ffmpeg-all.html 2.1 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487
  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 6.7, http://www.gnu.org/software/texinfo/ -->
  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 align="center">
  19. </div>
  20. <a name="SEC_Top"></a>
  21. <span id="SEC_Contents"></span>
  22. <h2 class="contents-heading">Table of Contents</h2>
  23. <div class="contents">
  24. <ul class="no-bullet">
  25. <li><a id="toc-Synopsis" href="#Synopsis">1 Synopsis</a></li>
  26. <li><a id="toc-Description" href="#Description">2 Description</a></li>
  27. <li><a id="toc-Detailed-description" href="#Detailed-description">3 Detailed description</a>
  28. <ul class="no-bullet">
  29. <li><a id="toc-Filtering" href="#Filtering">3.1 Filtering</a>
  30. <ul class="no-bullet">
  31. <li><a id="toc-Simple-filtergraphs" href="#Simple-filtergraphs">3.1.1 Simple filtergraphs</a></li>
  32. <li><a id="toc-Complex-filtergraphs" href="#Complex-filtergraphs">3.1.2 Complex filtergraphs</a></li>
  33. </ul></li>
  34. <li><a id="toc-Stream-copy" href="#Stream-copy">3.2 Stream copy</a></li>
  35. </ul></li>
  36. <li><a id="toc-Stream-selection" href="#Stream-selection">4 Stream selection</a>
  37. <ul class="no-bullet">
  38. <li><a id="toc-Description-1" href="#Description-1">4.1 Description</a>
  39. <ul class="no-bullet">
  40. <li><a id="toc-Automatic-stream-selection" href="#Automatic-stream-selection">4.1.1 Automatic stream selection</a></li>
  41. <li><a id="toc-Manual-stream-selection" href="#Manual-stream-selection">4.1.2 Manual stream selection</a></li>
  42. <li><a id="toc-Complex-filtergraphs-1" href="#Complex-filtergraphs-1">4.1.3 Complex filtergraphs</a></li>
  43. <li><a id="toc-Stream-handling" href="#Stream-handling">4.1.4 Stream handling</a></li>
  44. </ul></li>
  45. <li><a id="toc-Examples" href="#Examples">4.2 Examples</a></li>
  46. </ul></li>
  47. <li><a id="toc-Options" href="#Options">5 Options</a>
  48. <ul class="no-bullet">
  49. <li><a id="toc-Stream-specifiers-1" href="#Stream-specifiers-1">5.1 Stream specifiers</a></li>
  50. <li><a id="toc-Generic-options" href="#Generic-options">5.2 Generic options</a></li>
  51. <li><a id="toc-AVOptions" href="#AVOptions">5.3 AVOptions</a></li>
  52. <li><a id="toc-Main-options" href="#Main-options">5.4 Main options</a></li>
  53. <li><a id="toc-Video-Options" href="#Video-Options">5.5 Video Options</a></li>
  54. <li><a id="toc-Advanced-Video-options" href="#Advanced-Video-options">5.6 Advanced Video options</a></li>
  55. <li><a id="toc-Audio-Options" href="#Audio-Options">5.7 Audio Options</a></li>
  56. <li><a id="toc-Advanced-Audio-options" href="#Advanced-Audio-options">5.8 Advanced Audio options</a></li>
  57. <li><a id="toc-Subtitle-options" href="#Subtitle-options">5.9 Subtitle options</a></li>
  58. <li><a id="toc-Advanced-Subtitle-options" href="#Advanced-Subtitle-options">5.10 Advanced Subtitle options</a></li>
  59. <li><a id="toc-Advanced-options" href="#Advanced-options">5.11 Advanced options</a></li>
  60. <li><a id="toc-Preset-files" href="#Preset-files">5.12 Preset files</a>
  61. <ul class="no-bullet">
  62. <li><a id="toc-ffpreset-files" href="#ffpreset-files">5.12.1 ffpreset files</a></li>
  63. <li><a id="toc-avpreset-files" href="#avpreset-files">5.12.2 avpreset files</a></li>
  64. </ul></li>
  65. </ul></li>
  66. <li><a id="toc-Examples-1" href="#Examples-1">6 Examples</a>
  67. <ul class="no-bullet">
  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="no-bullet">
  74. <li><a id="toc-Quoting-and-escaping" href="#Quoting-and-escaping">7.1 Quoting and escaping</a>
  75. <ul class="no-bullet">
  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="no-bullet">
  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="no-bullet">
  94. <li><a id="toc-av1" href="#av1">11.1 av1</a>
  95. <ul class="no-bullet">
  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="no-bullet">
  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="no-bullet">
  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="no-bullet">
  109. <li><a id="toc-Options-4" href="#Options-4">11.5.1 Options</a></li>
  110. </ul></li>
  111. </ul></li>
  112. <li><a id="toc-Audio-Decoders" href="#Audio-Decoders">12 Audio Decoders</a>
  113. <ul class="no-bullet">
  114. <li><a id="toc-ac3" href="#ac3">12.1 ac3</a>
  115. <ul class="no-bullet">
  116. <li><a id="toc-AC_002d3-Decoder-Options" href="#AC_002d3-Decoder-Options">12.1.1 AC-3 Decoder Options</a></li>
  117. </ul></li>
  118. <li><a id="toc-flac-1" href="#flac-1">12.2 flac</a>
  119. <ul class="no-bullet">
  120. <li><a id="toc-FLAC-Decoder-options" href="#FLAC-Decoder-options">12.2.1 FLAC Decoder options</a></li>
  121. </ul></li>
  122. <li><a id="toc-ffwavesynth" href="#ffwavesynth">12.3 ffwavesynth</a></li>
  123. <li><a id="toc-libcelt" href="#libcelt">12.4 libcelt</a></li>
  124. <li><a id="toc-libgsm" href="#libgsm">12.5 libgsm</a></li>
  125. <li><a id="toc-libilbc" href="#libilbc">12.6 libilbc</a>
  126. <ul class="no-bullet">
  127. <li><a id="toc-Options-5" href="#Options-5">12.6.1 Options</a></li>
  128. </ul></li>
  129. <li><a id="toc-libopencore_002damrnb" href="#libopencore_002damrnb">12.7 libopencore-amrnb</a></li>
  130. <li><a id="toc-libopencore_002damrwb" href="#libopencore_002damrwb">12.8 libopencore-amrwb</a></li>
  131. <li><a id="toc-libopus" href="#libopus">12.9 libopus</a></li>
  132. </ul></li>
  133. <li><a id="toc-Subtitles-Decoders" href="#Subtitles-Decoders">13 Subtitles Decoders</a>
  134. <ul class="no-bullet">
  135. <li><a id="toc-libaribb24" href="#libaribb24">13.1 libaribb24</a>
  136. <ul class="no-bullet">
  137. <li><a id="toc-libaribb24-Decoder-Options" href="#libaribb24-Decoder-Options">13.1.1 libaribb24 Decoder Options</a></li>
  138. </ul></li>
  139. <li><a id="toc-dvbsub" href="#dvbsub">13.2 dvbsub</a>
  140. <ul class="no-bullet">
  141. <li><a id="toc-Options-6" href="#Options-6">13.2.1 Options</a></li>
  142. </ul></li>
  143. <li><a id="toc-dvdsub" href="#dvdsub">13.3 dvdsub</a>
  144. <ul class="no-bullet">
  145. <li><a id="toc-Options-7" href="#Options-7">13.3.1 Options</a></li>
  146. </ul></li>
  147. <li><a id="toc-libzvbi_002dteletext" href="#libzvbi_002dteletext">13.4 libzvbi-teletext</a>
  148. <ul class="no-bullet">
  149. <li><a id="toc-Options-8" href="#Options-8">13.4.1 Options</a></li>
  150. </ul></li>
  151. </ul></li>
  152. <li><a id="toc-Encoders" href="#Encoders">14 Encoders</a></li>
  153. <li><a id="toc-Audio-Encoders" href="#Audio-Encoders">15 Audio Encoders</a>
  154. <ul class="no-bullet">
  155. <li><a id="toc-aac" href="#aac">15.1 aac</a>
  156. <ul class="no-bullet">
  157. <li><a id="toc-Options-9" href="#Options-9">15.1.1 Options</a></li>
  158. </ul></li>
  159. <li><a id="toc-ac3-and-ac3_005ffixed" href="#ac3-and-ac3_005ffixed">15.2 ac3 and ac3_fixed</a>
  160. <ul class="no-bullet">
  161. <li><a id="toc-AC_002d3-Metadata" href="#AC_002d3-Metadata">15.2.1 AC-3 Metadata</a>
  162. <ul class="no-bullet">
  163. <li><a id="toc-Metadata-Control-Options" href="#Metadata-Control-Options">15.2.1.1 Metadata Control Options</a></li>
  164. <li><a id="toc-Downmix-Levels" href="#Downmix-Levels">15.2.1.2 Downmix Levels</a></li>
  165. <li><a id="toc-Audio-Production-Information" href="#Audio-Production-Information">15.2.1.3 Audio Production Information</a></li>
  166. <li><a id="toc-Other-Metadata-Options" href="#Other-Metadata-Options">15.2.1.4 Other Metadata Options</a></li>
  167. </ul></li>
  168. <li><a id="toc-Extended-Bitstream-Information" href="#Extended-Bitstream-Information">15.2.2 Extended Bitstream Information</a>
  169. <ul class="no-bullet">
  170. <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>
  171. <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>
  172. </ul></li>
  173. <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>
  174. <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>
  175. </ul></li>
  176. <li><a id="toc-flac-2" href="#flac-2">15.3 flac</a>
  177. <ul class="no-bullet">
  178. <li><a id="toc-Options-10" href="#Options-10">15.3.1 Options</a></li>
  179. </ul></li>
  180. <li><a id="toc-opus" href="#opus">15.4 opus</a>
  181. <ul class="no-bullet">
  182. <li><a id="toc-Options-11" href="#Options-11">15.4.1 Options</a></li>
  183. </ul></li>
  184. <li><a id="toc-libfdk_005faac" href="#libfdk_005faac">15.5 libfdk_aac</a>
  185. <ul class="no-bullet">
  186. <li><a id="toc-Options-12" href="#Options-12">15.5.1 Options</a></li>
  187. <li><a id="toc-Examples-4" href="#Examples-4">15.5.2 Examples</a></li>
  188. </ul></li>
  189. <li><a id="toc-libmp3lame-1" href="#libmp3lame-1">15.6 libmp3lame</a>
  190. <ul class="no-bullet">
  191. <li><a id="toc-Options-13" href="#Options-13">15.6.1 Options</a></li>
  192. </ul></li>
  193. <li><a id="toc-libopencore_002damrnb-1" href="#libopencore_002damrnb-1">15.7 libopencore-amrnb</a>
  194. <ul class="no-bullet">
  195. <li><a id="toc-Options-14" href="#Options-14">15.7.1 Options</a></li>
  196. </ul></li>
  197. <li><a id="toc-libopus-1" href="#libopus-1">15.8 libopus</a>
  198. <ul class="no-bullet">
  199. <li><a id="toc-Option-Mapping" href="#Option-Mapping">15.8.1 Option Mapping</a></li>
  200. </ul></li>
  201. <li><a id="toc-libshine-1" href="#libshine-1">15.9 libshine</a>
  202. <ul class="no-bullet">
  203. <li><a id="toc-Options-15" href="#Options-15">15.9.1 Options</a></li>
  204. </ul></li>
  205. <li><a id="toc-libtwolame" href="#libtwolame">15.10 libtwolame</a>
  206. <ul class="no-bullet">
  207. <li><a id="toc-Options-16" href="#Options-16">15.10.1 Options</a></li>
  208. </ul></li>
  209. <li><a id="toc-libvo_002damrwbenc" href="#libvo_002damrwbenc">15.11 libvo-amrwbenc</a>
  210. <ul class="no-bullet">
  211. <li><a id="toc-Options-17" href="#Options-17">15.11.1 Options</a></li>
  212. </ul></li>
  213. <li><a id="toc-libvorbis" href="#libvorbis">15.12 libvorbis</a>
  214. <ul class="no-bullet">
  215. <li><a id="toc-Options-18" href="#Options-18">15.12.1 Options</a></li>
  216. </ul></li>
  217. <li><a id="toc-mjpeg" href="#mjpeg">15.13 mjpeg</a>
  218. <ul class="no-bullet">
  219. <li><a id="toc-Options-19" href="#Options-19">15.13.1 Options</a></li>
  220. </ul></li>
  221. <li><a id="toc-wavpack" href="#wavpack">15.14 wavpack</a>
  222. <ul class="no-bullet">
  223. <li><a id="toc-Options-20" href="#Options-20">15.14.1 Options</a>
  224. <ul class="no-bullet">
  225. <li><a id="toc-Shared-options" href="#Shared-options">15.14.1.1 Shared options</a></li>
  226. <li><a id="toc-Private-options" href="#Private-options">15.14.1.2 Private options</a></li>
  227. </ul></li>
  228. </ul></li>
  229. </ul></li>
  230. <li><a id="toc-Video-Encoders" href="#Video-Encoders">16 Video Encoders</a>
  231. <ul class="no-bullet">
  232. <li><a id="toc-GIF" href="#GIF">16.1 GIF</a>
  233. <ul class="no-bullet">
  234. <li><a id="toc-Options-21" href="#Options-21">16.1.1 Options</a></li>
  235. </ul></li>
  236. <li><a id="toc-Hap" href="#Hap">16.2 Hap</a>
  237. <ul class="no-bullet">
  238. <li><a id="toc-Options-22" href="#Options-22">16.2.1 Options</a></li>
  239. </ul></li>
  240. <li><a id="toc-jpeg2000" href="#jpeg2000">16.3 jpeg2000</a>
  241. <ul class="no-bullet">
  242. <li><a id="toc-Options-23" href="#Options-23">16.3.1 Options</a></li>
  243. </ul></li>
  244. <li><a id="toc-librav1e" href="#librav1e">16.4 librav1e</a>
  245. <ul class="no-bullet">
  246. <li><a id="toc-Options-24" href="#Options-24">16.4.1 Options</a></li>
  247. </ul></li>
  248. <li><a id="toc-libaom_002dav1" href="#libaom_002dav1">16.5 libaom-av1</a>
  249. <ul class="no-bullet">
  250. <li><a id="toc-Options-25" href="#Options-25">16.5.1 Options</a></li>
  251. </ul></li>
  252. <li><a id="toc-libsvtav1" href="#libsvtav1">16.6 libsvtav1</a>
  253. <ul class="no-bullet">
  254. <li><a id="toc-Options-26" href="#Options-26">16.6.1 Options</a></li>
  255. </ul></li>
  256. <li><a id="toc-libkvazaar" href="#libkvazaar">16.7 libkvazaar</a>
  257. <ul class="no-bullet">
  258. <li><a id="toc-Options-27" href="#Options-27">16.7.1 Options</a></li>
  259. </ul></li>
  260. <li><a id="toc-libopenh264" href="#libopenh264">16.8 libopenh264</a>
  261. <ul class="no-bullet">
  262. <li><a id="toc-Options-28" href="#Options-28">16.8.1 Options</a></li>
  263. </ul></li>
  264. <li><a id="toc-libtheora" href="#libtheora">16.9 libtheora</a>
  265. <ul class="no-bullet">
  266. <li><a id="toc-Options-29" href="#Options-29">16.9.1 Options</a></li>
  267. <li><a id="toc-Examples-5" href="#Examples-5">16.9.2 Examples</a></li>
  268. </ul></li>
  269. <li><a id="toc-libvpx" href="#libvpx">16.10 libvpx</a>
  270. <ul class="no-bullet">
  271. <li><a id="toc-Options-30" href="#Options-30">16.10.1 Options</a></li>
  272. </ul></li>
  273. <li><a id="toc-libwebp" href="#libwebp">16.11 libwebp</a>
  274. <ul class="no-bullet">
  275. <li><a id="toc-Pixel-Format" href="#Pixel-Format">16.11.1 Pixel Format</a></li>
  276. <li><a id="toc-Options-31" href="#Options-31">16.11.2 Options</a></li>
  277. </ul></li>
  278. <li><a id="toc-libx264_002c-libx264rgb" href="#libx264_002c-libx264rgb">16.12 libx264, libx264rgb</a>
  279. <ul class="no-bullet">
  280. <li><a id="toc-Supported-Pixel-Formats" href="#Supported-Pixel-Formats">16.12.1 Supported Pixel Formats</a></li>
  281. <li><a id="toc-Options-32" href="#Options-32">16.12.2 Options</a></li>
  282. </ul></li>
  283. <li><a id="toc-libx265" href="#libx265">16.13 libx265</a>
  284. <ul class="no-bullet">
  285. <li><a id="toc-Options-33" href="#Options-33">16.13.1 Options</a></li>
  286. </ul></li>
  287. <li><a id="toc-libxavs2" href="#libxavs2">16.14 libxavs2</a>
  288. <ul class="no-bullet">
  289. <li><a id="toc-Options-34" href="#Options-34">16.14.1 Options</a></li>
  290. </ul></li>
  291. <li><a id="toc-libxvid" href="#libxvid">16.15 libxvid</a>
  292. <ul class="no-bullet">
  293. <li><a id="toc-Options-35" href="#Options-35">16.15.1 Options</a></li>
  294. </ul></li>
  295. <li><a id="toc-MediaFoundation" href="#MediaFoundation">16.16 MediaFoundation</a></li>
  296. <li><a id="toc-mpeg2" href="#mpeg2">16.17 mpeg2</a>
  297. <ul class="no-bullet">
  298. <li><a id="toc-Options-36" href="#Options-36">16.17.1 Options</a></li>
  299. </ul></li>
  300. <li><a id="toc-png" href="#png">16.18 png</a>
  301. <ul class="no-bullet">
  302. <li><a id="toc-Private-options-1" href="#Private-options-1">16.18.1 Private options</a></li>
  303. </ul></li>
  304. <li><a id="toc-ProRes" href="#ProRes">16.19 ProRes</a>
  305. <ul class="no-bullet">
  306. <li><a id="toc-Private-Options-for-prores_002dks" href="#Private-Options-for-prores_002dks">16.19.1 Private Options for prores-ks</a></li>
  307. <li><a id="toc-Speed-considerations" href="#Speed-considerations">16.19.2 Speed considerations</a></li>
  308. </ul></li>
  309. <li><a id="toc-QSV-encoders" href="#QSV-encoders">16.20 QSV encoders</a></li>
  310. <li><a id="toc-snow" href="#snow">16.21 snow</a>
  311. <ul class="no-bullet">
  312. <li><a id="toc-Options-37" href="#Options-37">16.21.1 Options</a></li>
  313. </ul></li>
  314. <li><a id="toc-VAAPI-encoders" href="#VAAPI-encoders">16.22 VAAPI encoders</a></li>
  315. <li><a id="toc-vc2" href="#vc2">16.23 vc2</a>
  316. <ul class="no-bullet">
  317. <li><a id="toc-Options-38" href="#Options-38">16.23.1 Options</a></li>
  318. </ul></li>
  319. </ul></li>
  320. <li><a id="toc-Subtitles-Encoders" href="#Subtitles-Encoders">17 Subtitles Encoders</a>
  321. <ul class="no-bullet">
  322. <li><a id="toc-dvdsub-1" href="#dvdsub-1">17.1 dvdsub</a>
  323. <ul class="no-bullet">
  324. <li><a id="toc-Options-39" href="#Options-39">17.1.1 Options</a></li>
  325. </ul></li>
  326. </ul></li>
  327. <li><a id="toc-Bitstream-Filters" href="#Bitstream-Filters">18 Bitstream Filters</a>
  328. <ul class="no-bullet">
  329. <li><a id="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">18.1 aac_adtstoasc</a></li>
  330. <li><a id="toc-av1_005fmetadata" href="#av1_005fmetadata">18.2 av1_metadata</a></li>
  331. <li><a id="toc-chomp" href="#chomp">18.3 chomp</a></li>
  332. <li><a id="toc-dca_005fcore" href="#dca_005fcore">18.4 dca_core</a></li>
  333. <li><a id="toc-dump_005fextra" href="#dump_005fextra">18.5 dump_extra</a></li>
  334. <li><a id="toc-eac3_005fcore" href="#eac3_005fcore">18.6 eac3_core</a></li>
  335. <li><a id="toc-extract_005fextradata" href="#extract_005fextradata">18.7 extract_extradata</a></li>
  336. <li><a id="toc-filter_005funits" href="#filter_005funits">18.8 filter_units</a></li>
  337. <li><a id="toc-hapqa_005fextract" href="#hapqa_005fextract">18.9 hapqa_extract</a></li>
  338. <li><a id="toc-h264_005fmetadata" href="#h264_005fmetadata">18.10 h264_metadata</a></li>
  339. <li><a id="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">18.11 h264_mp4toannexb</a></li>
  340. <li><a id="toc-h264_005fredundant_005fpps" href="#h264_005fredundant_005fpps">18.12 h264_redundant_pps</a></li>
  341. <li><a id="toc-hevc_005fmetadata" href="#hevc_005fmetadata">18.13 hevc_metadata</a></li>
  342. <li><a id="toc-hevc_005fmp4toannexb" href="#hevc_005fmp4toannexb">18.14 hevc_mp4toannexb</a></li>
  343. <li><a id="toc-imxdump" href="#imxdump">18.15 imxdump</a></li>
  344. <li><a id="toc-mjpeg2jpeg" href="#mjpeg2jpeg">18.16 mjpeg2jpeg</a></li>
  345. <li><a id="toc-mjpegadump" href="#mjpegadump">18.17 mjpegadump</a></li>
  346. <li><a id="toc-mov2textsub-1" href="#mov2textsub-1">18.18 mov2textsub</a></li>
  347. <li><a id="toc-mp3decomp" href="#mp3decomp">18.19 mp3decomp</a></li>
  348. <li><a id="toc-mpeg2_005fmetadata" href="#mpeg2_005fmetadata">18.20 mpeg2_metadata</a></li>
  349. <li><a id="toc-mpeg4_005funpack_005fbframes" href="#mpeg4_005funpack_005fbframes">18.21 mpeg4_unpack_bframes</a></li>
  350. <li><a id="toc-noise" href="#noise">18.22 noise</a></li>
  351. <li><a id="toc-null" href="#null">18.23 null</a></li>
  352. <li><a id="toc-pcm_005frechunk" href="#pcm_005frechunk">18.24 pcm_rechunk</a></li>
  353. <li><a id="toc-prores_005fmetadata" href="#prores_005fmetadata">18.25 prores_metadata</a></li>
  354. <li><a id="toc-remove_005fextra" href="#remove_005fextra">18.26 remove_extra</a></li>
  355. <li><a id="toc-setts" href="#setts">18.27 setts</a></li>
  356. <li><a id="toc-text2movsub-1" href="#text2movsub-1">18.28 text2movsub</a></li>
  357. <li><a id="toc-trace_005fheaders" href="#trace_005fheaders">18.29 trace_headers</a></li>
  358. <li><a id="toc-truehd_005fcore" href="#truehd_005fcore">18.30 truehd_core</a></li>
  359. <li><a id="toc-vp9_005fmetadata" href="#vp9_005fmetadata">18.31 vp9_metadata</a></li>
  360. <li><a id="toc-vp9_005fsuperframe" href="#vp9_005fsuperframe">18.32 vp9_superframe</a></li>
  361. <li><a id="toc-vp9_005fsuperframe_005fsplit" href="#vp9_005fsuperframe_005fsplit">18.33 vp9_superframe_split</a></li>
  362. <li><a id="toc-vp9_005fraw_005freorder" href="#vp9_005fraw_005freorder">18.34 vp9_raw_reorder</a></li>
  363. </ul></li>
  364. <li><a id="toc-Format-Options" href="#Format-Options">19 Format Options</a>
  365. <ul class="no-bullet">
  366. <li><a id="toc-Format-stream-specifiers-1" href="#Format-stream-specifiers-1">19.1 Format stream specifiers</a></li>
  367. </ul></li>
  368. <li><a id="toc-Demuxers" href="#Demuxers">20 Demuxers</a>
  369. <ul class="no-bullet">
  370. <li><a id="toc-aa" href="#aa">20.1 aa</a></li>
  371. <li><a id="toc-apng" href="#apng">20.2 apng</a></li>
  372. <li><a id="toc-asf-1" href="#asf-1">20.3 asf</a></li>
  373. <li><a id="toc-concat-1" href="#concat-1">20.4 concat</a>
  374. <ul class="no-bullet">
  375. <li><a id="toc-Syntax-1" href="#Syntax-1">20.4.1 Syntax</a></li>
  376. <li><a id="toc-Options-40" href="#Options-40">20.4.2 Options</a></li>
  377. <li><a id="toc-Examples-6" href="#Examples-6">20.4.3 Examples</a></li>
  378. </ul></li>
  379. <li><a id="toc-dash-1" href="#dash-1">20.5 dash</a></li>
  380. <li><a id="toc-flv_002c-live_005fflv" href="#flv_002c-live_005fflv">20.6 flv, live_flv</a></li>
  381. <li><a id="toc-gif-1" href="#gif-1">20.7 gif</a></li>
  382. <li><a id="toc-hls-1" href="#hls-1">20.8 hls</a></li>
  383. <li><a id="toc-image2-1" href="#image2-1">20.9 image2</a>
  384. <ul class="no-bullet">
  385. <li><a id="toc-Examples-7" href="#Examples-7">20.9.1 Examples</a></li>
  386. </ul></li>
  387. <li><a id="toc-libgme" href="#libgme">20.10 libgme</a></li>
  388. <li><a id="toc-libmodplug" href="#libmodplug">20.11 libmodplug</a></li>
  389. <li><a id="toc-libopenmpt" href="#libopenmpt">20.12 libopenmpt</a></li>
  390. <li><a id="toc-mov_002fmp4_002f3gp" href="#mov_002fmp4_002f3gp">20.13 mov/mp4/3gp</a>
  391. <ul class="no-bullet">
  392. <li><a id="toc-Options-41" href="#Options-41">20.13.1 Options</a></li>
  393. <li><a id="toc-Audible-AAX" href="#Audible-AAX">20.13.2 Audible AAX</a></li>
  394. </ul></li>
  395. <li><a id="toc-mpegts" href="#mpegts">20.14 mpegts</a></li>
  396. <li><a id="toc-mpjpeg" href="#mpjpeg">20.15 mpjpeg</a></li>
  397. <li><a id="toc-rawvideo-1" href="#rawvideo-1">20.16 rawvideo</a></li>
  398. <li><a id="toc-sbg" href="#sbg">20.17 sbg</a></li>
  399. <li><a id="toc-tedcaptions" href="#tedcaptions">20.18 tedcaptions</a></li>
  400. <li><a id="toc-vapoursynth" href="#vapoursynth">20.19 vapoursynth</a></li>
  401. </ul></li>
  402. <li><a id="toc-Muxers" href="#Muxers">21 Muxers</a>
  403. <ul class="no-bullet">
  404. <li><a id="toc-aiff-1" href="#aiff-1">21.1 aiff</a>
  405. <ul class="no-bullet">
  406. <li><a id="toc-Options-42" href="#Options-42">21.1.1 Options</a></li>
  407. </ul></li>
  408. <li><a id="toc-asf-2" href="#asf-2">21.2 asf</a>
  409. <ul class="no-bullet">
  410. <li><a id="toc-Options-43" href="#Options-43">21.2.1 Options</a></li>
  411. </ul></li>
  412. <li><a id="toc-avi-1" href="#avi-1">21.3 avi</a>
  413. <ul class="no-bullet">
  414. <li><a id="toc-Options-44" href="#Options-44">21.3.1 Options</a></li>
  415. </ul></li>
  416. <li><a id="toc-chromaprint-1" href="#chromaprint-1">21.4 chromaprint</a>
  417. <ul class="no-bullet">
  418. <li><a id="toc-Options-45" href="#Options-45">21.4.1 Options</a></li>
  419. </ul></li>
  420. <li><a id="toc-crc-1" href="#crc-1">21.5 crc</a>
  421. <ul class="no-bullet">
  422. <li><a id="toc-Examples-8" href="#Examples-8">21.5.1 Examples</a></li>
  423. </ul></li>
  424. <li><a id="toc-flv" href="#flv">21.6 flv</a></li>
  425. <li><a id="toc-dash-2" href="#dash-2">21.7 dash</a></li>
  426. <li><a id="toc-framecrc-1" href="#framecrc-1">21.8 framecrc</a>
  427. <ul class="no-bullet">
  428. <li><a id="toc-Examples-9" href="#Examples-9">21.8.1 Examples</a></li>
  429. </ul></li>
  430. <li><a id="toc-framehash-1" href="#framehash-1">21.9 framehash</a>
  431. <ul class="no-bullet">
  432. <li><a id="toc-Examples-10" href="#Examples-10">21.9.1 Examples</a></li>
  433. </ul></li>
  434. <li><a id="toc-framemd5-1" href="#framemd5-1">21.10 framemd5</a>
  435. <ul class="no-bullet">
  436. <li><a id="toc-Examples-11" href="#Examples-11">21.10.1 Examples</a></li>
  437. </ul></li>
  438. <li><a id="toc-gif-2" href="#gif-2">21.11 gif</a></li>
  439. <li><a id="toc-hash-1" href="#hash-1">21.12 hash</a>
  440. <ul class="no-bullet">
  441. <li><a id="toc-Examples-12" href="#Examples-12">21.12.1 Examples</a></li>
  442. </ul></li>
  443. <li><a id="toc-hls-2" href="#hls-2">21.13 hls</a>
  444. <ul class="no-bullet">
  445. <li><a id="toc-Options-46" href="#Options-46">21.13.1 Options</a></li>
  446. </ul></li>
  447. <li><a id="toc-ico-1" href="#ico-1">21.14 ico</a></li>
  448. <li><a id="toc-image2-2" href="#image2-2">21.15 image2</a>
  449. <ul class="no-bullet">
  450. <li><a id="toc-Options-47" href="#Options-47">21.15.1 Options</a></li>
  451. <li><a id="toc-Examples-13" href="#Examples-13">21.15.2 Examples</a></li>
  452. </ul></li>
  453. <li><a id="toc-matroska" href="#matroska">21.16 matroska</a>
  454. <ul class="no-bullet">
  455. <li><a id="toc-Metadata" href="#Metadata">21.16.1 Metadata</a></li>
  456. <li><a id="toc-Options-48" href="#Options-48">21.16.2 Options</a></li>
  457. </ul></li>
  458. <li><a id="toc-md5-1" href="#md5-1">21.17 md5</a>
  459. <ul class="no-bullet">
  460. <li><a id="toc-Examples-14" href="#Examples-14">21.17.1 Examples</a></li>
  461. </ul></li>
  462. <li><a id="toc-mov_002c-mp4_002c-ismv" href="#mov_002c-mp4_002c-ismv">21.18 mov, mp4, ismv</a>
  463. <ul class="no-bullet">
  464. <li><a id="toc-Options-49" href="#Options-49">21.18.1 Options</a></li>
  465. <li><a id="toc-Example" href="#Example">21.18.2 Example</a></li>
  466. </ul></li>
  467. <li><a id="toc-mp3" href="#mp3">21.19 mp3</a></li>
  468. <li><a id="toc-mpegts-1" href="#mpegts-1">21.20 mpegts</a>
  469. <ul class="no-bullet">
  470. <li><a id="toc-Options-50" href="#Options-50">21.20.1 Options</a></li>
  471. <li><a id="toc-Example-1" href="#Example-1">21.20.2 Example</a></li>
  472. </ul></li>
  473. <li><a id="toc-mxf_002c-mxf_005fd10_002c-mxf_005fopatom" href="#mxf_002c-mxf_005fd10_002c-mxf_005fopatom">21.21 mxf, mxf_d10, mxf_opatom</a>
  474. <ul class="no-bullet">
  475. <li><a id="toc-Options-51" href="#Options-51">21.21.1 Options</a></li>
  476. </ul></li>
  477. <li><a id="toc-null-1" href="#null-1">21.22 null</a></li>
  478. <li><a id="toc-nut" href="#nut">21.23 nut</a></li>
  479. <li><a id="toc-ogg" href="#ogg">21.24 ogg</a></li>
  480. <li><a id="toc-segment_002c-stream_005fsegment_002c-ssegment" href="#segment_002c-stream_005fsegment_002c-ssegment">21.25 segment, stream_segment, ssegment</a>
  481. <ul class="no-bullet">
  482. <li><a id="toc-Options-52" href="#Options-52">21.25.1 Options</a></li>
  483. <li><a id="toc-Examples-15" href="#Examples-15">21.25.2 Examples</a></li>
  484. </ul></li>
  485. <li><a id="toc-smoothstreaming" href="#smoothstreaming">21.26 smoothstreaming</a></li>
  486. <li><a id="toc-streamhash-1" href="#streamhash-1">21.27 streamhash</a>
  487. <ul class="no-bullet">
  488. <li><a id="toc-Examples-16" href="#Examples-16">21.27.1 Examples</a></li>
  489. </ul></li>
  490. <li><a id="toc-fifo-1" href="#fifo-1">21.28 fifo</a>
  491. <ul class="no-bullet">
  492. <li><a id="toc-Examples-17" href="#Examples-17">21.28.1 Examples</a></li>
  493. </ul></li>
  494. <li><a id="toc-tee-1" href="#tee-1">21.29 tee</a>
  495. <ul class="no-bullet">
  496. <li><a id="toc-Options-53" href="#Options-53">21.29.1 Options</a></li>
  497. <li><a id="toc-Examples-18" href="#Examples-18">21.29.2 Examples</a></li>
  498. </ul></li>
  499. <li><a id="toc-webm_005fdash_005fmanifest" href="#webm_005fdash_005fmanifest">21.30 webm_dash_manifest</a>
  500. <ul class="no-bullet">
  501. <li><a id="toc-Options-54" href="#Options-54">21.30.1 Options</a></li>
  502. <li><a id="toc-Example-2" href="#Example-2">21.30.2 Example</a></li>
  503. </ul></li>
  504. <li><a id="toc-webm_005fchunk" href="#webm_005fchunk">21.31 webm_chunk</a>
  505. <ul class="no-bullet">
  506. <li><a id="toc-Options-55" href="#Options-55">21.31.1 Options</a></li>
  507. <li><a id="toc-Example-3" href="#Example-3">21.31.2 Example</a></li>
  508. </ul></li>
  509. </ul></li>
  510. <li><a id="toc-Metadata-1" href="#Metadata-1">22 Metadata</a></li>
  511. <li><a id="toc-Protocol-Options" href="#Protocol-Options">23 Protocol Options</a></li>
  512. <li><a id="toc-Protocols" href="#Protocols">24 Protocols</a>
  513. <ul class="no-bullet">
  514. <li><a id="toc-amqp" href="#amqp">24.1 amqp</a></li>
  515. <li><a id="toc-async" href="#async">24.2 async</a></li>
  516. <li><a id="toc-bluray" href="#bluray">24.3 bluray</a></li>
  517. <li><a id="toc-cache" href="#cache">24.4 cache</a></li>
  518. <li><a id="toc-concat-2" href="#concat-2">24.5 concat</a></li>
  519. <li><a id="toc-crypto" href="#crypto">24.6 crypto</a></li>
  520. <li><a id="toc-data" href="#data">24.7 data</a></li>
  521. <li><a id="toc-file" href="#file">24.8 file</a></li>
  522. <li><a id="toc-ftp" href="#ftp">24.9 ftp</a></li>
  523. <li><a id="toc-gopher" href="#gopher">24.10 gopher</a></li>
  524. <li><a id="toc-gophers" href="#gophers">24.11 gophers</a></li>
  525. <li><a id="toc-hls-3" href="#hls-3">24.12 hls</a></li>
  526. <li><a id="toc-http" href="#http">24.13 http</a>
  527. <ul class="no-bullet">
  528. <li><a id="toc-HTTP-Cookies" href="#HTTP-Cookies">24.13.1 HTTP Cookies</a></li>
  529. </ul></li>
  530. <li><a id="toc-Icecast" href="#Icecast">24.14 Icecast</a></li>
  531. <li><a id="toc-mmst" href="#mmst">24.15 mmst</a></li>
  532. <li><a id="toc-mmsh" href="#mmsh">24.16 mmsh</a></li>
  533. <li><a id="toc-md5-2" href="#md5-2">24.17 md5</a></li>
  534. <li><a id="toc-pipe" href="#pipe">24.18 pipe</a></li>
  535. <li><a id="toc-prompeg" href="#prompeg">24.19 prompeg</a></li>
  536. <li><a id="toc-rist" href="#rist">24.20 rist</a></li>
  537. <li><a id="toc-rtmp" href="#rtmp">24.21 rtmp</a></li>
  538. <li><a id="toc-rtmpe" href="#rtmpe">24.22 rtmpe</a></li>
  539. <li><a id="toc-rtmps" href="#rtmps">24.23 rtmps</a></li>
  540. <li><a id="toc-rtmpt" href="#rtmpt">24.24 rtmpt</a></li>
  541. <li><a id="toc-rtmpte" href="#rtmpte">24.25 rtmpte</a></li>
  542. <li><a id="toc-rtmpts" href="#rtmpts">24.26 rtmpts</a></li>
  543. <li><a id="toc-libsmbclient" href="#libsmbclient">24.27 libsmbclient</a></li>
  544. <li><a id="toc-libssh" href="#libssh">24.28 libssh</a></li>
  545. <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.29 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
  546. <li><a id="toc-rtp" href="#rtp">24.30 rtp</a></li>
  547. <li><a id="toc-rtsp" href="#rtsp">24.31 rtsp</a>
  548. <ul class="no-bullet">
  549. <li><a id="toc-Examples-19" href="#Examples-19">24.31.1 Examples</a></li>
  550. </ul></li>
  551. <li><a id="toc-sap" href="#sap">24.32 sap</a>
  552. <ul class="no-bullet">
  553. <li><a id="toc-Muxer" href="#Muxer">24.32.1 Muxer</a></li>
  554. <li><a id="toc-Demuxer" href="#Demuxer">24.32.2 Demuxer</a></li>
  555. </ul></li>
  556. <li><a id="toc-sctp" href="#sctp">24.33 sctp</a></li>
  557. <li><a id="toc-srt" href="#srt">24.34 srt</a></li>
  558. <li><a id="toc-srtp" href="#srtp">24.35 srtp</a></li>
  559. <li><a id="toc-subfile" href="#subfile">24.36 subfile</a></li>
  560. <li><a id="toc-tee-2" href="#tee-2">24.37 tee</a></li>
  561. <li><a id="toc-tcp" href="#tcp">24.38 tcp</a></li>
  562. <li><a id="toc-tls" href="#tls">24.39 tls</a></li>
  563. <li><a id="toc-udp" href="#udp">24.40 udp</a>
  564. <ul class="no-bullet">
  565. <li><a id="toc-Examples-20" href="#Examples-20">24.40.1 Examples</a></li>
  566. </ul></li>
  567. <li><a id="toc-unix" href="#unix">24.41 unix</a></li>
  568. <li><a id="toc-zmq" href="#zmq">24.42 zmq</a></li>
  569. </ul></li>
  570. <li><a id="toc-Device-Options" href="#Device-Options">25 Device Options</a></li>
  571. <li><a id="toc-Input-Devices" href="#Input-Devices">26 Input Devices</a>
  572. <ul class="no-bullet">
  573. <li><a id="toc-alsa" href="#alsa">26.1 alsa</a>
  574. <ul class="no-bullet">
  575. <li><a id="toc-Options-56" href="#Options-56">26.1.1 Options</a></li>
  576. </ul></li>
  577. <li><a id="toc-android_005fcamera" href="#android_005fcamera">26.2 android_camera</a>
  578. <ul class="no-bullet">
  579. <li><a id="toc-Options-57" href="#Options-57">26.2.1 Options</a></li>
  580. </ul></li>
  581. <li><a id="toc-avfoundation" href="#avfoundation">26.3 avfoundation</a>
  582. <ul class="no-bullet">
  583. <li><a id="toc-Options-58" href="#Options-58">26.3.1 Options</a></li>
  584. <li><a id="toc-Examples-21" href="#Examples-21">26.3.2 Examples</a></li>
  585. </ul></li>
  586. <li><a id="toc-bktr" href="#bktr">26.4 bktr</a>
  587. <ul class="no-bullet">
  588. <li><a id="toc-Options-59" href="#Options-59">26.4.1 Options</a></li>
  589. </ul></li>
  590. <li><a id="toc-decklink" href="#decklink">26.5 decklink</a>
  591. <ul class="no-bullet">
  592. <li><a id="toc-Options-60" href="#Options-60">26.5.1 Options</a></li>
  593. <li><a id="toc-Examples-22" href="#Examples-22">26.5.2 Examples</a></li>
  594. </ul></li>
  595. <li><a id="toc-dshow" href="#dshow">26.6 dshow</a>
  596. <ul class="no-bullet">
  597. <li><a id="toc-Options-61" href="#Options-61">26.6.1 Options</a></li>
  598. <li><a id="toc-Examples-23" href="#Examples-23">26.6.2 Examples</a></li>
  599. </ul></li>
  600. <li><a id="toc-fbdev" href="#fbdev">26.7 fbdev</a>
  601. <ul class="no-bullet">
  602. <li><a id="toc-Options-62" href="#Options-62">26.7.1 Options</a></li>
  603. </ul></li>
  604. <li><a id="toc-gdigrab" href="#gdigrab">26.8 gdigrab</a>
  605. <ul class="no-bullet">
  606. <li><a id="toc-Options-63" href="#Options-63">26.8.1 Options</a></li>
  607. </ul></li>
  608. <li><a id="toc-iec61883" href="#iec61883">26.9 iec61883</a>
  609. <ul class="no-bullet">
  610. <li><a id="toc-Options-64" href="#Options-64">26.9.1 Options</a></li>
  611. <li><a id="toc-Examples-24" href="#Examples-24">26.9.2 Examples</a></li>
  612. </ul></li>
  613. <li><a id="toc-jack" href="#jack">26.10 jack</a>
  614. <ul class="no-bullet">
  615. <li><a id="toc-Options-65" href="#Options-65">26.10.1 Options</a></li>
  616. </ul></li>
  617. <li><a id="toc-kmsgrab" href="#kmsgrab">26.11 kmsgrab</a>
  618. <ul class="no-bullet">
  619. <li><a id="toc-Options-66" href="#Options-66">26.11.1 Options</a></li>
  620. <li><a id="toc-Examples-25" href="#Examples-25">26.11.2 Examples</a></li>
  621. </ul></li>
  622. <li><a id="toc-lavfi" href="#lavfi">26.12 lavfi</a>
  623. <ul class="no-bullet">
  624. <li><a id="toc-Options-67" href="#Options-67">26.12.1 Options</a></li>
  625. <li><a id="toc-Examples-26" href="#Examples-26">26.12.2 Examples</a></li>
  626. </ul></li>
  627. <li><a id="toc-libcdio" href="#libcdio">26.13 libcdio</a>
  628. <ul class="no-bullet">
  629. <li><a id="toc-Options-68" href="#Options-68">26.13.1 Options</a></li>
  630. </ul></li>
  631. <li><a id="toc-libdc1394" href="#libdc1394">26.14 libdc1394</a>
  632. <ul class="no-bullet">
  633. <li><a id="toc-Options-69" href="#Options-69">26.14.1 Options</a></li>
  634. </ul></li>
  635. <li><a id="toc-openal" href="#openal">26.15 openal</a>
  636. <ul class="no-bullet">
  637. <li><a id="toc-Options-70" href="#Options-70">26.15.1 Options</a></li>
  638. <li><a id="toc-Examples-27" href="#Examples-27">26.15.2 Examples</a></li>
  639. </ul></li>
  640. <li><a id="toc-oss" href="#oss">26.16 oss</a>
  641. <ul class="no-bullet">
  642. <li><a id="toc-Options-71" href="#Options-71">26.16.1 Options</a></li>
  643. </ul></li>
  644. <li><a id="toc-pulse" href="#pulse">26.17 pulse</a>
  645. <ul class="no-bullet">
  646. <li><a id="toc-Options-72" href="#Options-72">26.17.1 Options</a></li>
  647. <li><a id="toc-Examples-28" href="#Examples-28">26.17.2 Examples</a></li>
  648. </ul></li>
  649. <li><a id="toc-sndio" href="#sndio">26.18 sndio</a>
  650. <ul class="no-bullet">
  651. <li><a id="toc-Options-73" href="#Options-73">26.18.1 Options</a></li>
  652. </ul></li>
  653. <li><a id="toc-video4linux2_002c-v4l2" href="#video4linux2_002c-v4l2">26.19 video4linux2, v4l2</a>
  654. <ul class="no-bullet">
  655. <li><a id="toc-Options-74" href="#Options-74">26.19.1 Options</a></li>
  656. </ul></li>
  657. <li><a id="toc-vfwcap" href="#vfwcap">26.20 vfwcap</a>
  658. <ul class="no-bullet">
  659. <li><a id="toc-Options-75" href="#Options-75">26.20.1 Options</a></li>
  660. </ul></li>
  661. <li><a id="toc-x11grab" href="#x11grab">26.21 x11grab</a>
  662. <ul class="no-bullet">
  663. <li><a id="toc-Options-76" href="#Options-76">26.21.1 Options</a></li>
  664. </ul></li>
  665. </ul></li>
  666. <li><a id="toc-Output-Devices" href="#Output-Devices">27 Output Devices</a>
  667. <ul class="no-bullet">
  668. <li><a id="toc-alsa-1" href="#alsa-1">27.1 alsa</a>
  669. <ul class="no-bullet">
  670. <li><a id="toc-Examples-29" href="#Examples-29">27.1.1 Examples</a></li>
  671. </ul></li>
  672. <li><a id="toc-AudioToolbox" href="#AudioToolbox">27.2 AudioToolbox</a>
  673. <ul class="no-bullet">
  674. <li><a id="toc-Options-77" href="#Options-77">27.2.1 Options</a></li>
  675. <li><a id="toc-Examples-30" href="#Examples-30">27.2.2 Examples</a></li>
  676. </ul></li>
  677. <li><a id="toc-caca" href="#caca">27.3 caca</a>
  678. <ul class="no-bullet">
  679. <li><a id="toc-Options-78" href="#Options-78">27.3.1 Options</a></li>
  680. <li><a id="toc-Examples-31" href="#Examples-31">27.3.2 Examples</a></li>
  681. </ul></li>
  682. <li><a id="toc-decklink-1" href="#decklink-1">27.4 decklink</a>
  683. <ul class="no-bullet">
  684. <li><a id="toc-Options-79" href="#Options-79">27.4.1 Options</a></li>
  685. <li><a id="toc-Examples-32" href="#Examples-32">27.4.2 Examples</a></li>
  686. </ul></li>
  687. <li><a id="toc-fbdev-1" href="#fbdev-1">27.5 fbdev</a>
  688. <ul class="no-bullet">
  689. <li><a id="toc-Options-80" href="#Options-80">27.5.1 Options</a></li>
  690. <li><a id="toc-Examples-33" href="#Examples-33">27.5.2 Examples</a></li>
  691. </ul></li>
  692. <li><a id="toc-opengl" href="#opengl">27.6 opengl</a>
  693. <ul class="no-bullet">
  694. <li><a id="toc-Options-81" href="#Options-81">27.6.1 Options</a></li>
  695. <li><a id="toc-Examples-34" href="#Examples-34">27.6.2 Examples</a></li>
  696. </ul></li>
  697. <li><a id="toc-oss-1" href="#oss-1">27.7 oss</a></li>
  698. <li><a id="toc-pulse-1" href="#pulse-1">27.8 pulse</a>
  699. <ul class="no-bullet">
  700. <li><a id="toc-Options-82" href="#Options-82">27.8.1 Options</a></li>
  701. <li><a id="toc-Examples-35" href="#Examples-35">27.8.2 Examples</a></li>
  702. </ul></li>
  703. <li><a id="toc-sdl" href="#sdl">27.9 sdl</a>
  704. <ul class="no-bullet">
  705. <li><a id="toc-Options-83" href="#Options-83">27.9.1 Options</a></li>
  706. <li><a id="toc-Interactive-commands" href="#Interactive-commands">27.9.2 Interactive commands</a></li>
  707. <li><a id="toc-Examples-36" href="#Examples-36">27.9.3 Examples</a></li>
  708. </ul></li>
  709. <li><a id="toc-sndio-1" href="#sndio-1">27.10 sndio</a></li>
  710. <li><a id="toc-v4l2" href="#v4l2">27.11 v4l2</a></li>
  711. <li><a id="toc-xv" href="#xv">27.12 xv</a>
  712. <ul class="no-bullet">
  713. <li><a id="toc-Options-84" href="#Options-84">27.12.1 Options</a></li>
  714. <li><a id="toc-Examples-37" href="#Examples-37">27.12.2 Examples</a></li>
  715. </ul></li>
  716. </ul></li>
  717. <li><a id="toc-Resampler-Options" href="#Resampler-Options">28 Resampler Options</a></li>
  718. <li><a id="toc-Scaler-Options" href="#Scaler-Options">29 Scaler Options</a></li>
  719. <li><a id="toc-Filtering-Introduction" href="#Filtering-Introduction">30 Filtering Introduction</a></li>
  720. <li><a id="toc-graph2dot" href="#graph2dot">31 graph2dot</a></li>
  721. <li><a id="toc-Filtergraph-description" href="#Filtergraph-description">32 Filtergraph description</a>
  722. <ul class="no-bullet">
  723. <li><a id="toc-Filtergraph-syntax-1" href="#Filtergraph-syntax-1">32.1 Filtergraph syntax</a></li>
  724. <li><a id="toc-Notes-on-filtergraph-escaping" href="#Notes-on-filtergraph-escaping">32.2 Notes on filtergraph escaping</a></li>
  725. </ul></li>
  726. <li><a id="toc-Timeline-editing" href="#Timeline-editing">33 Timeline editing</a></li>
  727. <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>
  728. <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>
  729. <li><a id="toc-Audio-Filters" href="#Audio-Filters">36 Audio Filters</a>
  730. <ul class="no-bullet">
  731. <li><a id="toc-acompressor" href="#acompressor">36.1 acompressor</a>
  732. <ul class="no-bullet">
  733. <li><a id="toc-Commands" href="#Commands">36.1.1 Commands</a></li>
  734. </ul></li>
  735. <li><a id="toc-acontrast" href="#acontrast">36.2 acontrast</a></li>
  736. <li><a id="toc-acopy" href="#acopy">36.3 acopy</a></li>
  737. <li><a id="toc-acrossfade" href="#acrossfade">36.4 acrossfade</a>
  738. <ul class="no-bullet">
  739. <li><a id="toc-Examples-38" href="#Examples-38">36.4.1 Examples</a></li>
  740. </ul></li>
  741. <li><a id="toc-acrossover" href="#acrossover">36.5 acrossover</a>
  742. <ul class="no-bullet">
  743. <li><a id="toc-Examples-39" href="#Examples-39">36.5.1 Examples</a></li>
  744. </ul></li>
  745. <li><a id="toc-acrusher" href="#acrusher">36.6 acrusher</a>
  746. <ul class="no-bullet">
  747. <li><a id="toc-Commands-1" href="#Commands-1">36.6.1 Commands</a></li>
  748. </ul></li>
  749. <li><a id="toc-acue" href="#acue">36.7 acue</a></li>
  750. <li><a id="toc-adeclick" href="#adeclick">36.8 adeclick</a></li>
  751. <li><a id="toc-adeclip" href="#adeclip">36.9 adeclip</a></li>
  752. <li><a id="toc-adelay" href="#adelay">36.10 adelay</a>
  753. <ul class="no-bullet">
  754. <li><a id="toc-Examples-40" href="#Examples-40">36.10.1 Examples</a></li>
  755. </ul></li>
  756. <li><a id="toc-adenorm" href="#adenorm">36.11 adenorm</a>
  757. <ul class="no-bullet">
  758. <li><a id="toc-Commands-2" href="#Commands-2">36.11.1 Commands</a></li>
  759. </ul></li>
  760. <li><a id="toc-aderivative_002c-aintegral" href="#aderivative_002c-aintegral">36.12 aderivative, aintegral</a></li>
  761. <li><a id="toc-aecho" href="#aecho">36.13 aecho</a>
  762. <ul class="no-bullet">
  763. <li><a id="toc-Examples-41" href="#Examples-41">36.13.1 Examples</a></li>
  764. </ul></li>
  765. <li><a id="toc-aemphasis" href="#aemphasis">36.14 aemphasis</a>
  766. <ul class="no-bullet">
  767. <li><a id="toc-Commands-3" href="#Commands-3">36.14.1 Commands</a></li>
  768. </ul></li>
  769. <li><a id="toc-aeval" href="#aeval">36.15 aeval</a>
  770. <ul class="no-bullet">
  771. <li><a id="toc-Examples-42" href="#Examples-42">36.15.1 Examples</a></li>
  772. </ul></li>
  773. <li><a id="toc-aexciter" href="#aexciter">36.16 aexciter</a>
  774. <ul class="no-bullet">
  775. <li><a id="toc-Commands-4" href="#Commands-4">36.16.1 Commands</a></li>
  776. </ul></li>
  777. <li><a id="toc-afade-1" href="#afade-1">36.17 afade</a>
  778. <ul class="no-bullet">
  779. <li><a id="toc-Commands-5" href="#Commands-5">36.17.1 Commands</a></li>
  780. <li><a id="toc-Examples-43" href="#Examples-43">36.17.2 Examples</a></li>
  781. </ul></li>
  782. <li><a id="toc-afftdn" href="#afftdn">36.18 afftdn</a>
  783. <ul class="no-bullet">
  784. <li><a id="toc-Commands-6" href="#Commands-6">36.18.1 Commands</a></li>
  785. </ul></li>
  786. <li><a id="toc-afftfilt" href="#afftfilt">36.19 afftfilt</a>
  787. <ul class="no-bullet">
  788. <li><a id="toc-Examples-44" href="#Examples-44">36.19.1 Examples</a></li>
  789. </ul></li>
  790. <li><a id="toc-afir-1" href="#afir-1">36.20 afir</a>
  791. <ul class="no-bullet">
  792. <li><a id="toc-Examples-45" href="#Examples-45">36.20.1 Examples</a></li>
  793. </ul></li>
  794. <li><a id="toc-aformat-1" href="#aformat-1">36.21 aformat</a></li>
  795. <li><a id="toc-afreqshift" href="#afreqshift">36.22 afreqshift</a>
  796. <ul class="no-bullet">
  797. <li><a id="toc-Commands-7" href="#Commands-7">36.22.1 Commands</a></li>
  798. </ul></li>
  799. <li><a id="toc-agate" href="#agate">36.23 agate</a>
  800. <ul class="no-bullet">
  801. <li><a id="toc-Commands-8" href="#Commands-8">36.23.1 Commands</a></li>
  802. </ul></li>
  803. <li><a id="toc-aiir" href="#aiir">36.24 aiir</a>
  804. <ul class="no-bullet">
  805. <li><a id="toc-Examples-46" href="#Examples-46">36.24.1 Examples</a></li>
  806. </ul></li>
  807. <li><a id="toc-alimiter" href="#alimiter">36.25 alimiter</a></li>
  808. <li><a id="toc-allpass" href="#allpass">36.26 allpass</a>
  809. <ul class="no-bullet">
  810. <li><a id="toc-Commands-9" href="#Commands-9">36.26.1 Commands</a></li>
  811. </ul></li>
  812. <li><a id="toc-aloop" href="#aloop">36.27 aloop</a></li>
  813. <li><a id="toc-amerge-1" href="#amerge-1">36.28 amerge</a>
  814. <ul class="no-bullet">
  815. <li><a id="toc-Examples-47" href="#Examples-47">36.28.1 Examples</a></li>
  816. </ul></li>
  817. <li><a id="toc-amix" href="#amix">36.29 amix</a>
  818. <ul class="no-bullet">
  819. <li><a id="toc-Commands-10" href="#Commands-10">36.29.1 Commands</a></li>
  820. </ul></li>
  821. <li><a id="toc-amultiply" href="#amultiply">36.30 amultiply</a></li>
  822. <li><a id="toc-anequalizer" href="#anequalizer">36.31 anequalizer</a>
  823. <ul class="no-bullet">
  824. <li><a id="toc-Examples-48" href="#Examples-48">36.31.1 Examples</a></li>
  825. <li><a id="toc-Commands-11" href="#Commands-11">36.31.2 Commands</a></li>
  826. </ul></li>
  827. <li><a id="toc-anlmdn" href="#anlmdn">36.32 anlmdn</a>
  828. <ul class="no-bullet">
  829. <li><a id="toc-Commands-12" href="#Commands-12">36.32.1 Commands</a></li>
  830. </ul></li>
  831. <li><a id="toc-anlms" href="#anlms">36.33 anlms</a>
  832. <ul class="no-bullet">
  833. <li><a id="toc-Examples-49" href="#Examples-49">36.33.1 Examples</a></li>
  834. <li><a id="toc-Commands-13" href="#Commands-13">36.33.2 Commands</a></li>
  835. </ul></li>
  836. <li><a id="toc-anull" href="#anull">36.34 anull</a></li>
  837. <li><a id="toc-apad" href="#apad">36.35 apad</a>
  838. <ul class="no-bullet">
  839. <li><a id="toc-Examples-50" href="#Examples-50">36.35.1 Examples</a></li>
  840. </ul></li>
  841. <li><a id="toc-aphaser" href="#aphaser">36.36 aphaser</a></li>
  842. <li><a id="toc-aphaseshift" href="#aphaseshift">36.37 aphaseshift</a>
  843. <ul class="no-bullet">
  844. <li><a id="toc-Commands-14" href="#Commands-14">36.37.1 Commands</a></li>
  845. </ul></li>
  846. <li><a id="toc-apulsator" href="#apulsator">36.38 apulsator</a></li>
  847. <li><a id="toc-aresample-1" href="#aresample-1">36.39 aresample</a>
  848. <ul class="no-bullet">
  849. <li><a id="toc-Examples-51" href="#Examples-51">36.39.1 Examples</a></li>
  850. </ul></li>
  851. <li><a id="toc-areverse" href="#areverse">36.40 areverse</a>
  852. <ul class="no-bullet">
  853. <li><a id="toc-Examples-52" href="#Examples-52">36.40.1 Examples</a></li>
  854. </ul></li>
  855. <li><a id="toc-arnndn" href="#arnndn">36.41 arnndn</a>
  856. <ul class="no-bullet">
  857. <li><a id="toc-Commands-15" href="#Commands-15">36.41.1 Commands</a></li>
  858. </ul></li>
  859. <li><a id="toc-asetnsamples" href="#asetnsamples">36.42 asetnsamples</a></li>
  860. <li><a id="toc-asetrate" href="#asetrate">36.43 asetrate</a></li>
  861. <li><a id="toc-ashowinfo" href="#ashowinfo">36.44 ashowinfo</a></li>
  862. <li><a id="toc-asoftclip" href="#asoftclip">36.45 asoftclip</a>
  863. <ul class="no-bullet">
  864. <li><a id="toc-Commands-16" href="#Commands-16">36.45.1 Commands</a></li>
  865. </ul></li>
  866. <li><a id="toc-asr" href="#asr">36.46 asr</a></li>
  867. <li><a id="toc-astats-1" href="#astats-1">36.47 astats</a></li>
  868. <li><a id="toc-asubboost" href="#asubboost">36.48 asubboost</a>
  869. <ul class="no-bullet">
  870. <li><a id="toc-Commands-17" href="#Commands-17">36.48.1 Commands</a></li>
  871. </ul></li>
  872. <li><a id="toc-asubcut" href="#asubcut">36.49 asubcut</a>
  873. <ul class="no-bullet">
  874. <li><a id="toc-Commands-18" href="#Commands-18">36.49.1 Commands</a></li>
  875. </ul></li>
  876. <li><a id="toc-asupercut" href="#asupercut">36.50 asupercut</a>
  877. <ul class="no-bullet">
  878. <li><a id="toc-Commands-19" href="#Commands-19">36.50.1 Commands</a></li>
  879. </ul></li>
  880. <li><a id="toc-asuperpass" href="#asuperpass">36.51 asuperpass</a>
  881. <ul class="no-bullet">
  882. <li><a id="toc-Commands-20" href="#Commands-20">36.51.1 Commands</a></li>
  883. </ul></li>
  884. <li><a id="toc-asuperstop" href="#asuperstop">36.52 asuperstop</a>
  885. <ul class="no-bullet">
  886. <li><a id="toc-Commands-21" href="#Commands-21">36.52.1 Commands</a></li>
  887. </ul></li>
  888. <li><a id="toc-atempo" href="#atempo">36.53 atempo</a>
  889. <ul class="no-bullet">
  890. <li><a id="toc-Examples-53" href="#Examples-53">36.53.1 Examples</a></li>
  891. <li><a id="toc-Commands-22" href="#Commands-22">36.53.2 Commands</a></li>
  892. </ul></li>
  893. <li><a id="toc-atrim" href="#atrim">36.54 atrim</a></li>
  894. <li><a id="toc-axcorrelate" href="#axcorrelate">36.55 axcorrelate</a>
  895. <ul class="no-bullet">
  896. <li><a id="toc-Examples-54" href="#Examples-54">36.55.1 Examples</a></li>
  897. </ul></li>
  898. <li><a id="toc-bandpass" href="#bandpass">36.56 bandpass</a>
  899. <ul class="no-bullet">
  900. <li><a id="toc-Commands-23" href="#Commands-23">36.56.1 Commands</a></li>
  901. </ul></li>
  902. <li><a id="toc-bandreject" href="#bandreject">36.57 bandreject</a>
  903. <ul class="no-bullet">
  904. <li><a id="toc-Commands-24" href="#Commands-24">36.57.1 Commands</a></li>
  905. </ul></li>
  906. <li><a id="toc-bass_002c-lowshelf" href="#bass_002c-lowshelf">36.58 bass, lowshelf</a>
  907. <ul class="no-bullet">
  908. <li><a id="toc-Commands-25" href="#Commands-25">36.58.1 Commands</a></li>
  909. </ul></li>
  910. <li><a id="toc-biquad" href="#biquad">36.59 biquad</a>
  911. <ul class="no-bullet">
  912. <li><a id="toc-Commands-26" href="#Commands-26">36.59.1 Commands</a></li>
  913. </ul></li>
  914. <li><a id="toc-bs2b" href="#bs2b">36.60 bs2b</a></li>
  915. <li><a id="toc-channelmap" href="#channelmap">36.61 channelmap</a>
  916. <ul class="no-bullet">
  917. <li><a id="toc-Examples-55" href="#Examples-55">36.61.1 Examples</a></li>
  918. </ul></li>
  919. <li><a id="toc-channelsplit" href="#channelsplit">36.62 channelsplit</a>
  920. <ul class="no-bullet">
  921. <li><a id="toc-Examples-56" href="#Examples-56">36.62.1 Examples</a></li>
  922. </ul></li>
  923. <li><a id="toc-chorus" href="#chorus">36.63 chorus</a>
  924. <ul class="no-bullet">
  925. <li><a id="toc-Examples-57" href="#Examples-57">36.63.1 Examples</a></li>
  926. </ul></li>
  927. <li><a id="toc-compand" href="#compand">36.64 compand</a>
  928. <ul class="no-bullet">
  929. <li><a id="toc-Examples-58" href="#Examples-58">36.64.1 Examples</a></li>
  930. </ul></li>
  931. <li><a id="toc-compensationdelay" href="#compensationdelay">36.65 compensationdelay</a></li>
  932. <li><a id="toc-crossfeed" href="#crossfeed">36.66 crossfeed</a>
  933. <ul class="no-bullet">
  934. <li><a id="toc-Commands-27" href="#Commands-27">36.66.1 Commands</a></li>
  935. </ul></li>
  936. <li><a id="toc-crystalizer" href="#crystalizer">36.67 crystalizer</a>
  937. <ul class="no-bullet">
  938. <li><a id="toc-Commands-28" href="#Commands-28">36.67.1 Commands</a></li>
  939. </ul></li>
  940. <li><a id="toc-dcshift" href="#dcshift">36.68 dcshift</a></li>
  941. <li><a id="toc-deesser" href="#deesser">36.69 deesser</a></li>
  942. <li><a id="toc-drmeter" href="#drmeter">36.70 drmeter</a></li>
  943. <li><a id="toc-dynaudnorm" href="#dynaudnorm">36.71 dynaudnorm</a>
  944. <ul class="no-bullet">
  945. <li><a id="toc-Commands-29" href="#Commands-29">36.71.1 Commands</a></li>
  946. </ul></li>
  947. <li><a id="toc-earwax" href="#earwax">36.72 earwax</a></li>
  948. <li><a id="toc-equalizer" href="#equalizer">36.73 equalizer</a>
  949. <ul class="no-bullet">
  950. <li><a id="toc-Examples-59" href="#Examples-59">36.73.1 Examples</a></li>
  951. <li><a id="toc-Commands-30" href="#Commands-30">36.73.2 Commands</a></li>
  952. </ul></li>
  953. <li><a id="toc-extrastereo" href="#extrastereo">36.74 extrastereo</a>
  954. <ul class="no-bullet">
  955. <li><a id="toc-Commands-31" href="#Commands-31">36.74.1 Commands</a></li>
  956. </ul></li>
  957. <li><a id="toc-firequalizer" href="#firequalizer">36.75 firequalizer</a>
  958. <ul class="no-bullet">
  959. <li><a id="toc-Examples-60" href="#Examples-60">36.75.1 Examples</a></li>
  960. </ul></li>
  961. <li><a id="toc-flanger" href="#flanger">36.76 flanger</a></li>
  962. <li><a id="toc-haas" href="#haas">36.77 haas</a></li>
  963. <li><a id="toc-hdcd" href="#hdcd">36.78 hdcd</a></li>
  964. <li><a id="toc-headphone" href="#headphone">36.79 headphone</a>
  965. <ul class="no-bullet">
  966. <li><a id="toc-Examples-61" href="#Examples-61">36.79.1 Examples</a></li>
  967. </ul></li>
  968. <li><a id="toc-highpass" href="#highpass">36.80 highpass</a>
  969. <ul class="no-bullet">
  970. <li><a id="toc-Commands-32" href="#Commands-32">36.80.1 Commands</a></li>
  971. </ul></li>
  972. <li><a id="toc-join" href="#join">36.81 join</a></li>
  973. <li><a id="toc-ladspa" href="#ladspa">36.82 ladspa</a>
  974. <ul class="no-bullet">
  975. <li><a id="toc-Examples-62" href="#Examples-62">36.82.1 Examples</a></li>
  976. <li><a id="toc-Commands-33" href="#Commands-33">36.82.2 Commands</a></li>
  977. </ul></li>
  978. <li><a id="toc-loudnorm" href="#loudnorm">36.83 loudnorm</a></li>
  979. <li><a id="toc-lowpass" href="#lowpass">36.84 lowpass</a>
  980. <ul class="no-bullet">
  981. <li><a id="toc-Examples-63" href="#Examples-63">36.84.1 Examples</a></li>
  982. <li><a id="toc-Commands-34" href="#Commands-34">36.84.2 Commands</a></li>
  983. </ul></li>
  984. <li><a id="toc-lv2" href="#lv2">36.85 lv2</a>
  985. <ul class="no-bullet">
  986. <li><a id="toc-Examples-64" href="#Examples-64">36.85.1 Examples</a></li>
  987. </ul></li>
  988. <li><a id="toc-mcompand" href="#mcompand">36.86 mcompand</a></li>
  989. <li><a id="toc-pan-1" href="#pan-1">36.87 pan</a>
  990. <ul class="no-bullet">
  991. <li><a id="toc-Mixing-examples" href="#Mixing-examples">36.87.1 Mixing examples</a></li>
  992. <li><a id="toc-Remapping-examples" href="#Remapping-examples">36.87.2 Remapping examples</a></li>
  993. </ul></li>
  994. <li><a id="toc-replaygain" href="#replaygain">36.88 replaygain</a></li>
  995. <li><a id="toc-resample" href="#resample">36.89 resample</a></li>
  996. <li><a id="toc-rubberband" href="#rubberband">36.90 rubberband</a>
  997. <ul class="no-bullet">
  998. <li><a id="toc-Commands-35" href="#Commands-35">36.90.1 Commands</a></li>
  999. </ul></li>
  1000. <li><a id="toc-sidechaincompress" href="#sidechaincompress">36.91 sidechaincompress</a>
  1001. <ul class="no-bullet">
  1002. <li><a id="toc-Commands-36" href="#Commands-36">36.91.1 Commands</a></li>
  1003. <li><a id="toc-Examples-65" href="#Examples-65">36.91.2 Examples</a></li>
  1004. </ul></li>
  1005. <li><a id="toc-sidechaingate" href="#sidechaingate">36.92 sidechaingate</a>
  1006. <ul class="no-bullet">
  1007. <li><a id="toc-Commands-37" href="#Commands-37">36.92.1 Commands</a></li>
  1008. </ul></li>
  1009. <li><a id="toc-silencedetect" href="#silencedetect">36.93 silencedetect</a>
  1010. <ul class="no-bullet">
  1011. <li><a id="toc-Examples-66" href="#Examples-66">36.93.1 Examples</a></li>
  1012. </ul></li>
  1013. <li><a id="toc-silenceremove" href="#silenceremove">36.94 silenceremove</a>
  1014. <ul class="no-bullet">
  1015. <li><a id="toc-Examples-67" href="#Examples-67">36.94.1 Examples</a></li>
  1016. </ul></li>
  1017. <li><a id="toc-sofalizer" href="#sofalizer">36.95 sofalizer</a>
  1018. <ul class="no-bullet">
  1019. <li><a id="toc-Examples-68" href="#Examples-68">36.95.1 Examples</a></li>
  1020. </ul></li>
  1021. <li><a id="toc-speechnorm" href="#speechnorm">36.96 speechnorm</a>
  1022. <ul class="no-bullet">
  1023. <li><a id="toc-Commands-38" href="#Commands-38">36.96.1 Commands</a></li>
  1024. </ul></li>
  1025. <li><a id="toc-stereotools" href="#stereotools">36.97 stereotools</a>
  1026. <ul class="no-bullet">
  1027. <li><a id="toc-Commands-39" href="#Commands-39">36.97.1 Commands</a></li>
  1028. <li><a id="toc-Examples-69" href="#Examples-69">36.97.2 Examples</a></li>
  1029. </ul></li>
  1030. <li><a id="toc-stereowiden" href="#stereowiden">36.98 stereowiden</a>
  1031. <ul class="no-bullet">
  1032. <li><a id="toc-Commands-40" href="#Commands-40">36.98.1 Commands</a></li>
  1033. </ul></li>
  1034. <li><a id="toc-superequalizer" href="#superequalizer">36.99 superequalizer</a></li>
  1035. <li><a id="toc-surround" href="#surround">36.100 surround</a></li>
  1036. <li><a id="toc-treble_002c-highshelf" href="#treble_002c-highshelf">36.101 treble, highshelf</a>
  1037. <ul class="no-bullet">
  1038. <li><a id="toc-Commands-41" href="#Commands-41">36.101.1 Commands</a></li>
  1039. </ul></li>
  1040. <li><a id="toc-tremolo" href="#tremolo">36.102 tremolo</a></li>
  1041. <li><a id="toc-vibrato" href="#vibrato">36.103 vibrato</a></li>
  1042. <li><a id="toc-volume" href="#volume">36.104 volume</a>
  1043. <ul class="no-bullet">
  1044. <li><a id="toc-Commands-42" href="#Commands-42">36.104.1 Commands</a></li>
  1045. <li><a id="toc-Examples-70" href="#Examples-70">36.104.2 Examples</a></li>
  1046. </ul></li>
  1047. <li><a id="toc-volumedetect" href="#volumedetect">36.105 volumedetect</a>
  1048. <ul class="no-bullet">
  1049. <li><a id="toc-Examples-71" href="#Examples-71">36.105.1 Examples</a></li>
  1050. </ul></li>
  1051. </ul></li>
  1052. <li><a id="toc-Audio-Sources" href="#Audio-Sources">37 Audio Sources</a>
  1053. <ul class="no-bullet">
  1054. <li><a id="toc-abuffer" href="#abuffer">37.1 abuffer</a>
  1055. <ul class="no-bullet">
  1056. <li><a id="toc-Examples-72" href="#Examples-72">37.1.1 Examples</a></li>
  1057. </ul></li>
  1058. <li><a id="toc-aevalsrc" href="#aevalsrc">37.2 aevalsrc</a>
  1059. <ul class="no-bullet">
  1060. <li><a id="toc-Examples-73" href="#Examples-73">37.2.1 Examples</a></li>
  1061. </ul></li>
  1062. <li><a id="toc-afirsrc" href="#afirsrc">37.3 afirsrc</a></li>
  1063. <li><a id="toc-anullsrc" href="#anullsrc">37.4 anullsrc</a>
  1064. <ul class="no-bullet">
  1065. <li><a id="toc-Examples-74" href="#Examples-74">37.4.1 Examples</a></li>
  1066. </ul></li>
  1067. <li><a id="toc-flite" href="#flite">37.5 flite</a>
  1068. <ul class="no-bullet">
  1069. <li><a id="toc-Examples-75" href="#Examples-75">37.5.1 Examples</a></li>
  1070. </ul></li>
  1071. <li><a id="toc-anoisesrc" href="#anoisesrc">37.6 anoisesrc</a>
  1072. <ul class="no-bullet">
  1073. <li><a id="toc-Examples-76" href="#Examples-76">37.6.1 Examples</a></li>
  1074. </ul></li>
  1075. <li><a id="toc-hilbert" href="#hilbert">37.7 hilbert</a></li>
  1076. <li><a id="toc-sinc" href="#sinc">37.8 sinc</a></li>
  1077. <li><a id="toc-sine" href="#sine">37.9 sine</a>
  1078. <ul class="no-bullet">
  1079. <li><a id="toc-Examples-77" href="#Examples-77">37.9.1 Examples</a></li>
  1080. </ul></li>
  1081. </ul></li>
  1082. <li><a id="toc-Audio-Sinks" href="#Audio-Sinks">38 Audio Sinks</a>
  1083. <ul class="no-bullet">
  1084. <li><a id="toc-abuffersink" href="#abuffersink">38.1 abuffersink</a></li>
  1085. <li><a id="toc-anullsink" href="#anullsink">38.2 anullsink</a></li>
  1086. </ul></li>
  1087. <li><a id="toc-Video-Filters" href="#Video-Filters">39 Video Filters</a>
  1088. <ul class="no-bullet">
  1089. <li><a id="toc-addroi" href="#addroi">39.1 addroi</a>
  1090. <ul class="no-bullet">
  1091. <li><a id="toc-Examples-78" href="#Examples-78">39.1.1 Examples</a></li>
  1092. </ul></li>
  1093. <li><a id="toc-alphaextract" href="#alphaextract">39.2 alphaextract</a></li>
  1094. <li><a id="toc-alphamerge" href="#alphamerge">39.3 alphamerge</a></li>
  1095. <li><a id="toc-amplify" href="#amplify">39.4 amplify</a>
  1096. <ul class="no-bullet">
  1097. <li><a id="toc-Commands-43" href="#Commands-43">39.4.1 Commands</a></li>
  1098. </ul></li>
  1099. <li><a id="toc-ass" href="#ass">39.5 ass</a></li>
  1100. <li><a id="toc-atadenoise" href="#atadenoise">39.6 atadenoise</a>
  1101. <ul class="no-bullet">
  1102. <li><a id="toc-Commands-44" href="#Commands-44">39.6.1 Commands</a></li>
  1103. </ul></li>
  1104. <li><a id="toc-avgblur" href="#avgblur">39.7 avgblur</a>
  1105. <ul class="no-bullet">
  1106. <li><a id="toc-Commands-45" href="#Commands-45">39.7.1 Commands</a></li>
  1107. </ul></li>
  1108. <li><a id="toc-bbox" href="#bbox">39.8 bbox</a>
  1109. <ul class="no-bullet">
  1110. <li><a id="toc-Commands-46" href="#Commands-46">39.8.1 Commands</a></li>
  1111. </ul></li>
  1112. <li><a id="toc-bilateral" href="#bilateral">39.9 bilateral</a>
  1113. <ul class="no-bullet">
  1114. <li><a id="toc-Commands-47" href="#Commands-47">39.9.1 Commands</a></li>
  1115. </ul></li>
  1116. <li><a id="toc-bitplanenoise" href="#bitplanenoise">39.10 bitplanenoise</a></li>
  1117. <li><a id="toc-blackdetect" href="#blackdetect">39.11 blackdetect</a></li>
  1118. <li><a id="toc-blackframe" href="#blackframe">39.12 blackframe</a></li>
  1119. <li><a id="toc-blend-1" href="#blend-1">39.13 blend</a>
  1120. <ul class="no-bullet">
  1121. <li><a id="toc-Examples-79" href="#Examples-79">39.13.1 Examples</a></li>
  1122. <li><a id="toc-Commands-48" href="#Commands-48">39.13.2 Commands</a></li>
  1123. </ul></li>
  1124. <li><a id="toc-bm3d" href="#bm3d">39.14 bm3d</a>
  1125. <ul class="no-bullet">
  1126. <li><a id="toc-Examples-80" href="#Examples-80">39.14.1 Examples</a></li>
  1127. </ul></li>
  1128. <li><a id="toc-boxblur" href="#boxblur">39.15 boxblur</a>
  1129. <ul class="no-bullet">
  1130. <li><a id="toc-Examples-81" href="#Examples-81">39.15.1 Examples</a></li>
  1131. </ul></li>
  1132. <li><a id="toc-bwdif" href="#bwdif">39.16 bwdif</a></li>
  1133. <li><a id="toc-cas" href="#cas">39.17 cas</a>
  1134. <ul class="no-bullet">
  1135. <li><a id="toc-Commands-49" href="#Commands-49">39.17.1 Commands</a></li>
  1136. </ul></li>
  1137. <li><a id="toc-chromahold" href="#chromahold">39.18 chromahold</a>
  1138. <ul class="no-bullet">
  1139. <li><a id="toc-Commands-50" href="#Commands-50">39.18.1 Commands</a></li>
  1140. </ul></li>
  1141. <li><a id="toc-chromakey" href="#chromakey">39.19 chromakey</a>
  1142. <ul class="no-bullet">
  1143. <li><a id="toc-Commands-51" href="#Commands-51">39.19.1 Commands</a></li>
  1144. <li><a id="toc-Examples-82" href="#Examples-82">39.19.2 Examples</a></li>
  1145. </ul></li>
  1146. <li><a id="toc-chromanr" href="#chromanr">39.20 chromanr</a>
  1147. <ul class="no-bullet">
  1148. <li><a id="toc-Commands-52" href="#Commands-52">39.20.1 Commands</a></li>
  1149. </ul></li>
  1150. <li><a id="toc-chromashift" href="#chromashift">39.21 chromashift</a>
  1151. <ul class="no-bullet">
  1152. <li><a id="toc-Commands-53" href="#Commands-53">39.21.1 Commands</a></li>
  1153. </ul></li>
  1154. <li><a id="toc-ciescope" href="#ciescope">39.22 ciescope</a></li>
  1155. <li><a id="toc-codecview" href="#codecview">39.23 codecview</a>
  1156. <ul class="no-bullet">
  1157. <li><a id="toc-Examples-83" href="#Examples-83">39.23.1 Examples</a></li>
  1158. </ul></li>
  1159. <li><a id="toc-colorbalance" href="#colorbalance">39.24 colorbalance</a>
  1160. <ul class="no-bullet">
  1161. <li><a id="toc-Examples-84" href="#Examples-84">39.24.1 Examples</a></li>
  1162. <li><a id="toc-Commands-54" href="#Commands-54">39.24.2 Commands</a></li>
  1163. </ul></li>
  1164. <li><a id="toc-colorcontrast" href="#colorcontrast">39.25 colorcontrast</a>
  1165. <ul class="no-bullet">
  1166. <li><a id="toc-Commands-55" href="#Commands-55">39.25.1 Commands</a></li>
  1167. </ul></li>
  1168. <li><a id="toc-colorcorrect" href="#colorcorrect">39.26 colorcorrect</a>
  1169. <ul class="no-bullet">
  1170. <li><a id="toc-Commands-56" href="#Commands-56">39.26.1 Commands</a></li>
  1171. </ul></li>
  1172. <li><a id="toc-colorchannelmixer" href="#colorchannelmixer">39.27 colorchannelmixer</a>
  1173. <ul class="no-bullet">
  1174. <li><a id="toc-Examples-85" href="#Examples-85">39.27.1 Examples</a></li>
  1175. <li><a id="toc-Commands-57" href="#Commands-57">39.27.2 Commands</a></li>
  1176. </ul></li>
  1177. <li><a id="toc-colorize" href="#colorize">39.28 colorize</a>
  1178. <ul class="no-bullet">
  1179. <li><a id="toc-Commands-58" href="#Commands-58">39.28.1 Commands</a></li>
  1180. </ul></li>
  1181. <li><a id="toc-colorkey" href="#colorkey">39.29 colorkey</a>
  1182. <ul class="no-bullet">
  1183. <li><a id="toc-Examples-86" href="#Examples-86">39.29.1 Examples</a></li>
  1184. <li><a id="toc-Commands-59" href="#Commands-59">39.29.2 Commands</a></li>
  1185. </ul></li>
  1186. <li><a id="toc-colorhold" href="#colorhold">39.30 colorhold</a>
  1187. <ul class="no-bullet">
  1188. <li><a id="toc-Commands-60" href="#Commands-60">39.30.1 Commands</a></li>
  1189. </ul></li>
  1190. <li><a id="toc-colorlevels" href="#colorlevels">39.31 colorlevels</a>
  1191. <ul class="no-bullet">
  1192. <li><a id="toc-Examples-87" href="#Examples-87">39.31.1 Examples</a></li>
  1193. <li><a id="toc-Commands-61" href="#Commands-61">39.31.2 Commands</a></li>
  1194. </ul></li>
  1195. <li><a id="toc-colormatrix" href="#colormatrix">39.32 colormatrix</a></li>
  1196. <li><a id="toc-colorspace" href="#colorspace">39.33 colorspace</a></li>
  1197. <li><a id="toc-colortemperature" href="#colortemperature">39.34 colortemperature</a>
  1198. <ul class="no-bullet">
  1199. <li><a id="toc-Commands-62" href="#Commands-62">39.34.1 Commands</a></li>
  1200. </ul></li>
  1201. <li><a id="toc-convolution" href="#convolution">39.35 convolution</a>
  1202. <ul class="no-bullet">
  1203. <li><a id="toc-Commands-63" href="#Commands-63">39.35.1 Commands</a></li>
  1204. <li><a id="toc-Examples-88" href="#Examples-88">39.35.2 Examples</a></li>
  1205. </ul></li>
  1206. <li><a id="toc-convolve" href="#convolve">39.36 convolve</a></li>
  1207. <li><a id="toc-copy" href="#copy">39.37 copy</a></li>
  1208. <li><a id="toc-coreimage-1" href="#coreimage-1">39.38 coreimage</a>
  1209. <ul class="no-bullet">
  1210. <li><a id="toc-Examples-89" href="#Examples-89">39.38.1 Examples</a></li>
  1211. </ul></li>
  1212. <li><a id="toc-cover_005frect" href="#cover_005frect">39.39 cover_rect</a>
  1213. <ul class="no-bullet">
  1214. <li><a id="toc-Examples-90" href="#Examples-90">39.39.1 Examples</a></li>
  1215. </ul></li>
  1216. <li><a id="toc-crop" href="#crop">39.40 crop</a>
  1217. <ul class="no-bullet">
  1218. <li><a id="toc-Examples-91" href="#Examples-91">39.40.1 Examples</a></li>
  1219. <li><a id="toc-Commands-64" href="#Commands-64">39.40.2 Commands</a></li>
  1220. </ul></li>
  1221. <li><a id="toc-cropdetect" href="#cropdetect">39.41 cropdetect</a></li>
  1222. <li><a id="toc-cue-1" href="#cue-1">39.42 cue</a></li>
  1223. <li><a id="toc-curves-1" href="#curves-1">39.43 curves</a>
  1224. <ul class="no-bullet">
  1225. <li><a id="toc-Commands-65" href="#Commands-65">39.43.1 Commands</a></li>
  1226. <li><a id="toc-Examples-92" href="#Examples-92">39.43.2 Examples</a></li>
  1227. </ul></li>
  1228. <li><a id="toc-datascope" href="#datascope">39.44 datascope</a>
  1229. <ul class="no-bullet">
  1230. <li><a id="toc-Commands-66" href="#Commands-66">39.44.1 Commands</a></li>
  1231. </ul></li>
  1232. <li><a id="toc-dblur" href="#dblur">39.45 dblur</a>
  1233. <ul class="no-bullet">
  1234. <li><a id="toc-Commands-67" href="#Commands-67">39.45.1 Commands</a></li>
  1235. </ul></li>
  1236. <li><a id="toc-dctdnoiz" href="#dctdnoiz">39.46 dctdnoiz</a>
  1237. <ul class="no-bullet">
  1238. <li><a id="toc-Examples-93" href="#Examples-93">39.46.1 Examples</a></li>
  1239. </ul></li>
  1240. <li><a id="toc-deband" href="#deband">39.47 deband</a>
  1241. <ul class="no-bullet">
  1242. <li><a id="toc-Commands-68" href="#Commands-68">39.47.1 Commands</a></li>
  1243. </ul></li>
  1244. <li><a id="toc-deblock" href="#deblock">39.48 deblock</a>
  1245. <ul class="no-bullet">
  1246. <li><a id="toc-Examples-94" href="#Examples-94">39.48.1 Examples</a></li>
  1247. <li><a id="toc-Commands-69" href="#Commands-69">39.48.2 Commands</a></li>
  1248. </ul></li>
  1249. <li><a id="toc-decimate-1" href="#decimate-1">39.49 decimate</a></li>
  1250. <li><a id="toc-deconvolve" href="#deconvolve">39.50 deconvolve</a></li>
  1251. <li><a id="toc-dedot" href="#dedot">39.51 dedot</a></li>
  1252. <li><a id="toc-deflate" href="#deflate">39.52 deflate</a>
  1253. <ul class="no-bullet">
  1254. <li><a id="toc-Commands-70" href="#Commands-70">39.52.1 Commands</a></li>
  1255. </ul></li>
  1256. <li><a id="toc-deflicker" href="#deflicker">39.53 deflicker</a></li>
  1257. <li><a id="toc-dejudder" href="#dejudder">39.54 dejudder</a></li>
  1258. <li><a id="toc-delogo" href="#delogo">39.55 delogo</a>
  1259. <ul class="no-bullet">
  1260. <li><a id="toc-Examples-95" href="#Examples-95">39.55.1 Examples</a></li>
  1261. </ul></li>
  1262. <li><a id="toc-derain-1" href="#derain-1">39.56 derain</a></li>
  1263. <li><a id="toc-deshake" href="#deshake">39.57 deshake</a></li>
  1264. <li><a id="toc-despill" href="#despill">39.58 despill</a>
  1265. <ul class="no-bullet">
  1266. <li><a id="toc-Commands-71" href="#Commands-71">39.58.1 Commands</a></li>
  1267. </ul></li>
  1268. <li><a id="toc-detelecine" href="#detelecine">39.59 detelecine</a></li>
  1269. <li><a id="toc-dilation" href="#dilation">39.60 dilation</a>
  1270. <ul class="no-bullet">
  1271. <li><a id="toc-Commands-72" href="#Commands-72">39.60.1 Commands</a></li>
  1272. </ul></li>
  1273. <li><a id="toc-displace" href="#displace">39.61 displace</a>
  1274. <ul class="no-bullet">
  1275. <li><a id="toc-Examples-96" href="#Examples-96">39.61.1 Examples</a></li>
  1276. </ul></li>
  1277. <li><a id="toc-dnn_005fprocessing-1" href="#dnn_005fprocessing-1">39.62 dnn_processing</a>
  1278. <ul class="no-bullet">
  1279. <li><a id="toc-Examples-97" href="#Examples-97">39.62.1 Examples</a></li>
  1280. </ul></li>
  1281. <li><a id="toc-drawbox" href="#drawbox">39.63 drawbox</a>
  1282. <ul class="no-bullet">
  1283. <li><a id="toc-Examples-98" href="#Examples-98">39.63.1 Examples</a></li>
  1284. <li><a id="toc-Commands-73" href="#Commands-73">39.63.2 Commands</a></li>
  1285. </ul></li>
  1286. <li><a id="toc-drawgraph-1" href="#drawgraph-1">39.64 drawgraph</a></li>
  1287. <li><a id="toc-drawgrid" href="#drawgrid">39.65 drawgrid</a>
  1288. <ul class="no-bullet">
  1289. <li><a id="toc-Examples-99" href="#Examples-99">39.65.1 Examples</a></li>
  1290. <li><a id="toc-Commands-74" href="#Commands-74">39.65.2 Commands</a></li>
  1291. </ul></li>
  1292. <li><a id="toc-drawtext-1" href="#drawtext-1">39.66 drawtext</a>
  1293. <ul class="no-bullet">
  1294. <li><a id="toc-Syntax-2" href="#Syntax-2">39.66.1 Syntax</a></li>
  1295. <li><a id="toc-Text-expansion" href="#Text-expansion">39.66.2 Text expansion</a></li>
  1296. <li><a id="toc-Commands-75" href="#Commands-75">39.66.3 Commands</a></li>
  1297. <li><a id="toc-Examples-100" href="#Examples-100">39.66.4 Examples</a></li>
  1298. </ul></li>
  1299. <li><a id="toc-edgedetect" href="#edgedetect">39.67 edgedetect</a>
  1300. <ul class="no-bullet">
  1301. <li><a id="toc-Examples-101" href="#Examples-101">39.67.1 Examples</a></li>
  1302. </ul></li>
  1303. <li><a id="toc-elbg" href="#elbg">39.68 elbg</a></li>
  1304. <li><a id="toc-entropy" href="#entropy">39.69 entropy</a></li>
  1305. <li><a id="toc-epx" href="#epx">39.70 epx</a></li>
  1306. <li><a id="toc-eq" href="#eq">39.71 eq</a>
  1307. <ul class="no-bullet">
  1308. <li><a id="toc-Commands-76" href="#Commands-76">39.71.1 Commands</a></li>
  1309. </ul></li>
  1310. <li><a id="toc-erosion" href="#erosion">39.72 erosion</a>
  1311. <ul class="no-bullet">
  1312. <li><a id="toc-Commands-77" href="#Commands-77">39.72.1 Commands</a></li>
  1313. </ul></li>
  1314. <li><a id="toc-estdif" href="#estdif">39.73 estdif</a>
  1315. <ul class="no-bullet">
  1316. <li><a id="toc-Commands-78" href="#Commands-78">39.73.1 Commands</a></li>
  1317. </ul></li>
  1318. <li><a id="toc-exposure" href="#exposure">39.74 exposure</a>
  1319. <ul class="no-bullet">
  1320. <li><a id="toc-Commands-79" href="#Commands-79">39.74.1 Commands</a></li>
  1321. </ul></li>
  1322. <li><a id="toc-extractplanes" href="#extractplanes">39.75 extractplanes</a>
  1323. <ul class="no-bullet">
  1324. <li><a id="toc-Examples-102" href="#Examples-102">39.75.1 Examples</a></li>
  1325. </ul></li>
  1326. <li><a id="toc-fade" href="#fade">39.76 fade</a>
  1327. <ul class="no-bullet">
  1328. <li><a id="toc-Examples-103" href="#Examples-103">39.76.1 Examples</a></li>
  1329. </ul></li>
  1330. <li><a id="toc-fftdnoiz" href="#fftdnoiz">39.77 fftdnoiz</a></li>
  1331. <li><a id="toc-fftfilt" href="#fftfilt">39.78 fftfilt</a>
  1332. <ul class="no-bullet">
  1333. <li><a id="toc-Examples-104" href="#Examples-104">39.78.1 Examples</a></li>
  1334. </ul></li>
  1335. <li><a id="toc-field" href="#field">39.79 field</a></li>
  1336. <li><a id="toc-fieldhint" href="#fieldhint">39.80 fieldhint</a></li>
  1337. <li><a id="toc-fieldmatch" href="#fieldmatch">39.81 fieldmatch</a>
  1338. <ul class="no-bullet">
  1339. <li><a id="toc-p_002fc_002fn_002fu_002fb-meaning-1" href="#p_002fc_002fn_002fu_002fb-meaning-1">39.81.1 p/c/n/u/b meaning</a>
  1340. <ul class="no-bullet">
  1341. <li><a id="toc-p_002fc_002fn" href="#p_002fc_002fn">39.81.1.1 p/c/n</a></li>
  1342. <li><a id="toc-u_002fb" href="#u_002fb">39.81.1.2 u/b</a></li>
  1343. </ul></li>
  1344. <li><a id="toc-Examples-105" href="#Examples-105">39.81.2 Examples</a></li>
  1345. </ul></li>
  1346. <li><a id="toc-fieldorder" href="#fieldorder">39.82 fieldorder</a></li>
  1347. <li><a id="toc-fifo_002c-afifo" href="#fifo_002c-afifo">39.83 fifo, afifo</a></li>
  1348. <li><a id="toc-fillborders" href="#fillborders">39.84 fillborders</a>
  1349. <ul class="no-bullet">
  1350. <li><a id="toc-Commands-80" href="#Commands-80">39.84.1 Commands</a></li>
  1351. </ul></li>
  1352. <li><a id="toc-find_005frect" href="#find_005frect">39.85 find_rect</a>
  1353. <ul class="no-bullet">
  1354. <li><a id="toc-Examples-106" href="#Examples-106">39.85.1 Examples</a></li>
  1355. </ul></li>
  1356. <li><a id="toc-floodfill" href="#floodfill">39.86 floodfill</a></li>
  1357. <li><a id="toc-format-1" href="#format-1">39.87 format</a>
  1358. <ul class="no-bullet">
  1359. <li><a id="toc-Examples-107" href="#Examples-107">39.87.1 Examples</a></li>
  1360. </ul></li>
  1361. <li><a id="toc-fps-1" href="#fps-1">39.88 fps</a>
  1362. <ul class="no-bullet">
  1363. <li><a id="toc-Examples-108" href="#Examples-108">39.88.1 Examples</a></li>
  1364. </ul></li>
  1365. <li><a id="toc-framepack" href="#framepack">39.89 framepack</a></li>
  1366. <li><a id="toc-framerate" href="#framerate">39.90 framerate</a></li>
  1367. <li><a id="toc-framestep" href="#framestep">39.91 framestep</a></li>
  1368. <li><a id="toc-freezedetect" href="#freezedetect">39.92 freezedetect</a></li>
  1369. <li><a id="toc-freezeframes" href="#freezeframes">39.93 freezeframes</a></li>
  1370. <li><a id="toc-frei0r-1" href="#frei0r-1">39.94 frei0r</a>
  1371. <ul class="no-bullet">
  1372. <li><a id="toc-Examples-109" href="#Examples-109">39.94.1 Examples</a></li>
  1373. <li><a id="toc-Commands-81" href="#Commands-81">39.94.2 Commands</a></li>
  1374. </ul></li>
  1375. <li><a id="toc-fspp" href="#fspp">39.95 fspp</a></li>
  1376. <li><a id="toc-gblur" href="#gblur">39.96 gblur</a>
  1377. <ul class="no-bullet">
  1378. <li><a id="toc-Commands-82" href="#Commands-82">39.96.1 Commands</a></li>
  1379. </ul></li>
  1380. <li><a id="toc-geq" href="#geq">39.97 geq</a>
  1381. <ul class="no-bullet">
  1382. <li><a id="toc-Examples-110" href="#Examples-110">39.97.1 Examples</a></li>
  1383. </ul></li>
  1384. <li><a id="toc-gradfun" href="#gradfun">39.98 gradfun</a>
  1385. <ul class="no-bullet">
  1386. <li><a id="toc-Examples-111" href="#Examples-111">39.98.1 Examples</a></li>
  1387. </ul></li>
  1388. <li><a id="toc-graphmonitor-1" href="#graphmonitor-1">39.99 graphmonitor</a></li>
  1389. <li><a id="toc-greyedge" href="#greyedge">39.100 greyedge</a>
  1390. <ul class="no-bullet">
  1391. <li><a id="toc-Examples-112" href="#Examples-112">39.100.1 Examples</a></li>
  1392. </ul></li>
  1393. <li><a id="toc-haldclut-1" href="#haldclut-1">39.101 haldclut</a>
  1394. <ul class="no-bullet">
  1395. <li><a id="toc-Commands-83" href="#Commands-83">39.101.1 Commands</a></li>
  1396. <li><a id="toc-Workflow-examples" href="#Workflow-examples">39.101.2 Workflow examples</a>
  1397. <ul class="no-bullet">
  1398. <li><a id="toc-Hald-CLUT-video-stream" href="#Hald-CLUT-video-stream">39.101.2.1 Hald CLUT video stream</a></li>
  1399. <li><a id="toc-Hald-CLUT-with-preview" href="#Hald-CLUT-with-preview">39.101.2.2 Hald CLUT with preview</a></li>
  1400. </ul></li>
  1401. </ul></li>
  1402. <li><a id="toc-hflip" href="#hflip">39.102 hflip</a></li>
  1403. <li><a id="toc-histeq" href="#histeq">39.103 histeq</a></li>
  1404. <li><a id="toc-histogram-1" href="#histogram-1">39.104 histogram</a>
  1405. <ul class="no-bullet">
  1406. <li><a id="toc-Examples-113" href="#Examples-113">39.104.1 Examples</a></li>
  1407. </ul></li>
  1408. <li><a id="toc-hqdn3d-1" href="#hqdn3d-1">39.105 hqdn3d</a>
  1409. <ul class="no-bullet">
  1410. <li><a id="toc-Commands-84" href="#Commands-84">39.105.1 Commands</a></li>
  1411. </ul></li>
  1412. <li><a id="toc-hwdownload-1" href="#hwdownload-1">39.106 hwdownload</a></li>
  1413. <li><a id="toc-hwmap" href="#hwmap">39.107 hwmap</a></li>
  1414. <li><a id="toc-hwupload-1" href="#hwupload-1">39.108 hwupload</a></li>
  1415. <li><a id="toc-hwupload_005fcuda-1" href="#hwupload_005fcuda-1">39.109 hwupload_cuda</a></li>
  1416. <li><a id="toc-hqx" href="#hqx">39.110 hqx</a></li>
  1417. <li><a id="toc-hstack" href="#hstack">39.111 hstack</a></li>
  1418. <li><a id="toc-hue" href="#hue">39.112 hue</a>
  1419. <ul class="no-bullet">
  1420. <li><a id="toc-Examples-114" href="#Examples-114">39.112.1 Examples</a></li>
  1421. <li><a id="toc-Commands-85" href="#Commands-85">39.112.2 Commands</a></li>
  1422. </ul></li>
  1423. <li><a id="toc-hysteresis" href="#hysteresis">39.113 hysteresis</a></li>
  1424. <li><a id="toc-identity" href="#identity">39.114 identity</a></li>
  1425. <li><a id="toc-idet" href="#idet">39.115 idet</a></li>
  1426. <li><a id="toc-il" href="#il">39.116 il</a>
  1427. <ul class="no-bullet">
  1428. <li><a id="toc-Commands-86" href="#Commands-86">39.116.1 Commands</a></li>
  1429. </ul></li>
  1430. <li><a id="toc-inflate" href="#inflate">39.117 inflate</a>
  1431. <ul class="no-bullet">
  1432. <li><a id="toc-Commands-87" href="#Commands-87">39.117.1 Commands</a></li>
  1433. </ul></li>
  1434. <li><a id="toc-interlace" href="#interlace">39.118 interlace</a></li>
  1435. <li><a id="toc-kerndeint" href="#kerndeint">39.119 kerndeint</a>
  1436. <ul class="no-bullet">
  1437. <li><a id="toc-Examples-115" href="#Examples-115">39.119.1 Examples</a></li>
  1438. </ul></li>
  1439. <li><a id="toc-kirsch" href="#kirsch">39.120 kirsch</a>
  1440. <ul class="no-bullet">
  1441. <li><a id="toc-Commands-88" href="#Commands-88">39.120.1 Commands</a></li>
  1442. </ul></li>
  1443. <li><a id="toc-lagfun" href="#lagfun">39.121 lagfun</a>
  1444. <ul class="no-bullet">
  1445. <li><a id="toc-Commands-89" href="#Commands-89">39.121.1 Commands</a></li>
  1446. </ul></li>
  1447. <li><a id="toc-lenscorrection" href="#lenscorrection">39.122 lenscorrection</a>
  1448. <ul class="no-bullet">
  1449. <li><a id="toc-Options-85" href="#Options-85">39.122.1 Options</a></li>
  1450. <li><a id="toc-Commands-90" href="#Commands-90">39.122.2 Commands</a></li>
  1451. </ul></li>
  1452. <li><a id="toc-lensfun" href="#lensfun">39.123 lensfun</a>
  1453. <ul class="no-bullet">
  1454. <li><a id="toc-Examples-116" href="#Examples-116">39.123.1 Examples</a></li>
  1455. </ul></li>
  1456. <li><a id="toc-libvmaf" href="#libvmaf">39.124 libvmaf</a>
  1457. <ul class="no-bullet">
  1458. <li><a id="toc-Examples-117" href="#Examples-117">39.124.1 Examples</a></li>
  1459. </ul></li>
  1460. <li><a id="toc-limiter" href="#limiter">39.125 limiter</a>
  1461. <ul class="no-bullet">
  1462. <li><a id="toc-Commands-91" href="#Commands-91">39.125.1 Commands</a></li>
  1463. </ul></li>
  1464. <li><a id="toc-loop" href="#loop">39.126 loop</a>
  1465. <ul class="no-bullet">
  1466. <li><a id="toc-Examples-118" href="#Examples-118">39.126.1 Examples</a></li>
  1467. </ul></li>
  1468. <li><a id="toc-lut1d" href="#lut1d">39.127 lut1d</a>
  1469. <ul class="no-bullet">
  1470. <li><a id="toc-Commands-92" href="#Commands-92">39.127.1 Commands</a></li>
  1471. </ul></li>
  1472. <li><a id="toc-lut3d-1" href="#lut3d-1">39.128 lut3d</a>
  1473. <ul class="no-bullet">
  1474. <li><a id="toc-Commands-93" href="#Commands-93">39.128.1 Commands</a></li>
  1475. </ul></li>
  1476. <li><a id="toc-lumakey" href="#lumakey">39.129 lumakey</a>
  1477. <ul class="no-bullet">
  1478. <li><a id="toc-Commands-94" href="#Commands-94">39.129.1 Commands</a></li>
  1479. </ul></li>
  1480. <li><a id="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">39.130 lut, lutrgb, lutyuv</a>
  1481. <ul class="no-bullet">
  1482. <li><a id="toc-Commands-95" href="#Commands-95">39.130.1 Commands</a></li>
  1483. <li><a id="toc-Examples-119" href="#Examples-119">39.130.2 Examples</a></li>
  1484. </ul></li>
  1485. <li><a id="toc-lut2_002c-tlut2" href="#lut2_002c-tlut2">39.131 lut2, tlut2</a>
  1486. <ul class="no-bullet">
  1487. <li><a id="toc-Commands-96" href="#Commands-96">39.131.1 Commands</a></li>
  1488. <li><a id="toc-Examples-120" href="#Examples-120">39.131.2 Examples</a></li>
  1489. </ul></li>
  1490. <li><a id="toc-maskedclamp" href="#maskedclamp">39.132 maskedclamp</a>
  1491. <ul class="no-bullet">
  1492. <li><a id="toc-Commands-97" href="#Commands-97">39.132.1 Commands</a></li>
  1493. </ul></li>
  1494. <li><a id="toc-maskedmax" href="#maskedmax">39.133 maskedmax</a>
  1495. <ul class="no-bullet">
  1496. <li><a id="toc-Commands-98" href="#Commands-98">39.133.1 Commands</a></li>
  1497. </ul></li>
  1498. <li><a id="toc-maskedmerge" href="#maskedmerge">39.134 maskedmerge</a>
  1499. <ul class="no-bullet">
  1500. <li><a id="toc-Commands-99" href="#Commands-99">39.134.1 Commands</a></li>
  1501. </ul></li>
  1502. <li><a id="toc-maskedmin" href="#maskedmin">39.135 maskedmin</a>
  1503. <ul class="no-bullet">
  1504. <li><a id="toc-Commands-100" href="#Commands-100">39.135.1 Commands</a></li>
  1505. </ul></li>
  1506. <li><a id="toc-maskedthreshold" href="#maskedthreshold">39.136 maskedthreshold</a>
  1507. <ul class="no-bullet">
  1508. <li><a id="toc-Commands-101" href="#Commands-101">39.136.1 Commands</a></li>
  1509. </ul></li>
  1510. <li><a id="toc-maskfun" href="#maskfun">39.137 maskfun</a>
  1511. <ul class="no-bullet">
  1512. <li><a id="toc-Commands-102" href="#Commands-102">39.137.1 Commands</a></li>
  1513. </ul></li>
  1514. <li><a id="toc-mcdeint" href="#mcdeint">39.138 mcdeint</a></li>
  1515. <li><a id="toc-median" href="#median">39.139 median</a>
  1516. <ul class="no-bullet">
  1517. <li><a id="toc-Commands-103" href="#Commands-103">39.139.1 Commands</a></li>
  1518. </ul></li>
  1519. <li><a id="toc-mergeplanes" href="#mergeplanes">39.140 mergeplanes</a>
  1520. <ul class="no-bullet">
  1521. <li><a id="toc-Examples-121" href="#Examples-121">39.140.1 Examples</a></li>
  1522. </ul></li>
  1523. <li><a id="toc-mestimate" href="#mestimate">39.141 mestimate</a></li>
  1524. <li><a id="toc-midequalizer" href="#midequalizer">39.142 midequalizer</a></li>
  1525. <li><a id="toc-minterpolate" href="#minterpolate">39.143 minterpolate</a></li>
  1526. <li><a id="toc-mix" href="#mix">39.144 mix</a>
  1527. <ul class="no-bullet">
  1528. <li><a id="toc-Commands-104" href="#Commands-104">39.144.1 Commands</a></li>
  1529. </ul></li>
  1530. <li><a id="toc-monochrome" href="#monochrome">39.145 monochrome</a>
  1531. <ul class="no-bullet">
  1532. <li><a id="toc-Commands-105" href="#Commands-105">39.145.1 Commands</a></li>
  1533. </ul></li>
  1534. <li><a id="toc-mpdecimate" href="#mpdecimate">39.146 mpdecimate</a></li>
  1535. <li><a id="toc-msad" href="#msad">39.147 msad</a></li>
  1536. <li><a id="toc-negate" href="#negate">39.148 negate</a>
  1537. <ul class="no-bullet">
  1538. <li><a id="toc-Commands-106" href="#Commands-106">39.148.1 Commands</a></li>
  1539. </ul></li>
  1540. <li><a id="toc-nlmeans-1" href="#nlmeans-1">39.149 nlmeans</a></li>
  1541. <li><a id="toc-nnedi" href="#nnedi">39.150 nnedi</a>
  1542. <ul class="no-bullet">
  1543. <li><a id="toc-Commands-107" href="#Commands-107">39.150.1 Commands</a></li>
  1544. </ul></li>
  1545. <li><a id="toc-noformat" href="#noformat">39.151 noformat</a>
  1546. <ul class="no-bullet">
  1547. <li><a id="toc-Examples-122" href="#Examples-122">39.151.1 Examples</a></li>
  1548. </ul></li>
  1549. <li><a id="toc-noise-1" href="#noise-1">39.152 noise</a>
  1550. <ul class="no-bullet">
  1551. <li><a id="toc-Examples-123" href="#Examples-123">39.152.1 Examples</a></li>
  1552. </ul></li>
  1553. <li><a id="toc-normalize" href="#normalize">39.153 normalize</a>
  1554. <ul class="no-bullet">
  1555. <li><a id="toc-Commands-108" href="#Commands-108">39.153.1 Commands</a></li>
  1556. <li><a id="toc-Examples-124" href="#Examples-124">39.153.2 Examples</a></li>
  1557. </ul></li>
  1558. <li><a id="toc-null-2" href="#null-2">39.154 null</a></li>
  1559. <li><a id="toc-ocr" href="#ocr">39.155 ocr</a></li>
  1560. <li><a id="toc-ocv" href="#ocv">39.156 ocv</a>
  1561. <ul class="no-bullet">
  1562. <li><a id="toc-dilate-1" href="#dilate-1">39.156.1 dilate</a></li>
  1563. <li><a id="toc-erode" href="#erode">39.156.2 erode</a></li>
  1564. <li><a id="toc-smooth" href="#smooth">39.156.3 smooth</a></li>
  1565. </ul></li>
  1566. <li><a id="toc-oscilloscope" href="#oscilloscope">39.157 oscilloscope</a>
  1567. <ul class="no-bullet">
  1568. <li><a id="toc-Commands-109" href="#Commands-109">39.157.1 Commands</a></li>
  1569. <li><a id="toc-Examples-125" href="#Examples-125">39.157.2 Examples</a></li>
  1570. </ul></li>
  1571. <li><a id="toc-overlay-1" href="#overlay-1">39.158 overlay</a>
  1572. <ul class="no-bullet">
  1573. <li><a id="toc-Commands-110" href="#Commands-110">39.158.1 Commands</a></li>
  1574. <li><a id="toc-Examples-126" href="#Examples-126">39.158.2 Examples</a></li>
  1575. </ul></li>
  1576. <li><a id="toc-overlay_005fcuda-1" href="#overlay_005fcuda-1">39.159 overlay_cuda</a></li>
  1577. <li><a id="toc-owdenoise" href="#owdenoise">39.160 owdenoise</a></li>
  1578. <li><a id="toc-pad-1" href="#pad-1">39.161 pad</a>
  1579. <ul class="no-bullet">
  1580. <li><a id="toc-Examples-127" href="#Examples-127">39.161.1 Examples</a></li>
  1581. </ul></li>
  1582. <li><a id="toc-palettegen-1" href="#palettegen-1">39.162 palettegen</a>
  1583. <ul class="no-bullet">
  1584. <li><a id="toc-Examples-128" href="#Examples-128">39.162.1 Examples</a></li>
  1585. </ul></li>
  1586. <li><a id="toc-paletteuse" href="#paletteuse">39.163 paletteuse</a>
  1587. <ul class="no-bullet">
  1588. <li><a id="toc-Examples-129" href="#Examples-129">39.163.1 Examples</a></li>
  1589. </ul></li>
  1590. <li><a id="toc-perspective" href="#perspective">39.164 perspective</a></li>
  1591. <li><a id="toc-phase" href="#phase">39.165 phase</a>
  1592. <ul class="no-bullet">
  1593. <li><a id="toc-Commands-111" href="#Commands-111">39.165.1 Commands</a></li>
  1594. </ul></li>
  1595. <li><a id="toc-photosensitivity" href="#photosensitivity">39.166 photosensitivity</a></li>
  1596. <li><a id="toc-pixdesctest" href="#pixdesctest">39.167 pixdesctest</a></li>
  1597. <li><a id="toc-pixscope" href="#pixscope">39.168 pixscope</a>
  1598. <ul class="no-bullet">
  1599. <li><a id="toc-Commands-112" href="#Commands-112">39.168.1 Commands</a></li>
  1600. </ul></li>
  1601. <li><a id="toc-pp" href="#pp">39.169 pp</a>
  1602. <ul class="no-bullet">
  1603. <li><a id="toc-Examples-130" href="#Examples-130">39.169.1 Examples</a></li>
  1604. </ul></li>
  1605. <li><a id="toc-pp7" href="#pp7">39.170 pp7</a></li>
  1606. <li><a id="toc-premultiply" href="#premultiply">39.171 premultiply</a></li>
  1607. <li><a id="toc-prewitt" href="#prewitt">39.172 prewitt</a>
  1608. <ul class="no-bullet">
  1609. <li><a id="toc-Commands-113" href="#Commands-113">39.172.1 Commands</a></li>
  1610. </ul></li>
  1611. <li><a id="toc-pseudocolor" href="#pseudocolor">39.173 pseudocolor</a>
  1612. <ul class="no-bullet">
  1613. <li><a id="toc-Commands-114" href="#Commands-114">39.173.1 Commands</a></li>
  1614. <li><a id="toc-Examples-131" href="#Examples-131">39.173.2 Examples</a></li>
  1615. </ul></li>
  1616. <li><a id="toc-psnr" href="#psnr">39.174 psnr</a>
  1617. <ul class="no-bullet">
  1618. <li><a id="toc-Examples-132" href="#Examples-132">39.174.1 Examples</a></li>
  1619. </ul></li>
  1620. <li><a id="toc-pullup-1" href="#pullup-1">39.175 pullup</a></li>
  1621. <li><a id="toc-qp" href="#qp">39.176 qp</a>
  1622. <ul class="no-bullet">
  1623. <li><a id="toc-Examples-133" href="#Examples-133">39.176.1 Examples</a></li>
  1624. </ul></li>
  1625. <li><a id="toc-random" href="#random">39.177 random</a></li>
  1626. <li><a id="toc-readeia608" href="#readeia608">39.178 readeia608</a>
  1627. <ul class="no-bullet">
  1628. <li><a id="toc-Commands-115" href="#Commands-115">39.178.1 Commands</a></li>
  1629. <li><a id="toc-Examples-134" href="#Examples-134">39.178.2 Examples</a></li>
  1630. </ul></li>
  1631. <li><a id="toc-readvitc" href="#readvitc">39.179 readvitc</a>
  1632. <ul class="no-bullet">
  1633. <li><a id="toc-Examples-135" href="#Examples-135">39.179.1 Examples</a></li>
  1634. </ul></li>
  1635. <li><a id="toc-remap" href="#remap">39.180 remap</a></li>
  1636. <li><a id="toc-removegrain" href="#removegrain">39.181 removegrain</a></li>
  1637. <li><a id="toc-removelogo" href="#removelogo">39.182 removelogo</a></li>
  1638. <li><a id="toc-repeatfields" href="#repeatfields">39.183 repeatfields</a></li>
  1639. <li><a id="toc-reverse" href="#reverse">39.184 reverse</a>
  1640. <ul class="no-bullet">
  1641. <li><a id="toc-Examples-136" href="#Examples-136">39.184.1 Examples</a></li>
  1642. </ul></li>
  1643. <li><a id="toc-rgbashift" href="#rgbashift">39.185 rgbashift</a>
  1644. <ul class="no-bullet">
  1645. <li><a id="toc-Commands-116" href="#Commands-116">39.185.1 Commands</a></li>
  1646. </ul></li>
  1647. <li><a id="toc-roberts" href="#roberts">39.186 roberts</a>
  1648. <ul class="no-bullet">
  1649. <li><a id="toc-Commands-117" href="#Commands-117">39.186.1 Commands</a></li>
  1650. </ul></li>
  1651. <li><a id="toc-rotate" href="#rotate">39.187 rotate</a>
  1652. <ul class="no-bullet">
  1653. <li><a id="toc-Examples-137" href="#Examples-137">39.187.1 Examples</a></li>
  1654. <li><a id="toc-Commands-118" href="#Commands-118">39.187.2 Commands</a></li>
  1655. </ul></li>
  1656. <li><a id="toc-sab" href="#sab">39.188 sab</a></li>
  1657. <li><a id="toc-scale-1" href="#scale-1">39.189 scale</a>
  1658. <ul class="no-bullet">
  1659. <li><a id="toc-Options-86" href="#Options-86">39.189.1 Options</a></li>
  1660. <li><a id="toc-Examples-138" href="#Examples-138">39.189.2 Examples</a></li>
  1661. <li><a id="toc-Commands-119" href="#Commands-119">39.189.3 Commands</a></li>
  1662. </ul></li>
  1663. <li><a id="toc-scale_005fnpp" href="#scale_005fnpp">39.190 scale_npp</a></li>
  1664. <li><a id="toc-scale2ref" href="#scale2ref">39.191 scale2ref</a>
  1665. <ul class="no-bullet">
  1666. <li><a id="toc-Examples-139" href="#Examples-139">39.191.1 Examples</a></li>
  1667. <li><a id="toc-Commands-120" href="#Commands-120">39.191.2 Commands</a></li>
  1668. </ul></li>
  1669. <li><a id="toc-scroll" href="#scroll">39.192 scroll</a>
  1670. <ul class="no-bullet">
  1671. <li><a id="toc-Commands-121" href="#Commands-121">39.192.1 Commands</a></li>
  1672. </ul></li>
  1673. <li><a id="toc-scdet-1" href="#scdet-1">39.193 scdet</a></li>
  1674. <li><a id="toc-selectivecolor-1" href="#selectivecolor-1">39.194 selectivecolor</a>
  1675. <ul class="no-bullet">
  1676. <li><a id="toc-Examples-140" href="#Examples-140">39.194.1 Examples</a></li>
  1677. </ul></li>
  1678. <li><a id="toc-separatefields-1" href="#separatefields-1">39.195 separatefields</a></li>
  1679. <li><a id="toc-setdar_002c-setsar" href="#setdar_002c-setsar">39.196 setdar, setsar</a>
  1680. <ul class="no-bullet">
  1681. <li><a id="toc-Examples-141" href="#Examples-141">39.196.1 Examples</a></li>
  1682. </ul></li>
  1683. <li><a id="toc-setfield-1" href="#setfield-1">39.197 setfield</a></li>
  1684. <li><a id="toc-setparams-1" href="#setparams-1">39.198 setparams</a></li>
  1685. <li><a id="toc-shear" href="#shear">39.199 shear</a>
  1686. <ul class="no-bullet">
  1687. <li><a id="toc-Commands-122" href="#Commands-122">39.199.1 Commands</a></li>
  1688. </ul></li>
  1689. <li><a id="toc-showinfo" href="#showinfo">39.200 showinfo</a></li>
  1690. <li><a id="toc-showpalette" href="#showpalette">39.201 showpalette</a></li>
  1691. <li><a id="toc-shuffleframes" href="#shuffleframes">39.202 shuffleframes</a>
  1692. <ul class="no-bullet">
  1693. <li><a id="toc-Examples-142" href="#Examples-142">39.202.1 Examples</a></li>
  1694. </ul></li>
  1695. <li><a id="toc-shufflepixels" href="#shufflepixels">39.203 shufflepixels</a></li>
  1696. <li><a id="toc-shuffleplanes" href="#shuffleplanes">39.204 shuffleplanes</a>
  1697. <ul class="no-bullet">
  1698. <li><a id="toc-Examples-143" href="#Examples-143">39.204.1 Examples</a></li>
  1699. </ul></li>
  1700. <li><a id="toc-signalstats-1" href="#signalstats-1">39.205 signalstats</a>
  1701. <ul class="no-bullet">
  1702. <li><a id="toc-Examples-144" href="#Examples-144">39.205.1 Examples</a></li>
  1703. </ul></li>
  1704. <li><a id="toc-signature-1" href="#signature-1">39.206 signature</a>
  1705. <ul class="no-bullet">
  1706. <li><a id="toc-Examples-145" href="#Examples-145">39.206.1 Examples</a></li>
  1707. </ul></li>
  1708. <li><a id="toc-smartblur-1" href="#smartblur-1">39.207 smartblur</a></li>
  1709. <li><a id="toc-sobel" href="#sobel">39.208 sobel</a>
  1710. <ul class="no-bullet">
  1711. <li><a id="toc-Commands-123" href="#Commands-123">39.208.1 Commands</a></li>
  1712. </ul></li>
  1713. <li><a id="toc-spp-1" href="#spp-1">39.209 spp</a>
  1714. <ul class="no-bullet">
  1715. <li><a id="toc-Commands-124" href="#Commands-124">39.209.1 Commands</a></li>
  1716. </ul></li>
  1717. <li><a id="toc-sr-1" href="#sr-1">39.210 sr</a></li>
  1718. <li><a id="toc-ssim" href="#ssim">39.211 ssim</a>
  1719. <ul class="no-bullet">
  1720. <li><a id="toc-Examples-146" href="#Examples-146">39.211.1 Examples</a></li>
  1721. </ul></li>
  1722. <li><a id="toc-stereo3d" href="#stereo3d">39.212 stereo3d</a>
  1723. <ul class="no-bullet">
  1724. <li><a id="toc-Examples-147" href="#Examples-147">39.212.1 Examples</a></li>
  1725. </ul></li>
  1726. <li><a id="toc-streamselect_002c-astreamselect" href="#streamselect_002c-astreamselect">39.213 streamselect, astreamselect</a>
  1727. <ul class="no-bullet">
  1728. <li><a id="toc-Commands-125" href="#Commands-125">39.213.1 Commands</a></li>
  1729. <li><a id="toc-Examples-148" href="#Examples-148">39.213.2 Examples</a></li>
  1730. </ul></li>
  1731. <li><a id="toc-subtitles-1" href="#subtitles-1">39.214 subtitles</a></li>
  1732. <li><a id="toc-super2xsai" href="#super2xsai">39.215 super2xsai</a></li>
  1733. <li><a id="toc-swaprect" href="#swaprect">39.216 swaprect</a>
  1734. <ul class="no-bullet">
  1735. <li><a id="toc-Commands-126" href="#Commands-126">39.216.1 Commands</a></li>
  1736. </ul></li>
  1737. <li><a id="toc-swapuv" href="#swapuv">39.217 swapuv</a></li>
  1738. <li><a id="toc-tblend" href="#tblend">39.218 tblend</a></li>
  1739. <li><a id="toc-telecine" href="#telecine">39.219 telecine</a></li>
  1740. <li><a id="toc-thistogram" href="#thistogram">39.220 thistogram</a></li>
  1741. <li><a id="toc-threshold" href="#threshold">39.221 threshold</a>
  1742. <ul class="no-bullet">
  1743. <li><a id="toc-Examples-149" href="#Examples-149">39.221.1 Examples</a></li>
  1744. </ul></li>
  1745. <li><a id="toc-thumbnail" href="#thumbnail">39.222 thumbnail</a>
  1746. <ul class="no-bullet">
  1747. <li><a id="toc-Examples-150" href="#Examples-150">39.222.1 Examples</a></li>
  1748. </ul></li>
  1749. <li><a id="toc-tile-1" href="#tile-1">39.223 tile</a>
  1750. <ul class="no-bullet">
  1751. <li><a id="toc-Examples-151" href="#Examples-151">39.223.1 Examples</a></li>
  1752. </ul></li>
  1753. <li><a id="toc-tinterlace" href="#tinterlace">39.224 tinterlace</a></li>
  1754. <li><a id="toc-tmedian" href="#tmedian">39.225 tmedian</a>
  1755. <ul class="no-bullet">
  1756. <li><a id="toc-Commands-127" href="#Commands-127">39.225.1 Commands</a></li>
  1757. </ul></li>
  1758. <li><a id="toc-tmidequalizer" href="#tmidequalizer">39.226 tmidequalizer</a></li>
  1759. <li><a id="toc-tmix" href="#tmix">39.227 tmix</a>
  1760. <ul class="no-bullet">
  1761. <li><a id="toc-Examples-152" href="#Examples-152">39.227.1 Examples</a></li>
  1762. <li><a id="toc-Commands-128" href="#Commands-128">39.227.2 Commands</a></li>
  1763. </ul></li>
  1764. <li><a id="toc-tonemap-1" href="#tonemap-1">39.228 tonemap</a>
  1765. <ul class="no-bullet">
  1766. <li><a id="toc-Options-87" href="#Options-87">39.228.1 Options</a></li>
  1767. </ul></li>
  1768. <li><a id="toc-tpad" href="#tpad">39.229 tpad</a></li>
  1769. <li><a id="toc-transpose-1" href="#transpose-1">39.230 transpose</a></li>
  1770. <li><a id="toc-transpose_005fnpp" href="#transpose_005fnpp">39.231 transpose_npp</a></li>
  1771. <li><a id="toc-trim" href="#trim">39.232 trim</a></li>
  1772. <li><a id="toc-unpremultiply" href="#unpremultiply">39.233 unpremultiply</a></li>
  1773. <li><a id="toc-unsharp-1" href="#unsharp-1">39.234 unsharp</a>
  1774. <ul class="no-bullet">
  1775. <li><a id="toc-Examples-153" href="#Examples-153">39.234.1 Examples</a></li>
  1776. </ul></li>
  1777. <li><a id="toc-untile-1" href="#untile-1">39.235 untile</a>
  1778. <ul class="no-bullet">
  1779. <li><a id="toc-Examples-154" href="#Examples-154">39.235.1 Examples</a></li>
  1780. </ul></li>
  1781. <li><a id="toc-uspp" href="#uspp">39.236 uspp</a></li>
  1782. <li><a id="toc-v360" href="#v360">39.237 v360</a>
  1783. <ul class="no-bullet">
  1784. <li><a id="toc-Examples-155" href="#Examples-155">39.237.1 Examples</a></li>
  1785. <li><a id="toc-Commands-129" href="#Commands-129">39.237.2 Commands</a></li>
  1786. </ul></li>
  1787. <li><a id="toc-vaguedenoiser" href="#vaguedenoiser">39.238 vaguedenoiser</a></li>
  1788. <li><a id="toc-vectorscope" href="#vectorscope">39.239 vectorscope</a></li>
  1789. <li><a id="toc-vidstabdetect-1" href="#vidstabdetect-1">39.240 vidstabdetect</a>
  1790. <ul class="no-bullet">
  1791. <li><a id="toc-Examples-156" href="#Examples-156">39.240.1 Examples</a></li>
  1792. </ul></li>
  1793. <li><a id="toc-vidstabtransform-1" href="#vidstabtransform-1">39.241 vidstabtransform</a>
  1794. <ul class="no-bullet">
  1795. <li><a id="toc-Options-88" href="#Options-88">39.241.1 Options</a></li>
  1796. <li><a id="toc-Examples-157" href="#Examples-157">39.241.2 Examples</a></li>
  1797. </ul></li>
  1798. <li><a id="toc-vflip" href="#vflip">39.242 vflip</a></li>
  1799. <li><a id="toc-vfrdet" href="#vfrdet">39.243 vfrdet</a></li>
  1800. <li><a id="toc-vibrance" href="#vibrance">39.244 vibrance</a>
  1801. <ul class="no-bullet">
  1802. <li><a id="toc-Commands-130" href="#Commands-130">39.244.1 Commands</a></li>
  1803. </ul></li>
  1804. <li><a id="toc-vif" href="#vif">39.245 vif</a></li>
  1805. <li><a id="toc-vignette-1" href="#vignette-1">39.246 vignette</a>
  1806. <ul class="no-bullet">
  1807. <li><a id="toc-Expressions" href="#Expressions">39.246.1 Expressions</a></li>
  1808. <li><a id="toc-Examples-158" href="#Examples-158">39.246.2 Examples</a></li>
  1809. </ul></li>
  1810. <li><a id="toc-vmafmotion" href="#vmafmotion">39.247 vmafmotion</a></li>
  1811. <li><a id="toc-vstack" href="#vstack">39.248 vstack</a></li>
  1812. <li><a id="toc-w3fdif" href="#w3fdif">39.249 w3fdif</a>
  1813. <ul class="no-bullet">
  1814. <li><a id="toc-Commands-131" href="#Commands-131">39.249.1 Commands</a></li>
  1815. </ul></li>
  1816. <li><a id="toc-waveform" href="#waveform">39.250 waveform</a></li>
  1817. <li><a id="toc-weave_002c-doubleweave" href="#weave_002c-doubleweave">39.251 weave, doubleweave</a>
  1818. <ul class="no-bullet">
  1819. <li><a id="toc-Examples-159" href="#Examples-159">39.251.1 Examples</a></li>
  1820. </ul></li>
  1821. <li><a id="toc-xbr" href="#xbr">39.252 xbr</a></li>
  1822. <li><a id="toc-xfade" href="#xfade">39.253 xfade</a>
  1823. <ul class="no-bullet">
  1824. <li><a id="toc-Examples-160" href="#Examples-160">39.253.1 Examples</a></li>
  1825. </ul></li>
  1826. <li><a id="toc-xmedian" href="#xmedian">39.254 xmedian</a>
  1827. <ul class="no-bullet">
  1828. <li><a id="toc-Commands-132" href="#Commands-132">39.254.1 Commands</a></li>
  1829. </ul></li>
  1830. <li><a id="toc-xstack" href="#xstack">39.255 xstack</a>
  1831. <ul class="no-bullet">
  1832. <li><a id="toc-Examples-161" href="#Examples-161">39.255.1 Examples</a></li>
  1833. </ul></li>
  1834. <li><a id="toc-yadif-1" href="#yadif-1">39.256 yadif</a></li>
  1835. <li><a id="toc-yadif_005fcuda" href="#yadif_005fcuda">39.257 yadif_cuda</a></li>
  1836. <li><a id="toc-yaepblur" href="#yaepblur">39.258 yaepblur</a>
  1837. <ul class="no-bullet">
  1838. <li><a id="toc-Commands-133" href="#Commands-133">39.258.1 Commands</a></li>
  1839. </ul></li>
  1840. <li><a id="toc-zoompan" href="#zoompan">39.259 zoompan</a>
  1841. <ul class="no-bullet">
  1842. <li><a id="toc-Examples-162" href="#Examples-162">39.259.1 Examples</a></li>
  1843. </ul></li>
  1844. <li><a id="toc-zscale-1" href="#zscale-1">39.260 zscale</a>
  1845. <ul class="no-bullet">
  1846. <li><a id="toc-Options-89" href="#Options-89">39.260.1 Options</a></li>
  1847. <li><a id="toc-Commands-134" href="#Commands-134">39.260.2 Commands</a></li>
  1848. </ul></li>
  1849. </ul></li>
  1850. <li><a id="toc-OpenCL-Video-Filters" href="#OpenCL-Video-Filters">40 OpenCL Video Filters</a>
  1851. <ul class="no-bullet">
  1852. <li><a id="toc-avgblur_005fopencl" href="#avgblur_005fopencl">40.1 avgblur_opencl</a>
  1853. <ul class="no-bullet">
  1854. <li><a id="toc-Example-4" href="#Example-4">40.1.1 Example</a></li>
  1855. </ul></li>
  1856. <li><a id="toc-boxblur_005fopencl" href="#boxblur_005fopencl">40.2 boxblur_opencl</a>
  1857. <ul class="no-bullet">
  1858. <li><a id="toc-Examples-163" href="#Examples-163">40.2.1 Examples</a></li>
  1859. </ul></li>
  1860. <li><a id="toc-colorkey_005fopencl" href="#colorkey_005fopencl">40.3 colorkey_opencl</a>
  1861. <ul class="no-bullet">
  1862. <li><a id="toc-Examples-164" href="#Examples-164">40.3.1 Examples</a></li>
  1863. </ul></li>
  1864. <li><a id="toc-convolution_005fopencl" href="#convolution_005fopencl">40.4 convolution_opencl</a>
  1865. <ul class="no-bullet">
  1866. <li><a id="toc-Examples-165" href="#Examples-165">40.4.1 Examples</a></li>
  1867. </ul></li>
  1868. <li><a id="toc-erosion_005fopencl" href="#erosion_005fopencl">40.5 erosion_opencl</a>
  1869. <ul class="no-bullet">
  1870. <li><a id="toc-Example-5" href="#Example-5">40.5.1 Example</a></li>
  1871. </ul></li>
  1872. <li><a id="toc-deshake_005fopencl" href="#deshake_005fopencl">40.6 deshake_opencl</a>
  1873. <ul class="no-bullet">
  1874. <li><a id="toc-Examples-166" href="#Examples-166">40.6.1 Examples</a></li>
  1875. </ul></li>
  1876. <li><a id="toc-dilation_005fopencl" href="#dilation_005fopencl">40.7 dilation_opencl</a>
  1877. <ul class="no-bullet">
  1878. <li><a id="toc-Example-6" href="#Example-6">40.7.1 Example</a></li>
  1879. </ul></li>
  1880. <li><a id="toc-nlmeans_005fopencl" href="#nlmeans_005fopencl">40.8 nlmeans_opencl</a></li>
  1881. <li><a id="toc-overlay_005fopencl" href="#overlay_005fopencl">40.9 overlay_opencl</a>
  1882. <ul class="no-bullet">
  1883. <li><a id="toc-Examples-167" href="#Examples-167">40.9.1 Examples</a></li>
  1884. </ul></li>
  1885. <li><a id="toc-pad_005fopencl" href="#pad_005fopencl">40.10 pad_opencl</a></li>
  1886. <li><a id="toc-prewitt_005fopencl" href="#prewitt_005fopencl">40.11 prewitt_opencl</a>
  1887. <ul class="no-bullet">
  1888. <li><a id="toc-Example-7" href="#Example-7">40.11.1 Example</a></li>
  1889. </ul></li>
  1890. <li><a id="toc-program_005fopencl-1" href="#program_005fopencl-1">40.12 program_opencl</a></li>
  1891. <li><a id="toc-roberts_005fopencl" href="#roberts_005fopencl">40.13 roberts_opencl</a>
  1892. <ul class="no-bullet">
  1893. <li><a id="toc-Example-8" href="#Example-8">40.13.1 Example</a></li>
  1894. </ul></li>
  1895. <li><a id="toc-sobel_005fopencl" href="#sobel_005fopencl">40.14 sobel_opencl</a>
  1896. <ul class="no-bullet">
  1897. <li><a id="toc-Example-9" href="#Example-9">40.14.1 Example</a></li>
  1898. </ul></li>
  1899. <li><a id="toc-tonemap_005fopencl" href="#tonemap_005fopencl">40.15 tonemap_opencl</a>
  1900. <ul class="no-bullet">
  1901. <li><a id="toc-Example-10" href="#Example-10">40.15.1 Example</a></li>
  1902. </ul></li>
  1903. <li><a id="toc-unsharp_005fopencl" href="#unsharp_005fopencl">40.16 unsharp_opencl</a>
  1904. <ul class="no-bullet">
  1905. <li><a id="toc-Examples-168" href="#Examples-168">40.16.1 Examples</a></li>
  1906. </ul></li>
  1907. <li><a id="toc-xfade_005fopencl" href="#xfade_005fopencl">40.17 xfade_opencl</a></li>
  1908. </ul></li>
  1909. <li><a id="toc-VAAPI-Video-Filters" href="#VAAPI-Video-Filters">41 VAAPI Video Filters</a>
  1910. <ul class="no-bullet">
  1911. <li><a id="toc-tonemap_005fvaapi" href="#tonemap_005fvaapi">41.1 tonemap_vaapi</a>
  1912. <ul class="no-bullet">
  1913. <li><a id="toc-Example-11" href="#Example-11">41.1.1 Example</a></li>
  1914. </ul></li>
  1915. </ul></li>
  1916. <li><a id="toc-Video-Sources" href="#Video-Sources">42 Video Sources</a>
  1917. <ul class="no-bullet">
  1918. <li><a id="toc-buffer" href="#buffer">42.1 buffer</a></li>
  1919. <li><a id="toc-cellauto" href="#cellauto">42.2 cellauto</a>
  1920. <ul class="no-bullet">
  1921. <li><a id="toc-Examples-169" href="#Examples-169">42.2.1 Examples</a></li>
  1922. </ul></li>
  1923. <li><a id="toc-coreimagesrc-1" href="#coreimagesrc-1">42.3 coreimagesrc</a>
  1924. <ul class="no-bullet">
  1925. <li><a id="toc-Examples-170" href="#Examples-170">42.3.1 Examples</a></li>
  1926. </ul></li>
  1927. <li><a id="toc-gradients" href="#gradients">42.4 gradients</a></li>
  1928. <li><a id="toc-mandelbrot" href="#mandelbrot">42.5 mandelbrot</a></li>
  1929. <li><a id="toc-mptestsrc" href="#mptestsrc">42.6 mptestsrc</a></li>
  1930. <li><a id="toc-frei0r_005fsrc" href="#frei0r_005fsrc">42.7 frei0r_src</a></li>
  1931. <li><a id="toc-life" href="#life">42.8 life</a>
  1932. <ul class="no-bullet">
  1933. <li><a id="toc-Examples-171" href="#Examples-171">42.8.1 Examples</a></li>
  1934. </ul></li>
  1935. <li><a id="toc-allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc" href="#allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc">42.9 allrgb, allyuv, color, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc</a>
  1936. <ul class="no-bullet">
  1937. <li><a id="toc-Examples-172" href="#Examples-172">42.9.1 Examples</a></li>
  1938. <li><a id="toc-Commands-135" href="#Commands-135">42.9.2 Commands</a></li>
  1939. </ul></li>
  1940. <li><a id="toc-openclsrc" href="#openclsrc">42.10 openclsrc</a></li>
  1941. <li><a id="toc-sierpinski" href="#sierpinski">42.11 sierpinski</a></li>
  1942. </ul></li>
  1943. <li><a id="toc-Video-Sinks" href="#Video-Sinks">43 Video Sinks</a>
  1944. <ul class="no-bullet">
  1945. <li><a id="toc-buffersink" href="#buffersink">43.1 buffersink</a></li>
  1946. <li><a id="toc-nullsink" href="#nullsink">43.2 nullsink</a></li>
  1947. </ul></li>
  1948. <li><a id="toc-Multimedia-Filters" href="#Multimedia-Filters">44 Multimedia Filters</a>
  1949. <ul class="no-bullet">
  1950. <li><a id="toc-abitscope" href="#abitscope">44.1 abitscope</a></li>
  1951. <li><a id="toc-adrawgraph" href="#adrawgraph">44.2 adrawgraph</a></li>
  1952. <li><a id="toc-agraphmonitor" href="#agraphmonitor">44.3 agraphmonitor</a></li>
  1953. <li><a id="toc-ahistogram" href="#ahistogram">44.4 ahistogram</a></li>
  1954. <li><a id="toc-aphasemeter" href="#aphasemeter">44.5 aphasemeter</a>
  1955. <ul class="no-bullet">
  1956. <li><a id="toc-phasing-detection" href="#phasing-detection">44.5.1 phasing detection</a></li>
  1957. <li><a id="toc-Examples-173" href="#Examples-173">44.5.2 Examples</a></li>
  1958. </ul></li>
  1959. <li><a id="toc-avectorscope" href="#avectorscope">44.6 avectorscope</a>
  1960. <ul class="no-bullet">
  1961. <li><a id="toc-Examples-174" href="#Examples-174">44.6.1 Examples</a></li>
  1962. </ul></li>
  1963. <li><a id="toc-bench_002c-abench" href="#bench_002c-abench">44.7 bench, abench</a>
  1964. <ul class="no-bullet">
  1965. <li><a id="toc-Examples-175" href="#Examples-175">44.7.1 Examples</a></li>
  1966. </ul></li>
  1967. <li><a id="toc-concat-3" href="#concat-3">44.8 concat</a>
  1968. <ul class="no-bullet">
  1969. <li><a id="toc-Examples-176" href="#Examples-176">44.8.1 Examples</a></li>
  1970. <li><a id="toc-Commands-136" href="#Commands-136">44.8.2 Commands</a></li>
  1971. </ul></li>
  1972. <li><a id="toc-ebur128-1" href="#ebur128-1">44.9 ebur128</a>
  1973. <ul class="no-bullet">
  1974. <li><a id="toc-Examples-177" href="#Examples-177">44.9.1 Examples</a></li>
  1975. </ul></li>
  1976. <li><a id="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">44.10 interleave, ainterleave</a>
  1977. <ul class="no-bullet">
  1978. <li><a id="toc-Examples-178" href="#Examples-178">44.10.1 Examples</a></li>
  1979. </ul></li>
  1980. <li><a id="toc-metadata_002c-ametadata" href="#metadata_002c-ametadata">44.11 metadata, ametadata</a>
  1981. <ul class="no-bullet">
  1982. <li><a id="toc-Examples-179" href="#Examples-179">44.11.1 Examples</a></li>
  1983. </ul></li>
  1984. <li><a id="toc-perms_002c-aperms" href="#perms_002c-aperms">44.12 perms, aperms</a></li>
  1985. <li><a id="toc-realtime_002c-arealtime" href="#realtime_002c-arealtime">44.13 realtime, arealtime</a></li>
  1986. <li><a id="toc-select_002c-aselect" href="#select_002c-aselect">44.14 select, aselect</a>
  1987. <ul class="no-bullet">
  1988. <li><a id="toc-Examples-180" href="#Examples-180">44.14.1 Examples</a></li>
  1989. </ul></li>
  1990. <li><a id="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">44.15 sendcmd, asendcmd</a>
  1991. <ul class="no-bullet">
  1992. <li><a id="toc-Commands-syntax" href="#Commands-syntax">44.15.1 Commands syntax</a></li>
  1993. <li><a id="toc-Examples-181" href="#Examples-181">44.15.2 Examples</a></li>
  1994. </ul></li>
  1995. <li><a id="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">44.16 setpts, asetpts</a>
  1996. <ul class="no-bullet">
  1997. <li><a id="toc-Examples-182" href="#Examples-182">44.16.1 Examples</a></li>
  1998. </ul></li>
  1999. <li><a id="toc-setrange" href="#setrange">44.17 setrange</a></li>
  2000. <li><a id="toc-settb_002c-asettb" href="#settb_002c-asettb">44.18 settb, asettb</a>
  2001. <ul class="no-bullet">
  2002. <li><a id="toc-Examples-183" href="#Examples-183">44.18.1 Examples</a></li>
  2003. </ul></li>
  2004. <li><a id="toc-showcqt" href="#showcqt">44.19 showcqt</a>
  2005. <ul class="no-bullet">
  2006. <li><a id="toc-Examples-184" href="#Examples-184">44.19.1 Examples</a></li>
  2007. </ul></li>
  2008. <li><a id="toc-showfreqs" href="#showfreqs">44.20 showfreqs</a></li>
  2009. <li><a id="toc-showspatial" href="#showspatial">44.21 showspatial</a></li>
  2010. <li><a id="toc-showspectrum-1" href="#showspectrum-1">44.22 showspectrum</a>
  2011. <ul class="no-bullet">
  2012. <li><a id="toc-Examples-185" href="#Examples-185">44.22.1 Examples</a></li>
  2013. </ul></li>
  2014. <li><a id="toc-showspectrumpic" href="#showspectrumpic">44.23 showspectrumpic</a>
  2015. <ul class="no-bullet">
  2016. <li><a id="toc-Examples-186" href="#Examples-186">44.23.1 Examples</a></li>
  2017. </ul></li>
  2018. <li><a id="toc-showvolume" href="#showvolume">44.24 showvolume</a></li>
  2019. <li><a id="toc-showwaves" href="#showwaves">44.25 showwaves</a>
  2020. <ul class="no-bullet">
  2021. <li><a id="toc-Examples-187" href="#Examples-187">44.25.1 Examples</a></li>
  2022. </ul></li>
  2023. <li><a id="toc-showwavespic" href="#showwavespic">44.26 showwavespic</a>
  2024. <ul class="no-bullet">
  2025. <li><a id="toc-Examples-188" href="#Examples-188">44.26.1 Examples</a></li>
  2026. </ul></li>
  2027. <li><a id="toc-sidedata_002c-asidedata" href="#sidedata_002c-asidedata">44.27 sidedata, asidedata</a></li>
  2028. <li><a id="toc-spectrumsynth" href="#spectrumsynth">44.28 spectrumsynth</a>
  2029. <ul class="no-bullet">
  2030. <li><a id="toc-Examples-189" href="#Examples-189">44.28.1 Examples</a></li>
  2031. </ul></li>
  2032. <li><a id="toc-split_002c-asplit" href="#split_002c-asplit">44.29 split, asplit</a>
  2033. <ul class="no-bullet">
  2034. <li><a id="toc-Examples-190" href="#Examples-190">44.29.1 Examples</a></li>
  2035. </ul></li>
  2036. <li><a id="toc-zmq_002c-azmq" href="#zmq_002c-azmq">44.30 zmq, azmq</a>
  2037. <ul class="no-bullet">
  2038. <li><a id="toc-Examples-191" href="#Examples-191">44.30.1 Examples</a></li>
  2039. </ul></li>
  2040. </ul></li>
  2041. <li><a id="toc-Multimedia-Sources" href="#Multimedia-Sources">45 Multimedia Sources</a>
  2042. <ul class="no-bullet">
  2043. <li><a id="toc-amovie" href="#amovie">45.1 amovie</a></li>
  2044. <li><a id="toc-movie-1" href="#movie-1">45.2 movie</a>
  2045. <ul class="no-bullet">
  2046. <li><a id="toc-Examples-192" href="#Examples-192">45.2.1 Examples</a></li>
  2047. <li><a id="toc-Commands-137" href="#Commands-137">45.2.2 Commands</a></li>
  2048. </ul></li>
  2049. </ul></li>
  2050. <li><a id="toc-External-libraries" href="#External-libraries">46 External libraries</a>
  2051. <ul class="no-bullet">
  2052. <li><a id="toc-Alliance-for-Open-Media-_0028AOM_0029" href="#Alliance-for-Open-Media-_0028AOM_0029">46.1 Alliance for Open Media (AOM)</a></li>
  2053. <li><a id="toc-AMD-AMF_002fVCE" href="#AMD-AMF_002fVCE">46.2 AMD AMF/VCE</a></li>
  2054. <li><a id="toc-AviSynth" href="#AviSynth">46.3 AviSynth</a></li>
  2055. <li><a id="toc-Chromaprint" href="#Chromaprint">46.4 Chromaprint</a></li>
  2056. <li><a id="toc-codec2" href="#codec2">46.5 codec2</a></li>
  2057. <li><a id="toc-dav1d" href="#dav1d">46.6 dav1d</a></li>
  2058. <li><a id="toc-davs2" href="#davs2">46.7 davs2</a></li>
  2059. <li><a id="toc-uavs3d" href="#uavs3d">46.8 uavs3d</a></li>
  2060. <li><a id="toc-Game-Music-Emu" href="#Game-Music-Emu">46.9 Game Music Emu</a></li>
  2061. <li><a id="toc-Intel-QuickSync-Video" href="#Intel-QuickSync-Video">46.10 Intel QuickSync Video</a></li>
  2062. <li><a id="toc-Kvazaar" href="#Kvazaar">46.11 Kvazaar</a></li>
  2063. <li><a id="toc-LAME" href="#LAME">46.12 LAME</a></li>
  2064. <li><a id="toc-libilbc-1" href="#libilbc-1">46.13 libilbc</a></li>
  2065. <li><a id="toc-libvpx-1" href="#libvpx-1">46.14 libvpx</a></li>
  2066. <li><a id="toc-ModPlug" href="#ModPlug">46.15 ModPlug</a></li>
  2067. <li><a id="toc-OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries" href="#OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries">46.16 OpenCORE, VisualOn, and Fraunhofer libraries</a>
  2068. <ul class="no-bullet">
  2069. <li><a id="toc-OpenCORE-AMR" href="#OpenCORE-AMR">46.16.1 OpenCORE AMR</a></li>
  2070. <li><a id="toc-VisualOn-AMR_002dWB-encoder-library" href="#VisualOn-AMR_002dWB-encoder-library">46.16.2 VisualOn AMR-WB encoder library</a></li>
  2071. <li><a id="toc-Fraunhofer-AAC-library" href="#Fraunhofer-AAC-library">46.16.3 Fraunhofer AAC library</a></li>
  2072. </ul></li>
  2073. <li><a id="toc-OpenH264" href="#OpenH264">46.17 OpenH264</a></li>
  2074. <li><a id="toc-OpenJPEG" href="#OpenJPEG">46.18 OpenJPEG</a></li>
  2075. <li><a id="toc-rav1e" href="#rav1e">46.19 rav1e</a></li>
  2076. <li><a id="toc-SVT_002dAV1" href="#SVT_002dAV1">46.20 SVT-AV1</a></li>
  2077. <li><a id="toc-TwoLAME" href="#TwoLAME">46.21 TwoLAME</a></li>
  2078. <li><a id="toc-VapourSynth" href="#VapourSynth">46.22 VapourSynth</a></li>
  2079. <li><a id="toc-x264" href="#x264">46.23 x264</a></li>
  2080. <li><a id="toc-x265" href="#x265">46.24 x265</a></li>
  2081. <li><a id="toc-xavs" href="#xavs">46.25 xavs</a></li>
  2082. <li><a id="toc-xavs2" href="#xavs2">46.26 xavs2</a></li>
  2083. <li><a id="toc-ZVBI" href="#ZVBI">46.27 ZVBI</a></li>
  2084. </ul></li>
  2085. <li><a id="toc-Supported-File-Formats_002c-Codecs-or-Features" href="#Supported-File-Formats_002c-Codecs-or-Features">47 Supported File Formats, Codecs or Features</a>
  2086. <ul class="no-bullet">
  2087. <li><a id="toc-File-Formats" href="#File-Formats">47.1 File Formats</a></li>
  2088. <li><a id="toc-Image-Formats" href="#Image-Formats">47.2 Image Formats</a></li>
  2089. <li><a id="toc-Video-Codecs" href="#Video-Codecs">47.3 Video Codecs</a></li>
  2090. <li><a id="toc-Audio-Codecs" href="#Audio-Codecs">47.4 Audio Codecs</a></li>
  2091. <li><a id="toc-Subtitle-Formats" href="#Subtitle-Formats">47.5 Subtitle Formats</a></li>
  2092. <li><a id="toc-Network-Protocols" href="#Network-Protocols">47.6 Network Protocols</a></li>
  2093. <li><a id="toc-Input_002fOutput-Devices" href="#Input_002fOutput-Devices">47.7 Input/Output Devices</a></li>
  2094. <li><a id="toc-Timecode" href="#Timecode">47.8 Timecode</a></li>
  2095. </ul></li>
  2096. <li><a id="toc-See-Also" href="#See-Also">48 See Also</a></li>
  2097. <li><a id="toc-Authors" href="#Authors">49 Authors</a></li>
  2098. </ul>
  2099. </div>
  2100. <a name="Synopsis"></a>
  2101. <h2 class="chapter">1 Synopsis<span class="pull-right"><a class="anchor hidden-xs" href="#Synopsis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Synopsis" aria-hidden="true">TOC</a></span></h2>
  2102. <p>ffmpeg [<var>global_options</var>] {[<var>input_file_options</var>] -i <samp>input_url</samp>} ... {[<var>output_file_options</var>] <samp>output_url</samp>} ...
  2103. </p>
  2104. <a name="Description"></a>
  2105. <h2 class="chapter">2 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
  2106. <p><code>ffmpeg</code> is a very fast video and audio converter that can also grab from
  2107. a live audio/video source. It can also convert between arbitrary sample
  2108. rates and resize video on the fly with a high quality polyphase filter.
  2109. </p>
  2110. <p><code>ffmpeg</code> reads from an arbitrary number of input &quot;files&quot; (which can be regular
  2111. files, pipes, network streams, grabbing devices, etc.), specified by the
  2112. <code>-i</code> option, and writes to an arbitrary number of output &quot;files&quot;, which are
  2113. specified by a plain output url. Anything found on the command line which
  2114. cannot be interpreted as an option is considered to be an output url.
  2115. </p>
  2116. <p>Each input or output url can, in principle, contain any number of streams of
  2117. different types (video/audio/subtitle/attachment/data). The allowed number and/or
  2118. types of streams may be limited by the container format. Selecting which
  2119. streams from which inputs will go into which output is either done automatically
  2120. or with the <code>-map</code> option (see the Stream selection chapter).
  2121. </p>
  2122. <p>To refer to input files in options, you must use their indices (0-based). E.g.
  2123. the first input file is <code>0</code>, the second is <code>1</code>, etc. Similarly, streams
  2124. within a file are referred to by their indices. E.g. <code>2:3</code> refers to the
  2125. fourth stream in the third input file. Also see the Stream specifiers chapter.
  2126. </p>
  2127. <p>As a general rule, options are applied to the next specified
  2128. file. Therefore, order is important, and you can have the same
  2129. option on the command line multiple times. Each occurrence is
  2130. then applied to the next input or output file.
  2131. Exceptions from this rule are the global options (e.g. verbosity level),
  2132. which should be specified first.
  2133. </p>
  2134. <p>Do not mix input and output files &ndash; first specify all input files, then all
  2135. output files. Also do not mix options which belong to different files. All
  2136. options apply ONLY to the next input or output file and are reset between files.
  2137. </p>
  2138. <ul>
  2139. <li> To set the video bitrate of the output file to 64 kbit/s:
  2140. <div class="example">
  2141. <pre class="example">ffmpeg -i input.avi -b:v 64k -bufsize 64k output.avi
  2142. </pre></div>
  2143. </li><li> To force the frame rate of the output file to 24 fps:
  2144. <div class="example">
  2145. <pre class="example">ffmpeg -i input.avi -r 24 output.avi
  2146. </pre></div>
  2147. </li><li> To force the frame rate of the input file (valid for raw formats only)
  2148. to 1 fps and the frame rate of the output file to 24 fps:
  2149. <div class="example">
  2150. <pre class="example">ffmpeg -r 1 -i input.m2v -r 24 output.avi
  2151. </pre></div>
  2152. </li></ul>
  2153. <p>The format option may be needed for raw input files.
  2154. </p>
  2155. <a name="Detailed-description"></a>
  2156. <h2 class="chapter">3 Detailed description<span class="pull-right"><a class="anchor hidden-xs" href="#Detailed-description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Detailed-description" aria-hidden="true">TOC</a></span></h2>
  2157. <p>The transcoding process in <code>ffmpeg</code> for each output can be described by
  2158. the following diagram:
  2159. </p>
  2160. <pre class="verbatim"> _______ ______________
  2161. | | | |
  2162. | input | demuxer | encoded data | decoder
  2163. | file | ---------&gt; | packets | -----+
  2164. |_______| |______________| |
  2165. v
  2166. _________
  2167. | |
  2168. | decoded |
  2169. | frames |
  2170. |_________|
  2171. ________ ______________ |
  2172. | | | | |
  2173. | output | &lt;-------- | encoded data | &lt;----+
  2174. | file | muxer | packets | encoder
  2175. |________| |______________|
  2176. </pre>
  2177. <p><code>ffmpeg</code> calls the libavformat library (containing demuxers) to read
  2178. input files and get packets containing encoded data from them. When there are
  2179. multiple input files, <code>ffmpeg</code> tries to keep them synchronized by
  2180. tracking lowest timestamp on any active input stream.
  2181. </p>
  2182. <p>Encoded packets are then passed to the decoder (unless streamcopy is selected
  2183. for the stream, see further for a description). The decoder produces
  2184. uncompressed frames (raw video/PCM audio/...) which can be processed further by
  2185. filtering (see next section). After filtering, the frames are passed to the
  2186. encoder, which encodes them and outputs encoded packets. Finally those are
  2187. passed to the muxer, which writes the encoded packets to the output file.
  2188. </p>
  2189. <a name="Filtering"></a>
  2190. <h3 class="section">3.1 Filtering<span class="pull-right"><a class="anchor hidden-xs" href="#Filtering" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtering" aria-hidden="true">TOC</a></span></h3>
  2191. <p>Before encoding, <code>ffmpeg</code> can process raw audio and video frames using
  2192. filters from the libavfilter library. Several chained filters form a filter
  2193. graph. <code>ffmpeg</code> distinguishes between two types of filtergraphs:
  2194. simple and complex.
  2195. </p>
  2196. <a name="Simple-filtergraphs"></a>
  2197. <h4 class="subsection">3.1.1 Simple filtergraphs<span class="pull-right"><a class="anchor hidden-xs" href="#Simple-filtergraphs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Simple-filtergraphs" aria-hidden="true">TOC</a></span></h4>
  2198. <p>Simple filtergraphs are those that have exactly one input and output, both of
  2199. the same type. In the above diagram they can be represented by simply inserting
  2200. an additional step between decoding and encoding:
  2201. </p>
  2202. <pre class="verbatim"> _________ ______________
  2203. | | | |
  2204. | decoded | | encoded data |
  2205. | frames |\ _ | packets |
  2206. |_________| \ /||______________|
  2207. \ __________ /
  2208. simple _\|| | / encoder
  2209. filtergraph | filtered |/
  2210. | frames |
  2211. |__________|
  2212. </pre>
  2213. <p>Simple filtergraphs are configured with the per-stream <samp>-filter</samp> option
  2214. (with <samp>-vf</samp> and <samp>-af</samp> aliases for video and audio respectively).
  2215. A simple filtergraph for video can look for example like this:
  2216. </p>
  2217. <pre class="verbatim"> _______ _____________ _______ ________
  2218. | | | | | | | |
  2219. | input | ---&gt; | deinterlace | ---&gt; | scale | ---&gt; | output |
  2220. |_______| |_____________| |_______| |________|
  2221. </pre>
  2222. <p>Note that some filters change frame properties but not frame contents. E.g. the
  2223. <code>fps</code> filter in the example above changes number of frames, but does not
  2224. touch the frame contents. Another example is the <code>setpts</code> filter, which
  2225. only sets timestamps and otherwise passes the frames unchanged.
  2226. </p>
  2227. <a name="Complex-filtergraphs"></a>
  2228. <h4 class="subsection">3.1.2 Complex filtergraphs<span class="pull-right"><a class="anchor hidden-xs" href="#Complex-filtergraphs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Complex-filtergraphs" aria-hidden="true">TOC</a></span></h4>
  2229. <p>Complex filtergraphs are those which cannot be described as simply a linear
  2230. processing chain applied to one stream. This is the case, for example, when the graph has
  2231. more than one input and/or output, or when output stream type is different from
  2232. input. They can be represented with the following diagram:
  2233. </p>
  2234. <pre class="verbatim"> _________
  2235. | |
  2236. | input 0 |\ __________
  2237. |_________| \ | |
  2238. \ _________ /| output 0 |
  2239. \ | | / |__________|
  2240. _________ \| complex | /
  2241. | | | |/
  2242. | input 1 |----&gt;| filter |\
  2243. |_________| | | \ __________
  2244. /| graph | \ | |
  2245. / | | \| output 1 |
  2246. _________ / |_________| |__________|
  2247. | | /
  2248. | input 2 |/
  2249. |_________|
  2250. </pre>
  2251. <p>Complex filtergraphs are configured with the <samp>-filter_complex</samp> option.
  2252. Note that this option is global, since a complex filtergraph, by its nature,
  2253. cannot be unambiguously associated with a single stream or file.
  2254. </p>
  2255. <p>The <samp>-lavfi</samp> option is equivalent to <samp>-filter_complex</samp>.
  2256. </p>
  2257. <p>A trivial example of a complex filtergraph is the <code>overlay</code> filter, which
  2258. has two video inputs and one video output, containing one video overlaid on top
  2259. of the other. Its audio counterpart is the <code>amix</code> filter.
  2260. </p>
  2261. <a name="Stream-copy"></a>
  2262. <h3 class="section">3.2 Stream copy<span class="pull-right"><a class="anchor hidden-xs" href="#Stream-copy" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Stream-copy" aria-hidden="true">TOC</a></span></h3>
  2263. <p>Stream copy is a mode selected by supplying the <code>copy</code> parameter to the
  2264. <samp>-codec</samp> option. It makes <code>ffmpeg</code> omit the decoding and encoding
  2265. step for the specified stream, so it does only demuxing and muxing. It is useful
  2266. for changing the container format or modifying container-level metadata. The
  2267. diagram above will, in this case, simplify to this:
  2268. </p>
  2269. <pre class="verbatim"> _______ ______________ ________
  2270. | | | | | |
  2271. | input | demuxer | encoded data | muxer | output |
  2272. | file | ---------&gt; | packets | -------&gt; | file |
  2273. |_______| |______________| |________|
  2274. </pre>
  2275. <p>Since there is no decoding or encoding, it is very fast and there is no quality
  2276. loss. However, it might not work in some cases because of many factors. Applying
  2277. filters is obviously also impossible, since filters work on uncompressed data.
  2278. </p>
  2279. <a name="Stream-selection"></a>
  2280. <h2 class="chapter">4 Stream selection<span class="pull-right"><a class="anchor hidden-xs" href="#Stream-selection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Stream-selection" aria-hidden="true">TOC</a></span></h2>
  2281. <p><code>ffmpeg</code> provides the <code>-map</code> option for manual control of stream selection in each
  2282. output file. Users can skip <code>-map</code> and let ffmpeg perform automatic stream selection as
  2283. described below. The <code>-vn / -an / -sn / -dn</code> options can be used to skip inclusion of
  2284. video, audio, subtitle and data streams respectively, whether manually mapped or automatically
  2285. selected, except for those streams which are outputs of complex filtergraphs.
  2286. </p>
  2287. <a name="Description-1"></a>
  2288. <h3 class="section">4.1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description-1" aria-hidden="true">TOC</a></span></h3>
  2289. <p>The sub-sections that follow describe the various rules that are involved in stream selection.
  2290. The examples that follow next show how these rules are applied in practice.
  2291. </p>
  2292. <p>While every effort is made to accurately reflect the behavior of the program, FFmpeg is under
  2293. continuous development and the code may have changed since the time of this writing.
  2294. </p>
  2295. <a name="Automatic-stream-selection"></a>
  2296. <h4 class="subsection">4.1.1 Automatic stream selection<span class="pull-right"><a class="anchor hidden-xs" href="#Automatic-stream-selection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Automatic-stream-selection" aria-hidden="true">TOC</a></span></h4>
  2297. <p>In the absence of any map options for a particular output file, ffmpeg inspects the output
  2298. format to check which type of streams can be included in it, viz. video, audio and/or
  2299. subtitles. For each acceptable stream type, ffmpeg will pick one stream, when available,
  2300. from among all the inputs.
  2301. </p>
  2302. <p>It will select that stream based upon the following criteria:
  2303. </p><ul>
  2304. <li> for video, it is the stream with the highest resolution,
  2305. </li><li> for audio, it is the stream with the most channels,
  2306. </li><li> for subtitles, it is the first subtitle stream found but there&rsquo;s a caveat.
  2307. The output format&rsquo;s default subtitle encoder can be either text-based or image-based,
  2308. and only a subtitle stream of the same type will be chosen.
  2309. </li></ul>
  2310. <p>In the case where several streams of the same type rate equally, the stream with the lowest
  2311. index is chosen.
  2312. </p>
  2313. <p>Data or attachment streams are not automatically selected and can only be included
  2314. using <code>-map</code>.
  2315. </p><a name="Manual-stream-selection"></a>
  2316. <h4 class="subsection">4.1.2 Manual stream selection<span class="pull-right"><a class="anchor hidden-xs" href="#Manual-stream-selection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Manual-stream-selection" aria-hidden="true">TOC</a></span></h4>
  2317. <p>When <code>-map</code> is used, only user-mapped streams are included in that output file,
  2318. with one possible exception for filtergraph outputs described below.
  2319. </p>
  2320. <a name="Complex-filtergraphs-1"></a>
  2321. <h4 class="subsection">4.1.3 Complex filtergraphs<span class="pull-right"><a class="anchor hidden-xs" href="#Complex-filtergraphs-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Complex-filtergraphs-1" aria-hidden="true">TOC</a></span></h4>
  2322. <p>If there are any complex filtergraph output streams with unlabeled pads, they will be added
  2323. to the first output file. This will lead to a fatal error if the stream type is not supported
  2324. by the output format. In the absence of the map option, the inclusion of these streams leads
  2325. to the automatic stream selection of their types being skipped. If map options are present,
  2326. these filtergraph streams are included in addition to the mapped streams.
  2327. </p>
  2328. <p>Complex filtergraph output streams with labeled pads must be mapped once and exactly once.
  2329. </p>
  2330. <a name="Stream-handling"></a>
  2331. <h4 class="subsection">4.1.4 Stream handling<span class="pull-right"><a class="anchor hidden-xs" href="#Stream-handling" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Stream-handling" aria-hidden="true">TOC</a></span></h4>
  2332. <p>Stream handling is independent of stream selection, with an exception for subtitles described
  2333. below. Stream handling is set via the <code>-codec</code> option addressed to streams within a
  2334. specific <em>output</em> file. In particular, codec options are applied by ffmpeg after the
  2335. stream selection process and thus do not influence the latter. If no <code>-codec</code> option is
  2336. specified for a stream type, ffmpeg will select the default encoder registered by the output
  2337. file muxer.
  2338. </p>
  2339. <p>An exception exists for subtitles. If a subtitle encoder is specified for an output file, the
  2340. first subtitle stream found of any type, text or image, will be included. ffmpeg does not validate
  2341. if the specified encoder can convert the selected stream or if the converted stream is acceptable
  2342. within the output format. This applies generally as well: when the user sets an encoder manually,
  2343. the stream selection process cannot check if the encoded stream can be muxed into the output file.
  2344. If it cannot, ffmpeg will abort and <em>all</em> output files will fail to be processed.
  2345. </p>
  2346. <a name="Examples"></a>
  2347. <h3 class="section">4.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples" aria-hidden="true">TOC</a></span></h3>
  2348. <p>The following examples illustrate the behavior, quirks and limitations of ffmpeg&rsquo;s stream
  2349. selection methods.
  2350. </p>
  2351. <p>They assume the following three input files.
  2352. </p>
  2353. <pre class="verbatim">
  2354. input file 'A.avi'
  2355. stream 0: video 640x360
  2356. stream 1: audio 2 channels
  2357. input file 'B.mp4'
  2358. stream 0: video 1920x1080
  2359. stream 1: audio 2 channels
  2360. stream 2: subtitles (text)
  2361. stream 3: audio 5.1 channels
  2362. stream 4: subtitles (text)
  2363. input file 'C.mkv'
  2364. stream 0: video 1280x720
  2365. stream 1: audio 2 channels
  2366. stream 2: subtitles (image)
  2367. </pre>
  2368. <a name="Example_003a-automatic-stream-selection"></a>
  2369. <div class="example">
  2370. <pre class="example">ffmpeg -i A.avi -i B.mp4 out1.mkv out2.wav -map 1:a -c:a copy out3.mov
  2371. </pre></div>
  2372. <p>There are three output files specified, and for the first two, no <code>-map</code> options
  2373. are set, so ffmpeg will select streams for these two files automatically.
  2374. </p>
  2375. <p><samp>out1.mkv</samp> is a Matroska container file and accepts video, audio and subtitle streams,
  2376. so ffmpeg will try to select one of each type.<br>
  2377. For video, it will select <code>stream 0</code> from <samp>B.mp4</samp>, which has the highest
  2378. resolution among all the input video streams.<br>
  2379. For audio, it will select <code>stream 3</code> from <samp>B.mp4</samp>, since it has the greatest
  2380. number of channels.<br>
  2381. For subtitles, it will select <code>stream 2</code> from <samp>B.mp4</samp>, which is the first subtitle
  2382. stream from among <samp>A.avi</samp> and <samp>B.mp4</samp>.
  2383. </p>
  2384. <p><samp>out2.wav</samp> accepts only audio streams, so only <code>stream 3</code> from <samp>B.mp4</samp> is
  2385. selected.
  2386. </p>
  2387. <p>For <samp>out3.mov</samp>, since a <code>-map</code> option is set, no automatic stream selection will
  2388. occur. The <code>-map 1:a</code> option will select all audio streams from the second input
  2389. <samp>B.mp4</samp>. No other streams will be included in this output file.
  2390. </p>
  2391. <p>For the first two outputs, all included streams will be transcoded. The encoders chosen will
  2392. be the default ones registered by each output format, which may not match the codec of the
  2393. selected input streams.
  2394. </p>
  2395. <p>For the third output, codec option for audio streams has been set
  2396. to <code>copy</code>, so no decoding-filtering-encoding operations will occur, or <em>can</em> occur.
  2397. Packets of selected streams shall be conveyed from the input file and muxed within the output
  2398. file.
  2399. </p>
  2400. <a name="Example_003a-automatic-subtitles-selection"></a>
  2401. <div class="example">
  2402. <pre class="example">ffmpeg -i C.mkv out1.mkv -c:s dvdsub -an out2.mkv
  2403. </pre></div>
  2404. <p>Although <samp>out1.mkv</samp> is a Matroska container file which accepts subtitle streams, only a
  2405. video and audio stream shall be selected. The subtitle stream of <samp>C.mkv</samp> is image-based
  2406. and the default subtitle encoder of the Matroska muxer is text-based, so a transcode operation
  2407. for the subtitles is expected to fail and hence the stream isn&rsquo;t selected. However, in
  2408. <samp>out2.mkv</samp>, a subtitle encoder is specified in the command and so, the subtitle stream is
  2409. selected, in addition to the video stream. The presence of <code>-an</code> disables audio stream
  2410. selection for <samp>out2.mkv</samp>.
  2411. </p>
  2412. <a name="Example_003a-unlabeled-filtergraph-outputs"></a>
  2413. <div class="example">
  2414. <pre class="example">ffmpeg -i A.avi -i C.mkv -i B.mp4 -filter_complex &quot;overlay&quot; out1.mp4 out2.srt
  2415. </pre></div>
  2416. <p>A filtergraph is setup here using the <code>-filter_complex</code> option and consists of a single
  2417. video filter. The <code>overlay</code> filter requires exactly two video inputs, but none are
  2418. specified, so the first two available video streams are used, those of <samp>A.avi</samp> and
  2419. <samp>C.mkv</samp>. The output pad of the filter has no label and so is sent to the first output file
  2420. <samp>out1.mp4</samp>. Due to this, automatic selection of the video stream is skipped, which would
  2421. have selected the stream in <samp>B.mp4</samp>. The audio stream with most channels viz. <code>stream 3</code>
  2422. in <samp>B.mp4</samp>, is chosen automatically. No subtitle stream is chosen however, since the MP4
  2423. format has no default subtitle encoder registered, and the user hasn&rsquo;t specified a subtitle encoder.
  2424. </p>
  2425. <p>The 2nd output file, <samp>out2.srt</samp>, only accepts text-based subtitle streams. So, even though
  2426. the first subtitle stream available belongs to <samp>C.mkv</samp>, it is image-based and hence skipped.
  2427. The selected stream, <code>stream 2</code> in <samp>B.mp4</samp>, is the first text-based subtitle stream.
  2428. </p>
  2429. <a name="Example_003a-labeled-filtergraph-outputs"></a>
  2430. <div class="example">
  2431. <pre class="example">ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex &quot;[1:v]hue=s=0[outv];overlay;aresample&quot; \
  2432. -map '[outv]' -an out1.mp4 \
  2433. out2.mkv \
  2434. -map '[outv]' -map 1:a:0 out3.mkv
  2435. </pre></div>
  2436. <p>The above command will fail, as the output pad labelled <code>[outv]</code> has been mapped twice.
  2437. None of the output files shall be processed.
  2438. </p>
  2439. <div class="example">
  2440. <pre class="example">ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex &quot;[1:v]hue=s=0[outv];overlay;aresample&quot; \
  2441. -an out1.mp4 \
  2442. out2.mkv \
  2443. -map 1:a:0 out3.mkv
  2444. </pre></div>
  2445. <p>This command above will also fail as the hue filter output has a label, <code>[outv]</code>,
  2446. and hasn&rsquo;t been mapped anywhere.
  2447. </p>
  2448. <p>The command should be modified as follows,
  2449. </p><div class="example">
  2450. <pre class="example">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; \
  2451. -map '[outv1]' -an out1.mp4 \
  2452. out2.mkv \
  2453. -map '[outv2]' -map 1:a:0 out3.mkv
  2454. </pre></div>
  2455. <p>The video stream from <samp>B.mp4</samp> is sent to the hue filter, whose output is cloned once using
  2456. the split filter, and both outputs labelled. Then a copy each is mapped to the first and third
  2457. output files.
  2458. </p>
  2459. <p>The overlay filter, requiring two video inputs, uses the first two unused video streams. Those
  2460. are the streams from <samp>A.avi</samp> and <samp>C.mkv</samp>. The overlay output isn&rsquo;t labelled, so it is
  2461. sent to the first output file <samp>out1.mp4</samp>, regardless of the presence of the <code>-map</code> option.
  2462. </p>
  2463. <p>The aresample filter is sent the first unused audio stream, that of <samp>A.avi</samp>. Since this filter
  2464. output is also unlabelled, it too is mapped to the first output file. The presence of <code>-an</code>
  2465. only suppresses automatic or manual stream selection of audio streams, not outputs sent from
  2466. filtergraphs. Both these mapped streams shall be ordered before the mapped stream in <samp>out1.mp4</samp>.
  2467. </p>
  2468. <p>The video, audio and subtitle streams mapped to <code>out2.mkv</code> are entirely determined by
  2469. automatic stream selection.
  2470. </p>
  2471. <p><samp>out3.mkv</samp> consists of the cloned video output from the hue filter and the first audio
  2472. stream from <samp>B.mp4</samp>.
  2473. <br>
  2474. </p>
  2475. <a name="Options"></a>
  2476. <h2 class="chapter">5 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options" aria-hidden="true">TOC</a></span></h2>
  2477. <p>All the numerical options, if not specified otherwise, accept a string
  2478. representing a number as input, which may be followed by one of the SI
  2479. unit prefixes, for example: &rsquo;K&rsquo;, &rsquo;M&rsquo;, or &rsquo;G&rsquo;.
  2480. </p>
  2481. <p>If &rsquo;i&rsquo; is appended to the SI unit prefix, the complete prefix will be
  2482. interpreted as a unit prefix for binary multiples, which are based on
  2483. powers of 1024 instead of powers of 1000. Appending &rsquo;B&rsquo; to the SI unit
  2484. prefix multiplies the value by 8. This allows using, for example:
  2485. &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as number suffixes.
  2486. </p>
  2487. <p>Options which do not take arguments are boolean options, and set the
  2488. corresponding value to true. They can be set to false by prefixing
  2489. the option name with &quot;no&quot;. For example using &quot;-nofoo&quot;
  2490. will set the boolean option with name &quot;foo&quot; to false.
  2491. </p>
  2492. <span id="Stream-specifiers"></span><a name="Stream-specifiers-1"></a>
  2493. <h3 class="section">5.1 Stream specifiers<span class="pull-right"><a class="anchor hidden-xs" href="#Stream-specifiers-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Stream-specifiers-1" aria-hidden="true">TOC</a></span></h3>
  2494. <p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
  2495. are used to precisely specify which stream(s) a given option belongs to.
  2496. </p>
  2497. <p>A stream specifier is a string generally appended to the option name and
  2498. separated from it by a colon. E.g. <code>-codec:a:1 ac3</code> contains the
  2499. <code>a:1</code> stream specifier, which matches the second audio stream. Therefore, it
  2500. would select the ac3 codec for the second audio stream.
  2501. </p>
  2502. <p>A stream specifier can match several streams, so that the option is applied to all
  2503. of them. E.g. the stream specifier in <code>-b:a 128k</code> matches all audio
  2504. streams.
  2505. </p>
  2506. <p>An empty stream specifier matches all streams. For example, <code>-codec copy</code>
  2507. or <code>-codec: copy</code> would copy all the streams without reencoding.
  2508. </p>
  2509. <p>Possible forms of stream specifiers are:
  2510. </p><dl compact="compact">
  2511. <dt><samp><var>stream_index</var></samp></dt>
  2512. <dd><p>Matches the stream with this index. E.g. <code>-threads:1 4</code> would set the
  2513. thread count for the second stream to 4. If <var>stream_index</var> is used as an
  2514. additional stream specifier (see below), then it selects stream number
  2515. <var>stream_index</var> from the matching streams. Stream numbering is based on the
  2516. order of the streams as detected by libavformat except when a program ID is
  2517. also specified. In this case it is based on the ordering of the streams in the
  2518. program.
  2519. </p></dd>
  2520. <dt><samp><var>stream_type</var>[:<var>additional_stream_specifier</var>]</samp></dt>
  2521. <dd><p><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;
  2522. for subtitle, &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. &rsquo;v&rsquo; matches all video
  2523. streams, &rsquo;V&rsquo; only matches video streams which are not attached pictures, video
  2524. thumbnails or cover arts. If <var>additional_stream_specifier</var> is used, then
  2525. it matches streams which both have this type and match the
  2526. <var>additional_stream_specifier</var>. Otherwise, it matches all streams of the
  2527. specified type.
  2528. </p></dd>
  2529. <dt><samp>p:<var>program_id</var>[:<var>additional_stream_specifier</var>]</samp></dt>
  2530. <dd><p>Matches streams which are in the program with the id <var>program_id</var>. If
  2531. <var>additional_stream_specifier</var> is used, then it matches streams which both
  2532. are part of the program and match the <var>additional_stream_specifier</var>.
  2533. </p>
  2534. </dd>
  2535. <dt><samp>#<var>stream_id</var> or i:<var>stream_id</var></samp></dt>
  2536. <dd><p>Match the stream by stream id (e.g. PID in MPEG-TS container).
  2537. </p></dd>
  2538. <dt><samp>m:<var>key</var>[:<var>value</var>]</samp></dt>
  2539. <dd><p>Matches streams with the metadata tag <var>key</var> having the specified value. If
  2540. <var>value</var> is not given, matches streams that contain the given tag with any
  2541. value.
  2542. </p></dd>
  2543. <dt><samp>u</samp></dt>
  2544. <dd><p>Matches streams with usable configuration, the codec must be defined and the
  2545. essential information such as video dimension or audio sample rate must be present.
  2546. </p>
  2547. <p>Note that in <code>ffmpeg</code>, matching by metadata will only work properly for
  2548. input files.
  2549. </p></dd>
  2550. </dl>
  2551. <a name="Generic-options"></a>
  2552. <h3 class="section">5.2 Generic options<span class="pull-right"><a class="anchor hidden-xs" href="#Generic-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Generic-options" aria-hidden="true">TOC</a></span></h3>
  2553. <p>These options are shared amongst the ff* tools.
  2554. </p>
  2555. <dl compact="compact">
  2556. <dt><samp>-L</samp></dt>
  2557. <dd><p>Show license.
  2558. </p>
  2559. </dd>
  2560. <dt><samp>-h, -?, -help, --help [<var>arg</var>]</samp></dt>
  2561. <dd><p>Show help. An optional parameter may be specified to print help about a specific
  2562. item. If no argument is specified, only basic (non advanced) tool
  2563. options are shown.
  2564. </p>
  2565. <p>Possible values of <var>arg</var> are:
  2566. </p><dl compact="compact">
  2567. <dt><samp>long</samp></dt>
  2568. <dd><p>Print advanced tool options in addition to the basic tool options.
  2569. </p>
  2570. </dd>
  2571. <dt><samp>full</samp></dt>
  2572. <dd><p>Print complete list of options, including shared and private options
  2573. for encoders, decoders, demuxers, muxers, filters, etc.
  2574. </p>
  2575. </dd>
  2576. <dt><samp>decoder=<var>decoder_name</var></samp></dt>
  2577. <dd><p>Print detailed information about the decoder named <var>decoder_name</var>. Use the
  2578. <samp>-decoders</samp> option to get a list of all decoders.
  2579. </p>
  2580. </dd>
  2581. <dt><samp>encoder=<var>encoder_name</var></samp></dt>
  2582. <dd><p>Print detailed information about the encoder named <var>encoder_name</var>. Use the
  2583. <samp>-encoders</samp> option to get a list of all encoders.
  2584. </p>
  2585. </dd>
  2586. <dt><samp>demuxer=<var>demuxer_name</var></samp></dt>
  2587. <dd><p>Print detailed information about the demuxer named <var>demuxer_name</var>. Use the
  2588. <samp>-formats</samp> option to get a list of all demuxers and muxers.
  2589. </p>
  2590. </dd>
  2591. <dt><samp>muxer=<var>muxer_name</var></samp></dt>
  2592. <dd><p>Print detailed information about the muxer named <var>muxer_name</var>. Use the
  2593. <samp>-formats</samp> option to get a list of all muxers and demuxers.
  2594. </p>
  2595. </dd>
  2596. <dt><samp>filter=<var>filter_name</var></samp></dt>
  2597. <dd><p>Print detailed information about the filter named <var>filter_name</var>. Use the
  2598. <samp>-filters</samp> option to get a list of all filters.
  2599. </p>
  2600. </dd>
  2601. <dt><samp>bsf=<var>bitstream_filter_name</var></samp></dt>
  2602. <dd><p>Print detailed information about the bitstream filter named <var>bitstream_filter_name</var>.
  2603. Use the <samp>-bsfs</samp> option to get a list of all bitstream filters.
  2604. </p>
  2605. </dd>
  2606. <dt><samp>protocol=<var>protocol_name</var></samp></dt>
  2607. <dd><p>Print detailed information about the protocol named <var>protocol_name</var>.
  2608. Use the <samp>-protocols</samp> option to get a list of all protocols.
  2609. </p></dd>
  2610. </dl>
  2611. </dd>
  2612. <dt><samp>-version</samp></dt>
  2613. <dd><p>Show version.
  2614. </p>
  2615. </dd>
  2616. <dt><samp>-buildconf</samp></dt>
  2617. <dd><p>Show the build configuration, one option per line.
  2618. </p>
  2619. </dd>
  2620. <dt><samp>-formats</samp></dt>
  2621. <dd><p>Show available formats (including devices).
  2622. </p>
  2623. </dd>
  2624. <dt><samp>-demuxers</samp></dt>
  2625. <dd><p>Show available demuxers.
  2626. </p>
  2627. </dd>
  2628. <dt><samp>-muxers</samp></dt>
  2629. <dd><p>Show available muxers.
  2630. </p>
  2631. </dd>
  2632. <dt><samp>-devices</samp></dt>
  2633. <dd><p>Show available devices.
  2634. </p>
  2635. </dd>
  2636. <dt><samp>-codecs</samp></dt>
  2637. <dd><p>Show all codecs known to libavcodec.
  2638. </p>
  2639. <p>Note that the term &rsquo;codec&rsquo; is used throughout this documentation as a shortcut
  2640. for what is more correctly called a media bitstream format.
  2641. </p>
  2642. </dd>
  2643. <dt><samp>-decoders</samp></dt>
  2644. <dd><p>Show available decoders.
  2645. </p>
  2646. </dd>
  2647. <dt><samp>-encoders</samp></dt>
  2648. <dd><p>Show all available encoders.
  2649. </p>
  2650. </dd>
  2651. <dt><samp>-bsfs</samp></dt>
  2652. <dd><p>Show available bitstream filters.
  2653. </p>
  2654. </dd>
  2655. <dt><samp>-protocols</samp></dt>
  2656. <dd><p>Show available protocols.
  2657. </p>
  2658. </dd>
  2659. <dt><samp>-filters</samp></dt>
  2660. <dd><p>Show available libavfilter filters.
  2661. </p>
  2662. </dd>
  2663. <dt><samp>-pix_fmts</samp></dt>
  2664. <dd><p>Show available pixel formats.
  2665. </p>
  2666. </dd>
  2667. <dt><samp>-sample_fmts</samp></dt>
  2668. <dd><p>Show available sample formats.
  2669. </p>
  2670. </dd>
  2671. <dt><samp>-layouts</samp></dt>
  2672. <dd><p>Show channel names and standard channel layouts.
  2673. </p>
  2674. </dd>
  2675. <dt><samp>-colors</samp></dt>
  2676. <dd><p>Show recognized color names.
  2677. </p>
  2678. </dd>
  2679. <dt><samp>-sources <var>device</var>[,<var>opt1</var>=<var>val1</var>[,<var>opt2</var>=<var>val2</var>]...]</samp></dt>
  2680. <dd><p>Show autodetected sources of the input device.
  2681. Some devices may provide system-dependent source names that cannot be autodetected.
  2682. The returned list cannot be assumed to be always complete.
  2683. </p><div class="example">
  2684. <pre class="example">ffmpeg -sources pulse,server=192.168.0.4
  2685. </pre></div>
  2686. </dd>
  2687. <dt><samp>-sinks <var>device</var>[,<var>opt1</var>=<var>val1</var>[,<var>opt2</var>=<var>val2</var>]...]</samp></dt>
  2688. <dd><p>Show autodetected sinks of the output device.
  2689. Some devices may provide system-dependent sink names that cannot be autodetected.
  2690. The returned list cannot be assumed to be always complete.
  2691. </p><div class="example">
  2692. <pre class="example">ffmpeg -sinks pulse,server=192.168.0.4
  2693. </pre></div>
  2694. </dd>
  2695. <dt><samp>-loglevel [<var>flags</var>+]<var>loglevel</var> | -v [<var>flags</var>+]<var>loglevel</var></samp></dt>
  2696. <dd><p>Set logging level and flags used by the library.
  2697. </p>
  2698. <p>The optional <var>flags</var> prefix can consist of the following values:
  2699. </p><dl compact="compact">
  2700. <dt>&lsquo;<samp>repeat</samp>&rsquo;</dt>
  2701. <dd><p>Indicates that repeated log output should not be compressed to the first line
  2702. and the &quot;Last message repeated n times&quot; line will be omitted.
  2703. </p></dd>
  2704. <dt>&lsquo;<samp>level</samp>&rsquo;</dt>
  2705. <dd><p>Indicates that log output should add a <code>[level]</code> prefix to each message
  2706. line. This can be used as an alternative to log coloring, e.g. when dumping the
  2707. log to file.
  2708. </p></dd>
  2709. </dl>
  2710. <p>Flags can also be used alone by adding a &rsquo;+&rsquo;/&rsquo;-&rsquo; prefix to set/reset a single
  2711. flag without affecting other <var>flags</var> or changing <var>loglevel</var>. When
  2712. setting both <var>flags</var> and <var>loglevel</var>, a &rsquo;+&rsquo; separator is expected
  2713. between the last <var>flags</var> value and before <var>loglevel</var>.
  2714. </p>
  2715. <p><var>loglevel</var> is a string or a number containing one of the following values:
  2716. </p><dl compact="compact">
  2717. <dt>&lsquo;<samp>quiet, -8</samp>&rsquo;</dt>
  2718. <dd><p>Show nothing at all; be silent.
  2719. </p></dd>
  2720. <dt>&lsquo;<samp>panic, 0</samp>&rsquo;</dt>
  2721. <dd><p>Only show fatal errors which could lead the process to crash, such as
  2722. an assertion failure. This is not currently used for anything.
  2723. </p></dd>
  2724. <dt>&lsquo;<samp>fatal, 8</samp>&rsquo;</dt>
  2725. <dd><p>Only show fatal errors. These are errors after which the process absolutely
  2726. cannot continue.
  2727. </p></dd>
  2728. <dt>&lsquo;<samp>error, 16</samp>&rsquo;</dt>
  2729. <dd><p>Show all errors, including ones which can be recovered from.
  2730. </p></dd>
  2731. <dt>&lsquo;<samp>warning, 24</samp>&rsquo;</dt>
  2732. <dd><p>Show all warnings and errors. Any message related to possibly
  2733. incorrect or unexpected events will be shown.
  2734. </p></dd>
  2735. <dt>&lsquo;<samp>info, 32</samp>&rsquo;</dt>
  2736. <dd><p>Show informative messages during processing. This is in addition to
  2737. warnings and errors. This is the default value.
  2738. </p></dd>
  2739. <dt>&lsquo;<samp>verbose, 40</samp>&rsquo;</dt>
  2740. <dd><p>Same as <code>info</code>, except more verbose.
  2741. </p></dd>
  2742. <dt>&lsquo;<samp>debug, 48</samp>&rsquo;</dt>
  2743. <dd><p>Show everything, including debugging information.
  2744. </p></dd>
  2745. <dt>&lsquo;<samp>trace, 56</samp>&rsquo;</dt>
  2746. </dl>
  2747. <p>For example to enable repeated log output, add the <code>level</code> prefix, and set
  2748. <var>loglevel</var> to <code>verbose</code>:
  2749. </p><div class="example">
  2750. <pre class="example">ffmpeg -loglevel repeat+level+verbose -i input output
  2751. </pre></div>
  2752. <p>Another example that enables repeated log output without affecting current
  2753. state of <code>level</code> prefix flag or <var>loglevel</var>:
  2754. </p><div class="example">
  2755. <pre class="example">ffmpeg [...] -loglevel +repeat
  2756. </pre></div>
  2757. <p>By default the program logs to stderr. If coloring is supported by the
  2758. terminal, colors are used to mark errors and warnings. Log coloring
  2759. can be disabled setting the environment variable
  2760. <code>AV_LOG_FORCE_NOCOLOR</code>, or can be forced setting
  2761. the environment variable <code>AV_LOG_FORCE_COLOR</code>.
  2762. </p>
  2763. </dd>
  2764. <dt><samp>-report</samp></dt>
  2765. <dd><p>Dump full command line and log output to a file named
  2766. <code><var>program</var>-<var>YYYYMMDD</var>-<var>HHMMSS</var>.log</code> in the current
  2767. directory.
  2768. This file can be useful for bug reports.
  2769. It also implies <code>-loglevel debug</code>.
  2770. </p>
  2771. <p>Setting the environment variable <code>FFREPORT</code> to any value has the
  2772. same effect. If the value is a &rsquo;:&rsquo;-separated key=value sequence, these
  2773. options will affect the report; option values must be escaped if they
  2774. contain special characters or the options delimiter &rsquo;:&rsquo; (see the
  2775. &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual).
  2776. </p>
  2777. <p>The following options are recognized:
  2778. </p><dl compact="compact">
  2779. <dt><samp>file</samp></dt>
  2780. <dd><p>set the file name to use for the report; <code>%p</code> is expanded to the name
  2781. of the program, <code>%t</code> is expanded to a timestamp, <code>%%</code> is expanded
  2782. to a plain <code>%</code>
  2783. </p></dd>
  2784. <dt><samp>level</samp></dt>
  2785. <dd><p>set the log verbosity level using a numerical value (see <code>-loglevel</code>).
  2786. </p></dd>
  2787. </dl>
  2788. <p>For example, to output a report to a file named <samp>ffreport.log</samp>
  2789. using a log level of <code>32</code> (alias for log level <code>info</code>):
  2790. </p>
  2791. <div class="example">
  2792. <pre class="example">FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
  2793. </pre></div>
  2794. <p>Errors in parsing the environment variable are not fatal, and will not
  2795. appear in the report.
  2796. </p>
  2797. </dd>
  2798. <dt><samp>-hide_banner</samp></dt>
  2799. <dd><p>Suppress printing banner.
  2800. </p>
  2801. <p>All FFmpeg tools will normally show a copyright notice, build options
  2802. and library versions. This option can be used to suppress printing
  2803. this information.
  2804. </p>
  2805. </dd>
  2806. <dt><samp>-cpuflags flags (<em>global</em>)</samp></dt>
  2807. <dd><p>Allows setting and clearing cpu flags. This option is intended
  2808. for testing. Do not use it unless you know what you&rsquo;re doing.
  2809. </p><div class="example">
  2810. <pre class="example">ffmpeg -cpuflags -sse+mmx ...
  2811. ffmpeg -cpuflags mmx ...
  2812. ffmpeg -cpuflags 0 ...
  2813. </pre></div>
  2814. <p>Possible flags for this option are:
  2815. </p><dl compact="compact">
  2816. <dt>&lsquo;<samp>x86</samp>&rsquo;</dt>
  2817. <dd><dl compact="compact">
  2818. <dt>&lsquo;<samp>mmx</samp>&rsquo;</dt>
  2819. <dt>&lsquo;<samp>mmxext</samp>&rsquo;</dt>
  2820. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  2821. <dt>&lsquo;<samp>sse2</samp>&rsquo;</dt>
  2822. <dt>&lsquo;<samp>sse2slow</samp>&rsquo;</dt>
  2823. <dt>&lsquo;<samp>sse3</samp>&rsquo;</dt>
  2824. <dt>&lsquo;<samp>sse3slow</samp>&rsquo;</dt>
  2825. <dt>&lsquo;<samp>ssse3</samp>&rsquo;</dt>
  2826. <dt>&lsquo;<samp>atom</samp>&rsquo;</dt>
  2827. <dt>&lsquo;<samp>sse4.1</samp>&rsquo;</dt>
  2828. <dt>&lsquo;<samp>sse4.2</samp>&rsquo;</dt>
  2829. <dt>&lsquo;<samp>avx</samp>&rsquo;</dt>
  2830. <dt>&lsquo;<samp>avx2</samp>&rsquo;</dt>
  2831. <dt>&lsquo;<samp>xop</samp>&rsquo;</dt>
  2832. <dt>&lsquo;<samp>fma3</samp>&rsquo;</dt>
  2833. <dt>&lsquo;<samp>fma4</samp>&rsquo;</dt>
  2834. <dt>&lsquo;<samp>3dnow</samp>&rsquo;</dt>
  2835. <dt>&lsquo;<samp>3dnowext</samp>&rsquo;</dt>
  2836. <dt>&lsquo;<samp>bmi1</samp>&rsquo;</dt>
  2837. <dt>&lsquo;<samp>bmi2</samp>&rsquo;</dt>
  2838. <dt>&lsquo;<samp>cmov</samp>&rsquo;</dt>
  2839. </dl>
  2840. </dd>
  2841. <dt>&lsquo;<samp>ARM</samp>&rsquo;</dt>
  2842. <dd><dl compact="compact">
  2843. <dt>&lsquo;<samp>armv5te</samp>&rsquo;</dt>
  2844. <dt>&lsquo;<samp>armv6</samp>&rsquo;</dt>
  2845. <dt>&lsquo;<samp>armv6t2</samp>&rsquo;</dt>
  2846. <dt>&lsquo;<samp>vfp</samp>&rsquo;</dt>
  2847. <dt>&lsquo;<samp>vfpv3</samp>&rsquo;</dt>
  2848. <dt>&lsquo;<samp>neon</samp>&rsquo;</dt>
  2849. <dt>&lsquo;<samp>setend</samp>&rsquo;</dt>
  2850. </dl>
  2851. </dd>
  2852. <dt>&lsquo;<samp>AArch64</samp>&rsquo;</dt>
  2853. <dd><dl compact="compact">
  2854. <dt>&lsquo;<samp>armv8</samp>&rsquo;</dt>
  2855. <dt>&lsquo;<samp>vfp</samp>&rsquo;</dt>
  2856. <dt>&lsquo;<samp>neon</samp>&rsquo;</dt>
  2857. </dl>
  2858. </dd>
  2859. <dt>&lsquo;<samp>PowerPC</samp>&rsquo;</dt>
  2860. <dd><dl compact="compact">
  2861. <dt>&lsquo;<samp>altivec</samp>&rsquo;</dt>
  2862. </dl>
  2863. </dd>
  2864. <dt>&lsquo;<samp>Specific Processors</samp>&rsquo;</dt>
  2865. <dd><dl compact="compact">
  2866. <dt>&lsquo;<samp>pentium2</samp>&rsquo;</dt>
  2867. <dt>&lsquo;<samp>pentium3</samp>&rsquo;</dt>
  2868. <dt>&lsquo;<samp>pentium4</samp>&rsquo;</dt>
  2869. <dt>&lsquo;<samp>k6</samp>&rsquo;</dt>
  2870. <dt>&lsquo;<samp>k62</samp>&rsquo;</dt>
  2871. <dt>&lsquo;<samp>athlon</samp>&rsquo;</dt>
  2872. <dt>&lsquo;<samp>athlonxp</samp>&rsquo;</dt>
  2873. <dt>&lsquo;<samp>k8</samp>&rsquo;</dt>
  2874. </dl>
  2875. </dd>
  2876. </dl>
  2877. </dd>
  2878. <dt><samp>-max_alloc <var>bytes</var></samp></dt>
  2879. <dd><p>Set the maximum size limit for allocating a block on the heap by ffmpeg&rsquo;s
  2880. family of malloc functions. Exercise <strong>extreme caution</strong> when using
  2881. this option. Don&rsquo;t use if you do not understand the full consequence of doing so.
  2882. Default is INT_MAX.
  2883. </p></dd>
  2884. </dl>
  2885. <a name="AVOptions"></a>
  2886. <h3 class="section">5.3 AVOptions<span class="pull-right"><a class="anchor hidden-xs" href="#AVOptions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AVOptions" aria-hidden="true">TOC</a></span></h3>
  2887. <p>These options are provided directly by the libavformat, libavdevice and
  2888. libavcodec libraries. To see the list of available AVOptions, use the
  2889. <samp>-help</samp> option. They are separated into two categories:
  2890. </p><dl compact="compact">
  2891. <dt><samp>generic</samp></dt>
  2892. <dd><p>These options can be set for any container, codec or device. Generic options
  2893. are listed under AVFormatContext options for containers/devices and under
  2894. AVCodecContext options for codecs.
  2895. </p></dd>
  2896. <dt><samp>private</samp></dt>
  2897. <dd><p>These options are specific to the given container, device or codec. Private
  2898. options are listed under their corresponding containers/devices/codecs.
  2899. </p></dd>
  2900. </dl>
  2901. <p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
  2902. an MP3 file, use the <samp>id3v2_version</samp> private option of the MP3
  2903. muxer:
  2904. </p><div class="example">
  2905. <pre class="example">ffmpeg -i input.flac -id3v2_version 3 out.mp3
  2906. </pre></div>
  2907. <p>All codec AVOptions are per-stream, and thus a stream specifier
  2908. should be attached to them:
  2909. </p><div class="example">
  2910. <pre class="example">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
  2911. </pre></div>
  2912. <p>In the above example, a multichannel audio stream is mapped twice for output.
  2913. The first instance is encoded with codec ac3 and bitrate 640k.
  2914. The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using
  2915. absolute index of the output stream.
  2916. </p>
  2917. <p>Note: the <samp>-nooption</samp> syntax cannot be used for boolean
  2918. AVOptions, use <samp>-option 0</samp>/<samp>-option 1</samp>.
  2919. </p>
  2920. <p>Note: the old undocumented way of specifying per-stream AVOptions by
  2921. prepending v/a/s to the options name is now obsolete and will be
  2922. removed soon.
  2923. </p>
  2924. <a name="Main-options"></a>
  2925. <h3 class="section">5.4 Main options<span class="pull-right"><a class="anchor hidden-xs" href="#Main-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Main-options" aria-hidden="true">TOC</a></span></h3>
  2926. <dl compact="compact">
  2927. <dt><samp>-f <var>fmt</var> (<em>input/output</em>)</samp></dt>
  2928. <dd><p>Force input or output file format. The format is normally auto detected for input
  2929. files and guessed from the file extension for output files, so this option is not
  2930. needed in most cases.
  2931. </p>
  2932. </dd>
  2933. <dt><samp>-i <var>url</var> (<em>input</em>)</samp></dt>
  2934. <dd><p>input file url
  2935. </p>
  2936. </dd>
  2937. <dt><samp>-y (<em>global</em>)</samp></dt>
  2938. <dd><p>Overwrite output files without asking.
  2939. </p>
  2940. </dd>
  2941. <dt><samp>-n (<em>global</em>)</samp></dt>
  2942. <dd><p>Do not overwrite output files, and exit immediately if a specified
  2943. output file already exists.
  2944. </p>
  2945. </dd>
  2946. <dt><samp>-stream_loop <var>number</var> (<em>input</em>)</samp></dt>
  2947. <dd><p>Set number of times input stream shall be looped. Loop 0 means no loop,
  2948. loop -1 means infinite loop.
  2949. </p>
  2950. </dd>
  2951. <dt><samp>-c[:<var>stream_specifier</var>] <var>codec</var> (<em>input/output,per-stream</em>)</samp></dt>
  2952. <dt><samp>-codec[:<var>stream_specifier</var>] <var>codec</var> (<em>input/output,per-stream</em>)</samp></dt>
  2953. <dd><p>Select an encoder (when used before an output file) or a decoder (when used
  2954. before an input file) for one or more streams. <var>codec</var> is the name of a
  2955. decoder/encoder or a special value <code>copy</code> (output only) to indicate that
  2956. the stream is not to be re-encoded.
  2957. </p>
  2958. <p>For example
  2959. </p><div class="example">
  2960. <pre class="example">ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
  2961. </pre></div>
  2962. <p>encodes all video streams with libx264 and copies all audio streams.
  2963. </p>
  2964. <p>For each stream, the last matching <code>c</code> option is applied, so
  2965. </p><div class="example">
  2966. <pre class="example">ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
  2967. </pre></div>
  2968. <p>will copy all the streams except the second video, which will be encoded with
  2969. libx264, and the 138th audio, which will be encoded with libvorbis.
  2970. </p>
  2971. </dd>
  2972. <dt><samp>-t <var>duration</var> (<em>input/output</em>)</samp></dt>
  2973. <dd><p>When used as an input option (before <code>-i</code>), limit the <var>duration</var> of
  2974. data read from the input file.
  2975. </p>
  2976. <p>When used as an output option (before an output url), stop writing the
  2977. output after its duration reaches <var>duration</var>.
  2978. </p>
  2979. <p><var>duration</var> must be a time duration specification,
  2980. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  2981. </p>
  2982. <p>-to and -t are mutually exclusive and -t has priority.
  2983. </p>
  2984. </dd>
  2985. <dt><samp>-to <var>position</var> (<em>input/output</em>)</samp></dt>
  2986. <dd><p>Stop writing the output or reading the input at <var>position</var>.
  2987. <var>position</var> must be a time duration specification,
  2988. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  2989. </p>
  2990. <p>-to and -t are mutually exclusive and -t has priority.
  2991. </p>
  2992. </dd>
  2993. <dt><samp>-fs <var>limit_size</var> (<em>output</em>)</samp></dt>
  2994. <dd><p>Set the file size limit, expressed in bytes. No further chunk of bytes is written
  2995. after the limit is exceeded. The size of the output file is slightly more than the
  2996. requested file size.
  2997. </p>
  2998. </dd>
  2999. <dt><samp>-ss <var>position</var> (<em>input/output</em>)</samp></dt>
  3000. <dd><p>When used as an input option (before <code>-i</code>), seeks in this input file to
  3001. <var>position</var>. Note that in most formats it is not possible to seek exactly,
  3002. so <code>ffmpeg</code> will seek to the closest seek point before <var>position</var>.
  3003. When transcoding and <samp>-accurate_seek</samp> is enabled (the default), this
  3004. extra segment between the seek point and <var>position</var> will be decoded and
  3005. discarded. When doing stream copy or when <samp>-noaccurate_seek</samp> is used, it
  3006. will be preserved.
  3007. </p>
  3008. <p>When used as an output option (before an output url), decodes but discards
  3009. input until the timestamps reach <var>position</var>.
  3010. </p>
  3011. <p><var>position</var> must be a time duration specification,
  3012. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  3013. </p>
  3014. </dd>
  3015. <dt><samp>-sseof <var>position</var> (<em>input</em>)</samp></dt>
  3016. <dd>
  3017. <p>Like the <code>-ss</code> option but relative to the &quot;end of file&quot;. That is negative
  3018. values are earlier in the file, 0 is at EOF.
  3019. </p>
  3020. </dd>
  3021. <dt><samp>-itsoffset <var>offset</var> (<em>input</em>)</samp></dt>
  3022. <dd><p>Set the input time offset.
  3023. </p>
  3024. <p><var>offset</var> must be a time duration specification,
  3025. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  3026. </p>
  3027. <p>The offset is added to the timestamps of the input files. Specifying
  3028. a positive offset means that the corresponding streams are delayed by
  3029. the time duration specified in <var>offset</var>.
  3030. </p>
  3031. </dd>
  3032. <dt><samp>-itsscale <var>scale</var> (<em>input,per-stream</em>)</samp></dt>
  3033. <dd><p>Rescale input timestamps. <var>scale</var> should be a floating point number.
  3034. </p>
  3035. </dd>
  3036. <dt><samp>-timestamp <var>date</var> (<em>output</em>)</samp></dt>
  3037. <dd><p>Set the recording timestamp in the container.
  3038. </p>
  3039. <p><var>date</var> must be a date specification,
  3040. see <a href="ffmpeg-utils.html#date-syntax">(ffmpeg-utils)the Date section in the ffmpeg-utils(1) manual</a>.
  3041. </p>
  3042. </dd>
  3043. <dt><samp>-metadata[:metadata_specifier] <var>key</var>=<var>value</var> (<em>output,per-metadata</em>)</samp></dt>
  3044. <dd><p>Set a metadata key/value pair.
  3045. </p>
  3046. <p>An optional <var>metadata_specifier</var> may be given to set metadata
  3047. on streams, chapters or programs. See <code>-map_metadata</code>
  3048. documentation for details.
  3049. </p>
  3050. <p>This option overrides metadata set with <code>-map_metadata</code>. It is
  3051. also possible to delete metadata by using an empty value.
  3052. </p>
  3053. <p>For example, for setting the title in the output file:
  3054. </p><div class="example">
  3055. <pre class="example">ffmpeg -i in.avi -metadata title=&quot;my title&quot; out.flv
  3056. </pre></div>
  3057. <p>To set the language of the first audio stream:
  3058. </p><div class="example">
  3059. <pre class="example">ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
  3060. </pre></div>
  3061. </dd>
  3062. <dt><samp>-disposition[:stream_specifier] <var>value</var> (<em>output,per-stream</em>)</samp></dt>
  3063. <dd><p>Sets the disposition for a stream.
  3064. </p>
  3065. <p>This option overrides the disposition copied from the input stream. It is also
  3066. possible to delete the disposition by setting it to 0.
  3067. </p>
  3068. <p>The following dispositions are recognized:
  3069. </p><dl compact="compact">
  3070. <dt><samp>default</samp></dt>
  3071. <dt><samp>dub</samp></dt>
  3072. <dt><samp>original</samp></dt>
  3073. <dt><samp>comment</samp></dt>
  3074. <dt><samp>lyrics</samp></dt>
  3075. <dt><samp>karaoke</samp></dt>
  3076. <dt><samp>forced</samp></dt>
  3077. <dt><samp>hearing_impaired</samp></dt>
  3078. <dt><samp>visual_impaired</samp></dt>
  3079. <dt><samp>clean_effects</samp></dt>
  3080. <dt><samp>attached_pic</samp></dt>
  3081. <dt><samp>captions</samp></dt>
  3082. <dt><samp>descriptions</samp></dt>
  3083. <dt><samp>dependent</samp></dt>
  3084. <dt><samp>metadata</samp></dt>
  3085. </dl>
  3086. <p>For example, to make the second audio stream the default stream:
  3087. </p><div class="example">
  3088. <pre class="example">ffmpeg -i in.mkv -c copy -disposition:a:1 default out.mkv
  3089. </pre></div>
  3090. <p>To make the second subtitle stream the default stream and remove the default
  3091. disposition from the first subtitle stream:
  3092. </p><div class="example">
  3093. <pre class="example">ffmpeg -i in.mkv -c copy -disposition:s:0 0 -disposition:s:1 default out.mkv
  3094. </pre></div>
  3095. <p>To add an embedded cover/thumbnail:
  3096. </p><div class="example">
  3097. <pre class="example">ffmpeg -i in.mp4 -i IMAGE -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic out.mp4
  3098. </pre></div>
  3099. <p>Not all muxers support embedded thumbnails, and those who do, only support a few formats, like JPEG or PNG.
  3100. </p>
  3101. </dd>
  3102. <dt><samp>-program [title=<var>title</var>:][program_num=<var>program_num</var>:]st=<var>stream</var>[:st=<var>stream</var>...] (<em>output</em>)</samp></dt>
  3103. <dd>
  3104. <p>Creates a program with the specified <var>title</var>, <var>program_num</var> and adds the specified
  3105. <var>stream</var>(s) to it.
  3106. </p>
  3107. </dd>
  3108. <dt><samp>-target <var>type</var> (<em>output</em>)</samp></dt>
  3109. <dd><p>Specify target file type (<code>vcd</code>, <code>svcd</code>, <code>dvd</code>, <code>dv</code>,
  3110. <code>dv50</code>). <var>type</var> may be prefixed with <code>pal-</code>, <code>ntsc-</code> or
  3111. <code>film-</code> to use the corresponding standard. All the format options
  3112. (bitrate, codecs, buffer sizes) are then set automatically. You can just type:
  3113. </p>
  3114. <div class="example">
  3115. <pre class="example">ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
  3116. </pre></div>
  3117. <p>Nevertheless you can specify additional options as long as you know
  3118. they do not conflict with the standard, as in:
  3119. </p>
  3120. <div class="example">
  3121. <pre class="example">ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
  3122. </pre></div>
  3123. <p>The parameters set for each target are as follows.
  3124. </p>
  3125. <p><strong>VCD</strong>
  3126. </p><div class="example">
  3127. <pre class="example"><var>pal</var>:
  3128. -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
  3129. -s 352x288 -r 25
  3130. -codec:v mpeg1video -g 15 -b:v 1150k -maxrate:v 1150v -minrate:v 1150k -bufsize:v 327680
  3131. -ar 44100 -ac 2
  3132. -codec:a mp2 -b:a 224k
  3133. <var>ntsc</var>:
  3134. -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
  3135. -s 352x240 -r 30000/1001
  3136. -codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150v -minrate:v 1150k -bufsize:v 327680
  3137. -ar 44100 -ac 2
  3138. -codec:a mp2 -b:a 224k
  3139. <var>film</var>:
  3140. -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
  3141. -s 352x240 -r 24000/1001
  3142. -codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150v -minrate:v 1150k -bufsize:v 327680
  3143. -ar 44100 -ac 2
  3144. -codec:a mp2 -b:a 224k
  3145. </pre></div>
  3146. <p><strong>SVCD</strong>
  3147. </p><div class="example">
  3148. <pre class="example"><var>pal</var>:
  3149. -f svcd -packetsize 2324
  3150. -s 480x576 -pix_fmt yuv420p -r 25
  3151. -codec:v mpeg2video -g 15 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
  3152. -ar 44100
  3153. -codec:a mp2 -b:a 224k
  3154. <var>ntsc</var>:
  3155. -f svcd -packetsize 2324
  3156. -s 480x480 -pix_fmt yuv420p -r 30000/1001
  3157. -codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
  3158. -ar 44100
  3159. -codec:a mp2 -b:a 224k
  3160. <var>film</var>:
  3161. -f svcd -packetsize 2324
  3162. -s 480x480 -pix_fmt yuv420p -r 24000/1001
  3163. -codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
  3164. -ar 44100
  3165. -codec:a mp2 -b:a 224k
  3166. </pre></div>
  3167. <p><strong>DVD</strong>
  3168. </p><div class="example">
  3169. <pre class="example"><var>pal</var>:
  3170. -f dvd -muxrate 10080k -packetsize 2048
  3171. -s 720x576 -pix_fmt yuv420p -r 25
  3172. -codec:v mpeg2video -g 15 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
  3173. -ar 48000
  3174. -codec:a ac3 -b:a 448k
  3175. <var>ntsc</var>:
  3176. -f dvd -muxrate 10080k -packetsize 2048
  3177. -s 720x480 -pix_fmt yuv420p -r 30000/1001
  3178. -codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
  3179. -ar 48000
  3180. -codec:a ac3 -b:a 448k
  3181. <var>film</var>:
  3182. -f dvd -muxrate 10080k -packetsize 2048
  3183. -s 720x480 -pix_fmt yuv420p -r 24000/1001
  3184. -codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
  3185. -ar 48000
  3186. -codec:a ac3 -b:a 448k
  3187. </pre></div>
  3188. <p><strong>DV</strong>
  3189. </p><div class="example">
  3190. <pre class="example"><var>pal</var>:
  3191. -f dv
  3192. -s 720x576 -pix_fmt yuv420p -r 25
  3193. -ar 48000 -ac 2
  3194. <var>ntsc</var>:
  3195. -f dv
  3196. -s 720x480 -pix_fmt yuv411p -r 30000/1001
  3197. -ar 48000 -ac 2
  3198. <var>film</var>:
  3199. -f dv
  3200. -s 720x480 -pix_fmt yuv411p -r 24000/1001
  3201. -ar 48000 -ac 2
  3202. </pre></div>
  3203. <p>The <code>dv50</code> target is identical to the <code>dv</code> target except that the pixel format set is <code>yuv422p</code> for all three standards.
  3204. </p>
  3205. <p>Any user-set value for a parameter above will override the target preset value. In that case, the output may
  3206. not comply with the target standard.
  3207. </p>
  3208. </dd>
  3209. <dt><samp>-dn (<em>input/output</em>)</samp></dt>
  3210. <dd><p>As an input option, blocks all data streams of a file from being filtered or
  3211. being automatically selected or mapped for any output. See <code>-discard</code>
  3212. option to disable streams individually.
  3213. </p>
  3214. <p>As an output option, disables data recording i.e. automatic selection or
  3215. mapping of any data stream. For full manual control see the <code>-map</code>
  3216. option.
  3217. </p>
  3218. </dd>
  3219. <dt><samp>-dframes <var>number</var> (<em>output</em>)</samp></dt>
  3220. <dd><p>Set the number of data frames to output. This is an obsolete alias for
  3221. <code>-frames:d</code>, which you should use instead.
  3222. </p>
  3223. </dd>
  3224. <dt><samp>-frames[:<var>stream_specifier</var>] <var>framecount</var> (<em>output,per-stream</em>)</samp></dt>
  3225. <dd><p>Stop writing to the stream after <var>framecount</var> frames.
  3226. </p>
  3227. </dd>
  3228. <dt><samp>-q[:<var>stream_specifier</var>] <var>q</var> (<em>output,per-stream</em>)</samp></dt>
  3229. <dt><samp>-qscale[:<var>stream_specifier</var>] <var>q</var> (<em>output,per-stream</em>)</samp></dt>
  3230. <dd><p>Use fixed quality scale (VBR). The meaning of <var>q</var>/<var>qscale</var> is
  3231. codec-dependent.
  3232. If <var>qscale</var> is used without a <var>stream_specifier</var> then it applies only
  3233. to the video stream, this is to maintain compatibility with previous behavior
  3234. and as specifying the same codec specific value to 2 different codecs that is
  3235. audio and video generally is not what is intended when no stream_specifier is
  3236. used.
  3237. </p>
  3238. <span id="filter_005foption"></span></dd>
  3239. <dt><samp>-filter[:<var>stream_specifier</var>] <var>filtergraph</var> (<em>output,per-stream</em>)</samp></dt>
  3240. <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
  3241. filter the stream.
  3242. </p>
  3243. <p><var>filtergraph</var> is a description of the filtergraph to apply to
  3244. the stream, and must have a single input and a single output of the
  3245. same type of the stream. In the filtergraph, the input is associated
  3246. to the label <code>in</code>, and the output to the label <code>out</code>. See
  3247. the ffmpeg-filters manual for more information about the filtergraph
  3248. syntax.
  3249. </p>
  3250. <p>See the <a href="#filter_005fcomplex_005foption">-filter_complex option</a> if you
  3251. want to create filtergraphs with multiple inputs and/or outputs.
  3252. </p>
  3253. </dd>
  3254. <dt><samp>-filter_script[:<var>stream_specifier</var>] <var>filename</var> (<em>output,per-stream</em>)</samp></dt>
  3255. <dd><p>This option is similar to <samp>-filter</samp>, the only difference is that its
  3256. argument is the name of the file from which a filtergraph description is to be
  3257. read.
  3258. </p>
  3259. </dd>
  3260. <dt><samp>-filter_threads <var>nb_threads</var> (<em>global</em>)</samp></dt>
  3261. <dd><p>Defines how many threads are used to process a filter pipeline. Each pipeline
  3262. will produce a thread pool with this many threads available for parallel processing.
  3263. The default is the number of available CPUs.
  3264. </p>
  3265. </dd>
  3266. <dt><samp>-pre[:<var>stream_specifier</var>] <var>preset_name</var> (<em>output,per-stream</em>)</samp></dt>
  3267. <dd><p>Specify the preset for matching stream(s).
  3268. </p>
  3269. </dd>
  3270. <dt><samp>-stats (<em>global</em>)</samp></dt>
  3271. <dd><p>Print encoding progress/statistics. It is on by default, to explicitly
  3272. disable it you need to specify <code>-nostats</code>.
  3273. </p>
  3274. </dd>
  3275. <dt><samp>-stats_period <var>time</var> (<em>global</em>)</samp></dt>
  3276. <dd><p>Set period at which encoding progress/statistics are updated. Default is 0.5 seconds.
  3277. </p>
  3278. </dd>
  3279. <dt><samp>-progress <var>url</var> (<em>global</em>)</samp></dt>
  3280. <dd><p>Send program-friendly progress information to <var>url</var>.
  3281. </p>
  3282. <p>Progress information is written periodically and at the end of
  3283. the encoding process. It is made of &quot;<var>key</var>=<var>value</var>&quot; lines. <var>key</var>
  3284. consists of only alphanumeric characters. The last key of a sequence of
  3285. progress information is always &quot;progress&quot;.
  3286. </p>
  3287. <p>The update period is set using <code>-stats_period</code>.
  3288. </p>
  3289. <span id="stdin-option"></span></dd>
  3290. <dt><samp>-stdin</samp></dt>
  3291. <dd><p>Enable interaction on standard input. On by default unless standard input is
  3292. used as an input. To explicitly disable interaction you need to specify
  3293. <code>-nostdin</code>.
  3294. </p>
  3295. <p>Disabling interaction on standard input is useful, for example, if
  3296. ffmpeg is in the background process group. Roughly the same result can
  3297. be achieved with <code>ffmpeg ... &lt; /dev/null</code> but it requires a
  3298. shell.
  3299. </p>
  3300. </dd>
  3301. <dt><samp>-debug_ts (<em>global</em>)</samp></dt>
  3302. <dd><p>Print timestamp information. It is off by default. This option is
  3303. mostly useful for testing and debugging purposes, and the output
  3304. format may change from one version to another, so it should not be
  3305. employed by portable scripts.
  3306. </p>
  3307. <p>See also the option <code>-fdebug ts</code>.
  3308. </p>
  3309. </dd>
  3310. <dt><samp>-attach <var>filename</var> (<em>output</em>)</samp></dt>
  3311. <dd><p>Add an attachment to the output file. This is supported by a few formats
  3312. like Matroska for e.g. fonts used in rendering subtitles. Attachments
  3313. are implemented as a specific type of stream, so this option will add
  3314. a new stream to the file. It is then possible to use per-stream options
  3315. on this stream in the usual way. Attachment streams created with this
  3316. option will be created after all the other streams (i.e. those created
  3317. with <code>-map</code> or automatic mappings).
  3318. </p>
  3319. <p>Note that for Matroska you also have to set the mimetype metadata tag:
  3320. </p><div class="example">
  3321. <pre class="example">ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
  3322. </pre></div>
  3323. <p>(assuming that the attachment stream will be third in the output file).
  3324. </p>
  3325. </dd>
  3326. <dt><samp>-dump_attachment[:<var>stream_specifier</var>] <var>filename</var> (<em>input,per-stream</em>)</samp></dt>
  3327. <dd><p>Extract the matching attachment stream into a file named <var>filename</var>. If
  3328. <var>filename</var> is empty, then the value of the <code>filename</code> metadata tag
  3329. will be used.
  3330. </p>
  3331. <p>E.g. to extract the first attachment to a file named &rsquo;out.ttf&rsquo;:
  3332. </p><div class="example">
  3333. <pre class="example">ffmpeg -dump_attachment:t:0 out.ttf -i INPUT
  3334. </pre></div>
  3335. <p>To extract all attachments to files determined by the <code>filename</code> tag:
  3336. </p><div class="example">
  3337. <pre class="example">ffmpeg -dump_attachment:t &quot;&quot; -i INPUT
  3338. </pre></div>
  3339. <p>Technical note &ndash; attachments are implemented as codec extradata, so this
  3340. option can actually be used to extract extradata from any stream, not just
  3341. attachments.
  3342. </p></dd>
  3343. </dl>
  3344. <a name="Video-Options"></a>
  3345. <h3 class="section">5.5 Video Options<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Options" aria-hidden="true">TOC</a></span></h3>
  3346. <dl compact="compact">
  3347. <dt><samp>-vframes <var>number</var> (<em>output</em>)</samp></dt>
  3348. <dd><p>Set the number of video frames to output. This is an obsolete alias for
  3349. <code>-frames:v</code>, which you should use instead.
  3350. </p></dd>
  3351. <dt><samp>-r[:<var>stream_specifier</var>] <var>fps</var> (<em>input/output,per-stream</em>)</samp></dt>
  3352. <dd><p>Set frame rate (Hz value, fraction or abbreviation).
  3353. </p>
  3354. <p>As an input option, ignore any timestamps stored in the file and instead
  3355. generate timestamps assuming constant frame rate <var>fps</var>.
  3356. This is not the same as the <samp>-framerate</samp> option used for some input formats
  3357. like image2 or v4l2 (it used to be the same in older versions of FFmpeg).
  3358. If in doubt use <samp>-framerate</samp> instead of the input option <samp>-r</samp>.
  3359. </p>
  3360. <p>As an output option, duplicate or drop input frames to achieve constant output
  3361. frame rate <var>fps</var>.
  3362. </p>
  3363. </dd>
  3364. <dt><samp>-fpsmax[:<var>stream_specifier</var>] <var>fps</var> (<em>output,per-stream</em>)</samp></dt>
  3365. <dd><p>Set maximum frame rate (Hz value, fraction or abbreviation).
  3366. </p>
  3367. <p>Clamps output frame rate when output framerate is auto-set and is higher than this value.
  3368. Useful in batch processing or when input framerate is wrongly detected as very high.
  3369. It cannot be set together with <code>-r</code>. It is ignored during streamcopy.
  3370. </p>
  3371. </dd>
  3372. <dt><samp>-s[:<var>stream_specifier</var>] <var>size</var> (<em>input/output,per-stream</em>)</samp></dt>
  3373. <dd><p>Set frame size.
  3374. </p>
  3375. <p>As an input option, this is a shortcut for the <samp>video_size</samp> private
  3376. option, recognized by some demuxers for which the frame size is either not
  3377. stored in the file or is configurable &ndash; e.g. raw video or video grabbers.
  3378. </p>
  3379. <p>As an output option, this inserts the <code>scale</code> video filter to the
  3380. <em>end</em> of the corresponding filtergraph. Please use the <code>scale</code> filter
  3381. directly to insert it at the beginning or some other place.
  3382. </p>
  3383. <p>The format is &lsquo;<samp>wxh</samp>&rsquo; (default - same as source).
  3384. </p>
  3385. </dd>
  3386. <dt><samp>-aspect[:<var>stream_specifier</var>] <var>aspect</var> (<em>output,per-stream</em>)</samp></dt>
  3387. <dd><p>Set the video display aspect ratio specified by <var>aspect</var>.
  3388. </p>
  3389. <p><var>aspect</var> can be a floating point number string, or a string of the
  3390. form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
  3391. numerator and denominator of the aspect ratio. For example &quot;4:3&quot;,
  3392. &quot;16:9&quot;, &quot;1.3333&quot;, and &quot;1.7777&quot; are valid argument values.
  3393. </p>
  3394. <p>If used together with <samp>-vcodec copy</samp>, it will affect the aspect ratio
  3395. stored at container level, but not the aspect ratio stored in encoded
  3396. frames, if it exists.
  3397. </p>
  3398. </dd>
  3399. <dt><samp>-vn (<em>input/output</em>)</samp></dt>
  3400. <dd><p>As an input option, blocks all video streams of a file from being filtered or
  3401. being automatically selected or mapped for any output. See <code>-discard</code>
  3402. option to disable streams individually.
  3403. </p>
  3404. <p>As an output option, disables video recording i.e. automatic selection or
  3405. mapping of any video stream. For full manual control see the <code>-map</code>
  3406. option.
  3407. </p>
  3408. </dd>
  3409. <dt><samp>-vcodec <var>codec</var> (<em>output</em>)</samp></dt>
  3410. <dd><p>Set the video codec. This is an alias for <code>-codec:v</code>.
  3411. </p>
  3412. </dd>
  3413. <dt><samp>-pass[:<var>stream_specifier</var>] <var>n</var> (<em>output,per-stream</em>)</samp></dt>
  3414. <dd><p>Select the pass number (1 or 2). It is used to do two-pass
  3415. video encoding. The statistics of the video are recorded in the first
  3416. pass into a log file (see also the option -passlogfile),
  3417. and in the second pass that log file is used to generate the video
  3418. at the exact requested bitrate.
  3419. On pass 1, you may just deactivate audio and set output to null,
  3420. examples for Windows and Unix:
  3421. </p><div class="example">
  3422. <pre class="example">ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
  3423. ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
  3424. </pre></div>
  3425. </dd>
  3426. <dt><samp>-passlogfile[:<var>stream_specifier</var>] <var>prefix</var> (<em>output,per-stream</em>)</samp></dt>
  3427. <dd><p>Set two-pass log file name prefix to <var>prefix</var>, the default file name
  3428. prefix is &ldquo;ffmpeg2pass&rdquo;. The complete file name will be
  3429. <samp>PREFIX-N.log</samp>, where N is a number specific to the output
  3430. stream
  3431. </p>
  3432. </dd>
  3433. <dt><samp>-vf <var>filtergraph</var> (<em>output</em>)</samp></dt>
  3434. <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
  3435. filter the stream.
  3436. </p>
  3437. <p>This is an alias for <code>-filter:v</code>, see the <a href="#filter_005foption">-filter option</a>.
  3438. </p>
  3439. </dd>
  3440. <dt><samp>-autorotate</samp></dt>
  3441. <dd><p>Automatically rotate the video according to file metadata. Enabled by
  3442. default, use <samp>-noautorotate</samp> to disable it.
  3443. </p>
  3444. </dd>
  3445. <dt><samp>-autoscale</samp></dt>
  3446. <dd><p>Automatically scale the video according to the resolution of first frame.
  3447. Enabled by default, use <samp>-noautoscale</samp> to disable it. When autoscale is
  3448. disabled, all output frames of filter graph might not be in the same resolution
  3449. and may be inadequate for some encoder/muxer. Therefore, it is not recommended
  3450. to disable it unless you really know what you are doing.
  3451. Disable autoscale at your own risk.
  3452. </p></dd>
  3453. </dl>
  3454. <a name="Advanced-Video-options"></a>
  3455. <h3 class="section">5.6 Advanced Video options<span class="pull-right"><a class="anchor hidden-xs" href="#Advanced-Video-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Advanced-Video-options" aria-hidden="true">TOC</a></span></h3>
  3456. <dl compact="compact">
  3457. <dt><samp>-pix_fmt[:<var>stream_specifier</var>] <var>format</var> (<em>input/output,per-stream</em>)</samp></dt>
  3458. <dd><p>Set pixel format. Use <code>-pix_fmts</code> to show all the supported
  3459. pixel formats.
  3460. If the selected pixel format can not be selected, ffmpeg will print a
  3461. warning and select the best pixel format supported by the encoder.
  3462. If <var>pix_fmt</var> is prefixed by a <code>+</code>, ffmpeg will exit with an error
  3463. if the requested pixel format can not be selected, and automatic conversions
  3464. inside filtergraphs are disabled.
  3465. If <var>pix_fmt</var> is a single <code>+</code>, ffmpeg selects the same pixel format
  3466. as the input (or graph output) and automatic conversions are disabled.
  3467. </p>
  3468. </dd>
  3469. <dt><samp>-sws_flags <var>flags</var> (<em>input/output</em>)</samp></dt>
  3470. <dd><p>Set SwScaler flags.
  3471. </p>
  3472. </dd>
  3473. <dt><samp>-rc_override[:<var>stream_specifier</var>] <var>override</var> (<em>output,per-stream</em>)</samp></dt>
  3474. <dd><p>Rate control override for specific intervals, formatted as &quot;int,int,int&quot;
  3475. list separated with slashes. Two first values are the beginning and
  3476. end frame numbers, last one is quantizer to use if positive, or quality
  3477. factor if negative.
  3478. </p>
  3479. </dd>
  3480. <dt><samp>-ilme</samp></dt>
  3481. <dd><p>Force interlacing support in encoder (MPEG-2 and MPEG-4 only).
  3482. Use this option if your input file is interlaced and you want
  3483. to keep the interlaced format for minimum losses.
  3484. The alternative is to deinterlace the input stream by use of a filter
  3485. such as <code>yadif</code> or <code>bwdif</code>, but deinterlacing introduces losses.
  3486. </p></dd>
  3487. <dt><samp>-psnr</samp></dt>
  3488. <dd><p>Calculate PSNR of compressed frames.
  3489. </p></dd>
  3490. <dt><samp>-vstats</samp></dt>
  3491. <dd><p>Dump video coding statistics to <samp>vstats_HHMMSS.log</samp>.
  3492. </p></dd>
  3493. <dt><samp>-vstats_file <var>file</var></samp></dt>
  3494. <dd><p>Dump video coding statistics to <var>file</var>.
  3495. </p></dd>
  3496. <dt><samp>-vstats_version <var>file</var></samp></dt>
  3497. <dd><p>Specifies which version of the vstats format to use. Default is 2.
  3498. </p>
  3499. <p>version = 1 :
  3500. </p>
  3501. <p><code>frame= %5d q= %2.1f PSNR= %6.2f f_size= %6d s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s</code>
  3502. </p>
  3503. <p>version &gt; 1:
  3504. </p>
  3505. <p><code>out= %2d st= %2d frame= %5d q= %2.1f PSNR= %6.2f f_size= %6d s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s</code>
  3506. </p></dd>
  3507. <dt><samp>-top[:<var>stream_specifier</var>] <var>n</var> (<em>output,per-stream</em>)</samp></dt>
  3508. <dd><p>top=1/bottom=0/auto=-1 field first
  3509. </p></dd>
  3510. <dt><samp>-dc <var>precision</var></samp></dt>
  3511. <dd><p>Intra_dc_precision.
  3512. </p></dd>
  3513. <dt><samp>-vtag <var>fourcc/tag</var> (<em>output</em>)</samp></dt>
  3514. <dd><p>Force video tag/fourcc. This is an alias for <code>-tag:v</code>.
  3515. </p></dd>
  3516. <dt><samp>-qphist (<em>global</em>)</samp></dt>
  3517. <dd><p>Show QP histogram
  3518. </p></dd>
  3519. <dt><samp>-vbsf <var>bitstream_filter</var></samp></dt>
  3520. <dd><p>Deprecated see -bsf
  3521. </p>
  3522. </dd>
  3523. <dt><samp>-force_key_frames[:<var>stream_specifier</var>] <var>time</var>[,<var>time</var>...] (<em>output,per-stream</em>)</samp></dt>
  3524. <dt><samp>-force_key_frames[:<var>stream_specifier</var>] expr:<var>expr</var> (<em>output,per-stream</em>)</samp></dt>
  3525. <dt><samp>-force_key_frames[:<var>stream_specifier</var>] source (<em>output,per-stream</em>)</samp></dt>
  3526. <dd>
  3527. <p><var>force_key_frames</var> can take arguments of the following form:
  3528. </p>
  3529. <dl compact="compact">
  3530. <dt><samp><var>time</var>[,<var>time</var>...]</samp></dt>
  3531. <dd><p>If the argument consists of timestamps, ffmpeg will round the specified times to the nearest
  3532. output timestamp as per the encoder time base and force a keyframe at the first frame having
  3533. timestamp equal or greater than the computed timestamp. Note that if the encoder time base is too
  3534. coarse, then the keyframes may be forced on frames with timestamps lower than the specified time.
  3535. The default encoder time base is the inverse of the output framerate but may be set otherwise
  3536. via <code>-enc_time_base</code>.
  3537. </p>
  3538. <p>If one of the times is &quot;<code>chapters</code>[<var>delta</var>]&quot;, it is expanded into
  3539. the time of the beginning of all chapters in the file, shifted by
  3540. <var>delta</var>, expressed as a time in seconds.
  3541. This option can be useful to ensure that a seek point is present at a
  3542. chapter mark or any other designated place in the output file.
  3543. </p>
  3544. <p>For example, to insert a key frame at 5 minutes, plus key frames 0.1 second
  3545. before the beginning of every chapter:
  3546. </p><div class="example">
  3547. <pre class="example">-force_key_frames 0:05:00,chapters-0.1
  3548. </pre></div>
  3549. </dd>
  3550. <dt><samp>expr:<var>expr</var></samp></dt>
  3551. <dd><p>If the argument is prefixed with <code>expr:</code>, the string <var>expr</var>
  3552. is interpreted like an expression and is evaluated for each frame. A
  3553. key frame is forced in case the evaluation is non-zero.
  3554. </p>
  3555. <p>The expression in <var>expr</var> can contain the following constants:
  3556. </p><dl compact="compact">
  3557. <dt><samp>n</samp></dt>
  3558. <dd><p>the number of current processed frame, starting from 0
  3559. </p></dd>
  3560. <dt><samp>n_forced</samp></dt>
  3561. <dd><p>the number of forced frames
  3562. </p></dd>
  3563. <dt><samp>prev_forced_n</samp></dt>
  3564. <dd><p>the number of the previous forced frame, it is <code>NAN</code> when no
  3565. keyframe was forced yet
  3566. </p></dd>
  3567. <dt><samp>prev_forced_t</samp></dt>
  3568. <dd><p>the time of the previous forced frame, it is <code>NAN</code> when no
  3569. keyframe was forced yet
  3570. </p></dd>
  3571. <dt><samp>t</samp></dt>
  3572. <dd><p>the time of the current processed frame
  3573. </p></dd>
  3574. </dl>
  3575. <p>For example to force a key frame every 5 seconds, you can specify:
  3576. </p><div class="example">
  3577. <pre class="example">-force_key_frames expr:gte(t,n_forced*5)
  3578. </pre></div>
  3579. <p>To force a key frame 5 seconds after the time of the last forced one,
  3580. starting from second 13:
  3581. </p><div class="example">
  3582. <pre class="example">-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
  3583. </pre></div>
  3584. </dd>
  3585. <dt><samp>source</samp></dt>
  3586. <dd><p>If the argument is <code>source</code>, ffmpeg will force a key frame if
  3587. the current frame being encoded is marked as a key frame in its source.
  3588. </p>
  3589. </dd>
  3590. </dl>
  3591. <p>Note that forcing too many keyframes is very harmful for the lookahead
  3592. algorithms of certain encoders: using fixed-GOP options or similar
  3593. would be more efficient.
  3594. </p>
  3595. </dd>
  3596. <dt><samp>-copyinkf[:<var>stream_specifier</var>] (<em>output,per-stream</em>)</samp></dt>
  3597. <dd><p>When doing stream copy, copy also non-key frames found at the
  3598. beginning.
  3599. </p>
  3600. </dd>
  3601. <dt><samp>-init_hw_device <var>type</var>[=<var>name</var>][:<var>device</var>[,<var>key=value</var>...]]</samp></dt>
  3602. <dd><p>Initialise a new hardware device of type <var>type</var> called <var>name</var>, using the
  3603. given device parameters.
  3604. If no name is specified it will receive a default name of the form &quot;<var>type</var>%d&quot;.
  3605. </p>
  3606. <p>The meaning of <var>device</var> and the following arguments depends on the
  3607. device type:
  3608. </p><dl compact="compact">
  3609. <dt><samp>cuda</samp></dt>
  3610. <dd><p><var>device</var> is the number of the CUDA device.
  3611. </p>
  3612. </dd>
  3613. <dt><samp>dxva2</samp></dt>
  3614. <dd><p><var>device</var> is the number of the Direct3D 9 display adapter.
  3615. </p>
  3616. </dd>
  3617. <dt><samp>vaapi</samp></dt>
  3618. <dd><p><var>device</var> is either an X11 display name or a DRM render node.
  3619. If not specified, it will attempt to open the default X11 display (<em>$DISPLAY</em>)
  3620. and then the first DRM render node (<em>/dev/dri/renderD128</em>).
  3621. </p>
  3622. </dd>
  3623. <dt><samp>vdpau</samp></dt>
  3624. <dd><p><var>device</var> is an X11 display name.
  3625. If not specified, it will attempt to open the default X11 display (<em>$DISPLAY</em>).
  3626. </p>
  3627. </dd>
  3628. <dt><samp>qsv</samp></dt>
  3629. <dd><p><var>device</var> selects a value in &lsquo;<samp>MFX_IMPL_*</samp>&rsquo;. Allowed values are:
  3630. </p><dl compact="compact">
  3631. <dt><samp>auto</samp></dt>
  3632. <dt><samp>sw</samp></dt>
  3633. <dt><samp>hw</samp></dt>
  3634. <dt><samp>auto_any</samp></dt>
  3635. <dt><samp>hw_any</samp></dt>
  3636. <dt><samp>hw2</samp></dt>
  3637. <dt><samp>hw3</samp></dt>
  3638. <dt><samp>hw4</samp></dt>
  3639. </dl>
  3640. <p>If not specified, &lsquo;<samp>auto_any</samp>&rsquo; is used.
  3641. (Note that it may be easier to achieve the desired result for QSV by creating the
  3642. platform-appropriate subdevice (&lsquo;<samp>dxva2</samp>&rsquo; or &lsquo;<samp>vaapi</samp>&rsquo;) and then deriving a
  3643. QSV device from that.)
  3644. </p>
  3645. </dd>
  3646. <dt><samp>opencl</samp></dt>
  3647. <dd><p><var>device</var> selects the platform and device as <em>platform_index.device_index</em>.
  3648. </p>
  3649. <p>The set of devices can also be filtered using the key-value pairs to find only
  3650. devices matching particular platform or device strings.
  3651. </p>
  3652. <p>The strings usable as filters are:
  3653. </p><dl compact="compact">
  3654. <dt><samp>platform_profile</samp></dt>
  3655. <dt><samp>platform_version</samp></dt>
  3656. <dt><samp>platform_name</samp></dt>
  3657. <dt><samp>platform_vendor</samp></dt>
  3658. <dt><samp>platform_extensions</samp></dt>
  3659. <dt><samp>device_name</samp></dt>
  3660. <dt><samp>device_vendor</samp></dt>
  3661. <dt><samp>driver_version</samp></dt>
  3662. <dt><samp>device_version</samp></dt>
  3663. <dt><samp>device_profile</samp></dt>
  3664. <dt><samp>device_extensions</samp></dt>
  3665. <dt><samp>device_type</samp></dt>
  3666. </dl>
  3667. <p>The indices and filters must together uniquely select a device.
  3668. </p>
  3669. <p>Examples:
  3670. </p><dl compact="compact">
  3671. <dt><em>-init_hw_device opencl:0.1</em></dt>
  3672. <dd><p>Choose the second device on the first platform.
  3673. </p>
  3674. </dd>
  3675. <dt><em>-init_hw_device opencl:,device_name=Foo9000</em></dt>
  3676. <dd><p>Choose the device with a name containing the string <em>Foo9000</em>.
  3677. </p>
  3678. </dd>
  3679. <dt><em>-init_hw_device opencl:1,device_type=gpu,device_extensions=cl_khr_fp16</em></dt>
  3680. <dd><p>Choose the GPU device on the second platform supporting the <em>cl_khr_fp16</em>
  3681. extension.
  3682. </p></dd>
  3683. </dl>
  3684. </dd>
  3685. <dt><samp>vulkan</samp></dt>
  3686. <dd><p>If <var>device</var> is an integer, it selects the device by its index in a
  3687. system-dependent list of devices. If <var>device</var> is any other string, it
  3688. selects the first device with a name containing that string as a substring.
  3689. </p>
  3690. <p>The following options are recognized:
  3691. </p><dl compact="compact">
  3692. <dt><samp>debug</samp></dt>
  3693. <dd><p>If set to 1, enables the validation layer, if installed.
  3694. </p></dd>
  3695. <dt><samp>linear_images</samp></dt>
  3696. <dd><p>If set to 1, images allocated by the hwcontext will be linear and locally mappable.
  3697. </p></dd>
  3698. <dt><samp>instance_extensions</samp></dt>
  3699. <dd><p>A plus separated list of additional instance extensions to enable.
  3700. </p></dd>
  3701. <dt><samp>device_extensions</samp></dt>
  3702. <dd><p>A plus separated list of additional device extensions to enable.
  3703. </p></dd>
  3704. </dl>
  3705. <p>Examples:
  3706. </p><dl compact="compact">
  3707. <dt><em>-init_hw_device vulkan:1</em></dt>
  3708. <dd><p>Choose the second device on the system.
  3709. </p>
  3710. </dd>
  3711. <dt><em>-init_hw_device vulkan:RADV</em></dt>
  3712. <dd><p>Choose the first device with a name containing the string <em>RADV</em>.
  3713. </p>
  3714. </dd>
  3715. <dt><em>-init_hw_device vulkan:0,instance_extensions=VK_KHR_wayland_surface+VK_KHR_xcb_surface</em></dt>
  3716. <dd><p>Choose the first device and enable the Wayland and XCB instance extensions.
  3717. </p></dd>
  3718. </dl>
  3719. </dd>
  3720. </dl>
  3721. </dd>
  3722. <dt><samp>-init_hw_device <var>type</var>[=<var>name</var>]@<var>source</var></samp></dt>
  3723. <dd><p>Initialise a new hardware device of type <var>type</var> called <var>name</var>,
  3724. deriving it from the existing device with the name <var>source</var>.
  3725. </p>
  3726. </dd>
  3727. <dt><samp>-init_hw_device list</samp></dt>
  3728. <dd><p>List all hardware device types supported in this build of ffmpeg.
  3729. </p>
  3730. </dd>
  3731. <dt><samp>-filter_hw_device <var>name</var></samp></dt>
  3732. <dd><p>Pass the hardware device called <var>name</var> to all filters in any filter graph.
  3733. This can be used to set the device to upload to with the <code>hwupload</code> filter,
  3734. or the device to map to with the <code>hwmap</code> filter. Other filters may also
  3735. make use of this parameter when they require a hardware device. Note that this
  3736. is typically only required when the input is not already in hardware frames -
  3737. when it is, filters will derive the device they require from the context of the
  3738. frames they receive as input.
  3739. </p>
  3740. <p>This is a global setting, so all filters will receive the same device.
  3741. </p>
  3742. </dd>
  3743. <dt><samp>-hwaccel[:<var>stream_specifier</var>] <var>hwaccel</var> (<em>input,per-stream</em>)</samp></dt>
  3744. <dd><p>Use hardware acceleration to decode the matching stream(s). The allowed values
  3745. of <var>hwaccel</var> are:
  3746. </p><dl compact="compact">
  3747. <dt><samp>none</samp></dt>
  3748. <dd><p>Do not use any hardware acceleration (the default).
  3749. </p>
  3750. </dd>
  3751. <dt><samp>auto</samp></dt>
  3752. <dd><p>Automatically select the hardware acceleration method.
  3753. </p>
  3754. </dd>
  3755. <dt><samp>vdpau</samp></dt>
  3756. <dd><p>Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration.
  3757. </p>
  3758. </dd>
  3759. <dt><samp>dxva2</samp></dt>
  3760. <dd><p>Use DXVA2 (DirectX Video Acceleration) hardware acceleration.
  3761. </p>
  3762. </dd>
  3763. <dt><samp>vaapi</samp></dt>
  3764. <dd><p>Use VAAPI (Video Acceleration API) hardware acceleration.
  3765. </p>
  3766. </dd>
  3767. <dt><samp>qsv</samp></dt>
  3768. <dd><p>Use the Intel QuickSync Video acceleration for video transcoding.
  3769. </p>
  3770. <p>Unlike most other values, this option does not enable accelerated decoding (that
  3771. is used automatically whenever a qsv decoder is selected), but accelerated
  3772. transcoding, without copying the frames into the system memory.
  3773. </p>
  3774. <p>For it to work, both the decoder and the encoder must support QSV acceleration
  3775. and no filters must be used.
  3776. </p></dd>
  3777. </dl>
  3778. <p>This option has no effect if the selected hwaccel is not available or not
  3779. supported by the chosen decoder.
  3780. </p>
  3781. <p>Note that most acceleration methods are intended for playback and will not be
  3782. faster than software decoding on modern CPUs. Additionally, <code>ffmpeg</code>
  3783. will usually need to copy the decoded frames from the GPU memory into the system
  3784. memory, resulting in further performance loss. This option is thus mainly
  3785. useful for testing.
  3786. </p>
  3787. </dd>
  3788. <dt><samp>-hwaccel_device[:<var>stream_specifier</var>] <var>hwaccel_device</var> (<em>input,per-stream</em>)</samp></dt>
  3789. <dd><p>Select a device to use for hardware acceleration.
  3790. </p>
  3791. <p>This option only makes sense when the <samp>-hwaccel</samp> option is also specified.
  3792. It can either refer to an existing device created with <samp>-init_hw_device</samp>
  3793. by name, or it can create a new device as if
  3794. &lsquo;<samp>-init_hw_device</samp>&rsquo; <var>type</var>:<var>hwaccel_device</var>
  3795. were called immediately before.
  3796. </p>
  3797. </dd>
  3798. <dt><samp>-hwaccels</samp></dt>
  3799. <dd><p>List all hardware acceleration methods supported in this build of ffmpeg.
  3800. </p>
  3801. </dd>
  3802. </dl>
  3803. <a name="Audio-Options"></a>
  3804. <h3 class="section">5.7 Audio Options<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Options" aria-hidden="true">TOC</a></span></h3>
  3805. <dl compact="compact">
  3806. <dt><samp>-aframes <var>number</var> (<em>output</em>)</samp></dt>
  3807. <dd><p>Set the number of audio frames to output. This is an obsolete alias for
  3808. <code>-frames:a</code>, which you should use instead.
  3809. </p></dd>
  3810. <dt><samp>-ar[:<var>stream_specifier</var>] <var>freq</var> (<em>input/output,per-stream</em>)</samp></dt>
  3811. <dd><p>Set the audio sampling frequency. For output streams it is set by
  3812. default to the frequency of the corresponding input stream. For input
  3813. streams this option only makes sense for audio grabbing devices and raw
  3814. demuxers and is mapped to the corresponding demuxer options.
  3815. </p></dd>
  3816. <dt><samp>-aq <var>q</var> (<em>output</em>)</samp></dt>
  3817. <dd><p>Set the audio quality (codec-specific, VBR). This is an alias for -q:a.
  3818. </p></dd>
  3819. <dt><samp>-ac[:<var>stream_specifier</var>] <var>channels</var> (<em>input/output,per-stream</em>)</samp></dt>
  3820. <dd><p>Set the number of audio channels. For output streams it is set by
  3821. default to the number of input audio channels. For input streams
  3822. this option only makes sense for audio grabbing devices and raw demuxers
  3823. and is mapped to the corresponding demuxer options.
  3824. </p></dd>
  3825. <dt><samp>-an (<em>input/output</em>)</samp></dt>
  3826. <dd><p>As an input option, blocks all audio streams of a file from being filtered or
  3827. being automatically selected or mapped for any output. See <code>-discard</code>
  3828. option to disable streams individually.
  3829. </p>
  3830. <p>As an output option, disables audio recording i.e. automatic selection or
  3831. mapping of any audio stream. For full manual control see the <code>-map</code>
  3832. option.
  3833. </p></dd>
  3834. <dt><samp>-acodec <var>codec</var> (<em>input/output</em>)</samp></dt>
  3835. <dd><p>Set the audio codec. This is an alias for <code>-codec:a</code>.
  3836. </p></dd>
  3837. <dt><samp>-sample_fmt[:<var>stream_specifier</var>] <var>sample_fmt</var> (<em>output,per-stream</em>)</samp></dt>
  3838. <dd><p>Set the audio sample format. Use <code>-sample_fmts</code> to get a list
  3839. of supported sample formats.
  3840. </p>
  3841. </dd>
  3842. <dt><samp>-af <var>filtergraph</var> (<em>output</em>)</samp></dt>
  3843. <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
  3844. filter the stream.
  3845. </p>
  3846. <p>This is an alias for <code>-filter:a</code>, see the <a href="#filter_005foption">-filter option</a>.
  3847. </p></dd>
  3848. </dl>
  3849. <a name="Advanced-Audio-options"></a>
  3850. <h3 class="section">5.8 Advanced Audio options<span class="pull-right"><a class="anchor hidden-xs" href="#Advanced-Audio-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Advanced-Audio-options" aria-hidden="true">TOC</a></span></h3>
  3851. <dl compact="compact">
  3852. <dt><samp>-atag <var>fourcc/tag</var> (<em>output</em>)</samp></dt>
  3853. <dd><p>Force audio tag/fourcc. This is an alias for <code>-tag:a</code>.
  3854. </p></dd>
  3855. <dt><samp>-absf <var>bitstream_filter</var></samp></dt>
  3856. <dd><p>Deprecated, see -bsf
  3857. </p></dd>
  3858. <dt><samp>-guess_layout_max <var>channels</var> (<em>input,per-stream</em>)</samp></dt>
  3859. <dd><p>If some input channel layout is not known, try to guess only if it
  3860. corresponds to at most the specified number of channels. For example, 2
  3861. tells to <code>ffmpeg</code> to recognize 1 channel as mono and 2 channels as
  3862. stereo but not 6 channels as 5.1. The default is to always try to guess. Use
  3863. 0 to disable all guessing.
  3864. </p></dd>
  3865. </dl>
  3866. <a name="Subtitle-options"></a>
  3867. <h3 class="section">5.9 Subtitle options<span class="pull-right"><a class="anchor hidden-xs" href="#Subtitle-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Subtitle-options" aria-hidden="true">TOC</a></span></h3>
  3868. <dl compact="compact">
  3869. <dt><samp>-scodec <var>codec</var> (<em>input/output</em>)</samp></dt>
  3870. <dd><p>Set the subtitle codec. This is an alias for <code>-codec:s</code>.
  3871. </p></dd>
  3872. <dt><samp>-sn (<em>input/output</em>)</samp></dt>
  3873. <dd><p>As an input option, blocks all subtitle streams of a file from being filtered or
  3874. being automatically selected or mapped for any output. See <code>-discard</code>
  3875. option to disable streams individually.
  3876. </p>
  3877. <p>As an output option, disables subtitle recording i.e. automatic selection or
  3878. mapping of any subtitle stream. For full manual control see the <code>-map</code>
  3879. option.
  3880. </p></dd>
  3881. <dt><samp>-sbsf <var>bitstream_filter</var></samp></dt>
  3882. <dd><p>Deprecated, see -bsf
  3883. </p></dd>
  3884. </dl>
  3885. <a name="Advanced-Subtitle-options"></a>
  3886. <h3 class="section">5.10 Advanced Subtitle options<span class="pull-right"><a class="anchor hidden-xs" href="#Advanced-Subtitle-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Advanced-Subtitle-options" aria-hidden="true">TOC</a></span></h3>
  3887. <dl compact="compact">
  3888. <dt><samp>-fix_sub_duration</samp></dt>
  3889. <dd><p>Fix subtitles durations. For each subtitle, wait for the next packet in the
  3890. same stream and adjust the duration of the first to avoid overlap. This is
  3891. necessary with some subtitles codecs, especially DVB subtitles, because the
  3892. duration in the original packet is only a rough estimate and the end is
  3893. actually marked by an empty subtitle frame. Failing to use this option when
  3894. necessary can result in exaggerated durations or muxing failures due to
  3895. non-monotonic timestamps.
  3896. </p>
  3897. <p>Note that this option will delay the output of all data until the next
  3898. subtitle packet is decoded: it may increase memory consumption and latency a
  3899. lot.
  3900. </p>
  3901. </dd>
  3902. <dt><samp>-canvas_size <var>size</var></samp></dt>
  3903. <dd><p>Set the size of the canvas used to render subtitles.
  3904. </p>
  3905. </dd>
  3906. </dl>
  3907. <a name="Advanced-options"></a>
  3908. <h3 class="section">5.11 Advanced options<span class="pull-right"><a class="anchor hidden-xs" href="#Advanced-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Advanced-options" aria-hidden="true">TOC</a></span></h3>
  3909. <dl compact="compact">
  3910. <dt><samp>-map [-]<var>input_file_id</var>[:<var>stream_specifier</var>][?][,<var>sync_file_id</var>[:<var>stream_specifier</var>]] | <var>[linklabel]</var> (<em>output</em>)</samp></dt>
  3911. <dd>
  3912. <p>Designate one or more input streams as a source for the output file. Each input
  3913. stream is identified by the input file index <var>input_file_id</var> and
  3914. the input stream index <var>input_stream_id</var> within the input
  3915. file. Both indices start at 0. If specified,
  3916. <var>sync_file_id</var>:<var>stream_specifier</var> sets which input stream
  3917. is used as a presentation sync reference.
  3918. </p>
  3919. <p>The first <code>-map</code> option on the command line specifies the
  3920. source for output stream 0, the second <code>-map</code> option specifies
  3921. the source for output stream 1, etc.
  3922. </p>
  3923. <p>A <code>-</code> character before the stream identifier creates a &quot;negative&quot; mapping.
  3924. It disables matching streams from already created mappings.
  3925. </p>
  3926. <p>A trailing <code>?</code> after the stream index will allow the map to be
  3927. optional: if the map matches no streams the map will be ignored instead
  3928. of failing. Note the map will still fail if an invalid input file index
  3929. is used; such as if the map refers to a non-existent input.
  3930. </p>
  3931. <p>An alternative <var>[linklabel]</var> form will map outputs from complex filter
  3932. graphs (see the <samp>-filter_complex</samp> option) to the output file.
  3933. <var>linklabel</var> must correspond to a defined output link label in the graph.
  3934. </p>
  3935. <p>For example, to map ALL streams from the first input file to output
  3936. </p><div class="example">
  3937. <pre class="example">ffmpeg -i INPUT -map 0 output
  3938. </pre></div>
  3939. <p>For example, if you have two audio streams in the first input file,
  3940. these streams are identified by &quot;0:0&quot; and &quot;0:1&quot;. You can use
  3941. <code>-map</code> to select which streams to place in an output file. For
  3942. example:
  3943. </p><div class="example">
  3944. <pre class="example">ffmpeg -i INPUT -map 0:1 out.wav
  3945. </pre></div>
  3946. <p>will map the input stream in <samp>INPUT</samp> identified by &quot;0:1&quot; to
  3947. the (single) output stream in <samp>out.wav</samp>.
  3948. </p>
  3949. <p>For example, to select the stream with index 2 from input file
  3950. <samp>a.mov</samp> (specified by the identifier &quot;0:2&quot;), and stream with
  3951. index 6 from input <samp>b.mov</samp> (specified by the identifier &quot;1:6&quot;),
  3952. and copy them to the output file <samp>out.mov</samp>:
  3953. </p><div class="example">
  3954. <pre class="example">ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
  3955. </pre></div>
  3956. <p>To select all video and the third audio stream from an input file:
  3957. </p><div class="example">
  3958. <pre class="example">ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT
  3959. </pre></div>
  3960. <p>To map all the streams except the second audio, use negative mappings
  3961. </p><div class="example">
  3962. <pre class="example">ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT
  3963. </pre></div>
  3964. <p>To map the video and audio streams from the first input, and using the
  3965. trailing <code>?</code>, ignore the audio mapping if no audio streams exist in
  3966. the first input:
  3967. </p><div class="example">
  3968. <pre class="example">ffmpeg -i INPUT -map 0:v -map 0:a? OUTPUT
  3969. </pre></div>
  3970. <p>To pick the English audio stream:
  3971. </p><div class="example">
  3972. <pre class="example">ffmpeg -i INPUT -map 0:m:language:eng OUTPUT
  3973. </pre></div>
  3974. <p>Note that using this option disables the default mappings for this output file.
  3975. </p>
  3976. </dd>
  3977. <dt><samp>-ignore_unknown</samp></dt>
  3978. <dd><p>Ignore input streams with unknown type instead of failing if copying
  3979. such streams is attempted.
  3980. </p>
  3981. </dd>
  3982. <dt><samp>-copy_unknown</samp></dt>
  3983. <dd><p>Allow input streams with unknown type to be copied instead of failing if copying
  3984. such streams is attempted.
  3985. </p>
  3986. </dd>
  3987. <dt><samp>-map_channel [<var>input_file_id</var>.<var>stream_specifier</var>.<var>channel_id</var>|-1][?][:<var>output_file_id</var>.<var>stream_specifier</var>]</samp></dt>
  3988. <dd><p>Map an audio channel from a given input to an output. If
  3989. <var>output_file_id</var>.<var>stream_specifier</var> is not set, the audio channel will
  3990. be mapped on all the audio streams.
  3991. </p>
  3992. <p>Using &quot;-1&quot; instead of
  3993. <var>input_file_id</var>.<var>stream_specifier</var>.<var>channel_id</var> will map a muted
  3994. channel.
  3995. </p>
  3996. <p>A trailing <code>?</code> will allow the map_channel to be
  3997. optional: if the map_channel matches no channel the map_channel will be ignored instead
  3998. of failing.
  3999. </p>
  4000. <p>For example, assuming <var>INPUT</var> is a stereo audio file, you can switch the
  4001. two audio channels with the following command:
  4002. </p><div class="example">
  4003. <pre class="example">ffmpeg -i INPUT -map_channel 0.0.1 -map_channel 0.0.0 OUTPUT
  4004. </pre></div>
  4005. <p>If you want to mute the first channel and keep the second:
  4006. </p><div class="example">
  4007. <pre class="example">ffmpeg -i INPUT -map_channel -1 -map_channel 0.0.1 OUTPUT
  4008. </pre></div>
  4009. <p>The order of the &quot;-map_channel&quot; option specifies the order of the channels in
  4010. the output stream. The output channel layout is guessed from the number of
  4011. channels mapped (mono if one &quot;-map_channel&quot;, stereo if two, etc.). Using &quot;-ac&quot;
  4012. in combination of &quot;-map_channel&quot; makes the channel gain levels to be updated if
  4013. input and output channel layouts don&rsquo;t match (for instance two &quot;-map_channel&quot;
  4014. options and &quot;-ac 6&quot;).
  4015. </p>
  4016. <p>You can also extract each channel of an input to specific outputs; the following
  4017. command extracts two channels of the <var>INPUT</var> audio stream (file 0, stream 0)
  4018. to the respective <var>OUTPUT_CH0</var> and <var>OUTPUT_CH1</var> outputs:
  4019. </p><div class="example">
  4020. <pre class="example">ffmpeg -i INPUT -map_channel 0.0.0 OUTPUT_CH0 -map_channel 0.0.1 OUTPUT_CH1
  4021. </pre></div>
  4022. <p>The following example splits the channels of a stereo input into two separate
  4023. streams, which are put into the same output file:
  4024. </p><div class="example">
  4025. <pre class="example">ffmpeg -i stereo.wav -map 0:0 -map 0:0 -map_channel 0.0.0:0.0 -map_channel 0.0.1:0.1 -y out.ogg
  4026. </pre></div>
  4027. <p>Note that currently each output stream can only contain channels from a single
  4028. input stream; you can&rsquo;t for example use &quot;-map_channel&quot; to pick multiple input
  4029. audio channels contained in different streams (from the same or different files)
  4030. and merge them into a single output stream. It is therefore not currently
  4031. possible, for example, to turn two separate mono streams into a single stereo
  4032. stream. However splitting a stereo stream into two single channel mono streams
  4033. is possible.
  4034. </p>
  4035. <p>If you need this feature, a possible workaround is to use the <em>amerge</em>
  4036. filter. For example, if you need to merge a media (here <samp>input.mkv</samp>) with 2
  4037. mono audio streams into one single stereo channel audio stream (and keep the
  4038. video stream), you can use the following command:
  4039. </p><div class="example">
  4040. <pre class="example">ffmpeg -i input.mkv -filter_complex &quot;[0:1] [0:2] amerge&quot; -c:a pcm_s16le -c:v copy output.mkv
  4041. </pre></div>
  4042. <p>To map the first two audio channels from the first input, and using the
  4043. trailing <code>?</code>, ignore the audio channel mapping if the first input is
  4044. mono instead of stereo:
  4045. </p><div class="example">
  4046. <pre class="example">ffmpeg -i INPUT -map_channel 0.0.0 -map_channel 0.0.1? OUTPUT
  4047. </pre></div>
  4048. </dd>
  4049. <dt><samp>-map_metadata[:<var>metadata_spec_out</var>] <var>infile</var>[:<var>metadata_spec_in</var>] (<em>output,per-metadata</em>)</samp></dt>
  4050. <dd><p>Set metadata information of the next output file from <var>infile</var>. Note that
  4051. those are file indices (zero-based), not filenames.
  4052. Optional <var>metadata_spec_in/out</var> parameters specify, which metadata to copy.
  4053. A metadata specifier can have the following forms:
  4054. </p><dl compact="compact">
  4055. <dt><samp><var>g</var></samp></dt>
  4056. <dd><p>global metadata, i.e. metadata that applies to the whole file
  4057. </p>
  4058. </dd>
  4059. <dt><samp><var>s</var>[:<var>stream_spec</var>]</samp></dt>
  4060. <dd><p>per-stream metadata. <var>stream_spec</var> is a stream specifier as described
  4061. in the <a href="#Stream-specifiers">Stream specifiers</a> chapter. In an input metadata specifier, the first
  4062. matching stream is copied from. In an output metadata specifier, all matching
  4063. streams are copied to.
  4064. </p>
  4065. </dd>
  4066. <dt><samp><var>c</var>:<var>chapter_index</var></samp></dt>
  4067. <dd><p>per-chapter metadata. <var>chapter_index</var> is the zero-based chapter index.
  4068. </p>
  4069. </dd>
  4070. <dt><samp><var>p</var>:<var>program_index</var></samp></dt>
  4071. <dd><p>per-program metadata. <var>program_index</var> is the zero-based program index.
  4072. </p></dd>
  4073. </dl>
  4074. <p>If metadata specifier is omitted, it defaults to global.
  4075. </p>
  4076. <p>By default, global metadata is copied from the first input file,
  4077. per-stream and per-chapter metadata is copied along with streams/chapters. These
  4078. default mappings are disabled by creating any mapping of the relevant type. A negative
  4079. file index can be used to create a dummy mapping that just disables automatic copying.
  4080. </p>
  4081. <p>For example to copy metadata from the first stream of the input file to global metadata
  4082. of the output file:
  4083. </p><div class="example">
  4084. <pre class="example">ffmpeg -i in.ogg -map_metadata 0:s:0 out.mp3
  4085. </pre></div>
  4086. <p>To do the reverse, i.e. copy global metadata to all audio streams:
  4087. </p><div class="example">
  4088. <pre class="example">ffmpeg -i in.mkv -map_metadata:s:a 0:g out.mkv
  4089. </pre></div>
  4090. <p>Note that simple <code>0</code> would work as well in this example, since global
  4091. metadata is assumed by default.
  4092. </p>
  4093. </dd>
  4094. <dt><samp>-map_chapters <var>input_file_index</var> (<em>output</em>)</samp></dt>
  4095. <dd><p>Copy chapters from input file with index <var>input_file_index</var> to the next
  4096. output file. If no chapter mapping is specified, then chapters are copied from
  4097. the first input file with at least one chapter. Use a negative file index to
  4098. disable any chapter copying.
  4099. </p>
  4100. </dd>
  4101. <dt><samp>-benchmark (<em>global</em>)</samp></dt>
  4102. <dd><p>Show benchmarking information at the end of an encode.
  4103. Shows real, system and user time used and maximum memory consumption.
  4104. Maximum memory consumption is not supported on all systems,
  4105. it will usually display as 0 if not supported.
  4106. </p></dd>
  4107. <dt><samp>-benchmark_all (<em>global</em>)</samp></dt>
  4108. <dd><p>Show benchmarking information during the encode.
  4109. Shows real, system and user time used in various steps (audio/video encode/decode).
  4110. </p></dd>
  4111. <dt><samp>-timelimit <var>duration</var> (<em>global</em>)</samp></dt>
  4112. <dd><p>Exit after ffmpeg has been running for <var>duration</var> seconds in CPU user time.
  4113. </p></dd>
  4114. <dt><samp>-dump (<em>global</em>)</samp></dt>
  4115. <dd><p>Dump each input packet to stderr.
  4116. </p></dd>
  4117. <dt><samp>-hex (<em>global</em>)</samp></dt>
  4118. <dd><p>When dumping packets, also dump the payload.
  4119. </p></dd>
  4120. <dt><samp>-re (<em>input</em>)</samp></dt>
  4121. <dd><p>Read input at native frame rate. Mainly used to simulate a grab device,
  4122. or live input stream (e.g. when reading from a file). Should not be used
  4123. with actual grab devices or live input streams (where it can cause packet
  4124. loss).
  4125. By default <code>ffmpeg</code> attempts to read the input(s) as fast as possible.
  4126. This option will slow down the reading of the input(s) to the native frame rate
  4127. of the input(s). It is useful for real-time output (e.g. live streaming).
  4128. </p></dd>
  4129. <dt><samp>-vsync <var>parameter</var></samp></dt>
  4130. <dd><p>Video sync method.
  4131. For compatibility reasons old values can be specified as numbers.
  4132. Newly added values will have to be specified as strings always.
  4133. </p>
  4134. <dl compact="compact">
  4135. <dt><samp>0, passthrough</samp></dt>
  4136. <dd><p>Each frame is passed with its timestamp from the demuxer to the muxer.
  4137. </p></dd>
  4138. <dt><samp>1, cfr</samp></dt>
  4139. <dd><p>Frames will be duplicated and dropped to achieve exactly the requested
  4140. constant frame rate.
  4141. </p></dd>
  4142. <dt><samp>2, vfr</samp></dt>
  4143. <dd><p>Frames are passed through with their timestamp or dropped so as to
  4144. prevent 2 frames from having the same timestamp.
  4145. </p></dd>
  4146. <dt><samp>drop</samp></dt>
  4147. <dd><p>As passthrough but destroys all timestamps, making the muxer generate
  4148. fresh timestamps based on frame-rate.
  4149. </p></dd>
  4150. <dt><samp>-1, auto</samp></dt>
  4151. <dd><p>Chooses between 1 and 2 depending on muxer capabilities. This is the
  4152. default method.
  4153. </p></dd>
  4154. </dl>
  4155. <p>Note that the timestamps may be further modified by the muxer, after this.
  4156. For example, in the case that the format option <samp>avoid_negative_ts</samp>
  4157. is enabled.
  4158. </p>
  4159. <p>With -map you can select from which stream the timestamps should be
  4160. taken. You can leave either video or audio unchanged and sync the
  4161. remaining stream(s) to the unchanged one.
  4162. </p>
  4163. </dd>
  4164. <dt><samp>-frame_drop_threshold <var>parameter</var></samp></dt>
  4165. <dd><p>Frame drop threshold, which specifies how much behind video frames can
  4166. be before they are dropped. In frame rate units, so 1.0 is one frame.
  4167. The default is -1.1. One possible usecase is to avoid framedrops in case
  4168. of noisy timestamps or to increase frame drop precision in case of exact
  4169. timestamps.
  4170. </p>
  4171. </dd>
  4172. <dt><samp>-async <var>samples_per_second</var></samp></dt>
  4173. <dd><p>Audio sync method. &quot;Stretches/squeezes&quot; the audio stream to match the timestamps,
  4174. the parameter is the maximum samples per second by which the audio is changed.
  4175. -async 1 is a special case where only the start of the audio stream is corrected
  4176. without any later correction.
  4177. </p>
  4178. <p>Note that the timestamps may be further modified by the muxer, after this.
  4179. For example, in the case that the format option <samp>avoid_negative_ts</samp>
  4180. is enabled.
  4181. </p>
  4182. <p>This option has been deprecated. Use the <code>aresample</code> audio filter instead.
  4183. </p>
  4184. </dd>
  4185. <dt><samp>-adrift_threshold <var>time</var></samp></dt>
  4186. <dd><p>Set the minimum difference between timestamps and audio data (in seconds) to trigger
  4187. adding/dropping samples to make it match the timestamps. This option effectively is
  4188. a threshold to select between hard (add/drop) and soft (squeeze/stretch) compensation.
  4189. <code>-async</code> must be set to a positive value.
  4190. </p>
  4191. </dd>
  4192. <dt><samp>-apad <var>parameters</var> (<em>output,per-stream</em>)</samp></dt>
  4193. <dd><p>Pad the output audio stream(s). This is the same as applying <code>-af apad</code>.
  4194. Argument is a string of filter parameters composed the same as with the <code>apad</code> filter.
  4195. <code>-shortest</code> must be set for this output for the option to take effect.
  4196. </p>
  4197. </dd>
  4198. <dt><samp>-copyts</samp></dt>
  4199. <dd><p>Do not process input timestamps, but keep their values without trying
  4200. to sanitize them. In particular, do not remove the initial start time
  4201. offset value.
  4202. </p>
  4203. <p>Note that, depending on the <samp>vsync</samp> option or on specific muxer
  4204. processing (e.g. in case the format option <samp>avoid_negative_ts</samp>
  4205. is enabled) the output timestamps may mismatch with the input
  4206. timestamps even when this option is selected.
  4207. </p>
  4208. </dd>
  4209. <dt><samp>-start_at_zero</samp></dt>
  4210. <dd><p>When used with <samp>copyts</samp>, shift input timestamps so they start at zero.
  4211. </p>
  4212. <p>This means that using e.g. <code>-ss 50</code> will make output timestamps start at
  4213. 50 seconds, regardless of what timestamp the input file started at.
  4214. </p>
  4215. </dd>
  4216. <dt><samp>-copytb <var>mode</var></samp></dt>
  4217. <dd><p>Specify how to set the encoder timebase when stream copying. <var>mode</var> is an
  4218. integer numeric value, and can assume one of the following values:
  4219. </p>
  4220. <dl compact="compact">
  4221. <dt><samp>1</samp></dt>
  4222. <dd><p>Use the demuxer timebase.
  4223. </p>
  4224. <p>The time base is copied to the output encoder from the corresponding input
  4225. demuxer. This is sometimes required to avoid non monotonically increasing
  4226. timestamps when copying video streams with variable frame rate.
  4227. </p>
  4228. </dd>
  4229. <dt><samp>0</samp></dt>
  4230. <dd><p>Use the decoder timebase.
  4231. </p>
  4232. <p>The time base is copied to the output encoder from the corresponding input
  4233. decoder.
  4234. </p>
  4235. </dd>
  4236. <dt><samp>-1</samp></dt>
  4237. <dd><p>Try to make the choice automatically, in order to generate a sane output.
  4238. </p></dd>
  4239. </dl>
  4240. <p>Default value is -1.
  4241. </p>
  4242. </dd>
  4243. <dt><samp>-enc_time_base[:<var>stream_specifier</var>] <var>timebase</var> (<em>output,per-stream</em>)</samp></dt>
  4244. <dd><p>Set the encoder timebase. <var>timebase</var> is a floating point number,
  4245. and can assume one of the following values:
  4246. </p>
  4247. <dl compact="compact">
  4248. <dt><samp>0</samp></dt>
  4249. <dd><p>Assign a default value according to the media type.
  4250. </p>
  4251. <p>For video - use 1/framerate, for audio - use 1/samplerate.
  4252. </p>
  4253. </dd>
  4254. <dt><samp>-1</samp></dt>
  4255. <dd><p>Use the input stream timebase when possible.
  4256. </p>
  4257. <p>If an input stream is not available, the default timebase will be used.
  4258. </p>
  4259. </dd>
  4260. <dt><samp>&gt;0</samp></dt>
  4261. <dd><p>Use the provided number as the timebase.
  4262. </p>
  4263. <p>This field can be provided as a ratio of two integers (e.g. 1:24, 1:48000)
  4264. or as a floating point number (e.g. 0.04166, 2.0833e-5)
  4265. </p></dd>
  4266. </dl>
  4267. <p>Default value is 0.
  4268. </p>
  4269. </dd>
  4270. <dt><samp>-bitexact (<em>input/output</em>)</samp></dt>
  4271. <dd><p>Enable bitexact mode for (de)muxer and (de/en)coder
  4272. </p></dd>
  4273. <dt><samp>-shortest (<em>output</em>)</samp></dt>
  4274. <dd><p>Finish encoding when the shortest input stream ends.
  4275. </p></dd>
  4276. <dt><samp>-dts_delta_threshold</samp></dt>
  4277. <dd><p>Timestamp discontinuity delta threshold.
  4278. </p></dd>
  4279. <dt><samp>-dts_error_threshold <var>seconds</var></samp></dt>
  4280. <dd><p>Timestamp error delta threshold. This threshold use to discard crazy/damaged
  4281. timestamps and the default is 30 hours which is arbitrarily picked and quite
  4282. conservative.
  4283. </p></dd>
  4284. <dt><samp>-muxdelay <var>seconds</var> (<em>output</em>)</samp></dt>
  4285. <dd><p>Set the maximum demux-decode delay.
  4286. </p></dd>
  4287. <dt><samp>-muxpreload <var>seconds</var> (<em>output</em>)</samp></dt>
  4288. <dd><p>Set the initial demux-decode delay.
  4289. </p></dd>
  4290. <dt><samp>-streamid <var>output-stream-index</var>:<var>new-value</var> (<em>output</em>)</samp></dt>
  4291. <dd><p>Assign a new stream-id value to an output stream. This option should be
  4292. specified prior to the output filename to which it applies.
  4293. For the situation where multiple output files exist, a streamid
  4294. may be reassigned to a different value.
  4295. </p>
  4296. <p>For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
  4297. an output mpegts file:
  4298. </p><div class="example">
  4299. <pre class="example">ffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts
  4300. </pre></div>
  4301. </dd>
  4302. <dt><samp>-bsf[:<var>stream_specifier</var>] <var>bitstream_filters</var> (<em>output,per-stream</em>)</samp></dt>
  4303. <dd><p>Set bitstream filters for matching streams. <var>bitstream_filters</var> is
  4304. a comma-separated list of bitstream filters. Use the <code>-bsfs</code> option
  4305. to get the list of bitstream filters.
  4306. </p><div class="example">
  4307. <pre class="example">ffmpeg -i h264.mp4 -c:v copy -bsf:v h264_mp4toannexb -an out.h264
  4308. </pre></div>
  4309. <div class="example">
  4310. <pre class="example">ffmpeg -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt
  4311. </pre></div>
  4312. </dd>
  4313. <dt><samp>-tag[:<var>stream_specifier</var>] <var>codec_tag</var> (<em>input/output,per-stream</em>)</samp></dt>
  4314. <dd><p>Force a tag/fourcc for matching streams.
  4315. </p>
  4316. </dd>
  4317. <dt><samp>-timecode <var>hh</var>:<var>mm</var>:<var>ss</var>SEP<var>ff</var></samp></dt>
  4318. <dd><p>Specify Timecode for writing. <var>SEP</var> is &rsquo;:&rsquo; for non drop timecode and &rsquo;;&rsquo;
  4319. (or &rsquo;.&rsquo;) for drop.
  4320. </p><div class="example">
  4321. <pre class="example">ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
  4322. </pre></div>
  4323. <span id="filter_005fcomplex_005foption"></span></dd>
  4324. <dt><samp>-filter_complex <var>filtergraph</var> (<em>global</em>)</samp></dt>
  4325. <dd><p>Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
  4326. outputs. For simple graphs &ndash; those with one input and one output of the same
  4327. type &ndash; see the <samp>-filter</samp> options. <var>filtergraph</var> is a description of
  4328. the filtergraph, as described in the &ldquo;Filtergraph syntax&rdquo; section of the
  4329. ffmpeg-filters manual.
  4330. </p>
  4331. <p>Input link labels must refer to input streams using the
  4332. <code>[file_index:stream_specifier]</code> syntax (i.e. the same as <samp>-map</samp>
  4333. uses). If <var>stream_specifier</var> matches multiple streams, the first one will be
  4334. used. An unlabeled input will be connected to the first unused input stream of
  4335. the matching type.
  4336. </p>
  4337. <p>Output link labels are referred to with <samp>-map</samp>. Unlabeled outputs are
  4338. added to the first output file.
  4339. </p>
  4340. <p>Note that with this option it is possible to use only lavfi sources without
  4341. normal input files.
  4342. </p>
  4343. <p>For example, to overlay an image over video
  4344. </p><div class="example">
  4345. <pre class="example">ffmpeg -i video.mkv -i image.png -filter_complex '[0:v][1:v]overlay[out]' -map
  4346. '[out]' out.mkv
  4347. </pre></div>
  4348. <p>Here <code>[0:v]</code> refers to the first video stream in the first input file,
  4349. which is linked to the first (main) input of the overlay filter. Similarly the
  4350. first video stream in the second input is linked to the second (overlay) input
  4351. of overlay.
  4352. </p>
  4353. <p>Assuming there is only one video stream in each input file, we can omit input
  4354. labels, so the above is equivalent to
  4355. </p><div class="example">
  4356. <pre class="example">ffmpeg -i video.mkv -i image.png -filter_complex 'overlay[out]' -map
  4357. '[out]' out.mkv
  4358. </pre></div>
  4359. <p>Furthermore we can omit the output label and the single output from the filter
  4360. graph will be added to the output file automatically, so we can simply write
  4361. </p><div class="example">
  4362. <pre class="example">ffmpeg -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
  4363. </pre></div>
  4364. <p>As a special exception, you can use a bitmap subtitle stream as input: it
  4365. will be converted into a video with the same size as the largest video in
  4366. the file, or 720x576 if no video is present. Note that this is an
  4367. experimental and temporary solution. It will be removed once libavfilter has
  4368. proper support for subtitles.
  4369. </p>
  4370. <p>For example, to hardcode subtitles on top of a DVB-T recording stored in
  4371. MPEG-TS format, delaying the subtitles by 1 second:
  4372. </p><div class="example">
  4373. <pre class="example">ffmpeg -i input.ts -filter_complex \
  4374. '[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay' \
  4375. -sn -map '#0x2dc' output.mkv
  4376. </pre></div>
  4377. <p>(0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video,
  4378. audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too)
  4379. </p>
  4380. <p>To generate 5 seconds of pure red video using lavfi <code>color</code> source:
  4381. </p><div class="example">
  4382. <pre class="example">ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
  4383. </pre></div>
  4384. </dd>
  4385. <dt><samp>-filter_complex_threads <var>nb_threads</var> (<em>global</em>)</samp></dt>
  4386. <dd><p>Defines how many threads are used to process a filter_complex graph.
  4387. Similar to filter_threads but used for <code>-filter_complex</code> graphs only.
  4388. The default is the number of available CPUs.
  4389. </p>
  4390. </dd>
  4391. <dt><samp>-lavfi <var>filtergraph</var> (<em>global</em>)</samp></dt>
  4392. <dd><p>Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
  4393. outputs. Equivalent to <samp>-filter_complex</samp>.
  4394. </p>
  4395. </dd>
  4396. <dt><samp>-filter_complex_script <var>filename</var> (<em>global</em>)</samp></dt>
  4397. <dd><p>This option is similar to <samp>-filter_complex</samp>, the only difference is that
  4398. its argument is the name of the file from which a complex filtergraph
  4399. description is to be read.
  4400. </p>
  4401. </dd>
  4402. <dt><samp>-accurate_seek (<em>input</em>)</samp></dt>
  4403. <dd><p>This option enables or disables accurate seeking in input files with the
  4404. <samp>-ss</samp> option. It is enabled by default, so seeking is accurate when
  4405. transcoding. Use <samp>-noaccurate_seek</samp> to disable it, which may be useful
  4406. e.g. when copying some streams and transcoding the others.
  4407. </p>
  4408. </dd>
  4409. <dt><samp>-seek_timestamp (<em>input</em>)</samp></dt>
  4410. <dd><p>This option enables or disables seeking by timestamp in input files with the
  4411. <samp>-ss</samp> option. It is disabled by default. If enabled, the argument
  4412. to the <samp>-ss</samp> option is considered an actual timestamp, and is not
  4413. offset by the start time of the file. This matters only for files which do
  4414. not start from timestamp 0, such as transport streams.
  4415. </p>
  4416. </dd>
  4417. <dt><samp>-thread_queue_size <var>size</var> (<em>input</em>)</samp></dt>
  4418. <dd><p>This option sets the maximum number of queued packets when reading from the
  4419. file or device. With low latency / high rate live streams, packets may be
  4420. discarded if they are not read in a timely manner; setting this value can
  4421. force ffmpeg to use a separate input thread and read packets as soon as they
  4422. arrive. By default ffmpeg only do this if multiple inputs are specified.
  4423. </p>
  4424. </dd>
  4425. <dt><samp>-sdp_file <var>file</var> (<em>global</em>)</samp></dt>
  4426. <dd><p>Print sdp information for an output stream to <var>file</var>.
  4427. This allows dumping sdp information when at least one output isn&rsquo;t an
  4428. rtp stream. (Requires at least one of the output formats to be rtp).
  4429. </p>
  4430. </dd>
  4431. <dt><samp>-discard (<em>input</em>)</samp></dt>
  4432. <dd><p>Allows discarding specific streams or frames from streams.
  4433. Any input stream can be fully discarded, using value <code>all</code> whereas
  4434. selective discarding of frames from a stream occurs at the demuxer
  4435. and is not supported by all demuxers.
  4436. </p>
  4437. <dl compact="compact">
  4438. <dt><samp>none</samp></dt>
  4439. <dd><p>Discard no frame.
  4440. </p>
  4441. </dd>
  4442. <dt><samp>default</samp></dt>
  4443. <dd><p>Default, which discards no frames.
  4444. </p>
  4445. </dd>
  4446. <dt><samp>noref</samp></dt>
  4447. <dd><p>Discard all non-reference frames.
  4448. </p>
  4449. </dd>
  4450. <dt><samp>bidir</samp></dt>
  4451. <dd><p>Discard all bidirectional frames.
  4452. </p>
  4453. </dd>
  4454. <dt><samp>nokey</samp></dt>
  4455. <dd><p>Discard all frames excepts keyframes.
  4456. </p>
  4457. </dd>
  4458. <dt><samp>all</samp></dt>
  4459. <dd><p>Discard all frames.
  4460. </p></dd>
  4461. </dl>
  4462. </dd>
  4463. <dt><samp>-abort_on <var>flags</var> (<em>global</em>)</samp></dt>
  4464. <dd><p>Stop and abort on various conditions. The following flags are available:
  4465. </p>
  4466. <dl compact="compact">
  4467. <dt><samp>empty_output</samp></dt>
  4468. <dd><p>No packets were passed to the muxer, the output is empty.
  4469. </p></dd>
  4470. <dt><samp>empty_output_stream</samp></dt>
  4471. <dd><p>No packets were passed to the muxer in some of the output streams.
  4472. </p></dd>
  4473. </dl>
  4474. </dd>
  4475. <dt><samp>-max_error_rate (<em>global</em>)</samp></dt>
  4476. <dd><p>Set fraction of decoding frame failures across all inputs which when crossed
  4477. ffmpeg will return exit code 69. Crossing this threshold does not terminate
  4478. processing. Range is a floating-point number between 0 to 1. Default is 2/3.
  4479. </p>
  4480. </dd>
  4481. <dt><samp>-xerror (<em>global</em>)</samp></dt>
  4482. <dd><p>Stop and exit on error
  4483. </p>
  4484. </dd>
  4485. <dt><samp>-max_muxing_queue_size <var>packets</var> (<em>output,per-stream</em>)</samp></dt>
  4486. <dd><p>When transcoding audio and/or video streams, ffmpeg will not begin writing into
  4487. the output until it has one packet for each such stream. While waiting for that
  4488. to happen, packets for other streams are buffered. This option sets the size of
  4489. this buffer, in packets, for the matching output stream.
  4490. </p>
  4491. <p>The default value of this option should be high enough for most uses, so only
  4492. touch this option if you are sure that you need it.
  4493. </p>
  4494. </dd>
  4495. <dt><samp>-muxing_queue_data_threshold <var>bytes</var> (<em>output,per-stream</em>)</samp></dt>
  4496. <dd><p>This is a minimum threshold until which the muxing queue size is not taken into
  4497. account. Defaults to 50 megabytes per stream, and is based on the overall size
  4498. of packets passed to the muxer.
  4499. </p>
  4500. </dd>
  4501. <dt><samp>-auto_conversion_filters (<em>global</em>)</samp></dt>
  4502. <dd><p>Enable automatically inserting format conversion filters in all filter
  4503. graphs, including those defined by <samp>-vf</samp>, <samp>-af</samp>,
  4504. <samp>-filter_complex</samp> and <samp>-lavfi</samp>. If filter format negotiation
  4505. requires a conversion, the initialization of the filters will fail.
  4506. Conversions can still be performed by inserting the relevant conversion
  4507. filter (scale, aresample) in the graph.
  4508. On by default, to explicitly disable it you need to specify
  4509. <code>-noauto_conversion_filters</code>.
  4510. </p>
  4511. </dd>
  4512. </dl>
  4513. <a name="Preset-files"></a>
  4514. <h3 class="section">5.12 Preset files<span class="pull-right"><a class="anchor hidden-xs" href="#Preset-files" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Preset-files" aria-hidden="true">TOC</a></span></h3>
  4515. <p>A preset file contains a sequence of <var>option</var>=<var>value</var> pairs,
  4516. one for each line, specifying a sequence of options which would be
  4517. awkward to specify on the command line. Lines starting with the hash
  4518. (&rsquo;#&rsquo;) character are ignored and are used to provide comments. Check
  4519. the <samp>presets</samp> directory in the FFmpeg source tree for examples.
  4520. </p>
  4521. <p>There are two types of preset files: ffpreset and avpreset files.
  4522. </p>
  4523. <a name="ffpreset-files"></a>
  4524. <h4 class="subsection">5.12.1 ffpreset files<span class="pull-right"><a class="anchor hidden-xs" href="#ffpreset-files" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ffpreset-files" aria-hidden="true">TOC</a></span></h4>
  4525. <p>ffpreset files are specified with the <code>vpre</code>, <code>apre</code>,
  4526. <code>spre</code>, and <code>fpre</code> options. The <code>fpre</code> option takes the
  4527. filename of the preset instead of a preset name as input and can be
  4528. used for any kind of codec. For the <code>vpre</code>, <code>apre</code>, and
  4529. <code>spre</code> options, the options specified in a preset file are
  4530. applied to the currently selected codec of the same type as the preset
  4531. option.
  4532. </p>
  4533. <p>The argument passed to the <code>vpre</code>, <code>apre</code>, and <code>spre</code>
  4534. preset options identifies the preset file to use according to the
  4535. following rules:
  4536. </p>
  4537. <p>First ffmpeg searches for a file named <var>arg</var>.ffpreset in the
  4538. directories <samp>$FFMPEG_DATADIR</samp> (if set), and <samp>$HOME/.ffmpeg</samp>, and in
  4539. the datadir defined at configuration time (usually <samp>PREFIX/share/ffmpeg</samp>)
  4540. or in a <samp>ffpresets</samp> folder along the executable on win32,
  4541. in that order. For example, if the argument is <code>libvpx-1080p</code>, it will
  4542. search for the file <samp>libvpx-1080p.ffpreset</samp>.
  4543. </p>
  4544. <p>If no such file is found, then ffmpeg will search for a file named
  4545. <var>codec_name</var>-<var>arg</var>.ffpreset in the above-mentioned
  4546. directories, where <var>codec_name</var> is the name of the codec to which
  4547. the preset file options will be applied. For example, if you select
  4548. the video codec with <code>-vcodec libvpx</code> and use <code>-vpre 1080p</code>,
  4549. then it will search for the file <samp>libvpx-1080p.ffpreset</samp>.
  4550. </p>
  4551. <a name="avpreset-files"></a>
  4552. <h4 class="subsection">5.12.2 avpreset files<span class="pull-right"><a class="anchor hidden-xs" href="#avpreset-files" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avpreset-files" aria-hidden="true">TOC</a></span></h4>
  4553. <p>avpreset files are specified with the <code>pre</code> option. They work similar to
  4554. ffpreset files, but they only allow encoder- specific options. Therefore, an
  4555. <var>option</var>=<var>value</var> pair specifying an encoder cannot be used.
  4556. </p>
  4557. <p>When the <code>pre</code> option is specified, ffmpeg will look for files with the
  4558. suffix .avpreset in the directories <samp>$AVCONV_DATADIR</samp> (if set), and
  4559. <samp>$HOME/.avconv</samp>, and in the datadir defined at configuration time (usually
  4560. <samp>PREFIX/share/ffmpeg</samp>), in that order.
  4561. </p>
  4562. <p>First ffmpeg searches for a file named <var>codec_name</var>-<var>arg</var>.avpreset in
  4563. the above-mentioned directories, where <var>codec_name</var> is the name of the codec
  4564. to which the preset file options will be applied. For example, if you select the
  4565. video codec with <code>-vcodec libvpx</code> and use <code>-pre 1080p</code>, then it will
  4566. search for the file <samp>libvpx-1080p.avpreset</samp>.
  4567. </p>
  4568. <p>If no such file is found, then ffmpeg will search for a file named
  4569. <var>arg</var>.avpreset in the same directories.
  4570. </p>
  4571. <a name="Examples-1"></a>
  4572. <h2 class="chapter">6 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-1" aria-hidden="true">TOC</a></span></h2>
  4573. <a name="Video-and-Audio-grabbing"></a>
  4574. <h3 class="section">6.1 Video and Audio grabbing<span class="pull-right"><a class="anchor hidden-xs" href="#Video-and-Audio-grabbing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-and-Audio-grabbing" aria-hidden="true">TOC</a></span></h3>
  4575. <p>If you specify the input format and device then ffmpeg can grab video
  4576. and audio directly.
  4577. </p>
  4578. <div class="example">
  4579. <pre class="example">ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
  4580. </pre></div>
  4581. <p>Or with an ALSA audio source (mono input, card id 1) instead of OSS:
  4582. </p><div class="example">
  4583. <pre class="example">ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg
  4584. </pre></div>
  4585. <p>Note that you must activate the right video source and channel before
  4586. launching ffmpeg with any TV viewer such as
  4587. <a href="http://linux.bytesex.org/xawtv/">xawtv</a> by Gerd Knorr. You also
  4588. have to set the audio recording levels correctly with a
  4589. standard mixer.
  4590. </p>
  4591. <a name="X11-grabbing"></a>
  4592. <h3 class="section">6.2 X11 grabbing<span class="pull-right"><a class="anchor hidden-xs" href="#X11-grabbing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-X11-grabbing" aria-hidden="true">TOC</a></span></h3>
  4593. <p>Grab the X11 display with ffmpeg via
  4594. </p>
  4595. <div class="example">
  4596. <pre class="example">ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0 /tmp/out.mpg
  4597. </pre></div>
  4598. <p>0.0 is display.screen number of your X11 server, same as
  4599. the DISPLAY environment variable.
  4600. </p>
  4601. <div class="example">
  4602. <pre class="example">ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0+10,20 /tmp/out.mpg
  4603. </pre></div>
  4604. <p>0.0 is display.screen number of your X11 server, same as the DISPLAY environment
  4605. variable. 10 is the x-offset and 20 the y-offset for the grabbing.
  4606. </p>
  4607. <a name="Video-and-Audio-file-format-conversion"></a>
  4608. <h3 class="section">6.3 Video and Audio file format conversion<span class="pull-right"><a class="anchor hidden-xs" href="#Video-and-Audio-file-format-conversion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-and-Audio-file-format-conversion" aria-hidden="true">TOC</a></span></h3>
  4609. <p>Any supported file format and protocol can serve as input to ffmpeg:
  4610. </p>
  4611. <p>Examples:
  4612. </p><ul>
  4613. <li> You can use YUV files as input:
  4614. <div class="example">
  4615. <pre class="example">ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
  4616. </pre></div>
  4617. <p>It will use the files:
  4618. </p><div class="example">
  4619. <pre class="example">/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
  4620. /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
  4621. </pre></div>
  4622. <p>The Y files use twice the resolution of the U and V files. They are
  4623. raw files, without header. They can be generated by all decent video
  4624. decoders. You must specify the size of the image with the <samp>-s</samp> option
  4625. if ffmpeg cannot guess it.
  4626. </p>
  4627. </li><li> You can input from a raw YUV420P file:
  4628. <div class="example">
  4629. <pre class="example">ffmpeg -i /tmp/test.yuv /tmp/out.avi
  4630. </pre></div>
  4631. <p>test.yuv is a file containing raw YUV planar data. Each frame is composed
  4632. of the Y plane followed by the U and V planes at half vertical and
  4633. horizontal resolution.
  4634. </p>
  4635. </li><li> You can output to a raw YUV420P file:
  4636. <div class="example">
  4637. <pre class="example">ffmpeg -i mydivx.avi hugefile.yuv
  4638. </pre></div>
  4639. </li><li> You can set several input files and output files:
  4640. <div class="example">
  4641. <pre class="example">ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
  4642. </pre></div>
  4643. <p>Converts the audio file a.wav and the raw YUV video file a.yuv
  4644. to MPEG file a.mpg.
  4645. </p>
  4646. </li><li> You can also do audio and video conversions at the same time:
  4647. <div class="example">
  4648. <pre class="example">ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
  4649. </pre></div>
  4650. <p>Converts a.wav to MPEG audio at 22050 Hz sample rate.
  4651. </p>
  4652. </li><li> You can encode to several formats at the same time and define a
  4653. mapping from input stream to output streams:
  4654. <div class="example">
  4655. <pre class="example">ffmpeg -i /tmp/a.wav -map 0:a -b:a 64k /tmp/a.mp2 -map 0:a -b:a 128k /tmp/b.mp2
  4656. </pre></div>
  4657. <p>Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. &rsquo;-map
  4658. file:index&rsquo; specifies which input stream is used for each output
  4659. stream, in the order of the definition of output streams.
  4660. </p>
  4661. </li><li> You can transcode decrypted VOBs:
  4662. <div class="example">
  4663. <pre class="example">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
  4664. </pre></div>
  4665. <p>This is a typical DVD ripping example; the input is a VOB file, the
  4666. output an AVI file with MPEG-4 video and MP3 audio. Note that in this
  4667. command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
  4668. GOP size is 300 which means one intra frame every 10 seconds for 29.97fps
  4669. input video. Furthermore, the audio stream is MP3-encoded so you need
  4670. to enable LAME support by passing <code>--enable-libmp3lame</code> to configure.
  4671. The mapping is particularly useful for DVD transcoding
  4672. to get the desired audio language.
  4673. </p>
  4674. <p>NOTE: To see the supported input formats, use <code>ffmpeg -demuxers</code>.
  4675. </p>
  4676. </li><li> You can extract images from a video, or create a video from many images:
  4677. <p>For extracting images from a video:
  4678. </p><div class="example">
  4679. <pre class="example">ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
  4680. </pre></div>
  4681. <p>This will extract one video frame per second from the video and will
  4682. output them in files named <samp>foo-001.jpeg</samp>, <samp>foo-002.jpeg</samp>,
  4683. etc. Images will be rescaled to fit the new WxH values.
  4684. </p>
  4685. <p>If you want to extract just a limited number of frames, you can use the
  4686. above command in combination with the <code>-frames:v</code> or <code>-t</code> option,
  4687. or in combination with -ss to start extracting from a certain point in time.
  4688. </p>
  4689. <p>For creating a video from many images:
  4690. </p><div class="example">
  4691. <pre class="example">ffmpeg -f image2 -framerate 12 -i foo-%03d.jpeg -s WxH foo.avi
  4692. </pre></div>
  4693. <p>The syntax <code>foo-%03d.jpeg</code> specifies to use a decimal number
  4694. composed of three digits padded with zeroes to express the sequence
  4695. number. It is the same syntax supported by the C printf function, but
  4696. only formats accepting a normal integer are suitable.
  4697. </p>
  4698. <p>When importing an image sequence, -i also supports expanding
  4699. shell-like wildcard patterns (globbing) internally, by selecting the
  4700. image2-specific <code>-pattern_type glob</code> option.
  4701. </p>
  4702. <p>For example, for creating a video from filenames matching the glob pattern
  4703. <code>foo-*.jpeg</code>:
  4704. </p><div class="example">
  4705. <pre class="example">ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi
  4706. </pre></div>
  4707. </li><li> You can put many streams of the same type in the output:
  4708. <div class="example">
  4709. <pre class="example">ffmpeg -i test1.avi -i test2.avi -map 1:1 -map 1:0 -map 0:1 -map 0:0 -c copy -y test12.nut
  4710. </pre></div>
  4711. <p>The resulting output file <samp>test12.nut</samp> will contain the first four streams
  4712. from the input files in reverse order.
  4713. </p>
  4714. </li><li> To force CBR video output:
  4715. <div class="example">
  4716. <pre class="example">ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
  4717. </pre></div>
  4718. </li><li> The four options lmin, lmax, mblmin and mblmax use &rsquo;lambda&rsquo; units,
  4719. but you may use the QP2LAMBDA constant to easily convert from &rsquo;q&rsquo; units:
  4720. <div class="example">
  4721. <pre class="example">ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
  4722. </pre></div>
  4723. </li></ul>
  4724. <a name="Syntax"></a>
  4725. <h2 class="chapter">7 Syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Syntax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Syntax" aria-hidden="true">TOC</a></span></h2>
  4726. <p>This section documents the syntax and formats employed by the FFmpeg
  4727. libraries and tools.
  4728. </p>
  4729. <span id="quoting_005fand_005fescaping"></span><a name="Quoting-and-escaping"></a>
  4730. <h3 class="section">7.1 Quoting and escaping<span class="pull-right"><a class="anchor hidden-xs" href="#Quoting-and-escaping" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Quoting-and-escaping" aria-hidden="true">TOC</a></span></h3>
  4731. <p>FFmpeg adopts the following quoting and escaping mechanism, unless
  4732. explicitly specified. The following rules are applied:
  4733. </p>
  4734. <ul>
  4735. <li> &lsquo;<samp>'</samp>&rsquo; and &lsquo;<samp>\</samp>&rsquo; are special characters (respectively used for
  4736. quoting and escaping). In addition to them, there might be other
  4737. special characters depending on the specific syntax where the escaping
  4738. and quoting are employed.
  4739. </li><li> A special character is escaped by prefixing it with a &lsquo;<samp>\</samp>&rsquo;.
  4740. </li><li> All characters enclosed between &lsquo;<samp>''</samp>&rsquo; are included literally in the
  4741. parsed string. The quote character &lsquo;<samp>'</samp>&rsquo; itself cannot be quoted,
  4742. so you may need to close the quote and escape it.
  4743. </li><li> Leading and trailing whitespaces, unless escaped or quoted, are
  4744. removed from the parsed string.
  4745. </li></ul>
  4746. <p>Note that you may need to add a second level of escaping when using
  4747. the command line or a script, which depends on the syntax of the
  4748. adopted shell language.
  4749. </p>
  4750. <p>The function <code>av_get_token</code> defined in
  4751. <samp>libavutil/avstring.h</samp> can be used to parse a token quoted or
  4752. escaped according to the rules defined above.
  4753. </p>
  4754. <p>The tool <samp>tools/ffescape</samp> in the FFmpeg source tree can be used
  4755. to automatically quote or escape a string in a script.
  4756. </p>
  4757. <a name="Examples-2"></a>
  4758. <h4 class="subsection">7.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-2" aria-hidden="true">TOC</a></span></h4>
  4759. <ul>
  4760. <li> Escape the string <code>Crime d'Amour</code> containing the <code>'</code> special
  4761. character:
  4762. <div class="example">
  4763. <pre class="example">Crime d\'Amour
  4764. </pre></div>
  4765. </li><li> The string above contains a quote, so the <code>'</code> needs to be escaped
  4766. when quoting it:
  4767. <div class="example">
  4768. <pre class="example">'Crime d'\''Amour'
  4769. </pre></div>
  4770. </li><li> Include leading or trailing whitespaces using quoting:
  4771. <div class="example">
  4772. <pre class="example">' this string starts and ends with whitespaces '
  4773. </pre></div>
  4774. </li><li> Escaping and quoting can be mixed together:
  4775. <div class="example">
  4776. <pre class="example">' The string '\'string\'' is a string '
  4777. </pre></div>
  4778. </li><li> To include a literal &lsquo;<samp>\</samp>&rsquo; you can use either escaping or quoting:
  4779. <div class="example">
  4780. <pre class="example">'c:\foo' can be written as c:\\foo
  4781. </pre></div>
  4782. </li></ul>
  4783. <span id="date-syntax"></span><a name="Date"></a>
  4784. <h3 class="section">7.2 Date<span class="pull-right"><a class="anchor hidden-xs" href="#Date" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Date" aria-hidden="true">TOC</a></span></h3>
  4785. <p>The accepted syntax is:
  4786. </p><div class="example">
  4787. <pre class="example">[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
  4788. now
  4789. </pre></div>
  4790. <p>If the value is &quot;now&quot; it takes the current time.
  4791. </p>
  4792. <p>Time is local time unless Z is appended, in which case it is
  4793. interpreted as UTC.
  4794. If the year-month-day part is not specified it takes the current
  4795. year-month-day.
  4796. </p>
  4797. <span id="time-duration-syntax"></span><a name="Time-duration"></a>
  4798. <h3 class="section">7.3 Time duration<span class="pull-right"><a class="anchor hidden-xs" href="#Time-duration" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Time-duration" aria-hidden="true">TOC</a></span></h3>
  4799. <p>There are two accepted syntaxes for expressing time duration.
  4800. </p>
  4801. <div class="example">
  4802. <pre class="example">[-][<var>HH</var>:]<var>MM</var>:<var>SS</var>[.<var>m</var>...]
  4803. </pre></div>
  4804. <p><var>HH</var> expresses the number of hours, <var>MM</var> the number of minutes
  4805. for a maximum of 2 digits, and <var>SS</var> the number of seconds for a
  4806. maximum of 2 digits. The <var>m</var> at the end expresses decimal value for
  4807. <var>SS</var>.
  4808. </p>
  4809. <p><em>or</em>
  4810. </p>
  4811. <div class="example">
  4812. <pre class="example">[-]<var>S</var>+[.<var>m</var>...][s|ms|us]
  4813. </pre></div>
  4814. <p><var>S</var> expresses the number of seconds, with the optional decimal part
  4815. <var>m</var>. The optional literal suffixes &lsquo;<samp>s</samp>&rsquo;, &lsquo;<samp>ms</samp>&rsquo; or &lsquo;<samp>us</samp>&rsquo;
  4816. indicate to interpret the value as seconds, milliseconds or microseconds,
  4817. respectively.
  4818. </p>
  4819. <p>In both expressions, the optional &lsquo;<samp>-</samp>&rsquo; indicates negative duration.
  4820. </p>
  4821. <a name="Examples-3"></a>
  4822. <h4 class="subsection">7.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-3" aria-hidden="true">TOC</a></span></h4>
  4823. <p>The following examples are all valid time duration:
  4824. </p>
  4825. <dl compact="compact">
  4826. <dt>&lsquo;<samp>55</samp>&rsquo;</dt>
  4827. <dd><p>55 seconds
  4828. </p>
  4829. </dd>
  4830. <dt>&lsquo;<samp>0.2</samp>&rsquo;</dt>
  4831. <dd><p>0.2 seconds
  4832. </p>
  4833. </dd>
  4834. <dt>&lsquo;<samp>200ms</samp>&rsquo;</dt>
  4835. <dd><p>200 milliseconds, that&rsquo;s 0.2s
  4836. </p>
  4837. </dd>
  4838. <dt>&lsquo;<samp>200000us</samp>&rsquo;</dt>
  4839. <dd><p>200000 microseconds, that&rsquo;s 0.2s
  4840. </p>
  4841. </dd>
  4842. <dt>&lsquo;<samp>12:03:45</samp>&rsquo;</dt>
  4843. <dd><p>12 hours, 03 minutes and 45 seconds
  4844. </p>
  4845. </dd>
  4846. <dt>&lsquo;<samp>23.189</samp>&rsquo;</dt>
  4847. <dd><p>23.189 seconds
  4848. </p></dd>
  4849. </dl>
  4850. <span id="video-size-syntax"></span><a name="Video-size"></a>
  4851. <h3 class="section">7.4 Video size<span class="pull-right"><a class="anchor hidden-xs" href="#Video-size" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-size" aria-hidden="true">TOC</a></span></h3>
  4852. <p>Specify the size of the sourced video, it may be a string of the form
  4853. <var>width</var>x<var>height</var>, or the name of a size abbreviation.
  4854. </p>
  4855. <p>The following abbreviations are recognized:
  4856. </p><dl compact="compact">
  4857. <dt>&lsquo;<samp>ntsc</samp>&rsquo;</dt>
  4858. <dd><p>720x480
  4859. </p></dd>
  4860. <dt>&lsquo;<samp>pal</samp>&rsquo;</dt>
  4861. <dd><p>720x576
  4862. </p></dd>
  4863. <dt>&lsquo;<samp>qntsc</samp>&rsquo;</dt>
  4864. <dd><p>352x240
  4865. </p></dd>
  4866. <dt>&lsquo;<samp>qpal</samp>&rsquo;</dt>
  4867. <dd><p>352x288
  4868. </p></dd>
  4869. <dt>&lsquo;<samp>sntsc</samp>&rsquo;</dt>
  4870. <dd><p>640x480
  4871. </p></dd>
  4872. <dt>&lsquo;<samp>spal</samp>&rsquo;</dt>
  4873. <dd><p>768x576
  4874. </p></dd>
  4875. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  4876. <dd><p>352x240
  4877. </p></dd>
  4878. <dt>&lsquo;<samp>ntsc-film</samp>&rsquo;</dt>
  4879. <dd><p>352x240
  4880. </p></dd>
  4881. <dt>&lsquo;<samp>sqcif</samp>&rsquo;</dt>
  4882. <dd><p>128x96
  4883. </p></dd>
  4884. <dt>&lsquo;<samp>qcif</samp>&rsquo;</dt>
  4885. <dd><p>176x144
  4886. </p></dd>
  4887. <dt>&lsquo;<samp>cif</samp>&rsquo;</dt>
  4888. <dd><p>352x288
  4889. </p></dd>
  4890. <dt>&lsquo;<samp>4cif</samp>&rsquo;</dt>
  4891. <dd><p>704x576
  4892. </p></dd>
  4893. <dt>&lsquo;<samp>16cif</samp>&rsquo;</dt>
  4894. <dd><p>1408x1152
  4895. </p></dd>
  4896. <dt>&lsquo;<samp>qqvga</samp>&rsquo;</dt>
  4897. <dd><p>160x120
  4898. </p></dd>
  4899. <dt>&lsquo;<samp>qvga</samp>&rsquo;</dt>
  4900. <dd><p>320x240
  4901. </p></dd>
  4902. <dt>&lsquo;<samp>vga</samp>&rsquo;</dt>
  4903. <dd><p>640x480
  4904. </p></dd>
  4905. <dt>&lsquo;<samp>svga</samp>&rsquo;</dt>
  4906. <dd><p>800x600
  4907. </p></dd>
  4908. <dt>&lsquo;<samp>xga</samp>&rsquo;</dt>
  4909. <dd><p>1024x768
  4910. </p></dd>
  4911. <dt>&lsquo;<samp>uxga</samp>&rsquo;</dt>
  4912. <dd><p>1600x1200
  4913. </p></dd>
  4914. <dt>&lsquo;<samp>qxga</samp>&rsquo;</dt>
  4915. <dd><p>2048x1536
  4916. </p></dd>
  4917. <dt>&lsquo;<samp>sxga</samp>&rsquo;</dt>
  4918. <dd><p>1280x1024
  4919. </p></dd>
  4920. <dt>&lsquo;<samp>qsxga</samp>&rsquo;</dt>
  4921. <dd><p>2560x2048
  4922. </p></dd>
  4923. <dt>&lsquo;<samp>hsxga</samp>&rsquo;</dt>
  4924. <dd><p>5120x4096
  4925. </p></dd>
  4926. <dt>&lsquo;<samp>wvga</samp>&rsquo;</dt>
  4927. <dd><p>852x480
  4928. </p></dd>
  4929. <dt>&lsquo;<samp>wxga</samp>&rsquo;</dt>
  4930. <dd><p>1366x768
  4931. </p></dd>
  4932. <dt>&lsquo;<samp>wsxga</samp>&rsquo;</dt>
  4933. <dd><p>1600x1024
  4934. </p></dd>
  4935. <dt>&lsquo;<samp>wuxga</samp>&rsquo;</dt>
  4936. <dd><p>1920x1200
  4937. </p></dd>
  4938. <dt>&lsquo;<samp>woxga</samp>&rsquo;</dt>
  4939. <dd><p>2560x1600
  4940. </p></dd>
  4941. <dt>&lsquo;<samp>wqsxga</samp>&rsquo;</dt>
  4942. <dd><p>3200x2048
  4943. </p></dd>
  4944. <dt>&lsquo;<samp>wquxga</samp>&rsquo;</dt>
  4945. <dd><p>3840x2400
  4946. </p></dd>
  4947. <dt>&lsquo;<samp>whsxga</samp>&rsquo;</dt>
  4948. <dd><p>6400x4096
  4949. </p></dd>
  4950. <dt>&lsquo;<samp>whuxga</samp>&rsquo;</dt>
  4951. <dd><p>7680x4800
  4952. </p></dd>
  4953. <dt>&lsquo;<samp>cga</samp>&rsquo;</dt>
  4954. <dd><p>320x200
  4955. </p></dd>
  4956. <dt>&lsquo;<samp>ega</samp>&rsquo;</dt>
  4957. <dd><p>640x350
  4958. </p></dd>
  4959. <dt>&lsquo;<samp>hd480</samp>&rsquo;</dt>
  4960. <dd><p>852x480
  4961. </p></dd>
  4962. <dt>&lsquo;<samp>hd720</samp>&rsquo;</dt>
  4963. <dd><p>1280x720
  4964. </p></dd>
  4965. <dt>&lsquo;<samp>hd1080</samp>&rsquo;</dt>
  4966. <dd><p>1920x1080
  4967. </p></dd>
  4968. <dt>&lsquo;<samp>2k</samp>&rsquo;</dt>
  4969. <dd><p>2048x1080
  4970. </p></dd>
  4971. <dt>&lsquo;<samp>2kflat</samp>&rsquo;</dt>
  4972. <dd><p>1998x1080
  4973. </p></dd>
  4974. <dt>&lsquo;<samp>2kscope</samp>&rsquo;</dt>
  4975. <dd><p>2048x858
  4976. </p></dd>
  4977. <dt>&lsquo;<samp>4k</samp>&rsquo;</dt>
  4978. <dd><p>4096x2160
  4979. </p></dd>
  4980. <dt>&lsquo;<samp>4kflat</samp>&rsquo;</dt>
  4981. <dd><p>3996x2160
  4982. </p></dd>
  4983. <dt>&lsquo;<samp>4kscope</samp>&rsquo;</dt>
  4984. <dd><p>4096x1716
  4985. </p></dd>
  4986. <dt>&lsquo;<samp>nhd</samp>&rsquo;</dt>
  4987. <dd><p>640x360
  4988. </p></dd>
  4989. <dt>&lsquo;<samp>hqvga</samp>&rsquo;</dt>
  4990. <dd><p>240x160
  4991. </p></dd>
  4992. <dt>&lsquo;<samp>wqvga</samp>&rsquo;</dt>
  4993. <dd><p>400x240
  4994. </p></dd>
  4995. <dt>&lsquo;<samp>fwqvga</samp>&rsquo;</dt>
  4996. <dd><p>432x240
  4997. </p></dd>
  4998. <dt>&lsquo;<samp>hvga</samp>&rsquo;</dt>
  4999. <dd><p>480x320
  5000. </p></dd>
  5001. <dt>&lsquo;<samp>qhd</samp>&rsquo;</dt>
  5002. <dd><p>960x540
  5003. </p></dd>
  5004. <dt>&lsquo;<samp>2kdci</samp>&rsquo;</dt>
  5005. <dd><p>2048x1080
  5006. </p></dd>
  5007. <dt>&lsquo;<samp>4kdci</samp>&rsquo;</dt>
  5008. <dd><p>4096x2160
  5009. </p></dd>
  5010. <dt>&lsquo;<samp>uhd2160</samp>&rsquo;</dt>
  5011. <dd><p>3840x2160
  5012. </p></dd>
  5013. <dt>&lsquo;<samp>uhd4320</samp>&rsquo;</dt>
  5014. <dd><p>7680x4320
  5015. </p></dd>
  5016. </dl>
  5017. <span id="video-rate-syntax"></span><a name="Video-rate"></a>
  5018. <h3 class="section">7.5 Video rate<span class="pull-right"><a class="anchor hidden-xs" href="#Video-rate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-rate" aria-hidden="true">TOC</a></span></h3>
  5019. <p>Specify the frame rate of a video, expressed as the number of frames
  5020. generated per second. It has to be a string in the format
  5021. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
  5022. number or a valid video frame rate abbreviation.
  5023. </p>
  5024. <p>The following abbreviations are recognized:
  5025. </p><dl compact="compact">
  5026. <dt>&lsquo;<samp>ntsc</samp>&rsquo;</dt>
  5027. <dd><p>30000/1001
  5028. </p></dd>
  5029. <dt>&lsquo;<samp>pal</samp>&rsquo;</dt>
  5030. <dd><p>25/1
  5031. </p></dd>
  5032. <dt>&lsquo;<samp>qntsc</samp>&rsquo;</dt>
  5033. <dd><p>30000/1001
  5034. </p></dd>
  5035. <dt>&lsquo;<samp>qpal</samp>&rsquo;</dt>
  5036. <dd><p>25/1
  5037. </p></dd>
  5038. <dt>&lsquo;<samp>sntsc</samp>&rsquo;</dt>
  5039. <dd><p>30000/1001
  5040. </p></dd>
  5041. <dt>&lsquo;<samp>spal</samp>&rsquo;</dt>
  5042. <dd><p>25/1
  5043. </p></dd>
  5044. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  5045. <dd><p>24/1
  5046. </p></dd>
  5047. <dt>&lsquo;<samp>ntsc-film</samp>&rsquo;</dt>
  5048. <dd><p>24000/1001
  5049. </p></dd>
  5050. </dl>
  5051. <span id="ratio-syntax"></span><a name="Ratio"></a>
  5052. <h3 class="section">7.6 Ratio<span class="pull-right"><a class="anchor hidden-xs" href="#Ratio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Ratio" aria-hidden="true">TOC</a></span></h3>
  5053. <p>A ratio can be expressed as an expression, or in the form
  5054. <var>numerator</var>:<var>denominator</var>.
  5055. </p>
  5056. <p>Note that a ratio with infinite (1/0) or negative value is
  5057. considered valid, so you should check on the returned value if you
  5058. want to exclude those values.
  5059. </p>
  5060. <p>The undefined value can be expressed using the &quot;0:0&quot; string.
  5061. </p>
  5062. <span id="color-syntax"></span><a name="Color"></a>
  5063. <h3 class="section">7.7 Color<span class="pull-right"><a class="anchor hidden-xs" href="#Color" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Color" aria-hidden="true">TOC</a></span></h3>
  5064. <p>It can be the name of a color as defined below (case insensitive match) or a
  5065. <code>[0x|#]RRGGBB[AA]</code> sequence, possibly followed by @ and a string
  5066. representing the alpha component.
  5067. </p>
  5068. <p>The alpha component may be a string composed by &quot;0x&quot; followed by an
  5069. hexadecimal number or a decimal number between 0.0 and 1.0, which
  5070. represents the opacity value (&lsquo;<samp>0x00</samp>&rsquo; or &lsquo;<samp>0.0</samp>&rsquo; means completely
  5071. transparent, &lsquo;<samp>0xff</samp>&rsquo; or &lsquo;<samp>1.0</samp>&rsquo; completely opaque). If the alpha
  5072. component is not specified then &lsquo;<samp>0xff</samp>&rsquo; is assumed.
  5073. </p>
  5074. <p>The string &lsquo;<samp>random</samp>&rsquo; will result in a random color.
  5075. </p>
  5076. <p>The following names of colors are recognized:
  5077. </p><dl compact="compact">
  5078. <dt>&lsquo;<samp>AliceBlue</samp>&rsquo;</dt>
  5079. <dd><p>0xF0F8FF
  5080. </p></dd>
  5081. <dt>&lsquo;<samp>AntiqueWhite</samp>&rsquo;</dt>
  5082. <dd><p>0xFAEBD7
  5083. </p></dd>
  5084. <dt>&lsquo;<samp>Aqua</samp>&rsquo;</dt>
  5085. <dd><p>0x00FFFF
  5086. </p></dd>
  5087. <dt>&lsquo;<samp>Aquamarine</samp>&rsquo;</dt>
  5088. <dd><p>0x7FFFD4
  5089. </p></dd>
  5090. <dt>&lsquo;<samp>Azure</samp>&rsquo;</dt>
  5091. <dd><p>0xF0FFFF
  5092. </p></dd>
  5093. <dt>&lsquo;<samp>Beige</samp>&rsquo;</dt>
  5094. <dd><p>0xF5F5DC
  5095. </p></dd>
  5096. <dt>&lsquo;<samp>Bisque</samp>&rsquo;</dt>
  5097. <dd><p>0xFFE4C4
  5098. </p></dd>
  5099. <dt>&lsquo;<samp>Black</samp>&rsquo;</dt>
  5100. <dd><p>0x000000
  5101. </p></dd>
  5102. <dt>&lsquo;<samp>BlanchedAlmond</samp>&rsquo;</dt>
  5103. <dd><p>0xFFEBCD
  5104. </p></dd>
  5105. <dt>&lsquo;<samp>Blue</samp>&rsquo;</dt>
  5106. <dd><p>0x0000FF
  5107. </p></dd>
  5108. <dt>&lsquo;<samp>BlueViolet</samp>&rsquo;</dt>
  5109. <dd><p>0x8A2BE2
  5110. </p></dd>
  5111. <dt>&lsquo;<samp>Brown</samp>&rsquo;</dt>
  5112. <dd><p>0xA52A2A
  5113. </p></dd>
  5114. <dt>&lsquo;<samp>BurlyWood</samp>&rsquo;</dt>
  5115. <dd><p>0xDEB887
  5116. </p></dd>
  5117. <dt>&lsquo;<samp>CadetBlue</samp>&rsquo;</dt>
  5118. <dd><p>0x5F9EA0
  5119. </p></dd>
  5120. <dt>&lsquo;<samp>Chartreuse</samp>&rsquo;</dt>
  5121. <dd><p>0x7FFF00
  5122. </p></dd>
  5123. <dt>&lsquo;<samp>Chocolate</samp>&rsquo;</dt>
  5124. <dd><p>0xD2691E
  5125. </p></dd>
  5126. <dt>&lsquo;<samp>Coral</samp>&rsquo;</dt>
  5127. <dd><p>0xFF7F50
  5128. </p></dd>
  5129. <dt>&lsquo;<samp>CornflowerBlue</samp>&rsquo;</dt>
  5130. <dd><p>0x6495ED
  5131. </p></dd>
  5132. <dt>&lsquo;<samp>Cornsilk</samp>&rsquo;</dt>
  5133. <dd><p>0xFFF8DC
  5134. </p></dd>
  5135. <dt>&lsquo;<samp>Crimson</samp>&rsquo;</dt>
  5136. <dd><p>0xDC143C
  5137. </p></dd>
  5138. <dt>&lsquo;<samp>Cyan</samp>&rsquo;</dt>
  5139. <dd><p>0x00FFFF
  5140. </p></dd>
  5141. <dt>&lsquo;<samp>DarkBlue</samp>&rsquo;</dt>
  5142. <dd><p>0x00008B
  5143. </p></dd>
  5144. <dt>&lsquo;<samp>DarkCyan</samp>&rsquo;</dt>
  5145. <dd><p>0x008B8B
  5146. </p></dd>
  5147. <dt>&lsquo;<samp>DarkGoldenRod</samp>&rsquo;</dt>
  5148. <dd><p>0xB8860B
  5149. </p></dd>
  5150. <dt>&lsquo;<samp>DarkGray</samp>&rsquo;</dt>
  5151. <dd><p>0xA9A9A9
  5152. </p></dd>
  5153. <dt>&lsquo;<samp>DarkGreen</samp>&rsquo;</dt>
  5154. <dd><p>0x006400
  5155. </p></dd>
  5156. <dt>&lsquo;<samp>DarkKhaki</samp>&rsquo;</dt>
  5157. <dd><p>0xBDB76B
  5158. </p></dd>
  5159. <dt>&lsquo;<samp>DarkMagenta</samp>&rsquo;</dt>
  5160. <dd><p>0x8B008B
  5161. </p></dd>
  5162. <dt>&lsquo;<samp>DarkOliveGreen</samp>&rsquo;</dt>
  5163. <dd><p>0x556B2F
  5164. </p></dd>
  5165. <dt>&lsquo;<samp>Darkorange</samp>&rsquo;</dt>
  5166. <dd><p>0xFF8C00
  5167. </p></dd>
  5168. <dt>&lsquo;<samp>DarkOrchid</samp>&rsquo;</dt>
  5169. <dd><p>0x9932CC
  5170. </p></dd>
  5171. <dt>&lsquo;<samp>DarkRed</samp>&rsquo;</dt>
  5172. <dd><p>0x8B0000
  5173. </p></dd>
  5174. <dt>&lsquo;<samp>DarkSalmon</samp>&rsquo;</dt>
  5175. <dd><p>0xE9967A
  5176. </p></dd>
  5177. <dt>&lsquo;<samp>DarkSeaGreen</samp>&rsquo;</dt>
  5178. <dd><p>0x8FBC8F
  5179. </p></dd>
  5180. <dt>&lsquo;<samp>DarkSlateBlue</samp>&rsquo;</dt>
  5181. <dd><p>0x483D8B
  5182. </p></dd>
  5183. <dt>&lsquo;<samp>DarkSlateGray</samp>&rsquo;</dt>
  5184. <dd><p>0x2F4F4F
  5185. </p></dd>
  5186. <dt>&lsquo;<samp>DarkTurquoise</samp>&rsquo;</dt>
  5187. <dd><p>0x00CED1
  5188. </p></dd>
  5189. <dt>&lsquo;<samp>DarkViolet</samp>&rsquo;</dt>
  5190. <dd><p>0x9400D3
  5191. </p></dd>
  5192. <dt>&lsquo;<samp>DeepPink</samp>&rsquo;</dt>
  5193. <dd><p>0xFF1493
  5194. </p></dd>
  5195. <dt>&lsquo;<samp>DeepSkyBlue</samp>&rsquo;</dt>
  5196. <dd><p>0x00BFFF
  5197. </p></dd>
  5198. <dt>&lsquo;<samp>DimGray</samp>&rsquo;</dt>
  5199. <dd><p>0x696969
  5200. </p></dd>
  5201. <dt>&lsquo;<samp>DodgerBlue</samp>&rsquo;</dt>
  5202. <dd><p>0x1E90FF
  5203. </p></dd>
  5204. <dt>&lsquo;<samp>FireBrick</samp>&rsquo;</dt>
  5205. <dd><p>0xB22222
  5206. </p></dd>
  5207. <dt>&lsquo;<samp>FloralWhite</samp>&rsquo;</dt>
  5208. <dd><p>0xFFFAF0
  5209. </p></dd>
  5210. <dt>&lsquo;<samp>ForestGreen</samp>&rsquo;</dt>
  5211. <dd><p>0x228B22
  5212. </p></dd>
  5213. <dt>&lsquo;<samp>Fuchsia</samp>&rsquo;</dt>
  5214. <dd><p>0xFF00FF
  5215. </p></dd>
  5216. <dt>&lsquo;<samp>Gainsboro</samp>&rsquo;</dt>
  5217. <dd><p>0xDCDCDC
  5218. </p></dd>
  5219. <dt>&lsquo;<samp>GhostWhite</samp>&rsquo;</dt>
  5220. <dd><p>0xF8F8FF
  5221. </p></dd>
  5222. <dt>&lsquo;<samp>Gold</samp>&rsquo;</dt>
  5223. <dd><p>0xFFD700
  5224. </p></dd>
  5225. <dt>&lsquo;<samp>GoldenRod</samp>&rsquo;</dt>
  5226. <dd><p>0xDAA520
  5227. </p></dd>
  5228. <dt>&lsquo;<samp>Gray</samp>&rsquo;</dt>
  5229. <dd><p>0x808080
  5230. </p></dd>
  5231. <dt>&lsquo;<samp>Green</samp>&rsquo;</dt>
  5232. <dd><p>0x008000
  5233. </p></dd>
  5234. <dt>&lsquo;<samp>GreenYellow</samp>&rsquo;</dt>
  5235. <dd><p>0xADFF2F
  5236. </p></dd>
  5237. <dt>&lsquo;<samp>HoneyDew</samp>&rsquo;</dt>
  5238. <dd><p>0xF0FFF0
  5239. </p></dd>
  5240. <dt>&lsquo;<samp>HotPink</samp>&rsquo;</dt>
  5241. <dd><p>0xFF69B4
  5242. </p></dd>
  5243. <dt>&lsquo;<samp>IndianRed</samp>&rsquo;</dt>
  5244. <dd><p>0xCD5C5C
  5245. </p></dd>
  5246. <dt>&lsquo;<samp>Indigo</samp>&rsquo;</dt>
  5247. <dd><p>0x4B0082
  5248. </p></dd>
  5249. <dt>&lsquo;<samp>Ivory</samp>&rsquo;</dt>
  5250. <dd><p>0xFFFFF0
  5251. </p></dd>
  5252. <dt>&lsquo;<samp>Khaki</samp>&rsquo;</dt>
  5253. <dd><p>0xF0E68C
  5254. </p></dd>
  5255. <dt>&lsquo;<samp>Lavender</samp>&rsquo;</dt>
  5256. <dd><p>0xE6E6FA
  5257. </p></dd>
  5258. <dt>&lsquo;<samp>LavenderBlush</samp>&rsquo;</dt>
  5259. <dd><p>0xFFF0F5
  5260. </p></dd>
  5261. <dt>&lsquo;<samp>LawnGreen</samp>&rsquo;</dt>
  5262. <dd><p>0x7CFC00
  5263. </p></dd>
  5264. <dt>&lsquo;<samp>LemonChiffon</samp>&rsquo;</dt>
  5265. <dd><p>0xFFFACD
  5266. </p></dd>
  5267. <dt>&lsquo;<samp>LightBlue</samp>&rsquo;</dt>
  5268. <dd><p>0xADD8E6
  5269. </p></dd>
  5270. <dt>&lsquo;<samp>LightCoral</samp>&rsquo;</dt>
  5271. <dd><p>0xF08080
  5272. </p></dd>
  5273. <dt>&lsquo;<samp>LightCyan</samp>&rsquo;</dt>
  5274. <dd><p>0xE0FFFF
  5275. </p></dd>
  5276. <dt>&lsquo;<samp>LightGoldenRodYellow</samp>&rsquo;</dt>
  5277. <dd><p>0xFAFAD2
  5278. </p></dd>
  5279. <dt>&lsquo;<samp>LightGreen</samp>&rsquo;</dt>
  5280. <dd><p>0x90EE90
  5281. </p></dd>
  5282. <dt>&lsquo;<samp>LightGrey</samp>&rsquo;</dt>
  5283. <dd><p>0xD3D3D3
  5284. </p></dd>
  5285. <dt>&lsquo;<samp>LightPink</samp>&rsquo;</dt>
  5286. <dd><p>0xFFB6C1
  5287. </p></dd>
  5288. <dt>&lsquo;<samp>LightSalmon</samp>&rsquo;</dt>
  5289. <dd><p>0xFFA07A
  5290. </p></dd>
  5291. <dt>&lsquo;<samp>LightSeaGreen</samp>&rsquo;</dt>
  5292. <dd><p>0x20B2AA
  5293. </p></dd>
  5294. <dt>&lsquo;<samp>LightSkyBlue</samp>&rsquo;</dt>
  5295. <dd><p>0x87CEFA
  5296. </p></dd>
  5297. <dt>&lsquo;<samp>LightSlateGray</samp>&rsquo;</dt>
  5298. <dd><p>0x778899
  5299. </p></dd>
  5300. <dt>&lsquo;<samp>LightSteelBlue</samp>&rsquo;</dt>
  5301. <dd><p>0xB0C4DE
  5302. </p></dd>
  5303. <dt>&lsquo;<samp>LightYellow</samp>&rsquo;</dt>
  5304. <dd><p>0xFFFFE0
  5305. </p></dd>
  5306. <dt>&lsquo;<samp>Lime</samp>&rsquo;</dt>
  5307. <dd><p>0x00FF00
  5308. </p></dd>
  5309. <dt>&lsquo;<samp>LimeGreen</samp>&rsquo;</dt>
  5310. <dd><p>0x32CD32
  5311. </p></dd>
  5312. <dt>&lsquo;<samp>Linen</samp>&rsquo;</dt>
  5313. <dd><p>0xFAF0E6
  5314. </p></dd>
  5315. <dt>&lsquo;<samp>Magenta</samp>&rsquo;</dt>
  5316. <dd><p>0xFF00FF
  5317. </p></dd>
  5318. <dt>&lsquo;<samp>Maroon</samp>&rsquo;</dt>
  5319. <dd><p>0x800000
  5320. </p></dd>
  5321. <dt>&lsquo;<samp>MediumAquaMarine</samp>&rsquo;</dt>
  5322. <dd><p>0x66CDAA
  5323. </p></dd>
  5324. <dt>&lsquo;<samp>MediumBlue</samp>&rsquo;</dt>
  5325. <dd><p>0x0000CD
  5326. </p></dd>
  5327. <dt>&lsquo;<samp>MediumOrchid</samp>&rsquo;</dt>
  5328. <dd><p>0xBA55D3
  5329. </p></dd>
  5330. <dt>&lsquo;<samp>MediumPurple</samp>&rsquo;</dt>
  5331. <dd><p>0x9370D8
  5332. </p></dd>
  5333. <dt>&lsquo;<samp>MediumSeaGreen</samp>&rsquo;</dt>
  5334. <dd><p>0x3CB371
  5335. </p></dd>
  5336. <dt>&lsquo;<samp>MediumSlateBlue</samp>&rsquo;</dt>
  5337. <dd><p>0x7B68EE
  5338. </p></dd>
  5339. <dt>&lsquo;<samp>MediumSpringGreen</samp>&rsquo;</dt>
  5340. <dd><p>0x00FA9A
  5341. </p></dd>
  5342. <dt>&lsquo;<samp>MediumTurquoise</samp>&rsquo;</dt>
  5343. <dd><p>0x48D1CC
  5344. </p></dd>
  5345. <dt>&lsquo;<samp>MediumVioletRed</samp>&rsquo;</dt>
  5346. <dd><p>0xC71585
  5347. </p></dd>
  5348. <dt>&lsquo;<samp>MidnightBlue</samp>&rsquo;</dt>
  5349. <dd><p>0x191970
  5350. </p></dd>
  5351. <dt>&lsquo;<samp>MintCream</samp>&rsquo;</dt>
  5352. <dd><p>0xF5FFFA
  5353. </p></dd>
  5354. <dt>&lsquo;<samp>MistyRose</samp>&rsquo;</dt>
  5355. <dd><p>0xFFE4E1
  5356. </p></dd>
  5357. <dt>&lsquo;<samp>Moccasin</samp>&rsquo;</dt>
  5358. <dd><p>0xFFE4B5
  5359. </p></dd>
  5360. <dt>&lsquo;<samp>NavajoWhite</samp>&rsquo;</dt>
  5361. <dd><p>0xFFDEAD
  5362. </p></dd>
  5363. <dt>&lsquo;<samp>Navy</samp>&rsquo;</dt>
  5364. <dd><p>0x000080
  5365. </p></dd>
  5366. <dt>&lsquo;<samp>OldLace</samp>&rsquo;</dt>
  5367. <dd><p>0xFDF5E6
  5368. </p></dd>
  5369. <dt>&lsquo;<samp>Olive</samp>&rsquo;</dt>
  5370. <dd><p>0x808000
  5371. </p></dd>
  5372. <dt>&lsquo;<samp>OliveDrab</samp>&rsquo;</dt>
  5373. <dd><p>0x6B8E23
  5374. </p></dd>
  5375. <dt>&lsquo;<samp>Orange</samp>&rsquo;</dt>
  5376. <dd><p>0xFFA500
  5377. </p></dd>
  5378. <dt>&lsquo;<samp>OrangeRed</samp>&rsquo;</dt>
  5379. <dd><p>0xFF4500
  5380. </p></dd>
  5381. <dt>&lsquo;<samp>Orchid</samp>&rsquo;</dt>
  5382. <dd><p>0xDA70D6
  5383. </p></dd>
  5384. <dt>&lsquo;<samp>PaleGoldenRod</samp>&rsquo;</dt>
  5385. <dd><p>0xEEE8AA
  5386. </p></dd>
  5387. <dt>&lsquo;<samp>PaleGreen</samp>&rsquo;</dt>
  5388. <dd><p>0x98FB98
  5389. </p></dd>
  5390. <dt>&lsquo;<samp>PaleTurquoise</samp>&rsquo;</dt>
  5391. <dd><p>0xAFEEEE
  5392. </p></dd>
  5393. <dt>&lsquo;<samp>PaleVioletRed</samp>&rsquo;</dt>
  5394. <dd><p>0xD87093
  5395. </p></dd>
  5396. <dt>&lsquo;<samp>PapayaWhip</samp>&rsquo;</dt>
  5397. <dd><p>0xFFEFD5
  5398. </p></dd>
  5399. <dt>&lsquo;<samp>PeachPuff</samp>&rsquo;</dt>
  5400. <dd><p>0xFFDAB9
  5401. </p></dd>
  5402. <dt>&lsquo;<samp>Peru</samp>&rsquo;</dt>
  5403. <dd><p>0xCD853F
  5404. </p></dd>
  5405. <dt>&lsquo;<samp>Pink</samp>&rsquo;</dt>
  5406. <dd><p>0xFFC0CB
  5407. </p></dd>
  5408. <dt>&lsquo;<samp>Plum</samp>&rsquo;</dt>
  5409. <dd><p>0xDDA0DD
  5410. </p></dd>
  5411. <dt>&lsquo;<samp>PowderBlue</samp>&rsquo;</dt>
  5412. <dd><p>0xB0E0E6
  5413. </p></dd>
  5414. <dt>&lsquo;<samp>Purple</samp>&rsquo;</dt>
  5415. <dd><p>0x800080
  5416. </p></dd>
  5417. <dt>&lsquo;<samp>Red</samp>&rsquo;</dt>
  5418. <dd><p>0xFF0000
  5419. </p></dd>
  5420. <dt>&lsquo;<samp>RosyBrown</samp>&rsquo;</dt>
  5421. <dd><p>0xBC8F8F
  5422. </p></dd>
  5423. <dt>&lsquo;<samp>RoyalBlue</samp>&rsquo;</dt>
  5424. <dd><p>0x4169E1
  5425. </p></dd>
  5426. <dt>&lsquo;<samp>SaddleBrown</samp>&rsquo;</dt>
  5427. <dd><p>0x8B4513
  5428. </p></dd>
  5429. <dt>&lsquo;<samp>Salmon</samp>&rsquo;</dt>
  5430. <dd><p>0xFA8072
  5431. </p></dd>
  5432. <dt>&lsquo;<samp>SandyBrown</samp>&rsquo;</dt>
  5433. <dd><p>0xF4A460
  5434. </p></dd>
  5435. <dt>&lsquo;<samp>SeaGreen</samp>&rsquo;</dt>
  5436. <dd><p>0x2E8B57
  5437. </p></dd>
  5438. <dt>&lsquo;<samp>SeaShell</samp>&rsquo;</dt>
  5439. <dd><p>0xFFF5EE
  5440. </p></dd>
  5441. <dt>&lsquo;<samp>Sienna</samp>&rsquo;</dt>
  5442. <dd><p>0xA0522D
  5443. </p></dd>
  5444. <dt>&lsquo;<samp>Silver</samp>&rsquo;</dt>
  5445. <dd><p>0xC0C0C0
  5446. </p></dd>
  5447. <dt>&lsquo;<samp>SkyBlue</samp>&rsquo;</dt>
  5448. <dd><p>0x87CEEB
  5449. </p></dd>
  5450. <dt>&lsquo;<samp>SlateBlue</samp>&rsquo;</dt>
  5451. <dd><p>0x6A5ACD
  5452. </p></dd>
  5453. <dt>&lsquo;<samp>SlateGray</samp>&rsquo;</dt>
  5454. <dd><p>0x708090
  5455. </p></dd>
  5456. <dt>&lsquo;<samp>Snow</samp>&rsquo;</dt>
  5457. <dd><p>0xFFFAFA
  5458. </p></dd>
  5459. <dt>&lsquo;<samp>SpringGreen</samp>&rsquo;</dt>
  5460. <dd><p>0x00FF7F
  5461. </p></dd>
  5462. <dt>&lsquo;<samp>SteelBlue</samp>&rsquo;</dt>
  5463. <dd><p>0x4682B4
  5464. </p></dd>
  5465. <dt>&lsquo;<samp>Tan</samp>&rsquo;</dt>
  5466. <dd><p>0xD2B48C
  5467. </p></dd>
  5468. <dt>&lsquo;<samp>Teal</samp>&rsquo;</dt>
  5469. <dd><p>0x008080
  5470. </p></dd>
  5471. <dt>&lsquo;<samp>Thistle</samp>&rsquo;</dt>
  5472. <dd><p>0xD8BFD8
  5473. </p></dd>
  5474. <dt>&lsquo;<samp>Tomato</samp>&rsquo;</dt>
  5475. <dd><p>0xFF6347
  5476. </p></dd>
  5477. <dt>&lsquo;<samp>Turquoise</samp>&rsquo;</dt>
  5478. <dd><p>0x40E0D0
  5479. </p></dd>
  5480. <dt>&lsquo;<samp>Violet</samp>&rsquo;</dt>
  5481. <dd><p>0xEE82EE
  5482. </p></dd>
  5483. <dt>&lsquo;<samp>Wheat</samp>&rsquo;</dt>
  5484. <dd><p>0xF5DEB3
  5485. </p></dd>
  5486. <dt>&lsquo;<samp>White</samp>&rsquo;</dt>
  5487. <dd><p>0xFFFFFF
  5488. </p></dd>
  5489. <dt>&lsquo;<samp>WhiteSmoke</samp>&rsquo;</dt>
  5490. <dd><p>0xF5F5F5
  5491. </p></dd>
  5492. <dt>&lsquo;<samp>Yellow</samp>&rsquo;</dt>
  5493. <dd><p>0xFFFF00
  5494. </p></dd>
  5495. <dt>&lsquo;<samp>YellowGreen</samp>&rsquo;</dt>
  5496. <dd><p>0x9ACD32
  5497. </p></dd>
  5498. </dl>
  5499. <span id="channel-layout-syntax"></span><a name="Channel-Layout"></a>
  5500. <h3 class="section">7.8 Channel Layout<span class="pull-right"><a class="anchor hidden-xs" href="#Channel-Layout" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Channel-Layout" aria-hidden="true">TOC</a></span></h3>
  5501. <p>A channel layout specifies the spatial disposition of the channels in
  5502. a multi-channel audio stream. To specify a channel layout, FFmpeg
  5503. makes use of a special syntax.
  5504. </p>
  5505. <p>Individual channels are identified by an id, as given by the table
  5506. below:
  5507. </p><dl compact="compact">
  5508. <dt>&lsquo;<samp>FL</samp>&rsquo;</dt>
  5509. <dd><p>front left
  5510. </p></dd>
  5511. <dt>&lsquo;<samp>FR</samp>&rsquo;</dt>
  5512. <dd><p>front right
  5513. </p></dd>
  5514. <dt>&lsquo;<samp>FC</samp>&rsquo;</dt>
  5515. <dd><p>front center
  5516. </p></dd>
  5517. <dt>&lsquo;<samp>LFE</samp>&rsquo;</dt>
  5518. <dd><p>low frequency
  5519. </p></dd>
  5520. <dt>&lsquo;<samp>BL</samp>&rsquo;</dt>
  5521. <dd><p>back left
  5522. </p></dd>
  5523. <dt>&lsquo;<samp>BR</samp>&rsquo;</dt>
  5524. <dd><p>back right
  5525. </p></dd>
  5526. <dt>&lsquo;<samp>FLC</samp>&rsquo;</dt>
  5527. <dd><p>front left-of-center
  5528. </p></dd>
  5529. <dt>&lsquo;<samp>FRC</samp>&rsquo;</dt>
  5530. <dd><p>front right-of-center
  5531. </p></dd>
  5532. <dt>&lsquo;<samp>BC</samp>&rsquo;</dt>
  5533. <dd><p>back center
  5534. </p></dd>
  5535. <dt>&lsquo;<samp>SL</samp>&rsquo;</dt>
  5536. <dd><p>side left
  5537. </p></dd>
  5538. <dt>&lsquo;<samp>SR</samp>&rsquo;</dt>
  5539. <dd><p>side right
  5540. </p></dd>
  5541. <dt>&lsquo;<samp>TC</samp>&rsquo;</dt>
  5542. <dd><p>top center
  5543. </p></dd>
  5544. <dt>&lsquo;<samp>TFL</samp>&rsquo;</dt>
  5545. <dd><p>top front left
  5546. </p></dd>
  5547. <dt>&lsquo;<samp>TFC</samp>&rsquo;</dt>
  5548. <dd><p>top front center
  5549. </p></dd>
  5550. <dt>&lsquo;<samp>TFR</samp>&rsquo;</dt>
  5551. <dd><p>top front right
  5552. </p></dd>
  5553. <dt>&lsquo;<samp>TBL</samp>&rsquo;</dt>
  5554. <dd><p>top back left
  5555. </p></dd>
  5556. <dt>&lsquo;<samp>TBC</samp>&rsquo;</dt>
  5557. <dd><p>top back center
  5558. </p></dd>
  5559. <dt>&lsquo;<samp>TBR</samp>&rsquo;</dt>
  5560. <dd><p>top back right
  5561. </p></dd>
  5562. <dt>&lsquo;<samp>DL</samp>&rsquo;</dt>
  5563. <dd><p>downmix left
  5564. </p></dd>
  5565. <dt>&lsquo;<samp>DR</samp>&rsquo;</dt>
  5566. <dd><p>downmix right
  5567. </p></dd>
  5568. <dt>&lsquo;<samp>WL</samp>&rsquo;</dt>
  5569. <dd><p>wide left
  5570. </p></dd>
  5571. <dt>&lsquo;<samp>WR</samp>&rsquo;</dt>
  5572. <dd><p>wide right
  5573. </p></dd>
  5574. <dt>&lsquo;<samp>SDL</samp>&rsquo;</dt>
  5575. <dd><p>surround direct left
  5576. </p></dd>
  5577. <dt>&lsquo;<samp>SDR</samp>&rsquo;</dt>
  5578. <dd><p>surround direct right
  5579. </p></dd>
  5580. <dt>&lsquo;<samp>LFE2</samp>&rsquo;</dt>
  5581. <dd><p>low frequency 2
  5582. </p></dd>
  5583. </dl>
  5584. <p>Standard channel layout compositions can be specified by using the
  5585. following identifiers:
  5586. </p><dl compact="compact">
  5587. <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
  5588. <dd><p>FC
  5589. </p></dd>
  5590. <dt>&lsquo;<samp>stereo</samp>&rsquo;</dt>
  5591. <dd><p>FL+FR
  5592. </p></dd>
  5593. <dt>&lsquo;<samp>2.1</samp>&rsquo;</dt>
  5594. <dd><p>FL+FR+LFE
  5595. </p></dd>
  5596. <dt>&lsquo;<samp>3.0</samp>&rsquo;</dt>
  5597. <dd><p>FL+FR+FC
  5598. </p></dd>
  5599. <dt>&lsquo;<samp>3.0(back)</samp>&rsquo;</dt>
  5600. <dd><p>FL+FR+BC
  5601. </p></dd>
  5602. <dt>&lsquo;<samp>4.0</samp>&rsquo;</dt>
  5603. <dd><p>FL+FR+FC+BC
  5604. </p></dd>
  5605. <dt>&lsquo;<samp>quad</samp>&rsquo;</dt>
  5606. <dd><p>FL+FR+BL+BR
  5607. </p></dd>
  5608. <dt>&lsquo;<samp>quad(side)</samp>&rsquo;</dt>
  5609. <dd><p>FL+FR+SL+SR
  5610. </p></dd>
  5611. <dt>&lsquo;<samp>3.1</samp>&rsquo;</dt>
  5612. <dd><p>FL+FR+FC+LFE
  5613. </p></dd>
  5614. <dt>&lsquo;<samp>5.0</samp>&rsquo;</dt>
  5615. <dd><p>FL+FR+FC+BL+BR
  5616. </p></dd>
  5617. <dt>&lsquo;<samp>5.0(side)</samp>&rsquo;</dt>
  5618. <dd><p>FL+FR+FC+SL+SR
  5619. </p></dd>
  5620. <dt>&lsquo;<samp>4.1</samp>&rsquo;</dt>
  5621. <dd><p>FL+FR+FC+LFE+BC
  5622. </p></dd>
  5623. <dt>&lsquo;<samp>5.1</samp>&rsquo;</dt>
  5624. <dd><p>FL+FR+FC+LFE+BL+BR
  5625. </p></dd>
  5626. <dt>&lsquo;<samp>5.1(side)</samp>&rsquo;</dt>
  5627. <dd><p>FL+FR+FC+LFE+SL+SR
  5628. </p></dd>
  5629. <dt>&lsquo;<samp>6.0</samp>&rsquo;</dt>
  5630. <dd><p>FL+FR+FC+BC+SL+SR
  5631. </p></dd>
  5632. <dt>&lsquo;<samp>6.0(front)</samp>&rsquo;</dt>
  5633. <dd><p>FL+FR+FLC+FRC+SL+SR
  5634. </p></dd>
  5635. <dt>&lsquo;<samp>hexagonal</samp>&rsquo;</dt>
  5636. <dd><p>FL+FR+FC+BL+BR+BC
  5637. </p></dd>
  5638. <dt>&lsquo;<samp>6.1</samp>&rsquo;</dt>
  5639. <dd><p>FL+FR+FC+LFE+BC+SL+SR
  5640. </p></dd>
  5641. <dt>&lsquo;<samp>6.1</samp>&rsquo;</dt>
  5642. <dd><p>FL+FR+FC+LFE+BL+BR+BC
  5643. </p></dd>
  5644. <dt>&lsquo;<samp>6.1(front)</samp>&rsquo;</dt>
  5645. <dd><p>FL+FR+LFE+FLC+FRC+SL+SR
  5646. </p></dd>
  5647. <dt>&lsquo;<samp>7.0</samp>&rsquo;</dt>
  5648. <dd><p>FL+FR+FC+BL+BR+SL+SR
  5649. </p></dd>
  5650. <dt>&lsquo;<samp>7.0(front)</samp>&rsquo;</dt>
  5651. <dd><p>FL+FR+FC+FLC+FRC+SL+SR
  5652. </p></dd>
  5653. <dt>&lsquo;<samp>7.1</samp>&rsquo;</dt>
  5654. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR
  5655. </p></dd>
  5656. <dt>&lsquo;<samp>7.1(wide)</samp>&rsquo;</dt>
  5657. <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC
  5658. </p></dd>
  5659. <dt>&lsquo;<samp>7.1(wide-side)</samp>&rsquo;</dt>
  5660. <dd><p>FL+FR+FC+LFE+FLC+FRC+SL+SR
  5661. </p></dd>
  5662. <dt>&lsquo;<samp>octagonal</samp>&rsquo;</dt>
  5663. <dd><p>FL+FR+FC+BL+BR+BC+SL+SR
  5664. </p></dd>
  5665. <dt>&lsquo;<samp>hexadecagonal</samp>&rsquo;</dt>
  5666. <dd><p>FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR
  5667. </p></dd>
  5668. <dt>&lsquo;<samp>downmix</samp>&rsquo;</dt>
  5669. <dd><p>DL+DR
  5670. </p></dd>
  5671. </dl>
  5672. <p>A custom channel layout can be specified as a sequence of terms, separated by
  5673. &rsquo;+&rsquo; or &rsquo;|&rsquo;. Each term can be:
  5674. </p><ul>
  5675. <li> the name of a standard channel layout (e.g. &lsquo;<samp>mono</samp>&rsquo;,
  5676. &lsquo;<samp>stereo</samp>&rsquo;, &lsquo;<samp>4.0</samp>&rsquo;, &lsquo;<samp>quad</samp>&rsquo;, &lsquo;<samp>5.0</samp>&rsquo;, etc.)
  5677. </li><li> the name of a single channel (e.g. &lsquo;<samp>FL</samp>&rsquo;, &lsquo;<samp>FR</samp>&rsquo;, &lsquo;<samp>FC</samp>&rsquo;, &lsquo;<samp>LFE</samp>&rsquo;, etc.)
  5678. </li><li> a number of channels, in decimal, followed by &rsquo;c&rsquo;, yielding the default channel
  5679. layout for that number of channels (see the function
  5680. <code>av_get_default_channel_layout</code>). Note that not all channel counts have a
  5681. default layout.
  5682. </li><li> a number of channels, in decimal, followed by &rsquo;C&rsquo;, yielding an unknown channel
  5683. layout with the specified number of channels. Note that not all channel layout
  5684. specification strings support unknown channel layouts.
  5685. </li><li> a channel layout mask, in hexadecimal starting with &quot;0x&quot; (see the
  5686. <code>AV_CH_*</code> macros in <samp>libavutil/channel_layout.h</samp>.
  5687. </li></ul>
  5688. <p>Before libavutil version 53 the trailing character &quot;c&quot; to specify a number of
  5689. channels was optional, but now it is required, while a channel layout mask can
  5690. also be specified as a decimal number (if and only if not followed by &quot;c&quot; or &quot;C&quot;).
  5691. </p>
  5692. <p>See also the function <code>av_get_channel_layout</code> defined in
  5693. <samp>libavutil/channel_layout.h</samp>.
  5694. </p>
  5695. <a name="Expression-Evaluation"></a>
  5696. <h2 class="chapter">8 Expression Evaluation<span class="pull-right"><a class="anchor hidden-xs" href="#Expression-Evaluation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Expression-Evaluation" aria-hidden="true">TOC</a></span></h2>
  5697. <p>When evaluating an arithmetic expression, FFmpeg uses an internal
  5698. formula evaluator, implemented through the <samp>libavutil/eval.h</samp>
  5699. interface.
  5700. </p>
  5701. <p>An expression may contain unary, binary operators, constants, and
  5702. functions.
  5703. </p>
  5704. <p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
  5705. another expression &quot;<var>expr1</var>;<var>expr2</var>&quot;.
  5706. <var>expr1</var> and <var>expr2</var> are evaluated in turn, and the new
  5707. expression evaluates to the value of <var>expr2</var>.
  5708. </p>
  5709. <p>The following binary operators are available: <code>+</code>, <code>-</code>,
  5710. <code>*</code>, <code>/</code>, <code>^</code>.
  5711. </p>
  5712. <p>The following unary operators are available: <code>+</code>, <code>-</code>.
  5713. </p>
  5714. <p>The following functions are available:
  5715. </p><dl compact="compact">
  5716. <dt><samp>abs(x)</samp></dt>
  5717. <dd><p>Compute absolute value of <var>x</var>.
  5718. </p>
  5719. </dd>
  5720. <dt><samp>acos(x)</samp></dt>
  5721. <dd><p>Compute arccosine of <var>x</var>.
  5722. </p>
  5723. </dd>
  5724. <dt><samp>asin(x)</samp></dt>
  5725. <dd><p>Compute arcsine of <var>x</var>.
  5726. </p>
  5727. </dd>
  5728. <dt><samp>atan(x)</samp></dt>
  5729. <dd><p>Compute arctangent of <var>x</var>.
  5730. </p>
  5731. </dd>
  5732. <dt><samp>atan2(x, y)</samp></dt>
  5733. <dd><p>Compute principal value of the arc tangent of <var>y</var>/<var>x</var>.
  5734. </p>
  5735. </dd>
  5736. <dt><samp>between(x, min, max)</samp></dt>
  5737. <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>min</var> and lesser than or
  5738. equal to <var>max</var>, 0 otherwise.
  5739. </p>
  5740. </dd>
  5741. <dt><samp>bitand(x, y)</samp></dt>
  5742. <dt><samp>bitor(x, y)</samp></dt>
  5743. <dd><p>Compute bitwise and/or operation on <var>x</var> and <var>y</var>.
  5744. </p>
  5745. <p>The results of the evaluation of <var>x</var> and <var>y</var> are converted to
  5746. integers before executing the bitwise operation.
  5747. </p>
  5748. <p>Note that both the conversion to integer and the conversion back to
  5749. floating point can lose precision. Beware of unexpected results for
  5750. large numbers (usually 2^53 and larger).
  5751. </p>
  5752. </dd>
  5753. <dt><samp>ceil(expr)</samp></dt>
  5754. <dd><p>Round the value of expression <var>expr</var> upwards to the nearest
  5755. integer. For example, &quot;ceil(1.5)&quot; is &quot;2.0&quot;.
  5756. </p>
  5757. </dd>
  5758. <dt><samp>clip(x, min, max)</samp></dt>
  5759. <dd><p>Return the value of <var>x</var> clipped between <var>min</var> and <var>max</var>.
  5760. </p>
  5761. </dd>
  5762. <dt><samp>cos(x)</samp></dt>
  5763. <dd><p>Compute cosine of <var>x</var>.
  5764. </p>
  5765. </dd>
  5766. <dt><samp>cosh(x)</samp></dt>
  5767. <dd><p>Compute hyperbolic cosine of <var>x</var>.
  5768. </p>
  5769. </dd>
  5770. <dt><samp>eq(x, y)</samp></dt>
  5771. <dd><p>Return 1 if <var>x</var> and <var>y</var> are equivalent, 0 otherwise.
  5772. </p>
  5773. </dd>
  5774. <dt><samp>exp(x)</samp></dt>
  5775. <dd><p>Compute exponential of <var>x</var> (with base <code>e</code>, the Euler&rsquo;s number).
  5776. </p>
  5777. </dd>
  5778. <dt><samp>floor(expr)</samp></dt>
  5779. <dd><p>Round the value of expression <var>expr</var> downwards to the nearest
  5780. integer. For example, &quot;floor(-1.5)&quot; is &quot;-2.0&quot;.
  5781. </p>
  5782. </dd>
  5783. <dt><samp>gauss(x)</samp></dt>
  5784. <dd><p>Compute Gauss function of <var>x</var>, corresponding to
  5785. <code>exp(-x*x/2) / sqrt(2*PI)</code>.
  5786. </p>
  5787. </dd>
  5788. <dt><samp>gcd(x, y)</samp></dt>
  5789. <dd><p>Return the greatest common divisor of <var>x</var> and <var>y</var>. If both <var>x</var> and
  5790. <var>y</var> are 0 or either or both are less than zero then behavior is undefined.
  5791. </p>
  5792. </dd>
  5793. <dt><samp>gt(x, y)</samp></dt>
  5794. <dd><p>Return 1 if <var>x</var> is greater than <var>y</var>, 0 otherwise.
  5795. </p>
  5796. </dd>
  5797. <dt><samp>gte(x, y)</samp></dt>
  5798. <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>y</var>, 0 otherwise.
  5799. </p>
  5800. </dd>
  5801. <dt><samp>hypot(x, y)</samp></dt>
  5802. <dd><p>This function is similar to the C function with the same name; it returns
  5803. &quot;sqrt(<var>x</var>*<var>x</var> + <var>y</var>*<var>y</var>)&quot;, the length of the hypotenuse of a
  5804. right triangle with sides of length <var>x</var> and <var>y</var>, or the distance of the
  5805. point (<var>x</var>, <var>y</var>) from the origin.
  5806. </p>
  5807. </dd>
  5808. <dt><samp>if(x, y)</samp></dt>
  5809. <dd><p>Evaluate <var>x</var>, and if the result is non-zero return the result of
  5810. the evaluation of <var>y</var>, return 0 otherwise.
  5811. </p>
  5812. </dd>
  5813. <dt><samp>if(x, y, z)</samp></dt>
  5814. <dd><p>Evaluate <var>x</var>, and if the result is non-zero return the evaluation
  5815. result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
  5816. </p>
  5817. </dd>
  5818. <dt><samp>ifnot(x, y)</samp></dt>
  5819. <dd><p>Evaluate <var>x</var>, and if the result is zero return the result of the
  5820. evaluation of <var>y</var>, return 0 otherwise.
  5821. </p>
  5822. </dd>
  5823. <dt><samp>ifnot(x, y, z)</samp></dt>
  5824. <dd><p>Evaluate <var>x</var>, and if the result is zero return the evaluation
  5825. result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
  5826. </p>
  5827. </dd>
  5828. <dt><samp>isinf(x)</samp></dt>
  5829. <dd><p>Return 1.0 if <var>x</var> is +/-INFINITY, 0.0 otherwise.
  5830. </p>
  5831. </dd>
  5832. <dt><samp>isnan(x)</samp></dt>
  5833. <dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
  5834. </p>
  5835. </dd>
  5836. <dt><samp>ld(var)</samp></dt>
  5837. <dd><p>Load the value of the internal variable with number
  5838. <var>var</var>, which was previously stored with st(<var>var</var>, <var>expr</var>).
  5839. The function returns the loaded value.
  5840. </p>
  5841. </dd>
  5842. <dt><samp>lerp(x, y, z)</samp></dt>
  5843. <dd><p>Return linear interpolation between <var>x</var> and <var>y</var> by amount of <var>z</var>.
  5844. </p>
  5845. </dd>
  5846. <dt><samp>log(x)</samp></dt>
  5847. <dd><p>Compute natural logarithm of <var>x</var>.
  5848. </p>
  5849. </dd>
  5850. <dt><samp>lt(x, y)</samp></dt>
  5851. <dd><p>Return 1 if <var>x</var> is lesser than <var>y</var>, 0 otherwise.
  5852. </p>
  5853. </dd>
  5854. <dt><samp>lte(x, y)</samp></dt>
  5855. <dd><p>Return 1 if <var>x</var> is lesser than or equal to <var>y</var>, 0 otherwise.
  5856. </p>
  5857. </dd>
  5858. <dt><samp>max(x, y)</samp></dt>
  5859. <dd><p>Return the maximum between <var>x</var> and <var>y</var>.
  5860. </p>
  5861. </dd>
  5862. <dt><samp>min(x, y)</samp></dt>
  5863. <dd><p>Return the minimum between <var>x</var> and <var>y</var>.
  5864. </p>
  5865. </dd>
  5866. <dt><samp>mod(x, y)</samp></dt>
  5867. <dd><p>Compute the remainder of division of <var>x</var> by <var>y</var>.
  5868. </p>
  5869. </dd>
  5870. <dt><samp>not(expr)</samp></dt>
  5871. <dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
  5872. </p>
  5873. </dd>
  5874. <dt><samp>pow(x, y)</samp></dt>
  5875. <dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
  5876. &quot;(<var>x</var>)^(<var>y</var>)&quot;.
  5877. </p>
  5878. </dd>
  5879. <dt><samp>print(t)</samp></dt>
  5880. <dt><samp>print(t, l)</samp></dt>
  5881. <dd><p>Print the value of expression <var>t</var> with loglevel <var>l</var>. If
  5882. <var>l</var> is not specified then a default log level is used.
  5883. Returns the value of the expression printed.
  5884. </p>
  5885. <p>Prints t with loglevel l
  5886. </p>
  5887. </dd>
  5888. <dt><samp>random(x)</samp></dt>
  5889. <dd><p>Return a pseudo random value between 0.0 and 1.0. <var>x</var> is the index of the
  5890. internal variable which will be used to save the seed/state.
  5891. </p>
  5892. </dd>
  5893. <dt><samp>root(expr, max)</samp></dt>
  5894. <dd><p>Find an input value for which the function represented by <var>expr</var>
  5895. with argument <var>ld(0)</var> is 0 in the interval 0..<var>max</var>.
  5896. </p>
  5897. <p>The expression in <var>expr</var> must denote a continuous function or the
  5898. result is undefined.
  5899. </p>
  5900. <p><var>ld(0)</var> is used to represent the function input value, which means
  5901. that the given expression will be evaluated multiple times with
  5902. various input values that the expression can access through
  5903. <code>ld(0)</code>. When the expression evaluates to 0 then the
  5904. corresponding input value will be returned.
  5905. </p>
  5906. </dd>
  5907. <dt><samp>round(expr)</samp></dt>
  5908. <dd><p>Round the value of expression <var>expr</var> to the nearest integer. For example, &quot;round(1.5)&quot; is &quot;2.0&quot;.
  5909. </p>
  5910. </dd>
  5911. <dt><samp>sgn(x)</samp></dt>
  5912. <dd><p>Compute sign of <var>x</var>.
  5913. </p>
  5914. </dd>
  5915. <dt><samp>sin(x)</samp></dt>
  5916. <dd><p>Compute sine of <var>x</var>.
  5917. </p>
  5918. </dd>
  5919. <dt><samp>sinh(x)</samp></dt>
  5920. <dd><p>Compute hyperbolic sine of <var>x</var>.
  5921. </p>
  5922. </dd>
  5923. <dt><samp>sqrt(expr)</samp></dt>
  5924. <dd><p>Compute the square root of <var>expr</var>. This is equivalent to
  5925. &quot;(<var>expr</var>)^.5&quot;.
  5926. </p>
  5927. </dd>
  5928. <dt><samp>squish(x)</samp></dt>
  5929. <dd><p>Compute expression <code>1/(1 + exp(4*x))</code>.
  5930. </p>
  5931. </dd>
  5932. <dt><samp>st(var, expr)</samp></dt>
  5933. <dd><p>Store the value of the expression <var>expr</var> in an internal
  5934. variable. <var>var</var> specifies the number of the variable where to
  5935. store the value, and it is a value ranging from 0 to 9. The function
  5936. returns the value stored in the internal variable.
  5937. Note, Variables are currently not shared between expressions.
  5938. </p>
  5939. </dd>
  5940. <dt><samp>tan(x)</samp></dt>
  5941. <dd><p>Compute tangent of <var>x</var>.
  5942. </p>
  5943. </dd>
  5944. <dt><samp>tanh(x)</samp></dt>
  5945. <dd><p>Compute hyperbolic tangent of <var>x</var>.
  5946. </p>
  5947. </dd>
  5948. <dt><samp>taylor(expr, x)</samp></dt>
  5949. <dt><samp>taylor(expr, x, id)</samp></dt>
  5950. <dd><p>Evaluate a Taylor series at <var>x</var>, given an expression representing
  5951. the <code>ld(id)</code>-th derivative of a function at 0.
  5952. </p>
  5953. <p>When the series does not converge the result is undefined.
  5954. </p>
  5955. <p><var>ld(id)</var> is used to represent the derivative order in <var>expr</var>,
  5956. which means that the given expression will be evaluated multiple times
  5957. with various input values that the expression can access through
  5958. <code>ld(id)</code>. If <var>id</var> is not specified then 0 is assumed.
  5959. </p>
  5960. <p>Note, when you have the derivatives at y instead of 0,
  5961. <code>taylor(expr, x-y)</code> can be used.
  5962. </p>
  5963. </dd>
  5964. <dt><samp>time(0)</samp></dt>
  5965. <dd><p>Return the current (wallclock) time in seconds.
  5966. </p>
  5967. </dd>
  5968. <dt><samp>trunc(expr)</samp></dt>
  5969. <dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
  5970. integer. For example, &quot;trunc(-1.5)&quot; is &quot;-1.0&quot;.
  5971. </p>
  5972. </dd>
  5973. <dt><samp>while(cond, expr)</samp></dt>
  5974. <dd><p>Evaluate expression <var>expr</var> while the expression <var>cond</var> is
  5975. non-zero, and returns the value of the last <var>expr</var> evaluation, or
  5976. NAN if <var>cond</var> was always false.
  5977. </p></dd>
  5978. </dl>
  5979. <p>The following constants are available:
  5980. </p><dl compact="compact">
  5981. <dt><samp>PI</samp></dt>
  5982. <dd><p>area of the unit disc, approximately 3.14
  5983. </p></dd>
  5984. <dt><samp>E</samp></dt>
  5985. <dd><p>exp(1) (Euler&rsquo;s number), approximately 2.718
  5986. </p></dd>
  5987. <dt><samp>PHI</samp></dt>
  5988. <dd><p>golden ratio (1+sqrt(5))/2, approximately 1.618
  5989. </p></dd>
  5990. </dl>
  5991. <p>Assuming that an expression is considered &quot;true&quot; if it has a non-zero
  5992. value, note that:
  5993. </p>
  5994. <p><code>*</code> works like AND
  5995. </p>
  5996. <p><code>+</code> works like OR
  5997. </p>
  5998. <p>For example the construct:
  5999. </p><div class="example">
  6000. <pre class="example">if (A AND B) then C
  6001. </pre></div>
  6002. <p>is equivalent to:
  6003. </p><div class="example">
  6004. <pre class="example">if(A*B, C)
  6005. </pre></div>
  6006. <p>In your C code, you can extend the list of unary and binary functions,
  6007. and define recognized constants, so that they are available for your
  6008. expressions.
  6009. </p>
  6010. <p>The evaluator also recognizes the International System unit prefixes.
  6011. If &rsquo;i&rsquo; is appended after the prefix, binary prefixes are used, which
  6012. are based on powers of 1024 instead of powers of 1000.
  6013. The &rsquo;B&rsquo; postfix multiplies the value by 8, and can be appended after a
  6014. unit prefix or used alone. This allows using for example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;,
  6015. &rsquo;G&rsquo; and &rsquo;B&rsquo; as number postfix.
  6016. </p>
  6017. <p>The list of available International System prefixes follows, with
  6018. indication of the corresponding powers of 10 and of 2.
  6019. </p><dl compact="compact">
  6020. <dt><samp>y</samp></dt>
  6021. <dd><p>10^-24 / 2^-80
  6022. </p></dd>
  6023. <dt><samp>z</samp></dt>
  6024. <dd><p>10^-21 / 2^-70
  6025. </p></dd>
  6026. <dt><samp>a</samp></dt>
  6027. <dd><p>10^-18 / 2^-60
  6028. </p></dd>
  6029. <dt><samp>f</samp></dt>
  6030. <dd><p>10^-15 / 2^-50
  6031. </p></dd>
  6032. <dt><samp>p</samp></dt>
  6033. <dd><p>10^-12 / 2^-40
  6034. </p></dd>
  6035. <dt><samp>n</samp></dt>
  6036. <dd><p>10^-9 / 2^-30
  6037. </p></dd>
  6038. <dt><samp>u</samp></dt>
  6039. <dd><p>10^-6 / 2^-20
  6040. </p></dd>
  6041. <dt><samp>m</samp></dt>
  6042. <dd><p>10^-3 / 2^-10
  6043. </p></dd>
  6044. <dt><samp>c</samp></dt>
  6045. <dd><p>10^-2
  6046. </p></dd>
  6047. <dt><samp>d</samp></dt>
  6048. <dd><p>10^-1
  6049. </p></dd>
  6050. <dt><samp>h</samp></dt>
  6051. <dd><p>10^2
  6052. </p></dd>
  6053. <dt><samp>k</samp></dt>
  6054. <dd><p>10^3 / 2^10
  6055. </p></dd>
  6056. <dt><samp>K</samp></dt>
  6057. <dd><p>10^3 / 2^10
  6058. </p></dd>
  6059. <dt><samp>M</samp></dt>
  6060. <dd><p>10^6 / 2^20
  6061. </p></dd>
  6062. <dt><samp>G</samp></dt>
  6063. <dd><p>10^9 / 2^30
  6064. </p></dd>
  6065. <dt><samp>T</samp></dt>
  6066. <dd><p>10^12 / 2^40
  6067. </p></dd>
  6068. <dt><samp>P</samp></dt>
  6069. <dd><p>10^15 / 2^40
  6070. </p></dd>
  6071. <dt><samp>E</samp></dt>
  6072. <dd><p>10^18 / 2^50
  6073. </p></dd>
  6074. <dt><samp>Z</samp></dt>
  6075. <dd><p>10^21 / 2^60
  6076. </p></dd>
  6077. <dt><samp>Y</samp></dt>
  6078. <dd><p>10^24 / 2^70
  6079. </p></dd>
  6080. </dl>
  6081. <span id="codec_002doptions"></span><a name="Codec-Options"></a>
  6082. <h2 class="chapter">9 Codec Options<span class="pull-right"><a class="anchor hidden-xs" href="#Codec-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Codec-Options" aria-hidden="true">TOC</a></span></h2>
  6083. <p>libavcodec provides some generic global options, which can be set on
  6084. all the encoders and decoders. In addition each codec may support
  6085. so-called private options, which are specific for a given codec.
  6086. </p>
  6087. <p>Sometimes, a global option may only affect a specific kind of codec,
  6088. and may be nonsensical or ignored by another, so you need to be aware
  6089. of the meaning of the specified options. Also some options are
  6090. meant only for decoding or encoding.
  6091. </p>
  6092. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  6093. FFmpeg tools, or by setting the value explicitly in the
  6094. <code>AVCodecContext</code> options or using the <samp>libavutil/opt.h</samp> API
  6095. for programmatic use.
  6096. </p>
  6097. <p>The list of supported options follow:
  6098. </p>
  6099. <dl compact="compact">
  6100. <dt><samp>b <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
  6101. <dd><p>Set bitrate in bits/s. Default value is 200K.
  6102. </p>
  6103. </dd>
  6104. <dt><samp>ab <var>integer</var> (<em>encoding,audio</em>)</samp></dt>
  6105. <dd><p>Set audio bitrate (in bits/s). Default value is 128K.
  6106. </p>
  6107. </dd>
  6108. <dt><samp>bt <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6109. <dd><p>Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
  6110. tolerance specifies how far ratecontrol is willing to deviate from the
  6111. target average bitrate value. This is not related to min/max
  6112. bitrate. Lowering tolerance too much has an adverse effect on quality.
  6113. </p>
  6114. </dd>
  6115. <dt><samp>flags <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  6116. <dd><p>Set generic flags.
  6117. </p>
  6118. <p>Possible values:
  6119. </p><dl compact="compact">
  6120. <dt>&lsquo;<samp>mv4</samp>&rsquo;</dt>
  6121. <dd><p>Use four motion vector by macroblock (mpeg4).
  6122. </p></dd>
  6123. <dt>&lsquo;<samp>qpel</samp>&rsquo;</dt>
  6124. <dd><p>Use 1/4 pel motion compensation.
  6125. </p></dd>
  6126. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  6127. <dd><p>Use loop filter.
  6128. </p></dd>
  6129. <dt>&lsquo;<samp>qscale</samp>&rsquo;</dt>
  6130. <dd><p>Use fixed qscale.
  6131. </p></dd>
  6132. <dt>&lsquo;<samp>pass1</samp>&rsquo;</dt>
  6133. <dd><p>Use internal 2pass ratecontrol in first pass mode.
  6134. </p></dd>
  6135. <dt>&lsquo;<samp>pass2</samp>&rsquo;</dt>
  6136. <dd><p>Use internal 2pass ratecontrol in second pass mode.
  6137. </p></dd>
  6138. <dt>&lsquo;<samp>gray</samp>&rsquo;</dt>
  6139. <dd><p>Only decode/encode grayscale.
  6140. </p></dd>
  6141. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6142. <dd><p>Set error[?] variables during encoding.
  6143. </p></dd>
  6144. <dt>&lsquo;<samp>truncated</samp>&rsquo;</dt>
  6145. <dd><p>Input bitstream might be randomly truncated.
  6146. </p></dd>
  6147. <dt>&lsquo;<samp>drop_changed</samp>&rsquo;</dt>
  6148. <dd><p>Don&rsquo;t output frames whose parameters differ from first decoded frame in stream.
  6149. Error AVERROR_INPUT_CHANGED is returned when a frame is dropped.
  6150. </p>
  6151. </dd>
  6152. <dt>&lsquo;<samp>ildct</samp>&rsquo;</dt>
  6153. <dd><p>Use interlaced DCT.
  6154. </p></dd>
  6155. <dt>&lsquo;<samp>low_delay</samp>&rsquo;</dt>
  6156. <dd><p>Force low delay.
  6157. </p></dd>
  6158. <dt>&lsquo;<samp>global_header</samp>&rsquo;</dt>
  6159. <dd><p>Place global headers in extradata instead of every keyframe.
  6160. </p></dd>
  6161. <dt>&lsquo;<samp>bitexact</samp>&rsquo;</dt>
  6162. <dd><p>Only write platform-, build- and time-independent data. (except (I)DCT).
  6163. This ensures that file and data checksums are reproducible and match between
  6164. platforms. Its primary use is for regression testing.
  6165. </p></dd>
  6166. <dt>&lsquo;<samp>aic</samp>&rsquo;</dt>
  6167. <dd><p>Apply H263 advanced intra coding / mpeg4 ac prediction.
  6168. </p></dd>
  6169. <dt>&lsquo;<samp>ilme</samp>&rsquo;</dt>
  6170. <dd><p>Apply interlaced motion estimation.
  6171. </p></dd>
  6172. <dt>&lsquo;<samp>cgop</samp>&rsquo;</dt>
  6173. <dd><p>Use closed gop.
  6174. </p></dd>
  6175. <dt>&lsquo;<samp>output_corrupt</samp>&rsquo;</dt>
  6176. <dd><p>Output even potentially corrupted frames.
  6177. </p></dd>
  6178. </dl>
  6179. </dd>
  6180. <dt><samp>time_base <var>rational number</var></samp></dt>
  6181. <dd><p>Set codec time base.
  6182. </p>
  6183. <p>It is the fundamental unit of time (in seconds) in terms of which
  6184. frame timestamps are represented. For fixed-fps content, timebase
  6185. should be <code>1 / frame_rate</code> and timestamp increments should be
  6186. identically 1.
  6187. </p>
  6188. </dd>
  6189. <dt><samp>g <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6190. <dd><p>Set the group of picture (GOP) size. Default value is 12.
  6191. </p>
  6192. </dd>
  6193. <dt><samp>ar <var>integer</var> (<em>decoding/encoding,audio</em>)</samp></dt>
  6194. <dd><p>Set audio sampling rate (in Hz).
  6195. </p>
  6196. </dd>
  6197. <dt><samp>ac <var>integer</var> (<em>decoding/encoding,audio</em>)</samp></dt>
  6198. <dd><p>Set number of audio channels.
  6199. </p>
  6200. </dd>
  6201. <dt><samp>cutoff <var>integer</var> (<em>encoding,audio</em>)</samp></dt>
  6202. <dd><p>Set cutoff bandwidth. (Supported only by selected encoders, see
  6203. their respective documentation sections.)
  6204. </p>
  6205. </dd>
  6206. <dt><samp>frame_size <var>integer</var> (<em>encoding,audio</em>)</samp></dt>
  6207. <dd><p>Set audio frame size.
  6208. </p>
  6209. <p>Each submitted frame except the last must contain exactly frame_size
  6210. samples per channel. May be 0 when the codec has
  6211. CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
  6212. restricted. It is set by some decoders to indicate constant frame
  6213. size.
  6214. </p>
  6215. </dd>
  6216. <dt><samp>frame_number <var>integer</var></samp></dt>
  6217. <dd><p>Set the frame number.
  6218. </p>
  6219. </dd>
  6220. <dt><samp>delay <var>integer</var></samp></dt>
  6221. <dt><samp>qcomp <var>float</var> (<em>encoding,video</em>)</samp></dt>
  6222. <dd><p>Set video quantizer scale compression (VBR). It is used as a constant
  6223. in the ratecontrol equation. Recommended range for default rc_eq:
  6224. 0.0-1.0.
  6225. </p>
  6226. </dd>
  6227. <dt><samp>qblur <var>float</var> (<em>encoding,video</em>)</samp></dt>
  6228. <dd><p>Set video quantizer scale blur (VBR).
  6229. </p>
  6230. </dd>
  6231. <dt><samp>qmin <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6232. <dd><p>Set min video quantizer scale (VBR). Must be included between -1 and
  6233. 69, default value is 2.
  6234. </p>
  6235. </dd>
  6236. <dt><samp>qmax <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6237. <dd><p>Set max video quantizer scale (VBR). Must be included between -1 and
  6238. 1024, default value is 31.
  6239. </p>
  6240. </dd>
  6241. <dt><samp>qdiff <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6242. <dd><p>Set max difference between the quantizer scale (VBR).
  6243. </p>
  6244. </dd>
  6245. <dt><samp>bf <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6246. <dd><p>Set max number of B frames between non-B-frames.
  6247. </p>
  6248. <p>Must be an integer between -1 and 16. 0 means that B-frames are
  6249. disabled. If a value of -1 is used, it will choose an automatic value
  6250. depending on the encoder.
  6251. </p>
  6252. <p>Default value is 0.
  6253. </p>
  6254. </dd>
  6255. <dt><samp>b_qfactor <var>float</var> (<em>encoding,video</em>)</samp></dt>
  6256. <dd><p>Set qp factor between P and B frames.
  6257. </p>
  6258. </dd>
  6259. <dt><samp>b_strategy <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6260. <dd><p>Set strategy to choose between I/P/B-frames.
  6261. </p>
  6262. </dd>
  6263. <dt><samp>ps <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6264. <dd><p>Set RTP payload size in bytes.
  6265. </p>
  6266. </dd>
  6267. <dt><samp>mv_bits <var>integer</var></samp></dt>
  6268. <dt><samp>header_bits <var>integer</var></samp></dt>
  6269. <dt><samp>i_tex_bits <var>integer</var></samp></dt>
  6270. <dt><samp>p_tex_bits <var>integer</var></samp></dt>
  6271. <dt><samp>i_count <var>integer</var></samp></dt>
  6272. <dt><samp>p_count <var>integer</var></samp></dt>
  6273. <dt><samp>skip_count <var>integer</var></samp></dt>
  6274. <dt><samp>misc_bits <var>integer</var></samp></dt>
  6275. <dt><samp>frame_bits <var>integer</var></samp></dt>
  6276. <dt><samp>codec_tag <var>integer</var></samp></dt>
  6277. <dt><samp>bug <var>flags</var> (<em>decoding,video</em>)</samp></dt>
  6278. <dd><p>Workaround not auto detected encoder bugs.
  6279. </p>
  6280. <p>Possible values:
  6281. </p><dl compact="compact">
  6282. <dt>&lsquo;<samp>autodetect</samp>&rsquo;</dt>
  6283. <dt>&lsquo;<samp>xvid_ilace</samp>&rsquo;</dt>
  6284. <dd><p>Xvid interlacing bug (autodetected if fourcc==XVIX)
  6285. </p></dd>
  6286. <dt>&lsquo;<samp>ump4</samp>&rsquo;</dt>
  6287. <dd><p>(autodetected if fourcc==UMP4)
  6288. </p></dd>
  6289. <dt>&lsquo;<samp>no_padding</samp>&rsquo;</dt>
  6290. <dd><p>padding bug (autodetected)
  6291. </p></dd>
  6292. <dt>&lsquo;<samp>amv</samp>&rsquo;</dt>
  6293. <dt>&lsquo;<samp>qpel_chroma</samp>&rsquo;</dt>
  6294. <dt>&lsquo;<samp>std_qpel</samp>&rsquo;</dt>
  6295. <dd><p>old standard qpel (autodetected per fourcc/version)
  6296. </p></dd>
  6297. <dt>&lsquo;<samp>qpel_chroma2</samp>&rsquo;</dt>
  6298. <dt>&lsquo;<samp>direct_blocksize</samp>&rsquo;</dt>
  6299. <dd><p>direct-qpel-blocksize bug (autodetected per fourcc/version)
  6300. </p></dd>
  6301. <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
  6302. <dd><p>edge padding bug (autodetected per fourcc/version)
  6303. </p></dd>
  6304. <dt>&lsquo;<samp>hpel_chroma</samp>&rsquo;</dt>
  6305. <dt>&lsquo;<samp>dc_clip</samp>&rsquo;</dt>
  6306. <dt>&lsquo;<samp>ms</samp>&rsquo;</dt>
  6307. <dd><p>Workaround various bugs in microsoft broken decoders.
  6308. </p></dd>
  6309. <dt>&lsquo;<samp>trunc</samp>&rsquo;</dt>
  6310. <dd><p>trancated frames
  6311. </p></dd>
  6312. </dl>
  6313. </dd>
  6314. <dt><samp>strict <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp></dt>
  6315. <dd><p>Specify how strictly to follow the standards.
  6316. </p>
  6317. <p>Possible values:
  6318. </p><dl compact="compact">
  6319. <dt>&lsquo;<samp>very</samp>&rsquo;</dt>
  6320. <dd><p>strictly conform to an older more strict version of the spec or reference software
  6321. </p></dd>
  6322. <dt>&lsquo;<samp>strict</samp>&rsquo;</dt>
  6323. <dd><p>strictly conform to all the things in the spec no matter what consequences
  6324. </p></dd>
  6325. <dt>&lsquo;<samp>normal</samp>&rsquo;</dt>
  6326. <dt>&lsquo;<samp>unofficial</samp>&rsquo;</dt>
  6327. <dd><p>allow unofficial extensions
  6328. </p></dd>
  6329. <dt>&lsquo;<samp>experimental</samp>&rsquo;</dt>
  6330. <dd><p>allow non standardized experimental things, experimental
  6331. (unfinished/work in progress/not well tested) decoders and encoders.
  6332. Note: experimental decoders can pose a security risk, do not use this for
  6333. decoding untrusted input.
  6334. </p></dd>
  6335. </dl>
  6336. </dd>
  6337. <dt><samp>b_qoffset <var>float</var> (<em>encoding,video</em>)</samp></dt>
  6338. <dd><p>Set QP offset between P and B frames.
  6339. </p>
  6340. </dd>
  6341. <dt><samp>err_detect <var>flags</var> (<em>decoding,audio,video</em>)</samp></dt>
  6342. <dd><p>Set error detection flags.
  6343. </p>
  6344. <p>Possible values:
  6345. </p><dl compact="compact">
  6346. <dt>&lsquo;<samp>crccheck</samp>&rsquo;</dt>
  6347. <dd><p>verify embedded CRCs
  6348. </p></dd>
  6349. <dt>&lsquo;<samp>bitstream</samp>&rsquo;</dt>
  6350. <dd><p>detect bitstream specification deviations
  6351. </p></dd>
  6352. <dt>&lsquo;<samp>buffer</samp>&rsquo;</dt>
  6353. <dd><p>detect improper bitstream length
  6354. </p></dd>
  6355. <dt>&lsquo;<samp>explode</samp>&rsquo;</dt>
  6356. <dd><p>abort decoding on minor error detection
  6357. </p></dd>
  6358. <dt>&lsquo;<samp>ignore_err</samp>&rsquo;</dt>
  6359. <dd><p>ignore decoding errors, and continue decoding.
  6360. This is useful if you want to analyze the content of a video and thus want
  6361. everything to be decoded no matter what. This option will not result in a video
  6362. that is pleasing to watch in case of errors.
  6363. </p></dd>
  6364. <dt>&lsquo;<samp>careful</samp>&rsquo;</dt>
  6365. <dd><p>consider things that violate the spec and have not been seen in the wild as errors
  6366. </p></dd>
  6367. <dt>&lsquo;<samp>compliant</samp>&rsquo;</dt>
  6368. <dd><p>consider all spec non compliancies as errors
  6369. </p></dd>
  6370. <dt>&lsquo;<samp>aggressive</samp>&rsquo;</dt>
  6371. <dd><p>consider things that a sane encoder should not do as an error
  6372. </p></dd>
  6373. </dl>
  6374. </dd>
  6375. <dt><samp>has_b_frames <var>integer</var></samp></dt>
  6376. <dt><samp>block_align <var>integer</var></samp></dt>
  6377. <dt><samp>mpeg_quant <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6378. <dd><p>Use MPEG quantizers instead of H.263.
  6379. </p>
  6380. </dd>
  6381. <dt><samp>rc_override_count <var>integer</var></samp></dt>
  6382. <dt><samp>maxrate <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
  6383. <dd><p>Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
  6384. </p>
  6385. </dd>
  6386. <dt><samp>minrate <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
  6387. <dd><p>Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
  6388. encode. It is of little use elsewise.
  6389. </p>
  6390. </dd>
  6391. <dt><samp>bufsize <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
  6392. <dd><p>Set ratecontrol buffer size (in bits).
  6393. </p>
  6394. </dd>
  6395. <dt><samp>i_qfactor <var>float</var> (<em>encoding,video</em>)</samp></dt>
  6396. <dd><p>Set QP factor between P and I frames.
  6397. </p>
  6398. </dd>
  6399. <dt><samp>i_qoffset <var>float</var> (<em>encoding,video</em>)</samp></dt>
  6400. <dd><p>Set QP offset between P and I frames.
  6401. </p>
  6402. </dd>
  6403. <dt><samp>dct <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6404. <dd><p>Set DCT algorithm.
  6405. </p>
  6406. <p>Possible values:
  6407. </p><dl compact="compact">
  6408. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  6409. <dd><p>autoselect a good one (default)
  6410. </p></dd>
  6411. <dt>&lsquo;<samp>fastint</samp>&rsquo;</dt>
  6412. <dd><p>fast integer
  6413. </p></dd>
  6414. <dt>&lsquo;<samp>int</samp>&rsquo;</dt>
  6415. <dd><p>accurate integer
  6416. </p></dd>
  6417. <dt>&lsquo;<samp>mmx</samp>&rsquo;</dt>
  6418. <dt>&lsquo;<samp>altivec</samp>&rsquo;</dt>
  6419. <dt>&lsquo;<samp>faan</samp>&rsquo;</dt>
  6420. <dd><p>floating point AAN DCT
  6421. </p></dd>
  6422. </dl>
  6423. </dd>
  6424. <dt><samp>lumi_mask <var>float</var> (<em>encoding,video</em>)</samp></dt>
  6425. <dd><p>Compress bright areas stronger than medium ones.
  6426. </p>
  6427. </dd>
  6428. <dt><samp>tcplx_mask <var>float</var> (<em>encoding,video</em>)</samp></dt>
  6429. <dd><p>Set temporal complexity masking.
  6430. </p>
  6431. </dd>
  6432. <dt><samp>scplx_mask <var>float</var> (<em>encoding,video</em>)</samp></dt>
  6433. <dd><p>Set spatial complexity masking.
  6434. </p>
  6435. </dd>
  6436. <dt><samp>p_mask <var>float</var> (<em>encoding,video</em>)</samp></dt>
  6437. <dd><p>Set inter masking.
  6438. </p>
  6439. </dd>
  6440. <dt><samp>dark_mask <var>float</var> (<em>encoding,video</em>)</samp></dt>
  6441. <dd><p>Compress dark areas stronger than medium ones.
  6442. </p>
  6443. </dd>
  6444. <dt><samp>idct <var>integer</var> (<em>decoding/encoding,video</em>)</samp></dt>
  6445. <dd><p>Select IDCT implementation.
  6446. </p>
  6447. <p>Possible values:
  6448. </p><dl compact="compact">
  6449. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  6450. <dt>&lsquo;<samp>int</samp>&rsquo;</dt>
  6451. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  6452. <dt>&lsquo;<samp>simplemmx</samp>&rsquo;</dt>
  6453. <dt>&lsquo;<samp>simpleauto</samp>&rsquo;</dt>
  6454. <dd><p>Automatically pick a IDCT compatible with the simple one
  6455. </p>
  6456. </dd>
  6457. <dt>&lsquo;<samp>arm</samp>&rsquo;</dt>
  6458. <dt>&lsquo;<samp>altivec</samp>&rsquo;</dt>
  6459. <dt>&lsquo;<samp>sh4</samp>&rsquo;</dt>
  6460. <dt>&lsquo;<samp>simplearm</samp>&rsquo;</dt>
  6461. <dt>&lsquo;<samp>simplearmv5te</samp>&rsquo;</dt>
  6462. <dt>&lsquo;<samp>simplearmv6</samp>&rsquo;</dt>
  6463. <dt>&lsquo;<samp>simpleneon</samp>&rsquo;</dt>
  6464. <dt>&lsquo;<samp>xvid</samp>&rsquo;</dt>
  6465. <dt>&lsquo;<samp>faani</samp>&rsquo;</dt>
  6466. <dd><p>floating point AAN IDCT
  6467. </p></dd>
  6468. </dl>
  6469. </dd>
  6470. <dt><samp>slice_count <var>integer</var></samp></dt>
  6471. <dt><samp>ec <var>flags</var> (<em>decoding,video</em>)</samp></dt>
  6472. <dd><p>Set error concealment strategy.
  6473. </p>
  6474. <p>Possible values:
  6475. </p><dl compact="compact">
  6476. <dt>&lsquo;<samp>guess_mvs</samp>&rsquo;</dt>
  6477. <dd><p>iterative motion vector (MV) search (slow)
  6478. </p></dd>
  6479. <dt>&lsquo;<samp>deblock</samp>&rsquo;</dt>
  6480. <dd><p>use strong deblock filter for damaged MBs
  6481. </p></dd>
  6482. <dt>&lsquo;<samp>favor_inter</samp>&rsquo;</dt>
  6483. <dd><p>favor predicting from the previous frame instead of the current
  6484. </p></dd>
  6485. </dl>
  6486. </dd>
  6487. <dt><samp>bits_per_coded_sample <var>integer</var></samp></dt>
  6488. <dt><samp>pred <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6489. <dd><p>Set prediction method.
  6490. </p>
  6491. <p>Possible values:
  6492. </p><dl compact="compact">
  6493. <dt>&lsquo;<samp>left</samp>&rsquo;</dt>
  6494. <dt>&lsquo;<samp>plane</samp>&rsquo;</dt>
  6495. <dt>&lsquo;<samp>median</samp>&rsquo;</dt>
  6496. </dl>
  6497. </dd>
  6498. <dt><samp>aspect <var>rational number</var> (<em>encoding,video</em>)</samp></dt>
  6499. <dd><p>Set sample aspect ratio.
  6500. </p>
  6501. </dd>
  6502. <dt><samp>sar <var>rational number</var> (<em>encoding,video</em>)</samp></dt>
  6503. <dd><p>Set sample aspect ratio. Alias to <var>aspect</var>.
  6504. </p>
  6505. </dd>
  6506. <dt><samp>debug <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  6507. <dd><p>Print specific debug info.
  6508. </p>
  6509. <p>Possible values:
  6510. </p><dl compact="compact">
  6511. <dt>&lsquo;<samp>pict</samp>&rsquo;</dt>
  6512. <dd><p>picture info
  6513. </p></dd>
  6514. <dt>&lsquo;<samp>rc</samp>&rsquo;</dt>
  6515. <dd><p>rate control
  6516. </p></dd>
  6517. <dt>&lsquo;<samp>bitstream</samp>&rsquo;</dt>
  6518. <dt>&lsquo;<samp>mb_type</samp>&rsquo;</dt>
  6519. <dd><p>macroblock (MB) type
  6520. </p></dd>
  6521. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  6522. <dd><p>per-block quantization parameter (QP)
  6523. </p></dd>
  6524. <dt>&lsquo;<samp>dct_coeff</samp>&rsquo;</dt>
  6525. <dt>&lsquo;<samp>green_metadata</samp>&rsquo;</dt>
  6526. <dd><p>display complexity metadata for the upcoming frame, GoP or for a given duration.
  6527. </p>
  6528. </dd>
  6529. <dt>&lsquo;<samp>skip</samp>&rsquo;</dt>
  6530. <dt>&lsquo;<samp>startcode</samp>&rsquo;</dt>
  6531. <dt>&lsquo;<samp>er</samp>&rsquo;</dt>
  6532. <dd><p>error recognition
  6533. </p></dd>
  6534. <dt>&lsquo;<samp>mmco</samp>&rsquo;</dt>
  6535. <dd><p>memory management control operations (H.264)
  6536. </p></dd>
  6537. <dt>&lsquo;<samp>bugs</samp>&rsquo;</dt>
  6538. <dt>&lsquo;<samp>buffers</samp>&rsquo;</dt>
  6539. <dd><p>picture buffer allocations
  6540. </p></dd>
  6541. <dt>&lsquo;<samp>thread_ops</samp>&rsquo;</dt>
  6542. <dd><p>threading operations
  6543. </p></dd>
  6544. <dt>&lsquo;<samp>nomc</samp>&rsquo;</dt>
  6545. <dd><p>skip motion compensation
  6546. </p></dd>
  6547. </dl>
  6548. </dd>
  6549. <dt><samp>cmp <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6550. <dd><p>Set full pel me compare function.
  6551. </p>
  6552. <p>Possible values:
  6553. </p><dl compact="compact">
  6554. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6555. <dd><p>sum of absolute differences, fast (default)
  6556. </p></dd>
  6557. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6558. <dd><p>sum of squared errors
  6559. </p></dd>
  6560. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6561. <dd><p>sum of absolute Hadamard transformed differences
  6562. </p></dd>
  6563. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6564. <dd><p>sum of absolute DCT transformed differences
  6565. </p></dd>
  6566. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6567. <dd><p>sum of squared quantization errors (avoid, low quality)
  6568. </p></dd>
  6569. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6570. <dd><p>number of bits needed for the block
  6571. </p></dd>
  6572. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6573. <dd><p>rate distortion optimal, slow
  6574. </p></dd>
  6575. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6576. <dd><p>0
  6577. </p></dd>
  6578. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6579. <dd><p>sum of absolute vertical differences
  6580. </p></dd>
  6581. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6582. <dd><p>sum of squared vertical differences
  6583. </p></dd>
  6584. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6585. <dd><p>noise preserving sum of squared differences
  6586. </p></dd>
  6587. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6588. <dd><p>5/3 wavelet, only used in snow
  6589. </p></dd>
  6590. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6591. <dd><p>9/7 wavelet, only used in snow
  6592. </p></dd>
  6593. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6594. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6595. </dl>
  6596. </dd>
  6597. <dt><samp>subcmp <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6598. <dd><p>Set sub pel me compare function.
  6599. </p>
  6600. <p>Possible values:
  6601. </p><dl compact="compact">
  6602. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6603. <dd><p>sum of absolute differences, fast (default)
  6604. </p></dd>
  6605. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6606. <dd><p>sum of squared errors
  6607. </p></dd>
  6608. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6609. <dd><p>sum of absolute Hadamard transformed differences
  6610. </p></dd>
  6611. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6612. <dd><p>sum of absolute DCT transformed differences
  6613. </p></dd>
  6614. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6615. <dd><p>sum of squared quantization errors (avoid, low quality)
  6616. </p></dd>
  6617. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6618. <dd><p>number of bits needed for the block
  6619. </p></dd>
  6620. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6621. <dd><p>rate distortion optimal, slow
  6622. </p></dd>
  6623. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6624. <dd><p>0
  6625. </p></dd>
  6626. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6627. <dd><p>sum of absolute vertical differences
  6628. </p></dd>
  6629. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6630. <dd><p>sum of squared vertical differences
  6631. </p></dd>
  6632. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6633. <dd><p>noise preserving sum of squared differences
  6634. </p></dd>
  6635. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6636. <dd><p>5/3 wavelet, only used in snow
  6637. </p></dd>
  6638. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6639. <dd><p>9/7 wavelet, only used in snow
  6640. </p></dd>
  6641. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6642. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6643. </dl>
  6644. </dd>
  6645. <dt><samp>mbcmp <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6646. <dd><p>Set macroblock compare function.
  6647. </p>
  6648. <p>Possible values:
  6649. </p><dl compact="compact">
  6650. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6651. <dd><p>sum of absolute differences, fast (default)
  6652. </p></dd>
  6653. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6654. <dd><p>sum of squared errors
  6655. </p></dd>
  6656. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6657. <dd><p>sum of absolute Hadamard transformed differences
  6658. </p></dd>
  6659. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6660. <dd><p>sum of absolute DCT transformed differences
  6661. </p></dd>
  6662. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6663. <dd><p>sum of squared quantization errors (avoid, low quality)
  6664. </p></dd>
  6665. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6666. <dd><p>number of bits needed for the block
  6667. </p></dd>
  6668. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6669. <dd><p>rate distortion optimal, slow
  6670. </p></dd>
  6671. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6672. <dd><p>0
  6673. </p></dd>
  6674. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6675. <dd><p>sum of absolute vertical differences
  6676. </p></dd>
  6677. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6678. <dd><p>sum of squared vertical differences
  6679. </p></dd>
  6680. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6681. <dd><p>noise preserving sum of squared differences
  6682. </p></dd>
  6683. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6684. <dd><p>5/3 wavelet, only used in snow
  6685. </p></dd>
  6686. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6687. <dd><p>9/7 wavelet, only used in snow
  6688. </p></dd>
  6689. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6690. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6691. </dl>
  6692. </dd>
  6693. <dt><samp>ildctcmp <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6694. <dd><p>Set interlaced dct compare function.
  6695. </p>
  6696. <p>Possible values:
  6697. </p><dl compact="compact">
  6698. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6699. <dd><p>sum of absolute differences, fast (default)
  6700. </p></dd>
  6701. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6702. <dd><p>sum of squared errors
  6703. </p></dd>
  6704. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6705. <dd><p>sum of absolute Hadamard transformed differences
  6706. </p></dd>
  6707. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6708. <dd><p>sum of absolute DCT transformed differences
  6709. </p></dd>
  6710. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6711. <dd><p>sum of squared quantization errors (avoid, low quality)
  6712. </p></dd>
  6713. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6714. <dd><p>number of bits needed for the block
  6715. </p></dd>
  6716. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6717. <dd><p>rate distortion optimal, slow
  6718. </p></dd>
  6719. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6720. <dd><p>0
  6721. </p></dd>
  6722. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6723. <dd><p>sum of absolute vertical differences
  6724. </p></dd>
  6725. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6726. <dd><p>sum of squared vertical differences
  6727. </p></dd>
  6728. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6729. <dd><p>noise preserving sum of squared differences
  6730. </p></dd>
  6731. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6732. <dd><p>5/3 wavelet, only used in snow
  6733. </p></dd>
  6734. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6735. <dd><p>9/7 wavelet, only used in snow
  6736. </p></dd>
  6737. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6738. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6739. </dl>
  6740. </dd>
  6741. <dt><samp>dia_size <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6742. <dd><p>Set diamond type &amp; size for motion estimation.
  6743. </p><dl compact="compact">
  6744. <dt>&lsquo;<samp>(1024, INT_MAX)</samp>&rsquo;</dt>
  6745. <dd><p>full motion estimation(slowest)
  6746. </p></dd>
  6747. <dt>&lsquo;<samp>(768, 1024]</samp>&rsquo;</dt>
  6748. <dd><p>umh motion estimation
  6749. </p></dd>
  6750. <dt>&lsquo;<samp>(512, 768]</samp>&rsquo;</dt>
  6751. <dd><p>hex motion estimation
  6752. </p></dd>
  6753. <dt>&lsquo;<samp>(256, 512]</samp>&rsquo;</dt>
  6754. <dd><p>l2s diamond motion estimation
  6755. </p></dd>
  6756. <dt>&lsquo;<samp>[2,256]</samp>&rsquo;</dt>
  6757. <dd><p>var diamond motion estimation
  6758. </p></dd>
  6759. <dt>&lsquo;<samp>(-1, 2)</samp>&rsquo;</dt>
  6760. <dd><p>small diamond motion estimation
  6761. </p></dd>
  6762. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  6763. <dd><p>funny diamond motion estimation
  6764. </p></dd>
  6765. <dt>&lsquo;<samp>(INT_MIN, -1)</samp>&rsquo;</dt>
  6766. <dd><p>sab diamond motion estimation
  6767. </p></dd>
  6768. </dl>
  6769. </dd>
  6770. <dt><samp>last_pred <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6771. <dd><p>Set amount of motion predictors from the previous frame.
  6772. </p>
  6773. </dd>
  6774. <dt><samp>preme <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6775. <dd><p>Set pre motion estimation.
  6776. </p>
  6777. </dd>
  6778. <dt><samp>precmp <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6779. <dd><p>Set pre motion estimation compare function.
  6780. </p>
  6781. <p>Possible values:
  6782. </p><dl compact="compact">
  6783. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6784. <dd><p>sum of absolute differences, fast (default)
  6785. </p></dd>
  6786. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6787. <dd><p>sum of squared errors
  6788. </p></dd>
  6789. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6790. <dd><p>sum of absolute Hadamard transformed differences
  6791. </p></dd>
  6792. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6793. <dd><p>sum of absolute DCT transformed differences
  6794. </p></dd>
  6795. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6796. <dd><p>sum of squared quantization errors (avoid, low quality)
  6797. </p></dd>
  6798. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6799. <dd><p>number of bits needed for the block
  6800. </p></dd>
  6801. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6802. <dd><p>rate distortion optimal, slow
  6803. </p></dd>
  6804. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6805. <dd><p>0
  6806. </p></dd>
  6807. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6808. <dd><p>sum of absolute vertical differences
  6809. </p></dd>
  6810. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6811. <dd><p>sum of squared vertical differences
  6812. </p></dd>
  6813. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6814. <dd><p>noise preserving sum of squared differences
  6815. </p></dd>
  6816. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6817. <dd><p>5/3 wavelet, only used in snow
  6818. </p></dd>
  6819. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6820. <dd><p>9/7 wavelet, only used in snow
  6821. </p></dd>
  6822. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6823. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6824. </dl>
  6825. </dd>
  6826. <dt><samp>pre_dia_size <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6827. <dd><p>Set diamond type &amp; size for motion estimation pre-pass.
  6828. </p>
  6829. </dd>
  6830. <dt><samp>subq <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6831. <dd><p>Set sub pel motion estimation quality.
  6832. </p>
  6833. </dd>
  6834. <dt><samp>me_range <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6835. <dd><p>Set limit motion vectors range (1023 for DivX player).
  6836. </p>
  6837. </dd>
  6838. <dt><samp>global_quality <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
  6839. <dt><samp>coder <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6840. <dd>
  6841. <p>Possible values:
  6842. </p><dl compact="compact">
  6843. <dt>&lsquo;<samp>vlc</samp>&rsquo;</dt>
  6844. <dd><p>variable length coder / huffman coder
  6845. </p></dd>
  6846. <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
  6847. <dd><p>arithmetic coder
  6848. </p></dd>
  6849. <dt>&lsquo;<samp>raw</samp>&rsquo;</dt>
  6850. <dd><p>raw (no encoding)
  6851. </p></dd>
  6852. <dt>&lsquo;<samp>rle</samp>&rsquo;</dt>
  6853. <dd><p>run-length coder
  6854. </p></dd>
  6855. </dl>
  6856. </dd>
  6857. <dt><samp>context <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6858. <dd><p>Set context model.
  6859. </p>
  6860. </dd>
  6861. <dt><samp>slice_flags <var>integer</var></samp></dt>
  6862. <dt><samp>mbd <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6863. <dd><p>Set macroblock decision algorithm (high quality mode).
  6864. </p>
  6865. <p>Possible values:
  6866. </p><dl compact="compact">
  6867. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  6868. <dd><p>use mbcmp (default)
  6869. </p></dd>
  6870. <dt>&lsquo;<samp>bits</samp>&rsquo;</dt>
  6871. <dd><p>use fewest bits
  6872. </p></dd>
  6873. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6874. <dd><p>use best rate distortion
  6875. </p></dd>
  6876. </dl>
  6877. </dd>
  6878. <dt><samp>sc_threshold <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6879. <dd><p>Set scene change threshold.
  6880. </p>
  6881. </dd>
  6882. <dt><samp>nr <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6883. <dd><p>Set noise reduction.
  6884. </p>
  6885. </dd>
  6886. <dt><samp>rc_init_occupancy <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6887. <dd><p>Set number of bits which should be loaded into the rc buffer before
  6888. decoding starts.
  6889. </p>
  6890. </dd>
  6891. <dt><samp>flags2 <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  6892. <dd>
  6893. <p>Possible values:
  6894. </p><dl compact="compact">
  6895. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  6896. <dd><p>Allow non spec compliant speedup tricks.
  6897. </p></dd>
  6898. <dt>&lsquo;<samp>noout</samp>&rsquo;</dt>
  6899. <dd><p>Skip bitstream encoding.
  6900. </p></dd>
  6901. <dt>&lsquo;<samp>ignorecrop</samp>&rsquo;</dt>
  6902. <dd><p>Ignore cropping information from sps.
  6903. </p></dd>
  6904. <dt>&lsquo;<samp>local_header</samp>&rsquo;</dt>
  6905. <dd><p>Place global headers at every keyframe instead of in extradata.
  6906. </p></dd>
  6907. <dt>&lsquo;<samp>chunks</samp>&rsquo;</dt>
  6908. <dd><p>Frame data might be split into multiple chunks.
  6909. </p></dd>
  6910. <dt>&lsquo;<samp>showall</samp>&rsquo;</dt>
  6911. <dd><p>Show all frames before the first keyframe.
  6912. </p></dd>
  6913. <dt>&lsquo;<samp>export_mvs</samp>&rsquo;</dt>
  6914. <dd><p>Export motion vectors into frame side-data (see <code>AV_FRAME_DATA_MOTION_VECTORS</code>)
  6915. for codecs that support it. See also <samp>doc/examples/export_mvs.c</samp>.
  6916. </p></dd>
  6917. <dt>&lsquo;<samp>skip_manual</samp>&rsquo;</dt>
  6918. <dd><p>Do not skip samples and export skip information as frame side data.
  6919. </p></dd>
  6920. <dt>&lsquo;<samp>ass_ro_flush_noop</samp>&rsquo;</dt>
  6921. <dd><p>Do not reset ASS ReadOrder field on flush.
  6922. </p></dd>
  6923. </dl>
  6924. </dd>
  6925. <dt><samp>export_side_data <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp></dt>
  6926. <dd>
  6927. <p>Possible values:
  6928. </p><dl compact="compact">
  6929. <dt>&lsquo;<samp>mvs</samp>&rsquo;</dt>
  6930. <dd><p>Export motion vectors into frame side-data (see <code>AV_FRAME_DATA_MOTION_VECTORS</code>)
  6931. for codecs that support it. See also <samp>doc/examples/export_mvs.c</samp>.
  6932. </p></dd>
  6933. <dt>&lsquo;<samp>prft</samp>&rsquo;</dt>
  6934. <dd><p>Export encoder Producer Reference Time into packet side-data (see <code>AV_PKT_DATA_PRFT</code>)
  6935. for codecs that support it.
  6936. </p></dd>
  6937. <dt>&lsquo;<samp>venc_params</samp>&rsquo;</dt>
  6938. <dd><p>Export video encoding parameters through frame side data (see <code>AV_FRAME_DATA_VIDEO_ENC_PARAMS</code>)
  6939. for codecs that support it. At present, those are H.264 and VP9.
  6940. </p></dd>
  6941. <dt>&lsquo;<samp>film_grain</samp>&rsquo;</dt>
  6942. <dd><p>Export film grain parameters through frame side data (see <code>AV_FRAME_DATA_FILM_GRAIN_PARAMS</code>).
  6943. Supported at present by AV1 decoders.
  6944. </p></dd>
  6945. </dl>
  6946. </dd>
  6947. <dt><samp>threads <var>integer</var> (<em>decoding/encoding,video</em>)</samp></dt>
  6948. <dd><p>Set the number of threads to be used, in case the selected codec
  6949. implementation supports multi-threading.
  6950. </p>
  6951. <p>Possible values:
  6952. </p><dl compact="compact">
  6953. <dt>&lsquo;<samp>auto, 0</samp>&rsquo;</dt>
  6954. <dd><p>automatically select the number of threads to set
  6955. </p></dd>
  6956. </dl>
  6957. <p>Default value is &lsquo;<samp>auto</samp>&rsquo;.
  6958. </p>
  6959. </dd>
  6960. <dt><samp>dc <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6961. <dd><p>Set intra_dc_precision.
  6962. </p>
  6963. </dd>
  6964. <dt><samp>nssew <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6965. <dd><p>Set nsse weight.
  6966. </p>
  6967. </dd>
  6968. <dt><samp>skip_top <var>integer</var> (<em>decoding,video</em>)</samp></dt>
  6969. <dd><p>Set number of macroblock rows at the top which are skipped.
  6970. </p>
  6971. </dd>
  6972. <dt><samp>skip_bottom <var>integer</var> (<em>decoding,video</em>)</samp></dt>
  6973. <dd><p>Set number of macroblock rows at the bottom which are skipped.
  6974. </p>
  6975. </dd>
  6976. <dt><samp>profile <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
  6977. <dd>
  6978. <p>Set encoder codec profile. Default value is &lsquo;<samp>unknown</samp>&rsquo;. Encoder specific
  6979. profiles are documented in the relevant encoder documentation.
  6980. </p>
  6981. </dd>
  6982. <dt><samp>level <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
  6983. <dd>
  6984. <p>Possible values:
  6985. </p><dl compact="compact">
  6986. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  6987. </dl>
  6988. </dd>
  6989. <dt><samp>lowres <var>integer</var> (<em>decoding,audio,video</em>)</samp></dt>
  6990. <dd><p>Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
  6991. </p>
  6992. </dd>
  6993. <dt><samp>skip_threshold <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6994. <dd><p>Set frame skip threshold.
  6995. </p>
  6996. </dd>
  6997. <dt><samp>skip_factor <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  6998. <dd><p>Set frame skip factor.
  6999. </p>
  7000. </dd>
  7001. <dt><samp>skip_exp <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  7002. <dd><p>Set frame skip exponent.
  7003. Negative values behave identical to the corresponding positive ones, except
  7004. that the score is normalized.
  7005. Positive values exist primarily for compatibility reasons and are not so useful.
  7006. </p>
  7007. </dd>
  7008. <dt><samp>skipcmp <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  7009. <dd><p>Set frame skip compare function.
  7010. </p>
  7011. <p>Possible values:
  7012. </p><dl compact="compact">
  7013. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  7014. <dd><p>sum of absolute differences, fast (default)
  7015. </p></dd>
  7016. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  7017. <dd><p>sum of squared errors
  7018. </p></dd>
  7019. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  7020. <dd><p>sum of absolute Hadamard transformed differences
  7021. </p></dd>
  7022. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  7023. <dd><p>sum of absolute DCT transformed differences
  7024. </p></dd>
  7025. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  7026. <dd><p>sum of squared quantization errors (avoid, low quality)
  7027. </p></dd>
  7028. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  7029. <dd><p>number of bits needed for the block
  7030. </p></dd>
  7031. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  7032. <dd><p>rate distortion optimal, slow
  7033. </p></dd>
  7034. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  7035. <dd><p>0
  7036. </p></dd>
  7037. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  7038. <dd><p>sum of absolute vertical differences
  7039. </p></dd>
  7040. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  7041. <dd><p>sum of squared vertical differences
  7042. </p></dd>
  7043. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  7044. <dd><p>noise preserving sum of squared differences
  7045. </p></dd>
  7046. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  7047. <dd><p>5/3 wavelet, only used in snow
  7048. </p></dd>
  7049. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  7050. <dd><p>9/7 wavelet, only used in snow
  7051. </p></dd>
  7052. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  7053. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  7054. </dl>
  7055. </dd>
  7056. <dt><samp>mblmin <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  7057. <dd><p>Set min macroblock lagrange factor (VBR).
  7058. </p>
  7059. </dd>
  7060. <dt><samp>mblmax <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  7061. <dd><p>Set max macroblock lagrange factor (VBR).
  7062. </p>
  7063. </dd>
  7064. <dt><samp>mepc <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  7065. <dd><p>Set motion estimation bitrate penalty compensation (1.0 = 256).
  7066. </p>
  7067. </dd>
  7068. <dt><samp>skip_loop_filter <var>integer</var> (<em>decoding,video</em>)</samp></dt>
  7069. <dt><samp>skip_idct <var>integer</var> (<em>decoding,video</em>)</samp></dt>
  7070. <dt><samp>skip_frame <var>integer</var> (<em>decoding,video</em>)</samp></dt>
  7071. <dd>
  7072. <p>Make decoder discard processing depending on the frame type selected
  7073. by the option value.
  7074. </p>
  7075. <p><samp>skip_loop_filter</samp> skips frame loop filtering, <samp>skip_idct</samp>
  7076. skips frame IDCT/dequantization, <samp>skip_frame</samp> skips decoding.
  7077. </p>
  7078. <p>Possible values:
  7079. </p><dl compact="compact">
  7080. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  7081. <dd><p>Discard no frame.
  7082. </p>
  7083. </dd>
  7084. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  7085. <dd><p>Discard useless frames like 0-sized frames.
  7086. </p>
  7087. </dd>
  7088. <dt>&lsquo;<samp>noref</samp>&rsquo;</dt>
  7089. <dd><p>Discard all non-reference frames.
  7090. </p>
  7091. </dd>
  7092. <dt>&lsquo;<samp>bidir</samp>&rsquo;</dt>
  7093. <dd><p>Discard all bidirectional frames.
  7094. </p>
  7095. </dd>
  7096. <dt>&lsquo;<samp>nokey</samp>&rsquo;</dt>
  7097. <dd><p>Discard all frames excepts keyframes.
  7098. </p>
  7099. </dd>
  7100. <dt>&lsquo;<samp>nointra</samp>&rsquo;</dt>
  7101. <dd><p>Discard all frames except I frames.
  7102. </p>
  7103. </dd>
  7104. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  7105. <dd><p>Discard all frames.
  7106. </p></dd>
  7107. </dl>
  7108. <p>Default value is &lsquo;<samp>default</samp>&rsquo;.
  7109. </p>
  7110. </dd>
  7111. <dt><samp>bidir_refine <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  7112. <dd><p>Refine the two motion vectors used in bidirectional macroblocks.
  7113. </p>
  7114. </dd>
  7115. <dt><samp>brd_scale <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  7116. <dd><p>Downscale frames for dynamic B-frame decision.
  7117. </p>
  7118. </dd>
  7119. <dt><samp>keyint_min <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  7120. <dd><p>Set minimum interval between IDR-frames.
  7121. </p>
  7122. </dd>
  7123. <dt><samp>refs <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  7124. <dd><p>Set reference frames to consider for motion compensation.
  7125. </p>
  7126. </dd>
  7127. <dt><samp>chromaoffset <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  7128. <dd><p>Set chroma qp offset from luma.
  7129. </p>
  7130. </dd>
  7131. <dt><samp>trellis <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
  7132. <dd><p>Set rate-distortion optimal quantization.
  7133. </p>
  7134. </dd>
  7135. <dt><samp>mv0_threshold <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  7136. <dt><samp>b_sensitivity <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  7137. <dd><p>Adjust sensitivity of b_frame_strategy 1.
  7138. </p>
  7139. </dd>
  7140. <dt><samp>compression_level <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
  7141. <dt><samp>min_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp></dt>
  7142. <dt><samp>max_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp></dt>
  7143. <dt><samp>timecode_frame_start <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  7144. <dd><p>Set GOP timecode frame start number, in non drop frame format.
  7145. </p>
  7146. </dd>
  7147. <dt><samp>bits_per_raw_sample <var>integer</var></samp></dt>
  7148. <dt><samp>channel_layout <var>integer</var> (<em>decoding/encoding,audio</em>)</samp></dt>
  7149. <dd>
  7150. <p>Possible values:
  7151. </p></dd>
  7152. <dt><samp>request_channel_layout <var>integer</var> (<em>decoding,audio</em>)</samp></dt>
  7153. <dd>
  7154. <p>Possible values:
  7155. </p></dd>
  7156. <dt><samp>rc_max_vbv_use <var>float</var> (<em>encoding,video</em>)</samp></dt>
  7157. <dt><samp>rc_min_vbv_use <var>float</var> (<em>encoding,video</em>)</samp></dt>
  7158. <dt><samp>ticks_per_frame <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp></dt>
  7159. <dt><samp>color_primaries <var>integer</var> (<em>decoding/encoding,video</em>)</samp></dt>
  7160. <dd><p>Possible values:
  7161. </p><dl compact="compact">
  7162. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  7163. <dd><p>BT.709
  7164. </p></dd>
  7165. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  7166. <dd><p>BT.470 M
  7167. </p></dd>
  7168. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  7169. <dd><p>BT.470 BG
  7170. </p></dd>
  7171. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  7172. <dd><p>SMPTE 170 M
  7173. </p></dd>
  7174. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  7175. <dd><p>SMPTE 240 M
  7176. </p></dd>
  7177. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  7178. <dd><p>Film
  7179. </p></dd>
  7180. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  7181. <dd><p>BT.2020
  7182. </p></dd>
  7183. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  7184. <dt>&lsquo;<samp>smpte428_1</samp>&rsquo;</dt>
  7185. <dd><p>SMPTE ST 428-1
  7186. </p></dd>
  7187. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  7188. <dd><p>SMPTE 431-2
  7189. </p></dd>
  7190. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  7191. <dd><p>SMPTE 432-1
  7192. </p></dd>
  7193. <dt>&lsquo;<samp>jedec-p22</samp>&rsquo;</dt>
  7194. <dd><p>JEDEC P22
  7195. </p></dd>
  7196. </dl>
  7197. </dd>
  7198. <dt><samp>color_trc <var>integer</var> (<em>decoding/encoding,video</em>)</samp></dt>
  7199. <dd><p>Possible values:
  7200. </p><dl compact="compact">
  7201. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  7202. <dd><p>BT.709
  7203. </p></dd>
  7204. <dt>&lsquo;<samp>gamma22</samp>&rsquo;</dt>
  7205. <dd><p>BT.470 M
  7206. </p></dd>
  7207. <dt>&lsquo;<samp>gamma28</samp>&rsquo;</dt>
  7208. <dd><p>BT.470 BG
  7209. </p></dd>
  7210. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  7211. <dd><p>SMPTE 170 M
  7212. </p></dd>
  7213. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  7214. <dd><p>SMPTE 240 M
  7215. </p></dd>
  7216. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  7217. <dd><p>Linear
  7218. </p></dd>
  7219. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  7220. <dt>&lsquo;<samp>log100</samp>&rsquo;</dt>
  7221. <dd><p>Log
  7222. </p></dd>
  7223. <dt>&lsquo;<samp>log_sqrt</samp>&rsquo;</dt>
  7224. <dt>&lsquo;<samp>log316</samp>&rsquo;</dt>
  7225. <dd><p>Log square root
  7226. </p></dd>
  7227. <dt>&lsquo;<samp>iec61966_2_4</samp>&rsquo;</dt>
  7228. <dt>&lsquo;<samp>iec61966-2-4</samp>&rsquo;</dt>
  7229. <dd><p>IEC 61966-2-4
  7230. </p></dd>
  7231. <dt>&lsquo;<samp>bt1361</samp>&rsquo;</dt>
  7232. <dt>&lsquo;<samp>bt1361e</samp>&rsquo;</dt>
  7233. <dd><p>BT.1361
  7234. </p></dd>
  7235. <dt>&lsquo;<samp>iec61966_2_1</samp>&rsquo;</dt>
  7236. <dt>&lsquo;<samp>iec61966-2-1</samp>&rsquo;</dt>
  7237. <dd><p>IEC 61966-2-1
  7238. </p></dd>
  7239. <dt>&lsquo;<samp>bt2020_10</samp>&rsquo;</dt>
  7240. <dt>&lsquo;<samp>bt2020_10bit</samp>&rsquo;</dt>
  7241. <dd><p>BT.2020 - 10 bit
  7242. </p></dd>
  7243. <dt>&lsquo;<samp>bt2020_12</samp>&rsquo;</dt>
  7244. <dt>&lsquo;<samp>bt2020_12bit</samp>&rsquo;</dt>
  7245. <dd><p>BT.2020 - 12 bit
  7246. </p></dd>
  7247. <dt>&lsquo;<samp>smpte2084</samp>&rsquo;</dt>
  7248. <dd><p>SMPTE ST 2084
  7249. </p></dd>
  7250. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  7251. <dt>&lsquo;<samp>smpte428_1</samp>&rsquo;</dt>
  7252. <dd><p>SMPTE ST 428-1
  7253. </p></dd>
  7254. <dt>&lsquo;<samp>arib-std-b67</samp>&rsquo;</dt>
  7255. <dd><p>ARIB STD-B67
  7256. </p></dd>
  7257. </dl>
  7258. </dd>
  7259. <dt><samp>colorspace <var>integer</var> (<em>decoding/encoding,video</em>)</samp></dt>
  7260. <dd><p>Possible values:
  7261. </p><dl compact="compact">
  7262. <dt>&lsquo;<samp>rgb</samp>&rsquo;</dt>
  7263. <dd><p>RGB
  7264. </p></dd>
  7265. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  7266. <dd><p>BT.709
  7267. </p></dd>
  7268. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  7269. <dd><p>FCC
  7270. </p></dd>
  7271. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  7272. <dd><p>BT.470 BG
  7273. </p></dd>
  7274. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  7275. <dd><p>SMPTE 170 M
  7276. </p></dd>
  7277. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  7278. <dd><p>SMPTE 240 M
  7279. </p></dd>
  7280. <dt>&lsquo;<samp>ycocg</samp>&rsquo;</dt>
  7281. <dd><p>YCOCG
  7282. </p></dd>
  7283. <dt>&lsquo;<samp>bt2020nc</samp>&rsquo;</dt>
  7284. <dt>&lsquo;<samp>bt2020_ncl</samp>&rsquo;</dt>
  7285. <dd><p>BT.2020 NCL
  7286. </p></dd>
  7287. <dt>&lsquo;<samp>bt2020c</samp>&rsquo;</dt>
  7288. <dt>&lsquo;<samp>bt2020_cl</samp>&rsquo;</dt>
  7289. <dd><p>BT.2020 CL
  7290. </p></dd>
  7291. <dt>&lsquo;<samp>smpte2085</samp>&rsquo;</dt>
  7292. <dd><p>SMPTE 2085
  7293. </p></dd>
  7294. <dt>&lsquo;<samp>chroma-derived-nc</samp>&rsquo;</dt>
  7295. <dd><p>Chroma-derived NCL
  7296. </p></dd>
  7297. <dt>&lsquo;<samp>chroma-derived-c</samp>&rsquo;</dt>
  7298. <dd><p>Chroma-derived CL
  7299. </p></dd>
  7300. <dt>&lsquo;<samp>ictcp</samp>&rsquo;</dt>
  7301. <dd><p>ICtCp
  7302. </p></dd>
  7303. </dl>
  7304. </dd>
  7305. <dt><samp>color_range <var>integer</var> (<em>decoding/encoding,video</em>)</samp></dt>
  7306. <dd><p>If used as input parameter, it serves as a hint to the decoder, which
  7307. color_range the input has.
  7308. Possible values:
  7309. </p><dl compact="compact">
  7310. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  7311. <dt>&lsquo;<samp>mpeg</samp>&rsquo;</dt>
  7312. <dd><p>MPEG (219*2^(n-8))
  7313. </p></dd>
  7314. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  7315. <dt>&lsquo;<samp>jpeg</samp>&rsquo;</dt>
  7316. <dd><p>JPEG (2^n-1)
  7317. </p></dd>
  7318. </dl>
  7319. </dd>
  7320. <dt><samp>chroma_sample_location <var>integer</var> (<em>decoding/encoding,video</em>)</samp></dt>
  7321. <dd><p>Possible values:
  7322. </p><dl compact="compact">
  7323. <dt>&lsquo;<samp>left</samp>&rsquo;</dt>
  7324. <dt>&lsquo;<samp>center</samp>&rsquo;</dt>
  7325. <dt>&lsquo;<samp>topleft</samp>&rsquo;</dt>
  7326. <dt>&lsquo;<samp>top</samp>&rsquo;</dt>
  7327. <dt>&lsquo;<samp>bottomleft</samp>&rsquo;</dt>
  7328. <dt>&lsquo;<samp>bottom</samp>&rsquo;</dt>
  7329. </dl>
  7330. </dd>
  7331. <dt><samp>log_level_offset <var>integer</var></samp></dt>
  7332. <dd><p>Set the log level offset.
  7333. </p>
  7334. </dd>
  7335. <dt><samp>slices <var>integer</var> (<em>encoding,video</em>)</samp></dt>
  7336. <dd><p>Number of slices, used in parallelized encoding.
  7337. </p>
  7338. </dd>
  7339. <dt><samp>thread_type <var>flags</var> (<em>decoding/encoding,video</em>)</samp></dt>
  7340. <dd><p>Select which multithreading methods to use.
  7341. </p>
  7342. <p>Use of &lsquo;<samp>frame</samp>&rsquo; will increase decoding delay by one frame per
  7343. thread, so clients which cannot provide future frames should not use
  7344. it.
  7345. </p>
  7346. <p>Possible values:
  7347. </p><dl compact="compact">
  7348. <dt>&lsquo;<samp>slice</samp>&rsquo;</dt>
  7349. <dd><p>Decode more than one part of a single frame at once.
  7350. </p>
  7351. <p>Multithreading using slices works only when the video was encoded with
  7352. slices.
  7353. </p>
  7354. </dd>
  7355. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  7356. <dd><p>Decode more than one frame at once.
  7357. </p></dd>
  7358. </dl>
  7359. <p>Default value is &lsquo;<samp>slice+frame</samp>&rsquo;.
  7360. </p>
  7361. </dd>
  7362. <dt><samp>audio_service_type <var>integer</var> (<em>encoding,audio</em>)</samp></dt>
  7363. <dd><p>Set audio service type.
  7364. </p>
  7365. <p>Possible values:
  7366. </p><dl compact="compact">
  7367. <dt>&lsquo;<samp>ma</samp>&rsquo;</dt>
  7368. <dd><p>Main Audio Service
  7369. </p></dd>
  7370. <dt>&lsquo;<samp>ef</samp>&rsquo;</dt>
  7371. <dd><p>Effects
  7372. </p></dd>
  7373. <dt>&lsquo;<samp>vi</samp>&rsquo;</dt>
  7374. <dd><p>Visually Impaired
  7375. </p></dd>
  7376. <dt>&lsquo;<samp>hi</samp>&rsquo;</dt>
  7377. <dd><p>Hearing Impaired
  7378. </p></dd>
  7379. <dt>&lsquo;<samp>di</samp>&rsquo;</dt>
  7380. <dd><p>Dialogue
  7381. </p></dd>
  7382. <dt>&lsquo;<samp>co</samp>&rsquo;</dt>
  7383. <dd><p>Commentary
  7384. </p></dd>
  7385. <dt>&lsquo;<samp>em</samp>&rsquo;</dt>
  7386. <dd><p>Emergency
  7387. </p></dd>
  7388. <dt>&lsquo;<samp>vo</samp>&rsquo;</dt>
  7389. <dd><p>Voice Over
  7390. </p></dd>
  7391. <dt>&lsquo;<samp>ka</samp>&rsquo;</dt>
  7392. <dd><p>Karaoke
  7393. </p></dd>
  7394. </dl>
  7395. </dd>
  7396. <dt><samp>request_sample_fmt <var>sample_fmt</var> (<em>decoding,audio</em>)</samp></dt>
  7397. <dd><p>Set sample format audio decoders should prefer. Default value is
  7398. <code>none</code>.
  7399. </p>
  7400. </dd>
  7401. <dt><samp>pkt_timebase <var>rational number</var></samp></dt>
  7402. <dt><samp>sub_charenc <var>encoding</var> (<em>decoding,subtitles</em>)</samp></dt>
  7403. <dd><p>Set the input subtitles character encoding.
  7404. </p>
  7405. </dd>
  7406. <dt><samp>field_order <var>field_order</var> (<em>video</em>)</samp></dt>
  7407. <dd><p>Set/override the field order of the video.
  7408. Possible values:
  7409. </p><dl compact="compact">
  7410. <dt>&lsquo;<samp>progressive</samp>&rsquo;</dt>
  7411. <dd><p>Progressive video
  7412. </p></dd>
  7413. <dt>&lsquo;<samp>tt</samp>&rsquo;</dt>
  7414. <dd><p>Interlaced video, top field coded and displayed first
  7415. </p></dd>
  7416. <dt>&lsquo;<samp>bb</samp>&rsquo;</dt>
  7417. <dd><p>Interlaced video, bottom field coded and displayed first
  7418. </p></dd>
  7419. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  7420. <dd><p>Interlaced video, top coded first, bottom displayed first
  7421. </p></dd>
  7422. <dt>&lsquo;<samp>bt</samp>&rsquo;</dt>
  7423. <dd><p>Interlaced video, bottom coded first, top displayed first
  7424. </p></dd>
  7425. </dl>
  7426. </dd>
  7427. <dt><samp>skip_alpha <var>bool</var> (<em>decoding,video</em>)</samp></dt>
  7428. <dd><p>Set to 1 to disable processing alpha (transparency). This works like the
  7429. &lsquo;<samp>gray</samp>&rsquo; flag in the <samp>flags</samp> option which skips chroma information
  7430. instead of alpha. Default is 0.
  7431. </p>
  7432. </dd>
  7433. <dt><samp>codec_whitelist <var>list</var> (<em>input</em>)</samp></dt>
  7434. <dd><p>&quot;,&quot; separated list of allowed decoders. By default all are allowed.
  7435. </p>
  7436. </dd>
  7437. <dt><samp>dump_separator <var>string</var> (<em>input</em>)</samp></dt>
  7438. <dd><p>Separator used to separate the fields printed on the command line about the
  7439. Stream parameters.
  7440. For example, to separate the fields with newlines and indentation:
  7441. </p><div class="example">
  7442. <pre class="example">ffprobe -dump_separator &quot;
  7443. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  7444. </pre></div>
  7445. </dd>
  7446. <dt><samp>max_pixels <var>integer</var> (<em>decoding/encoding,video</em>)</samp></dt>
  7447. <dd><p>Maximum number of pixels per image. This value can be used to avoid out of
  7448. memory failures due to large images.
  7449. </p>
  7450. </dd>
  7451. <dt><samp>apply_cropping <var>bool</var> (<em>decoding,video</em>)</samp></dt>
  7452. <dd><p>Enable cropping if cropping parameters are multiples of the required
  7453. alignment for the left and top parameters. If the alignment is not met the
  7454. cropping will be partially applied to maintain alignment.
  7455. Default is 1 (enabled).
  7456. Note: The required alignment depends on if <code>AV_CODEC_FLAG_UNALIGNED</code> is set and the
  7457. CPU. <code>AV_CODEC_FLAG_UNALIGNED</code> cannot be changed from the command line. Also hardware
  7458. decoders will not apply left/top Cropping.
  7459. </p>
  7460. </dd>
  7461. </dl>
  7462. <a name="Decoders"></a>
  7463. <h2 class="chapter">10 Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Decoders" aria-hidden="true">TOC</a></span></h2>
  7464. <p>Decoders are configured elements in FFmpeg which allow the decoding of
  7465. multimedia streams.
  7466. </p>
  7467. <p>When you configure your FFmpeg build, all the supported native decoders
  7468. are enabled by default. Decoders requiring an external library must be enabled
  7469. manually via the corresponding <code>--enable-lib</code> option. You can list all
  7470. available decoders using the configure option <code>--list-decoders</code>.
  7471. </p>
  7472. <p>You can disable all the decoders with the configure option
  7473. <code>--disable-decoders</code> and selectively enable / disable single decoders
  7474. with the options <code>--enable-decoder=<var>DECODER</var></code> /
  7475. <code>--disable-decoder=<var>DECODER</var></code>.
  7476. </p>
  7477. <p>The option <code>-decoders</code> of the ff* tools will display the list of
  7478. enabled decoders.
  7479. </p>
  7480. <a name="Video-Decoders"></a>
  7481. <h2 class="chapter">11 Video Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Decoders" aria-hidden="true">TOC</a></span></h2>
  7482. <p>A description of some of the currently available video decoders
  7483. follows.
  7484. </p>
  7485. <a name="av1"></a>
  7486. <h3 class="section">11.1 av1<span class="pull-right"><a class="anchor hidden-xs" href="#av1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-av1" aria-hidden="true">TOC</a></span></h3>
  7487. <p>AOMedia Video 1 (AV1) decoder.
  7488. </p>
  7489. <a name="Options-1"></a>
  7490. <h4 class="subsection">11.1.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-1" aria-hidden="true">TOC</a></span></h4>
  7491. <dl compact="compact">
  7492. <dt><samp>operating_point</samp></dt>
  7493. <dd><p>Select an operating point of a scalable AV1 bitstream (0 - 31). Default is 0.
  7494. </p>
  7495. </dd>
  7496. </dl>
  7497. <a name="rawvideo"></a>
  7498. <h3 class="section">11.2 rawvideo<span class="pull-right"><a class="anchor hidden-xs" href="#rawvideo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rawvideo" aria-hidden="true">TOC</a></span></h3>
  7499. <p>Raw video decoder.
  7500. </p>
  7501. <p>This decoder decodes rawvideo streams.
  7502. </p>
  7503. <a name="Options-2"></a>
  7504. <h4 class="subsection">11.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-2" aria-hidden="true">TOC</a></span></h4>
  7505. <dl compact="compact">
  7506. <dt><samp>top <var>top_field_first</var></samp></dt>
  7507. <dd><p>Specify the assumed field type of the input video.
  7508. </p><dl compact="compact">
  7509. <dt><samp>-1</samp></dt>
  7510. <dd><p>the video is assumed to be progressive (default)
  7511. </p></dd>
  7512. <dt><samp>0</samp></dt>
  7513. <dd><p>bottom-field-first is assumed
  7514. </p></dd>
  7515. <dt><samp>1</samp></dt>
  7516. <dd><p>top-field-first is assumed
  7517. </p></dd>
  7518. </dl>
  7519. </dd>
  7520. </dl>
  7521. <a name="libdav1d"></a>
  7522. <h3 class="section">11.3 libdav1d<span class="pull-right"><a class="anchor hidden-xs" href="#libdav1d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libdav1d" aria-hidden="true">TOC</a></span></h3>
  7523. <p>dav1d AV1 decoder.
  7524. </p>
  7525. <p>libdav1d allows libavcodec to decode the AOMedia Video 1 (AV1) codec.
  7526. Requires the presence of the libdav1d headers and library during configuration.
  7527. You need to explicitly configure the build with <code>--enable-libdav1d</code>.
  7528. </p>
  7529. <a name="Options-3"></a>
  7530. <h4 class="subsection">11.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-3" aria-hidden="true">TOC</a></span></h4>
  7531. <p>The following options are supported by the libdav1d wrapper.
  7532. </p>
  7533. <dl compact="compact">
  7534. <dt><samp>framethreads</samp></dt>
  7535. <dd><p>Set amount of frame threads to use during decoding. The default value is 0 (autodetect).
  7536. </p>
  7537. </dd>
  7538. <dt><samp>tilethreads</samp></dt>
  7539. <dd><p>Set amount of tile threads to use during decoding. The default value is 0 (autodetect).
  7540. </p>
  7541. </dd>
  7542. <dt><samp>filmgrain</samp></dt>
  7543. <dd><p>Apply film grain to the decoded video if present in the bitstream. Defaults to the
  7544. internal default of the library.
  7545. </p>
  7546. </dd>
  7547. <dt><samp>oppoint</samp></dt>
  7548. <dd><p>Select an operating point of a scalable AV1 bitstream (0 - 31). Defaults to the
  7549. internal default of the library.
  7550. </p>
  7551. </dd>
  7552. <dt><samp>alllayers</samp></dt>
  7553. <dd><p>Output all spatial layers of a scalable AV1 bitstream. The default value is false.
  7554. </p>
  7555. </dd>
  7556. </dl>
  7557. <a name="libdavs2"></a>
  7558. <h3 class="section">11.4 libdavs2<span class="pull-right"><a class="anchor hidden-xs" href="#libdavs2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libdavs2" aria-hidden="true">TOC</a></span></h3>
  7559. <p>AVS2-P2/IEEE1857.4 video decoder wrapper.
  7560. </p>
  7561. <p>This decoder allows libavcodec to decode AVS2 streams with davs2 library.
  7562. </p>
  7563. <a name="libuavs3d"></a>
  7564. <h3 class="section">11.5 libuavs3d<span class="pull-right"><a class="anchor hidden-xs" href="#libuavs3d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libuavs3d" aria-hidden="true">TOC</a></span></h3>
  7565. <p>AVS3-P2/IEEE1857.10 video decoder.
  7566. </p>
  7567. <p>libuavs3d allows libavcodec to decode AVS3 streams.
  7568. Requires the presence of the libuavs3d headers and library during configuration.
  7569. You need to explicitly configure the build with <code>--enable-libuavs3d</code>.
  7570. </p>
  7571. <a name="Options-4"></a>
  7572. <h4 class="subsection">11.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-4" aria-hidden="true">TOC</a></span></h4>
  7573. <p>The following option is supported by the libuavs3d wrapper.
  7574. </p>
  7575. <dl compact="compact">
  7576. <dt><samp>frame_threads</samp></dt>
  7577. <dd><p>Set amount of frame threads to use during decoding. The default value is 0 (autodetect).
  7578. </p>
  7579. </dd>
  7580. </dl>
  7581. <a name="Audio-Decoders"></a>
  7582. <h2 class="chapter">12 Audio Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Decoders" aria-hidden="true">TOC</a></span></h2>
  7583. <p>A description of some of the currently available audio decoders
  7584. follows.
  7585. </p>
  7586. <a name="ac3"></a>
  7587. <h3 class="section">12.1 ac3<span class="pull-right"><a class="anchor hidden-xs" href="#ac3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ac3" aria-hidden="true">TOC</a></span></h3>
  7588. <p>AC-3 audio decoder.
  7589. </p>
  7590. <p>This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  7591. the undocumented RealAudio 3 (a.k.a. dnet).
  7592. </p>
  7593. <a name="AC_002d3-Decoder-Options"></a>
  7594. <h4 class="subsection">12.1.1 AC-3 Decoder Options<span class="pull-right"><a class="anchor hidden-xs" href="#AC_002d3-Decoder-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AC_002d3-Decoder-Options" aria-hidden="true">TOC</a></span></h4>
  7595. <dl compact="compact">
  7596. <dt><samp>-drc_scale <var>value</var></samp></dt>
  7597. <dd><p>Dynamic Range Scale Factor. The factor to apply to dynamic range values
  7598. from the AC-3 stream. This factor is applied exponentially. The default value is 1.
  7599. There are 3 notable scale factor ranges:
  7600. </p><dl compact="compact">
  7601. <dt><samp>drc_scale == 0</samp></dt>
  7602. <dd><p>DRC disabled. Produces full range audio.
  7603. </p></dd>
  7604. <dt><samp>0 &lt; drc_scale &lt;= 1</samp></dt>
  7605. <dd><p>DRC enabled. Applies a fraction of the stream DRC value.
  7606. Audio reproduction is between full range and full compression.
  7607. </p></dd>
  7608. <dt><samp>drc_scale &gt; 1</samp></dt>
  7609. <dd><p>DRC enabled. Applies drc_scale asymmetrically.
  7610. Loud sounds are fully compressed. Soft sounds are enhanced.
  7611. </p></dd>
  7612. </dl>
  7613. </dd>
  7614. </dl>
  7615. <a name="flac-1"></a>
  7616. <h3 class="section">12.2 flac<span class="pull-right"><a class="anchor hidden-xs" href="#flac-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flac-1" aria-hidden="true">TOC</a></span></h3>
  7617. <p>FLAC audio decoder.
  7618. </p>
  7619. <p>This decoder aims to implement the complete FLAC specification from Xiph.
  7620. </p>
  7621. <a name="FLAC-Decoder-options"></a>
  7622. <h4 class="subsection">12.2.1 FLAC Decoder options<span class="pull-right"><a class="anchor hidden-xs" href="#FLAC-Decoder-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-FLAC-Decoder-options" aria-hidden="true">TOC</a></span></h4>
  7623. <dl compact="compact">
  7624. <dt><samp>-use_buggy_lpc</samp></dt>
  7625. <dd><p>The lavc FLAC encoder used to produce buggy streams with high lpc values
  7626. (like the default value). This option makes it possible to decode such streams
  7627. correctly by using lavc&rsquo;s old buggy lpc logic for decoding.
  7628. </p>
  7629. </dd>
  7630. </dl>
  7631. <a name="ffwavesynth"></a>
  7632. <h3 class="section">12.3 ffwavesynth<span class="pull-right"><a class="anchor hidden-xs" href="#ffwavesynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ffwavesynth" aria-hidden="true">TOC</a></span></h3>
  7633. <p>Internal wave synthesizer.
  7634. </p>
  7635. <p>This decoder generates wave patterns according to predefined sequences. Its
  7636. use is purely internal and the format of the data it accepts is not publicly
  7637. documented.
  7638. </p>
  7639. <a name="libcelt"></a>
  7640. <h3 class="section">12.4 libcelt<span class="pull-right"><a class="anchor hidden-xs" href="#libcelt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libcelt" aria-hidden="true">TOC</a></span></h3>
  7641. <p>libcelt decoder wrapper.
  7642. </p>
  7643. <p>libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec.
  7644. Requires the presence of the libcelt headers and library during configuration.
  7645. You need to explicitly configure the build with <code>--enable-libcelt</code>.
  7646. </p>
  7647. <a name="libgsm"></a>
  7648. <h3 class="section">12.5 libgsm<span class="pull-right"><a class="anchor hidden-xs" href="#libgsm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libgsm" aria-hidden="true">TOC</a></span></h3>
  7649. <p>libgsm decoder wrapper.
  7650. </p>
  7651. <p>libgsm allows libavcodec to decode the GSM full rate audio codec. Requires
  7652. the presence of the libgsm headers and library during configuration. You need
  7653. to explicitly configure the build with <code>--enable-libgsm</code>.
  7654. </p>
  7655. <p>This decoder supports both the ordinary GSM and the Microsoft variant.
  7656. </p>
  7657. <a name="libilbc"></a>
  7658. <h3 class="section">12.6 libilbc<span class="pull-right"><a class="anchor hidden-xs" href="#libilbc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libilbc" aria-hidden="true">TOC</a></span></h3>
  7659. <p>libilbc decoder wrapper.
  7660. </p>
  7661. <p>libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC)
  7662. audio codec. Requires the presence of the libilbc headers and library during
  7663. configuration. You need to explicitly configure the build with
  7664. <code>--enable-libilbc</code>.
  7665. </p>
  7666. <a name="Options-5"></a>
  7667. <h4 class="subsection">12.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-5" aria-hidden="true">TOC</a></span></h4>
  7668. <p>The following option is supported by the libilbc wrapper.
  7669. </p>
  7670. <dl compact="compact">
  7671. <dt><samp>enhance</samp></dt>
  7672. <dd>
  7673. <p>Enable the enhancement of the decoded audio when set to 1. The default
  7674. value is 0 (disabled).
  7675. </p>
  7676. </dd>
  7677. </dl>
  7678. <a name="libopencore_002damrnb"></a>
  7679. <h3 class="section">12.7 libopencore-amrnb<span class="pull-right"><a class="anchor hidden-xs" href="#libopencore_002damrnb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopencore_002damrnb" aria-hidden="true">TOC</a></span></h3>
  7680. <p>libopencore-amrnb decoder wrapper.
  7681. </p>
  7682. <p>libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate
  7683. Narrowband audio codec. Using it requires the presence of the
  7684. libopencore-amrnb headers and library during configuration. You need to
  7685. explicitly configure the build with <code>--enable-libopencore-amrnb</code>.
  7686. </p>
  7687. <p>An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
  7688. without this library.
  7689. </p>
  7690. <a name="libopencore_002damrwb"></a>
  7691. <h3 class="section">12.8 libopencore-amrwb<span class="pull-right"><a class="anchor hidden-xs" href="#libopencore_002damrwb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopencore_002damrwb" aria-hidden="true">TOC</a></span></h3>
  7692. <p>libopencore-amrwb decoder wrapper.
  7693. </p>
  7694. <p>libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate
  7695. Wideband audio codec. Using it requires the presence of the
  7696. libopencore-amrwb headers and library during configuration. You need to
  7697. explicitly configure the build with <code>--enable-libopencore-amrwb</code>.
  7698. </p>
  7699. <p>An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
  7700. without this library.
  7701. </p>
  7702. <a name="libopus"></a>
  7703. <h3 class="section">12.9 libopus<span class="pull-right"><a class="anchor hidden-xs" href="#libopus" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopus" aria-hidden="true">TOC</a></span></h3>
  7704. <p>libopus decoder wrapper.
  7705. </p>
  7706. <p>libopus allows libavcodec to decode the Opus Interactive Audio Codec.
  7707. Requires the presence of the libopus headers and library during
  7708. configuration. You need to explicitly configure the build with
  7709. <code>--enable-libopus</code>.
  7710. </p>
  7711. <p>An FFmpeg native decoder for Opus exists, so users can decode Opus
  7712. without this library.
  7713. </p>
  7714. <a name="Subtitles-Decoders"></a>
  7715. <h2 class="chapter">13 Subtitles Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Subtitles-Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Subtitles-Decoders" aria-hidden="true">TOC</a></span></h2>
  7716. <a name="libaribb24"></a>
  7717. <h3 class="section">13.1 libaribb24<span class="pull-right"><a class="anchor hidden-xs" href="#libaribb24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libaribb24" aria-hidden="true">TOC</a></span></h3>
  7718. <p>ARIB STD-B24 caption decoder.
  7719. </p>
  7720. <p>Implements profiles A and C of the ARIB STD-B24 standard.
  7721. </p>
  7722. <a name="libaribb24-Decoder-Options"></a>
  7723. <h4 class="subsection">13.1.1 libaribb24 Decoder Options<span class="pull-right"><a class="anchor hidden-xs" href="#libaribb24-Decoder-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libaribb24-Decoder-Options" aria-hidden="true">TOC</a></span></h4>
  7724. <dl compact="compact">
  7725. <dt><samp>-aribb24-base-path <var>path</var></samp></dt>
  7726. <dd><p>Sets the base path for the libaribb24 library. This is utilized for reading of
  7727. configuration files (for custom unicode conversions), and for dumping of
  7728. non-text symbols as images under that location.
  7729. </p>
  7730. <p>Unset by default.
  7731. </p>
  7732. </dd>
  7733. <dt><samp>-aribb24-skip-ruby-text <var>boolean</var></samp></dt>
  7734. <dd><p>Tells the decoder wrapper to skip text blocks that contain half-height ruby
  7735. text.
  7736. </p>
  7737. <p>Enabled by default.
  7738. </p>
  7739. </dd>
  7740. </dl>
  7741. <a name="dvbsub"></a>
  7742. <h3 class="section">13.2 dvbsub<span class="pull-right"><a class="anchor hidden-xs" href="#dvbsub" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dvbsub" aria-hidden="true">TOC</a></span></h3>
  7743. <a name="Options-6"></a>
  7744. <h4 class="subsection">13.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-6" aria-hidden="true">TOC</a></span></h4>
  7745. <dl compact="compact">
  7746. <dt><samp>compute_clut</samp></dt>
  7747. <dd><dl compact="compact">
  7748. <dt><samp>-1</samp></dt>
  7749. <dd><p>Compute clut if no matching CLUT is in the stream.
  7750. </p></dd>
  7751. <dt><samp>0</samp></dt>
  7752. <dd><p>Never compute CLUT
  7753. </p></dd>
  7754. <dt><samp>1</samp></dt>
  7755. <dd><p>Always compute CLUT and override the one provided in the stream.
  7756. </p></dd>
  7757. </dl>
  7758. </dd>
  7759. <dt><samp>dvb_substream</samp></dt>
  7760. <dd><p>Selects the dvb substream, or all substreams if -1 which is default.
  7761. </p>
  7762. </dd>
  7763. </dl>
  7764. <a name="dvdsub"></a>
  7765. <h3 class="section">13.3 dvdsub<span class="pull-right"><a class="anchor hidden-xs" href="#dvdsub" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dvdsub" aria-hidden="true">TOC</a></span></h3>
  7766. <p>This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
  7767. also be found in VobSub file pairs and in some Matroska files.
  7768. </p>
  7769. <a name="Options-7"></a>
  7770. <h4 class="subsection">13.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-7" aria-hidden="true">TOC</a></span></h4>
  7771. <dl compact="compact">
  7772. <dt><samp>palette</samp></dt>
  7773. <dd><p>Specify the global palette used by the bitmaps. When stored in VobSub, the
  7774. palette is normally specified in the index file; in Matroska, the palette is
  7775. stored in the codec extra-data in the same format as in VobSub. In DVDs, the
  7776. palette is stored in the IFO file, and therefore not available when reading
  7777. from dumped VOB files.
  7778. </p>
  7779. <p>The format for this option is a string containing 16 24-bits hexadecimal
  7780. numbers (without 0x prefix) separated by commas, for example <code>0d00ee,
  7781. ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
  7782. 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
  7783. </p>
  7784. </dd>
  7785. <dt><samp>ifo_palette</samp></dt>
  7786. <dd><p>Specify the IFO file from which the global palette is obtained.
  7787. (experimental)
  7788. </p>
  7789. </dd>
  7790. <dt><samp>forced_subs_only</samp></dt>
  7791. <dd><p>Only decode subtitle entries marked as forced. Some titles have forced
  7792. and non-forced subtitles in the same track. Setting this flag to <code>1</code>
  7793. will only keep the forced subtitles. Default value is <code>0</code>.
  7794. </p></dd>
  7795. </dl>
  7796. <a name="libzvbi_002dteletext"></a>
  7797. <h3 class="section">13.4 libzvbi-teletext<span class="pull-right"><a class="anchor hidden-xs" href="#libzvbi_002dteletext" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libzvbi_002dteletext" aria-hidden="true">TOC</a></span></h3>
  7798. <p>Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext
  7799. subtitles. Requires the presence of the libzvbi headers and library during
  7800. configuration. You need to explicitly configure the build with
  7801. <code>--enable-libzvbi</code>.
  7802. </p>
  7803. <a name="Options-8"></a>
  7804. <h4 class="subsection">13.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-8" aria-hidden="true">TOC</a></span></h4>
  7805. <dl compact="compact">
  7806. <dt><samp>txt_page</samp></dt>
  7807. <dd><p>List of teletext page numbers to decode. Pages that do not match the specified
  7808. list are dropped. You may use the special <code>*</code> string to match all pages,
  7809. or <code>subtitle</code> to match all subtitle pages.
  7810. Default value is *.
  7811. </p></dd>
  7812. <dt><samp>txt_default_region</samp></dt>
  7813. <dd><p>Set default character set used for decoding, a value between 0 and 87 (see
  7814. ETS 300 706, Section 15, Table 32). Default value is -1, which does not
  7815. override the libzvbi default. This option is needed for some legacy level 1.0
  7816. transmissions which cannot signal the proper charset.
  7817. </p></dd>
  7818. <dt><samp>txt_chop_top</samp></dt>
  7819. <dd><p>Discards the top teletext line. Default value is 1.
  7820. </p></dd>
  7821. <dt><samp>txt_format</samp></dt>
  7822. <dd><p>Specifies the format of the decoded subtitles.
  7823. </p><dl compact="compact">
  7824. <dt><samp>bitmap</samp></dt>
  7825. <dd><p>The default format, you should use this for teletext pages, because certain
  7826. graphics and colors cannot be expressed in simple text or even ASS.
  7827. </p></dd>
  7828. <dt><samp>text</samp></dt>
  7829. <dd><p>Simple text based output without formatting.
  7830. </p></dd>
  7831. <dt><samp>ass</samp></dt>
  7832. <dd><p>Formatted ASS output, subtitle pages and teletext pages are returned in
  7833. different styles, subtitle pages are stripped down to text, but an effort is
  7834. made to keep the text alignment and the formatting.
  7835. </p></dd>
  7836. </dl>
  7837. </dd>
  7838. <dt><samp>txt_left</samp></dt>
  7839. <dd><p>X offset of generated bitmaps, default is 0.
  7840. </p></dd>
  7841. <dt><samp>txt_top</samp></dt>
  7842. <dd><p>Y offset of generated bitmaps, default is 0.
  7843. </p></dd>
  7844. <dt><samp>txt_chop_spaces</samp></dt>
  7845. <dd><p>Chops leading and trailing spaces and removes empty lines from the generated
  7846. text. This option is useful for teletext based subtitles where empty spaces may
  7847. be present at the start or at the end of the lines or empty lines may be
  7848. present between the subtitle lines because of double-sized teletext characters.
  7849. Default value is 1.
  7850. </p></dd>
  7851. <dt><samp>txt_duration</samp></dt>
  7852. <dd><p>Sets the display duration of the decoded teletext pages or subtitles in
  7853. milliseconds. Default value is -1 which means infinity or until the next
  7854. subtitle event comes.
  7855. </p></dd>
  7856. <dt><samp>txt_transparent</samp></dt>
  7857. <dd><p>Force transparent background of the generated teletext bitmaps. Default value
  7858. is 0 which means an opaque background.
  7859. </p></dd>
  7860. <dt><samp>txt_opacity</samp></dt>
  7861. <dd><p>Sets the opacity (0-255) of the teletext background. If
  7862. <samp>txt_transparent</samp> is not set, it only affects characters between a start
  7863. box and an end box, typically subtitles. Default value is 0 if
  7864. <samp>txt_transparent</samp> is set, 255 otherwise.
  7865. </p>
  7866. </dd>
  7867. </dl>
  7868. <a name="Encoders"></a>
  7869. <h2 class="chapter">14 Encoders<span class="pull-right"><a class="anchor hidden-xs" href="#Encoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Encoders" aria-hidden="true">TOC</a></span></h2>
  7870. <p>Encoders are configured elements in FFmpeg which allow the encoding of
  7871. multimedia streams.
  7872. </p>
  7873. <p>When you configure your FFmpeg build, all the supported native encoders
  7874. are enabled by default. Encoders requiring an external library must be enabled
  7875. manually via the corresponding <code>--enable-lib</code> option. You can list all
  7876. available encoders using the configure option <code>--list-encoders</code>.
  7877. </p>
  7878. <p>You can disable all the encoders with the configure option
  7879. <code>--disable-encoders</code> and selectively enable / disable single encoders
  7880. with the options <code>--enable-encoder=<var>ENCODER</var></code> /
  7881. <code>--disable-encoder=<var>ENCODER</var></code>.
  7882. </p>
  7883. <p>The option <code>-encoders</code> of the ff* tools will display the list of
  7884. enabled encoders.
  7885. </p>
  7886. <a name="Audio-Encoders"></a>
  7887. <h2 class="chapter">15 Audio Encoders<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Encoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Encoders" aria-hidden="true">TOC</a></span></h2>
  7888. <p>A description of some of the currently available audio encoders
  7889. follows.
  7890. </p>
  7891. <span id="aacenc"></span><a name="aac"></a>
  7892. <h3 class="section">15.1 aac<span class="pull-right"><a class="anchor hidden-xs" href="#aac" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aac" aria-hidden="true">TOC</a></span></h3>
  7893. <p>Advanced Audio Coding (AAC) encoder.
  7894. </p>
  7895. <p>This encoder is the default AAC encoder, natively implemented into FFmpeg.
  7896. </p>
  7897. <a name="Options-9"></a>
  7898. <h4 class="subsection">15.1.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-9" aria-hidden="true">TOC</a></span></h4>
  7899. <dl compact="compact">
  7900. <dt><samp>b</samp></dt>
  7901. <dd><p>Set bit rate in bits/s. Setting this automatically activates constant bit rate
  7902. (CBR) mode. If this option is unspecified it is set to 128kbps.
  7903. </p>
  7904. </dd>
  7905. <dt><samp>q</samp></dt>
  7906. <dd><p>Set quality for variable bit rate (VBR) mode. This option is valid only using
  7907. the <code>ffmpeg</code> command-line tool. For library interface users, use
  7908. <samp>global_quality</samp>.
  7909. </p>
  7910. </dd>
  7911. <dt><samp>cutoff</samp></dt>
  7912. <dd><p>Set cutoff frequency. If unspecified will allow the encoder to dynamically
  7913. adjust the cutoff to improve clarity on low bitrates.
  7914. </p>
  7915. </dd>
  7916. <dt><samp>aac_coder</samp></dt>
  7917. <dd><p>Set AAC encoder coding method. Possible values:
  7918. </p>
  7919. <dl compact="compact">
  7920. <dt>&lsquo;<samp>twoloop</samp>&rsquo;</dt>
  7921. <dd><p>Two loop searching (TLS) method.
  7922. </p>
  7923. <p>This method first sets quantizers depending on band thresholds and then tries
  7924. to find an optimal combination by adding or subtracting a specific value from
  7925. all quantizers and adjusting some individual quantizer a little. Will tune
  7926. itself based on whether <samp>aac_is</samp>, <samp>aac_ms</samp> and <samp>aac_pns</samp>
  7927. are enabled.
  7928. </p>
  7929. </dd>
  7930. <dt>&lsquo;<samp>anmr</samp>&rsquo;</dt>
  7931. <dd><p>Average noise to mask ratio (ANMR) trellis-based solution.
  7932. </p>
  7933. <p>This is an experimental coder which currently produces a lower quality, is more
  7934. unstable and is slower than the default twoloop coder but has potential.
  7935. Currently has no support for the <samp>aac_is</samp> or <samp>aac_pns</samp> options.
  7936. Not currently recommended.
  7937. </p>
  7938. </dd>
  7939. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  7940. <dd><p>Constant quantizer method.
  7941. </p>
  7942. <p>Uses a cheaper version of twoloop algorithm that doesn&rsquo;t try to do as many
  7943. clever adjustments. Worse with low bitrates (less than 64kbps), but is better
  7944. and much faster at higher bitrates.
  7945. This is the default choice for a coder
  7946. </p>
  7947. </dd>
  7948. </dl>
  7949. </dd>
  7950. <dt><samp>aac_ms</samp></dt>
  7951. <dd><p>Sets mid/side coding mode. The default value of &quot;auto&quot; will automatically use
  7952. M/S with bands which will benefit from such coding. Can be forced for all bands
  7953. using the value &quot;enable&quot;, which is mainly useful for debugging or disabled using
  7954. &quot;disable&quot;.
  7955. </p>
  7956. </dd>
  7957. <dt><samp>aac_is</samp></dt>
  7958. <dd><p>Sets intensity stereo coding tool usage. By default, it&rsquo;s enabled and will
  7959. automatically toggle IS for similar pairs of stereo bands if it&rsquo;s beneficial.
  7960. Can be disabled for debugging by setting the value to &quot;disable&quot;.
  7961. </p>
  7962. </dd>
  7963. <dt><samp>aac_pns</samp></dt>
  7964. <dd><p>Uses perceptual noise substitution to replace low entropy high frequency bands
  7965. with imperceptible white noise during the decoding process. By default, it&rsquo;s
  7966. enabled, but can be disabled for debugging purposes by using &quot;disable&quot;.
  7967. </p>
  7968. </dd>
  7969. <dt><samp>aac_tns</samp></dt>
  7970. <dd><p>Enables the use of a multitap FIR filter which spans through the high frequency
  7971. bands to hide quantization noise during the encoding process and is reverted
  7972. by the decoder. As well as decreasing unpleasant artifacts in the high range
  7973. this also reduces the entropy in the high bands and allows for more bits to
  7974. be used by the mid-low bands. By default it&rsquo;s enabled but can be disabled for
  7975. debugging by setting the option to &quot;disable&quot;.
  7976. </p>
  7977. </dd>
  7978. <dt><samp>aac_ltp</samp></dt>
  7979. <dd><p>Enables the use of the long term prediction extension which increases coding
  7980. efficiency in very low bandwidth situations such as encoding of voice or
  7981. solo piano music by extending constant harmonic peaks in bands throughout
  7982. frames. This option is implied by profile:a aac_low and is incompatible with
  7983. aac_pred. Use in conjunction with <samp>-ar</samp> to decrease the samplerate.
  7984. </p>
  7985. </dd>
  7986. <dt><samp>aac_pred</samp></dt>
  7987. <dd><p>Enables the use of a more traditional style of prediction where the spectral
  7988. coefficients transmitted are replaced by the difference of the current
  7989. coefficients minus the previous &quot;predicted&quot; coefficients. In theory and sometimes
  7990. in practice this can improve quality for low to mid bitrate audio.
  7991. This option implies the aac_main profile and is incompatible with aac_ltp.
  7992. </p>
  7993. </dd>
  7994. <dt><samp>profile</samp></dt>
  7995. <dd><p>Sets the encoding profile, possible values:
  7996. </p>
  7997. <dl compact="compact">
  7998. <dt>&lsquo;<samp>aac_low</samp>&rsquo;</dt>
  7999. <dd><p>The default, AAC &quot;Low-complexity&quot; profile. Is the most compatible and produces
  8000. decent quality.
  8001. </p>
  8002. </dd>
  8003. <dt>&lsquo;<samp>mpeg2_aac_low</samp>&rsquo;</dt>
  8004. <dd><p>Equivalent to <code>-profile:a aac_low -aac_pns 0</code>. PNS was introduced with the
  8005. MPEG4 specifications.
  8006. </p>
  8007. </dd>
  8008. <dt>&lsquo;<samp>aac_ltp</samp>&rsquo;</dt>
  8009. <dd><p>Long term prediction profile, is enabled by and will enable the <samp>aac_ltp</samp>
  8010. option. Introduced in MPEG4.
  8011. </p>
  8012. </dd>
  8013. <dt>&lsquo;<samp>aac_main</samp>&rsquo;</dt>
  8014. <dd><p>Main-type prediction profile, is enabled by and will enable the <samp>aac_pred</samp>
  8015. option. Introduced in MPEG2.
  8016. </p>
  8017. </dd>
  8018. </dl>
  8019. <p>If this option is unspecified it is set to &lsquo;<samp>aac_low</samp>&rsquo;.
  8020. </p></dd>
  8021. </dl>
  8022. <a name="ac3-and-ac3_005ffixed"></a>
  8023. <h3 class="section">15.2 ac3 and ac3_fixed<span class="pull-right"><a class="anchor hidden-xs" href="#ac3-and-ac3_005ffixed" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ac3-and-ac3_005ffixed" aria-hidden="true">TOC</a></span></h3>
  8024. <p>AC-3 audio encoders.
  8025. </p>
  8026. <p>These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  8027. the undocumented RealAudio 3 (a.k.a. dnet).
  8028. </p>
  8029. <p>The <var>ac3</var> encoder uses floating-point math, while the <var>ac3_fixed</var>
  8030. encoder only uses fixed-point integer math. This does not mean that one is
  8031. always faster, just that one or the other may be better suited to a
  8032. particular system. The <var>ac3_fixed</var> encoder is not the default codec for
  8033. any of the output formats, so it must be specified explicitly using the option
  8034. <code>-acodec ac3_fixed</code> in order to use it.
  8035. </p>
  8036. <a name="AC_002d3-Metadata"></a>
  8037. <h4 class="subsection">15.2.1 AC-3 Metadata<span class="pull-right"><a class="anchor hidden-xs" href="#AC_002d3-Metadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AC_002d3-Metadata" aria-hidden="true">TOC</a></span></h4>
  8038. <p>The AC-3 metadata options are used to set parameters that describe the audio,
  8039. but in most cases do not affect the audio encoding itself. Some of the options
  8040. do directly affect or influence the decoding and playback of the resulting
  8041. bitstream, while others are just for informational purposes. A few of the
  8042. options will add bits to the output stream that could otherwise be used for
  8043. audio data, and will thus affect the quality of the output. Those will be
  8044. indicated accordingly with a note in the option list below.
  8045. </p>
  8046. <p>These parameters are described in detail in several publicly-available
  8047. documents.
  8048. </p><ul>
  8049. <li> <a href="http://www.atsc.org/cms/standards/a_52-2010.pdf">A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard</a>
  8050. </li><li> <a 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>
  8051. </li><li> <a href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf">Dolby Metadata Guide</a>
  8052. </li><li> <a href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf">Dolby Digital Professional Encoding Guidelines</a>
  8053. </li></ul>
  8054. <a name="Metadata-Control-Options"></a>
  8055. <h4 class="subsubsection">15.2.1.1 Metadata Control Options<span class="pull-right"><a class="anchor hidden-xs" href="#Metadata-Control-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Metadata-Control-Options" aria-hidden="true">TOC</a></span></h4>
  8056. <dl compact="compact">
  8057. <dt><samp>-per_frame_metadata <var>boolean</var></samp></dt>
  8058. <dd><p>Allow Per-Frame Metadata. Specifies if the encoder should check for changing
  8059. metadata for each frame.
  8060. </p><dl compact="compact">
  8061. <dt><samp>0</samp></dt>
  8062. <dd><p>The metadata values set at initialization will be used for every frame in the
  8063. stream. (default)
  8064. </p></dd>
  8065. <dt><samp>1</samp></dt>
  8066. <dd><p>Metadata values can be changed before encoding each frame.
  8067. </p></dd>
  8068. </dl>
  8069. </dd>
  8070. </dl>
  8071. <a name="Downmix-Levels"></a>
  8072. <h4 class="subsubsection">15.2.1.2 Downmix Levels<span class="pull-right"><a class="anchor hidden-xs" href="#Downmix-Levels" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Downmix-Levels" aria-hidden="true">TOC</a></span></h4>
  8073. <dl compact="compact">
  8074. <dt><samp>-center_mixlev <var>level</var></samp></dt>
  8075. <dd><p>Center Mix Level. The amount of gain the decoder should apply to the center
  8076. channel when downmixing to stereo. This field will only be written to the
  8077. bitstream if a center channel is present. The value is specified as a scale
  8078. factor. There are 3 valid values:
  8079. </p><dl compact="compact">
  8080. <dt><samp>0.707</samp></dt>
  8081. <dd><p>Apply -3dB gain
  8082. </p></dd>
  8083. <dt><samp>0.595</samp></dt>
  8084. <dd><p>Apply -4.5dB gain (default)
  8085. </p></dd>
  8086. <dt><samp>0.500</samp></dt>
  8087. <dd><p>Apply -6dB gain
  8088. </p></dd>
  8089. </dl>
  8090. </dd>
  8091. <dt><samp>-surround_mixlev <var>level</var></samp></dt>
  8092. <dd><p>Surround Mix Level. The amount of gain the decoder should apply to the surround
  8093. channel(s) when downmixing to stereo. This field will only be written to the
  8094. bitstream if one or more surround channels are present. The value is specified
  8095. as a scale factor. There are 3 valid values:
  8096. </p><dl compact="compact">
  8097. <dt><samp>0.707</samp></dt>
  8098. <dd><p>Apply -3dB gain
  8099. </p></dd>
  8100. <dt><samp>0.500</samp></dt>
  8101. <dd><p>Apply -6dB gain (default)
  8102. </p></dd>
  8103. <dt><samp>0.000</samp></dt>
  8104. <dd><p>Silence Surround Channel(s)
  8105. </p></dd>
  8106. </dl>
  8107. </dd>
  8108. </dl>
  8109. <a name="Audio-Production-Information"></a>
  8110. <h4 class="subsubsection">15.2.1.3 Audio Production Information<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Production-Information" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Production-Information" aria-hidden="true">TOC</a></span></h4>
  8111. <p>Audio Production Information is optional information describing the mixing
  8112. environment. Either none or both of the fields are written to the bitstream.
  8113. </p>
  8114. <dl compact="compact">
  8115. <dt><samp>-mixing_level <var>number</var></samp></dt>
  8116. <dd><p>Mixing Level. Specifies peak sound pressure level (SPL) in the production
  8117. environment when the mix was mastered. Valid values are 80 to 111, or -1 for
  8118. unknown or not indicated. The default value is -1, but that value cannot be
  8119. used if the Audio Production Information is written to the bitstream. Therefore,
  8120. if the <code>room_type</code> option is not the default value, the <code>mixing_level</code>
  8121. option must not be -1.
  8122. </p>
  8123. </dd>
  8124. <dt><samp>-room_type <var>type</var></samp></dt>
  8125. <dd><p>Room Type. Describes the equalization used during the final mixing session at
  8126. the studio or on the dubbing stage. A large room is a dubbing stage with the
  8127. industry standard X-curve equalization; a small room has flat equalization.
  8128. This field will not be written to the bitstream if both the <code>mixing_level</code>
  8129. option and the <code>room_type</code> option have the default values.
  8130. </p><dl compact="compact">
  8131. <dt><samp>0</samp></dt>
  8132. <dt><samp>notindicated</samp></dt>
  8133. <dd><p>Not Indicated (default)
  8134. </p></dd>
  8135. <dt><samp>1</samp></dt>
  8136. <dt><samp>large</samp></dt>
  8137. <dd><p>Large Room
  8138. </p></dd>
  8139. <dt><samp>2</samp></dt>
  8140. <dt><samp>small</samp></dt>
  8141. <dd><p>Small Room
  8142. </p></dd>
  8143. </dl>
  8144. </dd>
  8145. </dl>
  8146. <a name="Other-Metadata-Options"></a>
  8147. <h4 class="subsubsection">15.2.1.4 Other Metadata Options<span class="pull-right"><a class="anchor hidden-xs" href="#Other-Metadata-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Other-Metadata-Options" aria-hidden="true">TOC</a></span></h4>
  8148. <dl compact="compact">
  8149. <dt><samp>-copyright <var>boolean</var></samp></dt>
  8150. <dd><p>Copyright Indicator. Specifies whether a copyright exists for this audio.
  8151. </p><dl compact="compact">
  8152. <dt><samp>0</samp></dt>
  8153. <dt><samp>off</samp></dt>
  8154. <dd><p>No Copyright Exists (default)
  8155. </p></dd>
  8156. <dt><samp>1</samp></dt>
  8157. <dt><samp>on</samp></dt>
  8158. <dd><p>Copyright Exists
  8159. </p></dd>
  8160. </dl>
  8161. </dd>
  8162. <dt><samp>-dialnorm <var>value</var></samp></dt>
  8163. <dd><p>Dialogue Normalization. Indicates how far the average dialogue level of the
  8164. program is below digital 100% full scale (0 dBFS). This parameter determines a
  8165. level shift during audio reproduction that sets the average volume of the
  8166. dialogue to a preset level. The goal is to match volume level between program
  8167. sources. A value of -31dB will result in no volume level change, relative to
  8168. the source volume, during audio reproduction. Valid values are whole numbers in
  8169. the range -31 to -1, with -31 being the default.
  8170. </p>
  8171. </dd>
  8172. <dt><samp>-dsur_mode <var>mode</var></samp></dt>
  8173. <dd><p>Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
  8174. (Pro Logic). This field will only be written to the bitstream if the audio
  8175. stream is stereo. Using this option does <b>NOT</b> mean the encoder will actually
  8176. apply Dolby Surround processing.
  8177. </p><dl compact="compact">
  8178. <dt><samp>0</samp></dt>
  8179. <dt><samp>notindicated</samp></dt>
  8180. <dd><p>Not Indicated (default)
  8181. </p></dd>
  8182. <dt><samp>1</samp></dt>
  8183. <dt><samp>off</samp></dt>
  8184. <dd><p>Not Dolby Surround Encoded
  8185. </p></dd>
  8186. <dt><samp>2</samp></dt>
  8187. <dt><samp>on</samp></dt>
  8188. <dd><p>Dolby Surround Encoded
  8189. </p></dd>
  8190. </dl>
  8191. </dd>
  8192. <dt><samp>-original <var>boolean</var></samp></dt>
  8193. <dd><p>Original Bit Stream Indicator. Specifies whether this audio is from the
  8194. original source and not a copy.
  8195. </p><dl compact="compact">
  8196. <dt><samp>0</samp></dt>
  8197. <dt><samp>off</samp></dt>
  8198. <dd><p>Not Original Source
  8199. </p></dd>
  8200. <dt><samp>1</samp></dt>
  8201. <dt><samp>on</samp></dt>
  8202. <dd><p>Original Source (default)
  8203. </p></dd>
  8204. </dl>
  8205. </dd>
  8206. </dl>
  8207. <a name="Extended-Bitstream-Information"></a>
  8208. <h4 class="subsection">15.2.2 Extended Bitstream Information<span class="pull-right"><a class="anchor hidden-xs" href="#Extended-Bitstream-Information" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Extended-Bitstream-Information" aria-hidden="true">TOC</a></span></h4>
  8209. <p>The extended bitstream options are part of the Alternate Bit Stream Syntax as
  8210. specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
  8211. If any one parameter in a group is specified, all values in that group will be
  8212. written to the bitstream. Default values are used for those that are written
  8213. but have not been specified. If the mixing levels are written, the decoder
  8214. will use these values instead of the ones specified in the <code>center_mixlev</code>
  8215. and <code>surround_mixlev</code> options if it supports the Alternate Bit Stream
  8216. Syntax.
  8217. </p>
  8218. <a name="Extended-Bitstream-Information-_002d-Part-1"></a>
  8219. <h4 class="subsubsection">15.2.2.1 Extended Bitstream Information - Part 1<span class="pull-right"><a class="anchor hidden-xs" href="#Extended-Bitstream-Information-_002d-Part-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Extended-Bitstream-Information-_002d-Part-1" aria-hidden="true">TOC</a></span></h4>
  8220. <dl compact="compact">
  8221. <dt><samp>-dmix_mode <var>mode</var></samp></dt>
  8222. <dd><p>Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
  8223. (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
  8224. </p><dl compact="compact">
  8225. <dt><samp>0</samp></dt>
  8226. <dt><samp>notindicated</samp></dt>
  8227. <dd><p>Not Indicated (default)
  8228. </p></dd>
  8229. <dt><samp>1</samp></dt>
  8230. <dt><samp>ltrt</samp></dt>
  8231. <dd><p>Lt/Rt Downmix Preferred
  8232. </p></dd>
  8233. <dt><samp>2</samp></dt>
  8234. <dt><samp>loro</samp></dt>
  8235. <dd><p>Lo/Ro Downmix Preferred
  8236. </p></dd>
  8237. </dl>
  8238. </dd>
  8239. <dt><samp>-ltrt_cmixlev <var>level</var></samp></dt>
  8240. <dd><p>Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
  8241. center channel when downmixing to stereo in Lt/Rt mode.
  8242. </p><dl compact="compact">
  8243. <dt><samp>1.414</samp></dt>
  8244. <dd><p>Apply +3dB gain
  8245. </p></dd>
  8246. <dt><samp>1.189</samp></dt>
  8247. <dd><p>Apply +1.5dB gain
  8248. </p></dd>
  8249. <dt><samp>1.000</samp></dt>
  8250. <dd><p>Apply 0dB gain
  8251. </p></dd>
  8252. <dt><samp>0.841</samp></dt>
  8253. <dd><p>Apply -1.5dB gain
  8254. </p></dd>
  8255. <dt><samp>0.707</samp></dt>
  8256. <dd><p>Apply -3.0dB gain
  8257. </p></dd>
  8258. <dt><samp>0.595</samp></dt>
  8259. <dd><p>Apply -4.5dB gain (default)
  8260. </p></dd>
  8261. <dt><samp>0.500</samp></dt>
  8262. <dd><p>Apply -6.0dB gain
  8263. </p></dd>
  8264. <dt><samp>0.000</samp></dt>
  8265. <dd><p>Silence Center Channel
  8266. </p></dd>
  8267. </dl>
  8268. </dd>
  8269. <dt><samp>-ltrt_surmixlev <var>level</var></samp></dt>
  8270. <dd><p>Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
  8271. surround channel(s) when downmixing to stereo in Lt/Rt mode.
  8272. </p><dl compact="compact">
  8273. <dt><samp>0.841</samp></dt>
  8274. <dd><p>Apply -1.5dB gain
  8275. </p></dd>
  8276. <dt><samp>0.707</samp></dt>
  8277. <dd><p>Apply -3.0dB gain
  8278. </p></dd>
  8279. <dt><samp>0.595</samp></dt>
  8280. <dd><p>Apply -4.5dB gain
  8281. </p></dd>
  8282. <dt><samp>0.500</samp></dt>
  8283. <dd><p>Apply -6.0dB gain (default)
  8284. </p></dd>
  8285. <dt><samp>0.000</samp></dt>
  8286. <dd><p>Silence Surround Channel(s)
  8287. </p></dd>
  8288. </dl>
  8289. </dd>
  8290. <dt><samp>-loro_cmixlev <var>level</var></samp></dt>
  8291. <dd><p>Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
  8292. center channel when downmixing to stereo in Lo/Ro mode.
  8293. </p><dl compact="compact">
  8294. <dt><samp>1.414</samp></dt>
  8295. <dd><p>Apply +3dB gain
  8296. </p></dd>
  8297. <dt><samp>1.189</samp></dt>
  8298. <dd><p>Apply +1.5dB gain
  8299. </p></dd>
  8300. <dt><samp>1.000</samp></dt>
  8301. <dd><p>Apply 0dB gain
  8302. </p></dd>
  8303. <dt><samp>0.841</samp></dt>
  8304. <dd><p>Apply -1.5dB gain
  8305. </p></dd>
  8306. <dt><samp>0.707</samp></dt>
  8307. <dd><p>Apply -3.0dB gain
  8308. </p></dd>
  8309. <dt><samp>0.595</samp></dt>
  8310. <dd><p>Apply -4.5dB gain (default)
  8311. </p></dd>
  8312. <dt><samp>0.500</samp></dt>
  8313. <dd><p>Apply -6.0dB gain
  8314. </p></dd>
  8315. <dt><samp>0.000</samp></dt>
  8316. <dd><p>Silence Center Channel
  8317. </p></dd>
  8318. </dl>
  8319. </dd>
  8320. <dt><samp>-loro_surmixlev <var>level</var></samp></dt>
  8321. <dd><p>Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
  8322. surround channel(s) when downmixing to stereo in Lo/Ro mode.
  8323. </p><dl compact="compact">
  8324. <dt><samp>0.841</samp></dt>
  8325. <dd><p>Apply -1.5dB gain
  8326. </p></dd>
  8327. <dt><samp>0.707</samp></dt>
  8328. <dd><p>Apply -3.0dB gain
  8329. </p></dd>
  8330. <dt><samp>0.595</samp></dt>
  8331. <dd><p>Apply -4.5dB gain
  8332. </p></dd>
  8333. <dt><samp>0.500</samp></dt>
  8334. <dd><p>Apply -6.0dB gain (default)
  8335. </p></dd>
  8336. <dt><samp>0.000</samp></dt>
  8337. <dd><p>Silence Surround Channel(s)
  8338. </p></dd>
  8339. </dl>
  8340. </dd>
  8341. </dl>
  8342. <a name="Extended-Bitstream-Information-_002d-Part-2"></a>
  8343. <h4 class="subsubsection">15.2.2.2 Extended Bitstream Information - Part 2<span class="pull-right"><a class="anchor hidden-xs" href="#Extended-Bitstream-Information-_002d-Part-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Extended-Bitstream-Information-_002d-Part-2" aria-hidden="true">TOC</a></span></h4>
  8344. <dl compact="compact">
  8345. <dt><samp>-dsurex_mode <var>mode</var></samp></dt>
  8346. <dd><p>Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
  8347. (7.1 matrixed to 5.1). Using this option does <b>NOT</b> mean the encoder will actually
  8348. apply Dolby Surround EX processing.
  8349. </p><dl compact="compact">
  8350. <dt><samp>0</samp></dt>
  8351. <dt><samp>notindicated</samp></dt>
  8352. <dd><p>Not Indicated (default)
  8353. </p></dd>
  8354. <dt><samp>1</samp></dt>
  8355. <dt><samp>on</samp></dt>
  8356. <dd><p>Dolby Surround EX Off
  8357. </p></dd>
  8358. <dt><samp>2</samp></dt>
  8359. <dt><samp>off</samp></dt>
  8360. <dd><p>Dolby Surround EX On
  8361. </p></dd>
  8362. </dl>
  8363. </dd>
  8364. <dt><samp>-dheadphone_mode <var>mode</var></samp></dt>
  8365. <dd><p>Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
  8366. encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
  8367. option does <b>NOT</b> mean the encoder will actually apply Dolby Headphone
  8368. processing.
  8369. </p><dl compact="compact">
  8370. <dt><samp>0</samp></dt>
  8371. <dt><samp>notindicated</samp></dt>
  8372. <dd><p>Not Indicated (default)
  8373. </p></dd>
  8374. <dt><samp>1</samp></dt>
  8375. <dt><samp>on</samp></dt>
  8376. <dd><p>Dolby Headphone Off
  8377. </p></dd>
  8378. <dt><samp>2</samp></dt>
  8379. <dt><samp>off</samp></dt>
  8380. <dd><p>Dolby Headphone On
  8381. </p></dd>
  8382. </dl>
  8383. </dd>
  8384. <dt><samp>-ad_conv_type <var>type</var></samp></dt>
  8385. <dd><p>A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
  8386. conversion.
  8387. </p><dl compact="compact">
  8388. <dt><samp>0</samp></dt>
  8389. <dt><samp>standard</samp></dt>
  8390. <dd><p>Standard A/D Converter (default)
  8391. </p></dd>
  8392. <dt><samp>1</samp></dt>
  8393. <dt><samp>hdcd</samp></dt>
  8394. <dd><p>HDCD A/D Converter
  8395. </p></dd>
  8396. </dl>
  8397. </dd>
  8398. </dl>
  8399. <a name="Other-AC_002d3-Encoding-Options"></a>
  8400. <h4 class="subsection">15.2.3 Other AC-3 Encoding Options<span class="pull-right"><a class="anchor hidden-xs" href="#Other-AC_002d3-Encoding-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Other-AC_002d3-Encoding-Options" aria-hidden="true">TOC</a></span></h4>
  8401. <dl compact="compact">
  8402. <dt><samp>-stereo_rematrixing <var>boolean</var></samp></dt>
  8403. <dd><p>Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
  8404. is an optional AC-3 feature that increases quality by selectively encoding
  8405. the left/right channels as mid/side. This option is enabled by default, and it
  8406. is highly recommended that it be left as enabled except for testing purposes.
  8407. </p>
  8408. </dd>
  8409. <dt><samp>cutoff <var>frequency</var></samp></dt>
  8410. <dd><p>Set lowpass cutoff frequency. If unspecified, the encoder selects a default
  8411. determined by various other encoding parameters.
  8412. </p>
  8413. </dd>
  8414. </dl>
  8415. <a name="Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options"></a>
  8416. <h4 class="subsection">15.2.4 Floating-Point-Only AC-3 Encoding Options<span class="pull-right"><a class="anchor hidden-xs" href="#Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options" aria-hidden="true">TOC</a></span></h4>
  8417. <p>These options are only valid for the floating-point encoder and do not exist
  8418. for the fixed-point encoder due to the corresponding features not being
  8419. implemented in fixed-point.
  8420. </p>
  8421. <dl compact="compact">
  8422. <dt><samp>-channel_coupling <var>boolean</var></samp></dt>
  8423. <dd><p>Enables/Disables use of channel coupling, which is an optional AC-3 feature
  8424. that increases quality by combining high frequency information from multiple
  8425. channels into a single channel. The per-channel high frequency information is
  8426. sent with less accuracy in both the frequency and time domains. This allows
  8427. more bits to be used for lower frequencies while preserving enough information
  8428. to reconstruct the high frequencies. This option is enabled by default for the
  8429. floating-point encoder and should generally be left as enabled except for
  8430. testing purposes or to increase encoding speed.
  8431. </p><dl compact="compact">
  8432. <dt><samp>-1</samp></dt>
  8433. <dt><samp>auto</samp></dt>
  8434. <dd><p>Selected by Encoder (default)
  8435. </p></dd>
  8436. <dt><samp>0</samp></dt>
  8437. <dt><samp>off</samp></dt>
  8438. <dd><p>Disable Channel Coupling
  8439. </p></dd>
  8440. <dt><samp>1</samp></dt>
  8441. <dt><samp>on</samp></dt>
  8442. <dd><p>Enable Channel Coupling
  8443. </p></dd>
  8444. </dl>
  8445. </dd>
  8446. <dt><samp>-cpl_start_band <var>number</var></samp></dt>
  8447. <dd><p>Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
  8448. value higher than the bandwidth is used, it will be reduced to 1 less than the
  8449. coupling end band. If <var>auto</var> is used, the start band will be determined by
  8450. the encoder based on the bit rate, sample rate, and channel layout. This option
  8451. has no effect if channel coupling is disabled.
  8452. </p><dl compact="compact">
  8453. <dt><samp>-1</samp></dt>
  8454. <dt><samp>auto</samp></dt>
  8455. <dd><p>Selected by Encoder (default)
  8456. </p></dd>
  8457. </dl>
  8458. </dd>
  8459. </dl>
  8460. <span id="flac"></span><a name="flac-2"></a>
  8461. <h3 class="section">15.3 flac<span class="pull-right"><a class="anchor hidden-xs" href="#flac-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flac-2" aria-hidden="true">TOC</a></span></h3>
  8462. <p>FLAC (Free Lossless Audio Codec) Encoder
  8463. </p>
  8464. <a name="Options-10"></a>
  8465. <h4 class="subsection">15.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-10" aria-hidden="true">TOC</a></span></h4>
  8466. <p>The following options are supported by FFmpeg&rsquo;s flac encoder.
  8467. </p>
  8468. <dl compact="compact">
  8469. <dt><samp>compression_level</samp></dt>
  8470. <dd><p>Sets the compression level, which chooses defaults for many other options
  8471. if they are not set explicitly. Valid values are from 0 to 12, 5 is the
  8472. default.
  8473. </p>
  8474. </dd>
  8475. <dt><samp>frame_size</samp></dt>
  8476. <dd><p>Sets the size of the frames in samples per channel.
  8477. </p>
  8478. </dd>
  8479. <dt><samp>lpc_coeff_precision</samp></dt>
  8480. <dd><p>Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the
  8481. default.
  8482. </p>
  8483. </dd>
  8484. <dt><samp>lpc_type</samp></dt>
  8485. <dd><p>Sets the first stage LPC algorithm
  8486. </p><dl compact="compact">
  8487. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  8488. <dd><p>LPC is not used
  8489. </p>
  8490. </dd>
  8491. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  8492. <dd><p>fixed LPC coefficients
  8493. </p>
  8494. </dd>
  8495. <dt>&lsquo;<samp>levinson</samp>&rsquo;</dt>
  8496. <dt>&lsquo;<samp>cholesky</samp>&rsquo;</dt>
  8497. </dl>
  8498. </dd>
  8499. <dt><samp>lpc_passes</samp></dt>
  8500. <dd><p>Number of passes to use for Cholesky factorization during LPC analysis
  8501. </p>
  8502. </dd>
  8503. <dt><samp>min_partition_order</samp></dt>
  8504. <dd><p>The minimum partition order
  8505. </p>
  8506. </dd>
  8507. <dt><samp>max_partition_order</samp></dt>
  8508. <dd><p>The maximum partition order
  8509. </p>
  8510. </dd>
  8511. <dt><samp>prediction_order_method</samp></dt>
  8512. <dd><dl compact="compact">
  8513. <dt>&lsquo;<samp>estimation</samp>&rsquo;</dt>
  8514. <dt>&lsquo;<samp>2level</samp>&rsquo;</dt>
  8515. <dt>&lsquo;<samp>4level</samp>&rsquo;</dt>
  8516. <dt>&lsquo;<samp>8level</samp>&rsquo;</dt>
  8517. <dt>&lsquo;<samp>search</samp>&rsquo;</dt>
  8518. <dd><p>Bruteforce search
  8519. </p></dd>
  8520. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  8521. </dl>
  8522. </dd>
  8523. <dt><samp>ch_mode</samp></dt>
  8524. <dd><p>Channel mode
  8525. </p><dl compact="compact">
  8526. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  8527. <dd><p>The mode is chosen automatically for each frame
  8528. </p></dd>
  8529. <dt>&lsquo;<samp>indep</samp>&rsquo;</dt>
  8530. <dd><p>Channels are independently coded
  8531. </p></dd>
  8532. <dt>&lsquo;<samp>left_side</samp>&rsquo;</dt>
  8533. <dt>&lsquo;<samp>right_side</samp>&rsquo;</dt>
  8534. <dt>&lsquo;<samp>mid_side</samp>&rsquo;</dt>
  8535. </dl>
  8536. </dd>
  8537. <dt><samp>exact_rice_parameters</samp></dt>
  8538. <dd><p>Chooses if rice parameters are calculated exactly or approximately.
  8539. if set to 1 then they are chosen exactly, which slows the code down slightly and
  8540. improves compression slightly.
  8541. </p>
  8542. </dd>
  8543. <dt><samp>multi_dim_quant</samp></dt>
  8544. <dd><p>Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is
  8545. applied after the first stage to finetune the coefficients. This is quite slow
  8546. and slightly improves compression.
  8547. </p>
  8548. </dd>
  8549. </dl>
  8550. <span id="opusenc"></span><a name="opus"></a>
  8551. <h3 class="section">15.4 opus<span class="pull-right"><a class="anchor hidden-xs" href="#opus" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-opus" aria-hidden="true">TOC</a></span></h3>
  8552. <p>Opus encoder.
  8553. </p>
  8554. <p>This is a native FFmpeg encoder for the Opus format. Currently its in development and
  8555. only implements the CELT part of the codec. Its quality is usually worse and at best
  8556. is equal to the libopus encoder.
  8557. </p>
  8558. <a name="Options-11"></a>
  8559. <h4 class="subsection">15.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-11" aria-hidden="true">TOC</a></span></h4>
  8560. <dl compact="compact">
  8561. <dt><samp>b</samp></dt>
  8562. <dd><p>Set bit rate in bits/s. If unspecified it uses the number of channels and the layout
  8563. to make a good guess.
  8564. </p>
  8565. </dd>
  8566. <dt><samp>opus_delay</samp></dt>
  8567. <dd><p>Sets the maximum delay in milliseconds. Lower delays than 20ms will very quickly
  8568. decrease quality.
  8569. </p></dd>
  8570. </dl>
  8571. <span id="libfdk_002daac_002denc"></span><a name="libfdk_005faac"></a>
  8572. <h3 class="section">15.5 libfdk_aac<span class="pull-right"><a class="anchor hidden-xs" href="#libfdk_005faac" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libfdk_005faac" aria-hidden="true">TOC</a></span></h3>
  8573. <p>libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
  8574. </p>
  8575. <p>The libfdk-aac library is based on the Fraunhofer FDK AAC code from
  8576. the Android project.
  8577. </p>
  8578. <p>Requires the presence of the libfdk-aac headers and library during
  8579. configuration. You need to explicitly configure the build with
  8580. <code>--enable-libfdk-aac</code>. The library is also incompatible with GPL,
  8581. so if you allow the use of GPL, you should configure with
  8582. <code>--enable-gpl --enable-nonfree --enable-libfdk-aac</code>.
  8583. </p>
  8584. <p>This encoder has support for the AAC-HE profiles.
  8585. </p>
  8586. <p>VBR encoding, enabled through the <samp>vbr</samp> or <samp>flags
  8587. +qscale</samp> options, is experimental and only works with some
  8588. combinations of parameters.
  8589. </p>
  8590. <p>Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
  8591. higher.
  8592. </p>
  8593. <p>For more information see the fdk-aac project at
  8594. <a href="http://sourceforge.net/p/opencore-amr/fdk-aac/">http://sourceforge.net/p/opencore-amr/fdk-aac/</a>.
  8595. </p>
  8596. <a name="Options-12"></a>
  8597. <h4 class="subsection">15.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-12" aria-hidden="true">TOC</a></span></h4>
  8598. <p>The following options are mapped on the shared FFmpeg codec options.
  8599. </p>
  8600. <dl compact="compact">
  8601. <dt><samp>b</samp></dt>
  8602. <dd><p>Set bit rate in bits/s. If the bitrate is not explicitly specified, it
  8603. is automatically set to a suitable value depending on the selected
  8604. profile.
  8605. </p>
  8606. <p>In case VBR mode is enabled the option is ignored.
  8607. </p>
  8608. </dd>
  8609. <dt><samp>ar</samp></dt>
  8610. <dd><p>Set audio sampling rate (in Hz).
  8611. </p>
  8612. </dd>
  8613. <dt><samp>channels</samp></dt>
  8614. <dd><p>Set the number of audio channels.
  8615. </p>
  8616. </dd>
  8617. <dt><samp>flags +qscale</samp></dt>
  8618. <dd><p>Enable fixed quality, VBR (Variable Bit Rate) mode.
  8619. Note that VBR is implicitly enabled when the <samp>vbr</samp> value is
  8620. positive.
  8621. </p>
  8622. </dd>
  8623. <dt><samp>cutoff</samp></dt>
  8624. <dd><p>Set cutoff frequency. If not specified (or explicitly set to 0) it
  8625. will use a value automatically computed by the library. Default value
  8626. is 0.
  8627. </p>
  8628. </dd>
  8629. <dt><samp>profile</samp></dt>
  8630. <dd><p>Set audio profile.
  8631. </p>
  8632. <p>The following profiles are recognized:
  8633. </p><dl compact="compact">
  8634. <dt>&lsquo;<samp>aac_low</samp>&rsquo;</dt>
  8635. <dd><p>Low Complexity AAC (LC)
  8636. </p>
  8637. </dd>
  8638. <dt>&lsquo;<samp>aac_he</samp>&rsquo;</dt>
  8639. <dd><p>High Efficiency AAC (HE-AAC)
  8640. </p>
  8641. </dd>
  8642. <dt>&lsquo;<samp>aac_he_v2</samp>&rsquo;</dt>
  8643. <dd><p>High Efficiency AAC version 2 (HE-AACv2)
  8644. </p>
  8645. </dd>
  8646. <dt>&lsquo;<samp>aac_ld</samp>&rsquo;</dt>
  8647. <dd><p>Low Delay AAC (LD)
  8648. </p>
  8649. </dd>
  8650. <dt>&lsquo;<samp>aac_eld</samp>&rsquo;</dt>
  8651. <dd><p>Enhanced Low Delay AAC (ELD)
  8652. </p></dd>
  8653. </dl>
  8654. <p>If not specified it is set to &lsquo;<samp>aac_low</samp>&rsquo;.
  8655. </p></dd>
  8656. </dl>
  8657. <p>The following are private options of the libfdk_aac encoder.
  8658. </p>
  8659. <dl compact="compact">
  8660. <dt><samp>afterburner</samp></dt>
  8661. <dd><p>Enable afterburner feature if set to 1, disabled if set to 0. This
  8662. improves the quality but also the required processing power.
  8663. </p>
  8664. <p>Default value is 1.
  8665. </p>
  8666. </dd>
  8667. <dt><samp>eld_sbr</samp></dt>
  8668. <dd><p>Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
  8669. if set to 0.
  8670. </p>
  8671. <p>Default value is 0.
  8672. </p>
  8673. </dd>
  8674. <dt><samp>eld_v2</samp></dt>
  8675. <dd><p>Enable ELDv2 (LD-MPS extension for ELD stereo signals) for ELDv2 if set to 1,
  8676. disabled if set to 0.
  8677. </p>
  8678. <p>Note that option is available when fdk-aac version (AACENCODER_LIB_VL0.AACENCODER_LIB_VL1.AACENCODER_LIB_VL2) &gt; (4.0.0).
  8679. </p>
  8680. <p>Default value is 0.
  8681. </p>
  8682. </dd>
  8683. <dt><samp>signaling</samp></dt>
  8684. <dd><p>Set SBR/PS signaling style.
  8685. </p>
  8686. <p>It can assume one of the following values:
  8687. </p><dl compact="compact">
  8688. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  8689. <dd><p>choose signaling implicitly (explicit hierarchical by default,
  8690. implicit if global header is disabled)
  8691. </p>
  8692. </dd>
  8693. <dt>&lsquo;<samp>implicit</samp>&rsquo;</dt>
  8694. <dd><p>implicit backwards compatible signaling
  8695. </p>
  8696. </dd>
  8697. <dt>&lsquo;<samp>explicit_sbr</samp>&rsquo;</dt>
  8698. <dd><p>explicit SBR, implicit PS signaling
  8699. </p>
  8700. </dd>
  8701. <dt>&lsquo;<samp>explicit_hierarchical</samp>&rsquo;</dt>
  8702. <dd><p>explicit hierarchical signaling
  8703. </p></dd>
  8704. </dl>
  8705. <p>Default value is &lsquo;<samp>default</samp>&rsquo;.
  8706. </p>
  8707. </dd>
  8708. <dt><samp>latm</samp></dt>
  8709. <dd><p>Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
  8710. </p>
  8711. <p>Default value is 0.
  8712. </p>
  8713. </dd>
  8714. <dt><samp>header_period</samp></dt>
  8715. <dd><p>Set StreamMuxConfig and PCE repetition period (in frames) for sending
  8716. in-band configuration buffers within LATM/LOAS transport layer.
  8717. </p>
  8718. <p>Must be a 16-bits non-negative integer.
  8719. </p>
  8720. <p>Default value is 0.
  8721. </p>
  8722. </dd>
  8723. <dt><samp>vbr</samp></dt>
  8724. <dd><p>Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
  8725. good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
  8726. (Constant Bit Rate) is enabled.
  8727. </p>
  8728. <p>Currently only the &lsquo;<samp>aac_low</samp>&rsquo; profile supports VBR encoding.
  8729. </p>
  8730. <p>VBR modes 1-5 correspond to roughly the following average bit rates:
  8731. </p>
  8732. <dl compact="compact">
  8733. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  8734. <dd><p>32 kbps/channel
  8735. </p></dd>
  8736. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  8737. <dd><p>40 kbps/channel
  8738. </p></dd>
  8739. <dt>&lsquo;<samp>3</samp>&rsquo;</dt>
  8740. <dd><p>48-56 kbps/channel
  8741. </p></dd>
  8742. <dt>&lsquo;<samp>4</samp>&rsquo;</dt>
  8743. <dd><p>64 kbps/channel
  8744. </p></dd>
  8745. <dt>&lsquo;<samp>5</samp>&rsquo;</dt>
  8746. <dd><p>about 80-96 kbps/channel
  8747. </p></dd>
  8748. </dl>
  8749. <p>Default value is 0.
  8750. </p></dd>
  8751. </dl>
  8752. <a name="Examples-4"></a>
  8753. <h4 class="subsection">15.5.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-4" aria-hidden="true">TOC</a></span></h4>
  8754. <ul>
  8755. <li> Use <code>ffmpeg</code> to convert an audio file to VBR AAC in an M4A (MP4)
  8756. container:
  8757. <div class="example">
  8758. <pre class="example">ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
  8759. </pre></div>
  8760. </li><li> Use <code>ffmpeg</code> to convert an audio file to CBR 64k kbps AAC, using the
  8761. High-Efficiency AAC profile:
  8762. <div class="example">
  8763. <pre class="example">ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
  8764. </pre></div>
  8765. </li></ul>
  8766. <span id="libmp3lame"></span><a name="libmp3lame-1"></a>
  8767. <h3 class="section">15.6 libmp3lame<span class="pull-right"><a class="anchor hidden-xs" href="#libmp3lame-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libmp3lame-1" aria-hidden="true">TOC</a></span></h3>
  8768. <p>LAME (Lame Ain&rsquo;t an MP3 Encoder) MP3 encoder wrapper.
  8769. </p>
  8770. <p>Requires the presence of the libmp3lame headers and library during
  8771. configuration. You need to explicitly configure the build with
  8772. <code>--enable-libmp3lame</code>.
  8773. </p>
  8774. <p>See <a href="#libshine">libshine</a> for a fixed-point MP3 encoder, although with a
  8775. lower quality.
  8776. </p>
  8777. <a name="Options-13"></a>
  8778. <h4 class="subsection">15.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-13" aria-hidden="true">TOC</a></span></h4>
  8779. <p>The following options are supported by the libmp3lame wrapper. The
  8780. <code>lame</code>-equivalent of the options are listed in parentheses.
  8781. </p>
  8782. <dl compact="compact">
  8783. <dt><samp>b (<em>-b</em>)</samp></dt>
  8784. <dd><p>Set bitrate expressed in bits/s for CBR or ABR. LAME <code>bitrate</code> is
  8785. expressed in kilobits/s.
  8786. </p>
  8787. </dd>
  8788. <dt><samp>q (<em>-V</em>)</samp></dt>
  8789. <dd><p>Set constant quality setting for VBR. This option is valid only
  8790. using the <code>ffmpeg</code> command-line tool. For library interface
  8791. users, use <samp>global_quality</samp>.
  8792. </p>
  8793. </dd>
  8794. <dt><samp>compression_level (<em>-q</em>)</samp></dt>
  8795. <dd><p>Set algorithm quality. Valid arguments are integers in the 0-9 range,
  8796. with 0 meaning highest quality but slowest, and 9 meaning fastest
  8797. while producing the worst quality.
  8798. </p>
  8799. </dd>
  8800. <dt><samp>cutoff (<em>--lowpass</em>)</samp></dt>
  8801. <dd><p>Set lowpass cutoff frequency. If unspecified, the encoder dynamically
  8802. adjusts the cutoff.
  8803. </p>
  8804. </dd>
  8805. <dt><samp>reservoir</samp></dt>
  8806. <dd><p>Enable use of bit reservoir when set to 1. Default value is 1. LAME
  8807. has this enabled by default, but can be overridden by use
  8808. <samp>--nores</samp> option.
  8809. </p>
  8810. </dd>
  8811. <dt><samp>joint_stereo (<em>-m j</em>)</samp></dt>
  8812. <dd><p>Enable the encoder to use (on a frame by frame basis) either L/R
  8813. stereo or mid/side stereo. Default value is 1.
  8814. </p>
  8815. </dd>
  8816. <dt><samp>abr (<em>--abr</em>)</samp></dt>
  8817. <dd><p>Enable the encoder to use ABR when set to 1. The <code>lame</code>
  8818. <samp>--abr</samp> sets the target bitrate, while this options only
  8819. tells FFmpeg to use ABR still relies on <samp>b</samp> to set bitrate.
  8820. </p>
  8821. </dd>
  8822. </dl>
  8823. <a name="libopencore_002damrnb-1"></a>
  8824. <h3 class="section">15.7 libopencore-amrnb<span class="pull-right"><a class="anchor hidden-xs" href="#libopencore_002damrnb-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopencore_002damrnb-1" aria-hidden="true">TOC</a></span></h3>
  8825. <p>OpenCORE Adaptive Multi-Rate Narrowband encoder.
  8826. </p>
  8827. <p>Requires the presence of the libopencore-amrnb headers and library during
  8828. configuration. You need to explicitly configure the build with
  8829. <code>--enable-libopencore-amrnb --enable-version3</code>.
  8830. </p>
  8831. <p>This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
  8832. but you can override it by setting <samp>strict</samp> to &lsquo;<samp>unofficial</samp>&rsquo; or
  8833. lower.
  8834. </p>
  8835. <a name="Options-14"></a>
  8836. <h4 class="subsection">15.7.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-14" aria-hidden="true">TOC</a></span></h4>
  8837. <dl compact="compact">
  8838. <dt><samp>b</samp></dt>
  8839. <dd><p>Set bitrate in bits per second. Only the following bitrates are supported,
  8840. otherwise libavcodec will round to the nearest valid bitrate.
  8841. </p>
  8842. <dl compact="compact">
  8843. <dt><samp>4750</samp></dt>
  8844. <dt><samp>5150</samp></dt>
  8845. <dt><samp>5900</samp></dt>
  8846. <dt><samp>6700</samp></dt>
  8847. <dt><samp>7400</samp></dt>
  8848. <dt><samp>7950</samp></dt>
  8849. <dt><samp>10200</samp></dt>
  8850. <dt><samp>12200</samp></dt>
  8851. </dl>
  8852. </dd>
  8853. <dt><samp>dtx</samp></dt>
  8854. <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
  8855. default value is 0 (disabled).
  8856. </p>
  8857. </dd>
  8858. </dl>
  8859. <a name="libopus-1"></a>
  8860. <h3 class="section">15.8 libopus<span class="pull-right"><a class="anchor hidden-xs" href="#libopus-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopus-1" aria-hidden="true">TOC</a></span></h3>
  8861. <p>libopus Opus Interactive Audio Codec encoder wrapper.
  8862. </p>
  8863. <p>Requires the presence of the libopus headers and library during
  8864. configuration. You need to explicitly configure the build with
  8865. <code>--enable-libopus</code>.
  8866. </p>
  8867. <a name="Option-Mapping"></a>
  8868. <h4 class="subsection">15.8.1 Option Mapping<span class="pull-right"><a class="anchor hidden-xs" href="#Option-Mapping" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Option-Mapping" aria-hidden="true">TOC</a></span></h4>
  8869. <p>Most libopus options are modelled after the <code>opusenc</code> utility from
  8870. opus-tools. The following is an option mapping chart describing options
  8871. supported by the libopus wrapper, and their <code>opusenc</code>-equivalent
  8872. in parentheses.
  8873. </p>
  8874. <dl compact="compact">
  8875. <dt><samp>b (<em>bitrate</em>)</samp></dt>
  8876. <dd><p>Set the bit rate in bits/s. FFmpeg&rsquo;s <samp>b</samp> option is
  8877. expressed in bits/s, while <code>opusenc</code>&rsquo;s <samp>bitrate</samp> in
  8878. kilobits/s.
  8879. </p>
  8880. </dd>
  8881. <dt><samp>vbr (<em>vbr</em>, <em>hard-cbr</em>, and <em>cvbr</em>)</samp></dt>
  8882. <dd><p>Set VBR mode. The FFmpeg <samp>vbr</samp> option has the following
  8883. valid arguments, with the <code>opusenc</code> equivalent options
  8884. in parentheses:
  8885. </p>
  8886. <dl compact="compact">
  8887. <dt>&lsquo;<samp>off (<em>hard-cbr</em>)</samp>&rsquo;</dt>
  8888. <dd><p>Use constant bit rate encoding.
  8889. </p>
  8890. </dd>
  8891. <dt>&lsquo;<samp>on (<em>vbr</em>)</samp>&rsquo;</dt>
  8892. <dd><p>Use variable bit rate encoding (the default).
  8893. </p>
  8894. </dd>
  8895. <dt>&lsquo;<samp>constrained (<em>cvbr</em>)</samp>&rsquo;</dt>
  8896. <dd><p>Use constrained variable bit rate encoding.
  8897. </p></dd>
  8898. </dl>
  8899. </dd>
  8900. <dt><samp>compression_level (<em>comp</em>)</samp></dt>
  8901. <dd><p>Set encoding algorithm complexity. Valid options are integers in
  8902. the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
  8903. gives the highest quality but slowest encoding. The default is 10.
  8904. </p>
  8905. </dd>
  8906. <dt><samp>frame_duration (<em>framesize</em>)</samp></dt>
  8907. <dd><p>Set maximum frame size, or duration of a frame in milliseconds. The
  8908. argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
  8909. frame sizes achieve lower latency but less quality at a given bitrate.
  8910. Sizes greater than 20ms are only interesting at fairly low bitrates.
  8911. The default is 20ms.
  8912. </p>
  8913. </dd>
  8914. <dt><samp>packet_loss (<em>expect-loss</em>)</samp></dt>
  8915. <dd><p>Set expected packet loss percentage. The default is 0.
  8916. </p>
  8917. </dd>
  8918. <dt><samp>fec (<em>n/a</em>)</samp></dt>
  8919. <dd><p>Enable inband forward error correction. <samp>packet_loss</samp> must be non-zero
  8920. to take advantage - frequency of FEC &rsquo;side-data&rsquo; is proportional to expected packet loss.
  8921. Default is disabled.
  8922. </p>
  8923. </dd>
  8924. <dt><samp>application (N.A.)</samp></dt>
  8925. <dd><p>Set intended application type. Valid options are listed below:
  8926. </p>
  8927. <dl compact="compact">
  8928. <dt>&lsquo;<samp>voip</samp>&rsquo;</dt>
  8929. <dd><p>Favor improved speech intelligibility.
  8930. </p></dd>
  8931. <dt>&lsquo;<samp>audio</samp>&rsquo;</dt>
  8932. <dd><p>Favor faithfulness to the input (the default).
  8933. </p></dd>
  8934. <dt>&lsquo;<samp>lowdelay</samp>&rsquo;</dt>
  8935. <dd><p>Restrict to only the lowest delay modes.
  8936. </p></dd>
  8937. </dl>
  8938. </dd>
  8939. <dt><samp>cutoff (N.A.)</samp></dt>
  8940. <dd><p>Set cutoff bandwidth in Hz. The argument must be exactly one of the
  8941. following: 4000, 6000, 8000, 12000, or 20000, corresponding to
  8942. narrowband, mediumband, wideband, super wideband, and fullband
  8943. respectively. The default is 0 (cutoff disabled).
  8944. </p>
  8945. </dd>
  8946. <dt><samp>mapping_family (<em>mapping_family</em>)</samp></dt>
  8947. <dd><p>Set channel mapping family to be used by the encoder. The default value of -1
  8948. uses mapping family 0 for mono and stereo inputs, and mapping family 1
  8949. otherwise. The default also disables the surround masking and LFE bandwidth
  8950. optimzations in libopus, and requires that the input contains 8 channels or
  8951. fewer.
  8952. </p>
  8953. <p>Other values include 0 for mono and stereo, 1 for surround sound with masking
  8954. and LFE bandwidth optimizations, and 255 for independent streams with an
  8955. unspecified channel layout.
  8956. </p>
  8957. </dd>
  8958. <dt><samp>apply_phase_inv (N.A.) (requires libopus &gt;= 1.2)</samp></dt>
  8959. <dd><p>If set to 0, disables the use of phase inversion for intensity stereo,
  8960. improving the quality of mono downmixes, but slightly reducing normal stereo
  8961. quality. The default is 1 (phase inversion enabled).
  8962. </p>
  8963. </dd>
  8964. </dl>
  8965. <span id="libshine"></span><a name="libshine-1"></a>
  8966. <h3 class="section">15.9 libshine<span class="pull-right"><a class="anchor hidden-xs" href="#libshine-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libshine-1" aria-hidden="true">TOC</a></span></h3>
  8967. <p>Shine Fixed-Point MP3 encoder wrapper.
  8968. </p>
  8969. <p>Shine is a fixed-point MP3 encoder. It has a far better performance on
  8970. platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
  8971. However, as it is more targeted on performance than quality, it is not on par
  8972. with LAME and other production-grade encoders quality-wise. Also, according to
  8973. the project&rsquo;s homepage, this encoder may not be free of bugs as the code was
  8974. written a long time ago and the project was dead for at least 5 years.
  8975. </p>
  8976. <p>This encoder only supports stereo and mono input. This is also CBR-only.
  8977. </p>
  8978. <p>The original project (last updated in early 2007) is at
  8979. <a href="http://sourceforge.net/projects/libshine-fxp/">http://sourceforge.net/projects/libshine-fxp/</a>. We only support the
  8980. updated fork by the Savonet/Liquidsoap project at <a href="https://github.com/savonet/shine">https://github.com/savonet/shine</a>.
  8981. </p>
  8982. <p>Requires the presence of the libshine headers and library during
  8983. configuration. You need to explicitly configure the build with
  8984. <code>--enable-libshine</code>.
  8985. </p>
  8986. <p>See also <a href="#libmp3lame">libmp3lame</a>.
  8987. </p>
  8988. <a name="Options-15"></a>
  8989. <h4 class="subsection">15.9.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-15" aria-hidden="true">TOC</a></span></h4>
  8990. <p>The following options are supported by the libshine wrapper. The
  8991. <code>shineenc</code>-equivalent of the options are listed in parentheses.
  8992. </p>
  8993. <dl compact="compact">
  8994. <dt><samp>b (<em>-b</em>)</samp></dt>
  8995. <dd><p>Set bitrate expressed in bits/s for CBR. <code>shineenc</code> <samp>-b</samp> option
  8996. is expressed in kilobits/s.
  8997. </p>
  8998. </dd>
  8999. </dl>
  9000. <a name="libtwolame"></a>
  9001. <h3 class="section">15.10 libtwolame<span class="pull-right"><a class="anchor hidden-xs" href="#libtwolame" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libtwolame" aria-hidden="true">TOC</a></span></h3>
  9002. <p>TwoLAME MP2 encoder wrapper.
  9003. </p>
  9004. <p>Requires the presence of the libtwolame headers and library during
  9005. configuration. You need to explicitly configure the build with
  9006. <code>--enable-libtwolame</code>.
  9007. </p>
  9008. <a name="Options-16"></a>
  9009. <h4 class="subsection">15.10.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-16" aria-hidden="true">TOC</a></span></h4>
  9010. <p>The following options are supported by the libtwolame wrapper. The
  9011. <code>twolame</code>-equivalent options follow the FFmpeg ones and are in
  9012. parentheses.
  9013. </p>
  9014. <dl compact="compact">
  9015. <dt><samp>b (<em>-b</em>)</samp></dt>
  9016. <dd><p>Set bitrate expressed in bits/s for CBR. <code>twolame</code> <samp>b</samp>
  9017. option is expressed in kilobits/s. Default value is 128k.
  9018. </p>
  9019. </dd>
  9020. <dt><samp>q (<em>-V</em>)</samp></dt>
  9021. <dd><p>Set quality for experimental VBR support. Maximum value range is
  9022. from -50 to 50, useful range is from -10 to 10. The higher the
  9023. value, the better the quality. This option is valid only using the
  9024. <code>ffmpeg</code> command-line tool. For library interface users,
  9025. use <samp>global_quality</samp>.
  9026. </p>
  9027. </dd>
  9028. <dt><samp>mode (<em>--mode</em>)</samp></dt>
  9029. <dd><p>Set the mode of the resulting audio. Possible values:
  9030. </p>
  9031. <dl compact="compact">
  9032. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  9033. <dd><p>Choose mode automatically based on the input. This is the default.
  9034. </p></dd>
  9035. <dt>&lsquo;<samp>stereo</samp>&rsquo;</dt>
  9036. <dd><p>Stereo
  9037. </p></dd>
  9038. <dt>&lsquo;<samp>joint_stereo</samp>&rsquo;</dt>
  9039. <dd><p>Joint stereo
  9040. </p></dd>
  9041. <dt>&lsquo;<samp>dual_channel</samp>&rsquo;</dt>
  9042. <dd><p>Dual channel
  9043. </p></dd>
  9044. <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
  9045. <dd><p>Mono
  9046. </p></dd>
  9047. </dl>
  9048. </dd>
  9049. <dt><samp>psymodel (<em>--psyc-mode</em>)</samp></dt>
  9050. <dd><p>Set psychoacoustic model to use in encoding. The argument must be
  9051. an integer between -1 and 4, inclusive. The higher the value, the
  9052. better the quality. The default value is 3.
  9053. </p>
  9054. </dd>
  9055. <dt><samp>energy_levels (<em>--energy</em>)</samp></dt>
  9056. <dd><p>Enable energy levels extensions when set to 1. The default value is
  9057. 0 (disabled).
  9058. </p>
  9059. </dd>
  9060. <dt><samp>error_protection (<em>--protect</em>)</samp></dt>
  9061. <dd><p>Enable CRC error protection when set to 1. The default value is 0
  9062. (disabled).
  9063. </p>
  9064. </dd>
  9065. <dt><samp>copyright (<em>--copyright</em>)</samp></dt>
  9066. <dd><p>Set MPEG audio copyright flag when set to 1. The default value is 0
  9067. (disabled).
  9068. </p>
  9069. </dd>
  9070. <dt><samp>original (<em>--original</em>)</samp></dt>
  9071. <dd><p>Set MPEG audio original flag when set to 1. The default value is 0
  9072. (disabled).
  9073. </p>
  9074. </dd>
  9075. </dl>
  9076. <a name="libvo_002damrwbenc"></a>
  9077. <h3 class="section">15.11 libvo-amrwbenc<span class="pull-right"><a class="anchor hidden-xs" href="#libvo_002damrwbenc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvo_002damrwbenc" aria-hidden="true">TOC</a></span></h3>
  9078. <p>VisualOn Adaptive Multi-Rate Wideband encoder.
  9079. </p>
  9080. <p>Requires the presence of the libvo-amrwbenc headers and library during
  9081. configuration. You need to explicitly configure the build with
  9082. <code>--enable-libvo-amrwbenc --enable-version3</code>.
  9083. </p>
  9084. <p>This is a mono-only encoder. Officially it only supports 16000Hz sample
  9085. rate, but you can override it by setting <samp>strict</samp> to
  9086. &lsquo;<samp>unofficial</samp>&rsquo; or lower.
  9087. </p>
  9088. <a name="Options-17"></a>
  9089. <h4 class="subsection">15.11.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-17" aria-hidden="true">TOC</a></span></h4>
  9090. <dl compact="compact">
  9091. <dt><samp>b</samp></dt>
  9092. <dd><p>Set bitrate in bits/s. Only the following bitrates are supported, otherwise
  9093. libavcodec will round to the nearest valid bitrate.
  9094. </p>
  9095. <dl compact="compact">
  9096. <dt>&lsquo;<samp>6600</samp>&rsquo;</dt>
  9097. <dt>&lsquo;<samp>8850</samp>&rsquo;</dt>
  9098. <dt>&lsquo;<samp>12650</samp>&rsquo;</dt>
  9099. <dt>&lsquo;<samp>14250</samp>&rsquo;</dt>
  9100. <dt>&lsquo;<samp>15850</samp>&rsquo;</dt>
  9101. <dt>&lsquo;<samp>18250</samp>&rsquo;</dt>
  9102. <dt>&lsquo;<samp>19850</samp>&rsquo;</dt>
  9103. <dt>&lsquo;<samp>23050</samp>&rsquo;</dt>
  9104. <dt>&lsquo;<samp>23850</samp>&rsquo;</dt>
  9105. </dl>
  9106. </dd>
  9107. <dt><samp>dtx</samp></dt>
  9108. <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
  9109. default value is 0 (disabled).
  9110. </p>
  9111. </dd>
  9112. </dl>
  9113. <a name="libvorbis"></a>
  9114. <h3 class="section">15.12 libvorbis<span class="pull-right"><a class="anchor hidden-xs" href="#libvorbis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvorbis" aria-hidden="true">TOC</a></span></h3>
  9115. <p>libvorbis encoder wrapper.
  9116. </p>
  9117. <p>Requires the presence of the libvorbisenc headers and library during
  9118. configuration. You need to explicitly configure the build with
  9119. <code>--enable-libvorbis</code>.
  9120. </p>
  9121. <a name="Options-18"></a>
  9122. <h4 class="subsection">15.12.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-18" aria-hidden="true">TOC</a></span></h4>
  9123. <p>The following options are supported by the libvorbis wrapper. The
  9124. <code>oggenc</code>-equivalent of the options are listed in parentheses.
  9125. </p>
  9126. <p>To get a more accurate and extensive documentation of the libvorbis
  9127. options, consult the libvorbisenc&rsquo;s and <code>oggenc</code>&rsquo;s documentations.
  9128. See <a href="http://xiph.org/vorbis/">http://xiph.org/vorbis/</a>,
  9129. <a href="http://wiki.xiph.org/Vorbis-tools">http://wiki.xiph.org/Vorbis-tools</a>, and oggenc(1).
  9130. </p>
  9131. <dl compact="compact">
  9132. <dt><samp>b (<em>-b</em>)</samp></dt>
  9133. <dd><p>Set bitrate expressed in bits/s for ABR. <code>oggenc</code> <samp>-b</samp> is
  9134. expressed in kilobits/s.
  9135. </p>
  9136. </dd>
  9137. <dt><samp>q (<em>-q</em>)</samp></dt>
  9138. <dd><p>Set constant quality setting for VBR. The value should be a float
  9139. number in the range of -1.0 to 10.0. The higher the value, the better
  9140. the quality. The default value is &lsquo;<samp>3.0</samp>&rsquo;.
  9141. </p>
  9142. <p>This option is valid only using the <code>ffmpeg</code> command-line tool.
  9143. For library interface users, use <samp>global_quality</samp>.
  9144. </p>
  9145. </dd>
  9146. <dt><samp>cutoff (<em>--advanced-encode-option lowpass_frequency=N</em>)</samp></dt>
  9147. <dd><p>Set cutoff bandwidth in Hz, a value of 0 disables cutoff. <code>oggenc</code>&rsquo;s
  9148. related option is expressed in kHz. The default value is &lsquo;<samp>0</samp>&rsquo; (cutoff
  9149. disabled).
  9150. </p>
  9151. </dd>
  9152. <dt><samp>minrate (<em>-m</em>)</samp></dt>
  9153. <dd><p>Set minimum bitrate expressed in bits/s. <code>oggenc</code> <samp>-m</samp> is
  9154. expressed in kilobits/s.
  9155. </p>
  9156. </dd>
  9157. <dt><samp>maxrate (<em>-M</em>)</samp></dt>
  9158. <dd><p>Set maximum bitrate expressed in bits/s. <code>oggenc</code> <samp>-M</samp> is
  9159. expressed in kilobits/s. This only has effect on ABR mode.
  9160. </p>
  9161. </dd>
  9162. <dt><samp>iblock (<em>--advanced-encode-option impulse_noisetune=N</em>)</samp></dt>
  9163. <dd><p>Set noise floor bias for impulse blocks. The value is a float number from
  9164. -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
  9165. to the crispness of transients in the encoded audio. The tradeoff for better
  9166. transient response is a higher bitrate.
  9167. </p>
  9168. </dd>
  9169. </dl>
  9170. <span id="mjpegenc"></span><a name="mjpeg"></a>
  9171. <h3 class="section">15.13 mjpeg<span class="pull-right"><a class="anchor hidden-xs" href="#mjpeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mjpeg" aria-hidden="true">TOC</a></span></h3>
  9172. <p>Motion JPEG encoder.
  9173. </p>
  9174. <a name="Options-19"></a>
  9175. <h4 class="subsection">15.13.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-19" aria-hidden="true">TOC</a></span></h4>
  9176. <dl compact="compact">
  9177. <dt><samp>huffman</samp></dt>
  9178. <dd><p>Set the huffman encoding strategy. Possible values:
  9179. </p>
  9180. <dl compact="compact">
  9181. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  9182. <dd><p>Use the default huffman tables. This is the default strategy.
  9183. </p>
  9184. </dd>
  9185. <dt>&lsquo;<samp>optimal</samp>&rsquo;</dt>
  9186. <dd><p>Compute and use optimal huffman tables.
  9187. </p>
  9188. </dd>
  9189. </dl>
  9190. </dd>
  9191. </dl>
  9192. <span id="wavpackenc"></span><a name="wavpack"></a>
  9193. <h3 class="section">15.14 wavpack<span class="pull-right"><a class="anchor hidden-xs" href="#wavpack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-wavpack" aria-hidden="true">TOC</a></span></h3>
  9194. <p>WavPack lossless audio encoder.
  9195. </p>
  9196. <a name="Options-20"></a>
  9197. <h4 class="subsection">15.14.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-20" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-20" aria-hidden="true">TOC</a></span></h4>
  9198. <p>The equivalent options for <code>wavpack</code> command line utility are listed in
  9199. parentheses.
  9200. </p>
  9201. <a name="Shared-options"></a>
  9202. <h4 class="subsubsection">15.14.1.1 Shared options<span class="pull-right"><a class="anchor hidden-xs" href="#Shared-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Shared-options" aria-hidden="true">TOC</a></span></h4>
  9203. <p>The following shared options are effective for this encoder. Only special notes
  9204. about this particular encoder will be documented here. For the general meaning
  9205. of the options, see <a href="#codec_002doptions">the Codec Options chapter</a>.
  9206. </p>
  9207. <dl compact="compact">
  9208. <dt><samp>frame_size (<em>--blocksize</em>)</samp></dt>
  9209. <dd><p>For this encoder, the range for this option is between 128 and 131072. Default
  9210. is automatically decided based on sample rate and number of channel.
  9211. </p>
  9212. <p>For the complete formula of calculating default, see
  9213. <samp>libavcodec/wavpackenc.c</samp>.
  9214. </p>
  9215. </dd>
  9216. <dt><samp>compression_level (<em>-f</em>, <em>-h</em>, <em>-hh</em>, and <em>-x</em>)</samp></dt>
  9217. </dl>
  9218. <a name="Private-options"></a>
  9219. <h4 class="subsubsection">15.14.1.2 Private options<span class="pull-right"><a class="anchor hidden-xs" href="#Private-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Private-options" aria-hidden="true">TOC</a></span></h4>
  9220. <dl compact="compact">
  9221. <dt><samp>joint_stereo (<em>-j</em>)</samp></dt>
  9222. <dd><p>Set whether to enable joint stereo. Valid values are:
  9223. </p>
  9224. <dl compact="compact">
  9225. <dt>&lsquo;<samp>on (<em>1</em>)</samp>&rsquo;</dt>
  9226. <dd><p>Force mid/side audio encoding.
  9227. </p></dd>
  9228. <dt>&lsquo;<samp>off (<em>0</em>)</samp>&rsquo;</dt>
  9229. <dd><p>Force left/right audio encoding.
  9230. </p></dd>
  9231. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  9232. <dd><p>Let the encoder decide automatically.
  9233. </p></dd>
  9234. </dl>
  9235. </dd>
  9236. <dt><samp>optimize_mono</samp></dt>
  9237. <dd><p>Set whether to enable optimization for mono. This option is only effective for
  9238. non-mono streams. Available values:
  9239. </p>
  9240. <dl compact="compact">
  9241. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  9242. <dd><p>enabled
  9243. </p></dd>
  9244. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  9245. <dd><p>disabled
  9246. </p></dd>
  9247. </dl>
  9248. </dd>
  9249. </dl>
  9250. <a name="Video-Encoders"></a>
  9251. <h2 class="chapter">16 Video Encoders<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Encoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Encoders" aria-hidden="true">TOC</a></span></h2>
  9252. <p>A description of some of the currently available video encoders
  9253. follows.
  9254. </p>
  9255. <a name="GIF"></a>
  9256. <h3 class="section">16.1 GIF<span class="pull-right"><a class="anchor hidden-xs" href="#GIF" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-GIF" aria-hidden="true">TOC</a></span></h3>
  9257. <p>GIF image/animation encoder.
  9258. </p>
  9259. <a name="Options-21"></a>
  9260. <h4 class="subsection">16.1.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-21" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-21" aria-hidden="true">TOC</a></span></h4>
  9261. <dl compact="compact">
  9262. <dt><samp>gifflags <var>integer</var></samp></dt>
  9263. <dd><p>Sets the flags used for GIF encoding.
  9264. </p>
  9265. <dl compact="compact">
  9266. <dt><samp>offsetting</samp></dt>
  9267. <dd><p>Enables picture offsetting.
  9268. </p>
  9269. <p>Default is enabled.
  9270. </p>
  9271. </dd>
  9272. <dt><samp>transdiff</samp></dt>
  9273. <dd><p>Enables transparency detection between frames.
  9274. </p>
  9275. <p>Default is enabled.
  9276. </p>
  9277. </dd>
  9278. </dl>
  9279. </dd>
  9280. <dt><samp>gifimage <var>integer</var></samp></dt>
  9281. <dd><p>Enables encoding one full GIF image per frame, rather than an animated GIF.
  9282. </p>
  9283. <p>Default value is <samp>0</samp>.
  9284. </p>
  9285. </dd>
  9286. <dt><samp>global_palette <var>integer</var></samp></dt>
  9287. <dd><p>Writes a palette to the global GIF header where feasible.
  9288. </p>
  9289. <p>If disabled, every frame will always have a palette written, even if there
  9290. is a global palette supplied.
  9291. </p>
  9292. <p>Default value is <samp>1</samp>.
  9293. </p>
  9294. </dd>
  9295. </dl>
  9296. <a name="Hap"></a>
  9297. <h3 class="section">16.2 Hap<span class="pull-right"><a class="anchor hidden-xs" href="#Hap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Hap" aria-hidden="true">TOC</a></span></h3>
  9298. <p>Vidvox Hap video encoder.
  9299. </p>
  9300. <a name="Options-22"></a>
  9301. <h4 class="subsection">16.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-22" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-22" aria-hidden="true">TOC</a></span></h4>
  9302. <dl compact="compact">
  9303. <dt><samp>format <var>integer</var></samp></dt>
  9304. <dd><p>Specifies the Hap format to encode.
  9305. </p>
  9306. <dl compact="compact">
  9307. <dt><samp>hap</samp></dt>
  9308. <dt><samp>hap_alpha</samp></dt>
  9309. <dt><samp>hap_q</samp></dt>
  9310. </dl>
  9311. <p>Default value is <samp>hap</samp>.
  9312. </p>
  9313. </dd>
  9314. <dt><samp>chunks <var>integer</var></samp></dt>
  9315. <dd><p>Specifies the number of chunks to split frames into, between 1 and 64. This
  9316. permits multithreaded decoding of large frames, potentially at the cost of
  9317. data-rate. The encoder may modify this value to divide frames evenly.
  9318. </p>
  9319. <p>Default value is <var>1</var>.
  9320. </p>
  9321. </dd>
  9322. <dt><samp>compressor <var>integer</var></samp></dt>
  9323. <dd><p>Specifies the second-stage compressor to use. If set to <samp>none</samp>,
  9324. <samp>chunks</samp> will be limited to 1, as chunked uncompressed frames offer no
  9325. benefit.
  9326. </p>
  9327. <dl compact="compact">
  9328. <dt><samp>none</samp></dt>
  9329. <dt><samp>snappy</samp></dt>
  9330. </dl>
  9331. <p>Default value is <samp>snappy</samp>.
  9332. </p>
  9333. </dd>
  9334. </dl>
  9335. <a name="jpeg2000"></a>
  9336. <h3 class="section">16.3 jpeg2000<span class="pull-right"><a class="anchor hidden-xs" href="#jpeg2000" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-jpeg2000" aria-hidden="true">TOC</a></span></h3>
  9337. <p>The native jpeg 2000 encoder is lossy by default, the <code>-q:v</code>
  9338. option can be used to set the encoding quality. Lossless encoding
  9339. can be selected with <code>-pred 1</code>.
  9340. </p>
  9341. <a name="Options-23"></a>
  9342. <h4 class="subsection">16.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-23" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-23" aria-hidden="true">TOC</a></span></h4>
  9343. <dl compact="compact">
  9344. <dt><samp>format <var>integer</var></samp></dt>
  9345. <dd><p>Can be set to either <code>j2k</code> or <code>jp2</code> (the default) that
  9346. makes it possible to store non-rgb pix_fmts.
  9347. </p>
  9348. </dd>
  9349. <dt><samp>tile_width <var>integer</var></samp></dt>
  9350. <dd><p>Sets tile width. Range is 1 to 1073741824. Default is 256.
  9351. </p>
  9352. </dd>
  9353. <dt><samp>tile_height <var>integer</var></samp></dt>
  9354. <dd><p>Sets tile height. Range is 1 to 1073741824. Default is 256.
  9355. </p>
  9356. </dd>
  9357. <dt><samp>pred <var>integer</var></samp></dt>
  9358. <dd><p>Allows setting the discrete wavelet transform (DWT) type
  9359. </p><dl compact="compact">
  9360. <dt><samp>dwt97int (Lossy)</samp></dt>
  9361. <dt><samp>dwt53 (Lossless)</samp></dt>
  9362. </dl>
  9363. <p>Default is <code>dwt97int</code>
  9364. </p>
  9365. </dd>
  9366. <dt><samp>sop <var>boolean</var></samp></dt>
  9367. <dd><p>Enable this to add SOP marker at the start of each packet. Disabled by default.
  9368. </p>
  9369. </dd>
  9370. <dt><samp>eph <var>boolean</var></samp></dt>
  9371. <dd><p>Enable this to add EPH marker at the end of each packet header. Disabled by default.
  9372. </p>
  9373. </dd>
  9374. <dt><samp>prog <var>integer</var></samp></dt>
  9375. <dd><p>Sets the progression order to be used by the encoder.
  9376. Possible values are:
  9377. </p><dl compact="compact">
  9378. <dt><samp>lrcp</samp></dt>
  9379. <dt><samp>rlcp</samp></dt>
  9380. <dt><samp>rpcl</samp></dt>
  9381. <dt><samp>pcrl</samp></dt>
  9382. <dt><samp>cprl</samp></dt>
  9383. </dl>
  9384. <p>Set to <code>lrcp</code> by default.
  9385. </p>
  9386. </dd>
  9387. <dt><samp>layer_rates <var>string</var></samp></dt>
  9388. <dd><p>By default, when this option is not used, compression is done using the quality metric.
  9389. This option allows for compression using compression ratio. The compression ratio for each
  9390. level could be specified. The compression ratio of a layer <code>l</code> species the what ratio of
  9391. total file size is contained in the first <code>l</code> layers.
  9392. </p>
  9393. <p>Example usage:
  9394. </p>
  9395. <div class="example">
  9396. <pre class="example">ffmpeg -i input.bmp -c:v jpeg2000 -layer_rates &quot;100,10,1&quot; output.j2k
  9397. </pre></div>
  9398. <p>This would compress the image to contain 3 layers, where the data contained in the
  9399. first layer would be compressed by 1000 times, compressed by 100 in the first two layers,
  9400. and shall contain all data while using all 3 layers.
  9401. </p>
  9402. </dd>
  9403. </dl>
  9404. <a name="librav1e"></a>
  9405. <h3 class="section">16.4 librav1e<span class="pull-right"><a class="anchor hidden-xs" href="#librav1e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-librav1e" aria-hidden="true">TOC</a></span></h3>
  9406. <p>rav1e AV1 encoder wrapper.
  9407. </p>
  9408. <p>Requires the presence of the rav1e headers and library during configuration.
  9409. You need to explicitly configure the build with <code>--enable-librav1e</code>.
  9410. </p>
  9411. <a name="Options-24"></a>
  9412. <h4 class="subsection">16.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-24" aria-hidden="true">TOC</a></span></h4>
  9413. <dl compact="compact">
  9414. <dt><samp>qmax</samp></dt>
  9415. <dd><p>Sets the maximum quantizer to use when using bitrate mode.
  9416. </p>
  9417. </dd>
  9418. <dt><samp>qmin</samp></dt>
  9419. <dd><p>Sets the minimum quantizer to use when using bitrate mode.
  9420. </p>
  9421. </dd>
  9422. <dt><samp>qp</samp></dt>
  9423. <dd><p>Uses quantizer mode to encode at the given quantizer (0-255).
  9424. </p>
  9425. </dd>
  9426. <dt><samp>speed</samp></dt>
  9427. <dd><p>Selects the speed preset (0-10) to encode with.
  9428. </p>
  9429. </dd>
  9430. <dt><samp>tiles</samp></dt>
  9431. <dd><p>Selects how many tiles to encode with.
  9432. </p>
  9433. </dd>
  9434. <dt><samp>tile-rows</samp></dt>
  9435. <dd><p>Selects how many rows of tiles to encode with.
  9436. </p>
  9437. </dd>
  9438. <dt><samp>tile-columns</samp></dt>
  9439. <dd><p>Selects how many columns of tiles to encode with.
  9440. </p>
  9441. </dd>
  9442. <dt><samp>rav1e-params</samp></dt>
  9443. <dd><p>Set rav1e options using a list of <var>key</var>=<var>value</var> pairs separated
  9444. by &quot;:&quot;. See <code>rav1e --help</code> for a list of options.
  9445. </p>
  9446. <p>For example to specify librav1e encoding options with <samp>-rav1e-params</samp>:
  9447. </p>
  9448. <div class="example">
  9449. <pre class="example">ffmpeg -i input -c:v librav1e -b:v 500K -rav1e-params speed=5:low_latency=true output.mp4
  9450. </pre></div>
  9451. </dd>
  9452. </dl>
  9453. <a name="libaom_002dav1"></a>
  9454. <h3 class="section">16.5 libaom-av1<span class="pull-right"><a class="anchor hidden-xs" href="#libaom_002dav1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libaom_002dav1" aria-hidden="true">TOC</a></span></h3>
  9455. <p>libaom AV1 encoder wrapper.
  9456. </p>
  9457. <p>Requires the presence of the libaom headers and library during
  9458. configuration. You need to explicitly configure the build with
  9459. <code>--enable-libaom</code>.
  9460. </p>
  9461. <a name="Options-25"></a>
  9462. <h4 class="subsection">16.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-25" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-25" aria-hidden="true">TOC</a></span></h4>
  9463. <p>The wrapper supports the following standard libavcodec options:
  9464. </p>
  9465. <dl compact="compact">
  9466. <dt><samp>b</samp></dt>
  9467. <dd><p>Set bitrate target in bits/second. By default this will use
  9468. variable-bitrate mode. If <samp>maxrate</samp> and <samp>minrate</samp> are
  9469. also set to the same value then it will use constant-bitrate mode,
  9470. otherwise if <samp>crf</samp> is set as well then it will use
  9471. constrained-quality mode.
  9472. </p>
  9473. </dd>
  9474. <dt><samp>g keyint_min</samp></dt>
  9475. <dd><p>Set key frame placement. The GOP size sets the maximum distance between
  9476. key frames; if zero the output stream will be intra-only. The minimum
  9477. distance is ignored unless it is the same as the GOP size, in which case
  9478. key frames will always appear at a fixed interval. Not set by default,
  9479. so without this option the library has completely free choice about
  9480. where to place key frames.
  9481. </p>
  9482. </dd>
  9483. <dt><samp>qmin qmax</samp></dt>
  9484. <dd><p>Set minimum/maximum quantisation values. Valid range is from 0 to 63
  9485. (warning: this does not match the quantiser values actually used by AV1
  9486. - divide by four to map real quantiser values to this range). Defaults
  9487. to min/max (no constraint).
  9488. </p>
  9489. </dd>
  9490. <dt><samp>minrate maxrate bufsize rc_init_occupancy</samp></dt>
  9491. <dd><p>Set rate control buffering parameters. Not used if not set - defaults
  9492. to unconstrained variable bitrate.
  9493. </p>
  9494. </dd>
  9495. <dt><samp>threads</samp></dt>
  9496. <dd><p>Set the number of threads to use while encoding. This may require the
  9497. <samp>tiles</samp> or <samp>row-mt</samp> options to also be set to actually
  9498. use the specified number of threads fully. Defaults to the number of
  9499. hardware threads supported by the host machine.
  9500. </p>
  9501. </dd>
  9502. <dt><samp>profile</samp></dt>
  9503. <dd><p>Set the encoding profile. Defaults to using the profile which matches
  9504. the bit depth and chroma subsampling of the input.
  9505. </p>
  9506. </dd>
  9507. </dl>
  9508. <p>The wrapper also has some specific options:
  9509. </p>
  9510. <dl compact="compact">
  9511. <dt><samp>cpu-used</samp></dt>
  9512. <dd><p>Set the quality/encoding speed tradeoff. Valid range is from 0 to 8,
  9513. higher numbers indicating greater speed and lower quality. The default
  9514. value is 1, which will be slow and high quality.
  9515. </p>
  9516. </dd>
  9517. <dt><samp>auto-alt-ref</samp></dt>
  9518. <dd><p>Enable use of alternate reference frames. Defaults to the internal
  9519. default of the library.
  9520. </p>
  9521. </dd>
  9522. <dt><samp>arnr-max-frames (<em>frames</em>)</samp></dt>
  9523. <dd><p>Set altref noise reduction max frame count. Default is -1.
  9524. </p>
  9525. </dd>
  9526. <dt><samp>arnr-strength (<em>strength</em>)</samp></dt>
  9527. <dd><p>Set altref noise reduction filter strength. Range is -1 to 6. Default is -1.
  9528. </p>
  9529. </dd>
  9530. <dt><samp>aq-mode (<em>aq-mode</em>)</samp></dt>
  9531. <dd><p>Set adaptive quantization mode. Possible values:
  9532. </p>
  9533. <dl compact="compact">
  9534. <dt>&lsquo;<samp>none (<em>0</em>)</samp>&rsquo;</dt>
  9535. <dd><p>Disabled.
  9536. </p>
  9537. </dd>
  9538. <dt>&lsquo;<samp>variance (<em>1</em>)</samp>&rsquo;</dt>
  9539. <dd><p>Variance-based.
  9540. </p>
  9541. </dd>
  9542. <dt>&lsquo;<samp>complexity (<em>2</em>)</samp>&rsquo;</dt>
  9543. <dd><p>Complexity-based.
  9544. </p>
  9545. </dd>
  9546. <dt>&lsquo;<samp>cyclic (<em>3</em>)</samp>&rsquo;</dt>
  9547. <dd><p>Cyclic refresh.
  9548. </p></dd>
  9549. </dl>
  9550. </dd>
  9551. <dt><samp>tune (<em>tune</em>)</samp></dt>
  9552. <dd><p>Set the distortion metric the encoder is tuned with. Default is <code>psnr</code>.
  9553. </p>
  9554. <dl compact="compact">
  9555. <dt>&lsquo;<samp>psnr (<em>0</em>)</samp>&rsquo;</dt>
  9556. <dt>&lsquo;<samp>ssim (<em>1</em>)</samp>&rsquo;</dt>
  9557. </dl>
  9558. </dd>
  9559. <dt><samp>lag-in-frames</samp></dt>
  9560. <dd><p>Set the maximum number of frames which the encoder may keep in flight
  9561. at any one time for lookahead purposes. Defaults to the internal
  9562. default of the library.
  9563. </p>
  9564. </dd>
  9565. <dt><samp>error-resilience</samp></dt>
  9566. <dd><p>Enable error resilience features:
  9567. </p><dl compact="compact">
  9568. <dt><samp>default</samp></dt>
  9569. <dd><p>Improve resilience against losses of whole frames.
  9570. </p></dd>
  9571. </dl>
  9572. <p>Not enabled by default.
  9573. </p>
  9574. </dd>
  9575. <dt><samp>crf</samp></dt>
  9576. <dd><p>Set the quality/size tradeoff for constant-quality (no bitrate target)
  9577. and constrained-quality (with maximum bitrate target) modes. Valid
  9578. range is 0 to 63, higher numbers indicating lower quality and smaller
  9579. output size. Only used if set; by default only the bitrate target is
  9580. used.
  9581. </p>
  9582. </dd>
  9583. <dt><samp>static-thresh</samp></dt>
  9584. <dd><p>Set a change threshold on blocks below which they will be skipped by
  9585. the encoder. Defined in arbitrary units as a nonnegative integer,
  9586. defaulting to zero (no blocks are skipped).
  9587. </p>
  9588. </dd>
  9589. <dt><samp>drop-threshold</samp></dt>
  9590. <dd><p>Set a threshold for dropping frames when close to rate control bounds.
  9591. Defined as a percentage of the target buffer - when the rate control
  9592. buffer falls below this percentage, frames will be dropped until it
  9593. has refilled above the threshold. Defaults to zero (no frames are
  9594. dropped).
  9595. </p>
  9596. </dd>
  9597. <dt><samp>denoise-noise-level (<em>level</em>)</samp></dt>
  9598. <dd><p>Amount of noise to be removed for grain synthesis. Grain synthesis is disabled if
  9599. this option is not set or set to 0.
  9600. </p>
  9601. </dd>
  9602. <dt><samp>denoise-block-size (<em>pixels</em>)</samp></dt>
  9603. <dd><p>Block size used for denoising for grain synthesis. If not set, AV1 codec
  9604. uses the default value of 32.
  9605. </p>
  9606. </dd>
  9607. <dt><samp>undershoot-pct (<em>pct</em>)</samp></dt>
  9608. <dd><p>Set datarate undershoot (min) percentage of the target bitrate. Range is -1 to 100.
  9609. Default is -1.
  9610. </p>
  9611. </dd>
  9612. <dt><samp>overshoot-pct (<em>pct</em>)</samp></dt>
  9613. <dd><p>Set datarate overshoot (max) percentage of the target bitrate. Range is -1 to 1000.
  9614. Default is -1.
  9615. </p>
  9616. </dd>
  9617. <dt><samp>minsection-pct (<em>pct</em>)</samp></dt>
  9618. <dd><p>Minimum percentage variation of the GOP bitrate from the target bitrate. If minsection-pct
  9619. is not set, the libaomenc wrapper computes it as follows: <code>(minrate * 100 / bitrate)</code>.
  9620. Range is -1 to 100. Default is -1 (unset).
  9621. </p>
  9622. </dd>
  9623. <dt><samp>maxsection-pct (<em>pct</em>)</samp></dt>
  9624. <dd><p>Maximum percentage variation of the GOP bitrate from the target bitrate. If maxsection-pct
  9625. is not set, the libaomenc wrapper computes it as follows: <code>(maxrate * 100 / bitrate)</code>.
  9626. Range is -1 to 5000. Default is -1 (unset).
  9627. </p>
  9628. </dd>
  9629. <dt><samp>frame-parallel (<em>boolean</em>)</samp></dt>
  9630. <dd><p>Enable frame parallel decodability features. Default is true.
  9631. </p>
  9632. </dd>
  9633. <dt><samp>tiles</samp></dt>
  9634. <dd><p>Set the number of tiles to encode the input video with, as columns x
  9635. rows. Larger numbers allow greater parallelism in both encoding and
  9636. decoding, but may decrease coding efficiency. Defaults to the minimum
  9637. number of tiles required by the size of the input video (this is 1x1
  9638. (that is, a single tile) for sizes up to and including 4K).
  9639. </p>
  9640. </dd>
  9641. <dt><samp>tile-columns tile-rows</samp></dt>
  9642. <dd><p>Set the number of tiles as log2 of the number of tile rows and columns.
  9643. Provided for compatibility with libvpx/VP9.
  9644. </p>
  9645. </dd>
  9646. <dt><samp>row-mt (Requires libaom &gt;= 1.0.0-759-g90a15f4f2)</samp></dt>
  9647. <dd><p>Enable row based multi-threading. Disabled by default.
  9648. </p>
  9649. </dd>
  9650. <dt><samp>enable-cdef (<em>boolean</em>)</samp></dt>
  9651. <dd><p>Enable Constrained Directional Enhancement Filter. The libaom-av1
  9652. encoder enables CDEF by default.
  9653. </p>
  9654. </dd>
  9655. <dt><samp>enable-restoration (<em>boolean</em>)</samp></dt>
  9656. <dd><p>Enable Loop Restoration Filter. Default is true for libaom-av1.
  9657. </p>
  9658. </dd>
  9659. <dt><samp>enable-global-motion (<em>boolean</em>)</samp></dt>
  9660. <dd><p>Enable the use of global motion for block prediction. Default is true.
  9661. </p>
  9662. </dd>
  9663. <dt><samp>enable-intrabc (<em>boolean</em>)</samp></dt>
  9664. <dd><p>Enable block copy mode for intra block prediction. This mode is
  9665. useful for screen content. Default is true.
  9666. </p>
  9667. </dd>
  9668. <dt><samp>enable-rect-partitions (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9669. <dd><p>Enable rectangular partitions. Default is true.
  9670. </p>
  9671. </dd>
  9672. <dt><samp>enable-1to4-partitions (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9673. <dd><p>Enable 1:4/4:1 partitions. Default is true.
  9674. </p>
  9675. </dd>
  9676. <dt><samp>enable-ab-partitions (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9677. <dd><p>Enable AB shape partitions. Default is true.
  9678. </p>
  9679. </dd>
  9680. <dt><samp>enable-angle-delta (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9681. <dd><p>Enable angle delta intra prediction. Default is true.
  9682. </p>
  9683. </dd>
  9684. <dt><samp>enable-cfl-intra (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9685. <dd><p>Enable chroma predicted from luma intra prediction. Default is true.
  9686. </p>
  9687. </dd>
  9688. <dt><samp>enable-filter-intra (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9689. <dd><p>Enable filter intra predictor. Default is true.
  9690. </p>
  9691. </dd>
  9692. <dt><samp>enable-intra-edge-filter (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9693. <dd><p>Enable intra edge filter. Default is true.
  9694. </p>
  9695. </dd>
  9696. <dt><samp>enable-smooth-intra (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9697. <dd><p>Enable smooth intra prediction mode. Default is true.
  9698. </p>
  9699. </dd>
  9700. <dt><samp>enable-paeth-intra (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9701. <dd><p>Enable paeth predictor in intra prediction. Default is true.
  9702. </p>
  9703. </dd>
  9704. <dt><samp>enable-palette (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9705. <dd><p>Enable palette prediction mode. Default is true.
  9706. </p>
  9707. </dd>
  9708. <dt><samp>enable-flip-idtx (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9709. <dd><p>Enable extended transform type, including FLIPADST_DCT, DCT_FLIPADST,
  9710. FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST, IDTX, V_DCT, H_DCT,
  9711. V_ADST, H_ADST, V_FLIPADST, H_FLIPADST. Default is true.
  9712. </p>
  9713. </dd>
  9714. <dt><samp>enable-tx64 (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9715. <dd><p>Enable 64-pt transform. Default is true.
  9716. </p>
  9717. </dd>
  9718. <dt><samp>reduced-tx-type-set (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9719. <dd><p>Use reduced set of transform types. Default is false.
  9720. </p>
  9721. </dd>
  9722. <dt><samp>use-intra-dct-only (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9723. <dd><p>Use DCT only for INTRA modes. Default is false.
  9724. </p>
  9725. </dd>
  9726. <dt><samp>use-inter-dct-only (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9727. <dd><p>Use DCT only for INTER modes. Default is false.
  9728. </p>
  9729. </dd>
  9730. <dt><samp>use-intra-default-tx-only (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9731. <dd><p>Use Default-transform only for INTRA modes. Default is false.
  9732. </p>
  9733. </dd>
  9734. <dt><samp>enable-ref-frame-mvs (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9735. <dd><p>Enable temporal mv prediction. Default is true.
  9736. </p>
  9737. </dd>
  9738. <dt><samp>enable-reduced-reference-set (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9739. <dd><p>Use reduced set of single and compound references. Default is false.
  9740. </p>
  9741. </dd>
  9742. <dt><samp>enable-obmc (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9743. <dd><p>Enable obmc. Default is true.
  9744. </p>
  9745. </dd>
  9746. <dt><samp>enable-dual-filter (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9747. <dd><p>Enable dual filter. Default is true.
  9748. </p>
  9749. </dd>
  9750. <dt><samp>enable-diff-wtd-comp (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9751. <dd><p>Enable difference-weighted compound. Default is true.
  9752. </p>
  9753. </dd>
  9754. <dt><samp>enable-dist-wtd-comp (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9755. <dd><p>Enable distance-weighted compound. Default is true.
  9756. </p>
  9757. </dd>
  9758. <dt><samp>enable-onesided-comp (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9759. <dd><p>Enable one sided compound. Default is true.
  9760. </p>
  9761. </dd>
  9762. <dt><samp>enable-interinter-wedge (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9763. <dd><p>Enable interinter wedge compound. Default is true.
  9764. </p>
  9765. </dd>
  9766. <dt><samp>enable-interintra-wedge (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9767. <dd><p>Enable interintra wedge compound. Default is true.
  9768. </p>
  9769. </dd>
  9770. <dt><samp>enable-masked-comp (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9771. <dd><p>Enable masked compound. Default is true.
  9772. </p>
  9773. </dd>
  9774. <dt><samp>enable-interintra-comp (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9775. <dd><p>Enable interintra compound. Default is true.
  9776. </p>
  9777. </dd>
  9778. <dt><samp>enable-smooth-interintra (<em>boolean</em>) (Requires libaom &gt;= v2.0.0)</samp></dt>
  9779. <dd><p>Enable smooth interintra mode. Default is true.
  9780. </p>
  9781. </dd>
  9782. <dt><samp>aom-params</samp></dt>
  9783. <dd><p>Set libaom options using a list of <var>key</var>=<var>value</var> pairs separated
  9784. by &quot;:&quot;. For a list of supported options, see <code>aomenc --help</code> under the
  9785. section &quot;AV1 Specific Options&quot;.
  9786. </p>
  9787. <p>For example to specify libaom encoding options with <samp>-aom-params</samp>:
  9788. </p>
  9789. <div class="example">
  9790. <pre class="example">ffmpeg -i input -c:v libaom-av1 -b:v 500K -aom-params tune=psnr:enable-tpl-model=1 output.mp4
  9791. </pre></div>
  9792. </dd>
  9793. </dl>
  9794. <a name="libsvtav1"></a>
  9795. <h3 class="section">16.6 libsvtav1<span class="pull-right"><a class="anchor hidden-xs" href="#libsvtav1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libsvtav1" aria-hidden="true">TOC</a></span></h3>
  9796. <p>SVT-AV1 encoder wrapper.
  9797. </p>
  9798. <p>Requires the presence of the SVT-AV1 headers and library during configuration.
  9799. You need to explicitly configure the build with <code>--enable-libsvtav1</code>.
  9800. </p>
  9801. <a name="Options-26"></a>
  9802. <h4 class="subsection">16.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-26" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-26" aria-hidden="true">TOC</a></span></h4>
  9803. <dl compact="compact">
  9804. <dt><samp>profile</samp></dt>
  9805. <dd><p>Set the encoding profile.
  9806. </p>
  9807. </dd>
  9808. <dt><samp>level</samp></dt>
  9809. <dd><p>Set the operating point level.
  9810. </p>
  9811. </dd>
  9812. <dt><samp>tier</samp></dt>
  9813. <dd><p>Set the operating point tier.
  9814. </p>
  9815. </dd>
  9816. <dt><samp>rc</samp></dt>
  9817. <dd><p>Set the rate control mode to use.
  9818. </p>
  9819. <p>Possible modes:
  9820. </p><dl compact="compact">
  9821. <dt><samp>cqp</samp></dt>
  9822. <dd><p>Constant quantizer: use fixed values of qindex (dependent on the frame type)
  9823. throughout the stream. This mode is the default.
  9824. </p>
  9825. </dd>
  9826. <dt><samp>vbr</samp></dt>
  9827. <dd><p>Variable bitrate: use a target bitrate for the whole stream.
  9828. </p>
  9829. </dd>
  9830. <dt><samp>cvbr</samp></dt>
  9831. <dd><p>Constrained variable bitrate: use a target bitrate for each GOP.
  9832. </p></dd>
  9833. </dl>
  9834. </dd>
  9835. <dt><samp>qmax</samp></dt>
  9836. <dd><p>Set the maximum quantizer to use when using a bitrate mode.
  9837. </p>
  9838. </dd>
  9839. <dt><samp>qmin</samp></dt>
  9840. <dd><p>Set the minimum quantizer to use when using a bitrate mode.
  9841. </p>
  9842. </dd>
  9843. <dt><samp>qp</samp></dt>
  9844. <dd><p>Set the quantizer used in cqp rate control mode (0-63).
  9845. </p>
  9846. </dd>
  9847. <dt><samp>sc_detection</samp></dt>
  9848. <dd><p>Enable scene change detection.
  9849. </p>
  9850. </dd>
  9851. <dt><samp>la_depth</samp></dt>
  9852. <dd><p>Set number of frames to look ahead (0-120).
  9853. </p>
  9854. </dd>
  9855. <dt><samp>preset</samp></dt>
  9856. <dd><p>Set the quality-speed tradeoff, in the range 0 to 8. Higher values are
  9857. faster but lower quality. Defaults to 8 (highest speed).
  9858. </p>
  9859. </dd>
  9860. <dt><samp>tile_rows</samp></dt>
  9861. <dd><p>Set log2 of the number of rows of tiles to use (0-6).
  9862. </p>
  9863. </dd>
  9864. <dt><samp>tile_columns</samp></dt>
  9865. <dd><p>Set log2 of the number of columns of tiles to use (0-4).
  9866. </p>
  9867. </dd>
  9868. </dl>
  9869. <a name="libkvazaar"></a>
  9870. <h3 class="section">16.7 libkvazaar<span class="pull-right"><a class="anchor hidden-xs" href="#libkvazaar" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libkvazaar" aria-hidden="true">TOC</a></span></h3>
  9871. <p>Kvazaar H.265/HEVC encoder.
  9872. </p>
  9873. <p>Requires the presence of the libkvazaar headers and library during
  9874. configuration. You need to explicitly configure the build with
  9875. <samp>--enable-libkvazaar</samp>.
  9876. </p>
  9877. <a name="Options-27"></a>
  9878. <h4 class="subsection">16.7.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-27" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-27" aria-hidden="true">TOC</a></span></h4>
  9879. <dl compact="compact">
  9880. <dt><samp>b</samp></dt>
  9881. <dd><p>Set target video bitrate in bit/s and enable rate control.
  9882. </p>
  9883. </dd>
  9884. <dt><samp>kvazaar-params</samp></dt>
  9885. <dd><p>Set kvazaar parameters as a list of <var>name</var>=<var>value</var> pairs separated
  9886. by commas (,). See kvazaar documentation for a list of options.
  9887. </p>
  9888. </dd>
  9889. </dl>
  9890. <a name="libopenh264"></a>
  9891. <h3 class="section">16.8 libopenh264<span class="pull-right"><a class="anchor hidden-xs" href="#libopenh264" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopenh264" aria-hidden="true">TOC</a></span></h3>
  9892. <p>Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper.
  9893. </p>
  9894. <p>This encoder requires the presence of the libopenh264 headers and
  9895. library during configuration. You need to explicitly configure the
  9896. build with <code>--enable-libopenh264</code>. The library is detected using
  9897. <code>pkg-config</code>.
  9898. </p>
  9899. <p>For more information about the library see
  9900. <a href="http://www.openh264.org">http://www.openh264.org</a>.
  9901. </p>
  9902. <a name="Options-28"></a>
  9903. <h4 class="subsection">16.8.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-28" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-28" aria-hidden="true">TOC</a></span></h4>
  9904. <p>The following FFmpeg global options affect the configurations of the
  9905. libopenh264 encoder.
  9906. </p>
  9907. <dl compact="compact">
  9908. <dt><samp>b</samp></dt>
  9909. <dd><p>Set the bitrate (as a number of bits per second).
  9910. </p>
  9911. </dd>
  9912. <dt><samp>g</samp></dt>
  9913. <dd><p>Set the GOP size.
  9914. </p>
  9915. </dd>
  9916. <dt><samp>maxrate</samp></dt>
  9917. <dd><p>Set the max bitrate (as a number of bits per second).
  9918. </p>
  9919. </dd>
  9920. <dt><samp>flags +global_header</samp></dt>
  9921. <dd><p>Set global header in the bitstream.
  9922. </p>
  9923. </dd>
  9924. <dt><samp>slices</samp></dt>
  9925. <dd><p>Set the number of slices, used in parallelized encoding. Default value
  9926. is 0. This is only used when <samp>slice_mode</samp> is set to
  9927. &lsquo;<samp>fixed</samp>&rsquo;.
  9928. </p>
  9929. </dd>
  9930. <dt><samp>slice_mode</samp></dt>
  9931. <dd><p>Set slice mode. Can assume one of the following possible values:
  9932. </p>
  9933. <dl compact="compact">
  9934. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  9935. <dd><p>a fixed number of slices
  9936. </p></dd>
  9937. <dt>&lsquo;<samp>rowmb</samp>&rsquo;</dt>
  9938. <dd><p>one slice per row of macroblocks
  9939. </p></dd>
  9940. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  9941. <dd><p>automatic number of slices according to number of threads
  9942. </p></dd>
  9943. <dt>&lsquo;<samp>dyn</samp>&rsquo;</dt>
  9944. <dd><p>dynamic slicing
  9945. </p></dd>
  9946. </dl>
  9947. <p>Default value is &lsquo;<samp>auto</samp>&rsquo;.
  9948. </p>
  9949. </dd>
  9950. <dt><samp>loopfilter</samp></dt>
  9951. <dd><p>Enable loop filter, if set to 1 (automatically enabled). To disable
  9952. set a value of 0.
  9953. </p>
  9954. </dd>
  9955. <dt><samp>profile</samp></dt>
  9956. <dd><p>Set profile restrictions. If set to the value of &lsquo;<samp>main</samp>&rsquo; enable
  9957. CABAC (set the <code>SEncParamExt.iEntropyCodingModeFlag</code> flag to 1).
  9958. </p>
  9959. </dd>
  9960. <dt><samp>max_nal_size</samp></dt>
  9961. <dd><p>Set maximum NAL size in bytes.
  9962. </p>
  9963. </dd>
  9964. <dt><samp>allow_skip_frames</samp></dt>
  9965. <dd><p>Allow skipping frames to hit the target bitrate if set to 1.
  9966. </p></dd>
  9967. </dl>
  9968. <a name="libtheora"></a>
  9969. <h3 class="section">16.9 libtheora<span class="pull-right"><a class="anchor hidden-xs" href="#libtheora" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libtheora" aria-hidden="true">TOC</a></span></h3>
  9970. <p>libtheora Theora encoder wrapper.
  9971. </p>
  9972. <p>Requires the presence of the libtheora headers and library during
  9973. configuration. You need to explicitly configure the build with
  9974. <code>--enable-libtheora</code>.
  9975. </p>
  9976. <p>For more information about the libtheora project see
  9977. <a href="http://www.theora.org/">http://www.theora.org/</a>.
  9978. </p>
  9979. <a name="Options-29"></a>
  9980. <h4 class="subsection">16.9.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-29" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-29" aria-hidden="true">TOC</a></span></h4>
  9981. <p>The following global options are mapped to internal libtheora options
  9982. which affect the quality and the bitrate of the encoded stream.
  9983. </p>
  9984. <dl compact="compact">
  9985. <dt><samp>b</samp></dt>
  9986. <dd><p>Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In
  9987. case VBR (Variable Bit Rate) mode is enabled this option is ignored.
  9988. </p>
  9989. </dd>
  9990. <dt><samp>flags</samp></dt>
  9991. <dd><p>Used to enable constant quality mode (VBR) encoding through the
  9992. <samp>qscale</samp> flag, and to enable the <code>pass1</code> and <code>pass2</code>
  9993. modes.
  9994. </p>
  9995. </dd>
  9996. <dt><samp>g</samp></dt>
  9997. <dd><p>Set the GOP size.
  9998. </p>
  9999. </dd>
  10000. <dt><samp>global_quality</samp></dt>
  10001. <dd><p>Set the global quality as an integer in lambda units.
  10002. </p>
  10003. <p>Only relevant when VBR mode is enabled with <code>flags +qscale</code>. The
  10004. value is converted to QP units by dividing it by <code>FF_QP2LAMBDA</code>,
  10005. clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
  10006. value in the native libtheora range [0-63]. A higher value corresponds
  10007. to a higher quality.
  10008. </p>
  10009. </dd>
  10010. <dt><samp>q</samp></dt>
  10011. <dd><p>Enable VBR mode when set to a non-negative value, and set constant
  10012. quality value as a double floating point value in QP units.
  10013. </p>
  10014. <p>The value is clipped in the [0-10] range, and then multiplied by 6.3
  10015. to get a value in the native libtheora range [0-63].
  10016. </p>
  10017. <p>This option is valid only using the <code>ffmpeg</code> command-line
  10018. tool. For library interface users, use <samp>global_quality</samp>.
  10019. </p></dd>
  10020. </dl>
  10021. <a name="Examples-5"></a>
  10022. <h4 class="subsection">16.9.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-5" aria-hidden="true">TOC</a></span></h4>
  10023. <ul>
  10024. <li> Set maximum constant quality (VBR) encoding with <code>ffmpeg</code>:
  10025. <div class="example">
  10026. <pre class="example">ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
  10027. </pre></div>
  10028. </li><li> Use <code>ffmpeg</code> to convert a CBR 1000 kbps Theora video stream:
  10029. <div class="example">
  10030. <pre class="example">ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
  10031. </pre></div>
  10032. </li></ul>
  10033. <a name="libvpx"></a>
  10034. <h3 class="section">16.10 libvpx<span class="pull-right"><a class="anchor hidden-xs" href="#libvpx" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvpx" aria-hidden="true">TOC</a></span></h3>
  10035. <p>VP8/VP9 format supported through libvpx.
  10036. </p>
  10037. <p>Requires the presence of the libvpx headers and library during configuration.
  10038. You need to explicitly configure the build with <code>--enable-libvpx</code>.
  10039. </p>
  10040. <a name="Options-30"></a>
  10041. <h4 class="subsection">16.10.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-30" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-30" aria-hidden="true">TOC</a></span></h4>
  10042. <p>The following options are supported by the libvpx wrapper. The
  10043. <code>vpxenc</code>-equivalent options or values are listed in parentheses
  10044. for easy migration.
  10045. </p>
  10046. <p>To reduce the duplication of documentation, only the private options
  10047. and some others requiring special attention are documented here. For
  10048. the documentation of the undocumented generic options, see
  10049. <a href="#codec_002doptions">the Codec Options chapter</a>.
  10050. </p>
  10051. <p>To get more documentation of the libvpx options, invoke the command
  10052. <code>ffmpeg -h encoder=libvpx</code>, <code>ffmpeg -h encoder=libvpx-vp9</code> or
  10053. <code>vpxenc --help</code>. Further information is available in the libvpx API
  10054. documentation.
  10055. </p>
  10056. <dl compact="compact">
  10057. <dt><samp>b (<em>target-bitrate</em>)</samp></dt>
  10058. <dd><p>Set bitrate in bits/s. Note that FFmpeg&rsquo;s <samp>b</samp> option is
  10059. expressed in bits/s, while <code>vpxenc</code>&rsquo;s <samp>target-bitrate</samp> is in
  10060. kilobits/s.
  10061. </p>
  10062. </dd>
  10063. <dt><samp>g (<em>kf-max-dist</em>)</samp></dt>
  10064. <dt><samp>keyint_min (<em>kf-min-dist</em>)</samp></dt>
  10065. <dt><samp>qmin (<em>min-q</em>)</samp></dt>
  10066. <dt><samp>qmax (<em>max-q</em>)</samp></dt>
  10067. <dt><samp>bufsize (<em>buf-sz</em>, <em>buf-optimal-sz</em>)</samp></dt>
  10068. <dd><p>Set ratecontrol buffer size (in bits). Note <code>vpxenc</code>&rsquo;s options are
  10069. specified in milliseconds, the libvpx wrapper converts this value as follows:
  10070. <code>buf-sz = bufsize * 1000 / bitrate</code>,
  10071. <code>buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6</code>.
  10072. </p>
  10073. </dd>
  10074. <dt><samp>rc_init_occupancy (<em>buf-initial-sz</em>)</samp></dt>
  10075. <dd><p>Set number of bits which should be loaded into the rc buffer before decoding
  10076. starts. Note <code>vpxenc</code>&rsquo;s option is specified in milliseconds, the libvpx
  10077. wrapper converts this value as follows:
  10078. <code>rc_init_occupancy * 1000 / bitrate</code>.
  10079. </p>
  10080. </dd>
  10081. <dt><samp>undershoot-pct</samp></dt>
  10082. <dd><p>Set datarate undershoot (min) percentage of the target bitrate.
  10083. </p>
  10084. </dd>
  10085. <dt><samp>overshoot-pct</samp></dt>
  10086. <dd><p>Set datarate overshoot (max) percentage of the target bitrate.
  10087. </p>
  10088. </dd>
  10089. <dt><samp>skip_threshold (<em>drop-frame</em>)</samp></dt>
  10090. <dt><samp>qcomp (<em>bias-pct</em>)</samp></dt>
  10091. <dt><samp>maxrate (<em>maxsection-pct</em>)</samp></dt>
  10092. <dd><p>Set GOP max bitrate in bits/s. Note <code>vpxenc</code>&rsquo;s option is specified as a
  10093. percentage of the target bitrate, the libvpx wrapper converts this value as
  10094. follows: <code>(maxrate * 100 / bitrate)</code>.
  10095. </p>
  10096. </dd>
  10097. <dt><samp>minrate (<em>minsection-pct</em>)</samp></dt>
  10098. <dd><p>Set GOP min bitrate in bits/s. Note <code>vpxenc</code>&rsquo;s option is specified as a
  10099. percentage of the target bitrate, the libvpx wrapper converts this value as
  10100. follows: <code>(minrate * 100 / bitrate)</code>.
  10101. </p>
  10102. </dd>
  10103. <dt><samp>minrate, maxrate, b <em>end-usage=cbr</em></samp></dt>
  10104. <dd><p><code>(minrate == maxrate == bitrate)</code>.
  10105. </p>
  10106. </dd>
  10107. <dt><samp>crf (<em>end-usage=cq</em>, <em>cq-level</em>)</samp></dt>
  10108. <dt><samp>tune (<em>tune</em>)</samp></dt>
  10109. <dd><dl compact="compact">
  10110. <dt>&lsquo;<samp>psnr (<em>psnr</em>)</samp>&rsquo;</dt>
  10111. <dt>&lsquo;<samp>ssim (<em>ssim</em>)</samp>&rsquo;</dt>
  10112. </dl>
  10113. </dd>
  10114. <dt><samp>quality, deadline (<em>deadline</em>)</samp></dt>
  10115. <dd><dl compact="compact">
  10116. <dt>&lsquo;<samp>best</samp>&rsquo;</dt>
  10117. <dd><p>Use best quality deadline. Poorly named and quite slow, this option should be
  10118. avoided as it may give worse quality output than good.
  10119. </p></dd>
  10120. <dt>&lsquo;<samp>good</samp>&rsquo;</dt>
  10121. <dd><p>Use good quality deadline. This is a good trade-off between speed and quality
  10122. when used with the <samp>cpu-used</samp> option.
  10123. </p></dd>
  10124. <dt>&lsquo;<samp>realtime</samp>&rsquo;</dt>
  10125. <dd><p>Use realtime quality deadline.
  10126. </p></dd>
  10127. </dl>
  10128. </dd>
  10129. <dt><samp>speed, cpu-used (<em>cpu-used</em>)</samp></dt>
  10130. <dd><p>Set quality/speed ratio modifier. Higher values speed up the encode at the cost
  10131. of quality.
  10132. </p>
  10133. </dd>
  10134. <dt><samp>nr (<em>noise-sensitivity</em>)</samp></dt>
  10135. <dt><samp>static-thresh</samp></dt>
  10136. <dd><p>Set a change threshold on blocks below which they will be skipped by the
  10137. encoder.
  10138. </p>
  10139. </dd>
  10140. <dt><samp>slices (<em>token-parts</em>)</samp></dt>
  10141. <dd><p>Note that FFmpeg&rsquo;s <samp>slices</samp> option gives the total number of partitions,
  10142. while <code>vpxenc</code>&rsquo;s <samp>token-parts</samp> is given as
  10143. <code>log2(partitions)</code>.
  10144. </p>
  10145. </dd>
  10146. <dt><samp>max-intra-rate</samp></dt>
  10147. <dd><p>Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0
  10148. means unlimited.
  10149. </p>
  10150. </dd>
  10151. <dt><samp>force_key_frames</samp></dt>
  10152. <dd><p><code>VPX_EFLAG_FORCE_KF</code>
  10153. </p>
  10154. </dd>
  10155. <dt><samp>Alternate reference frame related</samp></dt>
  10156. <dd><dl compact="compact">
  10157. <dt><samp>auto-alt-ref</samp></dt>
  10158. <dd><p>Enable use of alternate reference frames (2-pass only).
  10159. Values greater than 1 enable multi-layer alternate reference frames (VP9 only).
  10160. </p></dd>
  10161. <dt><samp>arnr-maxframes</samp></dt>
  10162. <dd><p>Set altref noise reduction max frame count.
  10163. </p></dd>
  10164. <dt><samp>arnr-type</samp></dt>
  10165. <dd><p>Set altref noise reduction filter type: backward, forward, centered.
  10166. </p></dd>
  10167. <dt><samp>arnr-strength</samp></dt>
  10168. <dd><p>Set altref noise reduction filter strength.
  10169. </p></dd>
  10170. <dt><samp>rc-lookahead, lag-in-frames (<em>lag-in-frames</em>)</samp></dt>
  10171. <dd><p>Set number of frames to look ahead for frametype and ratecontrol.
  10172. </p></dd>
  10173. </dl>
  10174. </dd>
  10175. <dt><samp>error-resilient</samp></dt>
  10176. <dd><p>Enable error resiliency features.
  10177. </p>
  10178. </dd>
  10179. <dt><samp>sharpness <var>integer</var></samp></dt>
  10180. <dd><p>Increase sharpness at the expense of lower PSNR.
  10181. The valid range is [0, 7].
  10182. </p>
  10183. </dd>
  10184. <dt><samp>ts-parameters</samp></dt>
  10185. <dd><p>Sets the temporal scalability configuration using a :-separated list of
  10186. key=value pairs. For example, to specify temporal scalability parameters
  10187. with <code>ffmpeg</code>:
  10188. </p><div class="example">
  10189. <pre class="example">ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
  10190. ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
  10191. ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
  10192. </pre></div>
  10193. <p>Below is a brief explanation of each of the parameters, please
  10194. refer to <code>struct vpx_codec_enc_cfg</code> in <code>vpx/vpx_encoder.h</code> for more
  10195. details.
  10196. </p><dl compact="compact">
  10197. <dt><samp>ts_number_layers</samp></dt>
  10198. <dd><p>Number of temporal coding layers.
  10199. </p></dd>
  10200. <dt><samp>ts_target_bitrate</samp></dt>
  10201. <dd><p>Target bitrate for each temporal layer (in kbps).
  10202. (bitrate should be inclusive of the lower temporal layer).
  10203. </p></dd>
  10204. <dt><samp>ts_rate_decimator</samp></dt>
  10205. <dd><p>Frame rate decimation factor for each temporal layer.
  10206. </p></dd>
  10207. <dt><samp>ts_periodicity</samp></dt>
  10208. <dd><p>Length of the sequence defining frame temporal layer membership.
  10209. </p></dd>
  10210. <dt><samp>ts_layer_id</samp></dt>
  10211. <dd><p>Template defining the membership of frames to temporal layers.
  10212. </p></dd>
  10213. <dt><samp>ts_layering_mode</samp></dt>
  10214. <dd><p>(optional) Selecting the temporal structure from a set of pre-defined temporal layering modes.
  10215. Currently supports the following options.
  10216. </p><dl compact="compact">
  10217. <dt><samp>0</samp></dt>
  10218. <dd><p>No temporal layering flags are provided internally,
  10219. relies on flags being passed in using <code>metadata</code> field in <code>AVFrame</code>
  10220. with following keys.
  10221. </p><dl compact="compact">
  10222. <dt><samp>vp8-flags</samp></dt>
  10223. <dd><p>Sets the flags passed into the encoder to indicate the referencing scheme for
  10224. the current frame.
  10225. Refer to function <code>vpx_codec_encode</code> in <code>vpx/vpx_encoder.h</code> for more
  10226. details.
  10227. </p></dd>
  10228. <dt><samp>temporal_id</samp></dt>
  10229. <dd><p>Explicitly sets the temporal id of the current frame to encode.
  10230. </p></dd>
  10231. </dl>
  10232. </dd>
  10233. <dt><samp>2</samp></dt>
  10234. <dd><p>Two temporal layers. 0-1...
  10235. </p></dd>
  10236. <dt><samp>3</samp></dt>
  10237. <dd><p>Three temporal layers. 0-2-1-2...; with single reference frame.
  10238. </p></dd>
  10239. <dt><samp>4</samp></dt>
  10240. <dd><p>Same as option &quot;3&quot;, except there is a dependency between
  10241. the two temporal layer 2 frames within the temporal period.
  10242. </p></dd>
  10243. </dl>
  10244. </dd>
  10245. </dl>
  10246. </dd>
  10247. <dt><samp>VP9-specific options</samp></dt>
  10248. <dd><dl compact="compact">
  10249. <dt><samp>lossless</samp></dt>
  10250. <dd><p>Enable lossless mode.
  10251. </p></dd>
  10252. <dt><samp>tile-columns</samp></dt>
  10253. <dd><p>Set number of tile columns to use. Note this is given as
  10254. <code>log2(tile_columns)</code>. For example, 8 tile columns would be requested by
  10255. setting the <samp>tile-columns</samp> option to 3.
  10256. </p></dd>
  10257. <dt><samp>tile-rows</samp></dt>
  10258. <dd><p>Set number of tile rows to use. Note this is given as <code>log2(tile_rows)</code>.
  10259. For example, 4 tile rows would be requested by setting the <samp>tile-rows</samp>
  10260. option to 2.
  10261. </p></dd>
  10262. <dt><samp>frame-parallel</samp></dt>
  10263. <dd><p>Enable frame parallel decodability features.
  10264. </p></dd>
  10265. <dt><samp>aq-mode</samp></dt>
  10266. <dd><p>Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
  10267. cyclic refresh, 4: equator360).
  10268. </p></dd>
  10269. <dt><samp>colorspace <em>color-space</em></samp></dt>
  10270. <dd><p>Set input color space. The VP9 bitstream supports signaling the following
  10271. colorspaces:
  10272. </p><dl compact="compact">
  10273. <dt><samp>&lsquo;<samp>rgb</samp>&rsquo; <em>sRGB</em></samp></dt>
  10274. <dt><samp>&lsquo;<samp>bt709</samp>&rsquo; <em>bt709</em></samp></dt>
  10275. <dt><samp>&lsquo;<samp>unspecified</samp>&rsquo; <em>unknown</em></samp></dt>
  10276. <dt><samp>&lsquo;<samp>bt470bg</samp>&rsquo; <em>bt601</em></samp></dt>
  10277. <dt><samp>&lsquo;<samp>smpte170m</samp>&rsquo; <em>smpte170</em></samp></dt>
  10278. <dt><samp>&lsquo;<samp>smpte240m</samp>&rsquo; <em>smpte240</em></samp></dt>
  10279. <dt><samp>&lsquo;<samp>bt2020_ncl</samp>&rsquo; <em>bt2020</em></samp></dt>
  10280. </dl>
  10281. </dd>
  10282. <dt><samp>row-mt <var>boolean</var></samp></dt>
  10283. <dd><p>Enable row based multi-threading.
  10284. </p></dd>
  10285. <dt><samp>tune-content</samp></dt>
  10286. <dd><p>Set content type: default (0), screen (1), film (2).
  10287. </p></dd>
  10288. <dt><samp>corpus-complexity</samp></dt>
  10289. <dd><p>Corpus VBR mode is a variant of standard VBR where the complexity distribution
  10290. midpoint is passed in rather than calculated for a specific clip or chunk.
  10291. </p>
  10292. <p>The valid range is [0, 10000]. 0 (default) uses standard VBR.
  10293. </p></dd>
  10294. <dt><samp>enable-tpl <var>boolean</var></samp></dt>
  10295. <dd><p>Enable temporal dependency model.
  10296. </p></dd>
  10297. <dt><samp>ref-frame-config</samp></dt>
  10298. <dd><p>Using per-frame metadata, set members of the structure <code>vpx_svc_ref_frame_config_t</code> in <code>vpx/vp8cx.h</code> to fine-control referencing schemes and frame buffer management.
  10299. <br>Use a :-separated list of key=value pairs.
  10300. For example,
  10301. </p><div class="example">
  10302. <pre class="example">av_dict_set(&amp;av_frame-&gt;metadata, &quot;ref-frame-config&quot;, \
  10303. &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;);
  10304. </pre></div>
  10305. <dl compact="compact">
  10306. <dt><samp>rfc_update_buffer_slot</samp></dt>
  10307. <dd><p>Indicates the buffer slot number to update
  10308. </p></dd>
  10309. <dt><samp>rfc_update_last</samp></dt>
  10310. <dd><p>Indicates whether to update the LAST frame
  10311. </p></dd>
  10312. <dt><samp>rfc_update_golden</samp></dt>
  10313. <dd><p>Indicates whether to update GOLDEN frame
  10314. </p></dd>
  10315. <dt><samp>rfc_update_alt_ref</samp></dt>
  10316. <dd><p>Indicates whether to update ALT_REF frame
  10317. </p></dd>
  10318. <dt><samp>rfc_lst_fb_idx</samp></dt>
  10319. <dd><p>LAST frame buffer index
  10320. </p></dd>
  10321. <dt><samp>rfc_gld_fb_idx</samp></dt>
  10322. <dd><p>GOLDEN frame buffer index
  10323. </p></dd>
  10324. <dt><samp>rfc_alt_fb_idx</samp></dt>
  10325. <dd><p>ALT_REF frame buffer index
  10326. </p></dd>
  10327. <dt><samp>rfc_reference_last</samp></dt>
  10328. <dd><p>Indicates whether to reference LAST frame
  10329. </p></dd>
  10330. <dt><samp>rfc_reference_golden</samp></dt>
  10331. <dd><p>Indicates whether to reference GOLDEN frame
  10332. </p></dd>
  10333. <dt><samp>rfc_reference_alt_ref</samp></dt>
  10334. <dd><p>Indicates whether to reference ALT_REF frame
  10335. </p></dd>
  10336. <dt><samp>rfc_reference_duration</samp></dt>
  10337. <dd><p>Indicates frame duration
  10338. </p></dd>
  10339. </dl>
  10340. </dd>
  10341. </dl>
  10342. </dd>
  10343. </dl>
  10344. <p>For more information about libvpx see:
  10345. <a href="http://www.webmproject.org/">http://www.webmproject.org/</a>
  10346. </p>
  10347. <a name="libwebp"></a>
  10348. <h3 class="section">16.11 libwebp<span class="pull-right"><a class="anchor hidden-xs" href="#libwebp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libwebp" aria-hidden="true">TOC</a></span></h3>
  10349. <p>libwebp WebP Image encoder wrapper
  10350. </p>
  10351. <p>libwebp is Google&rsquo;s official encoder for WebP images. It can encode in either
  10352. lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
  10353. frame. Lossless images are a separate codec developed by Google.
  10354. </p>
  10355. <a name="Pixel-Format"></a>
  10356. <h4 class="subsection">16.11.1 Pixel Format<span class="pull-right"><a class="anchor hidden-xs" href="#Pixel-Format" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Pixel-Format" aria-hidden="true">TOC</a></span></h4>
  10357. <p>Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
  10358. to limitations of the format and libwebp. Alpha is supported for either mode.
  10359. Because of API limitations, if RGB is passed in when encoding lossy or YUV is
  10360. passed in for encoding lossless, the pixel format will automatically be
  10361. converted using functions from libwebp. This is not ideal and is done only for
  10362. convenience.
  10363. </p>
  10364. <a name="Options-31"></a>
  10365. <h4 class="subsection">16.11.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-31" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-31" aria-hidden="true">TOC</a></span></h4>
  10366. <dl compact="compact">
  10367. <dt><samp>-lossless <var>boolean</var></samp></dt>
  10368. <dd><p>Enables/Disables use of lossless mode. Default is 0.
  10369. </p>
  10370. </dd>
  10371. <dt><samp>-compression_level <var>integer</var></samp></dt>
  10372. <dd><p>For lossy, this is a quality/speed tradeoff. Higher values give better quality
  10373. for a given size at the cost of increased encoding time. For lossless, this is
  10374. a size/speed tradeoff. Higher values give smaller size at the cost of increased
  10375. encoding time. More specifically, it controls the number of extra algorithms
  10376. and compression tools used, and varies the combination of these tools. This
  10377. maps to the <var>method</var> option in libwebp. The valid range is 0 to 6.
  10378. Default is 4.
  10379. </p>
  10380. </dd>
  10381. <dt><samp>-qscale <var>float</var></samp></dt>
  10382. <dd><p>For lossy encoding, this controls image quality, 0 to 100. For lossless
  10383. encoding, this controls the effort and time spent at compressing more. The
  10384. default value is 75. Note that for usage via libavcodec, this option is called
  10385. <var>global_quality</var> and must be multiplied by <var>FF_QP2LAMBDA</var>.
  10386. </p>
  10387. </dd>
  10388. <dt><samp>-preset <var>type</var></samp></dt>
  10389. <dd><p>Configuration preset. This does some automatic settings based on the general
  10390. type of the image.
  10391. </p><dl compact="compact">
  10392. <dt><samp>none</samp></dt>
  10393. <dd><p>Do not use a preset.
  10394. </p></dd>
  10395. <dt><samp>default</samp></dt>
  10396. <dd><p>Use the encoder default.
  10397. </p></dd>
  10398. <dt><samp>picture</samp></dt>
  10399. <dd><p>Digital picture, like portrait, inner shot
  10400. </p></dd>
  10401. <dt><samp>photo</samp></dt>
  10402. <dd><p>Outdoor photograph, with natural lighting
  10403. </p></dd>
  10404. <dt><samp>drawing</samp></dt>
  10405. <dd><p>Hand or line drawing, with high-contrast details
  10406. </p></dd>
  10407. <dt><samp>icon</samp></dt>
  10408. <dd><p>Small-sized colorful images
  10409. </p></dd>
  10410. <dt><samp>text</samp></dt>
  10411. <dd><p>Text-like
  10412. </p></dd>
  10413. </dl>
  10414. </dd>
  10415. </dl>
  10416. <a name="libx264_002c-libx264rgb"></a>
  10417. <h3 class="section">16.12 libx264, libx264rgb<span class="pull-right"><a class="anchor hidden-xs" href="#libx264_002c-libx264rgb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libx264_002c-libx264rgb" aria-hidden="true">TOC</a></span></h3>
  10418. <p>x264 H.264/MPEG-4 AVC encoder wrapper.
  10419. </p>
  10420. <p>This encoder requires the presence of the libx264 headers and library
  10421. during configuration. You need to explicitly configure the build with
  10422. <code>--enable-libx264</code>.
  10423. </p>
  10424. <p>libx264 supports an impressive number of features, including 8x8 and
  10425. 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
  10426. entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
  10427. for detail retention (adaptive quantization, psy-RD, psy-trellis).
  10428. </p>
  10429. <p>Many libx264 encoder options are mapped to FFmpeg global codec
  10430. options, while unique encoder options are provided through private
  10431. options. Additionally the <samp>x264opts</samp> and <samp>x264-params</samp>
  10432. private options allows one to pass a list of key=value tuples as accepted
  10433. by the libx264 <code>x264_param_parse</code> function.
  10434. </p>
  10435. <p>The x264 project website is at
  10436. <a href="http://www.videolan.org/developers/x264.html">http://www.videolan.org/developers/x264.html</a>.
  10437. </p>
  10438. <p>The libx264rgb encoder is the same as libx264, except it accepts packed RGB
  10439. pixel formats as input instead of YUV.
  10440. </p>
  10441. <a name="Supported-Pixel-Formats"></a>
  10442. <h4 class="subsection">16.12.1 Supported Pixel Formats<span class="pull-right"><a class="anchor hidden-xs" href="#Supported-Pixel-Formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Supported-Pixel-Formats" aria-hidden="true">TOC</a></span></h4>
  10443. <p>x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
  10444. x264&rsquo;s configure time.
  10445. </p>
  10446. <a name="Options-32"></a>
  10447. <h4 class="subsection">16.12.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-32" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-32" aria-hidden="true">TOC</a></span></h4>
  10448. <p>The following options are supported by the libx264 wrapper. The
  10449. <code>x264</code>-equivalent options or values are listed in parentheses
  10450. for easy migration.
  10451. </p>
  10452. <p>To reduce the duplication of documentation, only the private options
  10453. and some others requiring special attention are documented here. For
  10454. the documentation of the undocumented generic options, see
  10455. <a href="#codec_002doptions">the Codec Options chapter</a>.
  10456. </p>
  10457. <p>To get a more accurate and extensive documentation of the libx264
  10458. options, invoke the command <code>x264 --fullhelp</code> or consult
  10459. the libx264 documentation.
  10460. </p>
  10461. <dl compact="compact">
  10462. <dt><samp>b (<em>bitrate</em>)</samp></dt>
  10463. <dd><p>Set bitrate in bits/s. Note that FFmpeg&rsquo;s <samp>b</samp> option is
  10464. expressed in bits/s, while <code>x264</code>&rsquo;s <samp>bitrate</samp> is in
  10465. kilobits/s.
  10466. </p>
  10467. </dd>
  10468. <dt><samp>bf (<em>bframes</em>)</samp></dt>
  10469. <dt><samp>g (<em>keyint</em>)</samp></dt>
  10470. <dt><samp>qmin (<em>qpmin</em>)</samp></dt>
  10471. <dd><p>Minimum quantizer scale.
  10472. </p>
  10473. </dd>
  10474. <dt><samp>qmax (<em>qpmax</em>)</samp></dt>
  10475. <dd><p>Maximum quantizer scale.
  10476. </p>
  10477. </dd>
  10478. <dt><samp>qdiff (<em>qpstep</em>)</samp></dt>
  10479. <dd><p>Maximum difference between quantizer scales.
  10480. </p>
  10481. </dd>
  10482. <dt><samp>qblur (<em>qblur</em>)</samp></dt>
  10483. <dd><p>Quantizer curve blur
  10484. </p>
  10485. </dd>
  10486. <dt><samp>qcomp (<em>qcomp</em>)</samp></dt>
  10487. <dd><p>Quantizer curve compression factor
  10488. </p>
  10489. </dd>
  10490. <dt><samp>refs (<em>ref</em>)</samp></dt>
  10491. <dd><p>Number of reference frames each P-frame can use. The range is from <var>0-16</var>.
  10492. </p>
  10493. </dd>
  10494. <dt><samp>sc_threshold (<em>scenecut</em>)</samp></dt>
  10495. <dd><p>Sets the threshold for the scene change detection.
  10496. </p>
  10497. </dd>
  10498. <dt><samp>trellis (<em>trellis</em>)</samp></dt>
  10499. <dd><p>Performs Trellis quantization to increase efficiency. Enabled by default.
  10500. </p>
  10501. </dd>
  10502. <dt><samp>nr (<em>nr</em>)</samp></dt>
  10503. <dt><samp>me_range (<em>merange</em>)</samp></dt>
  10504. <dd><p>Maximum range of the motion search in pixels.
  10505. </p>
  10506. </dd>
  10507. <dt><samp>me_method (<em>me</em>)</samp></dt>
  10508. <dd><p>Set motion estimation method. Possible values in the decreasing order
  10509. of speed:
  10510. </p>
  10511. <dl compact="compact">
  10512. <dt>&lsquo;<samp>dia (<em>dia</em>)</samp>&rsquo;</dt>
  10513. <dt>&lsquo;<samp>epzs (<em>dia</em>)</samp>&rsquo;</dt>
  10514. <dd><p>Diamond search with radius 1 (fastest). &lsquo;<samp>epzs</samp>&rsquo; is an alias for
  10515. &lsquo;<samp>dia</samp>&rsquo;.
  10516. </p></dd>
  10517. <dt>&lsquo;<samp>hex (<em>hex</em>)</samp>&rsquo;</dt>
  10518. <dd><p>Hexagonal search with radius 2.
  10519. </p></dd>
  10520. <dt>&lsquo;<samp>umh (<em>umh</em>)</samp>&rsquo;</dt>
  10521. <dd><p>Uneven multi-hexagon search.
  10522. </p></dd>
  10523. <dt>&lsquo;<samp>esa (<em>esa</em>)</samp>&rsquo;</dt>
  10524. <dd><p>Exhaustive search.
  10525. </p></dd>
  10526. <dt>&lsquo;<samp>tesa (<em>tesa</em>)</samp>&rsquo;</dt>
  10527. <dd><p>Hadamard exhaustive search (slowest).
  10528. </p></dd>
  10529. </dl>
  10530. </dd>
  10531. <dt><samp>forced-idr</samp></dt>
  10532. <dd><p>Normally, when forcing a I-frame type, the encoder can select any type
  10533. of I-frame. This option forces it to choose an IDR-frame.
  10534. </p>
  10535. </dd>
  10536. <dt><samp>subq (<em>subme</em>)</samp></dt>
  10537. <dd><p>Sub-pixel motion estimation method.
  10538. </p>
  10539. </dd>
  10540. <dt><samp>b_strategy (<em>b-adapt</em>)</samp></dt>
  10541. <dd><p>Adaptive B-frame placement decision algorithm. Use only on first-pass.
  10542. </p>
  10543. </dd>
  10544. <dt><samp>keyint_min (<em>min-keyint</em>)</samp></dt>
  10545. <dd><p>Minimum GOP size.
  10546. </p>
  10547. </dd>
  10548. <dt><samp>coder</samp></dt>
  10549. <dd><p>Set entropy encoder. Possible values:
  10550. </p>
  10551. <dl compact="compact">
  10552. <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
  10553. <dd><p>Enable CABAC.
  10554. </p>
  10555. </dd>
  10556. <dt>&lsquo;<samp>vlc</samp>&rsquo;</dt>
  10557. <dd><p>Enable CAVLC and disable CABAC. It generates the same effect as
  10558. <code>x264</code>&rsquo;s <samp>--no-cabac</samp> option.
  10559. </p></dd>
  10560. </dl>
  10561. </dd>
  10562. <dt><samp>cmp</samp></dt>
  10563. <dd><p>Set full pixel motion estimation comparison algorithm. Possible values:
  10564. </p>
  10565. <dl compact="compact">
  10566. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  10567. <dd><p>Enable chroma in motion estimation.
  10568. </p>
  10569. </dd>
  10570. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  10571. <dd><p>Ignore chroma in motion estimation. It generates the same effect as
  10572. <code>x264</code>&rsquo;s <samp>--no-chroma-me</samp> option.
  10573. </p></dd>
  10574. </dl>
  10575. </dd>
  10576. <dt><samp>threads (<em>threads</em>)</samp></dt>
  10577. <dd><p>Number of encoding threads.
  10578. </p>
  10579. </dd>
  10580. <dt><samp>thread_type</samp></dt>
  10581. <dd><p>Set multithreading technique. Possible values:
  10582. </p>
  10583. <dl compact="compact">
  10584. <dt>&lsquo;<samp>slice</samp>&rsquo;</dt>
  10585. <dd><p>Slice-based multithreading. It generates the same effect as
  10586. <code>x264</code>&rsquo;s <samp>--sliced-threads</samp> option.
  10587. </p></dd>
  10588. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  10589. <dd><p>Frame-based multithreading.
  10590. </p></dd>
  10591. </dl>
  10592. </dd>
  10593. <dt><samp>flags</samp></dt>
  10594. <dd><p>Set encoding flags. It can be used to disable closed GOP and enable
  10595. open GOP by setting it to <code>-cgop</code>. The result is similar to
  10596. the behavior of <code>x264</code>&rsquo;s <samp>--open-gop</samp> option.
  10597. </p>
  10598. </dd>
  10599. <dt><samp>rc_init_occupancy (<em>vbv-init</em>)</samp></dt>
  10600. <dt><samp>preset (<em>preset</em>)</samp></dt>
  10601. <dd><p>Set the encoding preset.
  10602. </p>
  10603. </dd>
  10604. <dt><samp>tune (<em>tune</em>)</samp></dt>
  10605. <dd><p>Set tuning of the encoding params.
  10606. </p>
  10607. </dd>
  10608. <dt><samp>profile (<em>profile</em>)</samp></dt>
  10609. <dd><p>Set profile restrictions.
  10610. </p>
  10611. </dd>
  10612. <dt><samp>fastfirstpass</samp></dt>
  10613. <dd><p>Enable fast settings when encoding first pass, when set to 1. When set
  10614. to 0, it has the same effect of <code>x264</code>&rsquo;s
  10615. <samp>--slow-firstpass</samp> option.
  10616. </p>
  10617. </dd>
  10618. <dt><samp>crf (<em>crf</em>)</samp></dt>
  10619. <dd><p>Set the quality for constant quality mode.
  10620. </p>
  10621. </dd>
  10622. <dt><samp>crf_max (<em>crf-max</em>)</samp></dt>
  10623. <dd><p>In CRF mode, prevents VBV from lowering quality beyond this point.
  10624. </p>
  10625. </dd>
  10626. <dt><samp>qp (<em>qp</em>)</samp></dt>
  10627. <dd><p>Set constant quantization rate control method parameter.
  10628. </p>
  10629. </dd>
  10630. <dt><samp>aq-mode (<em>aq-mode</em>)</samp></dt>
  10631. <dd><p>Set AQ method. Possible values:
  10632. </p>
  10633. <dl compact="compact">
  10634. <dt>&lsquo;<samp>none (<em>0</em>)</samp>&rsquo;</dt>
  10635. <dd><p>Disabled.
  10636. </p>
  10637. </dd>
  10638. <dt>&lsquo;<samp>variance (<em>1</em>)</samp>&rsquo;</dt>
  10639. <dd><p>Variance AQ (complexity mask).
  10640. </p>
  10641. </dd>
  10642. <dt>&lsquo;<samp>autovariance (<em>2</em>)</samp>&rsquo;</dt>
  10643. <dd><p>Auto-variance AQ (experimental).
  10644. </p></dd>
  10645. </dl>
  10646. </dd>
  10647. <dt><samp>aq-strength (<em>aq-strength</em>)</samp></dt>
  10648. <dd><p>Set AQ strength, reduce blocking and blurring in flat and textured areas.
  10649. </p>
  10650. </dd>
  10651. <dt><samp>psy</samp></dt>
  10652. <dd><p>Use psychovisual optimizations when set to 1. When set to 0, it has the
  10653. same effect as <code>x264</code>&rsquo;s <samp>--no-psy</samp> option.
  10654. </p>
  10655. </dd>
  10656. <dt><samp>psy-rd (<em>psy-rd</em>)</samp></dt>
  10657. <dd><p>Set strength of psychovisual optimization, in
  10658. <var>psy-rd</var>:<var>psy-trellis</var> format.
  10659. </p>
  10660. </dd>
  10661. <dt><samp>rc-lookahead (<em>rc-lookahead</em>)</samp></dt>
  10662. <dd><p>Set number of frames to look ahead for frametype and ratecontrol.
  10663. </p>
  10664. </dd>
  10665. <dt><samp>weightb</samp></dt>
  10666. <dd><p>Enable weighted prediction for B-frames when set to 1. When set to 0,
  10667. it has the same effect as <code>x264</code>&rsquo;s <samp>--no-weightb</samp> option.
  10668. </p>
  10669. </dd>
  10670. <dt><samp>weightp (<em>weightp</em>)</samp></dt>
  10671. <dd><p>Set weighted prediction method for P-frames. Possible values:
  10672. </p>
  10673. <dl compact="compact">
  10674. <dt>&lsquo;<samp>none (<em>0</em>)</samp>&rsquo;</dt>
  10675. <dd><p>Disabled
  10676. </p></dd>
  10677. <dt>&lsquo;<samp>simple (<em>1</em>)</samp>&rsquo;</dt>
  10678. <dd><p>Enable only weighted refs
  10679. </p></dd>
  10680. <dt>&lsquo;<samp>smart (<em>2</em>)</samp>&rsquo;</dt>
  10681. <dd><p>Enable both weighted refs and duplicates
  10682. </p></dd>
  10683. </dl>
  10684. </dd>
  10685. <dt><samp>ssim (<em>ssim</em>)</samp></dt>
  10686. <dd><p>Enable calculation and printing SSIM stats after the encoding.
  10687. </p>
  10688. </dd>
  10689. <dt><samp>intra-refresh (<em>intra-refresh</em>)</samp></dt>
  10690. <dd><p>Enable the use of Periodic Intra Refresh instead of IDR frames when set
  10691. to 1.
  10692. </p>
  10693. </dd>
  10694. <dt><samp>avcintra-class (<em>class</em>)</samp></dt>
  10695. <dd><p>Configure the encoder to generate AVC-Intra.
  10696. Valid values are 50,100 and 200
  10697. </p>
  10698. </dd>
  10699. <dt><samp>bluray-compat (<em>bluray-compat</em>)</samp></dt>
  10700. <dd><p>Configure the encoder to be compatible with the bluray standard.
  10701. It is a shorthand for setting &quot;bluray-compat=1 force-cfr=1&quot;.
  10702. </p>
  10703. </dd>
  10704. <dt><samp>b-bias (<em>b-bias</em>)</samp></dt>
  10705. <dd><p>Set the influence on how often B-frames are used.
  10706. </p>
  10707. </dd>
  10708. <dt><samp>b-pyramid (<em>b-pyramid</em>)</samp></dt>
  10709. <dd><p>Set method for keeping of some B-frames as references. Possible values:
  10710. </p>
  10711. <dl compact="compact">
  10712. <dt>&lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
  10713. <dd><p>Disabled.
  10714. </p></dd>
  10715. <dt>&lsquo;<samp>strict (<em>strict</em>)</samp>&rsquo;</dt>
  10716. <dd><p>Strictly hierarchical pyramid.
  10717. </p></dd>
  10718. <dt>&lsquo;<samp>normal (<em>normal</em>)</samp>&rsquo;</dt>
  10719. <dd><p>Non-strict (not Blu-ray compatible).
  10720. </p></dd>
  10721. </dl>
  10722. </dd>
  10723. <dt><samp>mixed-refs</samp></dt>
  10724. <dd><p>Enable the use of one reference per partition, as opposed to one
  10725. reference per macroblock when set to 1. When set to 0, it has the
  10726. same effect as <code>x264</code>&rsquo;s <samp>--no-mixed-refs</samp> option.
  10727. </p>
  10728. </dd>
  10729. <dt><samp>8x8dct</samp></dt>
  10730. <dd><p>Enable adaptive spatial transform (high profile 8x8 transform)
  10731. when set to 1. When set to 0, it has the same effect as
  10732. <code>x264</code>&rsquo;s <samp>--no-8x8dct</samp> option.
  10733. </p>
  10734. </dd>
  10735. <dt><samp>fast-pskip</samp></dt>
  10736. <dd><p>Enable early SKIP detection on P-frames when set to 1. When set
  10737. to 0, it has the same effect as <code>x264</code>&rsquo;s
  10738. <samp>--no-fast-pskip</samp> option.
  10739. </p>
  10740. </dd>
  10741. <dt><samp>aud (<em>aud</em>)</samp></dt>
  10742. <dd><p>Enable use of access unit delimiters when set to 1.
  10743. </p>
  10744. </dd>
  10745. <dt><samp>mbtree</samp></dt>
  10746. <dd><p>Enable use macroblock tree ratecontrol when set to 1. When set
  10747. to 0, it has the same effect as <code>x264</code>&rsquo;s
  10748. <samp>--no-mbtree</samp> option.
  10749. </p>
  10750. </dd>
  10751. <dt><samp>deblock (<em>deblock</em>)</samp></dt>
  10752. <dd><p>Set loop filter parameters, in <var>alpha</var>:<var>beta</var> form.
  10753. </p>
  10754. </dd>
  10755. <dt><samp>cplxblur (<em>cplxblur</em>)</samp></dt>
  10756. <dd><p>Set fluctuations reduction in QP (before curve compression).
  10757. </p>
  10758. </dd>
  10759. <dt><samp>partitions (<em>partitions</em>)</samp></dt>
  10760. <dd><p>Set partitions to consider as a comma-separated list of. Possible
  10761. values in the list:
  10762. </p>
  10763. <dl compact="compact">
  10764. <dt>&lsquo;<samp>p8x8</samp>&rsquo;</dt>
  10765. <dd><p>8x8 P-frame partition.
  10766. </p></dd>
  10767. <dt>&lsquo;<samp>p4x4</samp>&rsquo;</dt>
  10768. <dd><p>4x4 P-frame partition.
  10769. </p></dd>
  10770. <dt>&lsquo;<samp>b8x8</samp>&rsquo;</dt>
  10771. <dd><p>4x4 B-frame partition.
  10772. </p></dd>
  10773. <dt>&lsquo;<samp>i8x8</samp>&rsquo;</dt>
  10774. <dd><p>8x8 I-frame partition.
  10775. </p></dd>
  10776. <dt>&lsquo;<samp>i4x4</samp>&rsquo;</dt>
  10777. <dd><p>4x4 I-frame partition.
  10778. (Enabling &lsquo;<samp>p4x4</samp>&rsquo; requires &lsquo;<samp>p8x8</samp>&rsquo; to be enabled. Enabling
  10779. &lsquo;<samp>i8x8</samp>&rsquo; requires adaptive spatial transform (<samp>8x8dct</samp>
  10780. option) to be enabled.)
  10781. </p></dd>
  10782. <dt>&lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
  10783. <dd><p>Do not consider any partitions.
  10784. </p></dd>
  10785. <dt>&lsquo;<samp>all (<em>all</em>)</samp>&rsquo;</dt>
  10786. <dd><p>Consider every partition.
  10787. </p></dd>
  10788. </dl>
  10789. </dd>
  10790. <dt><samp>direct-pred (<em>direct</em>)</samp></dt>
  10791. <dd><p>Set direct MV prediction mode. Possible values:
  10792. </p>
  10793. <dl compact="compact">
  10794. <dt>&lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
  10795. <dd><p>Disable MV prediction.
  10796. </p></dd>
  10797. <dt>&lsquo;<samp>spatial (<em>spatial</em>)</samp>&rsquo;</dt>
  10798. <dd><p>Enable spatial predicting.
  10799. </p></dd>
  10800. <dt>&lsquo;<samp>temporal (<em>temporal</em>)</samp>&rsquo;</dt>
  10801. <dd><p>Enable temporal predicting.
  10802. </p></dd>
  10803. <dt>&lsquo;<samp>auto (<em>auto</em>)</samp>&rsquo;</dt>
  10804. <dd><p>Automatically decided.
  10805. </p></dd>
  10806. </dl>
  10807. </dd>
  10808. <dt><samp>slice-max-size (<em>slice-max-size</em>)</samp></dt>
  10809. <dd><p>Set the limit of the size of each slice in bytes. If not specified
  10810. but RTP payload size (<samp>ps</samp>) is specified, that is used.
  10811. </p>
  10812. </dd>
  10813. <dt><samp>stats (<em>stats</em>)</samp></dt>
  10814. <dd><p>Set the file name for multi-pass stats.
  10815. </p>
  10816. </dd>
  10817. <dt><samp>nal-hrd (<em>nal-hrd</em>)</samp></dt>
  10818. <dd><p>Set signal HRD information (requires <samp>vbv-bufsize</samp> to be set).
  10819. Possible values:
  10820. </p>
  10821. <dl compact="compact">
  10822. <dt>&lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
  10823. <dd><p>Disable HRD information signaling.
  10824. </p></dd>
  10825. <dt>&lsquo;<samp>vbr (<em>vbr</em>)</samp>&rsquo;</dt>
  10826. <dd><p>Variable bit rate.
  10827. </p></dd>
  10828. <dt>&lsquo;<samp>cbr (<em>cbr</em>)</samp>&rsquo;</dt>
  10829. <dd><p>Constant bit rate (not allowed in MP4 container).
  10830. </p></dd>
  10831. </dl>
  10832. </dd>
  10833. <dt><samp>x264opts (N.A.)</samp></dt>
  10834. <dd><p>Set any x264 option, see <code>x264 --fullhelp</code> for a list.
  10835. </p>
  10836. <p>Argument is a list of <var>key</var>=<var>value</var> couples separated by
  10837. &quot;:&quot;. In <var>filter</var> and <var>psy-rd</var> options that use &quot;:&quot; as a separator
  10838. themselves, use &quot;,&quot; instead. They accept it as well since long ago but this
  10839. is kept undocumented for some reason.
  10840. </p>
  10841. <p>For example to specify libx264 encoding options with <code>ffmpeg</code>:
  10842. </p><div class="example">
  10843. <pre class="example">ffmpeg -i foo.mpg -c:v libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
  10844. </pre></div>
  10845. </dd>
  10846. <dt><samp>a53cc <var>boolean</var></samp></dt>
  10847. <dd><p>Import closed captions (which must be ATSC compatible format) into output.
  10848. Only the mpeg2 and h264 decoders provide these. Default is 1 (on).
  10849. </p>
  10850. </dd>
  10851. <dt><samp>x264-params (N.A.)</samp></dt>
  10852. <dd><p>Override the x264 configuration using a :-separated list of key=value
  10853. parameters.
  10854. </p>
  10855. <p>This option is functionally the same as the <samp>x264opts</samp>, but is
  10856. duplicated for compatibility with the Libav fork.
  10857. </p>
  10858. <p>For example to specify libx264 encoding options with <code>ffmpeg</code>:
  10859. </p><div class="example">
  10860. <pre class="example">ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
  10861. cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
  10862. no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
  10863. </pre></div>
  10864. </dd>
  10865. </dl>
  10866. <p>Encoding ffpresets for common usages are provided so they can be used with the
  10867. general presets system (e.g. passing the <samp>pre</samp> option).
  10868. </p>
  10869. <a name="libx265"></a>
  10870. <h3 class="section">16.13 libx265<span class="pull-right"><a class="anchor hidden-xs" href="#libx265" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libx265" aria-hidden="true">TOC</a></span></h3>
  10871. <p>x265 H.265/HEVC encoder wrapper.
  10872. </p>
  10873. <p>This encoder requires the presence of the libx265 headers and library
  10874. during configuration. You need to explicitly configure the build with
  10875. <samp>--enable-libx265</samp>.
  10876. </p>
  10877. <a name="Options-33"></a>
  10878. <h4 class="subsection">16.13.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-33" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-33" aria-hidden="true">TOC</a></span></h4>
  10879. <dl compact="compact">
  10880. <dt><samp>b</samp></dt>
  10881. <dd><p>Sets target video bitrate.
  10882. </p>
  10883. </dd>
  10884. <dt><samp>bf</samp></dt>
  10885. <dt><samp>g</samp></dt>
  10886. <dd><p>Set the GOP size.
  10887. </p>
  10888. </dd>
  10889. <dt><samp>keyint_min</samp></dt>
  10890. <dd><p>Minimum GOP size.
  10891. </p>
  10892. </dd>
  10893. <dt><samp>refs</samp></dt>
  10894. <dd><p>Number of reference frames each P-frame can use. The range is from <var>1-16</var>.
  10895. </p>
  10896. </dd>
  10897. <dt><samp>preset</samp></dt>
  10898. <dd><p>Set the x265 preset.
  10899. </p>
  10900. </dd>
  10901. <dt><samp>tune</samp></dt>
  10902. <dd><p>Set the x265 tune parameter.
  10903. </p>
  10904. </dd>
  10905. <dt><samp>profile</samp></dt>
  10906. <dd><p>Set profile restrictions.
  10907. </p>
  10908. </dd>
  10909. <dt><samp>crf</samp></dt>
  10910. <dd><p>Set the quality for constant quality mode.
  10911. </p>
  10912. </dd>
  10913. <dt><samp>qp</samp></dt>
  10914. <dd><p>Set constant quantization rate control method parameter.
  10915. </p>
  10916. </dd>
  10917. <dt><samp>qmin</samp></dt>
  10918. <dd><p>Minimum quantizer scale.
  10919. </p>
  10920. </dd>
  10921. <dt><samp>qmax</samp></dt>
  10922. <dd><p>Maximum quantizer scale.
  10923. </p>
  10924. </dd>
  10925. <dt><samp>qdiff</samp></dt>
  10926. <dd><p>Maximum difference between quantizer scales.
  10927. </p>
  10928. </dd>
  10929. <dt><samp>qblur</samp></dt>
  10930. <dd><p>Quantizer curve blur
  10931. </p>
  10932. </dd>
  10933. <dt><samp>qcomp</samp></dt>
  10934. <dd><p>Quantizer curve compression factor
  10935. </p>
  10936. </dd>
  10937. <dt><samp>i_qfactor</samp></dt>
  10938. <dt><samp>b_qfactor</samp></dt>
  10939. <dt><samp>forced-idr</samp></dt>
  10940. <dd><p>Normally, when forcing a I-frame type, the encoder can select any type
  10941. of I-frame. This option forces it to choose an IDR-frame.
  10942. </p>
  10943. </dd>
  10944. <dt><samp>x265-params</samp></dt>
  10945. <dd><p>Set x265 options using a list of <var>key</var>=<var>value</var> couples separated
  10946. by &quot;:&quot;. See <code>x265 --help</code> for a list of options.
  10947. </p>
  10948. <p>For example to specify libx265 encoding options with <samp>-x265-params</samp>:
  10949. </p>
  10950. <div class="example">
  10951. <pre class="example">ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
  10952. </pre></div>
  10953. </dd>
  10954. </dl>
  10955. <a name="libxavs2"></a>
  10956. <h3 class="section">16.14 libxavs2<span class="pull-right"><a class="anchor hidden-xs" href="#libxavs2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libxavs2" aria-hidden="true">TOC</a></span></h3>
  10957. <p>xavs2 AVS2-P2/IEEE1857.4 encoder wrapper.
  10958. </p>
  10959. <p>This encoder requires the presence of the libxavs2 headers and library
  10960. during configuration. You need to explicitly configure the build with
  10961. <samp>--enable-libxavs2</samp>.
  10962. </p>
  10963. <p>The following standard libavcodec options are used:
  10964. </p><ul>
  10965. <li> <samp>b</samp> / <samp>bit_rate</samp>
  10966. </li><li> <samp>g</samp> / <samp>gop_size</samp>
  10967. </li><li> <samp>bf</samp> / <samp>max_b_frames</samp>
  10968. </li></ul>
  10969. <p>The encoder also has its own specific options:
  10970. </p><a name="Options-34"></a>
  10971. <h4 class="subsection">16.14.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-34" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-34" aria-hidden="true">TOC</a></span></h4>
  10972. <dl compact="compact">
  10973. <dt><samp>lcu_row_threads</samp></dt>
  10974. <dd><p>Set the number of parallel threads for rows from 1 to 8 (default 5).
  10975. </p>
  10976. </dd>
  10977. <dt><samp>initial_qp</samp></dt>
  10978. <dd><p>Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  10979. used to set the initial qp for the first frame.
  10980. </p>
  10981. </dd>
  10982. <dt><samp>qp</samp></dt>
  10983. <dd><p>Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  10984. used to set the qp value under constant-QP mode.
  10985. </p>
  10986. </dd>
  10987. <dt><samp>max_qp</samp></dt>
  10988. <dd><p>Set the max qp for rate control from 1 to 63 (default 55).
  10989. </p>
  10990. </dd>
  10991. <dt><samp>min_qp</samp></dt>
  10992. <dd><p>Set the min qp for rate control from 1 to 63 (default 20).
  10993. </p>
  10994. </dd>
  10995. <dt><samp>speed_level</samp></dt>
  10996. <dd><p>Set the Speed level from 0 to 9 (default 0). Higher is better but slower.
  10997. </p>
  10998. </dd>
  10999. <dt><samp>log_level</samp></dt>
  11000. <dd><p>Set the log level from -1 to 3 (default 0). -1: none, 0: error,
  11001. 1: warning, 2: info, 3: debug.
  11002. </p>
  11003. </dd>
  11004. <dt><samp>xavs2-params</samp></dt>
  11005. <dd><p>Set xavs2 options using a list of <var>key</var>=<var>value</var> couples separated
  11006. by &quot;:&quot;.
  11007. </p>
  11008. <p>For example to specify libxavs2 encoding options with <samp>-xavs2-params</samp>:
  11009. </p>
  11010. <div class="example">
  11011. <pre class="example">ffmpeg -i input -c:v libxavs2 -xavs2-params RdoqLevel=0 output.avs2
  11012. </pre></div>
  11013. </dd>
  11014. </dl>
  11015. <a name="libxvid"></a>
  11016. <h3 class="section">16.15 libxvid<span class="pull-right"><a class="anchor hidden-xs" href="#libxvid" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libxvid" aria-hidden="true">TOC</a></span></h3>
  11017. <p>Xvid MPEG-4 Part 2 encoder wrapper.
  11018. </p>
  11019. <p>This encoder requires the presence of the libxvidcore headers and library
  11020. during configuration. You need to explicitly configure the build with
  11021. <code>--enable-libxvid --enable-gpl</code>.
  11022. </p>
  11023. <p>The native <code>mpeg4</code> encoder supports the MPEG-4 Part 2 format, so
  11024. users can encode to this format without this library.
  11025. </p>
  11026. <a name="Options-35"></a>
  11027. <h4 class="subsection">16.15.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-35" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-35" aria-hidden="true">TOC</a></span></h4>
  11028. <p>The following options are supported by the libxvid wrapper. Some of
  11029. the following options are listed but are not documented, and
  11030. correspond to shared codec options. See <a href="#codec_002doptions">the Codec
  11031. Options chapter</a> for their documentation. The other shared options
  11032. which are not listed have no effect for the libxvid encoder.
  11033. </p>
  11034. <dl compact="compact">
  11035. <dt><samp>b</samp></dt>
  11036. <dt><samp>g</samp></dt>
  11037. <dt><samp>qmin</samp></dt>
  11038. <dt><samp>qmax</samp></dt>
  11039. <dt><samp>mpeg_quant</samp></dt>
  11040. <dt><samp>threads</samp></dt>
  11041. <dt><samp>bf</samp></dt>
  11042. <dt><samp>b_qfactor</samp></dt>
  11043. <dt><samp>b_qoffset</samp></dt>
  11044. <dt><samp>flags</samp></dt>
  11045. <dd><p>Set specific encoding flags. Possible values:
  11046. </p>
  11047. <dl compact="compact">
  11048. <dt>&lsquo;<samp>mv4</samp>&rsquo;</dt>
  11049. <dd><p>Use four motion vector by macroblock.
  11050. </p>
  11051. </dd>
  11052. <dt>&lsquo;<samp>aic</samp>&rsquo;</dt>
  11053. <dd><p>Enable high quality AC prediction.
  11054. </p>
  11055. </dd>
  11056. <dt>&lsquo;<samp>gray</samp>&rsquo;</dt>
  11057. <dd><p>Only encode grayscale.
  11058. </p>
  11059. </dd>
  11060. <dt>&lsquo;<samp>gmc</samp>&rsquo;</dt>
  11061. <dd><p>Enable the use of global motion compensation (GMC).
  11062. </p>
  11063. </dd>
  11064. <dt>&lsquo;<samp>qpel</samp>&rsquo;</dt>
  11065. <dd><p>Enable quarter-pixel motion compensation.
  11066. </p>
  11067. </dd>
  11068. <dt>&lsquo;<samp>cgop</samp>&rsquo;</dt>
  11069. <dd><p>Enable closed GOP.
  11070. </p>
  11071. </dd>
  11072. <dt>&lsquo;<samp>global_header</samp>&rsquo;</dt>
  11073. <dd><p>Place global headers in extradata instead of every keyframe.
  11074. </p>
  11075. </dd>
  11076. </dl>
  11077. </dd>
  11078. <dt><samp>trellis</samp></dt>
  11079. <dt><samp>me_method</samp></dt>
  11080. <dd><p>Set motion estimation method. Possible values in decreasing order of
  11081. speed and increasing order of quality:
  11082. </p>
  11083. <dl compact="compact">
  11084. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  11085. <dd><p>Use no motion estimation (default).
  11086. </p>
  11087. </dd>
  11088. <dt>&lsquo;<samp>phods</samp>&rsquo;</dt>
  11089. <dt>&lsquo;<samp>x1</samp>&rsquo;</dt>
  11090. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  11091. <dd><p>Enable advanced diamond zonal search for 16x16 blocks and half-pixel
  11092. refinement for 16x16 blocks. &lsquo;<samp>x1</samp>&rsquo; and &lsquo;<samp>log</samp>&rsquo; are aliases for
  11093. &lsquo;<samp>phods</samp>&rsquo;.
  11094. </p>
  11095. </dd>
  11096. <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
  11097. <dd><p>Enable all of the things described above, plus advanced diamond zonal
  11098. search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
  11099. estimation on chroma planes.
  11100. </p>
  11101. </dd>
  11102. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  11103. <dd><p>Enable all of the things described above, plus extended 16x16 and 8x8
  11104. blocks search.
  11105. </p></dd>
  11106. </dl>
  11107. </dd>
  11108. <dt><samp>mbd</samp></dt>
  11109. <dd><p>Set macroblock decision algorithm. Possible values in the increasing
  11110. order of quality:
  11111. </p>
  11112. <dl compact="compact">
  11113. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  11114. <dd><p>Use macroblock comparing function algorithm (default).
  11115. </p>
  11116. </dd>
  11117. <dt>&lsquo;<samp>bits</samp>&rsquo;</dt>
  11118. <dd><p>Enable rate distortion-based half pixel and quarter pixel refinement for
  11119. 16x16 blocks.
  11120. </p>
  11121. </dd>
  11122. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  11123. <dd><p>Enable all of the things described above, plus rate distortion-based
  11124. half pixel and quarter pixel refinement for 8x8 blocks, and rate
  11125. distortion-based search using square pattern.
  11126. </p></dd>
  11127. </dl>
  11128. </dd>
  11129. <dt><samp>lumi_aq</samp></dt>
  11130. <dd><p>Enable lumi masking adaptive quantization when set to 1. Default is 0
  11131. (disabled).
  11132. </p>
  11133. </dd>
  11134. <dt><samp>variance_aq</samp></dt>
  11135. <dd><p>Enable variance adaptive quantization when set to 1. Default is 0
  11136. (disabled).
  11137. </p>
  11138. <p>When combined with <samp>lumi_aq</samp>, the resulting quality will not
  11139. be better than any of the two specified individually. In other
  11140. words, the resulting quality will be the worse one of the two
  11141. effects.
  11142. </p>
  11143. </dd>
  11144. <dt><samp>ssim</samp></dt>
  11145. <dd><p>Set structural similarity (SSIM) displaying method. Possible values:
  11146. </p>
  11147. <dl compact="compact">
  11148. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  11149. <dd><p>Disable displaying of SSIM information.
  11150. </p>
  11151. </dd>
  11152. <dt>&lsquo;<samp>avg</samp>&rsquo;</dt>
  11153. <dd><p>Output average SSIM at the end of encoding to stdout. The format of
  11154. showing the average SSIM is:
  11155. </p>
  11156. <div class="example">
  11157. <pre class="example">Average SSIM: %f
  11158. </pre></div>
  11159. <p>For users who are not familiar with C, %f means a float number, or
  11160. a decimal (e.g. 0.939232).
  11161. </p>
  11162. </dd>
  11163. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  11164. <dd><p>Output both per-frame SSIM data during encoding and average SSIM at
  11165. the end of encoding to stdout. The format of per-frame information
  11166. is:
  11167. </p>
  11168. <div class="example">
  11169. <pre class="example"> SSIM: avg: %1.3f min: %1.3f max: %1.3f
  11170. </pre></div>
  11171. <p>For users who are not familiar with C, %1.3f means a float number
  11172. rounded to 3 digits after the dot (e.g. 0.932).
  11173. </p>
  11174. </dd>
  11175. </dl>
  11176. </dd>
  11177. <dt><samp>ssim_acc</samp></dt>
  11178. <dd><p>Set SSIM accuracy. Valid options are integers within the range of
  11179. 0-4, while 0 gives the most accurate result and 4 computes the
  11180. fastest.
  11181. </p>
  11182. </dd>
  11183. </dl>
  11184. <a name="MediaFoundation"></a>
  11185. <h3 class="section">16.16 MediaFoundation<span class="pull-right"><a class="anchor hidden-xs" href="#MediaFoundation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-MediaFoundation" aria-hidden="true">TOC</a></span></h3>
  11186. <p>This provides wrappers to encoders (both audio and video) in the
  11187. MediaFoundation framework. It can access both SW and HW encoders.
  11188. Video encoders can take input in either of nv12 or yuv420p form
  11189. (some encoders support both, some support only either - in practice,
  11190. nv12 is the safer choice, especially among HW encoders).
  11191. </p>
  11192. <a name="mpeg2"></a>
  11193. <h3 class="section">16.17 mpeg2<span class="pull-right"><a class="anchor hidden-xs" href="#mpeg2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpeg2" aria-hidden="true">TOC</a></span></h3>
  11194. <p>MPEG-2 video encoder.
  11195. </p>
  11196. <a name="Options-36"></a>
  11197. <h4 class="subsection">16.17.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-36" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-36" aria-hidden="true">TOC</a></span></h4>
  11198. <dl compact="compact">
  11199. <dt><samp>profile</samp></dt>
  11200. <dd><p>Select the mpeg2 profile to encode:
  11201. </p>
  11202. <dl compact="compact">
  11203. <dt>&lsquo;<samp>422</samp>&rsquo;</dt>
  11204. <dt>&lsquo;<samp>high</samp>&rsquo;</dt>
  11205. <dt>&lsquo;<samp>ss</samp>&rsquo;</dt>
  11206. <dd><p>Spatially Scalable
  11207. </p></dd>
  11208. <dt>&lsquo;<samp>snr</samp>&rsquo;</dt>
  11209. <dd><p>SNR Scalable
  11210. </p></dd>
  11211. <dt>&lsquo;<samp>main</samp>&rsquo;</dt>
  11212. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  11213. </dl>
  11214. </dd>
  11215. <dt><samp>level</samp></dt>
  11216. <dd><p>Select the mpeg2 level to encode:
  11217. </p>
  11218. <dl compact="compact">
  11219. <dt>&lsquo;<samp>high</samp>&rsquo;</dt>
  11220. <dt>&lsquo;<samp>high1440</samp>&rsquo;</dt>
  11221. <dt>&lsquo;<samp>main</samp>&rsquo;</dt>
  11222. <dt>&lsquo;<samp>low</samp>&rsquo;</dt>
  11223. </dl>
  11224. </dd>
  11225. <dt><samp>seq_disp_ext <var>integer</var></samp></dt>
  11226. <dd><p>Specifies if the encoder should write a sequence_display_extension to the
  11227. output.
  11228. </p><dl compact="compact">
  11229. <dt><samp>-1</samp></dt>
  11230. <dt><samp>auto</samp></dt>
  11231. <dd><p>Decide automatically to write it or not (this is the default) by checking if
  11232. the data to be written is different from the default or unspecified values.
  11233. </p></dd>
  11234. <dt><samp>0</samp></dt>
  11235. <dt><samp>never</samp></dt>
  11236. <dd><p>Never write it.
  11237. </p></dd>
  11238. <dt><samp>1</samp></dt>
  11239. <dt><samp>always</samp></dt>
  11240. <dd><p>Always write it.
  11241. </p></dd>
  11242. </dl>
  11243. </dd>
  11244. <dt><samp>video_format <var>integer</var></samp></dt>
  11245. <dd><p>Specifies the video_format written into the sequence display extension
  11246. indicating the source of the video pictures. The default is &lsquo;<samp>unspecified</samp>&rsquo;,
  11247. can be &lsquo;<samp>component</samp>&rsquo;, &lsquo;<samp>pal</samp>&rsquo;, &lsquo;<samp>ntsc</samp>&rsquo;, &lsquo;<samp>secam</samp>&rsquo; or &lsquo;<samp>mac</samp>&rsquo;.
  11248. For maximum compatibility, use &lsquo;<samp>component</samp>&rsquo;.
  11249. </p></dd>
  11250. <dt><samp>a53cc <var>boolean</var></samp></dt>
  11251. <dd><p>Import closed captions (which must be ATSC compatible format) into output.
  11252. Default is 1 (on).
  11253. </p></dd>
  11254. </dl>
  11255. <a name="png"></a>
  11256. <h3 class="section">16.18 png<span class="pull-right"><a class="anchor hidden-xs" href="#png" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-png" aria-hidden="true">TOC</a></span></h3>
  11257. <p>PNG image encoder.
  11258. </p>
  11259. <a name="Private-options-1"></a>
  11260. <h4 class="subsection">16.18.1 Private options<span class="pull-right"><a class="anchor hidden-xs" href="#Private-options-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Private-options-1" aria-hidden="true">TOC</a></span></h4>
  11261. <dl compact="compact">
  11262. <dt><samp>dpi <var>integer</var></samp></dt>
  11263. <dd><p>Set physical density of pixels, in dots per inch, unset by default
  11264. </p></dd>
  11265. <dt><samp>dpm <var>integer</var></samp></dt>
  11266. <dd><p>Set physical density of pixels, in dots per meter, unset by default
  11267. </p></dd>
  11268. </dl>
  11269. <a name="ProRes"></a>
  11270. <h3 class="section">16.19 ProRes<span class="pull-right"><a class="anchor hidden-xs" href="#ProRes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ProRes" aria-hidden="true">TOC</a></span></h3>
  11271. <p>Apple ProRes encoder.
  11272. </p>
  11273. <p>FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
  11274. The used encoder can be chosen with the <code>-vcodec</code> option.
  11275. </p>
  11276. <a name="Private-Options-for-prores_002dks"></a>
  11277. <h4 class="subsection">16.19.1 Private Options for prores-ks<span class="pull-right"><a class="anchor hidden-xs" href="#Private-Options-for-prores_002dks" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Private-Options-for-prores_002dks" aria-hidden="true">TOC</a></span></h4>
  11278. <dl compact="compact">
  11279. <dt><samp>profile <var>integer</var></samp></dt>
  11280. <dd><p>Select the ProRes profile to encode
  11281. </p><dl compact="compact">
  11282. <dt>&lsquo;<samp>proxy</samp>&rsquo;</dt>
  11283. <dt>&lsquo;<samp>lt</samp>&rsquo;</dt>
  11284. <dt>&lsquo;<samp>standard</samp>&rsquo;</dt>
  11285. <dt>&lsquo;<samp>hq</samp>&rsquo;</dt>
  11286. <dt>&lsquo;<samp>4444</samp>&rsquo;</dt>
  11287. <dt>&lsquo;<samp>4444xq</samp>&rsquo;</dt>
  11288. </dl>
  11289. </dd>
  11290. <dt><samp>quant_mat <var>integer</var></samp></dt>
  11291. <dd><p>Select quantization matrix.
  11292. </p><dl compact="compact">
  11293. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  11294. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  11295. <dt>&lsquo;<samp>proxy</samp>&rsquo;</dt>
  11296. <dt>&lsquo;<samp>lt</samp>&rsquo;</dt>
  11297. <dt>&lsquo;<samp>standard</samp>&rsquo;</dt>
  11298. <dt>&lsquo;<samp>hq</samp>&rsquo;</dt>
  11299. </dl>
  11300. <p>If set to <var>auto</var>, the matrix matching the profile will be picked.
  11301. If not set, the matrix providing the highest quality, <var>default</var>, will be
  11302. picked.
  11303. </p>
  11304. </dd>
  11305. <dt><samp>bits_per_mb <var>integer</var></samp></dt>
  11306. <dd><p>How many bits to allot for coding one macroblock. Different profiles use
  11307. between 200 and 2400 bits per macroblock, the maximum is 8000.
  11308. </p>
  11309. </dd>
  11310. <dt><samp>mbs_per_slice <var>integer</var></samp></dt>
  11311. <dd><p>Number of macroblocks in each slice (1-8); the default value (8)
  11312. should be good in almost all situations.
  11313. </p>
  11314. </dd>
  11315. <dt><samp>vendor <var>string</var></samp></dt>
  11316. <dd><p>Override the 4-byte vendor ID.
  11317. A custom vendor ID like <var>apl0</var> would claim the stream was produced by
  11318. the Apple encoder.
  11319. </p>
  11320. </dd>
  11321. <dt><samp>alpha_bits <var>integer</var></samp></dt>
  11322. <dd><p>Specify number of bits for alpha component.
  11323. Possible values are <var>0</var>, <var>8</var> and <var>16</var>.
  11324. Use <var>0</var> to disable alpha plane coding.
  11325. </p>
  11326. </dd>
  11327. </dl>
  11328. <a name="Speed-considerations"></a>
  11329. <h4 class="subsection">16.19.2 Speed considerations<span class="pull-right"><a class="anchor hidden-xs" href="#Speed-considerations" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Speed-considerations" aria-hidden="true">TOC</a></span></h4>
  11330. <p>In the default mode of operation the encoder has to honor frame constraints
  11331. (i.e. not produce frames with size bigger than requested) while still making
  11332. output picture as good as possible.
  11333. A frame containing a lot of small details is harder to compress and the encoder
  11334. would spend more time searching for appropriate quantizers for each slice.
  11335. </p>
  11336. <p>Setting a higher <samp>bits_per_mb</samp> limit will improve the speed.
  11337. </p>
  11338. <p>For the fastest encoding speed set the <samp>qscale</samp> parameter (4 is the
  11339. recommended value) and do not set a size constraint.
  11340. </p>
  11341. <a name="QSV-encoders"></a>
  11342. <h3 class="section">16.20 QSV encoders<span class="pull-right"><a class="anchor hidden-xs" href="#QSV-encoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-QSV-encoders" aria-hidden="true">TOC</a></span></h3>
  11343. <p>The family of Intel QuickSync Video encoders (MPEG-2, H.264, HEVC, JPEG/MJPEG and VP9)
  11344. </p>
  11345. <p>The ratecontrol method is selected as follows:
  11346. </p>
  11347. <ul>
  11348. <li> When <samp>global_quality</samp> is specified, a quality-based mode is used.
  11349. Specifically this means either
  11350. <ul class="no-bullet">
  11351. <li>- <var>CQP</var> - constant quantizer scale, when the <samp>qscale</samp> codec flag is
  11352. also set (the <samp>-qscale</samp> ffmpeg option).
  11353. </li><li>- <var>LA_ICQ</var> - intelligent constant quality with lookahead, when the
  11354. <samp>look_ahead</samp> option is also set.
  11355. </li><li>- <var>ICQ</var> &ndash; intelligent constant quality otherwise.
  11356. </li></ul>
  11357. </li><li> Otherwise, a bitrate-based mode is used. For all of those, you should specify at
  11358. least the desired average bitrate with the <samp>b</samp> option.
  11359. <ul class="no-bullet">
  11360. <li>- <var>LA</var> - VBR with lookahead, when the <samp>look_ahead</samp> option is specified.
  11361. </li><li>- <var>VCM</var> - video conferencing mode, when the <samp>vcm</samp> option is set.
  11362. </li><li>- <var>CBR</var> - constant bitrate, when <samp>maxrate</samp> is specified and equal to
  11363. the average bitrate.
  11364. </li><li>- <var>VBR</var> - variable bitrate, when <samp>maxrate</samp> is specified, but is higher
  11365. than the average bitrate.
  11366. </li><li>- <var>AVBR</var> - average VBR mode, when <samp>maxrate</samp> is not specified. This mode
  11367. is further configured by the <samp>avbr_accuracy</samp> and
  11368. <samp>avbr_convergence</samp> options.
  11369. </li></ul>
  11370. </li></ul>
  11371. <p>Note that depending on your system, a different mode than the one you specified
  11372. may be selected by the encoder. Set the verbosity level to <var>verbose</var> or
  11373. higher to see the actual settings used by the QSV runtime.
  11374. </p>
  11375. <p>Additional libavcodec global options are mapped to MSDK options as follows:
  11376. </p>
  11377. <ul>
  11378. <li> <samp>g/gop_size</samp> -&gt; <samp>GopPicSize</samp>
  11379. </li><li> <samp>bf/max_b_frames</samp>+1 -&gt; <samp>GopRefDist</samp>
  11380. </li><li> <samp>rc_init_occupancy/rc_initial_buffer_occupancy</samp> -&gt;
  11381. <samp>InitialDelayInKB</samp>
  11382. </li><li> <samp>slices</samp> -&gt; <samp>NumSlice</samp>
  11383. </li><li> <samp>refs</samp> -&gt; <samp>NumRefFrame</samp>
  11384. </li><li> <samp>b_strategy/b_frame_strategy</samp> -&gt; <samp>BRefType</samp>
  11385. </li><li> <samp>cgop/CLOSED_GOP</samp> codec flag -&gt; <samp>GopOptFlag</samp>
  11386. </li><li> For the <var>CQP</var> mode, the <samp>i_qfactor/i_qoffset</samp> and
  11387. <samp>b_qfactor/b_qoffset</samp> set the difference between <var>QPP</var> and <var>QPI</var>,
  11388. and <var>QPP</var> and <var>QPB</var> respectively.
  11389. </li><li> Setting the <samp>coder</samp> option to the value <var>vlc</var> will make the H.264
  11390. encoder use CAVLC instead of CABAC.
  11391. </li></ul>
  11392. <a name="snow"></a>
  11393. <h3 class="section">16.21 snow<span class="pull-right"><a class="anchor hidden-xs" href="#snow" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-snow" aria-hidden="true">TOC</a></span></h3>
  11394. <a name="Options-37"></a>
  11395. <h4 class="subsection">16.21.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-37" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-37" aria-hidden="true">TOC</a></span></h4>
  11396. <dl compact="compact">
  11397. <dt><samp>iterative_dia_size</samp></dt>
  11398. <dd><p>dia size for the iterative motion estimation
  11399. </p></dd>
  11400. </dl>
  11401. <a name="VAAPI-encoders"></a>
  11402. <h3 class="section">16.22 VAAPI encoders<span class="pull-right"><a class="anchor hidden-xs" href="#VAAPI-encoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VAAPI-encoders" aria-hidden="true">TOC</a></span></h3>
  11403. <p>Wrappers for hardware encoders accessible via VAAPI.
  11404. </p>
  11405. <p>These encoders only accept input in VAAPI hardware surfaces. If you have input
  11406. in software frames, use the <samp>hwupload</samp> filter to upload them to the GPU.
  11407. </p>
  11408. <p>The following standard libavcodec options are used:
  11409. </p><ul>
  11410. <li> <samp>g</samp> / <samp>gop_size</samp>
  11411. </li><li> <samp>bf</samp> / <samp>max_b_frames</samp>
  11412. </li><li> <samp>profile</samp>
  11413. <p>If not set, this will be determined automatically from the format of the input
  11414. frames and the profiles supported by the driver.
  11415. </p></li><li> <samp>level</samp>
  11416. </li><li> <samp>b</samp> / <samp>bit_rate</samp>
  11417. </li><li> <samp>maxrate</samp> / <samp>rc_max_rate</samp>
  11418. </li><li> <samp>bufsize</samp> / <samp>rc_buffer_size</samp>
  11419. </li><li> <samp>rc_init_occupancy</samp> / <samp>rc_initial_buffer_occupancy</samp>
  11420. </li><li> <samp>compression_level</samp>
  11421. <p>Speed / quality tradeoff: higher values are faster / worse quality.
  11422. </p></li><li> <samp>q</samp> / <samp>global_quality</samp>
  11423. <p>Size / quality tradeoff: higher values are smaller / worse quality.
  11424. </p></li><li> <samp>qmin</samp>
  11425. </li><li> <samp>qmax</samp>
  11426. </li><li> <samp>i_qfactor</samp> / <samp>i_quant_factor</samp>
  11427. </li><li> <samp>i_qoffset</samp> / <samp>i_quant_offset</samp>
  11428. </li><li> <samp>b_qfactor</samp> / <samp>b_quant_factor</samp>
  11429. </li><li> <samp>b_qoffset</samp> / <samp>b_quant_offset</samp>
  11430. </li><li> <samp>slices</samp>
  11431. </li></ul>
  11432. <p>All encoders support the following options:
  11433. </p><dl compact="compact">
  11434. <dt><samp>low_power</samp></dt>
  11435. <dd><p>Some drivers/platforms offer a second encoder for some codecs intended to use
  11436. less power than the default encoder; setting this option will attempt to use
  11437. that encoder. Note that it may support a reduced feature set, so some other
  11438. options may not be available in this mode.
  11439. </p>
  11440. </dd>
  11441. <dt><samp>idr_interval</samp></dt>
  11442. <dd><p>Set the number of normal intra frames between full-refresh (IDR) frames in
  11443. open-GOP mode. The intra frames are still IRAPs, but will not include global
  11444. headers and may have non-decodable leading pictures.
  11445. </p>
  11446. </dd>
  11447. <dt><samp>b_depth</samp></dt>
  11448. <dd><p>Set the B-frame reference depth. When set to one (the default), all B-frames
  11449. will refer only to P- or I-frames. When set to greater values multiple layers
  11450. of B-frames will be present, frames in each layer only referring to frames in
  11451. higher layers.
  11452. </p>
  11453. </dd>
  11454. <dt><samp>rc_mode</samp></dt>
  11455. <dd><p>Set the rate control mode to use. A given driver may only support a subset of
  11456. modes.
  11457. </p>
  11458. <p>Possible modes:
  11459. </p><dl compact="compact">
  11460. <dt><samp>auto</samp></dt>
  11461. <dd><p>Choose the mode automatically based on driver support and the other options.
  11462. This is the default.
  11463. </p></dd>
  11464. <dt><samp>CQP</samp></dt>
  11465. <dd><p>Constant-quality.
  11466. </p></dd>
  11467. <dt><samp>CBR</samp></dt>
  11468. <dd><p>Constant-bitrate.
  11469. </p></dd>
  11470. <dt><samp>VBR</samp></dt>
  11471. <dd><p>Variable-bitrate.
  11472. </p></dd>
  11473. <dt><samp>ICQ</samp></dt>
  11474. <dd><p>Intelligent constant-quality.
  11475. </p></dd>
  11476. <dt><samp>QVBR</samp></dt>
  11477. <dd><p>Quality-defined variable-bitrate.
  11478. </p></dd>
  11479. <dt><samp>AVBR</samp></dt>
  11480. <dd><p>Average variable bitrate.
  11481. </p></dd>
  11482. </dl>
  11483. </dd>
  11484. </dl>
  11485. <p>Each encoder also has its own specific options:
  11486. </p><dl compact="compact">
  11487. <dt><samp>h264_vaapi</samp></dt>
  11488. <dd><p><samp>profile</samp> sets the value of <em>profile_idc</em> and the <em>constraint_set*_flag</em>s.
  11489. <samp>level</samp> sets the value of <em>level_idc</em>.
  11490. </p>
  11491. <dl compact="compact">
  11492. <dt><samp>coder</samp></dt>
  11493. <dd><p>Set entropy encoder (default is <em>cabac</em>). Possible values:
  11494. </p>
  11495. <dl compact="compact">
  11496. <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
  11497. <dt>&lsquo;<samp>cabac</samp>&rsquo;</dt>
  11498. <dd><p>Use CABAC.
  11499. </p>
  11500. </dd>
  11501. <dt>&lsquo;<samp>vlc</samp>&rsquo;</dt>
  11502. <dt>&lsquo;<samp>cavlc</samp>&rsquo;</dt>
  11503. <dd><p>Use CAVLC.
  11504. </p></dd>
  11505. </dl>
  11506. </dd>
  11507. <dt><samp>aud</samp></dt>
  11508. <dd><p>Include access unit delimiters in the stream (not included by default).
  11509. </p>
  11510. </dd>
  11511. <dt><samp>sei</samp></dt>
  11512. <dd><p>Set SEI message types to include.
  11513. Some combination of the following values:
  11514. </p><dl compact="compact">
  11515. <dt>&lsquo;<samp>identifier</samp>&rsquo;</dt>
  11516. <dd><p>Include a <em>user_data_unregistered</em> message containing information about
  11517. the encoder.
  11518. </p></dd>
  11519. <dt>&lsquo;<samp>timing</samp>&rsquo;</dt>
  11520. <dd><p>Include picture timing parameters (<em>buffering_period</em> and
  11521. <em>pic_timing</em> messages).
  11522. </p></dd>
  11523. <dt>&lsquo;<samp>recovery_point</samp>&rsquo;</dt>
  11524. <dd><p>Include recovery points where appropriate (<em>recovery_point</em> messages).
  11525. </p></dd>
  11526. </dl>
  11527. </dd>
  11528. </dl>
  11529. </dd>
  11530. <dt><samp>hevc_vaapi</samp></dt>
  11531. <dd><p><samp>profile</samp> and <samp>level</samp> set the values of
  11532. <em>general_profile_idc</em> and <em>general_level_idc</em> respectively.
  11533. </p>
  11534. <dl compact="compact">
  11535. <dt><samp>aud</samp></dt>
  11536. <dd><p>Include access unit delimiters in the stream (not included by default).
  11537. </p>
  11538. </dd>
  11539. <dt><samp>tier</samp></dt>
  11540. <dd><p>Set <em>general_tier_flag</em>. This may affect the level chosen for the stream
  11541. if it is not explicitly specified.
  11542. </p>
  11543. </dd>
  11544. <dt><samp>sei</samp></dt>
  11545. <dd><p>Set SEI message types to include.
  11546. Some combination of the following values:
  11547. </p><dl compact="compact">
  11548. <dt>&lsquo;<samp>hdr</samp>&rsquo;</dt>
  11549. <dd><p>Include HDR metadata if the input frames have it
  11550. (<em>mastering_display_colour_volume</em> and <em>content_light_level</em>
  11551. messages).
  11552. </p></dd>
  11553. </dl>
  11554. </dd>
  11555. <dt><samp>tiles</samp></dt>
  11556. <dd><p>Set the number of tiles to encode the input video with, as columns x rows.
  11557. Larger numbers allow greater parallelism in both encoding and decoding, but
  11558. may decrease coding efficiency.
  11559. </p>
  11560. </dd>
  11561. </dl>
  11562. </dd>
  11563. <dt><samp>mjpeg_vaapi</samp></dt>
  11564. <dd><p>Only baseline DCT encoding is supported. The encoder always uses the standard
  11565. quantisation and huffman tables - <samp>global_quality</samp> scales the standard
  11566. quantisation table (range 1-100).
  11567. </p>
  11568. <p>For YUV, 4:2:0, 4:2:2 and 4:4:4 subsampling modes are supported. RGB is also
  11569. supported, and will create an RGB JPEG.
  11570. </p>
  11571. <dl compact="compact">
  11572. <dt><samp>jfif</samp></dt>
  11573. <dd><p>Include JFIF header in each frame (not included by default).
  11574. </p></dd>
  11575. <dt><samp>huffman</samp></dt>
  11576. <dd><p>Include standard huffman tables (on by default). Turning this off will save
  11577. a few hundred bytes in each output frame, but may lose compatibility with some
  11578. JPEG decoders which don&rsquo;t fully handle MJPEG.
  11579. </p></dd>
  11580. </dl>
  11581. </dd>
  11582. <dt><samp>mpeg2_vaapi</samp></dt>
  11583. <dd><p><samp>profile</samp> and <samp>level</samp> set the value of <em>profile_and_level_indication</em>.
  11584. </p>
  11585. </dd>
  11586. <dt><samp>vp8_vaapi</samp></dt>
  11587. <dd><p>B-frames are not supported.
  11588. </p>
  11589. <p><samp>global_quality</samp> sets the <em>q_idx</em> used for non-key frames (range 0-127).
  11590. </p>
  11591. <dl compact="compact">
  11592. <dt><samp>loop_filter_level</samp></dt>
  11593. <dt><samp>loop_filter_sharpness</samp></dt>
  11594. <dd><p>Manually set the loop filter parameters.
  11595. </p></dd>
  11596. </dl>
  11597. </dd>
  11598. <dt><samp>vp9_vaapi</samp></dt>
  11599. <dd><p><samp>global_quality</samp> sets the <em>q_idx</em> used for P-frames (range 0-255).
  11600. </p>
  11601. <dl compact="compact">
  11602. <dt><samp>loop_filter_level</samp></dt>
  11603. <dt><samp>loop_filter_sharpness</samp></dt>
  11604. <dd><p>Manually set the loop filter parameters.
  11605. </p></dd>
  11606. </dl>
  11607. <p>B-frames are supported, but the output stream is always in encode order rather than display
  11608. order. If B-frames are enabled, it may be necessary to use the <samp>vp9_raw_reorder</samp>
  11609. bitstream filter to modify the output stream to display frames in the correct order.
  11610. </p>
  11611. <p>Only normal frames are produced - the <samp>vp9_superframe</samp> bitstream filter may be
  11612. required to produce a stream usable with all decoders.
  11613. </p>
  11614. </dd>
  11615. </dl>
  11616. <a name="vc2"></a>
  11617. <h3 class="section">16.23 vc2<span class="pull-right"><a class="anchor hidden-xs" href="#vc2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vc2" aria-hidden="true">TOC</a></span></h3>
  11618. <p>SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at
  11619. professional broadcasting but since it supports yuv420, yuv422 and yuv444 at
  11620. 8 (limited range or full range), 10 or 12 bits, this makes it suitable for
  11621. other tasks which require low overhead and low compression (like screen
  11622. recording).
  11623. </p>
  11624. <a name="Options-38"></a>
  11625. <h4 class="subsection">16.23.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-38" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-38" aria-hidden="true">TOC</a></span></h4>
  11626. <dl compact="compact">
  11627. <dt><samp>b</samp></dt>
  11628. <dd><p>Sets target video bitrate. Usually that&rsquo;s around 1:6 of the uncompressed
  11629. video bitrate (e.g. for 1920x1080 50fps yuv422p10 that&rsquo;s around 400Mbps). Higher
  11630. values (close to the uncompressed bitrate) turn on lossless compression mode.
  11631. </p>
  11632. </dd>
  11633. <dt><samp>field_order</samp></dt>
  11634. <dd><p>Enables field coding when set (e.g. to tt - top field first) for interlaced
  11635. inputs. Should increase compression with interlaced content as it splits the
  11636. fields and encodes each separately.
  11637. </p>
  11638. </dd>
  11639. <dt><samp>wavelet_depth</samp></dt>
  11640. <dd><p>Sets the total amount of wavelet transforms to apply, between 1 and 5 (default).
  11641. Lower values reduce compression and quality. Less capable decoders may not be
  11642. able to handle values of <samp>wavelet_depth</samp> over 3.
  11643. </p>
  11644. </dd>
  11645. <dt><samp>wavelet_type</samp></dt>
  11646. <dd><p>Sets the transform type. Currently only <var>5_3</var> (LeGall) and <var>9_7</var>
  11647. (Deslauriers-Dubuc)
  11648. are implemented, with 9_7 being the one with better compression and thus
  11649. is the default.
  11650. </p>
  11651. </dd>
  11652. <dt><samp>slice_width</samp></dt>
  11653. <dt><samp>slice_height</samp></dt>
  11654. <dd><p>Sets the slice size for each slice. Larger values result in better compression.
  11655. For compatibility with other more limited decoders use <samp>slice_width</samp> of
  11656. 32 and <samp>slice_height</samp> of 8.
  11657. </p>
  11658. </dd>
  11659. <dt><samp>tolerance</samp></dt>
  11660. <dd><p>Sets the undershoot tolerance of the rate control system in percent. This is
  11661. to prevent an expensive search from being run.
  11662. </p>
  11663. </dd>
  11664. <dt><samp>qm</samp></dt>
  11665. <dd><p>Sets the quantization matrix preset to use by default or when <samp>wavelet_depth</samp>
  11666. is set to 5
  11667. </p><ul class="no-bullet">
  11668. <li>- <var>default</var>
  11669. Uses the default quantization matrix from the specifications, extended with
  11670. values for the fifth level. This provides a good balance between keeping detail
  11671. and omitting artifacts.
  11672. </li><li>- <var>flat</var>
  11673. Use a completely zeroed out quantization matrix. This increases PSNR but might
  11674. reduce perception. Use in bogus benchmarks.
  11675. </li><li>- <var>color</var>
  11676. Reduces detail but attempts to preserve color at extremely low bitrates.
  11677. </li></ul>
  11678. </dd>
  11679. </dl>
  11680. <a name="Subtitles-Encoders"></a>
  11681. <h2 class="chapter">17 Subtitles Encoders<span class="pull-right"><a class="anchor hidden-xs" href="#Subtitles-Encoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Subtitles-Encoders" aria-hidden="true">TOC</a></span></h2>
  11682. <a name="dvdsub-1"></a>
  11683. <h3 class="section">17.1 dvdsub<span class="pull-right"><a class="anchor hidden-xs" href="#dvdsub-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dvdsub-1" aria-hidden="true">TOC</a></span></h3>
  11684. <p>This codec encodes the bitmap subtitle format that is used in DVDs.
  11685. Typically they are stored in VOBSUB file pairs (*.idx + *.sub),
  11686. and they can also be used in Matroska files.
  11687. </p>
  11688. <a name="Options-39"></a>
  11689. <h4 class="subsection">17.1.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-39" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-39" aria-hidden="true">TOC</a></span></h4>
  11690. <dl compact="compact">
  11691. <dt><samp>palette</samp></dt>
  11692. <dd><p>Specify the global palette used by the bitmaps.
  11693. </p>
  11694. <p>The format for this option is a string containing 16 24-bits hexadecimal
  11695. numbers (without 0x prefix) separated by commas, for example <code>0d00ee,
  11696. ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
  11697. 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
  11698. </p>
  11699. </dd>
  11700. <dt><samp>even_rows_fix</samp></dt>
  11701. <dd><p>When set to 1, enable a work-around that makes the number of pixel rows
  11702. even in all subtitles. This fixes a problem with some players that
  11703. cut off the bottom row if the number is odd. The work-around just adds
  11704. a fully transparent row if needed. The overhead is low, typically
  11705. one byte per subtitle on average.
  11706. </p>
  11707. <p>By default, this work-around is disabled.
  11708. </p></dd>
  11709. </dl>
  11710. <a name="Bitstream-Filters"></a>
  11711. <h2 class="chapter">18 Bitstream Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Bitstream-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Bitstream-Filters" aria-hidden="true">TOC</a></span></h2>
  11712. <p>When you configure your FFmpeg build, all the supported bitstream
  11713. filters are enabled by default. You can list all available ones using
  11714. the configure option <code>--list-bsfs</code>.
  11715. </p>
  11716. <p>You can disable all the bitstream filters using the configure option
  11717. <code>--disable-bsfs</code>, and selectively enable any bitstream filter using
  11718. the option <code>--enable-bsf=BSF</code>, or you can disable a particular
  11719. bitstream filter using the option <code>--disable-bsf=BSF</code>.
  11720. </p>
  11721. <p>The option <code>-bsfs</code> of the ff* tools will display the list of
  11722. all the supported bitstream filters included in your build.
  11723. </p>
  11724. <p>The ff* tools have a -bsf option applied per stream, taking a
  11725. comma-separated list of filters, whose parameters follow the filter
  11726. name after a &rsquo;=&rsquo;.
  11727. </p>
  11728. <div class="example">
  11729. <pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
  11730. </pre></div>
  11731. <p>Below is a description of the currently available bitstream filters,
  11732. with their parameters, if any.
  11733. </p>
  11734. <a name="aac_005fadtstoasc"></a>
  11735. <h3 class="section">18.1 aac_adtstoasc<span class="pull-right"><a class="anchor hidden-xs" href="#aac_005fadtstoasc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aac_005fadtstoasc" aria-hidden="true">TOC</a></span></h3>
  11736. <p>Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration
  11737. bitstream.
  11738. </p>
  11739. <p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
  11740. ADTS header and removes the ADTS header.
  11741. </p>
  11742. <p>This filter is required for example when copying an AAC stream from a
  11743. raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or
  11744. to MOV/MP4 files and related formats such as 3GP or M4A. Please note
  11745. that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats.
  11746. </p>
  11747. <a name="av1_005fmetadata"></a>
  11748. <h3 class="section">18.2 av1_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#av1_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-av1_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  11749. <p>Modify metadata embedded in an AV1 stream.
  11750. </p>
  11751. <dl compact="compact">
  11752. <dt><samp>td</samp></dt>
  11753. <dd><p>Insert or remove temporal delimiter OBUs in all temporal units of the
  11754. stream.
  11755. </p>
  11756. <dl compact="compact">
  11757. <dt>&lsquo;<samp>insert</samp>&rsquo;</dt>
  11758. <dd><p>Insert a TD at the beginning of every TU which does not already have one.
  11759. </p></dd>
  11760. <dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
  11761. <dd><p>Remove the TD from the beginning of every TU which has one.
  11762. </p></dd>
  11763. </dl>
  11764. </dd>
  11765. <dt><samp>color_primaries</samp></dt>
  11766. <dt><samp>transfer_characteristics</samp></dt>
  11767. <dt><samp>matrix_coefficients</samp></dt>
  11768. <dd><p>Set the color description fields in the stream (see AV1 section 6.4.2).
  11769. </p>
  11770. </dd>
  11771. <dt><samp>color_range</samp></dt>
  11772. <dd><p>Set the color range in the stream (see AV1 section 6.4.2; note that
  11773. this cannot be set for streams using BT.709 primaries, sRGB transfer
  11774. characteristic and identity (RGB) matrix coefficients).
  11775. </p><dl compact="compact">
  11776. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  11777. <dd><p>Limited range.
  11778. </p></dd>
  11779. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  11780. <dd><p>Full range.
  11781. </p></dd>
  11782. </dl>
  11783. </dd>
  11784. <dt><samp>chroma_sample_position</samp></dt>
  11785. <dd><p>Set the chroma sample location in the stream (see AV1 section 6.4.2).
  11786. This can only be set for 4:2:0 streams.
  11787. </p>
  11788. <dl compact="compact">
  11789. <dt>&lsquo;<samp>vertical</samp>&rsquo;</dt>
  11790. <dd><p>Left position (matching the default in MPEG-2 and H.264).
  11791. </p></dd>
  11792. <dt>&lsquo;<samp>colocated</samp>&rsquo;</dt>
  11793. <dd><p>Top-left position.
  11794. </p></dd>
  11795. </dl>
  11796. </dd>
  11797. <dt><samp>tick_rate</samp></dt>
  11798. <dd><p>Set the tick rate (<em>num_units_in_display_tick / time_scale</em>) in
  11799. the timing info in the sequence header.
  11800. </p></dd>
  11801. <dt><samp>num_ticks_per_picture</samp></dt>
  11802. <dd><p>Set the number of ticks in each picture, to indicate that the stream
  11803. has a fixed framerate. Ignored if <samp>tick_rate</samp> is not also set.
  11804. </p>
  11805. </dd>
  11806. <dt><samp>delete_padding</samp></dt>
  11807. <dd><p>Deletes Padding OBUs.
  11808. </p>
  11809. </dd>
  11810. </dl>
  11811. <a name="chomp"></a>
  11812. <h3 class="section">18.3 chomp<span class="pull-right"><a class="anchor hidden-xs" href="#chomp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chomp" aria-hidden="true">TOC</a></span></h3>
  11813. <p>Remove zero padding at the end of a packet.
  11814. </p>
  11815. <a name="dca_005fcore"></a>
  11816. <h3 class="section">18.4 dca_core<span class="pull-right"><a class="anchor hidden-xs" href="#dca_005fcore" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dca_005fcore" aria-hidden="true">TOC</a></span></h3>
  11817. <p>Extract the core from a DCA/DTS stream, dropping extensions such as
  11818. DTS-HD.
  11819. </p>
  11820. <a name="dump_005fextra"></a>
  11821. <h3 class="section">18.5 dump_extra<span class="pull-right"><a class="anchor hidden-xs" href="#dump_005fextra" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dump_005fextra" aria-hidden="true">TOC</a></span></h3>
  11822. <p>Add extradata to the beginning of the filtered packets except when
  11823. said packets already exactly begin with the extradata that is intended
  11824. to be added.
  11825. </p>
  11826. <dl compact="compact">
  11827. <dt><samp>freq</samp></dt>
  11828. <dd><p>The additional argument specifies which packets should be filtered.
  11829. It accepts the values:
  11830. </p><dl compact="compact">
  11831. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  11832. <dt>&lsquo;<samp>keyframe</samp>&rsquo;</dt>
  11833. <dd><p>add extradata to all key packets
  11834. </p>
  11835. </dd>
  11836. <dt>&lsquo;<samp>e</samp>&rsquo;</dt>
  11837. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  11838. <dd><p>add extradata to all packets
  11839. </p></dd>
  11840. </dl>
  11841. </dd>
  11842. </dl>
  11843. <p>If not specified it is assumed &lsquo;<samp>k</samp>&rsquo;.
  11844. </p>
  11845. <p>For example the following <code>ffmpeg</code> command forces a global
  11846. header (thus disabling individual packet headers) in the H.264 packets
  11847. generated by the <code>libx264</code> encoder, but corrects them by adding
  11848. the header stored in extradata to the key packets:
  11849. </p><div class="example">
  11850. <pre class="example">ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
  11851. </pre></div>
  11852. <a name="eac3_005fcore"></a>
  11853. <h3 class="section">18.6 eac3_core<span class="pull-right"><a class="anchor hidden-xs" href="#eac3_005fcore" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eac3_005fcore" aria-hidden="true">TOC</a></span></h3>
  11854. <p>Extract the core from a E-AC-3 stream, dropping extra channels.
  11855. </p>
  11856. <a name="extract_005fextradata"></a>
  11857. <h3 class="section">18.7 extract_extradata<span class="pull-right"><a class="anchor hidden-xs" href="#extract_005fextradata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-extract_005fextradata" aria-hidden="true">TOC</a></span></h3>
  11858. <p>Extract the in-band extradata.
  11859. </p>
  11860. <p>Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers,
  11861. or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either &quot;in-band&quot; (i.e. as a part
  11862. of the bitstream containing the coded frames) or &quot;out of band&quot; (e.g. on the
  11863. container level). This latter form is called &quot;extradata&quot; in FFmpeg terminology.
  11864. </p>
  11865. <p>This bitstream filter detects the in-band headers and makes them available as
  11866. extradata.
  11867. </p>
  11868. <dl compact="compact">
  11869. <dt><samp>remove</samp></dt>
  11870. <dd><p>When this option is enabled, the long-term headers are removed from the
  11871. bitstream after extraction.
  11872. </p></dd>
  11873. </dl>
  11874. <a name="filter_005funits"></a>
  11875. <h3 class="section">18.8 filter_units<span class="pull-right"><a class="anchor hidden-xs" href="#filter_005funits" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-filter_005funits" aria-hidden="true">TOC</a></span></h3>
  11876. <p>Remove units with types in or not in a given set from the stream.
  11877. </p>
  11878. <dl compact="compact">
  11879. <dt><samp>pass_types</samp></dt>
  11880. <dd><p>List of unit types or ranges of unit types to pass through while removing
  11881. all others. This is specified as a &rsquo;|&rsquo;-separated list of unit type values
  11882. or ranges of values with &rsquo;-&rsquo;.
  11883. </p>
  11884. </dd>
  11885. <dt><samp>remove_types</samp></dt>
  11886. <dd><p>Identical to <samp>pass_types</samp>, except the units in the given set
  11887. removed and all others passed through.
  11888. </p></dd>
  11889. </dl>
  11890. <p>Extradata is unchanged by this transformation, but note that if the stream
  11891. contains inline parameter sets then the output may be unusable if they are
  11892. removed.
  11893. </p>
  11894. <p>For example, to remove all non-VCL NAL units from an H.264 stream:
  11895. </p><div class="example">
  11896. <pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
  11897. </pre></div>
  11898. <p>To remove all AUDs, SEI and filler from an H.265 stream:
  11899. </p><div class="example">
  11900. <pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
  11901. </pre></div>
  11902. <a name="hapqa_005fextract"></a>
  11903. <h3 class="section">18.9 hapqa_extract<span class="pull-right"><a class="anchor hidden-xs" href="#hapqa_005fextract" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hapqa_005fextract" aria-hidden="true">TOC</a></span></h3>
  11904. <p>Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file.
  11905. </p>
  11906. <dl compact="compact">
  11907. <dt><samp>texture</samp></dt>
  11908. <dd><p>Specifies the texture to keep.
  11909. </p>
  11910. <dl compact="compact">
  11911. <dt><samp>color</samp></dt>
  11912. <dt><samp>alpha</samp></dt>
  11913. </dl>
  11914. </dd>
  11915. </dl>
  11916. <p>Convert HAPQA to HAPQ
  11917. </p><div class="example">
  11918. <pre class="example">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
  11919. </pre></div>
  11920. <p>Convert HAPQA to HAPAlphaOnly
  11921. </p><div class="example">
  11922. <pre class="example">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
  11923. </pre></div>
  11924. <a name="h264_005fmetadata"></a>
  11925. <h3 class="section">18.10 h264_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#h264_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h264_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  11926. <p>Modify metadata embedded in an H.264 stream.
  11927. </p>
  11928. <dl compact="compact">
  11929. <dt><samp>aud</samp></dt>
  11930. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  11931. </p>
  11932. <dl compact="compact">
  11933. <dt>&lsquo;<samp>insert</samp>&rsquo;</dt>
  11934. <dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
  11935. </dl>
  11936. </dd>
  11937. <dt><samp>sample_aspect_ratio</samp></dt>
  11938. <dd><p>Set the sample aspect ratio of the stream in the VUI parameters.
  11939. </p>
  11940. </dd>
  11941. <dt><samp>overscan_appropriate_flag</samp></dt>
  11942. <dd><p>Set whether the stream is suitable for display using overscan
  11943. or not (see H.264 section E.2.1).
  11944. </p>
  11945. </dd>
  11946. <dt><samp>video_format</samp></dt>
  11947. <dt><samp>video_full_range_flag</samp></dt>
  11948. <dd><p>Set the video format in the stream (see H.264 section E.2.1 and
  11949. table E-2).
  11950. </p>
  11951. </dd>
  11952. <dt><samp>colour_primaries</samp></dt>
  11953. <dt><samp>transfer_characteristics</samp></dt>
  11954. <dt><samp>matrix_coefficients</samp></dt>
  11955. <dd><p>Set the colour description in the stream (see H.264 section E.2.1
  11956. and tables E-3, E-4 and E-5).
  11957. </p>
  11958. </dd>
  11959. <dt><samp>chroma_sample_loc_type</samp></dt>
  11960. <dd><p>Set the chroma sample location in the stream (see H.264 section
  11961. E.2.1 and figure E-1).
  11962. </p>
  11963. </dd>
  11964. <dt><samp>tick_rate</samp></dt>
  11965. <dd><p>Set the tick rate (num_units_in_tick / time_scale) in the VUI
  11966. parameters. This is the smallest time unit representable in the
  11967. stream, and in many cases represents the field rate of the stream
  11968. (double the frame rate).
  11969. </p></dd>
  11970. <dt><samp>fixed_frame_rate_flag</samp></dt>
  11971. <dd><p>Set whether the stream has fixed framerate - typically this indicates
  11972. that the framerate is exactly half the tick rate, but the exact
  11973. meaning is dependent on interlacing and the picture structure (see
  11974. H.264 section E.2.1 and table E-6).
  11975. </p>
  11976. </dd>
  11977. <dt><samp>crop_left</samp></dt>
  11978. <dt><samp>crop_right</samp></dt>
  11979. <dt><samp>crop_top</samp></dt>
  11980. <dt><samp>crop_bottom</samp></dt>
  11981. <dd><p>Set the frame cropping offsets in the SPS. These values will replace
  11982. the current ones if the stream is already cropped.
  11983. </p>
  11984. <p>These fields are set in pixels. Note that some sizes may not be
  11985. representable if the chroma is subsampled or the stream is interlaced
  11986. (see H.264 section 7.4.2.1.1).
  11987. </p>
  11988. </dd>
  11989. <dt><samp>sei_user_data</samp></dt>
  11990. <dd><p>Insert a string as SEI unregistered user data. The argument must
  11991. be of the form <em>UUID+string</em>, where the UUID is as hex digits
  11992. possibly separated by hyphens, and the string can be anything.
  11993. </p>
  11994. <p>For example, &lsquo;<samp>086f3693-b7b3-4f2c-9653-21492feee5b8+hello</samp>&rsquo; will
  11995. insert the string &ldquo;hello&rdquo; associated with the given UUID.
  11996. </p>
  11997. </dd>
  11998. <dt><samp>delete_filler</samp></dt>
  11999. <dd><p>Deletes both filler NAL units and filler SEI messages.
  12000. </p>
  12001. </dd>
  12002. <dt><samp>level</samp></dt>
  12003. <dd><p>Set the level in the SPS. Refer to H.264 section A.3 and tables A-1
  12004. to A-5.
  12005. </p>
  12006. <p>The argument must be the name of a level (for example, &lsquo;<samp>4.2</samp>&rsquo;), a
  12007. level_idc value (for example, &lsquo;<samp>42</samp>&rsquo;), or the special name &lsquo;<samp>auto</samp>&rsquo;
  12008. indicating that the filter should attempt to guess the level from the
  12009. input stream properties.
  12010. </p>
  12011. </dd>
  12012. </dl>
  12013. <a name="h264_005fmp4toannexb"></a>
  12014. <h3 class="section">18.11 h264_mp4toannexb<span class="pull-right"><a class="anchor hidden-xs" href="#h264_005fmp4toannexb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h264_005fmp4toannexb" aria-hidden="true">TOC</a></span></h3>
  12015. <p>Convert an H.264 bitstream from length prefixed mode to start code
  12016. prefixed mode (as defined in the Annex B of the ITU-T H.264
  12017. specification).
  12018. </p>
  12019. <p>This is required by some streaming formats, typically the MPEG-2
  12020. transport stream format (muxer <code>mpegts</code>).
  12021. </p>
  12022. <p>For example to remux an MP4 file containing an H.264 stream to mpegts
  12023. format with <code>ffmpeg</code>, you can use the command:
  12024. </p>
  12025. <div class="example">
  12026. <pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
  12027. </pre></div>
  12028. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  12029. <code>mpegts</code>) and raw H.264 (muxer <code>h264</code>) output formats.
  12030. </p>
  12031. <a name="h264_005fredundant_005fpps"></a>
  12032. <h3 class="section">18.12 h264_redundant_pps<span class="pull-right"><a class="anchor hidden-xs" href="#h264_005fredundant_005fpps" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h264_005fredundant_005fpps" aria-hidden="true">TOC</a></span></h3>
  12033. <p>This applies a specific fixup to some Blu-ray streams which contain
  12034. redundant PPSs modifying irrelevant parameters of the stream which
  12035. confuse other transformations which require correct extradata.
  12036. </p>
  12037. <p>A new single global PPS is created, and all of the redundant PPSs
  12038. within the stream are removed.
  12039. </p>
  12040. <a name="hevc_005fmetadata"></a>
  12041. <h3 class="section">18.13 hevc_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#hevc_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hevc_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  12042. <p>Modify metadata embedded in an HEVC stream.
  12043. </p>
  12044. <dl compact="compact">
  12045. <dt><samp>aud</samp></dt>
  12046. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  12047. </p>
  12048. <dl compact="compact">
  12049. <dt>&lsquo;<samp>insert</samp>&rsquo;</dt>
  12050. <dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
  12051. </dl>
  12052. </dd>
  12053. <dt><samp>sample_aspect_ratio</samp></dt>
  12054. <dd><p>Set the sample aspect ratio in the stream in the VUI parameters.
  12055. </p>
  12056. </dd>
  12057. <dt><samp>video_format</samp></dt>
  12058. <dt><samp>video_full_range_flag</samp></dt>
  12059. <dd><p>Set the video format in the stream (see H.265 section E.3.1 and
  12060. table E.2).
  12061. </p>
  12062. </dd>
  12063. <dt><samp>colour_primaries</samp></dt>
  12064. <dt><samp>transfer_characteristics</samp></dt>
  12065. <dt><samp>matrix_coefficients</samp></dt>
  12066. <dd><p>Set the colour description in the stream (see H.265 section E.3.1
  12067. and tables E.3, E.4 and E.5).
  12068. </p>
  12069. </dd>
  12070. <dt><samp>chroma_sample_loc_type</samp></dt>
  12071. <dd><p>Set the chroma sample location in the stream (see H.265 section
  12072. E.3.1 and figure E.1).
  12073. </p>
  12074. </dd>
  12075. <dt><samp>tick_rate</samp></dt>
  12076. <dd><p>Set the tick rate in the VPS and VUI parameters (num_units_in_tick /
  12077. time_scale). Combined with <samp>num_ticks_poc_diff_one</samp>, this can
  12078. set a constant framerate in the stream. Note that it is likely to be
  12079. overridden by container parameters when the stream is in a container.
  12080. </p>
  12081. </dd>
  12082. <dt><samp>num_ticks_poc_diff_one</samp></dt>
  12083. <dd><p>Set poc_proportional_to_timing_flag in VPS and VUI and use this value
  12084. to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and
  12085. E.3.1). Ignored if <samp>tick_rate</samp> is not also set.
  12086. </p>
  12087. </dd>
  12088. <dt><samp>crop_left</samp></dt>
  12089. <dt><samp>crop_right</samp></dt>
  12090. <dt><samp>crop_top</samp></dt>
  12091. <dt><samp>crop_bottom</samp></dt>
  12092. <dd><p>Set the conformance window cropping offsets in the SPS. These values
  12093. will replace the current ones if the stream is already cropped.
  12094. </p>
  12095. <p>These fields are set in pixels. Note that some sizes may not be
  12096. representable if the chroma is subsampled (H.265 section 7.4.3.2.1).
  12097. </p>
  12098. </dd>
  12099. <dt><samp>level</samp></dt>
  12100. <dd><p>Set the level in the VPS and SPS. See H.265 section A.4 and tables
  12101. A.6 and A.7.
  12102. </p>
  12103. <p>The argument must be the name of a level (for example, &lsquo;<samp>5.1</samp>&rsquo;), a
  12104. <em>general_level_idc</em> value (for example, &lsquo;<samp>153</samp>&rsquo; for level 5.1),
  12105. or the special name &lsquo;<samp>auto</samp>&rsquo; indicating that the filter should
  12106. attempt to guess the level from the input stream properties.
  12107. </p>
  12108. </dd>
  12109. </dl>
  12110. <a name="hevc_005fmp4toannexb"></a>
  12111. <h3 class="section">18.14 hevc_mp4toannexb<span class="pull-right"><a class="anchor hidden-xs" href="#hevc_005fmp4toannexb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hevc_005fmp4toannexb" aria-hidden="true">TOC</a></span></h3>
  12112. <p>Convert an HEVC/H.265 bitstream from length prefixed mode to start code
  12113. prefixed mode (as defined in the Annex B of the ITU-T H.265
  12114. specification).
  12115. </p>
  12116. <p>This is required by some streaming formats, typically the MPEG-2
  12117. transport stream format (muxer <code>mpegts</code>).
  12118. </p>
  12119. <p>For example to remux an MP4 file containing an HEVC stream to mpegts
  12120. format with <code>ffmpeg</code>, you can use the command:
  12121. </p>
  12122. <div class="example">
  12123. <pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
  12124. </pre></div>
  12125. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  12126. <code>mpegts</code>) and raw HEVC/H.265 (muxer <code>h265</code> or
  12127. <code>hevc</code>) output formats.
  12128. </p>
  12129. <a name="imxdump"></a>
  12130. <h3 class="section">18.15 imxdump<span class="pull-right"><a class="anchor hidden-xs" href="#imxdump" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-imxdump" aria-hidden="true">TOC</a></span></h3>
  12131. <p>Modifies the bitstream to fit in MOV and to be usable by the Final Cut
  12132. Pro decoder. This filter only applies to the mpeg2video codec, and is
  12133. likely not needed for Final Cut Pro 7 and newer with the appropriate
  12134. <samp>-tag:v</samp>.
  12135. </p>
  12136. <p>For example, to remux 30 MB/sec NTSC IMX to MOV:
  12137. </p>
  12138. <div class="example">
  12139. <pre class="example">ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
  12140. </pre></div>
  12141. <a name="mjpeg2jpeg"></a>
  12142. <h3 class="section">18.16 mjpeg2jpeg<span class="pull-right"><a class="anchor hidden-xs" href="#mjpeg2jpeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mjpeg2jpeg" aria-hidden="true">TOC</a></span></h3>
  12143. <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
  12144. </p>
  12145. <p>MJPEG is a video codec wherein each video frame is essentially a
  12146. JPEG image. The individual frames can be extracted without loss,
  12147. e.g. by
  12148. </p>
  12149. <div class="example">
  12150. <pre class="example">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
  12151. </pre></div>
  12152. <p>Unfortunately, these chunks are incomplete JPEG images, because
  12153. they lack the DHT segment required for decoding. Quoting from
  12154. <a href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
  12155. </p>
  12156. <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
  12157. commented that &quot;MJPEG, or at least the MJPEG in AVIs having the
  12158. MJPG fourcc, is restricted JPEG with a fixed &ndash; and *omitted* &ndash;
  12159. Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
  12160. and it must use basic Huffman encoding, not arithmetic or
  12161. progressive. . . . You can indeed extract the MJPEG frames and
  12162. decode them with a regular JPEG decoder, but you have to prepend
  12163. the DHT segment to them, or else the decoder won&rsquo;t have any idea
  12164. how to decompress the data. The exact table necessary is given in
  12165. the OpenDML spec.&quot;
  12166. </p>
  12167. <p>This bitstream filter patches the header of frames extracted from an MJPEG
  12168. stream (carrying the AVI1 header ID and lacking a DHT segment) to
  12169. produce fully qualified JPEG images.
  12170. </p>
  12171. <div class="example">
  12172. <pre class="example">ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
  12173. exiftran -i -9 frame*.jpg
  12174. ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
  12175. </pre></div>
  12176. <a name="mjpegadump"></a>
  12177. <h3 class="section">18.17 mjpegadump<span class="pull-right"><a class="anchor hidden-xs" href="#mjpegadump" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mjpegadump" aria-hidden="true">TOC</a></span></h3>
  12178. <p>Add an MJPEG A header to the bitstream, to enable decoding by
  12179. Quicktime.
  12180. </p>
  12181. <span id="mov2textsub"></span><a name="mov2textsub-1"></a>
  12182. <h3 class="section">18.18 mov2textsub<span class="pull-right"><a class="anchor hidden-xs" href="#mov2textsub-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mov2textsub-1" aria-hidden="true">TOC</a></span></h3>
  12183. <p>Extract a representable text file from MOV subtitles, stripping the
  12184. metadata header from each subtitle packet.
  12185. </p>
  12186. <p>See also the <a href="#text2movsub">text2movsub</a> filter.
  12187. </p>
  12188. <a name="mp3decomp"></a>
  12189. <h3 class="section">18.19 mp3decomp<span class="pull-right"><a class="anchor hidden-xs" href="#mp3decomp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mp3decomp" aria-hidden="true">TOC</a></span></h3>
  12190. <p>Decompress non-standard compressed MP3 audio headers.
  12191. </p>
  12192. <a name="mpeg2_005fmetadata"></a>
  12193. <h3 class="section">18.20 mpeg2_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#mpeg2_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpeg2_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  12194. <p>Modify metadata embedded in an MPEG-2 stream.
  12195. </p>
  12196. <dl compact="compact">
  12197. <dt><samp>display_aspect_ratio</samp></dt>
  12198. <dd><p>Set the display aspect ratio in the stream.
  12199. </p>
  12200. <p>The following fixed values are supported:
  12201. </p><dl compact="compact">
  12202. <dt><samp>4/3</samp></dt>
  12203. <dt><samp>16/9</samp></dt>
  12204. <dt><samp>221/100</samp></dt>
  12205. </dl>
  12206. <p>Any other value will result in square pixels being signalled instead
  12207. (see H.262 section 6.3.3 and table 6-3).
  12208. </p>
  12209. </dd>
  12210. <dt><samp>frame_rate</samp></dt>
  12211. <dd><p>Set the frame rate in the stream. This is constructed from a table
  12212. of known values combined with a small multiplier and divisor - if
  12213. the supplied value is not exactly representable, the nearest
  12214. representable value will be used instead (see H.262 section 6.3.3
  12215. and table 6-4).
  12216. </p>
  12217. </dd>
  12218. <dt><samp>video_format</samp></dt>
  12219. <dd><p>Set the video format in the stream (see H.262 section 6.3.6 and
  12220. table 6-6).
  12221. </p>
  12222. </dd>
  12223. <dt><samp>colour_primaries</samp></dt>
  12224. <dt><samp>transfer_characteristics</samp></dt>
  12225. <dt><samp>matrix_coefficients</samp></dt>
  12226. <dd><p>Set the colour description in the stream (see H.262 section 6.3.6
  12227. and tables 6-7, 6-8 and 6-9).
  12228. </p>
  12229. </dd>
  12230. </dl>
  12231. <a name="mpeg4_005funpack_005fbframes"></a>
  12232. <h3 class="section">18.21 mpeg4_unpack_bframes<span class="pull-right"><a class="anchor hidden-xs" href="#mpeg4_005funpack_005fbframes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpeg4_005funpack_005fbframes" aria-hidden="true">TOC</a></span></h3>
  12233. <p>Unpack DivX-style packed B-frames.
  12234. </p>
  12235. <p>DivX-style packed B-frames are not valid MPEG-4 and were only a
  12236. workaround for the broken Video for Windows subsystem.
  12237. They use more space, can cause minor AV sync issues, require more
  12238. CPU power to decode (unless the player has some decoded picture queue
  12239. to compensate the 2,0,2,0 frame per packet style) and cause
  12240. trouble if copied into a standard container like mp4 or mpeg-ps/ts,
  12241. because MPEG-4 decoders may not be able to decode them, since they are
  12242. not valid MPEG-4.
  12243. </p>
  12244. <p>For example to fix an AVI file containing an MPEG-4 stream with
  12245. DivX-style packed B-frames using <code>ffmpeg</code>, you can use the command:
  12246. </p>
  12247. <div class="example">
  12248. <pre class="example">ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
  12249. </pre></div>
  12250. <a name="noise"></a>
  12251. <h3 class="section">18.22 noise<span class="pull-right"><a class="anchor hidden-xs" href="#noise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-noise" aria-hidden="true">TOC</a></span></h3>
  12252. <p>Damages the contents of packets or simply drops them without damaging the
  12253. container. Can be used for fuzzing or testing error resilience/concealment.
  12254. </p>
  12255. <p>Parameters:
  12256. </p><dl compact="compact">
  12257. <dt><samp>amount</samp></dt>
  12258. <dd><p>A numeral string, whose value is related to how often output bytes will
  12259. be modified. Therefore, values below or equal to 0 are forbidden, and
  12260. the lower the more frequent bytes will be modified, with 1 meaning
  12261. every byte is modified.
  12262. </p></dd>
  12263. <dt><samp>dropamount</samp></dt>
  12264. <dd><p>A numeral string, whose value is related to how often packets will be dropped.
  12265. Therefore, values below or equal to 0 are forbidden, and the lower the more
  12266. frequent packets will be dropped, with 1 meaning every packet is dropped.
  12267. </p></dd>
  12268. </dl>
  12269. <p>The following example applies the modification to every byte but does not drop
  12270. any packets.
  12271. </p><div class="example">
  12272. <pre class="example">ffmpeg -i INPUT -c copy -bsf noise[=1] output.mkv
  12273. </pre></div>
  12274. <a name="null"></a>
  12275. <h3 class="section">18.23 null<span class="pull-right"><a class="anchor hidden-xs" href="#null" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-null" aria-hidden="true">TOC</a></span></h3>
  12276. <p>This bitstream filter passes the packets through unchanged.
  12277. </p>
  12278. <a name="pcm_005frechunk"></a>
  12279. <h3 class="section">18.24 pcm_rechunk<span class="pull-right"><a class="anchor hidden-xs" href="#pcm_005frechunk" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pcm_005frechunk" aria-hidden="true">TOC</a></span></h3>
  12280. <p>Repacketize PCM audio to a fixed number of samples per packet or a fixed packet
  12281. rate per second. This is similar to the <a href="ffmpeg-filters.html#asetnsamples">(ffmpeg-filters)asetnsamples audio
  12282. filter</a> but works on audio packets instead of audio frames.
  12283. </p>
  12284. <dl compact="compact">
  12285. <dt><samp>nb_out_samples, n</samp></dt>
  12286. <dd><p>Set the number of samples per each output audio packet. The number is intended
  12287. as the number of samples <em>per each channel</em>. Default value is 1024.
  12288. </p>
  12289. </dd>
  12290. <dt><samp>pad, p</samp></dt>
  12291. <dd><p>If set to 1, the filter will pad the last audio packet with silence, so that it
  12292. will contain the same number of samples (or roughly the same number of samples,
  12293. see <samp>frame_rate</samp>) as the previous ones. Default value is 1.
  12294. </p>
  12295. </dd>
  12296. <dt><samp>frame_rate, r</samp></dt>
  12297. <dd><p>This option makes the filter output a fixed number of packets per second instead
  12298. of a fixed number of samples per packet. If the audio sample rate is not
  12299. divisible by the frame rate then the number of samples will not be constant but
  12300. will vary slightly so that each packet will start as close to the frame
  12301. boundary as possible. Using this option has precedence over <samp>nb_out_samples</samp>.
  12302. </p></dd>
  12303. </dl>
  12304. <p>You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio
  12305. for NTSC frame rate using the <samp>frame_rate</samp> option.
  12306. </p><div class="example">
  12307. <pre class="example">ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc -
  12308. </pre></div>
  12309. <a name="prores_005fmetadata"></a>
  12310. <h3 class="section">18.25 prores_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#prores_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prores_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  12311. <p>Modify color property metadata embedded in prores stream.
  12312. </p>
  12313. <dl compact="compact">
  12314. <dt><samp>color_primaries</samp></dt>
  12315. <dd><p>Set the color primaries.
  12316. Available values are:
  12317. </p>
  12318. <dl compact="compact">
  12319. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  12320. <dd><p>Keep the same color primaries property (default).
  12321. </p>
  12322. </dd>
  12323. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  12324. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  12325. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  12326. <dd><p>BT601 625
  12327. </p>
  12328. </dd>
  12329. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  12330. <dd><p>BT601 525
  12331. </p>
  12332. </dd>
  12333. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  12334. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  12335. <dd><p>DCI P3
  12336. </p>
  12337. </dd>
  12338. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  12339. <dd><p>P3 D65
  12340. </p>
  12341. </dd>
  12342. </dl>
  12343. </dd>
  12344. <dt><samp>transfer_characteristics</samp></dt>
  12345. <dd><p>Set the color transfer.
  12346. Available values are:
  12347. </p>
  12348. <dl compact="compact">
  12349. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  12350. <dd><p>Keep the same transfer characteristics property (default).
  12351. </p>
  12352. </dd>
  12353. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  12354. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  12355. <dd><p>BT 601, BT 709, BT 2020
  12356. </p></dd>
  12357. <dt>&lsquo;<samp>smpte2084</samp>&rsquo;</dt>
  12358. <dd><p>SMPTE ST 2084
  12359. </p></dd>
  12360. <dt>&lsquo;<samp>arib-std-b67</samp>&rsquo;</dt>
  12361. <dd><p>ARIB STD-B67
  12362. </p></dd>
  12363. </dl>
  12364. </dd>
  12365. <dt><samp>matrix_coefficients</samp></dt>
  12366. <dd><p>Set the matrix coefficient.
  12367. Available values are:
  12368. </p>
  12369. <dl compact="compact">
  12370. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  12371. <dd><p>Keep the same colorspace property (default).
  12372. </p>
  12373. </dd>
  12374. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  12375. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  12376. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  12377. <dd><p>BT 601
  12378. </p>
  12379. </dd>
  12380. <dt>&lsquo;<samp>bt2020nc</samp>&rsquo;</dt>
  12381. </dl>
  12382. </dd>
  12383. </dl>
  12384. <p>Set Rec709 colorspace for each frame of the file
  12385. </p><div class="example">
  12386. <pre class="example">ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
  12387. </pre></div>
  12388. <p>Set Hybrid Log-Gamma parameters for each frame of the file
  12389. </p><div class="example">
  12390. <pre class="example">ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt2020:color_trc=arib-std-b67:colorspace=bt2020nc output.mov
  12391. </pre></div>
  12392. <a name="remove_005fextra"></a>
  12393. <h3 class="section">18.26 remove_extra<span class="pull-right"><a class="anchor hidden-xs" href="#remove_005fextra" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-remove_005fextra" aria-hidden="true">TOC</a></span></h3>
  12394. <p>Remove extradata from packets.
  12395. </p>
  12396. <p>It accepts the following parameter:
  12397. </p><dl compact="compact">
  12398. <dt><samp>freq</samp></dt>
  12399. <dd><p>Set which frame types to remove extradata from.
  12400. </p>
  12401. <dl compact="compact">
  12402. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  12403. <dd><p>Remove extradata from non-keyframes only.
  12404. </p>
  12405. </dd>
  12406. <dt>&lsquo;<samp>keyframe</samp>&rsquo;</dt>
  12407. <dd><p>Remove extradata from keyframes only.
  12408. </p>
  12409. </dd>
  12410. <dt>&lsquo;<samp>e, all</samp>&rsquo;</dt>
  12411. <dd><p>Remove extradata from all frames.
  12412. </p>
  12413. </dd>
  12414. </dl>
  12415. </dd>
  12416. </dl>
  12417. <a name="setts"></a>
  12418. <h3 class="section">18.27 setts<span class="pull-right"><a class="anchor hidden-xs" href="#setts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setts" aria-hidden="true">TOC</a></span></h3>
  12419. <p>Set PTS and DTS in packets.
  12420. </p>
  12421. <p>It accepts the following parameters:
  12422. </p><dl compact="compact">
  12423. <dt><samp>ts</samp></dt>
  12424. <dt><samp>pts</samp></dt>
  12425. <dt><samp>dts</samp></dt>
  12426. <dd><p>Set expressions for PTS, DTS or both.
  12427. </p></dd>
  12428. </dl>
  12429. <p>The expressions are evaluated through the eval API and can contain the following
  12430. constants:
  12431. </p>
  12432. <dl compact="compact">
  12433. <dt><samp>N</samp></dt>
  12434. <dd><p>The count of the input packet. Starting from 0.
  12435. </p>
  12436. </dd>
  12437. <dt><samp>TS</samp></dt>
  12438. <dd><p>The demux timestamp in input in case of <code>ts</code> or <code>dts</code> option or presentation
  12439. timestamp in case of <code>pts</code> option.
  12440. </p>
  12441. </dd>
  12442. <dt><samp>POS</samp></dt>
  12443. <dd><p>The original position in the file of the packet, or undefined if undefined
  12444. for the current packet
  12445. </p>
  12446. </dd>
  12447. <dt><samp>DTS</samp></dt>
  12448. <dd><p>The demux timestamp in input.
  12449. </p>
  12450. </dd>
  12451. <dt><samp>PTS</samp></dt>
  12452. <dd><p>The presentation timestamp in input.
  12453. </p>
  12454. </dd>
  12455. <dt><samp>STARTDTS</samp></dt>
  12456. <dd><p>The DTS of the first packet.
  12457. </p>
  12458. </dd>
  12459. <dt><samp>STARTPTS</samp></dt>
  12460. <dd><p>The PTS of the first packet.
  12461. </p>
  12462. </dd>
  12463. <dt><samp>PREV_INDTS</samp></dt>
  12464. <dd><p>The previous input DTS.
  12465. </p>
  12466. </dd>
  12467. <dt><samp>PREV_INPTS</samp></dt>
  12468. <dd><p>The previous input PTS.
  12469. </p>
  12470. </dd>
  12471. <dt><samp>PREV_OUTDTS</samp></dt>
  12472. <dd><p>The previous output DTS.
  12473. </p>
  12474. </dd>
  12475. <dt><samp>PREV_OUTPTS</samp></dt>
  12476. <dd><p>The previous output PTS.
  12477. </p>
  12478. </dd>
  12479. <dt><samp>TB</samp></dt>
  12480. <dd><p>The timebase of stream packet belongs.
  12481. </p>
  12482. </dd>
  12483. <dt><samp>SR</samp></dt>
  12484. <dd><p>The sample rate of stream packet belongs.
  12485. </p></dd>
  12486. </dl>
  12487. <span id="text2movsub"></span><a name="text2movsub-1"></a>
  12488. <h3 class="section">18.28 text2movsub<span class="pull-right"><a class="anchor hidden-xs" href="#text2movsub-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-text2movsub-1" aria-hidden="true">TOC</a></span></h3>
  12489. <p>Convert text subtitles to MOV subtitles (as used by the <code>mov_text</code>
  12490. codec) with metadata headers.
  12491. </p>
  12492. <p>See also the <a href="#mov2textsub">mov2textsub</a> filter.
  12493. </p>
  12494. <a name="trace_005fheaders"></a>
  12495. <h3 class="section">18.29 trace_headers<span class="pull-right"><a class="anchor hidden-xs" href="#trace_005fheaders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-trace_005fheaders" aria-hidden="true">TOC</a></span></h3>
  12496. <p>Log trace output containing all syntax elements in the coded stream
  12497. headers (everything above the level of individual coded blocks).
  12498. This can be useful for debugging low-level stream issues.
  12499. </p>
  12500. <p>Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending
  12501. on the build only a subset of these may be available.
  12502. </p>
  12503. <a name="truehd_005fcore"></a>
  12504. <h3 class="section">18.30 truehd_core<span class="pull-right"><a class="anchor hidden-xs" href="#truehd_005fcore" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-truehd_005fcore" aria-hidden="true">TOC</a></span></h3>
  12505. <p>Extract the core from a TrueHD stream, dropping ATMOS data.
  12506. </p>
  12507. <a name="vp9_005fmetadata"></a>
  12508. <h3 class="section">18.31 vp9_metadata<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fmetadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fmetadata" aria-hidden="true">TOC</a></span></h3>
  12509. <p>Modify metadata embedded in a VP9 stream.
  12510. </p>
  12511. <dl compact="compact">
  12512. <dt><samp>color_space</samp></dt>
  12513. <dd><p>Set the color space value in the frame header. Note that any frame
  12514. set to RGB will be implicitly set to PC range and that RGB is
  12515. incompatible with profiles 0 and 2.
  12516. </p><dl compact="compact">
  12517. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  12518. <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
  12519. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  12520. <dt>&lsquo;<samp>smpte170</samp>&rsquo;</dt>
  12521. <dt>&lsquo;<samp>smpte240</samp>&rsquo;</dt>
  12522. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  12523. <dt>&lsquo;<samp>rgb</samp>&rsquo;</dt>
  12524. </dl>
  12525. </dd>
  12526. <dt><samp>color_range</samp></dt>
  12527. <dd><p>Set the color range value in the frame header. Note that any value
  12528. imposed by the color space will take precedence over this value.
  12529. </p><dl compact="compact">
  12530. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  12531. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  12532. </dl>
  12533. </dd>
  12534. </dl>
  12535. <a name="vp9_005fsuperframe"></a>
  12536. <h3 class="section">18.32 vp9_superframe<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fsuperframe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fsuperframe" aria-hidden="true">TOC</a></span></h3>
  12537. <p>Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This
  12538. fixes merging of split/segmented VP9 streams where the alt-ref frame
  12539. was split from its visible counterpart.
  12540. </p>
  12541. <a name="vp9_005fsuperframe_005fsplit"></a>
  12542. <h3 class="section">18.33 vp9_superframe_split<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fsuperframe_005fsplit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fsuperframe_005fsplit" aria-hidden="true">TOC</a></span></h3>
  12543. <p>Split VP9 superframes into single frames.
  12544. </p>
  12545. <a name="vp9_005fraw_005freorder"></a>
  12546. <h3 class="section">18.34 vp9_raw_reorder<span class="pull-right"><a class="anchor hidden-xs" href="#vp9_005fraw_005freorder" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vp9_005fraw_005freorder" aria-hidden="true">TOC</a></span></h3>
  12547. <p>Given a VP9 stream with correct timestamps but possibly out of order,
  12548. insert additional show-existing-frame packets to correct the ordering.
  12549. </p>
  12550. <a name="Format-Options"></a>
  12551. <h2 class="chapter">19 Format Options<span class="pull-right"><a class="anchor hidden-xs" href="#Format-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Format-Options" aria-hidden="true">TOC</a></span></h2>
  12552. <p>The libavformat library provides some generic global options, which
  12553. can be set on all the muxers and demuxers. In addition each muxer or
  12554. demuxer may support so-called private options, which are specific for
  12555. that component.
  12556. </p>
  12557. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  12558. FFmpeg tools, or by setting the value explicitly in the
  12559. <code>AVFormatContext</code> options or using the <samp>libavutil/opt.h</samp> API
  12560. for programmatic use.
  12561. </p>
  12562. <p>The list of supported options follows:
  12563. </p>
  12564. <dl compact="compact">
  12565. <dt><samp>avioflags <var>flags</var> (<em>input/output</em>)</samp></dt>
  12566. <dd><p>Possible values:
  12567. </p><dl compact="compact">
  12568. <dt>&lsquo;<samp>direct</samp>&rsquo;</dt>
  12569. <dd><p>Reduce buffering.
  12570. </p></dd>
  12571. </dl>
  12572. </dd>
  12573. <dt><samp>probesize <var>integer</var> (<em>input</em>)</samp></dt>
  12574. <dd><p>Set probing size in bytes, i.e. the size of the data to analyze to get
  12575. stream information. A higher value will enable detecting more
  12576. information in case it is dispersed into the stream, but will increase
  12577. latency. Must be an integer not lesser than 32. It is 5000000 by default.
  12578. </p>
  12579. </dd>
  12580. <dt><samp>max_probe_packets <var>integer</var> (<em>input</em>)</samp></dt>
  12581. <dd><p>Set the maximum number of buffered packets when probing a codec.
  12582. Default is 2500 packets.
  12583. </p>
  12584. </dd>
  12585. <dt><samp>packetsize <var>integer</var> (<em>output</em>)</samp></dt>
  12586. <dd><p>Set packet size.
  12587. </p>
  12588. </dd>
  12589. <dt><samp>fflags <var>flags</var></samp></dt>
  12590. <dd><p>Set format flags. Some are implemented for a limited number of formats.
  12591. </p>
  12592. <p>Possible values for input files:
  12593. </p><dl compact="compact">
  12594. <dt>&lsquo;<samp>discardcorrupt</samp>&rsquo;</dt>
  12595. <dd><p>Discard corrupted packets.
  12596. </p></dd>
  12597. <dt>&lsquo;<samp>fastseek</samp>&rsquo;</dt>
  12598. <dd><p>Enable fast, but inaccurate seeks for some formats.
  12599. </p></dd>
  12600. <dt>&lsquo;<samp>genpts</samp>&rsquo;</dt>
  12601. <dd><p>Generate missing PTS if DTS is present.
  12602. </p></dd>
  12603. <dt>&lsquo;<samp>igndts</samp>&rsquo;</dt>
  12604. <dd><p>Ignore DTS if PTS is set. Inert when nofillin is set.
  12605. </p></dd>
  12606. <dt>&lsquo;<samp>ignidx</samp>&rsquo;</dt>
  12607. <dd><p>Ignore index.
  12608. </p></dd>
  12609. <dt>&lsquo;<samp>keepside (<em>deprecated</em>,<em>inert</em>)</samp>&rsquo;</dt>
  12610. <dt>&lsquo;<samp>nobuffer</samp>&rsquo;</dt>
  12611. <dd><p>Reduce the latency introduced by buffering during initial input streams analysis.
  12612. </p></dd>
  12613. <dt>&lsquo;<samp>nofillin</samp>&rsquo;</dt>
  12614. <dd><p>Do not fill in missing values in packet fields that can be exactly calculated.
  12615. </p></dd>
  12616. <dt>&lsquo;<samp>noparse</samp>&rsquo;</dt>
  12617. <dd><p>Disable AVParsers, this needs <code>+nofillin</code> too.
  12618. </p></dd>
  12619. <dt>&lsquo;<samp>sortdts</samp>&rsquo;</dt>
  12620. <dd><p>Try to interleave output packets by DTS. At present, available only for AVIs with an index.
  12621. </p></dd>
  12622. </dl>
  12623. <p>Possible values for output files:
  12624. </p><dl compact="compact">
  12625. <dt>&lsquo;<samp>autobsf</samp>&rsquo;</dt>
  12626. <dd><p>Automatically apply bitstream filters as required by the output format. Enabled by default.
  12627. </p></dd>
  12628. <dt>&lsquo;<samp>bitexact</samp>&rsquo;</dt>
  12629. <dd><p>Only write platform-, build- and time-independent data.
  12630. This ensures that file and data checksums are reproducible and match between
  12631. platforms. Its primary use is for regression testing.
  12632. </p></dd>
  12633. <dt>&lsquo;<samp>flush_packets</samp>&rsquo;</dt>
  12634. <dd><p>Write out packets immediately.
  12635. </p></dd>
  12636. <dt>&lsquo;<samp>latm (<em>deprecated</em>,<em>inert</em>)</samp>&rsquo;</dt>
  12637. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  12638. <dd><p>Stop muxing at the end of the shortest stream.
  12639. It may be needed to increase max_interleave_delta to avoid flushing the longer
  12640. streams before EOF.
  12641. </p></dd>
  12642. </dl>
  12643. </dd>
  12644. <dt><samp>seek2any <var>integer</var> (<em>input</em>)</samp></dt>
  12645. <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
  12646. Default is 0.
  12647. </p>
  12648. </dd>
  12649. <dt><samp>analyzeduration <var>integer</var> (<em>input</em>)</samp></dt>
  12650. <dd><p>Specify how many microseconds are analyzed to probe the input. A
  12651. higher value will enable detecting more accurate information, but will
  12652. increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
  12653. </p>
  12654. </dd>
  12655. <dt><samp>cryptokey <var>hexadecimal string</var> (<em>input</em>)</samp></dt>
  12656. <dd><p>Set decryption key.
  12657. </p>
  12658. </dd>
  12659. <dt><samp>indexmem <var>integer</var> (<em>input</em>)</samp></dt>
  12660. <dd><p>Set max memory used for timestamp index (per stream).
  12661. </p>
  12662. </dd>
  12663. <dt><samp>rtbufsize <var>integer</var> (<em>input</em>)</samp></dt>
  12664. <dd><p>Set max memory used for buffering real-time frames.
  12665. </p>
  12666. </dd>
  12667. <dt><samp>fdebug <var>flags</var> (<em>input/output</em>)</samp></dt>
  12668. <dd><p>Print specific debug info.
  12669. </p>
  12670. <p>Possible values:
  12671. </p><dl compact="compact">
  12672. <dt>&lsquo;<samp>ts</samp>&rsquo;</dt>
  12673. </dl>
  12674. </dd>
  12675. <dt><samp>max_delay <var>integer</var> (<em>input/output</em>)</samp></dt>
  12676. <dd><p>Set maximum muxing or demuxing delay in microseconds.
  12677. </p>
  12678. </dd>
  12679. <dt><samp>fpsprobesize <var>integer</var> (<em>input</em>)</samp></dt>
  12680. <dd><p>Set number of frames used to probe fps.
  12681. </p>
  12682. </dd>
  12683. <dt><samp>audio_preload <var>integer</var> (<em>output</em>)</samp></dt>
  12684. <dd><p>Set microseconds by which audio packets should be interleaved earlier.
  12685. </p>
  12686. </dd>
  12687. <dt><samp>chunk_duration <var>integer</var> (<em>output</em>)</samp></dt>
  12688. <dd><p>Set microseconds for each chunk.
  12689. </p>
  12690. </dd>
  12691. <dt><samp>chunk_size <var>integer</var> (<em>output</em>)</samp></dt>
  12692. <dd><p>Set size in bytes for each chunk.
  12693. </p>
  12694. </dd>
  12695. <dt><samp>err_detect, f_err_detect <var>flags</var> (<em>input</em>)</samp></dt>
  12696. <dd><p>Set error detection flags. <code>f_err_detect</code> is deprecated and
  12697. should be used only via the <code>ffmpeg</code> tool.
  12698. </p>
  12699. <p>Possible values:
  12700. </p><dl compact="compact">
  12701. <dt>&lsquo;<samp>crccheck</samp>&rsquo;</dt>
  12702. <dd><p>Verify embedded CRCs.
  12703. </p></dd>
  12704. <dt>&lsquo;<samp>bitstream</samp>&rsquo;</dt>
  12705. <dd><p>Detect bitstream specification deviations.
  12706. </p></dd>
  12707. <dt>&lsquo;<samp>buffer</samp>&rsquo;</dt>
  12708. <dd><p>Detect improper bitstream length.
  12709. </p></dd>
  12710. <dt>&lsquo;<samp>explode</samp>&rsquo;</dt>
  12711. <dd><p>Abort decoding on minor error detection.
  12712. </p></dd>
  12713. <dt>&lsquo;<samp>careful</samp>&rsquo;</dt>
  12714. <dd><p>Consider things that violate the spec and have not been seen in the
  12715. wild as errors.
  12716. </p></dd>
  12717. <dt>&lsquo;<samp>compliant</samp>&rsquo;</dt>
  12718. <dd><p>Consider all spec non compliancies as errors.
  12719. </p></dd>
  12720. <dt>&lsquo;<samp>aggressive</samp>&rsquo;</dt>
  12721. <dd><p>Consider things that a sane encoder should not do as an error.
  12722. </p></dd>
  12723. </dl>
  12724. </dd>
  12725. <dt><samp>max_interleave_delta <var>integer</var> (<em>output</em>)</samp></dt>
  12726. <dd><p>Set maximum buffering duration for interleaving. The duration is
  12727. expressed in microseconds, and defaults to 10000000 (10 seconds).
  12728. </p>
  12729. <p>To ensure all the streams are interleaved correctly, libavformat will
  12730. wait until it has at least one packet for each stream before actually
  12731. writing any packets to the output file. When some streams are
  12732. &quot;sparse&quot; (i.e. there are large gaps between successive packets), this
  12733. can result in excessive buffering.
  12734. </p>
  12735. <p>This field specifies the maximum difference between the timestamps of the
  12736. first and the last packet in the muxing queue, above which libavformat
  12737. will output a packet regardless of whether it has queued a packet for all
  12738. the streams.
  12739. </p>
  12740. <p>If set to 0, libavformat will continue buffering packets until it has
  12741. a packet for each stream, regardless of the maximum timestamp
  12742. difference between the buffered packets.
  12743. </p>
  12744. </dd>
  12745. <dt><samp>use_wallclock_as_timestamps <var>integer</var> (<em>input</em>)</samp></dt>
  12746. <dd><p>Use wallclock as timestamps if set to 1. Default is 0.
  12747. </p>
  12748. </dd>
  12749. <dt><samp>avoid_negative_ts <var>integer</var> (<em>output</em>)</samp></dt>
  12750. <dd>
  12751. <p>Possible values:
  12752. </p><dl compact="compact">
  12753. <dt>&lsquo;<samp>make_non_negative</samp>&rsquo;</dt>
  12754. <dd><p>Shift timestamps to make them non-negative.
  12755. Also note that this affects only leading negative timestamps, and not
  12756. non-monotonic negative timestamps.
  12757. </p></dd>
  12758. <dt>&lsquo;<samp>make_zero</samp>&rsquo;</dt>
  12759. <dd><p>Shift timestamps so that the first timestamp is 0.
  12760. </p></dd>
  12761. <dt>&lsquo;<samp>auto (default)</samp>&rsquo;</dt>
  12762. <dd><p>Enables shifting when required by the target format.
  12763. </p></dd>
  12764. <dt>&lsquo;<samp>disabled</samp>&rsquo;</dt>
  12765. <dd><p>Disables shifting of timestamp.
  12766. </p></dd>
  12767. </dl>
  12768. <p>When shifting is enabled, all output timestamps are shifted by the
  12769. same amount. Audio, video, and subtitles desynching and relative
  12770. timestamp differences are preserved compared to how they would have
  12771. been without shifting.
  12772. </p>
  12773. </dd>
  12774. <dt><samp>skip_initial_bytes <var>integer</var> (<em>input</em>)</samp></dt>
  12775. <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
  12776. Default is 0.
  12777. </p>
  12778. </dd>
  12779. <dt><samp>correct_ts_overflow <var>integer</var> (<em>input</em>)</samp></dt>
  12780. <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
  12781. </p>
  12782. </dd>
  12783. <dt><samp>flush_packets <var>integer</var> (<em>output</em>)</samp></dt>
  12784. <dd><p>Flush the underlying I/O stream after each packet. Default is -1 (auto), which
  12785. means that the underlying protocol will decide, 1 enables it, and has the
  12786. effect of reducing the latency, 0 disables it and may increase IO throughput in
  12787. some cases.
  12788. </p>
  12789. </dd>
  12790. <dt><samp>output_ts_offset <var>offset</var> (<em>output</em>)</samp></dt>
  12791. <dd><p>Set the output time offset.
  12792. </p>
  12793. <p><var>offset</var> must be a time duration specification,
  12794. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  12795. </p>
  12796. <p>The offset is added by the muxer to the output timestamps.
  12797. </p>
  12798. <p>Specifying a positive offset means that the corresponding streams are
  12799. delayed bt the time duration specified in <var>offset</var>. Default value
  12800. is <code>0</code> (meaning that no offset is applied).
  12801. </p>
  12802. </dd>
  12803. <dt><samp>format_whitelist <var>list</var> (<em>input</em>)</samp></dt>
  12804. <dd><p>&quot;,&quot; separated list of allowed demuxers. By default all are allowed.
  12805. </p>
  12806. </dd>
  12807. <dt><samp>dump_separator <var>string</var> (<em>input</em>)</samp></dt>
  12808. <dd><p>Separator used to separate the fields printed on the command line about the
  12809. Stream parameters.
  12810. For example, to separate the fields with newlines and indentation:
  12811. </p><div class="example">
  12812. <pre class="example">ffprobe -dump_separator &quot;
  12813. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  12814. </pre></div>
  12815. </dd>
  12816. <dt><samp>max_streams <var>integer</var> (<em>input</em>)</samp></dt>
  12817. <dd><p>Specifies the maximum number of streams. This can be used to reject files that
  12818. would require too many resources due to a large number of streams.
  12819. </p>
  12820. </dd>
  12821. <dt><samp>skip_estimate_duration_from_pts <var>bool</var> (<em>input</em>)</samp></dt>
  12822. <dd><p>Skip estimation of input duration when calculated using PTS.
  12823. At present, applicable for MPEG-PS and MPEG-TS.
  12824. </p>
  12825. </dd>
  12826. <dt><samp>strict, f_strict <var>integer</var> (<em>input/output</em>)</samp></dt>
  12827. <dd><p>Specify how strictly to follow the standards. <code>f_strict</code> is deprecated and
  12828. should be used only via the <code>ffmpeg</code> tool.
  12829. </p>
  12830. <p>Possible values:
  12831. </p><dl compact="compact">
  12832. <dt>&lsquo;<samp>very</samp>&rsquo;</dt>
  12833. <dd><p>strictly conform to an older more strict version of the spec or reference software
  12834. </p></dd>
  12835. <dt>&lsquo;<samp>strict</samp>&rsquo;</dt>
  12836. <dd><p>strictly conform to all the things in the spec no matter what consequences
  12837. </p></dd>
  12838. <dt>&lsquo;<samp>normal</samp>&rsquo;</dt>
  12839. <dt>&lsquo;<samp>unofficial</samp>&rsquo;</dt>
  12840. <dd><p>allow unofficial extensions
  12841. </p></dd>
  12842. <dt>&lsquo;<samp>experimental</samp>&rsquo;</dt>
  12843. <dd><p>allow non standardized experimental things, experimental
  12844. (unfinished/work in progress/not well tested) decoders and encoders.
  12845. Note: experimental decoders can pose a security risk, do not use this for
  12846. decoding untrusted input.
  12847. </p></dd>
  12848. </dl>
  12849. </dd>
  12850. </dl>
  12851. <span id="Format-stream-specifiers"></span><a name="Format-stream-specifiers-1"></a>
  12852. <h3 class="section">19.1 Format stream specifiers<span class="pull-right"><a class="anchor hidden-xs" href="#Format-stream-specifiers-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Format-stream-specifiers-1" aria-hidden="true">TOC</a></span></h3>
  12853. <p>Format stream specifiers allow selection of one or more streams that
  12854. match specific properties.
  12855. </p>
  12856. <p>The exact semantics of stream specifiers is defined by the
  12857. <code>avformat_match_stream_specifier()</code> function declared in the
  12858. <samp>libavformat/avformat.h</samp> header and documented in the
  12859. <a href="ffmpeg.html#Stream-specifiers">(ffmpeg)Stream specifiers section in the ffmpeg(1) manual</a>.
  12860. </p>
  12861. <a name="Demuxers"></a>
  12862. <h2 class="chapter">20 Demuxers<span class="pull-right"><a class="anchor hidden-xs" href="#Demuxers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Demuxers" aria-hidden="true">TOC</a></span></h2>
  12863. <p>Demuxers are configured elements in FFmpeg that can read the
  12864. multimedia streams from a particular type of file.
  12865. </p>
  12866. <p>When you configure your FFmpeg build, all the supported demuxers
  12867. are enabled by default. You can list all available ones using the
  12868. configure option <code>--list-demuxers</code>.
  12869. </p>
  12870. <p>You can disable all the demuxers using the configure option
  12871. <code>--disable-demuxers</code>, and selectively enable a single demuxer with
  12872. the option <code>--enable-demuxer=<var>DEMUXER</var></code>, or disable it
  12873. with the option <code>--disable-demuxer=<var>DEMUXER</var></code>.
  12874. </p>
  12875. <p>The option <code>-demuxers</code> of the ff* tools will display the list of
  12876. enabled demuxers. Use <code>-formats</code> to view a combined list of
  12877. enabled demuxers and muxers.
  12878. </p>
  12879. <p>The description of some of the currently available demuxers follows.
  12880. </p>
  12881. <a name="aa"></a>
  12882. <h3 class="section">20.1 aa<span class="pull-right"><a class="anchor hidden-xs" href="#aa" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aa" aria-hidden="true">TOC</a></span></h3>
  12883. <p>Audible Format 2, 3, and 4 demuxer.
  12884. </p>
  12885. <p>This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
  12886. </p>
  12887. <a name="apng"></a>
  12888. <h3 class="section">20.2 apng<span class="pull-right"><a class="anchor hidden-xs" href="#apng" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apng" aria-hidden="true">TOC</a></span></h3>
  12889. <p>Animated Portable Network Graphics demuxer.
  12890. </p>
  12891. <p>This demuxer is used to demux APNG files.
  12892. All headers, but the PNG signature, up to (but not including) the first
  12893. fcTL chunk are transmitted as extradata.
  12894. Frames are then split as being all the chunks between two fcTL ones, or
  12895. between the last fcTL and IEND chunks.
  12896. </p>
  12897. <dl compact="compact">
  12898. <dt><samp>-ignore_loop <var>bool</var></samp></dt>
  12899. <dd><p>Ignore the loop variable in the file if set.
  12900. </p></dd>
  12901. <dt><samp>-max_fps <var>int</var></samp></dt>
  12902. <dd><p>Maximum framerate in frames per second (0 for no limit).
  12903. </p></dd>
  12904. <dt><samp>-default_fps <var>int</var></samp></dt>
  12905. <dd><p>Default framerate in frames per second when none is specified in the file
  12906. (0 meaning as fast as possible).
  12907. </p></dd>
  12908. </dl>
  12909. <a name="asf-1"></a>
  12910. <h3 class="section">20.3 asf<span class="pull-right"><a class="anchor hidden-xs" href="#asf-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asf-1" aria-hidden="true">TOC</a></span></h3>
  12911. <p>Advanced Systems Format demuxer.
  12912. </p>
  12913. <p>This demuxer is used to demux ASF files and MMS network streams.
  12914. </p>
  12915. <dl compact="compact">
  12916. <dt><samp>-no_resync_search <var>bool</var></samp></dt>
  12917. <dd><p>Do not try to resynchronize by looking for a certain optional start code.
  12918. </p></dd>
  12919. </dl>
  12920. <span id="concat"></span><a name="concat-1"></a>
  12921. <h3 class="section">20.4 concat<span class="pull-right"><a class="anchor hidden-xs" href="#concat-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concat-1" aria-hidden="true">TOC</a></span></h3>
  12922. <p>Virtual concatenation script demuxer.
  12923. </p>
  12924. <p>This demuxer reads a list of files and other directives from a text file and
  12925. demuxes them one after the other, as if all their packets had been muxed
  12926. together.
  12927. </p>
  12928. <p>The timestamps in the files are adjusted so that the first file starts at 0
  12929. and each next file starts where the previous one finishes. Note that it is
  12930. done globally and may cause gaps if all streams do not have exactly the same
  12931. length.
  12932. </p>
  12933. <p>All files must have the same streams (same codecs, same time base, etc.).
  12934. </p>
  12935. <p>The duration of each file is used to adjust the timestamps of the next file:
  12936. if the duration is incorrect (because it was computed using the bit-rate or
  12937. because the file is truncated, for example), it can cause artifacts. The
  12938. <code>duration</code> directive can be used to override the duration stored in
  12939. each file.
  12940. </p>
  12941. <a name="Syntax-1"></a>
  12942. <h4 class="subsection">20.4.1 Syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Syntax-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Syntax-1" aria-hidden="true">TOC</a></span></h4>
  12943. <p>The script is a text file in extended-ASCII, with one directive per line.
  12944. Empty lines, leading spaces and lines starting with &rsquo;#&rsquo; are ignored. The
  12945. following directive is recognized:
  12946. </p>
  12947. <dl compact="compact">
  12948. <dt><samp><code>file <var>path</var></code></samp></dt>
  12949. <dd><p>Path to a file to read; special characters and spaces must be escaped with
  12950. backslash or single quotes.
  12951. </p>
  12952. <p>All subsequent file-related directives apply to that file.
  12953. </p>
  12954. </dd>
  12955. <dt><samp><code>ffconcat version 1.0</code></samp></dt>
  12956. <dd><p>Identify the script type and version. It also sets the <samp>safe</samp> option
  12957. to 1 if it was -1.
  12958. </p>
  12959. <p>To make FFmpeg recognize the format automatically, this directive must
  12960. appear exactly as is (no extra space or byte-order-mark) on the very first
  12961. line of the script.
  12962. </p>
  12963. </dd>
  12964. <dt><samp><code>duration <var>dur</var></code></samp></dt>
  12965. <dd><p>Duration of the file. This information can be specified from the file;
  12966. specifying it here may be more efficient or help if the information from the
  12967. file is not available or accurate.
  12968. </p>
  12969. <p>If the duration is set for all files, then it is possible to seek in the
  12970. whole concatenated video.
  12971. </p>
  12972. </dd>
  12973. <dt><samp><code>inpoint <var>timestamp</var></code></samp></dt>
  12974. <dd><p>In point of the file. When the demuxer opens the file it instantly seeks to the
  12975. specified timestamp. Seeking is done so that all streams can be presented
  12976. successfully at In point.
  12977. </p>
  12978. <p>This directive works best with intra frame codecs, because for non-intra frame
  12979. ones you will usually get extra packets before the actual In point and the
  12980. decoded content will most likely contain frames before In point too.
  12981. </p>
  12982. <p>For each file, packets before the file In point will have timestamps less than
  12983. the calculated start timestamp of the file (negative in case of the first
  12984. file), and the duration of the files (if not specified by the <code>duration</code>
  12985. directive) will be reduced based on their specified In point.
  12986. </p>
  12987. <p>Because of potential packets before the specified In point, packet timestamps
  12988. may overlap between two concatenated files.
  12989. </p>
  12990. </dd>
  12991. <dt><samp><code>outpoint <var>timestamp</var></code></samp></dt>
  12992. <dd><p>Out point of the file. When the demuxer reaches the specified decoding
  12993. timestamp in any of the streams, it handles it as an end of file condition and
  12994. skips the current and all the remaining packets from all streams.
  12995. </p>
  12996. <p>Out point is exclusive, which means that the demuxer will not output packets
  12997. with a decoding timestamp greater or equal to Out point.
  12998. </p>
  12999. <p>This directive works best with intra frame codecs and formats where all streams
  13000. are tightly interleaved. For non-intra frame codecs you will usually get
  13001. additional packets with presentation timestamp after Out point therefore the
  13002. decoded content will most likely contain frames after Out point too. If your
  13003. streams are not tightly interleaved you may not get all the packets from all
  13004. streams before Out point and you may only will be able to decode the earliest
  13005. stream until Out point.
  13006. </p>
  13007. <p>The duration of the files (if not specified by the <code>duration</code>
  13008. directive) will be reduced based on their specified Out point.
  13009. </p>
  13010. </dd>
  13011. <dt><samp><code>file_packet_metadata <var>key=value</var></code></samp></dt>
  13012. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  13013. each file packet. You can specify this directive multiple times to add multiple
  13014. metadata entries.
  13015. </p>
  13016. </dd>
  13017. <dt><samp><code>stream</code></samp></dt>
  13018. <dd><p>Introduce a stream in the virtual file.
  13019. All subsequent stream-related directives apply to the last introduced
  13020. stream.
  13021. Some streams properties must be set in order to allow identifying the
  13022. matching streams in the subfiles.
  13023. If no streams are defined in the script, the streams from the first file are
  13024. copied.
  13025. </p>
  13026. </dd>
  13027. <dt><samp><code>exact_stream_id <var>id</var></code></samp></dt>
  13028. <dd><p>Set the id of the stream.
  13029. If this directive is given, the string with the corresponding id in the
  13030. subfiles will be used.
  13031. This is especially useful for MPEG-PS (VOB) files, where the order of the
  13032. streams is not reliable.
  13033. </p>
  13034. </dd>
  13035. </dl>
  13036. <a name="Options-40"></a>
  13037. <h4 class="subsection">20.4.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-40" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-40" aria-hidden="true">TOC</a></span></h4>
  13038. <p>This demuxer accepts the following option:
  13039. </p>
  13040. <dl compact="compact">
  13041. <dt><samp>safe</samp></dt>
  13042. <dd><p>If set to 1, reject unsafe file paths. A file path is considered safe if it
  13043. does not contain a protocol specification and is relative and all components
  13044. only contain characters from the portable character set (letters, digits,
  13045. period, underscore and hyphen) and have no period at the beginning of a
  13046. component.
  13047. </p>
  13048. <p>If set to 0, any file name is accepted.
  13049. </p>
  13050. <p>The default is 1.
  13051. </p>
  13052. <p>-1 is equivalent to 1 if the format was automatically
  13053. probed and 0 otherwise.
  13054. </p>
  13055. </dd>
  13056. <dt><samp>auto_convert</samp></dt>
  13057. <dd><p>If set to 1, try to perform automatic conversions on packet data to make the
  13058. streams concatenable.
  13059. The default is 1.
  13060. </p>
  13061. <p>Currently, the only conversion is adding the h264_mp4toannexb bitstream
  13062. filter to H.264 streams in MP4 format. This is necessary in particular if
  13063. there are resolution changes.
  13064. </p>
  13065. </dd>
  13066. <dt><samp>segment_time_metadata</samp></dt>
  13067. <dd><p>If set to 1, every packet will contain the <var>lavf.concat.start_time</var> and the
  13068. <var>lavf.concat.duration</var> packet metadata values which are the start_time and
  13069. the duration of the respective file segments in the concatenated output
  13070. expressed in microseconds. The duration metadata is only set if it is known
  13071. based on the concat file.
  13072. The default is 0.
  13073. </p>
  13074. </dd>
  13075. </dl>
  13076. <a name="Examples-6"></a>
  13077. <h4 class="subsection">20.4.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-6" aria-hidden="true">TOC</a></span></h4>
  13078. <ul>
  13079. <li> Use absolute filenames and include some comments:
  13080. <div class="example">
  13081. <pre class="example"># my first filename
  13082. file /mnt/share/file-1.wav
  13083. # my second filename including whitespace
  13084. file '/mnt/share/file 2.wav'
  13085. # my third filename including whitespace plus single quote
  13086. file '/mnt/share/file 3'\''.wav'
  13087. </pre></div>
  13088. </li><li> Allow for input format auto-probing, use safe filenames and set the duration of
  13089. the first file:
  13090. <div class="example">
  13091. <pre class="example">ffconcat version 1.0
  13092. file file-1.wav
  13093. duration 20.0
  13094. file subdir/file-2.wav
  13095. </pre></div>
  13096. </li></ul>
  13097. <a name="dash-1"></a>
  13098. <h3 class="section">20.5 dash<span class="pull-right"><a class="anchor hidden-xs" href="#dash-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dash-1" aria-hidden="true">TOC</a></span></h3>
  13099. <p>Dynamic Adaptive Streaming over HTTP demuxer.
  13100. </p>
  13101. <p>This demuxer presents all AVStreams found in the manifest.
  13102. By setting the discard flags on AVStreams the caller can decide
  13103. which streams to actually receive.
  13104. Each stream mirrors the <code>id</code> and <code>bandwidth</code> properties from the
  13105. <code>&lt;Representation&gt;</code> as metadata keys named &quot;id&quot; and &quot;variant_bitrate&quot; respectively.
  13106. </p>
  13107. <a name="flv_002c-live_005fflv"></a>
  13108. <h3 class="section">20.6 flv, live_flv<span class="pull-right"><a class="anchor hidden-xs" href="#flv_002c-live_005fflv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flv_002c-live_005fflv" aria-hidden="true">TOC</a></span></h3>
  13109. <p>Adobe Flash Video Format demuxer.
  13110. </p>
  13111. <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.
  13112. </p>
  13113. <div class="example">
  13114. <pre class="example">ffmpeg -f flv -i myfile.flv ...
  13115. ffmpeg -f live_flv -i rtmp://&lt;any.server&gt;/anything/key ....
  13116. </pre></div>
  13117. <dl compact="compact">
  13118. <dt><samp>-flv_metadata <var>bool</var></samp></dt>
  13119. <dd><p>Allocate the streams according to the onMetaData array content.
  13120. </p>
  13121. </dd>
  13122. <dt><samp>-flv_ignore_prevtag <var>bool</var></samp></dt>
  13123. <dd><p>Ignore the size of previous tag value.
  13124. </p>
  13125. </dd>
  13126. <dt><samp>-flv_full_metadata <var>bool</var></samp></dt>
  13127. <dd><p>Output all context of the onMetadata.
  13128. </p></dd>
  13129. </dl>
  13130. <a name="gif-1"></a>
  13131. <h3 class="section">20.7 gif<span class="pull-right"><a class="anchor hidden-xs" href="#gif-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gif-1" aria-hidden="true">TOC</a></span></h3>
  13132. <p>Animated GIF demuxer.
  13133. </p>
  13134. <p>It accepts the following options:
  13135. </p>
  13136. <dl compact="compact">
  13137. <dt><samp>min_delay</samp></dt>
  13138. <dd><p>Set the minimum valid delay between frames in hundredths of seconds.
  13139. Range is 0 to 6000. Default value is 2.
  13140. </p>
  13141. </dd>
  13142. <dt><samp>max_gif_delay</samp></dt>
  13143. <dd><p>Set the maximum valid delay between frames in hundredth of seconds.
  13144. Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
  13145. the maximum value allowed by the specification.
  13146. </p>
  13147. </dd>
  13148. <dt><samp>default_delay</samp></dt>
  13149. <dd><p>Set the default delay between frames in hundredths of seconds.
  13150. Range is 0 to 6000. Default value is 10.
  13151. </p>
  13152. </dd>
  13153. <dt><samp>ignore_loop</samp></dt>
  13154. <dd><p>GIF files can contain information to loop a certain number of times (or
  13155. infinitely). If <samp>ignore_loop</samp> is set to 1, then the loop setting
  13156. from the input will be ignored and looping will not occur. If set to 0,
  13157. then looping will occur and will cycle the number of times according to
  13158. the GIF. Default value is 1.
  13159. </p></dd>
  13160. </dl>
  13161. <p>For example, with the overlay filter, place an infinitely looping GIF
  13162. over another video:
  13163. </p><div class="example">
  13164. <pre class="example">ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
  13165. </pre></div>
  13166. <p>Note that in the above example the shortest option for overlay filter is
  13167. used to end the output video at the length of the shortest input file,
  13168. which in this case is <samp>input.mp4</samp> as the GIF in this example loops
  13169. infinitely.
  13170. </p>
  13171. <a name="hls-1"></a>
  13172. <h3 class="section">20.8 hls<span class="pull-right"><a class="anchor hidden-xs" href="#hls-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hls-1" aria-hidden="true">TOC</a></span></h3>
  13173. <p>HLS demuxer
  13174. </p>
  13175. <p>Apple HTTP Live Streaming demuxer.
  13176. </p>
  13177. <p>This demuxer presents all AVStreams from all variant streams.
  13178. The id field is set to the bitrate variant index number. By setting
  13179. the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
  13180. the caller can decide which variant streams to actually receive.
  13181. The total bitrate of the variant that the stream belongs to is
  13182. available in a metadata key named &quot;variant_bitrate&quot;.
  13183. </p>
  13184. <p>It accepts the following options:
  13185. </p>
  13186. <dl compact="compact">
  13187. <dt><samp>live_start_index</samp></dt>
  13188. <dd><p>segment index to start live streams at (negative values are from the end).
  13189. </p>
  13190. </dd>
  13191. <dt><samp>allowed_extensions</samp></dt>
  13192. <dd><p>&rsquo;,&rsquo; separated list of file extensions that hls is allowed to access.
  13193. </p>
  13194. </dd>
  13195. <dt><samp>max_reload</samp></dt>
  13196. <dd><p>Maximum number of times a insufficient list is attempted to be reloaded.
  13197. Default value is 1000.
  13198. </p>
  13199. </dd>
  13200. <dt><samp>m3u8_hold_counters</samp></dt>
  13201. <dd><p>The maximum number of times to load m3u8 when it refreshes without new segments.
  13202. Default value is 1000.
  13203. </p>
  13204. </dd>
  13205. <dt><samp>http_persistent</samp></dt>
  13206. <dd><p>Use persistent HTTP connections. Applicable only for HTTP streams.
  13207. Enabled by default.
  13208. </p>
  13209. </dd>
  13210. <dt><samp>http_multiple</samp></dt>
  13211. <dd><p>Use multiple HTTP connections for downloading HTTP segments.
  13212. Enabled by default for HTTP/1.1 servers.
  13213. </p>
  13214. </dd>
  13215. <dt><samp>http_seekable</samp></dt>
  13216. <dd><p>Use HTTP partial requests for downloading HTTP segments.
  13217. 0 = disable, 1 = enable, -1 = auto, Default is auto.
  13218. </p></dd>
  13219. </dl>
  13220. <a name="image2-1"></a>
  13221. <h3 class="section">20.9 image2<span class="pull-right"><a class="anchor hidden-xs" href="#image2-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-image2-1" aria-hidden="true">TOC</a></span></h3>
  13222. <p>Image file demuxer.
  13223. </p>
  13224. <p>This demuxer reads from a list of image files specified by a pattern.
  13225. The syntax and meaning of the pattern is specified by the
  13226. option <var>pattern_type</var>.
  13227. </p>
  13228. <p>The pattern may contain a suffix which is used to automatically
  13229. determine the format of the images contained in the files.
  13230. </p>
  13231. <p>The size, the pixel format, and the format of each image must be the
  13232. same for all the files in the sequence.
  13233. </p>
  13234. <p>This demuxer accepts the following options:
  13235. </p><dl compact="compact">
  13236. <dt><samp>framerate</samp></dt>
  13237. <dd><p>Set the frame rate for the video stream. It defaults to 25.
  13238. </p></dd>
  13239. <dt><samp>loop</samp></dt>
  13240. <dd><p>If set to 1, loop over the input. Default value is 0.
  13241. </p></dd>
  13242. <dt><samp>pattern_type</samp></dt>
  13243. <dd><p>Select the pattern type used to interpret the provided filename.
  13244. </p>
  13245. <p><var>pattern_type</var> accepts one of the following values.
  13246. </p><dl compact="compact">
  13247. <dt><samp>none</samp></dt>
  13248. <dd><p>Disable pattern matching, therefore the video will only contain the specified
  13249. image. You should use this option if you do not want to create sequences from
  13250. multiple images and your filenames may contain special pattern characters.
  13251. </p></dd>
  13252. <dt><samp>sequence</samp></dt>
  13253. <dd><p>Select a sequence pattern type, used to specify a sequence of files
  13254. indexed by sequential numbers.
  13255. </p>
  13256. <p>A sequence pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, which
  13257. specifies the position of the characters representing a sequential
  13258. number in each filename matched by the pattern. If the form
  13259. &quot;%d0<var>N</var>d&quot; is used, the string representing the number in each
  13260. filename is 0-padded and <var>N</var> is the total number of 0-padded
  13261. digits representing the number. The literal character &rsquo;%&rsquo; can be
  13262. specified in the pattern with the string &quot;%%&quot;.
  13263. </p>
  13264. <p>If the sequence pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
  13265. the file list specified by the pattern must contain a number
  13266. inclusively contained between <var>start_number</var> and
  13267. <var>start_number</var>+<var>start_number_range</var>-1, and all the following
  13268. numbers must be sequential.
  13269. </p>
  13270. <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
  13271. filenames of the form <samp>img-001.bmp</samp>, <samp>img-002.bmp</samp>, ...,
  13272. <samp>img-010.bmp</samp>, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
  13273. sequence of filenames of the form <samp>i%m%g-1.jpg</samp>,
  13274. <samp>i%m%g-2.jpg</samp>, ..., <samp>i%m%g-10.jpg</samp>, etc.
  13275. </p>
  13276. <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
  13277. &quot;%0<var>N</var>d&quot;, for example to convert a single image file
  13278. <samp>img.jpeg</samp> you can employ the command:
  13279. </p><div class="example">
  13280. <pre class="example">ffmpeg -i img.jpeg img.png
  13281. </pre></div>
  13282. </dd>
  13283. <dt><samp>glob</samp></dt>
  13284. <dd><p>Select a glob wildcard pattern type.
  13285. </p>
  13286. <p>The pattern is interpreted like a <code>glob()</code> pattern. This is only
  13287. selectable if libavformat was compiled with globbing support.
  13288. </p>
  13289. </dd>
  13290. <dt><samp>glob_sequence <em>(deprecated, will be removed)</em></samp></dt>
  13291. <dd><p>Select a mixed glob wildcard/sequence pattern.
  13292. </p>
  13293. <p>If your version of libavformat was compiled with globbing support, and
  13294. the provided pattern contains at least one glob meta character among
  13295. <code>%*?[]{}</code> that is preceded by an unescaped &quot;%&quot;, the pattern is
  13296. interpreted like a <code>glob()</code> pattern, otherwise it is interpreted
  13297. like a sequence pattern.
  13298. </p>
  13299. <p>All glob special characters <code>%*?[]{}</code> must be prefixed
  13300. with &quot;%&quot;. To escape a literal &quot;%&quot; you shall use &quot;%%&quot;.
  13301. </p>
  13302. <p>For example the pattern <code>foo-%*.jpeg</code> will match all the
  13303. filenames prefixed by &quot;foo-&quot; and terminating with &quot;.jpeg&quot;, and
  13304. <code>foo-%?%?%?.jpeg</code> will match all the filenames prefixed with
  13305. &quot;foo-&quot;, followed by a sequence of three characters, and terminating
  13306. with &quot;.jpeg&quot;.
  13307. </p>
  13308. <p>This pattern type is deprecated in favor of <var>glob</var> and
  13309. <var>sequence</var>.
  13310. </p></dd>
  13311. </dl>
  13312. <p>Default value is <var>glob_sequence</var>.
  13313. </p></dd>
  13314. <dt><samp>pixel_format</samp></dt>
  13315. <dd><p>Set the pixel format of the images to read. If not specified the pixel
  13316. format is guessed from the first image file in the sequence.
  13317. </p></dd>
  13318. <dt><samp>start_number</samp></dt>
  13319. <dd><p>Set the index of the file matched by the image file pattern to start
  13320. to read from. Default value is 0.
  13321. </p></dd>
  13322. <dt><samp>start_number_range</samp></dt>
  13323. <dd><p>Set the index interval range to check when looking for the first image
  13324. file in the sequence, starting from <var>start_number</var>. Default value
  13325. is 5.
  13326. </p></dd>
  13327. <dt><samp>ts_from_file</samp></dt>
  13328. <dd><p>If set to 1, will set frame timestamp to modification time of image file. Note
  13329. that monotonity of timestamps is not provided: images go in the same order as
  13330. without this option. Default value is 0.
  13331. If set to 2, will set frame timestamp to the modification time of the image file in
  13332. nanosecond precision.
  13333. </p></dd>
  13334. <dt><samp>video_size</samp></dt>
  13335. <dd><p>Set the video size of the images to read. If not specified the video
  13336. size is guessed from the first image file in the sequence.
  13337. </p></dd>
  13338. <dt><samp>export_path_metadata</samp></dt>
  13339. <dd><p>If set to 1, will add two extra fields to the metadata found in input, making them
  13340. also available for other filters (see <var>drawtext</var> filter for examples). Default
  13341. value is 0. The extra fields are described below:
  13342. </p><dl compact="compact">
  13343. <dt><samp>lavf.image2dec.source_path</samp></dt>
  13344. <dd><p>Corresponds to the full path to the input file being read.
  13345. </p></dd>
  13346. <dt><samp>lavf.image2dec.source_basename</samp></dt>
  13347. <dd><p>Corresponds to the name of the file being read.
  13348. </p></dd>
  13349. </dl>
  13350. </dd>
  13351. </dl>
  13352. <a name="Examples-7"></a>
  13353. <h4 class="subsection">20.9.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-7" aria-hidden="true">TOC</a></span></h4>
  13354. <ul>
  13355. <li> Use <code>ffmpeg</code> for creating a video from the images in the file
  13356. sequence <samp>img-001.jpeg</samp>, <samp>img-002.jpeg</samp>, ..., assuming an
  13357. input frame rate of 10 frames per second:
  13358. <div class="example">
  13359. <pre class="example">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
  13360. </pre></div>
  13361. </li><li> As above, but start by reading from a file with index 100 in the sequence:
  13362. <div class="example">
  13363. <pre class="example">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
  13364. </pre></div>
  13365. </li><li> Read images matching the &quot;*.png&quot; glob pattern , that is all the files
  13366. terminating with the &quot;.png&quot; suffix:
  13367. <div class="example">
  13368. <pre class="example">ffmpeg -framerate 10 -pattern_type glob -i &quot;*.png&quot; out.mkv
  13369. </pre></div>
  13370. </li></ul>
  13371. <a name="libgme"></a>
  13372. <h3 class="section">20.10 libgme<span class="pull-right"><a class="anchor hidden-xs" href="#libgme" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libgme" aria-hidden="true">TOC</a></span></h3>
  13373. <p>The Game Music Emu library is a collection of video game music file emulators.
  13374. </p>
  13375. <p>See <a href="https://bitbucket.org/mpyne/game-music-emu/overview">https://bitbucket.org/mpyne/game-music-emu/overview</a> for more information.
  13376. </p>
  13377. <p>It accepts the following options:
  13378. </p>
  13379. <dl compact="compact">
  13380. <dt><samp>track_index</samp></dt>
  13381. <dd><p>Set the index of which track to demux. The demuxer can only export one track.
  13382. Track indexes start at 0. Default is to pick the first track. Number of tracks
  13383. is exported as <var>tracks</var> metadata entry.
  13384. </p>
  13385. </dd>
  13386. <dt><samp>sample_rate</samp></dt>
  13387. <dd><p>Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100.
  13388. </p>
  13389. </dd>
  13390. <dt><samp>max_size <em>(bytes)</em></samp></dt>
  13391. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  13392. which in turn, acts as a ceiling for the size of files that can be read.
  13393. Default is 50 MiB.
  13394. </p>
  13395. </dd>
  13396. </dl>
  13397. <a name="libmodplug"></a>
  13398. <h3 class="section">20.11 libmodplug<span class="pull-right"><a class="anchor hidden-xs" href="#libmodplug" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libmodplug" aria-hidden="true">TOC</a></span></h3>
  13399. <p>ModPlug based module demuxer
  13400. </p>
  13401. <p>See <a href="https://github.com/Konstanty/libmodplug">https://github.com/Konstanty/libmodplug</a>
  13402. </p>
  13403. <p>It will export one 2-channel 16-bit 44.1 kHz audio stream.
  13404. Optionally, a <code>pal8</code> 16-color video stream can be exported with or without printed metadata.
  13405. </p>
  13406. <p>It accepts the following options:
  13407. </p>
  13408. <dl compact="compact">
  13409. <dt><samp>noise_reduction</samp></dt>
  13410. <dd><p>Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0.
  13411. </p>
  13412. </dd>
  13413. <dt><samp>reverb_depth</samp></dt>
  13414. <dd><p>Set amount of reverb. Range 0-100. Default is 0.
  13415. </p>
  13416. </dd>
  13417. <dt><samp>reverb_delay</samp></dt>
  13418. <dd><p>Set delay in ms, clamped to 40-250 ms. Default is 0.
  13419. </p>
  13420. </dd>
  13421. <dt><samp>bass_amount</samp></dt>
  13422. <dd><p>Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0.
  13423. </p>
  13424. </dd>
  13425. <dt><samp>bass_range</samp></dt>
  13426. <dd><p>Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100 Hz. Default is 0.
  13427. </p>
  13428. </dd>
  13429. <dt><samp>surround_depth</samp></dt>
  13430. <dd><p>Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0.
  13431. </p>
  13432. </dd>
  13433. <dt><samp>surround_delay</samp></dt>
  13434. <dd><p>Set surround delay in ms, clamped to 5-40 ms. Default is 0.
  13435. </p>
  13436. </dd>
  13437. <dt><samp>max_size</samp></dt>
  13438. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  13439. which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB.
  13440. 0 removes buffer size limit (not recommended). Default is 5 MiB.
  13441. </p>
  13442. </dd>
  13443. <dt><samp>video_stream_expr</samp></dt>
  13444. <dd><p>String which is evaluated using the eval API to assign colors to the generated video stream.
  13445. Variables which can be used are <code>x</code>, <code>y</code>, <code>w</code>, <code>h</code>, <code>t</code>, <code>speed</code>,
  13446. <code>tempo</code>, <code>order</code>, <code>pattern</code> and <code>row</code>.
  13447. </p>
  13448. </dd>
  13449. <dt><samp>video_stream</samp></dt>
  13450. <dd><p>Generate video stream. Can be 1 (on) or 0 (off). Default is 0.
  13451. </p>
  13452. </dd>
  13453. <dt><samp>video_stream_w</samp></dt>
  13454. <dd><p>Set video frame width in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  13455. </p>
  13456. </dd>
  13457. <dt><samp>video_stream_h</samp></dt>
  13458. <dd><p>Set video frame height in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  13459. </p>
  13460. </dd>
  13461. <dt><samp>video_stream_ptxt</samp></dt>
  13462. <dd><p>Print metadata on video stream. Includes <code>speed</code>, <code>tempo</code>, <code>order</code>, <code>pattern</code>,
  13463. <code>row</code> and <code>ts</code> (time in ms). Can be 1 (on) or 0 (off). Default is 1.
  13464. </p>
  13465. </dd>
  13466. </dl>
  13467. <a name="libopenmpt"></a>
  13468. <h3 class="section">20.12 libopenmpt<span class="pull-right"><a class="anchor hidden-xs" href="#libopenmpt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopenmpt" aria-hidden="true">TOC</a></span></h3>
  13469. <p>libopenmpt based module demuxer
  13470. </p>
  13471. <p>See <a href="https://lib.openmpt.org/libopenmpt/">https://lib.openmpt.org/libopenmpt/</a> for more information.
  13472. </p>
  13473. <p>Some files have multiple subsongs (tracks) this can be set with the <samp>subsong</samp>
  13474. option.
  13475. </p>
  13476. <p>It accepts the following options:
  13477. </p>
  13478. <dl compact="compact">
  13479. <dt><samp>subsong</samp></dt>
  13480. <dd><p>Set the subsong index. This can be either &rsquo;all&rsquo;, &rsquo;auto&rsquo;, or the index of the
  13481. subsong. Subsong indexes start at 0. The default is &rsquo;auto&rsquo;.
  13482. </p>
  13483. <p>The default value is to let libopenmpt choose.
  13484. </p>
  13485. </dd>
  13486. <dt><samp>layout</samp></dt>
  13487. <dd><p>Set the channel layout. Valid values are 1, 2, and 4 channel layouts.
  13488. The default value is STEREO.
  13489. </p>
  13490. </dd>
  13491. <dt><samp>sample_rate</samp></dt>
  13492. <dd><p>Set the sample rate for libopenmpt to output.
  13493. Range is from 1000 to INT_MAX. The value default is 48000.
  13494. </p></dd>
  13495. </dl>
  13496. <a name="mov_002fmp4_002f3gp"></a>
  13497. <h3 class="section">20.13 mov/mp4/3gp<span class="pull-right"><a class="anchor hidden-xs" href="#mov_002fmp4_002f3gp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mov_002fmp4_002f3gp" aria-hidden="true">TOC</a></span></h3>
  13498. <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).
  13499. </p>
  13500. <p>Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v
  13501. </p>
  13502. <a name="Options-41"></a>
  13503. <h4 class="subsection">20.13.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-41" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-41" aria-hidden="true">TOC</a></span></h4>
  13504. <p>This demuxer accepts the following options:
  13505. </p><dl compact="compact">
  13506. <dt><samp>enable_drefs</samp></dt>
  13507. <dd><p>Enable loading of external tracks, disabled by default.
  13508. Enabling this can theoretically leak information in some use cases.
  13509. </p>
  13510. </dd>
  13511. <dt><samp>use_absolute_path</samp></dt>
  13512. <dd><p>Allows loading of external tracks via absolute paths, disabled by default.
  13513. Enabling this poses a security risk. It should only be enabled if the source
  13514. is known to be non-malicious.
  13515. </p>
  13516. </dd>
  13517. <dt><samp>seek_streams_individually</samp></dt>
  13518. <dd><p>When seeking, identify the closest point in each stream individually and demux packets in
  13519. that stream from identified point. This can lead to a different sequence of packets compared
  13520. to demuxing linearly from the beginning. Default is true.
  13521. </p>
  13522. </dd>
  13523. <dt><samp>ignore_editlist</samp></dt>
  13524. <dd><p>Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the
  13525. timeline described by the edit list. Default is false.
  13526. </p>
  13527. </dd>
  13528. <dt><samp>advanced_editlist</samp></dt>
  13529. <dd><p>Modify the stream index to reflect the timeline described by the edit list. <code>ignore_editlist</code>
  13530. must be set to false for this option to be effective.
  13531. If both <code>ignore_editlist</code> and this option are set to false, then only the
  13532. start of the stream index is modified to reflect initial dwell time or starting timestamp
  13533. described by the edit list. Default is true.
  13534. </p>
  13535. </dd>
  13536. <dt><samp>ignore_chapters</samp></dt>
  13537. <dd><p>Don&rsquo;t parse chapters. This includes GoPro &rsquo;HiLight&rsquo; tags/moments. Note that chapters are
  13538. only parsed when input is seekable. Default is false.
  13539. </p>
  13540. </dd>
  13541. <dt><samp>use_mfra_for</samp></dt>
  13542. <dd><p>For seekable fragmented input, set fragment&rsquo;s starting timestamp from media fragment random access box, if present.
  13543. </p>
  13544. <p>Following options are available:
  13545. </p><dl compact="compact">
  13546. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  13547. <dd><p>Auto-detect whether to set mfra timestamps as PTS or DTS <em>(default)</em>
  13548. </p>
  13549. </dd>
  13550. <dt>&lsquo;<samp>dts</samp>&rsquo;</dt>
  13551. <dd><p>Set mfra timestamps as DTS
  13552. </p>
  13553. </dd>
  13554. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  13555. <dd><p>Set mfra timestamps as PTS
  13556. </p>
  13557. </dd>
  13558. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  13559. <dd><p>Don&rsquo;t use mfra box to set timestamps
  13560. </p></dd>
  13561. </dl>
  13562. </dd>
  13563. <dt><samp>export_all</samp></dt>
  13564. <dd><p>Export unrecognized boxes within the <var>udta</var> box as metadata entries. The first four
  13565. characters of the box type are set as the key. Default is false.
  13566. </p>
  13567. </dd>
  13568. <dt><samp>export_xmp</samp></dt>
  13569. <dd><p>Export entire contents of <var>XMP_</var> box and <var>uuid</var> box as a string with key <code>xmp</code>. Note that
  13570. if <code>export_all</code> is set and this option isn&rsquo;t, the contents of <var>XMP_</var> box are still exported
  13571. but with key <code>XMP_</code>. Default is false.
  13572. </p>
  13573. </dd>
  13574. <dt><samp>activation_bytes</samp></dt>
  13575. <dd><p>4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below.
  13576. </p>
  13577. </dd>
  13578. <dt><samp>audible_fixed_key</samp></dt>
  13579. <dd><p>Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to
  13580. specify.
  13581. </p>
  13582. </dd>
  13583. <dt><samp>decryption_key</samp></dt>
  13584. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  13585. </p></dd>
  13586. </dl>
  13587. <a name="Audible-AAX"></a>
  13588. <h4 class="subsection">20.13.2 Audible AAX<span class="pull-right"><a class="anchor hidden-xs" href="#Audible-AAX" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audible-AAX" aria-hidden="true">TOC</a></span></h4>
  13589. <p>Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
  13590. </p><div class="example">
  13591. <pre class="example">ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
  13592. </pre></div>
  13593. <a name="mpegts"></a>
  13594. <h3 class="section">20.14 mpegts<span class="pull-right"><a class="anchor hidden-xs" href="#mpegts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpegts" aria-hidden="true">TOC</a></span></h3>
  13595. <p>MPEG-2 transport stream demuxer.
  13596. </p>
  13597. <p>This demuxer accepts the following options:
  13598. </p><dl compact="compact">
  13599. <dt><samp>resync_size</samp></dt>
  13600. <dd><p>Set size limit for looking up a new synchronization. Default value is
  13601. 65536.
  13602. </p>
  13603. </dd>
  13604. <dt><samp>skip_unknown_pmt</samp></dt>
  13605. <dd><p>Skip PMTs for programs not defined in the PAT. Default value is 0.
  13606. </p>
  13607. </dd>
  13608. <dt><samp>fix_teletext_pts</samp></dt>
  13609. <dd><p>Override teletext packet PTS and DTS values with the timestamps calculated
  13610. from the PCR of the first program which the teletext stream is part of and is
  13611. not discarded. Default value is 1, set this option to 0 if you want your
  13612. teletext packet PTS and DTS values untouched.
  13613. </p>
  13614. </dd>
  13615. <dt><samp>ts_packetsize</samp></dt>
  13616. <dd><p>Output option carrying the raw packet size in bytes.
  13617. Show the detected raw packet size, cannot be set by the user.
  13618. </p>
  13619. </dd>
  13620. <dt><samp>scan_all_pmts</samp></dt>
  13621. <dd><p>Scan and combine all PMTs. The value is an integer with value from -1
  13622. to 1 (-1 means automatic setting, 1 means enabled, 0 means
  13623. disabled). Default value is -1.
  13624. </p>
  13625. </dd>
  13626. <dt><samp>merge_pmt_versions</samp></dt>
  13627. <dd><p>Re-use existing streams when a PMT&rsquo;s version is updated and elementary
  13628. streams move to different PIDs. Default value is 0.
  13629. </p></dd>
  13630. </dl>
  13631. <a name="mpjpeg"></a>
  13632. <h3 class="section">20.15 mpjpeg<span class="pull-right"><a class="anchor hidden-xs" href="#mpjpeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpjpeg" aria-hidden="true">TOC</a></span></h3>
  13633. <p>MJPEG encapsulated in multi-part MIME demuxer.
  13634. </p>
  13635. <p>This demuxer allows reading of MJPEG, where each frame is represented as a part of
  13636. multipart/x-mixed-replace stream.
  13637. </p><dl compact="compact">
  13638. <dt><samp>strict_mime_boundary</samp></dt>
  13639. <dd><p>Default implementation applies a relaxed standard to multi-part MIME boundary detection,
  13640. to prevent regression with numerous existing endpoints not generating a proper MIME
  13641. MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check
  13642. of the boundary value.
  13643. </p></dd>
  13644. </dl>
  13645. <a name="rawvideo-1"></a>
  13646. <h3 class="section">20.16 rawvideo<span class="pull-right"><a class="anchor hidden-xs" href="#rawvideo-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rawvideo-1" aria-hidden="true">TOC</a></span></h3>
  13647. <p>Raw video demuxer.
  13648. </p>
  13649. <p>This demuxer allows one to read raw video data. Since there is no header
  13650. specifying the assumed video parameters, the user must specify them
  13651. in order to be able to decode the data correctly.
  13652. </p>
  13653. <p>This demuxer accepts the following options:
  13654. </p><dl compact="compact">
  13655. <dt><samp>framerate</samp></dt>
  13656. <dd><p>Set input video frame rate. Default value is 25.
  13657. </p>
  13658. </dd>
  13659. <dt><samp>pixel_format</samp></dt>
  13660. <dd><p>Set the input video pixel format. Default value is <code>yuv420p</code>.
  13661. </p>
  13662. </dd>
  13663. <dt><samp>video_size</samp></dt>
  13664. <dd><p>Set the input video size. This value must be specified explicitly.
  13665. </p></dd>
  13666. </dl>
  13667. <p>For example to read a rawvideo file <samp>input.raw</samp> with
  13668. <code>ffplay</code>, assuming a pixel format of <code>rgb24</code>, a video
  13669. size of <code>320x240</code>, and a frame rate of 10 images per second, use
  13670. the command:
  13671. </p><div class="example">
  13672. <pre class="example">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
  13673. </pre></div>
  13674. <a name="sbg"></a>
  13675. <h3 class="section">20.17 sbg<span class="pull-right"><a class="anchor hidden-xs" href="#sbg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sbg" aria-hidden="true">TOC</a></span></h3>
  13676. <p>SBaGen script demuxer.
  13677. </p>
  13678. <p>This demuxer reads the script language used by SBaGen
  13679. <a href="http://uazu.net/sbagen/">http://uazu.net/sbagen/</a> to generate binaural beats sessions. A SBG
  13680. script looks like that:
  13681. </p><div class="example">
  13682. <pre class="example">-SE
  13683. a: 300-2.5/3 440+4.5/0
  13684. b: 300-2.5/0 440+4.5/3
  13685. off: -
  13686. NOW == a
  13687. +0:07:00 == b
  13688. +0:14:00 == a
  13689. +0:21:00 == b
  13690. +0:30:00 off
  13691. </pre></div>
  13692. <p>A SBG script can mix absolute and relative timestamps. If the script uses
  13693. either only absolute timestamps (including the script start time) or only
  13694. relative ones, then its layout is fixed, and the conversion is
  13695. straightforward. On the other hand, if the script mixes both kind of
  13696. timestamps, then the <var>NOW</var> reference for relative timestamps will be
  13697. taken from the current time of day at the time the script is read, and the
  13698. script layout will be frozen according to that reference. That means that if
  13699. the script is directly played, the actual times will match the absolute
  13700. timestamps up to the sound controller&rsquo;s clock accuracy, but if the user
  13701. somehow pauses the playback or seeks, all times will be shifted accordingly.
  13702. </p>
  13703. <a name="tedcaptions"></a>
  13704. <h3 class="section">20.18 tedcaptions<span class="pull-right"><a class="anchor hidden-xs" href="#tedcaptions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tedcaptions" aria-hidden="true">TOC</a></span></h3>
  13705. <p>JSON captions used for <a href="http://www.ted.com/">TED Talks</a>.
  13706. </p>
  13707. <p>TED does not provide links to the captions, but they can be guessed from the
  13708. page. The file <samp>tools/bookmarklets.html</samp> from the FFmpeg source tree
  13709. contains a bookmarklet to expose them.
  13710. </p>
  13711. <p>This demuxer accepts the following option:
  13712. </p><dl compact="compact">
  13713. <dt><samp>start_time</samp></dt>
  13714. <dd><p>Set the start time of the TED talk, in milliseconds. The default is 15000
  13715. (15s). It is used to sync the captions with the downloadable videos, because
  13716. they include a 15s intro.
  13717. </p></dd>
  13718. </dl>
  13719. <p>Example: convert the captions to a format most players understand:
  13720. </p><div class="example">
  13721. <pre class="example">ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
  13722. </pre></div>
  13723. <a name="vapoursynth"></a>
  13724. <h3 class="section">20.19 vapoursynth<span class="pull-right"><a class="anchor hidden-xs" href="#vapoursynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vapoursynth" aria-hidden="true">TOC</a></span></h3>
  13725. <p>Vapoursynth wrapper.
  13726. </p>
  13727. <p>Due to security concerns, Vapoursynth scripts will not
  13728. be autodetected so the input format has to be forced. For ff* CLI tools,
  13729. add <code>-f vapoursynth</code> before the input <code>-i yourscript.vpy</code>.
  13730. </p>
  13731. <p>This demuxer accepts the following option:
  13732. </p><dl compact="compact">
  13733. <dt><samp>max_script_size</samp></dt>
  13734. <dd><p>The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size,
  13735. which in turn, acts as a ceiling for the size of scripts that can be read.
  13736. Default is 1 MiB.
  13737. </p></dd>
  13738. </dl>
  13739. <a name="Muxers"></a>
  13740. <h2 class="chapter">21 Muxers<span class="pull-right"><a class="anchor hidden-xs" href="#Muxers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Muxers" aria-hidden="true">TOC</a></span></h2>
  13741. <p>Muxers are configured elements in FFmpeg which allow writing
  13742. multimedia streams to a particular type of file.
  13743. </p>
  13744. <p>When you configure your FFmpeg build, all the supported muxers
  13745. are enabled by default. You can list all available muxers using the
  13746. configure option <code>--list-muxers</code>.
  13747. </p>
  13748. <p>You can disable all the muxers with the configure option
  13749. <code>--disable-muxers</code> and selectively enable / disable single muxers
  13750. with the options <code>--enable-muxer=<var>MUXER</var></code> /
  13751. <code>--disable-muxer=<var>MUXER</var></code>.
  13752. </p>
  13753. <p>The option <code>-muxers</code> of the ff* tools will display the list of
  13754. enabled muxers. Use <code>-formats</code> to view a combined list of
  13755. enabled demuxers and muxers.
  13756. </p>
  13757. <p>A description of some of the currently available muxers follows.
  13758. </p>
  13759. <span id="aiff"></span><a name="aiff-1"></a>
  13760. <h3 class="section">21.1 aiff<span class="pull-right"><a class="anchor hidden-xs" href="#aiff-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aiff-1" aria-hidden="true">TOC</a></span></h3>
  13761. <p>Audio Interchange File Format muxer.
  13762. </p>
  13763. <a name="Options-42"></a>
  13764. <h4 class="subsection">21.1.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-42" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-42" aria-hidden="true">TOC</a></span></h4>
  13765. <p>It accepts the following options:
  13766. </p>
  13767. <dl compact="compact">
  13768. <dt><samp>write_id3v2</samp></dt>
  13769. <dd><p>Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
  13770. </p>
  13771. </dd>
  13772. <dt><samp>id3v2_version</samp></dt>
  13773. <dd><p>Select ID3v2 version to write. Currently only version 3 and 4 (aka.
  13774. ID3v2.3 and ID3v2.4) are supported. The default is version 4.
  13775. </p>
  13776. </dd>
  13777. </dl>
  13778. <span id="asf"></span><a name="asf-2"></a>
  13779. <h3 class="section">21.2 asf<span class="pull-right"><a class="anchor hidden-xs" href="#asf-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asf-2" aria-hidden="true">TOC</a></span></h3>
  13780. <p>Advanced Systems Format muxer.
  13781. </p>
  13782. <p>Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this
  13783. muxer too.
  13784. </p>
  13785. <a name="Options-43"></a>
  13786. <h4 class="subsection">21.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-43" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-43" aria-hidden="true">TOC</a></span></h4>
  13787. <p>It accepts the following options:
  13788. </p>
  13789. <dl compact="compact">
  13790. <dt><samp>packet_size</samp></dt>
  13791. <dd><p>Set the muxer packet size. By tuning this setting you may reduce data
  13792. fragmentation or muxer overhead depending on your source. Default value is
  13793. 3200, minimum is 100, maximum is 64k.
  13794. </p>
  13795. </dd>
  13796. </dl>
  13797. <span id="avi"></span><a name="avi-1"></a>
  13798. <h3 class="section">21.3 avi<span class="pull-right"><a class="anchor hidden-xs" href="#avi-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avi-1" aria-hidden="true">TOC</a></span></h3>
  13799. <p>Audio Video Interleaved muxer.
  13800. </p>
  13801. <a name="Options-44"></a>
  13802. <h4 class="subsection">21.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-44" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-44" aria-hidden="true">TOC</a></span></h4>
  13803. <p>It accepts the following options:
  13804. </p>
  13805. <dl compact="compact">
  13806. <dt><samp>reserve_index_space</samp></dt>
  13807. <dd><p>Reserve the specified amount of bytes for the OpenDML master index of each
  13808. stream within the file header. By default additional master indexes are
  13809. embedded within the data packets if there is no space left in the first master
  13810. index and are linked together as a chain of indexes. This index structure can
  13811. cause problems for some use cases, e.g. third-party software strictly relying
  13812. on the OpenDML index specification or when file seeking is slow. Reserving
  13813. enough index space in the file header avoids these problems.
  13814. </p>
  13815. <p>The required index space depends on the output file size and should be about 16
  13816. bytes per gigabyte. When this option is omitted or set to zero the necessary
  13817. index space is guessed.
  13818. </p>
  13819. </dd>
  13820. <dt><samp>write_channel_mask</samp></dt>
  13821. <dd><p>Write the channel layout mask into the audio stream header.
  13822. </p>
  13823. <p>This option is enabled by default. Disabling the channel mask can be useful in
  13824. specific scenarios, e.g. when merging multiple audio streams into one for
  13825. compatibility with software that only supports a single audio stream in AVI
  13826. (see <a href="ffmpeg-filters.html#amerge">(ffmpeg-filters)the &quot;amerge&quot; section in the ffmpeg-filters manual</a>).
  13827. </p>
  13828. </dd>
  13829. <dt><samp>flipped_raw_rgb</samp></dt>
  13830. <dd><p>If set to true, store positive height for raw RGB bitmaps, which indicates
  13831. bitmap is stored bottom-up. Note that this option does not flip the bitmap
  13832. which has to be done manually beforehand, e.g. by using the vflip filter.
  13833. Default is <var>false</var> and indicates bitmap is stored top down.
  13834. </p>
  13835. </dd>
  13836. </dl>
  13837. <span id="chromaprint"></span><a name="chromaprint-1"></a>
  13838. <h3 class="section">21.4 chromaprint<span class="pull-right"><a class="anchor hidden-xs" href="#chromaprint-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromaprint-1" aria-hidden="true">TOC</a></span></h3>
  13839. <p>Chromaprint fingerprinter.
  13840. </p>
  13841. <p>This muxer feeds audio data to the Chromaprint library,
  13842. which generates a fingerprint for the provided audio data. See <a href="https://acoustid.org/chromaprint">https://acoustid.org/chromaprint</a>
  13843. </p>
  13844. <p>It takes a single signed native-endian 16-bit raw audio stream of at most 2 channels.
  13845. </p>
  13846. <a name="Options-45"></a>
  13847. <h4 class="subsection">21.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-45" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-45" aria-hidden="true">TOC</a></span></h4>
  13848. <dl compact="compact">
  13849. <dt><samp>silence_threshold</samp></dt>
  13850. <dd><p>Threshold for detecting silence. Range is from -1 to 32767, where -1 disables
  13851. silence detection. Silence detection can only be used with version 3 of the
  13852. algorithm.
  13853. Silence detection must be disabled for use with the AcoustID service. Default is -1.
  13854. </p>
  13855. </dd>
  13856. <dt><samp>algorithm</samp></dt>
  13857. <dd><p>Version of algorithm to fingerprint with. Range is 0 to 4.
  13858. Version 3 enables silence detection. Default is 1.
  13859. </p>
  13860. </dd>
  13861. <dt><samp>fp_format</samp></dt>
  13862. <dd><p>Format to output the fingerprint as. Accepts the following options:
  13863. </p><dl compact="compact">
  13864. <dt>&lsquo;<samp>raw</samp>&rsquo;</dt>
  13865. <dd><p>Binary raw fingerprint
  13866. </p>
  13867. </dd>
  13868. <dt>&lsquo;<samp>compressed</samp>&rsquo;</dt>
  13869. <dd><p>Binary compressed fingerprint
  13870. </p>
  13871. </dd>
  13872. <dt>&lsquo;<samp>base64</samp>&rsquo;</dt>
  13873. <dd><p>Base64 compressed fingerprint <em>(default)</em>
  13874. </p>
  13875. </dd>
  13876. </dl>
  13877. </dd>
  13878. </dl>
  13879. <span id="crc"></span><a name="crc-1"></a>
  13880. <h3 class="section">21.5 crc<span class="pull-right"><a class="anchor hidden-xs" href="#crc-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crc-1" aria-hidden="true">TOC</a></span></h3>
  13881. <p>CRC (Cyclic Redundancy Check) testing format.
  13882. </p>
  13883. <p>This muxer computes and prints the Adler-32 CRC of all the input audio
  13884. and video frames. By default audio frames are converted to signed
  13885. 16-bit raw audio and video frames to raw video before computing the
  13886. CRC.
  13887. </p>
  13888. <p>The output of the muxer consists of a single line of the form:
  13889. CRC=0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal number 0-padded to
  13890. 8 digits containing the CRC for all the decoded input frames.
  13891. </p>
  13892. <p>See also the <a href="#framecrc">framecrc</a> muxer.
  13893. </p>
  13894. <a name="Examples-8"></a>
  13895. <h4 class="subsection">21.5.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-8" aria-hidden="true">TOC</a></span></h4>
  13896. <p>For example to compute the CRC of the input, and store it in the file
  13897. <samp>out.crc</samp>:
  13898. </p><div class="example">
  13899. <pre class="example">ffmpeg -i INPUT -f crc out.crc
  13900. </pre></div>
  13901. <p>You can print the CRC to stdout with the command:
  13902. </p><div class="example">
  13903. <pre class="example">ffmpeg -i INPUT -f crc -
  13904. </pre></div>
  13905. <p>You can select the output format of each frame with <code>ffmpeg</code> by
  13906. specifying the audio and video codec and format. For example to
  13907. compute the CRC of the input audio converted to PCM unsigned 8-bit
  13908. and the input video converted to MPEG-2 video, use the command:
  13909. </p><div class="example">
  13910. <pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
  13911. </pre></div>
  13912. <a name="flv"></a>
  13913. <h3 class="section">21.6 flv<span class="pull-right"><a class="anchor hidden-xs" href="#flv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flv" aria-hidden="true">TOC</a></span></h3>
  13914. <p>Adobe Flash Video Format muxer.
  13915. </p>
  13916. <p>This muxer accepts the following options:
  13917. </p>
  13918. <dl compact="compact">
  13919. <dt><samp>flvflags <var>flags</var></samp></dt>
  13920. <dd><p>Possible values:
  13921. </p>
  13922. <dl compact="compact">
  13923. <dt>&lsquo;<samp>aac_seq_header_detect</samp>&rsquo;</dt>
  13924. <dd><p>Place AAC sequence header based on audio stream data.
  13925. </p>
  13926. </dd>
  13927. <dt>&lsquo;<samp>no_sequence_end</samp>&rsquo;</dt>
  13928. <dd><p>Disable sequence end tag.
  13929. </p>
  13930. </dd>
  13931. <dt>&lsquo;<samp>no_metadata</samp>&rsquo;</dt>
  13932. <dd><p>Disable metadata tag.
  13933. </p>
  13934. </dd>
  13935. <dt>&lsquo;<samp>no_duration_filesize</samp>&rsquo;</dt>
  13936. <dd><p>Disable duration and filesize in metadata when they are equal to zero
  13937. at the end of stream. (Be used to non-seekable living stream).
  13938. </p>
  13939. </dd>
  13940. <dt>&lsquo;<samp>add_keyframe_index</samp>&rsquo;</dt>
  13941. <dd><p>Used to facilitate seeking; particularly for HTTP pseudo streaming.
  13942. </p></dd>
  13943. </dl>
  13944. </dd>
  13945. </dl>
  13946. <span id="dash"></span><a name="dash-2"></a>
  13947. <h3 class="section">21.7 dash<span class="pull-right"><a class="anchor hidden-xs" href="#dash-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dash-2" aria-hidden="true">TOC</a></span></h3>
  13948. <p>Dynamic Adaptive Streaming over HTTP (DASH) muxer that creates segments
  13949. and manifest files according to the MPEG-DASH standard ISO/IEC 23009-1:2014.
  13950. </p>
  13951. <p>For more information see:
  13952. </p>
  13953. <ul>
  13954. <li> ISO DASH Specification: <a 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>
  13955. </li><li> WebM DASH Specification: <a 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>
  13956. </li></ul>
  13957. <p>It creates a MPD manifest file and segment files for each stream.
  13958. </p>
  13959. <p>The segment filename might contain pre-defined identifiers used with SegmentTemplate
  13960. as defined in section 5.3.9.4.4 of the standard. Available identifiers are &quot;$RepresentationID$&quot;,
  13961. &quot;$Number$&quot;, &quot;$Bandwidth$&quot; and &quot;$Time$&quot;.
  13962. In addition to the standard identifiers, an ffmpeg-specific &quot;$ext$&quot; identifier is also supported.
  13963. When specified ffmpeg will replace $ext$ in the file name with muxing format&rsquo;s extensions such as mp4, webm etc.,
  13964. </p>
  13965. <div class="example">
  13966. <pre class="example">ffmpeg -re -i &lt;input&gt; -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \
  13967. -b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline \
  13968. -profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 \
  13969. -b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 \
  13970. -window_size 5 -adaptation_sets &quot;id=0,streams=v id=1,streams=a&quot; \
  13971. -f dash /path/to/out.mpd
  13972. </pre></div>
  13973. <dl compact="compact">
  13974. <dt><samp>min_seg_duration <var>microseconds</var></samp></dt>
  13975. <dd><p>This is a deprecated option to set the segment length in microseconds, use <var>seg_duration</var> instead.
  13976. </p></dd>
  13977. <dt><samp>seg_duration <var>duration</var></samp></dt>
  13978. <dd><p>Set the segment length in seconds (fractional value can be set). The value is
  13979. treated as average segment duration when <var>use_template</var> is enabled and
  13980. <var>use_timeline</var> is disabled and as minimum segment duration for all the other
  13981. use cases.
  13982. </p></dd>
  13983. <dt><samp>frag_duration <var>duration</var></samp></dt>
  13984. <dd><p>Set the length in seconds of fragments within segments (fractional value can be set).
  13985. </p></dd>
  13986. <dt><samp>frag_type <var>type</var></samp></dt>
  13987. <dd><p>Set the type of interval for fragmentation.
  13988. </p></dd>
  13989. <dt><samp>window_size <var>size</var></samp></dt>
  13990. <dd><p>Set the maximum number of segments kept in the manifest.
  13991. </p></dd>
  13992. <dt><samp>extra_window_size <var>size</var></samp></dt>
  13993. <dd><p>Set the maximum number of segments kept outside of the manifest before removing from disk.
  13994. </p></dd>
  13995. <dt><samp>remove_at_exit <var>remove</var></samp></dt>
  13996. <dd><p>Enable (1) or disable (0) removal of all segments when finished.
  13997. </p></dd>
  13998. <dt><samp>use_template <var>template</var></samp></dt>
  13999. <dd><p>Enable (1) or disable (0) use of SegmentTemplate instead of SegmentList.
  14000. </p></dd>
  14001. <dt><samp>use_timeline <var>timeline</var></samp></dt>
  14002. <dd><p>Enable (1) or disable (0) use of SegmentTimeline in SegmentTemplate.
  14003. </p></dd>
  14004. <dt><samp>single_file <var>single_file</var></samp></dt>
  14005. <dd><p>Enable (1) or disable (0) storing all segments in one file, accessed using byte ranges.
  14006. </p></dd>
  14007. <dt><samp>single_file_name <var>file_name</var></samp></dt>
  14008. <dd><p>DASH-templated name to be used for baseURL. Implies <var>single_file</var> set to &quot;1&quot;. In the template, &quot;$ext$&quot; is replaced with the file name extension specific for the segment format.
  14009. </p></dd>
  14010. <dt><samp>init_seg_name <var>init_name</var></samp></dt>
  14011. <dd><p>DASH-templated name to used for the initialization segment. Default is &quot;init-stream$RepresentationID$.$ext$&quot;. &quot;$ext$&quot; is replaced with the file name extension specific for the segment format.
  14012. </p></dd>
  14013. <dt><samp>media_seg_name <var>segment_name</var></samp></dt>
  14014. <dd><p>DASH-templated name to used for the media segments. Default is &quot;chunk-stream$RepresentationID$-$Number%05d$.$ext$&quot;. &quot;$ext$&quot; is replaced with the file name extension specific for the segment format.
  14015. </p></dd>
  14016. <dt><samp>utc_timing_url <var>utc_url</var></samp></dt>
  14017. <dd><p>URL of the page that will return the UTC timestamp in ISO format. Example: &quot;https://time.akamai.com/?iso&quot;
  14018. </p></dd>
  14019. <dt><samp>method <var>method</var></samp></dt>
  14020. <dd><p>Use the given HTTP method to create output files. Generally set to PUT or POST.
  14021. </p></dd>
  14022. <dt><samp>http_user_agent <var>user_agent</var></samp></dt>
  14023. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP output.
  14024. </p></dd>
  14025. <dt><samp>http_persistent <var>http_persistent</var></samp></dt>
  14026. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  14027. </p></dd>
  14028. <dt><samp>hls_playlist <var>hls_playlist</var></samp></dt>
  14029. <dd><p>Generate HLS playlist files as well. The master playlist is generated with the filename <var>hls_master_name</var>.
  14030. One media playlist file is generated for each stream with filenames media_0.m3u8, media_1.m3u8, etc.
  14031. </p></dd>
  14032. <dt><samp>hls_master_name <var>file_name</var></samp></dt>
  14033. <dd><p>HLS master playlist name. Default is &quot;master.m3u8&quot;.
  14034. </p></dd>
  14035. <dt><samp>streaming <var>streaming</var></samp></dt>
  14036. <dd><p>Enable (1) or disable (0) chunk streaming mode of output. In chunk streaming
  14037. mode, each frame will be a moof fragment which forms a chunk.
  14038. </p></dd>
  14039. <dt><samp>adaptation_sets <var>adaptation_sets</var></samp></dt>
  14040. <dd><p>Assign streams to AdaptationSets. Syntax is &quot;id=x,streams=a,b,c id=y,streams=d,e&quot; with x and y being the IDs
  14041. of the adaptation sets and a,b,c,d and e are the indices of the mapped streams.
  14042. </p>
  14043. <p>To map all video (or audio) streams to an AdaptationSet, &quot;v&quot; (or &quot;a&quot;) can be used as stream identifier instead of IDs.
  14044. </p>
  14045. <p>When no assignment is defined, this defaults to an AdaptationSet for each stream.
  14046. </p>
  14047. <p>Optional syntax is &quot;id=x,seg_duration=x,frag_duration=x,frag_type=type,descriptor=descriptor_string,streams=a,b,c id=y,seg_duration=y,frag_type=type,streams=d,e&quot; and so on,
  14048. descriptor is useful to the scheme defined by ISO/IEC 23009-1:2014/Amd.2:2015.
  14049. For example, -adaptation_sets &quot;id=0,descriptor=&lt;SupplementalProperty schemeIdUri=\&quot;urn:mpeg:dash:srd:2014\&quot; value=\&quot;0,0,0,1,1,2,2\&quot;/&gt;,streams=v&quot;.
  14050. Please note that descriptor string should be a self-closing xml tag.
  14051. seg_duration, frag_duration and frag_type override the global option values for each adaptation set.
  14052. For example, -adaptation_sets &quot;id=0,seg_duration=2,frag_duration=1,frag_type=duration,streams=v id=1,seg_duration=2,frag_type=none,streams=a&quot;
  14053. type_id marks an adaptation set as containing streams meant to be used for Trick Mode for the referenced adaptation set.
  14054. For example, -adaptation_sets &quot;id=0,seg_duration=2,frag_type=none,streams=0 id=1,seg_duration=10,frag_type=none,trick_id=0,streams=1&quot;
  14055. </p></dd>
  14056. <dt><samp>timeout <var>timeout</var></samp></dt>
  14057. <dd><p>Set timeout for socket I/O operations. Applicable only for HTTP output.
  14058. </p></dd>
  14059. <dt><samp>index_correction <var>index_correction</var></samp></dt>
  14060. <dd><p>Enable (1) or Disable (0) segment index correction logic. Applicable only when
  14061. <var>use_template</var> is enabled and <var>use_timeline</var> is disabled.
  14062. </p>
  14063. <p>When enabled, the logic monitors the flow of segment indexes. If a streams&rsquo;s
  14064. segment index value is not at the expected real time position, then the logic
  14065. corrects that index value.
  14066. </p>
  14067. <p>Typically this logic is needed in live streaming use cases. The network bandwidth
  14068. fluctuations are common during long run streaming. Each fluctuation can cause
  14069. the segment indexes fall behind the expected real time position.
  14070. </p></dd>
  14071. <dt><samp>format_options <var>options_list</var></samp></dt>
  14072. <dd><p>Set container format (mp4/webm) options using a <code>:</code> separated list of
  14073. key=value parameters. Values containing <code>:</code> special characters must be
  14074. escaped.
  14075. </p>
  14076. </dd>
  14077. <dt><samp>global_sidx <var>global_sidx</var></samp></dt>
  14078. <dd><p>Write global SIDX atom. Applicable only for single file, mp4 output, non-streaming mode.
  14079. </p>
  14080. </dd>
  14081. <dt><samp>dash_segment_type <var>dash_segment_type</var></samp></dt>
  14082. <dd><p>Possible values:
  14083. </p><dl compact="compact">
  14084. <dt><samp>auto</samp></dt>
  14085. <dd><p>If this flag is set, the dash segment files format will be selected based on the stream codec. This is the default mode.
  14086. </p>
  14087. </dd>
  14088. <dt><samp>mp4</samp></dt>
  14089. <dd><p>If this flag is set, the dash segment files will be in in ISOBMFF format.
  14090. </p>
  14091. </dd>
  14092. <dt><samp>webm</samp></dt>
  14093. <dd><p>If this flag is set, the dash segment files will be in in WebM format.
  14094. </p></dd>
  14095. </dl>
  14096. </dd>
  14097. <dt><samp>ignore_io_errors <var>ignore_io_errors</var></samp></dt>
  14098. <dd><p>Ignore IO errors during open and write. Useful for long-duration runs with network output.
  14099. </p>
  14100. </dd>
  14101. <dt><samp>lhls <var>lhls</var></samp></dt>
  14102. <dd><p>Enable Low-latency HLS(LHLS). Adds #EXT-X-PREFETCH tag with current segment&rsquo;s URI.
  14103. Apple doesn&rsquo;t have an official spec for LHLS. Meanwhile hls.js player folks are
  14104. trying to standardize a open LHLS spec. The draft spec is available in https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md
  14105. This option will also try to comply with the above open spec, till Apple&rsquo;s spec officially supports it.
  14106. Applicable only when <var>streaming</var> and <var>hls_playlist</var> options are enabled.
  14107. This is an experimental feature.
  14108. </p>
  14109. </dd>
  14110. <dt><samp>ldash <var>ldash</var></samp></dt>
  14111. <dd><p>Enable Low-latency Dash by constraining the presence and values of some elements.
  14112. </p>
  14113. </dd>
  14114. <dt><samp>master_m3u8_publish_rate <var>master_m3u8_publish_rate</var></samp></dt>
  14115. <dd><p>Publish master playlist repeatedly every after specified number of segment intervals.
  14116. </p>
  14117. </dd>
  14118. <dt><samp>write_prft <var>write_prft</var></samp></dt>
  14119. <dd><p>Write Producer Reference Time elements on supported streams. This also enables writing
  14120. prft boxes in the underlying muxer. Applicable only when the <var>utc_url</var> option is enabled.
  14121. It&rsquo;s set to auto by default, in which case the muxer will attempt to enable it only in modes
  14122. that require it.
  14123. </p>
  14124. </dd>
  14125. <dt><samp>mpd_profile <var>mpd_profile</var></samp></dt>
  14126. <dd><p>Set one or more manifest profiles.
  14127. </p>
  14128. </dd>
  14129. <dt><samp>http_opts <var>http_opts</var></samp></dt>
  14130. <dd><p>A :-separated list of key=value options to pass to the underlying HTTP
  14131. protocol. Applicable only for HTTP output.
  14132. </p>
  14133. </dd>
  14134. <dt><samp>target_latency <var>target_latency</var></samp></dt>
  14135. <dd><p>Set an intended target latency in seconds (fractional value can be set) for serving. Applicable only when <var>streaming</var> and <var>write_prft</var> options are enabled.
  14136. This is an informative fields clients can use to measure the latency of the service.
  14137. </p>
  14138. </dd>
  14139. <dt><samp>min_playback_rate <var>min_playback_rate</var></samp></dt>
  14140. <dd><p>Set the minimum playback rate indicated as appropriate for the purposes of automatically
  14141. adjusting playback latency and buffer occupancy during normal playback by clients.
  14142. </p>
  14143. </dd>
  14144. <dt><samp>max_playback_rate <var>max_playback_rate</var></samp></dt>
  14145. <dd><p>Set the maximum playback rate indicated as appropriate for the purposes of automatically
  14146. adjusting playback latency and buffer occupancy during normal playback by clients.
  14147. </p>
  14148. </dd>
  14149. <dt><samp>update_period <var>update_period</var></samp></dt>
  14150. <dd><p>Set the mpd update period ,for dynamic content.
  14151. The unit is second.
  14152. </p>
  14153. </dd>
  14154. </dl>
  14155. <span id="framecrc"></span><a name="framecrc-1"></a>
  14156. <h3 class="section">21.8 framecrc<span class="pull-right"><a class="anchor hidden-xs" href="#framecrc-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framecrc-1" aria-hidden="true">TOC</a></span></h3>
  14157. <p>Per-packet CRC (Cyclic Redundancy Check) testing format.
  14158. </p>
  14159. <p>This muxer computes and prints the Adler-32 CRC for each audio
  14160. and video packet. By default audio frames are converted to signed
  14161. 16-bit raw audio and video frames to raw video before computing the
  14162. CRC.
  14163. </p>
  14164. <p>The output of the muxer consists of a line for each audio and video
  14165. packet of the form:
  14166. </p><div class="example">
  14167. <pre class="example"><var>stream_index</var>, <var>packet_dts</var>, <var>packet_pts</var>, <var>packet_duration</var>, <var>packet_size</var>, 0x<var>CRC</var>
  14168. </pre></div>
  14169. <p><var>CRC</var> is a hexadecimal number 0-padded to 8 digits containing the
  14170. CRC of the packet.
  14171. </p>
  14172. <a name="Examples-9"></a>
  14173. <h4 class="subsection">21.8.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-9" aria-hidden="true">TOC</a></span></h4>
  14174. <p>For example to compute the CRC of the audio and video frames in
  14175. <samp>INPUT</samp>, converted to raw audio and video packets, and store it
  14176. in the file <samp>out.crc</samp>:
  14177. </p><div class="example">
  14178. <pre class="example">ffmpeg -i INPUT -f framecrc out.crc
  14179. </pre></div>
  14180. <p>To print the information to stdout, use the command:
  14181. </p><div class="example">
  14182. <pre class="example">ffmpeg -i INPUT -f framecrc -
  14183. </pre></div>
  14184. <p>With <code>ffmpeg</code>, you can select the output format to which the
  14185. audio and video frames are encoded before computing the CRC for each
  14186. packet by specifying the audio and video codec. For example, to
  14187. compute the CRC of each decoded input audio frame converted to PCM
  14188. unsigned 8-bit and of each decoded input video frame converted to
  14189. MPEG-2 video, use the command:
  14190. </p><div class="example">
  14191. <pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
  14192. </pre></div>
  14193. <p>See also the <a href="#crc">crc</a> muxer.
  14194. </p>
  14195. <span id="framehash"></span><a name="framehash-1"></a>
  14196. <h3 class="section">21.9 framehash<span class="pull-right"><a class="anchor hidden-xs" href="#framehash-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framehash-1" aria-hidden="true">TOC</a></span></h3>
  14197. <p>Per-packet hash testing format.
  14198. </p>
  14199. <p>This muxer computes and prints a cryptographic hash for each audio
  14200. and video packet. This can be used for packet-by-packet equality
  14201. checks without having to individually do a binary comparison on each.
  14202. </p>
  14203. <p>By default audio frames are converted to signed 16-bit raw audio and
  14204. video frames to raw video before computing the hash, but the output
  14205. of explicit conversions to other codecs can also be used. It uses the
  14206. SHA-256 cryptographic hash function by default, but supports several
  14207. other algorithms.
  14208. </p>
  14209. <p>The output of the muxer consists of a line for each audio and video
  14210. packet of the form:
  14211. </p><div class="example">
  14212. <pre class="example"><var>stream_index</var>, <var>packet_dts</var>, <var>packet_pts</var>, <var>packet_duration</var>, <var>packet_size</var>, <var>hash</var>
  14213. </pre></div>
  14214. <p><var>hash</var> is a hexadecimal number representing the computed hash
  14215. for the packet.
  14216. </p>
  14217. <dl compact="compact">
  14218. <dt><samp>hash <var>algorithm</var></samp></dt>
  14219. <dd><p>Use the cryptographic hash function specified by the string <var>algorithm</var>.
  14220. Supported values include <code>MD5</code>, <code>murmur3</code>, <code>RIPEMD128</code>,
  14221. <code>RIPEMD160</code>, <code>RIPEMD256</code>, <code>RIPEMD320</code>, <code>SHA160</code>,
  14222. <code>SHA224</code>, <code>SHA256</code> (default), <code>SHA512/224</code>, <code>SHA512/256</code>,
  14223. <code>SHA384</code>, <code>SHA512</code>, <code>CRC32</code> and <code>adler32</code>.
  14224. </p>
  14225. </dd>
  14226. </dl>
  14227. <a name="Examples-10"></a>
  14228. <h4 class="subsection">21.9.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-10" aria-hidden="true">TOC</a></span></h4>
  14229. <p>To compute the SHA-256 hash of the audio and video frames in <samp>INPUT</samp>,
  14230. converted to raw audio and video packets, and store it in the file
  14231. <samp>out.sha256</samp>:
  14232. </p><div class="example">
  14233. <pre class="example">ffmpeg -i INPUT -f framehash out.sha256
  14234. </pre></div>
  14235. <p>To print the information to stdout, using the MD5 hash function, use
  14236. the command:
  14237. </p><div class="example">
  14238. <pre class="example">ffmpeg -i INPUT -f framehash -hash md5 -
  14239. </pre></div>
  14240. <p>See also the <a href="#hash">hash</a> muxer.
  14241. </p>
  14242. <span id="framemd5"></span><a name="framemd5-1"></a>
  14243. <h3 class="section">21.10 framemd5<span class="pull-right"><a class="anchor hidden-xs" href="#framemd5-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framemd5-1" aria-hidden="true">TOC</a></span></h3>
  14244. <p>Per-packet MD5 testing format.
  14245. </p>
  14246. <p>This is a variant of the <a href="#framehash">framehash</a> muxer. Unlike that muxer,
  14247. it defaults to using the MD5 hash function.
  14248. </p>
  14249. <a name="Examples-11"></a>
  14250. <h4 class="subsection">21.10.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-11" aria-hidden="true">TOC</a></span></h4>
  14251. <p>To compute the MD5 hash of the audio and video frames in <samp>INPUT</samp>,
  14252. converted to raw audio and video packets, and store it in the file
  14253. <samp>out.md5</samp>:
  14254. </p><div class="example">
  14255. <pre class="example">ffmpeg -i INPUT -f framemd5 out.md5
  14256. </pre></div>
  14257. <p>To print the information to stdout, use the command:
  14258. </p><div class="example">
  14259. <pre class="example">ffmpeg -i INPUT -f framemd5 -
  14260. </pre></div>
  14261. <p>See also the <a href="#framehash">framehash</a> and <a href="#md5">md5</a> muxers.
  14262. </p>
  14263. <span id="gif"></span><a name="gif-2"></a>
  14264. <h3 class="section">21.11 gif<span class="pull-right"><a class="anchor hidden-xs" href="#gif-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gif-2" aria-hidden="true">TOC</a></span></h3>
  14265. <p>Animated GIF muxer.
  14266. </p>
  14267. <p>It accepts the following options:
  14268. </p>
  14269. <dl compact="compact">
  14270. <dt><samp>loop</samp></dt>
  14271. <dd><p>Set the number of times to loop the output. Use <code>-1</code> for no loop, <code>0</code>
  14272. for looping indefinitely (default).
  14273. </p>
  14274. </dd>
  14275. <dt><samp>final_delay</samp></dt>
  14276. <dd><p>Force the delay (expressed in centiseconds) after the last frame. Each frame
  14277. ends with a delay until the next frame. The default is <code>-1</code>, which is a
  14278. special value to tell the muxer to re-use the previous delay. In case of a
  14279. loop, you might want to customize this value to mark a pause for instance.
  14280. </p></dd>
  14281. </dl>
  14282. <p>For example, to encode a gif looping 10 times, with a 5 seconds delay between
  14283. the loops:
  14284. </p><div class="example">
  14285. <pre class="example">ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
  14286. </pre></div>
  14287. <p>Note 1: if you wish to extract the frames into separate GIF files, you need to
  14288. force the <a href="#image2">image2</a> muxer:
  14289. </p><div class="example">
  14290. <pre class="example">ffmpeg -i INPUT -c:v gif -f image2 &quot;out%d.gif&quot;
  14291. </pre></div>
  14292. <p>Note 2: the GIF format has a very large time base: the delay between two frames
  14293. can therefore not be smaller than one centi second.
  14294. </p>
  14295. <span id="hash"></span><a name="hash-1"></a>
  14296. <h3 class="section">21.12 hash<span class="pull-right"><a class="anchor hidden-xs" href="#hash-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hash-1" aria-hidden="true">TOC</a></span></h3>
  14297. <p>Hash testing format.
  14298. </p>
  14299. <p>This muxer computes and prints a cryptographic hash of all the input
  14300. audio and video frames. This can be used for equality checks without
  14301. having to do a complete binary comparison.
  14302. </p>
  14303. <p>By default audio frames are converted to signed 16-bit raw audio and
  14304. video frames to raw video before computing the hash, but the output
  14305. of explicit conversions to other codecs can also be used. Timestamps
  14306. are ignored. It uses the SHA-256 cryptographic hash function by default,
  14307. but supports several other algorithms.
  14308. </p>
  14309. <p>The output of the muxer consists of a single line of the form:
  14310. <var>algo</var>=<var>hash</var>, where <var>algo</var> is a short string representing
  14311. the hash function used, and <var>hash</var> is a hexadecimal number
  14312. representing the computed hash.
  14313. </p>
  14314. <dl compact="compact">
  14315. <dt><samp>hash <var>algorithm</var></samp></dt>
  14316. <dd><p>Use the cryptographic hash function specified by the string <var>algorithm</var>.
  14317. Supported values include <code>MD5</code>, <code>murmur3</code>, <code>RIPEMD128</code>,
  14318. <code>RIPEMD160</code>, <code>RIPEMD256</code>, <code>RIPEMD320</code>, <code>SHA160</code>,
  14319. <code>SHA224</code>, <code>SHA256</code> (default), <code>SHA512/224</code>, <code>SHA512/256</code>,
  14320. <code>SHA384</code>, <code>SHA512</code>, <code>CRC32</code> and <code>adler32</code>.
  14321. </p>
  14322. </dd>
  14323. </dl>
  14324. <a name="Examples-12"></a>
  14325. <h4 class="subsection">21.12.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-12" aria-hidden="true">TOC</a></span></h4>
  14326. <p>To compute the SHA-256 hash of the input converted to raw audio and
  14327. video, and store it in the file <samp>out.sha256</samp>:
  14328. </p><div class="example">
  14329. <pre class="example">ffmpeg -i INPUT -f hash out.sha256
  14330. </pre></div>
  14331. <p>To print an MD5 hash to stdout use the command:
  14332. </p><div class="example">
  14333. <pre class="example">ffmpeg -i INPUT -f hash -hash md5 -
  14334. </pre></div>
  14335. <p>See also the <a href="#framehash">framehash</a> muxer.
  14336. </p>
  14337. <span id="hls"></span><a name="hls-2"></a>
  14338. <h3 class="section">21.13 hls<span class="pull-right"><a class="anchor hidden-xs" href="#hls-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hls-2" aria-hidden="true">TOC</a></span></h3>
  14339. <p>Apple HTTP Live Streaming muxer that segments MPEG-TS according to
  14340. the HTTP Live Streaming (HLS) specification.
  14341. </p>
  14342. <p>It creates a playlist file, and one or more segment files. The output filename
  14343. specifies the playlist filename.
  14344. </p>
  14345. <p>By default, the muxer creates a file for each segment produced. These files
  14346. have the same name as the playlist, followed by a sequential number and a
  14347. .ts extension.
  14348. </p>
  14349. <p>Make sure to require a closed GOP when encoding and to set the GOP
  14350. size to fit your segment time constraint.
  14351. </p>
  14352. <p>For example, to convert an input file with <code>ffmpeg</code>:
  14353. </p><div class="example">
  14354. <pre class="example">ffmpeg -i in.mkv -c:v h264 -flags +cgop -g 30 -hls_time 1 out.m3u8
  14355. </pre></div>
  14356. <p>This example will produce the playlist, <samp>out.m3u8</samp>, and segment files:
  14357. <samp>out0.ts</samp>, <samp>out1.ts</samp>, <samp>out2.ts</samp>, etc.
  14358. </p>
  14359. <p>See also the <a href="#segment">segment</a> muxer, which provides a more generic and
  14360. flexible implementation of a segmenter, and can be used to perform HLS
  14361. segmentation.
  14362. </p>
  14363. <a name="Options-46"></a>
  14364. <h4 class="subsection">21.13.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-46" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-46" aria-hidden="true">TOC</a></span></h4>
  14365. <p>This muxer supports the following options:
  14366. </p>
  14367. <dl compact="compact">
  14368. <dt><samp>hls_init_time <var>duration</var></samp></dt>
  14369. <dd><p>Set the initial target segment length. Default value is <var>0</var>.
  14370. </p>
  14371. <p><var>duration</var> must be a time duration specification,
  14372. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  14373. </p>
  14374. <p>Segment will be cut on the next key frame after this time has passed on the first m3u8 list.
  14375. After the initial playlist is filled <code>ffmpeg</code> will cut segments
  14376. at duration equal to <code>hls_time</code>
  14377. </p>
  14378. </dd>
  14379. <dt><samp>hls_time <var>duration</var></samp></dt>
  14380. <dd><p>Set the target segment length. Default value is 2.
  14381. </p>
  14382. <p><var>duration</var> must be a time duration specification,
  14383. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  14384. Segment will be cut on the next key frame after this time has passed.
  14385. </p>
  14386. </dd>
  14387. <dt><samp>hls_list_size <var>size</var></samp></dt>
  14388. <dd><p>Set the maximum number of playlist entries. If set to 0 the list file
  14389. will contain all the segments. Default value is 5.
  14390. </p>
  14391. </dd>
  14392. <dt><samp>hls_delete_threshold <var>size</var></samp></dt>
  14393. <dd><p>Set the number of unreferenced segments to keep on disk before <code>hls_flags delete_segments</code>
  14394. deletes them. Increase this to allow continue clients to download segments which
  14395. were recently referenced in the playlist. Default value is 1, meaning segments older than
  14396. <code>hls_list_size+1</code> will be deleted.
  14397. </p>
  14398. </dd>
  14399. <dt><samp>hls_ts_options <var>options_list</var></samp></dt>
  14400. <dd><p>Set output format options using a :-separated list of key=value
  14401. parameters. Values containing <code>:</code> special characters must be
  14402. escaped.
  14403. </p>
  14404. </dd>
  14405. <dt><samp>hls_wrap <var>wrap</var></samp></dt>
  14406. <dd><p>This is a deprecated option, you can use <code>hls_list_size</code>
  14407. and <code>hls_flags delete_segments</code> instead it
  14408. </p>
  14409. <p>This option is useful to avoid to fill the disk with many segment
  14410. files, and limits the maximum number of segment files written to disk
  14411. to <var>wrap</var>.
  14412. </p>
  14413. </dd>
  14414. <dt><samp>hls_start_number_source</samp></dt>
  14415. <dd><p>Start the playlist sequence number (<code>#EXT-X-MEDIA-SEQUENCE</code>) according to the specified source.
  14416. Unless <code>hls_flags single_file</code> is set, it also specifies source of starting sequence numbers of
  14417. segment and subtitle filenames. In any case, if <code>hls_flags append_list</code>
  14418. is set and read playlist sequence number is greater than the specified start sequence number,
  14419. then that value will be used as start value.
  14420. </p>
  14421. <p>It accepts the following values:
  14422. </p>
  14423. <dl compact="compact">
  14424. <dt><samp>generic (default)</samp></dt>
  14425. <dd><p>Set the starting sequence numbers according to <var>start_number</var> option value.
  14426. </p>
  14427. </dd>
  14428. <dt><samp>epoch</samp></dt>
  14429. <dd><p>The start number will be the seconds since epoch (1970-01-01 00:00:00)
  14430. </p>
  14431. </dd>
  14432. <dt><samp>epoch_us</samp></dt>
  14433. <dd><p>The start number will be the microseconds since epoch (1970-01-01 00:00:00)
  14434. </p>
  14435. </dd>
  14436. <dt><samp>datetime</samp></dt>
  14437. <dd><p>The start number will be based on the current date/time as YYYYmmddHHMMSS. e.g. 20161231235759.
  14438. </p>
  14439. </dd>
  14440. </dl>
  14441. </dd>
  14442. <dt><samp>start_number <var>number</var></samp></dt>
  14443. <dd><p>Start the playlist sequence number (<code>#EXT-X-MEDIA-SEQUENCE</code>) from the specified <var>number</var>
  14444. when <var>hls_start_number_source</var> value is <var>generic</var>. (This is the default case.)
  14445. Unless <code>hls_flags single_file</code> is set, it also specifies starting sequence numbers of segment and subtitle filenames.
  14446. Default value is 0.
  14447. </p>
  14448. </dd>
  14449. <dt><samp>hls_allow_cache <var>allowcache</var></samp></dt>
  14450. <dd><p>Explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments.
  14451. </p>
  14452. </dd>
  14453. <dt><samp>hls_base_url <var>baseurl</var></samp></dt>
  14454. <dd><p>Append <var>baseurl</var> to every entry in the playlist.
  14455. Useful to generate playlists with absolute paths.
  14456. </p>
  14457. <p>Note that the playlist sequence number must be unique for each segment
  14458. and it is not to be confused with the segment filename sequence number
  14459. which can be cyclic, for example if the <samp>wrap</samp> option is
  14460. specified.
  14461. </p>
  14462. </dd>
  14463. <dt><samp>hls_segment_filename <var>filename</var></samp></dt>
  14464. <dd><p>Set the segment filename. Unless <code>hls_flags single_file</code> is set,
  14465. <var>filename</var> is used as a string format with the segment number:
  14466. </p><div class="example">
  14467. <pre class="example">ffmpeg -i in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
  14468. </pre></div>
  14469. <p>This example will produce the playlist, <samp>out.m3u8</samp>, and segment files:
  14470. <samp>file000.ts</samp>, <samp>file001.ts</samp>, <samp>file002.ts</samp>, etc.
  14471. </p>
  14472. <p><var>filename</var> may contain full path or relative path specification,
  14473. but only the file name part without any path info will be contained in the m3u8 segment list.
  14474. Should a relative path be specified, the path of the created segment
  14475. files will be relative to the current working directory.
  14476. When strftime_mkdir is set, the whole expanded value of <var>filename</var> will be written into the m3u8 segment list.
  14477. </p>
  14478. <p>When <code>var_stream_map</code> is set with two or more variant streams, the
  14479. <var>filename</var> pattern must contain the string &quot;%v&quot;, this string specifies
  14480. the position of variant stream index in the generated segment file names.
  14481. </p><div class="example">
  14482. <pre class="example">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  14483. -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; \
  14484. -hls_segment_filename 'file_%v_%03d.ts' out_%v.m3u8
  14485. </pre></div>
  14486. <p>This example will produce the playlists segment file sets:
  14487. <samp>file_0_000.ts</samp>, <samp>file_0_001.ts</samp>, <samp>file_0_002.ts</samp>, etc. and
  14488. <samp>file_1_000.ts</samp>, <samp>file_1_001.ts</samp>, <samp>file_1_002.ts</samp>, etc.
  14489. </p>
  14490. <p>The string &quot;%v&quot; may be present in the filename or in the last directory name
  14491. containing the file, but only in one of them. (Additionally, %v may appear multiple times in the last
  14492. sub-directory or filename.) If the string %v is present in the directory name, then
  14493. sub-directories are created after expanding the directory name pattern. This
  14494. enables creation of segments corresponding to different variant streams in
  14495. subdirectories.
  14496. </p><div class="example">
  14497. <pre class="example">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  14498. -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; \
  14499. -hls_segment_filename 'vs%v/file_%03d.ts' vs%v/out.m3u8
  14500. </pre></div>
  14501. <p>This example will produce the playlists segment file sets:
  14502. <samp>vs0/file_000.ts</samp>, <samp>vs0/file_001.ts</samp>, <samp>vs0/file_002.ts</samp>, etc. and
  14503. <samp>vs1/file_000.ts</samp>, <samp>vs1/file_001.ts</samp>, <samp>vs1/file_002.ts</samp>, etc.
  14504. </p>
  14505. </dd>
  14506. <dt><samp>use_localtime</samp></dt>
  14507. <dd><p>Same as strftime option, will be deprecated.
  14508. </p>
  14509. </dd>
  14510. <dt><samp>strftime</samp></dt>
  14511. <dd><p>Use strftime() on <var>filename</var> to expand the segment filename with localtime.
  14512. The segment number is also available in this mode, but to use it, you need to specify second_level_segment_index
  14513. hls_flag and %%d will be the specifier.
  14514. </p><div class="example">
  14515. <pre class="example">ffmpeg -i in.nut -strftime 1 -hls_segment_filename 'file-%Y%m%d-%s.ts' out.m3u8
  14516. </pre></div>
  14517. <p>This example will produce the playlist, <samp>out.m3u8</samp>, and segment files:
  14518. <samp>file-20160215-1455569023.ts</samp>, <samp>file-20160215-1455569024.ts</samp>, etc.
  14519. Note: On some systems/environments, the <code>%s</code> specifier is not available. See
  14520. <code>strftime()</code> documentation.
  14521. </p><div class="example">
  14522. <pre class="example">ffmpeg -i in.nut -strftime 1 -hls_flags second_level_segment_index -hls_segment_filename 'file-%Y%m%d-%%04d.ts' out.m3u8
  14523. </pre></div>
  14524. <p>This example will produce the playlist, <samp>out.m3u8</samp>, and segment files:
  14525. <samp>file-20160215-0001.ts</samp>, <samp>file-20160215-0002.ts</samp>, etc.
  14526. </p>
  14527. </dd>
  14528. <dt><samp>use_localtime_mkdir</samp></dt>
  14529. <dd><p>Same as strftime_mkdir option, will be deprecated .
  14530. </p>
  14531. </dd>
  14532. <dt><samp>strftime_mkdir</samp></dt>
  14533. <dd><p>Used together with -strftime_mkdir, it will create all subdirectories which
  14534. is expanded in <var>filename</var>.
  14535. </p><div class="example">
  14536. <pre class="example">ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y%m%d/file-%Y%m%d-%s.ts' out.m3u8
  14537. </pre></div>
  14538. <p>This example will create a directory 201560215 (if it does not exist), and then
  14539. produce the playlist, <samp>out.m3u8</samp>, and segment files:
  14540. <samp>20160215/file-20160215-1455569023.ts</samp>, <samp>20160215/file-20160215-1455569024.ts</samp>, etc.
  14541. </p>
  14542. <div class="example">
  14543. <pre class="example">ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y/%m/%d/file-%Y%m%d-%s.ts' out.m3u8
  14544. </pre></div>
  14545. <p>This example will create a directory hierarchy 2016/02/15 (if any of them do not exist), and then
  14546. produce the playlist, <samp>out.m3u8</samp>, and segment files:
  14547. <samp>2016/02/15/file-20160215-1455569023.ts</samp>, <samp>2016/02/15/file-20160215-1455569024.ts</samp>, etc.
  14548. </p>
  14549. </dd>
  14550. <dt><samp>hls_key_info_file <var>key_info_file</var></samp></dt>
  14551. <dd><p>Use the information in <var>key_info_file</var> for segment encryption. The first
  14552. line of <var>key_info_file</var> specifies the key URI written to the playlist. The
  14553. key URL is used to access the encryption key during playback. The second line
  14554. specifies the path to the key file used to obtain the key during the encryption
  14555. process. The key file is read as a single packed array of 16 octets in binary
  14556. format. The optional third line specifies the initialization vector (IV) as a
  14557. hexadecimal string to be used instead of the segment sequence number (default)
  14558. for encryption. Changes to <var>key_info_file</var> will result in segment
  14559. encryption with the new key/IV and an entry in the playlist for the new key
  14560. URI/IV if <code>hls_flags periodic_rekey</code> is enabled.
  14561. </p>
  14562. <p>Key info file format:
  14563. </p><div class="example">
  14564. <pre class="example"><var>key URI</var>
  14565. <var>key file path</var>
  14566. <var>IV</var> (optional)
  14567. </pre></div>
  14568. <p>Example key URIs:
  14569. </p><div class="example">
  14570. <pre class="example">http://server/file.key
  14571. /path/to/file.key
  14572. file.key
  14573. </pre></div>
  14574. <p>Example key file paths:
  14575. </p><div class="example">
  14576. <pre class="example">file.key
  14577. /path/to/file.key
  14578. </pre></div>
  14579. <p>Example IV:
  14580. </p><div class="example">
  14581. <pre class="example">0123456789ABCDEF0123456789ABCDEF
  14582. </pre></div>
  14583. <p>Key info file example:
  14584. </p><div class="example">
  14585. <pre class="example">http://server/file.key
  14586. /path/to/file.key
  14587. 0123456789ABCDEF0123456789ABCDEF
  14588. </pre></div>
  14589. <p>Example shell script:
  14590. </p><div class="example">
  14591. <pre class="example">#!/bin/sh
  14592. BASE_URL=${1:-'.'}
  14593. openssl rand 16 &gt; file.key
  14594. echo $BASE_URL/file.key &gt; file.keyinfo
  14595. echo file.key &gt;&gt; file.keyinfo
  14596. echo $(openssl rand -hex 16) &gt;&gt; file.keyinfo
  14597. ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
  14598. -hls_key_info_file file.keyinfo out.m3u8
  14599. </pre></div>
  14600. </dd>
  14601. <dt><samp>-hls_enc <var>enc</var></samp></dt>
  14602. <dd><p>Enable (1) or disable (0) the AES128 encryption.
  14603. When enabled every segment generated is encrypted and the encryption key
  14604. is saved as <var>playlist name</var>.key.
  14605. </p>
  14606. </dd>
  14607. <dt><samp>-hls_enc_key <var>key</var></samp></dt>
  14608. <dd><p>16-octet key to encrypt the segments, by default it
  14609. is randomly generated.
  14610. </p>
  14611. </dd>
  14612. <dt><samp>-hls_enc_key_url <var>keyurl</var></samp></dt>
  14613. <dd><p>If set, <var>keyurl</var> is prepended instead of <var>baseurl</var> to the key filename
  14614. in the playlist.
  14615. </p>
  14616. </dd>
  14617. <dt><samp>-hls_enc_iv <var>iv</var></samp></dt>
  14618. <dd><p>16-octet initialization vector for every segment instead
  14619. of the autogenerated ones.
  14620. </p>
  14621. </dd>
  14622. <dt><samp>hls_segment_type <var>flags</var></samp></dt>
  14623. <dd><p>Possible values:
  14624. </p>
  14625. <dl compact="compact">
  14626. <dt>&lsquo;<samp>mpegts</samp>&rsquo;</dt>
  14627. <dd><p>Output segment files in MPEG-2 Transport Stream format. This is
  14628. compatible with all HLS versions.
  14629. </p>
  14630. </dd>
  14631. <dt>&lsquo;<samp>fmp4</samp>&rsquo;</dt>
  14632. <dd><p>Output segment files in fragmented MP4 format, similar to MPEG-DASH.
  14633. fmp4 files may be used in HLS version 7 and above.
  14634. </p>
  14635. </dd>
  14636. </dl>
  14637. </dd>
  14638. <dt><samp>hls_fmp4_init_filename <var>filename</var></samp></dt>
  14639. <dd><p>Set filename to the fragment files header file, default filename is <samp>init.mp4</samp>.
  14640. </p>
  14641. <p>Use <code>-strftime 1</code> on <var>filename</var> to expand the segment filename with localtime.
  14642. </p><div class="example">
  14643. <pre class="example">ffmpeg -i in.nut -hls_segment_type fmp4 -strftime 1 -hls_fmp4_init_filename &quot;%s_init.mp4&quot; out.m3u8
  14644. </pre></div>
  14645. <p>This will produce init like this
  14646. <samp>1602678741_init.mp4</samp>
  14647. </p>
  14648. </dd>
  14649. <dt><samp>hls_fmp4_init_resend</samp></dt>
  14650. <dd><p>Resend init file after m3u8 file refresh every time, default is <var>0</var>.
  14651. </p>
  14652. <p>When <code>var_stream_map</code> is set with two or more variant streams, the
  14653. <var>filename</var> pattern must contain the string &quot;%v&quot;, this string specifies
  14654. the position of variant stream index in the generated init file names.
  14655. The string &quot;%v&quot; may be present in the filename or in the last directory name
  14656. containing the file. If the string is present in the directory name, then
  14657. sub-directories are created after expanding the directory name pattern. This
  14658. enables creation of init files corresponding to different variant streams in
  14659. subdirectories.
  14660. </p>
  14661. </dd>
  14662. <dt><samp>hls_flags <var>flags</var></samp></dt>
  14663. <dd><p>Possible values:
  14664. </p>
  14665. <dl compact="compact">
  14666. <dt>&lsquo;<samp>single_file</samp>&rsquo;</dt>
  14667. <dd><p>If this flag is set, the muxer will store all segments in a single MPEG-TS
  14668. file, and will use byte ranges in the playlist. HLS playlists generated with
  14669. this way will have the version number 4.
  14670. For example:
  14671. </p><div class="example">
  14672. <pre class="example">ffmpeg -i in.nut -hls_flags single_file out.m3u8
  14673. </pre></div>
  14674. <p>Will produce the playlist, <samp>out.m3u8</samp>, and a single segment file,
  14675. <samp>out.ts</samp>.
  14676. </p>
  14677. </dd>
  14678. <dt>&lsquo;<samp>delete_segments</samp>&rsquo;</dt>
  14679. <dd><p>Segment files removed from the playlist are deleted after a period of time
  14680. equal to the duration of the segment plus the duration of the playlist.
  14681. </p>
  14682. </dd>
  14683. <dt>&lsquo;<samp>append_list</samp>&rsquo;</dt>
  14684. <dd><p>Append new segments into the end of old segment list,
  14685. and remove the <code>#EXT-X-ENDLIST</code> from the old segment list.
  14686. </p>
  14687. </dd>
  14688. <dt>&lsquo;<samp>round_durations</samp>&rsquo;</dt>
  14689. <dd><p>Round the duration info in the playlist file segment info to integer
  14690. values, instead of using floating point.
  14691. </p>
  14692. </dd>
  14693. <dt>&lsquo;<samp>discont_start</samp>&rsquo;</dt>
  14694. <dd><p>Add the <code>#EXT-X-DISCONTINUITY</code> tag to the playlist, before the
  14695. first segment&rsquo;s information.
  14696. </p>
  14697. </dd>
  14698. <dt>&lsquo;<samp>omit_endlist</samp>&rsquo;</dt>
  14699. <dd><p>Do not append the <code>EXT-X-ENDLIST</code> tag at the end of the playlist.
  14700. </p>
  14701. </dd>
  14702. <dt>&lsquo;<samp>periodic_rekey</samp>&rsquo;</dt>
  14703. <dd><p>The file specified by <code>hls_key_info_file</code> will be checked periodically and
  14704. detect updates to the encryption info. Be sure to replace this file atomically,
  14705. including the file containing the AES encryption key.
  14706. </p>
  14707. </dd>
  14708. <dt>&lsquo;<samp>independent_segments</samp>&rsquo;</dt>
  14709. <dd><p>Add the <code>#EXT-X-INDEPENDENT-SEGMENTS</code> to playlists that has video segments
  14710. and when all the segments of that playlist are guaranteed to start with a Key frame.
  14711. </p>
  14712. </dd>
  14713. <dt>&lsquo;<samp>iframes_only</samp>&rsquo;</dt>
  14714. <dd><p>Add the <code>#EXT-X-I-FRAMES-ONLY</code> to playlists that has video segments
  14715. and can play only I-frames in the <code>#EXT-X-BYTERANGE</code> mode.
  14716. </p>
  14717. </dd>
  14718. <dt>&lsquo;<samp>split_by_time</samp>&rsquo;</dt>
  14719. <dd><p>Allow segments to start on frames other than keyframes. This improves
  14720. behavior on some players when the time between keyframes is inconsistent,
  14721. but may make things worse on others, and can cause some oddities during
  14722. seeking. This flag should be used with the <code>hls_time</code> option.
  14723. </p>
  14724. </dd>
  14725. <dt>&lsquo;<samp>program_date_time</samp>&rsquo;</dt>
  14726. <dd><p>Generate <code>EXT-X-PROGRAM-DATE-TIME</code> tags.
  14727. </p>
  14728. </dd>
  14729. <dt>&lsquo;<samp>second_level_segment_index</samp>&rsquo;</dt>
  14730. <dd><p>Makes it possible to use segment indexes as %%d in hls_segment_filename expression
  14731. besides date/time values when strftime is on.
  14732. To get fixed width numbers with trailing zeroes, %%0xd format is available where x is the required width.
  14733. </p>
  14734. </dd>
  14735. <dt>&lsquo;<samp>second_level_segment_size</samp>&rsquo;</dt>
  14736. <dd><p>Makes it possible to use segment sizes (counted in bytes) as %%s in hls_segment_filename
  14737. expression besides date/time values when strftime is on.
  14738. To get fixed width numbers with trailing zeroes, %%0xs format is available where x is the required width.
  14739. </p>
  14740. </dd>
  14741. <dt>&lsquo;<samp>second_level_segment_duration</samp>&rsquo;</dt>
  14742. <dd><p>Makes it possible to use segment duration (calculated in microseconds) as %%t in hls_segment_filename
  14743. expression besides date/time values when strftime is on.
  14744. To get fixed width numbers with trailing zeroes, %%0xt format is available where x is the required width.
  14745. </p>
  14746. <div class="example">
  14747. <pre class="example">ffmpeg -i sample.mpeg \
  14748. -f hls -hls_time 3 -hls_list_size 5 \
  14749. -hls_flags second_level_segment_index+second_level_segment_size+second_level_segment_duration \
  14750. -strftime 1 -strftime_mkdir 1 -hls_segment_filename &quot;segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts&quot; stream.m3u8
  14751. </pre></div>
  14752. <p>This will produce segments like this:
  14753. <samp>segment_20170102194334_0003_00122200_0000003000000.ts</samp>, <samp>segment_20170102194334_0004_00120072_0000003000000.ts</samp> etc.
  14754. </p>
  14755. </dd>
  14756. <dt>&lsquo;<samp>temp_file</samp>&rsquo;</dt>
  14757. <dd><p>Write segment data to filename.tmp and rename to filename only once the segment is complete. A webserver
  14758. serving up segments can be configured to reject requests to *.tmp to prevent access to in-progress segments
  14759. before they have been added to the m3u8 playlist. This flag also affects how m3u8 playlist files are created.
  14760. If this flag is set, all playlist files will written into temporary file and renamed after they are complete, similarly as segments are handled.
  14761. But playlists with <code>file</code> protocol and with type (<code>hls_playlist_type</code>) other than <code>vod</code>
  14762. are always written into temporary file regardless of this flag. Master playlist files (<code>master_pl_name</code>), if any, with <code>file</code> protocol,
  14763. are always written into temporary file regardless of this flag if <code>master_pl_publish_rate</code> value is other than zero.
  14764. </p>
  14765. </dd>
  14766. </dl>
  14767. </dd>
  14768. <dt><samp>hls_playlist_type event</samp></dt>
  14769. <dd><p>Emit <code>#EXT-X-PLAYLIST-TYPE:EVENT</code> in the m3u8 header. Forces
  14770. <samp>hls_list_size</samp> to 0; the playlist can only be appended to.
  14771. </p>
  14772. </dd>
  14773. <dt><samp>hls_playlist_type vod</samp></dt>
  14774. <dd><p>Emit <code>#EXT-X-PLAYLIST-TYPE:VOD</code> in the m3u8 header. Forces
  14775. <samp>hls_list_size</samp> to 0; the playlist must not change.
  14776. </p>
  14777. </dd>
  14778. <dt><samp>method</samp></dt>
  14779. <dd><p>Use the given HTTP method to create the hls files.
  14780. </p><div class="example">
  14781. <pre class="example">ffmpeg -re -i in.ts -f hls -method PUT http://example.com/live/out.m3u8
  14782. </pre></div>
  14783. <p>This example will upload all the mpegts segment files to the HTTP
  14784. server using the HTTP PUT method, and update the m3u8 files every
  14785. <code>refresh</code> times using the same method.
  14786. Note that the HTTP server must support the given method for uploading
  14787. files.
  14788. </p>
  14789. </dd>
  14790. <dt><samp>http_user_agent</samp></dt>
  14791. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP output.
  14792. </p>
  14793. </dd>
  14794. <dt><samp>var_stream_map</samp></dt>
  14795. <dd><p>Map string which specifies how to group the audio, video and subtitle streams
  14796. into different variant streams. The variant stream groups are separated
  14797. by space.
  14798. Expected string format is like this &quot;a:0,v:0 a:1,v:1 ....&quot;. Here a:, v:, s: are
  14799. the keys to specify audio, video and subtitle streams respectively.
  14800. Allowed values are 0 to 9 (limited just based on practical usage).
  14801. </p>
  14802. <p>When there are two or more variant streams, the output filename pattern must
  14803. contain the string &quot;%v&quot;, this string specifies the position of variant stream
  14804. index in the output media playlist filenames. The string &quot;%v&quot; may be present in
  14805. the filename or in the last directory name containing the file. If the string is
  14806. present in the directory name, then sub-directories are created after expanding
  14807. the directory name pattern. This enables creation of variant streams in
  14808. subdirectories.
  14809. </p>
  14810. <div class="example">
  14811. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  14812. -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; \
  14813. http://example.com/live/out_%v.m3u8
  14814. </pre></div>
  14815. <p>This example creates two hls variant streams. The first variant stream will
  14816. contain video stream of bitrate 1000k and audio stream of bitrate 64k and the
  14817. second variant stream will contain video stream of bitrate 256k and audio
  14818. stream of bitrate 32k. Here, two media playlist with file names out_0.m3u8 and
  14819. out_1.m3u8 will be created. If you want something meaningful text instead of indexes
  14820. in result names, you may specify names for each or some of the variants
  14821. as in the following example.
  14822. </p>
  14823. <div class="example">
  14824. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  14825. -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; \
  14826. http://example.com/live/out_%v.m3u8
  14827. </pre></div>
  14828. <p>This example creates two hls variant streams as in the previous one.
  14829. But here, the two media playlist with file names out_my_hd.m3u8 and
  14830. out_my_sd.m3u8 will be created.
  14831. </p>
  14832. <div class="example">
  14833. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k \
  14834. -map 0:v -map 0:a -map 0:v -f hls -var_stream_map &quot;v:0 a:0 v:1&quot; \
  14835. http://example.com/live/out_%v.m3u8
  14836. </pre></div>
  14837. <p>This example creates three hls variant streams. The first variant stream will
  14838. be a video only stream with video bitrate 1000k, the second variant stream will
  14839. be an audio only stream with bitrate 64k and the third variant stream will be a
  14840. video only stream with bitrate 256k. Here, three media playlist with file names
  14841. out_0.m3u8, out_1.m3u8 and out_2.m3u8 will be created.
  14842. </p><div class="example">
  14843. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  14844. -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; \
  14845. http://example.com/live/vs_%v/out.m3u8
  14846. </pre></div>
  14847. <p>This example creates the variant streams in subdirectories. Here, the first
  14848. media playlist is created at <samp>http://example.com/live/vs_0/out.m3u8</samp> and
  14849. the second one at <samp>http://example.com/live/vs_1/out.m3u8</samp>.
  14850. </p><div class="example">
  14851. <pre class="example">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k -b:v:1 3000k \
  14852. -map 0:a -map 0:a -map 0:v -map 0:v -f hls \
  14853. -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; \
  14854. -master_pl_name master.m3u8 \
  14855. http://example.com/live/out_%v.m3u8
  14856. </pre></div>
  14857. <p>This example creates two audio only and two video only variant streams. In
  14858. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  14859. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  14860. and they are mapped to the two video only variant streams with audio group names
  14861. &rsquo;aud_low&rsquo; and &rsquo;aud_high&rsquo;.
  14862. </p>
  14863. <p>By default, a single hls variant containing all the encoded streams is created.
  14864. </p>
  14865. <div class="example">
  14866. <pre class="example">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  14867. -map 0:a -map 0:a -map 0:v -f hls \
  14868. -var_stream_map &quot;a:0,agroup:aud_low,default:yes a:1,agroup:aud_low v:0,agroup:aud_low&quot; \
  14869. -master_pl_name master.m3u8 \
  14870. http://example.com/live/out_%v.m3u8
  14871. </pre></div>
  14872. <p>This example creates two audio only and one video only variant streams. In
  14873. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  14874. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  14875. and they are mapped to the one video only variant streams with audio group name
  14876. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES.
  14877. </p>
  14878. <p>By default, a single hls variant containing all the encoded streams is created.
  14879. </p>
  14880. <div class="example">
  14881. <pre class="example">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  14882. -map 0:a -map 0:a -map 0:v -f hls \
  14883. -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; \
  14884. -master_pl_name master.m3u8 \
  14885. http://example.com/live/out_%v.m3u8
  14886. </pre></div>
  14887. <p>This example creates two audio only and one video only variant streams. In
  14888. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  14889. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  14890. and they are mapped to the one video only variant streams with audio group name
  14891. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES, and one audio
  14892. have and language is named ENG, the other audio language is named CHN.
  14893. </p>
  14894. <p>By default, a single hls variant containing all the encoded streams is created.
  14895. </p>
  14896. <div class="example">
  14897. <pre class="example">ffmpeg -y -i input_with_subtitle.mkv \
  14898. -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
  14899. -b:a:0 256k \
  14900. -c:s webvtt -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0 -map 0:s:0 \
  14901. -f hls -var_stream_map &quot;v:0,a:0,s:0,sgroup:subtitle&quot; \
  14902. -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \
  14903. 10 -master_pl_publish_rate 10 -hls_flags \
  14904. delete_segments+discont_start+split_by_time ./tmp/video.m3u8
  14905. </pre></div>
  14906. <p>This example adds <code>#EXT-X-MEDIA</code> tag with <code>TYPE=SUBTITLES</code> in
  14907. the master playlist with webvtt subtitle group name &rsquo;subtitle&rsquo;. Please make sure
  14908. the input file has one text subtitle stream at least.
  14909. </p>
  14910. </dd>
  14911. <dt><samp>cc_stream_map</samp></dt>
  14912. <dd><p>Map string which specifies different closed captions groups and their
  14913. attributes. The closed captions stream groups are separated by space.
  14914. Expected string format is like this
  14915. &quot;ccgroup:&lt;group name&gt;,instreamid:&lt;INSTREAM-ID&gt;,language:&lt;language code&gt; ....&quot;.
  14916. &rsquo;ccgroup&rsquo; and &rsquo;instreamid&rsquo; are mandatory attributes. &rsquo;language&rsquo; is an optional
  14917. attribute.
  14918. The closed captions groups configured using this option are mapped to different
  14919. variant streams by providing the same &rsquo;ccgroup&rsquo; name in the
  14920. <code>var_stream_map</code> string. If <code>var_stream_map</code> is not set, then the
  14921. first available ccgroup in <code>cc_stream_map</code> is mapped to the output variant
  14922. stream. The examples for these two use cases are given below.
  14923. </p>
  14924. <div class="example">
  14925. <pre class="example">ffmpeg -re -i in.ts -b:v 1000k -b:a 64k -a53cc 1 -f hls \
  14926. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en&quot; \
  14927. -master_pl_name master.m3u8 \
  14928. http://example.com/live/out.m3u8
  14929. </pre></div>
  14930. <p>This example adds <code>#EXT-X-MEDIA</code> tag with <code>TYPE=CLOSED-CAPTIONS</code> in
  14931. the master playlist with group name &rsquo;cc&rsquo;, language &rsquo;en&rsquo; (english) and
  14932. INSTREAM-ID &rsquo;CC1&rsquo;. Also, it adds <code>CLOSED-CAPTIONS</code> attribute with group
  14933. name &rsquo;cc&rsquo; for the output variant stream.
  14934. </p><div class="example">
  14935. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  14936. -a53cc:0 1 -a53cc:1 1\
  14937. -map 0:v -map 0:a -map 0:v -map 0:a -f hls \
  14938. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en ccgroup:cc,instreamid:CC2,language:sp&quot; \
  14939. -var_stream_map &quot;v:0,a:0,ccgroup:cc v:1,a:1,ccgroup:cc&quot; \
  14940. -master_pl_name master.m3u8 \
  14941. http://example.com/live/out_%v.m3u8
  14942. </pre></div>
  14943. <p>This example adds two <code>#EXT-X-MEDIA</code> tags with <code>TYPE=CLOSED-CAPTIONS</code> in
  14944. the master playlist for the INSTREAM-IDs &rsquo;CC1&rsquo; and &rsquo;CC2&rsquo;. Also, it adds
  14945. <code>CLOSED-CAPTIONS</code> attribute with group name &rsquo;cc&rsquo; for the two output variant
  14946. streams.
  14947. </p>
  14948. </dd>
  14949. <dt><samp>master_pl_name</samp></dt>
  14950. <dd><p>Create HLS master playlist with the given name.
  14951. </p>
  14952. <div class="example">
  14953. <pre class="example">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 http://example.com/live/out.m3u8
  14954. </pre></div>
  14955. <p>This example creates HLS master playlist with name master.m3u8 and it is
  14956. published at http://example.com/live/
  14957. </p>
  14958. </dd>
  14959. <dt><samp>master_pl_publish_rate</samp></dt>
  14960. <dd><p>Publish master play list repeatedly every after specified number of segment intervals.
  14961. </p>
  14962. <div class="example">
  14963. <pre class="example">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 \
  14964. -hls_time 2 -master_pl_publish_rate 30 http://example.com/live/out.m3u8
  14965. </pre></div>
  14966. <p>This example creates HLS master playlist with name master.m3u8 and keep
  14967. publishing it repeatedly every after 30 segments i.e. every after 60s.
  14968. </p>
  14969. </dd>
  14970. <dt><samp>http_persistent</samp></dt>
  14971. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  14972. </p>
  14973. </dd>
  14974. <dt><samp>timeout</samp></dt>
  14975. <dd><p>Set timeout for socket I/O operations. Applicable only for HTTP output.
  14976. </p>
  14977. </dd>
  14978. <dt><samp>-ignore_io_errors</samp></dt>
  14979. <dd><p>Ignore IO errors during open, write and delete. Useful for long-duration runs with network output.
  14980. </p>
  14981. </dd>
  14982. <dt><samp>headers</samp></dt>
  14983. <dd><p>Set custom HTTP headers, can override built in default headers. Applicable only for HTTP output.
  14984. </p>
  14985. </dd>
  14986. </dl>
  14987. <span id="ico"></span><a name="ico-1"></a>
  14988. <h3 class="section">21.14 ico<span class="pull-right"><a class="anchor hidden-xs" href="#ico-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ico-1" aria-hidden="true">TOC</a></span></h3>
  14989. <p>ICO file muxer.
  14990. </p>
  14991. <p>Microsoft&rsquo;s icon file format (ICO) has some strict limitations that should be noted:
  14992. </p>
  14993. <ul>
  14994. <li> Size cannot exceed 256 pixels in any dimension
  14995. </li><li> Only BMP and PNG images can be stored
  14996. </li><li> If a BMP image is used, it must be one of the following pixel formats:
  14997. <div class="example">
  14998. <pre class="example">BMP Bit Depth FFmpeg Pixel Format
  14999. 1bit pal8
  15000. 4bit pal8
  15001. 8bit pal8
  15002. 16bit rgb555le
  15003. 24bit bgr24
  15004. 32bit bgra
  15005. </pre></div>
  15006. </li><li> If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
  15007. </li><li> If a PNG image is used, it must use the rgba pixel format
  15008. </li></ul>
  15009. <span id="image2"></span><a name="image2-2"></a>
  15010. <h3 class="section">21.15 image2<span class="pull-right"><a class="anchor hidden-xs" href="#image2-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-image2-2" aria-hidden="true">TOC</a></span></h3>
  15011. <p>Image file muxer.
  15012. </p>
  15013. <p>The image file muxer writes video frames to image files.
  15014. </p>
  15015. <p>The output filenames are specified by a pattern, which can be used to
  15016. produce sequentially numbered series of files.
  15017. The pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, this string
  15018. specifies the position of the characters representing a numbering in
  15019. the filenames. If the form &quot;%0<var>N</var>d&quot; is used, the string
  15020. representing the number in each filename is 0-padded to <var>N</var>
  15021. digits. The literal character &rsquo;%&rsquo; can be specified in the pattern with
  15022. the string &quot;%%&quot;.
  15023. </p>
  15024. <p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
  15025. the file list specified will contain the number 1, all the following
  15026. numbers will be sequential.
  15027. </p>
  15028. <p>The pattern may contain a suffix which is used to automatically
  15029. determine the format of the image files to write.
  15030. </p>
  15031. <p>For example the pattern &quot;img-%03d.bmp&quot; will specify a sequence of
  15032. filenames of the form <samp>img-001.bmp</samp>, <samp>img-002.bmp</samp>, ...,
  15033. <samp>img-010.bmp</samp>, etc.
  15034. The pattern &quot;img%%-%d.jpg&quot; will specify a sequence of filenames of the
  15035. form <samp>img%-1.jpg</samp>, <samp>img%-2.jpg</samp>, ..., <samp>img%-10.jpg</samp>,
  15036. etc.
  15037. </p>
  15038. <p>The image muxer supports the .Y.U.V image file format. This format is
  15039. special in that that each image frame consists of three files, for
  15040. each of the YUV420P components. To read or write this image file format,
  15041. specify the name of the &rsquo;.Y&rsquo; file. The muxer will automatically open the
  15042. &rsquo;.U&rsquo; and &rsquo;.V&rsquo; files as required.
  15043. </p>
  15044. <a name="Options-47"></a>
  15045. <h4 class="subsection">21.15.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-47" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-47" aria-hidden="true">TOC</a></span></h4>
  15046. <dl compact="compact">
  15047. <dt><samp>frame_pts</samp></dt>
  15048. <dd><p>If set to 1, expand the filename with pts from pkt-&gt;pts.
  15049. Default value is 0.
  15050. </p>
  15051. </dd>
  15052. <dt><samp>start_number</samp></dt>
  15053. <dd><p>Start the sequence from the specified number. Default value is 1.
  15054. </p>
  15055. </dd>
  15056. <dt><samp>update</samp></dt>
  15057. <dd><p>If set to 1, the filename will always be interpreted as just a
  15058. filename, not a pattern, and the corresponding file will be continuously
  15059. overwritten with new images. Default value is 0.
  15060. </p>
  15061. </dd>
  15062. <dt><samp>strftime</samp></dt>
  15063. <dd><p>If set to 1, expand the filename with date and time information from
  15064. <code>strftime()</code>. Default value is 0.
  15065. </p>
  15066. </dd>
  15067. <dt><samp>protocol_opts <var>options_list</var></samp></dt>
  15068. <dd><p>Set protocol options as a :-separated list of key=value parameters. Values
  15069. containing the <code>:</code> special character must be escaped.
  15070. </p>
  15071. </dd>
  15072. </dl>
  15073. <a name="Examples-13"></a>
  15074. <h4 class="subsection">21.15.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-13" aria-hidden="true">TOC</a></span></h4>
  15075. <p>The following example shows how to use <code>ffmpeg</code> for creating a
  15076. sequence of files <samp>img-001.jpeg</samp>, <samp>img-002.jpeg</samp>, ...,
  15077. taking one image every second from the input video:
  15078. </p><div class="example">
  15079. <pre class="example">ffmpeg -i in.avi -vsync cfr -r 1 -f image2 'img-%03d.jpeg'
  15080. </pre></div>
  15081. <p>Note that with <code>ffmpeg</code>, if the format is not specified with the
  15082. <code>-f</code> option and the output filename specifies an image file
  15083. format, the image2 muxer is automatically selected, so the previous
  15084. command can be written as:
  15085. </p><div class="example">
  15086. <pre class="example">ffmpeg -i in.avi -vsync cfr -r 1 'img-%03d.jpeg'
  15087. </pre></div>
  15088. <p>Note also that the pattern must not necessarily contain &quot;%d&quot; or
  15089. &quot;%0<var>N</var>d&quot;, for example to create a single image file
  15090. <samp>img.jpeg</samp> from the start of the input video you can employ the command:
  15091. </p><div class="example">
  15092. <pre class="example">ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
  15093. </pre></div>
  15094. <p>The <samp>strftime</samp> option allows you to expand the filename with
  15095. date and time information. Check the documentation of
  15096. the <code>strftime()</code> function for the syntax.
  15097. </p>
  15098. <p>For example to generate image files from the <code>strftime()</code>
  15099. &quot;%Y-%m-%d_%H-%M-%S&quot; pattern, the following <code>ffmpeg</code> command
  15100. can be used:
  15101. </p><div class="example">
  15102. <pre class="example">ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 &quot;%Y-%m-%d_%H-%M-%S.jpg&quot;
  15103. </pre></div>
  15104. <p>You can set the file name with current frame&rsquo;s PTS:
  15105. </p><div class="example">
  15106. <pre class="example">ffmpeg -f v4l2 -r 1 -i /dev/video0 -copyts -f image2 -frame_pts true %d.jpg&quot;
  15107. </pre></div>
  15108. <p>A more complex example is to publish contents of your desktop directly to a
  15109. WebDAV server every second:
  15110. </p><div class="example">
  15111. <pre class="example">ffmpeg -f x11grab -framerate 1 -i :0.0 -q:v 6 -update 1 -protocol_opts method=PUT http://example.com/desktop.jpg
  15112. </pre></div>
  15113. <a name="matroska"></a>
  15114. <h3 class="section">21.16 matroska<span class="pull-right"><a class="anchor hidden-xs" href="#matroska" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-matroska" aria-hidden="true">TOC</a></span></h3>
  15115. <p>Matroska container muxer.
  15116. </p>
  15117. <p>This muxer implements the matroska and webm container specs.
  15118. </p>
  15119. <a name="Metadata"></a>
  15120. <h4 class="subsection">21.16.1 Metadata<span class="pull-right"><a class="anchor hidden-xs" href="#Metadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Metadata" aria-hidden="true">TOC</a></span></h4>
  15121. <p>The recognized metadata settings in this muxer are:
  15122. </p>
  15123. <dl compact="compact">
  15124. <dt><samp>title</samp></dt>
  15125. <dd><p>Set title name provided to a single track. This gets mapped to
  15126. the FileDescription element for a stream written as attachment.
  15127. </p>
  15128. </dd>
  15129. <dt><samp>language</samp></dt>
  15130. <dd><p>Specify the language of the track in the Matroska languages form.
  15131. </p>
  15132. <p>The language can be either the 3 letters bibliographic ISO-639-2 (ISO
  15133. 639-2/B) form (like &quot;fre&quot; for French), or a language code mixed with a
  15134. country code for specialities in languages (like &quot;fre-ca&quot; for Canadian
  15135. French).
  15136. </p>
  15137. </dd>
  15138. <dt><samp>stereo_mode</samp></dt>
  15139. <dd><p>Set stereo 3D video layout of two views in a single video track.
  15140. </p>
  15141. <p>The following values are recognized:
  15142. </p><dl compact="compact">
  15143. <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
  15144. <dd><p>video is not stereo
  15145. </p></dd>
  15146. <dt>&lsquo;<samp>left_right</samp>&rsquo;</dt>
  15147. <dd><p>Both views are arranged side by side, Left-eye view is on the left
  15148. </p></dd>
  15149. <dt>&lsquo;<samp>bottom_top</samp>&rsquo;</dt>
  15150. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
  15151. </p></dd>
  15152. <dt>&lsquo;<samp>top_bottom</samp>&rsquo;</dt>
  15153. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
  15154. </p></dd>
  15155. <dt>&lsquo;<samp>checkerboard_rl</samp>&rsquo;</dt>
  15156. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
  15157. </p></dd>
  15158. <dt>&lsquo;<samp>checkerboard_lr</samp>&rsquo;</dt>
  15159. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
  15160. </p></dd>
  15161. <dt>&lsquo;<samp>row_interleaved_rl</samp>&rsquo;</dt>
  15162. <dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
  15163. </p></dd>
  15164. <dt>&lsquo;<samp>row_interleaved_lr</samp>&rsquo;</dt>
  15165. <dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
  15166. </p></dd>
  15167. <dt>&lsquo;<samp>col_interleaved_rl</samp>&rsquo;</dt>
  15168. <dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
  15169. </p></dd>
  15170. <dt>&lsquo;<samp>col_interleaved_lr</samp>&rsquo;</dt>
  15171. <dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
  15172. </p></dd>
  15173. <dt>&lsquo;<samp>anaglyph_cyan_red</samp>&rsquo;</dt>
  15174. <dd><p>All frames are in anaglyph format viewable through red-cyan filters
  15175. </p></dd>
  15176. <dt>&lsquo;<samp>right_left</samp>&rsquo;</dt>
  15177. <dd><p>Both views are arranged side by side, Right-eye view is on the left
  15178. </p></dd>
  15179. <dt>&lsquo;<samp>anaglyph_green_magenta</samp>&rsquo;</dt>
  15180. <dd><p>All frames are in anaglyph format viewable through green-magenta filters
  15181. </p></dd>
  15182. <dt>&lsquo;<samp>block_lr</samp>&rsquo;</dt>
  15183. <dd><p>Both eyes laced in one Block, Left-eye view is first
  15184. </p></dd>
  15185. <dt>&lsquo;<samp>block_rl</samp>&rsquo;</dt>
  15186. <dd><p>Both eyes laced in one Block, Right-eye view is first
  15187. </p></dd>
  15188. </dl>
  15189. </dd>
  15190. </dl>
  15191. <p>For example a 3D WebM clip can be created using the following command line:
  15192. </p><div class="example">
  15193. <pre class="example">ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
  15194. </pre></div>
  15195. <a name="Options-48"></a>
  15196. <h4 class="subsection">21.16.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-48" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-48" aria-hidden="true">TOC</a></span></h4>
  15197. <p>This muxer supports the following options:
  15198. </p>
  15199. <dl compact="compact">
  15200. <dt><samp>reserve_index_space</samp></dt>
  15201. <dd><p>By default, this muxer writes the index for seeking (called cues in Matroska
  15202. terms) at the end of the file, because it cannot know in advance how much space
  15203. to leave for the index at the beginning of the file. However for some use cases
  15204. &ndash; e.g. streaming where seeking is possible but slow &ndash; it is useful to put the
  15205. index at the beginning of the file.
  15206. </p>
  15207. <p>If this option is set to a non-zero value, the muxer will reserve a given amount
  15208. of space in the file header and then try to write the cues there when the muxing
  15209. finishes. If the reserved space does not suffice, no Cues will be written, the
  15210. file will be finalized and writing the trailer will return an error.
  15211. A safe size for most use cases should be about 50kB per hour of video.
  15212. </p>
  15213. <p>Note that cues are only written if the output is seekable and this option will
  15214. have no effect if it is not.
  15215. </p></dd>
  15216. <dt><samp>default_mode</samp></dt>
  15217. <dd><p>This option controls how the FlagDefault of the output tracks will be set.
  15218. It influences which tracks players should play by default. The default mode
  15219. is &lsquo;<samp>infer</samp>&rsquo;.
  15220. </p><dl compact="compact">
  15221. <dt>&lsquo;<samp>infer</samp>&rsquo;</dt>
  15222. <dd><p>In this mode, for each type of track (audio, video or subtitle), if there is
  15223. a track with disposition default of this type, then the first such track
  15224. (i.e. the one with the lowest index) will be marked as default; if no such
  15225. track exists, the first track of this type will be marked as default instead
  15226. (if existing). This ensures that the default flag is set in a sensible way even
  15227. if the input originated from containers that lack the concept of default tracks.
  15228. </p></dd>
  15229. <dt>&lsquo;<samp>infer_no_subs</samp>&rsquo;</dt>
  15230. <dd><p>This mode is the same as infer except that if no subtitle track with
  15231. disposition default exists, no subtitle track will be marked as default.
  15232. </p></dd>
  15233. <dt>&lsquo;<samp>passthrough</samp>&rsquo;</dt>
  15234. <dd><p>In this mode the FlagDefault is set if and only if the AV_DISPOSITION_DEFAULT
  15235. flag is set in the disposition of the corresponding stream.
  15236. </p></dd>
  15237. </dl>
  15238. </dd>
  15239. <dt><samp>flipped_raw_rgb</samp></dt>
  15240. <dd><p>If set to true, store positive height for raw RGB bitmaps, which indicates
  15241. bitmap is stored bottom-up. Note that this option does not flip the bitmap
  15242. which has to be done manually beforehand, e.g. by using the vflip filter.
  15243. Default is <var>false</var> and indicates bitmap is stored top down.
  15244. </p>
  15245. </dd>
  15246. </dl>
  15247. <span id="md5"></span><a name="md5-1"></a>
  15248. <h3 class="section">21.17 md5<span class="pull-right"><a class="anchor hidden-xs" href="#md5-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-md5-1" aria-hidden="true">TOC</a></span></h3>
  15249. <p>MD5 testing format.
  15250. </p>
  15251. <p>This is a variant of the <a href="#hash">hash</a> muxer. Unlike that muxer, it
  15252. defaults to using the MD5 hash function.
  15253. </p>
  15254. <a name="Examples-14"></a>
  15255. <h4 class="subsection">21.17.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-14" aria-hidden="true">TOC</a></span></h4>
  15256. <p>To compute the MD5 hash of the input converted to raw
  15257. audio and video, and store it in the file <samp>out.md5</samp>:
  15258. </p><div class="example">
  15259. <pre class="example">ffmpeg -i INPUT -f md5 out.md5
  15260. </pre></div>
  15261. <p>You can print the MD5 to stdout with the command:
  15262. </p><div class="example">
  15263. <pre class="example">ffmpeg -i INPUT -f md5 -
  15264. </pre></div>
  15265. <p>See also the <a href="#hash">hash</a> and <a href="#framemd5">framemd5</a> muxers.
  15266. </p>
  15267. <a name="mov_002c-mp4_002c-ismv"></a>
  15268. <h3 class="section">21.18 mov, mp4, ismv<span class="pull-right"><a class="anchor hidden-xs" href="#mov_002c-mp4_002c-ismv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mov_002c-mp4_002c-ismv" aria-hidden="true">TOC</a></span></h3>
  15269. <p>MOV/MP4/ISMV (Smooth Streaming) muxer.
  15270. </p>
  15271. <p>The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4
  15272. file has all the metadata about all packets stored in one location
  15273. (written at the end of the file, it can be moved to the start for
  15274. better playback by adding <var>faststart</var> to the <var>movflags</var>, or
  15275. using the <code>qt-faststart</code> tool). A fragmented
  15276. file consists of a number of fragments, where packets and metadata
  15277. about these packets are stored together. Writing a fragmented
  15278. file has the advantage that the file is decodable even if the
  15279. writing is interrupted (while a normal MOV/MP4 is undecodable if
  15280. it is not properly finished), and it requires less memory when writing
  15281. very long files (since writing normal MOV/MP4 files stores info about
  15282. every single packet in memory until the file is closed). The downside
  15283. is that it is less compatible with other applications.
  15284. </p>
  15285. <a name="Options-49"></a>
  15286. <h4 class="subsection">21.18.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-49" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-49" aria-hidden="true">TOC</a></span></h4>
  15287. <p>Fragmentation is enabled by setting one of the AVOptions that define
  15288. how to cut the file into fragments:
  15289. </p>
  15290. <dl compact="compact">
  15291. <dt><samp>-moov_size <var>bytes</var></samp></dt>
  15292. <dd><p>Reserves space for the moov atom at the beginning of the file instead of placing the
  15293. moov atom at the end. If the space reserved is insufficient, muxing will fail.
  15294. </p></dd>
  15295. <dt><samp>-movflags frag_keyframe</samp></dt>
  15296. <dd><p>Start a new fragment at each video keyframe.
  15297. </p></dd>
  15298. <dt><samp>-frag_duration <var>duration</var></samp></dt>
  15299. <dd><p>Create fragments that are <var>duration</var> microseconds long.
  15300. </p></dd>
  15301. <dt><samp>-frag_size <var>size</var></samp></dt>
  15302. <dd><p>Create fragments that contain up to <var>size</var> bytes of payload data.
  15303. </p></dd>
  15304. <dt><samp>-movflags frag_custom</samp></dt>
  15305. <dd><p>Allow the caller to manually choose when to cut fragments, by
  15306. calling <code>av_write_frame(ctx, NULL)</code> to write a fragment with
  15307. the packets written so far. (This is only useful with other
  15308. applications integrating libavformat, not from <code>ffmpeg</code>.)
  15309. </p></dd>
  15310. <dt><samp>-min_frag_duration <var>duration</var></samp></dt>
  15311. <dd><p>Don&rsquo;t create fragments that are shorter than <var>duration</var> microseconds long.
  15312. </p></dd>
  15313. </dl>
  15314. <p>If more than one condition is specified, fragments are cut when
  15315. one of the specified conditions is fulfilled. The exception to this is
  15316. <code>-min_frag_duration</code>, which has to be fulfilled for any of the other
  15317. conditions to apply.
  15318. </p>
  15319. <p>Additionally, the way the output file is written can be adjusted
  15320. through a few other options:
  15321. </p>
  15322. <dl compact="compact">
  15323. <dt><samp>-movflags empty_moov</samp></dt>
  15324. <dd><p>Write an initial moov atom directly at the start of the file, without
  15325. describing any samples in it. Generally, an mdat/moov pair is written
  15326. at the start of the file, as a normal MOV/MP4 file, containing only
  15327. a short portion of the file. With this option set, there is no initial
  15328. mdat atom, and the moov atom only describes the tracks but has
  15329. a zero duration.
  15330. </p>
  15331. <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
  15332. </p></dd>
  15333. <dt><samp>-movflags separate_moof</samp></dt>
  15334. <dd><p>Write a separate moof (movie fragment) atom for each track. Normally,
  15335. packets for all tracks are written in a moof atom (which is slightly
  15336. more efficient), but with this option set, the muxer writes one moof/mdat
  15337. pair for each track, making it easier to separate tracks.
  15338. </p>
  15339. <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
  15340. </p></dd>
  15341. <dt><samp>-movflags skip_sidx</samp></dt>
  15342. <dd><p>Skip writing of sidx atom. When bitrate overhead due to sidx atom is high,
  15343. this option could be used for cases where sidx atom is not mandatory.
  15344. When global_sidx flag is enabled, this option will be ignored.
  15345. </p></dd>
  15346. <dt><samp>-movflags faststart</samp></dt>
  15347. <dd><p>Run a second pass moving the index (moov atom) to the beginning of the file.
  15348. This operation can take a while, and will not work in various situations such
  15349. as fragmented output, thus it is not enabled by default.
  15350. </p></dd>
  15351. <dt><samp>-movflags rtphint</samp></dt>
  15352. <dd><p>Add RTP hinting tracks to the output file.
  15353. </p></dd>
  15354. <dt><samp>-movflags disable_chpl</samp></dt>
  15355. <dd><p>Disable Nero chapter markers (chpl atom). Normally, both Nero chapters
  15356. and a QuickTime chapter track are written to the file. With this option
  15357. set, only the QuickTime chapter track will be written. Nero chapters can
  15358. cause failures when the file is reprocessed with certain tagging programs, like
  15359. mp3Tag 2.61a and iTunes 11.3, most likely other versions are affected as well.
  15360. </p></dd>
  15361. <dt><samp>-movflags omit_tfhd_offset</samp></dt>
  15362. <dd><p>Do not write any absolute base_data_offset in tfhd atoms. This avoids
  15363. tying fragments to absolute byte positions in the file/streams.
  15364. </p></dd>
  15365. <dt><samp>-movflags default_base_moof</samp></dt>
  15366. <dd><p>Similarly to the omit_tfhd_offset, this flag avoids writing the
  15367. absolute base_data_offset field in tfhd atoms, but does so by using
  15368. the new default-base-is-moof flag instead. This flag is new from
  15369. 14496-12:2012. This may make the fragments easier to parse in certain
  15370. circumstances (avoiding basing track fragment location calculations
  15371. on the implicit end of the previous track fragment).
  15372. </p></dd>
  15373. <dt><samp>-write_tmcd</samp></dt>
  15374. <dd><p>Specify <code>on</code> to force writing a timecode track, <code>off</code> to disable it
  15375. and <code>auto</code> to write a timecode track only for mov and mp4 output (default).
  15376. </p></dd>
  15377. <dt><samp>-movflags negative_cts_offsets</samp></dt>
  15378. <dd><p>Enables utilization of version 1 of the CTTS box, in which the CTS offsets can
  15379. be negative. This enables the initial sample to have DTS/CTS of zero, and
  15380. reduces the need for edit lists for some cases such as video tracks with
  15381. B-frames. Additionally, eases conformance with the DASH-IF interoperability
  15382. guidelines.
  15383. </p>
  15384. <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
  15385. </p></dd>
  15386. <dt><samp>-write_prft</samp></dt>
  15387. <dd><p>Write producer time reference box (PRFT) with a specified time source for the
  15388. NTP field in the PRFT box. Set value as &lsquo;<samp>wallclock</samp>&rsquo; to specify timesource
  15389. as wallclock time and &lsquo;<samp>pts</samp>&rsquo; to specify timesource as input packets&rsquo; PTS
  15390. values.
  15391. </p>
  15392. <p>Setting value to &lsquo;<samp>pts</samp>&rsquo; is applicable only for a live encoding use case,
  15393. where PTS values are set as as wallclock time at the source. For example, an
  15394. encoding use case with decklink capture source where <samp>video_pts</samp> and
  15395. <samp>audio_pts</samp> are set to &lsquo;<samp>abs_wallclock</samp>&rsquo;.
  15396. </p></dd>
  15397. </dl>
  15398. <a name="Example"></a>
  15399. <h4 class="subsection">21.18.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example" aria-hidden="true">TOC</a></span></h4>
  15400. <p>Smooth Streaming content can be pushed in real time to a publishing
  15401. point on IIS with this muxer. Example:
  15402. </p><div class="example">
  15403. <pre class="example">ffmpeg -re <var>&lt;normal input/transcoding options&gt;</var> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
  15404. </pre></div>
  15405. <a name="mp3"></a>
  15406. <h3 class="section">21.19 mp3<span class="pull-right"><a class="anchor hidden-xs" href="#mp3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mp3" aria-hidden="true">TOC</a></span></h3>
  15407. <p>The MP3 muxer writes a raw MP3 stream with the following optional features:
  15408. </p><ul>
  15409. <li> An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and
  15410. 2.4 are supported, the <code>id3v2_version</code> private option controls which one is
  15411. used (3 or 4). Setting <code>id3v2_version</code> to 0 disables the ID3v2 header
  15412. completely.
  15413. <p>The muxer supports writing attached pictures (APIC frames) to the ID3v2 header.
  15414. The pictures are supplied to the muxer in form of a video stream with a single
  15415. packet. There can be any number of those streams, each will correspond to a
  15416. single APIC frame. The stream metadata tags <var>title</var> and <var>comment</var> map
  15417. to APIC <var>description</var> and <var>picture type</var> respectively. See
  15418. <a href="http://id3.org/id3v2.4.0-frames">http://id3.org/id3v2.4.0-frames</a> for allowed picture types.
  15419. </p>
  15420. <p>Note that the APIC frames must be written at the beginning, so the muxer will
  15421. buffer the audio frames until it gets all the pictures. It is therefore advised
  15422. to provide the pictures as soon as possible to avoid excessive buffering.
  15423. </p>
  15424. </li><li> A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by
  15425. default, but will be written only if the output is seekable. The
  15426. <code>write_xing</code> private option can be used to disable it. The frame contains
  15427. various information that may be useful to the decoder, like the audio duration
  15428. or encoder delay.
  15429. </li><li> A legacy ID3v1 tag at the end of the file (disabled by default). It may be
  15430. enabled with the <code>write_id3v1</code> private option, but as its capabilities are
  15431. very limited, its usage is not recommended.
  15432. </li></ul>
  15433. <p>Examples:
  15434. </p>
  15435. <p>Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
  15436. </p><div class="example">
  15437. <pre class="example">ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
  15438. </pre></div>
  15439. <p>To attach a picture to an mp3 file select both the audio and the picture stream
  15440. with <code>map</code>:
  15441. </p><div class="example">
  15442. <pre class="example">ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
  15443. -metadata:s:v title=&quot;Album cover&quot; -metadata:s:v comment=&quot;Cover (Front)&quot; out.mp3
  15444. </pre></div>
  15445. <p>Write a &quot;clean&quot; MP3 without any extra features:
  15446. </p><div class="example">
  15447. <pre class="example">ffmpeg -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
  15448. </pre></div>
  15449. <a name="mpegts-1"></a>
  15450. <h3 class="section">21.20 mpegts<span class="pull-right"><a class="anchor hidden-xs" href="#mpegts-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpegts-1" aria-hidden="true">TOC</a></span></h3>
  15451. <p>MPEG transport stream muxer.
  15452. </p>
  15453. <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
  15454. </p>
  15455. <p>The recognized metadata settings in mpegts muxer are <code>service_provider</code>
  15456. and <code>service_name</code>. If they are not set the default for
  15457. <code>service_provider</code> is &lsquo;<samp>FFmpeg</samp>&rsquo; and the default for
  15458. <code>service_name</code> is &lsquo;<samp>Service01</samp>&rsquo;.
  15459. </p>
  15460. <a name="Options-50"></a>
  15461. <h4 class="subsection">21.20.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-50" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-50" aria-hidden="true">TOC</a></span></h4>
  15462. <p>The muxer options are:
  15463. </p>
  15464. <dl compact="compact">
  15465. <dt><samp>mpegts_transport_stream_id <var>integer</var></samp></dt>
  15466. <dd><p>Set the &lsquo;<samp>transport_stream_id</samp>&rsquo;. This identifies a transponder in DVB.
  15467. Default is <code>0x0001</code>.
  15468. </p>
  15469. </dd>
  15470. <dt><samp>mpegts_original_network_id <var>integer</var></samp></dt>
  15471. <dd><p>Set the &lsquo;<samp>original_network_id</samp>&rsquo;. This is unique identifier of a
  15472. network in DVB. Its main use is in the unique identification of a service
  15473. through the path &lsquo;<samp>Original_Network_ID, Transport_Stream_ID</samp>&rsquo;. Default
  15474. is <code>0x0001</code>.
  15475. </p>
  15476. </dd>
  15477. <dt><samp>mpegts_service_id <var>integer</var></samp></dt>
  15478. <dd><p>Set the &lsquo;<samp>service_id</samp>&rsquo;, also known as program in DVB. Default is
  15479. <code>0x0001</code>.
  15480. </p>
  15481. </dd>
  15482. <dt><samp>mpegts_service_type <var>integer</var></samp></dt>
  15483. <dd><p>Set the program &lsquo;<samp>service_type</samp>&rsquo;. Default is <code>digital_tv</code>.
  15484. Accepts the following options:
  15485. </p><dl compact="compact">
  15486. <dt>&lsquo;<samp>hex_value</samp>&rsquo;</dt>
  15487. <dd><p>Any hexadecimal value between <code>0x01</code> and <code>0xff</code> as defined in
  15488. ETSI 300 468.
  15489. </p></dd>
  15490. <dt>&lsquo;<samp>digital_tv</samp>&rsquo;</dt>
  15491. <dd><p>Digital TV service.
  15492. </p></dd>
  15493. <dt>&lsquo;<samp>digital_radio</samp>&rsquo;</dt>
  15494. <dd><p>Digital Radio service.
  15495. </p></dd>
  15496. <dt>&lsquo;<samp>teletext</samp>&rsquo;</dt>
  15497. <dd><p>Teletext service.
  15498. </p></dd>
  15499. <dt>&lsquo;<samp>advanced_codec_digital_radio</samp>&rsquo;</dt>
  15500. <dd><p>Advanced Codec Digital Radio service.
  15501. </p></dd>
  15502. <dt>&lsquo;<samp>mpeg2_digital_hdtv</samp>&rsquo;</dt>
  15503. <dd><p>MPEG2 Digital HDTV service.
  15504. </p></dd>
  15505. <dt>&lsquo;<samp>advanced_codec_digital_sdtv</samp>&rsquo;</dt>
  15506. <dd><p>Advanced Codec Digital SDTV service.
  15507. </p></dd>
  15508. <dt>&lsquo;<samp>advanced_codec_digital_hdtv</samp>&rsquo;</dt>
  15509. <dd><p>Advanced Codec Digital HDTV service.
  15510. </p></dd>
  15511. </dl>
  15512. </dd>
  15513. <dt><samp>mpegts_pmt_start_pid <var>integer</var></samp></dt>
  15514. <dd><p>Set the first PID for PMTs. Default is <code>0x1000</code>, minimum is <code>0x0020</code>,
  15515. maximum is <code>0x1ffa</code>. This option has no effect in m2ts mode where the PMT
  15516. PID is fixed <code>0x0100</code>.
  15517. </p>
  15518. </dd>
  15519. <dt><samp>mpegts_start_pid <var>integer</var></samp></dt>
  15520. <dd><p>Set the first PID for elementary streams. Default is <code>0x0100</code>, minimum is
  15521. <code>0x0020</code>, maximum is <code>0x1ffa</code>. This option has no effect in m2ts mode
  15522. where the elementary stream PIDs are fixed.
  15523. </p>
  15524. </dd>
  15525. <dt><samp>mpegts_m2ts_mode <var>boolean</var></samp></dt>
  15526. <dd><p>Enable m2ts mode if set to <code>1</code>. Default value is <code>-1</code> which
  15527. disables m2ts mode.
  15528. </p>
  15529. </dd>
  15530. <dt><samp>muxrate <var>integer</var></samp></dt>
  15531. <dd><p>Set a constant muxrate. Default is VBR.
  15532. </p>
  15533. </dd>
  15534. <dt><samp>pes_payload_size <var>integer</var></samp></dt>
  15535. <dd><p>Set minimum PES packet payload in bytes. Default is <code>2930</code>.
  15536. </p>
  15537. </dd>
  15538. <dt><samp>mpegts_flags <var>flags</var></samp></dt>
  15539. <dd><p>Set mpegts flags. Accepts the following options:
  15540. </p><dl compact="compact">
  15541. <dt>&lsquo;<samp>resend_headers</samp>&rsquo;</dt>
  15542. <dd><p>Reemit PAT/PMT before writing the next packet.
  15543. </p></dd>
  15544. <dt>&lsquo;<samp>latm</samp>&rsquo;</dt>
  15545. <dd><p>Use LATM packetization for AAC.
  15546. </p></dd>
  15547. <dt>&lsquo;<samp>pat_pmt_at_frames</samp>&rsquo;</dt>
  15548. <dd><p>Reemit PAT and PMT at each video frame.
  15549. </p></dd>
  15550. <dt>&lsquo;<samp>system_b</samp>&rsquo;</dt>
  15551. <dd><p>Conform to System B (DVB) instead of System A (ATSC).
  15552. </p></dd>
  15553. <dt>&lsquo;<samp>initial_discontinuity</samp>&rsquo;</dt>
  15554. <dd><p>Mark the initial packet of each stream as discontinuity.
  15555. </p></dd>
  15556. </dl>
  15557. </dd>
  15558. <dt><samp>mpegts_copyts <var>boolean</var></samp></dt>
  15559. <dd><p>Preserve original timestamps, if value is set to <code>1</code>. Default value
  15560. is <code>-1</code>, which results in shifting timestamps so that they start from 0.
  15561. </p>
  15562. </dd>
  15563. <dt><samp>omit_video_pes_length <var>boolean</var></samp></dt>
  15564. <dd><p>Omit the PES packet length for video packets. Default is <code>1</code> (true).
  15565. </p>
  15566. </dd>
  15567. <dt><samp>pcr_period <var>integer</var></samp></dt>
  15568. <dd><p>Override the default PCR retransmission time in milliseconds. Default is
  15569. <code>-1</code> which means that the PCR interval will be determined automatically:
  15570. 20 ms is used for CBR streams, the highest multiple of the frame duration which
  15571. is less than 100 ms is used for VBR streams.
  15572. </p>
  15573. </dd>
  15574. <dt><samp>pat_period <var>duration</var></samp></dt>
  15575. <dd><p>Maximum time in seconds between PAT/PMT tables. Default is <code>0.1</code>.
  15576. </p>
  15577. </dd>
  15578. <dt><samp>sdt_period <var>duration</var></samp></dt>
  15579. <dd><p>Maximum time in seconds between SDT tables. Default is <code>0.5</code>.
  15580. </p>
  15581. </dd>
  15582. <dt><samp>tables_version <var>integer</var></samp></dt>
  15583. <dd><p>Set PAT, PMT and SDT version (default <code>0</code>, valid values are from 0 to 31, inclusively).
  15584. This option allows updating stream structure so that standard consumer may
  15585. detect the change. To do so, reopen output <code>AVFormatContext</code> (in case of API
  15586. usage) or restart <code>ffmpeg</code> instance, cyclically changing
  15587. <samp>tables_version</samp> value:
  15588. </p>
  15589. <div class="example">
  15590. <pre class="example">ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  15591. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  15592. ...
  15593. ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
  15594. ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  15595. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  15596. ...
  15597. </pre></div>
  15598. </dd>
  15599. </dl>
  15600. <a name="Example-1"></a>
  15601. <h4 class="subsection">21.20.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-1" aria-hidden="true">TOC</a></span></h4>
  15602. <div class="example">
  15603. <pre class="example">ffmpeg -i file.mpg -c copy \
  15604. -mpegts_original_network_id 0x1122 \
  15605. -mpegts_transport_stream_id 0x3344 \
  15606. -mpegts_service_id 0x5566 \
  15607. -mpegts_pmt_start_pid 0x1500 \
  15608. -mpegts_start_pid 0x150 \
  15609. -metadata service_provider=&quot;Some provider&quot; \
  15610. -metadata service_name=&quot;Some Channel&quot; \
  15611. out.ts
  15612. </pre></div>
  15613. <a name="mxf_002c-mxf_005fd10_002c-mxf_005fopatom"></a>
  15614. <h3 class="section">21.21 mxf, mxf_d10, mxf_opatom<span class="pull-right"><a class="anchor hidden-xs" href="#mxf_002c-mxf_005fd10_002c-mxf_005fopatom" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mxf_002c-mxf_005fd10_002c-mxf_005fopatom" aria-hidden="true">TOC</a></span></h3>
  15615. <p>MXF muxer.
  15616. </p>
  15617. <a name="Options-51"></a>
  15618. <h4 class="subsection">21.21.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-51" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-51" aria-hidden="true">TOC</a></span></h4>
  15619. <p>The muxer options are:
  15620. </p>
  15621. <dl compact="compact">
  15622. <dt><samp>store_user_comments <var>bool</var></samp></dt>
  15623. <dd><p>Set if user comments should be stored if available or never.
  15624. IRT D-10 does not allow user comments. The default is thus to write them for
  15625. mxf and mxf_opatom but not for mxf_d10
  15626. </p></dd>
  15627. </dl>
  15628. <a name="null-1"></a>
  15629. <h3 class="section">21.22 null<span class="pull-right"><a class="anchor hidden-xs" href="#null-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-null-1" aria-hidden="true">TOC</a></span></h3>
  15630. <p>Null muxer.
  15631. </p>
  15632. <p>This muxer does not generate any output file, it is mainly useful for
  15633. testing or benchmarking purposes.
  15634. </p>
  15635. <p>For example to benchmark decoding with <code>ffmpeg</code> you can use the
  15636. command:
  15637. </p><div class="example">
  15638. <pre class="example">ffmpeg -benchmark -i INPUT -f null out.null
  15639. </pre></div>
  15640. <p>Note that the above command does not read or write the <samp>out.null</samp>
  15641. file, but specifying the output file is required by the <code>ffmpeg</code>
  15642. syntax.
  15643. </p>
  15644. <p>Alternatively you can write the command as:
  15645. </p><div class="example">
  15646. <pre class="example">ffmpeg -benchmark -i INPUT -f null -
  15647. </pre></div>
  15648. <a name="nut"></a>
  15649. <h3 class="section">21.23 nut<span class="pull-right"><a class="anchor hidden-xs" href="#nut" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nut" aria-hidden="true">TOC</a></span></h3>
  15650. <dl compact="compact">
  15651. <dt><samp>-syncpoints <var>flags</var></samp></dt>
  15652. <dd><p>Change the syncpoint usage in nut:
  15653. </p><dl compact="compact">
  15654. <dt><samp><var>default</var> use the normal low-overhead seeking aids.</samp></dt>
  15655. <dt><samp><var>none</var> do not use the syncpoints at all, reducing the overhead but making the stream non-seekable;</samp></dt>
  15656. <dd><p>Use of this option is not recommended, as the resulting files are very damage
  15657. sensitive and seeking is not possible. Also in general the overhead from
  15658. syncpoints is negligible. Note, -<code>write_index</code> 0 can be used to disable
  15659. all growing data tables, allowing to mux endless streams with limited memory
  15660. and without these disadvantages.
  15661. </p></dd>
  15662. <dt><samp><var>timestamped</var> extend the syncpoint with a wallclock field.</samp></dt>
  15663. </dl>
  15664. <p>The <var>none</var> and <var>timestamped</var> flags are experimental.
  15665. </p></dd>
  15666. <dt><samp>-write_index <var>bool</var></samp></dt>
  15667. <dd><p>Write index at the end, the default is to write an index.
  15668. </p></dd>
  15669. </dl>
  15670. <div class="example">
  15671. <pre class="example">ffmpeg -i INPUT -f_strict experimental -syncpoints none - | processor
  15672. </pre></div>
  15673. <a name="ogg"></a>
  15674. <h3 class="section">21.24 ogg<span class="pull-right"><a class="anchor hidden-xs" href="#ogg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ogg" aria-hidden="true">TOC</a></span></h3>
  15675. <p>Ogg container muxer.
  15676. </p>
  15677. <dl compact="compact">
  15678. <dt><samp>-page_duration <var>duration</var></samp></dt>
  15679. <dd><p>Preferred page duration, in microseconds. The muxer will attempt to create
  15680. pages that are approximately <var>duration</var> microseconds long. This allows the
  15681. user to compromise between seek granularity and container overhead. The default
  15682. is 1 second. A value of 0 will fill all segments, making pages as large as
  15683. possible. A value of 1 will effectively use 1 packet-per-page in most
  15684. situations, giving a small seek granularity at the cost of additional container
  15685. overhead.
  15686. </p></dd>
  15687. <dt><samp>-serial_offset <var>value</var></samp></dt>
  15688. <dd><p>Serial value from which to set the streams serial number.
  15689. Setting it to different and sufficiently large values ensures that the produced
  15690. ogg files can be safely chained.
  15691. </p>
  15692. </dd>
  15693. </dl>
  15694. <span id="segment"></span><a name="segment_002c-stream_005fsegment_002c-ssegment"></a>
  15695. <h3 class="section">21.25 segment, stream_segment, ssegment<span class="pull-right"><a class="anchor hidden-xs" href="#segment_002c-stream_005fsegment_002c-ssegment" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-segment_002c-stream_005fsegment_002c-ssegment" aria-hidden="true">TOC</a></span></h3>
  15696. <p>Basic stream segmenter.
  15697. </p>
  15698. <p>This muxer outputs streams to a number of separate files of nearly
  15699. fixed duration. Output filename pattern can be set in a fashion
  15700. similar to <a href="#image2">image2</a>, or by using a <code>strftime</code> template if
  15701. the <samp>strftime</samp> option is enabled.
  15702. </p>
  15703. <p><code>stream_segment</code> is a variant of the muxer used to write to
  15704. streaming output formats, i.e. which do not require global headers,
  15705. and is recommended for outputting e.g. to MPEG transport stream segments.
  15706. <code>ssegment</code> is a shorter alias for <code>stream_segment</code>.
  15707. </p>
  15708. <p>Every segment starts with a keyframe of the selected reference stream,
  15709. which is set through the <samp>reference_stream</samp> option.
  15710. </p>
  15711. <p>Note that if you want accurate splitting for a video file, you need to
  15712. make the input key frames correspond to the exact splitting times
  15713. expected by the segmenter, or the segment muxer will start the new
  15714. segment with the key frame found next after the specified start
  15715. time.
  15716. </p>
  15717. <p>The segment muxer works best with a single constant frame rate video.
  15718. </p>
  15719. <p>Optionally it can generate a list of the created segments, by setting
  15720. the option <var>segment_list</var>. The list type is specified by the
  15721. <var>segment_list_type</var> option. The entry filenames in the segment
  15722. list are set by default to the basename of the corresponding segment
  15723. files.
  15724. </p>
  15725. <p>See also the <a href="#hls">hls</a> muxer, which provides a more specific
  15726. implementation for HLS segmentation.
  15727. </p>
  15728. <a name="Options-52"></a>
  15729. <h4 class="subsection">21.25.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-52" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-52" aria-hidden="true">TOC</a></span></h4>
  15730. <p>The segment muxer supports the following options:
  15731. </p>
  15732. <dl compact="compact">
  15733. <dt><samp>increment_tc <var>1|0</var></samp></dt>
  15734. <dd><p>if set to <code>1</code>, increment timecode between each segment
  15735. If this is selected, the input need to have
  15736. a timecode in the first video stream. Default value is
  15737. <code>0</code>.
  15738. </p>
  15739. </dd>
  15740. <dt><samp>reference_stream <var>specifier</var></samp></dt>
  15741. <dd><p>Set the reference stream, as specified by the string <var>specifier</var>.
  15742. If <var>specifier</var> is set to <code>auto</code>, the reference is chosen
  15743. automatically. Otherwise it must be a stream specifier (see the &ldquo;Stream
  15744. specifiers&rdquo; chapter in the ffmpeg manual) which specifies the
  15745. reference stream. The default value is <code>auto</code>.
  15746. </p>
  15747. </dd>
  15748. <dt><samp>segment_format <var>format</var></samp></dt>
  15749. <dd><p>Override the inner container format, by default it is guessed by the filename
  15750. extension.
  15751. </p>
  15752. </dd>
  15753. <dt><samp>segment_format_options <var>options_list</var></samp></dt>
  15754. <dd><p>Set output format options using a :-separated list of key=value
  15755. parameters. Values containing the <code>:</code> special character must be
  15756. escaped.
  15757. </p>
  15758. </dd>
  15759. <dt><samp>segment_list <var>name</var></samp></dt>
  15760. <dd><p>Generate also a listfile named <var>name</var>. If not specified no
  15761. listfile is generated.
  15762. </p>
  15763. </dd>
  15764. <dt><samp>segment_list_flags <var>flags</var></samp></dt>
  15765. <dd><p>Set flags affecting the segment list generation.
  15766. </p>
  15767. <p>It currently supports the following flags:
  15768. </p><dl compact="compact">
  15769. <dt>&lsquo;<samp>cache</samp>&rsquo;</dt>
  15770. <dd><p>Allow caching (only affects M3U8 list files).
  15771. </p>
  15772. </dd>
  15773. <dt>&lsquo;<samp>live</samp>&rsquo;</dt>
  15774. <dd><p>Allow live-friendly file generation.
  15775. </p></dd>
  15776. </dl>
  15777. </dd>
  15778. <dt><samp>segment_list_size <var>size</var></samp></dt>
  15779. <dd><p>Update the list file so that it contains at most <var>size</var>
  15780. segments. If 0 the list file will contain all the segments. Default
  15781. value is 0.
  15782. </p>
  15783. </dd>
  15784. <dt><samp>segment_list_entry_prefix <var>prefix</var></samp></dt>
  15785. <dd><p>Prepend <var>prefix</var> to each entry. Useful to generate absolute paths.
  15786. By default no prefix is applied.
  15787. </p>
  15788. </dd>
  15789. <dt><samp>segment_list_type <var>type</var></samp></dt>
  15790. <dd><p>Select the listing format.
  15791. </p>
  15792. <p>The following values are recognized:
  15793. </p><dl compact="compact">
  15794. <dt>&lsquo;<samp>flat</samp>&rsquo;</dt>
  15795. <dd><p>Generate a flat list for the created segments, one segment per line.
  15796. </p>
  15797. </dd>
  15798. <dt>&lsquo;<samp>csv, ext</samp>&rsquo;</dt>
  15799. <dd><p>Generate a list for the created segments, one segment per line,
  15800. each line matching the format (comma-separated values):
  15801. </p><div class="example">
  15802. <pre class="example"><var>segment_filename</var>,<var>segment_start_time</var>,<var>segment_end_time</var>
  15803. </pre></div>
  15804. <p><var>segment_filename</var> is the name of the output file generated by the
  15805. muxer according to the provided pattern. CSV escaping (according to
  15806. RFC4180) is applied if required.
  15807. </p>
  15808. <p><var>segment_start_time</var> and <var>segment_end_time</var> specify
  15809. the segment start and end time expressed in seconds.
  15810. </p>
  15811. <p>A list file with the suffix <code>&quot;.csv&quot;</code> or <code>&quot;.ext&quot;</code> will
  15812. auto-select this format.
  15813. </p>
  15814. <p>&lsquo;<samp>ext</samp>&rsquo; is deprecated in favor or &lsquo;<samp>csv</samp>&rsquo;.
  15815. </p>
  15816. </dd>
  15817. <dt>&lsquo;<samp>ffconcat</samp>&rsquo;</dt>
  15818. <dd><p>Generate an ffconcat file for the created segments. The resulting file
  15819. can be read using the FFmpeg <a href="#concat">concat</a> demuxer.
  15820. </p>
  15821. <p>A list file with the suffix <code>&quot;.ffcat&quot;</code> or <code>&quot;.ffconcat&quot;</code> will
  15822. auto-select this format.
  15823. </p>
  15824. </dd>
  15825. <dt>&lsquo;<samp>m3u8</samp>&rsquo;</dt>
  15826. <dd><p>Generate an extended M3U8 file, version 3, compliant with
  15827. <a href="http://tools.ietf.org/id/draft-pantos-http-live-streaming">http://tools.ietf.org/id/draft-pantos-http-live-streaming</a>.
  15828. </p>
  15829. <p>A list file with the suffix <code>&quot;.m3u8&quot;</code> will auto-select this format.
  15830. </p></dd>
  15831. </dl>
  15832. <p>If not specified the type is guessed from the list file name suffix.
  15833. </p>
  15834. </dd>
  15835. <dt><samp>segment_time <var>time</var></samp></dt>
  15836. <dd><p>Set segment duration to <var>time</var>, the value must be a duration
  15837. specification. Default value is &quot;2&quot;. See also the
  15838. <samp>segment_times</samp> option.
  15839. </p>
  15840. <p>Note that splitting may not be accurate, unless you force the
  15841. reference stream key-frames at the given time. See the introductory
  15842. notice and the examples below.
  15843. </p>
  15844. </dd>
  15845. <dt><samp>segment_atclocktime <var>1|0</var></samp></dt>
  15846. <dd><p>If set to &quot;1&quot; split at regular clock time intervals starting from 00:00
  15847. o&rsquo;clock. The <var>time</var> value specified in <samp>segment_time</samp> is
  15848. used for setting the length of the splitting interval.
  15849. </p>
  15850. <p>For example with <samp>segment_time</samp> set to &quot;900&quot; this makes it possible
  15851. to create files at 12:00 o&rsquo;clock, 12:15, 12:30, etc.
  15852. </p>
  15853. <p>Default value is &quot;0&quot;.
  15854. </p>
  15855. </dd>
  15856. <dt><samp>segment_clocktime_offset <var>duration</var></samp></dt>
  15857. <dd><p>Delay the segment splitting times with the specified duration when using
  15858. <samp>segment_atclocktime</samp>.
  15859. </p>
  15860. <p>For example with <samp>segment_time</samp> set to &quot;900&quot; and
  15861. <samp>segment_clocktime_offset</samp> set to &quot;300&quot; this makes it possible to
  15862. create files at 12:05, 12:20, 12:35, etc.
  15863. </p>
  15864. <p>Default value is &quot;0&quot;.
  15865. </p>
  15866. </dd>
  15867. <dt><samp>segment_clocktime_wrap_duration <var>duration</var></samp></dt>
  15868. <dd><p>Force the segmenter to only start a new segment if a packet reaches the muxer
  15869. within the specified duration after the segmenting clock time. This way you
  15870. can make the segmenter more resilient to backward local time jumps, such as
  15871. leap seconds or transition to standard time from daylight savings time.
  15872. </p>
  15873. <p>Default is the maximum possible duration which means starting a new segment
  15874. regardless of the elapsed time since the last clock time.
  15875. </p>
  15876. </dd>
  15877. <dt><samp>segment_time_delta <var>delta</var></samp></dt>
  15878. <dd><p>Specify the accuracy time when selecting the start time for a
  15879. segment, expressed as a duration specification. Default value is &quot;0&quot;.
  15880. </p>
  15881. <p>When delta is specified a key-frame will start a new segment if its
  15882. PTS satisfies the relation:
  15883. </p><div class="example">
  15884. <pre class="example">PTS &gt;= start_time - time_delta
  15885. </pre></div>
  15886. <p>This option is useful when splitting video content, which is always
  15887. split at GOP boundaries, in case a key frame is found just before the
  15888. specified split time.
  15889. </p>
  15890. <p>In particular may be used in combination with the <samp>ffmpeg</samp> option
  15891. <var>force_key_frames</var>. The key frame times specified by
  15892. <var>force_key_frames</var> may not be set accurately because of rounding
  15893. issues, with the consequence that a key frame time may result set just
  15894. before the specified time. For constant frame rate videos a value of
  15895. 1/(2*<var>frame_rate</var>) should address the worst case mismatch between
  15896. the specified time and the time set by <var>force_key_frames</var>.
  15897. </p>
  15898. </dd>
  15899. <dt><samp>segment_times <var>times</var></samp></dt>
  15900. <dd><p>Specify a list of split points. <var>times</var> contains a list of comma
  15901. separated duration specifications, in increasing order. See also
  15902. the <samp>segment_time</samp> option.
  15903. </p>
  15904. </dd>
  15905. <dt><samp>segment_frames <var>frames</var></samp></dt>
  15906. <dd><p>Specify a list of split video frame numbers. <var>frames</var> contains a
  15907. list of comma separated integer numbers, in increasing order.
  15908. </p>
  15909. <p>This option specifies to start a new segment whenever a reference
  15910. stream key frame is found and the sequential number (starting from 0)
  15911. of the frame is greater or equal to the next value in the list.
  15912. </p>
  15913. </dd>
  15914. <dt><samp>segment_wrap <var>limit</var></samp></dt>
  15915. <dd><p>Wrap around segment index once it reaches <var>limit</var>.
  15916. </p>
  15917. </dd>
  15918. <dt><samp>segment_start_number <var>number</var></samp></dt>
  15919. <dd><p>Set the sequence number of the first segment. Defaults to <code>0</code>.
  15920. </p>
  15921. </dd>
  15922. <dt><samp>strftime <var>1|0</var></samp></dt>
  15923. <dd><p>Use the <code>strftime</code> function to define the name of the new
  15924. segments to write. If this is selected, the output segment name must
  15925. contain a <code>strftime</code> function template. Default value is
  15926. <code>0</code>.
  15927. </p>
  15928. </dd>
  15929. <dt><samp>break_non_keyframes <var>1|0</var></samp></dt>
  15930. <dd><p>If enabled, allow segments to start on frames other than keyframes. This
  15931. improves behavior on some players when the time between keyframes is
  15932. inconsistent, but may make things worse on others, and can cause some oddities
  15933. during seeking. Defaults to <code>0</code>.
  15934. </p>
  15935. </dd>
  15936. <dt><samp>reset_timestamps <var>1|0</var></samp></dt>
  15937. <dd><p>Reset timestamps at the beginning of each segment, so that each segment
  15938. will start with near-zero timestamps. It is meant to ease the playback
  15939. of the generated segments. May not work with some combinations of
  15940. muxers/codecs. It is set to <code>0</code> by default.
  15941. </p>
  15942. </dd>
  15943. <dt><samp>initial_offset <var>offset</var></samp></dt>
  15944. <dd><p>Specify timestamp offset to apply to the output packet timestamps. The
  15945. argument must be a time duration specification, and defaults to 0.
  15946. </p>
  15947. </dd>
  15948. <dt><samp>write_empty_segments <var>1|0</var></samp></dt>
  15949. <dd><p>If enabled, write an empty segment if there are no packets during the period a
  15950. segment would usually span. Otherwise, the segment will be filled with the next
  15951. packet written. Defaults to <code>0</code>.
  15952. </p></dd>
  15953. </dl>
  15954. <p>Make sure to require a closed GOP when encoding and to set the GOP
  15955. size to fit your segment time constraint.
  15956. </p>
  15957. <a name="Examples-15"></a>
  15958. <h4 class="subsection">21.25.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-15" aria-hidden="true">TOC</a></span></h4>
  15959. <ul>
  15960. <li> Remux the content of file <samp>in.mkv</samp> to a list of segments
  15961. <samp>out-000.nut</samp>, <samp>out-001.nut</samp>, etc., and write the list of
  15962. generated segments to <samp>out.list</samp>:
  15963. <div class="example">
  15964. <pre class="example">ffmpeg -i in.mkv -codec hevc -flags +cgop -g 60 -map 0 -f segment -segment_list out.list out%03d.nut
  15965. </pre></div>
  15966. </li><li> Segment input and set output format options for the output segments:
  15967. <div class="example">
  15968. <pre class="example">ffmpeg -i in.mkv -f segment -segment_time 10 -segment_format_options movflags=+faststart out%03d.mp4
  15969. </pre></div>
  15970. </li><li> Segment the input file according to the split points specified by the
  15971. <var>segment_times</var> option:
  15972. <div class="example">
  15973. <pre class="example">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
  15974. </pre></div>
  15975. </li><li> Use the <code>ffmpeg</code> <samp>force_key_frames</samp>
  15976. option to force key frames in the input at the specified location, together
  15977. with the segment option <samp>segment_time_delta</samp> to account for
  15978. possible roundings operated when setting key frame times.
  15979. <div class="example">
  15980. <pre class="example">ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codec:v mpeg4 -codec:a pcm_s16le -map 0 \
  15981. -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
  15982. </pre></div>
  15983. <p>In order to force key frames on the input file, transcoding is
  15984. required.
  15985. </p>
  15986. </li><li> Segment the input file by splitting the input file according to the
  15987. frame numbers sequence specified with the <samp>segment_frames</samp> option:
  15988. <div class="example">
  15989. <pre class="example">ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 out%03d.nut
  15990. </pre></div>
  15991. </li><li> Convert the <samp>in.mkv</samp> to TS segments using the <code>libx264</code>
  15992. and <code>aac</code> encoders:
  15993. <div class="example">
  15994. <pre class="example">ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a aac -f ssegment -segment_list out.list out%03d.ts
  15995. </pre></div>
  15996. </li><li> Segment the input file, and create an M3U8 live playlist (can be used
  15997. as live HLS source):
  15998. <div class="example">
  15999. <pre class="example">ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
  16000. -segment_list_flags +live -segment_time 10 out%03d.mkv
  16001. </pre></div>
  16002. </li></ul>
  16003. <a name="smoothstreaming"></a>
  16004. <h3 class="section">21.26 smoothstreaming<span class="pull-right"><a class="anchor hidden-xs" href="#smoothstreaming" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smoothstreaming" aria-hidden="true">TOC</a></span></h3>
  16005. <p>Smooth Streaming muxer generates a set of files (Manifest, chunks) suitable for serving with conventional web server.
  16006. </p>
  16007. <dl compact="compact">
  16008. <dt><samp>window_size</samp></dt>
  16009. <dd><p>Specify the number of fragments kept in the manifest. Default 0 (keep all).
  16010. </p>
  16011. </dd>
  16012. <dt><samp>extra_window_size</samp></dt>
  16013. <dd><p>Specify the number of fragments kept outside of the manifest before removing from disk. Default 5.
  16014. </p>
  16015. </dd>
  16016. <dt><samp>lookahead_count</samp></dt>
  16017. <dd><p>Specify the number of lookahead fragments. Default 2.
  16018. </p>
  16019. </dd>
  16020. <dt><samp>min_frag_duration</samp></dt>
  16021. <dd><p>Specify the minimum fragment duration (in microseconds). Default 5000000.
  16022. </p>
  16023. </dd>
  16024. <dt><samp>remove_at_exit</samp></dt>
  16025. <dd><p>Specify whether to remove all fragments when finished. Default 0 (do not remove).
  16026. </p>
  16027. </dd>
  16028. </dl>
  16029. <span id="streamhash"></span><a name="streamhash-1"></a>
  16030. <h3 class="section">21.27 streamhash<span class="pull-right"><a class="anchor hidden-xs" href="#streamhash-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-streamhash-1" aria-hidden="true">TOC</a></span></h3>
  16031. <p>Per stream hash testing format.
  16032. </p>
  16033. <p>This muxer computes and prints a cryptographic hash of all the input frames,
  16034. on a per-stream basis. This can be used for equality checks without having
  16035. to do a complete binary comparison.
  16036. </p>
  16037. <p>By default audio frames are converted to signed 16-bit raw audio and
  16038. video frames to raw video before computing the hash, but the output
  16039. of explicit conversions to other codecs can also be used. Timestamps
  16040. are ignored. It uses the SHA-256 cryptographic hash function by default,
  16041. but supports several other algorithms.
  16042. </p>
  16043. <p>The output of the muxer consists of one line per stream of the form:
  16044. <var>streamindex</var>,<var>streamtype</var>,<var>algo</var>=<var>hash</var>, where
  16045. <var>streamindex</var> is the index of the mapped stream, <var>streamtype</var> is a
  16046. single character indicating the type of stream, <var>algo</var> is a short string
  16047. representing the hash function used, and <var>hash</var> is a hexadecimal number
  16048. representing the computed hash.
  16049. </p>
  16050. <dl compact="compact">
  16051. <dt><samp>hash <var>algorithm</var></samp></dt>
  16052. <dd><p>Use the cryptographic hash function specified by the string <var>algorithm</var>.
  16053. Supported values include <code>MD5</code>, <code>murmur3</code>, <code>RIPEMD128</code>,
  16054. <code>RIPEMD160</code>, <code>RIPEMD256</code>, <code>RIPEMD320</code>, <code>SHA160</code>,
  16055. <code>SHA224</code>, <code>SHA256</code> (default), <code>SHA512/224</code>, <code>SHA512/256</code>,
  16056. <code>SHA384</code>, <code>SHA512</code>, <code>CRC32</code> and <code>adler32</code>.
  16057. </p>
  16058. </dd>
  16059. </dl>
  16060. <a name="Examples-16"></a>
  16061. <h4 class="subsection">21.27.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-16" aria-hidden="true">TOC</a></span></h4>
  16062. <p>To compute the SHA-256 hash of the input converted to raw audio and
  16063. video, and store it in the file <samp>out.sha256</samp>:
  16064. </p><div class="example">
  16065. <pre class="example">ffmpeg -i INPUT -f streamhash out.sha256
  16066. </pre></div>
  16067. <p>To print an MD5 hash to stdout use the command:
  16068. </p><div class="example">
  16069. <pre class="example">ffmpeg -i INPUT -f streamhash -hash md5 -
  16070. </pre></div>
  16071. <p>See also the <a href="#hash">hash</a> and <a href="#framehash">framehash</a> muxers.
  16072. </p>
  16073. <span id="fifo"></span><a name="fifo-1"></a>
  16074. <h3 class="section">21.28 fifo<span class="pull-right"><a class="anchor hidden-xs" href="#fifo-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fifo-1" aria-hidden="true">TOC</a></span></h3>
  16075. <p>The fifo pseudo-muxer allows the separation of encoding and muxing by using
  16076. first-in-first-out queue and running the actual muxer in a separate thread. This
  16077. is especially useful in combination with the <a href="#tee">tee</a> muxer and can be used to
  16078. send data to several destinations with different reliability/writing speed/latency.
  16079. </p>
  16080. <p>API users should be aware that callback functions (interrupt_callback,
  16081. io_open and io_close) used within its AVFormatContext must be thread-safe.
  16082. </p>
  16083. <p>The behavior of the fifo muxer if the queue fills up or if the output fails is
  16084. selectable,
  16085. </p>
  16086. <ul>
  16087. <li> output can be transparently restarted with configurable delay between retries
  16088. based on real time or time of the processed stream.
  16089. </li><li> encoding can be blocked during temporary failure, or continue transparently
  16090. dropping packets in case fifo queue fills up.
  16091. </li></ul>
  16092. <dl compact="compact">
  16093. <dt><samp>fifo_format</samp></dt>
  16094. <dd><p>Specify the format name. Useful if it cannot be guessed from the
  16095. output name suffix.
  16096. </p>
  16097. </dd>
  16098. <dt><samp>queue_size</samp></dt>
  16099. <dd><p>Specify size of the queue (number of packets). Default value is 60.
  16100. </p>
  16101. </dd>
  16102. <dt><samp>format_opts</samp></dt>
  16103. <dd><p>Specify format options for the underlying muxer. Muxer options can be specified
  16104. as a list of <var>key</var>=<var>value</var> pairs separated by &rsquo;:&rsquo;.
  16105. </p>
  16106. </dd>
  16107. <dt><samp>drop_pkts_on_overflow <var>bool</var></samp></dt>
  16108. <dd><p>If set to 1 (true), in case the fifo queue fills up, packets will be dropped
  16109. rather than blocking the encoder. This makes it possible to continue streaming without
  16110. delaying the input, at the cost of omitting part of the stream. By default
  16111. this option is set to 0 (false), so in such cases the encoder will be blocked
  16112. until the muxer processes some of the packets and none of them is lost.
  16113. </p>
  16114. </dd>
  16115. <dt><samp>attempt_recovery <var>bool</var></samp></dt>
  16116. <dd><p>If failure occurs, attempt to recover the output. This is especially useful
  16117. when used with network output, since it makes it possible to restart streaming transparently.
  16118. By default this option is set to 0 (false).
  16119. </p>
  16120. </dd>
  16121. <dt><samp>max_recovery_attempts</samp></dt>
  16122. <dd><p>Sets maximum number of successive unsuccessful recovery attempts after which
  16123. the output fails permanently. By default this option is set to 0 (unlimited).
  16124. </p>
  16125. </dd>
  16126. <dt><samp>recovery_wait_time <var>duration</var></samp></dt>
  16127. <dd><p>Waiting time before the next recovery attempt after previous unsuccessful
  16128. recovery attempt. Default value is 5 seconds.
  16129. </p>
  16130. </dd>
  16131. <dt><samp>recovery_wait_streamtime <var>bool</var></samp></dt>
  16132. <dd><p>If set to 0 (false), the real time is used when waiting for the recovery
  16133. attempt (i.e. the recovery will be attempted after at least
  16134. recovery_wait_time seconds).
  16135. If set to 1 (true), the time of the processed stream is taken into account
  16136. instead (i.e. the recovery will be attempted after at least <var>recovery_wait_time</var>
  16137. seconds of the stream is omitted).
  16138. By default, this option is set to 0 (false).
  16139. </p>
  16140. </dd>
  16141. <dt><samp>recover_any_error <var>bool</var></samp></dt>
  16142. <dd><p>If set to 1 (true), recovery will be attempted regardless of type of the error
  16143. causing the failure. By default this option is set to 0 (false) and in case of
  16144. certain (usually permanent) errors the recovery is not attempted even when
  16145. <var>attempt_recovery</var> is set to 1.
  16146. </p>
  16147. </dd>
  16148. <dt><samp>restart_with_keyframe <var>bool</var></samp></dt>
  16149. <dd><p>Specify whether to wait for the keyframe after recovering from
  16150. queue overflow or failure. This option is set to 0 (false) by default.
  16151. </p>
  16152. </dd>
  16153. <dt><samp>timeshift <var>duration</var></samp></dt>
  16154. <dd><p>Buffer the specified amount of packets and delay writing the output. Note that
  16155. <var>queue_size</var> must be big enough to store the packets for timeshift. At the
  16156. end of the input the fifo buffer is flushed at realtime speed.
  16157. </p>
  16158. </dd>
  16159. </dl>
  16160. <a name="Examples-17"></a>
  16161. <h4 class="subsection">21.28.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-17" aria-hidden="true">TOC</a></span></h4>
  16162. <ul>
  16163. <li> Stream something to rtmp server, continue processing the stream at real-time
  16164. rate even in case of temporary failure (network outage) and attempt to recover
  16165. streaming every second indefinitely.
  16166. <div class="example">
  16167. <pre class="example">ffmpeg -re -i ... -c:v libx264 -c:a aac -f fifo -fifo_format flv -map 0:v -map 0:a
  16168. -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 1 rtmp://example.com/live/stream_name
  16169. </pre></div>
  16170. </li></ul>
  16171. <span id="tee"></span><a name="tee-1"></a>
  16172. <h3 class="section">21.29 tee<span class="pull-right"><a class="anchor hidden-xs" href="#tee-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tee-1" aria-hidden="true">TOC</a></span></h3>
  16173. <p>The tee muxer can be used to write the same data to several outputs, such as files or streams.
  16174. It can be used, for example, to stream a video over a network and save it to disk at the same time.
  16175. </p>
  16176. <p>It is different from specifying several outputs to the <code>ffmpeg</code>
  16177. command-line tool. With the tee muxer, the audio and video data will be encoded only once.
  16178. With conventional multiple outputs, multiple encoding operations in parallel are initiated,
  16179. which can be a very expensive process. The tee muxer is not useful when using the libavformat API
  16180. directly because it is then possible to feed the same packets to several muxers directly.
  16181. </p>
  16182. <p>Since the tee muxer does not represent any particular output format, ffmpeg cannot auto-select
  16183. output streams. So all streams intended for output must be specified using <code>-map</code>. See
  16184. the examples below.
  16185. </p>
  16186. <p>Some encoders may need different options depending on the output format;
  16187. the auto-detection of this can not work with the tee muxer, so they need to be explicitly specified.
  16188. The main example is the <samp>global_header</samp> flag.
  16189. </p>
  16190. <p>The slave outputs are specified in the file name given to the muxer,
  16191. separated by &rsquo;|&rsquo;. If any of the slave name contains the &rsquo;|&rsquo; separator,
  16192. leading or trailing spaces or any special character, those must be
  16193. escaped (see <a href="ffmpeg-utils.html#quoting_005fand_005fescaping">(ffmpeg-utils)the &quot;Quoting and escaping&quot;
  16194. section in the ffmpeg-utils(1) manual</a>).
  16195. </p>
  16196. <a name="Options-53"></a>
  16197. <h4 class="subsection">21.29.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-53" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-53" aria-hidden="true">TOC</a></span></h4>
  16198. <dl compact="compact">
  16199. <dt><samp>use_fifo <var>bool</var></samp></dt>
  16200. <dd><p>If set to 1, slave outputs will be processed in separate threads using the <a href="#fifo">fifo</a>
  16201. muxer. This allows to compensate for different speed/latency/reliability of
  16202. outputs and setup transparent recovery. By default this feature is turned off.
  16203. </p>
  16204. </dd>
  16205. <dt><samp>fifo_options</samp></dt>
  16206. <dd><p>Options to pass to fifo pseudo-muxer instances. See <a href="#fifo">fifo</a>.
  16207. </p>
  16208. </dd>
  16209. </dl>
  16210. <p>Muxer options can be specified for each slave by prepending them as a list of
  16211. <var>key</var>=<var>value</var> pairs separated by &rsquo;:&rsquo;, between square brackets. If
  16212. the options values contain a special character or the &rsquo;:&rsquo; separator, they
  16213. must be escaped; note that this is a second level escaping.
  16214. </p>
  16215. <p>The following special options are also recognized:
  16216. </p><dl compact="compact">
  16217. <dt><samp>f</samp></dt>
  16218. <dd><p>Specify the format name. Required if it cannot be guessed from the
  16219. output URL.
  16220. </p>
  16221. </dd>
  16222. <dt><samp>bsfs[/<var>spec</var>]</samp></dt>
  16223. <dd><p>Specify a list of bitstream filters to apply to the specified
  16224. output.
  16225. </p>
  16226. <p>It is possible to specify to which streams a given bitstream filter
  16227. applies, by appending a stream specifier to the option separated by
  16228. <code>/</code>. <var>spec</var> must be a stream specifier (see <a href="#Format-stream-specifiers">Format stream specifiers</a>).
  16229. </p>
  16230. <p>If the stream specifier is not specified, the bitstream filters will be
  16231. applied to all streams in the output. This will cause that output operation
  16232. to fail if the output contains streams to which the bitstream filter cannot
  16233. be applied e.g. <code>h264_mp4toannexb</code> being applied to an output containing an audio stream.
  16234. </p>
  16235. <p>Options for a bitstream filter must be specified in the form of <code>opt=value</code>.
  16236. </p>
  16237. <p>Several bitstream filters can be specified, separated by &quot;,&quot;.
  16238. </p>
  16239. </dd>
  16240. <dt><samp>use_fifo <var>bool</var></samp></dt>
  16241. <dd><p>This allows to override tee muxer use_fifo option for individual slave muxer.
  16242. </p>
  16243. </dd>
  16244. <dt><samp>fifo_options</samp></dt>
  16245. <dd><p>This allows to override tee muxer fifo_options for individual slave muxer.
  16246. See <a href="#fifo">fifo</a>.
  16247. </p>
  16248. </dd>
  16249. <dt><samp>select</samp></dt>
  16250. <dd><p>Select the streams that should be mapped to the slave output,
  16251. specified by a stream specifier. If not specified, this defaults to
  16252. all the mapped streams. This will cause that output operation to fail
  16253. if the output format does not accept all mapped streams.
  16254. </p>
  16255. <p>You may use multiple stream specifiers separated by commas (<code>,</code>) e.g.: <code>a:0,v</code>
  16256. </p>
  16257. </dd>
  16258. <dt><samp>onfail</samp></dt>
  16259. <dd><p>Specify behaviour on output failure. This can be set to either <code>abort</code> (which is
  16260. default) or <code>ignore</code>. <code>abort</code> will cause whole process to fail in case of failure
  16261. on this slave output. <code>ignore</code> will ignore failure on this output, so other outputs
  16262. will continue without being affected.
  16263. </p></dd>
  16264. </dl>
  16265. <a name="Examples-18"></a>
  16266. <h4 class="subsection">21.29.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-18" aria-hidden="true">TOC</a></span></h4>
  16267. <ul>
  16268. <li> Encode something and both archive it in a WebM file and stream it
  16269. as MPEG-TS over UDP:
  16270. <div class="example">
  16271. <pre class="example">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  16272. &quot;archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  16273. </pre></div>
  16274. </li><li> As above, but continue streaming even if output to local file fails
  16275. (for example local drive fills up):
  16276. <div class="example">
  16277. <pre class="example">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  16278. &quot;[onfail=ignore]archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  16279. </pre></div>
  16280. </li><li> Use <code>ffmpeg</code> to encode the input, and send the output
  16281. to three different destinations. The <code>dump_extra</code> bitstream
  16282. filter is used to add extradata information to all the output video
  16283. keyframes packets, as requested by the MPEG-TS format. The select
  16284. option is applied to <samp>out.aac</samp> in order to make it contain only
  16285. audio packets.
  16286. <div class="example">
  16287. <pre class="example">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  16288. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac&quot;
  16289. </pre></div>
  16290. </li><li> As above, but select only stream <code>a:1</code> for the audio output. Note
  16291. that a second level escaping must be performed, as &quot;:&quot; is a special
  16292. character used to separate options.
  16293. <div class="example">
  16294. <pre class="example">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  16295. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=\'a:1\']out.aac&quot;
  16296. </pre></div>
  16297. </li></ul>
  16298. <a name="webm_005fdash_005fmanifest"></a>
  16299. <h3 class="section">21.30 webm_dash_manifest<span class="pull-right"><a class="anchor hidden-xs" href="#webm_005fdash_005fmanifest" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-webm_005fdash_005fmanifest" aria-hidden="true">TOC</a></span></h3>
  16300. <p>WebM DASH Manifest muxer.
  16301. </p>
  16302. <p>This muxer implements the WebM DASH Manifest specification to generate the DASH
  16303. manifest XML. It also supports manifest generation for DASH live streams.
  16304. </p>
  16305. <p>For more information see:
  16306. </p>
  16307. <ul>
  16308. <li> WebM DASH Specification: <a 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>
  16309. </li><li> ISO DASH Specification: <a 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>
  16310. </li></ul>
  16311. <a name="Options-54"></a>
  16312. <h4 class="subsection">21.30.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-54" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-54" aria-hidden="true">TOC</a></span></h4>
  16313. <p>This muxer supports the following options:
  16314. </p>
  16315. <dl compact="compact">
  16316. <dt><samp>adaptation_sets</samp></dt>
  16317. <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
  16318. unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding
  16319. audio and video streams. Any number of adaptation sets can be added using this option.
  16320. </p>
  16321. </dd>
  16322. <dt><samp>live</samp></dt>
  16323. <dd><p>Set this to 1 to create a live stream DASH Manifest. Default: 0.
  16324. </p>
  16325. </dd>
  16326. <dt><samp>chunk_start_index</samp></dt>
  16327. <dd><p>Start index of the first chunk. This will go in the &lsquo;<samp>startNumber</samp>&rsquo; attribute
  16328. of the &lsquo;<samp>SegmentTemplate</samp>&rsquo; element in the manifest. Default: 0.
  16329. </p>
  16330. </dd>
  16331. <dt><samp>chunk_duration_ms</samp></dt>
  16332. <dd><p>Duration of each chunk in milliseconds. This will go in the &lsquo;<samp>duration</samp>&rsquo;
  16333. attribute of the &lsquo;<samp>SegmentTemplate</samp>&rsquo; element in the manifest. Default: 1000.
  16334. </p>
  16335. </dd>
  16336. <dt><samp>utc_timing_url</samp></dt>
  16337. <dd><p>URL of the page that will return the UTC timestamp in ISO format. This will go
  16338. in the &lsquo;<samp>value</samp>&rsquo; attribute of the &lsquo;<samp>UTCTiming</samp>&rsquo; element in the manifest.
  16339. Default: None.
  16340. </p>
  16341. </dd>
  16342. <dt><samp>time_shift_buffer_depth</samp></dt>
  16343. <dd><p>Smallest time (in seconds) shifting buffer for which any Representation is
  16344. guaranteed to be available. This will go in the &lsquo;<samp>timeShiftBufferDepth</samp>&rsquo;
  16345. attribute of the &lsquo;<samp>MPD</samp>&rsquo; element. Default: 60.
  16346. </p>
  16347. </dd>
  16348. <dt><samp>minimum_update_period</samp></dt>
  16349. <dd><p>Minimum update period (in seconds) of the manifest. This will go in the
  16350. &lsquo;<samp>minimumUpdatePeriod</samp>&rsquo; attribute of the &lsquo;<samp>MPD</samp>&rsquo; element. Default: 0.
  16351. </p>
  16352. </dd>
  16353. </dl>
  16354. <a name="Example-2"></a>
  16355. <h4 class="subsection">21.30.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-2" aria-hidden="true">TOC</a></span></h4>
  16356. <div class="example">
  16357. <pre class="example">ffmpeg -f webm_dash_manifest -i video1.webm \
  16358. -f webm_dash_manifest -i video2.webm \
  16359. -f webm_dash_manifest -i audio1.webm \
  16360. -f webm_dash_manifest -i audio2.webm \
  16361. -map 0 -map 1 -map 2 -map 3 \
  16362. -c copy \
  16363. -f webm_dash_manifest \
  16364. -adaptation_sets &quot;id=0,streams=0,1 id=1,streams=2,3&quot; \
  16365. manifest.xml
  16366. </pre></div>
  16367. <a name="webm_005fchunk"></a>
  16368. <h3 class="section">21.31 webm_chunk<span class="pull-right"><a class="anchor hidden-xs" href="#webm_005fchunk" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-webm_005fchunk" aria-hidden="true">TOC</a></span></h3>
  16369. <p>WebM Live Chunk Muxer.
  16370. </p>
  16371. <p>This muxer writes out WebM headers and chunks as separate files which can be
  16372. consumed by clients that support WebM Live streams via DASH.
  16373. </p>
  16374. <a name="Options-55"></a>
  16375. <h4 class="subsection">21.31.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-55" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-55" aria-hidden="true">TOC</a></span></h4>
  16376. <p>This muxer supports the following options:
  16377. </p>
  16378. <dl compact="compact">
  16379. <dt><samp>chunk_start_index</samp></dt>
  16380. <dd><p>Index of the first chunk (defaults to 0).
  16381. </p>
  16382. </dd>
  16383. <dt><samp>header</samp></dt>
  16384. <dd><p>Filename of the header where the initialization data will be written.
  16385. </p>
  16386. </dd>
  16387. <dt><samp>audio_chunk_duration</samp></dt>
  16388. <dd><p>Duration of each audio chunk in milliseconds (defaults to 5000).
  16389. </p></dd>
  16390. </dl>
  16391. <a name="Example-3"></a>
  16392. <h4 class="subsection">21.31.2 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-3" aria-hidden="true">TOC</a></span></h4>
  16393. <div class="example">
  16394. <pre class="example">ffmpeg -f v4l2 -i /dev/video0 \
  16395. -f alsa -i hw:0 \
  16396. -map 0:0 \
  16397. -c:v libvpx-vp9 \
  16398. -s 640x360 -keyint_min 30 -g 30 \
  16399. -f webm_chunk \
  16400. -header webm_live_video_360.hdr \
  16401. -chunk_start_index 1 \
  16402. webm_live_video_360_%d.chk \
  16403. -map 1:0 \
  16404. -c:a libvorbis \
  16405. -b:a 128k \
  16406. -f webm_chunk \
  16407. -header webm_live_audio_128.hdr \
  16408. -chunk_start_index 1 \
  16409. -audio_chunk_duration 1000 \
  16410. webm_live_audio_128_%d.chk
  16411. </pre></div>
  16412. <a name="Metadata-1"></a>
  16413. <h2 class="chapter">22 Metadata<span class="pull-right"><a class="anchor hidden-xs" href="#Metadata-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Metadata-1" aria-hidden="true">TOC</a></span></h2>
  16414. <p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
  16415. INI-like text file and then load it back using the metadata muxer/demuxer.
  16416. </p>
  16417. <p>The file format is as follows:
  16418. </p><ol>
  16419. <li> A file consists of a header and a number of metadata tags divided into sections,
  16420. each on its own line.
  16421. </li><li> The header is a &lsquo;<samp>;FFMETADATA</samp>&rsquo; string, followed by a version number (now 1).
  16422. </li><li> Metadata tags are of the form &lsquo;<samp>key=value</samp>&rsquo;
  16423. </li><li> Immediately after header follows global metadata
  16424. </li><li> After global metadata there may be sections with per-stream/per-chapter
  16425. metadata.
  16426. </li><li> A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
  16427. brackets (&lsquo;<samp>[</samp>&rsquo;, &lsquo;<samp>]</samp>&rsquo;) and ends with next section or end of file.
  16428. </li><li> At the beginning of a chapter section there may be an optional timebase to be
  16429. used for start/end values. It must be in form
  16430. &lsquo;<samp>TIMEBASE=<var>num</var>/<var>den</var></samp>&rsquo;, where <var>num</var> and <var>den</var> are
  16431. integers. If the timebase is missing then start/end times are assumed to
  16432. be in nanoseconds.
  16433. <p>Next a chapter section must contain chapter start and end times in form
  16434. &lsquo;<samp>START=<var>num</var></samp>&rsquo;, &lsquo;<samp>END=<var>num</var></samp>&rsquo;, where <var>num</var> is a positive
  16435. integer.
  16436. </p>
  16437. </li><li> Empty lines and lines starting with &lsquo;<samp>;</samp>&rsquo; or &lsquo;<samp>#</samp>&rsquo; are ignored.
  16438. </li><li> Metadata keys or values containing special characters (&lsquo;<samp>=</samp>&rsquo;, &lsquo;<samp>;</samp>&rsquo;,
  16439. &lsquo;<samp>#</samp>&rsquo;, &lsquo;<samp>\</samp>&rsquo; and a newline) must be escaped with a backslash &lsquo;<samp>\</samp>&rsquo;.
  16440. </li><li> Note that whitespace in metadata (e.g. &lsquo;<samp>foo = bar</samp>&rsquo;) is considered to be
  16441. a part of the tag (in the example above key is &lsquo;<samp>foo </samp>&rsquo;, value is
  16442. &lsquo;<samp> bar</samp>&rsquo;).
  16443. </li></ol>
  16444. <p>A ffmetadata file might look like this:
  16445. </p><div class="example">
  16446. <pre class="example">;FFMETADATA1
  16447. title=bike\\shed
  16448. ;this is a comment
  16449. artist=FFmpeg troll team
  16450. [CHAPTER]
  16451. TIMEBASE=1/1000
  16452. START=0
  16453. #chapter ends at 0:01:00
  16454. END=60000
  16455. title=chapter \#1
  16456. [STREAM]
  16457. title=multi\
  16458. line
  16459. </pre></div>
  16460. <p>By using the ffmetadata muxer and demuxer it is possible to extract
  16461. metadata from an input file to an ffmetadata file, and then transcode
  16462. the file into an output file with the edited ffmetadata file.
  16463. </p>
  16464. <p>Extracting an ffmetadata file with <samp>ffmpeg</samp> goes as follows:
  16465. </p><div class="example">
  16466. <pre class="example">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
  16467. </pre></div>
  16468. <p>Reinserting edited metadata information from the FFMETADATAFILE file can
  16469. be done as:
  16470. </p><div class="example">
  16471. <pre class="example">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
  16472. </pre></div>
  16473. <a name="Protocol-Options"></a>
  16474. <h2 class="chapter">23 Protocol Options<span class="pull-right"><a class="anchor hidden-xs" href="#Protocol-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Protocol-Options" aria-hidden="true">TOC</a></span></h2>
  16475. <p>The libavformat library provides some generic global options, which
  16476. can be set on all the protocols. In addition each protocol may support
  16477. so-called private options, which are specific for that component.
  16478. </p>
  16479. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  16480. FFmpeg tools, or by setting the value explicitly in the
  16481. <code>AVFormatContext</code> options or using the <samp>libavutil/opt.h</samp> API
  16482. for programmatic use.
  16483. </p>
  16484. <p>The list of supported options follows:
  16485. </p>
  16486. <dl compact="compact">
  16487. <dt><samp>protocol_whitelist <var>list</var> (<em>input</em>)</samp></dt>
  16488. <dd><p>Set a &quot;,&quot;-separated list of allowed protocols. &quot;ALL&quot; matches all protocols. Protocols
  16489. prefixed by &quot;-&quot; are disabled.
  16490. All protocols are allowed by default but protocols used by an another
  16491. protocol (nested protocols) are restricted to a per protocol subset.
  16492. </p></dd>
  16493. </dl>
  16494. <a name="Protocols"></a>
  16495. <h2 class="chapter">24 Protocols<span class="pull-right"><a class="anchor hidden-xs" href="#Protocols" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Protocols" aria-hidden="true">TOC</a></span></h2>
  16496. <p>Protocols are configured elements in FFmpeg that enable access to
  16497. resources that require specific protocols.
  16498. </p>
  16499. <p>When you configure your FFmpeg build, all the supported protocols are
  16500. enabled by default. You can list all available ones using the
  16501. configure option &quot;&ndash;list-protocols&quot;.
  16502. </p>
  16503. <p>You can disable all the protocols using the configure option
  16504. &quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
  16505. option &quot;&ndash;enable-protocol=<var>PROTOCOL</var>&quot;, or you can disable a
  16506. particular protocol using the option
  16507. &quot;&ndash;disable-protocol=<var>PROTOCOL</var>&quot;.
  16508. </p>
  16509. <p>The option &quot;-protocols&quot; of the ff* tools will display the list of
  16510. supported protocols.
  16511. </p>
  16512. <p>All protocols accept the following options:
  16513. </p>
  16514. <dl compact="compact">
  16515. <dt><samp>rw_timeout</samp></dt>
  16516. <dd><p>Maximum time to wait for (network) read/write operations to complete,
  16517. in microseconds.
  16518. </p></dd>
  16519. </dl>
  16520. <p>A description of the currently available protocols follows.
  16521. </p>
  16522. <a name="amqp"></a>
  16523. <h3 class="section">24.1 amqp<span class="pull-right"><a class="anchor hidden-xs" href="#amqp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amqp" aria-hidden="true">TOC</a></span></h3>
  16524. <p>Advanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker based
  16525. publish-subscribe communication protocol.
  16526. </p>
  16527. <p>FFmpeg must be compiled with &ndash;enable-librabbitmq to support AMQP. A separate
  16528. AMQP broker must also be run. An example open-source AMQP broker is RabbitMQ.
  16529. </p>
  16530. <p>After starting the broker, an FFmpeg client may stream data to the broker using
  16531. the command:
  16532. </p>
  16533. <div class="example">
  16534. <pre class="example">ffmpeg -re -i input -f mpegts amqp://[[user]:[password]@]hostname[:port][/vhost]
  16535. </pre></div>
  16536. <p>Where hostname and port (default is 5672) is the address of the broker. The
  16537. client may also set a user/password for authentication. The default for both
  16538. fields is &quot;guest&quot;. Name of virtual host on broker can be set with vhost. The
  16539. default value is &quot;/&quot;.
  16540. </p>
  16541. <p>Muliple subscribers may stream from the broker using the command:
  16542. </p><div class="example">
  16543. <pre class="example">ffplay amqp://[[user]:[password]@]hostname[:port][/vhost]
  16544. </pre></div>
  16545. <p>In RabbitMQ all data published to the broker flows through a specific exchange,
  16546. and each subscribing client has an assigned queue/buffer. When a packet arrives
  16547. at an exchange, it may be copied to a client&rsquo;s queue depending on the exchange
  16548. and routing_key fields.
  16549. </p>
  16550. <p>The following options are supported:
  16551. </p>
  16552. <dl compact="compact">
  16553. <dt><samp>exchange</samp></dt>
  16554. <dd><p>Sets the exchange to use on the broker. RabbitMQ has several predefined
  16555. exchanges: &quot;amq.direct&quot; is the default exchange, where the publisher and
  16556. subscriber must have a matching routing_key; &quot;amq.fanout&quot; is the same as a
  16557. broadcast operation (i.e. the data is forwarded to all queues on the fanout
  16558. exchange independent of the routing_key); and &quot;amq.topic&quot; is similar to
  16559. &quot;amq.direct&quot;, but allows for more complex pattern matching (refer to the RabbitMQ
  16560. documentation).
  16561. </p>
  16562. </dd>
  16563. <dt><samp>routing_key</samp></dt>
  16564. <dd><p>Sets the routing key. The default value is &quot;amqp&quot;. The routing key is used on
  16565. the &quot;amq.direct&quot; and &quot;amq.topic&quot; exchanges to decide whether packets are written
  16566. to the queue of a subscriber.
  16567. </p>
  16568. </dd>
  16569. <dt><samp>pkt_size</samp></dt>
  16570. <dd><p>Maximum size of each packet sent/received to the broker. Default is 131072.
  16571. Minimum is 4096 and max is any large value (representable by an int). When
  16572. receiving packets, this sets an internal buffer size in FFmpeg. It should be
  16573. equal to or greater than the size of the published packets to the broker. Otherwise
  16574. the received message may be truncated causing decoding errors.
  16575. </p>
  16576. </dd>
  16577. <dt><samp>connection_timeout</samp></dt>
  16578. <dd><p>The timeout in seconds during the initial connection to the broker. The
  16579. default value is rw_timeout, or 5 seconds if rw_timeout is not set.
  16580. </p>
  16581. </dd>
  16582. <dt><samp>delivery_mode <var>mode</var></samp></dt>
  16583. <dd><p>Sets the delivery mode of each message sent to broker.
  16584. The following values are accepted:
  16585. </p><dl compact="compact">
  16586. <dt>&lsquo;<samp>persistent</samp>&rsquo;</dt>
  16587. <dd><p>Delivery mode set to &quot;persistent&quot; (2). This is the default value.
  16588. Messages may be written to the broker&rsquo;s disk depending on its setup.
  16589. </p>
  16590. </dd>
  16591. <dt>&lsquo;<samp>non-persistent</samp>&rsquo;</dt>
  16592. <dd><p>Delivery mode set to &quot;non-persistent&quot; (1).
  16593. Messages will stay in broker&rsquo;s memory unless the broker is under memory
  16594. pressure.
  16595. </p>
  16596. </dd>
  16597. </dl>
  16598. </dd>
  16599. </dl>
  16600. <a name="async"></a>
  16601. <h3 class="section">24.2 async<span class="pull-right"><a class="anchor hidden-xs" href="#async" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-async" aria-hidden="true">TOC</a></span></h3>
  16602. <p>Asynchronous data filling wrapper for input stream.
  16603. </p>
  16604. <p>Fill data in a background thread, to decouple I/O operation from demux thread.
  16605. </p>
  16606. <div class="example">
  16607. <pre class="example">async:<var>URL</var>
  16608. async:http://host/resource
  16609. async:cache:http://host/resource
  16610. </pre></div>
  16611. <a name="bluray"></a>
  16612. <h3 class="section">24.3 bluray<span class="pull-right"><a class="anchor hidden-xs" href="#bluray" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bluray" aria-hidden="true">TOC</a></span></h3>
  16613. <p>Read BluRay playlist.
  16614. </p>
  16615. <p>The accepted options are:
  16616. </p><dl compact="compact">
  16617. <dt><samp>angle</samp></dt>
  16618. <dd><p>BluRay angle
  16619. </p>
  16620. </dd>
  16621. <dt><samp>chapter</samp></dt>
  16622. <dd><p>Start chapter (1...N)
  16623. </p>
  16624. </dd>
  16625. <dt><samp>playlist</samp></dt>
  16626. <dd><p>Playlist to read (BDMV/PLAYLIST/?????.mpls)
  16627. </p>
  16628. </dd>
  16629. </dl>
  16630. <p>Examples:
  16631. </p>
  16632. <p>Read longest playlist from BluRay mounted to /mnt/bluray:
  16633. </p><div class="example">
  16634. <pre class="example">bluray:/mnt/bluray
  16635. </pre></div>
  16636. <p>Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
  16637. </p><div class="example">
  16638. <pre class="example">-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
  16639. </pre></div>
  16640. <a name="cache"></a>
  16641. <h3 class="section">24.4 cache<span class="pull-right"><a class="anchor hidden-xs" href="#cache" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cache" aria-hidden="true">TOC</a></span></h3>
  16642. <p>Caching wrapper for input stream.
  16643. </p>
  16644. <p>Cache the input stream to temporary file. It brings seeking capability to live streams.
  16645. </p>
  16646. <p>The accepted options are:
  16647. </p><dl compact="compact">
  16648. <dt><samp>read_ahead_limit</samp></dt>
  16649. <dd><p>Amount in bytes that may be read ahead when seeking isn&rsquo;t supported. Range is -1 to INT_MAX.
  16650. -1 for unlimited. Default is 65536.
  16651. </p>
  16652. </dd>
  16653. </dl>
  16654. <p>URL Syntax is
  16655. </p><div class="example">
  16656. <pre class="example">cache:<var>URL</var>
  16657. </pre></div>
  16658. <a name="concat-2"></a>
  16659. <h3 class="section">24.5 concat<span class="pull-right"><a class="anchor hidden-xs" href="#concat-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concat-2" aria-hidden="true">TOC</a></span></h3>
  16660. <p>Physical concatenation protocol.
  16661. </p>
  16662. <p>Read and seek from many resources in sequence as if they were
  16663. a unique resource.
  16664. </p>
  16665. <p>A URL accepted by this protocol has the syntax:
  16666. </p><div class="example">
  16667. <pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
  16668. </pre></div>
  16669. <p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
  16670. resource to be concatenated, each one possibly specifying a distinct
  16671. protocol.
  16672. </p>
  16673. <p>For example to read a sequence of files <samp>split1.mpeg</samp>,
  16674. <samp>split2.mpeg</samp>, <samp>split3.mpeg</samp> with <code>ffplay</code> use the
  16675. command:
  16676. </p><div class="example">
  16677. <pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
  16678. </pre></div>
  16679. <p>Note that you may need to escape the character &quot;|&quot; which is special for
  16680. many shells.
  16681. </p>
  16682. <a name="crypto"></a>
  16683. <h3 class="section">24.6 crypto<span class="pull-right"><a class="anchor hidden-xs" href="#crypto" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crypto" aria-hidden="true">TOC</a></span></h3>
  16684. <p>AES-encrypted stream reading protocol.
  16685. </p>
  16686. <p>The accepted options are:
  16687. </p><dl compact="compact">
  16688. <dt><samp>key</samp></dt>
  16689. <dd><p>Set the AES decryption key binary block from given hexadecimal representation.
  16690. </p>
  16691. </dd>
  16692. <dt><samp>iv</samp></dt>
  16693. <dd><p>Set the AES decryption initialization vector binary block from given hexadecimal representation.
  16694. </p></dd>
  16695. </dl>
  16696. <p>Accepted URL formats:
  16697. </p><div class="example">
  16698. <pre class="example">crypto:<var>URL</var>
  16699. crypto+<var>URL</var>
  16700. </pre></div>
  16701. <a name="data"></a>
  16702. <h3 class="section">24.7 data<span class="pull-right"><a class="anchor hidden-xs" href="#data" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-data" aria-hidden="true">TOC</a></span></h3>
  16703. <p>Data in-line in the URI. See <a href="http://en.wikipedia.org/wiki/Data_URI_scheme">http://en.wikipedia.org/wiki/Data_URI_scheme</a>.
  16704. </p>
  16705. <p>For example, to convert a GIF file given inline with <code>ffmpeg</code>:
  16706. </p><div class="example">
  16707. <pre class="example">ffmpeg -i &quot;data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=&quot; smiley.png
  16708. </pre></div>
  16709. <a name="file"></a>
  16710. <h3 class="section">24.8 file<span class="pull-right"><a class="anchor hidden-xs" href="#file" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-file" aria-hidden="true">TOC</a></span></h3>
  16711. <p>File access protocol.
  16712. </p>
  16713. <p>Read from or write to a file.
  16714. </p>
  16715. <p>A file URL can have the form:
  16716. </p><div class="example">
  16717. <pre class="example">file:<var>filename</var>
  16718. </pre></div>
  16719. <p>where <var>filename</var> is the path of the file to read.
  16720. </p>
  16721. <p>An URL that does not have a protocol prefix will be assumed to be a
  16722. file URL. Depending on the build, an URL that looks like a Windows
  16723. path with the drive letter at the beginning will also be assumed to be
  16724. a file URL (usually not the case in builds for unix-like systems).
  16725. </p>
  16726. <p>For example to read from a file <samp>input.mpeg</samp> with <code>ffmpeg</code>
  16727. use the command:
  16728. </p><div class="example">
  16729. <pre class="example">ffmpeg -i file:input.mpeg output.mpeg
  16730. </pre></div>
  16731. <p>This protocol accepts the following options:
  16732. </p>
  16733. <dl compact="compact">
  16734. <dt><samp>truncate</samp></dt>
  16735. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  16736. truncating. Default value is 1.
  16737. </p>
  16738. </dd>
  16739. <dt><samp>blocksize</samp></dt>
  16740. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  16741. <code>INT_MAX</code>, which results in not limiting the requested block size.
  16742. Setting this value reasonably low improves user termination request reaction
  16743. time, which is valuable for files on slow medium.
  16744. </p>
  16745. </dd>
  16746. <dt><samp>follow</samp></dt>
  16747. <dd><p>If set to 1, the protocol will retry reading at the end of the file, allowing
  16748. reading files that still are being written. In order for this to terminate,
  16749. you either need to use the rw_timeout option, or use the interrupt callback
  16750. (for API users).
  16751. </p>
  16752. </dd>
  16753. <dt><samp>seekable</samp></dt>
  16754. <dd><p>Controls if seekability is advertised on the file. 0 means non-seekable, -1
  16755. means auto (seekable for normal files, non-seekable for named pipes).
  16756. </p>
  16757. <p>Many demuxers handle seekable and non-seekable resources differently,
  16758. overriding this might speed up opening certain files at the cost of losing some
  16759. features (e.g. accurate seeking).
  16760. </p></dd>
  16761. </dl>
  16762. <a name="ftp"></a>
  16763. <h3 class="section">24.9 ftp<span class="pull-right"><a class="anchor hidden-xs" href="#ftp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ftp" aria-hidden="true">TOC</a></span></h3>
  16764. <p>FTP (File Transfer Protocol).
  16765. </p>
  16766. <p>Read from or write to remote resources using FTP protocol.
  16767. </p>
  16768. <p>Following syntax is required.
  16769. </p><div class="example">
  16770. <pre class="example">ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  16771. </pre></div>
  16772. <p>This protocol accepts the following options.
  16773. </p>
  16774. <dl compact="compact">
  16775. <dt><samp>timeout</samp></dt>
  16776. <dd><p>Set timeout in microseconds of socket I/O operations used by the underlying low level
  16777. operation. By default it is set to -1, which means that the timeout is
  16778. not specified.
  16779. </p>
  16780. </dd>
  16781. <dt><samp>ftp-user</samp></dt>
  16782. <dd><p>Set a user to be used for authenticating to the FTP server. This is overridden by the
  16783. user in the FTP URL.
  16784. </p>
  16785. </dd>
  16786. <dt><samp>ftp-password</samp></dt>
  16787. <dd><p>Set a password to be used for authenticating to the FTP server. This is overridden by
  16788. the password in the FTP URL, or by <samp>ftp-anonymous-password</samp> if no user is set.
  16789. </p>
  16790. </dd>
  16791. <dt><samp>ftp-anonymous-password</samp></dt>
  16792. <dd><p>Password used when login as anonymous user. Typically an e-mail address
  16793. should be used.
  16794. </p>
  16795. </dd>
  16796. <dt><samp>ftp-write-seekable</samp></dt>
  16797. <dd><p>Control seekability of connection during encoding. If set to 1 the
  16798. resource is supposed to be seekable, if set to 0 it is assumed not
  16799. to be seekable. Default value is 0.
  16800. </p></dd>
  16801. </dl>
  16802. <p>NOTE: Protocol can be used as output, but it is recommended to not do
  16803. it, unless special care is taken (tests, customized server configuration
  16804. etc.). Different FTP servers behave in different way during seek
  16805. operation. ff* tools may produce incomplete content due to server limitations.
  16806. </p>
  16807. <a name="gopher"></a>
  16808. <h3 class="section">24.10 gopher<span class="pull-right"><a class="anchor hidden-xs" href="#gopher" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gopher" aria-hidden="true">TOC</a></span></h3>
  16809. <p>Gopher protocol.
  16810. </p>
  16811. <a name="gophers"></a>
  16812. <h3 class="section">24.11 gophers<span class="pull-right"><a class="anchor hidden-xs" href="#gophers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gophers" aria-hidden="true">TOC</a></span></h3>
  16813. <p>Gophers protocol.
  16814. </p>
  16815. <p>The Gopher protocol with TLS encapsulation.
  16816. </p>
  16817. <a name="hls-3"></a>
  16818. <h3 class="section">24.12 hls<span class="pull-right"><a class="anchor hidden-xs" href="#hls-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hls-3" aria-hidden="true">TOC</a></span></h3>
  16819. <p>Read Apple HTTP Live Streaming compliant segmented stream as
  16820. a uniform one. The M3U8 playlists describing the segments can be
  16821. remote HTTP resources or local files, accessed using the standard
  16822. file protocol.
  16823. The nested protocol is declared by specifying
  16824. &quot;+<var>proto</var>&quot; after the hls URI scheme name, where <var>proto</var>
  16825. is either &quot;file&quot; or &quot;http&quot;.
  16826. </p>
  16827. <div class="example">
  16828. <pre class="example">hls+http://host/path/to/remote/resource.m3u8
  16829. hls+file://path/to/local/resource.m3u8
  16830. </pre></div>
  16831. <p>Using this protocol is discouraged - the hls demuxer should work
  16832. just as well (if not, please report the issues) and is more complete.
  16833. To use the hls demuxer instead, simply use the direct URLs to the
  16834. m3u8 files.
  16835. </p>
  16836. <a name="http"></a>
  16837. <h3 class="section">24.13 http<span class="pull-right"><a class="anchor hidden-xs" href="#http" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-http" aria-hidden="true">TOC</a></span></h3>
  16838. <p>HTTP (Hyper Text Transfer Protocol).
  16839. </p>
  16840. <p>This protocol accepts the following options:
  16841. </p>
  16842. <dl compact="compact">
  16843. <dt><samp>seekable</samp></dt>
  16844. <dd><p>Control seekability of connection. If set to 1 the resource is
  16845. supposed to be seekable, if set to 0 it is assumed not to be seekable,
  16846. if set to -1 it will try to autodetect if it is seekable. Default
  16847. value is -1.
  16848. </p>
  16849. </dd>
  16850. <dt><samp>chunked_post</samp></dt>
  16851. <dd><p>If set to 1 use chunked Transfer-Encoding for posts, default is 1.
  16852. </p>
  16853. </dd>
  16854. <dt><samp>content_type</samp></dt>
  16855. <dd><p>Set a specific content type for the POST messages or for listen mode.
  16856. </p>
  16857. </dd>
  16858. <dt><samp>http_proxy</samp></dt>
  16859. <dd><p>set HTTP proxy to tunnel through e.g. http://example.com:1234
  16860. </p>
  16861. </dd>
  16862. <dt><samp>headers</samp></dt>
  16863. <dd><p>Set custom HTTP headers, can override built in default headers. The
  16864. value must be a string encoding the headers.
  16865. </p>
  16866. </dd>
  16867. <dt><samp>multiple_requests</samp></dt>
  16868. <dd><p>Use persistent connections if set to 1, default is 0.
  16869. </p>
  16870. </dd>
  16871. <dt><samp>post_data</samp></dt>
  16872. <dd><p>Set custom HTTP post data.
  16873. </p>
  16874. </dd>
  16875. <dt><samp>referer</samp></dt>
  16876. <dd><p>Set the Referer header. Include &rsquo;Referer: URL&rsquo; header in HTTP request.
  16877. </p>
  16878. </dd>
  16879. <dt><samp>user_agent</samp></dt>
  16880. <dd><p>Override the User-Agent header. If not specified the protocol will use a
  16881. string describing the libavformat build. (&quot;Lavf/&lt;version&gt;&quot;)
  16882. </p>
  16883. </dd>
  16884. <dt><samp>user-agent</samp></dt>
  16885. <dd><p>This is a deprecated option, you can use user_agent instead it.
  16886. </p>
  16887. </dd>
  16888. <dt><samp>reconnect_at_eof</samp></dt>
  16889. <dd><p>If set then eof is treated like an error and causes reconnection, this is useful
  16890. for live / endless streams.
  16891. </p>
  16892. </dd>
  16893. <dt><samp>reconnect_streamed</samp></dt>
  16894. <dd><p>If set then even streamed/non seekable streams will be reconnected on errors.
  16895. </p>
  16896. </dd>
  16897. <dt><samp>reconnect_on_network_error</samp></dt>
  16898. <dd><p>Reconnect automatically in case of TCP/TLS errors during connect.
  16899. </p>
  16900. </dd>
  16901. <dt><samp>reconnect_on_http_error</samp></dt>
  16902. <dd><p>A comma separated list of HTTP status codes to reconnect on. The list can
  16903. include specific status codes (e.g. &rsquo;503&rsquo;) or the strings &rsquo;4xx&rsquo; / &rsquo;5xx&rsquo;.
  16904. </p>
  16905. </dd>
  16906. <dt><samp>reconnect_delay_max</samp></dt>
  16907. <dd><p>Sets the maximum delay in seconds after which to give up reconnecting
  16908. </p>
  16909. </dd>
  16910. <dt><samp>mime_type</samp></dt>
  16911. <dd><p>Export the MIME type.
  16912. </p>
  16913. </dd>
  16914. <dt><samp>http_version</samp></dt>
  16915. <dd><p>Exports the HTTP response version number. Usually &quot;1.0&quot; or &quot;1.1&quot;.
  16916. </p>
  16917. </dd>
  16918. <dt><samp>icy</samp></dt>
  16919. <dd><p>If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
  16920. supports this, the metadata has to be retrieved by the application by reading
  16921. the <samp>icy_metadata_headers</samp> and <samp>icy_metadata_packet</samp> options.
  16922. The default is 1.
  16923. </p>
  16924. </dd>
  16925. <dt><samp>icy_metadata_headers</samp></dt>
  16926. <dd><p>If the server supports ICY metadata, this contains the ICY-specific HTTP reply
  16927. headers, separated by newline characters.
  16928. </p>
  16929. </dd>
  16930. <dt><samp>icy_metadata_packet</samp></dt>
  16931. <dd><p>If the server supports ICY metadata, and <samp>icy</samp> was set to 1, this
  16932. contains the last non-empty metadata packet sent by the server. It should be
  16933. polled in regular intervals by applications interested in mid-stream metadata
  16934. updates.
  16935. </p>
  16936. </dd>
  16937. <dt><samp>cookies</samp></dt>
  16938. <dd><p>Set the cookies to be sent in future requests. The format of each cookie is the
  16939. same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
  16940. delimited by a newline character.
  16941. </p>
  16942. </dd>
  16943. <dt><samp>offset</samp></dt>
  16944. <dd><p>Set initial byte offset.
  16945. </p>
  16946. </dd>
  16947. <dt><samp>end_offset</samp></dt>
  16948. <dd><p>Try to limit the request to bytes preceding this offset.
  16949. </p>
  16950. </dd>
  16951. <dt><samp>method</samp></dt>
  16952. <dd><p>When used as a client option it sets the HTTP method for the request.
  16953. </p>
  16954. <p>When used as a server option it sets the HTTP method that is going to be
  16955. expected from the client(s).
  16956. If the expected and the received HTTP method do not match the client will
  16957. be given a Bad Request response.
  16958. When unset the HTTP method is not checked for now. This will be replaced by
  16959. autodetection in the future.
  16960. </p>
  16961. </dd>
  16962. <dt><samp>listen</samp></dt>
  16963. <dd><p>If set to 1 enables experimental HTTP server. This can be used to send data when
  16964. used as an output option, or read data from a client with HTTP POST when used as
  16965. an input option.
  16966. If set to 2 enables experimental multi-client HTTP server. This is not yet implemented
  16967. in ffmpeg.c and thus must not be used as a command line option.
  16968. </p><div class="example">
  16969. <pre class="example"># Server side (sending):
  16970. ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://<var>server</var>:<var>port</var>
  16971. # Client side (receiving):
  16972. ffmpeg -i http://<var>server</var>:<var>port</var> -c copy somefile.ogg
  16973. # Client can also be done with wget:
  16974. wget http://<var>server</var>:<var>port</var> -O somefile.ogg
  16975. # Server side (receiving):
  16976. ffmpeg -listen 1 -i http://<var>server</var>:<var>port</var> -c copy somefile.ogg
  16977. # Client side (sending):
  16978. ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://<var>server</var>:<var>port</var>
  16979. # Client can also be done with wget:
  16980. wget --post-file=somefile.ogg http://<var>server</var>:<var>port</var>
  16981. </pre></div>
  16982. </dd>
  16983. <dt><samp>send_expect_100</samp></dt>
  16984. <dd><p>Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
  16985. to 0 it won&rsquo;t, if set to -1 it will try to send if it is applicable. Default
  16986. value is -1.
  16987. </p>
  16988. </dd>
  16989. <dt><samp>auth_type</samp></dt>
  16990. <dd>
  16991. <p>Set HTTP authentication type. No option for Digest, since this method requires
  16992. getting nonce parameters from the server first and can&rsquo;t be used straight away like
  16993. Basic.
  16994. </p>
  16995. <dl compact="compact">
  16996. <dt><samp>none</samp></dt>
  16997. <dd><p>Choose the HTTP authentication type automatically. This is the default.
  16998. </p></dd>
  16999. <dt><samp>basic</samp></dt>
  17000. <dd>
  17001. <p>Choose the HTTP basic authentication.
  17002. </p>
  17003. <p>Basic authentication sends a Base64-encoded string that contains a user name and password
  17004. for the client. Base64 is not a form of encryption and should be considered the same as
  17005. sending the user name and password in clear text (Base64 is a reversible encoding).
  17006. If a resource needs to be protected, strongly consider using an authentication scheme
  17007. other than basic authentication. HTTPS/TLS should be used with basic authentication.
  17008. Without these additional security enhancements, basic authentication should not be used
  17009. to protect sensitive or valuable information.
  17010. </p></dd>
  17011. </dl>
  17012. </dd>
  17013. </dl>
  17014. <a name="HTTP-Cookies"></a>
  17015. <h4 class="subsection">24.13.1 HTTP Cookies<span class="pull-right"><a class="anchor hidden-xs" href="#HTTP-Cookies" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-HTTP-Cookies" aria-hidden="true">TOC</a></span></h4>
  17016. <p>Some HTTP requests will be denied unless cookie values are passed in with the
  17017. request. The <samp>cookies</samp> option allows these cookies to be specified. At
  17018. the very least, each cookie must specify a value along with a path and domain.
  17019. HTTP requests that match both the domain and path will automatically include the
  17020. cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
  17021. by a newline.
  17022. </p>
  17023. <p>The required syntax to play a stream specifying a cookie is:
  17024. </p><div class="example">
  17025. <pre class="example">ffplay -cookies &quot;nlqptid=nltid=tsn; path=/; domain=somedomain.com;&quot; http://somedomain.com/somestream.m3u8
  17026. </pre></div>
  17027. <a name="Icecast"></a>
  17028. <h3 class="section">24.14 Icecast<span class="pull-right"><a class="anchor hidden-xs" href="#Icecast" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Icecast" aria-hidden="true">TOC</a></span></h3>
  17029. <p>Icecast protocol (stream to Icecast servers)
  17030. </p>
  17031. <p>This protocol accepts the following options:
  17032. </p>
  17033. <dl compact="compact">
  17034. <dt><samp>ice_genre</samp></dt>
  17035. <dd><p>Set the stream genre.
  17036. </p>
  17037. </dd>
  17038. <dt><samp>ice_name</samp></dt>
  17039. <dd><p>Set the stream name.
  17040. </p>
  17041. </dd>
  17042. <dt><samp>ice_description</samp></dt>
  17043. <dd><p>Set the stream description.
  17044. </p>
  17045. </dd>
  17046. <dt><samp>ice_url</samp></dt>
  17047. <dd><p>Set the stream website URL.
  17048. </p>
  17049. </dd>
  17050. <dt><samp>ice_public</samp></dt>
  17051. <dd><p>Set if the stream should be public.
  17052. The default is 0 (not public).
  17053. </p>
  17054. </dd>
  17055. <dt><samp>user_agent</samp></dt>
  17056. <dd><p>Override the User-Agent header. If not specified a string of the form
  17057. &quot;Lavf/&lt;version&gt;&quot; will be used.
  17058. </p>
  17059. </dd>
  17060. <dt><samp>password</samp></dt>
  17061. <dd><p>Set the Icecast mountpoint password.
  17062. </p>
  17063. </dd>
  17064. <dt><samp>content_type</samp></dt>
  17065. <dd><p>Set the stream content type. This must be set if it is different from
  17066. audio/mpeg.
  17067. </p>
  17068. </dd>
  17069. <dt><samp>legacy_icecast</samp></dt>
  17070. <dd><p>This enables support for Icecast versions &lt; 2.4.0, that do not support the
  17071. HTTP PUT method but the SOURCE method.
  17072. </p>
  17073. </dd>
  17074. <dt><samp>tls</samp></dt>
  17075. <dd><p>Establish a TLS (HTTPS) connection to Icecast.
  17076. </p>
  17077. </dd>
  17078. </dl>
  17079. <div class="example">
  17080. <pre class="example">icecast://[<var>username</var>[:<var>password</var>]@]<var>server</var>:<var>port</var>/<var>mountpoint</var>
  17081. </pre></div>
  17082. <a name="mmst"></a>
  17083. <h3 class="section">24.15 mmst<span class="pull-right"><a class="anchor hidden-xs" href="#mmst" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mmst" aria-hidden="true">TOC</a></span></h3>
  17084. <p>MMS (Microsoft Media Server) protocol over TCP.
  17085. </p>
  17086. <a name="mmsh"></a>
  17087. <h3 class="section">24.16 mmsh<span class="pull-right"><a class="anchor hidden-xs" href="#mmsh" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mmsh" aria-hidden="true">TOC</a></span></h3>
  17088. <p>MMS (Microsoft Media Server) protocol over HTTP.
  17089. </p>
  17090. <p>The required syntax is:
  17091. </p><div class="example">
  17092. <pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
  17093. </pre></div>
  17094. <a name="md5-2"></a>
  17095. <h3 class="section">24.17 md5<span class="pull-right"><a class="anchor hidden-xs" href="#md5-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-md5-2" aria-hidden="true">TOC</a></span></h3>
  17096. <p>MD5 output protocol.
  17097. </p>
  17098. <p>Computes the MD5 hash of the data to be written, and on close writes
  17099. this to the designated output or stdout if none is specified. It can
  17100. be used to test muxers without writing an actual file.
  17101. </p>
  17102. <p>Some examples follow.
  17103. </p><div class="example">
  17104. <pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
  17105. ffmpeg -i input.flv -f avi -y md5:output.avi.md5
  17106. # Write the MD5 hash of the encoded AVI file to stdout.
  17107. ffmpeg -i input.flv -f avi -y md5:
  17108. </pre></div>
  17109. <p>Note that some formats (typically MOV) require the output protocol to
  17110. be seekable, so they will fail with the MD5 output protocol.
  17111. </p>
  17112. <a name="pipe"></a>
  17113. <h3 class="section">24.18 pipe<span class="pull-right"><a class="anchor hidden-xs" href="#pipe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pipe" aria-hidden="true">TOC</a></span></h3>
  17114. <p>UNIX pipe access protocol.
  17115. </p>
  17116. <p>Read and write from UNIX pipes.
  17117. </p>
  17118. <p>The accepted syntax is:
  17119. </p><div class="example">
  17120. <pre class="example">pipe:[<var>number</var>]
  17121. </pre></div>
  17122. <p><var>number</var> is the number corresponding to the file descriptor of the
  17123. pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If <var>number</var>
  17124. is not specified, by default the stdout file descriptor will be used
  17125. for writing, stdin for reading.
  17126. </p>
  17127. <p>For example to read from stdin with <code>ffmpeg</code>:
  17128. </p><div class="example">
  17129. <pre class="example">cat test.wav | ffmpeg -i pipe:0
  17130. # ...this is the same as...
  17131. cat test.wav | ffmpeg -i pipe:
  17132. </pre></div>
  17133. <p>For writing to stdout with <code>ffmpeg</code>:
  17134. </p><div class="example">
  17135. <pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
  17136. # ...this is the same as...
  17137. ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
  17138. </pre></div>
  17139. <p>This protocol accepts the following options:
  17140. </p>
  17141. <dl compact="compact">
  17142. <dt><samp>blocksize</samp></dt>
  17143. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  17144. <code>INT_MAX</code>, which results in not limiting the requested block size.
  17145. Setting this value reasonably low improves user termination request reaction
  17146. time, which is valuable if data transmission is slow.
  17147. </p></dd>
  17148. </dl>
  17149. <p>Note that some formats (typically MOV), require the output protocol to
  17150. be seekable, so they will fail with the pipe output protocol.
  17151. </p>
  17152. <a name="prompeg"></a>
  17153. <h3 class="section">24.19 prompeg<span class="pull-right"><a class="anchor hidden-xs" href="#prompeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prompeg" aria-hidden="true">TOC</a></span></h3>
  17154. <p>Pro-MPEG Code of Practice #3 Release 2 FEC protocol.
  17155. </p>
  17156. <p>The Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction mechanism
  17157. for MPEG-2 Transport Streams sent over RTP.
  17158. </p>
  17159. <p>This protocol must be used in conjunction with the <code>rtp_mpegts</code> muxer and
  17160. the <code>rtp</code> protocol.
  17161. </p>
  17162. <p>The required syntax is:
  17163. </p><div class="example">
  17164. <pre class="example">-f rtp_mpegts -fec prompeg=<var>option</var>=<var>val</var>... rtp://<var>hostname</var>:<var>port</var>
  17165. </pre></div>
  17166. <p>The destination UDP ports are <code>port + 2</code> for the column FEC stream
  17167. and <code>port + 4</code> for the row FEC stream.
  17168. </p>
  17169. <p>This protocol accepts the following options:
  17170. </p><dl compact="compact">
  17171. <dt><samp>l=<var>n</var></samp></dt>
  17172. <dd><p>The number of columns (4-20, LxD &lt;= 100)
  17173. </p>
  17174. </dd>
  17175. <dt><samp>d=<var>n</var></samp></dt>
  17176. <dd><p>The number of rows (4-20, LxD &lt;= 100)
  17177. </p>
  17178. </dd>
  17179. </dl>
  17180. <p>Example usage:
  17181. </p>
  17182. <div class="example">
  17183. <pre class="example">-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://<var>hostname</var>:<var>port</var>
  17184. </pre></div>
  17185. <a name="rist"></a>
  17186. <h3 class="section">24.20 rist<span class="pull-right"><a class="anchor hidden-xs" href="#rist" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rist" aria-hidden="true">TOC</a></span></h3>
  17187. <p>Reliable Internet Streaming Transport protocol
  17188. </p>
  17189. <p>The accepted options are:
  17190. </p><dl compact="compact">
  17191. <dt><samp>rist_profile</samp></dt>
  17192. <dd><p>Supported values:
  17193. </p><dl compact="compact">
  17194. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  17195. <dt>&lsquo;<samp>main</samp>&rsquo;</dt>
  17196. <dd><p>This one is default.
  17197. </p></dd>
  17198. <dt>&lsquo;<samp>advanced</samp>&rsquo;</dt>
  17199. </dl>
  17200. </dd>
  17201. <dt><samp>buffer_size</samp></dt>
  17202. <dd><p>Set internal RIST buffer size in milliseconds for retransmission of data.
  17203. Default value is 0 which means the librist default (1 sec). Maximum value is 30
  17204. seconds.
  17205. </p>
  17206. </dd>
  17207. <dt><samp>pkt_size</samp></dt>
  17208. <dd><p>Set maximum packet size for sending data. 1316 by default.
  17209. </p>
  17210. </dd>
  17211. <dt><samp>log_level</samp></dt>
  17212. <dd><p>Set loglevel for RIST logging messages. You only need to set this if you
  17213. explicitly want to enable debug level messages or packet loss simulation,
  17214. otherwise the regular loglevel is respected.
  17215. </p>
  17216. </dd>
  17217. <dt><samp>secret</samp></dt>
  17218. <dd><p>Set override of encryption secret, by default is unset.
  17219. </p>
  17220. </dd>
  17221. <dt><samp>encryption</samp></dt>
  17222. <dd><p>Set encryption type, by default is disabled.
  17223. Acceptable values are 128 and 256.
  17224. </p></dd>
  17225. </dl>
  17226. <a name="rtmp"></a>
  17227. <h3 class="section">24.21 rtmp<span class="pull-right"><a class="anchor hidden-xs" href="#rtmp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmp" aria-hidden="true">TOC</a></span></h3>
  17228. <p>Real-Time Messaging Protocol.
  17229. </p>
  17230. <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
  17231. content across a TCP/IP network.
  17232. </p>
  17233. <p>The required syntax is:
  17234. </p><div class="example">
  17235. <pre class="example">rtmp://[<var>username</var>:<var>password</var>@]<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>instance</var>][/<var>playpath</var>]
  17236. </pre></div>
  17237. <p>The accepted parameters are:
  17238. </p><dl compact="compact">
  17239. <dt><samp>username</samp></dt>
  17240. <dd><p>An optional username (mostly for publishing).
  17241. </p>
  17242. </dd>
  17243. <dt><samp>password</samp></dt>
  17244. <dd><p>An optional password (mostly for publishing).
  17245. </p>
  17246. </dd>
  17247. <dt><samp>server</samp></dt>
  17248. <dd><p>The address of the RTMP server.
  17249. </p>
  17250. </dd>
  17251. <dt><samp>port</samp></dt>
  17252. <dd><p>The number of the TCP port to use (by default is 1935).
  17253. </p>
  17254. </dd>
  17255. <dt><samp>app</samp></dt>
  17256. <dd><p>It is the name of the application to access. It usually corresponds to
  17257. the path where the application is installed on the RTMP server
  17258. (e.g. <samp>/ondemand/</samp>, <samp>/flash/live/</samp>, etc.). You can override
  17259. the value parsed from the URI through the <code>rtmp_app</code> option, too.
  17260. </p>
  17261. </dd>
  17262. <dt><samp>playpath</samp></dt>
  17263. <dd><p>It is the path or name of the resource to play with reference to the
  17264. application specified in <var>app</var>, may be prefixed by &quot;mp4:&quot;. You
  17265. can override the value parsed from the URI through the <code>rtmp_playpath</code>
  17266. option, too.
  17267. </p>
  17268. </dd>
  17269. <dt><samp>listen</samp></dt>
  17270. <dd><p>Act as a server, listening for an incoming connection.
  17271. </p>
  17272. </dd>
  17273. <dt><samp>timeout</samp></dt>
  17274. <dd><p>Maximum time to wait for the incoming connection. Implies listen.
  17275. </p></dd>
  17276. </dl>
  17277. <p>Additionally, the following parameters can be set via command line options
  17278. (or in code via <code>AVOption</code>s):
  17279. </p><dl compact="compact">
  17280. <dt><samp>rtmp_app</samp></dt>
  17281. <dd><p>Name of application to connect on the RTMP server. This option
  17282. overrides the parameter specified in the URI.
  17283. </p>
  17284. </dd>
  17285. <dt><samp>rtmp_buffer</samp></dt>
  17286. <dd><p>Set the client buffer time in milliseconds. The default is 3000.
  17287. </p>
  17288. </dd>
  17289. <dt><samp>rtmp_conn</samp></dt>
  17290. <dd><p>Extra arbitrary AMF connection parameters, parsed from a string,
  17291. e.g. like <code>B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0</code>.
  17292. Each value is prefixed by a single character denoting the type,
  17293. B for Boolean, N for number, S for string, O for object, or Z for null,
  17294. followed by a colon. For Booleans the data must be either 0 or 1 for
  17295. FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or
  17296. 1 to end or begin an object, respectively. Data items in subobjects may
  17297. be named, by prefixing the type with &rsquo;N&rsquo; and specifying the name before
  17298. the value (i.e. <code>NB:myFlag:1</code>). This option may be used multiple
  17299. times to construct arbitrary AMF sequences.
  17300. </p>
  17301. </dd>
  17302. <dt><samp>rtmp_flashver</samp></dt>
  17303. <dd><p>Version of the Flash plugin used to run the SWF player. The default
  17304. is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
  17305. &lt;libavformat version&gt;).)
  17306. </p>
  17307. </dd>
  17308. <dt><samp>rtmp_flush_interval</samp></dt>
  17309. <dd><p>Number of packets flushed in the same request (RTMPT only). The default
  17310. is 10.
  17311. </p>
  17312. </dd>
  17313. <dt><samp>rtmp_live</samp></dt>
  17314. <dd><p>Specify that the media is a live stream. No resuming or seeking in
  17315. live streams is possible. The default value is <code>any</code>, which means the
  17316. subscriber first tries to play the live stream specified in the
  17317. playpath. If a live stream of that name is not found, it plays the
  17318. recorded stream. The other possible values are <code>live</code> and
  17319. <code>recorded</code>.
  17320. </p>
  17321. </dd>
  17322. <dt><samp>rtmp_pageurl</samp></dt>
  17323. <dd><p>URL of the web page in which the media was embedded. By default no
  17324. value will be sent.
  17325. </p>
  17326. </dd>
  17327. <dt><samp>rtmp_playpath</samp></dt>
  17328. <dd><p>Stream identifier to play or to publish. This option overrides the
  17329. parameter specified in the URI.
  17330. </p>
  17331. </dd>
  17332. <dt><samp>rtmp_subscribe</samp></dt>
  17333. <dd><p>Name of live stream to subscribe to. By default no value will be sent.
  17334. It is only sent if the option is specified or if rtmp_live
  17335. is set to live.
  17336. </p>
  17337. </dd>
  17338. <dt><samp>rtmp_swfhash</samp></dt>
  17339. <dd><p>SHA256 hash of the decompressed SWF file (32 bytes).
  17340. </p>
  17341. </dd>
  17342. <dt><samp>rtmp_swfsize</samp></dt>
  17343. <dd><p>Size of the decompressed SWF file, required for SWFVerification.
  17344. </p>
  17345. </dd>
  17346. <dt><samp>rtmp_swfurl</samp></dt>
  17347. <dd><p>URL of the SWF player for the media. By default no value will be sent.
  17348. </p>
  17349. </dd>
  17350. <dt><samp>rtmp_swfverify</samp></dt>
  17351. <dd><p>URL to player swf file, compute hash/size automatically.
  17352. </p>
  17353. </dd>
  17354. <dt><samp>rtmp_tcurl</samp></dt>
  17355. <dd><p>URL of the target stream. Defaults to proto://host[:port]/app.
  17356. </p>
  17357. </dd>
  17358. </dl>
  17359. <p>For example to read with <code>ffplay</code> a multimedia resource named
  17360. &quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
  17361. </p><div class="example">
  17362. <pre class="example">ffplay rtmp://myserver/vod/sample
  17363. </pre></div>
  17364. <p>To publish to a password protected server, passing the playpath and
  17365. app names separately:
  17366. </p><div class="example">
  17367. <pre class="example">ffmpeg -re -i &lt;input&gt; -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@myserver/
  17368. </pre></div>
  17369. <a name="rtmpe"></a>
  17370. <h3 class="section">24.22 rtmpe<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpe" aria-hidden="true">TOC</a></span></h3>
  17371. <p>Encrypted Real-Time Messaging Protocol.
  17372. </p>
  17373. <p>The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
  17374. streaming multimedia content within standard cryptographic primitives,
  17375. consisting of Diffie-Hellman key exchange and HMACSHA256, generating
  17376. a pair of RC4 keys.
  17377. </p>
  17378. <a name="rtmps"></a>
  17379. <h3 class="section">24.23 rtmps<span class="pull-right"><a class="anchor hidden-xs" href="#rtmps" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmps" aria-hidden="true">TOC</a></span></h3>
  17380. <p>Real-Time Messaging Protocol over a secure SSL connection.
  17381. </p>
  17382. <p>The Real-Time Messaging Protocol (RTMPS) is used for streaming
  17383. multimedia content across an encrypted connection.
  17384. </p>
  17385. <a name="rtmpt"></a>
  17386. <h3 class="section">24.24 rtmpt<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpt" aria-hidden="true">TOC</a></span></h3>
  17387. <p>Real-Time Messaging Protocol tunneled through HTTP.
  17388. </p>
  17389. <p>The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
  17390. for streaming multimedia content within HTTP requests to traverse
  17391. firewalls.
  17392. </p>
  17393. <a name="rtmpte"></a>
  17394. <h3 class="section">24.25 rtmpte<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpte" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpte" aria-hidden="true">TOC</a></span></h3>
  17395. <p>Encrypted Real-Time Messaging Protocol tunneled through HTTP.
  17396. </p>
  17397. <p>The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
  17398. is used for streaming multimedia content within HTTP requests to traverse
  17399. firewalls.
  17400. </p>
  17401. <a name="rtmpts"></a>
  17402. <h3 class="section">24.26 rtmpts<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpts" aria-hidden="true">TOC</a></span></h3>
  17403. <p>Real-Time Messaging Protocol tunneled through HTTPS.
  17404. </p>
  17405. <p>The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
  17406. for streaming multimedia content within HTTPS requests to traverse
  17407. firewalls.
  17408. </p>
  17409. <a name="libsmbclient"></a>
  17410. <h3 class="section">24.27 libsmbclient<span class="pull-right"><a class="anchor hidden-xs" href="#libsmbclient" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libsmbclient" aria-hidden="true">TOC</a></span></h3>
  17411. <p>libsmbclient permits one to manipulate CIFS/SMB network resources.
  17412. </p>
  17413. <p>Following syntax is required.
  17414. </p>
  17415. <div class="example">
  17416. <pre class="example">smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
  17417. </pre></div>
  17418. <p>This protocol accepts the following options.
  17419. </p>
  17420. <dl compact="compact">
  17421. <dt><samp>timeout</samp></dt>
  17422. <dd><p>Set timeout in milliseconds of socket I/O operations used by the underlying
  17423. low level operation. By default it is set to -1, which means that the timeout
  17424. is not specified.
  17425. </p>
  17426. </dd>
  17427. <dt><samp>truncate</samp></dt>
  17428. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  17429. truncating. Default value is 1.
  17430. </p>
  17431. </dd>
  17432. <dt><samp>workgroup</samp></dt>
  17433. <dd><p>Set the workgroup used for making connections. By default workgroup is not specified.
  17434. </p>
  17435. </dd>
  17436. </dl>
  17437. <p>For more information see: <a href="http://www.samba.org/">http://www.samba.org/</a>.
  17438. </p>
  17439. <a name="libssh"></a>
  17440. <h3 class="section">24.28 libssh<span class="pull-right"><a class="anchor hidden-xs" href="#libssh" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libssh" aria-hidden="true">TOC</a></span></h3>
  17441. <p>Secure File Transfer Protocol via libssh
  17442. </p>
  17443. <p>Read from or write to remote resources using SFTP protocol.
  17444. </p>
  17445. <p>Following syntax is required.
  17446. </p>
  17447. <div class="example">
  17448. <pre class="example">sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  17449. </pre></div>
  17450. <p>This protocol accepts the following options.
  17451. </p>
  17452. <dl compact="compact">
  17453. <dt><samp>timeout</samp></dt>
  17454. <dd><p>Set timeout of socket I/O operations used by the underlying low level
  17455. operation. By default it is set to -1, which means that the timeout
  17456. is not specified.
  17457. </p>
  17458. </dd>
  17459. <dt><samp>truncate</samp></dt>
  17460. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  17461. truncating. Default value is 1.
  17462. </p>
  17463. </dd>
  17464. <dt><samp>private_key</samp></dt>
  17465. <dd><p>Specify the path of the file containing private key to use during authorization.
  17466. By default libssh searches for keys in the <samp>~/.ssh/</samp> directory.
  17467. </p>
  17468. </dd>
  17469. </dl>
  17470. <p>Example: Play a file stored on remote server.
  17471. </p>
  17472. <div class="example">
  17473. <pre class="example">ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
  17474. </pre></div>
  17475. <a name="librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
  17476. <h3 class="section">24.29 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte<span class="pull-right"><a class="anchor hidden-xs" href="#librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" aria-hidden="true">TOC</a></span></h3>
  17477. <p>Real-Time Messaging Protocol and its variants supported through
  17478. librtmp.
  17479. </p>
  17480. <p>Requires the presence of the librtmp headers and library during
  17481. configuration. You need to explicitly configure the build with
  17482. &quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
  17483. protocol.
  17484. </p>
  17485. <p>This protocol provides most client functions and a few server
  17486. functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
  17487. encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
  17488. variants of these encrypted types (RTMPTE, RTMPTS).
  17489. </p>
  17490. <p>The required syntax is:
  17491. </p><div class="example">
  17492. <pre class="example"><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
  17493. </pre></div>
  17494. <p>where <var>rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
  17495. &quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
  17496. <var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
  17497. meaning as specified for the RTMP native protocol.
  17498. <var>options</var> contains a list of space-separated options of the form
  17499. <var>key</var>=<var>val</var>.
  17500. </p>
  17501. <p>See the librtmp manual page (man 3 librtmp) for more information.
  17502. </p>
  17503. <p>For example, to stream a file in real-time to an RTMP server using
  17504. <code>ffmpeg</code>:
  17505. </p><div class="example">
  17506. <pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
  17507. </pre></div>
  17508. <p>To play the same stream using <code>ffplay</code>:
  17509. </p><div class="example">
  17510. <pre class="example">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
  17511. </pre></div>
  17512. <a name="rtp"></a>
  17513. <h3 class="section">24.30 rtp<span class="pull-right"><a class="anchor hidden-xs" href="#rtp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtp" aria-hidden="true">TOC</a></span></h3>
  17514. <p>Real-time Transport Protocol.
  17515. </p>
  17516. <p>The required syntax for an RTP URL is:
  17517. rtp://<var>hostname</var>[:<var>port</var>][?<var>option</var>=<var>val</var>...]
  17518. </p>
  17519. <p><var>port</var> specifies the RTP port to use.
  17520. </p>
  17521. <p>The following URL options are supported:
  17522. </p>
  17523. <dl compact="compact">
  17524. <dt><samp>ttl=<var>n</var></samp></dt>
  17525. <dd><p>Set the TTL (Time-To-Live) value (for multicast only).
  17526. </p>
  17527. </dd>
  17528. <dt><samp>rtcpport=<var>n</var></samp></dt>
  17529. <dd><p>Set the remote RTCP port to <var>n</var>.
  17530. </p>
  17531. </dd>
  17532. <dt><samp>localrtpport=<var>n</var></samp></dt>
  17533. <dd><p>Set the local RTP port to <var>n</var>.
  17534. </p>
  17535. </dd>
  17536. <dt><samp>localrtcpport=<var>n</var>'</samp></dt>
  17537. <dd><p>Set the local RTCP port to <var>n</var>.
  17538. </p>
  17539. </dd>
  17540. <dt><samp>pkt_size=<var>n</var></samp></dt>
  17541. <dd><p>Set max packet size (in bytes) to <var>n</var>.
  17542. </p>
  17543. </dd>
  17544. <dt><samp>buffer_size=<var>size</var></samp></dt>
  17545. <dd><p>Set the maximum UDP socket buffer size in bytes.
  17546. </p>
  17547. </dd>
  17548. <dt><samp>connect=0|1</samp></dt>
  17549. <dd><p>Do a <code>connect()</code> on the UDP socket (if set to 1) or not (if set
  17550. to 0).
  17551. </p>
  17552. </dd>
  17553. <dt><samp>sources=<var>ip</var>[,<var>ip</var>]</samp></dt>
  17554. <dd><p>List allowed source IP addresses.
  17555. </p>
  17556. </dd>
  17557. <dt><samp>block=<var>ip</var>[,<var>ip</var>]</samp></dt>
  17558. <dd><p>List disallowed (blocked) source IP addresses.
  17559. </p>
  17560. </dd>
  17561. <dt><samp>write_to_source=0|1</samp></dt>
  17562. <dd><p>Send packets to the source address of the latest received packet (if
  17563. set to 1) or to a default remote address (if set to 0).
  17564. </p>
  17565. </dd>
  17566. <dt><samp>localport=<var>n</var></samp></dt>
  17567. <dd><p>Set the local RTP port to <var>n</var>.
  17568. </p>
  17569. </dd>
  17570. <dt><samp>timeout=<var>n</var></samp></dt>
  17571. <dd><p>Set timeout (in microseconds) of socket I/O operations to <var>n</var>.
  17572. </p>
  17573. <p>This is a deprecated option. Instead, <samp>localrtpport</samp> should be
  17574. used.
  17575. </p>
  17576. </dd>
  17577. </dl>
  17578. <p>Important notes:
  17579. </p>
  17580. <ol>
  17581. <li> If <samp>rtcpport</samp> is not set the RTCP port will be set to the RTP
  17582. port value plus 1.
  17583. </li><li> If <samp>localrtpport</samp> (the local RTP port) is not set any available
  17584. port will be used for the local RTP and RTCP ports.
  17585. </li><li> If <samp>localrtcpport</samp> (the local RTCP port) is not set it will be
  17586. set to the local RTP port value plus 1.
  17587. </li></ol>
  17588. <a name="rtsp"></a>
  17589. <h3 class="section">24.31 rtsp<span class="pull-right"><a class="anchor hidden-xs" href="#rtsp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtsp" aria-hidden="true">TOC</a></span></h3>
  17590. <p>Real-Time Streaming Protocol.
  17591. </p>
  17592. <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
  17593. and muxer. The demuxer supports both normal RTSP (with data transferred
  17594. over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
  17595. data transferred over RDT).
  17596. </p>
  17597. <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
  17598. supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
  17599. <a href="https://github.com/revmischa/rtsp-server">RTSP server</a>).
  17600. </p>
  17601. <p>The required syntax for a RTSP url is:
  17602. </p><div class="example">
  17603. <pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>
  17604. </pre></div>
  17605. <p>Options can be set on the <code>ffmpeg</code>/<code>ffplay</code> command
  17606. line, or set in code via <code>AVOption</code>s or in
  17607. <code>avformat_open_input</code>.
  17608. </p>
  17609. <p>The following options are supported.
  17610. </p>
  17611. <dl compact="compact">
  17612. <dt><samp>initial_pause</samp></dt>
  17613. <dd><p>Do not start playing the stream immediately if set to 1. Default value
  17614. is 0.
  17615. </p>
  17616. </dd>
  17617. <dt><samp>rtsp_transport</samp></dt>
  17618. <dd><p>Set RTSP transport protocols.
  17619. </p>
  17620. <p>It accepts the following values:
  17621. </p><dl compact="compact">
  17622. <dt>&lsquo;<samp>udp</samp>&rsquo;</dt>
  17623. <dd><p>Use UDP as lower transport protocol.
  17624. </p>
  17625. </dd>
  17626. <dt>&lsquo;<samp>tcp</samp>&rsquo;</dt>
  17627. <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
  17628. transport protocol.
  17629. </p>
  17630. </dd>
  17631. <dt>&lsquo;<samp>udp_multicast</samp>&rsquo;</dt>
  17632. <dd><p>Use UDP multicast as lower transport protocol.
  17633. </p>
  17634. </dd>
  17635. <dt>&lsquo;<samp>http</samp>&rsquo;</dt>
  17636. <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
  17637. passing proxies.
  17638. </p></dd>
  17639. </dl>
  17640. <p>Multiple lower transport protocols may be specified, in that case they are
  17641. tried one at a time (if the setup of one fails, the next one is tried).
  17642. For the muxer, only the &lsquo;<samp>tcp</samp>&rsquo; and &lsquo;<samp>udp</samp>&rsquo; options are supported.
  17643. </p>
  17644. </dd>
  17645. <dt><samp>rtsp_flags</samp></dt>
  17646. <dd><p>Set RTSP flags.
  17647. </p>
  17648. <p>The following values are accepted:
  17649. </p><dl compact="compact">
  17650. <dt>&lsquo;<samp>filter_src</samp>&rsquo;</dt>
  17651. <dd><p>Accept packets only from negotiated peer address and port.
  17652. </p></dd>
  17653. <dt>&lsquo;<samp>listen</samp>&rsquo;</dt>
  17654. <dd><p>Act as a server, listening for an incoming connection.
  17655. </p></dd>
  17656. <dt>&lsquo;<samp>prefer_tcp</samp>&rsquo;</dt>
  17657. <dd><p>Try TCP for RTP transport first, if TCP is available as RTSP RTP transport.
  17658. </p></dd>
  17659. </dl>
  17660. <p>Default value is &lsquo;<samp>none</samp>&rsquo;.
  17661. </p>
  17662. </dd>
  17663. <dt><samp>allowed_media_types</samp></dt>
  17664. <dd><p>Set media types to accept from the server.
  17665. </p>
  17666. <p>The following flags are accepted:
  17667. </p><dl compact="compact">
  17668. <dt>&lsquo;<samp>video</samp>&rsquo;</dt>
  17669. <dt>&lsquo;<samp>audio</samp>&rsquo;</dt>
  17670. <dt>&lsquo;<samp>data</samp>&rsquo;</dt>
  17671. </dl>
  17672. <p>By default it accepts all media types.
  17673. </p>
  17674. </dd>
  17675. <dt><samp>min_port</samp></dt>
  17676. <dd><p>Set minimum local UDP port. Default value is 5000.
  17677. </p>
  17678. </dd>
  17679. <dt><samp>max_port</samp></dt>
  17680. <dd><p>Set maximum local UDP port. Default value is 65000.
  17681. </p>
  17682. </dd>
  17683. <dt><samp>timeout</samp></dt>
  17684. <dd><p>Set maximum timeout (in seconds) to wait for incoming connections.
  17685. </p>
  17686. <p>A value of -1 means infinite (default). This option implies the
  17687. <samp>rtsp_flags</samp> set to &lsquo;<samp>listen</samp>&rsquo;.
  17688. </p>
  17689. </dd>
  17690. <dt><samp>reorder_queue_size</samp></dt>
  17691. <dd><p>Set number of packets to buffer for handling of reordered packets.
  17692. </p>
  17693. </dd>
  17694. <dt><samp>stimeout</samp></dt>
  17695. <dd><p>Set socket TCP I/O timeout in microseconds.
  17696. </p>
  17697. </dd>
  17698. <dt><samp>user-agent</samp></dt>
  17699. <dd><p>Override User-Agent header. If not specified, it defaults to the
  17700. libavformat identifier string.
  17701. </p></dd>
  17702. </dl>
  17703. <p>When receiving data over UDP, the demuxer tries to reorder received packets
  17704. (since they may arrive out of order, or packets may get lost totally). This
  17705. can be disabled by setting the maximum demuxing delay to zero (via
  17706. the <code>max_delay</code> field of AVFormatContext).
  17707. </p>
  17708. <p>When watching multi-bitrate Real-RTSP streams with <code>ffplay</code>, the
  17709. streams to display can be chosen with <code>-vst</code> <var>n</var> and
  17710. <code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
  17711. on the fly by pressing <code>v</code> and <code>a</code>.
  17712. </p>
  17713. <a name="Examples-19"></a>
  17714. <h4 class="subsection">24.31.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-19" aria-hidden="true">TOC</a></span></h4>
  17715. <p>The following examples all make use of the <code>ffplay</code> and
  17716. <code>ffmpeg</code> tools.
  17717. </p>
  17718. <ul>
  17719. <li> Watch a stream over UDP, with a max reordering delay of 0.5 seconds:
  17720. <div class="example">
  17721. <pre class="example">ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
  17722. </pre></div>
  17723. </li><li> Watch a stream tunneled over HTTP:
  17724. <div class="example">
  17725. <pre class="example">ffplay -rtsp_transport http rtsp://server/video.mp4
  17726. </pre></div>
  17727. </li><li> Send a stream in realtime to a RTSP server, for others to watch:
  17728. <div class="example">
  17729. <pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
  17730. </pre></div>
  17731. </li><li> Receive a stream in realtime:
  17732. <div class="example">
  17733. <pre class="example">ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <var>output</var>
  17734. </pre></div>
  17735. </li></ul>
  17736. <a name="sap"></a>
  17737. <h3 class="section">24.32 sap<span class="pull-right"><a class="anchor hidden-xs" href="#sap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sap" aria-hidden="true">TOC</a></span></h3>
  17738. <p>Session Announcement Protocol (RFC 2974). This is not technically a
  17739. protocol handler in libavformat, it is a muxer and demuxer.
  17740. It is used for signalling of RTP streams, by announcing the SDP for the
  17741. streams regularly on a separate port.
  17742. </p>
  17743. <a name="Muxer"></a>
  17744. <h4 class="subsection">24.32.1 Muxer<span class="pull-right"><a class="anchor hidden-xs" href="#Muxer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Muxer" aria-hidden="true">TOC</a></span></h4>
  17745. <p>The syntax for a SAP url given to the muxer is:
  17746. </p><div class="example">
  17747. <pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
  17748. </pre></div>
  17749. <p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
  17750. or to port 5004 if no port is specified.
  17751. <var>options</var> is a <code>&amp;</code>-separated list. The following options
  17752. are supported:
  17753. </p>
  17754. <dl compact="compact">
  17755. <dt><samp>announce_addr=<var>address</var></samp></dt>
  17756. <dd><p>Specify the destination IP address for sending the announcements to.
  17757. If omitted, the announcements are sent to the commonly used SAP
  17758. announcement multicast address 224.2.127.254 (sap.mcast.net), or
  17759. ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
  17760. </p>
  17761. </dd>
  17762. <dt><samp>announce_port=<var>port</var></samp></dt>
  17763. <dd><p>Specify the port to send the announcements on, defaults to
  17764. 9875 if not specified.
  17765. </p>
  17766. </dd>
  17767. <dt><samp>ttl=<var>ttl</var></samp></dt>
  17768. <dd><p>Specify the time to live value for the announcements and RTP packets,
  17769. defaults to 255.
  17770. </p>
  17771. </dd>
  17772. <dt><samp>same_port=<var>0|1</var></samp></dt>
  17773. <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
  17774. default), all streams are sent on unique ports, with each stream on a
  17775. port 2 numbers higher than the previous.
  17776. VLC/Live555 requires this to be set to 1, to be able to receive the stream.
  17777. The RTP stack in libavformat for receiving requires all streams to be sent
  17778. on unique ports.
  17779. </p></dd>
  17780. </dl>
  17781. <p>Example command lines follow.
  17782. </p>
  17783. <p>To broadcast a stream on the local subnet, for watching in VLC:
  17784. </p>
  17785. <div class="example">
  17786. <pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
  17787. </pre></div>
  17788. <p>Similarly, for watching in <code>ffplay</code>:
  17789. </p>
  17790. <div class="example">
  17791. <pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
  17792. </pre></div>
  17793. <p>And for watching in <code>ffplay</code>, over IPv6:
  17794. </p>
  17795. <div class="example">
  17796. <pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
  17797. </pre></div>
  17798. <a name="Demuxer"></a>
  17799. <h4 class="subsection">24.32.2 Demuxer<span class="pull-right"><a class="anchor hidden-xs" href="#Demuxer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Demuxer" aria-hidden="true">TOC</a></span></h4>
  17800. <p>The syntax for a SAP url given to the demuxer is:
  17801. </p><div class="example">
  17802. <pre class="example">sap://[<var>address</var>][:<var>port</var>]
  17803. </pre></div>
  17804. <p><var>address</var> is the multicast address to listen for announcements on,
  17805. if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
  17806. is the port that is listened on, 9875 if omitted.
  17807. </p>
  17808. <p>The demuxers listens for announcements on the given address and port.
  17809. Once an announcement is received, it tries to receive that particular stream.
  17810. </p>
  17811. <p>Example command lines follow.
  17812. </p>
  17813. <p>To play back the first stream announced on the normal SAP multicast address:
  17814. </p>
  17815. <div class="example">
  17816. <pre class="example">ffplay sap://
  17817. </pre></div>
  17818. <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
  17819. </p>
  17820. <div class="example">
  17821. <pre class="example">ffplay sap://[ff0e::2:7ffe]
  17822. </pre></div>
  17823. <a name="sctp"></a>
  17824. <h3 class="section">24.33 sctp<span class="pull-right"><a class="anchor hidden-xs" href="#sctp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sctp" aria-hidden="true">TOC</a></span></h3>
  17825. <p>Stream Control Transmission Protocol.
  17826. </p>
  17827. <p>The accepted URL syntax is:
  17828. </p><div class="example">
  17829. <pre class="example">sctp://<var>host</var>:<var>port</var>[?<var>options</var>]
  17830. </pre></div>
  17831. <p>The protocol accepts the following options:
  17832. </p><dl compact="compact">
  17833. <dt><samp>listen</samp></dt>
  17834. <dd><p>If set to any value, listen for an incoming connection. Outgoing connection is done by default.
  17835. </p>
  17836. </dd>
  17837. <dt><samp>max_streams</samp></dt>
  17838. <dd><p>Set the maximum number of streams. By default no limit is set.
  17839. </p></dd>
  17840. </dl>
  17841. <a name="srt"></a>
  17842. <h3 class="section">24.34 srt<span class="pull-right"><a class="anchor hidden-xs" href="#srt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-srt" aria-hidden="true">TOC</a></span></h3>
  17843. <p>Haivision Secure Reliable Transport Protocol via libsrt.
  17844. </p>
  17845. <p>The supported syntax for a SRT URL is:
  17846. </p><div class="example">
  17847. <pre class="example">srt://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  17848. </pre></div>
  17849. <p><var>options</var> contains a list of &amp;-separated options of the form
  17850. <var>key</var>=<var>val</var>.
  17851. </p>
  17852. <p>or
  17853. </p>
  17854. <div class="example">
  17855. <pre class="example"><var>options</var> srt://<var>hostname</var>:<var>port</var>
  17856. </pre></div>
  17857. <p><var>options</var> contains a list of &rsquo;-<var>key</var> <var>val</var>&rsquo;
  17858. options.
  17859. </p>
  17860. <p>This protocol accepts the following options.
  17861. </p>
  17862. <dl compact="compact">
  17863. <dt><samp>connect_timeout=<var>milliseconds</var></samp></dt>
  17864. <dd><p>Connection timeout; SRT cannot connect for RTT &gt; 1500 msec
  17865. (2 handshake exchanges) with the default connect timeout of
  17866. 3 seconds. This option applies to the caller and rendezvous
  17867. connection modes. The connect timeout is 10 times the value
  17868. set for the rendezvous mode (which can be used as a
  17869. workaround for this connection problem with earlier versions).
  17870. </p>
  17871. </dd>
  17872. <dt><samp>ffs=<var>bytes</var></samp></dt>
  17873. <dd><p>Flight Flag Size (Window Size), in bytes. FFS is actually an
  17874. internal parameter and you should set it to not less than
  17875. <samp>recv_buffer_size</samp> and <samp>mss</samp>. The default value
  17876. is relatively large, therefore unless you set a very large receiver buffer,
  17877. you do not need to change this option. Default value is 25600.
  17878. </p>
  17879. </dd>
  17880. <dt><samp>inputbw=<var>bytes/seconds</var></samp></dt>
  17881. <dd><p>Sender nominal input rate, in bytes per seconds. Used along with
  17882. <samp>oheadbw</samp>, when <samp>maxbw</samp> is set to relative (0), to
  17883. calculate maximum sending rate when recovery packets are sent
  17884. along with the main media stream:
  17885. <samp>inputbw</samp> * (100 + <samp>oheadbw</samp>) / 100
  17886. if <samp>inputbw</samp> is not set while <samp>maxbw</samp> is set to
  17887. relative (0), the actual input rate is evaluated inside
  17888. the library. Default value is 0.
  17889. </p>
  17890. </dd>
  17891. <dt><samp>iptos=<var>tos</var></samp></dt>
  17892. <dd><p>IP Type of Service. Applies to sender only. Default value is 0xB8.
  17893. </p>
  17894. </dd>
  17895. <dt><samp>ipttl=<var>ttl</var></samp></dt>
  17896. <dd><p>IP Time To Live. Applies to sender only. Default value is 64.
  17897. </p>
  17898. </dd>
  17899. <dt><samp>latency=<var>microseconds</var></samp></dt>
  17900. <dd><p>Timestamp-based Packet Delivery Delay.
  17901. Used to absorb bursts of missed packet retransmissions.
  17902. This flag sets both <samp>rcvlatency</samp> and <samp>peerlatency</samp>
  17903. to the same value. Note that prior to version 1.3.0
  17904. this is the only flag to set the latency, however
  17905. this is effectively equivalent to setting <samp>peerlatency</samp>,
  17906. when side is sender and <samp>rcvlatency</samp>
  17907. when side is receiver, and the bidirectional stream
  17908. sending is not supported.
  17909. </p>
  17910. </dd>
  17911. <dt><samp>listen_timeout=<var>microseconds</var></samp></dt>
  17912. <dd><p>Set socket listen timeout.
  17913. </p>
  17914. </dd>
  17915. <dt><samp>maxbw=<var>bytes/seconds</var></samp></dt>
  17916. <dd><p>Maximum sending bandwidth, in bytes per seconds.
  17917. -1 infinite (CSRTCC limit is 30mbps)
  17918. 0 relative to input rate (see <samp>inputbw</samp>)
  17919. &gt;0 absolute limit value
  17920. Default value is 0 (relative)
  17921. </p>
  17922. </dd>
  17923. <dt><samp>mode=<var>caller|listener|rendezvous</var></samp></dt>
  17924. <dd><p>Connection mode.
  17925. <samp>caller</samp> opens client connection.
  17926. <samp>listener</samp> starts server to listen for incoming connections.
  17927. <samp>rendezvous</samp> use Rendez-Vous connection mode.
  17928. Default value is caller.
  17929. </p>
  17930. </dd>
  17931. <dt><samp>mss=<var>bytes</var></samp></dt>
  17932. <dd><p>Maximum Segment Size, in bytes. Used for buffer allocation
  17933. and rate calculation using a packet counter assuming fully
  17934. filled packets. The smallest MSS between the peers is
  17935. used. This is 1500 by default in the overall internet.
  17936. This is the maximum size of the UDP packet and can be
  17937. only decreased, unless you have some unusual dedicated
  17938. network settings. Default value is 1500.
  17939. </p>
  17940. </dd>
  17941. <dt><samp>nakreport=<var>1|0</var></samp></dt>
  17942. <dd><p>If set to 1, Receiver will send &lsquo;UMSG_LOSSREPORT&lsquo; messages
  17943. periodically until a lost packet is retransmitted or
  17944. intentionally dropped. Default value is 1.
  17945. </p>
  17946. </dd>
  17947. <dt><samp>oheadbw=<var>percents</var></samp></dt>
  17948. <dd><p>Recovery bandwidth overhead above input rate, in percents.
  17949. See <samp>inputbw</samp>. Default value is 25%.
  17950. </p>
  17951. </dd>
  17952. <dt><samp>passphrase=<var>string</var></samp></dt>
  17953. <dd><p>HaiCrypt Encryption/Decryption Passphrase string, length
  17954. from 10 to 79 characters. The passphrase is the shared
  17955. secret between the sender and the receiver. It is used
  17956. to generate the Key Encrypting Key using PBKDF2
  17957. (Password-Based Key Derivation Function). It is used
  17958. only if <samp>pbkeylen</samp> is non-zero. It is used on
  17959. the receiver only if the received data is encrypted.
  17960. The configured passphrase cannot be recovered (write-only).
  17961. </p>
  17962. </dd>
  17963. <dt><samp>enforced_encryption=<var>1|0</var></samp></dt>
  17964. <dd><p>If true, both connection parties must have the same password
  17965. set (including empty, that is, with no encryption). If the
  17966. password doesn&rsquo;t match or only one side is unencrypted,
  17967. the connection is rejected. Default is true.
  17968. </p>
  17969. </dd>
  17970. <dt><samp>kmrefreshrate=<var>packets</var></samp></dt>
  17971. <dd><p>The number of packets to be transmitted after which the
  17972. encryption key is switched to a new key. Default is -1.
  17973. -1 means auto (0x1000000 in srt library). The range for
  17974. this option is integers in the 0 - <code>INT_MAX</code>.
  17975. </p>
  17976. </dd>
  17977. <dt><samp>kmpreannounce=<var>packets</var></samp></dt>
  17978. <dd><p>The interval between when a new encryption key is sent and
  17979. when switchover occurs. This value also applies to the
  17980. subsequent interval between when switchover occurs and
  17981. when the old encryption key is decommissioned. Default is -1.
  17982. -1 means auto (0x1000 in srt library). The range for
  17983. this option is integers in the 0 - <code>INT_MAX</code>.
  17984. </p>
  17985. </dd>
  17986. <dt><samp>payload_size=<var>bytes</var></samp></dt>
  17987. <dd><p>Sets the maximum declared size of a packet transferred
  17988. during the single call to the sending function in Live
  17989. mode. Use 0 if this value isn&rsquo;t used (which is default in
  17990. file mode).
  17991. Default is -1 (automatic), which typically means MPEG-TS;
  17992. if you are going to use SRT
  17993. to send any different kind of payload, such as, for example,
  17994. wrapping a live stream in very small frames, then you can
  17995. use a bigger maximum frame size, though not greater than
  17996. 1456 bytes.
  17997. </p>
  17998. </dd>
  17999. <dt><samp>pkt_size=<var>bytes</var></samp></dt>
  18000. <dd><p>Alias for &lsquo;<samp>payload_size</samp>&rsquo;.
  18001. </p>
  18002. </dd>
  18003. <dt><samp>peerlatency=<var>microseconds</var></samp></dt>
  18004. <dd><p>The latency value (as described in <samp>rcvlatency</samp>) that is
  18005. set by the sender side as a minimum value for the receiver.
  18006. </p>
  18007. </dd>
  18008. <dt><samp>pbkeylen=<var>bytes</var></samp></dt>
  18009. <dd><p>Sender encryption key length, in bytes.
  18010. Only can be set to 0, 16, 24 and 32.
  18011. Enable sender encryption if not 0.
  18012. Not required on receiver (set to 0),
  18013. key size obtained from sender in HaiCrypt handshake.
  18014. Default value is 0.
  18015. </p>
  18016. </dd>
  18017. <dt><samp>rcvlatency=<var>microseconds</var></samp></dt>
  18018. <dd><p>The time that should elapse since the moment when the
  18019. packet was sent and the moment when it&rsquo;s delivered to
  18020. the receiver application in the receiving function.
  18021. This time should be a buffer time large enough to cover
  18022. the time spent for sending, unexpectedly extended RTT
  18023. time, and the time needed to retransmit the lost UDP
  18024. packet. The effective latency value will be the maximum
  18025. of this options&rsquo; value and the value of <samp>peerlatency</samp>
  18026. set by the peer side. Before version 1.3.0 this option
  18027. is only available as <samp>latency</samp>.
  18028. </p>
  18029. </dd>
  18030. <dt><samp>recv_buffer_size=<var>bytes</var></samp></dt>
  18031. <dd><p>Set UDP receive buffer size, expressed in bytes.
  18032. </p>
  18033. </dd>
  18034. <dt><samp>send_buffer_size=<var>bytes</var></samp></dt>
  18035. <dd><p>Set UDP send buffer size, expressed in bytes.
  18036. </p>
  18037. </dd>
  18038. <dt><samp>timeout=<var>microseconds</var></samp></dt>
  18039. <dd><p>Set raise error timeouts for read, write and connect operations. Note that the
  18040. SRT library has internal timeouts which can be controlled separately, the
  18041. value set here is only a cap on those.
  18042. </p>
  18043. </dd>
  18044. <dt><samp>tlpktdrop=<var>1|0</var></samp></dt>
  18045. <dd><p>Too-late Packet Drop. When enabled on receiver, it skips
  18046. missing packets that have not been delivered in time and
  18047. delivers the following packets to the application when
  18048. their time-to-play has come. It also sends a fake ACK to
  18049. the sender. When enabled on sender and enabled on the
  18050. receiving peer, the sender drops the older packets that
  18051. have no chance of being delivered in time. It was
  18052. automatically enabled in the sender if the receiver
  18053. supports it.
  18054. </p>
  18055. </dd>
  18056. <dt><samp>sndbuf=<var>bytes</var></samp></dt>
  18057. <dd><p>Set send buffer size, expressed in bytes.
  18058. </p>
  18059. </dd>
  18060. <dt><samp>rcvbuf=<var>bytes</var></samp></dt>
  18061. <dd><p>Set receive buffer size, expressed in bytes.
  18062. </p>
  18063. <p>Receive buffer must not be greater than <samp>ffs</samp>.
  18064. </p>
  18065. </dd>
  18066. <dt><samp>lossmaxttl=<var>packets</var></samp></dt>
  18067. <dd><p>The value up to which the Reorder Tolerance may grow. When
  18068. Reorder Tolerance is &gt; 0, then packet loss report is delayed
  18069. until that number of packets come in. Reorder Tolerance
  18070. increases every time a &quot;belated&quot; packet has come, but it
  18071. wasn&rsquo;t due to retransmission (that is, when UDP packets tend
  18072. to come out of order), with the difference between the latest
  18073. sequence and this packet&rsquo;s sequence, and not more than the
  18074. value of this option. By default it&rsquo;s 0, which means that this
  18075. mechanism is turned off, and the loss report is always sent
  18076. immediately upon experiencing a &quot;gap&quot; in sequences.
  18077. </p>
  18078. </dd>
  18079. <dt><samp>minversion</samp></dt>
  18080. <dd><p>The minimum SRT version that is required from the peer. A connection
  18081. to a peer that does not satisfy the minimum version requirement
  18082. will be rejected.
  18083. </p>
  18084. <p>The version format in hex is 0xXXYYZZ for x.y.z in human readable
  18085. form.
  18086. </p>
  18087. </dd>
  18088. <dt><samp>streamid=<var>string</var></samp></dt>
  18089. <dd><p>A string limited to 512 characters that can be set on the socket prior
  18090. to connecting. This stream ID will be able to be retrieved by the
  18091. listener side from the socket that is returned from srt_accept and
  18092. was connected by a socket with that set stream ID. SRT does not enforce
  18093. any special interpretation of the contents of this string.
  18094. This option doesn’t make sense in Rendezvous connection; the result
  18095. might be that simply one side will override the value from the other
  18096. side and it’s the matter of luck which one would win
  18097. </p>
  18098. </dd>
  18099. <dt><samp>smoother=<var>live|file</var></samp></dt>
  18100. <dd><p>The type of Smoother used for the transmission for that socket, which
  18101. is responsible for the transmission and congestion control. The Smoother
  18102. type must be exactly the same on both connecting parties, otherwise
  18103. the connection is rejected.
  18104. </p>
  18105. </dd>
  18106. <dt><samp>messageapi=<var>1|0</var></samp></dt>
  18107. <dd><p>When set, this socket uses the Message API, otherwise it uses Buffer
  18108. API. Note that in live mode (see <samp>transtype</samp>) there’s only
  18109. message API available. In File mode you can chose to use one of two modes:
  18110. </p>
  18111. <p>Stream API (default, when this option is false). In this mode you may
  18112. send as many data as you wish with one sending instruction, or even use
  18113. dedicated functions that read directly from a file. The internal facility
  18114. will take care of any speed and congestion control. When receiving, you
  18115. can also receive as many data as desired, the data not extracted will be
  18116. waiting for the next call. There is no boundary between data portions in
  18117. the Stream mode.
  18118. </p>
  18119. <p>Message API. In this mode your single sending instruction passes exactly
  18120. one piece of data that has boundaries (a message). Contrary to Live mode,
  18121. this message may span across multiple UDP packets and the only size
  18122. limitation is that it shall fit as a whole in the sending buffer. The
  18123. receiver shall use as large buffer as necessary to receive the message,
  18124. otherwise the message will not be given up. When the message is not
  18125. complete (not all packets received or there was a packet loss) it will
  18126. not be given up.
  18127. </p>
  18128. </dd>
  18129. <dt><samp>transtype=<var>live|file</var></samp></dt>
  18130. <dd><p>Sets the transmission type for the socket, in particular, setting this
  18131. option sets multiple other parameters to their default values as required
  18132. for a particular transmission type.
  18133. </p>
  18134. <p>live: Set options as for live transmission. In this mode, you should
  18135. send by one sending instruction only so many data that fit in one UDP packet,
  18136. and limited to the value defined first in <samp>payload_size</samp> (1316 is
  18137. default in this mode). There is no speed control in this mode, only the
  18138. bandwidth control, if configured, in order to not exceed the bandwidth with
  18139. the overhead transmission (retransmitted and control packets).
  18140. </p>
  18141. <p>file: Set options as for non-live transmission. See <samp>messageapi</samp>
  18142. for further explanations
  18143. </p>
  18144. </dd>
  18145. <dt><samp>linger=<var>seconds</var></samp></dt>
  18146. <dd><p>The number of seconds that the socket waits for unsent data when closing.
  18147. Default is -1. -1 means auto (off with 0 seconds in live mode, on with 180
  18148. seconds in file mode). The range for this option is integers in the
  18149. 0 - <code>INT_MAX</code>.
  18150. </p>
  18151. </dd>
  18152. </dl>
  18153. <p>For more information see: <a href="https://github.com/Haivision/srt">https://github.com/Haivision/srt</a>.
  18154. </p>
  18155. <a name="srtp"></a>
  18156. <h3 class="section">24.35 srtp<span class="pull-right"><a class="anchor hidden-xs" href="#srtp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-srtp" aria-hidden="true">TOC</a></span></h3>
  18157. <p>Secure Real-time Transport Protocol.
  18158. </p>
  18159. <p>The accepted options are:
  18160. </p><dl compact="compact">
  18161. <dt><samp>srtp_in_suite</samp></dt>
  18162. <dt><samp>srtp_out_suite</samp></dt>
  18163. <dd><p>Select input and output encoding suites.
  18164. </p>
  18165. <p>Supported values:
  18166. </p><dl compact="compact">
  18167. <dt>&lsquo;<samp>AES_CM_128_HMAC_SHA1_80</samp>&rsquo;</dt>
  18168. <dt>&lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_80</samp>&rsquo;</dt>
  18169. <dt>&lsquo;<samp>AES_CM_128_HMAC_SHA1_32</samp>&rsquo;</dt>
  18170. <dt>&lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_32</samp>&rsquo;</dt>
  18171. </dl>
  18172. </dd>
  18173. <dt><samp>srtp_in_params</samp></dt>
  18174. <dt><samp>srtp_out_params</samp></dt>
  18175. <dd><p>Set input and output encoding parameters, which are expressed by a
  18176. base64-encoded representation of a binary block. The first 16 bytes of
  18177. this binary block are used as master key, the following 14 bytes are
  18178. used as master salt.
  18179. </p></dd>
  18180. </dl>
  18181. <a name="subfile"></a>
  18182. <h3 class="section">24.36 subfile<span class="pull-right"><a class="anchor hidden-xs" href="#subfile" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-subfile" aria-hidden="true">TOC</a></span></h3>
  18183. <p>Virtually extract a segment of a file or another stream.
  18184. The underlying stream must be seekable.
  18185. </p>
  18186. <p>Accepted options:
  18187. </p><dl compact="compact">
  18188. <dt><samp>start</samp></dt>
  18189. <dd><p>Start offset of the extracted segment, in bytes.
  18190. </p></dd>
  18191. <dt><samp>end</samp></dt>
  18192. <dd><p>End offset of the extracted segment, in bytes.
  18193. If set to 0, extract till end of file.
  18194. </p></dd>
  18195. </dl>
  18196. <p>Examples:
  18197. </p>
  18198. <p>Extract a chapter from a DVD VOB file (start and end sectors obtained
  18199. externally and multiplied by 2048):
  18200. </p><div class="example">
  18201. <pre class="example">subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
  18202. </pre></div>
  18203. <p>Play an AVI file directly from a TAR archive:
  18204. </p><div class="example">
  18205. <pre class="example">subfile,,start,183241728,end,366490624,,:archive.tar
  18206. </pre></div>
  18207. <p>Play a MPEG-TS file from start offset till end:
  18208. </p><div class="example">
  18209. <pre class="example">subfile,,start,32815239,end,0,,:video.ts
  18210. </pre></div>
  18211. <a name="tee-2"></a>
  18212. <h3 class="section">24.37 tee<span class="pull-right"><a class="anchor hidden-xs" href="#tee-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tee-2" aria-hidden="true">TOC</a></span></h3>
  18213. <p>Writes the output to multiple protocols. The individual outputs are separated
  18214. by |
  18215. </p>
  18216. <div class="example">
  18217. <pre class="example">tee:file://path/to/local/this.avi|file://path/to/local/that.avi
  18218. </pre></div>
  18219. <a name="tcp"></a>
  18220. <h3 class="section">24.38 tcp<span class="pull-right"><a class="anchor hidden-xs" href="#tcp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tcp" aria-hidden="true">TOC</a></span></h3>
  18221. <p>Transmission Control Protocol.
  18222. </p>
  18223. <p>The required syntax for a TCP url is:
  18224. </p><div class="example">
  18225. <pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  18226. </pre></div>
  18227. <p><var>options</var> contains a list of &amp;-separated options of the form
  18228. <var>key</var>=<var>val</var>.
  18229. </p>
  18230. <p>The list of supported options follows.
  18231. </p>
  18232. <dl compact="compact">
  18233. <dt><samp>listen=<var>2|1|0</var></samp></dt>
  18234. <dd><p>Listen for an incoming connection. 0 disables listen, 1 enables listen in
  18235. single client mode, 2 enables listen in multi-client mode. Default value is 0.
  18236. </p>
  18237. </dd>
  18238. <dt><samp>timeout=<var>microseconds</var></samp></dt>
  18239. <dd><p>Set raise error timeout, expressed in microseconds.
  18240. </p>
  18241. <p>This option is only relevant in read mode: if no data arrived in more
  18242. than this time interval, raise error.
  18243. </p>
  18244. </dd>
  18245. <dt><samp>listen_timeout=<var>milliseconds</var></samp></dt>
  18246. <dd><p>Set listen timeout, expressed in milliseconds.
  18247. </p>
  18248. </dd>
  18249. <dt><samp>recv_buffer_size=<var>bytes</var></samp></dt>
  18250. <dd><p>Set receive buffer size, expressed bytes.
  18251. </p>
  18252. </dd>
  18253. <dt><samp>send_buffer_size=<var>bytes</var></samp></dt>
  18254. <dd><p>Set send buffer size, expressed bytes.
  18255. </p>
  18256. </dd>
  18257. <dt><samp>tcp_nodelay=<var>1|0</var></samp></dt>
  18258. <dd><p>Set TCP_NODELAY to disable Nagle&rsquo;s algorithm. Default value is 0.
  18259. </p>
  18260. </dd>
  18261. <dt><samp>tcp_mss=<var>bytes</var></samp></dt>
  18262. <dd><p>Set maximum segment size for outgoing TCP packets, expressed in bytes.
  18263. </p></dd>
  18264. </dl>
  18265. <p>The following example shows how to setup a listening TCP connection
  18266. with <code>ffmpeg</code>, which is then accessed with <code>ffplay</code>:
  18267. </p><div class="example">
  18268. <pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tcp://<var>hostname</var>:<var>port</var>?listen
  18269. ffplay tcp://<var>hostname</var>:<var>port</var>
  18270. </pre></div>
  18271. <a name="tls"></a>
  18272. <h3 class="section">24.39 tls<span class="pull-right"><a class="anchor hidden-xs" href="#tls" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tls" aria-hidden="true">TOC</a></span></h3>
  18273. <p>Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
  18274. </p>
  18275. <p>The required syntax for a TLS/SSL url is:
  18276. </p><div class="example">
  18277. <pre class="example">tls://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  18278. </pre></div>
  18279. <p>The following parameters can be set via command line options
  18280. (or in code via <code>AVOption</code>s):
  18281. </p>
  18282. <dl compact="compact">
  18283. <dt><samp>ca_file, cafile=<var>filename</var></samp></dt>
  18284. <dd><p>A file containing certificate authority (CA) root certificates to treat
  18285. as trusted. If the linked TLS library contains a default this might not
  18286. need to be specified for verification to work, but not all libraries and
  18287. setups have defaults built in.
  18288. The file must be in OpenSSL PEM format.
  18289. </p>
  18290. </dd>
  18291. <dt><samp>tls_verify=<var>1|0</var></samp></dt>
  18292. <dd><p>If enabled, try to verify the peer that we are communicating with.
  18293. Note, if using OpenSSL, this currently only makes sure that the
  18294. peer certificate is signed by one of the root certificates in the CA
  18295. database, but it does not validate that the certificate actually
  18296. matches the host name we are trying to connect to. (With other backends,
  18297. the host name is validated as well.)
  18298. </p>
  18299. <p>This is disabled by default since it requires a CA database to be
  18300. provided by the caller in many cases.
  18301. </p>
  18302. </dd>
  18303. <dt><samp>cert_file, cert=<var>filename</var></samp></dt>
  18304. <dd><p>A file containing a certificate to use in the handshake with the peer.
  18305. (When operating as server, in listen mode, this is more often required
  18306. by the peer, while client certificates only are mandated in certain
  18307. setups.)
  18308. </p>
  18309. </dd>
  18310. <dt><samp>key_file, key=<var>filename</var></samp></dt>
  18311. <dd><p>A file containing the private key for the certificate.
  18312. </p>
  18313. </dd>
  18314. <dt><samp>listen=<var>1|0</var></samp></dt>
  18315. <dd><p>If enabled, listen for connections on the provided port, and assume
  18316. the server role in the handshake instead of the client role.
  18317. </p>
  18318. </dd>
  18319. <dt><samp>http_proxy</samp></dt>
  18320. <dd><p>The HTTP proxy to tunnel through, e.g. <code>http://example.com:1234</code>.
  18321. The proxy must support the CONNECT method.
  18322. </p>
  18323. </dd>
  18324. </dl>
  18325. <p>Example command lines:
  18326. </p>
  18327. <p>To create a TLS/SSL server that serves an input stream.
  18328. </p>
  18329. <div class="example">
  18330. <pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tls://<var>hostname</var>:<var>port</var>?listen&amp;cert=<var>server.crt</var>&amp;key=<var>server.key</var>
  18331. </pre></div>
  18332. <p>To play back a stream from the TLS/SSL server using <code>ffplay</code>:
  18333. </p>
  18334. <div class="example">
  18335. <pre class="example">ffplay tls://<var>hostname</var>:<var>port</var>
  18336. </pre></div>
  18337. <a name="udp"></a>
  18338. <h3 class="section">24.40 udp<span class="pull-right"><a class="anchor hidden-xs" href="#udp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-udp" aria-hidden="true">TOC</a></span></h3>
  18339. <p>User Datagram Protocol.
  18340. </p>
  18341. <p>The required syntax for an UDP URL is:
  18342. </p><div class="example">
  18343. <pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  18344. </pre></div>
  18345. <p><var>options</var> contains a list of &amp;-separated options of the form <var>key</var>=<var>val</var>.
  18346. </p>
  18347. <p>In case threading is enabled on the system, a circular buffer is used
  18348. to store the incoming data, which allows one to reduce loss of data due to
  18349. UDP socket buffer overruns. The <var>fifo_size</var> and
  18350. <var>overrun_nonfatal</var> options are related to this buffer.
  18351. </p>
  18352. <p>The list of supported options follows.
  18353. </p>
  18354. <dl compact="compact">
  18355. <dt><samp>buffer_size=<var>size</var></samp></dt>
  18356. <dd><p>Set the UDP maximum socket buffer size in bytes. This is used to set either
  18357. the receive or send buffer size, depending on what the socket is used for.
  18358. Default is 32 KB for output, 384 KB for input. See also <var>fifo_size</var>.
  18359. </p>
  18360. </dd>
  18361. <dt><samp>bitrate=<var>bitrate</var></samp></dt>
  18362. <dd><p>If set to nonzero, the output will have the specified constant bitrate if the
  18363. input has enough packets to sustain it.
  18364. </p>
  18365. </dd>
  18366. <dt><samp>burst_bits=<var>bits</var></samp></dt>
  18367. <dd><p>When using <var>bitrate</var> this specifies the maximum number of bits in
  18368. packet bursts.
  18369. </p>
  18370. </dd>
  18371. <dt><samp>localport=<var>port</var></samp></dt>
  18372. <dd><p>Override the local UDP port to bind with.
  18373. </p>
  18374. </dd>
  18375. <dt><samp>localaddr=<var>addr</var></samp></dt>
  18376. <dd><p>Local IP address of a network interface used for sending packets or joining
  18377. multicast groups.
  18378. </p>
  18379. </dd>
  18380. <dt><samp>pkt_size=<var>size</var></samp></dt>
  18381. <dd><p>Set the size in bytes of UDP packets.
  18382. </p>
  18383. </dd>
  18384. <dt><samp>reuse=<var>1|0</var></samp></dt>
  18385. <dd><p>Explicitly allow or disallow reusing UDP sockets.
  18386. </p>
  18387. </dd>
  18388. <dt><samp>ttl=<var>ttl</var></samp></dt>
  18389. <dd><p>Set the time to live value (for multicast only).
  18390. </p>
  18391. </dd>
  18392. <dt><samp>connect=<var>1|0</var></samp></dt>
  18393. <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
  18394. destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
  18395. If the destination address isn&rsquo;t known at the start, this option can
  18396. be specified in ff_udp_set_remote_url, too.
  18397. This allows finding out the source address for the packets with getsockname,
  18398. and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
  18399. unreachable&quot; is received.
  18400. For receiving, this gives the benefit of only receiving packets from
  18401. the specified peer address/port.
  18402. </p>
  18403. </dd>
  18404. <dt><samp>sources=<var>address</var>[,<var>address</var>]</samp></dt>
  18405. <dd><p>Only receive packets sent from the specified addresses. In case of multicast,
  18406. also subscribe to multicast traffic coming from these addresses only.
  18407. </p>
  18408. </dd>
  18409. <dt><samp>block=<var>address</var>[,<var>address</var>]</samp></dt>
  18410. <dd><p>Ignore packets sent from the specified addresses. In case of multicast, also
  18411. exclude the source addresses in the multicast subscription.
  18412. </p>
  18413. </dd>
  18414. <dt><samp>fifo_size=<var>units</var></samp></dt>
  18415. <dd><p>Set the UDP receiving circular buffer size, expressed as a number of
  18416. packets with size of 188 bytes. If not specified defaults to 7*4096.
  18417. </p>
  18418. </dd>
  18419. <dt><samp>overrun_nonfatal=<var>1|0</var></samp></dt>
  18420. <dd><p>Survive in case of UDP receiving circular buffer overrun. Default
  18421. value is 0.
  18422. </p>
  18423. </dd>
  18424. <dt><samp>timeout=<var>microseconds</var></samp></dt>
  18425. <dd><p>Set raise error timeout, expressed in microseconds.
  18426. </p>
  18427. <p>This option is only relevant in read mode: if no data arrived in more
  18428. than this time interval, raise error.
  18429. </p>
  18430. </dd>
  18431. <dt><samp>broadcast=<var>1|0</var></samp></dt>
  18432. <dd><p>Explicitly allow or disallow UDP broadcasting.
  18433. </p>
  18434. <p>Note that broadcasting may not work properly on networks having
  18435. a broadcast storm protection.
  18436. </p></dd>
  18437. </dl>
  18438. <a name="Examples-20"></a>
  18439. <h4 class="subsection">24.40.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-20" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-20" aria-hidden="true">TOC</a></span></h4>
  18440. <ul>
  18441. <li> Use <code>ffmpeg</code> to stream over UDP to a remote endpoint:
  18442. <div class="example">
  18443. <pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> udp://<var>hostname</var>:<var>port</var>
  18444. </pre></div>
  18445. </li><li> Use <code>ffmpeg</code> to stream in mpegts format over UDP using 188
  18446. sized UDP packets, using a large input buffer:
  18447. <div class="example">
  18448. <pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&amp;buffer_size=65535
  18449. </pre></div>
  18450. </li><li> Use <code>ffmpeg</code> to receive over UDP from a remote endpoint:
  18451. <div class="example">
  18452. <pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var> ...
  18453. </pre></div>
  18454. </li></ul>
  18455. <a name="unix"></a>
  18456. <h3 class="section">24.41 unix<span class="pull-right"><a class="anchor hidden-xs" href="#unix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unix" aria-hidden="true">TOC</a></span></h3>
  18457. <p>Unix local socket
  18458. </p>
  18459. <p>The required syntax for a Unix socket URL is:
  18460. </p>
  18461. <div class="example">
  18462. <pre class="example">unix://<var>filepath</var>
  18463. </pre></div>
  18464. <p>The following parameters can be set via command line options
  18465. (or in code via <code>AVOption</code>s):
  18466. </p>
  18467. <dl compact="compact">
  18468. <dt><samp>timeout</samp></dt>
  18469. <dd><p>Timeout in ms.
  18470. </p></dd>
  18471. <dt><samp>listen</samp></dt>
  18472. <dd><p>Create the Unix socket in listening mode.
  18473. </p></dd>
  18474. </dl>
  18475. <a name="zmq"></a>
  18476. <h3 class="section">24.42 zmq<span class="pull-right"><a class="anchor hidden-xs" href="#zmq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zmq" aria-hidden="true">TOC</a></span></h3>
  18477. <p>ZeroMQ asynchronous messaging using the libzmq library.
  18478. </p>
  18479. <p>This library supports unicast streaming to multiple clients without relying on
  18480. an external server.
  18481. </p>
  18482. <p>The required syntax for streaming or connecting to a stream is:
  18483. </p><div class="example">
  18484. <pre class="example">zmq:tcp://ip-address:port
  18485. </pre></div>
  18486. <p>Example:
  18487. Create a localhost stream on port 5555:
  18488. </p><div class="example">
  18489. <pre class="example">ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
  18490. </pre></div>
  18491. <p>Multiple clients may connect to the stream using:
  18492. </p><div class="example">
  18493. <pre class="example">ffplay zmq:tcp://127.0.0.1:5555
  18494. </pre></div>
  18495. <p>Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub pattern.
  18496. The server side binds to a port and publishes data. Clients connect to the
  18497. server (via IP address/port) and subscribe to the stream. The order in which
  18498. the server and client start generally does not matter.
  18499. </p>
  18500. <p>ffmpeg must be compiled with the &ndash;enable-libzmq option to support
  18501. this protocol.
  18502. </p>
  18503. <p>Options can be set on the <code>ffmpeg</code>/<code>ffplay</code> command
  18504. line. The following options are supported:
  18505. </p>
  18506. <dl compact="compact">
  18507. <dt><samp>pkt_size</samp></dt>
  18508. <dd><p>Forces the maximum packet size for sending/receiving data. The default value is
  18509. 131,072 bytes. On the server side, this sets the maximum size of sent packets
  18510. via ZeroMQ. On the clients, it sets an internal buffer size for receiving
  18511. packets. Note that pkt_size on the clients should be equal to or greater than
  18512. pkt_size on the server. Otherwise the received message may be truncated causing
  18513. decoding errors.
  18514. </p>
  18515. </dd>
  18516. </dl>
  18517. <a name="Device-Options"></a>
  18518. <h2 class="chapter">25 Device Options<span class="pull-right"><a class="anchor hidden-xs" href="#Device-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Device-Options" aria-hidden="true">TOC</a></span></h2>
  18519. <p>The libavdevice library provides the same interface as
  18520. libavformat. Namely, an input device is considered like a demuxer, and
  18521. an output device like a muxer, and the interface and generic device
  18522. options are the same provided by libavformat (see the ffmpeg-formats
  18523. manual).
  18524. </p>
  18525. <p>In addition each input or output device may support so-called private
  18526. options, which are specific for that component.
  18527. </p>
  18528. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  18529. FFmpeg tools, or by setting the value explicitly in the device
  18530. <code>AVFormatContext</code> options or using the <samp>libavutil/opt.h</samp> API
  18531. for programmatic use.
  18532. </p>
  18533. <a name="Input-Devices"></a>
  18534. <h2 class="chapter">26 Input Devices<span class="pull-right"><a class="anchor hidden-xs" href="#Input-Devices" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Input-Devices" aria-hidden="true">TOC</a></span></h2>
  18535. <p>Input devices are configured elements in FFmpeg which enable accessing
  18536. the data coming from a multimedia device attached to your system.
  18537. </p>
  18538. <p>When you configure your FFmpeg build, all the supported input devices
  18539. are enabled by default. You can list all available ones using the
  18540. configure option &quot;&ndash;list-indevs&quot;.
  18541. </p>
  18542. <p>You can disable all the input devices using the configure option
  18543. &quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
  18544. option &quot;&ndash;enable-indev=<var>INDEV</var>&quot;, or you can disable a particular
  18545. input device using the option &quot;&ndash;disable-indev=<var>INDEV</var>&quot;.
  18546. </p>
  18547. <p>The option &quot;-devices&quot; of the ff* tools will display the list of
  18548. supported input devices.
  18549. </p>
  18550. <p>A description of the currently available input devices follows.
  18551. </p>
  18552. <a name="alsa"></a>
  18553. <h3 class="section">26.1 alsa<span class="pull-right"><a class="anchor hidden-xs" href="#alsa" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alsa" aria-hidden="true">TOC</a></span></h3>
  18554. <p>ALSA (Advanced Linux Sound Architecture) input device.
  18555. </p>
  18556. <p>To enable this input device during configuration you need libasound
  18557. installed on your system.
  18558. </p>
  18559. <p>This device allows capturing from an ALSA device. The name of the
  18560. device to capture has to be an ALSA card identifier.
  18561. </p>
  18562. <p>An ALSA identifier has the syntax:
  18563. </p><div class="example">
  18564. <pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
  18565. </pre></div>
  18566. <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
  18567. </p>
  18568. <p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
  18569. specify card number or identifier, device number and subdevice number
  18570. (-1 means any).
  18571. </p>
  18572. <p>To see the list of cards currently recognized by your system check the
  18573. files <samp>/proc/asound/cards</samp> and <samp>/proc/asound/devices</samp>.
  18574. </p>
  18575. <p>For example to capture with <code>ffmpeg</code> from an ALSA device with
  18576. card id 0, you may run the command:
  18577. </p><div class="example">
  18578. <pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
  18579. </pre></div>
  18580. <p>For more information see:
  18581. <a href="http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html">http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html</a>
  18582. </p>
  18583. <a name="Options-56"></a>
  18584. <h4 class="subsection">26.1.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-56" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-56" aria-hidden="true">TOC</a></span></h4>
  18585. <dl compact="compact">
  18586. <dt><samp>sample_rate</samp></dt>
  18587. <dd><p>Set the sample rate in Hz. Default is 48000.
  18588. </p>
  18589. </dd>
  18590. <dt><samp>channels</samp></dt>
  18591. <dd><p>Set the number of channels. Default is 2.
  18592. </p>
  18593. </dd>
  18594. </dl>
  18595. <a name="android_005fcamera"></a>
  18596. <h3 class="section">26.2 android_camera<span class="pull-right"><a class="anchor hidden-xs" href="#android_005fcamera" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-android_005fcamera" aria-hidden="true">TOC</a></span></h3>
  18597. <p>Android camera input device.
  18598. </p>
  18599. <p>This input devices uses the Android Camera2 NDK API which is
  18600. available on devices with API level 24+. The availability of
  18601. android_camera is autodetected during configuration.
  18602. </p>
  18603. <p>This device allows capturing from all cameras on an Android device,
  18604. which are integrated into the Camera2 NDK API.
  18605. </p>
  18606. <p>The available cameras are enumerated internally and can be selected
  18607. with the <var>camera_index</var> parameter. The input file string is
  18608. discarded.
  18609. </p>
  18610. <p>Generally the back facing camera has index 0 while the front facing
  18611. camera has index 1.
  18612. </p>
  18613. <a name="Options-57"></a>
  18614. <h4 class="subsection">26.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-57" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-57" aria-hidden="true">TOC</a></span></h4>
  18615. <dl compact="compact">
  18616. <dt><samp>video_size</samp></dt>
  18617. <dd><p>Set the video size given as a string such as 640x480 or hd720.
  18618. Falls back to the first available configuration reported by
  18619. Android if requested video size is not available or by default.
  18620. </p>
  18621. </dd>
  18622. <dt><samp>framerate</samp></dt>
  18623. <dd><p>Set the video framerate.
  18624. Falls back to the first available configuration reported by
  18625. Android if requested framerate is not available or by default (-1).
  18626. </p>
  18627. </dd>
  18628. <dt><samp>camera_index</samp></dt>
  18629. <dd><p>Set the index of the camera to use. Default is 0.
  18630. </p>
  18631. </dd>
  18632. <dt><samp>input_queue_size</samp></dt>
  18633. <dd><p>Set the maximum number of frames to buffer. Default is 5.
  18634. </p>
  18635. </dd>
  18636. </dl>
  18637. <a name="avfoundation"></a>
  18638. <h3 class="section">26.3 avfoundation<span class="pull-right"><a class="anchor hidden-xs" href="#avfoundation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avfoundation" aria-hidden="true">TOC</a></span></h3>
  18639. <p>AVFoundation input device.
  18640. </p>
  18641. <p>AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX &gt;= 10.7 as well as on iOS.
  18642. </p>
  18643. <p>The input filename has to be given in the following syntax:
  18644. </p><div class="example">
  18645. <pre class="example">-i &quot;[[VIDEO]:[AUDIO]]&quot;
  18646. </pre></div>
  18647. <p>The first entry selects the video input while the latter selects the audio input.
  18648. The stream has to be specified by the device name or the device index as shown by the device list.
  18649. Alternatively, the video and/or audio input device can be chosen by index using the
  18650. <samp>
  18651. -video_device_index &lt;INDEX&gt;
  18652. </samp>
  18653. and/or
  18654. <samp>
  18655. -audio_device_index &lt;INDEX&gt;
  18656. </samp>
  18657. , overriding any
  18658. device name or index given in the input filename.
  18659. </p>
  18660. <p>All available devices can be enumerated by using <samp>-list_devices true</samp>, listing
  18661. all device names and corresponding indices.
  18662. </p>
  18663. <p>There are two device name aliases:
  18664. </p><dl compact="compact">
  18665. <dt><code>default</code></dt>
  18666. <dd><p>Select the AVFoundation default device of the corresponding type.
  18667. </p>
  18668. </dd>
  18669. <dt><code>none</code></dt>
  18670. <dd><p>Do not record the corresponding media type.
  18671. This is equivalent to specifying an empty device name or index.
  18672. </p>
  18673. </dd>
  18674. </dl>
  18675. <a name="Options-58"></a>
  18676. <h4 class="subsection">26.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-58" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-58" aria-hidden="true">TOC</a></span></h4>
  18677. <p>AVFoundation supports the following options:
  18678. </p>
  18679. <dl compact="compact">
  18680. <dt><samp>-list_devices &lt;TRUE|FALSE&gt;</samp></dt>
  18681. <dd><p>If set to true, a list of all available input devices is given showing all
  18682. device names and indices.
  18683. </p>
  18684. </dd>
  18685. <dt><samp>-video_device_index &lt;INDEX&gt;</samp></dt>
  18686. <dd><p>Specify the video device by its index. Overrides anything given in the input filename.
  18687. </p>
  18688. </dd>
  18689. <dt><samp>-audio_device_index &lt;INDEX&gt;</samp></dt>
  18690. <dd><p>Specify the audio device by its index. Overrides anything given in the input filename.
  18691. </p>
  18692. </dd>
  18693. <dt><samp>-pixel_format &lt;FORMAT&gt;</samp></dt>
  18694. <dd><p>Request the video device to use a specific pixel format.
  18695. If the specified format is not supported, a list of available formats is given
  18696. and the first one in this list is used instead. Available pixel formats are:
  18697. <code>monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
  18698. bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
  18699. yuv420p, nv12, yuyv422, gray</code>
  18700. </p>
  18701. </dd>
  18702. <dt><samp>-framerate</samp></dt>
  18703. <dd><p>Set the grabbing frame rate. Default is <code>ntsc</code>, corresponding to a
  18704. frame rate of <code>30000/1001</code>.
  18705. </p>
  18706. </dd>
  18707. <dt><samp>-video_size</samp></dt>
  18708. <dd><p>Set the video frame size.
  18709. </p>
  18710. </dd>
  18711. <dt><samp>-capture_cursor</samp></dt>
  18712. <dd><p>Capture the mouse pointer. Default is 0.
  18713. </p>
  18714. </dd>
  18715. <dt><samp>-capture_mouse_clicks</samp></dt>
  18716. <dd><p>Capture the screen mouse clicks. Default is 0.
  18717. </p>
  18718. </dd>
  18719. <dt><samp>-capture_raw_data</samp></dt>
  18720. <dd><p>Capture the raw device data. Default is 0.
  18721. 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.
  18722. </p></dd>
  18723. </dl>
  18724. <a name="Examples-21"></a>
  18725. <h4 class="subsection">26.3.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-21" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-21" aria-hidden="true">TOC</a></span></h4>
  18726. <ul>
  18727. <li> Print the list of AVFoundation supported devices and exit:
  18728. <div class="example">
  18729. <pre class="example">$ ffmpeg -f avfoundation -list_devices true -i &quot;&quot;
  18730. </pre></div>
  18731. </li><li> Record video from video device 0 and audio from audio device 0 into out.avi:
  18732. <div class="example">
  18733. <pre class="example">$ ffmpeg -f avfoundation -i &quot;0:0&quot; out.avi
  18734. </pre></div>
  18735. </li><li> Record video from video device 2 and audio from audio device 1 into out.avi:
  18736. <div class="example">
  18737. <pre class="example">$ ffmpeg -f avfoundation -video_device_index 2 -i &quot;:1&quot; out.avi
  18738. </pre></div>
  18739. </li><li> Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi:
  18740. <div class="example">
  18741. <pre class="example">$ ffmpeg -f avfoundation -pixel_format bgr0 -i &quot;default:none&quot; out.avi
  18742. </pre></div>
  18743. </li><li> Record raw DV data from a suitable input device and write the output into out.dv:
  18744. <div class="example">
  18745. <pre class="example">$ ffmpeg -f avfoundation -capture_raw_data true -i &quot;zr100:none&quot; out.dv
  18746. </pre></div>
  18747. </li></ul>
  18748. <a name="bktr"></a>
  18749. <h3 class="section">26.4 bktr<span class="pull-right"><a class="anchor hidden-xs" href="#bktr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bktr" aria-hidden="true">TOC</a></span></h3>
  18750. <p>BSD video input device.
  18751. </p>
  18752. <a name="Options-59"></a>
  18753. <h4 class="subsection">26.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-59" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-59" aria-hidden="true">TOC</a></span></h4>
  18754. <dl compact="compact">
  18755. <dt><samp>framerate</samp></dt>
  18756. <dd><p>Set the frame rate.
  18757. </p>
  18758. </dd>
  18759. <dt><samp>video_size</samp></dt>
  18760. <dd><p>Set the video frame size. Default is <code>vga</code>.
  18761. </p>
  18762. </dd>
  18763. <dt><samp>standard</samp></dt>
  18764. <dd>
  18765. <p>Available values are:
  18766. </p><dl compact="compact">
  18767. <dt>&lsquo;<samp>pal</samp>&rsquo;</dt>
  18768. <dt>&lsquo;<samp>ntsc</samp>&rsquo;</dt>
  18769. <dt>&lsquo;<samp>secam</samp>&rsquo;</dt>
  18770. <dt>&lsquo;<samp>paln</samp>&rsquo;</dt>
  18771. <dt>&lsquo;<samp>palm</samp>&rsquo;</dt>
  18772. <dt>&lsquo;<samp>ntscj</samp>&rsquo;</dt>
  18773. </dl>
  18774. </dd>
  18775. </dl>
  18776. <a name="decklink"></a>
  18777. <h3 class="section">26.5 decklink<span class="pull-right"><a class="anchor hidden-xs" href="#decklink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-decklink" aria-hidden="true">TOC</a></span></h3>
  18778. <p>The decklink input device provides capture capabilities for Blackmagic
  18779. DeckLink devices.
  18780. </p>
  18781. <p>To enable this input device, you need the Blackmagic DeckLink SDK and you
  18782. need to configure with the appropriate <code>--extra-cflags</code>
  18783. and <code>--extra-ldflags</code>.
  18784. On Windows, you need to run the IDL files through <code>widl</code>.
  18785. </p>
  18786. <p>DeckLink is very picky about the formats it supports. Pixel format of the
  18787. input can be set with <samp>raw_format</samp>.
  18788. Framerate and video size must be determined for your device with
  18789. <code>-list_formats 1</code>. Audio sample rate is always 48 kHz and the number
  18790. of channels can be 2, 8 or 16. Note that all audio channels are bundled in one single
  18791. audio track.
  18792. </p>
  18793. <a name="Options-60"></a>
  18794. <h4 class="subsection">26.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-60" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-60" aria-hidden="true">TOC</a></span></h4>
  18795. <dl compact="compact">
  18796. <dt><samp>list_devices</samp></dt>
  18797. <dd><p>If set to <samp>true</samp>, print a list of devices and exit.
  18798. Defaults to <samp>false</samp>. This option is deprecated, please use the
  18799. <code>-sources</code> option of ffmpeg to list the available input devices.
  18800. </p>
  18801. </dd>
  18802. <dt><samp>list_formats</samp></dt>
  18803. <dd><p>If set to <samp>true</samp>, print a list of supported formats and exit.
  18804. Defaults to <samp>false</samp>.
  18805. </p>
  18806. </dd>
  18807. <dt><samp>format_code &lt;FourCC&gt;</samp></dt>
  18808. <dd><p>This sets the input video format to the format given by the FourCC. To see
  18809. the supported values of your device(s) use <samp>list_formats</samp>.
  18810. Note that there is a FourCC <samp>'pal '</samp> that can also be used
  18811. as <samp>pal</samp> (3 letters).
  18812. Default behavior is autodetection of the input video format, if the hardware
  18813. supports it.
  18814. </p>
  18815. </dd>
  18816. <dt><samp>raw_format</samp></dt>
  18817. <dd><p>Set the pixel format of the captured video.
  18818. Available values are:
  18819. </p><dl compact="compact">
  18820. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  18821. <dd>
  18822. <p>This is the default which means 8-bit YUV 422 or 8-bit ARGB if format
  18823. autodetection is used, 8-bit YUV 422 otherwise.
  18824. </p>
  18825. </dd>
  18826. <dt>&lsquo;<samp>uyvy422</samp>&rsquo;</dt>
  18827. <dd>
  18828. <p>8-bit YUV 422.
  18829. </p>
  18830. </dd>
  18831. <dt>&lsquo;<samp>yuv422p10</samp>&rsquo;</dt>
  18832. <dd>
  18833. <p>10-bit YUV 422.
  18834. </p>
  18835. </dd>
  18836. <dt>&lsquo;<samp>argb</samp>&rsquo;</dt>
  18837. <dd>
  18838. <p>8-bit RGB.
  18839. </p>
  18840. </dd>
  18841. <dt>&lsquo;<samp>bgra</samp>&rsquo;</dt>
  18842. <dd>
  18843. <p>8-bit RGB.
  18844. </p>
  18845. </dd>
  18846. <dt>&lsquo;<samp>rgb10</samp>&rsquo;</dt>
  18847. <dd>
  18848. <p>10-bit RGB.
  18849. </p>
  18850. </dd>
  18851. </dl>
  18852. </dd>
  18853. <dt><samp>teletext_lines</samp></dt>
  18854. <dd><p>If set to nonzero, an additional teletext stream will be captured from the
  18855. vertical ancillary data. Both SD PAL (576i) and HD (1080i or 1080p)
  18856. sources are supported. In case of HD sources, OP47 packets are decoded.
  18857. </p>
  18858. <p>This option is a bitmask of the SD PAL VBI lines captured, specifically lines 6
  18859. to 22, and lines 318 to 335. Line 6 is the LSB in the mask. Selected lines
  18860. which do not contain teletext information will be ignored. You can use the
  18861. special <samp>all</samp> constant to select all possible lines, or
  18862. <samp>standard</samp> to skip lines 6, 318 and 319, which are not compatible with
  18863. all receivers.
  18864. </p>
  18865. <p>For SD sources, ffmpeg needs to be compiled with <code>--enable-libzvbi</code>. For
  18866. HD sources, on older (pre-4K) DeckLink card models you have to capture in 10
  18867. bit mode.
  18868. </p>
  18869. </dd>
  18870. <dt><samp>channels</samp></dt>
  18871. <dd><p>Defines number of audio channels to capture. Must be &lsquo;<samp>2</samp>&rsquo;, &lsquo;<samp>8</samp>&rsquo; or &lsquo;<samp>16</samp>&rsquo;.
  18872. Defaults to &lsquo;<samp>2</samp>&rsquo;.
  18873. </p>
  18874. </dd>
  18875. <dt><samp>duplex_mode</samp></dt>
  18876. <dd><p>Sets the decklink device duplex mode. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>half</samp>&rsquo; or &lsquo;<samp>full</samp>&rsquo;.
  18877. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  18878. </p>
  18879. </dd>
  18880. <dt><samp>timecode_format</samp></dt>
  18881. <dd><p>Timecode type to include in the frame and video stream metadata. Must be
  18882. &lsquo;<samp>none</samp>&rsquo;, &lsquo;<samp>rp188vitc</samp>&rsquo;, &lsquo;<samp>rp188vitc2</samp>&rsquo;, &lsquo;<samp>rp188ltc</samp>&rsquo;,
  18883. &lsquo;<samp>rp188hfr</samp>&rsquo;, &lsquo;<samp>rp188any</samp>&rsquo;, &lsquo;<samp>vitc</samp>&rsquo;, &lsquo;<samp>vitc2</samp>&rsquo;, or &lsquo;<samp>serial</samp>&rsquo;.
  18884. Defaults to &lsquo;<samp>none</samp>&rsquo; (not included).
  18885. </p>
  18886. <p>In order to properly support 50/60 fps timecodes, the ordering of the queried
  18887. timecode types for &lsquo;<samp>rp188any</samp>&rsquo; is HFR, VITC1, VITC2 and LTC for &gt;30 fps
  18888. content. Note that this is slightly different to the ordering used by the
  18889. DeckLink API, which is HFR, VITC1, LTC, VITC2.
  18890. </p>
  18891. </dd>
  18892. <dt><samp>video_input</samp></dt>
  18893. <dd><p>Sets the video input source. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>sdi</samp>&rsquo;, &lsquo;<samp>hdmi</samp>&rsquo;,
  18894. &lsquo;<samp>optical_sdi</samp>&rsquo;, &lsquo;<samp>component</samp>&rsquo;, &lsquo;<samp>composite</samp>&rsquo; or &lsquo;<samp>s_video</samp>&rsquo;.
  18895. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  18896. </p>
  18897. </dd>
  18898. <dt><samp>audio_input</samp></dt>
  18899. <dd><p>Sets the audio input source. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>embedded</samp>&rsquo;,
  18900. &lsquo;<samp>aes_ebu</samp>&rsquo;, &lsquo;<samp>analog</samp>&rsquo;, &lsquo;<samp>analog_xlr</samp>&rsquo;, &lsquo;<samp>analog_rca</samp>&rsquo; or
  18901. &lsquo;<samp>microphone</samp>&rsquo;. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  18902. </p>
  18903. </dd>
  18904. <dt><samp>video_pts</samp></dt>
  18905. <dd><p>Sets the video packet timestamp source. Must be &lsquo;<samp>video</samp>&rsquo;, &lsquo;<samp>audio</samp>&rsquo;,
  18906. &lsquo;<samp>reference</samp>&rsquo;, &lsquo;<samp>wallclock</samp>&rsquo; or &lsquo;<samp>abs_wallclock</samp>&rsquo;.
  18907. Defaults to &lsquo;<samp>video</samp>&rsquo;.
  18908. </p>
  18909. </dd>
  18910. <dt><samp>audio_pts</samp></dt>
  18911. <dd><p>Sets the audio packet timestamp source. Must be &lsquo;<samp>video</samp>&rsquo;, &lsquo;<samp>audio</samp>&rsquo;,
  18912. &lsquo;<samp>reference</samp>&rsquo;, &lsquo;<samp>wallclock</samp>&rsquo; or &lsquo;<samp>abs_wallclock</samp>&rsquo;.
  18913. Defaults to &lsquo;<samp>audio</samp>&rsquo;.
  18914. </p>
  18915. </dd>
  18916. <dt><samp>draw_bars</samp></dt>
  18917. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, color bars are drawn in the event of a signal loss.
  18918. Defaults to &lsquo;<samp>true</samp>&rsquo;.
  18919. </p>
  18920. </dd>
  18921. <dt><samp>queue_size</samp></dt>
  18922. <dd><p>Sets maximum input buffer size in bytes. If the buffering reaches this value,
  18923. incoming frames will be dropped.
  18924. Defaults to &lsquo;<samp>1073741824</samp>&rsquo;.
  18925. </p>
  18926. </dd>
  18927. <dt><samp>audio_depth</samp></dt>
  18928. <dd><p>Sets the audio sample bit depth. Must be &lsquo;<samp>16</samp>&rsquo; or &lsquo;<samp>32</samp>&rsquo;.
  18929. Defaults to &lsquo;<samp>16</samp>&rsquo;.
  18930. </p>
  18931. </dd>
  18932. <dt><samp>decklink_copyts</samp></dt>
  18933. <dd><p>If set to <samp>true</samp>, timestamps are forwarded as they are without removing
  18934. the initial offset.
  18935. Defaults to <samp>false</samp>.
  18936. </p>
  18937. </dd>
  18938. <dt><samp>timestamp_align</samp></dt>
  18939. <dd><p>Capture start time alignment in seconds. If set to nonzero, input frames are
  18940. dropped till the system timestamp aligns with configured value.
  18941. Alignment difference of up to one frame duration is tolerated.
  18942. This is useful for maintaining input synchronization across N different
  18943. hardware devices deployed for &rsquo;N-way&rsquo; redundancy. The system time of different
  18944. hardware devices should be synchronized with protocols such as NTP or PTP,
  18945. before using this option.
  18946. Note that this method is not foolproof. In some border cases input
  18947. synchronization may not happen due to thread scheduling jitters in the OS.
  18948. Either sync could go wrong by 1 frame or in a rarer case
  18949. <samp>timestamp_align</samp> seconds.
  18950. Defaults to &lsquo;<samp>0</samp>&rsquo;.
  18951. </p>
  18952. </dd>
  18953. <dt><samp>wait_for_tc (<em>bool</em>)</samp></dt>
  18954. <dd><p>Drop frames till a frame with timecode is received. Sometimes serial timecode
  18955. isn&rsquo;t received with the first input frame. If that happens, the stored stream
  18956. timecode will be inaccurate. If this option is set to <samp>true</samp>, input frames
  18957. are dropped till a frame with timecode is received.
  18958. Option <var>timecode_format</var> must be specified.
  18959. Defaults to <samp>false</samp>.
  18960. </p>
  18961. </dd>
  18962. <dt><samp>enable_klv(<em>bool</em>)</samp></dt>
  18963. <dd><p>If set to <samp>true</samp>, extracts KLV data from VANC and outputs KLV packets.
  18964. KLV VANC packets are joined based on MID and PSC fields and aggregated into
  18965. one KLV packet.
  18966. Defaults to <samp>false</samp>.
  18967. </p>
  18968. </dd>
  18969. </dl>
  18970. <a name="Examples-22"></a>
  18971. <h4 class="subsection">26.5.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-22" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-22" aria-hidden="true">TOC</a></span></h4>
  18972. <ul>
  18973. <li> List input devices:
  18974. <div class="example">
  18975. <pre class="example">ffmpeg -sources decklink
  18976. </pre></div>
  18977. </li><li> List supported formats:
  18978. <div class="example">
  18979. <pre class="example">ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
  18980. </pre></div>
  18981. </li><li> Capture video clip at 1080i50:
  18982. <div class="example">
  18983. <pre class="example">ffmpeg -format_code Hi50 -f decklink -i 'Intensity Pro' -c:a copy -c:v copy output.avi
  18984. </pre></div>
  18985. </li><li> Capture video clip at 1080i50 10 bit:
  18986. <div class="example">
  18987. <pre class="example">ffmpeg -raw_format yuv422p10 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
  18988. </pre></div>
  18989. </li><li> Capture video clip at 1080i50 with 16 audio channels:
  18990. <div class="example">
  18991. <pre class="example">ffmpeg -channels 16 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
  18992. </pre></div>
  18993. </li></ul>
  18994. <a name="dshow"></a>
  18995. <h3 class="section">26.6 dshow<span class="pull-right"><a class="anchor hidden-xs" href="#dshow" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dshow" aria-hidden="true">TOC</a></span></h3>
  18996. <p>Windows DirectShow input device.
  18997. </p>
  18998. <p>DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
  18999. Currently only audio and video devices are supported.
  19000. </p>
  19001. <p>Multiple devices may be opened as separate inputs, but they may also be
  19002. opened on the same input, which should improve synchronism between them.
  19003. </p>
  19004. <p>The input name should be in the format:
  19005. </p>
  19006. <div class="example">
  19007. <pre class="example"><var>TYPE</var>=<var>NAME</var>[:<var>TYPE</var>=<var>NAME</var>]
  19008. </pre></div>
  19009. <p>where <var>TYPE</var> can be either <var>audio</var> or <var>video</var>,
  19010. and <var>NAME</var> is the device&rsquo;s name or alternative name..
  19011. </p>
  19012. <a name="Options-61"></a>
  19013. <h4 class="subsection">26.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-61" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-61" aria-hidden="true">TOC</a></span></h4>
  19014. <p>If no options are specified, the device&rsquo;s defaults are used.
  19015. If the device does not support the requested options, it will
  19016. fail to open.
  19017. </p>
  19018. <dl compact="compact">
  19019. <dt><samp>video_size</samp></dt>
  19020. <dd><p>Set the video size in the captured video.
  19021. </p>
  19022. </dd>
  19023. <dt><samp>framerate</samp></dt>
  19024. <dd><p>Set the frame rate in the captured video.
  19025. </p>
  19026. </dd>
  19027. <dt><samp>sample_rate</samp></dt>
  19028. <dd><p>Set the sample rate (in Hz) of the captured audio.
  19029. </p>
  19030. </dd>
  19031. <dt><samp>sample_size</samp></dt>
  19032. <dd><p>Set the sample size (in bits) of the captured audio.
  19033. </p>
  19034. </dd>
  19035. <dt><samp>channels</samp></dt>
  19036. <dd><p>Set the number of channels in the captured audio.
  19037. </p>
  19038. </dd>
  19039. <dt><samp>list_devices</samp></dt>
  19040. <dd><p>If set to <samp>true</samp>, print a list of devices and exit.
  19041. </p>
  19042. </dd>
  19043. <dt><samp>list_options</samp></dt>
  19044. <dd><p>If set to <samp>true</samp>, print a list of selected device&rsquo;s options
  19045. and exit.
  19046. </p>
  19047. </dd>
  19048. <dt><samp>video_device_number</samp></dt>
  19049. <dd><p>Set video device number for devices with the same name (starts at 0,
  19050. defaults to 0).
  19051. </p>
  19052. </dd>
  19053. <dt><samp>audio_device_number</samp></dt>
  19054. <dd><p>Set audio device number for devices with the same name (starts at 0,
  19055. defaults to 0).
  19056. </p>
  19057. </dd>
  19058. <dt><samp>pixel_format</samp></dt>
  19059. <dd><p>Select pixel format to be used by DirectShow. This may only be set when
  19060. the video codec is not set or set to rawvideo.
  19061. </p>
  19062. </dd>
  19063. <dt><samp>audio_buffer_size</samp></dt>
  19064. <dd><p>Set audio device buffer size in milliseconds (which can directly
  19065. impact latency, depending on the device).
  19066. Defaults to using the audio device&rsquo;s
  19067. default buffer size (typically some multiple of 500ms).
  19068. Setting this value too low can degrade performance.
  19069. See also
  19070. <a 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>
  19071. </p>
  19072. </dd>
  19073. <dt><samp>video_pin_name</samp></dt>
  19074. <dd><p>Select video capture pin to use by name or alternative name.
  19075. </p>
  19076. </dd>
  19077. <dt><samp>audio_pin_name</samp></dt>
  19078. <dd><p>Select audio capture pin to use by name or alternative name.
  19079. </p>
  19080. </dd>
  19081. <dt><samp>crossbar_video_input_pin_number</samp></dt>
  19082. <dd><p>Select video input pin number for crossbar device. This will be
  19083. routed to the crossbar device&rsquo;s Video Decoder output pin.
  19084. Note that changing this value can affect future invocations
  19085. (sets a new default) until system reboot occurs.
  19086. </p>
  19087. </dd>
  19088. <dt><samp>crossbar_audio_input_pin_number</samp></dt>
  19089. <dd><p>Select audio input pin number for crossbar device. This will be
  19090. routed to the crossbar device&rsquo;s Audio Decoder output pin.
  19091. Note that changing this value can affect future invocations
  19092. (sets a new default) until system reboot occurs.
  19093. </p>
  19094. </dd>
  19095. <dt><samp>show_video_device_dialog</samp></dt>
  19096. <dd><p>If set to <samp>true</samp>, before capture starts, popup a display dialog
  19097. to the end user, allowing them to change video filter properties
  19098. and configurations manually.
  19099. Note that for crossbar devices, adjusting values in this dialog
  19100. may be needed at times to toggle between PAL (25 fps) and NTSC (29.97)
  19101. input frame rates, sizes, interlacing, etc. Changing these values can
  19102. enable different scan rates/frame rates and avoiding green bars at
  19103. the bottom, flickering scan lines, etc.
  19104. Note that with some devices, changing these properties can also affect future
  19105. invocations (sets new defaults) until system reboot occurs.
  19106. </p>
  19107. </dd>
  19108. <dt><samp>show_audio_device_dialog</samp></dt>
  19109. <dd><p>If set to <samp>true</samp>, before capture starts, popup a display dialog
  19110. to the end user, allowing them to change audio filter properties
  19111. and configurations manually.
  19112. </p>
  19113. </dd>
  19114. <dt><samp>show_video_crossbar_connection_dialog</samp></dt>
  19115. <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
  19116. dialog to the end user, allowing them to manually
  19117. modify crossbar pin routings, when it opens a video device.
  19118. </p>
  19119. </dd>
  19120. <dt><samp>show_audio_crossbar_connection_dialog</samp></dt>
  19121. <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
  19122. dialog to the end user, allowing them to manually
  19123. modify crossbar pin routings, when it opens an audio device.
  19124. </p>
  19125. </dd>
  19126. <dt><samp>show_analog_tv_tuner_dialog</samp></dt>
  19127. <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
  19128. dialog to the end user, allowing them to manually
  19129. modify TV channels and frequencies.
  19130. </p>
  19131. </dd>
  19132. <dt><samp>show_analog_tv_tuner_audio_dialog</samp></dt>
  19133. <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
  19134. dialog to the end user, allowing them to manually
  19135. modify TV audio (like mono vs. stereo, Language A,B or C).
  19136. </p>
  19137. </dd>
  19138. <dt><samp>audio_device_load</samp></dt>
  19139. <dd><p>Load an audio capture filter device from file instead of searching
  19140. it by name. It may load additional parameters too, if the filter
  19141. supports the serialization of its properties to.
  19142. To use this an audio capture source has to be specified, but it can
  19143. be anything even fake one.
  19144. </p>
  19145. </dd>
  19146. <dt><samp>audio_device_save</samp></dt>
  19147. <dd><p>Save the currently used audio capture filter device and its
  19148. parameters (if the filter supports it) to a file.
  19149. If a file with the same name exists it will be overwritten.
  19150. </p>
  19151. </dd>
  19152. <dt><samp>video_device_load</samp></dt>
  19153. <dd><p>Load a video capture filter device from file instead of searching
  19154. it by name. It may load additional parameters too, if the filter
  19155. supports the serialization of its properties to.
  19156. To use this a video capture source has to be specified, but it can
  19157. be anything even fake one.
  19158. </p>
  19159. </dd>
  19160. <dt><samp>video_device_save</samp></dt>
  19161. <dd><p>Save the currently used video capture filter device and its
  19162. parameters (if the filter supports it) to a file.
  19163. If a file with the same name exists it will be overwritten.
  19164. </p>
  19165. </dd>
  19166. </dl>
  19167. <a name="Examples-23"></a>
  19168. <h4 class="subsection">26.6.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-23" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-23" aria-hidden="true">TOC</a></span></h4>
  19169. <ul>
  19170. <li> Print the list of DirectShow supported devices and exit:
  19171. <div class="example">
  19172. <pre class="example">$ ffmpeg -list_devices true -f dshow -i dummy
  19173. </pre></div>
  19174. </li><li> Open video device <var>Camera</var>:
  19175. <div class="example">
  19176. <pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;
  19177. </pre></div>
  19178. </li><li> Open second video device with name <var>Camera</var>:
  19179. <div class="example">
  19180. <pre class="example">$ ffmpeg -f dshow -video_device_number 1 -i video=&quot;Camera&quot;
  19181. </pre></div>
  19182. </li><li> Open video device <var>Camera</var> and audio device <var>Microphone</var>:
  19183. <div class="example">
  19184. <pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;:audio=&quot;Microphone&quot;
  19185. </pre></div>
  19186. </li><li> Print the list of supported options in selected device and exit:
  19187. <div class="example">
  19188. <pre class="example">$ ffmpeg -list_options true -f dshow -i video=&quot;Camera&quot;
  19189. </pre></div>
  19190. </li><li> Specify pin names to capture by name or alternative name, specify alternative device name:
  19191. <div class="example">
  19192. <pre class="example">$ 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;
  19193. </pre></div>
  19194. </li><li> Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup:
  19195. <div class="example">
  19196. <pre class="example">$ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
  19197. -crossbar_audio_input_pin_number 3 -i video=&quot;AVerMedia BDA Analog Capture&quot;:audio=&quot;AVerMedia BDA Analog Capture&quot;
  19198. </pre></div>
  19199. </li></ul>
  19200. <a name="fbdev"></a>
  19201. <h3 class="section">26.7 fbdev<span class="pull-right"><a class="anchor hidden-xs" href="#fbdev" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fbdev" aria-hidden="true">TOC</a></span></h3>
  19202. <p>Linux framebuffer input device.
  19203. </p>
  19204. <p>The Linux framebuffer is a graphic hardware-independent abstraction
  19205. layer to show graphics on a computer monitor, typically on the
  19206. console. It is accessed through a file device node, usually
  19207. <samp>/dev/fb0</samp>.
  19208. </p>
  19209. <p>For more detailed information read the file
  19210. Documentation/fb/framebuffer.txt included in the Linux source tree.
  19211. </p>
  19212. <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
  19213. </p>
  19214. <p>To record from the framebuffer device <samp>/dev/fb0</samp> with
  19215. <code>ffmpeg</code>:
  19216. </p><div class="example">
  19217. <pre class="example">ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
  19218. </pre></div>
  19219. <p>You can take a single screenshot image with the command:
  19220. </p><div class="example">
  19221. <pre class="example">ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
  19222. </pre></div>
  19223. <a name="Options-62"></a>
  19224. <h4 class="subsection">26.7.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-62" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-62" aria-hidden="true">TOC</a></span></h4>
  19225. <dl compact="compact">
  19226. <dt><samp>framerate</samp></dt>
  19227. <dd><p>Set the frame rate. Default is 25.
  19228. </p>
  19229. </dd>
  19230. </dl>
  19231. <a name="gdigrab"></a>
  19232. <h3 class="section">26.8 gdigrab<span class="pull-right"><a class="anchor hidden-xs" href="#gdigrab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gdigrab" aria-hidden="true">TOC</a></span></h3>
  19233. <p>Win32 GDI-based screen capture device.
  19234. </p>
  19235. <p>This device allows you to capture a region of the display on Windows.
  19236. </p>
  19237. <p>There are two options for the input filename:
  19238. </p><div class="example">
  19239. <pre class="example">desktop
  19240. </pre></div>
  19241. <p>or
  19242. </p><div class="example">
  19243. <pre class="example">title=<var>window_title</var>
  19244. </pre></div>
  19245. <p>The first option will capture the entire desktop, or a fixed region of the
  19246. desktop. The second option will instead capture the contents of a single
  19247. window, regardless of its position on the screen.
  19248. </p>
  19249. <p>For example, to grab the entire desktop using <code>ffmpeg</code>:
  19250. </p><div class="example">
  19251. <pre class="example">ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
  19252. </pre></div>
  19253. <p>Grab a 640x480 region at position <code>10,20</code>:
  19254. </p><div class="example">
  19255. <pre class="example">ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
  19256. </pre></div>
  19257. <p>Grab the contents of the window named &quot;Calculator&quot;
  19258. </p><div class="example">
  19259. <pre class="example">ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
  19260. </pre></div>
  19261. <a name="Options-63"></a>
  19262. <h4 class="subsection">26.8.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-63" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-63" aria-hidden="true">TOC</a></span></h4>
  19263. <dl compact="compact">
  19264. <dt><samp>draw_mouse</samp></dt>
  19265. <dd><p>Specify whether to draw the mouse pointer. Use the value <code>0</code> to
  19266. not draw the pointer. Default value is <code>1</code>.
  19267. </p>
  19268. </dd>
  19269. <dt><samp>framerate</samp></dt>
  19270. <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
  19271. corresponding to a frame rate of <code>30000/1001</code>.
  19272. </p>
  19273. </dd>
  19274. <dt><samp>show_region</samp></dt>
  19275. <dd><p>Show grabbed region on screen.
  19276. </p>
  19277. <p>If <var>show_region</var> is specified with <code>1</code>, then the grabbing
  19278. region will be indicated on screen. With this option, it is easy to
  19279. know what is being grabbed if only a portion of the screen is grabbed.
  19280. </p>
  19281. <p>Note that <var>show_region</var> is incompatible with grabbing the contents
  19282. of a single window.
  19283. </p>
  19284. <p>For example:
  19285. </p><div class="example">
  19286. <pre class="example">ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
  19287. </pre></div>
  19288. </dd>
  19289. <dt><samp>video_size</samp></dt>
  19290. <dd><p>Set the video frame size. The default is to capture the full screen if <samp>desktop</samp> is selected, or the full window size if <samp>title=<var>window_title</var></samp> is selected.
  19291. </p>
  19292. </dd>
  19293. <dt><samp>offset_x</samp></dt>
  19294. <dd><p>When capturing a region with <var>video_size</var>, set the distance from the left edge of the screen or desktop.
  19295. </p>
  19296. <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>offset_x</var> value to move the region to that monitor.
  19297. </p>
  19298. </dd>
  19299. <dt><samp>offset_y</samp></dt>
  19300. <dd><p>When capturing a region with <var>video_size</var>, set the distance from the top edge of the screen or desktop.
  19301. </p>
  19302. <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>offset_y</var> value to move the region to that monitor.
  19303. </p>
  19304. </dd>
  19305. </dl>
  19306. <a name="iec61883"></a>
  19307. <h3 class="section">26.9 iec61883<span class="pull-right"><a class="anchor hidden-xs" href="#iec61883" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-iec61883" aria-hidden="true">TOC</a></span></h3>
  19308. <p>FireWire DV/HDV input device using libiec61883.
  19309. </p>
  19310. <p>To enable this input device, you need libiec61883, libraw1394 and
  19311. libavc1394 installed on your system. Use the configure option
  19312. <code>--enable-libiec61883</code> to compile with the device enabled.
  19313. </p>
  19314. <p>The iec61883 capture device supports capturing from a video device
  19315. connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
  19316. FireWire stack (juju). This is the default DV/HDV input method in Linux
  19317. Kernel 2.6.37 and later, since the old FireWire stack was removed.
  19318. </p>
  19319. <p>Specify the FireWire port to be used as input file, or &quot;auto&quot;
  19320. to choose the first port connected.
  19321. </p>
  19322. <a name="Options-64"></a>
  19323. <h4 class="subsection">26.9.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-64" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-64" aria-hidden="true">TOC</a></span></h4>
  19324. <dl compact="compact">
  19325. <dt><samp>dvtype</samp></dt>
  19326. <dd><p>Override autodetection of DV/HDV. This should only be used if auto
  19327. detection does not work, or if usage of a different device type
  19328. should be prohibited. Treating a DV device as HDV (or vice versa) will
  19329. not work and result in undefined behavior.
  19330. The values <samp>auto</samp>, <samp>dv</samp> and <samp>hdv</samp> are supported.
  19331. </p>
  19332. </dd>
  19333. <dt><samp>dvbuffer</samp></dt>
  19334. <dd><p>Set maximum size of buffer for incoming data, in frames. For DV, this
  19335. is an exact value. For HDV, it is not frame exact, since HDV does
  19336. not have a fixed frame size.
  19337. </p>
  19338. </dd>
  19339. <dt><samp>dvguid</samp></dt>
  19340. <dd><p>Select the capture device by specifying its GUID. Capturing will only
  19341. be performed from the specified device and fails if no device with the
  19342. given GUID is found. This is useful to select the input if multiple
  19343. devices are connected at the same time.
  19344. Look at /sys/bus/firewire/devices to find out the GUIDs.
  19345. </p>
  19346. </dd>
  19347. </dl>
  19348. <a name="Examples-24"></a>
  19349. <h4 class="subsection">26.9.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-24" aria-hidden="true">TOC</a></span></h4>
  19350. <ul>
  19351. <li> Grab and show the input of a FireWire DV/HDV device.
  19352. <div class="example">
  19353. <pre class="example">ffplay -f iec61883 -i auto
  19354. </pre></div>
  19355. </li><li> Grab and record the input of a FireWire DV/HDV device,
  19356. using a packet buffer of 100000 packets if the source is HDV.
  19357. <div class="example">
  19358. <pre class="example">ffmpeg -f iec61883 -i auto -dvbuffer 100000 out.mpg
  19359. </pre></div>
  19360. </li></ul>
  19361. <a name="jack"></a>
  19362. <h3 class="section">26.10 jack<span class="pull-right"><a class="anchor hidden-xs" href="#jack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-jack" aria-hidden="true">TOC</a></span></h3>
  19363. <p>JACK input device.
  19364. </p>
  19365. <p>To enable this input device during configuration you need libjack
  19366. installed on your system.
  19367. </p>
  19368. <p>A JACK input device creates one or more JACK writable clients, one for
  19369. each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
  19370. <var>client_name</var> is the name provided by the application, and <var>N</var>
  19371. is a number which identifies the channel.
  19372. Each writable client will send the acquired data to the FFmpeg input
  19373. device.
  19374. </p>
  19375. <p>Once you have created one or more JACK readable clients, you need to
  19376. connect them to one or more JACK writable clients.
  19377. </p>
  19378. <p>To connect or disconnect JACK clients you can use the <code>jack_connect</code>
  19379. and <code>jack_disconnect</code> programs, or do it through a graphical interface,
  19380. for example with <code>qjackctl</code>.
  19381. </p>
  19382. <p>To list the JACK clients and their properties you can invoke the command
  19383. <code>jack_lsp</code>.
  19384. </p>
  19385. <p>Follows an example which shows how to capture a JACK readable client
  19386. with <code>ffmpeg</code>.
  19387. </p><div class="example">
  19388. <pre class="example"># Create a JACK writable client with name &quot;ffmpeg&quot;.
  19389. $ ffmpeg -f jack -i ffmpeg -y out.wav
  19390. # Start the sample jack_metro readable client.
  19391. $ jack_metro -b 120 -d 0.2 -f 4000
  19392. # List the current JACK clients.
  19393. $ jack_lsp -c
  19394. system:capture_1
  19395. system:capture_2
  19396. system:playback_1
  19397. system:playback_2
  19398. ffmpeg:input_1
  19399. metro:120_bpm
  19400. # Connect metro to the ffmpeg writable client.
  19401. $ jack_connect metro:120_bpm ffmpeg:input_1
  19402. </pre></div>
  19403. <p>For more information read:
  19404. <a href="http://jackaudio.org/">http://jackaudio.org/</a>
  19405. </p>
  19406. <a name="Options-65"></a>
  19407. <h4 class="subsection">26.10.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-65" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-65" aria-hidden="true">TOC</a></span></h4>
  19408. <dl compact="compact">
  19409. <dt><samp>channels</samp></dt>
  19410. <dd><p>Set the number of channels. Default is 2.
  19411. </p>
  19412. </dd>
  19413. </dl>
  19414. <a name="kmsgrab"></a>
  19415. <h3 class="section">26.11 kmsgrab<span class="pull-right"><a class="anchor hidden-xs" href="#kmsgrab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-kmsgrab" aria-hidden="true">TOC</a></span></h3>
  19416. <p>KMS video input device.
  19417. </p>
  19418. <p>Captures the KMS scanout framebuffer associated with a specified CRTC or plane as a
  19419. DRM object that can be passed to other hardware functions.
  19420. </p>
  19421. <p>Requires either DRM master or CAP_SYS_ADMIN to run.
  19422. </p>
  19423. <p>If you don&rsquo;t understand what all of that means, you probably don&rsquo;t want this. Look at
  19424. <samp>x11grab</samp> instead.
  19425. </p>
  19426. <a name="Options-66"></a>
  19427. <h4 class="subsection">26.11.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-66" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-66" aria-hidden="true">TOC</a></span></h4>
  19428. <dl compact="compact">
  19429. <dt><samp>device</samp></dt>
  19430. <dd><p>DRM device to capture on. Defaults to <samp>/dev/dri/card0</samp>.
  19431. </p>
  19432. </dd>
  19433. <dt><samp>format</samp></dt>
  19434. <dd><p>Pixel format of the framebuffer. This can be autodetected if you are running Linux 5.7
  19435. or later, but needs to be provided for earlier versions. Defaults to <samp>bgr0</samp>,
  19436. which is the most common format used by the Linux console and Xorg X server.
  19437. </p>
  19438. </dd>
  19439. <dt><samp>format_modifier</samp></dt>
  19440. <dd><p>Format modifier to signal on output frames. This is necessary to import correctly into
  19441. some APIs. It can be autodetected if you are running Linux 5.7 or later, but will need
  19442. to be provided explicitly when needed in earlier versions. See the libdrm documentation
  19443. for possible values.
  19444. </p>
  19445. </dd>
  19446. <dt><samp>crtc_id</samp></dt>
  19447. <dd><p>KMS CRTC ID to define the capture source. The first active plane on the given CRTC
  19448. will be used.
  19449. </p>
  19450. </dd>
  19451. <dt><samp>plane_id</samp></dt>
  19452. <dd><p>KMS plane ID to define the capture source. Defaults to the first active plane found if
  19453. neither <samp>crtc_id</samp> nor <samp>plane_id</samp> are specified.
  19454. </p>
  19455. </dd>
  19456. <dt><samp>framerate</samp></dt>
  19457. <dd><p>Framerate to capture at. This is not synchronised to any page flipping or framebuffer
  19458. changes - it just defines the interval at which the framebuffer is sampled. Sampling
  19459. faster than the framebuffer update rate will generate independent frames with the same
  19460. content. Defaults to <code>30</code>.
  19461. </p>
  19462. </dd>
  19463. </dl>
  19464. <a name="Examples-25"></a>
  19465. <h4 class="subsection">26.11.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-25" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-25" aria-hidden="true">TOC</a></span></h4>
  19466. <ul>
  19467. <li> Capture from the first active plane, download the result to normal frames and encode.
  19468. This will only work if the framebuffer is both linear and mappable - if not, the result
  19469. may be scrambled or fail to download.
  19470. <div class="example">
  19471. <pre class="example">ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4
  19472. </pre></div>
  19473. </li><li> Capture from CRTC ID 42 at 60fps, map the result to VAAPI, convert to NV12 and encode as H.264.
  19474. <div class="example">
  19475. <pre class="example">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
  19476. </pre></div>
  19477. </li><li> To capture only part of a plane the output can be cropped - this can be used to capture
  19478. a single window, as long as it has a known absolute position and size. For example, to
  19479. capture and encode the middle quarter of a 1920x1080 plane:
  19480. <div class="example">
  19481. <pre class="example">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
  19482. </pre></div>
  19483. </li></ul>
  19484. <a name="lavfi"></a>
  19485. <h3 class="section">26.12 lavfi<span class="pull-right"><a class="anchor hidden-xs" href="#lavfi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lavfi" aria-hidden="true">TOC</a></span></h3>
  19486. <p>Libavfilter input virtual device.
  19487. </p>
  19488. <p>This input device reads data from the open output pads of a libavfilter
  19489. filtergraph.
  19490. </p>
  19491. <p>For each filtergraph open output, the input device will create a
  19492. corresponding stream which is mapped to the generated output. Currently
  19493. only video data is supported. The filtergraph is specified through the
  19494. option <samp>graph</samp>.
  19495. </p>
  19496. <a name="Options-67"></a>
  19497. <h4 class="subsection">26.12.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-67" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-67" aria-hidden="true">TOC</a></span></h4>
  19498. <dl compact="compact">
  19499. <dt><samp>graph</samp></dt>
  19500. <dd><p>Specify the filtergraph to use as input. Each video open output must be
  19501. labelled by a unique string of the form &quot;out<var>N</var>&quot;, where <var>N</var> is a
  19502. number starting from 0 corresponding to the mapped input stream
  19503. generated by the device.
  19504. The first unlabelled output is automatically assigned to the &quot;out0&quot;
  19505. label, but all the others need to be specified explicitly.
  19506. </p>
  19507. <p>The suffix &quot;+subcc&quot; can be appended to the output label to create an extra
  19508. stream with the closed captions packets attached to that output
  19509. (experimental; only for EIA-608 / CEA-708 for now).
  19510. The subcc streams are created after all the normal streams, in the order of
  19511. the corresponding stream.
  19512. For example, if there is &quot;out19+subcc&quot;, &quot;out7+subcc&quot; and up to &quot;out42&quot;, the
  19513. stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19.
  19514. </p>
  19515. <p>If not specified defaults to the filename specified for the input
  19516. device.
  19517. </p>
  19518. </dd>
  19519. <dt><samp>graph_file</samp></dt>
  19520. <dd><p>Set the filename of the filtergraph to be read and sent to the other
  19521. filters. Syntax of the filtergraph is the same as the one specified by
  19522. the option <var>graph</var>.
  19523. </p>
  19524. </dd>
  19525. <dt><samp>dumpgraph</samp></dt>
  19526. <dd><p>Dump graph to stderr.
  19527. </p>
  19528. </dd>
  19529. </dl>
  19530. <a name="Examples-26"></a>
  19531. <h4 class="subsection">26.12.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-26" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-26" aria-hidden="true">TOC</a></span></h4>
  19532. <ul>
  19533. <li> Create a color video stream and play it back with <code>ffplay</code>:
  19534. <div class="example">
  19535. <pre class="example">ffplay -f lavfi -graph &quot;color=c=pink [out0]&quot; dummy
  19536. </pre></div>
  19537. </li><li> As the previous example, but use filename for specifying the graph
  19538. description, and omit the &quot;out0&quot; label:
  19539. <div class="example">
  19540. <pre class="example">ffplay -f lavfi color=c=pink
  19541. </pre></div>
  19542. </li><li> Create three different video test filtered sources and play them:
  19543. <div class="example">
  19544. <pre class="example">ffplay -f lavfi -graph &quot;testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]&quot; test3
  19545. </pre></div>
  19546. </li><li> Read an audio stream from a file using the amovie source and play it
  19547. back with <code>ffplay</code>:
  19548. <div class="example">
  19549. <pre class="example">ffplay -f lavfi &quot;amovie=test.wav&quot;
  19550. </pre></div>
  19551. </li><li> Read an audio stream and a video stream and play it back with
  19552. <code>ffplay</code>:
  19553. <div class="example">
  19554. <pre class="example">ffplay -f lavfi &quot;movie=test.avi[out0];amovie=test.wav[out1]&quot;
  19555. </pre></div>
  19556. </li><li> Dump decoded frames to images and closed captions to a file (experimental):
  19557. <div class="example">
  19558. <pre class="example">ffmpeg -f lavfi -i &quot;movie=test.ts[out0+subcc]&quot; -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
  19559. </pre></div>
  19560. </li></ul>
  19561. <a name="libcdio"></a>
  19562. <h3 class="section">26.13 libcdio<span class="pull-right"><a class="anchor hidden-xs" href="#libcdio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libcdio" aria-hidden="true">TOC</a></span></h3>
  19563. <p>Audio-CD input device based on libcdio.
  19564. </p>
  19565. <p>To enable this input device during configuration you need libcdio
  19566. installed on your system. It requires the configure option
  19567. <code>--enable-libcdio</code>.
  19568. </p>
  19569. <p>This device allows playing and grabbing from an Audio-CD.
  19570. </p>
  19571. <p>For example to copy with <code>ffmpeg</code> the entire Audio-CD in <samp>/dev/sr0</samp>,
  19572. you may run the command:
  19573. </p><div class="example">
  19574. <pre class="example">ffmpeg -f libcdio -i /dev/sr0 cd.wav
  19575. </pre></div>
  19576. <a name="Options-68"></a>
  19577. <h4 class="subsection">26.13.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-68" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-68" aria-hidden="true">TOC</a></span></h4>
  19578. <dl compact="compact">
  19579. <dt><samp>speed</samp></dt>
  19580. <dd><p>Set drive reading speed. Default value is 0.
  19581. </p>
  19582. <p>The speed is specified CD-ROM speed units. The speed is set through
  19583. the libcdio <code>cdio_cddap_speed_set</code> function. On many CD-ROM
  19584. drives, specifying a value too large will result in using the fastest
  19585. speed.
  19586. </p>
  19587. </dd>
  19588. <dt><samp>paranoia_mode</samp></dt>
  19589. <dd><p>Set paranoia recovery mode flags. It accepts one of the following values:
  19590. </p>
  19591. <dl compact="compact">
  19592. <dt>&lsquo;<samp>disable</samp>&rsquo;</dt>
  19593. <dt>&lsquo;<samp>verify</samp>&rsquo;</dt>
  19594. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  19595. <dt>&lsquo;<samp>neverskip</samp>&rsquo;</dt>
  19596. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  19597. </dl>
  19598. <p>Default value is &lsquo;<samp>disable</samp>&rsquo;.
  19599. </p>
  19600. <p>For more information about the available recovery modes, consult the
  19601. paranoia project documentation.
  19602. </p></dd>
  19603. </dl>
  19604. <a name="libdc1394"></a>
  19605. <h3 class="section">26.14 libdc1394<span class="pull-right"><a class="anchor hidden-xs" href="#libdc1394" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libdc1394" aria-hidden="true">TOC</a></span></h3>
  19606. <p>IIDC1394 input device, based on libdc1394 and libraw1394.
  19607. </p>
  19608. <p>Requires the configure option <code>--enable-libdc1394</code>.
  19609. </p>
  19610. <a name="Options-69"></a>
  19611. <h4 class="subsection">26.14.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-69" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-69" aria-hidden="true">TOC</a></span></h4>
  19612. <dl compact="compact">
  19613. <dt><samp>framerate</samp></dt>
  19614. <dd><p>Set the frame rate. Default is <code>ntsc</code>, corresponding to a frame
  19615. rate of <code>30000/1001</code>.
  19616. </p>
  19617. </dd>
  19618. <dt><samp>pixel_format</samp></dt>
  19619. <dd><p>Select the pixel format. Default is <code>uyvy422</code>.
  19620. </p>
  19621. </dd>
  19622. <dt><samp>video_size</samp></dt>
  19623. <dd><p>Set the video size given as a string such as <code>640x480</code> or <code>hd720</code>.
  19624. Default is <code>qvga</code>.
  19625. </p></dd>
  19626. </dl>
  19627. <a name="openal"></a>
  19628. <h3 class="section">26.15 openal<span class="pull-right"><a class="anchor hidden-xs" href="#openal" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-openal" aria-hidden="true">TOC</a></span></h3>
  19629. <p>The OpenAL input device provides audio capture on all systems with a
  19630. working OpenAL 1.1 implementation.
  19631. </p>
  19632. <p>To enable this input device during configuration, you need OpenAL
  19633. headers and libraries installed on your system, and need to configure
  19634. FFmpeg with <code>--enable-openal</code>.
  19635. </p>
  19636. <p>OpenAL headers and libraries should be provided as part of your OpenAL
  19637. implementation, or as an additional download (an SDK). Depending on your
  19638. installation you may need to specify additional flags via the
  19639. <code>--extra-cflags</code> and <code>--extra-ldflags</code> for allowing the build
  19640. system to locate the OpenAL headers and libraries.
  19641. </p>
  19642. <p>An incomplete list of OpenAL implementations follows:
  19643. </p>
  19644. <dl compact="compact">
  19645. <dt><strong>Creative</strong></dt>
  19646. <dd><p>The official Windows implementation, providing hardware acceleration
  19647. with supported devices and software fallback.
  19648. See <a href="http://openal.org/">http://openal.org/</a>.
  19649. </p></dd>
  19650. <dt><strong>OpenAL Soft</strong></dt>
  19651. <dd><p>Portable, open source (LGPL) software implementation. Includes
  19652. backends for the most common sound APIs on the Windows, Linux,
  19653. Solaris, and BSD operating systems.
  19654. See <a href="http://kcat.strangesoft.net/openal.html">http://kcat.strangesoft.net/openal.html</a>.
  19655. </p></dd>
  19656. <dt><strong>Apple</strong></dt>
  19657. <dd><p>OpenAL is part of Core Audio, the official Mac OS X Audio interface.
  19658. See <a href="http://developer.apple.com/technologies/mac/audio-and-video.html">http://developer.apple.com/technologies/mac/audio-and-video.html</a>
  19659. </p></dd>
  19660. </dl>
  19661. <p>This device allows one to capture from an audio input device handled
  19662. through OpenAL.
  19663. </p>
  19664. <p>You need to specify the name of the device to capture in the provided
  19665. filename. If the empty string is provided, the device will
  19666. automatically select the default device. You can get the list of the
  19667. supported devices by using the option <var>list_devices</var>.
  19668. </p>
  19669. <a name="Options-70"></a>
  19670. <h4 class="subsection">26.15.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-70" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-70" aria-hidden="true">TOC</a></span></h4>
  19671. <dl compact="compact">
  19672. <dt><samp>channels</samp></dt>
  19673. <dd><p>Set the number of channels in the captured audio. Only the values
  19674. <samp>1</samp> (monaural) and <samp>2</samp> (stereo) are currently supported.
  19675. Defaults to <samp>2</samp>.
  19676. </p>
  19677. </dd>
  19678. <dt><samp>sample_size</samp></dt>
  19679. <dd><p>Set the sample size (in bits) of the captured audio. Only the values
  19680. <samp>8</samp> and <samp>16</samp> are currently supported. Defaults to
  19681. <samp>16</samp>.
  19682. </p>
  19683. </dd>
  19684. <dt><samp>sample_rate</samp></dt>
  19685. <dd><p>Set the sample rate (in Hz) of the captured audio.
  19686. Defaults to <samp>44.1k</samp>.
  19687. </p>
  19688. </dd>
  19689. <dt><samp>list_devices</samp></dt>
  19690. <dd><p>If set to <samp>true</samp>, print a list of devices and exit.
  19691. Defaults to <samp>false</samp>.
  19692. </p>
  19693. </dd>
  19694. </dl>
  19695. <a name="Examples-27"></a>
  19696. <h4 class="subsection">26.15.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-27" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-27" aria-hidden="true">TOC</a></span></h4>
  19697. <p>Print the list of OpenAL supported devices and exit:
  19698. </p><div class="example">
  19699. <pre class="example">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
  19700. </pre></div>
  19701. <p>Capture from the OpenAL device <samp>DR-BT101 via PulseAudio</samp>:
  19702. </p><div class="example">
  19703. <pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
  19704. </pre></div>
  19705. <p>Capture from the default device (note the empty string &rdquo; as filename):
  19706. </p><div class="example">
  19707. <pre class="example">$ ffmpeg -f openal -i '' out.ogg
  19708. </pre></div>
  19709. <p>Capture from two devices simultaneously, writing to two different files,
  19710. within the same <code>ffmpeg</code> command:
  19711. </p><div class="example">
  19712. <pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
  19713. </pre></div>
  19714. <p>Note: not all OpenAL implementations support multiple simultaneous capture -
  19715. try the latest OpenAL Soft if the above does not work.
  19716. </p>
  19717. <a name="oss"></a>
  19718. <h3 class="section">26.16 oss<span class="pull-right"><a class="anchor hidden-xs" href="#oss" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-oss" aria-hidden="true">TOC</a></span></h3>
  19719. <p>Open Sound System input device.
  19720. </p>
  19721. <p>The filename to provide to the input device is the device node
  19722. representing the OSS input device, and is usually set to
  19723. <samp>/dev/dsp</samp>.
  19724. </p>
  19725. <p>For example to grab from <samp>/dev/dsp</samp> using <code>ffmpeg</code> use the
  19726. command:
  19727. </p><div class="example">
  19728. <pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
  19729. </pre></div>
  19730. <p>For more information about OSS see:
  19731. <a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
  19732. </p>
  19733. <a name="Options-71"></a>
  19734. <h4 class="subsection">26.16.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-71" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-71" aria-hidden="true">TOC</a></span></h4>
  19735. <dl compact="compact">
  19736. <dt><samp>sample_rate</samp></dt>
  19737. <dd><p>Set the sample rate in Hz. Default is 48000.
  19738. </p>
  19739. </dd>
  19740. <dt><samp>channels</samp></dt>
  19741. <dd><p>Set the number of channels. Default is 2.
  19742. </p>
  19743. </dd>
  19744. </dl>
  19745. <a name="pulse"></a>
  19746. <h3 class="section">26.17 pulse<span class="pull-right"><a class="anchor hidden-xs" href="#pulse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pulse" aria-hidden="true">TOC</a></span></h3>
  19747. <p>PulseAudio input device.
  19748. </p>
  19749. <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
  19750. </p>
  19751. <p>The filename to provide to the input device is a source device or the
  19752. string &quot;default&quot;
  19753. </p>
  19754. <p>To list the PulseAudio source devices and their properties you can invoke
  19755. the command <code>pactl list sources</code>.
  19756. </p>
  19757. <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>.
  19758. </p>
  19759. <a name="Options-72"></a>
  19760. <h4 class="subsection">26.17.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-72" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-72" aria-hidden="true">TOC</a></span></h4>
  19761. <dl compact="compact">
  19762. <dt><samp>server</samp></dt>
  19763. <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
  19764. Default server is used when not provided.
  19765. </p>
  19766. </dd>
  19767. <dt><samp>name</samp></dt>
  19768. <dd><p>Specify the application name PulseAudio will use when showing active clients,
  19769. by default it is the <code>LIBAVFORMAT_IDENT</code> string.
  19770. </p>
  19771. </dd>
  19772. <dt><samp>stream_name</samp></dt>
  19773. <dd><p>Specify the stream name PulseAudio will use when showing active streams,
  19774. by default it is &quot;record&quot;.
  19775. </p>
  19776. </dd>
  19777. <dt><samp>sample_rate</samp></dt>
  19778. <dd><p>Specify the samplerate in Hz, by default 48kHz is used.
  19779. </p>
  19780. </dd>
  19781. <dt><samp>channels</samp></dt>
  19782. <dd><p>Specify the channels in use, by default 2 (stereo) is set.
  19783. </p>
  19784. </dd>
  19785. <dt><samp>frame_size</samp></dt>
  19786. <dd><p>Specify the number of bytes per frame, by default it is set to 1024.
  19787. </p>
  19788. </dd>
  19789. <dt><samp>fragment_size</samp></dt>
  19790. <dd><p>Specify the minimal buffering fragment in PulseAudio, it will affect the
  19791. audio latency. By default it is unset.
  19792. </p>
  19793. </dd>
  19794. <dt><samp>wallclock</samp></dt>
  19795. <dd><p>Set the initial PTS using the current time. Default is 1.
  19796. </p>
  19797. </dd>
  19798. </dl>
  19799. <a name="Examples-28"></a>
  19800. <h4 class="subsection">26.17.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-28" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-28" aria-hidden="true">TOC</a></span></h4>
  19801. <p>Record a stream from default device:
  19802. </p><div class="example">
  19803. <pre class="example">ffmpeg -f pulse -i default /tmp/pulse.wav
  19804. </pre></div>
  19805. <a name="sndio"></a>
  19806. <h3 class="section">26.18 sndio<span class="pull-right"><a class="anchor hidden-xs" href="#sndio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sndio" aria-hidden="true">TOC</a></span></h3>
  19807. <p>sndio input device.
  19808. </p>
  19809. <p>To enable this input device during configuration you need libsndio
  19810. installed on your system.
  19811. </p>
  19812. <p>The filename to provide to the input device is the device node
  19813. representing the sndio input device, and is usually set to
  19814. <samp>/dev/audio0</samp>.
  19815. </p>
  19816. <p>For example to grab from <samp>/dev/audio0</samp> using <code>ffmpeg</code> use the
  19817. command:
  19818. </p><div class="example">
  19819. <pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
  19820. </pre></div>
  19821. <a name="Options-73"></a>
  19822. <h4 class="subsection">26.18.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-73" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-73" aria-hidden="true">TOC</a></span></h4>
  19823. <dl compact="compact">
  19824. <dt><samp>sample_rate</samp></dt>
  19825. <dd><p>Set the sample rate in Hz. Default is 48000.
  19826. </p>
  19827. </dd>
  19828. <dt><samp>channels</samp></dt>
  19829. <dd><p>Set the number of channels. Default is 2.
  19830. </p>
  19831. </dd>
  19832. </dl>
  19833. <a name="video4linux2_002c-v4l2"></a>
  19834. <h3 class="section">26.19 video4linux2, v4l2<span class="pull-right"><a class="anchor hidden-xs" href="#video4linux2_002c-v4l2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-video4linux2_002c-v4l2" aria-hidden="true">TOC</a></span></h3>
  19835. <p>Video4Linux2 input video device.
  19836. </p>
  19837. <p>&quot;v4l2&quot; can be used as alias for &quot;video4linux2&quot;.
  19838. </p>
  19839. <p>If FFmpeg is built with v4l-utils support (by using the
  19840. <code>--enable-libv4l2</code> configure option), it is possible to use it with the
  19841. <code>-use_libv4l2</code> input device option.
  19842. </p>
  19843. <p>The name of the device to grab is a file device node, usually Linux
  19844. systems tend to automatically create such nodes when the device
  19845. (e.g. an USB webcam) is plugged into the system, and has a name of the
  19846. kind <samp>/dev/video<var>N</var></samp>, where <var>N</var> is a number associated to
  19847. the device.
  19848. </p>
  19849. <p>Video4Linux2 devices usually support a limited set of
  19850. <var>width</var>x<var>height</var> sizes and frame rates. You can check which are
  19851. supported using <code>-list_formats all</code> for Video4Linux2 devices.
  19852. Some devices, like TV cards, support one or more standards. It is possible
  19853. to list all the supported standards using <code>-list_standards all</code>.
  19854. </p>
  19855. <p>The time base for the timestamps is 1 microsecond. Depending on the kernel
  19856. version and configuration, the timestamps may be derived from the real time
  19857. clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
  19858. boot time, unaffected by NTP or manual changes to the clock). The
  19859. <samp>-timestamps abs</samp> or <samp>-ts abs</samp> option can be used to force
  19860. conversion into the real time clock.
  19861. </p>
  19862. <p>Some usage examples of the video4linux2 device with <code>ffmpeg</code>
  19863. and <code>ffplay</code>:
  19864. </p><ul>
  19865. <li> List supported formats for a video4linux2 device:
  19866. <div class="example">
  19867. <pre class="example">ffplay -f video4linux2 -list_formats all /dev/video0
  19868. </pre></div>
  19869. </li><li> Grab and show the input of a video4linux2 device:
  19870. <div class="example">
  19871. <pre class="example">ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
  19872. </pre></div>
  19873. </li><li> Grab and record the input of a video4linux2 device, leave the
  19874. frame rate and size as previously set:
  19875. <div class="example">
  19876. <pre class="example">ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
  19877. </pre></div>
  19878. </li></ul>
  19879. <p>For more information about Video4Linux, check <a href="http://linuxtv.org/">http://linuxtv.org/</a>.
  19880. </p>
  19881. <a name="Options-74"></a>
  19882. <h4 class="subsection">26.19.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-74" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-74" aria-hidden="true">TOC</a></span></h4>
  19883. <dl compact="compact">
  19884. <dt><samp>standard</samp></dt>
  19885. <dd><p>Set the standard. Must be the name of a supported standard. To get a
  19886. list of the supported standards, use the <samp>list_standards</samp>
  19887. option.
  19888. </p>
  19889. </dd>
  19890. <dt><samp>channel</samp></dt>
  19891. <dd><p>Set the input channel number. Default to -1, which means using the
  19892. previously selected channel.
  19893. </p>
  19894. </dd>
  19895. <dt><samp>video_size</samp></dt>
  19896. <dd><p>Set the video frame size. The argument must be a string in the form
  19897. <var>WIDTH</var>x<var>HEIGHT</var> or a valid size abbreviation.
  19898. </p>
  19899. </dd>
  19900. <dt><samp>pixel_format</samp></dt>
  19901. <dd><p>Select the pixel format (only valid for raw video input).
  19902. </p>
  19903. </dd>
  19904. <dt><samp>input_format</samp></dt>
  19905. <dd><p>Set the preferred pixel format (for raw video) or a codec name.
  19906. This option allows one to select the input format, when several are
  19907. available.
  19908. </p>
  19909. </dd>
  19910. <dt><samp>framerate</samp></dt>
  19911. <dd><p>Set the preferred video frame rate.
  19912. </p>
  19913. </dd>
  19914. <dt><samp>list_formats</samp></dt>
  19915. <dd><p>List available formats (supported pixel formats, codecs, and frame
  19916. sizes) and exit.
  19917. </p>
  19918. <p>Available values are:
  19919. </p><dl compact="compact">
  19920. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  19921. <dd><p>Show all available (compressed and non-compressed) formats.
  19922. </p>
  19923. </dd>
  19924. <dt>&lsquo;<samp>raw</samp>&rsquo;</dt>
  19925. <dd><p>Show only raw video (non-compressed) formats.
  19926. </p>
  19927. </dd>
  19928. <dt>&lsquo;<samp>compressed</samp>&rsquo;</dt>
  19929. <dd><p>Show only compressed formats.
  19930. </p></dd>
  19931. </dl>
  19932. </dd>
  19933. <dt><samp>list_standards</samp></dt>
  19934. <dd><p>List supported standards and exit.
  19935. </p>
  19936. <p>Available values are:
  19937. </p><dl compact="compact">
  19938. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  19939. <dd><p>Show all supported standards.
  19940. </p></dd>
  19941. </dl>
  19942. </dd>
  19943. <dt><samp>timestamps, ts</samp></dt>
  19944. <dd><p>Set type of timestamps for grabbed frames.
  19945. </p>
  19946. <p>Available values are:
  19947. </p><dl compact="compact">
  19948. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  19949. <dd><p>Use timestamps from the kernel.
  19950. </p>
  19951. </dd>
  19952. <dt>&lsquo;<samp>abs</samp>&rsquo;</dt>
  19953. <dd><p>Use absolute timestamps (wall clock).
  19954. </p>
  19955. </dd>
  19956. <dt>&lsquo;<samp>mono2abs</samp>&rsquo;</dt>
  19957. <dd><p>Force conversion from monotonic to absolute timestamps.
  19958. </p></dd>
  19959. </dl>
  19960. <p>Default value is <code>default</code>.
  19961. </p>
  19962. </dd>
  19963. <dt><samp>use_libv4l2</samp></dt>
  19964. <dd><p>Use libv4l2 (v4l-utils) conversion functions. Default is 0.
  19965. </p>
  19966. </dd>
  19967. </dl>
  19968. <a name="vfwcap"></a>
  19969. <h3 class="section">26.20 vfwcap<span class="pull-right"><a class="anchor hidden-xs" href="#vfwcap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vfwcap" aria-hidden="true">TOC</a></span></h3>
  19970. <p>VfW (Video for Windows) capture input device.
  19971. </p>
  19972. <p>The filename passed as input is the capture driver number, ranging from
  19973. 0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
  19974. other filename will be interpreted as device number 0.
  19975. </p>
  19976. <a name="Options-75"></a>
  19977. <h4 class="subsection">26.20.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-75" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-75" aria-hidden="true">TOC</a></span></h4>
  19978. <dl compact="compact">
  19979. <dt><samp>video_size</samp></dt>
  19980. <dd><p>Set the video frame size.
  19981. </p>
  19982. </dd>
  19983. <dt><samp>framerate</samp></dt>
  19984. <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
  19985. corresponding to a frame rate of <code>30000/1001</code>.
  19986. </p>
  19987. </dd>
  19988. </dl>
  19989. <a name="x11grab"></a>
  19990. <h3 class="section">26.21 x11grab<span class="pull-right"><a class="anchor hidden-xs" href="#x11grab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-x11grab" aria-hidden="true">TOC</a></span></h3>
  19991. <p>X11 video input device.
  19992. </p>
  19993. <p>To enable this input device during configuration you need libxcb
  19994. installed on your system. It will be automatically detected during
  19995. configuration.
  19996. </p>
  19997. <p>This device allows one to capture a region of an X11 display.
  19998. </p>
  19999. <p>The filename passed as input has the syntax:
  20000. </p><div class="example">
  20001. <pre class="example">[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
  20002. </pre></div>
  20003. <p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
  20004. X11 display name of the screen to grab from. <var>hostname</var> can be
  20005. omitted, and defaults to &quot;localhost&quot;. The environment variable
  20006. <code>DISPLAY</code> contains the default display name.
  20007. </p>
  20008. <p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
  20009. area with respect to the top-left border of the X11 screen. They
  20010. default to 0.
  20011. </p>
  20012. <p>Check the X11 documentation (e.g. <code>man X</code>) for more detailed
  20013. information.
  20014. </p>
  20015. <p>Use the <code>xdpyinfo</code> program for getting basic information about
  20016. the properties of your X11 display (e.g. grep for &quot;name&quot; or
  20017. &quot;dimensions&quot;).
  20018. </p>
  20019. <p>For example to grab from <samp>:0.0</samp> using <code>ffmpeg</code>:
  20020. </p><div class="example">
  20021. <pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
  20022. </pre></div>
  20023. <p>Grab at position <code>10,20</code>:
  20024. </p><div class="example">
  20025. <pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  20026. </pre></div>
  20027. <a name="Options-76"></a>
  20028. <h4 class="subsection">26.21.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-76" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-76" aria-hidden="true">TOC</a></span></h4>
  20029. <dl compact="compact">
  20030. <dt><samp>select_region</samp></dt>
  20031. <dd><p>Specify whether to select the grabbing area graphically using the pointer.
  20032. A value of <code>1</code> prompts the user to select the grabbing area graphically
  20033. by clicking and dragging. A single click with no dragging will select the
  20034. whole screen. A region with zero width or height will also select the whole
  20035. screen. This option overwrites the <var>video_size</var>, <var>grab_x</var>, and
  20036. <var>grab_y</var> options. Default value is <code>0</code>.
  20037. </p>
  20038. </dd>
  20039. <dt><samp>draw_mouse</samp></dt>
  20040. <dd><p>Specify whether to draw the mouse pointer. A value of <code>0</code> specifies
  20041. not to draw the pointer. Default value is <code>1</code>.
  20042. </p>
  20043. </dd>
  20044. <dt><samp>follow_mouse</samp></dt>
  20045. <dd><p>Make the grabbed area follow the mouse. The argument can be
  20046. <code>centered</code> or a number of pixels <var>PIXELS</var>.
  20047. </p>
  20048. <p>When it is specified with &quot;centered&quot;, the grabbing region follows the mouse
  20049. pointer and keeps the pointer at the center of region; otherwise, the region
  20050. follows only when the mouse pointer reaches within <var>PIXELS</var> (greater than
  20051. zero) to the edge of region.
  20052. </p>
  20053. <p>For example:
  20054. </p><div class="example">
  20055. <pre class="example">ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
  20056. </pre></div>
  20057. <p>To follow only when the mouse pointer reaches within 100 pixels to edge:
  20058. </p><div class="example">
  20059. <pre class="example">ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
  20060. </pre></div>
  20061. </dd>
  20062. <dt><samp>framerate</samp></dt>
  20063. <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
  20064. corresponding to a frame rate of <code>30000/1001</code>.
  20065. </p>
  20066. </dd>
  20067. <dt><samp>show_region</samp></dt>
  20068. <dd><p>Show grabbed region on screen.
  20069. </p>
  20070. <p>If <var>show_region</var> is specified with <code>1</code>, then the grabbing
  20071. region will be indicated on screen. With this option, it is easy to
  20072. know what is being grabbed if only a portion of the screen is grabbed.
  20073. </p>
  20074. </dd>
  20075. <dt><samp>region_border</samp></dt>
  20076. <dd><p>Set the region border thickness if <samp>-show_region 1</samp> is used.
  20077. Range is 1 to 128 and default is 3 (XCB-based x11grab only).
  20078. </p>
  20079. <p>For example:
  20080. </p><div class="example">
  20081. <pre class="example">ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  20082. </pre></div>
  20083. <p>With <var>follow_mouse</var>:
  20084. </p><div class="example">
  20085. <pre class="example">ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
  20086. </pre></div>
  20087. </dd>
  20088. <dt><samp>window_id</samp></dt>
  20089. <dd><p>Grab this window, instead of the whole screen. Default value is 0, which maps to
  20090. the whole screen (root window).
  20091. </p>
  20092. <p>The id of a window can be found using the <code>xwininfo</code> program, possibly with options -tree and
  20093. -root.
  20094. </p>
  20095. <p>If the window is later enlarged, the new area is not recorded. Video ends when
  20096. the window is closed, unmapped (i.e., iconified) or shrunk beyond the video
  20097. size (which defaults to the initial window size).
  20098. </p>
  20099. <p>This option disables options <samp>follow_mouse</samp> and <samp>select_region</samp>.
  20100. </p>
  20101. </dd>
  20102. <dt><samp>video_size</samp></dt>
  20103. <dd><p>Set the video frame size. Default is the full desktop or window.
  20104. </p>
  20105. </dd>
  20106. <dt><samp>grab_x</samp></dt>
  20107. <dt><samp>grab_y</samp></dt>
  20108. <dd><p>Set the grabbing region coordinates. They are expressed as offset from
  20109. the top left corner of the X11 window and correspond to the
  20110. <var>x_offset</var> and <var>y_offset</var> parameters in the device name. The
  20111. default value for both options is 0.
  20112. </p></dd>
  20113. </dl>
  20114. <a name="Output-Devices"></a>
  20115. <h2 class="chapter">27 Output Devices<span class="pull-right"><a class="anchor hidden-xs" href="#Output-Devices" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Output-Devices" aria-hidden="true">TOC</a></span></h2>
  20116. <p>Output devices are configured elements in FFmpeg that can write
  20117. multimedia data to an output device attached to your system.
  20118. </p>
  20119. <p>When you configure your FFmpeg build, all the supported output devices
  20120. are enabled by default. You can list all available ones using the
  20121. configure option &quot;&ndash;list-outdevs&quot;.
  20122. </p>
  20123. <p>You can disable all the output devices using the configure option
  20124. &quot;&ndash;disable-outdevs&quot;, and selectively enable an output device using the
  20125. option &quot;&ndash;enable-outdev=<var>OUTDEV</var>&quot;, or you can disable a particular
  20126. input device using the option &quot;&ndash;disable-outdev=<var>OUTDEV</var>&quot;.
  20127. </p>
  20128. <p>The option &quot;-devices&quot; of the ff* tools will display the list of
  20129. enabled output devices.
  20130. </p>
  20131. <p>A description of the currently available output devices follows.
  20132. </p>
  20133. <a name="alsa-1"></a>
  20134. <h3 class="section">27.1 alsa<span class="pull-right"><a class="anchor hidden-xs" href="#alsa-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alsa-1" aria-hidden="true">TOC</a></span></h3>
  20135. <p>ALSA (Advanced Linux Sound Architecture) output device.
  20136. </p>
  20137. <a name="Examples-29"></a>
  20138. <h4 class="subsection">27.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-29" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-29" aria-hidden="true">TOC</a></span></h4>
  20139. <ul>
  20140. <li> Play a file on default ALSA device:
  20141. <div class="example">
  20142. <pre class="example">ffmpeg -i INPUT -f alsa default
  20143. </pre></div>
  20144. </li><li> Play a file on soundcard 1, audio device 7:
  20145. <div class="example">
  20146. <pre class="example">ffmpeg -i INPUT -f alsa hw:1,7
  20147. </pre></div>
  20148. </li></ul>
  20149. <a name="AudioToolbox"></a>
  20150. <h3 class="section">27.2 AudioToolbox<span class="pull-right"><a class="anchor hidden-xs" href="#AudioToolbox" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AudioToolbox" aria-hidden="true">TOC</a></span></h3>
  20151. <p>AudioToolbox output device.
  20152. </p>
  20153. <p>Allows native output to CoreAudio devices on OSX.
  20154. </p>
  20155. <p>The output filename can be empty (or <code>-</code>) to refer to the default system output device or a number that refers to the device index as shown using: <code>-list_devices true</code>.
  20156. </p>
  20157. <p>Alternatively, the audio input device can be chosen by index using the
  20158. <samp>
  20159. -audio_device_index &lt;INDEX&gt;
  20160. </samp>
  20161. , overriding any device name or index given in the input filename.
  20162. </p>
  20163. <p>All available devices can be enumerated by using <samp>-list_devices true</samp>, listing
  20164. all device names, UIDs and corresponding indices.
  20165. </p>
  20166. <a name="Options-77"></a>
  20167. <h4 class="subsection">27.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-77" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-77" aria-hidden="true">TOC</a></span></h4>
  20168. <p>AudioToolbox supports the following options:
  20169. </p>
  20170. <dl compact="compact">
  20171. <dt><samp>-audio_device_index &lt;INDEX&gt;</samp></dt>
  20172. <dd><p>Specify the audio device by its index. Overrides anything given in the output filename.
  20173. </p>
  20174. </dd>
  20175. </dl>
  20176. <a name="Examples-30"></a>
  20177. <h4 class="subsection">27.2.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-30" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-30" aria-hidden="true">TOC</a></span></h4>
  20178. <ul>
  20179. <li> Print the list of supported devices and output a sine wave to the default device:
  20180. <div class="example">
  20181. <pre class="example">$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -list_devices true -
  20182. </pre></div>
  20183. </li><li> Output a sine wave to the device with the index 2, overriding any output filename:
  20184. <div class="example">
  20185. <pre class="example">$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -audio_device_index 2 -
  20186. </pre></div>
  20187. </li></ul>
  20188. <a name="caca"></a>
  20189. <h3 class="section">27.3 caca<span class="pull-right"><a class="anchor hidden-xs" href="#caca" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-caca" aria-hidden="true">TOC</a></span></h3>
  20190. <p>CACA output device.
  20191. </p>
  20192. <p>This output device allows one to show a video stream in CACA window.
  20193. Only one CACA window is allowed per application, so you can
  20194. have only one instance of this output device in an application.
  20195. </p>
  20196. <p>To enable this output device you need to configure FFmpeg with
  20197. <code>--enable-libcaca</code>.
  20198. libcaca is a graphics library that outputs text instead of pixels.
  20199. </p>
  20200. <p>For more information about libcaca, check:
  20201. <a href="http://caca.zoy.org/wiki/libcaca">http://caca.zoy.org/wiki/libcaca</a>
  20202. </p>
  20203. <a name="Options-78"></a>
  20204. <h4 class="subsection">27.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-78" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-78" aria-hidden="true">TOC</a></span></h4>
  20205. <dl compact="compact">
  20206. <dt><samp>window_title</samp></dt>
  20207. <dd><p>Set the CACA window title, if not specified default to the filename
  20208. specified for the output device.
  20209. </p>
  20210. </dd>
  20211. <dt><samp>window_size</samp></dt>
  20212. <dd><p>Set the CACA window size, can be a string of the form
  20213. <var>width</var>x<var>height</var> or a video size abbreviation.
  20214. If not specified it defaults to the size of the input video.
  20215. </p>
  20216. </dd>
  20217. <dt><samp>driver</samp></dt>
  20218. <dd><p>Set display driver.
  20219. </p>
  20220. </dd>
  20221. <dt><samp>algorithm</samp></dt>
  20222. <dd><p>Set dithering algorithm. Dithering is necessary
  20223. because the picture being rendered has usually far more colours than
  20224. the available palette.
  20225. The accepted values are listed with <code>-list_dither algorithms</code>.
  20226. </p>
  20227. </dd>
  20228. <dt><samp>antialias</samp></dt>
  20229. <dd><p>Set antialias method. Antialiasing smoothens the rendered
  20230. image and avoids the commonly seen staircase effect.
  20231. The accepted values are listed with <code>-list_dither antialiases</code>.
  20232. </p>
  20233. </dd>
  20234. <dt><samp>charset</samp></dt>
  20235. <dd><p>Set which characters are going to be used when rendering text.
  20236. The accepted values are listed with <code>-list_dither charsets</code>.
  20237. </p>
  20238. </dd>
  20239. <dt><samp>color</samp></dt>
  20240. <dd><p>Set color to be used when rendering text.
  20241. The accepted values are listed with <code>-list_dither colors</code>.
  20242. </p>
  20243. </dd>
  20244. <dt><samp>list_drivers</samp></dt>
  20245. <dd><p>If set to <samp>true</samp>, print a list of available drivers and exit.
  20246. </p>
  20247. </dd>
  20248. <dt><samp>list_dither</samp></dt>
  20249. <dd><p>List available dither options related to the argument.
  20250. The argument must be one of <code>algorithms</code>, <code>antialiases</code>,
  20251. <code>charsets</code>, <code>colors</code>.
  20252. </p></dd>
  20253. </dl>
  20254. <a name="Examples-31"></a>
  20255. <h4 class="subsection">27.3.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-31" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-31" aria-hidden="true">TOC</a></span></h4>
  20256. <ul>
  20257. <li> The following command shows the <code>ffmpeg</code> output is an
  20258. CACA window, forcing its size to 80x25:
  20259. <div class="example">
  20260. <pre class="example">ffmpeg -i INPUT -c:v rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
  20261. </pre></div>
  20262. </li><li> Show the list of available drivers and exit:
  20263. <div class="example">
  20264. <pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
  20265. </pre></div>
  20266. </li><li> Show the list of available dither colors and exit:
  20267. <div class="example">
  20268. <pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
  20269. </pre></div>
  20270. </li></ul>
  20271. <a name="decklink-1"></a>
  20272. <h3 class="section">27.4 decklink<span class="pull-right"><a class="anchor hidden-xs" href="#decklink-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-decklink-1" aria-hidden="true">TOC</a></span></h3>
  20273. <p>The decklink output device provides playback capabilities for Blackmagic
  20274. DeckLink devices.
  20275. </p>
  20276. <p>To enable this output device, you need the Blackmagic DeckLink SDK and you
  20277. need to configure with the appropriate <code>--extra-cflags</code>
  20278. and <code>--extra-ldflags</code>.
  20279. On Windows, you need to run the IDL files through <code>widl</code>.
  20280. </p>
  20281. <p>DeckLink is very picky about the formats it supports. Pixel format is always
  20282. uyvy422, framerate, field order and video size must be determined for your
  20283. device with <code>-list_formats 1</code>. Audio sample rate is always 48 kHz.
  20284. </p>
  20285. <a name="Options-79"></a>
  20286. <h4 class="subsection">27.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-79" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-79" aria-hidden="true">TOC</a></span></h4>
  20287. <dl compact="compact">
  20288. <dt><samp>list_devices</samp></dt>
  20289. <dd><p>If set to <samp>true</samp>, print a list of devices and exit.
  20290. Defaults to <samp>false</samp>. This option is deprecated, please use the
  20291. <code>-sinks</code> option of ffmpeg to list the available output devices.
  20292. </p>
  20293. </dd>
  20294. <dt><samp>list_formats</samp></dt>
  20295. <dd><p>If set to <samp>true</samp>, print a list of supported formats and exit.
  20296. Defaults to <samp>false</samp>.
  20297. </p>
  20298. </dd>
  20299. <dt><samp>preroll</samp></dt>
  20300. <dd><p>Amount of time to preroll video in seconds.
  20301. Defaults to <samp>0.5</samp>.
  20302. </p>
  20303. </dd>
  20304. <dt><samp>duplex_mode</samp></dt>
  20305. <dd><p>Sets the decklink device duplex mode. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>half</samp>&rsquo; or &lsquo;<samp>full</samp>&rsquo;.
  20306. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  20307. </p>
  20308. </dd>
  20309. <dt><samp>timing_offset</samp></dt>
  20310. <dd><p>Sets the genlock timing pixel offset on the used output.
  20311. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  20312. </p>
  20313. </dd>
  20314. </dl>
  20315. <a name="Examples-32"></a>
  20316. <h4 class="subsection">27.4.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-32" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-32" aria-hidden="true">TOC</a></span></h4>
  20317. <ul>
  20318. <li> List output devices:
  20319. <div class="example">
  20320. <pre class="example">ffmpeg -sinks decklink
  20321. </pre></div>
  20322. </li><li> List supported formats:
  20323. <div class="example">
  20324. <pre class="example">ffmpeg -i test.avi -f decklink -list_formats 1 'DeckLink Mini Monitor'
  20325. </pre></div>
  20326. </li><li> Play video clip:
  20327. <div class="example">
  20328. <pre class="example">ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 'DeckLink Mini Monitor'
  20329. </pre></div>
  20330. </li><li> Play video clip with non-standard framerate or video size:
  20331. <div class="example">
  20332. <pre class="example">ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 -s 720x486 -r 24000/1001 'DeckLink Mini Monitor'
  20333. </pre></div>
  20334. </li></ul>
  20335. <a name="fbdev-1"></a>
  20336. <h3 class="section">27.5 fbdev<span class="pull-right"><a class="anchor hidden-xs" href="#fbdev-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fbdev-1" aria-hidden="true">TOC</a></span></h3>
  20337. <p>Linux framebuffer output device.
  20338. </p>
  20339. <p>The Linux framebuffer is a graphic hardware-independent abstraction
  20340. layer to show graphics on a computer monitor, typically on the
  20341. console. It is accessed through a file device node, usually
  20342. <samp>/dev/fb0</samp>.
  20343. </p>
  20344. <p>For more detailed information read the file
  20345. <samp>Documentation/fb/framebuffer.txt</samp> included in the Linux source tree.
  20346. </p>
  20347. <a name="Options-80"></a>
  20348. <h4 class="subsection">27.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-80" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-80" aria-hidden="true">TOC</a></span></h4>
  20349. <dl compact="compact">
  20350. <dt><samp>xoffset</samp></dt>
  20351. <dt><samp>yoffset</samp></dt>
  20352. <dd><p>Set x/y coordinate of top left corner. Default is 0.
  20353. </p></dd>
  20354. </dl>
  20355. <a name="Examples-33"></a>
  20356. <h4 class="subsection">27.5.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-33" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-33" aria-hidden="true">TOC</a></span></h4>
  20357. <p>Play a file on framebuffer device <samp>/dev/fb0</samp>.
  20358. Required pixel format depends on current framebuffer settings.
  20359. </p><div class="example">
  20360. <pre class="example">ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0
  20361. </pre></div>
  20362. <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
  20363. </p>
  20364. <a name="opengl"></a>
  20365. <h3 class="section">27.6 opengl<span class="pull-right"><a class="anchor hidden-xs" href="#opengl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-opengl" aria-hidden="true">TOC</a></span></h3>
  20366. <p>OpenGL output device.
  20367. </p>
  20368. <p>To enable this output device you need to configure FFmpeg with <code>--enable-opengl</code>.
  20369. </p>
  20370. <p>This output device allows one to render to OpenGL context.
  20371. Context may be provided by application or default SDL window is created.
  20372. </p>
  20373. <p>When device renders to external context, application must implement handlers for following messages:
  20374. <code>AV_DEV_TO_APP_CREATE_WINDOW_BUFFER</code> - create OpenGL context on current thread.
  20375. <code>AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER</code> - make OpenGL context current.
  20376. <code>AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER</code> - swap buffers.
  20377. <code>AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER</code> - destroy OpenGL context.
  20378. Application is also required to inform a device about current resolution by sending <code>AV_APP_TO_DEV_WINDOW_SIZE</code> message.
  20379. </p>
  20380. <a name="Options-81"></a>
  20381. <h4 class="subsection">27.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-81" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-81" aria-hidden="true">TOC</a></span></h4>
  20382. <dl compact="compact">
  20383. <dt><samp>background</samp></dt>
  20384. <dd><p>Set background color. Black is a default.
  20385. </p></dd>
  20386. <dt><samp>no_window</samp></dt>
  20387. <dd><p>Disables default SDL window when set to non-zero value.
  20388. Application must provide OpenGL context and both <code>window_size_cb</code> and <code>window_swap_buffers_cb</code> callbacks when set.
  20389. </p></dd>
  20390. <dt><samp>window_title</samp></dt>
  20391. <dd><p>Set the SDL window title, if not specified default to the filename specified for the output device.
  20392. Ignored when <samp>no_window</samp> is set.
  20393. </p></dd>
  20394. <dt><samp>window_size</samp></dt>
  20395. <dd><p>Set preferred window size, can be a string of the form widthxheight or a video size abbreviation.
  20396. If not specified it defaults to the size of the input video, downscaled according to the aspect ratio.
  20397. Mostly usable when <samp>no_window</samp> is not set.
  20398. </p>
  20399. </dd>
  20400. </dl>
  20401. <a name="Examples-34"></a>
  20402. <h4 class="subsection">27.6.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-34" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-34" aria-hidden="true">TOC</a></span></h4>
  20403. <p>Play a file on SDL window using OpenGL rendering:
  20404. </p><div class="example">
  20405. <pre class="example">ffmpeg -i INPUT -f opengl &quot;window title&quot;
  20406. </pre></div>
  20407. <a name="oss-1"></a>
  20408. <h3 class="section">27.7 oss<span class="pull-right"><a class="anchor hidden-xs" href="#oss-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-oss-1" aria-hidden="true">TOC</a></span></h3>
  20409. <p>OSS (Open Sound System) output device.
  20410. </p>
  20411. <a name="pulse-1"></a>
  20412. <h3 class="section">27.8 pulse<span class="pull-right"><a class="anchor hidden-xs" href="#pulse-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pulse-1" aria-hidden="true">TOC</a></span></h3>
  20413. <p>PulseAudio output device.
  20414. </p>
  20415. <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
  20416. </p>
  20417. <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>
  20418. </p>
  20419. <a name="Options-82"></a>
  20420. <h4 class="subsection">27.8.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-82" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-82" aria-hidden="true">TOC</a></span></h4>
  20421. <dl compact="compact">
  20422. <dt><samp>server</samp></dt>
  20423. <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
  20424. Default server is used when not provided.
  20425. </p>
  20426. </dd>
  20427. <dt><samp>name</samp></dt>
  20428. <dd><p>Specify the application name PulseAudio will use when showing active clients,
  20429. by default it is the <code>LIBAVFORMAT_IDENT</code> string.
  20430. </p>
  20431. </dd>
  20432. <dt><samp>stream_name</samp></dt>
  20433. <dd><p>Specify the stream name PulseAudio will use when showing active streams,
  20434. by default it is set to the specified output name.
  20435. </p>
  20436. </dd>
  20437. <dt><samp>device</samp></dt>
  20438. <dd><p>Specify the device to use. Default device is used when not provided.
  20439. List of output devices can be obtained with command <code>pactl list sinks</code>.
  20440. </p>
  20441. </dd>
  20442. <dt><samp>buffer_size</samp></dt>
  20443. <dt><samp>buffer_duration</samp></dt>
  20444. <dd><p>Control the size and duration of the PulseAudio buffer. A small buffer
  20445. gives more control, but requires more frequent updates.
  20446. </p>
  20447. <p><samp>buffer_size</samp> specifies size in bytes while
  20448. <samp>buffer_duration</samp> specifies duration in milliseconds.
  20449. </p>
  20450. <p>When both options are provided then the highest value is used
  20451. (duration is recalculated to bytes using stream parameters). If they
  20452. are set to 0 (which is default), the device will use the default
  20453. PulseAudio duration value. By default PulseAudio set buffer duration
  20454. to around 2 seconds.
  20455. </p>
  20456. </dd>
  20457. <dt><samp>prebuf</samp></dt>
  20458. <dd><p>Specify pre-buffering size in bytes. The server does not start with
  20459. playback before at least <samp>prebuf</samp> bytes are available in the
  20460. buffer. By default this option is initialized to the same value as
  20461. <samp>buffer_size</samp> or <samp>buffer_duration</samp> (whichever is bigger).
  20462. </p>
  20463. </dd>
  20464. <dt><samp>minreq</samp></dt>
  20465. <dd><p>Specify minimum request size in bytes. The server does not request less
  20466. than <samp>minreq</samp> bytes from the client, instead waits until the buffer
  20467. is free enough to request more bytes at once. It is recommended to not set
  20468. this option, which will initialize this to a value that is deemed sensible
  20469. by the server.
  20470. </p>
  20471. </dd>
  20472. </dl>
  20473. <a name="Examples-35"></a>
  20474. <h4 class="subsection">27.8.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-35" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-35" aria-hidden="true">TOC</a></span></h4>
  20475. <p>Play a file on default device on default server:
  20476. </p><div class="example">
  20477. <pre class="example">ffmpeg -i INPUT -f pulse &quot;stream name&quot;
  20478. </pre></div>
  20479. <a name="sdl"></a>
  20480. <h3 class="section">27.9 sdl<span class="pull-right"><a class="anchor hidden-xs" href="#sdl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sdl" aria-hidden="true">TOC</a></span></h3>
  20481. <p>SDL (Simple DirectMedia Layer) output device.
  20482. </p>
  20483. <p>&quot;sdl2&quot; can be used as alias for &quot;sdl&quot;.
  20484. </p>
  20485. <p>This output device allows one to show a video stream in an SDL
  20486. window. Only one SDL window is allowed per application, so you can
  20487. have only one instance of this output device in an application.
  20488. </p>
  20489. <p>To enable this output device you need libsdl installed on your system
  20490. when configuring your build.
  20491. </p>
  20492. <p>For more information about SDL, check:
  20493. <a href="http://www.libsdl.org/">http://www.libsdl.org/</a>
  20494. </p>
  20495. <a name="Options-83"></a>
  20496. <h4 class="subsection">27.9.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-83" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-83" aria-hidden="true">TOC</a></span></h4>
  20497. <dl compact="compact">
  20498. <dt><samp>window_title</samp></dt>
  20499. <dd><p>Set the SDL window title, if not specified default to the filename
  20500. specified for the output device.
  20501. </p>
  20502. </dd>
  20503. <dt><samp>icon_title</samp></dt>
  20504. <dd><p>Set the name of the iconified SDL window, if not specified it is set
  20505. to the same value of <var>window_title</var>.
  20506. </p>
  20507. </dd>
  20508. <dt><samp>window_size</samp></dt>
  20509. <dd><p>Set the SDL window size, can be a string of the form
  20510. <var>width</var>x<var>height</var> or a video size abbreviation.
  20511. If not specified it defaults to the size of the input video,
  20512. downscaled according to the aspect ratio.
  20513. </p>
  20514. </dd>
  20515. <dt><samp>window_x</samp></dt>
  20516. <dt><samp>window_y</samp></dt>
  20517. <dd><p>Set the position of the window on the screen.
  20518. </p>
  20519. </dd>
  20520. <dt><samp>window_fullscreen</samp></dt>
  20521. <dd><p>Set fullscreen mode when non-zero value is provided.
  20522. Default value is zero.
  20523. </p>
  20524. </dd>
  20525. <dt><samp>window_enable_quit</samp></dt>
  20526. <dd><p>Enable quit action (using window button or keyboard key)
  20527. when non-zero value is provided.
  20528. Default value is 1 (enable quit action)
  20529. </p></dd>
  20530. </dl>
  20531. <a name="Interactive-commands"></a>
  20532. <h4 class="subsection">27.9.2 Interactive commands<span class="pull-right"><a class="anchor hidden-xs" href="#Interactive-commands" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Interactive-commands" aria-hidden="true">TOC</a></span></h4>
  20533. <p>The window created by the device can be controlled through the
  20534. following interactive commands.
  20535. </p>
  20536. <dl compact="compact">
  20537. <dt><tt class="key">q, ESC</tt></dt>
  20538. <dd><p>Quit the device immediately.
  20539. </p></dd>
  20540. </dl>
  20541. <a name="Examples-36"></a>
  20542. <h4 class="subsection">27.9.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-36" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-36" aria-hidden="true">TOC</a></span></h4>
  20543. <p>The following command shows the <code>ffmpeg</code> output is an
  20544. SDL window, forcing its size to the qcif format:
  20545. </p><div class="example">
  20546. <pre class="example">ffmpeg -i INPUT -c:v rawvideo -pix_fmt yuv420p -window_size qcif -f sdl &quot;SDL output&quot;
  20547. </pre></div>
  20548. <a name="sndio-1"></a>
  20549. <h3 class="section">27.10 sndio<span class="pull-right"><a class="anchor hidden-xs" href="#sndio-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sndio-1" aria-hidden="true">TOC</a></span></h3>
  20550. <p>sndio audio output device.
  20551. </p>
  20552. <a name="v4l2"></a>
  20553. <h3 class="section">27.11 v4l2<span class="pull-right"><a class="anchor hidden-xs" href="#v4l2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-v4l2" aria-hidden="true">TOC</a></span></h3>
  20554. <p>Video4Linux2 output device.
  20555. </p>
  20556. <a name="xv"></a>
  20557. <h3 class="section">27.12 xv<span class="pull-right"><a class="anchor hidden-xs" href="#xv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xv" aria-hidden="true">TOC</a></span></h3>
  20558. <p>XV (XVideo) output device.
  20559. </p>
  20560. <p>This output device allows one to show a video stream in a X Window System
  20561. window.
  20562. </p>
  20563. <a name="Options-84"></a>
  20564. <h4 class="subsection">27.12.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-84" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-84" aria-hidden="true">TOC</a></span></h4>
  20565. <dl compact="compact">
  20566. <dt><samp>display_name</samp></dt>
  20567. <dd><p>Specify the hardware display name, which determines the display and
  20568. communications domain to be used.
  20569. </p>
  20570. <p>The display name or DISPLAY environment variable can be a string in
  20571. the format <var>hostname</var>[:<var>number</var>[.<var>screen_number</var>]].
  20572. </p>
  20573. <p><var>hostname</var> specifies the name of the host machine on which the
  20574. display is physically attached. <var>number</var> specifies the number of
  20575. the display server on that host machine. <var>screen_number</var> specifies
  20576. the screen to be used on that server.
  20577. </p>
  20578. <p>If unspecified, it defaults to the value of the DISPLAY environment
  20579. variable.
  20580. </p>
  20581. <p>For example, <code>dual-headed:0.1</code> would specify screen 1 of display
  20582. 0 on the machine named &ldquo;dual-headed&rdquo;.
  20583. </p>
  20584. <p>Check the X11 specification for more detailed information about the
  20585. display name format.
  20586. </p>
  20587. </dd>
  20588. <dt><samp>window_id</samp></dt>
  20589. <dd><p>When set to non-zero value then device doesn&rsquo;t create new window,
  20590. but uses existing one with provided <var>window_id</var>. By default
  20591. this options is set to zero and device creates its own window.
  20592. </p>
  20593. </dd>
  20594. <dt><samp>window_size</samp></dt>
  20595. <dd><p>Set the created window size, can be a string of the form
  20596. <var>width</var>x<var>height</var> or a video size abbreviation. If not
  20597. specified it defaults to the size of the input video.
  20598. Ignored when <var>window_id</var> is set.
  20599. </p>
  20600. </dd>
  20601. <dt><samp>window_x</samp></dt>
  20602. <dt><samp>window_y</samp></dt>
  20603. <dd><p>Set the X and Y window offsets for the created window. They are both
  20604. set to 0 by default. The values may be ignored by the window manager.
  20605. Ignored when <var>window_id</var> is set.
  20606. </p>
  20607. </dd>
  20608. <dt><samp>window_title</samp></dt>
  20609. <dd><p>Set the window title, if not specified default to the filename
  20610. specified for the output device. Ignored when <var>window_id</var> is set.
  20611. </p></dd>
  20612. </dl>
  20613. <p>For more information about XVideo see <a href="http://www.x.org/">http://www.x.org/</a>.
  20614. </p>
  20615. <a name="Examples-37"></a>
  20616. <h4 class="subsection">27.12.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-37" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-37" aria-hidden="true">TOC</a></span></h4>
  20617. <ul>
  20618. <li> Decode, display and encode video input with <code>ffmpeg</code> at the
  20619. same time:
  20620. <div class="example">
  20621. <pre class="example">ffmpeg -i INPUT OUTPUT -f xv display
  20622. </pre></div>
  20623. </li><li> Decode and display the input video to multiple X11 windows:
  20624. <div class="example">
  20625. <pre class="example">ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
  20626. </pre></div>
  20627. </li></ul>
  20628. <a name="Resampler-Options"></a>
  20629. <h2 class="chapter">28 Resampler Options<span class="pull-right"><a class="anchor hidden-xs" href="#Resampler-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Resampler-Options" aria-hidden="true">TOC</a></span></h2>
  20630. <p>The audio resampler supports the following named options.
  20631. </p>
  20632. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  20633. FFmpeg tools, <var>option</var>=<var>value</var> for the aresample filter,
  20634. by setting the value explicitly in the
  20635. <code>SwrContext</code> options or using the <samp>libavutil/opt.h</samp> API for
  20636. programmatic use.
  20637. </p>
  20638. <dl compact="compact">
  20639. <dt><samp>ich, in_channel_count</samp></dt>
  20640. <dd><p>Set the number of input channels. Default value is 0. Setting this
  20641. value is not mandatory if the corresponding channel layout
  20642. <samp>in_channel_layout</samp> is set.
  20643. </p>
  20644. </dd>
  20645. <dt><samp>och, out_channel_count</samp></dt>
  20646. <dd><p>Set the number of output channels. Default value is 0. Setting this
  20647. value is not mandatory if the corresponding channel layout
  20648. <samp>out_channel_layout</samp> is set.
  20649. </p>
  20650. </dd>
  20651. <dt><samp>uch, used_channel_count</samp></dt>
  20652. <dd><p>Set the number of used input channels. Default value is 0. This option is
  20653. only used for special remapping.
  20654. </p>
  20655. </dd>
  20656. <dt><samp>isr, in_sample_rate</samp></dt>
  20657. <dd><p>Set the input sample rate. Default value is 0.
  20658. </p>
  20659. </dd>
  20660. <dt><samp>osr, out_sample_rate</samp></dt>
  20661. <dd><p>Set the output sample rate. Default value is 0.
  20662. </p>
  20663. </dd>
  20664. <dt><samp>isf, in_sample_fmt</samp></dt>
  20665. <dd><p>Specify the input sample format. It is set by default to <code>none</code>.
  20666. </p>
  20667. </dd>
  20668. <dt><samp>osf, out_sample_fmt</samp></dt>
  20669. <dd><p>Specify the output sample format. It is set by default to <code>none</code>.
  20670. </p>
  20671. </dd>
  20672. <dt><samp>tsf, internal_sample_fmt</samp></dt>
  20673. <dd><p>Set the internal sample format. Default value is <code>none</code>.
  20674. This will automatically be chosen when it is not explicitly set.
  20675. </p>
  20676. </dd>
  20677. <dt><samp>icl, in_channel_layout</samp></dt>
  20678. <dt><samp>ocl, out_channel_layout</samp></dt>
  20679. <dd><p>Set the input/output channel layout.
  20680. </p>
  20681. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  20682. for the required syntax.
  20683. </p>
  20684. </dd>
  20685. <dt><samp>clev, center_mix_level</samp></dt>
  20686. <dd><p>Set the center mix level. It is a value expressed in deciBel, and must be
  20687. in the interval [-32,32].
  20688. </p>
  20689. </dd>
  20690. <dt><samp>slev, surround_mix_level</samp></dt>
  20691. <dd><p>Set the surround mix level. It is a value expressed in deciBel, and must
  20692. be in the interval [-32,32].
  20693. </p>
  20694. </dd>
  20695. <dt><samp>lfe_mix_level</samp></dt>
  20696. <dd><p>Set LFE mix into non LFE level. It is used when there is a LFE input but no
  20697. LFE output. It is a value expressed in deciBel, and must
  20698. be in the interval [-32,32].
  20699. </p>
  20700. </dd>
  20701. <dt><samp>rmvol, rematrix_volume</samp></dt>
  20702. <dd><p>Set rematrix volume. Default value is 1.0.
  20703. </p>
  20704. </dd>
  20705. <dt><samp>rematrix_maxval</samp></dt>
  20706. <dd><p>Set maximum output value for rematrixing.
  20707. This can be used to prevent clipping vs. preventing volume reduction.
  20708. A value of 1.0 prevents clipping.
  20709. </p>
  20710. </dd>
  20711. <dt><samp>flags, swr_flags</samp></dt>
  20712. <dd><p>Set flags used by the converter. Default value is 0.
  20713. </p>
  20714. <p>It supports the following individual flags:
  20715. </p><dl compact="compact">
  20716. <dt><samp>res</samp></dt>
  20717. <dd><p>force resampling, this flag forces resampling to be used even when the
  20718. input and output sample rates match.
  20719. </p></dd>
  20720. </dl>
  20721. </dd>
  20722. <dt><samp>dither_scale</samp></dt>
  20723. <dd><p>Set the dither scale. Default value is 1.
  20724. </p>
  20725. </dd>
  20726. <dt><samp>dither_method</samp></dt>
  20727. <dd><p>Set dither method. Default value is 0.
  20728. </p>
  20729. <p>Supported values:
  20730. </p><dl compact="compact">
  20731. <dt>&lsquo;<samp>rectangular</samp>&rsquo;</dt>
  20732. <dd><p>select rectangular dither
  20733. </p></dd>
  20734. <dt>&lsquo;<samp>triangular</samp>&rsquo;</dt>
  20735. <dd><p>select triangular dither
  20736. </p></dd>
  20737. <dt>&lsquo;<samp>triangular_hp</samp>&rsquo;</dt>
  20738. <dd><p>select triangular dither with high pass
  20739. </p></dd>
  20740. <dt>&lsquo;<samp>lipshitz</samp>&rsquo;</dt>
  20741. <dd><p>select Lipshitz noise shaping dither.
  20742. </p></dd>
  20743. <dt>&lsquo;<samp>shibata</samp>&rsquo;</dt>
  20744. <dd><p>select Shibata noise shaping dither.
  20745. </p></dd>
  20746. <dt>&lsquo;<samp>low_shibata</samp>&rsquo;</dt>
  20747. <dd><p>select low Shibata noise shaping dither.
  20748. </p></dd>
  20749. <dt>&lsquo;<samp>high_shibata</samp>&rsquo;</dt>
  20750. <dd><p>select high Shibata noise shaping dither.
  20751. </p></dd>
  20752. <dt>&lsquo;<samp>f_weighted</samp>&rsquo;</dt>
  20753. <dd><p>select f-weighted noise shaping dither
  20754. </p></dd>
  20755. <dt>&lsquo;<samp>modified_e_weighted</samp>&rsquo;</dt>
  20756. <dd><p>select modified-e-weighted noise shaping dither
  20757. </p></dd>
  20758. <dt>&lsquo;<samp>improved_e_weighted</samp>&rsquo;</dt>
  20759. <dd><p>select improved-e-weighted noise shaping dither
  20760. </p>
  20761. </dd>
  20762. </dl>
  20763. </dd>
  20764. <dt><samp>resampler</samp></dt>
  20765. <dd><p>Set resampling engine. Default value is swr.
  20766. </p>
  20767. <p>Supported values:
  20768. </p><dl compact="compact">
  20769. <dt>&lsquo;<samp>swr</samp>&rsquo;</dt>
  20770. <dd><p>select the native SW Resampler; filter options precision and cheby are not
  20771. applicable in this case.
  20772. </p></dd>
  20773. <dt>&lsquo;<samp>soxr</samp>&rsquo;</dt>
  20774. <dd><p>select the SoX Resampler (where available); compensation, and filter options
  20775. filter_size, phase_shift, exact_rational, filter_type &amp; kaiser_beta, are not
  20776. applicable in this case.
  20777. </p></dd>
  20778. </dl>
  20779. </dd>
  20780. <dt><samp>filter_size</samp></dt>
  20781. <dd><p>For swr only, set resampling filter size, default value is 32.
  20782. </p>
  20783. </dd>
  20784. <dt><samp>phase_shift</samp></dt>
  20785. <dd><p>For swr only, set resampling phase shift, default value is 10, and must be in
  20786. the interval [0,30].
  20787. </p>
  20788. </dd>
  20789. <dt><samp>linear_interp</samp></dt>
  20790. <dd><p>Use linear interpolation when enabled (the default). Disable it if you want
  20791. to preserve speed instead of quality when exact_rational fails.
  20792. </p>
  20793. </dd>
  20794. <dt><samp>exact_rational</samp></dt>
  20795. <dd><p>For swr only, when enabled, try to use exact phase_count based on input and
  20796. output sample rate. However, if it is larger than <code>1 &lt;&lt; phase_shift</code>,
  20797. the phase_count will be <code>1 &lt;&lt; phase_shift</code> as fallback. Default is enabled.
  20798. </p>
  20799. </dd>
  20800. <dt><samp>cutoff</samp></dt>
  20801. <dd><p>Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
  20802. value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
  20803. (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
  20804. </p>
  20805. </dd>
  20806. <dt><samp>precision</samp></dt>
  20807. <dd><p>For soxr only, the precision in bits to which the resampled signal will be
  20808. calculated. The default value of 20 (which, with suitable dithering, is
  20809. appropriate for a destination bit-depth of 16) gives SoX&rsquo;s &rsquo;High Quality&rsquo;; a
  20810. value of 28 gives SoX&rsquo;s &rsquo;Very High Quality&rsquo;.
  20811. </p>
  20812. </dd>
  20813. <dt><samp>cheby</samp></dt>
  20814. <dd><p>For soxr only, selects passband rolloff none (Chebyshev) &amp; higher-precision
  20815. approximation for &rsquo;irrational&rsquo; ratios. Default value is 0.
  20816. </p>
  20817. </dd>
  20818. <dt><samp>async</samp></dt>
  20819. <dd><p>For swr only, simple 1 parameter audio sync to timestamps using stretching,
  20820. squeezing, filling and trimming. Setting this to 1 will enable filling and
  20821. trimming, larger values represent the maximum amount in samples that the data
  20822. may be stretched or squeezed for each second.
  20823. Default value is 0, thus no compensation is applied to make the samples match
  20824. the audio timestamps.
  20825. </p>
  20826. </dd>
  20827. <dt><samp>first_pts</samp></dt>
  20828. <dd><p>For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
  20829. This allows for padding/trimming at the start of stream. By default, no
  20830. assumption is made about the first frame&rsquo;s expected pts, so no padding or
  20831. trimming is done. For example, this could be set to 0 to pad the beginning with
  20832. silence if an audio stream starts after the video stream or to trim any samples
  20833. with a negative pts due to encoder delay.
  20834. </p>
  20835. </dd>
  20836. <dt><samp>min_comp</samp></dt>
  20837. <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
  20838. seconds) to trigger stretching/squeezing/filling or trimming of the
  20839. data to make it match the timestamps. The default is that
  20840. stretching/squeezing/filling and trimming is disabled
  20841. (<samp>min_comp</samp> = <code>FLT_MAX</code>).
  20842. </p>
  20843. </dd>
  20844. <dt><samp>min_hard_comp</samp></dt>
  20845. <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
  20846. seconds) to trigger adding/dropping samples to make it match the
  20847. timestamps. This option effectively is a threshold to select between
  20848. hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
  20849. all compensation is by default disabled through <samp>min_comp</samp>.
  20850. The default is 0.1.
  20851. </p>
  20852. </dd>
  20853. <dt><samp>comp_duration</samp></dt>
  20854. <dd><p>For swr only, set duration (in seconds) over which data is stretched/squeezed
  20855. to make it match the timestamps. Must be a non-negative double float value,
  20856. default value is 1.0.
  20857. </p>
  20858. </dd>
  20859. <dt><samp>max_soft_comp</samp></dt>
  20860. <dd><p>For swr only, set maximum factor by which data is stretched/squeezed to make it
  20861. match the timestamps. Must be a non-negative double float value, default value
  20862. is 0.
  20863. </p>
  20864. </dd>
  20865. <dt><samp>matrix_encoding</samp></dt>
  20866. <dd><p>Select matrixed stereo encoding.
  20867. </p>
  20868. <p>It accepts the following values:
  20869. </p><dl compact="compact">
  20870. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  20871. <dd><p>select none
  20872. </p></dd>
  20873. <dt>&lsquo;<samp>dolby</samp>&rsquo;</dt>
  20874. <dd><p>select Dolby
  20875. </p></dd>
  20876. <dt>&lsquo;<samp>dplii</samp>&rsquo;</dt>
  20877. <dd><p>select Dolby Pro Logic II
  20878. </p></dd>
  20879. </dl>
  20880. <p>Default value is <code>none</code>.
  20881. </p>
  20882. </dd>
  20883. <dt><samp>filter_type</samp></dt>
  20884. <dd><p>For swr only, select resampling filter type. This only affects resampling
  20885. operations.
  20886. </p>
  20887. <p>It accepts the following values:
  20888. </p><dl compact="compact">
  20889. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  20890. <dd><p>select cubic
  20891. </p></dd>
  20892. <dt>&lsquo;<samp>blackman_nuttall</samp>&rsquo;</dt>
  20893. <dd><p>select Blackman Nuttall windowed sinc
  20894. </p></dd>
  20895. <dt>&lsquo;<samp>kaiser</samp>&rsquo;</dt>
  20896. <dd><p>select Kaiser windowed sinc
  20897. </p></dd>
  20898. </dl>
  20899. </dd>
  20900. <dt><samp>kaiser_beta</samp></dt>
  20901. <dd><p>For swr only, set Kaiser window beta value. Must be a double float value in the
  20902. interval [2,16], default value is 9.
  20903. </p>
  20904. </dd>
  20905. <dt><samp>output_sample_bits</samp></dt>
  20906. <dd><p>For swr only, set number of used output sample bits for dithering. Must be an integer in the
  20907. interval [0,64], default value is 0, which means it&rsquo;s not used.
  20908. </p>
  20909. </dd>
  20910. </dl>
  20911. <span id="scaler_005foptions"></span><a name="Scaler-Options"></a>
  20912. <h2 class="chapter">29 Scaler Options<span class="pull-right"><a class="anchor hidden-xs" href="#Scaler-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Scaler-Options" aria-hidden="true">TOC</a></span></h2>
  20913. <p>The video scaler supports the following named options.
  20914. </p>
  20915. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  20916. FFmpeg tools, with a few API-only exceptions noted below.
  20917. For programmatic use, they can be set explicitly in the
  20918. <code>SwsContext</code> options or through the <samp>libavutil/opt.h</samp> API.
  20919. </p>
  20920. <dl compact="compact">
  20921. <dd>
  20922. <span id="sws_005fflags"></span></dd>
  20923. <dt><samp>sws_flags</samp></dt>
  20924. <dd><p>Set the scaler flags. This is also used to set the scaling
  20925. algorithm. Only a single algorithm should be selected. Default
  20926. value is &lsquo;<samp>bicubic</samp>&rsquo;.
  20927. </p>
  20928. <p>It accepts the following values:
  20929. </p><dl compact="compact">
  20930. <dt>&lsquo;<samp>fast_bilinear</samp>&rsquo;</dt>
  20931. <dd><p>Select fast bilinear scaling algorithm.
  20932. </p>
  20933. </dd>
  20934. <dt>&lsquo;<samp>bilinear</samp>&rsquo;</dt>
  20935. <dd><p>Select bilinear scaling algorithm.
  20936. </p>
  20937. </dd>
  20938. <dt>&lsquo;<samp>bicubic</samp>&rsquo;</dt>
  20939. <dd><p>Select bicubic scaling algorithm.
  20940. </p>
  20941. </dd>
  20942. <dt>&lsquo;<samp>experimental</samp>&rsquo;</dt>
  20943. <dd><p>Select experimental scaling algorithm.
  20944. </p>
  20945. </dd>
  20946. <dt>&lsquo;<samp>neighbor</samp>&rsquo;</dt>
  20947. <dd><p>Select nearest neighbor rescaling algorithm.
  20948. </p>
  20949. </dd>
  20950. <dt>&lsquo;<samp>area</samp>&rsquo;</dt>
  20951. <dd><p>Select averaging area rescaling algorithm.
  20952. </p>
  20953. </dd>
  20954. <dt>&lsquo;<samp>bicublin</samp>&rsquo;</dt>
  20955. <dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
  20956. chroma components.
  20957. </p>
  20958. </dd>
  20959. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  20960. <dd><p>Select Gaussian rescaling algorithm.
  20961. </p>
  20962. </dd>
  20963. <dt>&lsquo;<samp>sinc</samp>&rsquo;</dt>
  20964. <dd><p>Select sinc rescaling algorithm.
  20965. </p>
  20966. </dd>
  20967. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  20968. <dd><p>Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be
  20969. changed by setting <code>param0</code>.
  20970. </p>
  20971. </dd>
  20972. <dt>&lsquo;<samp>spline</samp>&rsquo;</dt>
  20973. <dd><p>Select natural bicubic spline rescaling algorithm.
  20974. </p>
  20975. </dd>
  20976. <dt>&lsquo;<samp>print_info</samp>&rsquo;</dt>
  20977. <dd><p>Enable printing/debug logging.
  20978. </p>
  20979. </dd>
  20980. <dt>&lsquo;<samp>accurate_rnd</samp>&rsquo;</dt>
  20981. <dd><p>Enable accurate rounding.
  20982. </p>
  20983. </dd>
  20984. <dt>&lsquo;<samp>full_chroma_int</samp>&rsquo;</dt>
  20985. <dd><p>Enable full chroma interpolation.
  20986. </p>
  20987. </dd>
  20988. <dt>&lsquo;<samp>full_chroma_inp</samp>&rsquo;</dt>
  20989. <dd><p>Select full chroma input.
  20990. </p>
  20991. </dd>
  20992. <dt>&lsquo;<samp>bitexact</samp>&rsquo;</dt>
  20993. <dd><p>Enable bitexact output.
  20994. </p></dd>
  20995. </dl>
  20996. </dd>
  20997. <dt><samp>srcw <var>(API only)</var></samp></dt>
  20998. <dd><p>Set source width.
  20999. </p>
  21000. </dd>
  21001. <dt><samp>srch <var>(API only)</var></samp></dt>
  21002. <dd><p>Set source height.
  21003. </p>
  21004. </dd>
  21005. <dt><samp>dstw <var>(API only)</var></samp></dt>
  21006. <dd><p>Set destination width.
  21007. </p>
  21008. </dd>
  21009. <dt><samp>dsth <var>(API only)</var></samp></dt>
  21010. <dd><p>Set destination height.
  21011. </p>
  21012. </dd>
  21013. <dt><samp>src_format <var>(API only)</var></samp></dt>
  21014. <dd><p>Set source pixel format (must be expressed as an integer).
  21015. </p>
  21016. </dd>
  21017. <dt><samp>dst_format <var>(API only)</var></samp></dt>
  21018. <dd><p>Set destination pixel format (must be expressed as an integer).
  21019. </p>
  21020. </dd>
  21021. <dt><samp>src_range <var>(boolean)</var></samp></dt>
  21022. <dd><p>If value is set to <code>1</code>, indicates source is full range. Default value is
  21023. <code>0</code>, which indicates source is limited range.
  21024. </p>
  21025. </dd>
  21026. <dt><samp>dst_range <var>(boolean)</var></samp></dt>
  21027. <dd><p>If value is set to <code>1</code>, enable full range for destination. Default value
  21028. is <code>0</code>, which enables limited range.
  21029. </p>
  21030. <span id="sws_005fparams"></span></dd>
  21031. <dt><samp>param0, param1</samp></dt>
  21032. <dd><p>Set scaling algorithm parameters. The specified values are specific of
  21033. some scaling algorithms and ignored by others. The specified values
  21034. are floating point number values.
  21035. </p>
  21036. </dd>
  21037. <dt><samp>sws_dither</samp></dt>
  21038. <dd><p>Set the dithering algorithm. Accepts one of the following
  21039. values. Default value is &lsquo;<samp>auto</samp>&rsquo;.
  21040. </p>
  21041. <dl compact="compact">
  21042. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  21043. <dd><p>automatic choice
  21044. </p>
  21045. </dd>
  21046. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  21047. <dd><p>no dithering
  21048. </p>
  21049. </dd>
  21050. <dt>&lsquo;<samp>bayer</samp>&rsquo;</dt>
  21051. <dd><p>bayer dither
  21052. </p>
  21053. </dd>
  21054. <dt>&lsquo;<samp>ed</samp>&rsquo;</dt>
  21055. <dd><p>error diffusion dither
  21056. </p>
  21057. </dd>
  21058. <dt>&lsquo;<samp>a_dither</samp>&rsquo;</dt>
  21059. <dd><p>arithmetic dither, based using addition
  21060. </p>
  21061. </dd>
  21062. <dt>&lsquo;<samp>x_dither</samp>&rsquo;</dt>
  21063. <dd><p>arithmetic dither, based using xor (more random/less apparent patterning that
  21064. a_dither).
  21065. </p>
  21066. </dd>
  21067. </dl>
  21068. </dd>
  21069. <dt><samp>alphablend</samp></dt>
  21070. <dd><p>Set the alpha blending to use when the input has alpha but the output does not.
  21071. Default value is &lsquo;<samp>none</samp>&rsquo;.
  21072. </p>
  21073. <dl compact="compact">
  21074. <dt>&lsquo;<samp>uniform_color</samp>&rsquo;</dt>
  21075. <dd><p>Blend onto a uniform background color
  21076. </p>
  21077. </dd>
  21078. <dt>&lsquo;<samp>checkerboard</samp>&rsquo;</dt>
  21079. <dd><p>Blend onto a checkerboard
  21080. </p>
  21081. </dd>
  21082. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  21083. <dd><p>No blending
  21084. </p>
  21085. </dd>
  21086. </dl>
  21087. </dd>
  21088. </dl>
  21089. <a name="Filtering-Introduction"></a>
  21090. <h2 class="chapter">30 Filtering Introduction<span class="pull-right"><a class="anchor hidden-xs" href="#Filtering-Introduction" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtering-Introduction" aria-hidden="true">TOC</a></span></h2>
  21091. <p>Filtering in FFmpeg is enabled through the libavfilter library.
  21092. </p>
  21093. <p>In libavfilter, a filter can have multiple inputs and multiple
  21094. outputs.
  21095. To illustrate the sorts of things that are possible, we consider the
  21096. following filtergraph.
  21097. </p>
  21098. <pre class="verbatim"> [main]
  21099. input --&gt; split ---------------------&gt; overlay --&gt; output
  21100. | ^
  21101. |[tmp] [flip]|
  21102. +-----&gt; crop --&gt; vflip -------+
  21103. </pre>
  21104. <p>This filtergraph splits the input stream in two streams, then sends one
  21105. stream through the crop filter and the vflip filter, before merging it
  21106. back with the other stream by overlaying it on top. You can use the
  21107. following command to achieve this:
  21108. </p>
  21109. <div class="example">
  21110. <pre class="example">ffmpeg -i INPUT -vf &quot;split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2&quot; OUTPUT
  21111. </pre></div>
  21112. <p>The result will be that the top half of the video is mirrored
  21113. onto the bottom half of the output video.
  21114. </p>
  21115. <p>Filters in the same linear chain are separated by commas, and distinct
  21116. linear chains of filters are separated by semicolons. In our example,
  21117. <var>crop,vflip</var> are in one linear chain, <var>split</var> and
  21118. <var>overlay</var> are separately in another. The points where the linear
  21119. chains join are labelled by names enclosed in square brackets. In the
  21120. example, the split filter generates two outputs that are associated to
  21121. the labels <var>[main]</var> and <var>[tmp]</var>.
  21122. </p>
  21123. <p>The stream sent to the second output of <var>split</var>, labelled as
  21124. <var>[tmp]</var>, is processed through the <var>crop</var> filter, which crops
  21125. away the lower half part of the video, and then vertically flipped. The
  21126. <var>overlay</var> filter takes in input the first unchanged output of the
  21127. split filter (which was labelled as <var>[main]</var>), and overlay on its
  21128. lower half the output generated by the <var>crop,vflip</var> filterchain.
  21129. </p>
  21130. <p>Some filters take in input a list of parameters: they are specified
  21131. after the filter name and an equal sign, and are separated from each other
  21132. by a colon.
  21133. </p>
  21134. <p>There exist so-called <var>source filters</var> that do not have an
  21135. audio/video input, and <var>sink filters</var> that will not have audio/video
  21136. output.
  21137. </p>
  21138. <a name="graph2dot"></a>
  21139. <h2 class="chapter">31 graph2dot<span class="pull-right"><a class="anchor hidden-xs" href="#graph2dot" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-graph2dot" aria-hidden="true">TOC</a></span></h2>
  21140. <p>The <samp>graph2dot</samp> program included in the FFmpeg <samp>tools</samp>
  21141. directory can be used to parse a filtergraph description and issue a
  21142. corresponding textual representation in the dot language.
  21143. </p>
  21144. <p>Invoke the command:
  21145. </p><div class="example">
  21146. <pre class="example">graph2dot -h
  21147. </pre></div>
  21148. <p>to see how to use <samp>graph2dot</samp>.
  21149. </p>
  21150. <p>You can then pass the dot description to the <samp>dot</samp> program (from
  21151. the graphviz suite of programs) and obtain a graphical representation
  21152. of the filtergraph.
  21153. </p>
  21154. <p>For example the sequence of commands:
  21155. </p><div class="example">
  21156. <pre class="example">echo <var>GRAPH_DESCRIPTION</var> | \
  21157. tools/graph2dot -o graph.tmp &amp;&amp; \
  21158. dot -Tpng graph.tmp -o graph.png &amp;&amp; \
  21159. display graph.png
  21160. </pre></div>
  21161. <p>can be used to create and display an image representing the graph
  21162. described by the <var>GRAPH_DESCRIPTION</var> string. Note that this string must be
  21163. a complete self-contained graph, with its inputs and outputs explicitly defined.
  21164. For example if your command line is of the form:
  21165. </p><div class="example">
  21166. <pre class="example">ffmpeg -i infile -vf scale=640:360 outfile
  21167. </pre></div>
  21168. <p>your <var>GRAPH_DESCRIPTION</var> string will need to be of the form:
  21169. </p><div class="example">
  21170. <pre class="example">nullsrc,scale=640:360,nullsink
  21171. </pre></div>
  21172. <p>you may also need to set the <var>nullsrc</var> parameters and add a <var>format</var>
  21173. filter in order to simulate a specific input file.
  21174. </p>
  21175. <a name="Filtergraph-description"></a>
  21176. <h2 class="chapter">32 Filtergraph description<span class="pull-right"><a class="anchor hidden-xs" href="#Filtergraph-description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtergraph-description" aria-hidden="true">TOC</a></span></h2>
  21177. <p>A filtergraph is a directed graph of connected filters. It can contain
  21178. cycles, and there can be multiple links between a pair of
  21179. filters. Each link has one input pad on one side connecting it to one
  21180. filter from which it takes its input, and one output pad on the other
  21181. side connecting it to one filter accepting its output.
  21182. </p>
  21183. <p>Each filter in a filtergraph is an instance of a filter class
  21184. registered in the application, which defines the features and the
  21185. number of input and output pads of the filter.
  21186. </p>
  21187. <p>A filter with no input pads is called a &quot;source&quot;, and a filter with no
  21188. output pads is called a &quot;sink&quot;.
  21189. </p>
  21190. <span id="Filtergraph-syntax"></span><a name="Filtergraph-syntax-1"></a>
  21191. <h3 class="section">32.1 Filtergraph syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Filtergraph-syntax-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtergraph-syntax-1" aria-hidden="true">TOC</a></span></h3>
  21192. <p>A filtergraph has a textual representation, which is recognized by the
  21193. <samp>-filter</samp>/<samp>-vf</samp>/<samp>-af</samp> and
  21194. <samp>-filter_complex</samp> options in <code>ffmpeg</code> and
  21195. <samp>-vf</samp>/<samp>-af</samp> in <code>ffplay</code>, and by the
  21196. <code>avfilter_graph_parse_ptr()</code> function defined in
  21197. <samp>libavfilter/avfilter.h</samp>.
  21198. </p>
  21199. <p>A filterchain consists of a sequence of connected filters, each one
  21200. connected to the previous one in the sequence. A filterchain is
  21201. represented by a list of &quot;,&quot;-separated filter descriptions.
  21202. </p>
  21203. <p>A filtergraph consists of a sequence of filterchains. A sequence of
  21204. filterchains is represented by a list of &quot;;&quot;-separated filterchain
  21205. descriptions.
  21206. </p>
  21207. <p>A filter is represented by a string of the form:
  21208. [<var>in_link_1</var>]...[<var>in_link_N</var>]<var>filter_name</var>@<var>id</var>=<var>arguments</var>[<var>out_link_1</var>]...[<var>out_link_M</var>]
  21209. </p>
  21210. <p><var>filter_name</var> is the name of the filter class of which the
  21211. described filter is an instance of, and has to be the name of one of
  21212. the filter classes registered in the program optionally followed by &quot;@<var>id</var>&quot;.
  21213. The name of the filter class is optionally followed by a string
  21214. &quot;=<var>arguments</var>&quot;.
  21215. </p>
  21216. <p><var>arguments</var> is a string which contains the parameters used to
  21217. initialize the filter instance. It may have one of two forms:
  21218. </p><ul>
  21219. <li> A &rsquo;:&rsquo;-separated list of <var>key=value</var> pairs.
  21220. </li><li> A &rsquo;:&rsquo;-separated list of <var>value</var>. In this case, the keys are assumed to be
  21221. the option names in the order they are declared. E.g. the <code>fade</code> filter
  21222. declares three options in this order &ndash; <samp>type</samp>, <samp>start_frame</samp> and
  21223. <samp>nb_frames</samp>. Then the parameter list <var>in:0:30</var> means that the value
  21224. <var>in</var> is assigned to the option <samp>type</samp>, <var>0</var> to
  21225. <samp>start_frame</samp> and <var>30</var> to <samp>nb_frames</samp>.
  21226. </li><li> A &rsquo;:&rsquo;-separated list of mixed direct <var>value</var> and long <var>key=value</var>
  21227. pairs. The direct <var>value</var> must precede the <var>key=value</var> pairs, and
  21228. follow the same constraints order of the previous point. The following
  21229. <var>key=value</var> pairs can be set in any preferred order.
  21230. </li></ul>
  21231. <p>If the option value itself is a list of items (e.g. the <code>format</code> filter
  21232. takes a list of pixel formats), the items in the list are usually separated by
  21233. &lsquo;<samp>|</samp>&rsquo;.
  21234. </p>
  21235. <p>The list of arguments can be quoted using the character &lsquo;<samp>'</samp>&rsquo; as initial
  21236. and ending mark, and the character &lsquo;<samp>\</samp>&rsquo; for escaping the characters
  21237. within the quoted text; otherwise the argument string is considered
  21238. terminated when the next special character (belonging to the set
  21239. &lsquo;<samp>[]=;,</samp>&rsquo;) is encountered.
  21240. </p>
  21241. <p>The name and arguments of the filter are optionally preceded and
  21242. followed by a list of link labels.
  21243. A link label allows one to name a link and associate it to a filter output
  21244. or input pad. The preceding labels <var>in_link_1</var>
  21245. ... <var>in_link_N</var>, are associated to the filter input pads,
  21246. the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
  21247. associated to the output pads.
  21248. </p>
  21249. <p>When two link labels with the same name are found in the
  21250. filtergraph, a link between the corresponding input and output pad is
  21251. created.
  21252. </p>
  21253. <p>If an output pad is not labelled, it is linked by default to the first
  21254. unlabelled input pad of the next filter in the filterchain.
  21255. For example in the filterchain
  21256. </p><div class="example">
  21257. <pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
  21258. </pre></div>
  21259. <p>the split filter instance has two output pads, and the overlay filter
  21260. instance two input pads. The first output pad of split is labelled
  21261. &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
  21262. output pad of split is linked to the second input pad of overlay,
  21263. which are both unlabelled.
  21264. </p>
  21265. <p>In a filter description, if the input label of the first filter is not
  21266. specified, &quot;in&quot; is assumed; if the output label of the last filter is not
  21267. specified, &quot;out&quot; is assumed.
  21268. </p>
  21269. <p>In a complete filterchain all the unlabelled filter input and output
  21270. pads must be connected. A filtergraph is considered valid if all the
  21271. filter input and output pads of all the filterchains are connected.
  21272. </p>
  21273. <p>Libavfilter will automatically insert <a href="#scale">scale</a> filters where format
  21274. conversion is required. It is possible to specify swscale flags
  21275. for those automatically inserted scalers by prepending
  21276. <code>sws_flags=<var>flags</var>;</code>
  21277. to the filtergraph description.
  21278. </p>
  21279. <p>Here is a BNF description of the filtergraph syntax:
  21280. </p><div class="example">
  21281. <pre class="example"><var>NAME</var> ::= sequence of alphanumeric characters and '_'
  21282. <var>FILTER_NAME</var> ::= <var>NAME</var>[&quot;@&quot;<var>NAME</var>]
  21283. <var>LINKLABEL</var> ::= &quot;[&quot; <var>NAME</var> &quot;]&quot;
  21284. <var>LINKLABELS</var> ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
  21285. <var>FILTER_ARGUMENTS</var> ::= sequence of chars (possibly quoted)
  21286. <var>FILTER</var> ::= [<var>LINKLABELS</var>] <var>FILTER_NAME</var> [&quot;=&quot; <var>FILTER_ARGUMENTS</var>] [<var>LINKLABELS</var>]
  21287. <var>FILTERCHAIN</var> ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
  21288. <var>FILTERGRAPH</var> ::= [sws_flags=<var>flags</var>;] <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
  21289. </pre></div>
  21290. <span id="filtergraph-escaping"></span><a name="Notes-on-filtergraph-escaping"></a>
  21291. <h3 class="section">32.2 Notes on filtergraph escaping<span class="pull-right"><a class="anchor hidden-xs" href="#Notes-on-filtergraph-escaping" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Notes-on-filtergraph-escaping" aria-hidden="true">TOC</a></span></h3>
  21292. <p>Filtergraph description composition entails several levels of
  21293. escaping. See <a href="ffmpeg-utils.html#quoting_005fand_005fescaping">(ffmpeg-utils)the &quot;Quoting and escaping&quot;
  21294. section in the ffmpeg-utils(1) manual</a> for more
  21295. information about the employed escaping procedure.
  21296. </p>
  21297. <p>A first level escaping affects the content of each filter option
  21298. value, which may contain the special character <code>:</code> used to
  21299. separate values, or one of the escaping characters <code>\'</code>.
  21300. </p>
  21301. <p>A second level escaping affects the whole filter description, which
  21302. may contain the escaping characters <code>\'</code> or the special
  21303. characters <code>[],;</code> used by the filtergraph description.
  21304. </p>
  21305. <p>Finally, when you specify a filtergraph on a shell commandline, you
  21306. need to perform a third level escaping for the shell special
  21307. characters contained within it.
  21308. </p>
  21309. <p>For example, consider the following string to be embedded in
  21310. the <a href="#drawtext">drawtext</a> filter description <samp>text</samp> value:
  21311. </p><div class="example">
  21312. <pre class="example">this is a 'string': may contain one, or more, special characters
  21313. </pre></div>
  21314. <p>This string contains the <code>'</code> special escaping character, and the
  21315. <code>:</code> special character, so it needs to be escaped in this way:
  21316. </p><div class="example">
  21317. <pre class="example">text=this is a \'string\'\: may contain one, or more, special characters
  21318. </pre></div>
  21319. <p>A second level of escaping is required when embedding the filter
  21320. description in a filtergraph description, in order to escape all the
  21321. filtergraph special characters. Thus the example above becomes:
  21322. </p><div class="example">
  21323. <pre class="example">drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
  21324. </pre></div>
  21325. <p>(note that in addition to the <code>\'</code> escaping special characters,
  21326. also <code>,</code> needs to be escaped).
  21327. </p>
  21328. <p>Finally an additional level of escaping is needed when writing the
  21329. filtergraph description in a shell command, which depends on the
  21330. escaping rules of the adopted shell. For example, assuming that
  21331. <code>\</code> is special and needs to be escaped with another <code>\</code>, the
  21332. previous string will finally result in:
  21333. </p><div class="example">
  21334. <pre class="example">-vf &quot;drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters&quot;
  21335. </pre></div>
  21336. <a name="Timeline-editing"></a>
  21337. <h2 class="chapter">33 Timeline editing<span class="pull-right"><a class="anchor hidden-xs" href="#Timeline-editing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Timeline-editing" aria-hidden="true">TOC</a></span></h2>
  21338. <p>Some filters support a generic <samp>enable</samp> option. For the filters
  21339. supporting timeline editing, this option can be set to an expression which is
  21340. evaluated before sending a frame to the filter. If the evaluation is non-zero,
  21341. the filter will be enabled, otherwise the frame will be sent unchanged to the
  21342. next filter in the filtergraph.
  21343. </p>
  21344. <p>The expression accepts the following values:
  21345. </p><dl compact="compact">
  21346. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  21347. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  21348. </p>
  21349. </dd>
  21350. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  21351. <dd><p>sequential number of the input frame, starting from 0
  21352. </p>
  21353. </dd>
  21354. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  21355. <dd><p>the position in the file of the input frame, NAN if unknown
  21356. </p>
  21357. </dd>
  21358. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  21359. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  21360. <dd><p>width and height of the input frame if video
  21361. </p></dd>
  21362. </dl>
  21363. <p>Additionally, these filters support an <samp>enable</samp> command that can be used
  21364. to re-define the expression.
  21365. </p>
  21366. <p>Like any other filtering option, the <samp>enable</samp> option follows the same
  21367. rules.
  21368. </p>
  21369. <p>For example, to enable a blur filter (<a href="#smartblur">smartblur</a>) from 10 seconds to 3
  21370. minutes, and a <a href="#curves">curves</a> filter starting at 3 seconds:
  21371. </p><div class="example">
  21372. <pre class="example">smartblur = enable='between(t,10,3*60)',
  21373. curves = enable='gte(t,3)' : preset=cross_process
  21374. </pre></div>
  21375. <p>See <code>ffmpeg -filters</code> to view which filters have timeline support.
  21376. </p>
  21377. <span id="commands"></span><a name="Changing-options-at-runtime-with-a-command"></a>
  21378. <h2 class="chapter">34 Changing options at runtime with a command<span class="pull-right"><a class="anchor hidden-xs" href="#Changing-options-at-runtime-with-a-command" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Changing-options-at-runtime-with-a-command" aria-hidden="true">TOC</a></span></h2>
  21379. <p>Some options can be changed during the operation of the filter using
  21380. a command. These options are marked &rsquo;T&rsquo; on the output of
  21381. <code>ffmpeg</code> <samp>-h filter=&lt;name of filter&gt;</samp>.
  21382. The name of the command is the name of the option and the argument is
  21383. the new value.
  21384. </p>
  21385. <span id="framesync"></span><a name="Options-for-filters-with-several-inputs-_0028framesync_0029"></a>
  21386. <h2 class="chapter">35 Options for filters with several inputs (framesync)<span class="pull-right"><a class="anchor hidden-xs" href="#Options-for-filters-with-several-inputs-_0028framesync_0029" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-for-filters-with-several-inputs-_0028framesync_0029" aria-hidden="true">TOC</a></span></h2>
  21387. <p>Some filters with several inputs support a common set of options.
  21388. These options can only be set by name, not with the short notation.
  21389. </p>
  21390. <dl compact="compact">
  21391. <dt><samp>eof_action</samp></dt>
  21392. <dd><p>The action to take when EOF is encountered on the secondary input; it accepts
  21393. one of the following values:
  21394. </p>
  21395. <dl compact="compact">
  21396. <dt><samp>repeat</samp></dt>
  21397. <dd><p>Repeat the last frame (the default).
  21398. </p></dd>
  21399. <dt><samp>endall</samp></dt>
  21400. <dd><p>End both streams.
  21401. </p></dd>
  21402. <dt><samp>pass</samp></dt>
  21403. <dd><p>Pass the main input through.
  21404. </p></dd>
  21405. </dl>
  21406. </dd>
  21407. <dt><samp>shortest</samp></dt>
  21408. <dd><p>If set to 1, force the output to terminate when the shortest input
  21409. terminates. Default value is 0.
  21410. </p>
  21411. </dd>
  21412. <dt><samp>repeatlast</samp></dt>
  21413. <dd><p>If set to 1, force the filter to extend the last frame of secondary streams
  21414. until the end of the primary stream. A value of 0 disables this behavior.
  21415. Default value is 1.
  21416. </p></dd>
  21417. </dl>
  21418. <a name="Audio-Filters"></a>
  21419. <h2 class="chapter">36 Audio Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Filters" aria-hidden="true">TOC</a></span></h2>
  21420. <p>When you configure your FFmpeg build, you can disable any of the
  21421. existing filters using <code>--disable-filters</code>.
  21422. The configure output will show the audio filters included in your
  21423. build.
  21424. </p>
  21425. <p>Below is a description of the currently available audio filters.
  21426. </p>
  21427. <a name="acompressor"></a>
  21428. <h3 class="section">36.1 acompressor<span class="pull-right"><a class="anchor hidden-xs" href="#acompressor" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acompressor" aria-hidden="true">TOC</a></span></h3>
  21429. <p>A compressor is mainly used to reduce the dynamic range of a signal.
  21430. Especially modern music is mostly compressed at a high ratio to
  21431. improve the overall loudness. It&rsquo;s done to get the highest attention
  21432. of a listener, &quot;fatten&quot; the sound and bring more &quot;power&quot; to the track.
  21433. If a signal is compressed too much it may sound dull or &quot;dead&quot;
  21434. afterwards or it may start to &quot;pump&quot; (which could be a powerful effect
  21435. but can also destroy a track completely).
  21436. The right compression is the key to reach a professional sound and is
  21437. the high art of mixing and mastering. Because of its complex settings
  21438. it may take a long time to get the right feeling for this kind of effect.
  21439. </p>
  21440. <p>Compression is done by detecting the volume above a chosen level
  21441. <code>threshold</code> and dividing it by the factor set with <code>ratio</code>.
  21442. So if you set the threshold to -12dB and your signal reaches -6dB a ratio
  21443. of 2:1 will result in a signal at -9dB. Because an exact manipulation of
  21444. the signal would cause distortion of the waveform the reduction can be
  21445. levelled over the time. This is done by setting &quot;Attack&quot; and &quot;Release&quot;.
  21446. <code>attack</code> determines how long the signal has to rise above the threshold
  21447. before any reduction will occur and <code>release</code> sets the time the signal
  21448. has to fall below the threshold to reduce the reduction again. Shorter signals
  21449. than the chosen attack time will be left untouched.
  21450. The overall reduction of the signal can be made up afterwards with the
  21451. <code>makeup</code> setting. So compressing the peaks of a signal about 6dB and
  21452. raising the makeup to this level results in a signal twice as loud than the
  21453. source. To gain a softer entry in the compression the <code>knee</code> flattens the
  21454. hard edge at the threshold in the range of the chosen decibels.
  21455. </p>
  21456. <p>The filter accepts the following options:
  21457. </p>
  21458. <dl compact="compact">
  21459. <dt><samp>level_in</samp></dt>
  21460. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  21461. </p>
  21462. </dd>
  21463. <dt><samp>mode</samp></dt>
  21464. <dd><p>Set mode of compressor operation. Can be <code>upward</code> or <code>downward</code>.
  21465. Default is <code>downward</code>.
  21466. </p>
  21467. </dd>
  21468. <dt><samp>threshold</samp></dt>
  21469. <dd><p>If a signal of stream rises above this level it will affect the gain
  21470. reduction.
  21471. By default it is 0.125. Range is between 0.00097563 and 1.
  21472. </p>
  21473. </dd>
  21474. <dt><samp>ratio</samp></dt>
  21475. <dd><p>Set a ratio by which the signal is reduced. 1:2 means that if the level
  21476. rose 4dB above the threshold, it will be only 2dB above after the reduction.
  21477. Default is 2. Range is between 1 and 20.
  21478. </p>
  21479. </dd>
  21480. <dt><samp>attack</samp></dt>
  21481. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  21482. reduction starts. Default is 20. Range is between 0.01 and 2000.
  21483. </p>
  21484. </dd>
  21485. <dt><samp>release</samp></dt>
  21486. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  21487. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  21488. </p>
  21489. </dd>
  21490. <dt><samp>makeup</samp></dt>
  21491. <dd><p>Set the amount by how much signal will be amplified after processing.
  21492. Default is 1. Range is from 1 to 64.
  21493. </p>
  21494. </dd>
  21495. <dt><samp>knee</samp></dt>
  21496. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  21497. Default is 2.82843. Range is between 1 and 8.
  21498. </p>
  21499. </dd>
  21500. <dt><samp>link</samp></dt>
  21501. <dd><p>Choose if the <code>average</code> level between all channels of input stream
  21502. or the louder(<code>maximum</code>) channel of input stream affects the
  21503. reduction. Default is <code>average</code>.
  21504. </p>
  21505. </dd>
  21506. <dt><samp>detection</samp></dt>
  21507. <dd><p>Should the exact signal be taken in case of <code>peak</code> or an RMS one in case
  21508. of <code>rms</code>. Default is <code>rms</code> which is mostly smoother.
  21509. </p>
  21510. </dd>
  21511. <dt><samp>mix</samp></dt>
  21512. <dd><p>How much to use compressed signal in output. Default is 1.
  21513. Range is between 0 and 1.
  21514. </p></dd>
  21515. </dl>
  21516. <a name="Commands"></a>
  21517. <h4 class="subsection">36.1.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands" aria-hidden="true">TOC</a></span></h4>
  21518. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  21519. </p>
  21520. <a name="acontrast"></a>
  21521. <h3 class="section">36.2 acontrast<span class="pull-right"><a class="anchor hidden-xs" href="#acontrast" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acontrast" aria-hidden="true">TOC</a></span></h3>
  21522. <p>Simple audio dynamic range compression/expansion filter.
  21523. </p>
  21524. <p>The filter accepts the following options:
  21525. </p>
  21526. <dl compact="compact">
  21527. <dt><samp>contrast</samp></dt>
  21528. <dd><p>Set contrast. Default is 33. Allowed range is between 0 and 100.
  21529. </p></dd>
  21530. </dl>
  21531. <a name="acopy"></a>
  21532. <h3 class="section">36.3 acopy<span class="pull-right"><a class="anchor hidden-xs" href="#acopy" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acopy" aria-hidden="true">TOC</a></span></h3>
  21533. <p>Copy the input audio source unchanged to the output. This is mainly useful for
  21534. testing purposes.
  21535. </p>
  21536. <a name="acrossfade"></a>
  21537. <h3 class="section">36.4 acrossfade<span class="pull-right"><a class="anchor hidden-xs" href="#acrossfade" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acrossfade" aria-hidden="true">TOC</a></span></h3>
  21538. <p>Apply cross fade from one input audio stream to another input audio stream.
  21539. The cross fade is applied for specified duration near the end of first stream.
  21540. </p>
  21541. <p>The filter accepts the following options:
  21542. </p>
  21543. <dl compact="compact">
  21544. <dt><samp>nb_samples, ns</samp></dt>
  21545. <dd><p>Specify the number of samples for which the cross fade effect has to last.
  21546. At the end of the cross fade effect the first input audio will be completely
  21547. silent. Default is 44100.
  21548. </p>
  21549. </dd>
  21550. <dt><samp>duration, d</samp></dt>
  21551. <dd><p>Specify the duration of the cross fade effect. See
  21552. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  21553. for the accepted syntax.
  21554. By default the duration is determined by <var>nb_samples</var>.
  21555. If set this option is used instead of <var>nb_samples</var>.
  21556. </p>
  21557. </dd>
  21558. <dt><samp>overlap, o</samp></dt>
  21559. <dd><p>Should first stream end overlap with second stream start. Default is enabled.
  21560. </p>
  21561. </dd>
  21562. <dt><samp>curve1</samp></dt>
  21563. <dd><p>Set curve for cross fade transition for first stream.
  21564. </p>
  21565. </dd>
  21566. <dt><samp>curve2</samp></dt>
  21567. <dd><p>Set curve for cross fade transition for second stream.
  21568. </p>
  21569. <p>For description of available curve types see <a href="#afade">afade</a> filter description.
  21570. </p></dd>
  21571. </dl>
  21572. <a name="Examples-38"></a>
  21573. <h4 class="subsection">36.4.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-38" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-38" aria-hidden="true">TOC</a></span></h4>
  21574. <ul>
  21575. <li> Cross fade from one input to another:
  21576. <div class="example">
  21577. <pre class="example">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
  21578. </pre></div>
  21579. </li><li> Cross fade from one input to another but without overlapping:
  21580. <div class="example">
  21581. <pre class="example">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
  21582. </pre></div>
  21583. </li></ul>
  21584. <a name="acrossover"></a>
  21585. <h3 class="section">36.5 acrossover<span class="pull-right"><a class="anchor hidden-xs" href="#acrossover" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acrossover" aria-hidden="true">TOC</a></span></h3>
  21586. <p>Split audio stream into several bands.
  21587. </p>
  21588. <p>This filter splits audio stream into two or more frequency ranges.
  21589. Summing all streams back will give flat output.
  21590. </p>
  21591. <p>The filter accepts the following options:
  21592. </p>
  21593. <dl compact="compact">
  21594. <dt><samp>split</samp></dt>
  21595. <dd><p>Set split frequencies. Those must be positive and increasing.
  21596. </p>
  21597. </dd>
  21598. <dt><samp>order</samp></dt>
  21599. <dd><p>Set filter order for each band split. This controls filter roll-off or steepness
  21600. of filter transfer function.
  21601. Available values are:
  21602. </p>
  21603. <dl compact="compact">
  21604. <dt>&lsquo;<samp>2nd</samp>&rsquo;</dt>
  21605. <dd><p>12 dB per octave.
  21606. </p></dd>
  21607. <dt>&lsquo;<samp>4th</samp>&rsquo;</dt>
  21608. <dd><p>24 dB per octave.
  21609. </p></dd>
  21610. <dt>&lsquo;<samp>6th</samp>&rsquo;</dt>
  21611. <dd><p>36 dB per octave.
  21612. </p></dd>
  21613. <dt>&lsquo;<samp>8th</samp>&rsquo;</dt>
  21614. <dd><p>48 dB per octave.
  21615. </p></dd>
  21616. <dt>&lsquo;<samp>10th</samp>&rsquo;</dt>
  21617. <dd><p>60 dB per octave.
  21618. </p></dd>
  21619. <dt>&lsquo;<samp>12th</samp>&rsquo;</dt>
  21620. <dd><p>72 dB per octave.
  21621. </p></dd>
  21622. <dt>&lsquo;<samp>14th</samp>&rsquo;</dt>
  21623. <dd><p>84 dB per octave.
  21624. </p></dd>
  21625. <dt>&lsquo;<samp>16th</samp>&rsquo;</dt>
  21626. <dd><p>96 dB per octave.
  21627. </p></dd>
  21628. <dt>&lsquo;<samp>18th</samp>&rsquo;</dt>
  21629. <dd><p>108 dB per octave.
  21630. </p></dd>
  21631. <dt>&lsquo;<samp>20th</samp>&rsquo;</dt>
  21632. <dd><p>120 dB per octave.
  21633. </p></dd>
  21634. </dl>
  21635. <p>Default is <var>4th</var>.
  21636. </p>
  21637. </dd>
  21638. <dt><samp>level</samp></dt>
  21639. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  21640. </p>
  21641. </dd>
  21642. <dt><samp>gains</samp></dt>
  21643. <dd><p>Set output gain for each band. Default value is 1 for all bands.
  21644. </p></dd>
  21645. </dl>
  21646. <a name="Examples-39"></a>
  21647. <h4 class="subsection">36.5.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-39" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-39" aria-hidden="true">TOC</a></span></h4>
  21648. <ul>
  21649. <li> Split input audio stream into two bands (low and high) with split frequency of 1500 Hz,
  21650. each band will be in separate stream:
  21651. <div class="example">
  21652. <pre class="example">ffmpeg -i in.flac -filter_complex 'acrossover=split=1500[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
  21653. </pre></div>
  21654. </li><li> Same as above, but with higher filter order:
  21655. <div class="example">
  21656. <pre class="example">ffmpeg -i in.flac -filter_complex 'acrossover=split=1500:order=8th[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
  21657. </pre></div>
  21658. </li><li> Same as above, but also with additional middle band (frequencies between 1500 and 8000):
  21659. <div class="example">
  21660. <pre class="example">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
  21661. </pre></div>
  21662. </li></ul>
  21663. <a name="acrusher"></a>
  21664. <h3 class="section">36.6 acrusher<span class="pull-right"><a class="anchor hidden-xs" href="#acrusher" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acrusher" aria-hidden="true">TOC</a></span></h3>
  21665. <p>Reduce audio bit resolution.
  21666. </p>
  21667. <p>This filter is bit crusher with enhanced functionality. A bit crusher
  21668. is used to audibly reduce number of bits an audio signal is sampled
  21669. with. This doesn&rsquo;t change the bit depth at all, it just produces the
  21670. effect. Material reduced in bit depth sounds more harsh and &quot;digital&quot;.
  21671. This filter is able to even round to continuous values instead of discrete
  21672. bit depths.
  21673. Additionally it has a D/C offset which results in different crushing of
  21674. the lower and the upper half of the signal.
  21675. An Anti-Aliasing setting is able to produce &quot;softer&quot; crushing sounds.
  21676. </p>
  21677. <p>Another feature of this filter is the logarithmic mode.
  21678. This setting switches from linear distances between bits to logarithmic ones.
  21679. The result is a much more &quot;natural&quot; sounding crusher which doesn&rsquo;t gate low
  21680. signals for example. The human ear has a logarithmic perception,
  21681. so this kind of crushing is much more pleasant.
  21682. Logarithmic crushing is also able to get anti-aliased.
  21683. </p>
  21684. <p>The filter accepts the following options:
  21685. </p>
  21686. <dl compact="compact">
  21687. <dt><samp>level_in</samp></dt>
  21688. <dd><p>Set level in.
  21689. </p>
  21690. </dd>
  21691. <dt><samp>level_out</samp></dt>
  21692. <dd><p>Set level out.
  21693. </p>
  21694. </dd>
  21695. <dt><samp>bits</samp></dt>
  21696. <dd><p>Set bit reduction.
  21697. </p>
  21698. </dd>
  21699. <dt><samp>mix</samp></dt>
  21700. <dd><p>Set mixing amount.
  21701. </p>
  21702. </dd>
  21703. <dt><samp>mode</samp></dt>
  21704. <dd><p>Can be linear: <code>lin</code> or logarithmic: <code>log</code>.
  21705. </p>
  21706. </dd>
  21707. <dt><samp>dc</samp></dt>
  21708. <dd><p>Set DC.
  21709. </p>
  21710. </dd>
  21711. <dt><samp>aa</samp></dt>
  21712. <dd><p>Set anti-aliasing.
  21713. </p>
  21714. </dd>
  21715. <dt><samp>samples</samp></dt>
  21716. <dd><p>Set sample reduction.
  21717. </p>
  21718. </dd>
  21719. <dt><samp>lfo</samp></dt>
  21720. <dd><p>Enable LFO. By default disabled.
  21721. </p>
  21722. </dd>
  21723. <dt><samp>lforange</samp></dt>
  21724. <dd><p>Set LFO range.
  21725. </p>
  21726. </dd>
  21727. <dt><samp>lforate</samp></dt>
  21728. <dd><p>Set LFO rate.
  21729. </p></dd>
  21730. </dl>
  21731. <a name="Commands-1"></a>
  21732. <h4 class="subsection">36.6.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-1" aria-hidden="true">TOC</a></span></h4>
  21733. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  21734. </p>
  21735. <a name="acue"></a>
  21736. <h3 class="section">36.7 acue<span class="pull-right"><a class="anchor hidden-xs" href="#acue" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acue" aria-hidden="true">TOC</a></span></h3>
  21737. <p>Delay audio filtering until a given wallclock timestamp. See the <a href="#cue">cue</a>
  21738. filter.
  21739. </p>
  21740. <a name="adeclick"></a>
  21741. <h3 class="section">36.8 adeclick<span class="pull-right"><a class="anchor hidden-xs" href="#adeclick" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adeclick" aria-hidden="true">TOC</a></span></h3>
  21742. <p>Remove impulsive noise from input audio.
  21743. </p>
  21744. <p>Samples detected as impulsive noise are replaced by interpolated samples using
  21745. autoregressive modelling.
  21746. </p>
  21747. <dl compact="compact">
  21748. <dt><samp>window, w</samp></dt>
  21749. <dd><p>Set window size, in milliseconds. Allowed range is from <code>10</code> to
  21750. <code>100</code>. Default value is <code>55</code> milliseconds.
  21751. This sets size of window which will be processed at once.
  21752. </p>
  21753. </dd>
  21754. <dt><samp>overlap, o</samp></dt>
  21755. <dd><p>Set window overlap, in percentage of window size. Allowed range is from
  21756. <code>50</code> to <code>95</code>. Default value is <code>75</code> percent.
  21757. Setting this to a very high value increases impulsive noise removal but makes
  21758. whole process much slower.
  21759. </p>
  21760. </dd>
  21761. <dt><samp>arorder, a</samp></dt>
  21762. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  21763. <code>0</code> to <code>25</code>. Default value is <code>2</code> percent. This option also
  21764. controls quality of interpolated samples using neighbour good samples.
  21765. </p>
  21766. </dd>
  21767. <dt><samp>threshold, t</samp></dt>
  21768. <dd><p>Set threshold value. Allowed range is from <code>1</code> to <code>100</code>.
  21769. Default value is <code>2</code>.
  21770. This controls the strength of impulsive noise which is going to be removed.
  21771. The lower value, the more samples will be detected as impulsive noise.
  21772. </p>
  21773. </dd>
  21774. <dt><samp>burst, b</samp></dt>
  21775. <dd><p>Set burst fusion, in percentage of window size. Allowed range is <code>0</code> to
  21776. <code>10</code>. Default value is <code>2</code>.
  21777. If any two samples detected as noise are spaced less than this value then any
  21778. sample between those two samples will be also detected as noise.
  21779. </p>
  21780. </dd>
  21781. <dt><samp>method, m</samp></dt>
  21782. <dd><p>Set overlap method.
  21783. </p>
  21784. <p>It accepts the following values:
  21785. </p><dl compact="compact">
  21786. <dt><samp>add, a</samp></dt>
  21787. <dd><p>Select overlap-add method. Even not interpolated samples are slightly
  21788. changed with this method.
  21789. </p>
  21790. </dd>
  21791. <dt><samp>save, s</samp></dt>
  21792. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  21793. </p></dd>
  21794. </dl>
  21795. <p>Default value is <code>a</code>.
  21796. </p></dd>
  21797. </dl>
  21798. <a name="adeclip"></a>
  21799. <h3 class="section">36.9 adeclip<span class="pull-right"><a class="anchor hidden-xs" href="#adeclip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adeclip" aria-hidden="true">TOC</a></span></h3>
  21800. <p>Remove clipped samples from input audio.
  21801. </p>
  21802. <p>Samples detected as clipped are replaced by interpolated samples using
  21803. autoregressive modelling.
  21804. </p>
  21805. <dl compact="compact">
  21806. <dt><samp>window, w</samp></dt>
  21807. <dd><p>Set window size, in milliseconds. Allowed range is from <code>10</code> to <code>100</code>.
  21808. Default value is <code>55</code> milliseconds.
  21809. This sets size of window which will be processed at once.
  21810. </p>
  21811. </dd>
  21812. <dt><samp>overlap, o</samp></dt>
  21813. <dd><p>Set window overlap, in percentage of window size. Allowed range is from <code>50</code>
  21814. to <code>95</code>. Default value is <code>75</code> percent.
  21815. </p>
  21816. </dd>
  21817. <dt><samp>arorder, a</samp></dt>
  21818. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  21819. <code>0</code> to <code>25</code>. Default value is <code>8</code> percent. This option also controls
  21820. quality of interpolated samples using neighbour good samples.
  21821. </p>
  21822. </dd>
  21823. <dt><samp>threshold, t</samp></dt>
  21824. <dd><p>Set threshold value. Allowed range is from <code>1</code> to <code>100</code>.
  21825. Default value is <code>10</code>. Higher values make clip detection less aggressive.
  21826. </p>
  21827. </dd>
  21828. <dt><samp>hsize, n</samp></dt>
  21829. <dd><p>Set size of histogram used to detect clips. Allowed range is from <code>100</code> to <code>9999</code>.
  21830. Default value is <code>1000</code>. Higher values make clip detection less aggressive.
  21831. </p>
  21832. </dd>
  21833. <dt><samp>method, m</samp></dt>
  21834. <dd><p>Set overlap method.
  21835. </p>
  21836. <p>It accepts the following values:
  21837. </p><dl compact="compact">
  21838. <dt><samp>add, a</samp></dt>
  21839. <dd><p>Select overlap-add method. Even not interpolated samples are slightly changed
  21840. with this method.
  21841. </p>
  21842. </dd>
  21843. <dt><samp>save, s</samp></dt>
  21844. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  21845. </p></dd>
  21846. </dl>
  21847. <p>Default value is <code>a</code>.
  21848. </p></dd>
  21849. </dl>
  21850. <a name="adelay"></a>
  21851. <h3 class="section">36.10 adelay<span class="pull-right"><a class="anchor hidden-xs" href="#adelay" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adelay" aria-hidden="true">TOC</a></span></h3>
  21852. <p>Delay one or more audio channels.
  21853. </p>
  21854. <p>Samples in delayed channel are filled with silence.
  21855. </p>
  21856. <p>The filter accepts the following option:
  21857. </p>
  21858. <dl compact="compact">
  21859. <dt><samp>delays</samp></dt>
  21860. <dd><p>Set list of delays in milliseconds for each channel separated by &rsquo;|&rsquo;.
  21861. Unused delays will be silently ignored. If number of given delays is
  21862. smaller than number of channels all remaining channels will not be delayed.
  21863. If you want to delay exact number of samples, append &rsquo;S&rsquo; to number.
  21864. If you want instead to delay in seconds, append &rsquo;s&rsquo; to number.
  21865. </p>
  21866. </dd>
  21867. <dt><samp>all</samp></dt>
  21868. <dd><p>Use last set delay for all remaining channels. By default is disabled.
  21869. This option if enabled changes how option <code>delays</code> is interpreted.
  21870. </p></dd>
  21871. </dl>
  21872. <a name="Examples-40"></a>
  21873. <h4 class="subsection">36.10.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-40" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-40" aria-hidden="true">TOC</a></span></h4>
  21874. <ul>
  21875. <li> Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
  21876. the second channel (and any other channels that may be present) unchanged.
  21877. <div class="example">
  21878. <pre class="example">adelay=1500|0|500
  21879. </pre></div>
  21880. </li><li> Delay second channel by 500 samples, the third channel by 700 samples and leave
  21881. the first channel (and any other channels that may be present) unchanged.
  21882. <div class="example">
  21883. <pre class="example">adelay=0|500S|700S
  21884. </pre></div>
  21885. </li><li> Delay all channels by same number of samples:
  21886. <div class="example">
  21887. <pre class="example">adelay=delays=64S:all=1
  21888. </pre></div>
  21889. </li></ul>
  21890. <a name="adenorm"></a>
  21891. <h3 class="section">36.11 adenorm<span class="pull-right"><a class="anchor hidden-xs" href="#adenorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adenorm" aria-hidden="true">TOC</a></span></h3>
  21892. <p>Remedy denormals in audio by adding extremely low-level noise.
  21893. </p>
  21894. <p>This filter shall be placed before any filter that can produce denormals.
  21895. </p>
  21896. <p>A description of the accepted parameters follows.
  21897. </p>
  21898. <dl compact="compact">
  21899. <dt><samp>level</samp></dt>
  21900. <dd><p>Set level of added noise in dB. Default is <code>-351</code>.
  21901. Allowed range is from -451 to -90.
  21902. </p>
  21903. </dd>
  21904. <dt><samp>type</samp></dt>
  21905. <dd><p>Set type of added noise.
  21906. </p>
  21907. <dl compact="compact">
  21908. <dt><samp>dc</samp></dt>
  21909. <dd><p>Add DC signal.
  21910. </p></dd>
  21911. <dt><samp>ac</samp></dt>
  21912. <dd><p>Add AC signal.
  21913. </p></dd>
  21914. <dt><samp>square</samp></dt>
  21915. <dd><p>Add square signal.
  21916. </p></dd>
  21917. <dt><samp>pulse</samp></dt>
  21918. <dd><p>Add pulse signal.
  21919. </p></dd>
  21920. </dl>
  21921. <p>Default is <code>dc</code>.
  21922. </p></dd>
  21923. </dl>
  21924. <a name="Commands-2"></a>
  21925. <h4 class="subsection">36.11.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-2" aria-hidden="true">TOC</a></span></h4>
  21926. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  21927. </p>
  21928. <a name="aderivative_002c-aintegral"></a>
  21929. <h3 class="section">36.12 aderivative, aintegral<span class="pull-right"><a class="anchor hidden-xs" href="#aderivative_002c-aintegral" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aderivative_002c-aintegral" aria-hidden="true">TOC</a></span></h3>
  21930. <p>Compute derivative/integral of audio stream.
  21931. </p>
  21932. <p>Applying both filters one after another produces original audio.
  21933. </p>
  21934. <a name="aecho"></a>
  21935. <h3 class="section">36.13 aecho<span class="pull-right"><a class="anchor hidden-xs" href="#aecho" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aecho" aria-hidden="true">TOC</a></span></h3>
  21936. <p>Apply echoing to the input audio.
  21937. </p>
  21938. <p>Echoes are reflected sound and can occur naturally amongst mountains
  21939. (and sometimes large buildings) when talking or shouting; digital echo
  21940. effects emulate this behaviour and are often used to help fill out the
  21941. sound of a single instrument or vocal. The time difference between the
  21942. original signal and the reflection is the <code>delay</code>, and the
  21943. loudness of the reflected signal is the <code>decay</code>.
  21944. Multiple echoes can have different delays and decays.
  21945. </p>
  21946. <p>A description of the accepted parameters follows.
  21947. </p>
  21948. <dl compact="compact">
  21949. <dt><samp>in_gain</samp></dt>
  21950. <dd><p>Set input gain of reflected signal. Default is <code>0.6</code>.
  21951. </p>
  21952. </dd>
  21953. <dt><samp>out_gain</samp></dt>
  21954. <dd><p>Set output gain of reflected signal. Default is <code>0.3</code>.
  21955. </p>
  21956. </dd>
  21957. <dt><samp>delays</samp></dt>
  21958. <dd><p>Set list of time intervals in milliseconds between original signal and reflections
  21959. separated by &rsquo;|&rsquo;. Allowed range for each <code>delay</code> is <code>(0 - 90000.0]</code>.
  21960. Default is <code>1000</code>.
  21961. </p>
  21962. </dd>
  21963. <dt><samp>decays</samp></dt>
  21964. <dd><p>Set list of loudness of reflected signals separated by &rsquo;|&rsquo;.
  21965. Allowed range for each <code>decay</code> is <code>(0 - 1.0]</code>.
  21966. Default is <code>0.5</code>.
  21967. </p></dd>
  21968. </dl>
  21969. <a name="Examples-41"></a>
  21970. <h4 class="subsection">36.13.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-41" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-41" aria-hidden="true">TOC</a></span></h4>
  21971. <ul>
  21972. <li> Make it sound as if there are twice as many instruments as are actually playing:
  21973. <div class="example">
  21974. <pre class="example">aecho=0.8:0.88:60:0.4
  21975. </pre></div>
  21976. </li><li> If delay is very short, then it sounds like a (metallic) robot playing music:
  21977. <div class="example">
  21978. <pre class="example">aecho=0.8:0.88:6:0.4
  21979. </pre></div>
  21980. </li><li> A longer delay will sound like an open air concert in the mountains:
  21981. <div class="example">
  21982. <pre class="example">aecho=0.8:0.9:1000:0.3
  21983. </pre></div>
  21984. </li><li> Same as above but with one more mountain:
  21985. <div class="example">
  21986. <pre class="example">aecho=0.8:0.9:1000|1800:0.3|0.25
  21987. </pre></div>
  21988. </li></ul>
  21989. <a name="aemphasis"></a>
  21990. <h3 class="section">36.14 aemphasis<span class="pull-right"><a class="anchor hidden-xs" href="#aemphasis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aemphasis" aria-hidden="true">TOC</a></span></h3>
  21991. <p>Audio emphasis filter creates or restores material directly taken from LPs or
  21992. emphased CDs with different filter curves. E.g. to store music on vinyl the
  21993. signal has to be altered by a filter first to even out the disadvantages of
  21994. this recording medium.
  21995. Once the material is played back the inverse filter has to be applied to
  21996. restore the distortion of the frequency response.
  21997. </p>
  21998. <p>The filter accepts the following options:
  21999. </p>
  22000. <dl compact="compact">
  22001. <dt><samp>level_in</samp></dt>
  22002. <dd><p>Set input gain.
  22003. </p>
  22004. </dd>
  22005. <dt><samp>level_out</samp></dt>
  22006. <dd><p>Set output gain.
  22007. </p>
  22008. </dd>
  22009. <dt><samp>mode</samp></dt>
  22010. <dd><p>Set filter mode. For restoring material use <code>reproduction</code> mode, otherwise
  22011. use <code>production</code> mode. Default is <code>reproduction</code> mode.
  22012. </p>
  22013. </dd>
  22014. <dt><samp>type</samp></dt>
  22015. <dd><p>Set filter type. Selects medium. Can be one of the following:
  22016. </p>
  22017. <dl compact="compact">
  22018. <dt><samp>col</samp></dt>
  22019. <dd><p>select Columbia.
  22020. </p></dd>
  22021. <dt><samp>emi</samp></dt>
  22022. <dd><p>select EMI.
  22023. </p></dd>
  22024. <dt><samp>bsi</samp></dt>
  22025. <dd><p>select BSI (78RPM).
  22026. </p></dd>
  22027. <dt><samp>riaa</samp></dt>
  22028. <dd><p>select RIAA.
  22029. </p></dd>
  22030. <dt><samp>cd</samp></dt>
  22031. <dd><p>select Compact Disc (CD).
  22032. </p></dd>
  22033. <dt><samp>50fm</samp></dt>
  22034. <dd><p>select 50µs (FM).
  22035. </p></dd>
  22036. <dt><samp>75fm</samp></dt>
  22037. <dd><p>select 75µs (FM).
  22038. </p></dd>
  22039. <dt><samp>50kf</samp></dt>
  22040. <dd><p>select 50µs (FM-KF).
  22041. </p></dd>
  22042. <dt><samp>75kf</samp></dt>
  22043. <dd><p>select 75µs (FM-KF).
  22044. </p></dd>
  22045. </dl>
  22046. </dd>
  22047. </dl>
  22048. <a name="Commands-3"></a>
  22049. <h4 class="subsection">36.14.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-3" aria-hidden="true">TOC</a></span></h4>
  22050. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  22051. </p>
  22052. <a name="aeval"></a>
  22053. <h3 class="section">36.15 aeval<span class="pull-right"><a class="anchor hidden-xs" href="#aeval" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aeval" aria-hidden="true">TOC</a></span></h3>
  22054. <p>Modify an audio signal according to the specified expressions.
  22055. </p>
  22056. <p>This filter accepts one or more expressions (one for each channel),
  22057. which are evaluated and used to modify a corresponding audio signal.
  22058. </p>
  22059. <p>It accepts the following parameters:
  22060. </p>
  22061. <dl compact="compact">
  22062. <dt><samp>exprs</samp></dt>
  22063. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. If
  22064. the number of input channels is greater than the number of
  22065. expressions, the last specified expression is used for the remaining
  22066. output channels.
  22067. </p>
  22068. </dd>
  22069. <dt><samp>channel_layout, c</samp></dt>
  22070. <dd><p>Set output channel layout. If not specified, the channel layout is
  22071. specified by the number of expressions. If set to &lsquo;<samp>same</samp>&rsquo;, it will
  22072. use by default the same input channel layout.
  22073. </p></dd>
  22074. </dl>
  22075. <p>Each expression in <var>exprs</var> can contain the following constants and functions:
  22076. </p>
  22077. <dl compact="compact">
  22078. <dt><samp>ch</samp></dt>
  22079. <dd><p>channel number of the current expression
  22080. </p>
  22081. </dd>
  22082. <dt><samp>n</samp></dt>
  22083. <dd><p>number of the evaluated sample, starting from 0
  22084. </p>
  22085. </dd>
  22086. <dt><samp>s</samp></dt>
  22087. <dd><p>sample rate
  22088. </p>
  22089. </dd>
  22090. <dt><samp>t</samp></dt>
  22091. <dd><p>time of the evaluated sample expressed in seconds
  22092. </p>
  22093. </dd>
  22094. <dt><samp>nb_in_channels</samp></dt>
  22095. <dt><samp>nb_out_channels</samp></dt>
  22096. <dd><p>input and output number of channels
  22097. </p>
  22098. </dd>
  22099. <dt><samp>val(CH)</samp></dt>
  22100. <dd><p>the value of input channel with number <var>CH</var>
  22101. </p></dd>
  22102. </dl>
  22103. <p>Note: this filter is slow. For faster processing you should use a
  22104. dedicated filter.
  22105. </p>
  22106. <a name="Examples-42"></a>
  22107. <h4 class="subsection">36.15.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-42" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-42" aria-hidden="true">TOC</a></span></h4>
  22108. <ul>
  22109. <li> Half volume:
  22110. <div class="example">
  22111. <pre class="example">aeval=val(ch)/2:c=same
  22112. </pre></div>
  22113. </li><li> Invert phase of the second channel:
  22114. <div class="example">
  22115. <pre class="example">aeval=val(0)|-val(1)
  22116. </pre></div>
  22117. </li></ul>
  22118. <a name="aexciter"></a>
  22119. <h3 class="section">36.16 aexciter<span class="pull-right"><a class="anchor hidden-xs" href="#aexciter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aexciter" aria-hidden="true">TOC</a></span></h3>
  22120. <p>An exciter is used to produce high sound that is not present in the
  22121. original signal. This is done by creating harmonic distortions of the
  22122. signal which are restricted in range and added to the original signal.
  22123. An Exciter raises the upper end of an audio signal without simply raising
  22124. the higher frequencies like an equalizer would do to create a more
  22125. &quot;crisp&quot; or &quot;brilliant&quot; sound.
  22126. </p>
  22127. <p>The filter accepts the following options:
  22128. </p>
  22129. <dl compact="compact">
  22130. <dt><samp>level_in</samp></dt>
  22131. <dd><p>Set input level prior processing of signal.
  22132. Allowed range is from 0 to 64.
  22133. Default value is 1.
  22134. </p>
  22135. </dd>
  22136. <dt><samp>level_out</samp></dt>
  22137. <dd><p>Set output level after processing of signal.
  22138. Allowed range is from 0 to 64.
  22139. Default value is 1.
  22140. </p>
  22141. </dd>
  22142. <dt><samp>amount</samp></dt>
  22143. <dd><p>Set the amount of harmonics added to original signal.
  22144. Allowed range is from 0 to 64.
  22145. Default value is 1.
  22146. </p>
  22147. </dd>
  22148. <dt><samp>drive</samp></dt>
  22149. <dd><p>Set the amount of newly created harmonics.
  22150. Allowed range is from 0.1 to 10.
  22151. Default value is 8.5.
  22152. </p>
  22153. </dd>
  22154. <dt><samp>blend</samp></dt>
  22155. <dd><p>Set the octave of newly created harmonics.
  22156. Allowed range is from -10 to 10.
  22157. Default value is 0.
  22158. </p>
  22159. </dd>
  22160. <dt><samp>freq</samp></dt>
  22161. <dd><p>Set the lower frequency limit of producing harmonics in Hz.
  22162. Allowed range is from 2000 to 12000 Hz.
  22163. Default is 7500 Hz.
  22164. </p>
  22165. </dd>
  22166. <dt><samp>ceil</samp></dt>
  22167. <dd><p>Set the upper frequency limit of producing harmonics.
  22168. Allowed range is from 9999 to 20000 Hz.
  22169. If value is lower than 10000 Hz no limit is applied.
  22170. </p>
  22171. </dd>
  22172. <dt><samp>listen</samp></dt>
  22173. <dd><p>Mute the original signal and output only added harmonics.
  22174. By default is disabled.
  22175. </p></dd>
  22176. </dl>
  22177. <a name="Commands-4"></a>
  22178. <h4 class="subsection">36.16.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-4" aria-hidden="true">TOC</a></span></h4>
  22179. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  22180. </p>
  22181. <span id="afade"></span><a name="afade-1"></a>
  22182. <h3 class="section">36.17 afade<span class="pull-right"><a class="anchor hidden-xs" href="#afade-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afade-1" aria-hidden="true">TOC</a></span></h3>
  22183. <p>Apply fade-in/out effect to input audio.
  22184. </p>
  22185. <p>A description of the accepted parameters follows.
  22186. </p>
  22187. <dl compact="compact">
  22188. <dt><samp>type, t</samp></dt>
  22189. <dd><p>Specify the effect type, can be either <code>in</code> for fade-in, or
  22190. <code>out</code> for a fade-out effect. Default is <code>in</code>.
  22191. </p>
  22192. </dd>
  22193. <dt><samp>start_sample, ss</samp></dt>
  22194. <dd><p>Specify the number of the start sample for starting to apply the fade
  22195. effect. Default is 0.
  22196. </p>
  22197. </dd>
  22198. <dt><samp>nb_samples, ns</samp></dt>
  22199. <dd><p>Specify the number of samples for which the fade effect has to last. At
  22200. the end of the fade-in effect the output audio will have the same
  22201. volume as the input audio, at the end of the fade-out transition
  22202. the output audio will be silence. Default is 44100.
  22203. </p>
  22204. </dd>
  22205. <dt><samp>start_time, st</samp></dt>
  22206. <dd><p>Specify the start time of the fade effect. Default is 0.
  22207. The value must be specified as a time duration; see
  22208. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  22209. for the accepted syntax.
  22210. If set this option is used instead of <var>start_sample</var>.
  22211. </p>
  22212. </dd>
  22213. <dt><samp>duration, d</samp></dt>
  22214. <dd><p>Specify the duration of the fade effect. See
  22215. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  22216. for the accepted syntax.
  22217. At the end of the fade-in effect the output audio will have the same
  22218. volume as the input audio, at the end of the fade-out transition
  22219. the output audio will be silence.
  22220. By default the duration is determined by <var>nb_samples</var>.
  22221. If set this option is used instead of <var>nb_samples</var>.
  22222. </p>
  22223. </dd>
  22224. <dt><samp>curve</samp></dt>
  22225. <dd><p>Set curve for fade transition.
  22226. </p>
  22227. <p>It accepts the following values:
  22228. </p><dl compact="compact">
  22229. <dt><samp>tri</samp></dt>
  22230. <dd><p>select triangular, linear slope (default)
  22231. </p></dd>
  22232. <dt><samp>qsin</samp></dt>
  22233. <dd><p>select quarter of sine wave
  22234. </p></dd>
  22235. <dt><samp>hsin</samp></dt>
  22236. <dd><p>select half of sine wave
  22237. </p></dd>
  22238. <dt><samp>esin</samp></dt>
  22239. <dd><p>select exponential sine wave
  22240. </p></dd>
  22241. <dt><samp>log</samp></dt>
  22242. <dd><p>select logarithmic
  22243. </p></dd>
  22244. <dt><samp>ipar</samp></dt>
  22245. <dd><p>select inverted parabola
  22246. </p></dd>
  22247. <dt><samp>qua</samp></dt>
  22248. <dd><p>select quadratic
  22249. </p></dd>
  22250. <dt><samp>cub</samp></dt>
  22251. <dd><p>select cubic
  22252. </p></dd>
  22253. <dt><samp>squ</samp></dt>
  22254. <dd><p>select square root
  22255. </p></dd>
  22256. <dt><samp>cbr</samp></dt>
  22257. <dd><p>select cubic root
  22258. </p></dd>
  22259. <dt><samp>par</samp></dt>
  22260. <dd><p>select parabola
  22261. </p></dd>
  22262. <dt><samp>exp</samp></dt>
  22263. <dd><p>select exponential
  22264. </p></dd>
  22265. <dt><samp>iqsin</samp></dt>
  22266. <dd><p>select inverted quarter of sine wave
  22267. </p></dd>
  22268. <dt><samp>ihsin</samp></dt>
  22269. <dd><p>select inverted half of sine wave
  22270. </p></dd>
  22271. <dt><samp>dese</samp></dt>
  22272. <dd><p>select double-exponential seat
  22273. </p></dd>
  22274. <dt><samp>desi</samp></dt>
  22275. <dd><p>select double-exponential sigmoid
  22276. </p></dd>
  22277. <dt><samp>losi</samp></dt>
  22278. <dd><p>select logistic sigmoid
  22279. </p></dd>
  22280. <dt><samp>sinc</samp></dt>
  22281. <dd><p>select sine cardinal function
  22282. </p></dd>
  22283. <dt><samp>isinc</samp></dt>
  22284. <dd><p>select inverted sine cardinal function
  22285. </p></dd>
  22286. <dt><samp>nofade</samp></dt>
  22287. <dd><p>no fade applied
  22288. </p></dd>
  22289. </dl>
  22290. </dd>
  22291. </dl>
  22292. <a name="Commands-5"></a>
  22293. <h4 class="subsection">36.17.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-5" aria-hidden="true">TOC</a></span></h4>
  22294. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  22295. </p>
  22296. <a name="Examples-43"></a>
  22297. <h4 class="subsection">36.17.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-43" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-43" aria-hidden="true">TOC</a></span></h4>
  22298. <ul>
  22299. <li> Fade in first 15 seconds of audio:
  22300. <div class="example">
  22301. <pre class="example">afade=t=in:ss=0:d=15
  22302. </pre></div>
  22303. </li><li> Fade out last 25 seconds of a 900 seconds audio:
  22304. <div class="example">
  22305. <pre class="example">afade=t=out:st=875:d=25
  22306. </pre></div>
  22307. </li></ul>
  22308. <a name="afftdn"></a>
  22309. <h3 class="section">36.18 afftdn<span class="pull-right"><a class="anchor hidden-xs" href="#afftdn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afftdn" aria-hidden="true">TOC</a></span></h3>
  22310. <p>Denoise audio samples with FFT.
  22311. </p>
  22312. <p>A description of the accepted parameters follows.
  22313. </p>
  22314. <dl compact="compact">
  22315. <dt><samp>nr</samp></dt>
  22316. <dd><p>Set the noise reduction in dB, allowed range is 0.01 to 97.
  22317. Default value is 12 dB.
  22318. </p>
  22319. </dd>
  22320. <dt><samp>nf</samp></dt>
  22321. <dd><p>Set the noise floor in dB, allowed range is -80 to -20.
  22322. Default value is -50 dB.
  22323. </p>
  22324. </dd>
  22325. <dt><samp>nt</samp></dt>
  22326. <dd><p>Set the noise type.
  22327. </p>
  22328. <p>It accepts the following values:
  22329. </p><dl compact="compact">
  22330. <dt><samp>w</samp></dt>
  22331. <dd><p>Select white noise.
  22332. </p>
  22333. </dd>
  22334. <dt><samp>v</samp></dt>
  22335. <dd><p>Select vinyl noise.
  22336. </p>
  22337. </dd>
  22338. <dt><samp>s</samp></dt>
  22339. <dd><p>Select shellac noise.
  22340. </p>
  22341. </dd>
  22342. <dt><samp>c</samp></dt>
  22343. <dd><p>Select custom noise, defined in <code>bn</code> option.
  22344. </p>
  22345. <p>Default value is white noise.
  22346. </p></dd>
  22347. </dl>
  22348. </dd>
  22349. <dt><samp>bn</samp></dt>
  22350. <dd><p>Set custom band noise for every one of 15 bands.
  22351. Bands are separated by &rsquo; &rsquo; or &rsquo;|&rsquo;.
  22352. </p>
  22353. </dd>
  22354. <dt><samp>rf</samp></dt>
  22355. <dd><p>Set the residual floor in dB, allowed range is -80 to -20.
  22356. Default value is -38 dB.
  22357. </p>
  22358. </dd>
  22359. <dt><samp>tn</samp></dt>
  22360. <dd><p>Enable noise tracking. By default is disabled.
  22361. With this enabled, noise floor is automatically adjusted.
  22362. </p>
  22363. </dd>
  22364. <dt><samp>tr</samp></dt>
  22365. <dd><p>Enable residual tracking. By default is disabled.
  22366. </p>
  22367. </dd>
  22368. <dt><samp>om</samp></dt>
  22369. <dd><p>Set the output mode.
  22370. </p>
  22371. <p>It accepts the following values:
  22372. </p><dl compact="compact">
  22373. <dt><samp>i</samp></dt>
  22374. <dd><p>Pass input unchanged.
  22375. </p>
  22376. </dd>
  22377. <dt><samp>o</samp></dt>
  22378. <dd><p>Pass noise filtered out.
  22379. </p>
  22380. </dd>
  22381. <dt><samp>n</samp></dt>
  22382. <dd><p>Pass only noise.
  22383. </p>
  22384. <p>Default value is <var>o</var>.
  22385. </p></dd>
  22386. </dl>
  22387. </dd>
  22388. </dl>
  22389. <a name="Commands-6"></a>
  22390. <h4 class="subsection">36.18.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-6" aria-hidden="true">TOC</a></span></h4>
  22391. <p>This filter supports the following commands:
  22392. </p><dl compact="compact">
  22393. <dt><samp>sample_noise, sn</samp></dt>
  22394. <dd><p>Start or stop measuring noise profile.
  22395. Syntax for the command is : &quot;start&quot; or &quot;stop&quot; string.
  22396. After measuring noise profile is stopped it will be
  22397. automatically applied in filtering.
  22398. </p>
  22399. </dd>
  22400. <dt><samp>noise_reduction, nr</samp></dt>
  22401. <dd><p>Change noise reduction. Argument is single float number.
  22402. Syntax for the command is : &quot;<var>noise_reduction</var>&quot;
  22403. </p>
  22404. </dd>
  22405. <dt><samp>noise_floor, nf</samp></dt>
  22406. <dd><p>Change noise floor. Argument is single float number.
  22407. Syntax for the command is : &quot;<var>noise_floor</var>&quot;
  22408. </p>
  22409. </dd>
  22410. <dt><samp>output_mode, om</samp></dt>
  22411. <dd><p>Change output mode operation.
  22412. Syntax for the command is : &quot;i&quot;, &quot;o&quot; or &quot;n&quot; string.
  22413. </p></dd>
  22414. </dl>
  22415. <a name="afftfilt"></a>
  22416. <h3 class="section">36.19 afftfilt<span class="pull-right"><a class="anchor hidden-xs" href="#afftfilt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afftfilt" aria-hidden="true">TOC</a></span></h3>
  22417. <p>Apply arbitrary expressions to samples in frequency domain.
  22418. </p>
  22419. <dl compact="compact">
  22420. <dt><samp>real</samp></dt>
  22421. <dd><p>Set frequency domain real expression for each separate channel separated
  22422. by &rsquo;|&rsquo;. Default is &quot;re&quot;.
  22423. If the number of input channels is greater than the number of
  22424. expressions, the last specified expression is used for the remaining
  22425. output channels.
  22426. </p>
  22427. </dd>
  22428. <dt><samp>imag</samp></dt>
  22429. <dd><p>Set frequency domain imaginary expression for each separate channel
  22430. separated by &rsquo;|&rsquo;. Default is &quot;im&quot;.
  22431. </p>
  22432. <p>Each expression in <var>real</var> and <var>imag</var> can contain the following
  22433. constants and functions:
  22434. </p>
  22435. <dl compact="compact">
  22436. <dt><samp>sr</samp></dt>
  22437. <dd><p>sample rate
  22438. </p>
  22439. </dd>
  22440. <dt><samp>b</samp></dt>
  22441. <dd><p>current frequency bin number
  22442. </p>
  22443. </dd>
  22444. <dt><samp>nb</samp></dt>
  22445. <dd><p>number of available bins
  22446. </p>
  22447. </dd>
  22448. <dt><samp>ch</samp></dt>
  22449. <dd><p>channel number of the current expression
  22450. </p>
  22451. </dd>
  22452. <dt><samp>chs</samp></dt>
  22453. <dd><p>number of channels
  22454. </p>
  22455. </dd>
  22456. <dt><samp>pts</samp></dt>
  22457. <dd><p>current frame pts
  22458. </p>
  22459. </dd>
  22460. <dt><samp>re</samp></dt>
  22461. <dd><p>current real part of frequency bin of current channel
  22462. </p>
  22463. </dd>
  22464. <dt><samp>im</samp></dt>
  22465. <dd><p>current imaginary part of frequency bin of current channel
  22466. </p>
  22467. </dd>
  22468. <dt><samp>real(b, ch)</samp></dt>
  22469. <dd><p>Return the value of real part of frequency bin at location (<var>bin</var>,<var>channel</var>)
  22470. </p>
  22471. </dd>
  22472. <dt><samp>imag(b, ch)</samp></dt>
  22473. <dd><p>Return the value of imaginary part of frequency bin at location (<var>bin</var>,<var>channel</var>)
  22474. </p></dd>
  22475. </dl>
  22476. </dd>
  22477. <dt><samp>win_size</samp></dt>
  22478. <dd><p>Set window size. Allowed range is from 16 to 131072.
  22479. Default is <code>4096</code>
  22480. </p>
  22481. </dd>
  22482. <dt><samp>win_func</samp></dt>
  22483. <dd><p>Set window function. Default is <code>hann</code>.
  22484. </p>
  22485. </dd>
  22486. <dt><samp>overlap</samp></dt>
  22487. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  22488. window function will be picked. Default is <code>0.75</code>.
  22489. </p></dd>
  22490. </dl>
  22491. <a name="Examples-44"></a>
  22492. <h4 class="subsection">36.19.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-44" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-44" aria-hidden="true">TOC</a></span></h4>
  22493. <ul>
  22494. <li> Leave almost only low frequencies in audio:
  22495. <div class="example">
  22496. <pre class="example">afftfilt=&quot;'real=re * (1-clip((b/nb)*b,0,1))':imag='im * (1-clip((b/nb)*b,0,1))'&quot;
  22497. </pre></div>
  22498. </li><li> Apply robotize effect:
  22499. <div class="example">
  22500. <pre class="example">afftfilt=&quot;real='hypot(re,im)*sin(0)':imag='hypot(re,im)*cos(0)':win_size=512:overlap=0.75&quot;
  22501. </pre></div>
  22502. </li><li> Apply whisper effect:
  22503. <div class="example">
  22504. <pre class="example">afftfilt=&quot;real='hypot(re,im)*cos((random(0)*2-1)*2*3.14)':imag='hypot(re,im)*sin((random(1)*2-1)*2*3.14)':win_size=128:overlap=0.8&quot;
  22505. </pre></div>
  22506. </li></ul>
  22507. <span id="afir"></span><a name="afir-1"></a>
  22508. <h3 class="section">36.20 afir<span class="pull-right"><a class="anchor hidden-xs" href="#afir-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afir-1" aria-hidden="true">TOC</a></span></h3>
  22509. <p>Apply an arbitrary Finite Impulse Response filter.
  22510. </p>
  22511. <p>This filter is designed for applying long FIR filters,
  22512. up to 60 seconds long.
  22513. </p>
  22514. <p>It can be used as component for digital crossover filters,
  22515. room equalization, cross talk cancellation, wavefield synthesis,
  22516. auralization, ambiophonics, ambisonics and spatialization.
  22517. </p>
  22518. <p>This filter uses the streams higher than first one as FIR coefficients.
  22519. If the non-first stream holds a single channel, it will be used
  22520. for all input channels in the first stream, otherwise
  22521. the number of channels in the non-first stream must be same as
  22522. the number of channels in the first stream.
  22523. </p>
  22524. <p>It accepts the following parameters:
  22525. </p>
  22526. <dl compact="compact">
  22527. <dt><samp>dry</samp></dt>
  22528. <dd><p>Set dry gain. This sets input gain.
  22529. </p>
  22530. </dd>
  22531. <dt><samp>wet</samp></dt>
  22532. <dd><p>Set wet gain. This sets final output gain.
  22533. </p>
  22534. </dd>
  22535. <dt><samp>length</samp></dt>
  22536. <dd><p>Set Impulse Response filter length. Default is 1, which means whole IR is processed.
  22537. </p>
  22538. </dd>
  22539. <dt><samp>gtype</samp></dt>
  22540. <dd><p>Enable applying gain measured from power of IR.
  22541. </p>
  22542. <p>Set which approach to use for auto gain measurement.
  22543. </p>
  22544. <dl compact="compact">
  22545. <dt><samp>none</samp></dt>
  22546. <dd><p>Do not apply any gain.
  22547. </p>
  22548. </dd>
  22549. <dt><samp>peak</samp></dt>
  22550. <dd><p>select peak gain, very conservative approach. This is default value.
  22551. </p>
  22552. </dd>
  22553. <dt><samp>dc</samp></dt>
  22554. <dd><p>select DC gain, limited application.
  22555. </p>
  22556. </dd>
  22557. <dt><samp>gn</samp></dt>
  22558. <dd><p>select gain to noise approach, this is most popular one.
  22559. </p></dd>
  22560. </dl>
  22561. </dd>
  22562. <dt><samp>irgain</samp></dt>
  22563. <dd><p>Set gain to be applied to IR coefficients before filtering.
  22564. Allowed range is 0 to 1. This gain is applied after any gain applied with <var>gtype</var> option.
  22565. </p>
  22566. </dd>
  22567. <dt><samp>irfmt</samp></dt>
  22568. <dd><p>Set format of IR stream. Can be <code>mono</code> or <code>input</code>.
  22569. Default is <code>input</code>.
  22570. </p>
  22571. </dd>
  22572. <dt><samp>maxir</samp></dt>
  22573. <dd><p>Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds.
  22574. Allowed range is 0.1 to 60 seconds.
  22575. </p>
  22576. </dd>
  22577. <dt><samp>response</samp></dt>
  22578. <dd><p>Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream.
  22579. By default it is disabled.
  22580. </p>
  22581. </dd>
  22582. <dt><samp>channel</samp></dt>
  22583. <dd><p>Set for which IR channel to display frequency response. By default is first channel
  22584. displayed. This option is used only when <var>response</var> is enabled.
  22585. </p>
  22586. </dd>
  22587. <dt><samp>size</samp></dt>
  22588. <dd><p>Set video stream size. This option is used only when <var>response</var> is enabled.
  22589. </p>
  22590. </dd>
  22591. <dt><samp>rate</samp></dt>
  22592. <dd><p>Set video stream frame rate. This option is used only when <var>response</var> is enabled.
  22593. </p>
  22594. </dd>
  22595. <dt><samp>minp</samp></dt>
  22596. <dd><p>Set minimal partition size used for convolution. Default is <var>8192</var>.
  22597. Allowed range is from <var>1</var> to <var>32768</var>.
  22598. Lower values decreases latency at cost of higher CPU usage.
  22599. </p>
  22600. </dd>
  22601. <dt><samp>maxp</samp></dt>
  22602. <dd><p>Set maximal partition size used for convolution. Default is <var>8192</var>.
  22603. Allowed range is from <var>8</var> to <var>32768</var>.
  22604. Lower values may increase CPU usage.
  22605. </p>
  22606. </dd>
  22607. <dt><samp>nbirs</samp></dt>
  22608. <dd><p>Set number of input impulse responses streams which will be switchable at runtime.
  22609. Allowed range is from <var>1</var> to <var>32</var>. Default is <var>1</var>.
  22610. </p>
  22611. </dd>
  22612. <dt><samp>ir</samp></dt>
  22613. <dd><p>Set IR stream which will be used for convolution, starting from <var>0</var>, should always be
  22614. lower than supplied value by <code>nbirs</code> option. Default is <var>0</var>.
  22615. This option can be changed at runtime via <a href="#commands">commands</a>.
  22616. </p></dd>
  22617. </dl>
  22618. <a name="Examples-45"></a>
  22619. <h4 class="subsection">36.20.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-45" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-45" aria-hidden="true">TOC</a></span></h4>
  22620. <ul>
  22621. <li> Apply reverb to stream using mono IR file as second input, complete command using ffmpeg:
  22622. <div class="example">
  22623. <pre class="example">ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
  22624. </pre></div>
  22625. </li></ul>
  22626. <span id="aformat"></span><a name="aformat-1"></a>
  22627. <h3 class="section">36.21 aformat<span class="pull-right"><a class="anchor hidden-xs" href="#aformat-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aformat-1" aria-hidden="true">TOC</a></span></h3>
  22628. <p>Set output format constraints for the input audio. The framework will
  22629. negotiate the most appropriate format to minimize conversions.
  22630. </p>
  22631. <p>It accepts the following parameters:
  22632. </p><dl compact="compact">
  22633. <dt><samp>sample_fmts, f</samp></dt>
  22634. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample formats.
  22635. </p>
  22636. </dd>
  22637. <dt><samp>sample_rates, r</samp></dt>
  22638. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample rates.
  22639. </p>
  22640. </dd>
  22641. <dt><samp>channel_layouts, cl</samp></dt>
  22642. <dd><p>A &rsquo;|&rsquo;-separated list of requested channel layouts.
  22643. </p>
  22644. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  22645. for the required syntax.
  22646. </p></dd>
  22647. </dl>
  22648. <p>If a parameter is omitted, all values are allowed.
  22649. </p>
  22650. <p>Force the output to either unsigned 8-bit or signed 16-bit stereo
  22651. </p><div class="example">
  22652. <pre class="example">aformat=sample_fmts=u8|s16:channel_layouts=stereo
  22653. </pre></div>
  22654. <a name="afreqshift"></a>
  22655. <h3 class="section">36.22 afreqshift<span class="pull-right"><a class="anchor hidden-xs" href="#afreqshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afreqshift" aria-hidden="true">TOC</a></span></h3>
  22656. <p>Apply frequency shift to input audio samples.
  22657. </p>
  22658. <p>The filter accepts the following options:
  22659. </p>
  22660. <dl compact="compact">
  22661. <dt><samp>shift</samp></dt>
  22662. <dd><p>Specify frequency shift. Allowed range is -INT_MAX to INT_MAX.
  22663. Default value is 0.0.
  22664. </p>
  22665. </dd>
  22666. <dt><samp>level</samp></dt>
  22667. <dd><p>Set output gain applied to final output. Allowed range is from 0.0 to 1.0.
  22668. Default value is 1.0.
  22669. </p></dd>
  22670. </dl>
  22671. <a name="Commands-7"></a>
  22672. <h4 class="subsection">36.22.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-7" aria-hidden="true">TOC</a></span></h4>
  22673. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  22674. </p>
  22675. <a name="agate"></a>
  22676. <h3 class="section">36.23 agate<span class="pull-right"><a class="anchor hidden-xs" href="#agate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-agate" aria-hidden="true">TOC</a></span></h3>
  22677. <p>A gate is mainly used to reduce lower parts of a signal. This kind of signal
  22678. processing reduces disturbing noise between useful signals.
  22679. </p>
  22680. <p>Gating is done by detecting the volume below a chosen level <var>threshold</var>
  22681. and dividing it by the factor set with <var>ratio</var>. The bottom of the noise
  22682. floor is set via <var>range</var>. Because an exact manipulation of the signal
  22683. would cause distortion of the waveform the reduction can be levelled over
  22684. time. This is done by setting <var>attack</var> and <var>release</var>.
  22685. </p>
  22686. <p><var>attack</var> determines how long the signal has to fall below the threshold
  22687. before any reduction will occur and <var>release</var> sets the time the signal
  22688. has to rise above the threshold to reduce the reduction again.
  22689. Shorter signals than the chosen attack time will be left untouched.
  22690. </p>
  22691. <dl compact="compact">
  22692. <dt><samp>level_in</samp></dt>
  22693. <dd><p>Set input level before filtering.
  22694. Default is 1. Allowed range is from 0.015625 to 64.
  22695. </p>
  22696. </dd>
  22697. <dt><samp>mode</samp></dt>
  22698. <dd><p>Set the mode of operation. Can be <code>upward</code> or <code>downward</code>.
  22699. Default is <code>downward</code>. If set to <code>upward</code> mode, higher parts of signal
  22700. will be amplified, expanding dynamic range in upward direction.
  22701. Otherwise, in case of <code>downward</code> lower parts of signal will be reduced.
  22702. </p>
  22703. </dd>
  22704. <dt><samp>range</samp></dt>
  22705. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  22706. Default is 0.06125. Allowed range is from 0 to 1.
  22707. Setting this to 0 disables reduction and then filter behaves like expander.
  22708. </p>
  22709. </dd>
  22710. <dt><samp>threshold</samp></dt>
  22711. <dd><p>If a signal rises above this level the gain reduction is released.
  22712. Default is 0.125. Allowed range is from 0 to 1.
  22713. </p>
  22714. </dd>
  22715. <dt><samp>ratio</samp></dt>
  22716. <dd><p>Set a ratio by which the signal is reduced.
  22717. Default is 2. Allowed range is from 1 to 9000.
  22718. </p>
  22719. </dd>
  22720. <dt><samp>attack</samp></dt>
  22721. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  22722. reduction stops.
  22723. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  22724. </p>
  22725. </dd>
  22726. <dt><samp>release</samp></dt>
  22727. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  22728. reduction is increased again. Default is 250 milliseconds.
  22729. Allowed range is from 0.01 to 9000.
  22730. </p>
  22731. </dd>
  22732. <dt><samp>makeup</samp></dt>
  22733. <dd><p>Set amount of amplification of signal after processing.
  22734. Default is 1. Allowed range is from 1 to 64.
  22735. </p>
  22736. </dd>
  22737. <dt><samp>knee</samp></dt>
  22738. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  22739. Default is 2.828427125. Allowed range is from 1 to 8.
  22740. </p>
  22741. </dd>
  22742. <dt><samp>detection</samp></dt>
  22743. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  22744. Default is <code>rms</code>. Can be <code>peak</code> or <code>rms</code>.
  22745. </p>
  22746. </dd>
  22747. <dt><samp>link</samp></dt>
  22748. <dd><p>Choose if the average level between all channels or the louder channel affects
  22749. the reduction.
  22750. Default is <code>average</code>. Can be <code>average</code> or <code>maximum</code>.
  22751. </p></dd>
  22752. </dl>
  22753. <a name="Commands-8"></a>
  22754. <h4 class="subsection">36.23.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-8" aria-hidden="true">TOC</a></span></h4>
  22755. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  22756. </p>
  22757. <a name="aiir"></a>
  22758. <h3 class="section">36.24 aiir<span class="pull-right"><a class="anchor hidden-xs" href="#aiir" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aiir" aria-hidden="true">TOC</a></span></h3>
  22759. <p>Apply an arbitrary Infinite Impulse Response filter.
  22760. </p>
  22761. <p>It accepts the following parameters:
  22762. </p>
  22763. <dl compact="compact">
  22764. <dt><samp>zeros, z</samp></dt>
  22765. <dd><p>Set B/numerator/zeros/reflection coefficients.
  22766. </p>
  22767. </dd>
  22768. <dt><samp>poles, p</samp></dt>
  22769. <dd><p>Set A/denominator/poles/ladder coefficients.
  22770. </p>
  22771. </dd>
  22772. <dt><samp>gains, k</samp></dt>
  22773. <dd><p>Set channels gains.
  22774. </p>
  22775. </dd>
  22776. <dt><samp>dry_gain</samp></dt>
  22777. <dd><p>Set input gain.
  22778. </p>
  22779. </dd>
  22780. <dt><samp>wet_gain</samp></dt>
  22781. <dd><p>Set output gain.
  22782. </p>
  22783. </dd>
  22784. <dt><samp>format, f</samp></dt>
  22785. <dd><p>Set coefficients format.
  22786. </p>
  22787. <dl compact="compact">
  22788. <dt>&lsquo;<samp>ll</samp>&rsquo;</dt>
  22789. <dd><p>lattice-ladder function
  22790. </p></dd>
  22791. <dt>&lsquo;<samp>sf</samp>&rsquo;</dt>
  22792. <dd><p>analog transfer function
  22793. </p></dd>
  22794. <dt>&lsquo;<samp>tf</samp>&rsquo;</dt>
  22795. <dd><p>digital transfer function
  22796. </p></dd>
  22797. <dt>&lsquo;<samp>zp</samp>&rsquo;</dt>
  22798. <dd><p>Z-plane zeros/poles, cartesian (default)
  22799. </p></dd>
  22800. <dt>&lsquo;<samp>pr</samp>&rsquo;</dt>
  22801. <dd><p>Z-plane zeros/poles, polar radians
  22802. </p></dd>
  22803. <dt>&lsquo;<samp>pd</samp>&rsquo;</dt>
  22804. <dd><p>Z-plane zeros/poles, polar degrees
  22805. </p></dd>
  22806. <dt>&lsquo;<samp>sp</samp>&rsquo;</dt>
  22807. <dd><p>S-plane zeros/poles
  22808. </p></dd>
  22809. </dl>
  22810. </dd>
  22811. <dt><samp>process, r</samp></dt>
  22812. <dd><p>Set type of processing.
  22813. </p>
  22814. <dl compact="compact">
  22815. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  22816. <dd><p>direct processing
  22817. </p></dd>
  22818. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  22819. <dd><p>serial processing
  22820. </p></dd>
  22821. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  22822. <dd><p>parallel processing
  22823. </p></dd>
  22824. </dl>
  22825. </dd>
  22826. <dt><samp>precision, e</samp></dt>
  22827. <dd><p>Set filtering precision.
  22828. </p>
  22829. <dl compact="compact">
  22830. <dt>&lsquo;<samp>dbl</samp>&rsquo;</dt>
  22831. <dd><p>double-precision floating-point (default)
  22832. </p></dd>
  22833. <dt>&lsquo;<samp>flt</samp>&rsquo;</dt>
  22834. <dd><p>single-precision floating-point
  22835. </p></dd>
  22836. <dt>&lsquo;<samp>i32</samp>&rsquo;</dt>
  22837. <dd><p>32-bit integers
  22838. </p></dd>
  22839. <dt>&lsquo;<samp>i16</samp>&rsquo;</dt>
  22840. <dd><p>16-bit integers
  22841. </p></dd>
  22842. </dl>
  22843. </dd>
  22844. <dt><samp>normalize, n</samp></dt>
  22845. <dd><p>Normalize filter coefficients, by default is enabled.
  22846. Enabling it will normalize magnitude response at DC to 0dB.
  22847. </p>
  22848. </dd>
  22849. <dt><samp>mix</samp></dt>
  22850. <dd><p>How much to use filtered signal in output. Default is 1.
  22851. Range is between 0 and 1.
  22852. </p>
  22853. </dd>
  22854. <dt><samp>response</samp></dt>
  22855. <dd><p>Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream.
  22856. By default it is disabled.
  22857. </p>
  22858. </dd>
  22859. <dt><samp>channel</samp></dt>
  22860. <dd><p>Set for which IR channel to display frequency response. By default is first channel
  22861. displayed. This option is used only when <var>response</var> is enabled.
  22862. </p>
  22863. </dd>
  22864. <dt><samp>size</samp></dt>
  22865. <dd><p>Set video stream size. This option is used only when <var>response</var> is enabled.
  22866. </p></dd>
  22867. </dl>
  22868. <p>Coefficients in <code>tf</code> and <code>sf</code> format are separated by spaces and are in ascending
  22869. order.
  22870. </p>
  22871. <p>Coefficients in <code>zp</code> format are separated by spaces and order of coefficients
  22872. doesn&rsquo;t matter. Coefficients in <code>zp</code> format are complex numbers with <var>i</var>
  22873. imaginary unit.
  22874. </p>
  22875. <p>Different coefficients and gains can be provided for every channel, in such case
  22876. use &rsquo;|&rsquo; to separate coefficients or gains. Last provided coefficients will be
  22877. used for all remaining channels.
  22878. </p>
  22879. <a name="Examples-46"></a>
  22880. <h4 class="subsection">36.24.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-46" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-46" aria-hidden="true">TOC</a></span></h4>
  22881. <ul>
  22882. <li> Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate:
  22883. <div class="example">
  22884. <pre class="example">aiir=k=1:z=7.957584807809675810E-1 -2.575128568908332300 3.674839853930788710 -2.57512875289799137 7.957586296317130880E-1:p=1 -2.86950072432325953 3.63022088054647218 -2.28075678147272232 6.361362326477423500E-1:f=tf:r=d
  22885. </pre></div>
  22886. </li><li> Same as above but in <code>zp</code> format:
  22887. <div class="example">
  22888. <pre class="example">aiir=k=0.79575848078096756:z=0.80918701+0.58773007i 0.80918701-0.58773007i 0.80884700+0.58784055i 0.80884700-0.58784055i:p=0.63892345+0.59951235i 0.63892345-0.59951235i 0.79582691+0.44198673i 0.79582691-0.44198673i:f=zp:r=s
  22889. </pre></div>
  22890. </li><li> Apply 3-rd order analog normalized Butterworth low-pass filter, using analog transfer function format:
  22891. <div class="example">
  22892. <pre class="example">aiir=z=1.3057 0 0 0:p=1.3057 2.3892 2.1860 1:f=sf:r=d
  22893. </pre></div>
  22894. </li></ul>
  22895. <a name="alimiter"></a>
  22896. <h3 class="section">36.25 alimiter<span class="pull-right"><a class="anchor hidden-xs" href="#alimiter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alimiter" aria-hidden="true">TOC</a></span></h3>
  22897. <p>The limiter prevents an input signal from rising over a desired threshold.
  22898. This limiter uses lookahead technology to prevent your signal from distorting.
  22899. It means that there is a small delay after the signal is processed. Keep in mind
  22900. that the delay it produces is the attack time you set.
  22901. </p>
  22902. <p>The filter accepts the following options:
  22903. </p>
  22904. <dl compact="compact">
  22905. <dt><samp>level_in</samp></dt>
  22906. <dd><p>Set input gain. Default is 1.
  22907. </p>
  22908. </dd>
  22909. <dt><samp>level_out</samp></dt>
  22910. <dd><p>Set output gain. Default is 1.
  22911. </p>
  22912. </dd>
  22913. <dt><samp>limit</samp></dt>
  22914. <dd><p>Don&rsquo;t let signals above this level pass the limiter. Default is 1.
  22915. </p>
  22916. </dd>
  22917. <dt><samp>attack</samp></dt>
  22918. <dd><p>The limiter will reach its attenuation level in this amount of time in
  22919. milliseconds. Default is 5 milliseconds.
  22920. </p>
  22921. </dd>
  22922. <dt><samp>release</samp></dt>
  22923. <dd><p>Come back from limiting to attenuation 1.0 in this amount of milliseconds.
  22924. Default is 50 milliseconds.
  22925. </p>
  22926. </dd>
  22927. <dt><samp>asc</samp></dt>
  22928. <dd><p>When gain reduction is always needed ASC takes care of releasing to an
  22929. average reduction level rather than reaching a reduction of 0 in the release
  22930. time.
  22931. </p>
  22932. </dd>
  22933. <dt><samp>asc_level</samp></dt>
  22934. <dd><p>Select how much the release time is affected by ASC, 0 means nearly no changes
  22935. in release time while 1 produces higher release times.
  22936. </p>
  22937. </dd>
  22938. <dt><samp>level</samp></dt>
  22939. <dd><p>Auto level output signal. Default is enabled.
  22940. This normalizes audio back to 0dB if enabled.
  22941. </p></dd>
  22942. </dl>
  22943. <p>Depending on picked setting it is recommended to upsample input 2x or 4x times
  22944. with <a href="#aresample">aresample</a> before applying this filter.
  22945. </p>
  22946. <a name="allpass"></a>
  22947. <h3 class="section">36.26 allpass<span class="pull-right"><a class="anchor hidden-xs" href="#allpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-allpass" aria-hidden="true">TOC</a></span></h3>
  22948. <p>Apply a two-pole all-pass filter with central frequency (in Hz)
  22949. <var>frequency</var>, and filter-width <var>width</var>.
  22950. An all-pass filter changes the audio&rsquo;s frequency to phase relationship
  22951. without changing its frequency to amplitude relationship.
  22952. </p>
  22953. <p>The filter accepts the following options:
  22954. </p>
  22955. <dl compact="compact">
  22956. <dt><samp>frequency, f</samp></dt>
  22957. <dd><p>Set frequency in Hz.
  22958. </p>
  22959. </dd>
  22960. <dt><samp>width_type, t</samp></dt>
  22961. <dd><p>Set method to specify band-width of filter.
  22962. </p><dl compact="compact">
  22963. <dt><samp>h</samp></dt>
  22964. <dd><p>Hz
  22965. </p></dd>
  22966. <dt><samp>q</samp></dt>
  22967. <dd><p>Q-Factor
  22968. </p></dd>
  22969. <dt><samp>o</samp></dt>
  22970. <dd><p>octave
  22971. </p></dd>
  22972. <dt><samp>s</samp></dt>
  22973. <dd><p>slope
  22974. </p></dd>
  22975. <dt><samp>k</samp></dt>
  22976. <dd><p>kHz
  22977. </p></dd>
  22978. </dl>
  22979. </dd>
  22980. <dt><samp>width, w</samp></dt>
  22981. <dd><p>Specify the band-width of a filter in width_type units.
  22982. </p>
  22983. </dd>
  22984. <dt><samp>mix, m</samp></dt>
  22985. <dd><p>How much to use filtered signal in output. Default is 1.
  22986. Range is between 0 and 1.
  22987. </p>
  22988. </dd>
  22989. <dt><samp>channels, c</samp></dt>
  22990. <dd><p>Specify which channels to filter, by default all available are filtered.
  22991. </p>
  22992. </dd>
  22993. <dt><samp>normalize, n</samp></dt>
  22994. <dd><p>Normalize biquad coefficients, by default is disabled.
  22995. Enabling it will normalize magnitude response at DC to 0dB.
  22996. </p>
  22997. </dd>
  22998. <dt><samp>order, o</samp></dt>
  22999. <dd><p>Set the filter order, can be 1 or 2. Default is 2.
  23000. </p>
  23001. </dd>
  23002. <dt><samp>transform, a</samp></dt>
  23003. <dd><p>Set transform type of IIR filter.
  23004. </p><dl compact="compact">
  23005. <dt><samp>di</samp></dt>
  23006. <dt><samp>dii</samp></dt>
  23007. <dt><samp>tdii</samp></dt>
  23008. <dt><samp>latt</samp></dt>
  23009. </dl>
  23010. </dd>
  23011. <dt><samp>precision, r</samp></dt>
  23012. <dd><p>Set precison of filtering.
  23013. </p><dl compact="compact">
  23014. <dt><samp>auto</samp></dt>
  23015. <dd><p>Pick automatic sample format depending on surround filters.
  23016. </p></dd>
  23017. <dt><samp>s16</samp></dt>
  23018. <dd><p>Always use signed 16-bit.
  23019. </p></dd>
  23020. <dt><samp>s32</samp></dt>
  23021. <dd><p>Always use signed 32-bit.
  23022. </p></dd>
  23023. <dt><samp>f32</samp></dt>
  23024. <dd><p>Always use float 32-bit.
  23025. </p></dd>
  23026. <dt><samp>f64</samp></dt>
  23027. <dd><p>Always use float 64-bit.
  23028. </p></dd>
  23029. </dl>
  23030. </dd>
  23031. </dl>
  23032. <a name="Commands-9"></a>
  23033. <h4 class="subsection">36.26.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-9" aria-hidden="true">TOC</a></span></h4>
  23034. <p>This filter supports the following commands:
  23035. </p><dl compact="compact">
  23036. <dt><samp>frequency, f</samp></dt>
  23037. <dd><p>Change allpass frequency.
  23038. Syntax for the command is : &quot;<var>frequency</var>&quot;
  23039. </p>
  23040. </dd>
  23041. <dt><samp>width_type, t</samp></dt>
  23042. <dd><p>Change allpass width_type.
  23043. Syntax for the command is : &quot;<var>width_type</var>&quot;
  23044. </p>
  23045. </dd>
  23046. <dt><samp>width, w</samp></dt>
  23047. <dd><p>Change allpass width.
  23048. Syntax for the command is : &quot;<var>width</var>&quot;
  23049. </p>
  23050. </dd>
  23051. <dt><samp>mix, m</samp></dt>
  23052. <dd><p>Change allpass mix.
  23053. Syntax for the command is : &quot;<var>mix</var>&quot;
  23054. </p></dd>
  23055. </dl>
  23056. <a name="aloop"></a>
  23057. <h3 class="section">36.27 aloop<span class="pull-right"><a class="anchor hidden-xs" href="#aloop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aloop" aria-hidden="true">TOC</a></span></h3>
  23058. <p>Loop audio samples.
  23059. </p>
  23060. <p>The filter accepts the following options:
  23061. </p>
  23062. <dl compact="compact">
  23063. <dt><samp>loop</samp></dt>
  23064. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  23065. Default is 0.
  23066. </p>
  23067. </dd>
  23068. <dt><samp>size</samp></dt>
  23069. <dd><p>Set maximal number of samples. Default is 0.
  23070. </p>
  23071. </dd>
  23072. <dt><samp>start</samp></dt>
  23073. <dd><p>Set first sample of loop. Default is 0.
  23074. </p></dd>
  23075. </dl>
  23076. <span id="amerge"></span><a name="amerge-1"></a>
  23077. <h3 class="section">36.28 amerge<span class="pull-right"><a class="anchor hidden-xs" href="#amerge-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amerge-1" aria-hidden="true">TOC</a></span></h3>
  23078. <p>Merge two or more audio streams into a single multi-channel stream.
  23079. </p>
  23080. <p>The filter accepts the following options:
  23081. </p>
  23082. <dl compact="compact">
  23083. <dt><samp>inputs</samp></dt>
  23084. <dd><p>Set the number of inputs. Default is 2.
  23085. </p>
  23086. </dd>
  23087. </dl>
  23088. <p>If the channel layouts of the inputs are disjoint, and therefore compatible,
  23089. the channel layout of the output will be set accordingly and the channels
  23090. will be reordered as necessary. If the channel layouts of the inputs are not
  23091. disjoint, the output will have all the channels of the first input then all
  23092. the channels of the second input, in that order, and the channel layout of
  23093. the output will be the default value corresponding to the total number of
  23094. channels.
  23095. </p>
  23096. <p>For example, if the first input is in 2.1 (FL+FR+LF) and the second input
  23097. is FC+BL+BR, then the output will be in 5.1, with the channels in the
  23098. following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
  23099. first input, b1 is the first channel of the second input).
  23100. </p>
  23101. <p>On the other hand, if both input are in stereo, the output channels will be
  23102. in the default order: a1, a2, b1, b2, and the channel layout will be
  23103. arbitrarily set to 4.0, which may or may not be the expected value.
  23104. </p>
  23105. <p>All inputs must have the same sample rate, and format.
  23106. </p>
  23107. <p>If inputs do not have the same duration, the output will stop with the
  23108. shortest.
  23109. </p>
  23110. <a name="Examples-47"></a>
  23111. <h4 class="subsection">36.28.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-47" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-47" aria-hidden="true">TOC</a></span></h4>
  23112. <ul>
  23113. <li> Merge two mono files into a stereo stream:
  23114. <div class="example">
  23115. <pre class="example">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
  23116. </pre></div>
  23117. </li><li> Multiple merges assuming 1 video stream and 6 audio streams in <samp>input.mkv</samp>:
  23118. <div class="example">
  23119. <pre class="example">ffmpeg -i input.mkv -filter_complex &quot;[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6&quot; -c:a pcm_s16le output.mkv
  23120. </pre></div>
  23121. </li></ul>
  23122. <a name="amix"></a>
  23123. <h3 class="section">36.29 amix<span class="pull-right"><a class="anchor hidden-xs" href="#amix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amix" aria-hidden="true">TOC</a></span></h3>
  23124. <p>Mixes multiple audio inputs into a single output.
  23125. </p>
  23126. <p>Note that this filter only supports float samples (the <var>amerge</var>
  23127. and <var>pan</var> audio filters support many formats). If the <var>amix</var>
  23128. input has integer samples then <a href="#aresample">aresample</a> will be automatically
  23129. inserted to perform the conversion to float samples.
  23130. </p>
  23131. <p>For example
  23132. </p><div class="example">
  23133. <pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
  23134. </pre></div>
  23135. <p>will mix 3 input audio streams to a single output with the same duration as the
  23136. first input and a dropout transition time of 3 seconds.
  23137. </p>
  23138. <p>It accepts the following parameters:
  23139. </p><dl compact="compact">
  23140. <dt><samp>inputs</samp></dt>
  23141. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  23142. </p>
  23143. </dd>
  23144. <dt><samp>duration</samp></dt>
  23145. <dd><p>How to determine the end-of-stream.
  23146. </p><dl compact="compact">
  23147. <dt><samp>longest</samp></dt>
  23148. <dd><p>The duration of the longest input. (default)
  23149. </p>
  23150. </dd>
  23151. <dt><samp>shortest</samp></dt>
  23152. <dd><p>The duration of the shortest input.
  23153. </p>
  23154. </dd>
  23155. <dt><samp>first</samp></dt>
  23156. <dd><p>The duration of the first input.
  23157. </p>
  23158. </dd>
  23159. </dl>
  23160. </dd>
  23161. <dt><samp>dropout_transition</samp></dt>
  23162. <dd><p>The transition time, in seconds, for volume renormalization when an input
  23163. stream ends. The default value is 2 seconds.
  23164. </p>
  23165. </dd>
  23166. <dt><samp>weights</samp></dt>
  23167. <dd><p>Specify weight of each input audio stream as sequence.
  23168. Each weight is separated by space. By default all inputs have same weight.
  23169. </p>
  23170. </dd>
  23171. <dt><samp>normalize</samp></dt>
  23172. <dd><p>Always scale inputs instead of only doing summation of samples.
  23173. Beware of heavy clipping if inputs are not normalized prior or after filtering
  23174. by this filter if this option is disabled. By default is enabled.
  23175. </p></dd>
  23176. </dl>
  23177. <a name="Commands-10"></a>
  23178. <h4 class="subsection">36.29.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-10" aria-hidden="true">TOC</a></span></h4>
  23179. <p>This filter supports the following commands:
  23180. </p><dl compact="compact">
  23181. <dt><samp>weights</samp></dt>
  23182. <dt><samp>sum</samp></dt>
  23183. <dd><p>Syntax is same as option with same name.
  23184. </p></dd>
  23185. </dl>
  23186. <a name="amultiply"></a>
  23187. <h3 class="section">36.30 amultiply<span class="pull-right"><a class="anchor hidden-xs" href="#amultiply" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amultiply" aria-hidden="true">TOC</a></span></h3>
  23188. <p>Multiply first audio stream with second audio stream and store result
  23189. in output audio stream. Multiplication is done by multiplying each
  23190. sample from first stream with sample at same position from second stream.
  23191. </p>
  23192. <p>With this element-wise multiplication one can create amplitude fades and
  23193. amplitude modulations.
  23194. </p>
  23195. <a name="anequalizer"></a>
  23196. <h3 class="section">36.31 anequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#anequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anequalizer" aria-hidden="true">TOC</a></span></h3>
  23197. <p>High-order parametric multiband equalizer for each channel.
  23198. </p>
  23199. <p>It accepts the following parameters:
  23200. </p><dl compact="compact">
  23201. <dt><samp>params</samp></dt>
  23202. <dd>
  23203. <p>This option string is in format:
  23204. &quot;c<var>chn</var> f=<var>cf</var> w=<var>w</var> g=<var>g</var> t=<var>f</var> | ...&quot;
  23205. Each equalizer band is separated by &rsquo;|&rsquo;.
  23206. </p>
  23207. <dl compact="compact">
  23208. <dt><samp>chn</samp></dt>
  23209. <dd><p>Set channel number to which equalization will be applied.
  23210. If input doesn&rsquo;t have that channel the entry is ignored.
  23211. </p>
  23212. </dd>
  23213. <dt><samp>f</samp></dt>
  23214. <dd><p>Set central frequency for band.
  23215. If input doesn&rsquo;t have that frequency the entry is ignored.
  23216. </p>
  23217. </dd>
  23218. <dt><samp>w</samp></dt>
  23219. <dd><p>Set band width in Hertz.
  23220. </p>
  23221. </dd>
  23222. <dt><samp>g</samp></dt>
  23223. <dd><p>Set band gain in dB.
  23224. </p>
  23225. </dd>
  23226. <dt><samp>t</samp></dt>
  23227. <dd><p>Set filter type for band, optional, can be:
  23228. </p>
  23229. <dl compact="compact">
  23230. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  23231. <dd><p>Butterworth, this is default.
  23232. </p>
  23233. </dd>
  23234. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  23235. <dd><p>Chebyshev type 1.
  23236. </p>
  23237. </dd>
  23238. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  23239. <dd><p>Chebyshev type 2.
  23240. </p></dd>
  23241. </dl>
  23242. </dd>
  23243. </dl>
  23244. </dd>
  23245. <dt><samp>curves</samp></dt>
  23246. <dd><p>With this option activated frequency response of anequalizer is displayed
  23247. in video stream.
  23248. </p>
  23249. </dd>
  23250. <dt><samp>size</samp></dt>
  23251. <dd><p>Set video stream size. Only useful if curves option is activated.
  23252. </p>
  23253. </dd>
  23254. <dt><samp>mgain</samp></dt>
  23255. <dd><p>Set max gain that will be displayed. Only useful if curves option is activated.
  23256. Setting this to a reasonable value makes it possible to display gain which is derived from
  23257. neighbour bands which are too close to each other and thus produce higher gain
  23258. when both are activated.
  23259. </p>
  23260. </dd>
  23261. <dt><samp>fscale</samp></dt>
  23262. <dd><p>Set frequency scale used to draw frequency response in video output.
  23263. Can be linear or logarithmic. Default is logarithmic.
  23264. </p>
  23265. </dd>
  23266. <dt><samp>colors</samp></dt>
  23267. <dd><p>Set color for each channel curve which is going to be displayed in video stream.
  23268. This is list of color names separated by space or by &rsquo;|&rsquo;.
  23269. Unrecognised or missing colors will be replaced by white color.
  23270. </p></dd>
  23271. </dl>
  23272. <a name="Examples-48"></a>
  23273. <h4 class="subsection">36.31.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-48" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-48" aria-hidden="true">TOC</a></span></h4>
  23274. <ul>
  23275. <li> Lower gain by 10 of central frequency 200Hz and width 100 Hz
  23276. for first 2 channels using Chebyshev type 1 filter:
  23277. <div class="example">
  23278. <pre class="example">anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
  23279. </pre></div>
  23280. </li></ul>
  23281. <a name="Commands-11"></a>
  23282. <h4 class="subsection">36.31.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-11" aria-hidden="true">TOC</a></span></h4>
  23283. <p>This filter supports the following commands:
  23284. </p><dl compact="compact">
  23285. <dt><samp>change</samp></dt>
  23286. <dd><p>Alter existing filter parameters.
  23287. Syntax for the commands is : &quot;<var>fN</var>|f=<var>freq</var>|w=<var>width</var>|g=<var>gain</var>&quot;
  23288. </p>
  23289. <p><var>fN</var> is existing filter number, starting from 0, if no such filter is available
  23290. error is returned.
  23291. <var>freq</var> set new frequency parameter.
  23292. <var>width</var> set new width parameter in Hertz.
  23293. <var>gain</var> set new gain parameter in dB.
  23294. </p>
  23295. <p>Full filter invocation with asendcmd may look like this:
  23296. asendcmd=c=&rsquo;4.0 anequalizer change 0|f=200|w=50|g=1&rsquo;,anequalizer=...
  23297. </p></dd>
  23298. </dl>
  23299. <a name="anlmdn"></a>
  23300. <h3 class="section">36.32 anlmdn<span class="pull-right"><a class="anchor hidden-xs" href="#anlmdn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anlmdn" aria-hidden="true">TOC</a></span></h3>
  23301. <p>Reduce broadband noise in audio samples using Non-Local Means algorithm.
  23302. </p>
  23303. <p>Each sample is adjusted by looking for other samples with similar contexts. This
  23304. context similarity is defined by comparing their surrounding patches of size
  23305. <samp>p</samp>. Patches are searched in an area of <samp>r</samp> around the sample.
  23306. </p>
  23307. <p>The filter accepts the following options:
  23308. </p>
  23309. <dl compact="compact">
  23310. <dt><samp>s</samp></dt>
  23311. <dd><p>Set denoising strength. Allowed range is from 0.00001 to 10. Default value is 0.00001.
  23312. </p>
  23313. </dd>
  23314. <dt><samp>p</samp></dt>
  23315. <dd><p>Set patch radius duration. Allowed range is from 1 to 100 milliseconds.
  23316. Default value is 2 milliseconds.
  23317. </p>
  23318. </dd>
  23319. <dt><samp>r</samp></dt>
  23320. <dd><p>Set research radius duration. Allowed range is from 2 to 300 milliseconds.
  23321. Default value is 6 milliseconds.
  23322. </p>
  23323. </dd>
  23324. <dt><samp>o</samp></dt>
  23325. <dd><p>Set the output mode.
  23326. </p>
  23327. <p>It accepts the following values:
  23328. </p><dl compact="compact">
  23329. <dt><samp>i</samp></dt>
  23330. <dd><p>Pass input unchanged.
  23331. </p>
  23332. </dd>
  23333. <dt><samp>o</samp></dt>
  23334. <dd><p>Pass noise filtered out.
  23335. </p>
  23336. </dd>
  23337. <dt><samp>n</samp></dt>
  23338. <dd><p>Pass only noise.
  23339. </p>
  23340. <p>Default value is <var>o</var>.
  23341. </p></dd>
  23342. </dl>
  23343. </dd>
  23344. <dt><samp>m</samp></dt>
  23345. <dd><p>Set smooth factor. Default value is <var>11</var>. Allowed range is from <var>1</var> to <var>15</var>.
  23346. </p></dd>
  23347. </dl>
  23348. <a name="Commands-12"></a>
  23349. <h4 class="subsection">36.32.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-12" aria-hidden="true">TOC</a></span></h4>
  23350. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  23351. </p>
  23352. <a name="anlms"></a>
  23353. <h3 class="section">36.33 anlms<span class="pull-right"><a class="anchor hidden-xs" href="#anlms" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anlms" aria-hidden="true">TOC</a></span></h3>
  23354. <p>Apply Normalized Least-Mean-Squares algorithm to the first audio stream using the second audio stream.
  23355. </p>
  23356. <p>This adaptive filter is used to mimic a desired filter by finding the filter coefficients that
  23357. relate to producing the least mean square of the error signal (difference between the desired,
  23358. 2nd input audio stream and the actual signal, the 1st input audio stream).
  23359. </p>
  23360. <p>A description of the accepted options follows.
  23361. </p>
  23362. <dl compact="compact">
  23363. <dt><samp>order</samp></dt>
  23364. <dd><p>Set filter order.
  23365. </p>
  23366. </dd>
  23367. <dt><samp>mu</samp></dt>
  23368. <dd><p>Set filter mu.
  23369. </p>
  23370. </dd>
  23371. <dt><samp>eps</samp></dt>
  23372. <dd><p>Set the filter eps.
  23373. </p>
  23374. </dd>
  23375. <dt><samp>leakage</samp></dt>
  23376. <dd><p>Set the filter leakage.
  23377. </p>
  23378. </dd>
  23379. <dt><samp>out_mode</samp></dt>
  23380. <dd><p>It accepts the following values:
  23381. </p><dl compact="compact">
  23382. <dt><samp>i</samp></dt>
  23383. <dd><p>Pass the 1st input.
  23384. </p>
  23385. </dd>
  23386. <dt><samp>d</samp></dt>
  23387. <dd><p>Pass the 2nd input.
  23388. </p>
  23389. </dd>
  23390. <dt><samp>o</samp></dt>
  23391. <dd><p>Pass filtered samples.
  23392. </p>
  23393. </dd>
  23394. <dt><samp>n</samp></dt>
  23395. <dd><p>Pass difference between desired and filtered samples.
  23396. </p>
  23397. <p>Default value is <var>o</var>.
  23398. </p></dd>
  23399. </dl>
  23400. </dd>
  23401. </dl>
  23402. <a name="Examples-49"></a>
  23403. <h4 class="subsection">36.33.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-49" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-49" aria-hidden="true">TOC</a></span></h4>
  23404. <ul>
  23405. <li> One of many usages of this filter is noise reduction, input audio is filtered
  23406. with same samples that are delayed by fixed amount, one such example for stereo audio is:
  23407. <div class="example">
  23408. <pre class="example">asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o
  23409. </pre></div>
  23410. </li></ul>
  23411. <a name="Commands-13"></a>
  23412. <h4 class="subsection">36.33.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-13" aria-hidden="true">TOC</a></span></h4>
  23413. <p>This filter supports the same commands as options, excluding option <code>order</code>.
  23414. </p>
  23415. <a name="anull"></a>
  23416. <h3 class="section">36.34 anull<span class="pull-right"><a class="anchor hidden-xs" href="#anull" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anull" aria-hidden="true">TOC</a></span></h3>
  23417. <p>Pass the audio source unchanged to the output.
  23418. </p>
  23419. <a name="apad"></a>
  23420. <h3 class="section">36.35 apad<span class="pull-right"><a class="anchor hidden-xs" href="#apad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apad" aria-hidden="true">TOC</a></span></h3>
  23421. <p>Pad the end of an audio stream with silence.
  23422. </p>
  23423. <p>This can be used together with <code>ffmpeg</code> <samp>-shortest</samp> to
  23424. extend audio streams to the same length as the video stream.
  23425. </p>
  23426. <p>A description of the accepted options follows.
  23427. </p>
  23428. <dl compact="compact">
  23429. <dt><samp>packet_size</samp></dt>
  23430. <dd><p>Set silence packet size. Default value is 4096.
  23431. </p>
  23432. </dd>
  23433. <dt><samp>pad_len</samp></dt>
  23434. <dd><p>Set the number of samples of silence to add to the end. After the
  23435. value is reached, the stream is terminated. This option is mutually
  23436. exclusive with <samp>whole_len</samp>.
  23437. </p>
  23438. </dd>
  23439. <dt><samp>whole_len</samp></dt>
  23440. <dd><p>Set the minimum total number of samples in the output audio stream. If
  23441. the value is longer than the input audio length, silence is added to
  23442. the end, until the value is reached. This option is mutually exclusive
  23443. with <samp>pad_len</samp>.
  23444. </p>
  23445. </dd>
  23446. <dt><samp>pad_dur</samp></dt>
  23447. <dd><p>Specify the duration of samples of silence to add. See
  23448. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  23449. for the accepted syntax. Used only if set to non-zero value.
  23450. </p>
  23451. </dd>
  23452. <dt><samp>whole_dur</samp></dt>
  23453. <dd><p>Specify the minimum total duration in the output audio stream. See
  23454. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  23455. for the accepted syntax. Used only if set to non-zero value. If the value is longer than
  23456. the input audio length, silence is added to the end, until the value is reached.
  23457. This option is mutually exclusive with <samp>pad_dur</samp>
  23458. </p></dd>
  23459. </dl>
  23460. <p>If neither the <samp>pad_len</samp> nor the <samp>whole_len</samp> nor <samp>pad_dur</samp>
  23461. nor <samp>whole_dur</samp> option is set, the filter will add silence to the end of
  23462. the input stream indefinitely.
  23463. </p>
  23464. <a name="Examples-50"></a>
  23465. <h4 class="subsection">36.35.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-50" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-50" aria-hidden="true">TOC</a></span></h4>
  23466. <ul>
  23467. <li> Add 1024 samples of silence to the end of the input:
  23468. <div class="example">
  23469. <pre class="example">apad=pad_len=1024
  23470. </pre></div>
  23471. </li><li> Make sure the audio output will contain at least 10000 samples, pad
  23472. the input with silence if required:
  23473. <div class="example">
  23474. <pre class="example">apad=whole_len=10000
  23475. </pre></div>
  23476. </li><li> Use <code>ffmpeg</code> to pad the audio input with silence, so that the
  23477. video stream will always result the shortest and will be converted
  23478. until the end in the output file when using the <samp>shortest</samp>
  23479. option:
  23480. <div class="example">
  23481. <pre class="example">ffmpeg -i VIDEO -i AUDIO -filter_complex &quot;[1:0]apad&quot; -shortest OUTPUT
  23482. </pre></div>
  23483. </li></ul>
  23484. <a name="aphaser"></a>
  23485. <h3 class="section">36.36 aphaser<span class="pull-right"><a class="anchor hidden-xs" href="#aphaser" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aphaser" aria-hidden="true">TOC</a></span></h3>
  23486. <p>Add a phasing effect to the input audio.
  23487. </p>
  23488. <p>A phaser filter creates series of peaks and troughs in the frequency spectrum.
  23489. The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
  23490. </p>
  23491. <p>A description of the accepted parameters follows.
  23492. </p>
  23493. <dl compact="compact">
  23494. <dt><samp>in_gain</samp></dt>
  23495. <dd><p>Set input gain. Default is 0.4.
  23496. </p>
  23497. </dd>
  23498. <dt><samp>out_gain</samp></dt>
  23499. <dd><p>Set output gain. Default is 0.74
  23500. </p>
  23501. </dd>
  23502. <dt><samp>delay</samp></dt>
  23503. <dd><p>Set delay in milliseconds. Default is 3.0.
  23504. </p>
  23505. </dd>
  23506. <dt><samp>decay</samp></dt>
  23507. <dd><p>Set decay. Default is 0.4.
  23508. </p>
  23509. </dd>
  23510. <dt><samp>speed</samp></dt>
  23511. <dd><p>Set modulation speed in Hz. Default is 0.5.
  23512. </p>
  23513. </dd>
  23514. <dt><samp>type</samp></dt>
  23515. <dd><p>Set modulation type. Default is triangular.
  23516. </p>
  23517. <p>It accepts the following values:
  23518. </p><dl compact="compact">
  23519. <dt>&lsquo;<samp>triangular, t</samp>&rsquo;</dt>
  23520. <dt>&lsquo;<samp>sinusoidal, s</samp>&rsquo;</dt>
  23521. </dl>
  23522. </dd>
  23523. </dl>
  23524. <a name="aphaseshift"></a>
  23525. <h3 class="section">36.37 aphaseshift<span class="pull-right"><a class="anchor hidden-xs" href="#aphaseshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aphaseshift" aria-hidden="true">TOC</a></span></h3>
  23526. <p>Apply phase shift to input audio samples.
  23527. </p>
  23528. <p>The filter accepts the following options:
  23529. </p>
  23530. <dl compact="compact">
  23531. <dt><samp>shift</samp></dt>
  23532. <dd><p>Specify phase shift. Allowed range is from -1.0 to 1.0.
  23533. Default value is 0.0.
  23534. </p>
  23535. </dd>
  23536. <dt><samp>level</samp></dt>
  23537. <dd><p>Set output gain applied to final output. Allowed range is from 0.0 to 1.0.
  23538. Default value is 1.0.
  23539. </p></dd>
  23540. </dl>
  23541. <a name="Commands-14"></a>
  23542. <h4 class="subsection">36.37.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-14" aria-hidden="true">TOC</a></span></h4>
  23543. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  23544. </p>
  23545. <a name="apulsator"></a>
  23546. <h3 class="section">36.38 apulsator<span class="pull-right"><a class="anchor hidden-xs" href="#apulsator" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apulsator" aria-hidden="true">TOC</a></span></h3>
  23547. <p>Audio pulsator is something between an autopanner and a tremolo.
  23548. But it can produce funny stereo effects as well. Pulsator changes the volume
  23549. of the left and right channel based on a LFO (low frequency oscillator) with
  23550. different waveforms and shifted phases.
  23551. This filter have the ability to define an offset between left and right
  23552. channel. An offset of 0 means that both LFO shapes match each other.
  23553. The left and right channel are altered equally - a conventional tremolo.
  23554. An offset of 50% means that the shape of the right channel is exactly shifted
  23555. in phase (or moved backwards about half of the frequency) - pulsator acts as
  23556. an autopanner. At 1 both curves match again. Every setting in between moves the
  23557. phase shift gapless between all stages and produces some &quot;bypassing&quot; sounds with
  23558. sine and triangle waveforms. The more you set the offset near 1 (starting from
  23559. the 0.5) the faster the signal passes from the left to the right speaker.
  23560. </p>
  23561. <p>The filter accepts the following options:
  23562. </p>
  23563. <dl compact="compact">
  23564. <dt><samp>level_in</samp></dt>
  23565. <dd><p>Set input gain. By default it is 1. Range is [0.015625 - 64].
  23566. </p>
  23567. </dd>
  23568. <dt><samp>level_out</samp></dt>
  23569. <dd><p>Set output gain. By default it is 1. Range is [0.015625 - 64].
  23570. </p>
  23571. </dd>
  23572. <dt><samp>mode</samp></dt>
  23573. <dd><p>Set waveform shape the LFO will use. Can be one of: sine, triangle, square,
  23574. sawup or sawdown. Default is sine.
  23575. </p>
  23576. </dd>
  23577. <dt><samp>amount</samp></dt>
  23578. <dd><p>Set modulation. Define how much of original signal is affected by the LFO.
  23579. </p>
  23580. </dd>
  23581. <dt><samp>offset_l</samp></dt>
  23582. <dd><p>Set left channel offset. Default is 0. Allowed range is [0 - 1].
  23583. </p>
  23584. </dd>
  23585. <dt><samp>offset_r</samp></dt>
  23586. <dd><p>Set right channel offset. Default is 0.5. Allowed range is [0 - 1].
  23587. </p>
  23588. </dd>
  23589. <dt><samp>width</samp></dt>
  23590. <dd><p>Set pulse width. Default is 1. Allowed range is [0 - 2].
  23591. </p>
  23592. </dd>
  23593. <dt><samp>timing</samp></dt>
  23594. <dd><p>Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz.
  23595. </p>
  23596. </dd>
  23597. <dt><samp>bpm</samp></dt>
  23598. <dd><p>Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing
  23599. is set to bpm.
  23600. </p>
  23601. </dd>
  23602. <dt><samp>ms</samp></dt>
  23603. <dd><p>Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing
  23604. is set to ms.
  23605. </p>
  23606. </dd>
  23607. <dt><samp>hz</samp></dt>
  23608. <dd><p>Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used
  23609. if timing is set to hz.
  23610. </p></dd>
  23611. </dl>
  23612. <span id="aresample"></span><a name="aresample-1"></a>
  23613. <h3 class="section">36.39 aresample<span class="pull-right"><a class="anchor hidden-xs" href="#aresample-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aresample-1" aria-hidden="true">TOC</a></span></h3>
  23614. <p>Resample the input audio to the specified parameters, using the
  23615. libswresample library. If none are specified then the filter will
  23616. automatically convert between its input and output.
  23617. </p>
  23618. <p>This filter is also able to stretch/squeeze the audio data to make it match
  23619. the timestamps or to inject silence / cut out audio to make it match the
  23620. timestamps, do a combination of both or do neither.
  23621. </p>
  23622. <p>The filter accepts the syntax
  23623. [<var>sample_rate</var>:]<var>resampler_options</var>, where <var>sample_rate</var>
  23624. expresses a sample rate and <var>resampler_options</var> is a list of
  23625. <var>key</var>=<var>value</var> pairs, separated by &quot;:&quot;. See the
  23626. <a href="ffmpeg-resampler.html#Resampler-Options">(ffmpeg-resampler)&quot;Resampler Options&quot; section in the
  23627. ffmpeg-resampler(1) manual</a>
  23628. for the complete list of supported options.
  23629. </p>
  23630. <a name="Examples-51"></a>
  23631. <h4 class="subsection">36.39.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-51" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-51" aria-hidden="true">TOC</a></span></h4>
  23632. <ul>
  23633. <li> Resample the input audio to 44100Hz:
  23634. <div class="example">
  23635. <pre class="example">aresample=44100
  23636. </pre></div>
  23637. </li><li> Stretch/squeeze samples to the given timestamps, with a maximum of 1000
  23638. samples per second compensation:
  23639. <div class="example">
  23640. <pre class="example">aresample=async=1000
  23641. </pre></div>
  23642. </li></ul>
  23643. <a name="areverse"></a>
  23644. <h3 class="section">36.40 areverse<span class="pull-right"><a class="anchor hidden-xs" href="#areverse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-areverse" aria-hidden="true">TOC</a></span></h3>
  23645. <p>Reverse an audio clip.
  23646. </p>
  23647. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  23648. is suggested.
  23649. </p>
  23650. <a name="Examples-52"></a>
  23651. <h4 class="subsection">36.40.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-52" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-52" aria-hidden="true">TOC</a></span></h4>
  23652. <ul>
  23653. <li> Take the first 5 seconds of a clip, and reverse it.
  23654. <div class="example">
  23655. <pre class="example">atrim=end=5,areverse
  23656. </pre></div>
  23657. </li></ul>
  23658. <a name="arnndn"></a>
  23659. <h3 class="section">36.41 arnndn<span class="pull-right"><a class="anchor hidden-xs" href="#arnndn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-arnndn" aria-hidden="true">TOC</a></span></h3>
  23660. <p>Reduce noise from speech using Recurrent Neural Networks.
  23661. </p>
  23662. <p>This filter accepts the following options:
  23663. </p>
  23664. <dl compact="compact">
  23665. <dt><samp>model, m</samp></dt>
  23666. <dd><p>Set train model file to load. This option is always required.
  23667. </p>
  23668. </dd>
  23669. <dt><samp>mix</samp></dt>
  23670. <dd><p>Set how much to mix filtered samples into final output.
  23671. Allowed range is from -1 to 1. Default value is 1.
  23672. Negative values are special, they set how much to keep filtered noise
  23673. in the final filter output. Set this option to -1 to hear actual
  23674. noise removed from input signal.
  23675. </p></dd>
  23676. </dl>
  23677. <a name="Commands-15"></a>
  23678. <h4 class="subsection">36.41.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-15" aria-hidden="true">TOC</a></span></h4>
  23679. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  23680. </p>
  23681. <a name="asetnsamples"></a>
  23682. <h3 class="section">36.42 asetnsamples<span class="pull-right"><a class="anchor hidden-xs" href="#asetnsamples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asetnsamples" aria-hidden="true">TOC</a></span></h3>
  23683. <p>Set the number of samples per each output audio frame.
  23684. </p>
  23685. <p>The last output packet may contain a different number of samples, as
  23686. the filter will flush all the remaining samples when the input audio
  23687. signals its end.
  23688. </p>
  23689. <p>The filter accepts the following options:
  23690. </p>
  23691. <dl compact="compact">
  23692. <dt><samp>nb_out_samples, n</samp></dt>
  23693. <dd><p>Set the number of frames per each output audio frame. The number is
  23694. intended as the number of samples <em>per each channel</em>.
  23695. Default value is 1024.
  23696. </p>
  23697. </dd>
  23698. <dt><samp>pad, p</samp></dt>
  23699. <dd><p>If set to 1, the filter will pad the last audio frame with zeroes, so
  23700. that the last frame will contain the same number of samples as the
  23701. previous ones. Default value is 1.
  23702. </p></dd>
  23703. </dl>
  23704. <p>For example, to set the number of per-frame samples to 1234 and
  23705. disable padding for the last frame, use:
  23706. </p><div class="example">
  23707. <pre class="example">asetnsamples=n=1234:p=0
  23708. </pre></div>
  23709. <a name="asetrate"></a>
  23710. <h3 class="section">36.43 asetrate<span class="pull-right"><a class="anchor hidden-xs" href="#asetrate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asetrate" aria-hidden="true">TOC</a></span></h3>
  23711. <p>Set the sample rate without altering the PCM data.
  23712. This will result in a change of speed and pitch.
  23713. </p>
  23714. <p>The filter accepts the following options:
  23715. </p>
  23716. <dl compact="compact">
  23717. <dt><samp>sample_rate, r</samp></dt>
  23718. <dd><p>Set the output sample rate. Default is 44100 Hz.
  23719. </p></dd>
  23720. </dl>
  23721. <a name="ashowinfo"></a>
  23722. <h3 class="section">36.44 ashowinfo<span class="pull-right"><a class="anchor hidden-xs" href="#ashowinfo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ashowinfo" aria-hidden="true">TOC</a></span></h3>
  23723. <p>Show a line containing various information for each input audio frame.
  23724. The input audio is not modified.
  23725. </p>
  23726. <p>The shown line contains a sequence of key/value pairs of the form
  23727. <var>key</var>:<var>value</var>.
  23728. </p>
  23729. <p>The following values are shown in the output:
  23730. </p>
  23731. <dl compact="compact">
  23732. <dt><samp>n</samp></dt>
  23733. <dd><p>The (sequential) number of the input frame, starting from 0.
  23734. </p>
  23735. </dd>
  23736. <dt><samp>pts</samp></dt>
  23737. <dd><p>The presentation timestamp of the input frame, in time base units; the time base
  23738. depends on the filter input pad, and is usually 1/<var>sample_rate</var>.
  23739. </p>
  23740. </dd>
  23741. <dt><samp>pts_time</samp></dt>
  23742. <dd><p>The presentation timestamp of the input frame in seconds.
  23743. </p>
  23744. </dd>
  23745. <dt><samp>pos</samp></dt>
  23746. <dd><p>position of the frame in the input stream, -1 if this information in
  23747. unavailable and/or meaningless (for example in case of synthetic audio)
  23748. </p>
  23749. </dd>
  23750. <dt><samp>fmt</samp></dt>
  23751. <dd><p>The sample format.
  23752. </p>
  23753. </dd>
  23754. <dt><samp>chlayout</samp></dt>
  23755. <dd><p>The channel layout.
  23756. </p>
  23757. </dd>
  23758. <dt><samp>rate</samp></dt>
  23759. <dd><p>The sample rate for the audio frame.
  23760. </p>
  23761. </dd>
  23762. <dt><samp>nb_samples</samp></dt>
  23763. <dd><p>The number of samples (per channel) in the frame.
  23764. </p>
  23765. </dd>
  23766. <dt><samp>checksum</samp></dt>
  23767. <dd><p>The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
  23768. audio, the data is treated as if all the planes were concatenated.
  23769. </p>
  23770. </dd>
  23771. <dt><samp>plane_checksums</samp></dt>
  23772. <dd><p>A list of Adler-32 checksums for each data plane.
  23773. </p></dd>
  23774. </dl>
  23775. <a name="asoftclip"></a>
  23776. <h3 class="section">36.45 asoftclip<span class="pull-right"><a class="anchor hidden-xs" href="#asoftclip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asoftclip" aria-hidden="true">TOC</a></span></h3>
  23777. <p>Apply audio soft clipping.
  23778. </p>
  23779. <p>Soft clipping is a type of distortion effect where the amplitude of a signal is saturated
  23780. along a smooth curve, rather than the abrupt shape of hard-clipping.
  23781. </p>
  23782. <p>This filter accepts the following options:
  23783. </p>
  23784. <dl compact="compact">
  23785. <dt><samp>type</samp></dt>
  23786. <dd><p>Set type of soft-clipping.
  23787. </p>
  23788. <p>It accepts the following values:
  23789. </p><dl compact="compact">
  23790. <dt><samp>hard</samp></dt>
  23791. <dt><samp>tanh</samp></dt>
  23792. <dt><samp>atan</samp></dt>
  23793. <dt><samp>cubic</samp></dt>
  23794. <dt><samp>exp</samp></dt>
  23795. <dt><samp>alg</samp></dt>
  23796. <dt><samp>quintic</samp></dt>
  23797. <dt><samp>sin</samp></dt>
  23798. <dt><samp>erf</samp></dt>
  23799. </dl>
  23800. </dd>
  23801. <dt><samp>threshold</samp></dt>
  23802. <dd><p>Set threshold from where to start clipping. Default value is 0dB or 1.
  23803. </p>
  23804. </dd>
  23805. <dt><samp>output</samp></dt>
  23806. <dd><p>Set gain applied to output. Default value is 0dB or 1.
  23807. </p>
  23808. </dd>
  23809. <dt><samp>param</samp></dt>
  23810. <dd><p>Set additional parameter which controls sigmoid function.
  23811. </p>
  23812. </dd>
  23813. <dt><samp>oversample</samp></dt>
  23814. <dd><p>Set oversampling factor.
  23815. </p></dd>
  23816. </dl>
  23817. <a name="Commands-16"></a>
  23818. <h4 class="subsection">36.45.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-16" aria-hidden="true">TOC</a></span></h4>
  23819. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  23820. </p>
  23821. <a name="asr"></a>
  23822. <h3 class="section">36.46 asr<span class="pull-right"><a class="anchor hidden-xs" href="#asr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asr" aria-hidden="true">TOC</a></span></h3>
  23823. <p>Automatic Speech Recognition
  23824. </p>
  23825. <p>This filter uses PocketSphinx for speech recognition. To enable
  23826. compilation of this filter, you need to configure FFmpeg with
  23827. <code>--enable-pocketsphinx</code>.
  23828. </p>
  23829. <p>It accepts the following options:
  23830. </p>
  23831. <dl compact="compact">
  23832. <dt><samp>rate</samp></dt>
  23833. <dd><p>Set sampling rate of input audio. Defaults is <code>16000</code>.
  23834. This need to match speech models, otherwise one will get poor results.
  23835. </p>
  23836. </dd>
  23837. <dt><samp>hmm</samp></dt>
  23838. <dd><p>Set dictionary containing acoustic model files.
  23839. </p>
  23840. </dd>
  23841. <dt><samp>dict</samp></dt>
  23842. <dd><p>Set pronunciation dictionary.
  23843. </p>
  23844. </dd>
  23845. <dt><samp>lm</samp></dt>
  23846. <dd><p>Set language model file.
  23847. </p>
  23848. </dd>
  23849. <dt><samp>lmctl</samp></dt>
  23850. <dd><p>Set language model set.
  23851. </p>
  23852. </dd>
  23853. <dt><samp>lmname</samp></dt>
  23854. <dd><p>Set which language model to use.
  23855. </p>
  23856. </dd>
  23857. <dt><samp>logfn</samp></dt>
  23858. <dd><p>Set output for log messages.
  23859. </p></dd>
  23860. </dl>
  23861. <p>The filter exports recognized speech as the frame metadata <code>lavfi.asr.text</code>.
  23862. </p>
  23863. <span id="astats"></span><a name="astats-1"></a>
  23864. <h3 class="section">36.47 astats<span class="pull-right"><a class="anchor hidden-xs" href="#astats-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-astats-1" aria-hidden="true">TOC</a></span></h3>
  23865. <p>Display time domain statistical information about the audio channels.
  23866. Statistics are calculated and displayed for each audio channel and,
  23867. where applicable, an overall figure is also given.
  23868. </p>
  23869. <p>It accepts the following option:
  23870. </p><dl compact="compact">
  23871. <dt><samp>length</samp></dt>
  23872. <dd><p>Short window length in seconds, used for peak and trough RMS measurement.
  23873. Default is <code>0.05</code> (50 milliseconds). Allowed range is <code>[0.01 - 10]</code>.
  23874. </p>
  23875. </dd>
  23876. <dt><samp>metadata</samp></dt>
  23877. <dd>
  23878. <p>Set metadata injection. All the metadata keys are prefixed with <code>lavfi.astats.X</code>,
  23879. where <code>X</code> is channel number starting from 1 or string <code>Overall</code>. Default is
  23880. disabled.
  23881. </p>
  23882. <p>Available keys for each channel are:
  23883. DC_offset
  23884. Min_level
  23885. Max_level
  23886. Min_difference
  23887. Max_difference
  23888. Mean_difference
  23889. RMS_difference
  23890. Peak_level
  23891. RMS_peak
  23892. RMS_trough
  23893. Crest_factor
  23894. Flat_factor
  23895. Peak_count
  23896. Noise_floor
  23897. Noise_floor_count
  23898. Bit_depth
  23899. Dynamic_range
  23900. Zero_crossings
  23901. Zero_crossings_rate
  23902. Number_of_NaNs
  23903. Number_of_Infs
  23904. Number_of_denormals
  23905. </p>
  23906. <p>and for Overall:
  23907. DC_offset
  23908. Min_level
  23909. Max_level
  23910. Min_difference
  23911. Max_difference
  23912. Mean_difference
  23913. RMS_difference
  23914. Peak_level
  23915. RMS_level
  23916. RMS_peak
  23917. RMS_trough
  23918. Flat_factor
  23919. Peak_count
  23920. Noise_floor
  23921. Noise_floor_count
  23922. Bit_depth
  23923. Number_of_samples
  23924. Number_of_NaNs
  23925. Number_of_Infs
  23926. Number_of_denormals
  23927. </p>
  23928. <p>For example full key look like this <code>lavfi.astats.1.DC_offset</code> or
  23929. this <code>lavfi.astats.Overall.Peak_count</code>.
  23930. </p>
  23931. <p>For description what each key means read below.
  23932. </p>
  23933. </dd>
  23934. <dt><samp>reset</samp></dt>
  23935. <dd><p>Set number of frame after which stats are going to be recalculated.
  23936. Default is disabled.
  23937. </p>
  23938. </dd>
  23939. <dt><samp>measure_perchannel</samp></dt>
  23940. <dd><p>Select the entries which need to be measured per channel. The metadata keys can
  23941. be used as flags, default is <samp>all</samp> which measures everything.
  23942. <samp>none</samp> disables all per channel measurement.
  23943. </p>
  23944. </dd>
  23945. <dt><samp>measure_overall</samp></dt>
  23946. <dd><p>Select the entries which need to be measured overall. The metadata keys can
  23947. be used as flags, default is <samp>all</samp> which measures everything.
  23948. <samp>none</samp> disables all overall measurement.
  23949. </p>
  23950. </dd>
  23951. </dl>
  23952. <p>A description of each shown parameter follows:
  23953. </p>
  23954. <dl compact="compact">
  23955. <dt><samp>DC offset</samp></dt>
  23956. <dd><p>Mean amplitude displacement from zero.
  23957. </p>
  23958. </dd>
  23959. <dt><samp>Min level</samp></dt>
  23960. <dd><p>Minimal sample level.
  23961. </p>
  23962. </dd>
  23963. <dt><samp>Max level</samp></dt>
  23964. <dd><p>Maximal sample level.
  23965. </p>
  23966. </dd>
  23967. <dt><samp>Min difference</samp></dt>
  23968. <dd><p>Minimal difference between two consecutive samples.
  23969. </p>
  23970. </dd>
  23971. <dt><samp>Max difference</samp></dt>
  23972. <dd><p>Maximal difference between two consecutive samples.
  23973. </p>
  23974. </dd>
  23975. <dt><samp>Mean difference</samp></dt>
  23976. <dd><p>Mean difference between two consecutive samples.
  23977. The average of each difference between two consecutive samples.
  23978. </p>
  23979. </dd>
  23980. <dt><samp>RMS difference</samp></dt>
  23981. <dd><p>Root Mean Square difference between two consecutive samples.
  23982. </p>
  23983. </dd>
  23984. <dt><samp>Peak level dB</samp></dt>
  23985. <dt><samp>RMS level dB</samp></dt>
  23986. <dd><p>Standard peak and RMS level measured in dBFS.
  23987. </p>
  23988. </dd>
  23989. <dt><samp>RMS peak dB</samp></dt>
  23990. <dt><samp>RMS trough dB</samp></dt>
  23991. <dd><p>Peak and trough values for RMS level measured over a short window.
  23992. </p>
  23993. </dd>
  23994. <dt><samp>Crest factor</samp></dt>
  23995. <dd><p>Standard ratio of peak to RMS level (note: not in dB).
  23996. </p>
  23997. </dd>
  23998. <dt><samp>Flat factor</samp></dt>
  23999. <dd><p>Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
  24000. (i.e. either <var>Min level</var> or <var>Max level</var>).
  24001. </p>
  24002. </dd>
  24003. <dt><samp>Peak count</samp></dt>
  24004. <dd><p>Number of occasions (not the number of samples) that the signal attained either
  24005. <var>Min level</var> or <var>Max level</var>.
  24006. </p>
  24007. </dd>
  24008. <dt><samp>Noise floor dB</samp></dt>
  24009. <dd><p>Minimum local peak measured in dBFS over a short window.
  24010. </p>
  24011. </dd>
  24012. <dt><samp>Noise floor count</samp></dt>
  24013. <dd><p>Number of occasions (not the number of samples) that the signal attained
  24014. <var>Noise floor</var>.
  24015. </p>
  24016. </dd>
  24017. <dt><samp>Bit depth</samp></dt>
  24018. <dd><p>Overall bit depth of audio. Number of bits used for each sample.
  24019. </p>
  24020. </dd>
  24021. <dt><samp>Dynamic range</samp></dt>
  24022. <dd><p>Measured dynamic range of audio in dB.
  24023. </p>
  24024. </dd>
  24025. <dt><samp>Zero crossings</samp></dt>
  24026. <dd><p>Number of points where the waveform crosses the zero level axis.
  24027. </p>
  24028. </dd>
  24029. <dt><samp>Zero crossings rate</samp></dt>
  24030. <dd><p>Rate of Zero crossings and number of audio samples.
  24031. </p></dd>
  24032. </dl>
  24033. <a name="asubboost"></a>
  24034. <h3 class="section">36.48 asubboost<span class="pull-right"><a class="anchor hidden-xs" href="#asubboost" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asubboost" aria-hidden="true">TOC</a></span></h3>
  24035. <p>Boost subwoofer frequencies.
  24036. </p>
  24037. <p>The filter accepts the following options:
  24038. </p>
  24039. <dl compact="compact">
  24040. <dt><samp>dry</samp></dt>
  24041. <dd><p>Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1.
  24042. Default value is 0.7.
  24043. </p>
  24044. </dd>
  24045. <dt><samp>wet</samp></dt>
  24046. <dd><p>Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1.
  24047. Default value is 0.7.
  24048. </p>
  24049. </dd>
  24050. <dt><samp>decay</samp></dt>
  24051. <dd><p>Set delay line decay gain value. Allowed range is from 0 to 1.
  24052. Default value is 0.7.
  24053. </p>
  24054. </dd>
  24055. <dt><samp>feedback</samp></dt>
  24056. <dd><p>Set delay line feedback gain value. Allowed range is from 0 to 1.
  24057. Default value is 0.9.
  24058. </p>
  24059. </dd>
  24060. <dt><samp>cutoff</samp></dt>
  24061. <dd><p>Set cutoff frequency in Hertz. Allowed range is 50 to 900.
  24062. Default value is 100.
  24063. </p>
  24064. </dd>
  24065. <dt><samp>slope</samp></dt>
  24066. <dd><p>Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1.
  24067. Default value is 0.5.
  24068. </p>
  24069. </dd>
  24070. <dt><samp>delay</samp></dt>
  24071. <dd><p>Set delay. Allowed range is from 1 to 100.
  24072. Default value is 20.
  24073. </p></dd>
  24074. </dl>
  24075. <a name="Commands-17"></a>
  24076. <h4 class="subsection">36.48.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-17" aria-hidden="true">TOC</a></span></h4>
  24077. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  24078. </p>
  24079. <a name="asubcut"></a>
  24080. <h3 class="section">36.49 asubcut<span class="pull-right"><a class="anchor hidden-xs" href="#asubcut" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asubcut" aria-hidden="true">TOC</a></span></h3>
  24081. <p>Cut subwoofer frequencies.
  24082. </p>
  24083. <p>This filter allows to set custom, steeper
  24084. roll off than highpass filter, and thus is able to more attenuate
  24085. frequency content in stop-band.
  24086. </p>
  24087. <p>The filter accepts the following options:
  24088. </p>
  24089. <dl compact="compact">
  24090. <dt><samp>cutoff</samp></dt>
  24091. <dd><p>Set cutoff frequency in Hertz. Allowed range is 2 to 200.
  24092. Default value is 20.
  24093. </p>
  24094. </dd>
  24095. <dt><samp>order</samp></dt>
  24096. <dd><p>Set filter order. Available values are from 3 to 20.
  24097. Default value is 10.
  24098. </p>
  24099. </dd>
  24100. <dt><samp>level</samp></dt>
  24101. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  24102. </p></dd>
  24103. </dl>
  24104. <a name="Commands-18"></a>
  24105. <h4 class="subsection">36.49.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-18" aria-hidden="true">TOC</a></span></h4>
  24106. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  24107. </p>
  24108. <a name="asupercut"></a>
  24109. <h3 class="section">36.50 asupercut<span class="pull-right"><a class="anchor hidden-xs" href="#asupercut" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asupercut" aria-hidden="true">TOC</a></span></h3>
  24110. <p>Cut super frequencies.
  24111. </p>
  24112. <p>The filter accepts the following options:
  24113. </p>
  24114. <dl compact="compact">
  24115. <dt><samp>cutoff</samp></dt>
  24116. <dd><p>Set cutoff frequency in Hertz. Allowed range is 20000 to 192000.
  24117. Default value is 20000.
  24118. </p>
  24119. </dd>
  24120. <dt><samp>order</samp></dt>
  24121. <dd><p>Set filter order. Available values are from 3 to 20.
  24122. Default value is 10.
  24123. </p>
  24124. </dd>
  24125. <dt><samp>level</samp></dt>
  24126. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  24127. </p></dd>
  24128. </dl>
  24129. <a name="Commands-19"></a>
  24130. <h4 class="subsection">36.50.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-19" aria-hidden="true">TOC</a></span></h4>
  24131. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  24132. </p>
  24133. <a name="asuperpass"></a>
  24134. <h3 class="section">36.51 asuperpass<span class="pull-right"><a class="anchor hidden-xs" href="#asuperpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asuperpass" aria-hidden="true">TOC</a></span></h3>
  24135. <p>Apply high order Butterworth band-pass filter.
  24136. </p>
  24137. <p>The filter accepts the following options:
  24138. </p>
  24139. <dl compact="compact">
  24140. <dt><samp>centerf</samp></dt>
  24141. <dd><p>Set center frequency in Hertz. Allowed range is 2 to 999999.
  24142. Default value is 1000.
  24143. </p>
  24144. </dd>
  24145. <dt><samp>order</samp></dt>
  24146. <dd><p>Set filter order. Available values are from 4 to 20.
  24147. Default value is 4.
  24148. </p>
  24149. </dd>
  24150. <dt><samp>qfactor</samp></dt>
  24151. <dd><p>Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1.
  24152. </p>
  24153. </dd>
  24154. <dt><samp>level</samp></dt>
  24155. <dd><p>Set input gain level. Allowed range is from 0 to 2. Default value is 1.
  24156. </p></dd>
  24157. </dl>
  24158. <a name="Commands-20"></a>
  24159. <h4 class="subsection">36.51.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-20" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-20" aria-hidden="true">TOC</a></span></h4>
  24160. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  24161. </p>
  24162. <a name="asuperstop"></a>
  24163. <h3 class="section">36.52 asuperstop<span class="pull-right"><a class="anchor hidden-xs" href="#asuperstop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asuperstop" aria-hidden="true">TOC</a></span></h3>
  24164. <p>Apply high order Butterworth band-stop filter.
  24165. </p>
  24166. <p>The filter accepts the following options:
  24167. </p>
  24168. <dl compact="compact">
  24169. <dt><samp>centerf</samp></dt>
  24170. <dd><p>Set center frequency in Hertz. Allowed range is 2 to 999999.
  24171. Default value is 1000.
  24172. </p>
  24173. </dd>
  24174. <dt><samp>order</samp></dt>
  24175. <dd><p>Set filter order. Available values are from 4 to 20.
  24176. Default value is 4.
  24177. </p>
  24178. </dd>
  24179. <dt><samp>qfactor</samp></dt>
  24180. <dd><p>Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1.
  24181. </p>
  24182. </dd>
  24183. <dt><samp>level</samp></dt>
  24184. <dd><p>Set input gain level. Allowed range is from 0 to 2. Default value is 1.
  24185. </p></dd>
  24186. </dl>
  24187. <a name="Commands-21"></a>
  24188. <h4 class="subsection">36.52.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-21" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-21" aria-hidden="true">TOC</a></span></h4>
  24189. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  24190. </p>
  24191. <a name="atempo"></a>
  24192. <h3 class="section">36.53 atempo<span class="pull-right"><a class="anchor hidden-xs" href="#atempo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atempo" aria-hidden="true">TOC</a></span></h3>
  24193. <p>Adjust audio tempo.
  24194. </p>
  24195. <p>The filter accepts exactly one parameter, the audio tempo. If not
  24196. specified then the filter will assume nominal 1.0 tempo. Tempo must
  24197. be in the [0.5, 100.0] range.
  24198. </p>
  24199. <p>Note that tempo greater than 2 will skip some samples rather than
  24200. blend them in. If for any reason this is a concern it is always
  24201. possible to daisy-chain several instances of atempo to achieve the
  24202. desired product tempo.
  24203. </p>
  24204. <a name="Examples-53"></a>
  24205. <h4 class="subsection">36.53.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-53" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-53" aria-hidden="true">TOC</a></span></h4>
  24206. <ul>
  24207. <li> Slow down audio to 80% tempo:
  24208. <div class="example">
  24209. <pre class="example">atempo=0.8
  24210. </pre></div>
  24211. </li><li> To speed up audio to 300% tempo:
  24212. <div class="example">
  24213. <pre class="example">atempo=3
  24214. </pre></div>
  24215. </li><li> To speed up audio to 300% tempo by daisy-chaining two atempo instances:
  24216. <div class="example">
  24217. <pre class="example">atempo=sqrt(3),atempo=sqrt(3)
  24218. </pre></div>
  24219. </li></ul>
  24220. <a name="Commands-22"></a>
  24221. <h4 class="subsection">36.53.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-22" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-22" aria-hidden="true">TOC</a></span></h4>
  24222. <p>This filter supports the following commands:
  24223. </p><dl compact="compact">
  24224. <dt><samp>tempo</samp></dt>
  24225. <dd><p>Change filter tempo scale factor.
  24226. Syntax for the command is : &quot;<var>tempo</var>&quot;
  24227. </p></dd>
  24228. </dl>
  24229. <a name="atrim"></a>
  24230. <h3 class="section">36.54 atrim<span class="pull-right"><a class="anchor hidden-xs" href="#atrim" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atrim" aria-hidden="true">TOC</a></span></h3>
  24231. <p>Trim the input so that the output contains one continuous subpart of the input.
  24232. </p>
  24233. <p>It accepts the following parameters:
  24234. </p><dl compact="compact">
  24235. <dt><samp>start</samp></dt>
  24236. <dd><p>Timestamp (in seconds) of the start of the section to keep. I.e. the audio
  24237. sample with the timestamp <var>start</var> will be the first sample in the output.
  24238. </p>
  24239. </dd>
  24240. <dt><samp>end</samp></dt>
  24241. <dd><p>Specify time of the first audio sample that will be dropped, i.e. the
  24242. audio sample immediately preceding the one with the timestamp <var>end</var> will be
  24243. the last sample in the output.
  24244. </p>
  24245. </dd>
  24246. <dt><samp>start_pts</samp></dt>
  24247. <dd><p>Same as <var>start</var>, except this option sets the start timestamp in samples
  24248. instead of seconds.
  24249. </p>
  24250. </dd>
  24251. <dt><samp>end_pts</samp></dt>
  24252. <dd><p>Same as <var>end</var>, except this option sets the end timestamp in samples instead
  24253. of seconds.
  24254. </p>
  24255. </dd>
  24256. <dt><samp>duration</samp></dt>
  24257. <dd><p>The maximum duration of the output in seconds.
  24258. </p>
  24259. </dd>
  24260. <dt><samp>start_sample</samp></dt>
  24261. <dd><p>The number of the first sample that should be output.
  24262. </p>
  24263. </dd>
  24264. <dt><samp>end_sample</samp></dt>
  24265. <dd><p>The number of the first sample that should be dropped.
  24266. </p></dd>
  24267. </dl>
  24268. <p><samp>start</samp>, <samp>end</samp>, and <samp>duration</samp> are expressed as time
  24269. duration specifications; see
  24270. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  24271. </p>
  24272. <p>Note that the first two sets of the start/end options and the <samp>duration</samp>
  24273. option look at the frame timestamp, while the _sample options simply count the
  24274. samples that pass through the filter. So start/end_pts and start/end_sample will
  24275. give different results when the timestamps are wrong, inexact or do not start at
  24276. zero. Also note that this filter does not modify the timestamps. If you wish
  24277. to have the output timestamps start at zero, insert the asetpts filter after the
  24278. atrim filter.
  24279. </p>
  24280. <p>If multiple start or end options are set, this filter tries to be greedy and
  24281. keep all samples that match at least one of the specified constraints. To keep
  24282. only the part that matches all the constraints at once, chain multiple atrim
  24283. filters.
  24284. </p>
  24285. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  24286. just the end values to keep everything before the specified time.
  24287. </p>
  24288. <p>Examples:
  24289. </p><ul>
  24290. <li> Drop everything except the second minute of input:
  24291. <div class="example">
  24292. <pre class="example">ffmpeg -i INPUT -af atrim=60:120
  24293. </pre></div>
  24294. </li><li> Keep only the first 1000 samples:
  24295. <div class="example">
  24296. <pre class="example">ffmpeg -i INPUT -af atrim=end_sample=1000
  24297. </pre></div>
  24298. </li></ul>
  24299. <a name="axcorrelate"></a>
  24300. <h3 class="section">36.55 axcorrelate<span class="pull-right"><a class="anchor hidden-xs" href="#axcorrelate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-axcorrelate" aria-hidden="true">TOC</a></span></h3>
  24301. <p>Calculate normalized cross-correlation between two input audio streams.
  24302. </p>
  24303. <p>Resulted samples are always between -1 and 1 inclusive.
  24304. If result is 1 it means two input samples are highly correlated in that selected segment.
  24305. Result 0 means they are not correlated at all.
  24306. If result is -1 it means two input samples are out of phase, which means they cancel each
  24307. other.
  24308. </p>
  24309. <p>The filter accepts the following options:
  24310. </p>
  24311. <dl compact="compact">
  24312. <dt><samp>size</samp></dt>
  24313. <dd><p>Set size of segment over which cross-correlation is calculated.
  24314. Default is 256. Allowed range is from 2 to 131072.
  24315. </p>
  24316. </dd>
  24317. <dt><samp>algo</samp></dt>
  24318. <dd><p>Set algorithm for cross-correlation. Can be <code>slow</code> or <code>fast</code>.
  24319. Default is <code>slow</code>. Fast algorithm assumes mean values over any given segment
  24320. are always zero and thus need much less calculations to make.
  24321. This is generally not true, but is valid for typical audio streams.
  24322. </p></dd>
  24323. </dl>
  24324. <a name="Examples-54"></a>
  24325. <h4 class="subsection">36.55.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-54" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-54" aria-hidden="true">TOC</a></span></h4>
  24326. <ul>
  24327. <li> Calculate correlation between channels in stereo audio stream:
  24328. <div class="example">
  24329. <pre class="example">ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
  24330. </pre></div>
  24331. </li></ul>
  24332. <a name="bandpass"></a>
  24333. <h3 class="section">36.56 bandpass<span class="pull-right"><a class="anchor hidden-xs" href="#bandpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bandpass" aria-hidden="true">TOC</a></span></h3>
  24334. <p>Apply a two-pole Butterworth band-pass filter with central
  24335. frequency <var>frequency</var>, and (3dB-point) band-width width.
  24336. The <var>csg</var> option selects a constant skirt gain (peak gain = Q)
  24337. instead of the default: constant 0dB peak gain.
  24338. The filter roll off at 6dB per octave (20dB per decade).
  24339. </p>
  24340. <p>The filter accepts the following options:
  24341. </p>
  24342. <dl compact="compact">
  24343. <dt><samp>frequency, f</samp></dt>
  24344. <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
  24345. </p>
  24346. </dd>
  24347. <dt><samp>csg</samp></dt>
  24348. <dd><p>Constant skirt gain if set to 1. Defaults to 0.
  24349. </p>
  24350. </dd>
  24351. <dt><samp>width_type, t</samp></dt>
  24352. <dd><p>Set method to specify band-width of filter.
  24353. </p><dl compact="compact">
  24354. <dt><samp>h</samp></dt>
  24355. <dd><p>Hz
  24356. </p></dd>
  24357. <dt><samp>q</samp></dt>
  24358. <dd><p>Q-Factor
  24359. </p></dd>
  24360. <dt><samp>o</samp></dt>
  24361. <dd><p>octave
  24362. </p></dd>
  24363. <dt><samp>s</samp></dt>
  24364. <dd><p>slope
  24365. </p></dd>
  24366. <dt><samp>k</samp></dt>
  24367. <dd><p>kHz
  24368. </p></dd>
  24369. </dl>
  24370. </dd>
  24371. <dt><samp>width, w</samp></dt>
  24372. <dd><p>Specify the band-width of a filter in width_type units.
  24373. </p>
  24374. </dd>
  24375. <dt><samp>mix, m</samp></dt>
  24376. <dd><p>How much to use filtered signal in output. Default is 1.
  24377. Range is between 0 and 1.
  24378. </p>
  24379. </dd>
  24380. <dt><samp>channels, c</samp></dt>
  24381. <dd><p>Specify which channels to filter, by default all available are filtered.
  24382. </p>
  24383. </dd>
  24384. <dt><samp>normalize, n</samp></dt>
  24385. <dd><p>Normalize biquad coefficients, by default is disabled.
  24386. Enabling it will normalize magnitude response at DC to 0dB.
  24387. </p>
  24388. </dd>
  24389. <dt><samp>transform, a</samp></dt>
  24390. <dd><p>Set transform type of IIR filter.
  24391. </p><dl compact="compact">
  24392. <dt><samp>di</samp></dt>
  24393. <dt><samp>dii</samp></dt>
  24394. <dt><samp>tdii</samp></dt>
  24395. <dt><samp>latt</samp></dt>
  24396. </dl>
  24397. </dd>
  24398. <dt><samp>precision, r</samp></dt>
  24399. <dd><p>Set precison of filtering.
  24400. </p><dl compact="compact">
  24401. <dt><samp>auto</samp></dt>
  24402. <dd><p>Pick automatic sample format depending on surround filters.
  24403. </p></dd>
  24404. <dt><samp>s16</samp></dt>
  24405. <dd><p>Always use signed 16-bit.
  24406. </p></dd>
  24407. <dt><samp>s32</samp></dt>
  24408. <dd><p>Always use signed 32-bit.
  24409. </p></dd>
  24410. <dt><samp>f32</samp></dt>
  24411. <dd><p>Always use float 32-bit.
  24412. </p></dd>
  24413. <dt><samp>f64</samp></dt>
  24414. <dd><p>Always use float 64-bit.
  24415. </p></dd>
  24416. </dl>
  24417. </dd>
  24418. </dl>
  24419. <a name="Commands-23"></a>
  24420. <h4 class="subsection">36.56.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-23" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-23" aria-hidden="true">TOC</a></span></h4>
  24421. <p>This filter supports the following commands:
  24422. </p><dl compact="compact">
  24423. <dt><samp>frequency, f</samp></dt>
  24424. <dd><p>Change bandpass frequency.
  24425. Syntax for the command is : &quot;<var>frequency</var>&quot;
  24426. </p>
  24427. </dd>
  24428. <dt><samp>width_type, t</samp></dt>
  24429. <dd><p>Change bandpass width_type.
  24430. Syntax for the command is : &quot;<var>width_type</var>&quot;
  24431. </p>
  24432. </dd>
  24433. <dt><samp>width, w</samp></dt>
  24434. <dd><p>Change bandpass width.
  24435. Syntax for the command is : &quot;<var>width</var>&quot;
  24436. </p>
  24437. </dd>
  24438. <dt><samp>mix, m</samp></dt>
  24439. <dd><p>Change bandpass mix.
  24440. Syntax for the command is : &quot;<var>mix</var>&quot;
  24441. </p></dd>
  24442. </dl>
  24443. <a name="bandreject"></a>
  24444. <h3 class="section">36.57 bandreject<span class="pull-right"><a class="anchor hidden-xs" href="#bandreject" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bandreject" aria-hidden="true">TOC</a></span></h3>
  24445. <p>Apply a two-pole Butterworth band-reject filter with central
  24446. frequency <var>frequency</var>, and (3dB-point) band-width <var>width</var>.
  24447. The filter roll off at 6dB per octave (20dB per decade).
  24448. </p>
  24449. <p>The filter accepts the following options:
  24450. </p>
  24451. <dl compact="compact">
  24452. <dt><samp>frequency, f</samp></dt>
  24453. <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
  24454. </p>
  24455. </dd>
  24456. <dt><samp>width_type, t</samp></dt>
  24457. <dd><p>Set method to specify band-width of filter.
  24458. </p><dl compact="compact">
  24459. <dt><samp>h</samp></dt>
  24460. <dd><p>Hz
  24461. </p></dd>
  24462. <dt><samp>q</samp></dt>
  24463. <dd><p>Q-Factor
  24464. </p></dd>
  24465. <dt><samp>o</samp></dt>
  24466. <dd><p>octave
  24467. </p></dd>
  24468. <dt><samp>s</samp></dt>
  24469. <dd><p>slope
  24470. </p></dd>
  24471. <dt><samp>k</samp></dt>
  24472. <dd><p>kHz
  24473. </p></dd>
  24474. </dl>
  24475. </dd>
  24476. <dt><samp>width, w</samp></dt>
  24477. <dd><p>Specify the band-width of a filter in width_type units.
  24478. </p>
  24479. </dd>
  24480. <dt><samp>mix, m</samp></dt>
  24481. <dd><p>How much to use filtered signal in output. Default is 1.
  24482. Range is between 0 and 1.
  24483. </p>
  24484. </dd>
  24485. <dt><samp>channels, c</samp></dt>
  24486. <dd><p>Specify which channels to filter, by default all available are filtered.
  24487. </p>
  24488. </dd>
  24489. <dt><samp>normalize, n</samp></dt>
  24490. <dd><p>Normalize biquad coefficients, by default is disabled.
  24491. Enabling it will normalize magnitude response at DC to 0dB.
  24492. </p>
  24493. </dd>
  24494. <dt><samp>transform, a</samp></dt>
  24495. <dd><p>Set transform type of IIR filter.
  24496. </p><dl compact="compact">
  24497. <dt><samp>di</samp></dt>
  24498. <dt><samp>dii</samp></dt>
  24499. <dt><samp>tdii</samp></dt>
  24500. <dt><samp>latt</samp></dt>
  24501. </dl>
  24502. </dd>
  24503. <dt><samp>precision, r</samp></dt>
  24504. <dd><p>Set precison of filtering.
  24505. </p><dl compact="compact">
  24506. <dt><samp>auto</samp></dt>
  24507. <dd><p>Pick automatic sample format depending on surround filters.
  24508. </p></dd>
  24509. <dt><samp>s16</samp></dt>
  24510. <dd><p>Always use signed 16-bit.
  24511. </p></dd>
  24512. <dt><samp>s32</samp></dt>
  24513. <dd><p>Always use signed 32-bit.
  24514. </p></dd>
  24515. <dt><samp>f32</samp></dt>
  24516. <dd><p>Always use float 32-bit.
  24517. </p></dd>
  24518. <dt><samp>f64</samp></dt>
  24519. <dd><p>Always use float 64-bit.
  24520. </p></dd>
  24521. </dl>
  24522. </dd>
  24523. </dl>
  24524. <a name="Commands-24"></a>
  24525. <h4 class="subsection">36.57.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-24" aria-hidden="true">TOC</a></span></h4>
  24526. <p>This filter supports the following commands:
  24527. </p><dl compact="compact">
  24528. <dt><samp>frequency, f</samp></dt>
  24529. <dd><p>Change bandreject frequency.
  24530. Syntax for the command is : &quot;<var>frequency</var>&quot;
  24531. </p>
  24532. </dd>
  24533. <dt><samp>width_type, t</samp></dt>
  24534. <dd><p>Change bandreject width_type.
  24535. Syntax for the command is : &quot;<var>width_type</var>&quot;
  24536. </p>
  24537. </dd>
  24538. <dt><samp>width, w</samp></dt>
  24539. <dd><p>Change bandreject width.
  24540. Syntax for the command is : &quot;<var>width</var>&quot;
  24541. </p>
  24542. </dd>
  24543. <dt><samp>mix, m</samp></dt>
  24544. <dd><p>Change bandreject mix.
  24545. Syntax for the command is : &quot;<var>mix</var>&quot;
  24546. </p></dd>
  24547. </dl>
  24548. <a name="bass_002c-lowshelf"></a>
  24549. <h3 class="section">36.58 bass, lowshelf<span class="pull-right"><a class="anchor hidden-xs" href="#bass_002c-lowshelf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bass_002c-lowshelf" aria-hidden="true">TOC</a></span></h3>
  24550. <p>Boost or cut the bass (lower) frequencies of the audio using a two-pole
  24551. shelving filter with a response similar to that of a standard
  24552. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  24553. </p>
  24554. <p>The filter accepts the following options:
  24555. </p>
  24556. <dl compact="compact">
  24557. <dt><samp>gain, g</samp></dt>
  24558. <dd><p>Give the gain at 0 Hz. Its useful range is about -20
  24559. (for a large cut) to +20 (for a large boost).
  24560. Beware of clipping when using a positive gain.
  24561. </p>
  24562. </dd>
  24563. <dt><samp>frequency, f</samp></dt>
  24564. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  24565. to extend or reduce the frequency range to be boosted or cut.
  24566. The default value is <code>100</code> Hz.
  24567. </p>
  24568. </dd>
  24569. <dt><samp>width_type, t</samp></dt>
  24570. <dd><p>Set method to specify band-width of filter.
  24571. </p><dl compact="compact">
  24572. <dt><samp>h</samp></dt>
  24573. <dd><p>Hz
  24574. </p></dd>
  24575. <dt><samp>q</samp></dt>
  24576. <dd><p>Q-Factor
  24577. </p></dd>
  24578. <dt><samp>o</samp></dt>
  24579. <dd><p>octave
  24580. </p></dd>
  24581. <dt><samp>s</samp></dt>
  24582. <dd><p>slope
  24583. </p></dd>
  24584. <dt><samp>k</samp></dt>
  24585. <dd><p>kHz
  24586. </p></dd>
  24587. </dl>
  24588. </dd>
  24589. <dt><samp>width, w</samp></dt>
  24590. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  24591. </p>
  24592. </dd>
  24593. <dt><samp>poles, p</samp></dt>
  24594. <dd><p>Set number of poles. Default is 2.
  24595. </p>
  24596. </dd>
  24597. <dt><samp>mix, m</samp></dt>
  24598. <dd><p>How much to use filtered signal in output. Default is 1.
  24599. Range is between 0 and 1.
  24600. </p>
  24601. </dd>
  24602. <dt><samp>channels, c</samp></dt>
  24603. <dd><p>Specify which channels to filter, by default all available are filtered.
  24604. </p>
  24605. </dd>
  24606. <dt><samp>normalize, n</samp></dt>
  24607. <dd><p>Normalize biquad coefficients, by default is disabled.
  24608. Enabling it will normalize magnitude response at DC to 0dB.
  24609. </p>
  24610. </dd>
  24611. <dt><samp>transform, a</samp></dt>
  24612. <dd><p>Set transform type of IIR filter.
  24613. </p><dl compact="compact">
  24614. <dt><samp>di</samp></dt>
  24615. <dt><samp>dii</samp></dt>
  24616. <dt><samp>tdii</samp></dt>
  24617. <dt><samp>latt</samp></dt>
  24618. </dl>
  24619. </dd>
  24620. <dt><samp>precision, r</samp></dt>
  24621. <dd><p>Set precison of filtering.
  24622. </p><dl compact="compact">
  24623. <dt><samp>auto</samp></dt>
  24624. <dd><p>Pick automatic sample format depending on surround filters.
  24625. </p></dd>
  24626. <dt><samp>s16</samp></dt>
  24627. <dd><p>Always use signed 16-bit.
  24628. </p></dd>
  24629. <dt><samp>s32</samp></dt>
  24630. <dd><p>Always use signed 32-bit.
  24631. </p></dd>
  24632. <dt><samp>f32</samp></dt>
  24633. <dd><p>Always use float 32-bit.
  24634. </p></dd>
  24635. <dt><samp>f64</samp></dt>
  24636. <dd><p>Always use float 64-bit.
  24637. </p></dd>
  24638. </dl>
  24639. </dd>
  24640. </dl>
  24641. <a name="Commands-25"></a>
  24642. <h4 class="subsection">36.58.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-25" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-25" aria-hidden="true">TOC</a></span></h4>
  24643. <p>This filter supports the following commands:
  24644. </p><dl compact="compact">
  24645. <dt><samp>frequency, f</samp></dt>
  24646. <dd><p>Change bass frequency.
  24647. Syntax for the command is : &quot;<var>frequency</var>&quot;
  24648. </p>
  24649. </dd>
  24650. <dt><samp>width_type, t</samp></dt>
  24651. <dd><p>Change bass width_type.
  24652. Syntax for the command is : &quot;<var>width_type</var>&quot;
  24653. </p>
  24654. </dd>
  24655. <dt><samp>width, w</samp></dt>
  24656. <dd><p>Change bass width.
  24657. Syntax for the command is : &quot;<var>width</var>&quot;
  24658. </p>
  24659. </dd>
  24660. <dt><samp>gain, g</samp></dt>
  24661. <dd><p>Change bass gain.
  24662. Syntax for the command is : &quot;<var>gain</var>&quot;
  24663. </p>
  24664. </dd>
  24665. <dt><samp>mix, m</samp></dt>
  24666. <dd><p>Change bass mix.
  24667. Syntax for the command is : &quot;<var>mix</var>&quot;
  24668. </p></dd>
  24669. </dl>
  24670. <a name="biquad"></a>
  24671. <h3 class="section">36.59 biquad<span class="pull-right"><a class="anchor hidden-xs" href="#biquad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-biquad" aria-hidden="true">TOC</a></span></h3>
  24672. <p>Apply a biquad IIR filter with the given coefficients.
  24673. Where <var>b0</var>, <var>b1</var>, <var>b2</var> and <var>a0</var>, <var>a1</var>, <var>a2</var>
  24674. are the numerator and denominator coefficients respectively.
  24675. and <var>channels</var>, <var>c</var> specify which channels to filter, by default all
  24676. available are filtered.
  24677. </p>
  24678. <a name="Commands-26"></a>
  24679. <h4 class="subsection">36.59.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-26" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-26" aria-hidden="true">TOC</a></span></h4>
  24680. <p>This filter supports the following commands:
  24681. </p><dl compact="compact">
  24682. <dt><samp>a0</samp></dt>
  24683. <dt><samp>a1</samp></dt>
  24684. <dt><samp>a2</samp></dt>
  24685. <dt><samp>b0</samp></dt>
  24686. <dt><samp>b1</samp></dt>
  24687. <dt><samp>b2</samp></dt>
  24688. <dd><p>Change biquad parameter.
  24689. Syntax for the command is : &quot;<var>value</var>&quot;
  24690. </p>
  24691. </dd>
  24692. <dt><samp>mix, m</samp></dt>
  24693. <dd><p>How much to use filtered signal in output. Default is 1.
  24694. Range is between 0 and 1.
  24695. </p>
  24696. </dd>
  24697. <dt><samp>channels, c</samp></dt>
  24698. <dd><p>Specify which channels to filter, by default all available are filtered.
  24699. </p>
  24700. </dd>
  24701. <dt><samp>normalize, n</samp></dt>
  24702. <dd><p>Normalize biquad coefficients, by default is disabled.
  24703. Enabling it will normalize magnitude response at DC to 0dB.
  24704. </p>
  24705. </dd>
  24706. <dt><samp>transform, a</samp></dt>
  24707. <dd><p>Set transform type of IIR filter.
  24708. </p><dl compact="compact">
  24709. <dt><samp>di</samp></dt>
  24710. <dt><samp>dii</samp></dt>
  24711. <dt><samp>tdii</samp></dt>
  24712. <dt><samp>latt</samp></dt>
  24713. </dl>
  24714. </dd>
  24715. <dt><samp>precision, r</samp></dt>
  24716. <dd><p>Set precison of filtering.
  24717. </p><dl compact="compact">
  24718. <dt><samp>auto</samp></dt>
  24719. <dd><p>Pick automatic sample format depending on surround filters.
  24720. </p></dd>
  24721. <dt><samp>s16</samp></dt>
  24722. <dd><p>Always use signed 16-bit.
  24723. </p></dd>
  24724. <dt><samp>s32</samp></dt>
  24725. <dd><p>Always use signed 32-bit.
  24726. </p></dd>
  24727. <dt><samp>f32</samp></dt>
  24728. <dd><p>Always use float 32-bit.
  24729. </p></dd>
  24730. <dt><samp>f64</samp></dt>
  24731. <dd><p>Always use float 64-bit.
  24732. </p></dd>
  24733. </dl>
  24734. </dd>
  24735. </dl>
  24736. <a name="bs2b"></a>
  24737. <h3 class="section">36.60 bs2b<span class="pull-right"><a class="anchor hidden-xs" href="#bs2b" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bs2b" aria-hidden="true">TOC</a></span></h3>
  24738. <p>Bauer stereo to binaural transformation, which improves headphone listening of
  24739. stereo audio records.
  24740. </p>
  24741. <p>To enable compilation of this filter you need to configure FFmpeg with
  24742. <code>--enable-libbs2b</code>.
  24743. </p>
  24744. <p>It accepts the following parameters:
  24745. </p><dl compact="compact">
  24746. <dt><samp>profile</samp></dt>
  24747. <dd><p>Pre-defined crossfeed level.
  24748. </p><dl compact="compact">
  24749. <dt><samp>default</samp></dt>
  24750. <dd><p>Default level (fcut=700, feed=50).
  24751. </p>
  24752. </dd>
  24753. <dt><samp>cmoy</samp></dt>
  24754. <dd><p>Chu Moy circuit (fcut=700, feed=60).
  24755. </p>
  24756. </dd>
  24757. <dt><samp>jmeier</samp></dt>
  24758. <dd><p>Jan Meier circuit (fcut=650, feed=95).
  24759. </p>
  24760. </dd>
  24761. </dl>
  24762. </dd>
  24763. <dt><samp>fcut</samp></dt>
  24764. <dd><p>Cut frequency (in Hz).
  24765. </p>
  24766. </dd>
  24767. <dt><samp>feed</samp></dt>
  24768. <dd><p>Feed level (in Hz).
  24769. </p>
  24770. </dd>
  24771. </dl>
  24772. <a name="channelmap"></a>
  24773. <h3 class="section">36.61 channelmap<span class="pull-right"><a class="anchor hidden-xs" href="#channelmap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-channelmap" aria-hidden="true">TOC</a></span></h3>
  24774. <p>Remap input channels to new locations.
  24775. </p>
  24776. <p>It accepts the following parameters:
  24777. </p><dl compact="compact">
  24778. <dt><samp>map</samp></dt>
  24779. <dd><p>Map channels from input to output. The argument is a &rsquo;|&rsquo;-separated list of
  24780. mappings, each in the <code><var>in_channel</var>-<var>out_channel</var></code> or
  24781. <var>in_channel</var> form. <var>in_channel</var> can be either the name of the input
  24782. channel (e.g. FL for front left) or its index in the input channel layout.
  24783. <var>out_channel</var> is the name of the output channel or its index in the output
  24784. channel layout. If <var>out_channel</var> is not given then it is implicitly an
  24785. index, starting with zero and increasing by one for each mapping.
  24786. </p>
  24787. </dd>
  24788. <dt><samp>channel_layout</samp></dt>
  24789. <dd><p>The channel layout of the output stream.
  24790. </p></dd>
  24791. </dl>
  24792. <p>If no mapping is present, the filter will implicitly map input channels to
  24793. output channels, preserving indices.
  24794. </p>
  24795. <a name="Examples-55"></a>
  24796. <h4 class="subsection">36.61.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-55" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-55" aria-hidden="true">TOC</a></span></h4>
  24797. <ul>
  24798. <li> For example, assuming a 5.1+downmix input MOV file,
  24799. <div class="example">
  24800. <pre class="example">ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
  24801. </pre></div>
  24802. <p>will create an output WAV file tagged as stereo from the downmix channels of
  24803. the input.
  24804. </p>
  24805. </li><li> To fix a 5.1 WAV improperly encoded in AAC&rsquo;s native channel order
  24806. <div class="example">
  24807. <pre class="example">ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
  24808. </pre></div>
  24809. </li></ul>
  24810. <a name="channelsplit"></a>
  24811. <h3 class="section">36.62 channelsplit<span class="pull-right"><a class="anchor hidden-xs" href="#channelsplit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-channelsplit" aria-hidden="true">TOC</a></span></h3>
  24812. <p>Split each channel from an input audio stream into a separate output stream.
  24813. </p>
  24814. <p>It accepts the following parameters:
  24815. </p><dl compact="compact">
  24816. <dt><samp>channel_layout</samp></dt>
  24817. <dd><p>The channel layout of the input stream. The default is &quot;stereo&quot;.
  24818. </p></dd>
  24819. <dt><samp>channels</samp></dt>
  24820. <dd><p>A channel layout describing the channels to be extracted as separate output streams
  24821. or &quot;all&quot; to extract each input channel as a separate stream. The default is &quot;all&quot;.
  24822. </p>
  24823. <p>Choosing channels not present in channel layout in the input will result in an error.
  24824. </p></dd>
  24825. </dl>
  24826. <a name="Examples-56"></a>
  24827. <h4 class="subsection">36.62.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-56" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-56" aria-hidden="true">TOC</a></span></h4>
  24828. <ul>
  24829. <li> For example, assuming a stereo input MP3 file,
  24830. <div class="example">
  24831. <pre class="example">ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
  24832. </pre></div>
  24833. <p>will create an output Matroska file with two audio streams, one containing only
  24834. the left channel and the other the right channel.
  24835. </p>
  24836. </li><li> Split a 5.1 WAV file into per-channel files:
  24837. <div class="example">
  24838. <pre class="example">ffmpeg -i in.wav -filter_complex
  24839. 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
  24840. -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
  24841. front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
  24842. side_right.wav
  24843. </pre></div>
  24844. </li><li> Extract only LFE from a 5.1 WAV file:
  24845. <div class="example">
  24846. <pre class="example">ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
  24847. -map '[LFE]' lfe.wav
  24848. </pre></div>
  24849. </li></ul>
  24850. <a name="chorus"></a>
  24851. <h3 class="section">36.63 chorus<span class="pull-right"><a class="anchor hidden-xs" href="#chorus" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chorus" aria-hidden="true">TOC</a></span></h3>
  24852. <p>Add a chorus effect to the audio.
  24853. </p>
  24854. <p>Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
  24855. </p>
  24856. <p>Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
  24857. constant, with chorus, it is varied using using sinusoidal or triangular modulation.
  24858. The modulation depth defines the range the modulated delay is played before or after
  24859. the delay. Hence the delayed sound will sound slower or faster, that is the delayed
  24860. sound tuned around the original one, like in a chorus where some vocals are slightly
  24861. off key.
  24862. </p>
  24863. <p>It accepts the following parameters:
  24864. </p><dl compact="compact">
  24865. <dt><samp>in_gain</samp></dt>
  24866. <dd><p>Set input gain. Default is 0.4.
  24867. </p>
  24868. </dd>
  24869. <dt><samp>out_gain</samp></dt>
  24870. <dd><p>Set output gain. Default is 0.4.
  24871. </p>
  24872. </dd>
  24873. <dt><samp>delays</samp></dt>
  24874. <dd><p>Set delays. A typical delay is around 40ms to 60ms.
  24875. </p>
  24876. </dd>
  24877. <dt><samp>decays</samp></dt>
  24878. <dd><p>Set decays.
  24879. </p>
  24880. </dd>
  24881. <dt><samp>speeds</samp></dt>
  24882. <dd><p>Set speeds.
  24883. </p>
  24884. </dd>
  24885. <dt><samp>depths</samp></dt>
  24886. <dd><p>Set depths.
  24887. </p></dd>
  24888. </dl>
  24889. <a name="Examples-57"></a>
  24890. <h4 class="subsection">36.63.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-57" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-57" aria-hidden="true">TOC</a></span></h4>
  24891. <ul>
  24892. <li> A single delay:
  24893. <div class="example">
  24894. <pre class="example">chorus=0.7:0.9:55:0.4:0.25:2
  24895. </pre></div>
  24896. </li><li> Two delays:
  24897. <div class="example">
  24898. <pre class="example">chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
  24899. </pre></div>
  24900. </li><li> Fuller sounding chorus with three delays:
  24901. <div class="example">
  24902. <pre class="example">chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3
  24903. </pre></div>
  24904. </li></ul>
  24905. <a name="compand"></a>
  24906. <h3 class="section">36.64 compand<span class="pull-right"><a class="anchor hidden-xs" href="#compand" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-compand" aria-hidden="true">TOC</a></span></h3>
  24907. <p>Compress or expand the audio&rsquo;s dynamic range.
  24908. </p>
  24909. <p>It accepts the following parameters:
  24910. </p>
  24911. <dl compact="compact">
  24912. <dt><samp>attacks</samp></dt>
  24913. <dt><samp>decays</samp></dt>
  24914. <dd><p>A list of times in seconds for each channel over which the instantaneous level
  24915. of the input signal is averaged to determine its volume. <var>attacks</var> refers to
  24916. increase of volume and <var>decays</var> refers to decrease of volume. For most
  24917. situations, the attack time (response to the audio getting louder) should be
  24918. shorter than the decay time, because the human ear is more sensitive to sudden
  24919. loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
  24920. a typical value for decay is 0.8 seconds.
  24921. If specified number of attacks &amp; decays is lower than number of channels, the last
  24922. set attack/decay will be used for all remaining channels.
  24923. </p>
  24924. </dd>
  24925. <dt><samp>points</samp></dt>
  24926. <dd><p>A list of points for the transfer function, specified in dB relative to the
  24927. maximum possible signal amplitude. Each key points list must be defined using
  24928. the following syntax: <code>x0/y0|x1/y1|x2/y2|....</code> or
  24929. <code>x0/y0 x1/y1 x2/y2 ....</code>
  24930. </p>
  24931. <p>The input values must be in strictly increasing order but the transfer function
  24932. does not have to be monotonically rising. The point <code>0/0</code> is assumed but
  24933. may be overridden (by <code>0/out-dBn</code>). Typical values for the transfer
  24934. function are <code>-70/-70|-60/-20|1/0</code>.
  24935. </p>
  24936. </dd>
  24937. <dt><samp>soft-knee</samp></dt>
  24938. <dd><p>Set the curve radius in dB for all joints. It defaults to 0.01.
  24939. </p>
  24940. </dd>
  24941. <dt><samp>gain</samp></dt>
  24942. <dd><p>Set the additional gain in dB to be applied at all points on the transfer
  24943. function. This allows for easy adjustment of the overall gain.
  24944. It defaults to 0.
  24945. </p>
  24946. </dd>
  24947. <dt><samp>volume</samp></dt>
  24948. <dd><p>Set an initial volume, in dB, to be assumed for each channel when filtering
  24949. starts. This permits the user to supply a nominal level initially, so that, for
  24950. example, a very large gain is not applied to initial signal levels before the
  24951. companding has begun to operate. A typical value for audio which is initially
  24952. quiet is -90 dB. It defaults to 0.
  24953. </p>
  24954. </dd>
  24955. <dt><samp>delay</samp></dt>
  24956. <dd><p>Set a delay, in seconds. The input audio is analyzed immediately, but audio is
  24957. delayed before being fed to the volume adjuster. Specifying a delay
  24958. approximately equal to the attack/decay times allows the filter to effectively
  24959. operate in predictive rather than reactive mode. It defaults to 0.
  24960. </p>
  24961. </dd>
  24962. </dl>
  24963. <a name="Examples-58"></a>
  24964. <h4 class="subsection">36.64.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-58" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-58" aria-hidden="true">TOC</a></span></h4>
  24965. <ul>
  24966. <li> Make music with both quiet and loud passages suitable for listening to in a
  24967. noisy environment:
  24968. <div class="example">
  24969. <pre class="example">compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
  24970. </pre></div>
  24971. <p>Another example for audio with whisper and explosion parts:
  24972. </p><div class="example">
  24973. <pre class="example">compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
  24974. </pre></div>
  24975. </li><li> A noise gate for when the noise is at a lower level than the signal:
  24976. <div class="example">
  24977. <pre class="example">compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
  24978. </pre></div>
  24979. </li><li> Here is another noise gate, this time for when the noise is at a higher level
  24980. than the signal (making it, in some ways, similar to squelch):
  24981. <div class="example">
  24982. <pre class="example">compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
  24983. </pre></div>
  24984. </li><li> 2:1 compression starting at -6dB:
  24985. <div class="example">
  24986. <pre class="example">compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
  24987. </pre></div>
  24988. </li><li> 2:1 compression starting at -9dB:
  24989. <div class="example">
  24990. <pre class="example">compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
  24991. </pre></div>
  24992. </li><li> 2:1 compression starting at -12dB:
  24993. <div class="example">
  24994. <pre class="example">compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
  24995. </pre></div>
  24996. </li><li> 2:1 compression starting at -18dB:
  24997. <div class="example">
  24998. <pre class="example">compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
  24999. </pre></div>
  25000. </li><li> 3:1 compression starting at -15dB:
  25001. <div class="example">
  25002. <pre class="example">compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
  25003. </pre></div>
  25004. </li><li> Compressor/Gate:
  25005. <div class="example">
  25006. <pre class="example">compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
  25007. </pre></div>
  25008. </li><li> Expander:
  25009. <div class="example">
  25010. <pre class="example">compand=attacks=0:points=-80/-169|-54/-80|-49.5/-64.6|-41.1/-41.1|-25.8/-15|-10.8/-4.5|0/0|20/8.3
  25011. </pre></div>
  25012. </li><li> Hard limiter at -6dB:
  25013. <div class="example">
  25014. <pre class="example">compand=attacks=0:points=-80/-80|-6/-6|20/-6
  25015. </pre></div>
  25016. </li><li> Hard limiter at -12dB:
  25017. <div class="example">
  25018. <pre class="example">compand=attacks=0:points=-80/-80|-12/-12|20/-12
  25019. </pre></div>
  25020. </li><li> Hard noise gate at -35 dB:
  25021. <div class="example">
  25022. <pre class="example">compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
  25023. </pre></div>
  25024. </li><li> Soft limiter:
  25025. <div class="example">
  25026. <pre class="example">compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
  25027. </pre></div>
  25028. </li></ul>
  25029. <a name="compensationdelay"></a>
  25030. <h3 class="section">36.65 compensationdelay<span class="pull-right"><a class="anchor hidden-xs" href="#compensationdelay" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-compensationdelay" aria-hidden="true">TOC</a></span></h3>
  25031. <p>Compensation Delay Line is a metric based delay to compensate differing
  25032. positions of microphones or speakers.
  25033. </p>
  25034. <p>For example, you have recorded guitar with two microphones placed in
  25035. different locations. Because the front of sound wave has fixed speed in
  25036. normal conditions, the phasing of microphones can vary and depends on
  25037. their location and interposition. The best sound mix can be achieved when
  25038. these microphones are in phase (synchronized). Note that a distance of
  25039. ~30 cm between microphones makes one microphone capture the signal in
  25040. antiphase to the other microphone. That makes the final mix sound moody.
  25041. This filter helps to solve phasing problems by adding different delays
  25042. to each microphone track and make them synchronized.
  25043. </p>
  25044. <p>The best result can be reached when you take one track as base and
  25045. synchronize other tracks one by one with it.
  25046. Remember that synchronization/delay tolerance depends on sample rate, too.
  25047. Higher sample rates will give more tolerance.
  25048. </p>
  25049. <p>The filter accepts the following parameters:
  25050. </p>
  25051. <dl compact="compact">
  25052. <dt><samp>mm</samp></dt>
  25053. <dd><p>Set millimeters distance. This is compensation distance for fine tuning.
  25054. Default is 0.
  25055. </p>
  25056. </dd>
  25057. <dt><samp>cm</samp></dt>
  25058. <dd><p>Set cm distance. This is compensation distance for tightening distance setup.
  25059. Default is 0.
  25060. </p>
  25061. </dd>
  25062. <dt><samp>m</samp></dt>
  25063. <dd><p>Set meters distance. This is compensation distance for hard distance setup.
  25064. Default is 0.
  25065. </p>
  25066. </dd>
  25067. <dt><samp>dry</samp></dt>
  25068. <dd><p>Set dry amount. Amount of unprocessed (dry) signal.
  25069. Default is 0.
  25070. </p>
  25071. </dd>
  25072. <dt><samp>wet</samp></dt>
  25073. <dd><p>Set wet amount. Amount of processed (wet) signal.
  25074. Default is 1.
  25075. </p>
  25076. </dd>
  25077. <dt><samp>temp</samp></dt>
  25078. <dd><p>Set temperature in degrees Celsius. This is the temperature of the environment.
  25079. Default is 20.
  25080. </p></dd>
  25081. </dl>
  25082. <a name="crossfeed"></a>
  25083. <h3 class="section">36.66 crossfeed<span class="pull-right"><a class="anchor hidden-xs" href="#crossfeed" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crossfeed" aria-hidden="true">TOC</a></span></h3>
  25084. <p>Apply headphone crossfeed filter.
  25085. </p>
  25086. <p>Crossfeed is the process of blending the left and right channels of stereo
  25087. audio recording.
  25088. It is mainly used to reduce extreme stereo separation of low frequencies.
  25089. </p>
  25090. <p>The intent is to produce more speaker like sound to the listener.
  25091. </p>
  25092. <p>The filter accepts the following options:
  25093. </p>
  25094. <dl compact="compact">
  25095. <dt><samp>strength</samp></dt>
  25096. <dd><p>Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1.
  25097. This sets gain of low shelf filter for side part of stereo image.
  25098. Default is -6dB. Max allowed is -30db when strength is set to 1.
  25099. </p>
  25100. </dd>
  25101. <dt><samp>range</samp></dt>
  25102. <dd><p>Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1.
  25103. This sets cut off frequency of low shelf filter. Default is cut off near
  25104. 1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz.
  25105. </p>
  25106. </dd>
  25107. <dt><samp>slope</samp></dt>
  25108. <dd><p>Set curve slope of low shelf filter. Default is 0.5.
  25109. Allowed range is from 0.01 to 1.
  25110. </p>
  25111. </dd>
  25112. <dt><samp>level_in</samp></dt>
  25113. <dd><p>Set input gain. Default is 0.9.
  25114. </p>
  25115. </dd>
  25116. <dt><samp>level_out</samp></dt>
  25117. <dd><p>Set output gain. Default is 1.
  25118. </p></dd>
  25119. </dl>
  25120. <a name="Commands-27"></a>
  25121. <h4 class="subsection">36.66.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-27" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-27" aria-hidden="true">TOC</a></span></h4>
  25122. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  25123. </p>
  25124. <a name="crystalizer"></a>
  25125. <h3 class="section">36.67 crystalizer<span class="pull-right"><a class="anchor hidden-xs" href="#crystalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crystalizer" aria-hidden="true">TOC</a></span></h3>
  25126. <p>Simple algorithm for audio noise sharpening.
  25127. </p>
  25128. <p>This filter linearly increases differences betweeen each audio sample.
  25129. </p>
  25130. <p>The filter accepts the following options:
  25131. </p>
  25132. <dl compact="compact">
  25133. <dt><samp>i</samp></dt>
  25134. <dd><p>Sets the intensity of effect (default: 2.0). Must be in range between -10.0 to 0
  25135. (unchanged sound) to 10.0 (maximum effect).
  25136. To inverse filtering use negative value.
  25137. </p>
  25138. </dd>
  25139. <dt><samp>c</samp></dt>
  25140. <dd><p>Enable clipping. By default is enabled.
  25141. </p></dd>
  25142. </dl>
  25143. <a name="Commands-28"></a>
  25144. <h4 class="subsection">36.67.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-28" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-28" aria-hidden="true">TOC</a></span></h4>
  25145. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  25146. </p>
  25147. <a name="dcshift"></a>
  25148. <h3 class="section">36.68 dcshift<span class="pull-right"><a class="anchor hidden-xs" href="#dcshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dcshift" aria-hidden="true">TOC</a></span></h3>
  25149. <p>Apply a DC shift to the audio.
  25150. </p>
  25151. <p>This can be useful to remove a DC offset (caused perhaps by a hardware problem
  25152. in the recording chain) from the audio. The effect of a DC offset is reduced
  25153. headroom and hence volume. The <a href="#astats">astats</a> filter can be used to determine if
  25154. a signal has a DC offset.
  25155. </p>
  25156. <dl compact="compact">
  25157. <dt><samp>shift</samp></dt>
  25158. <dd><p>Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift
  25159. the audio.
  25160. </p>
  25161. </dd>
  25162. <dt><samp>limitergain</samp></dt>
  25163. <dd><p>Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
  25164. used to prevent clipping.
  25165. </p></dd>
  25166. </dl>
  25167. <a name="deesser"></a>
  25168. <h3 class="section">36.69 deesser<span class="pull-right"><a class="anchor hidden-xs" href="#deesser" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deesser" aria-hidden="true">TOC</a></span></h3>
  25169. <p>Apply de-essing to the audio samples.
  25170. </p>
  25171. <dl compact="compact">
  25172. <dt><samp>i</samp></dt>
  25173. <dd><p>Set intensity for triggering de-essing. Allowed range is from 0 to 1.
  25174. Default is 0.
  25175. </p>
  25176. </dd>
  25177. <dt><samp>m</samp></dt>
  25178. <dd><p>Set amount of ducking on treble part of sound. Allowed range is from 0 to 1.
  25179. Default is 0.5.
  25180. </p>
  25181. </dd>
  25182. <dt><samp>f</samp></dt>
  25183. <dd><p>How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1.
  25184. Default is 0.5.
  25185. </p>
  25186. </dd>
  25187. <dt><samp>s</samp></dt>
  25188. <dd><p>Set the output mode.
  25189. </p>
  25190. <p>It accepts the following values:
  25191. </p><dl compact="compact">
  25192. <dt><samp>i</samp></dt>
  25193. <dd><p>Pass input unchanged.
  25194. </p>
  25195. </dd>
  25196. <dt><samp>o</samp></dt>
  25197. <dd><p>Pass ess filtered out.
  25198. </p>
  25199. </dd>
  25200. <dt><samp>e</samp></dt>
  25201. <dd><p>Pass only ess.
  25202. </p>
  25203. <p>Default value is <var>o</var>.
  25204. </p></dd>
  25205. </dl>
  25206. </dd>
  25207. </dl>
  25208. <a name="drmeter"></a>
  25209. <h3 class="section">36.70 drmeter<span class="pull-right"><a class="anchor hidden-xs" href="#drmeter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drmeter" aria-hidden="true">TOC</a></span></h3>
  25210. <p>Measure audio dynamic range.
  25211. </p>
  25212. <p>DR values of 14 and higher is found in very dynamic material. DR of 8 to 13
  25213. is found in transition material. And anything less that 8 have very poor dynamics
  25214. and is very compressed.
  25215. </p>
  25216. <p>The filter accepts the following options:
  25217. </p>
  25218. <dl compact="compact">
  25219. <dt><samp>length</samp></dt>
  25220. <dd><p>Set window length in seconds used to split audio into segments of equal length.
  25221. Default is 3 seconds.
  25222. </p></dd>
  25223. </dl>
  25224. <a name="dynaudnorm"></a>
  25225. <h3 class="section">36.71 dynaudnorm<span class="pull-right"><a class="anchor hidden-xs" href="#dynaudnorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dynaudnorm" aria-hidden="true">TOC</a></span></h3>
  25226. <p>Dynamic Audio Normalizer.
  25227. </p>
  25228. <p>This filter applies a certain amount of gain to the input audio in order
  25229. to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in
  25230. contrast to more &quot;simple&quot; normalization algorithms, the Dynamic Audio
  25231. Normalizer *dynamically* re-adjusts the gain factor to the input audio.
  25232. This allows for applying extra gain to the &quot;quiet&quot; sections of the audio
  25233. while avoiding distortions or clipping the &quot;loud&quot; sections. In other words:
  25234. The Dynamic Audio Normalizer will &quot;even out&quot; the volume of quiet and loud
  25235. sections, in the sense that the volume of each section is brought to the
  25236. same target level. Note, however, that the Dynamic Audio Normalizer achieves
  25237. this goal *without* applying &quot;dynamic range compressing&quot;. It will retain 100%
  25238. of the dynamic range *within* each section of the audio file.
  25239. </p>
  25240. <dl compact="compact">
  25241. <dt><samp>framelen, f</samp></dt>
  25242. <dd><p>Set the frame length in milliseconds. In range from 10 to 8000 milliseconds.
  25243. Default is 500 milliseconds.
  25244. The Dynamic Audio Normalizer processes the input audio in small chunks,
  25245. referred to as frames. This is required, because a peak magnitude has no
  25246. meaning for just a single sample value. Instead, we need to determine the
  25247. peak magnitude for a contiguous sequence of sample values. While a &quot;standard&quot;
  25248. normalizer would simply use the peak magnitude of the complete file, the
  25249. Dynamic Audio Normalizer determines the peak magnitude individually for each
  25250. frame. The length of a frame is specified in milliseconds. By default, the
  25251. Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has
  25252. been found to give good results with most files.
  25253. Note that the exact frame length, in number of samples, will be determined
  25254. automatically, based on the sampling rate of the individual input audio file.
  25255. </p>
  25256. </dd>
  25257. <dt><samp>gausssize, g</samp></dt>
  25258. <dd><p>Set the Gaussian filter window size. In range from 3 to 301, must be odd
  25259. number. Default is 31.
  25260. Probably the most important parameter of the Dynamic Audio Normalizer is the
  25261. <code>window size</code> of the Gaussian smoothing filter. The filter&rsquo;s window size
  25262. is specified in frames, centered around the current frame. For the sake of
  25263. simplicity, this must be an odd number. Consequently, the default value of 31
  25264. takes into account the current frame, as well as the 15 preceding frames and
  25265. the 15 subsequent frames. Using a larger window results in a stronger
  25266. smoothing effect and thus in less gain variation, i.e. slower gain
  25267. adaptation. Conversely, using a smaller window results in a weaker smoothing
  25268. effect and thus in more gain variation, i.e. faster gain adaptation.
  25269. In other words, the more you increase this value, the more the Dynamic Audio
  25270. Normalizer will behave like a &quot;traditional&quot; normalization filter. On the
  25271. contrary, the more you decrease this value, the more the Dynamic Audio
  25272. Normalizer will behave like a dynamic range compressor.
  25273. </p>
  25274. </dd>
  25275. <dt><samp>peak, p</samp></dt>
  25276. <dd><p>Set the target peak value. This specifies the highest permissible magnitude
  25277. level for the normalized audio input. This filter will try to approach the
  25278. target peak magnitude as closely as possible, but at the same time it also
  25279. makes sure that the normalized signal will never exceed the peak magnitude.
  25280. A frame&rsquo;s maximum local gain factor is imposed directly by the target peak
  25281. magnitude. The default value is 0.95 and thus leaves a headroom of 5%*.
  25282. It is not recommended to go above this value.
  25283. </p>
  25284. </dd>
  25285. <dt><samp>maxgain, m</samp></dt>
  25286. <dd><p>Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0.
  25287. The Dynamic Audio Normalizer determines the maximum possible (local) gain
  25288. factor for each input frame, i.e. the maximum gain factor that does not
  25289. result in clipping or distortion. The maximum gain factor is determined by
  25290. the frame&rsquo;s highest magnitude sample. However, the Dynamic Audio Normalizer
  25291. additionally bounds the frame&rsquo;s maximum gain factor by a predetermined
  25292. (global) maximum gain factor. This is done in order to avoid excessive gain
  25293. factors in &quot;silent&quot; or almost silent frames. By default, the maximum gain
  25294. factor is 10.0, For most inputs the default value should be sufficient and
  25295. it usually is not recommended to increase this value. Though, for input
  25296. with an extremely low overall volume level, it may be necessary to allow even
  25297. higher gain factors. Note, however, that the Dynamic Audio Normalizer does
  25298. not simply apply a &quot;hard&quot; threshold (i.e. cut off values above the threshold).
  25299. Instead, a &quot;sigmoid&quot; threshold function will be applied. This way, the
  25300. gain factors will smoothly approach the threshold value, but never exceed that
  25301. value.
  25302. </p>
  25303. </dd>
  25304. <dt><samp>targetrms, r</samp></dt>
  25305. <dd><p>Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled.
  25306. By default, the Dynamic Audio Normalizer performs &quot;peak&quot; normalization.
  25307. This means that the maximum local gain factor for each frame is defined
  25308. (only) by the frame&rsquo;s highest magnitude sample. This way, the samples can
  25309. be amplified as much as possible without exceeding the maximum signal
  25310. level, i.e. without clipping. Optionally, however, the Dynamic Audio
  25311. Normalizer can also take into account the frame&rsquo;s root mean square,
  25312. abbreviated RMS. In electrical engineering, the RMS is commonly used to
  25313. determine the power of a time-varying signal. It is therefore considered
  25314. that the RMS is a better approximation of the &quot;perceived loudness&quot; than
  25315. just looking at the signal&rsquo;s peak magnitude. Consequently, by adjusting all
  25316. frames to a constant RMS value, a uniform &quot;perceived loudness&quot; can be
  25317. established. If a target RMS value has been specified, a frame&rsquo;s local gain
  25318. factor is defined as the factor that would result in exactly that RMS value.
  25319. Note, however, that the maximum local gain factor is still restricted by the
  25320. frame&rsquo;s highest magnitude sample, in order to prevent clipping.
  25321. </p>
  25322. </dd>
  25323. <dt><samp>coupling, n</samp></dt>
  25324. <dd><p>Enable channels coupling. By default is enabled.
  25325. By default, the Dynamic Audio Normalizer will amplify all channels by the same
  25326. amount. This means the same gain factor will be applied to all channels, i.e.
  25327. the maximum possible gain factor is determined by the &quot;loudest&quot; channel.
  25328. However, in some recordings, it may happen that the volume of the different
  25329. channels is uneven, e.g. one channel may be &quot;quieter&quot; than the other one(s).
  25330. In this case, this option can be used to disable the channel coupling. This way,
  25331. the gain factor will be determined independently for each channel, depending
  25332. only on the individual channel&rsquo;s highest magnitude sample. This allows for
  25333. harmonizing the volume of the different channels.
  25334. </p>
  25335. </dd>
  25336. <dt><samp>correctdc, c</samp></dt>
  25337. <dd><p>Enable DC bias correction. By default is disabled.
  25338. An audio signal (in the time domain) is a sequence of sample values.
  25339. In the Dynamic Audio Normalizer these sample values are represented in the
  25340. -1.0 to 1.0 range, regardless of the original input format. Normally, the
  25341. audio signal, or &quot;waveform&quot;, should be centered around the zero point.
  25342. That means if we calculate the mean value of all samples in a file, or in a
  25343. single frame, then the result should be 0.0 or at least very close to that
  25344. value. If, however, there is a significant deviation of the mean value from
  25345. 0.0, in either positive or negative direction, this is referred to as a
  25346. DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic
  25347. Audio Normalizer provides optional DC bias correction.
  25348. With DC bias correction enabled, the Dynamic Audio Normalizer will determine
  25349. the mean value, or &quot;DC correction&quot; offset, of each input frame and subtract
  25350. that value from all of the frame&rsquo;s sample values which ensures those samples
  25351. are centered around 0.0 again. Also, in order to avoid &quot;gaps&quot; at the frame
  25352. boundaries, the DC correction offset values will be interpolated smoothly
  25353. between neighbouring frames.
  25354. </p>
  25355. </dd>
  25356. <dt><samp>altboundary, b</samp></dt>
  25357. <dd><p>Enable alternative boundary mode. By default is disabled.
  25358. The Dynamic Audio Normalizer takes into account a certain neighbourhood
  25359. around each frame. This includes the preceding frames as well as the
  25360. subsequent frames. However, for the &quot;boundary&quot; frames, located at the very
  25361. beginning and at the very end of the audio file, not all neighbouring
  25362. frames are available. In particular, for the first few frames in the audio
  25363. file, the preceding frames are not known. And, similarly, for the last few
  25364. frames in the audio file, the subsequent frames are not known. Thus, the
  25365. question arises which gain factors should be assumed for the missing frames
  25366. in the &quot;boundary&quot; region. The Dynamic Audio Normalizer implements two modes
  25367. to deal with this situation. The default boundary mode assumes a gain factor
  25368. of exactly 1.0 for the missing frames, resulting in a smooth &quot;fade in&quot; and
  25369. &quot;fade out&quot; at the beginning and at the end of the input, respectively.
  25370. </p>
  25371. </dd>
  25372. <dt><samp>compress, s</samp></dt>
  25373. <dd><p>Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
  25374. By default, the Dynamic Audio Normalizer does not apply &quot;traditional&quot;
  25375. compression. This means that signal peaks will not be pruned and thus the
  25376. full dynamic range will be retained within each local neighbourhood. However,
  25377. in some cases it may be desirable to combine the Dynamic Audio Normalizer&rsquo;s
  25378. normalization algorithm with a more &quot;traditional&quot; compression.
  25379. For this purpose, the Dynamic Audio Normalizer provides an optional compression
  25380. (thresholding) function. If (and only if) the compression feature is enabled,
  25381. all input frames will be processed by a soft knee thresholding function prior
  25382. to the actual normalization process. Put simply, the thresholding function is
  25383. going to prune all samples whose magnitude exceeds a certain threshold value.
  25384. However, the Dynamic Audio Normalizer does not simply apply a fixed threshold
  25385. value. Instead, the threshold value will be adjusted for each individual
  25386. frame.
  25387. In general, smaller parameters result in stronger compression, and vice versa.
  25388. Values below 3.0 are not recommended, because audible distortion may appear.
  25389. </p>
  25390. </dd>
  25391. <dt><samp>threshold, t</samp></dt>
  25392. <dd><p>Set the target threshold value. This specifies the lowest permissible
  25393. magnitude level for the audio input which will be normalized.
  25394. If input frame volume is above this value frame will be normalized.
  25395. Otherwise frame may not be normalized at all. The default value is set
  25396. to 0, which means all input frames will be normalized.
  25397. This option is mostly useful if digital noise is not wanted to be amplified.
  25398. </p></dd>
  25399. </dl>
  25400. <a name="Commands-29"></a>
  25401. <h4 class="subsection">36.71.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-29" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-29" aria-hidden="true">TOC</a></span></h4>
  25402. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  25403. </p>
  25404. <a name="earwax"></a>
  25405. <h3 class="section">36.72 earwax<span class="pull-right"><a class="anchor hidden-xs" href="#earwax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-earwax" aria-hidden="true">TOC</a></span></h3>
  25406. <p>Make audio easier to listen to on headphones.
  25407. </p>
  25408. <p>This filter adds &lsquo;cues&rsquo; to 44.1kHz stereo (i.e. audio CD format) audio
  25409. so that when listened to on headphones the stereo image is moved from
  25410. inside your head (standard for headphones) to outside and in front of
  25411. the listener (standard for speakers).
  25412. </p>
  25413. <p>Ported from SoX.
  25414. </p>
  25415. <a name="equalizer"></a>
  25416. <h3 class="section">36.73 equalizer<span class="pull-right"><a class="anchor hidden-xs" href="#equalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-equalizer" aria-hidden="true">TOC</a></span></h3>
  25417. <p>Apply a two-pole peaking equalisation (EQ) filter. With this
  25418. filter, the signal-level at and around a selected frequency can
  25419. be increased or decreased, whilst (unlike bandpass and bandreject
  25420. filters) that at all other frequencies is unchanged.
  25421. </p>
  25422. <p>In order to produce complex equalisation curves, this filter can
  25423. be given several times, each with a different central frequency.
  25424. </p>
  25425. <p>The filter accepts the following options:
  25426. </p>
  25427. <dl compact="compact">
  25428. <dt><samp>frequency, f</samp></dt>
  25429. <dd><p>Set the filter&rsquo;s central frequency in Hz.
  25430. </p>
  25431. </dd>
  25432. <dt><samp>width_type, t</samp></dt>
  25433. <dd><p>Set method to specify band-width of filter.
  25434. </p><dl compact="compact">
  25435. <dt><samp>h</samp></dt>
  25436. <dd><p>Hz
  25437. </p></dd>
  25438. <dt><samp>q</samp></dt>
  25439. <dd><p>Q-Factor
  25440. </p></dd>
  25441. <dt><samp>o</samp></dt>
  25442. <dd><p>octave
  25443. </p></dd>
  25444. <dt><samp>s</samp></dt>
  25445. <dd><p>slope
  25446. </p></dd>
  25447. <dt><samp>k</samp></dt>
  25448. <dd><p>kHz
  25449. </p></dd>
  25450. </dl>
  25451. </dd>
  25452. <dt><samp>width, w</samp></dt>
  25453. <dd><p>Specify the band-width of a filter in width_type units.
  25454. </p>
  25455. </dd>
  25456. <dt><samp>gain, g</samp></dt>
  25457. <dd><p>Set the required gain or attenuation in dB.
  25458. Beware of clipping when using a positive gain.
  25459. </p>
  25460. </dd>
  25461. <dt><samp>mix, m</samp></dt>
  25462. <dd><p>How much to use filtered signal in output. Default is 1.
  25463. Range is between 0 and 1.
  25464. </p>
  25465. </dd>
  25466. <dt><samp>channels, c</samp></dt>
  25467. <dd><p>Specify which channels to filter, by default all available are filtered.
  25468. </p>
  25469. </dd>
  25470. <dt><samp>normalize, n</samp></dt>
  25471. <dd><p>Normalize biquad coefficients, by default is disabled.
  25472. Enabling it will normalize magnitude response at DC to 0dB.
  25473. </p>
  25474. </dd>
  25475. <dt><samp>transform, a</samp></dt>
  25476. <dd><p>Set transform type of IIR filter.
  25477. </p><dl compact="compact">
  25478. <dt><samp>di</samp></dt>
  25479. <dt><samp>dii</samp></dt>
  25480. <dt><samp>tdii</samp></dt>
  25481. <dt><samp>latt</samp></dt>
  25482. </dl>
  25483. </dd>
  25484. <dt><samp>precision, r</samp></dt>
  25485. <dd><p>Set precison of filtering.
  25486. </p><dl compact="compact">
  25487. <dt><samp>auto</samp></dt>
  25488. <dd><p>Pick automatic sample format depending on surround filters.
  25489. </p></dd>
  25490. <dt><samp>s16</samp></dt>
  25491. <dd><p>Always use signed 16-bit.
  25492. </p></dd>
  25493. <dt><samp>s32</samp></dt>
  25494. <dd><p>Always use signed 32-bit.
  25495. </p></dd>
  25496. <dt><samp>f32</samp></dt>
  25497. <dd><p>Always use float 32-bit.
  25498. </p></dd>
  25499. <dt><samp>f64</samp></dt>
  25500. <dd><p>Always use float 64-bit.
  25501. </p></dd>
  25502. </dl>
  25503. </dd>
  25504. </dl>
  25505. <a name="Examples-59"></a>
  25506. <h4 class="subsection">36.73.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-59" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-59" aria-hidden="true">TOC</a></span></h4>
  25507. <ul>
  25508. <li> Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
  25509. <div class="example">
  25510. <pre class="example">equalizer=f=1000:t=h:width=200:g=-10
  25511. </pre></div>
  25512. </li><li> Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
  25513. <div class="example">
  25514. <pre class="example">equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
  25515. </pre></div>
  25516. </li></ul>
  25517. <a name="Commands-30"></a>
  25518. <h4 class="subsection">36.73.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-30" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-30" aria-hidden="true">TOC</a></span></h4>
  25519. <p>This filter supports the following commands:
  25520. </p><dl compact="compact">
  25521. <dt><samp>frequency, f</samp></dt>
  25522. <dd><p>Change equalizer frequency.
  25523. Syntax for the command is : &quot;<var>frequency</var>&quot;
  25524. </p>
  25525. </dd>
  25526. <dt><samp>width_type, t</samp></dt>
  25527. <dd><p>Change equalizer width_type.
  25528. Syntax for the command is : &quot;<var>width_type</var>&quot;
  25529. </p>
  25530. </dd>
  25531. <dt><samp>width, w</samp></dt>
  25532. <dd><p>Change equalizer width.
  25533. Syntax for the command is : &quot;<var>width</var>&quot;
  25534. </p>
  25535. </dd>
  25536. <dt><samp>gain, g</samp></dt>
  25537. <dd><p>Change equalizer gain.
  25538. Syntax for the command is : &quot;<var>gain</var>&quot;
  25539. </p>
  25540. </dd>
  25541. <dt><samp>mix, m</samp></dt>
  25542. <dd><p>Change equalizer mix.
  25543. Syntax for the command is : &quot;<var>mix</var>&quot;
  25544. </p></dd>
  25545. </dl>
  25546. <a name="extrastereo"></a>
  25547. <h3 class="section">36.74 extrastereo<span class="pull-right"><a class="anchor hidden-xs" href="#extrastereo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-extrastereo" aria-hidden="true">TOC</a></span></h3>
  25548. <p>Linearly increases the difference between left and right channels which
  25549. adds some sort of &quot;live&quot; effect to playback.
  25550. </p>
  25551. <p>The filter accepts the following options:
  25552. </p>
  25553. <dl compact="compact">
  25554. <dt><samp>m</samp></dt>
  25555. <dd><p>Sets the difference coefficient (default: 2.5). 0.0 means mono sound
  25556. (average of both channels), with 1.0 sound will be unchanged, with
  25557. -1.0 left and right channels will be swapped.
  25558. </p>
  25559. </dd>
  25560. <dt><samp>c</samp></dt>
  25561. <dd><p>Enable clipping. By default is enabled.
  25562. </p></dd>
  25563. </dl>
  25564. <a name="Commands-31"></a>
  25565. <h4 class="subsection">36.74.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-31" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-31" aria-hidden="true">TOC</a></span></h4>
  25566. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  25567. </p>
  25568. <a name="firequalizer"></a>
  25569. <h3 class="section">36.75 firequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#firequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-firequalizer" aria-hidden="true">TOC</a></span></h3>
  25570. <p>Apply FIR Equalization using arbitrary frequency response.
  25571. </p>
  25572. <p>The filter accepts the following option:
  25573. </p>
  25574. <dl compact="compact">
  25575. <dt><samp>gain</samp></dt>
  25576. <dd><p>Set gain curve equation (in dB). The expression can contain variables:
  25577. </p><dl compact="compact">
  25578. <dt><samp>f</samp></dt>
  25579. <dd><p>the evaluated frequency
  25580. </p></dd>
  25581. <dt><samp>sr</samp></dt>
  25582. <dd><p>sample rate
  25583. </p></dd>
  25584. <dt><samp>ch</samp></dt>
  25585. <dd><p>channel number, set to 0 when multichannels evaluation is disabled
  25586. </p></dd>
  25587. <dt><samp>chid</samp></dt>
  25588. <dd><p>channel id, see libavutil/channel_layout.h, set to the first channel id when
  25589. multichannels evaluation is disabled
  25590. </p></dd>
  25591. <dt><samp>chs</samp></dt>
  25592. <dd><p>number of channels
  25593. </p></dd>
  25594. <dt><samp>chlayout</samp></dt>
  25595. <dd><p>channel_layout, see libavutil/channel_layout.h
  25596. </p>
  25597. </dd>
  25598. </dl>
  25599. <p>and functions:
  25600. </p><dl compact="compact">
  25601. <dt><samp>gain_interpolate(f)</samp></dt>
  25602. <dd><p>interpolate gain on frequency f based on gain_entry
  25603. </p></dd>
  25604. <dt><samp>cubic_interpolate(f)</samp></dt>
  25605. <dd><p>same as gain_interpolate, but smoother
  25606. </p></dd>
  25607. </dl>
  25608. <p>This option is also available as command. Default is <code>gain_interpolate(f)</code>.
  25609. </p>
  25610. </dd>
  25611. <dt><samp>gain_entry</samp></dt>
  25612. <dd><p>Set gain entry for gain_interpolate function. The expression can
  25613. contain functions:
  25614. </p><dl compact="compact">
  25615. <dt><samp>entry(f, g)</samp></dt>
  25616. <dd><p>store gain entry at frequency f with value g
  25617. </p></dd>
  25618. </dl>
  25619. <p>This option is also available as command.
  25620. </p>
  25621. </dd>
  25622. <dt><samp>delay</samp></dt>
  25623. <dd><p>Set filter delay in seconds. Higher value means more accurate.
  25624. Default is <code>0.01</code>.
  25625. </p>
  25626. </dd>
  25627. <dt><samp>accuracy</samp></dt>
  25628. <dd><p>Set filter accuracy in Hz. Lower value means more accurate.
  25629. Default is <code>5</code>.
  25630. </p>
  25631. </dd>
  25632. <dt><samp>wfunc</samp></dt>
  25633. <dd><p>Set window function. Acceptable values are:
  25634. </p><dl compact="compact">
  25635. <dt><samp>rectangular</samp></dt>
  25636. <dd><p>rectangular window, useful when gain curve is already smooth
  25637. </p></dd>
  25638. <dt><samp>hann</samp></dt>
  25639. <dd><p>hann window (default)
  25640. </p></dd>
  25641. <dt><samp>hamming</samp></dt>
  25642. <dd><p>hamming window
  25643. </p></dd>
  25644. <dt><samp>blackman</samp></dt>
  25645. <dd><p>blackman window
  25646. </p></dd>
  25647. <dt><samp>nuttall3</samp></dt>
  25648. <dd><p>3-terms continuous 1st derivative nuttall window
  25649. </p></dd>
  25650. <dt><samp>mnuttall3</samp></dt>
  25651. <dd><p>minimum 3-terms discontinuous nuttall window
  25652. </p></dd>
  25653. <dt><samp>nuttall</samp></dt>
  25654. <dd><p>4-terms continuous 1st derivative nuttall window
  25655. </p></dd>
  25656. <dt><samp>bnuttall</samp></dt>
  25657. <dd><p>minimum 4-terms discontinuous nuttall (blackman-nuttall) window
  25658. </p></dd>
  25659. <dt><samp>bharris</samp></dt>
  25660. <dd><p>blackman-harris window
  25661. </p></dd>
  25662. <dt><samp>tukey</samp></dt>
  25663. <dd><p>tukey window
  25664. </p></dd>
  25665. </dl>
  25666. </dd>
  25667. <dt><samp>fixed</samp></dt>
  25668. <dd><p>If enabled, use fixed number of audio samples. This improves speed when
  25669. filtering with large delay. Default is disabled.
  25670. </p>
  25671. </dd>
  25672. <dt><samp>multi</samp></dt>
  25673. <dd><p>Enable multichannels evaluation on gain. Default is disabled.
  25674. </p>
  25675. </dd>
  25676. <dt><samp>zero_phase</samp></dt>
  25677. <dd><p>Enable zero phase mode by subtracting timestamp to compensate delay.
  25678. Default is disabled.
  25679. </p>
  25680. </dd>
  25681. <dt><samp>scale</samp></dt>
  25682. <dd><p>Set scale used by gain. Acceptable values are:
  25683. </p><dl compact="compact">
  25684. <dt><samp>linlin</samp></dt>
  25685. <dd><p>linear frequency, linear gain
  25686. </p></dd>
  25687. <dt><samp>linlog</samp></dt>
  25688. <dd><p>linear frequency, logarithmic (in dB) gain (default)
  25689. </p></dd>
  25690. <dt><samp>loglin</samp></dt>
  25691. <dd><p>logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain
  25692. </p></dd>
  25693. <dt><samp>loglog</samp></dt>
  25694. <dd><p>logarithmic frequency, logarithmic gain
  25695. </p></dd>
  25696. </dl>
  25697. </dd>
  25698. <dt><samp>dumpfile</samp></dt>
  25699. <dd><p>Set file for dumping, suitable for gnuplot.
  25700. </p>
  25701. </dd>
  25702. <dt><samp>dumpscale</samp></dt>
  25703. <dd><p>Set scale for dumpfile. Acceptable values are same with scale option.
  25704. Default is linlog.
  25705. </p>
  25706. </dd>
  25707. <dt><samp>fft2</samp></dt>
  25708. <dd><p>Enable 2-channel convolution using complex FFT. This improves speed significantly.
  25709. Default is disabled.
  25710. </p>
  25711. </dd>
  25712. <dt><samp>min_phase</samp></dt>
  25713. <dd><p>Enable minimum phase impulse response. Default is disabled.
  25714. </p></dd>
  25715. </dl>
  25716. <a name="Examples-60"></a>
  25717. <h4 class="subsection">36.75.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-60" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-60" aria-hidden="true">TOC</a></span></h4>
  25718. <ul>
  25719. <li> lowpass at 1000 Hz:
  25720. <div class="example">
  25721. <pre class="example">firequalizer=gain='if(lt(f,1000), 0, -INF)'
  25722. </pre></div>
  25723. </li><li> lowpass at 1000 Hz with gain_entry:
  25724. <div class="example">
  25725. <pre class="example">firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
  25726. </pre></div>
  25727. </li><li> custom equalization:
  25728. <div class="example">
  25729. <pre class="example">firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
  25730. </pre></div>
  25731. </li><li> higher delay with zero phase to compensate delay:
  25732. <div class="example">
  25733. <pre class="example">firequalizer=delay=0.1:fixed=on:zero_phase=on
  25734. </pre></div>
  25735. </li><li> lowpass on left channel, highpass on right channel:
  25736. <div class="example">
  25737. <pre class="example">firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
  25738. :gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
  25739. </pre></div>
  25740. </li></ul>
  25741. <a name="flanger"></a>
  25742. <h3 class="section">36.76 flanger<span class="pull-right"><a class="anchor hidden-xs" href="#flanger" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flanger" aria-hidden="true">TOC</a></span></h3>
  25743. <p>Apply a flanging effect to the audio.
  25744. </p>
  25745. <p>The filter accepts the following options:
  25746. </p>
  25747. <dl compact="compact">
  25748. <dt><samp>delay</samp></dt>
  25749. <dd><p>Set base delay in milliseconds. Range from 0 to 30. Default value is 0.
  25750. </p>
  25751. </dd>
  25752. <dt><samp>depth</samp></dt>
  25753. <dd><p>Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2.
  25754. </p>
  25755. </dd>
  25756. <dt><samp>regen</samp></dt>
  25757. <dd><p>Set percentage regeneration (delayed signal feedback). Range from -95 to 95.
  25758. Default value is 0.
  25759. </p>
  25760. </dd>
  25761. <dt><samp>width</samp></dt>
  25762. <dd><p>Set percentage of delayed signal mixed with original. Range from 0 to 100.
  25763. Default value is 71.
  25764. </p>
  25765. </dd>
  25766. <dt><samp>speed</samp></dt>
  25767. <dd><p>Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5.
  25768. </p>
  25769. </dd>
  25770. <dt><samp>shape</samp></dt>
  25771. <dd><p>Set swept wave shape, can be <var>triangular</var> or <var>sinusoidal</var>.
  25772. Default value is <var>sinusoidal</var>.
  25773. </p>
  25774. </dd>
  25775. <dt><samp>phase</samp></dt>
  25776. <dd><p>Set swept wave percentage-shift for multi channel. Range from 0 to 100.
  25777. Default value is 25.
  25778. </p>
  25779. </dd>
  25780. <dt><samp>interp</samp></dt>
  25781. <dd><p>Set delay-line interpolation, <var>linear</var> or <var>quadratic</var>.
  25782. Default is <var>linear</var>.
  25783. </p></dd>
  25784. </dl>
  25785. <a name="haas"></a>
  25786. <h3 class="section">36.77 haas<span class="pull-right"><a class="anchor hidden-xs" href="#haas" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-haas" aria-hidden="true">TOC</a></span></h3>
  25787. <p>Apply Haas effect to audio.
  25788. </p>
  25789. <p>Note that this makes most sense to apply on mono signals.
  25790. With this filter applied to mono signals it give some directionality and
  25791. stretches its stereo image.
  25792. </p>
  25793. <p>The filter accepts the following options:
  25794. </p>
  25795. <dl compact="compact">
  25796. <dt><samp>level_in</samp></dt>
  25797. <dd><p>Set input level. By default is <var>1</var>, or 0dB
  25798. </p>
  25799. </dd>
  25800. <dt><samp>level_out</samp></dt>
  25801. <dd><p>Set output level. By default is <var>1</var>, or 0dB.
  25802. </p>
  25803. </dd>
  25804. <dt><samp>side_gain</samp></dt>
  25805. <dd><p>Set gain applied to side part of signal. By default is <var>1</var>.
  25806. </p>
  25807. </dd>
  25808. <dt><samp>middle_source</samp></dt>
  25809. <dd><p>Set kind of middle source. Can be one of the following:
  25810. </p>
  25811. <dl compact="compact">
  25812. <dt>&lsquo;<samp>left</samp>&rsquo;</dt>
  25813. <dd><p>Pick left channel.
  25814. </p>
  25815. </dd>
  25816. <dt>&lsquo;<samp>right</samp>&rsquo;</dt>
  25817. <dd><p>Pick right channel.
  25818. </p>
  25819. </dd>
  25820. <dt>&lsquo;<samp>mid</samp>&rsquo;</dt>
  25821. <dd><p>Pick middle part signal of stereo image.
  25822. </p>
  25823. </dd>
  25824. <dt>&lsquo;<samp>side</samp>&rsquo;</dt>
  25825. <dd><p>Pick side part signal of stereo image.
  25826. </p></dd>
  25827. </dl>
  25828. </dd>
  25829. <dt><samp>middle_phase</samp></dt>
  25830. <dd><p>Change middle phase. By default is disabled.
  25831. </p>
  25832. </dd>
  25833. <dt><samp>left_delay</samp></dt>
  25834. <dd><p>Set left channel delay. By default is <var>2.05</var> milliseconds.
  25835. </p>
  25836. </dd>
  25837. <dt><samp>left_balance</samp></dt>
  25838. <dd><p>Set left channel balance. By default is <var>-1</var>.
  25839. </p>
  25840. </dd>
  25841. <dt><samp>left_gain</samp></dt>
  25842. <dd><p>Set left channel gain. By default is <var>1</var>.
  25843. </p>
  25844. </dd>
  25845. <dt><samp>left_phase</samp></dt>
  25846. <dd><p>Change left phase. By default is disabled.
  25847. </p>
  25848. </dd>
  25849. <dt><samp>right_delay</samp></dt>
  25850. <dd><p>Set right channel delay. By defaults is <var>2.12</var> milliseconds.
  25851. </p>
  25852. </dd>
  25853. <dt><samp>right_balance</samp></dt>
  25854. <dd><p>Set right channel balance. By default is <var>1</var>.
  25855. </p>
  25856. </dd>
  25857. <dt><samp>right_gain</samp></dt>
  25858. <dd><p>Set right channel gain. By default is <var>1</var>.
  25859. </p>
  25860. </dd>
  25861. <dt><samp>right_phase</samp></dt>
  25862. <dd><p>Change right phase. By default is enabled.
  25863. </p></dd>
  25864. </dl>
  25865. <a name="hdcd"></a>
  25866. <h3 class="section">36.78 hdcd<span class="pull-right"><a class="anchor hidden-xs" href="#hdcd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hdcd" aria-hidden="true">TOC</a></span></h3>
  25867. <p>Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with
  25868. embedded HDCD codes is expanded into a 20-bit PCM stream.
  25869. </p>
  25870. <p>The filter supports the Peak Extend and Low-level Gain Adjustment features
  25871. of HDCD, and detects the Transient Filter flag.
  25872. </p>
  25873. <div class="example">
  25874. <pre class="example">ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
  25875. </pre></div>
  25876. <p>When using the filter with wav, note the default encoding for wav is 16-bit,
  25877. so the resulting 20-bit stream will be truncated back to 16-bit. Use something
  25878. like <code>-acodec pcm_s24le</code> after the filter to get 24-bit PCM output.
  25879. </p><div class="example">
  25880. <pre class="example">ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
  25881. ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
  25882. </pre></div>
  25883. <p>The filter accepts the following options:
  25884. </p>
  25885. <dl compact="compact">
  25886. <dt><samp>disable_autoconvert</samp></dt>
  25887. <dd><p>Disable any automatic format conversion or resampling in the filter graph.
  25888. </p>
  25889. </dd>
  25890. <dt><samp>process_stereo</samp></dt>
  25891. <dd><p>Process the stereo channels together. If target_gain does not match between
  25892. channels, consider it invalid and use the last valid target_gain.
  25893. </p>
  25894. </dd>
  25895. <dt><samp>cdt_ms</samp></dt>
  25896. <dd><p>Set the code detect timer period in ms.
  25897. </p>
  25898. </dd>
  25899. <dt><samp>force_pe</samp></dt>
  25900. <dd><p>Always extend peaks above -3dBFS even if PE isn&rsquo;t signaled.
  25901. </p>
  25902. </dd>
  25903. <dt><samp>analyze_mode</samp></dt>
  25904. <dd><p>Replace audio with a solid tone and adjust the amplitude to signal some
  25905. specific aspect of the decoding process. The output file can be loaded in
  25906. an audio editor alongside the original to aid analysis.
  25907. </p>
  25908. <p><code>analyze_mode=pe:force_pe=true</code> can be used to see all samples above the PE level.
  25909. </p>
  25910. <p>Modes are:
  25911. </p><dl compact="compact">
  25912. <dt>&lsquo;<samp>0, off</samp>&rsquo;</dt>
  25913. <dd><p>Disabled
  25914. </p></dd>
  25915. <dt>&lsquo;<samp>1, lle</samp>&rsquo;</dt>
  25916. <dd><p>Gain adjustment level at each sample
  25917. </p></dd>
  25918. <dt>&lsquo;<samp>2, pe</samp>&rsquo;</dt>
  25919. <dd><p>Samples where peak extend occurs
  25920. </p></dd>
  25921. <dt>&lsquo;<samp>3, cdt</samp>&rsquo;</dt>
  25922. <dd><p>Samples where the code detect timer is active
  25923. </p></dd>
  25924. <dt>&lsquo;<samp>4, tgm</samp>&rsquo;</dt>
  25925. <dd><p>Samples where the target gain does not match between channels
  25926. </p></dd>
  25927. </dl>
  25928. </dd>
  25929. </dl>
  25930. <a name="headphone"></a>
  25931. <h3 class="section">36.79 headphone<span class="pull-right"><a class="anchor hidden-xs" href="#headphone" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-headphone" aria-hidden="true">TOC</a></span></h3>
  25932. <p>Apply head-related transfer functions (HRTFs) to create virtual
  25933. loudspeakers around the user for binaural listening via headphones.
  25934. The HRIRs are provided via additional streams, for each channel
  25935. one stereo input stream is needed.
  25936. </p>
  25937. <p>The filter accepts the following options:
  25938. </p>
  25939. <dl compact="compact">
  25940. <dt><samp>map</samp></dt>
  25941. <dd><p>Set mapping of input streams for convolution.
  25942. The argument is a &rsquo;|&rsquo;-separated list of channel names in order as they
  25943. are given as additional stream inputs for filter.
  25944. This also specify number of input streams. Number of input streams
  25945. must be not less than number of channels in first stream plus one.
  25946. </p>
  25947. </dd>
  25948. <dt><samp>gain</samp></dt>
  25949. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  25950. </p>
  25951. </dd>
  25952. <dt><samp>type</samp></dt>
  25953. <dd><p>Set processing type. Can be <var>time</var> or <var>freq</var>. <var>time</var> is
  25954. processing audio in time domain which is slow.
  25955. <var>freq</var> is processing audio in frequency domain which is fast.
  25956. Default is <var>freq</var>.
  25957. </p>
  25958. </dd>
  25959. <dt><samp>lfe</samp></dt>
  25960. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  25961. </p>
  25962. </dd>
  25963. <dt><samp>size</samp></dt>
  25964. <dd><p>Set size of frame in number of samples which will be processed at once.
  25965. Default value is <var>1024</var>. Allowed range is from 1024 to 96000.
  25966. </p>
  25967. </dd>
  25968. <dt><samp>hrir</samp></dt>
  25969. <dd><p>Set format of hrir stream.
  25970. Default value is <var>stereo</var>. Alternative value is <var>multich</var>.
  25971. If value is set to <var>stereo</var>, number of additional streams should
  25972. be greater or equal to number of input channels in first input stream.
  25973. Also each additional stream should have stereo number of channels.
  25974. If value is set to <var>multich</var>, number of additional streams should
  25975. be exactly one. Also number of input channels of additional stream
  25976. should be equal or greater than twice number of channels of first input
  25977. stream.
  25978. </p></dd>
  25979. </dl>
  25980. <a name="Examples-61"></a>
  25981. <h4 class="subsection">36.79.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-61" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-61" aria-hidden="true">TOC</a></span></h4>
  25982. <ul>
  25983. <li> Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  25984. each amovie filter use stereo file with IR coefficients as input.
  25985. The files give coefficients for each position of virtual loudspeaker:
  25986. <div class="example">
  25987. <pre class="example">ffmpeg -i input.wav
  25988. -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;
  25989. output.wav
  25990. </pre></div>
  25991. </li><li> Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  25992. but now in <var>multich</var> <var>hrir</var> format.
  25993. <div class="example">
  25994. <pre class="example">ffmpeg -i input.wav -filter_complex &quot;amovie=minp.wav[hrirs];[0:a][hrirs]headphone=map=FL|FR|FC|LFE|BL|BR|SL|SR:hrir=multich&quot;
  25995. output.wav
  25996. </pre></div>
  25997. </li></ul>
  25998. <a name="highpass"></a>
  25999. <h3 class="section">36.80 highpass<span class="pull-right"><a class="anchor hidden-xs" href="#highpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-highpass" aria-hidden="true">TOC</a></span></h3>
  26000. <p>Apply a high-pass filter with 3dB point frequency.
  26001. The filter can be either single-pole, or double-pole (the default).
  26002. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  26003. </p>
  26004. <p>The filter accepts the following options:
  26005. </p>
  26006. <dl compact="compact">
  26007. <dt><samp>frequency, f</samp></dt>
  26008. <dd><p>Set frequency in Hz. Default is 3000.
  26009. </p>
  26010. </dd>
  26011. <dt><samp>poles, p</samp></dt>
  26012. <dd><p>Set number of poles. Default is 2.
  26013. </p>
  26014. </dd>
  26015. <dt><samp>width_type, t</samp></dt>
  26016. <dd><p>Set method to specify band-width of filter.
  26017. </p><dl compact="compact">
  26018. <dt><samp>h</samp></dt>
  26019. <dd><p>Hz
  26020. </p></dd>
  26021. <dt><samp>q</samp></dt>
  26022. <dd><p>Q-Factor
  26023. </p></dd>
  26024. <dt><samp>o</samp></dt>
  26025. <dd><p>octave
  26026. </p></dd>
  26027. <dt><samp>s</samp></dt>
  26028. <dd><p>slope
  26029. </p></dd>
  26030. <dt><samp>k</samp></dt>
  26031. <dd><p>kHz
  26032. </p></dd>
  26033. </dl>
  26034. </dd>
  26035. <dt><samp>width, w</samp></dt>
  26036. <dd><p>Specify the band-width of a filter in width_type units.
  26037. Applies only to double-pole filter.
  26038. The default is 0.707q and gives a Butterworth response.
  26039. </p>
  26040. </dd>
  26041. <dt><samp>mix, m</samp></dt>
  26042. <dd><p>How much to use filtered signal in output. Default is 1.
  26043. Range is between 0 and 1.
  26044. </p>
  26045. </dd>
  26046. <dt><samp>channels, c</samp></dt>
  26047. <dd><p>Specify which channels to filter, by default all available are filtered.
  26048. </p>
  26049. </dd>
  26050. <dt><samp>normalize, n</samp></dt>
  26051. <dd><p>Normalize biquad coefficients, by default is disabled.
  26052. Enabling it will normalize magnitude response at DC to 0dB.
  26053. </p>
  26054. </dd>
  26055. <dt><samp>transform, a</samp></dt>
  26056. <dd><p>Set transform type of IIR filter.
  26057. </p><dl compact="compact">
  26058. <dt><samp>di</samp></dt>
  26059. <dt><samp>dii</samp></dt>
  26060. <dt><samp>tdii</samp></dt>
  26061. <dt><samp>latt</samp></dt>
  26062. </dl>
  26063. </dd>
  26064. <dt><samp>precision, r</samp></dt>
  26065. <dd><p>Set precison of filtering.
  26066. </p><dl compact="compact">
  26067. <dt><samp>auto</samp></dt>
  26068. <dd><p>Pick automatic sample format depending on surround filters.
  26069. </p></dd>
  26070. <dt><samp>s16</samp></dt>
  26071. <dd><p>Always use signed 16-bit.
  26072. </p></dd>
  26073. <dt><samp>s32</samp></dt>
  26074. <dd><p>Always use signed 32-bit.
  26075. </p></dd>
  26076. <dt><samp>f32</samp></dt>
  26077. <dd><p>Always use float 32-bit.
  26078. </p></dd>
  26079. <dt><samp>f64</samp></dt>
  26080. <dd><p>Always use float 64-bit.
  26081. </p></dd>
  26082. </dl>
  26083. </dd>
  26084. </dl>
  26085. <a name="Commands-32"></a>
  26086. <h4 class="subsection">36.80.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-32" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-32" aria-hidden="true">TOC</a></span></h4>
  26087. <p>This filter supports the following commands:
  26088. </p><dl compact="compact">
  26089. <dt><samp>frequency, f</samp></dt>
  26090. <dd><p>Change highpass frequency.
  26091. Syntax for the command is : &quot;<var>frequency</var>&quot;
  26092. </p>
  26093. </dd>
  26094. <dt><samp>width_type, t</samp></dt>
  26095. <dd><p>Change highpass width_type.
  26096. Syntax for the command is : &quot;<var>width_type</var>&quot;
  26097. </p>
  26098. </dd>
  26099. <dt><samp>width, w</samp></dt>
  26100. <dd><p>Change highpass width.
  26101. Syntax for the command is : &quot;<var>width</var>&quot;
  26102. </p>
  26103. </dd>
  26104. <dt><samp>mix, m</samp></dt>
  26105. <dd><p>Change highpass mix.
  26106. Syntax for the command is : &quot;<var>mix</var>&quot;
  26107. </p></dd>
  26108. </dl>
  26109. <a name="join"></a>
  26110. <h3 class="section">36.81 join<span class="pull-right"><a class="anchor hidden-xs" href="#join" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-join" aria-hidden="true">TOC</a></span></h3>
  26111. <p>Join multiple input streams into one multi-channel stream.
  26112. </p>
  26113. <p>It accepts the following parameters:
  26114. </p><dl compact="compact">
  26115. <dt><samp>inputs</samp></dt>
  26116. <dd><p>The number of input streams. It defaults to 2.
  26117. </p>
  26118. </dd>
  26119. <dt><samp>channel_layout</samp></dt>
  26120. <dd><p>The desired output channel layout. It defaults to stereo.
  26121. </p>
  26122. </dd>
  26123. <dt><samp>map</samp></dt>
  26124. <dd><p>Map channels from inputs to output. The argument is a &rsquo;|&rsquo;-separated list of
  26125. mappings, each in the <code><var>input_idx</var>.<var>in_channel</var>-<var>out_channel</var></code>
  26126. form. <var>input_idx</var> is the 0-based index of the input stream. <var>in_channel</var>
  26127. can be either the name of the input channel (e.g. FL for front left) or its
  26128. index in the specified input stream. <var>out_channel</var> is the name of the output
  26129. channel.
  26130. </p></dd>
  26131. </dl>
  26132. <p>The filter will attempt to guess the mappings when they are not specified
  26133. explicitly. It does so by first trying to find an unused matching input channel
  26134. and if that fails it picks the first unused input channel.
  26135. </p>
  26136. <p>Join 3 inputs (with properly set channel layouts):
  26137. </p><div class="example">
  26138. <pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
  26139. </pre></div>
  26140. <p>Build a 5.1 output from 6 single-channel streams:
  26141. </p><div class="example">
  26142. <pre class="example">ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
  26143. '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'
  26144. out
  26145. </pre></div>
  26146. <a name="ladspa"></a>
  26147. <h3 class="section">36.82 ladspa<span class="pull-right"><a class="anchor hidden-xs" href="#ladspa" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ladspa" aria-hidden="true">TOC</a></span></h3>
  26148. <p>Load a LADSPA (Linux Audio Developer&rsquo;s Simple Plugin API) plugin.
  26149. </p>
  26150. <p>To enable compilation of this filter you need to configure FFmpeg with
  26151. <code>--enable-ladspa</code>.
  26152. </p>
  26153. <dl compact="compact">
  26154. <dt><samp>file, f</samp></dt>
  26155. <dd><p>Specifies the name of LADSPA plugin library to load. If the environment
  26156. variable <code>LADSPA_PATH</code> is defined, the LADSPA plugin is searched in
  26157. each one of the directories specified by the colon separated list in
  26158. <code>LADSPA_PATH</code>, otherwise in the standard LADSPA paths, which are in
  26159. this order: <samp>HOME/.ladspa/lib/</samp>, <samp>/usr/local/lib/ladspa/</samp>,
  26160. <samp>/usr/lib/ladspa/</samp>.
  26161. </p>
  26162. </dd>
  26163. <dt><samp>plugin, p</samp></dt>
  26164. <dd><p>Specifies the plugin within the library. Some libraries contain only
  26165. one plugin, but others contain many of them. If this is not set filter
  26166. will list all available plugins within the specified library.
  26167. </p>
  26168. </dd>
  26169. <dt><samp>controls, c</samp></dt>
  26170. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  26171. values that determine the behavior of the loaded plugin (for example delay,
  26172. threshold or gain).
  26173. Controls need to be defined using the following syntax:
  26174. c0=<var>value0</var>|c1=<var>value1</var>|c2=<var>value2</var>|..., where
  26175. <var>valuei</var> is the value set on the <var>i</var>-th control.
  26176. Alternatively they can be also defined using the following syntax:
  26177. <var>value0</var>|<var>value1</var>|<var>value2</var>|..., where
  26178. <var>valuei</var> is the value set on the <var>i</var>-th control.
  26179. If <samp>controls</samp> is set to <code>help</code>, all available controls and
  26180. their valid ranges are printed.
  26181. </p>
  26182. </dd>
  26183. <dt><samp>sample_rate, s</samp></dt>
  26184. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  26185. zero inputs.
  26186. </p>
  26187. </dd>
  26188. <dt><samp>nb_samples, n</samp></dt>
  26189. <dd><p>Set the number of samples per channel per each output frame, default
  26190. is 1024. Only used if plugin have zero inputs.
  26191. </p>
  26192. </dd>
  26193. <dt><samp>duration, d</samp></dt>
  26194. <dd><p>Set the minimum duration of the sourced audio. See
  26195. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  26196. for the accepted syntax.
  26197. Note that the resulting duration may be greater than the specified duration,
  26198. as the generated audio is always cut at the end of a complete frame.
  26199. If not specified, or the expressed duration is negative, the audio is
  26200. supposed to be generated forever.
  26201. Only used if plugin have zero inputs.
  26202. </p>
  26203. </dd>
  26204. <dt><samp>latency, l</samp></dt>
  26205. <dd><p>Enable latency compensation, by default is disabled.
  26206. Only used if plugin have inputs.
  26207. </p></dd>
  26208. </dl>
  26209. <a name="Examples-62"></a>
  26210. <h4 class="subsection">36.82.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-62" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-62" aria-hidden="true">TOC</a></span></h4>
  26211. <ul>
  26212. <li> List all available plugins within amp (LADSPA example plugin) library:
  26213. <div class="example">
  26214. <pre class="example">ladspa=file=amp
  26215. </pre></div>
  26216. </li><li> List all available controls and their valid ranges for <code>vcf_notch</code>
  26217. plugin from <code>VCF</code> library:
  26218. <div class="example">
  26219. <pre class="example">ladspa=f=vcf:p=vcf_notch:c=help
  26220. </pre></div>
  26221. </li><li> Simulate low quality audio equipment using <code>Computer Music Toolkit</code> (CMT)
  26222. plugin library:
  26223. <div class="example">
  26224. <pre class="example">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
  26225. </pre></div>
  26226. </li><li> Add reverberation to the audio using TAP-plugins
  26227. (Tom&rsquo;s Audio Processing plugins):
  26228. <div class="example">
  26229. <pre class="example">ladspa=file=tap_reverb:tap_reverb
  26230. </pre></div>
  26231. </li><li> Generate white noise, with 0.2 amplitude:
  26232. <div class="example">
  26233. <pre class="example">ladspa=file=cmt:noise_source_white:c=c0=.2
  26234. </pre></div>
  26235. </li><li> Generate 20 bpm clicks using plugin <code>C* Click - Metronome</code> from the
  26236. <code>C* Audio Plugin Suite</code> (CAPS) library:
  26237. <div class="example">
  26238. <pre class="example">ladspa=file=caps:Click:c=c1=20'
  26239. </pre></div>
  26240. </li><li> Apply <code>C* Eq10X2 - Stereo 10-band equaliser</code> effect:
  26241. <div class="example">
  26242. <pre class="example">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
  26243. </pre></div>
  26244. </li><li> Increase volume by 20dB using fast lookahead limiter from Steve Harris
  26245. <code>SWH Plugins</code> collection:
  26246. <div class="example">
  26247. <pre class="example">ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
  26248. </pre></div>
  26249. </li><li> Attenuate low frequencies using Multiband EQ from Steve Harris
  26250. <code>SWH Plugins</code> collection:
  26251. <div class="example">
  26252. <pre class="example">ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
  26253. </pre></div>
  26254. </li><li> Reduce stereo image using <code>Narrower</code> from the <code>C* Audio Plugin Suite</code>
  26255. (CAPS) library:
  26256. <div class="example">
  26257. <pre class="example">ladspa=caps:Narrower
  26258. </pre></div>
  26259. </li><li> Another white noise, now using <code>C* Audio Plugin Suite</code> (CAPS) library:
  26260. <div class="example">
  26261. <pre class="example">ladspa=caps:White:.2
  26262. </pre></div>
  26263. </li><li> Some fractal noise, using <code>C* Audio Plugin Suite</code> (CAPS) library:
  26264. <div class="example">
  26265. <pre class="example">ladspa=caps:Fractal:c=c1=1
  26266. </pre></div>
  26267. </li><li> Dynamic volume normalization using <code>VLevel</code> plugin:
  26268. <div class="example">
  26269. <pre class="example">ladspa=vlevel-ladspa:vlevel_mono
  26270. </pre></div>
  26271. </li></ul>
  26272. <a name="Commands-33"></a>
  26273. <h4 class="subsection">36.82.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-33" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-33" aria-hidden="true">TOC</a></span></h4>
  26274. <p>This filter supports the following commands:
  26275. </p><dl compact="compact">
  26276. <dt><samp>cN</samp></dt>
  26277. <dd><p>Modify the <var>N</var>-th control value.
  26278. </p>
  26279. <p>If the specified value is not valid, it is ignored and prior one is kept.
  26280. </p></dd>
  26281. </dl>
  26282. <a name="loudnorm"></a>
  26283. <h3 class="section">36.83 loudnorm<span class="pull-right"><a class="anchor hidden-xs" href="#loudnorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-loudnorm" aria-hidden="true">TOC</a></span></h3>
  26284. <p>EBU R128 loudness normalization. Includes both dynamic and linear normalization modes.
  26285. Support for both single pass (livestreams, files) and double pass (files) modes.
  26286. This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately
  26287. detect true peaks, the audio stream will be upsampled to 192 kHz.
  26288. Use the <code>-ar</code> option or <code>aresample</code> filter to explicitly set an output sample rate.
  26289. </p>
  26290. <p>The filter accepts the following options:
  26291. </p>
  26292. <dl compact="compact">
  26293. <dt><samp>I, i</samp></dt>
  26294. <dd><p>Set integrated loudness target.
  26295. Range is -70.0 - -5.0. Default value is -24.0.
  26296. </p>
  26297. </dd>
  26298. <dt><samp>LRA, lra</samp></dt>
  26299. <dd><p>Set loudness range target.
  26300. Range is 1.0 - 20.0. Default value is 7.0.
  26301. </p>
  26302. </dd>
  26303. <dt><samp>TP, tp</samp></dt>
  26304. <dd><p>Set maximum true peak.
  26305. Range is -9.0 - +0.0. Default value is -2.0.
  26306. </p>
  26307. </dd>
  26308. <dt><samp>measured_I, measured_i</samp></dt>
  26309. <dd><p>Measured IL of input file.
  26310. Range is -99.0 - +0.0.
  26311. </p>
  26312. </dd>
  26313. <dt><samp>measured_LRA, measured_lra</samp></dt>
  26314. <dd><p>Measured LRA of input file.
  26315. Range is 0.0 - 99.0.
  26316. </p>
  26317. </dd>
  26318. <dt><samp>measured_TP, measured_tp</samp></dt>
  26319. <dd><p>Measured true peak of input file.
  26320. Range is -99.0 - +99.0.
  26321. </p>
  26322. </dd>
  26323. <dt><samp>measured_thresh</samp></dt>
  26324. <dd><p>Measured threshold of input file.
  26325. Range is -99.0 - +0.0.
  26326. </p>
  26327. </dd>
  26328. <dt><samp>offset</samp></dt>
  26329. <dd><p>Set offset gain. Gain is applied before the true-peak limiter.
  26330. Range is -99.0 - +99.0. Default is +0.0.
  26331. </p>
  26332. </dd>
  26333. <dt><samp>linear</samp></dt>
  26334. <dd><p>Normalize by linearly scaling the source audio.
  26335. <code>measured_I</code>, <code>measured_LRA</code>, <code>measured_TP</code>,
  26336. and <code>measured_thresh</code> must all be specified. Target LRA shouldn&rsquo;t
  26337. be lower than source LRA and the change in integrated loudness shouldn&rsquo;t
  26338. result in a true peak which exceeds the target TP. If any of these
  26339. conditions aren&rsquo;t met, normalization mode will revert to <var>dynamic</var>.
  26340. Options are <code>true</code> or <code>false</code>. Default is <code>true</code>.
  26341. </p>
  26342. </dd>
  26343. <dt><samp>dual_mono</samp></dt>
  26344. <dd><p>Treat mono input files as &quot;dual-mono&quot;. If a mono file is intended for playback
  26345. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  26346. If set to <code>true</code>, this option will compensate for this effect.
  26347. Multi-channel input files are not affected by this option.
  26348. Options are true or false. Default is false.
  26349. </p>
  26350. </dd>
  26351. <dt><samp>print_format</samp></dt>
  26352. <dd><p>Set print format for stats. Options are summary, json, or none.
  26353. Default value is none.
  26354. </p></dd>
  26355. </dl>
  26356. <a name="lowpass"></a>
  26357. <h3 class="section">36.84 lowpass<span class="pull-right"><a class="anchor hidden-xs" href="#lowpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lowpass" aria-hidden="true">TOC</a></span></h3>
  26358. <p>Apply a low-pass filter with 3dB point frequency.
  26359. The filter can be either single-pole or double-pole (the default).
  26360. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  26361. </p>
  26362. <p>The filter accepts the following options:
  26363. </p>
  26364. <dl compact="compact">
  26365. <dt><samp>frequency, f</samp></dt>
  26366. <dd><p>Set frequency in Hz. Default is 500.
  26367. </p>
  26368. </dd>
  26369. <dt><samp>poles, p</samp></dt>
  26370. <dd><p>Set number of poles. Default is 2.
  26371. </p>
  26372. </dd>
  26373. <dt><samp>width_type, t</samp></dt>
  26374. <dd><p>Set method to specify band-width of filter.
  26375. </p><dl compact="compact">
  26376. <dt><samp>h</samp></dt>
  26377. <dd><p>Hz
  26378. </p></dd>
  26379. <dt><samp>q</samp></dt>
  26380. <dd><p>Q-Factor
  26381. </p></dd>
  26382. <dt><samp>o</samp></dt>
  26383. <dd><p>octave
  26384. </p></dd>
  26385. <dt><samp>s</samp></dt>
  26386. <dd><p>slope
  26387. </p></dd>
  26388. <dt><samp>k</samp></dt>
  26389. <dd><p>kHz
  26390. </p></dd>
  26391. </dl>
  26392. </dd>
  26393. <dt><samp>width, w</samp></dt>
  26394. <dd><p>Specify the band-width of a filter in width_type units.
  26395. Applies only to double-pole filter.
  26396. The default is 0.707q and gives a Butterworth response.
  26397. </p>
  26398. </dd>
  26399. <dt><samp>mix, m</samp></dt>
  26400. <dd><p>How much to use filtered signal in output. Default is 1.
  26401. Range is between 0 and 1.
  26402. </p>
  26403. </dd>
  26404. <dt><samp>channels, c</samp></dt>
  26405. <dd><p>Specify which channels to filter, by default all available are filtered.
  26406. </p>
  26407. </dd>
  26408. <dt><samp>normalize, n</samp></dt>
  26409. <dd><p>Normalize biquad coefficients, by default is disabled.
  26410. Enabling it will normalize magnitude response at DC to 0dB.
  26411. </p>
  26412. </dd>
  26413. <dt><samp>transform, a</samp></dt>
  26414. <dd><p>Set transform type of IIR filter.
  26415. </p><dl compact="compact">
  26416. <dt><samp>di</samp></dt>
  26417. <dt><samp>dii</samp></dt>
  26418. <dt><samp>tdii</samp></dt>
  26419. <dt><samp>latt</samp></dt>
  26420. </dl>
  26421. </dd>
  26422. <dt><samp>precision, r</samp></dt>
  26423. <dd><p>Set precison of filtering.
  26424. </p><dl compact="compact">
  26425. <dt><samp>auto</samp></dt>
  26426. <dd><p>Pick automatic sample format depending on surround filters.
  26427. </p></dd>
  26428. <dt><samp>s16</samp></dt>
  26429. <dd><p>Always use signed 16-bit.
  26430. </p></dd>
  26431. <dt><samp>s32</samp></dt>
  26432. <dd><p>Always use signed 32-bit.
  26433. </p></dd>
  26434. <dt><samp>f32</samp></dt>
  26435. <dd><p>Always use float 32-bit.
  26436. </p></dd>
  26437. <dt><samp>f64</samp></dt>
  26438. <dd><p>Always use float 64-bit.
  26439. </p></dd>
  26440. </dl>
  26441. </dd>
  26442. </dl>
  26443. <a name="Examples-63"></a>
  26444. <h4 class="subsection">36.84.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-63" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-63" aria-hidden="true">TOC</a></span></h4>
  26445. <ul>
  26446. <li> Lowpass only LFE channel, it LFE is not present it does nothing:
  26447. <div class="example">
  26448. <pre class="example">lowpass=c=LFE
  26449. </pre></div>
  26450. </li></ul>
  26451. <a name="Commands-34"></a>
  26452. <h4 class="subsection">36.84.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-34" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-34" aria-hidden="true">TOC</a></span></h4>
  26453. <p>This filter supports the following commands:
  26454. </p><dl compact="compact">
  26455. <dt><samp>frequency, f</samp></dt>
  26456. <dd><p>Change lowpass frequency.
  26457. Syntax for the command is : &quot;<var>frequency</var>&quot;
  26458. </p>
  26459. </dd>
  26460. <dt><samp>width_type, t</samp></dt>
  26461. <dd><p>Change lowpass width_type.
  26462. Syntax for the command is : &quot;<var>width_type</var>&quot;
  26463. </p>
  26464. </dd>
  26465. <dt><samp>width, w</samp></dt>
  26466. <dd><p>Change lowpass width.
  26467. Syntax for the command is : &quot;<var>width</var>&quot;
  26468. </p>
  26469. </dd>
  26470. <dt><samp>mix, m</samp></dt>
  26471. <dd><p>Change lowpass mix.
  26472. Syntax for the command is : &quot;<var>mix</var>&quot;
  26473. </p></dd>
  26474. </dl>
  26475. <a name="lv2"></a>
  26476. <h3 class="section">36.85 lv2<span class="pull-right"><a class="anchor hidden-xs" href="#lv2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lv2" aria-hidden="true">TOC</a></span></h3>
  26477. <p>Load a LV2 (LADSPA Version 2) plugin.
  26478. </p>
  26479. <p>To enable compilation of this filter you need to configure FFmpeg with
  26480. <code>--enable-lv2</code>.
  26481. </p>
  26482. <dl compact="compact">
  26483. <dt><samp>plugin, p</samp></dt>
  26484. <dd><p>Specifies the plugin URI. You may need to escape &rsquo;:&rsquo;.
  26485. </p>
  26486. </dd>
  26487. <dt><samp>controls, c</samp></dt>
  26488. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  26489. values that determine the behavior of the loaded plugin (for example delay,
  26490. threshold or gain).
  26491. If <samp>controls</samp> is set to <code>help</code>, all available controls and
  26492. their valid ranges are printed.
  26493. </p>
  26494. </dd>
  26495. <dt><samp>sample_rate, s</samp></dt>
  26496. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  26497. zero inputs.
  26498. </p>
  26499. </dd>
  26500. <dt><samp>nb_samples, n</samp></dt>
  26501. <dd><p>Set the number of samples per channel per each output frame, default
  26502. is 1024. Only used if plugin have zero inputs.
  26503. </p>
  26504. </dd>
  26505. <dt><samp>duration, d</samp></dt>
  26506. <dd><p>Set the minimum duration of the sourced audio. See
  26507. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  26508. for the accepted syntax.
  26509. Note that the resulting duration may be greater than the specified duration,
  26510. as the generated audio is always cut at the end of a complete frame.
  26511. If not specified, or the expressed duration is negative, the audio is
  26512. supposed to be generated forever.
  26513. Only used if plugin have zero inputs.
  26514. </p></dd>
  26515. </dl>
  26516. <a name="Examples-64"></a>
  26517. <h4 class="subsection">36.85.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-64" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-64" aria-hidden="true">TOC</a></span></h4>
  26518. <ul>
  26519. <li> Apply bass enhancer plugin from Calf:
  26520. <div class="example">
  26521. <pre class="example">lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
  26522. </pre></div>
  26523. </li><li> Apply vinyl plugin from Calf:
  26524. <div class="example">
  26525. <pre class="example">lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
  26526. </pre></div>
  26527. </li><li> Apply bit crusher plugin from ArtyFX:
  26528. <div class="example">
  26529. <pre class="example">lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
  26530. </pre></div>
  26531. </li></ul>
  26532. <a name="mcompand"></a>
  26533. <h3 class="section">36.86 mcompand<span class="pull-right"><a class="anchor hidden-xs" href="#mcompand" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mcompand" aria-hidden="true">TOC</a></span></h3>
  26534. <p>Multiband Compress or expand the audio&rsquo;s dynamic range.
  26535. </p>
  26536. <p>The input audio is divided into bands using 4th order Linkwitz-Riley IIRs.
  26537. This is akin to the crossover of a loudspeaker, and results in flat frequency
  26538. response when absent compander action.
  26539. </p>
  26540. <p>It accepts the following parameters:
  26541. </p>
  26542. <dl compact="compact">
  26543. <dt><samp>args</samp></dt>
  26544. <dd><p>This option syntax is:
  26545. attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ...
  26546. For explanation of each item refer to compand filter documentation.
  26547. </p></dd>
  26548. </dl>
  26549. <span id="pan"></span><a name="pan-1"></a>
  26550. <h3 class="section">36.87 pan<span class="pull-right"><a class="anchor hidden-xs" href="#pan-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pan-1" aria-hidden="true">TOC</a></span></h3>
  26551. <p>Mix channels with specific gain levels. The filter accepts the output
  26552. channel layout followed by a set of channels definitions.
  26553. </p>
  26554. <p>This filter is also designed to efficiently remap the channels of an audio
  26555. stream.
  26556. </p>
  26557. <p>The filter accepts parameters of the form:
  26558. &quot;<var>l</var>|<var>outdef</var>|<var>outdef</var>|...&quot;
  26559. </p>
  26560. <dl compact="compact">
  26561. <dt><samp>l</samp></dt>
  26562. <dd><p>output channel layout or number of channels
  26563. </p>
  26564. </dd>
  26565. <dt><samp>outdef</samp></dt>
  26566. <dd><p>output channel specification, of the form:
  26567. &quot;<var>out_name</var>=[<var>gain</var>*]<var>in_name</var>[(+-)[<var>gain</var>*]<var>in_name</var>...]&quot;
  26568. </p>
  26569. </dd>
  26570. <dt><samp>out_name</samp></dt>
  26571. <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
  26572. number (c0, c1, etc.)
  26573. </p>
  26574. </dd>
  26575. <dt><samp>gain</samp></dt>
  26576. <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
  26577. </p>
  26578. </dd>
  26579. <dt><samp>in_name</samp></dt>
  26580. <dd><p>input channel to use, see out_name for details; it is not possible to mix
  26581. named and numbered input channels
  26582. </p></dd>
  26583. </dl>
  26584. <p>If the &lsquo;=&rsquo; in a channel specification is replaced by &lsquo;&lt;&rsquo;, then the gains for
  26585. that specification will be renormalized so that the total is 1, thus
  26586. avoiding clipping noise.
  26587. </p>
  26588. <a name="Mixing-examples"></a>
  26589. <h4 class="subsection">36.87.1 Mixing examples<span class="pull-right"><a class="anchor hidden-xs" href="#Mixing-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Mixing-examples" aria-hidden="true">TOC</a></span></h4>
  26590. <p>For example, if you want to down-mix from stereo to mono, but with a bigger
  26591. factor for the left channel:
  26592. </p><div class="example">
  26593. <pre class="example">pan=1c|c0=0.9*c0+0.1*c1
  26594. </pre></div>
  26595. <p>A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
  26596. 7-channels surround:
  26597. </p><div class="example">
  26598. <pre class="example">pan=stereo| FL &lt; FL + 0.5*FC + 0.6*BL + 0.6*SL | FR &lt; FR + 0.5*FC + 0.6*BR + 0.6*SR
  26599. </pre></div>
  26600. <p>Note that <code>ffmpeg</code> integrates a default down-mix (and up-mix) system
  26601. that should be preferred (see &quot;-ac&quot; option) unless you have very specific
  26602. needs.
  26603. </p>
  26604. <a name="Remapping-examples"></a>
  26605. <h4 class="subsection">36.87.2 Remapping examples<span class="pull-right"><a class="anchor hidden-xs" href="#Remapping-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Remapping-examples" aria-hidden="true">TOC</a></span></h4>
  26606. <p>The channel remapping will be effective if, and only if:
  26607. </p>
  26608. <ul>
  26609. <li> gain coefficients are zeroes or ones,
  26610. </li><li> only one input per channel output,
  26611. </li></ul>
  26612. <p>If all these conditions are satisfied, the filter will notify the user (&quot;Pure
  26613. channel mapping detected&quot;), and use an optimized and lossless method to do the
  26614. remapping.
  26615. </p>
  26616. <p>For example, if you have a 5.1 source and want a stereo audio stream by
  26617. dropping the extra channels:
  26618. </p><div class="example">
  26619. <pre class="example">pan=&quot;stereo| c0=FL | c1=FR&quot;
  26620. </pre></div>
  26621. <p>Given the same source, you can also switch front left and front right channels
  26622. and keep the input channel layout:
  26623. </p><div class="example">
  26624. <pre class="example">pan=&quot;5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5&quot;
  26625. </pre></div>
  26626. <p>If the input is a stereo audio stream, you can mute the front left channel (and
  26627. still keep the stereo channel layout) with:
  26628. </p><div class="example">
  26629. <pre class="example">pan=&quot;stereo|c1=c1&quot;
  26630. </pre></div>
  26631. <p>Still with a stereo audio stream input, you can copy the right channel in both
  26632. front left and right:
  26633. </p><div class="example">
  26634. <pre class="example">pan=&quot;stereo| c0=FR | c1=FR&quot;
  26635. </pre></div>
  26636. <a name="replaygain"></a>
  26637. <h3 class="section">36.88 replaygain<span class="pull-right"><a class="anchor hidden-xs" href="#replaygain" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-replaygain" aria-hidden="true">TOC</a></span></h3>
  26638. <p>ReplayGain scanner filter. This filter takes an audio stream as an input and
  26639. outputs it unchanged.
  26640. At end of filtering it displays <code>track_gain</code> and <code>track_peak</code>.
  26641. </p>
  26642. <a name="resample"></a>
  26643. <h3 class="section">36.89 resample<span class="pull-right"><a class="anchor hidden-xs" href="#resample" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-resample" aria-hidden="true">TOC</a></span></h3>
  26644. <p>Convert the audio sample format, sample rate and channel layout. It is
  26645. not meant to be used directly.
  26646. </p>
  26647. <a name="rubberband"></a>
  26648. <h3 class="section">36.90 rubberband<span class="pull-right"><a class="anchor hidden-xs" href="#rubberband" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rubberband" aria-hidden="true">TOC</a></span></h3>
  26649. <p>Apply time-stretching and pitch-shifting with librubberband.
  26650. </p>
  26651. <p>To enable compilation of this filter, you need to configure FFmpeg with
  26652. <code>--enable-librubberband</code>.
  26653. </p>
  26654. <p>The filter accepts the following options:
  26655. </p>
  26656. <dl compact="compact">
  26657. <dt><samp>tempo</samp></dt>
  26658. <dd><p>Set tempo scale factor.
  26659. </p>
  26660. </dd>
  26661. <dt><samp>pitch</samp></dt>
  26662. <dd><p>Set pitch scale factor.
  26663. </p>
  26664. </dd>
  26665. <dt><samp>transients</samp></dt>
  26666. <dd><p>Set transients detector.
  26667. Possible values are:
  26668. </p><dl compact="compact">
  26669. <dt><var>crisp</var></dt>
  26670. <dt><var>mixed</var></dt>
  26671. <dt><var>smooth</var></dt>
  26672. </dl>
  26673. </dd>
  26674. <dt><samp>detector</samp></dt>
  26675. <dd><p>Set detector.
  26676. Possible values are:
  26677. </p><dl compact="compact">
  26678. <dt><var>compound</var></dt>
  26679. <dt><var>percussive</var></dt>
  26680. <dt><var>soft</var></dt>
  26681. </dl>
  26682. </dd>
  26683. <dt><samp>phase</samp></dt>
  26684. <dd><p>Set phase.
  26685. Possible values are:
  26686. </p><dl compact="compact">
  26687. <dt><var>laminar</var></dt>
  26688. <dt><var>independent</var></dt>
  26689. </dl>
  26690. </dd>
  26691. <dt><samp>window</samp></dt>
  26692. <dd><p>Set processing window size.
  26693. Possible values are:
  26694. </p><dl compact="compact">
  26695. <dt><var>standard</var></dt>
  26696. <dt><var>short</var></dt>
  26697. <dt><var>long</var></dt>
  26698. </dl>
  26699. </dd>
  26700. <dt><samp>smoothing</samp></dt>
  26701. <dd><p>Set smoothing.
  26702. Possible values are:
  26703. </p><dl compact="compact">
  26704. <dt><var>off</var></dt>
  26705. <dt><var>on</var></dt>
  26706. </dl>
  26707. </dd>
  26708. <dt><samp>formant</samp></dt>
  26709. <dd><p>Enable formant preservation when shift pitching.
  26710. Possible values are:
  26711. </p><dl compact="compact">
  26712. <dt><var>shifted</var></dt>
  26713. <dt><var>preserved</var></dt>
  26714. </dl>
  26715. </dd>
  26716. <dt><samp>pitchq</samp></dt>
  26717. <dd><p>Set pitch quality.
  26718. Possible values are:
  26719. </p><dl compact="compact">
  26720. <dt><var>quality</var></dt>
  26721. <dt><var>speed</var></dt>
  26722. <dt><var>consistency</var></dt>
  26723. </dl>
  26724. </dd>
  26725. <dt><samp>channels</samp></dt>
  26726. <dd><p>Set channels.
  26727. Possible values are:
  26728. </p><dl compact="compact">
  26729. <dt><var>apart</var></dt>
  26730. <dt><var>together</var></dt>
  26731. </dl>
  26732. </dd>
  26733. </dl>
  26734. <a name="Commands-35"></a>
  26735. <h4 class="subsection">36.90.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-35" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-35" aria-hidden="true">TOC</a></span></h4>
  26736. <p>This filter supports the following commands:
  26737. </p><dl compact="compact">
  26738. <dt><samp>tempo</samp></dt>
  26739. <dd><p>Change filter tempo scale factor.
  26740. Syntax for the command is : &quot;<var>tempo</var>&quot;
  26741. </p>
  26742. </dd>
  26743. <dt><samp>pitch</samp></dt>
  26744. <dd><p>Change filter pitch scale factor.
  26745. Syntax for the command is : &quot;<var>pitch</var>&quot;
  26746. </p></dd>
  26747. </dl>
  26748. <a name="sidechaincompress"></a>
  26749. <h3 class="section">36.91 sidechaincompress<span class="pull-right"><a class="anchor hidden-xs" href="#sidechaincompress" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sidechaincompress" aria-hidden="true">TOC</a></span></h3>
  26750. <p>This filter acts like normal compressor but has the ability to compress
  26751. detected signal using second input signal.
  26752. It needs two input streams and returns one output stream.
  26753. First input stream will be processed depending on second stream signal.
  26754. The filtered signal then can be filtered with other filters in later stages of
  26755. processing. See <a href="#pan">pan</a> and <a href="#amerge">amerge</a> filter.
  26756. </p>
  26757. <p>The filter accepts the following options:
  26758. </p>
  26759. <dl compact="compact">
  26760. <dt><samp>level_in</samp></dt>
  26761. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  26762. </p>
  26763. </dd>
  26764. <dt><samp>mode</samp></dt>
  26765. <dd><p>Set mode of compressor operation. Can be <code>upward</code> or <code>downward</code>.
  26766. Default is <code>downward</code>.
  26767. </p>
  26768. </dd>
  26769. <dt><samp>threshold</samp></dt>
  26770. <dd><p>If a signal of second stream raises above this level it will affect the gain
  26771. reduction of first stream.
  26772. By default is 0.125. Range is between 0.00097563 and 1.
  26773. </p>
  26774. </dd>
  26775. <dt><samp>ratio</samp></dt>
  26776. <dd><p>Set a ratio about which the signal is reduced. 1:2 means that if the level
  26777. raised 4dB above the threshold, it will be only 2dB above after the reduction.
  26778. Default is 2. Range is between 1 and 20.
  26779. </p>
  26780. </dd>
  26781. <dt><samp>attack</samp></dt>
  26782. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  26783. reduction starts. Default is 20. Range is between 0.01 and 2000.
  26784. </p>
  26785. </dd>
  26786. <dt><samp>release</samp></dt>
  26787. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  26788. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  26789. </p>
  26790. </dd>
  26791. <dt><samp>makeup</samp></dt>
  26792. <dd><p>Set the amount by how much signal will be amplified after processing.
  26793. Default is 1. Range is from 1 to 64.
  26794. </p>
  26795. </dd>
  26796. <dt><samp>knee</samp></dt>
  26797. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  26798. Default is 2.82843. Range is between 1 and 8.
  26799. </p>
  26800. </dd>
  26801. <dt><samp>link</samp></dt>
  26802. <dd><p>Choose if the <code>average</code> level between all channels of side-chain stream
  26803. or the louder(<code>maximum</code>) channel of side-chain stream affects the
  26804. reduction. Default is <code>average</code>.
  26805. </p>
  26806. </dd>
  26807. <dt><samp>detection</samp></dt>
  26808. <dd><p>Should the exact signal be taken in case of <code>peak</code> or an RMS one in case
  26809. of <code>rms</code>. Default is <code>rms</code> which is mainly smoother.
  26810. </p>
  26811. </dd>
  26812. <dt><samp>level_sc</samp></dt>
  26813. <dd><p>Set sidechain gain. Default is 1. Range is between 0.015625 and 64.
  26814. </p>
  26815. </dd>
  26816. <dt><samp>mix</samp></dt>
  26817. <dd><p>How much to use compressed signal in output. Default is 1.
  26818. Range is between 0 and 1.
  26819. </p></dd>
  26820. </dl>
  26821. <a name="Commands-36"></a>
  26822. <h4 class="subsection">36.91.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-36" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-36" aria-hidden="true">TOC</a></span></h4>
  26823. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  26824. </p>
  26825. <a name="Examples-65"></a>
  26826. <h4 class="subsection">36.91.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-65" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-65" aria-hidden="true">TOC</a></span></h4>
  26827. <ul>
  26828. <li> Full ffmpeg example taking 2 audio inputs, 1st input to be compressed
  26829. depending on the signal of 2nd input and later compressed signal to be
  26830. merged with 2nd input:
  26831. <div class="example">
  26832. <pre class="example">ffmpeg -i main.flac -i sidechain.flac -filter_complex &quot;[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge&quot;
  26833. </pre></div>
  26834. </li></ul>
  26835. <a name="sidechaingate"></a>
  26836. <h3 class="section">36.92 sidechaingate<span class="pull-right"><a class="anchor hidden-xs" href="#sidechaingate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sidechaingate" aria-hidden="true">TOC</a></span></h3>
  26837. <p>A sidechain gate acts like a normal (wideband) gate but has the ability to
  26838. filter the detected signal before sending it to the gain reduction stage.
  26839. Normally a gate uses the full range signal to detect a level above the
  26840. threshold.
  26841. For example: If you cut all lower frequencies from your sidechain signal
  26842. the gate will decrease the volume of your track only if not enough highs
  26843. appear. With this technique you are able to reduce the resonation of a
  26844. natural drum or remove &quot;rumbling&quot; of muted strokes from a heavily distorted
  26845. guitar.
  26846. It needs two input streams and returns one output stream.
  26847. First input stream will be processed depending on second stream signal.
  26848. </p>
  26849. <p>The filter accepts the following options:
  26850. </p>
  26851. <dl compact="compact">
  26852. <dt><samp>level_in</samp></dt>
  26853. <dd><p>Set input level before filtering.
  26854. Default is 1. Allowed range is from 0.015625 to 64.
  26855. </p>
  26856. </dd>
  26857. <dt><samp>mode</samp></dt>
  26858. <dd><p>Set the mode of operation. Can be <code>upward</code> or <code>downward</code>.
  26859. Default is <code>downward</code>. If set to <code>upward</code> mode, higher parts of signal
  26860. will be amplified, expanding dynamic range in upward direction.
  26861. Otherwise, in case of <code>downward</code> lower parts of signal will be reduced.
  26862. </p>
  26863. </dd>
  26864. <dt><samp>range</samp></dt>
  26865. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  26866. Default is 0.06125. Allowed range is from 0 to 1.
  26867. Setting this to 0 disables reduction and then filter behaves like expander.
  26868. </p>
  26869. </dd>
  26870. <dt><samp>threshold</samp></dt>
  26871. <dd><p>If a signal rises above this level the gain reduction is released.
  26872. Default is 0.125. Allowed range is from 0 to 1.
  26873. </p>
  26874. </dd>
  26875. <dt><samp>ratio</samp></dt>
  26876. <dd><p>Set a ratio about which the signal is reduced.
  26877. Default is 2. Allowed range is from 1 to 9000.
  26878. </p>
  26879. </dd>
  26880. <dt><samp>attack</samp></dt>
  26881. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  26882. reduction stops.
  26883. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  26884. </p>
  26885. </dd>
  26886. <dt><samp>release</samp></dt>
  26887. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  26888. reduction is increased again. Default is 250 milliseconds.
  26889. Allowed range is from 0.01 to 9000.
  26890. </p>
  26891. </dd>
  26892. <dt><samp>makeup</samp></dt>
  26893. <dd><p>Set amount of amplification of signal after processing.
  26894. Default is 1. Allowed range is from 1 to 64.
  26895. </p>
  26896. </dd>
  26897. <dt><samp>knee</samp></dt>
  26898. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  26899. Default is 2.828427125. Allowed range is from 1 to 8.
  26900. </p>
  26901. </dd>
  26902. <dt><samp>detection</samp></dt>
  26903. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  26904. Default is rms. Can be peak or rms.
  26905. </p>
  26906. </dd>
  26907. <dt><samp>link</samp></dt>
  26908. <dd><p>Choose if the average level between all channels or the louder channel affects
  26909. the reduction.
  26910. Default is average. Can be average or maximum.
  26911. </p>
  26912. </dd>
  26913. <dt><samp>level_sc</samp></dt>
  26914. <dd><p>Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
  26915. </p></dd>
  26916. </dl>
  26917. <a name="Commands-37"></a>
  26918. <h4 class="subsection">36.92.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-37" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-37" aria-hidden="true">TOC</a></span></h4>
  26919. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  26920. </p>
  26921. <a name="silencedetect"></a>
  26922. <h3 class="section">36.93 silencedetect<span class="pull-right"><a class="anchor hidden-xs" href="#silencedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-silencedetect" aria-hidden="true">TOC</a></span></h3>
  26923. <p>Detect silence in an audio stream.
  26924. </p>
  26925. <p>This filter logs a message when it detects that the input audio volume is less
  26926. or equal to a noise tolerance value for a duration greater or equal to the
  26927. minimum detected noise duration.
  26928. </p>
  26929. <p>The printed times and duration are expressed in seconds. The
  26930. <code>lavfi.silence_start</code> or <code>lavfi.silence_start.X</code> metadata key
  26931. is set on the first frame whose timestamp equals or exceeds the detection
  26932. duration and it contains the timestamp of the first frame of the silence.
  26933. </p>
  26934. <p>The <code>lavfi.silence_duration</code> or <code>lavfi.silence_duration.X</code>
  26935. and <code>lavfi.silence_end</code> or <code>lavfi.silence_end.X</code> metadata
  26936. keys are set on the first frame after the silence. If <samp>mono</samp> is
  26937. enabled, and each channel is evaluated separately, the <code>.X</code>
  26938. suffixed keys are used, and <code>X</code> corresponds to the channel number.
  26939. </p>
  26940. <p>The filter accepts the following options:
  26941. </p>
  26942. <dl compact="compact">
  26943. <dt><samp>noise, n</samp></dt>
  26944. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  26945. specified value) or amplitude ratio. Default is -60dB, or 0.001.
  26946. </p>
  26947. </dd>
  26948. <dt><samp>duration, d</samp></dt>
  26949. <dd><p>Set silence duration until notification (default is 2 seconds). See
  26950. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  26951. for the accepted syntax.
  26952. </p>
  26953. </dd>
  26954. <dt><samp>mono, m</samp></dt>
  26955. <dd><p>Process each channel separately, instead of combined. By default is disabled.
  26956. </p></dd>
  26957. </dl>
  26958. <a name="Examples-66"></a>
  26959. <h4 class="subsection">36.93.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-66" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-66" aria-hidden="true">TOC</a></span></h4>
  26960. <ul>
  26961. <li> Detect 5 seconds of silence with -50dB noise tolerance:
  26962. <div class="example">
  26963. <pre class="example">silencedetect=n=-50dB:d=5
  26964. </pre></div>
  26965. </li><li> Complete example with <code>ffmpeg</code> to detect silence with 0.0001 noise
  26966. tolerance in <samp>silence.mp3</samp>:
  26967. <div class="example">
  26968. <pre class="example">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
  26969. </pre></div>
  26970. </li></ul>
  26971. <a name="silenceremove"></a>
  26972. <h3 class="section">36.94 silenceremove<span class="pull-right"><a class="anchor hidden-xs" href="#silenceremove" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-silenceremove" aria-hidden="true">TOC</a></span></h3>
  26973. <p>Remove silence from the beginning, middle or end of the audio.
  26974. </p>
  26975. <p>The filter accepts the following options:
  26976. </p>
  26977. <dl compact="compact">
  26978. <dt><samp>start_periods</samp></dt>
  26979. <dd><p>This value is used to indicate if audio should be trimmed at beginning of
  26980. the audio. A value of zero indicates no silence should be trimmed from the
  26981. beginning. When specifying a non-zero value, it trims audio up until it
  26982. finds non-silence. Normally, when trimming silence from beginning of audio
  26983. the <var>start_periods</var> will be <code>1</code> but it can be increased to higher
  26984. values to trim all audio up to specific count of non-silence periods.
  26985. Default value is <code>0</code>.
  26986. </p>
  26987. </dd>
  26988. <dt><samp>start_duration</samp></dt>
  26989. <dd><p>Specify the amount of time that non-silence must be detected before it stops
  26990. trimming audio. By increasing the duration, bursts of noises can be treated
  26991. as silence and trimmed off. Default value is <code>0</code>.
  26992. </p>
  26993. </dd>
  26994. <dt><samp>start_threshold</samp></dt>
  26995. <dd><p>This indicates what sample value should be treated as silence. For digital
  26996. audio, a value of <code>0</code> may be fine but for audio recorded from analog,
  26997. you may wish to increase the value to account for background noise.
  26998. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  26999. or amplitude ratio. Default value is <code>0</code>.
  27000. </p>
  27001. </dd>
  27002. <dt><samp>start_silence</samp></dt>
  27003. <dd><p>Specify max duration of silence at beginning that will be kept after
  27004. trimming. Default is 0, which is equal to trimming all samples detected
  27005. as silence.
  27006. </p>
  27007. </dd>
  27008. <dt><samp>start_mode</samp></dt>
  27009. <dd><p>Specify mode of detection of silence end in start of multi-channel audio.
  27010. Can be <var>any</var> or <var>all</var>. Default is <var>any</var>.
  27011. With <var>any</var>, any sample that is detected as non-silence will cause
  27012. stopped trimming of silence.
  27013. With <var>all</var>, only if all channels are detected as non-silence will cause
  27014. stopped trimming of silence.
  27015. </p>
  27016. </dd>
  27017. <dt><samp>stop_periods</samp></dt>
  27018. <dd><p>Set the count for trimming silence from the end of audio.
  27019. To remove silence from the middle of a file, specify a <var>stop_periods</var>
  27020. that is negative. This value is then treated as a positive value and is
  27021. used to indicate the effect should restart processing as specified by
  27022. <var>start_periods</var>, making it suitable for removing periods of silence
  27023. in the middle of the audio.
  27024. Default value is <code>0</code>.
  27025. </p>
  27026. </dd>
  27027. <dt><samp>stop_duration</samp></dt>
  27028. <dd><p>Specify a duration of silence that must exist before audio is not copied any
  27029. more. By specifying a higher duration, silence that is wanted can be left in
  27030. the audio.
  27031. Default value is <code>0</code>.
  27032. </p>
  27033. </dd>
  27034. <dt><samp>stop_threshold</samp></dt>
  27035. <dd><p>This is the same as <samp>start_threshold</samp> but for trimming silence from
  27036. the end of audio.
  27037. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  27038. or amplitude ratio. Default value is <code>0</code>.
  27039. </p>
  27040. </dd>
  27041. <dt><samp>stop_silence</samp></dt>
  27042. <dd><p>Specify max duration of silence at end that will be kept after
  27043. trimming. Default is 0, which is equal to trimming all samples detected
  27044. as silence.
  27045. </p>
  27046. </dd>
  27047. <dt><samp>stop_mode</samp></dt>
  27048. <dd><p>Specify mode of detection of silence start in end of multi-channel audio.
  27049. Can be <var>any</var> or <var>all</var>. Default is <var>any</var>.
  27050. With <var>any</var>, any sample that is detected as non-silence will cause
  27051. stopped trimming of silence.
  27052. With <var>all</var>, only if all channels are detected as non-silence will cause
  27053. stopped trimming of silence.
  27054. </p>
  27055. </dd>
  27056. <dt><samp>detection</samp></dt>
  27057. <dd><p>Set how is silence detected. Can be <code>rms</code> or <code>peak</code>. Second is faster
  27058. and works better with digital silence which is exactly 0.
  27059. Default value is <code>rms</code>.
  27060. </p>
  27061. </dd>
  27062. <dt><samp>window</samp></dt>
  27063. <dd><p>Set duration in number of seconds used to calculate size of window in number
  27064. of samples for detecting silence.
  27065. Default value is <code>0.02</code>. Allowed range is from <code>0</code> to <code>10</code>.
  27066. </p></dd>
  27067. </dl>
  27068. <a name="Examples-67"></a>
  27069. <h4 class="subsection">36.94.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-67" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-67" aria-hidden="true">TOC</a></span></h4>
  27070. <ul>
  27071. <li> The following example shows how this filter can be used to start a recording
  27072. that does not contain the delay at the start which usually occurs between
  27073. pressing the record button and the start of the performance:
  27074. <div class="example">
  27075. <pre class="example">silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
  27076. </pre></div>
  27077. </li><li> Trim all silence encountered from beginning to end where there is more than 1
  27078. second of silence in audio:
  27079. <div class="example">
  27080. <pre class="example">silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
  27081. </pre></div>
  27082. </li><li> Trim all digital silence samples, using peak detection, from beginning to end
  27083. where there is more than 0 samples of digital silence in audio and digital
  27084. silence is detected in all channels at same positions in stream:
  27085. <div class="example">
  27086. <pre class="example">silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0
  27087. </pre></div>
  27088. </li></ul>
  27089. <a name="sofalizer"></a>
  27090. <h3 class="section">36.95 sofalizer<span class="pull-right"><a class="anchor hidden-xs" href="#sofalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sofalizer" aria-hidden="true">TOC</a></span></h3>
  27091. <p>SOFAlizer uses head-related transfer functions (HRTFs) to create virtual
  27092. loudspeakers around the user for binaural listening via headphones (audio
  27093. formats up to 9 channels supported).
  27094. The HRTFs are stored in SOFA files (see <a href="http://www.sofacoustics.org/">http://www.sofacoustics.org/</a> for a database).
  27095. SOFAlizer is developed at the Acoustics Research Institute (ARI) of the
  27096. Austrian Academy of Sciences.
  27097. </p>
  27098. <p>To enable compilation of this filter you need to configure FFmpeg with
  27099. <code>--enable-libmysofa</code>.
  27100. </p>
  27101. <p>The filter accepts the following options:
  27102. </p>
  27103. <dl compact="compact">
  27104. <dt><samp>sofa</samp></dt>
  27105. <dd><p>Set the SOFA file used for rendering.
  27106. </p>
  27107. </dd>
  27108. <dt><samp>gain</samp></dt>
  27109. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  27110. </p>
  27111. </dd>
  27112. <dt><samp>rotation</samp></dt>
  27113. <dd><p>Set rotation of virtual loudspeakers in deg. Default is 0.
  27114. </p>
  27115. </dd>
  27116. <dt><samp>elevation</samp></dt>
  27117. <dd><p>Set elevation of virtual speakers in deg. Default is 0.
  27118. </p>
  27119. </dd>
  27120. <dt><samp>radius</samp></dt>
  27121. <dd><p>Set distance in meters between loudspeakers and the listener with near-field
  27122. HRTFs. Default is 1.
  27123. </p>
  27124. </dd>
  27125. <dt><samp>type</samp></dt>
  27126. <dd><p>Set processing type. Can be <var>time</var> or <var>freq</var>. <var>time</var> is
  27127. processing audio in time domain which is slow.
  27128. <var>freq</var> is processing audio in frequency domain which is fast.
  27129. Default is <var>freq</var>.
  27130. </p>
  27131. </dd>
  27132. <dt><samp>speakers</samp></dt>
  27133. <dd><p>Set custom positions of virtual loudspeakers. Syntax for this option is:
  27134. &lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;[|&lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;|...].
  27135. Each virtual loudspeaker is described with short channel name following with
  27136. azimuth and elevation in degrees.
  27137. Each virtual loudspeaker description is separated by &rsquo;|&rsquo;.
  27138. For example to override front left and front right channel positions use:
  27139. &rsquo;speakers=FL 45 15|FR 345 15&rsquo;.
  27140. Descriptions with unrecognised channel names are ignored.
  27141. </p>
  27142. </dd>
  27143. <dt><samp>lfegain</samp></dt>
  27144. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  27145. </p>
  27146. </dd>
  27147. <dt><samp>framesize</samp></dt>
  27148. <dd><p>Set custom frame size in number of samples. Default is 1024.
  27149. Allowed range is from 1024 to 96000. Only used if option &lsquo;<samp>type</samp>&rsquo;
  27150. is set to <var>freq</var>.
  27151. </p>
  27152. </dd>
  27153. <dt><samp>normalize</samp></dt>
  27154. <dd><p>Should all IRs be normalized upon importing SOFA file.
  27155. By default is enabled.
  27156. </p>
  27157. </dd>
  27158. <dt><samp>interpolate</samp></dt>
  27159. <dd><p>Should nearest IRs be interpolated with neighbor IRs if exact position
  27160. does not match. By default is disabled.
  27161. </p>
  27162. </dd>
  27163. <dt><samp>minphase</samp></dt>
  27164. <dd><p>Minphase all IRs upon loading of SOFA file. By default is disabled.
  27165. </p>
  27166. </dd>
  27167. <dt><samp>anglestep</samp></dt>
  27168. <dd><p>Set neighbor search angle step. Only used if option <var>interpolate</var> is enabled.
  27169. </p>
  27170. </dd>
  27171. <dt><samp>radstep</samp></dt>
  27172. <dd><p>Set neighbor search radius step. Only used if option <var>interpolate</var> is enabled.
  27173. </p></dd>
  27174. </dl>
  27175. <a name="Examples-68"></a>
  27176. <h4 class="subsection">36.95.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-68" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-68" aria-hidden="true">TOC</a></span></h4>
  27177. <ul>
  27178. <li> Using ClubFritz6 sofa file:
  27179. <div class="example">
  27180. <pre class="example">sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
  27181. </pre></div>
  27182. </li><li> Using ClubFritz12 sofa file and bigger radius with small rotation:
  27183. <div class="example">
  27184. <pre class="example">sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
  27185. </pre></div>
  27186. </li><li> Similar as above but with custom speaker positions for front left, front right, back left and back right
  27187. and also with custom gain:
  27188. <div class="example">
  27189. <pre class="example">&quot;sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|BL 135|BR 225:gain=28&quot;
  27190. </pre></div>
  27191. </li></ul>
  27192. <a name="speechnorm"></a>
  27193. <h3 class="section">36.96 speechnorm<span class="pull-right"><a class="anchor hidden-xs" href="#speechnorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-speechnorm" aria-hidden="true">TOC</a></span></h3>
  27194. <p>Speech Normalizer.
  27195. </p>
  27196. <p>This filter expands or compresses each half-cycle of audio samples
  27197. (local set of samples all above or all below zero and between two nearest zero crossings) depending
  27198. on threshold value, so audio reaches target peak value under conditions controlled by below options.
  27199. </p>
  27200. <p>The filter accepts the following options:
  27201. </p>
  27202. <dl compact="compact">
  27203. <dt><samp>peak, p</samp></dt>
  27204. <dd><p>Set the expansion target peak value. This specifies the highest allowed absolute amplitude
  27205. level for the normalized audio input. Default value is 0.95. Allowed range is from 0.0 to 1.0.
  27206. </p>
  27207. </dd>
  27208. <dt><samp>expansion, e</samp></dt>
  27209. <dd><p>Set the maximum expansion factor. Allowed range is from 1.0 to 50.0. Default value is 2.0.
  27210. This option controls maximum local half-cycle of samples expansion. The maximum expansion
  27211. would be such that local peak value reaches target peak value but never to surpass it and that
  27212. ratio between new and previous peak value does not surpass this option value.
  27213. </p>
  27214. </dd>
  27215. <dt><samp>compression, c</samp></dt>
  27216. <dd><p>Set the maximum compression factor. Allowed range is from 1.0 to 50.0. Default value is 2.0.
  27217. This option controls maximum local half-cycle of samples compression. This option is used
  27218. only if <samp>threshold</samp> option is set to value greater than 0.0, then in such cases
  27219. when local peak is lower or same as value set by <samp>threshold</samp> all samples belonging to
  27220. that peak&rsquo;s half-cycle will be compressed by current compression factor.
  27221. </p>
  27222. </dd>
  27223. <dt><samp>threshold, t</samp></dt>
  27224. <dd><p>Set the threshold value. Default value is 0.0. Allowed range is from 0.0 to 1.0.
  27225. This option specifies which half-cycles of samples will be compressed and which will be expanded.
  27226. Any half-cycle samples with their local peak value below or same as this option value will be
  27227. compressed by current compression factor, otherwise, if greater than threshold value they will be
  27228. expanded with expansion factor so that it could reach peak target value but never surpass it.
  27229. </p>
  27230. </dd>
  27231. <dt><samp>raise, r</samp></dt>
  27232. <dd><p>Set the expansion raising amount per each half-cycle of samples. Default value is 0.001.
  27233. Allowed range is from 0.0 to 1.0. This controls how fast expansion factor is raised per
  27234. each new half-cycle until it reaches <samp>expansion</samp> value.
  27235. Setting this options too high may lead to distortions.
  27236. </p>
  27237. </dd>
  27238. <dt><samp>fall, f</samp></dt>
  27239. <dd><p>Set the compression raising amount per each half-cycle of samples. Default value is 0.001.
  27240. Allowed range is from 0.0 to 1.0. This controls how fast compression factor is raised per
  27241. each new half-cycle until it reaches <samp>compression</samp> value.
  27242. </p>
  27243. </dd>
  27244. <dt><samp>channels, h</samp></dt>
  27245. <dd><p>Specify which channels to filter, by default all available channels are filtered.
  27246. </p>
  27247. </dd>
  27248. <dt><samp>invert, i</samp></dt>
  27249. <dd><p>Enable inverted filtering, by default is disabled. This inverts interpretation of <samp>threshold</samp>
  27250. option. When enabled any half-cycle of samples with their local peak value below or same as
  27251. <samp>threshold</samp> option will be expanded otherwise it will be compressed.
  27252. </p>
  27253. </dd>
  27254. <dt><samp>link, l</samp></dt>
  27255. <dd><p>Link channels when calculating gain applied to each filtered channel sample, by default is disabled.
  27256. When disabled each filtered channel gain calculation is independent, otherwise when this option
  27257. is enabled the minimum of all possible gains for each filtered channel is used.
  27258. </p></dd>
  27259. </dl>
  27260. <a name="Commands-38"></a>
  27261. <h4 class="subsection">36.96.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-38" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-38" aria-hidden="true">TOC</a></span></h4>
  27262. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  27263. </p>
  27264. <a name="stereotools"></a>
  27265. <h3 class="section">36.97 stereotools<span class="pull-right"><a class="anchor hidden-xs" href="#stereotools" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-stereotools" aria-hidden="true">TOC</a></span></h3>
  27266. <p>This filter has some handy utilities to manage stereo signals, for converting
  27267. M/S stereo recordings to L/R signal while having control over the parameters
  27268. or spreading the stereo image of master track.
  27269. </p>
  27270. <p>The filter accepts the following options:
  27271. </p>
  27272. <dl compact="compact">
  27273. <dt><samp>level_in</samp></dt>
  27274. <dd><p>Set input level before filtering for both channels. Defaults is 1.
  27275. Allowed range is from 0.015625 to 64.
  27276. </p>
  27277. </dd>
  27278. <dt><samp>level_out</samp></dt>
  27279. <dd><p>Set output level after filtering for both channels. Defaults is 1.
  27280. Allowed range is from 0.015625 to 64.
  27281. </p>
  27282. </dd>
  27283. <dt><samp>balance_in</samp></dt>
  27284. <dd><p>Set input balance between both channels. Default is 0.
  27285. Allowed range is from -1 to 1.
  27286. </p>
  27287. </dd>
  27288. <dt><samp>balance_out</samp></dt>
  27289. <dd><p>Set output balance between both channels. Default is 0.
  27290. Allowed range is from -1 to 1.
  27291. </p>
  27292. </dd>
  27293. <dt><samp>softclip</samp></dt>
  27294. <dd><p>Enable softclipping. Results in analog distortion instead of harsh digital 0dB
  27295. clipping. Disabled by default.
  27296. </p>
  27297. </dd>
  27298. <dt><samp>mutel</samp></dt>
  27299. <dd><p>Mute the left channel. Disabled by default.
  27300. </p>
  27301. </dd>
  27302. <dt><samp>muter</samp></dt>
  27303. <dd><p>Mute the right channel. Disabled by default.
  27304. </p>
  27305. </dd>
  27306. <dt><samp>phasel</samp></dt>
  27307. <dd><p>Change the phase of the left channel. Disabled by default.
  27308. </p>
  27309. </dd>
  27310. <dt><samp>phaser</samp></dt>
  27311. <dd><p>Change the phase of the right channel. Disabled by default.
  27312. </p>
  27313. </dd>
  27314. <dt><samp>mode</samp></dt>
  27315. <dd><p>Set stereo mode. Available values are:
  27316. </p>
  27317. <dl compact="compact">
  27318. <dt>&lsquo;<samp>lr&gt;lr</samp>&rsquo;</dt>
  27319. <dd><p>Left/Right to Left/Right, this is default.
  27320. </p>
  27321. </dd>
  27322. <dt>&lsquo;<samp>lr&gt;ms</samp>&rsquo;</dt>
  27323. <dd><p>Left/Right to Mid/Side.
  27324. </p>
  27325. </dd>
  27326. <dt>&lsquo;<samp>ms&gt;lr</samp>&rsquo;</dt>
  27327. <dd><p>Mid/Side to Left/Right.
  27328. </p>
  27329. </dd>
  27330. <dt>&lsquo;<samp>lr&gt;ll</samp>&rsquo;</dt>
  27331. <dd><p>Left/Right to Left/Left.
  27332. </p>
  27333. </dd>
  27334. <dt>&lsquo;<samp>lr&gt;rr</samp>&rsquo;</dt>
  27335. <dd><p>Left/Right to Right/Right.
  27336. </p>
  27337. </dd>
  27338. <dt>&lsquo;<samp>lr&gt;l+r</samp>&rsquo;</dt>
  27339. <dd><p>Left/Right to Left + Right.
  27340. </p>
  27341. </dd>
  27342. <dt>&lsquo;<samp>lr&gt;rl</samp>&rsquo;</dt>
  27343. <dd><p>Left/Right to Right/Left.
  27344. </p>
  27345. </dd>
  27346. <dt>&lsquo;<samp>ms&gt;ll</samp>&rsquo;</dt>
  27347. <dd><p>Mid/Side to Left/Left.
  27348. </p>
  27349. </dd>
  27350. <dt>&lsquo;<samp>ms&gt;rr</samp>&rsquo;</dt>
  27351. <dd><p>Mid/Side to Right/Right.
  27352. </p>
  27353. </dd>
  27354. <dt>&lsquo;<samp>ms&gt;rl</samp>&rsquo;</dt>
  27355. <dd><p>Mid/Side to Right/Left.
  27356. </p>
  27357. </dd>
  27358. <dt>&lsquo;<samp>lr&gt;l-r</samp>&rsquo;</dt>
  27359. <dd><p>Left/Right to Left - Right.
  27360. </p></dd>
  27361. </dl>
  27362. </dd>
  27363. <dt><samp>slev</samp></dt>
  27364. <dd><p>Set level of side signal. Default is 1.
  27365. Allowed range is from 0.015625 to 64.
  27366. </p>
  27367. </dd>
  27368. <dt><samp>sbal</samp></dt>
  27369. <dd><p>Set balance of side signal. Default is 0.
  27370. Allowed range is from -1 to 1.
  27371. </p>
  27372. </dd>
  27373. <dt><samp>mlev</samp></dt>
  27374. <dd><p>Set level of the middle signal. Default is 1.
  27375. Allowed range is from 0.015625 to 64.
  27376. </p>
  27377. </dd>
  27378. <dt><samp>mpan</samp></dt>
  27379. <dd><p>Set middle signal pan. Default is 0. Allowed range is from -1 to 1.
  27380. </p>
  27381. </dd>
  27382. <dt><samp>base</samp></dt>
  27383. <dd><p>Set stereo base between mono and inversed channels. Default is 0.
  27384. Allowed range is from -1 to 1.
  27385. </p>
  27386. </dd>
  27387. <dt><samp>delay</samp></dt>
  27388. <dd><p>Set delay in milliseconds how much to delay left from right channel and
  27389. vice versa. Default is 0. Allowed range is from -20 to 20.
  27390. </p>
  27391. </dd>
  27392. <dt><samp>sclevel</samp></dt>
  27393. <dd><p>Set S/C level. Default is 1. Allowed range is from 1 to 100.
  27394. </p>
  27395. </dd>
  27396. <dt><samp>phase</samp></dt>
  27397. <dd><p>Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360.
  27398. </p>
  27399. </dd>
  27400. <dt><samp>bmode_in, bmode_out</samp></dt>
  27401. <dd><p>Set balance mode for balance_in/balance_out option.
  27402. </p>
  27403. <p>Can be one of the following:
  27404. </p>
  27405. <dl compact="compact">
  27406. <dt>&lsquo;<samp>balance</samp>&rsquo;</dt>
  27407. <dd><p>Classic balance mode. Attenuate one channel at time.
  27408. Gain is raised up to 1.
  27409. </p>
  27410. </dd>
  27411. <dt>&lsquo;<samp>amplitude</samp>&rsquo;</dt>
  27412. <dd><p>Similar as classic mode above but gain is raised up to 2.
  27413. </p>
  27414. </dd>
  27415. <dt>&lsquo;<samp>power</samp>&rsquo;</dt>
  27416. <dd><p>Equal power distribution, from -6dB to +6dB range.
  27417. </p></dd>
  27418. </dl>
  27419. </dd>
  27420. </dl>
  27421. <a name="Commands-39"></a>
  27422. <h4 class="subsection">36.97.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-39" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-39" aria-hidden="true">TOC</a></span></h4>
  27423. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  27424. </p>
  27425. <a name="Examples-69"></a>
  27426. <h4 class="subsection">36.97.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-69" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-69" aria-hidden="true">TOC</a></span></h4>
  27427. <ul>
  27428. <li> Apply karaoke like effect:
  27429. <div class="example">
  27430. <pre class="example">stereotools=mlev=0.015625
  27431. </pre></div>
  27432. </li><li> Convert M/S signal to L/R:
  27433. <div class="example">
  27434. <pre class="example">&quot;stereotools=mode=ms&gt;lr&quot;
  27435. </pre></div>
  27436. </li></ul>
  27437. <a name="stereowiden"></a>
  27438. <h3 class="section">36.98 stereowiden<span class="pull-right"><a class="anchor hidden-xs" href="#stereowiden" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-stereowiden" aria-hidden="true">TOC</a></span></h3>
  27439. <p>This filter enhance the stereo effect by suppressing signal common to both
  27440. channels and by delaying the signal of left into right and vice versa,
  27441. thereby widening the stereo effect.
  27442. </p>
  27443. <p>The filter accepts the following options:
  27444. </p>
  27445. <dl compact="compact">
  27446. <dt><samp>delay</samp></dt>
  27447. <dd><p>Time in milliseconds of the delay of left signal into right and vice versa.
  27448. Default is 20 milliseconds.
  27449. </p>
  27450. </dd>
  27451. <dt><samp>feedback</samp></dt>
  27452. <dd><p>Amount of gain in delayed signal into right and vice versa. Gives a delay
  27453. effect of left signal in right output and vice versa which gives widening
  27454. effect. Default is 0.3.
  27455. </p>
  27456. </dd>
  27457. <dt><samp>crossfeed</samp></dt>
  27458. <dd><p>Cross feed of left into right with inverted phase. This helps in suppressing
  27459. the mono. If the value is 1 it will cancel all the signal common to both
  27460. channels. Default is 0.3.
  27461. </p>
  27462. </dd>
  27463. <dt><samp>drymix</samp></dt>
  27464. <dd><p>Set level of input signal of original channel. Default is 0.8.
  27465. </p></dd>
  27466. </dl>
  27467. <a name="Commands-40"></a>
  27468. <h4 class="subsection">36.98.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-40" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-40" aria-hidden="true">TOC</a></span></h4>
  27469. <p>This filter supports the all above options except <code>delay</code> as <a href="#commands">commands</a>.
  27470. </p>
  27471. <a name="superequalizer"></a>
  27472. <h3 class="section">36.99 superequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#superequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-superequalizer" aria-hidden="true">TOC</a></span></h3>
  27473. <p>Apply 18 band equalizer.
  27474. </p>
  27475. <p>The filter accepts the following options:
  27476. </p><dl compact="compact">
  27477. <dt><samp>1b</samp></dt>
  27478. <dd><p>Set 65Hz band gain.
  27479. </p></dd>
  27480. <dt><samp>2b</samp></dt>
  27481. <dd><p>Set 92Hz band gain.
  27482. </p></dd>
  27483. <dt><samp>3b</samp></dt>
  27484. <dd><p>Set 131Hz band gain.
  27485. </p></dd>
  27486. <dt><samp>4b</samp></dt>
  27487. <dd><p>Set 185Hz band gain.
  27488. </p></dd>
  27489. <dt><samp>5b</samp></dt>
  27490. <dd><p>Set 262Hz band gain.
  27491. </p></dd>
  27492. <dt><samp>6b</samp></dt>
  27493. <dd><p>Set 370Hz band gain.
  27494. </p></dd>
  27495. <dt><samp>7b</samp></dt>
  27496. <dd><p>Set 523Hz band gain.
  27497. </p></dd>
  27498. <dt><samp>8b</samp></dt>
  27499. <dd><p>Set 740Hz band gain.
  27500. </p></dd>
  27501. <dt><samp>9b</samp></dt>
  27502. <dd><p>Set 1047Hz band gain.
  27503. </p></dd>
  27504. <dt><samp>10b</samp></dt>
  27505. <dd><p>Set 1480Hz band gain.
  27506. </p></dd>
  27507. <dt><samp>11b</samp></dt>
  27508. <dd><p>Set 2093Hz band gain.
  27509. </p></dd>
  27510. <dt><samp>12b</samp></dt>
  27511. <dd><p>Set 2960Hz band gain.
  27512. </p></dd>
  27513. <dt><samp>13b</samp></dt>
  27514. <dd><p>Set 4186Hz band gain.
  27515. </p></dd>
  27516. <dt><samp>14b</samp></dt>
  27517. <dd><p>Set 5920Hz band gain.
  27518. </p></dd>
  27519. <dt><samp>15b</samp></dt>
  27520. <dd><p>Set 8372Hz band gain.
  27521. </p></dd>
  27522. <dt><samp>16b</samp></dt>
  27523. <dd><p>Set 11840Hz band gain.
  27524. </p></dd>
  27525. <dt><samp>17b</samp></dt>
  27526. <dd><p>Set 16744Hz band gain.
  27527. </p></dd>
  27528. <dt><samp>18b</samp></dt>
  27529. <dd><p>Set 20000Hz band gain.
  27530. </p></dd>
  27531. </dl>
  27532. <a name="surround"></a>
  27533. <h3 class="section">36.100 surround<span class="pull-right"><a class="anchor hidden-xs" href="#surround" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-surround" aria-hidden="true">TOC</a></span></h3>
  27534. <p>Apply audio surround upmix filter.
  27535. </p>
  27536. <p>This filter allows to produce multichannel output from audio stream.
  27537. </p>
  27538. <p>The filter accepts the following options:
  27539. </p>
  27540. <dl compact="compact">
  27541. <dt><samp>chl_out</samp></dt>
  27542. <dd><p>Set output channel layout. By default, this is <var>5.1</var>.
  27543. </p>
  27544. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  27545. for the required syntax.
  27546. </p>
  27547. </dd>
  27548. <dt><samp>chl_in</samp></dt>
  27549. <dd><p>Set input channel layout. By default, this is <var>stereo</var>.
  27550. </p>
  27551. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  27552. for the required syntax.
  27553. </p>
  27554. </dd>
  27555. <dt><samp>level_in</samp></dt>
  27556. <dd><p>Set input volume level. By default, this is <var>1</var>.
  27557. </p>
  27558. </dd>
  27559. <dt><samp>level_out</samp></dt>
  27560. <dd><p>Set output volume level. By default, this is <var>1</var>.
  27561. </p>
  27562. </dd>
  27563. <dt><samp>lfe</samp></dt>
  27564. <dd><p>Enable LFE channel output if output channel layout has it. By default, this is enabled.
  27565. </p>
  27566. </dd>
  27567. <dt><samp>lfe_low</samp></dt>
  27568. <dd><p>Set LFE low cut off frequency. By default, this is <var>128</var> Hz.
  27569. </p>
  27570. </dd>
  27571. <dt><samp>lfe_high</samp></dt>
  27572. <dd><p>Set LFE high cut off frequency. By default, this is <var>256</var> Hz.
  27573. </p>
  27574. </dd>
  27575. <dt><samp>lfe_mode</samp></dt>
  27576. <dd><p>Set LFE mode, can be <var>add</var> or <var>sub</var>. Default is <var>add</var>.
  27577. In <var>add</var> mode, LFE channel is created from input audio and added to output.
  27578. In <var>sub</var> mode, LFE channel is created from input audio and added to output but
  27579. also all non-LFE output channels are subtracted with output LFE channel.
  27580. </p>
  27581. </dd>
  27582. <dt><samp>angle</samp></dt>
  27583. <dd><p>Set angle of stereo surround transform, Allowed range is from <var>0</var> to <var>360</var>.
  27584. Default is <var>90</var>.
  27585. </p>
  27586. </dd>
  27587. <dt><samp>fc_in</samp></dt>
  27588. <dd><p>Set front center input volume. By default, this is <var>1</var>.
  27589. </p>
  27590. </dd>
  27591. <dt><samp>fc_out</samp></dt>
  27592. <dd><p>Set front center output volume. By default, this is <var>1</var>.
  27593. </p>
  27594. </dd>
  27595. <dt><samp>fl_in</samp></dt>
  27596. <dd><p>Set front left input volume. By default, this is <var>1</var>.
  27597. </p>
  27598. </dd>
  27599. <dt><samp>fl_out</samp></dt>
  27600. <dd><p>Set front left output volume. By default, this is <var>1</var>.
  27601. </p>
  27602. </dd>
  27603. <dt><samp>fr_in</samp></dt>
  27604. <dd><p>Set front right input volume. By default, this is <var>1</var>.
  27605. </p>
  27606. </dd>
  27607. <dt><samp>fr_out</samp></dt>
  27608. <dd><p>Set front right output volume. By default, this is <var>1</var>.
  27609. </p>
  27610. </dd>
  27611. <dt><samp>sl_in</samp></dt>
  27612. <dd><p>Set side left input volume. By default, this is <var>1</var>.
  27613. </p>
  27614. </dd>
  27615. <dt><samp>sl_out</samp></dt>
  27616. <dd><p>Set side left output volume. By default, this is <var>1</var>.
  27617. </p>
  27618. </dd>
  27619. <dt><samp>sr_in</samp></dt>
  27620. <dd><p>Set side right input volume. By default, this is <var>1</var>.
  27621. </p>
  27622. </dd>
  27623. <dt><samp>sr_out</samp></dt>
  27624. <dd><p>Set side right output volume. By default, this is <var>1</var>.
  27625. </p>
  27626. </dd>
  27627. <dt><samp>bl_in</samp></dt>
  27628. <dd><p>Set back left input volume. By default, this is <var>1</var>.
  27629. </p>
  27630. </dd>
  27631. <dt><samp>bl_out</samp></dt>
  27632. <dd><p>Set back left output volume. By default, this is <var>1</var>.
  27633. </p>
  27634. </dd>
  27635. <dt><samp>br_in</samp></dt>
  27636. <dd><p>Set back right input volume. By default, this is <var>1</var>.
  27637. </p>
  27638. </dd>
  27639. <dt><samp>br_out</samp></dt>
  27640. <dd><p>Set back right output volume. By default, this is <var>1</var>.
  27641. </p>
  27642. </dd>
  27643. <dt><samp>bc_in</samp></dt>
  27644. <dd><p>Set back center input volume. By default, this is <var>1</var>.
  27645. </p>
  27646. </dd>
  27647. <dt><samp>bc_out</samp></dt>
  27648. <dd><p>Set back center output volume. By default, this is <var>1</var>.
  27649. </p>
  27650. </dd>
  27651. <dt><samp>lfe_in</samp></dt>
  27652. <dd><p>Set LFE input volume. By default, this is <var>1</var>.
  27653. </p>
  27654. </dd>
  27655. <dt><samp>lfe_out</samp></dt>
  27656. <dd><p>Set LFE output volume. By default, this is <var>1</var>.
  27657. </p>
  27658. </dd>
  27659. <dt><samp>allx</samp></dt>
  27660. <dd><p>Set spread usage of stereo image across X axis for all channels.
  27661. </p>
  27662. </dd>
  27663. <dt><samp>ally</samp></dt>
  27664. <dd><p>Set spread usage of stereo image across Y axis for all channels.
  27665. </p>
  27666. </dd>
  27667. <dt><samp>fcx, flx, frx, blx, brx, slx, srx, bcx</samp></dt>
  27668. <dd><p>Set spread usage of stereo image across X axis for each channel.
  27669. </p>
  27670. </dd>
  27671. <dt><samp>fcy, fly, fry, bly, bry, sly, sry, bcy</samp></dt>
  27672. <dd><p>Set spread usage of stereo image across Y axis for each channel.
  27673. </p>
  27674. </dd>
  27675. <dt><samp>win_size</samp></dt>
  27676. <dd><p>Set window size. Allowed range is from <var>1024</var> to <var>65536</var>. Default size is <var>4096</var>.
  27677. </p>
  27678. </dd>
  27679. <dt><samp>win_func</samp></dt>
  27680. <dd><p>Set window function.
  27681. </p>
  27682. <p>It accepts the following values:
  27683. </p><dl compact="compact">
  27684. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  27685. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  27686. <dt>&lsquo;<samp>hann, hanning</samp>&rsquo;</dt>
  27687. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  27688. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  27689. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  27690. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  27691. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  27692. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  27693. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  27694. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  27695. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  27696. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  27697. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  27698. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  27699. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  27700. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  27701. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  27702. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  27703. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  27704. </dl>
  27705. <p>Default is <code>hann</code>.
  27706. </p>
  27707. </dd>
  27708. <dt><samp>overlap</samp></dt>
  27709. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  27710. window function will be picked. Default is <code>0.5</code>.
  27711. </p></dd>
  27712. </dl>
  27713. <a name="treble_002c-highshelf"></a>
  27714. <h3 class="section">36.101 treble, highshelf<span class="pull-right"><a class="anchor hidden-xs" href="#treble_002c-highshelf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-treble_002c-highshelf" aria-hidden="true">TOC</a></span></h3>
  27715. <p>Boost or cut treble (upper) frequencies of the audio using a two-pole
  27716. shelving filter with a response similar to that of a standard
  27717. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  27718. </p>
  27719. <p>The filter accepts the following options:
  27720. </p>
  27721. <dl compact="compact">
  27722. <dt><samp>gain, g</samp></dt>
  27723. <dd><p>Give the gain at whichever is the lower of ~22 kHz and the
  27724. Nyquist frequency. Its useful range is about -20 (for a large cut)
  27725. to +20 (for a large boost). Beware of clipping when using a positive gain.
  27726. </p>
  27727. </dd>
  27728. <dt><samp>frequency, f</samp></dt>
  27729. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  27730. to extend or reduce the frequency range to be boosted or cut.
  27731. The default value is <code>3000</code> Hz.
  27732. </p>
  27733. </dd>
  27734. <dt><samp>width_type, t</samp></dt>
  27735. <dd><p>Set method to specify band-width of filter.
  27736. </p><dl compact="compact">
  27737. <dt><samp>h</samp></dt>
  27738. <dd><p>Hz
  27739. </p></dd>
  27740. <dt><samp>q</samp></dt>
  27741. <dd><p>Q-Factor
  27742. </p></dd>
  27743. <dt><samp>o</samp></dt>
  27744. <dd><p>octave
  27745. </p></dd>
  27746. <dt><samp>s</samp></dt>
  27747. <dd><p>slope
  27748. </p></dd>
  27749. <dt><samp>k</samp></dt>
  27750. <dd><p>kHz
  27751. </p></dd>
  27752. </dl>
  27753. </dd>
  27754. <dt><samp>width, w</samp></dt>
  27755. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  27756. </p>
  27757. </dd>
  27758. <dt><samp>poles, p</samp></dt>
  27759. <dd><p>Set number of poles. Default is 2.
  27760. </p>
  27761. </dd>
  27762. <dt><samp>mix, m</samp></dt>
  27763. <dd><p>How much to use filtered signal in output. Default is 1.
  27764. Range is between 0 and 1.
  27765. </p>
  27766. </dd>
  27767. <dt><samp>channels, c</samp></dt>
  27768. <dd><p>Specify which channels to filter, by default all available are filtered.
  27769. </p>
  27770. </dd>
  27771. <dt><samp>normalize, n</samp></dt>
  27772. <dd><p>Normalize biquad coefficients, by default is disabled.
  27773. Enabling it will normalize magnitude response at DC to 0dB.
  27774. </p>
  27775. </dd>
  27776. <dt><samp>transform, a</samp></dt>
  27777. <dd><p>Set transform type of IIR filter.
  27778. </p><dl compact="compact">
  27779. <dt><samp>di</samp></dt>
  27780. <dt><samp>dii</samp></dt>
  27781. <dt><samp>tdii</samp></dt>
  27782. <dt><samp>latt</samp></dt>
  27783. </dl>
  27784. </dd>
  27785. <dt><samp>precision, r</samp></dt>
  27786. <dd><p>Set precison of filtering.
  27787. </p><dl compact="compact">
  27788. <dt><samp>auto</samp></dt>
  27789. <dd><p>Pick automatic sample format depending on surround filters.
  27790. </p></dd>
  27791. <dt><samp>s16</samp></dt>
  27792. <dd><p>Always use signed 16-bit.
  27793. </p></dd>
  27794. <dt><samp>s32</samp></dt>
  27795. <dd><p>Always use signed 32-bit.
  27796. </p></dd>
  27797. <dt><samp>f32</samp></dt>
  27798. <dd><p>Always use float 32-bit.
  27799. </p></dd>
  27800. <dt><samp>f64</samp></dt>
  27801. <dd><p>Always use float 64-bit.
  27802. </p></dd>
  27803. </dl>
  27804. </dd>
  27805. </dl>
  27806. <a name="Commands-41"></a>
  27807. <h4 class="subsection">36.101.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-41" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-41" aria-hidden="true">TOC</a></span></h4>
  27808. <p>This filter supports the following commands:
  27809. </p><dl compact="compact">
  27810. <dt><samp>frequency, f</samp></dt>
  27811. <dd><p>Change treble frequency.
  27812. Syntax for the command is : &quot;<var>frequency</var>&quot;
  27813. </p>
  27814. </dd>
  27815. <dt><samp>width_type, t</samp></dt>
  27816. <dd><p>Change treble width_type.
  27817. Syntax for the command is : &quot;<var>width_type</var>&quot;
  27818. </p>
  27819. </dd>
  27820. <dt><samp>width, w</samp></dt>
  27821. <dd><p>Change treble width.
  27822. Syntax for the command is : &quot;<var>width</var>&quot;
  27823. </p>
  27824. </dd>
  27825. <dt><samp>gain, g</samp></dt>
  27826. <dd><p>Change treble gain.
  27827. Syntax for the command is : &quot;<var>gain</var>&quot;
  27828. </p>
  27829. </dd>
  27830. <dt><samp>mix, m</samp></dt>
  27831. <dd><p>Change treble mix.
  27832. Syntax for the command is : &quot;<var>mix</var>&quot;
  27833. </p></dd>
  27834. </dl>
  27835. <a name="tremolo"></a>
  27836. <h3 class="section">36.102 tremolo<span class="pull-right"><a class="anchor hidden-xs" href="#tremolo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tremolo" aria-hidden="true">TOC</a></span></h3>
  27837. <p>Sinusoidal amplitude modulation.
  27838. </p>
  27839. <p>The filter accepts the following options:
  27840. </p>
  27841. <dl compact="compact">
  27842. <dt><samp>f</samp></dt>
  27843. <dd><p>Modulation frequency in Hertz. Modulation frequencies in the subharmonic range
  27844. (20 Hz or lower) will result in a tremolo effect.
  27845. This filter may also be used as a ring modulator by specifying
  27846. a modulation frequency higher than 20 Hz.
  27847. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  27848. </p>
  27849. </dd>
  27850. <dt><samp>d</samp></dt>
  27851. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  27852. Default value is 0.5.
  27853. </p></dd>
  27854. </dl>
  27855. <a name="vibrato"></a>
  27856. <h3 class="section">36.103 vibrato<span class="pull-right"><a class="anchor hidden-xs" href="#vibrato" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vibrato" aria-hidden="true">TOC</a></span></h3>
  27857. <p>Sinusoidal phase modulation.
  27858. </p>
  27859. <p>The filter accepts the following options:
  27860. </p>
  27861. <dl compact="compact">
  27862. <dt><samp>f</samp></dt>
  27863. <dd><p>Modulation frequency in Hertz.
  27864. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  27865. </p>
  27866. </dd>
  27867. <dt><samp>d</samp></dt>
  27868. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  27869. Default value is 0.5.
  27870. </p></dd>
  27871. </dl>
  27872. <a name="volume"></a>
  27873. <h3 class="section">36.104 volume<span class="pull-right"><a class="anchor hidden-xs" href="#volume" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-volume" aria-hidden="true">TOC</a></span></h3>
  27874. <p>Adjust the input audio volume.
  27875. </p>
  27876. <p>It accepts the following parameters:
  27877. </p><dl compact="compact">
  27878. <dt><samp>volume</samp></dt>
  27879. <dd><p>Set audio volume expression.
  27880. </p>
  27881. <p>Output values are clipped to the maximum value.
  27882. </p>
  27883. <p>The output audio volume is given by the relation:
  27884. </p><div class="example">
  27885. <pre class="example"><var>output_volume</var> = <var>volume</var> * <var>input_volume</var>
  27886. </pre></div>
  27887. <p>The default value for <var>volume</var> is &quot;1.0&quot;.
  27888. </p>
  27889. </dd>
  27890. <dt><samp>precision</samp></dt>
  27891. <dd><p>This parameter represents the mathematical precision.
  27892. </p>
  27893. <p>It determines which input sample formats will be allowed, which affects the
  27894. precision of the volume scaling.
  27895. </p>
  27896. <dl compact="compact">
  27897. <dt><samp>fixed</samp></dt>
  27898. <dd><p>8-bit fixed-point; this limits input sample format to U8, S16, and S32.
  27899. </p></dd>
  27900. <dt><samp>float</samp></dt>
  27901. <dd><p>32-bit floating-point; this limits input sample format to FLT. (default)
  27902. </p></dd>
  27903. <dt><samp>double</samp></dt>
  27904. <dd><p>64-bit floating-point; this limits input sample format to DBL.
  27905. </p></dd>
  27906. </dl>
  27907. </dd>
  27908. <dt><samp>replaygain</samp></dt>
  27909. <dd><p>Choose the behaviour on encountering ReplayGain side data in input frames.
  27910. </p>
  27911. <dl compact="compact">
  27912. <dt><samp>drop</samp></dt>
  27913. <dd><p>Remove ReplayGain side data, ignoring its contents (the default).
  27914. </p>
  27915. </dd>
  27916. <dt><samp>ignore</samp></dt>
  27917. <dd><p>Ignore ReplayGain side data, but leave it in the frame.
  27918. </p>
  27919. </dd>
  27920. <dt><samp>track</samp></dt>
  27921. <dd><p>Prefer the track gain, if present.
  27922. </p>
  27923. </dd>
  27924. <dt><samp>album</samp></dt>
  27925. <dd><p>Prefer the album gain, if present.
  27926. </p></dd>
  27927. </dl>
  27928. </dd>
  27929. <dt><samp>replaygain_preamp</samp></dt>
  27930. <dd><p>Pre-amplification gain in dB to apply to the selected replaygain gain.
  27931. </p>
  27932. <p>Default value for <var>replaygain_preamp</var> is 0.0.
  27933. </p>
  27934. </dd>
  27935. <dt><samp>replaygain_noclip</samp></dt>
  27936. <dd><p>Prevent clipping by limiting the gain applied.
  27937. </p>
  27938. <p>Default value for <var>replaygain_noclip</var> is 1.
  27939. </p>
  27940. </dd>
  27941. <dt><samp>eval</samp></dt>
  27942. <dd><p>Set when the volume expression is evaluated.
  27943. </p>
  27944. <p>It accepts the following values:
  27945. </p><dl compact="compact">
  27946. <dt>&lsquo;<samp>once</samp>&rsquo;</dt>
  27947. <dd><p>only evaluate expression once during the filter initialization, or
  27948. when the &lsquo;<samp>volume</samp>&rsquo; command is sent
  27949. </p>
  27950. </dd>
  27951. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  27952. <dd><p>evaluate expression for each incoming frame
  27953. </p></dd>
  27954. </dl>
  27955. <p>Default value is &lsquo;<samp>once</samp>&rsquo;.
  27956. </p></dd>
  27957. </dl>
  27958. <p>The volume expression can contain the following parameters.
  27959. </p>
  27960. <dl compact="compact">
  27961. <dt><samp>n</samp></dt>
  27962. <dd><p>frame number (starting at zero)
  27963. </p></dd>
  27964. <dt><samp>nb_channels</samp></dt>
  27965. <dd><p>number of channels
  27966. </p></dd>
  27967. <dt><samp>nb_consumed_samples</samp></dt>
  27968. <dd><p>number of samples consumed by the filter
  27969. </p></dd>
  27970. <dt><samp>nb_samples</samp></dt>
  27971. <dd><p>number of samples in the current frame
  27972. </p></dd>
  27973. <dt><samp>pos</samp></dt>
  27974. <dd><p>original frame position in the file
  27975. </p></dd>
  27976. <dt><samp>pts</samp></dt>
  27977. <dd><p>frame PTS
  27978. </p></dd>
  27979. <dt><samp>sample_rate</samp></dt>
  27980. <dd><p>sample rate
  27981. </p></dd>
  27982. <dt><samp>startpts</samp></dt>
  27983. <dd><p>PTS at start of stream
  27984. </p></dd>
  27985. <dt><samp>startt</samp></dt>
  27986. <dd><p>time at start of stream
  27987. </p></dd>
  27988. <dt><samp>t</samp></dt>
  27989. <dd><p>frame time
  27990. </p></dd>
  27991. <dt><samp>tb</samp></dt>
  27992. <dd><p>timestamp timebase
  27993. </p></dd>
  27994. <dt><samp>volume</samp></dt>
  27995. <dd><p>last set volume value
  27996. </p></dd>
  27997. </dl>
  27998. <p>Note that when <samp>eval</samp> is set to &lsquo;<samp>once</samp>&rsquo; only the
  27999. <var>sample_rate</var> and <var>tb</var> variables are available, all other
  28000. variables will evaluate to NAN.
  28001. </p>
  28002. <a name="Commands-42"></a>
  28003. <h4 class="subsection">36.104.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-42" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-42" aria-hidden="true">TOC</a></span></h4>
  28004. <p>This filter supports the following commands:
  28005. </p><dl compact="compact">
  28006. <dt><samp>volume</samp></dt>
  28007. <dd><p>Modify the volume expression.
  28008. The command accepts the same syntax of the corresponding option.
  28009. </p>
  28010. <p>If the specified expression is not valid, it is kept at its current
  28011. value.
  28012. </p></dd>
  28013. </dl>
  28014. <a name="Examples-70"></a>
  28015. <h4 class="subsection">36.104.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-70" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-70" aria-hidden="true">TOC</a></span></h4>
  28016. <ul>
  28017. <li> Halve the input audio volume:
  28018. <div class="example">
  28019. <pre class="example">volume=volume=0.5
  28020. volume=volume=1/2
  28021. volume=volume=-6.0206dB
  28022. </pre></div>
  28023. <p>In all the above example the named key for <samp>volume</samp> can be
  28024. omitted, for example like in:
  28025. </p><div class="example">
  28026. <pre class="example">volume=0.5
  28027. </pre></div>
  28028. </li><li> Increase input audio power by 6 decibels using fixed-point precision:
  28029. <div class="example">
  28030. <pre class="example">volume=volume=6dB:precision=fixed
  28031. </pre></div>
  28032. </li><li> Fade volume after time 10 with an annihilation period of 5 seconds:
  28033. <div class="example">
  28034. <pre class="example">volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
  28035. </pre></div>
  28036. </li></ul>
  28037. <a name="volumedetect"></a>
  28038. <h3 class="section">36.105 volumedetect<span class="pull-right"><a class="anchor hidden-xs" href="#volumedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-volumedetect" aria-hidden="true">TOC</a></span></h3>
  28039. <p>Detect the volume of the input video.
  28040. </p>
  28041. <p>The filter has no parameters. The input is not modified. Statistics about
  28042. the volume will be printed in the log when the input stream end is reached.
  28043. </p>
  28044. <p>In particular it will show the mean volume (root mean square), maximum
  28045. volume (on a per-sample basis), and the beginning of a histogram of the
  28046. registered volume values (from the maximum value to a cumulated 1/1000 of
  28047. the samples).
  28048. </p>
  28049. <p>All volumes are in decibels relative to the maximum PCM value.
  28050. </p>
  28051. <a name="Examples-71"></a>
  28052. <h4 class="subsection">36.105.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-71" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-71" aria-hidden="true">TOC</a></span></h4>
  28053. <p>Here is an excerpt of the output:
  28054. </p><div class="example">
  28055. <pre class="example">[Parsed_volumedetect_0 &nbsp;0xa23120] mean_volume: -27 dB
  28056. [Parsed_volumedetect_0 &nbsp;0xa23120] max_volume: -4 dB
  28057. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_4db: 6
  28058. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_5db: 62
  28059. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_6db: 286
  28060. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_7db: 1042
  28061. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_8db: 2551
  28062. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_9db: 4609
  28063. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_10db: 8409
  28064. </pre></div>
  28065. <p>It means that:
  28066. </p><ul>
  28067. <li> The mean square energy is approximately -27 dB, or 10^-2.7.
  28068. </li><li> The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
  28069. </li><li> There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
  28070. </li></ul>
  28071. <p>In other words, raising the volume by +4 dB does not cause any clipping,
  28072. raising it by +5 dB causes clipping for 6 samples, etc.
  28073. </p>
  28074. <a name="Audio-Sources"></a>
  28075. <h2 class="chapter">37 Audio Sources<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Sources" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Sources" aria-hidden="true">TOC</a></span></h2>
  28076. <p>Below is a description of the currently available audio sources.
  28077. </p>
  28078. <a name="abuffer"></a>
  28079. <h3 class="section">37.1 abuffer<span class="pull-right"><a class="anchor hidden-xs" href="#abuffer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-abuffer" aria-hidden="true">TOC</a></span></h3>
  28080. <p>Buffer audio frames, and make them available to the filter chain.
  28081. </p>
  28082. <p>This source is mainly intended for a programmatic use, in particular
  28083. through the interface defined in <samp>libavfilter/buffersrc.h</samp>.
  28084. </p>
  28085. <p>It accepts the following parameters:
  28086. </p><dl compact="compact">
  28087. <dt><samp>time_base</samp></dt>
  28088. <dd><p>The timebase which will be used for timestamps of submitted frames. It must be
  28089. either a floating-point number or in <var>numerator</var>/<var>denominator</var> form.
  28090. </p>
  28091. </dd>
  28092. <dt><samp>sample_rate</samp></dt>
  28093. <dd><p>The sample rate of the incoming audio buffers.
  28094. </p>
  28095. </dd>
  28096. <dt><samp>sample_fmt</samp></dt>
  28097. <dd><p>The sample format of the incoming audio buffers.
  28098. Either a sample format name or its corresponding integer representation from
  28099. the enum AVSampleFormat in <samp>libavutil/samplefmt.h</samp>
  28100. </p>
  28101. </dd>
  28102. <dt><samp>channel_layout</samp></dt>
  28103. <dd><p>The channel layout of the incoming audio buffers.
  28104. Either a channel layout name from channel_layout_map in
  28105. <samp>libavutil/channel_layout.c</samp> or its corresponding integer representation
  28106. from the AV_CH_LAYOUT_* macros in <samp>libavutil/channel_layout.h</samp>
  28107. </p>
  28108. </dd>
  28109. <dt><samp>channels</samp></dt>
  28110. <dd><p>The number of channels of the incoming audio buffers.
  28111. If both <var>channels</var> and <var>channel_layout</var> are specified, then they
  28112. must be consistent.
  28113. </p>
  28114. </dd>
  28115. </dl>
  28116. <a name="Examples-72"></a>
  28117. <h4 class="subsection">37.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-72" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-72" aria-hidden="true">TOC</a></span></h4>
  28118. <div class="example">
  28119. <pre class="example">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
  28120. </pre></div>
  28121. <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
  28122. Since the sample format with name &quot;s16p&quot; corresponds to the number
  28123. 6 and the &quot;stereo&quot; channel layout corresponds to the value 0x3, this is
  28124. equivalent to:
  28125. </p><div class="example">
  28126. <pre class="example">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
  28127. </pre></div>
  28128. <a name="aevalsrc"></a>
  28129. <h3 class="section">37.2 aevalsrc<span class="pull-right"><a class="anchor hidden-xs" href="#aevalsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aevalsrc" aria-hidden="true">TOC</a></span></h3>
  28130. <p>Generate an audio signal specified by an expression.
  28131. </p>
  28132. <p>This source accepts in input one or more expressions (one for each
  28133. channel), which are evaluated and used to generate a corresponding
  28134. audio signal.
  28135. </p>
  28136. <p>This source accepts the following options:
  28137. </p>
  28138. <dl compact="compact">
  28139. <dt><samp>exprs</samp></dt>
  28140. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. In case the
  28141. <samp>channel_layout</samp> option is not specified, the selected channel layout
  28142. depends on the number of provided expressions. Otherwise the last
  28143. specified expression is applied to the remaining output channels.
  28144. </p>
  28145. </dd>
  28146. <dt><samp>channel_layout, c</samp></dt>
  28147. <dd><p>Set the channel layout. The number of channels in the specified layout
  28148. must be equal to the number of specified expressions.
  28149. </p>
  28150. </dd>
  28151. <dt><samp>duration, d</samp></dt>
  28152. <dd><p>Set the minimum duration of the sourced audio. See
  28153. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  28154. for the accepted syntax.
  28155. Note that the resulting duration may be greater than the specified
  28156. duration, as the generated audio is always cut at the end of a
  28157. complete frame.
  28158. </p>
  28159. <p>If not specified, or the expressed duration is negative, the audio is
  28160. supposed to be generated forever.
  28161. </p>
  28162. </dd>
  28163. <dt><samp>nb_samples, n</samp></dt>
  28164. <dd><p>Set the number of samples per channel per each output frame,
  28165. default to 1024.
  28166. </p>
  28167. </dd>
  28168. <dt><samp>sample_rate, s</samp></dt>
  28169. <dd><p>Specify the sample rate, default to 44100.
  28170. </p></dd>
  28171. </dl>
  28172. <p>Each expression in <var>exprs</var> can contain the following constants:
  28173. </p>
  28174. <dl compact="compact">
  28175. <dt><samp>n</samp></dt>
  28176. <dd><p>number of the evaluated sample, starting from 0
  28177. </p>
  28178. </dd>
  28179. <dt><samp>t</samp></dt>
  28180. <dd><p>time of the evaluated sample expressed in seconds, starting from 0
  28181. </p>
  28182. </dd>
  28183. <dt><samp>s</samp></dt>
  28184. <dd><p>sample rate
  28185. </p>
  28186. </dd>
  28187. </dl>
  28188. <a name="Examples-73"></a>
  28189. <h4 class="subsection">37.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-73" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-73" aria-hidden="true">TOC</a></span></h4>
  28190. <ul>
  28191. <li> Generate silence:
  28192. <div class="example">
  28193. <pre class="example">aevalsrc=0
  28194. </pre></div>
  28195. </li><li> Generate a sin signal with frequency of 440 Hz, set sample rate to
  28196. 8000 Hz:
  28197. <div class="example">
  28198. <pre class="example">aevalsrc=&quot;sin(440*2*PI*t):s=8000&quot;
  28199. </pre></div>
  28200. </li><li> Generate a two channels signal, specify the channel layout (Front
  28201. Center + Back Center) explicitly:
  28202. <div class="example">
  28203. <pre class="example">aevalsrc=&quot;sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC&quot;
  28204. </pre></div>
  28205. </li><li> Generate white noise:
  28206. <div class="example">
  28207. <pre class="example">aevalsrc=&quot;-2+random(0)&quot;
  28208. </pre></div>
  28209. </li><li> Generate an amplitude modulated signal:
  28210. <div class="example">
  28211. <pre class="example">aevalsrc=&quot;sin(10*2*PI*t)*sin(880*2*PI*t)&quot;
  28212. </pre></div>
  28213. </li><li> Generate 2.5 Hz binaural beats on a 360 Hz carrier:
  28214. <div class="example">
  28215. <pre class="example">aevalsrc=&quot;0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)&quot;
  28216. </pre></div>
  28217. </li></ul>
  28218. <a name="afirsrc"></a>
  28219. <h3 class="section">37.3 afirsrc<span class="pull-right"><a class="anchor hidden-xs" href="#afirsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afirsrc" aria-hidden="true">TOC</a></span></h3>
  28220. <p>Generate a FIR coefficients using frequency sampling method.
  28221. </p>
  28222. <p>The resulting stream can be used with <a href="#afir">afir</a> filter for filtering the audio signal.
  28223. </p>
  28224. <p>The filter accepts the following options:
  28225. </p>
  28226. <dl compact="compact">
  28227. <dt><samp>taps, t</samp></dt>
  28228. <dd><p>Set number of filter coefficents in output audio stream.
  28229. Default value is 1025.
  28230. </p>
  28231. </dd>
  28232. <dt><samp>frequency, f</samp></dt>
  28233. <dd><p>Set frequency points from where magnitude and phase are set.
  28234. This must be in non decreasing order, and first element must be 0, while last element
  28235. must be 1. Elements are separated by white spaces.
  28236. </p>
  28237. </dd>
  28238. <dt><samp>magnitude, m</samp></dt>
  28239. <dd><p>Set magnitude value for every frequency point set by <samp>frequency</samp>.
  28240. Number of values must be same as number of frequency points.
  28241. Values are separated by white spaces.
  28242. </p>
  28243. </dd>
  28244. <dt><samp>phase, p</samp></dt>
  28245. <dd><p>Set phase value for every frequency point set by <samp>frequency</samp>.
  28246. Number of values must be same as number of frequency points.
  28247. Values are separated by white spaces.
  28248. </p>
  28249. </dd>
  28250. <dt><samp>sample_rate, r</samp></dt>
  28251. <dd><p>Set sample rate, default is 44100.
  28252. </p>
  28253. </dd>
  28254. <dt><samp>nb_samples, n</samp></dt>
  28255. <dd><p>Set number of samples per each frame. Default is 1024.
  28256. </p>
  28257. </dd>
  28258. <dt><samp>win_func, w</samp></dt>
  28259. <dd><p>Set window function. Default is blackman.
  28260. </p></dd>
  28261. </dl>
  28262. <a name="anullsrc"></a>
  28263. <h3 class="section">37.4 anullsrc<span class="pull-right"><a class="anchor hidden-xs" href="#anullsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anullsrc" aria-hidden="true">TOC</a></span></h3>
  28264. <p>The null audio source, return unprocessed audio frames. It is mainly useful
  28265. as a template and to be employed in analysis / debugging tools, or as
  28266. the source for filters which ignore the input data (for example the sox
  28267. synth filter).
  28268. </p>
  28269. <p>This source accepts the following options:
  28270. </p>
  28271. <dl compact="compact">
  28272. <dt><samp>channel_layout, cl</samp></dt>
  28273. <dd>
  28274. <p>Specifies the channel layout, and can be either an integer or a string
  28275. representing a channel layout. The default value of <var>channel_layout</var>
  28276. is &quot;stereo&quot;.
  28277. </p>
  28278. <p>Check the channel_layout_map definition in
  28279. <samp>libavutil/channel_layout.c</samp> for the mapping between strings and
  28280. channel layout values.
  28281. </p>
  28282. </dd>
  28283. <dt><samp>sample_rate, r</samp></dt>
  28284. <dd><p>Specifies the sample rate, and defaults to 44100.
  28285. </p>
  28286. </dd>
  28287. <dt><samp>nb_samples, n</samp></dt>
  28288. <dd><p>Set the number of samples per requested frames.
  28289. </p>
  28290. </dd>
  28291. <dt><samp>duration, d</samp></dt>
  28292. <dd><p>Set the duration of the sourced audio. See
  28293. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  28294. for the accepted syntax.
  28295. </p>
  28296. <p>If not specified, or the expressed duration is negative, the audio is
  28297. supposed to be generated forever.
  28298. </p></dd>
  28299. </dl>
  28300. <a name="Examples-74"></a>
  28301. <h4 class="subsection">37.4.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-74" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-74" aria-hidden="true">TOC</a></span></h4>
  28302. <ul>
  28303. <li> Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
  28304. <div class="example">
  28305. <pre class="example">anullsrc=r=48000:cl=4
  28306. </pre></div>
  28307. </li><li> Do the same operation with a more obvious syntax:
  28308. <div class="example">
  28309. <pre class="example">anullsrc=r=48000:cl=mono
  28310. </pre></div>
  28311. </li></ul>
  28312. <p>All the parameters need to be explicitly defined.
  28313. </p>
  28314. <a name="flite"></a>
  28315. <h3 class="section">37.5 flite<span class="pull-right"><a class="anchor hidden-xs" href="#flite" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flite" aria-hidden="true">TOC</a></span></h3>
  28316. <p>Synthesize a voice utterance using the libflite library.
  28317. </p>
  28318. <p>To enable compilation of this filter you need to configure FFmpeg with
  28319. <code>--enable-libflite</code>.
  28320. </p>
  28321. <p>Note that versions of the flite library prior to 2.0 are not thread-safe.
  28322. </p>
  28323. <p>The filter accepts the following options:
  28324. </p>
  28325. <dl compact="compact">
  28326. <dt><samp>list_voices</samp></dt>
  28327. <dd><p>If set to 1, list the names of the available voices and exit
  28328. immediately. Default value is 0.
  28329. </p>
  28330. </dd>
  28331. <dt><samp>nb_samples, n</samp></dt>
  28332. <dd><p>Set the maximum number of samples per frame. Default value is 512.
  28333. </p>
  28334. </dd>
  28335. <dt><samp>textfile</samp></dt>
  28336. <dd><p>Set the filename containing the text to speak.
  28337. </p>
  28338. </dd>
  28339. <dt><samp>text</samp></dt>
  28340. <dd><p>Set the text to speak.
  28341. </p>
  28342. </dd>
  28343. <dt><samp>voice, v</samp></dt>
  28344. <dd><p>Set the voice to use for the speech synthesis. Default value is
  28345. <code>kal</code>. See also the <var>list_voices</var> option.
  28346. </p></dd>
  28347. </dl>
  28348. <a name="Examples-75"></a>
  28349. <h4 class="subsection">37.5.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-75" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-75" aria-hidden="true">TOC</a></span></h4>
  28350. <ul>
  28351. <li> Read from file <samp>speech.txt</samp>, and synthesize the text using the
  28352. standard flite voice:
  28353. <div class="example">
  28354. <pre class="example">flite=textfile=speech.txt
  28355. </pre></div>
  28356. </li><li> Read the specified text selecting the <code>slt</code> voice:
  28357. <div class="example">
  28358. <pre class="example">flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
  28359. </pre></div>
  28360. </li><li> Input text to ffmpeg:
  28361. <div class="example">
  28362. <pre class="example">ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
  28363. </pre></div>
  28364. </li><li> Make <samp>ffplay</samp> speak the specified text, using <code>flite</code> and
  28365. the <code>lavfi</code> device:
  28366. <div class="example">
  28367. <pre class="example">ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
  28368. </pre></div>
  28369. </li></ul>
  28370. <p>For more information about libflite, check:
  28371. <a href="http://www.festvox.org/flite/">http://www.festvox.org/flite/</a>
  28372. </p>
  28373. <a name="anoisesrc"></a>
  28374. <h3 class="section">37.6 anoisesrc<span class="pull-right"><a class="anchor hidden-xs" href="#anoisesrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anoisesrc" aria-hidden="true">TOC</a></span></h3>
  28375. <p>Generate a noise audio signal.
  28376. </p>
  28377. <p>The filter accepts the following options:
  28378. </p>
  28379. <dl compact="compact">
  28380. <dt><samp>sample_rate, r</samp></dt>
  28381. <dd><p>Specify the sample rate. Default value is 48000 Hz.
  28382. </p>
  28383. </dd>
  28384. <dt><samp>amplitude, a</samp></dt>
  28385. <dd><p>Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value
  28386. is 1.0.
  28387. </p>
  28388. </dd>
  28389. <dt><samp>duration, d</samp></dt>
  28390. <dd><p>Specify the duration of the generated audio stream. Not specifying this option
  28391. results in noise with an infinite length.
  28392. </p>
  28393. </dd>
  28394. <dt><samp>color, colour, c</samp></dt>
  28395. <dd><p>Specify the color of noise. Available noise colors are white, pink, brown,
  28396. blue, violet and velvet. Default color is white.
  28397. </p>
  28398. </dd>
  28399. <dt><samp>seed, s</samp></dt>
  28400. <dd><p>Specify a value used to seed the PRNG.
  28401. </p>
  28402. </dd>
  28403. <dt><samp>nb_samples, n</samp></dt>
  28404. <dd><p>Set the number of samples per each output frame, default is 1024.
  28405. </p></dd>
  28406. </dl>
  28407. <a name="Examples-76"></a>
  28408. <h4 class="subsection">37.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-76" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-76" aria-hidden="true">TOC</a></span></h4>
  28409. <ul>
  28410. <li> Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5:
  28411. <div class="example">
  28412. <pre class="example">anoisesrc=d=60:c=pink:r=44100:a=0.5
  28413. </pre></div>
  28414. </li></ul>
  28415. <a name="hilbert"></a>
  28416. <h3 class="section">37.7 hilbert<span class="pull-right"><a class="anchor hidden-xs" href="#hilbert" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hilbert" aria-hidden="true">TOC</a></span></h3>
  28417. <p>Generate odd-tap Hilbert transform FIR coefficients.
  28418. </p>
  28419. <p>The resulting stream can be used with <a href="#afir">afir</a> filter for phase-shifting
  28420. the signal by 90 degrees.
  28421. </p>
  28422. <p>This is used in many matrix coding schemes and for analytic signal generation.
  28423. The process is often written as a multiplication by i (or j), the imaginary unit.
  28424. </p>
  28425. <p>The filter accepts the following options:
  28426. </p>
  28427. <dl compact="compact">
  28428. <dt><samp>sample_rate, s</samp></dt>
  28429. <dd><p>Set sample rate, default is 44100.
  28430. </p>
  28431. </dd>
  28432. <dt><samp>taps, t</samp></dt>
  28433. <dd><p>Set length of FIR filter, default is 22051.
  28434. </p>
  28435. </dd>
  28436. <dt><samp>nb_samples, n</samp></dt>
  28437. <dd><p>Set number of samples per each frame.
  28438. </p>
  28439. </dd>
  28440. <dt><samp>win_func, w</samp></dt>
  28441. <dd><p>Set window function to be used when generating FIR coefficients.
  28442. </p></dd>
  28443. </dl>
  28444. <a name="sinc"></a>
  28445. <h3 class="section">37.8 sinc<span class="pull-right"><a class="anchor hidden-xs" href="#sinc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sinc" aria-hidden="true">TOC</a></span></h3>
  28446. <p>Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients.
  28447. </p>
  28448. <p>The resulting stream can be used with <a href="#afir">afir</a> filter for filtering the audio signal.
  28449. </p>
  28450. <p>The filter accepts the following options:
  28451. </p>
  28452. <dl compact="compact">
  28453. <dt><samp>sample_rate, r</samp></dt>
  28454. <dd><p>Set sample rate, default is 44100.
  28455. </p>
  28456. </dd>
  28457. <dt><samp>nb_samples, n</samp></dt>
  28458. <dd><p>Set number of samples per each frame. Default is 1024.
  28459. </p>
  28460. </dd>
  28461. <dt><samp>hp</samp></dt>
  28462. <dd><p>Set high-pass frequency. Default is 0.
  28463. </p>
  28464. </dd>
  28465. <dt><samp>lp</samp></dt>
  28466. <dd><p>Set low-pass frequency. Default is 0.
  28467. If high-pass frequency is lower than low-pass frequency and low-pass frequency
  28468. is higher than 0 then filter will create band-pass filter coefficients,
  28469. otherwise band-reject filter coefficients.
  28470. </p>
  28471. </dd>
  28472. <dt><samp>phase</samp></dt>
  28473. <dd><p>Set filter phase response. Default is 50. Allowed range is from 0 to 100.
  28474. </p>
  28475. </dd>
  28476. <dt><samp>beta</samp></dt>
  28477. <dd><p>Set Kaiser window beta.
  28478. </p>
  28479. </dd>
  28480. <dt><samp>att</samp></dt>
  28481. <dd><p>Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 dB.
  28482. </p>
  28483. </dd>
  28484. <dt><samp>round</samp></dt>
  28485. <dd><p>Enable rounding, by default is disabled.
  28486. </p>
  28487. </dd>
  28488. <dt><samp>hptaps</samp></dt>
  28489. <dd><p>Set number of taps for high-pass filter.
  28490. </p>
  28491. </dd>
  28492. <dt><samp>lptaps</samp></dt>
  28493. <dd><p>Set number of taps for low-pass filter.
  28494. </p></dd>
  28495. </dl>
  28496. <a name="sine"></a>
  28497. <h3 class="section">37.9 sine<span class="pull-right"><a class="anchor hidden-xs" href="#sine" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sine" aria-hidden="true">TOC</a></span></h3>
  28498. <p>Generate an audio signal made of a sine wave with amplitude 1/8.
  28499. </p>
  28500. <p>The audio signal is bit-exact.
  28501. </p>
  28502. <p>The filter accepts the following options:
  28503. </p>
  28504. <dl compact="compact">
  28505. <dt><samp>frequency, f</samp></dt>
  28506. <dd><p>Set the carrier frequency. Default is 440 Hz.
  28507. </p>
  28508. </dd>
  28509. <dt><samp>beep_factor, b</samp></dt>
  28510. <dd><p>Enable a periodic beep every second with frequency <var>beep_factor</var> times
  28511. the carrier frequency. Default is 0, meaning the beep is disabled.
  28512. </p>
  28513. </dd>
  28514. <dt><samp>sample_rate, r</samp></dt>
  28515. <dd><p>Specify the sample rate, default is 44100.
  28516. </p>
  28517. </dd>
  28518. <dt><samp>duration, d</samp></dt>
  28519. <dd><p>Specify the duration of the generated audio stream.
  28520. </p>
  28521. </dd>
  28522. <dt><samp>samples_per_frame</samp></dt>
  28523. <dd><p>Set the number of samples per output frame.
  28524. </p>
  28525. <p>The expression can contain the following constants:
  28526. </p>
  28527. <dl compact="compact">
  28528. <dt><samp>n</samp></dt>
  28529. <dd><p>The (sequential) number of the output audio frame, starting from 0.
  28530. </p>
  28531. </dd>
  28532. <dt><samp>pts</samp></dt>
  28533. <dd><p>The PTS (Presentation TimeStamp) of the output audio frame,
  28534. expressed in <var>TB</var> units.
  28535. </p>
  28536. </dd>
  28537. <dt><samp>t</samp></dt>
  28538. <dd><p>The PTS of the output audio frame, expressed in seconds.
  28539. </p>
  28540. </dd>
  28541. <dt><samp>TB</samp></dt>
  28542. <dd><p>The timebase of the output audio frames.
  28543. </p></dd>
  28544. </dl>
  28545. <p>Default is <code>1024</code>.
  28546. </p></dd>
  28547. </dl>
  28548. <a name="Examples-77"></a>
  28549. <h4 class="subsection">37.9.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-77" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-77" aria-hidden="true">TOC</a></span></h4>
  28550. <ul>
  28551. <li> Generate a simple 440 Hz sine wave:
  28552. <div class="example">
  28553. <pre class="example">sine
  28554. </pre></div>
  28555. </li><li> Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
  28556. <div class="example">
  28557. <pre class="example">sine=220:4:d=5
  28558. sine=f=220:b=4:d=5
  28559. sine=frequency=220:beep_factor=4:duration=5
  28560. </pre></div>
  28561. </li><li> Generate a 1 kHz sine wave following <code>1602,1601,1602,1601,1602</code> NTSC
  28562. pattern:
  28563. <div class="example">
  28564. <pre class="example">sine=1000:samples_per_frame='st(0,mod(n,5)); 1602-not(not(eq(ld(0),1)+eq(ld(0),3)))'
  28565. </pre></div>
  28566. </li></ul>
  28567. <a name="Audio-Sinks"></a>
  28568. <h2 class="chapter">38 Audio Sinks<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Sinks" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Sinks" aria-hidden="true">TOC</a></span></h2>
  28569. <p>Below is a description of the currently available audio sinks.
  28570. </p>
  28571. <a name="abuffersink"></a>
  28572. <h3 class="section">38.1 abuffersink<span class="pull-right"><a class="anchor hidden-xs" href="#abuffersink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-abuffersink" aria-hidden="true">TOC</a></span></h3>
  28573. <p>Buffer audio frames, and make them available to the end of filter chain.
  28574. </p>
  28575. <p>This sink is mainly intended for programmatic use, in particular
  28576. through the interface defined in <samp>libavfilter/buffersink.h</samp>
  28577. or the options system.
  28578. </p>
  28579. <p>It accepts a pointer to an AVABufferSinkContext structure, which
  28580. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  28581. parameter to <code>avfilter_init_filter</code> for initialization.
  28582. </p><a name="anullsink"></a>
  28583. <h3 class="section">38.2 anullsink<span class="pull-right"><a class="anchor hidden-xs" href="#anullsink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anullsink" aria-hidden="true">TOC</a></span></h3>
  28584. <p>Null audio sink; do absolutely nothing with the input audio. It is
  28585. mainly useful as a template and for use in analysis / debugging
  28586. tools.
  28587. </p>
  28588. <a name="Video-Filters"></a>
  28589. <h2 class="chapter">39 Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  28590. <p>When you configure your FFmpeg build, you can disable any of the
  28591. existing filters using <code>--disable-filters</code>.
  28592. The configure output will show the video filters included in your
  28593. build.
  28594. </p>
  28595. <p>Below is a description of the currently available video filters.
  28596. </p>
  28597. <a name="addroi"></a>
  28598. <h3 class="section">39.1 addroi<span class="pull-right"><a class="anchor hidden-xs" href="#addroi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-addroi" aria-hidden="true">TOC</a></span></h3>
  28599. <p>Mark a region of interest in a video frame.
  28600. </p>
  28601. <p>The frame data is passed through unchanged, but metadata is attached
  28602. to the frame indicating regions of interest which can affect the
  28603. behaviour of later encoding. Multiple regions can be marked by
  28604. applying the filter multiple times.
  28605. </p>
  28606. <dl compact="compact">
  28607. <dt><samp>x</samp></dt>
  28608. <dd><p>Region distance in pixels from the left edge of the frame.
  28609. </p></dd>
  28610. <dt><samp>y</samp></dt>
  28611. <dd><p>Region distance in pixels from the top edge of the frame.
  28612. </p></dd>
  28613. <dt><samp>w</samp></dt>
  28614. <dd><p>Region width in pixels.
  28615. </p></dd>
  28616. <dt><samp>h</samp></dt>
  28617. <dd><p>Region height in pixels.
  28618. </p>
  28619. <p>The parameters <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> are expressions,
  28620. and may contain the following variables:
  28621. </p><dl compact="compact">
  28622. <dt><samp>iw</samp></dt>
  28623. <dd><p>Width of the input frame.
  28624. </p></dd>
  28625. <dt><samp>ih</samp></dt>
  28626. <dd><p>Height of the input frame.
  28627. </p></dd>
  28628. </dl>
  28629. </dd>
  28630. <dt><samp>qoffset</samp></dt>
  28631. <dd><p>Quantisation offset to apply within the region.
  28632. </p>
  28633. <p>This must be a real value in the range -1 to +1. A value of zero
  28634. indicates no quality change. A negative value asks for better quality
  28635. (less quantisation), while a positive value asks for worse quality
  28636. (greater quantisation).
  28637. </p>
  28638. <p>The range is calibrated so that the extreme values indicate the
  28639. largest possible offset - if the rest of the frame is encoded with the
  28640. worst possible quality, an offset of -1 indicates that this region
  28641. should be encoded with the best possible quality anyway. Intermediate
  28642. values are then interpolated in some codec-dependent way.
  28643. </p>
  28644. <p>For example, in 10-bit H.264 the quantisation parameter varies between
  28645. -12 and 51. A typical qoffset value of -1/10 therefore indicates that
  28646. this region should be encoded with a QP around one-tenth of the full
  28647. range better than the rest of the frame. So, if most of the frame
  28648. were to be encoded with a QP of around 30, this region would get a QP
  28649. of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3).
  28650. An extreme value of -1 would indicate that this region should be
  28651. encoded with the best possible quality regardless of the treatment of
  28652. the rest of the frame - that is, should be encoded at a QP of -12.
  28653. </p></dd>
  28654. <dt><samp>clear</samp></dt>
  28655. <dd><p>If set to true, remove any existing regions of interest marked on the
  28656. frame before adding the new one.
  28657. </p></dd>
  28658. </dl>
  28659. <a name="Examples-78"></a>
  28660. <h4 class="subsection">39.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-78" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-78" aria-hidden="true">TOC</a></span></h4>
  28661. <ul>
  28662. <li> Mark the centre quarter of the frame as interesting.
  28663. <div class="example">
  28664. <pre class="example">addroi=iw/4:ih/4:iw/2:ih/2:-1/10
  28665. </pre></div>
  28666. </li><li> Mark the 100-pixel-wide region on the left edge of the frame as very
  28667. uninteresting (to be encoded at much lower quality than the rest of
  28668. the frame).
  28669. <div class="example">
  28670. <pre class="example">addroi=0:0:100:ih:+1/5
  28671. </pre></div>
  28672. </li></ul>
  28673. <a name="alphaextract"></a>
  28674. <h3 class="section">39.2 alphaextract<span class="pull-right"><a class="anchor hidden-xs" href="#alphaextract" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alphaextract" aria-hidden="true">TOC</a></span></h3>
  28675. <p>Extract the alpha component from the input as a grayscale video. This
  28676. is especially useful with the <var>alphamerge</var> filter.
  28677. </p>
  28678. <a name="alphamerge"></a>
  28679. <h3 class="section">39.3 alphamerge<span class="pull-right"><a class="anchor hidden-xs" href="#alphamerge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alphamerge" aria-hidden="true">TOC</a></span></h3>
  28680. <p>Add or replace the alpha component of the primary input with the
  28681. grayscale value of a second input. This is intended for use with
  28682. <var>alphaextract</var> to allow the transmission or storage of frame
  28683. sequences that have alpha in a format that doesn&rsquo;t support an alpha
  28684. channel.
  28685. </p>
  28686. <p>For example, to reconstruct full frames from a normal YUV-encoded video
  28687. and a separate video created with <var>alphaextract</var>, you might use:
  28688. </p><div class="example">
  28689. <pre class="example">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
  28690. </pre></div>
  28691. <a name="amplify"></a>
  28692. <h3 class="section">39.4 amplify<span class="pull-right"><a class="anchor hidden-xs" href="#amplify" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amplify" aria-hidden="true">TOC</a></span></h3>
  28693. <p>Amplify differences between current pixel and pixels of adjacent frames in
  28694. same pixel location.
  28695. </p>
  28696. <p>This filter accepts the following options:
  28697. </p>
  28698. <dl compact="compact">
  28699. <dt><samp>radius</samp></dt>
  28700. <dd><p>Set frame radius. Default is 2. Allowed range is from 1 to 63.
  28701. For example radius of 3 will instruct filter to calculate average of 7 frames.
  28702. </p>
  28703. </dd>
  28704. <dt><samp>factor</samp></dt>
  28705. <dd><p>Set factor to amplify difference. Default is 2. Allowed range is from 0 to 65535.
  28706. </p>
  28707. </dd>
  28708. <dt><samp>threshold</samp></dt>
  28709. <dd><p>Set threshold for difference amplification. Any difference greater or equal to
  28710. this value will not alter source pixel. Default is 10.
  28711. Allowed range is from 0 to 65535.
  28712. </p>
  28713. </dd>
  28714. <dt><samp>tolerance</samp></dt>
  28715. <dd><p>Set tolerance for difference amplification. Any difference lower to
  28716. this value will not alter source pixel. Default is 0.
  28717. Allowed range is from 0 to 65535.
  28718. </p>
  28719. </dd>
  28720. <dt><samp>low</samp></dt>
  28721. <dd><p>Set lower limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  28722. This option controls maximum possible value that will decrease source pixel value.
  28723. </p>
  28724. </dd>
  28725. <dt><samp>high</samp></dt>
  28726. <dd><p>Set high limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  28727. This option controls maximum possible value that will increase source pixel value.
  28728. </p>
  28729. </dd>
  28730. <dt><samp>planes</samp></dt>
  28731. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  28732. </p></dd>
  28733. </dl>
  28734. <a name="Commands-43"></a>
  28735. <h4 class="subsection">39.4.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-43" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-43" aria-hidden="true">TOC</a></span></h4>
  28736. <p>This filter supports the following <a href="#commands">commands</a> that corresponds to option of same name:
  28737. </p><dl compact="compact">
  28738. <dt><samp>factor</samp></dt>
  28739. <dt><samp>threshold</samp></dt>
  28740. <dt><samp>tolerance</samp></dt>
  28741. <dt><samp>low</samp></dt>
  28742. <dt><samp>high</samp></dt>
  28743. <dt><samp>planes</samp></dt>
  28744. </dl>
  28745. <a name="ass"></a>
  28746. <h3 class="section">39.5 ass<span class="pull-right"><a class="anchor hidden-xs" href="#ass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ass" aria-hidden="true">TOC</a></span></h3>
  28747. <p>Same as the <a href="#subtitles">subtitles</a> filter, except that it doesn&rsquo;t require libavcodec
  28748. and libavformat to work. On the other hand, it is limited to ASS (Advanced
  28749. Substation Alpha) subtitles files.
  28750. </p>
  28751. <p>This filter accepts the following option in addition to the common options from
  28752. the <a href="#subtitles">subtitles</a> filter:
  28753. </p>
  28754. <dl compact="compact">
  28755. <dt><samp>shaping</samp></dt>
  28756. <dd><p>Set the shaping engine
  28757. </p>
  28758. <p>Available values are:
  28759. </p><dl compact="compact">
  28760. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  28761. <dd><p>The default libass shaping engine, which is the best available.
  28762. </p></dd>
  28763. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  28764. <dd><p>Fast, font-agnostic shaper that can do only substitutions
  28765. </p></dd>
  28766. <dt>&lsquo;<samp>complex</samp>&rsquo;</dt>
  28767. <dd><p>Slower shaper using OpenType for substitutions and positioning
  28768. </p></dd>
  28769. </dl>
  28770. <p>The default is <code>auto</code>.
  28771. </p></dd>
  28772. </dl>
  28773. <a name="atadenoise"></a>
  28774. <h3 class="section">39.6 atadenoise<span class="pull-right"><a class="anchor hidden-xs" href="#atadenoise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atadenoise" aria-hidden="true">TOC</a></span></h3>
  28775. <p>Apply an Adaptive Temporal Averaging Denoiser to the video input.
  28776. </p>
  28777. <p>The filter accepts the following options:
  28778. </p>
  28779. <dl compact="compact">
  28780. <dt><samp>0a</samp></dt>
  28781. <dd><p>Set threshold A for 1st plane. Default is 0.02.
  28782. Valid range is 0 to 0.3.
  28783. </p>
  28784. </dd>
  28785. <dt><samp>0b</samp></dt>
  28786. <dd><p>Set threshold B for 1st plane. Default is 0.04.
  28787. Valid range is 0 to 5.
  28788. </p>
  28789. </dd>
  28790. <dt><samp>1a</samp></dt>
  28791. <dd><p>Set threshold A for 2nd plane. Default is 0.02.
  28792. Valid range is 0 to 0.3.
  28793. </p>
  28794. </dd>
  28795. <dt><samp>1b</samp></dt>
  28796. <dd><p>Set threshold B for 2nd plane. Default is 0.04.
  28797. Valid range is 0 to 5.
  28798. </p>
  28799. </dd>
  28800. <dt><samp>2a</samp></dt>
  28801. <dd><p>Set threshold A for 3rd plane. Default is 0.02.
  28802. Valid range is 0 to 0.3.
  28803. </p>
  28804. </dd>
  28805. <dt><samp>2b</samp></dt>
  28806. <dd><p>Set threshold B for 3rd plane. Default is 0.04.
  28807. Valid range is 0 to 5.
  28808. </p>
  28809. <p>Threshold A is designed to react on abrupt changes in the input signal and
  28810. threshold B is designed to react on continuous changes in the input signal.
  28811. </p>
  28812. </dd>
  28813. <dt><samp>s</samp></dt>
  28814. <dd><p>Set number of frames filter will use for averaging. Default is 9. Must be odd
  28815. number in range [5, 129].
  28816. </p>
  28817. </dd>
  28818. <dt><samp>p</samp></dt>
  28819. <dd><p>Set what planes of frame filter will use for averaging. Default is all.
  28820. </p>
  28821. </dd>
  28822. <dt><samp>a</samp></dt>
  28823. <dd><p>Set what variant of algorithm filter will use for averaging. Default is <code>p</code> parallel.
  28824. Alternatively can be set to <code>s</code> serial.
  28825. </p>
  28826. <p>Parallel can be faster then serial, while other way around is never true.
  28827. Parallel will abort early on first change being greater then thresholds, while serial
  28828. will continue processing other side of frames if they are equal or below thresholds.
  28829. </p>
  28830. </dd>
  28831. <dt><samp>0s</samp></dt>
  28832. <dt><samp>1s</samp></dt>
  28833. <dt><samp>2s</samp></dt>
  28834. <dd><p>Set sigma for 1st plane, 2nd plane or 3rd plane. Default is 32767.
  28835. Valid range is from 0 to 32767.
  28836. This options controls weight for each pixel in radius defined by size.
  28837. Default value means every pixel have same weight.
  28838. Setting this option to 0 effectively disables filtering.
  28839. </p></dd>
  28840. </dl>
  28841. <a name="Commands-44"></a>
  28842. <h4 class="subsection">39.6.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-44" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-44" aria-hidden="true">TOC</a></span></h4>
  28843. <p>This filter supports same <a href="#commands">commands</a> as options except option <code>s</code>.
  28844. The command accepts the same syntax of the corresponding option.
  28845. </p>
  28846. <a name="avgblur"></a>
  28847. <h3 class="section">39.7 avgblur<span class="pull-right"><a class="anchor hidden-xs" href="#avgblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avgblur" aria-hidden="true">TOC</a></span></h3>
  28848. <p>Apply average blur filter.
  28849. </p>
  28850. <p>The filter accepts the following options:
  28851. </p>
  28852. <dl compact="compact">
  28853. <dt><samp>sizeX</samp></dt>
  28854. <dd><p>Set horizontal radius size.
  28855. </p>
  28856. </dd>
  28857. <dt><samp>planes</samp></dt>
  28858. <dd><p>Set which planes to filter. By default all planes are filtered.
  28859. </p>
  28860. </dd>
  28861. <dt><samp>sizeY</samp></dt>
  28862. <dd><p>Set vertical radius size, if zero it will be same as <code>sizeX</code>.
  28863. Default is <code>0</code>.
  28864. </p></dd>
  28865. </dl>
  28866. <a name="Commands-45"></a>
  28867. <h4 class="subsection">39.7.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-45" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-45" aria-hidden="true">TOC</a></span></h4>
  28868. <p>This filter supports same commands as options.
  28869. The command accepts the same syntax of the corresponding option.
  28870. </p>
  28871. <p>If the specified expression is not valid, it is kept at its current
  28872. value.
  28873. </p>
  28874. <a name="bbox"></a>
  28875. <h3 class="section">39.8 bbox<span class="pull-right"><a class="anchor hidden-xs" href="#bbox" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bbox" aria-hidden="true">TOC</a></span></h3>
  28876. <p>Compute the bounding box for the non-black pixels in the input frame
  28877. luminance plane.
  28878. </p>
  28879. <p>This filter computes the bounding box containing all the pixels with a
  28880. luminance value greater than the minimum allowed value.
  28881. The parameters describing the bounding box are printed on the filter
  28882. log.
  28883. </p>
  28884. <p>The filter accepts the following option:
  28885. </p>
  28886. <dl compact="compact">
  28887. <dt><samp>min_val</samp></dt>
  28888. <dd><p>Set the minimal luminance value. Default is <code>16</code>.
  28889. </p></dd>
  28890. </dl>
  28891. <a name="Commands-46"></a>
  28892. <h4 class="subsection">39.8.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-46" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-46" aria-hidden="true">TOC</a></span></h4>
  28893. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  28894. </p>
  28895. <a name="bilateral"></a>
  28896. <h3 class="section">39.9 bilateral<span class="pull-right"><a class="anchor hidden-xs" href="#bilateral" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bilateral" aria-hidden="true">TOC</a></span></h3>
  28897. <p>Apply bilateral filter, spatial smoothing while preserving edges.
  28898. </p>
  28899. <p>The filter accepts the following options:
  28900. </p><dl compact="compact">
  28901. <dt><samp>sigmaS</samp></dt>
  28902. <dd><p>Set sigma of gaussian function to calculate spatial weight.
  28903. Allowed range is 0 to 512. Default is 0.1.
  28904. </p>
  28905. </dd>
  28906. <dt><samp>sigmaR</samp></dt>
  28907. <dd><p>Set sigma of gaussian function to calculate range weight.
  28908. Allowed range is 0 to 1. Default is 0.1.
  28909. </p>
  28910. </dd>
  28911. <dt><samp>planes</samp></dt>
  28912. <dd><p>Set planes to filter. Default is first only.
  28913. </p></dd>
  28914. </dl>
  28915. <a name="Commands-47"></a>
  28916. <h4 class="subsection">39.9.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-47" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-47" aria-hidden="true">TOC</a></span></h4>
  28917. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  28918. </p>
  28919. <a name="bitplanenoise"></a>
  28920. <h3 class="section">39.10 bitplanenoise<span class="pull-right"><a class="anchor hidden-xs" href="#bitplanenoise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bitplanenoise" aria-hidden="true">TOC</a></span></h3>
  28921. <p>Show and measure bit plane noise.
  28922. </p>
  28923. <p>The filter accepts the following options:
  28924. </p>
  28925. <dl compact="compact">
  28926. <dt><samp>bitplane</samp></dt>
  28927. <dd><p>Set which plane to analyze. Default is <code>1</code>.
  28928. </p>
  28929. </dd>
  28930. <dt><samp>filter</samp></dt>
  28931. <dd><p>Filter out noisy pixels from <code>bitplane</code> set above.
  28932. Default is disabled.
  28933. </p></dd>
  28934. </dl>
  28935. <a name="blackdetect"></a>
  28936. <h3 class="section">39.11 blackdetect<span class="pull-right"><a class="anchor hidden-xs" href="#blackdetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blackdetect" aria-hidden="true">TOC</a></span></h3>
  28937. <p>Detect video intervals that are (almost) completely black. Can be
  28938. useful to detect chapter transitions, commercials, or invalid
  28939. recordings.
  28940. </p>
  28941. <p>The filter outputs its detection analysis to both the log as well as
  28942. frame metadata. If a black segment of at least the specified minimum
  28943. duration is found, a line with the start and end timestamps as well
  28944. as duration is printed to the log with level <code>info</code>. In addition,
  28945. a log line with level <code>debug</code> is printed per frame showing the
  28946. black amount detected for that frame.
  28947. </p>
  28948. <p>The filter also attaches metadata to the first frame of a black
  28949. segment with key <code>lavfi.black_start</code> and to the first frame
  28950. after the black segment ends with key <code>lavfi.black_end</code>. The
  28951. value is the frame&rsquo;s timestamp. This metadata is added regardless
  28952. of the minimum duration specified.
  28953. </p>
  28954. <p>The filter accepts the following options:
  28955. </p>
  28956. <dl compact="compact">
  28957. <dt><samp>black_min_duration, d</samp></dt>
  28958. <dd><p>Set the minimum detected black duration expressed in seconds. It must
  28959. be a non-negative floating point number.
  28960. </p>
  28961. <p>Default value is 2.0.
  28962. </p>
  28963. </dd>
  28964. <dt><samp>picture_black_ratio_th, pic_th</samp></dt>
  28965. <dd><p>Set the threshold for considering a picture &quot;black&quot;.
  28966. Express the minimum value for the ratio:
  28967. </p><div class="example">
  28968. <pre class="example"><var>nb_black_pixels</var> / <var>nb_pixels</var>
  28969. </pre></div>
  28970. <p>for which a picture is considered black.
  28971. Default value is 0.98.
  28972. </p>
  28973. </dd>
  28974. <dt><samp>pixel_black_th, pix_th</samp></dt>
  28975. <dd><p>Set the threshold for considering a pixel &quot;black&quot;.
  28976. </p>
  28977. <p>The threshold expresses the maximum pixel luminance value for which a
  28978. pixel is considered &quot;black&quot;. The provided value is scaled according to
  28979. the following equation:
  28980. </p><div class="example">
  28981. <pre class="example"><var>absolute_threshold</var> = <var>luminance_minimum_value</var> + <var>pixel_black_th</var> * <var>luminance_range_size</var>
  28982. </pre></div>
  28983. <p><var>luminance_range_size</var> and <var>luminance_minimum_value</var> depend on
  28984. the input video format, the range is [0-255] for YUV full-range
  28985. formats and [16-235] for YUV non full-range formats.
  28986. </p>
  28987. <p>Default value is 0.10.
  28988. </p></dd>
  28989. </dl>
  28990. <p>The following example sets the maximum pixel threshold to the minimum
  28991. value, and detects only black intervals of 2 or more seconds:
  28992. </p><div class="example">
  28993. <pre class="example">blackdetect=d=2:pix_th=0.00
  28994. </pre></div>
  28995. <a name="blackframe"></a>
  28996. <h3 class="section">39.12 blackframe<span class="pull-right"><a class="anchor hidden-xs" href="#blackframe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blackframe" aria-hidden="true">TOC</a></span></h3>
  28997. <p>Detect frames that are (almost) completely black. Can be useful to
  28998. detect chapter transitions or commercials. Output lines consist of
  28999. the frame number of the detected frame, the percentage of blackness,
  29000. the position in the file if known or -1 and the timestamp in seconds.
  29001. </p>
  29002. <p>In order to display the output lines, you need to set the loglevel at
  29003. least to the AV_LOG_INFO value.
  29004. </p>
  29005. <p>This filter exports frame metadata <code>lavfi.blackframe.pblack</code>.
  29006. The value represents the percentage of pixels in the picture that
  29007. are below the threshold value.
  29008. </p>
  29009. <p>It accepts the following parameters:
  29010. </p>
  29011. <dl compact="compact">
  29012. <dt><samp>amount</samp></dt>
  29013. <dd><p>The percentage of the pixels that have to be below the threshold; it defaults to
  29014. <code>98</code>.
  29015. </p>
  29016. </dd>
  29017. <dt><samp>threshold, thresh</samp></dt>
  29018. <dd><p>The threshold below which a pixel value is considered black; it defaults to
  29019. <code>32</code>.
  29020. </p>
  29021. </dd>
  29022. </dl>
  29023. <span id="blend"></span><a name="blend-1"></a>
  29024. <h3 class="section">39.13 blend<span class="pull-right"><a class="anchor hidden-xs" href="#blend-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blend-1" aria-hidden="true">TOC</a></span></h3>
  29025. <p>Blend two video frames into each other.
  29026. </p>
  29027. <p>The <code>blend</code> filter takes two input streams and outputs one
  29028. stream, the first input is the &quot;top&quot; layer and second input is
  29029. &quot;bottom&quot; layer. By default, the output terminates when the longest input terminates.
  29030. </p>
  29031. <p>The <code>tblend</code> (time blend) filter takes two consecutive frames
  29032. from one single stream, and outputs the result obtained by blending
  29033. the new frame on top of the old frame.
  29034. </p>
  29035. <p>A description of the accepted options follows.
  29036. </p>
  29037. <dl compact="compact">
  29038. <dt><samp>c0_mode</samp></dt>
  29039. <dt><samp>c1_mode</samp></dt>
  29040. <dt><samp>c2_mode</samp></dt>
  29041. <dt><samp>c3_mode</samp></dt>
  29042. <dt><samp>all_mode</samp></dt>
  29043. <dd><p>Set blend mode for specific pixel component or all pixel components in case
  29044. of <var>all_mode</var>. Default value is <code>normal</code>.
  29045. </p>
  29046. <p>Available values for component modes are:
  29047. </p><dl compact="compact">
  29048. <dt>&lsquo;<samp>addition</samp>&rsquo;</dt>
  29049. <dt>&lsquo;<samp>grainmerge</samp>&rsquo;</dt>
  29050. <dt>&lsquo;<samp>and</samp>&rsquo;</dt>
  29051. <dt>&lsquo;<samp>average</samp>&rsquo;</dt>
  29052. <dt>&lsquo;<samp>burn</samp>&rsquo;</dt>
  29053. <dt>&lsquo;<samp>darken</samp>&rsquo;</dt>
  29054. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  29055. <dt>&lsquo;<samp>grainextract</samp>&rsquo;</dt>
  29056. <dt>&lsquo;<samp>divide</samp>&rsquo;</dt>
  29057. <dt>&lsquo;<samp>dodge</samp>&rsquo;</dt>
  29058. <dt>&lsquo;<samp>freeze</samp>&rsquo;</dt>
  29059. <dt>&lsquo;<samp>exclusion</samp>&rsquo;</dt>
  29060. <dt>&lsquo;<samp>extremity</samp>&rsquo;</dt>
  29061. <dt>&lsquo;<samp>glow</samp>&rsquo;</dt>
  29062. <dt>&lsquo;<samp>hardlight</samp>&rsquo;</dt>
  29063. <dt>&lsquo;<samp>hardmix</samp>&rsquo;</dt>
  29064. <dt>&lsquo;<samp>heat</samp>&rsquo;</dt>
  29065. <dt>&lsquo;<samp>lighten</samp>&rsquo;</dt>
  29066. <dt>&lsquo;<samp>linearlight</samp>&rsquo;</dt>
  29067. <dt>&lsquo;<samp>multiply</samp>&rsquo;</dt>
  29068. <dt>&lsquo;<samp>multiply128</samp>&rsquo;</dt>
  29069. <dt>&lsquo;<samp>negation</samp>&rsquo;</dt>
  29070. <dt>&lsquo;<samp>normal</samp>&rsquo;</dt>
  29071. <dt>&lsquo;<samp>or</samp>&rsquo;</dt>
  29072. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  29073. <dt>&lsquo;<samp>phoenix</samp>&rsquo;</dt>
  29074. <dt>&lsquo;<samp>pinlight</samp>&rsquo;</dt>
  29075. <dt>&lsquo;<samp>reflect</samp>&rsquo;</dt>
  29076. <dt>&lsquo;<samp>screen</samp>&rsquo;</dt>
  29077. <dt>&lsquo;<samp>softlight</samp>&rsquo;</dt>
  29078. <dt>&lsquo;<samp>subtract</samp>&rsquo;</dt>
  29079. <dt>&lsquo;<samp>vividlight</samp>&rsquo;</dt>
  29080. <dt>&lsquo;<samp>xor</samp>&rsquo;</dt>
  29081. </dl>
  29082. </dd>
  29083. <dt><samp>c0_opacity</samp></dt>
  29084. <dt><samp>c1_opacity</samp></dt>
  29085. <dt><samp>c2_opacity</samp></dt>
  29086. <dt><samp>c3_opacity</samp></dt>
  29087. <dt><samp>all_opacity</samp></dt>
  29088. <dd><p>Set blend opacity for specific pixel component or all pixel components in case
  29089. of <var>all_opacity</var>. Only used in combination with pixel component blend modes.
  29090. </p>
  29091. </dd>
  29092. <dt><samp>c0_expr</samp></dt>
  29093. <dt><samp>c1_expr</samp></dt>
  29094. <dt><samp>c2_expr</samp></dt>
  29095. <dt><samp>c3_expr</samp></dt>
  29096. <dt><samp>all_expr</samp></dt>
  29097. <dd><p>Set blend expression for specific pixel component or all pixel components in case
  29098. of <var>all_expr</var>. Note that related mode options will be ignored if those are set.
  29099. </p>
  29100. <p>The expressions can use the following variables:
  29101. </p>
  29102. <dl compact="compact">
  29103. <dt><samp>N</samp></dt>
  29104. <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
  29105. </p>
  29106. </dd>
  29107. <dt><samp>X</samp></dt>
  29108. <dt><samp>Y</samp></dt>
  29109. <dd><p>the coordinates of the current sample
  29110. </p>
  29111. </dd>
  29112. <dt><samp>W</samp></dt>
  29113. <dt><samp>H</samp></dt>
  29114. <dd><p>the width and height of currently filtered plane
  29115. </p>
  29116. </dd>
  29117. <dt><samp>SW</samp></dt>
  29118. <dt><samp>SH</samp></dt>
  29119. <dd><p>Width and height scale for the plane being filtered. It is the
  29120. ratio between the dimensions of the current plane to the luma plane,
  29121. e.g. for a <code>yuv420p</code> frame, the values are <code>1,1</code> for
  29122. the luma plane and <code>0.5,0.5</code> for the chroma planes.
  29123. </p>
  29124. </dd>
  29125. <dt><samp>T</samp></dt>
  29126. <dd><p>Time of the current frame, expressed in seconds.
  29127. </p>
  29128. </dd>
  29129. <dt><samp>TOP, A</samp></dt>
  29130. <dd><p>Value of pixel component at current location for first video frame (top layer).
  29131. </p>
  29132. </dd>
  29133. <dt><samp>BOTTOM, B</samp></dt>
  29134. <dd><p>Value of pixel component at current location for second video frame (bottom layer).
  29135. </p></dd>
  29136. </dl>
  29137. </dd>
  29138. </dl>
  29139. <p>The <code>blend</code> filter also supports the <a href="#framesync">framesync</a> options.
  29140. </p>
  29141. <a name="Examples-79"></a>
  29142. <h4 class="subsection">39.13.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-79" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-79" aria-hidden="true">TOC</a></span></h4>
  29143. <ul>
  29144. <li> Apply transition from bottom layer to top layer in first 10 seconds:
  29145. <div class="example">
  29146. <pre class="example">blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
  29147. </pre></div>
  29148. </li><li> Apply linear horizontal transition from top layer to bottom layer:
  29149. <div class="example">
  29150. <pre class="example">blend=all_expr='A*(X/W)+B*(1-X/W)'
  29151. </pre></div>
  29152. </li><li> Apply 1x1 checkerboard effect:
  29153. <div class="example">
  29154. <pre class="example">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
  29155. </pre></div>
  29156. </li><li> Apply uncover left effect:
  29157. <div class="example">
  29158. <pre class="example">blend=all_expr='if(gte(N*SW+X,W),A,B)'
  29159. </pre></div>
  29160. </li><li> Apply uncover down effect:
  29161. <div class="example">
  29162. <pre class="example">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
  29163. </pre></div>
  29164. </li><li> Apply uncover up-left effect:
  29165. <div class="example">
  29166. <pre class="example">blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
  29167. </pre></div>
  29168. </li><li> Split diagonally video and shows top and bottom layer on each side:
  29169. <div class="example">
  29170. <pre class="example">blend=all_expr='if(gt(X,Y*(W/H)),A,B)'
  29171. </pre></div>
  29172. </li><li> Display differences between the current and the previous frame:
  29173. <div class="example">
  29174. <pre class="example">tblend=all_mode=grainextract
  29175. </pre></div>
  29176. </li></ul>
  29177. <a name="Commands-48"></a>
  29178. <h4 class="subsection">39.13.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-48" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-48" aria-hidden="true">TOC</a></span></h4>
  29179. <p>This filter supports same <a href="#commands">commands</a> as options.
  29180. </p>
  29181. <a name="bm3d"></a>
  29182. <h3 class="section">39.14 bm3d<span class="pull-right"><a class="anchor hidden-xs" href="#bm3d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bm3d" aria-hidden="true">TOC</a></span></h3>
  29183. <p>Denoise frames using Block-Matching 3D algorithm.
  29184. </p>
  29185. <p>The filter accepts the following options.
  29186. </p>
  29187. <dl compact="compact">
  29188. <dt><samp>sigma</samp></dt>
  29189. <dd><p>Set denoising strength. Default value is 1.
  29190. Allowed range is from 0 to 999.9.
  29191. The denoising algorithm is very sensitive to sigma, so adjust it
  29192. according to the source.
  29193. </p>
  29194. </dd>
  29195. <dt><samp>block</samp></dt>
  29196. <dd><p>Set local patch size. This sets dimensions in 2D.
  29197. </p>
  29198. </dd>
  29199. <dt><samp>bstep</samp></dt>
  29200. <dd><p>Set sliding step for processing blocks. Default value is 4.
  29201. Allowed range is from 1 to 64.
  29202. Smaller values allows processing more reference blocks and is slower.
  29203. </p>
  29204. </dd>
  29205. <dt><samp>group</samp></dt>
  29206. <dd><p>Set maximal number of similar blocks for 3rd dimension. Default value is 1.
  29207. When set to 1, no block matching is done. Larger values allows more blocks
  29208. in single group.
  29209. Allowed range is from 1 to 256.
  29210. </p>
  29211. </dd>
  29212. <dt><samp>range</samp></dt>
  29213. <dd><p>Set radius for search block matching. Default is 9.
  29214. Allowed range is from 1 to INT32_MAX.
  29215. </p>
  29216. </dd>
  29217. <dt><samp>mstep</samp></dt>
  29218. <dd><p>Set step between two search locations for block matching. Default is 1.
  29219. Allowed range is from 1 to 64. Smaller is slower.
  29220. </p>
  29221. </dd>
  29222. <dt><samp>thmse</samp></dt>
  29223. <dd><p>Set threshold of mean square error for block matching. Valid range is 0 to
  29224. INT32_MAX.
  29225. </p>
  29226. </dd>
  29227. <dt><samp>hdthr</samp></dt>
  29228. <dd><p>Set thresholding parameter for hard thresholding in 3D transformed domain.
  29229. Larger values results in stronger hard-thresholding filtering in frequency
  29230. domain.
  29231. </p>
  29232. </dd>
  29233. <dt><samp>estim</samp></dt>
  29234. <dd><p>Set filtering estimation mode. Can be <code>basic</code> or <code>final</code>.
  29235. Default is <code>basic</code>.
  29236. </p>
  29237. </dd>
  29238. <dt><samp>ref</samp></dt>
  29239. <dd><p>If enabled, filter will use 2nd stream for block matching.
  29240. Default is disabled for <code>basic</code> value of <var>estim</var> option,
  29241. and always enabled if value of <var>estim</var> is <code>final</code>.
  29242. </p>
  29243. </dd>
  29244. <dt><samp>planes</samp></dt>
  29245. <dd><p>Set planes to filter. Default is all available except alpha.
  29246. </p></dd>
  29247. </dl>
  29248. <a name="Examples-80"></a>
  29249. <h4 class="subsection">39.14.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-80" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-80" aria-hidden="true">TOC</a></span></h4>
  29250. <ul>
  29251. <li> Basic filtering with bm3d:
  29252. <div class="example">
  29253. <pre class="example">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic
  29254. </pre></div>
  29255. </li><li> Same as above, but filtering only luma:
  29256. <div class="example">
  29257. <pre class="example">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1
  29258. </pre></div>
  29259. </li><li> Same as above, but with both estimation modes:
  29260. <div class="example">
  29261. <pre class="example">split[a][b],[a]bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
  29262. </pre></div>
  29263. </li><li> Same as above, but prefilter with <a href="#nlmeans">nlmeans</a> filter instead:
  29264. <div class="example">
  29265. <pre class="example">split[a][b],[a]nlmeans=s=3:r=7:p=3[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
  29266. </pre></div>
  29267. </li></ul>
  29268. <a name="boxblur"></a>
  29269. <h3 class="section">39.15 boxblur<span class="pull-right"><a class="anchor hidden-xs" href="#boxblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-boxblur" aria-hidden="true">TOC</a></span></h3>
  29270. <p>Apply a boxblur algorithm to the input video.
  29271. </p>
  29272. <p>It accepts the following parameters:
  29273. </p>
  29274. <dl compact="compact">
  29275. <dt><samp>luma_radius, lr</samp></dt>
  29276. <dt><samp>luma_power, lp</samp></dt>
  29277. <dt><samp>chroma_radius, cr</samp></dt>
  29278. <dt><samp>chroma_power, cp</samp></dt>
  29279. <dt><samp>alpha_radius, ar</samp></dt>
  29280. <dt><samp>alpha_power, ap</samp></dt>
  29281. </dl>
  29282. <p>A description of the accepted options follows.
  29283. </p>
  29284. <dl compact="compact">
  29285. <dt><samp>luma_radius, lr</samp></dt>
  29286. <dt><samp>chroma_radius, cr</samp></dt>
  29287. <dt><samp>alpha_radius, ar</samp></dt>
  29288. <dd><p>Set an expression for the box radius in pixels used for blurring the
  29289. corresponding input plane.
  29290. </p>
  29291. <p>The radius value must be a non-negative number, and must not be
  29292. greater than the value of the expression <code>min(w,h)/2</code> for the
  29293. luma and alpha planes, and of <code>min(cw,ch)/2</code> for the chroma
  29294. planes.
  29295. </p>
  29296. <p>Default value for <samp>luma_radius</samp> is &quot;2&quot;. If not specified,
  29297. <samp>chroma_radius</samp> and <samp>alpha_radius</samp> default to the
  29298. corresponding value set for <samp>luma_radius</samp>.
  29299. </p>
  29300. <p>The expressions can contain the following constants:
  29301. </p><dl compact="compact">
  29302. <dt><samp>w</samp></dt>
  29303. <dt><samp>h</samp></dt>
  29304. <dd><p>The input width and height in pixels.
  29305. </p>
  29306. </dd>
  29307. <dt><samp>cw</samp></dt>
  29308. <dt><samp>ch</samp></dt>
  29309. <dd><p>The input chroma image width and height in pixels.
  29310. </p>
  29311. </dd>
  29312. <dt><samp>hsub</samp></dt>
  29313. <dt><samp>vsub</samp></dt>
  29314. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  29315. pixel format &quot;yuv422p&quot;, <var>hsub</var> is 2 and <var>vsub</var> is 1.
  29316. </p></dd>
  29317. </dl>
  29318. </dd>
  29319. <dt><samp>luma_power, lp</samp></dt>
  29320. <dt><samp>chroma_power, cp</samp></dt>
  29321. <dt><samp>alpha_power, ap</samp></dt>
  29322. <dd><p>Specify how many times the boxblur filter is applied to the
  29323. corresponding plane.
  29324. </p>
  29325. <p>Default value for <samp>luma_power</samp> is 2. If not specified,
  29326. <samp>chroma_power</samp> and <samp>alpha_power</samp> default to the
  29327. corresponding value set for <samp>luma_power</samp>.
  29328. </p>
  29329. <p>A value of 0 will disable the effect.
  29330. </p></dd>
  29331. </dl>
  29332. <a name="Examples-81"></a>
  29333. <h4 class="subsection">39.15.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-81" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-81" aria-hidden="true">TOC</a></span></h4>
  29334. <ul>
  29335. <li> Apply a boxblur filter with the luma, chroma, and alpha radii
  29336. set to 2:
  29337. <div class="example">
  29338. <pre class="example">boxblur=luma_radius=2:luma_power=1
  29339. boxblur=2:1
  29340. </pre></div>
  29341. </li><li> Set the luma radius to 2, and alpha and chroma radius to 0:
  29342. <div class="example">
  29343. <pre class="example">boxblur=2:1:cr=0:ar=0
  29344. </pre></div>
  29345. </li><li> Set the luma and chroma radii to a fraction of the video dimension:
  29346. <div class="example">
  29347. <pre class="example">boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
  29348. </pre></div>
  29349. </li></ul>
  29350. <a name="bwdif"></a>
  29351. <h3 class="section">39.16 bwdif<span class="pull-right"><a class="anchor hidden-xs" href="#bwdif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bwdif" aria-hidden="true">TOC</a></span></h3>
  29352. <p>Deinterlace the input video (&quot;bwdif&quot; stands for &quot;Bob Weaver
  29353. Deinterlacing Filter&quot;).
  29354. </p>
  29355. <p>Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic
  29356. interpolation algorithms.
  29357. It accepts the following parameters:
  29358. </p>
  29359. <dl compact="compact">
  29360. <dt><samp>mode</samp></dt>
  29361. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  29362. </p>
  29363. <dl compact="compact">
  29364. <dt><samp>0, send_frame</samp></dt>
  29365. <dd><p>Output one frame for each frame.
  29366. </p></dd>
  29367. <dt><samp>1, send_field</samp></dt>
  29368. <dd><p>Output one frame for each field.
  29369. </p></dd>
  29370. </dl>
  29371. <p>The default value is <code>send_field</code>.
  29372. </p>
  29373. </dd>
  29374. <dt><samp>parity</samp></dt>
  29375. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  29376. of the following values:
  29377. </p>
  29378. <dl compact="compact">
  29379. <dt><samp>0, tff</samp></dt>
  29380. <dd><p>Assume the top field is first.
  29381. </p></dd>
  29382. <dt><samp>1, bff</samp></dt>
  29383. <dd><p>Assume the bottom field is first.
  29384. </p></dd>
  29385. <dt><samp>-1, auto</samp></dt>
  29386. <dd><p>Enable automatic detection of field parity.
  29387. </p></dd>
  29388. </dl>
  29389. <p>The default value is <code>auto</code>.
  29390. If the interlacing is unknown or the decoder does not export this information,
  29391. top field first will be assumed.
  29392. </p>
  29393. </dd>
  29394. <dt><samp>deint</samp></dt>
  29395. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  29396. values:
  29397. </p>
  29398. <dl compact="compact">
  29399. <dt><samp>0, all</samp></dt>
  29400. <dd><p>Deinterlace all frames.
  29401. </p></dd>
  29402. <dt><samp>1, interlaced</samp></dt>
  29403. <dd><p>Only deinterlace frames marked as interlaced.
  29404. </p></dd>
  29405. </dl>
  29406. <p>The default value is <code>all</code>.
  29407. </p></dd>
  29408. </dl>
  29409. <a name="cas"></a>
  29410. <h3 class="section">39.17 cas<span class="pull-right"><a class="anchor hidden-xs" href="#cas" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cas" aria-hidden="true">TOC</a></span></h3>
  29411. <p>Apply Contrast Adaptive Sharpen filter to video stream.
  29412. </p>
  29413. <p>The filter accepts the following options:
  29414. </p>
  29415. <dl compact="compact">
  29416. <dt><samp>strength</samp></dt>
  29417. <dd><p>Set the sharpening strength. Default value is 0.
  29418. </p>
  29419. </dd>
  29420. <dt><samp>planes</samp></dt>
  29421. <dd><p>Set planes to filter. Default value is to filter all
  29422. planes except alpha plane.
  29423. </p></dd>
  29424. </dl>
  29425. <a name="Commands-49"></a>
  29426. <h4 class="subsection">39.17.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-49" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-49" aria-hidden="true">TOC</a></span></h4>
  29427. <p>This filter supports same <a href="#commands">commands</a> as options.
  29428. </p>
  29429. <a name="chromahold"></a>
  29430. <h3 class="section">39.18 chromahold<span class="pull-right"><a class="anchor hidden-xs" href="#chromahold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromahold" aria-hidden="true">TOC</a></span></h3>
  29431. <p>Remove all color information for all colors except for certain one.
  29432. </p>
  29433. <p>The filter accepts the following options:
  29434. </p>
  29435. <dl compact="compact">
  29436. <dt><samp>color</samp></dt>
  29437. <dd><p>The color which will not be replaced with neutral chroma.
  29438. </p>
  29439. </dd>
  29440. <dt><samp>similarity</samp></dt>
  29441. <dd><p>Similarity percentage with the above color.
  29442. 0.01 matches only the exact key color, while 1.0 matches everything.
  29443. </p>
  29444. </dd>
  29445. <dt><samp>blend</samp></dt>
  29446. <dd><p>Blend percentage.
  29447. 0.0 makes pixels either fully gray, or not gray at all.
  29448. Higher values result in more preserved color.
  29449. </p>
  29450. </dd>
  29451. <dt><samp>yuv</samp></dt>
  29452. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  29453. </p>
  29454. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  29455. This can be used to pass exact YUV values as hexadecimal numbers.
  29456. </p></dd>
  29457. </dl>
  29458. <a name="Commands-50"></a>
  29459. <h4 class="subsection">39.18.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-50" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-50" aria-hidden="true">TOC</a></span></h4>
  29460. <p>This filter supports same <a href="#commands">commands</a> as options.
  29461. The command accepts the same syntax of the corresponding option.
  29462. </p>
  29463. <p>If the specified expression is not valid, it is kept at its current
  29464. value.
  29465. </p>
  29466. <a name="chromakey"></a>
  29467. <h3 class="section">39.19 chromakey<span class="pull-right"><a class="anchor hidden-xs" href="#chromakey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromakey" aria-hidden="true">TOC</a></span></h3>
  29468. <p>YUV colorspace color/chroma keying.
  29469. </p>
  29470. <p>The filter accepts the following options:
  29471. </p>
  29472. <dl compact="compact">
  29473. <dt><samp>color</samp></dt>
  29474. <dd><p>The color which will be replaced with transparency.
  29475. </p>
  29476. </dd>
  29477. <dt><samp>similarity</samp></dt>
  29478. <dd><p>Similarity percentage with the key color.
  29479. </p>
  29480. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  29481. </p>
  29482. </dd>
  29483. <dt><samp>blend</samp></dt>
  29484. <dd><p>Blend percentage.
  29485. </p>
  29486. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  29487. </p>
  29488. <p>Higher values result in semi-transparent pixels, with a higher transparency
  29489. the more similar the pixels color is to the key color.
  29490. </p>
  29491. </dd>
  29492. <dt><samp>yuv</samp></dt>
  29493. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  29494. </p>
  29495. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  29496. This can be used to pass exact YUV values as hexadecimal numbers.
  29497. </p></dd>
  29498. </dl>
  29499. <a name="Commands-51"></a>
  29500. <h4 class="subsection">39.19.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-51" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-51" aria-hidden="true">TOC</a></span></h4>
  29501. <p>This filter supports same <a href="#commands">commands</a> as options.
  29502. The command accepts the same syntax of the corresponding option.
  29503. </p>
  29504. <p>If the specified expression is not valid, it is kept at its current
  29505. value.
  29506. </p>
  29507. <a name="Examples-82"></a>
  29508. <h4 class="subsection">39.19.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-82" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-82" aria-hidden="true">TOC</a></span></h4>
  29509. <ul>
  29510. <li> Make every green pixel in the input image transparent:
  29511. <div class="example">
  29512. <pre class="example">ffmpeg -i input.png -vf chromakey=green out.png
  29513. </pre></div>
  29514. </li><li> Overlay a greenscreen-video on top of a static black background.
  29515. <div class="example">
  29516. <pre class="example">ffmpeg -f lavfi -i color=c=black:s=1280x720 -i video.mp4 -shortest -filter_complex &quot;[1:v]chromakey=0x70de77:0.1:0.2[ckout];[0:v][ckout]overlay[out]&quot; -map &quot;[out]&quot; output.mkv
  29517. </pre></div>
  29518. </li></ul>
  29519. <a name="chromanr"></a>
  29520. <h3 class="section">39.20 chromanr<span class="pull-right"><a class="anchor hidden-xs" href="#chromanr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromanr" aria-hidden="true">TOC</a></span></h3>
  29521. <p>Reduce chrominance noise.
  29522. </p>
  29523. <p>The filter accepts the following options:
  29524. </p>
  29525. <dl compact="compact">
  29526. <dt><samp>thres</samp></dt>
  29527. <dd><p>Set threshold for averaging chrominance values.
  29528. Sum of absolute difference of Y, U and V pixel components of current
  29529. pixel and neighbour pixels lower than this threshold will be used in
  29530. averaging. Luma component is left unchanged and is copied to output.
  29531. Default value is 30. Allowed range is from 1 to 200.
  29532. </p>
  29533. </dd>
  29534. <dt><samp>sizew</samp></dt>
  29535. <dd><p>Set horizontal radius of rectangle used for averaging.
  29536. Allowed range is from 1 to 100. Default value is 5.
  29537. </p>
  29538. </dd>
  29539. <dt><samp>sizeh</samp></dt>
  29540. <dd><p>Set vertical radius of rectangle used for averaging.
  29541. Allowed range is from 1 to 100. Default value is 5.
  29542. </p>
  29543. </dd>
  29544. <dt><samp>stepw</samp></dt>
  29545. <dd><p>Set horizontal step when averaging. Default value is 1.
  29546. Allowed range is from 1 to 50.
  29547. Mostly useful to speed-up filtering.
  29548. </p>
  29549. </dd>
  29550. <dt><samp>steph</samp></dt>
  29551. <dd><p>Set vertical step when averaging. Default value is 1.
  29552. Allowed range is from 1 to 50.
  29553. Mostly useful to speed-up filtering.
  29554. </p>
  29555. </dd>
  29556. <dt><samp>threy</samp></dt>
  29557. <dd><p>Set Y threshold for averaging chrominance values.
  29558. Set finer control for max allowed difference between Y components
  29559. of current pixel and neigbour pixels.
  29560. Default value is 200. Allowed range is from 1 to 200.
  29561. </p>
  29562. </dd>
  29563. <dt><samp>threu</samp></dt>
  29564. <dd><p>Set U threshold for averaging chrominance values.
  29565. Set finer control for max allowed difference between U components
  29566. of current pixel and neigbour pixels.
  29567. Default value is 200. Allowed range is from 1 to 200.
  29568. </p>
  29569. </dd>
  29570. <dt><samp>threv</samp></dt>
  29571. <dd><p>Set V threshold for averaging chrominance values.
  29572. Set finer control for max allowed difference between V components
  29573. of current pixel and neigbour pixels.
  29574. Default value is 200. Allowed range is from 1 to 200.
  29575. </p></dd>
  29576. </dl>
  29577. <a name="Commands-52"></a>
  29578. <h4 class="subsection">39.20.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-52" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-52" aria-hidden="true">TOC</a></span></h4>
  29579. <p>This filter supports same <a href="#commands">commands</a> as options.
  29580. The command accepts the same syntax of the corresponding option.
  29581. </p>
  29582. <a name="chromashift"></a>
  29583. <h3 class="section">39.21 chromashift<span class="pull-right"><a class="anchor hidden-xs" href="#chromashift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromashift" aria-hidden="true">TOC</a></span></h3>
  29584. <p>Shift chroma pixels horizontally and/or vertically.
  29585. </p>
  29586. <p>The filter accepts the following options:
  29587. </p><dl compact="compact">
  29588. <dt><samp>cbh</samp></dt>
  29589. <dd><p>Set amount to shift chroma-blue horizontally.
  29590. </p></dd>
  29591. <dt><samp>cbv</samp></dt>
  29592. <dd><p>Set amount to shift chroma-blue vertically.
  29593. </p></dd>
  29594. <dt><samp>crh</samp></dt>
  29595. <dd><p>Set amount to shift chroma-red horizontally.
  29596. </p></dd>
  29597. <dt><samp>crv</samp></dt>
  29598. <dd><p>Set amount to shift chroma-red vertically.
  29599. </p></dd>
  29600. <dt><samp>edge</samp></dt>
  29601. <dd><p>Set edge mode, can be <var>smear</var>, default, or <var>warp</var>.
  29602. </p></dd>
  29603. </dl>
  29604. <a name="Commands-53"></a>
  29605. <h4 class="subsection">39.21.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-53" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-53" aria-hidden="true">TOC</a></span></h4>
  29606. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  29607. </p>
  29608. <a name="ciescope"></a>
  29609. <h3 class="section">39.22 ciescope<span class="pull-right"><a class="anchor hidden-xs" href="#ciescope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ciescope" aria-hidden="true">TOC</a></span></h3>
  29610. <p>Display CIE color diagram with pixels overlaid onto it.
  29611. </p>
  29612. <p>The filter accepts the following options:
  29613. </p>
  29614. <dl compact="compact">
  29615. <dt><samp>system</samp></dt>
  29616. <dd><p>Set color system.
  29617. </p>
  29618. <dl compact="compact">
  29619. <dt>&lsquo;<samp>ntsc, 470m</samp>&rsquo;</dt>
  29620. <dt>&lsquo;<samp>ebu, 470bg</samp>&rsquo;</dt>
  29621. <dt>&lsquo;<samp>smpte</samp>&rsquo;</dt>
  29622. <dt>&lsquo;<samp>240m</samp>&rsquo;</dt>
  29623. <dt>&lsquo;<samp>apple</samp>&rsquo;</dt>
  29624. <dt>&lsquo;<samp>widergb</samp>&rsquo;</dt>
  29625. <dt>&lsquo;<samp>cie1931</samp>&rsquo;</dt>
  29626. <dt>&lsquo;<samp>rec709, hdtv</samp>&rsquo;</dt>
  29627. <dt>&lsquo;<samp>uhdtv, rec2020</samp>&rsquo;</dt>
  29628. <dt>&lsquo;<samp>dcip3</samp>&rsquo;</dt>
  29629. </dl>
  29630. </dd>
  29631. <dt><samp>cie</samp></dt>
  29632. <dd><p>Set CIE system.
  29633. </p>
  29634. <dl compact="compact">
  29635. <dt>&lsquo;<samp>xyy</samp>&rsquo;</dt>
  29636. <dt>&lsquo;<samp>ucs</samp>&rsquo;</dt>
  29637. <dt>&lsquo;<samp>luv</samp>&rsquo;</dt>
  29638. </dl>
  29639. </dd>
  29640. <dt><samp>gamuts</samp></dt>
  29641. <dd><p>Set what gamuts to draw.
  29642. </p>
  29643. <p>See <code>system</code> option for available values.
  29644. </p>
  29645. </dd>
  29646. <dt><samp>size, s</samp></dt>
  29647. <dd><p>Set ciescope size, by default set to 512.
  29648. </p>
  29649. </dd>
  29650. <dt><samp>intensity, i</samp></dt>
  29651. <dd><p>Set intensity used to map input pixel values to CIE diagram.
  29652. </p>
  29653. </dd>
  29654. <dt><samp>contrast</samp></dt>
  29655. <dd><p>Set contrast used to draw tongue colors that are out of active color system gamut.
  29656. </p>
  29657. </dd>
  29658. <dt><samp>corrgamma</samp></dt>
  29659. <dd><p>Correct gamma displayed on scope, by default enabled.
  29660. </p>
  29661. </dd>
  29662. <dt><samp>showwhite</samp></dt>
  29663. <dd><p>Show white point on CIE diagram, by default disabled.
  29664. </p>
  29665. </dd>
  29666. <dt><samp>gamma</samp></dt>
  29667. <dd><p>Set input gamma. Used only with XYZ input color space.
  29668. </p></dd>
  29669. </dl>
  29670. <a name="codecview"></a>
  29671. <h3 class="section">39.23 codecview<span class="pull-right"><a class="anchor hidden-xs" href="#codecview" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-codecview" aria-hidden="true">TOC</a></span></h3>
  29672. <p>Visualize information exported by some codecs.
  29673. </p>
  29674. <p>Some codecs can export information through frames using side-data or other
  29675. means. For example, some MPEG based codecs export motion vectors through the
  29676. <var>export_mvs</var> flag in the codec <samp>flags2</samp> option.
  29677. </p>
  29678. <p>The filter accepts the following option:
  29679. </p>
  29680. <dl compact="compact">
  29681. <dt><samp>mv</samp></dt>
  29682. <dd><p>Set motion vectors to visualize.
  29683. </p>
  29684. <p>Available flags for <var>mv</var> are:
  29685. </p>
  29686. <dl compact="compact">
  29687. <dt>&lsquo;<samp>pf</samp>&rsquo;</dt>
  29688. <dd><p>forward predicted MVs of P-frames
  29689. </p></dd>
  29690. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  29691. <dd><p>forward predicted MVs of B-frames
  29692. </p></dd>
  29693. <dt>&lsquo;<samp>bb</samp>&rsquo;</dt>
  29694. <dd><p>backward predicted MVs of B-frames
  29695. </p></dd>
  29696. </dl>
  29697. </dd>
  29698. <dt><samp>qp</samp></dt>
  29699. <dd><p>Display quantization parameters using the chroma planes.
  29700. </p>
  29701. </dd>
  29702. <dt><samp>mv_type, mvt</samp></dt>
  29703. <dd><p>Set motion vectors type to visualize. Includes MVs from all frames unless specified by <var>frame_type</var> option.
  29704. </p>
  29705. <p>Available flags for <var>mv_type</var> are:
  29706. </p>
  29707. <dl compact="compact">
  29708. <dt>&lsquo;<samp>fp</samp>&rsquo;</dt>
  29709. <dd><p>forward predicted MVs
  29710. </p></dd>
  29711. <dt>&lsquo;<samp>bp</samp>&rsquo;</dt>
  29712. <dd><p>backward predicted MVs
  29713. </p></dd>
  29714. </dl>
  29715. </dd>
  29716. <dt><samp>frame_type, ft</samp></dt>
  29717. <dd><p>Set frame type to visualize motion vectors of.
  29718. </p>
  29719. <p>Available flags for <var>frame_type</var> are:
  29720. </p>
  29721. <dl compact="compact">
  29722. <dt>&lsquo;<samp>if</samp>&rsquo;</dt>
  29723. <dd><p>intra-coded frames (I-frames)
  29724. </p></dd>
  29725. <dt>&lsquo;<samp>pf</samp>&rsquo;</dt>
  29726. <dd><p>predicted frames (P-frames)
  29727. </p></dd>
  29728. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  29729. <dd><p>bi-directionally predicted frames (B-frames)
  29730. </p></dd>
  29731. </dl>
  29732. </dd>
  29733. </dl>
  29734. <a name="Examples-83"></a>
  29735. <h4 class="subsection">39.23.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-83" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-83" aria-hidden="true">TOC</a></span></h4>
  29736. <ul>
  29737. <li> Visualize forward predicted MVs of all frames using <code>ffplay</code>:
  29738. <div class="example">
  29739. <pre class="example">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp
  29740. </pre></div>
  29741. </li><li> Visualize multi-directionals MVs of P and B-Frames using <code>ffplay</code>:
  29742. <div class="example">
  29743. <pre class="example">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
  29744. </pre></div>
  29745. </li></ul>
  29746. <a name="colorbalance"></a>
  29747. <h3 class="section">39.24 colorbalance<span class="pull-right"><a class="anchor hidden-xs" href="#colorbalance" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorbalance" aria-hidden="true">TOC</a></span></h3>
  29748. <p>Modify intensity of primary colors (red, green and blue) of input frames.
  29749. </p>
  29750. <p>The filter allows an input frame to be adjusted in the shadows, midtones or highlights
  29751. regions for the red-cyan, green-magenta or blue-yellow balance.
  29752. </p>
  29753. <p>A positive adjustment value shifts the balance towards the primary color, a negative
  29754. value towards the complementary color.
  29755. </p>
  29756. <p>The filter accepts the following options:
  29757. </p>
  29758. <dl compact="compact">
  29759. <dt><samp>rs</samp></dt>
  29760. <dt><samp>gs</samp></dt>
  29761. <dt><samp>bs</samp></dt>
  29762. <dd><p>Adjust red, green and blue shadows (darkest pixels).
  29763. </p>
  29764. </dd>
  29765. <dt><samp>rm</samp></dt>
  29766. <dt><samp>gm</samp></dt>
  29767. <dt><samp>bm</samp></dt>
  29768. <dd><p>Adjust red, green and blue midtones (medium pixels).
  29769. </p>
  29770. </dd>
  29771. <dt><samp>rh</samp></dt>
  29772. <dt><samp>gh</samp></dt>
  29773. <dt><samp>bh</samp></dt>
  29774. <dd><p>Adjust red, green and blue highlights (brightest pixels).
  29775. </p>
  29776. <p>Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
  29777. </p>
  29778. </dd>
  29779. <dt><samp>pl</samp></dt>
  29780. <dd><p>Preserve lightness when changing color balance. Default is disabled.
  29781. </p></dd>
  29782. </dl>
  29783. <a name="Examples-84"></a>
  29784. <h4 class="subsection">39.24.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-84" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-84" aria-hidden="true">TOC</a></span></h4>
  29785. <ul>
  29786. <li> Add red color cast to shadows:
  29787. <div class="example">
  29788. <pre class="example">colorbalance=rs=.3
  29789. </pre></div>
  29790. </li></ul>
  29791. <a name="Commands-54"></a>
  29792. <h4 class="subsection">39.24.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-54" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-54" aria-hidden="true">TOC</a></span></h4>
  29793. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  29794. </p>
  29795. <a name="colorcontrast"></a>
  29796. <h3 class="section">39.25 colorcontrast<span class="pull-right"><a class="anchor hidden-xs" href="#colorcontrast" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorcontrast" aria-hidden="true">TOC</a></span></h3>
  29797. <p>Adjust color contrast between RGB components.
  29798. </p>
  29799. <p>The filter accepts the following options:
  29800. </p>
  29801. <dl compact="compact">
  29802. <dt><samp>rc</samp></dt>
  29803. <dd><p>Set the red-cyan contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  29804. </p>
  29805. </dd>
  29806. <dt><samp>gm</samp></dt>
  29807. <dd><p>Set the green-magenta contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  29808. </p>
  29809. </dd>
  29810. <dt><samp>by</samp></dt>
  29811. <dd><p>Set the blue-yellow contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  29812. </p>
  29813. </dd>
  29814. <dt><samp>rcw</samp></dt>
  29815. <dt><samp>gmw</samp></dt>
  29816. <dt><samp>byw</samp></dt>
  29817. <dd><p>Set the weight of each <code>rc</code>, <code>gm</code>, <code>by</code> option value. Default value is 0.0.
  29818. Allowed range is from 0.0 to 1.0. If all weights are 0.0 filtering is disabled.
  29819. </p>
  29820. </dd>
  29821. <dt><samp>pl</samp></dt>
  29822. <dd><p>Set the amount of preserving lightness. Default value is 0.0. Allowed range is from 0.0 to 1.0.
  29823. </p></dd>
  29824. </dl>
  29825. <a name="Commands-55"></a>
  29826. <h4 class="subsection">39.25.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-55" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-55" aria-hidden="true">TOC</a></span></h4>
  29827. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  29828. </p>
  29829. <a name="colorcorrect"></a>
  29830. <h3 class="section">39.26 colorcorrect<span class="pull-right"><a class="anchor hidden-xs" href="#colorcorrect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorcorrect" aria-hidden="true">TOC</a></span></h3>
  29831. <p>Adjust color white balance selectively for blacks and whites.
  29832. This filter operates in YUV colorspace.
  29833. </p>
  29834. <p>The filter accepts the following options:
  29835. </p>
  29836. <dl compact="compact">
  29837. <dt><samp>rl</samp></dt>
  29838. <dd><p>Set the red shadow spot. Allowed range is from -1.0 to 1.0.
  29839. Default value is 0.
  29840. </p>
  29841. </dd>
  29842. <dt><samp>bl</samp></dt>
  29843. <dd><p>Set the blue shadow spot. Allowed range is from -1.0 to 1.0.
  29844. Default value is 0.
  29845. </p>
  29846. </dd>
  29847. <dt><samp>rh</samp></dt>
  29848. <dd><p>Set the red highlight spot. Allowed range is from -1.0 to 1.0.
  29849. Default value is 0.
  29850. </p>
  29851. </dd>
  29852. <dt><samp>bh</samp></dt>
  29853. <dd><p>Set the red highlight spot. Allowed range is from -1.0 to 1.0.
  29854. Default value is 0.
  29855. </p>
  29856. </dd>
  29857. <dt><samp>saturation</samp></dt>
  29858. <dd><p>Set the amount of saturation. Allowed range is from -3.0 to 3.0.
  29859. Default value is 1.
  29860. </p></dd>
  29861. </dl>
  29862. <a name="Commands-56"></a>
  29863. <h4 class="subsection">39.26.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-56" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-56" aria-hidden="true">TOC</a></span></h4>
  29864. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  29865. </p>
  29866. <a name="colorchannelmixer"></a>
  29867. <h3 class="section">39.27 colorchannelmixer<span class="pull-right"><a class="anchor hidden-xs" href="#colorchannelmixer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorchannelmixer" aria-hidden="true">TOC</a></span></h3>
  29868. <p>Adjust video input frames by re-mixing color channels.
  29869. </p>
  29870. <p>This filter modifies a color channel by adding the values associated to
  29871. the other channels of the same pixels. For example if the value to
  29872. modify is red, the output value will be:
  29873. </p><div class="example">
  29874. <pre class="example"><var>red</var>=<var>red</var>*<var>rr</var> + <var>blue</var>*<var>rb</var> + <var>green</var>*<var>rg</var> + <var>alpha</var>*<var>ra</var>
  29875. </pre></div>
  29876. <p>The filter accepts the following options:
  29877. </p>
  29878. <dl compact="compact">
  29879. <dt><samp>rr</samp></dt>
  29880. <dt><samp>rg</samp></dt>
  29881. <dt><samp>rb</samp></dt>
  29882. <dt><samp>ra</samp></dt>
  29883. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output red channel.
  29884. Default is <code>1</code> for <var>rr</var>, and <code>0</code> for <var>rg</var>, <var>rb</var> and <var>ra</var>.
  29885. </p>
  29886. </dd>
  29887. <dt><samp>gr</samp></dt>
  29888. <dt><samp>gg</samp></dt>
  29889. <dt><samp>gb</samp></dt>
  29890. <dt><samp>ga</samp></dt>
  29891. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output green channel.
  29892. Default is <code>1</code> for <var>gg</var>, and <code>0</code> for <var>gr</var>, <var>gb</var> and <var>ga</var>.
  29893. </p>
  29894. </dd>
  29895. <dt><samp>br</samp></dt>
  29896. <dt><samp>bg</samp></dt>
  29897. <dt><samp>bb</samp></dt>
  29898. <dt><samp>ba</samp></dt>
  29899. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output blue channel.
  29900. Default is <code>1</code> for <var>bb</var>, and <code>0</code> for <var>br</var>, <var>bg</var> and <var>ba</var>.
  29901. </p>
  29902. </dd>
  29903. <dt><samp>ar</samp></dt>
  29904. <dt><samp>ag</samp></dt>
  29905. <dt><samp>ab</samp></dt>
  29906. <dt><samp>aa</samp></dt>
  29907. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
  29908. Default is <code>1</code> for <var>aa</var>, and <code>0</code> for <var>ar</var>, <var>ag</var> and <var>ab</var>.
  29909. </p>
  29910. <p>Allowed ranges for options are <code>[-2.0, 2.0]</code>.
  29911. </p>
  29912. </dd>
  29913. <dt><samp>pl</samp></dt>
  29914. <dd><p>Preserve lightness when changing colors. Allowed range is from <code>[0.0, 1.0]</code>.
  29915. Default is <code>0.0</code>, thus disabled.
  29916. </p></dd>
  29917. </dl>
  29918. <a name="Examples-85"></a>
  29919. <h4 class="subsection">39.27.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-85" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-85" aria-hidden="true">TOC</a></span></h4>
  29920. <ul>
  29921. <li> Convert source to grayscale:
  29922. <div class="example">
  29923. <pre class="example">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
  29924. </pre></div>
  29925. </li><li> Simulate sepia tones:
  29926. <div class="example">
  29927. <pre class="example">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
  29928. </pre></div>
  29929. </li></ul>
  29930. <a name="Commands-57"></a>
  29931. <h4 class="subsection">39.27.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-57" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-57" aria-hidden="true">TOC</a></span></h4>
  29932. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  29933. </p>
  29934. <a name="colorize"></a>
  29935. <h3 class="section">39.28 colorize<span class="pull-right"><a class="anchor hidden-xs" href="#colorize" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorize" aria-hidden="true">TOC</a></span></h3>
  29936. <p>Overlay a solid color on the video stream.
  29937. </p>
  29938. <p>The filter accepts the following options:
  29939. </p>
  29940. <dl compact="compact">
  29941. <dt><samp>hue</samp></dt>
  29942. <dd><p>Set the color hue. Allowed range is from 0 to 360.
  29943. Default value is 0.
  29944. </p>
  29945. </dd>
  29946. <dt><samp>saturation</samp></dt>
  29947. <dd><p>Set the color saturation. Allowed range is from 0 to 1.
  29948. Default value is 0.5.
  29949. </p>
  29950. </dd>
  29951. <dt><samp>lightness</samp></dt>
  29952. <dd><p>Set the color lightness. Allowed range is from 0 to 1.
  29953. Default value is 0.5.
  29954. </p>
  29955. </dd>
  29956. <dt><samp>mix</samp></dt>
  29957. <dd><p>Set the mix of source lightness. By default is set to 1.0.
  29958. Allowed range is from 0.0 to 1.0.
  29959. </p></dd>
  29960. </dl>
  29961. <a name="Commands-58"></a>
  29962. <h4 class="subsection">39.28.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-58" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-58" aria-hidden="true">TOC</a></span></h4>
  29963. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  29964. </p>
  29965. <a name="colorkey"></a>
  29966. <h3 class="section">39.29 colorkey<span class="pull-right"><a class="anchor hidden-xs" href="#colorkey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorkey" aria-hidden="true">TOC</a></span></h3>
  29967. <p>RGB colorspace color keying.
  29968. </p>
  29969. <p>The filter accepts the following options:
  29970. </p>
  29971. <dl compact="compact">
  29972. <dt><samp>color</samp></dt>
  29973. <dd><p>The color which will be replaced with transparency.
  29974. </p>
  29975. </dd>
  29976. <dt><samp>similarity</samp></dt>
  29977. <dd><p>Similarity percentage with the key color.
  29978. </p>
  29979. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  29980. </p>
  29981. </dd>
  29982. <dt><samp>blend</samp></dt>
  29983. <dd><p>Blend percentage.
  29984. </p>
  29985. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  29986. </p>
  29987. <p>Higher values result in semi-transparent pixels, with a higher transparency
  29988. the more similar the pixels color is to the key color.
  29989. </p></dd>
  29990. </dl>
  29991. <a name="Examples-86"></a>
  29992. <h4 class="subsection">39.29.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-86" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-86" aria-hidden="true">TOC</a></span></h4>
  29993. <ul>
  29994. <li> Make every green pixel in the input image transparent:
  29995. <div class="example">
  29996. <pre class="example">ffmpeg -i input.png -vf colorkey=green out.png
  29997. </pre></div>
  29998. </li><li> Overlay a greenscreen-video on top of a static background image.
  29999. <div class="example">
  30000. <pre class="example">ffmpeg -i background.png -i video.mp4 -filter_complex &quot;[1:v]colorkey=0x3BBD1E:0.3:0.2[ckout];[0:v][ckout]overlay[out]&quot; -map &quot;[out]&quot; output.flv
  30001. </pre></div>
  30002. </li></ul>
  30003. <a name="Commands-59"></a>
  30004. <h4 class="subsection">39.29.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-59" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-59" aria-hidden="true">TOC</a></span></h4>
  30005. <p>This filter supports same <a href="#commands">commands</a> as options.
  30006. The command accepts the same syntax of the corresponding option.
  30007. </p>
  30008. <p>If the specified expression is not valid, it is kept at its current
  30009. value.
  30010. </p>
  30011. <a name="colorhold"></a>
  30012. <h3 class="section">39.30 colorhold<span class="pull-right"><a class="anchor hidden-xs" href="#colorhold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorhold" aria-hidden="true">TOC</a></span></h3>
  30013. <p>Remove all color information for all RGB colors except for certain one.
  30014. </p>
  30015. <p>The filter accepts the following options:
  30016. </p>
  30017. <dl compact="compact">
  30018. <dt><samp>color</samp></dt>
  30019. <dd><p>The color which will not be replaced with neutral gray.
  30020. </p>
  30021. </dd>
  30022. <dt><samp>similarity</samp></dt>
  30023. <dd><p>Similarity percentage with the above color.
  30024. 0.01 matches only the exact key color, while 1.0 matches everything.
  30025. </p>
  30026. </dd>
  30027. <dt><samp>blend</samp></dt>
  30028. <dd><p>Blend percentage. 0.0 makes pixels fully gray.
  30029. Higher values result in more preserved color.
  30030. </p></dd>
  30031. </dl>
  30032. <a name="Commands-60"></a>
  30033. <h4 class="subsection">39.30.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-60" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-60" aria-hidden="true">TOC</a></span></h4>
  30034. <p>This filter supports same <a href="#commands">commands</a> as options.
  30035. The command accepts the same syntax of the corresponding option.
  30036. </p>
  30037. <p>If the specified expression is not valid, it is kept at its current
  30038. value.
  30039. </p>
  30040. <a name="colorlevels"></a>
  30041. <h3 class="section">39.31 colorlevels<span class="pull-right"><a class="anchor hidden-xs" href="#colorlevels" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorlevels" aria-hidden="true">TOC</a></span></h3>
  30042. <p>Adjust video input frames using levels.
  30043. </p>
  30044. <p>The filter accepts the following options:
  30045. </p>
  30046. <dl compact="compact">
  30047. <dt><samp>rimin</samp></dt>
  30048. <dt><samp>gimin</samp></dt>
  30049. <dt><samp>bimin</samp></dt>
  30050. <dt><samp>aimin</samp></dt>
  30051. <dd><p>Adjust red, green, blue and alpha input black point.
  30052. Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
  30053. </p>
  30054. </dd>
  30055. <dt><samp>rimax</samp></dt>
  30056. <dt><samp>gimax</samp></dt>
  30057. <dt><samp>bimax</samp></dt>
  30058. <dt><samp>aimax</samp></dt>
  30059. <dd><p>Adjust red, green, blue and alpha input white point.
  30060. Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>1</code>.
  30061. </p>
  30062. <p>Input levels are used to lighten highlights (bright tones), darken shadows
  30063. (dark tones), change the balance of bright and dark tones.
  30064. </p>
  30065. </dd>
  30066. <dt><samp>romin</samp></dt>
  30067. <dt><samp>gomin</samp></dt>
  30068. <dt><samp>bomin</samp></dt>
  30069. <dt><samp>aomin</samp></dt>
  30070. <dd><p>Adjust red, green, blue and alpha output black point.
  30071. Allowed ranges for options are <code>[0, 1.0]</code>. Defaults are <code>0</code>.
  30072. </p>
  30073. </dd>
  30074. <dt><samp>romax</samp></dt>
  30075. <dt><samp>gomax</samp></dt>
  30076. <dt><samp>bomax</samp></dt>
  30077. <dt><samp>aomax</samp></dt>
  30078. <dd><p>Adjust red, green, blue and alpha output white point.
  30079. Allowed ranges for options are <code>[0, 1.0]</code>. Defaults are <code>1</code>.
  30080. </p>
  30081. <p>Output levels allows manual selection of a constrained output level range.
  30082. </p></dd>
  30083. </dl>
  30084. <a name="Examples-87"></a>
  30085. <h4 class="subsection">39.31.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-87" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-87" aria-hidden="true">TOC</a></span></h4>
  30086. <ul>
  30087. <li> Make video output darker:
  30088. <div class="example">
  30089. <pre class="example">colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
  30090. </pre></div>
  30091. </li><li> Increase contrast:
  30092. <div class="example">
  30093. <pre class="example">colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
  30094. </pre></div>
  30095. </li><li> Make video output lighter:
  30096. <div class="example">
  30097. <pre class="example">colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
  30098. </pre></div>
  30099. </li><li> Increase brightness:
  30100. <div class="example">
  30101. <pre class="example">colorlevels=romin=0.5:gomin=0.5:bomin=0.5
  30102. </pre></div>
  30103. </li></ul>
  30104. <a name="Commands-61"></a>
  30105. <h4 class="subsection">39.31.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-61" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-61" aria-hidden="true">TOC</a></span></h4>
  30106. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  30107. </p>
  30108. <a name="colormatrix"></a>
  30109. <h3 class="section">39.32 colormatrix<span class="pull-right"><a class="anchor hidden-xs" href="#colormatrix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colormatrix" aria-hidden="true">TOC</a></span></h3>
  30110. <p>Convert color matrix.
  30111. </p>
  30112. <p>The filter accepts the following options:
  30113. </p>
  30114. <dl compact="compact">
  30115. <dt><samp>src</samp></dt>
  30116. <dt><samp>dst</samp></dt>
  30117. <dd><p>Specify the source and destination color matrix. Both values must be
  30118. specified.
  30119. </p>
  30120. <p>The accepted values are:
  30121. </p><dl compact="compact">
  30122. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  30123. <dd><p>BT.709
  30124. </p>
  30125. </dd>
  30126. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  30127. <dd><p>FCC
  30128. </p>
  30129. </dd>
  30130. <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
  30131. <dd><p>BT.601
  30132. </p>
  30133. </dd>
  30134. <dt>&lsquo;<samp>bt470</samp>&rsquo;</dt>
  30135. <dd><p>BT.470
  30136. </p>
  30137. </dd>
  30138. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  30139. <dd><p>BT.470BG
  30140. </p>
  30141. </dd>
  30142. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  30143. <dd><p>SMPTE-170M
  30144. </p>
  30145. </dd>
  30146. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  30147. <dd><p>SMPTE-240M
  30148. </p>
  30149. </dd>
  30150. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  30151. <dd><p>BT.2020
  30152. </p></dd>
  30153. </dl>
  30154. </dd>
  30155. </dl>
  30156. <p>For example to convert from BT.601 to SMPTE-240M, use the command:
  30157. </p><div class="example">
  30158. <pre class="example">colormatrix=bt601:smpte240m
  30159. </pre></div>
  30160. <a name="colorspace"></a>
  30161. <h3 class="section">39.33 colorspace<span class="pull-right"><a class="anchor hidden-xs" href="#colorspace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorspace" aria-hidden="true">TOC</a></span></h3>
  30162. <p>Convert colorspace, transfer characteristics or color primaries.
  30163. Input video needs to have an even size.
  30164. </p>
  30165. <p>The filter accepts the following options:
  30166. </p>
  30167. <dl compact="compact">
  30168. <dd><span id="all"></span></dd>
  30169. <dt><samp>all</samp></dt>
  30170. <dd><p>Specify all color properties at once.
  30171. </p>
  30172. <p>The accepted values are:
  30173. </p><dl compact="compact">
  30174. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  30175. <dd><p>BT.470M
  30176. </p>
  30177. </dd>
  30178. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  30179. <dd><p>BT.470BG
  30180. </p>
  30181. </dd>
  30182. <dt>&lsquo;<samp>bt601-6-525</samp>&rsquo;</dt>
  30183. <dd><p>BT.601-6 525
  30184. </p>
  30185. </dd>
  30186. <dt>&lsquo;<samp>bt601-6-625</samp>&rsquo;</dt>
  30187. <dd><p>BT.601-6 625
  30188. </p>
  30189. </dd>
  30190. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  30191. <dd><p>BT.709
  30192. </p>
  30193. </dd>
  30194. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  30195. <dd><p>SMPTE-170M
  30196. </p>
  30197. </dd>
  30198. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  30199. <dd><p>SMPTE-240M
  30200. </p>
  30201. </dd>
  30202. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  30203. <dd><p>BT.2020
  30204. </p>
  30205. </dd>
  30206. </dl>
  30207. <span id="space"></span></dd>
  30208. <dt><samp>space</samp></dt>
  30209. <dd><p>Specify output colorspace.
  30210. </p>
  30211. <p>The accepted values are:
  30212. </p><dl compact="compact">
  30213. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  30214. <dd><p>BT.709
  30215. </p>
  30216. </dd>
  30217. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  30218. <dd><p>FCC
  30219. </p>
  30220. </dd>
  30221. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  30222. <dd><p>BT.470BG or BT.601-6 625
  30223. </p>
  30224. </dd>
  30225. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  30226. <dd><p>SMPTE-170M or BT.601-6 525
  30227. </p>
  30228. </dd>
  30229. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  30230. <dd><p>SMPTE-240M
  30231. </p>
  30232. </dd>
  30233. <dt>&lsquo;<samp>ycgco</samp>&rsquo;</dt>
  30234. <dd><p>YCgCo
  30235. </p>
  30236. </dd>
  30237. <dt>&lsquo;<samp>bt2020ncl</samp>&rsquo;</dt>
  30238. <dd><p>BT.2020 with non-constant luminance
  30239. </p>
  30240. </dd>
  30241. </dl>
  30242. <span id="trc"></span></dd>
  30243. <dt><samp>trc</samp></dt>
  30244. <dd><p>Specify output transfer characteristics.
  30245. </p>
  30246. <p>The accepted values are:
  30247. </p><dl compact="compact">
  30248. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  30249. <dd><p>BT.709
  30250. </p>
  30251. </dd>
  30252. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  30253. <dd><p>BT.470M
  30254. </p>
  30255. </dd>
  30256. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  30257. <dd><p>BT.470BG
  30258. </p>
  30259. </dd>
  30260. <dt>&lsquo;<samp>gamma22</samp>&rsquo;</dt>
  30261. <dd><p>Constant gamma of 2.2
  30262. </p>
  30263. </dd>
  30264. <dt>&lsquo;<samp>gamma28</samp>&rsquo;</dt>
  30265. <dd><p>Constant gamma of 2.8
  30266. </p>
  30267. </dd>
  30268. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  30269. <dd><p>SMPTE-170M, BT.601-6 625 or BT.601-6 525
  30270. </p>
  30271. </dd>
  30272. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  30273. <dd><p>SMPTE-240M
  30274. </p>
  30275. </dd>
  30276. <dt>&lsquo;<samp>srgb</samp>&rsquo;</dt>
  30277. <dd><p>SRGB
  30278. </p>
  30279. </dd>
  30280. <dt>&lsquo;<samp>iec61966-2-1</samp>&rsquo;</dt>
  30281. <dd><p>iec61966-2-1
  30282. </p>
  30283. </dd>
  30284. <dt>&lsquo;<samp>iec61966-2-4</samp>&rsquo;</dt>
  30285. <dd><p>iec61966-2-4
  30286. </p>
  30287. </dd>
  30288. <dt>&lsquo;<samp>xvycc</samp>&rsquo;</dt>
  30289. <dd><p>xvycc
  30290. </p>
  30291. </dd>
  30292. <dt>&lsquo;<samp>bt2020-10</samp>&rsquo;</dt>
  30293. <dd><p>BT.2020 for 10-bits content
  30294. </p>
  30295. </dd>
  30296. <dt>&lsquo;<samp>bt2020-12</samp>&rsquo;</dt>
  30297. <dd><p>BT.2020 for 12-bits content
  30298. </p>
  30299. </dd>
  30300. </dl>
  30301. <span id="primaries"></span></dd>
  30302. <dt><samp>primaries</samp></dt>
  30303. <dd><p>Specify output color primaries.
  30304. </p>
  30305. <p>The accepted values are:
  30306. </p><dl compact="compact">
  30307. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  30308. <dd><p>BT.709
  30309. </p>
  30310. </dd>
  30311. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  30312. <dd><p>BT.470M
  30313. </p>
  30314. </dd>
  30315. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  30316. <dd><p>BT.470BG or BT.601-6 625
  30317. </p>
  30318. </dd>
  30319. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  30320. <dd><p>SMPTE-170M or BT.601-6 525
  30321. </p>
  30322. </dd>
  30323. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  30324. <dd><p>SMPTE-240M
  30325. </p>
  30326. </dd>
  30327. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  30328. <dd><p>film
  30329. </p>
  30330. </dd>
  30331. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  30332. <dd><p>SMPTE-431
  30333. </p>
  30334. </dd>
  30335. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  30336. <dd><p>SMPTE-432
  30337. </p>
  30338. </dd>
  30339. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  30340. <dd><p>BT.2020
  30341. </p>
  30342. </dd>
  30343. <dt>&lsquo;<samp>jedec-p22</samp>&rsquo;</dt>
  30344. <dd><p>JEDEC P22 phosphors
  30345. </p>
  30346. </dd>
  30347. </dl>
  30348. <span id="range"></span></dd>
  30349. <dt><samp>range</samp></dt>
  30350. <dd><p>Specify output color range.
  30351. </p>
  30352. <p>The accepted values are:
  30353. </p><dl compact="compact">
  30354. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  30355. <dd><p>TV (restricted) range
  30356. </p>
  30357. </dd>
  30358. <dt>&lsquo;<samp>mpeg</samp>&rsquo;</dt>
  30359. <dd><p>MPEG (restricted) range
  30360. </p>
  30361. </dd>
  30362. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  30363. <dd><p>PC (full) range
  30364. </p>
  30365. </dd>
  30366. <dt>&lsquo;<samp>jpeg</samp>&rsquo;</dt>
  30367. <dd><p>JPEG (full) range
  30368. </p>
  30369. </dd>
  30370. </dl>
  30371. </dd>
  30372. <dt><samp>format</samp></dt>
  30373. <dd><p>Specify output color format.
  30374. </p>
  30375. <p>The accepted values are:
  30376. </p><dl compact="compact">
  30377. <dt>&lsquo;<samp>yuv420p</samp>&rsquo;</dt>
  30378. <dd><p>YUV 4:2:0 planar 8-bits
  30379. </p>
  30380. </dd>
  30381. <dt>&lsquo;<samp>yuv420p10</samp>&rsquo;</dt>
  30382. <dd><p>YUV 4:2:0 planar 10-bits
  30383. </p>
  30384. </dd>
  30385. <dt>&lsquo;<samp>yuv420p12</samp>&rsquo;</dt>
  30386. <dd><p>YUV 4:2:0 planar 12-bits
  30387. </p>
  30388. </dd>
  30389. <dt>&lsquo;<samp>yuv422p</samp>&rsquo;</dt>
  30390. <dd><p>YUV 4:2:2 planar 8-bits
  30391. </p>
  30392. </dd>
  30393. <dt>&lsquo;<samp>yuv422p10</samp>&rsquo;</dt>
  30394. <dd><p>YUV 4:2:2 planar 10-bits
  30395. </p>
  30396. </dd>
  30397. <dt>&lsquo;<samp>yuv422p12</samp>&rsquo;</dt>
  30398. <dd><p>YUV 4:2:2 planar 12-bits
  30399. </p>
  30400. </dd>
  30401. <dt>&lsquo;<samp>yuv444p</samp>&rsquo;</dt>
  30402. <dd><p>YUV 4:4:4 planar 8-bits
  30403. </p>
  30404. </dd>
  30405. <dt>&lsquo;<samp>yuv444p10</samp>&rsquo;</dt>
  30406. <dd><p>YUV 4:4:4 planar 10-bits
  30407. </p>
  30408. </dd>
  30409. <dt>&lsquo;<samp>yuv444p12</samp>&rsquo;</dt>
  30410. <dd><p>YUV 4:4:4 planar 12-bits
  30411. </p>
  30412. </dd>
  30413. </dl>
  30414. </dd>
  30415. <dt><samp>fast</samp></dt>
  30416. <dd><p>Do a fast conversion, which skips gamma/primary correction. This will take
  30417. significantly less CPU, but will be mathematically incorrect. To get output
  30418. compatible with that produced by the colormatrix filter, use fast=1.
  30419. </p>
  30420. </dd>
  30421. <dt><samp>dither</samp></dt>
  30422. <dd><p>Specify dithering mode.
  30423. </p>
  30424. <p>The accepted values are:
  30425. </p><dl compact="compact">
  30426. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  30427. <dd><p>No dithering
  30428. </p>
  30429. </dd>
  30430. <dt>&lsquo;<samp>fsb</samp>&rsquo;</dt>
  30431. <dd><p>Floyd-Steinberg dithering
  30432. </p></dd>
  30433. </dl>
  30434. </dd>
  30435. <dt><samp>wpadapt</samp></dt>
  30436. <dd><p>Whitepoint adaptation mode.
  30437. </p>
  30438. <p>The accepted values are:
  30439. </p><dl compact="compact">
  30440. <dt>&lsquo;<samp>bradford</samp>&rsquo;</dt>
  30441. <dd><p>Bradford whitepoint adaptation
  30442. </p>
  30443. </dd>
  30444. <dt>&lsquo;<samp>vonkries</samp>&rsquo;</dt>
  30445. <dd><p>von Kries whitepoint adaptation
  30446. </p>
  30447. </dd>
  30448. <dt>&lsquo;<samp>identity</samp>&rsquo;</dt>
  30449. <dd><p>identity whitepoint adaptation (i.e. no whitepoint adaptation)
  30450. </p></dd>
  30451. </dl>
  30452. </dd>
  30453. <dt><samp>iall</samp></dt>
  30454. <dd><p>Override all input properties at once. Same accepted values as <a href="#all">all</a>.
  30455. </p>
  30456. </dd>
  30457. <dt><samp>ispace</samp></dt>
  30458. <dd><p>Override input colorspace. Same accepted values as <a href="#space">space</a>.
  30459. </p>
  30460. </dd>
  30461. <dt><samp>iprimaries</samp></dt>
  30462. <dd><p>Override input color primaries. Same accepted values as <a href="#primaries">primaries</a>.
  30463. </p>
  30464. </dd>
  30465. <dt><samp>itrc</samp></dt>
  30466. <dd><p>Override input transfer characteristics. Same accepted values as <a href="#trc">trc</a>.
  30467. </p>
  30468. </dd>
  30469. <dt><samp>irange</samp></dt>
  30470. <dd><p>Override input color range. Same accepted values as <a href="#range">range</a>.
  30471. </p>
  30472. </dd>
  30473. </dl>
  30474. <p>The filter converts the transfer characteristics, color space and color
  30475. primaries to the specified user values. The output value, if not specified,
  30476. is set to a default value based on the &quot;all&quot; property. If that property is
  30477. also not specified, the filter will log an error. The output color range and
  30478. format default to the same value as the input color range and format. The
  30479. input transfer characteristics, color space, color primaries and color range
  30480. should be set on the input data. If any of these are missing, the filter will
  30481. log an error and no conversion will take place.
  30482. </p>
  30483. <p>For example to convert the input to SMPTE-240M, use the command:
  30484. </p><div class="example">
  30485. <pre class="example">colorspace=smpte240m
  30486. </pre></div>
  30487. <a name="colortemperature"></a>
  30488. <h3 class="section">39.34 colortemperature<span class="pull-right"><a class="anchor hidden-xs" href="#colortemperature" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colortemperature" aria-hidden="true">TOC</a></span></h3>
  30489. <p>Adjust color temperature in video to simulate variations in ambient color temperature.
  30490. </p>
  30491. <p>The filter accepts the following options:
  30492. </p>
  30493. <dl compact="compact">
  30494. <dt><samp>temperature</samp></dt>
  30495. <dd><p>Set the temperature in Kelvin. Allowed range is from 1000 to 40000.
  30496. Default value is 6500 K.
  30497. </p>
  30498. </dd>
  30499. <dt><samp>mix</samp></dt>
  30500. <dd><p>Set mixing with filtered output. Allowed range is from 0 to 1.
  30501. Default value is 1.
  30502. </p>
  30503. </dd>
  30504. <dt><samp>pl</samp></dt>
  30505. <dd><p>Set the amount of preserving lightness. Allowed range is from 0 to 1.
  30506. Default value is 0.
  30507. </p></dd>
  30508. </dl>
  30509. <a name="Commands-62"></a>
  30510. <h4 class="subsection">39.34.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-62" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-62" aria-hidden="true">TOC</a></span></h4>
  30511. <p>This filter supports same <a href="#commands">commands</a> as options.
  30512. </p>
  30513. <a name="convolution"></a>
  30514. <h3 class="section">39.35 convolution<span class="pull-right"><a class="anchor hidden-xs" href="#convolution" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-convolution" aria-hidden="true">TOC</a></span></h3>
  30515. <p>Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements.
  30516. </p>
  30517. <p>The filter accepts the following options:
  30518. </p>
  30519. <dl compact="compact">
  30520. <dt><samp>0m</samp></dt>
  30521. <dt><samp>1m</samp></dt>
  30522. <dt><samp>2m</samp></dt>
  30523. <dt><samp>3m</samp></dt>
  30524. <dd><p>Set matrix for each plane.
  30525. Matrix is sequence of 9, 25 or 49 signed integers in <var>square</var> mode,
  30526. and from 1 to 49 odd number of signed integers in <var>row</var> mode.
  30527. </p>
  30528. </dd>
  30529. <dt><samp>0rdiv</samp></dt>
  30530. <dt><samp>1rdiv</samp></dt>
  30531. <dt><samp>2rdiv</samp></dt>
  30532. <dt><samp>3rdiv</samp></dt>
  30533. <dd><p>Set multiplier for calculated value for each plane.
  30534. If unset or 0, it will be sum of all matrix elements.
  30535. </p>
  30536. </dd>
  30537. <dt><samp>0bias</samp></dt>
  30538. <dt><samp>1bias</samp></dt>
  30539. <dt><samp>2bias</samp></dt>
  30540. <dt><samp>3bias</samp></dt>
  30541. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  30542. Useful for making the overall image brighter or darker. Default is 0.0.
  30543. </p>
  30544. </dd>
  30545. <dt><samp>0mode</samp></dt>
  30546. <dt><samp>1mode</samp></dt>
  30547. <dt><samp>2mode</samp></dt>
  30548. <dt><samp>3mode</samp></dt>
  30549. <dd><p>Set matrix mode for each plane. Can be <var>square</var>, <var>row</var> or <var>column</var>.
  30550. Default is <var>square</var>.
  30551. </p></dd>
  30552. </dl>
  30553. <a name="Commands-63"></a>
  30554. <h4 class="subsection">39.35.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-63" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-63" aria-hidden="true">TOC</a></span></h4>
  30555. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  30556. </p>
  30557. <a name="Examples-88"></a>
  30558. <h4 class="subsection">39.35.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-88" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-88" aria-hidden="true">TOC</a></span></h4>
  30559. <ul>
  30560. <li> Apply sharpen:
  30561. <div class="example">
  30562. <pre class="example">convolution=&quot;0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0&quot;
  30563. </pre></div>
  30564. </li><li> Apply blur:
  30565. <div class="example">
  30566. <pre class="example">convolution=&quot;1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9&quot;
  30567. </pre></div>
  30568. </li><li> Apply edge enhance:
  30569. <div class="example">
  30570. <pre class="example">convolution=&quot;0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128&quot;
  30571. </pre></div>
  30572. </li><li> Apply edge detect:
  30573. <div class="example">
  30574. <pre class="example">convolution=&quot;0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128&quot;
  30575. </pre></div>
  30576. </li><li> Apply laplacian edge detector which includes diagonals:
  30577. <div class="example">
  30578. <pre class="example">convolution=&quot;1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0&quot;
  30579. </pre></div>
  30580. </li><li> Apply emboss:
  30581. <div class="example">
  30582. <pre class="example">convolution=&quot;-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2&quot;
  30583. </pre></div>
  30584. </li></ul>
  30585. <a name="convolve"></a>
  30586. <h3 class="section">39.36 convolve<span class="pull-right"><a class="anchor hidden-xs" href="#convolve" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-convolve" aria-hidden="true">TOC</a></span></h3>
  30587. <p>Apply 2D convolution of video stream in frequency domain using second stream
  30588. as impulse.
  30589. </p>
  30590. <p>The filter accepts the following options:
  30591. </p>
  30592. <dl compact="compact">
  30593. <dt><samp>planes</samp></dt>
  30594. <dd><p>Set which planes to process.
  30595. </p>
  30596. </dd>
  30597. <dt><samp>impulse</samp></dt>
  30598. <dd><p>Set which impulse video frames will be processed, can be <var>first</var>
  30599. or <var>all</var>. Default is <var>all</var>.
  30600. </p></dd>
  30601. </dl>
  30602. <p>The <code>convolve</code> filter also supports the <a href="#framesync">framesync</a> options.
  30603. </p>
  30604. <a name="copy"></a>
  30605. <h3 class="section">39.37 copy<span class="pull-right"><a class="anchor hidden-xs" href="#copy" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-copy" aria-hidden="true">TOC</a></span></h3>
  30606. <p>Copy the input video source unchanged to the output. This is mainly useful for
  30607. testing purposes.
  30608. </p>
  30609. <span id="coreimage"></span><a name="coreimage-1"></a>
  30610. <h3 class="section">39.38 coreimage<span class="pull-right"><a class="anchor hidden-xs" href="#coreimage-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-coreimage-1" aria-hidden="true">TOC</a></span></h3>
  30611. <p>Video filtering on GPU using Apple&rsquo;s CoreImage API on OSX.
  30612. </p>
  30613. <p>Hardware acceleration is based on an OpenGL context. Usually, this means it is
  30614. processed by video hardware. However, software-based OpenGL implementations
  30615. exist which means there is no guarantee for hardware processing. It depends on
  30616. the respective OSX.
  30617. </p>
  30618. <p>There are many filters and image generators provided by Apple that come with a
  30619. large variety of options. The filter has to be referenced by its name along
  30620. with its options.
  30621. </p>
  30622. <p>The coreimage filter accepts the following options:
  30623. </p><dl compact="compact">
  30624. <dt><samp>list_filters</samp></dt>
  30625. <dd><p>List all available filters and generators along with all their respective
  30626. options as well as possible minimum and maximum values along with the default
  30627. values.
  30628. </p><div class="example">
  30629. <pre class="example">list_filters=true
  30630. </pre></div>
  30631. </dd>
  30632. <dt><samp>filter</samp></dt>
  30633. <dd><p>Specify all filters by their respective name and options.
  30634. Use <var>list_filters</var> to determine all valid filter names and options.
  30635. Numerical options are specified by a float value and are automatically clamped
  30636. to their respective value range. Vector and color options have to be specified
  30637. by a list of space separated float values. Character escaping has to be done.
  30638. A special option name <code>default</code> is available to use default options for a
  30639. filter.
  30640. </p>
  30641. <p>It is required to specify either <code>default</code> or at least one of the filter options.
  30642. All omitted options are used with their default values.
  30643. The syntax of the filter string is as follows:
  30644. </p><div class="example">
  30645. <pre class="example">filter=&lt;NAME&gt;@&lt;OPTION&gt;=&lt;VALUE&gt;[@&lt;OPTION&gt;=&lt;VALUE&gt;][@...][#&lt;NAME&gt;@&lt;OPTION&gt;=&lt;VALUE&gt;[@&lt;OPTION&gt;=&lt;VALUE&gt;][@...]][#...]
  30646. </pre></div>
  30647. </dd>
  30648. <dt><samp>output_rect</samp></dt>
  30649. <dd><p>Specify a rectangle where the output of the filter chain is copied into the
  30650. input image. It is given by a list of space separated float values:
  30651. </p><div class="example">
  30652. <pre class="example">output_rect=x\ y\ width\ height
  30653. </pre></div>
  30654. <p>If not given, the output rectangle equals the dimensions of the input image.
  30655. The output rectangle is automatically cropped at the borders of the input
  30656. image. Negative values are valid for each component.
  30657. </p><div class="example">
  30658. <pre class="example">output_rect=25\ 25\ 100\ 100
  30659. </pre></div>
  30660. </dd>
  30661. </dl>
  30662. <p>Several filters can be chained for successive processing without GPU-HOST
  30663. transfers allowing for fast processing of complex filter chains.
  30664. Currently, only filters with zero (generators) or exactly one (filters) input
  30665. image and one output image are supported. Also, transition filters are not yet
  30666. usable as intended.
  30667. </p>
  30668. <p>Some filters generate output images with additional padding depending on the
  30669. respective filter kernel. The padding is automatically removed to ensure the
  30670. filter output has the same size as the input image.
  30671. </p>
  30672. <p>For image generators, the size of the output image is determined by the
  30673. previous output image of the filter chain or the input image of the whole
  30674. filterchain, respectively. The generators do not use the pixel information of
  30675. this image to generate their output. However, the generated output is
  30676. blended onto this image, resulting in partial or complete coverage of the
  30677. output image.
  30678. </p>
  30679. <p>The <a href="#coreimagesrc">coreimagesrc</a> video source can be used for generating input images
  30680. which are directly fed into the filter chain. By using it, providing input
  30681. images by another video source or an input video is not required.
  30682. </p>
  30683. <a name="Examples-89"></a>
  30684. <h4 class="subsection">39.38.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-89" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-89" aria-hidden="true">TOC</a></span></h4>
  30685. <ul>
  30686. <li> List all filters available:
  30687. <div class="example">
  30688. <pre class="example">coreimage=list_filters=true
  30689. </pre></div>
  30690. </li><li> Use the CIBoxBlur filter with default options to blur an image:
  30691. <div class="example">
  30692. <pre class="example">coreimage=filter=CIBoxBlur@default
  30693. </pre></div>
  30694. </li><li> Use a filter chain with CISepiaTone at default values and CIVignetteEffect with
  30695. its center at 100x100 and a radius of 50 pixels:
  30696. <div class="example">
  30697. <pre class="example">coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\ 100@inputRadius=50
  30698. </pre></div>
  30699. </li><li> Use nullsrc and CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  30700. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  30701. <div class="example">
  30702. <pre class="example">ffmpeg -f lavfi -i nullsrc=s=100x100,coreimage=filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  30703. </pre></div>
  30704. </li></ul>
  30705. <a name="cover_005frect"></a>
  30706. <h3 class="section">39.39 cover_rect<span class="pull-right"><a class="anchor hidden-xs" href="#cover_005frect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cover_005frect" aria-hidden="true">TOC</a></span></h3>
  30707. <p>Cover a rectangular object
  30708. </p>
  30709. <p>It accepts the following options:
  30710. </p>
  30711. <dl compact="compact">
  30712. <dt><samp>cover</samp></dt>
  30713. <dd><p>Filepath of the optional cover image, needs to be in yuv420.
  30714. </p>
  30715. </dd>
  30716. <dt><samp>mode</samp></dt>
  30717. <dd><p>Set covering mode.
  30718. </p>
  30719. <p>It accepts the following values:
  30720. </p><dl compact="compact">
  30721. <dt>&lsquo;<samp>cover</samp>&rsquo;</dt>
  30722. <dd><p>cover it by the supplied image
  30723. </p></dd>
  30724. <dt>&lsquo;<samp>blur</samp>&rsquo;</dt>
  30725. <dd><p>cover it by interpolating the surrounding pixels
  30726. </p></dd>
  30727. </dl>
  30728. <p>Default value is <var>blur</var>.
  30729. </p></dd>
  30730. </dl>
  30731. <a name="Examples-90"></a>
  30732. <h4 class="subsection">39.39.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-90" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-90" aria-hidden="true">TOC</a></span></h4>
  30733. <ul>
  30734. <li> Cover a rectangular object by the supplied image of a given video using <code>ffmpeg</code>:
  30735. <div class="example">
  30736. <pre class="example">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  30737. </pre></div>
  30738. </li></ul>
  30739. <a name="crop"></a>
  30740. <h3 class="section">39.40 crop<span class="pull-right"><a class="anchor hidden-xs" href="#crop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crop" aria-hidden="true">TOC</a></span></h3>
  30741. <p>Crop the input video to given dimensions.
  30742. </p>
  30743. <p>It accepts the following parameters:
  30744. </p>
  30745. <dl compact="compact">
  30746. <dt><samp>w, out_w</samp></dt>
  30747. <dd><p>The width of the output video. It defaults to <code>iw</code>.
  30748. This expression is evaluated only once during the filter
  30749. configuration, or when the &lsquo;<samp>w</samp>&rsquo; or &lsquo;<samp>out_w</samp>&rsquo; command is sent.
  30750. </p>
  30751. </dd>
  30752. <dt><samp>h, out_h</samp></dt>
  30753. <dd><p>The height of the output video. It defaults to <code>ih</code>.
  30754. This expression is evaluated only once during the filter
  30755. configuration, or when the &lsquo;<samp>h</samp>&rsquo; or &lsquo;<samp>out_h</samp>&rsquo; command is sent.
  30756. </p>
  30757. </dd>
  30758. <dt><samp>x</samp></dt>
  30759. <dd><p>The horizontal position, in the input video, of the left edge of the output
  30760. video. It defaults to <code>(in_w-out_w)/2</code>.
  30761. This expression is evaluated per-frame.
  30762. </p>
  30763. </dd>
  30764. <dt><samp>y</samp></dt>
  30765. <dd><p>The vertical position, in the input video, of the top edge of the output video.
  30766. It defaults to <code>(in_h-out_h)/2</code>.
  30767. This expression is evaluated per-frame.
  30768. </p>
  30769. </dd>
  30770. <dt><samp>keep_aspect</samp></dt>
  30771. <dd><p>If set to 1 will force the output display aspect ratio
  30772. to be the same of the input, by changing the output sample aspect
  30773. ratio. It defaults to 0.
  30774. </p>
  30775. </dd>
  30776. <dt><samp>exact</samp></dt>
  30777. <dd><p>Enable exact cropping. If enabled, subsampled videos will be cropped at exact
  30778. width/height/x/y as specified and will not be rounded to nearest smaller value.
  30779. It defaults to 0.
  30780. </p></dd>
  30781. </dl>
  30782. <p>The <var>out_w</var>, <var>out_h</var>, <var>x</var>, <var>y</var> parameters are
  30783. expressions containing the following constants:
  30784. </p>
  30785. <dl compact="compact">
  30786. <dt><samp>x</samp></dt>
  30787. <dt><samp>y</samp></dt>
  30788. <dd><p>The computed values for <var>x</var> and <var>y</var>. They are evaluated for
  30789. each new frame.
  30790. </p>
  30791. </dd>
  30792. <dt><samp>in_w</samp></dt>
  30793. <dt><samp>in_h</samp></dt>
  30794. <dd><p>The input width and height.
  30795. </p>
  30796. </dd>
  30797. <dt><samp>iw</samp></dt>
  30798. <dt><samp>ih</samp></dt>
  30799. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  30800. </p>
  30801. </dd>
  30802. <dt><samp>out_w</samp></dt>
  30803. <dt><samp>out_h</samp></dt>
  30804. <dd><p>The output (cropped) width and height.
  30805. </p>
  30806. </dd>
  30807. <dt><samp>ow</samp></dt>
  30808. <dt><samp>oh</samp></dt>
  30809. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
  30810. </p>
  30811. </dd>
  30812. <dt><samp>a</samp></dt>
  30813. <dd><p>same as <var>iw</var> / <var>ih</var>
  30814. </p>
  30815. </dd>
  30816. <dt><samp>sar</samp></dt>
  30817. <dd><p>input sample aspect ratio
  30818. </p>
  30819. </dd>
  30820. <dt><samp>dar</samp></dt>
  30821. <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
  30822. </p>
  30823. </dd>
  30824. <dt><samp>hsub</samp></dt>
  30825. <dt><samp>vsub</samp></dt>
  30826. <dd><p>horizontal and vertical chroma subsample values. For example for the
  30827. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  30828. </p>
  30829. </dd>
  30830. <dt><samp>n</samp></dt>
  30831. <dd><p>The number of the input frame, starting from 0.
  30832. </p>
  30833. </dd>
  30834. <dt><samp>pos</samp></dt>
  30835. <dd><p>the position in the file of the input frame, NAN if unknown
  30836. </p>
  30837. </dd>
  30838. <dt><samp>t</samp></dt>
  30839. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  30840. </p>
  30841. </dd>
  30842. </dl>
  30843. <p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
  30844. and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
  30845. cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
  30846. evaluated after <var>out_w</var> and <var>out_h</var>.
  30847. </p>
  30848. <p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
  30849. position of the top-left corner of the output (non-cropped) area. They
  30850. are evaluated for each frame. If the evaluated value is not valid, it
  30851. is approximated to the nearest valid value.
  30852. </p>
  30853. <p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
  30854. for <var>y</var> may depend on <var>x</var>.
  30855. </p>
  30856. <a name="Examples-91"></a>
  30857. <h4 class="subsection">39.40.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-91" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-91" aria-hidden="true">TOC</a></span></h4>
  30858. <ul>
  30859. <li> Crop area with size 100x100 at position (12,34).
  30860. <div class="example">
  30861. <pre class="example">crop=100:100:12:34
  30862. </pre></div>
  30863. <p>Using named options, the example above becomes:
  30864. </p><div class="example">
  30865. <pre class="example">crop=w=100:h=100:x=12:y=34
  30866. </pre></div>
  30867. </li><li> Crop the central input area with size 100x100:
  30868. <div class="example">
  30869. <pre class="example">crop=100:100
  30870. </pre></div>
  30871. </li><li> Crop the central input area with size 2/3 of the input video:
  30872. <div class="example">
  30873. <pre class="example">crop=2/3*in_w:2/3*in_h
  30874. </pre></div>
  30875. </li><li> Crop the input video central square:
  30876. <div class="example">
  30877. <pre class="example">crop=out_w=in_h
  30878. crop=in_h
  30879. </pre></div>
  30880. </li><li> Delimit the rectangle with the top-left corner placed at position
  30881. 100:100 and the right-bottom corner corresponding to the right-bottom
  30882. corner of the input image.
  30883. <div class="example">
  30884. <pre class="example">crop=in_w-100:in_h-100:100:100
  30885. </pre></div>
  30886. </li><li> Crop 10 pixels from the left and right borders, and 20 pixels from
  30887. the top and bottom borders
  30888. <div class="example">
  30889. <pre class="example">crop=in_w-2*10:in_h-2*20
  30890. </pre></div>
  30891. </li><li> Keep only the bottom right quarter of the input image:
  30892. <div class="example">
  30893. <pre class="example">crop=in_w/2:in_h/2:in_w/2:in_h/2
  30894. </pre></div>
  30895. </li><li> Crop height for getting Greek harmony:
  30896. <div class="example">
  30897. <pre class="example">crop=in_w:1/PHI*in_w
  30898. </pre></div>
  30899. </li><li> Apply trembling effect:
  30900. <div class="example">
  30901. <pre class="example">crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)
  30902. </pre></div>
  30903. </li><li> Apply erratic camera effect depending on timestamp:
  30904. <div class="example">
  30905. <pre class="example">crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)&quot;
  30906. </pre></div>
  30907. </li><li> Set x depending on the value of y:
  30908. <div class="example">
  30909. <pre class="example">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
  30910. </pre></div>
  30911. </li></ul>
  30912. <a name="Commands-64"></a>
  30913. <h4 class="subsection">39.40.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-64" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-64" aria-hidden="true">TOC</a></span></h4>
  30914. <p>This filter supports the following commands:
  30915. </p><dl compact="compact">
  30916. <dt><samp>w, out_w</samp></dt>
  30917. <dt><samp>h, out_h</samp></dt>
  30918. <dt><samp>x</samp></dt>
  30919. <dt><samp>y</samp></dt>
  30920. <dd><p>Set width/height of the output video and the horizontal/vertical position
  30921. in the input video.
  30922. The command accepts the same syntax of the corresponding option.
  30923. </p>
  30924. <p>If the specified expression is not valid, it is kept at its current
  30925. value.
  30926. </p></dd>
  30927. </dl>
  30928. <a name="cropdetect"></a>
  30929. <h3 class="section">39.41 cropdetect<span class="pull-right"><a class="anchor hidden-xs" href="#cropdetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cropdetect" aria-hidden="true">TOC</a></span></h3>
  30930. <p>Auto-detect the crop size.
  30931. </p>
  30932. <p>It calculates the necessary cropping parameters and prints the
  30933. recommended parameters via the logging system. The detected dimensions
  30934. correspond to the non-black area of the input video.
  30935. </p>
  30936. <p>It accepts the following parameters:
  30937. </p>
  30938. <dl compact="compact">
  30939. <dt><samp>limit</samp></dt>
  30940. <dd><p>Set higher black value threshold, which can be optionally specified
  30941. from nothing (0) to everything (255 for 8-bit based formats). An intensity
  30942. value greater to the set value is considered non-black. It defaults to 24.
  30943. You can also specify a value between 0.0 and 1.0 which will be scaled depending
  30944. on the bitdepth of the pixel format.
  30945. </p>
  30946. </dd>
  30947. <dt><samp>round</samp></dt>
  30948. <dd><p>The value which the width/height should be divisible by. It defaults to
  30949. 16. The offset is automatically adjusted to center the video. Use 2 to
  30950. get only even dimensions (needed for 4:2:2 video). 16 is best when
  30951. encoding to most video codecs.
  30952. </p>
  30953. </dd>
  30954. <dt><samp>skip</samp></dt>
  30955. <dd><p>Set the number of initial frames for which evaluation is skipped.
  30956. Default is 2. Range is 0 to INT_MAX.
  30957. </p>
  30958. </dd>
  30959. <dt><samp>reset_count, reset</samp></dt>
  30960. <dd><p>Set the counter that determines after how many frames cropdetect will
  30961. reset the previously detected largest video area and start over to
  30962. detect the current optimal crop area. Default value is 0.
  30963. </p>
  30964. <p>This can be useful when channel logos distort the video area. 0
  30965. indicates &rsquo;never reset&rsquo;, and returns the largest area encountered during
  30966. playback.
  30967. </p></dd>
  30968. </dl>
  30969. <span id="cue"></span><a name="cue-1"></a>
  30970. <h3 class="section">39.42 cue<span class="pull-right"><a class="anchor hidden-xs" href="#cue-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cue-1" aria-hidden="true">TOC</a></span></h3>
  30971. <p>Delay video filtering until a given wallclock timestamp. The filter first
  30972. passes on <samp>preroll</samp> amount of frames, then it buffers at most
  30973. <samp>buffer</samp> amount of frames and waits for the cue. After reaching the cue
  30974. it forwards the buffered frames and also any subsequent frames coming in its
  30975. input.
  30976. </p>
  30977. <p>The filter can be used synchronize the output of multiple ffmpeg processes for
  30978. realtime output devices like decklink. By putting the delay in the filtering
  30979. chain and pre-buffering frames the process can pass on data to output almost
  30980. immediately after the target wallclock timestamp is reached.
  30981. </p>
  30982. <p>Perfect frame accuracy cannot be guaranteed, but the result is good enough for
  30983. some use cases.
  30984. </p>
  30985. <dl compact="compact">
  30986. <dt><samp>cue</samp></dt>
  30987. <dd><p>The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0.
  30988. </p>
  30989. </dd>
  30990. <dt><samp>preroll</samp></dt>
  30991. <dd><p>The duration of content to pass on as preroll expressed in seconds. Default is 0.
  30992. </p>
  30993. </dd>
  30994. <dt><samp>buffer</samp></dt>
  30995. <dd><p>The maximum duration of content to buffer before waiting for the cue expressed
  30996. in seconds. Default is 0.
  30997. </p>
  30998. </dd>
  30999. </dl>
  31000. <span id="curves"></span><a name="curves-1"></a>
  31001. <h3 class="section">39.43 curves<span class="pull-right"><a class="anchor hidden-xs" href="#curves-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-curves-1" aria-hidden="true">TOC</a></span></h3>
  31002. <p>Apply color adjustments using curves.
  31003. </p>
  31004. <p>This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
  31005. component (red, green and blue) has its values defined by <var>N</var> key points
  31006. tied from each other using a smooth curve. The x-axis represents the pixel
  31007. values from the input frame, and the y-axis the new pixel values to be set for
  31008. the output frame.
  31009. </p>
  31010. <p>By default, a component curve is defined by the two points <var>(0;0)</var> and
  31011. <var>(1;1)</var>. This creates a straight line where each original pixel value is
  31012. &quot;adjusted&quot; to its own value, which means no change to the image.
  31013. </p>
  31014. <p>The filter allows you to redefine these two points and add some more. A new
  31015. curve (using a natural cubic spline interpolation) will be define to pass
  31016. smoothly through all these new coordinates. The new defined points needs to be
  31017. strictly increasing over the x-axis, and their <var>x</var> and <var>y</var> values must
  31018. be in the <var>[0;1]</var> interval. If the computed curves happened to go outside
  31019. the vector spaces, the values will be clipped accordingly.
  31020. </p>
  31021. <p>The filter accepts the following options:
  31022. </p>
  31023. <dl compact="compact">
  31024. <dt><samp>preset</samp></dt>
  31025. <dd><p>Select one of the available color presets. This option can be used in addition
  31026. to the <samp>r</samp>, <samp>g</samp>, <samp>b</samp> parameters; in this case, the later
  31027. options takes priority on the preset values.
  31028. Available presets are:
  31029. </p><dl compact="compact">
  31030. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  31031. <dt>&lsquo;<samp>color_negative</samp>&rsquo;</dt>
  31032. <dt>&lsquo;<samp>cross_process</samp>&rsquo;</dt>
  31033. <dt>&lsquo;<samp>darker</samp>&rsquo;</dt>
  31034. <dt>&lsquo;<samp>increase_contrast</samp>&rsquo;</dt>
  31035. <dt>&lsquo;<samp>lighter</samp>&rsquo;</dt>
  31036. <dt>&lsquo;<samp>linear_contrast</samp>&rsquo;</dt>
  31037. <dt>&lsquo;<samp>medium_contrast</samp>&rsquo;</dt>
  31038. <dt>&lsquo;<samp>negative</samp>&rsquo;</dt>
  31039. <dt>&lsquo;<samp>strong_contrast</samp>&rsquo;</dt>
  31040. <dt>&lsquo;<samp>vintage</samp>&rsquo;</dt>
  31041. </dl>
  31042. <p>Default is <code>none</code>.
  31043. </p></dd>
  31044. <dt><samp>master, m</samp></dt>
  31045. <dd><p>Set the master key points. These points will define a second pass mapping. It
  31046. is sometimes called a &quot;luminance&quot; or &quot;value&quot; mapping. It can be used with
  31047. <samp>r</samp>, <samp>g</samp>, <samp>b</samp> or <samp>all</samp> since it acts like a
  31048. post-processing LUT.
  31049. </p></dd>
  31050. <dt><samp>red, r</samp></dt>
  31051. <dd><p>Set the key points for the red component.
  31052. </p></dd>
  31053. <dt><samp>green, g</samp></dt>
  31054. <dd><p>Set the key points for the green component.
  31055. </p></dd>
  31056. <dt><samp>blue, b</samp></dt>
  31057. <dd><p>Set the key points for the blue component.
  31058. </p></dd>
  31059. <dt><samp>all</samp></dt>
  31060. <dd><p>Set the key points for all components (not including master).
  31061. Can be used in addition to the other key points component
  31062. options. In this case, the unset component(s) will fallback on this
  31063. <samp>all</samp> setting.
  31064. </p></dd>
  31065. <dt><samp>psfile</samp></dt>
  31066. <dd><p>Specify a Photoshop curves file (<code>.acv</code>) to import the settings from.
  31067. </p></dd>
  31068. <dt><samp>plot</samp></dt>
  31069. <dd><p>Save Gnuplot script of the curves in specified file.
  31070. </p></dd>
  31071. </dl>
  31072. <p>To avoid some filtergraph syntax conflicts, each key points list need to be
  31073. defined using the following syntax: <code>x0/y0 x1/y1 x2/y2 ...</code>.
  31074. </p>
  31075. <a name="Commands-65"></a>
  31076. <h4 class="subsection">39.43.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-65" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-65" aria-hidden="true">TOC</a></span></h4>
  31077. <p>This filter supports same <a href="#commands">commands</a> as options.
  31078. </p>
  31079. <a name="Examples-92"></a>
  31080. <h4 class="subsection">39.43.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-92" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-92" aria-hidden="true">TOC</a></span></h4>
  31081. <ul>
  31082. <li> Increase slightly the middle level of blue:
  31083. <div class="example">
  31084. <pre class="example">curves=blue='0/0 0.5/0.58 1/1'
  31085. </pre></div>
  31086. </li><li> Vintage effect:
  31087. <div class="example">
  31088. <pre class="example">curves=r='0/0.11 .42/.51 1/0.95':g='0/0 0.50/0.48 1/1':b='0/0.22 .49/.44 1/0.8'
  31089. </pre></div>
  31090. <p>Here we obtain the following coordinates for each components:
  31091. </p><dl compact="compact">
  31092. <dt><var>red</var></dt>
  31093. <dd><p><code>(0;0.11) (0.42;0.51) (1;0.95)</code>
  31094. </p></dd>
  31095. <dt><var>green</var></dt>
  31096. <dd><p><code>(0;0) (0.50;0.48) (1;1)</code>
  31097. </p></dd>
  31098. <dt><var>blue</var></dt>
  31099. <dd><p><code>(0;0.22) (0.49;0.44) (1;0.80)</code>
  31100. </p></dd>
  31101. </dl>
  31102. </li><li> The previous example can also be achieved with the associated built-in preset:
  31103. <div class="example">
  31104. <pre class="example">curves=preset=vintage
  31105. </pre></div>
  31106. </li><li> Or simply:
  31107. <div class="example">
  31108. <pre class="example">curves=vintage
  31109. </pre></div>
  31110. </li><li> Use a Photoshop preset and redefine the points of the green component:
  31111. <div class="example">
  31112. <pre class="example">curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1'
  31113. </pre></div>
  31114. </li><li> Check out the curves of the <code>cross_process</code> profile using <code>ffmpeg</code>
  31115. and <code>gnuplot</code>:
  31116. <div class="example">
  31117. <pre class="example">ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null -
  31118. gnuplot -p /tmp/curves.plt
  31119. </pre></div>
  31120. </li></ul>
  31121. <a name="datascope"></a>
  31122. <h3 class="section">39.44 datascope<span class="pull-right"><a class="anchor hidden-xs" href="#datascope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-datascope" aria-hidden="true">TOC</a></span></h3>
  31123. <p>Video data analysis filter.
  31124. </p>
  31125. <p>This filter shows hexadecimal pixel values of part of video.
  31126. </p>
  31127. <p>The filter accepts the following options:
  31128. </p>
  31129. <dl compact="compact">
  31130. <dt><samp>size, s</samp></dt>
  31131. <dd><p>Set output video size.
  31132. </p>
  31133. </dd>
  31134. <dt><samp>x</samp></dt>
  31135. <dd><p>Set x offset from where to pick pixels.
  31136. </p>
  31137. </dd>
  31138. <dt><samp>y</samp></dt>
  31139. <dd><p>Set y offset from where to pick pixels.
  31140. </p>
  31141. </dd>
  31142. <dt><samp>mode</samp></dt>
  31143. <dd><p>Set scope mode, can be one of the following:
  31144. </p><dl compact="compact">
  31145. <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
  31146. <dd><p>Draw hexadecimal pixel values with white color on black background.
  31147. </p>
  31148. </dd>
  31149. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  31150. <dd><p>Draw hexadecimal pixel values with input video pixel color on black
  31151. background.
  31152. </p>
  31153. </dd>
  31154. <dt>&lsquo;<samp>color2</samp>&rsquo;</dt>
  31155. <dd><p>Draw hexadecimal pixel values on color background picked from input video,
  31156. the text color is picked in such way so its always visible.
  31157. </p></dd>
  31158. </dl>
  31159. </dd>
  31160. <dt><samp>axis</samp></dt>
  31161. <dd><p>Draw rows and columns numbers on left and top of video.
  31162. </p>
  31163. </dd>
  31164. <dt><samp>opacity</samp></dt>
  31165. <dd><p>Set background opacity.
  31166. </p>
  31167. </dd>
  31168. <dt><samp>format</samp></dt>
  31169. <dd><p>Set display number format. Can be <code>hex</code>, or <code>dec</code>. Default is <code>hex</code>.
  31170. </p>
  31171. </dd>
  31172. <dt><samp>components</samp></dt>
  31173. <dd><p>Set pixel components to display. By default all pixel components are displayed.
  31174. </p></dd>
  31175. </dl>
  31176. <a name="Commands-66"></a>
  31177. <h4 class="subsection">39.44.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-66" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-66" aria-hidden="true">TOC</a></span></h4>
  31178. <p>This filter supports same <a href="#commands">commands</a> as options excluding <code>size</code> option.
  31179. </p>
  31180. <a name="dblur"></a>
  31181. <h3 class="section">39.45 dblur<span class="pull-right"><a class="anchor hidden-xs" href="#dblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dblur" aria-hidden="true">TOC</a></span></h3>
  31182. <p>Apply Directional blur filter.
  31183. </p>
  31184. <p>The filter accepts the following options:
  31185. </p>
  31186. <dl compact="compact">
  31187. <dt><samp>angle</samp></dt>
  31188. <dd><p>Set angle of directional blur. Default is <code>45</code>.
  31189. </p>
  31190. </dd>
  31191. <dt><samp>radius</samp></dt>
  31192. <dd><p>Set radius of directional blur. Default is <code>5</code>.
  31193. </p>
  31194. </dd>
  31195. <dt><samp>planes</samp></dt>
  31196. <dd><p>Set which planes to filter. By default all planes are filtered.
  31197. </p></dd>
  31198. </dl>
  31199. <a name="Commands-67"></a>
  31200. <h4 class="subsection">39.45.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-67" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-67" aria-hidden="true">TOC</a></span></h4>
  31201. <p>This filter supports same <a href="#commands">commands</a> as options.
  31202. The command accepts the same syntax of the corresponding option.
  31203. </p>
  31204. <p>If the specified expression is not valid, it is kept at its current
  31205. value.
  31206. </p>
  31207. <a name="dctdnoiz"></a>
  31208. <h3 class="section">39.46 dctdnoiz<span class="pull-right"><a class="anchor hidden-xs" href="#dctdnoiz" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dctdnoiz" aria-hidden="true">TOC</a></span></h3>
  31209. <p>Denoise frames using 2D DCT (frequency domain filtering).
  31210. </p>
  31211. <p>This filter is not designed for real time.
  31212. </p>
  31213. <p>The filter accepts the following options:
  31214. </p>
  31215. <dl compact="compact">
  31216. <dt><samp>sigma, s</samp></dt>
  31217. <dd><p>Set the noise sigma constant.
  31218. </p>
  31219. <p>This <var>sigma</var> defines a hard threshold of <code>3 * sigma</code>; every DCT
  31220. coefficient (absolute value) below this threshold with be dropped.
  31221. </p>
  31222. <p>If you need a more advanced filtering, see <samp>expr</samp>.
  31223. </p>
  31224. <p>Default is <code>0</code>.
  31225. </p>
  31226. </dd>
  31227. <dt><samp>overlap</samp></dt>
  31228. <dd><p>Set number overlapping pixels for each block. Since the filter can be slow, you
  31229. may want to reduce this value, at the cost of a less effective filter and the
  31230. risk of various artefacts.
  31231. </p>
  31232. <p>If the overlapping value doesn&rsquo;t permit processing the whole input width or
  31233. height, a warning will be displayed and according borders won&rsquo;t be denoised.
  31234. </p>
  31235. <p>Default value is <var>blocksize</var>-1, which is the best possible setting.
  31236. </p>
  31237. </dd>
  31238. <dt><samp>expr, e</samp></dt>
  31239. <dd><p>Set the coefficient factor expression.
  31240. </p>
  31241. <p>For each coefficient of a DCT block, this expression will be evaluated as a
  31242. multiplier value for the coefficient.
  31243. </p>
  31244. <p>If this is option is set, the <samp>sigma</samp> option will be ignored.
  31245. </p>
  31246. <p>The absolute value of the coefficient can be accessed through the <var>c</var>
  31247. variable.
  31248. </p>
  31249. </dd>
  31250. <dt><samp>n</samp></dt>
  31251. <dd><p>Set the <var>blocksize</var> using the number of bits. <code>1&lt;&lt;<var>n</var></code> defines the
  31252. <var>blocksize</var>, which is the width and height of the processed blocks.
  31253. </p>
  31254. <p>The default value is <var>3</var> (8x8) and can be raised to <var>4</var> for a
  31255. <var>blocksize</var> of 16x16. Note that changing this setting has huge consequences
  31256. on the speed processing. Also, a larger block size does not necessarily means a
  31257. better de-noising.
  31258. </p></dd>
  31259. </dl>
  31260. <a name="Examples-93"></a>
  31261. <h4 class="subsection">39.46.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-93" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-93" aria-hidden="true">TOC</a></span></h4>
  31262. <p>Apply a denoise with a <samp>sigma</samp> of <code>4.5</code>:
  31263. </p><div class="example">
  31264. <pre class="example">dctdnoiz=4.5
  31265. </pre></div>
  31266. <p>The same operation can be achieved using the expression system:
  31267. </p><div class="example">
  31268. <pre class="example">dctdnoiz=e='gte(c, 4.5*3)'
  31269. </pre></div>
  31270. <p>Violent denoise using a block size of <code>16x16</code>:
  31271. </p><div class="example">
  31272. <pre class="example">dctdnoiz=15:n=4
  31273. </pre></div>
  31274. <a name="deband"></a>
  31275. <h3 class="section">39.47 deband<span class="pull-right"><a class="anchor hidden-xs" href="#deband" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deband" aria-hidden="true">TOC</a></span></h3>
  31276. <p>Remove banding artifacts from input video.
  31277. It works by replacing banded pixels with average value of referenced pixels.
  31278. </p>
  31279. <p>The filter accepts the following options:
  31280. </p>
  31281. <dl compact="compact">
  31282. <dt><samp>1thr</samp></dt>
  31283. <dt><samp>2thr</samp></dt>
  31284. <dt><samp>3thr</samp></dt>
  31285. <dt><samp>4thr</samp></dt>
  31286. <dd><p>Set banding detection threshold for each plane. Default is 0.02.
  31287. Valid range is 0.00003 to 0.5.
  31288. If difference between current pixel and reference pixel is less than threshold,
  31289. it will be considered as banded.
  31290. </p>
  31291. </dd>
  31292. <dt><samp>range, r</samp></dt>
  31293. <dd><p>Banding detection range in pixels. Default is 16. If positive, random number
  31294. in range 0 to set value will be used. If negative, exact absolute value
  31295. will be used.
  31296. The range defines square of four pixels around current pixel.
  31297. </p>
  31298. </dd>
  31299. <dt><samp>direction, d</samp></dt>
  31300. <dd><p>Set direction in radians from which four pixel will be compared. If positive,
  31301. random direction from 0 to set direction will be picked. If negative, exact of
  31302. absolute value will be picked. For example direction 0, -PI or -2*PI radians
  31303. will pick only pixels on same row and -PI/2 will pick only pixels on same
  31304. column.
  31305. </p>
  31306. </dd>
  31307. <dt><samp>blur, b</samp></dt>
  31308. <dd><p>If enabled, current pixel is compared with average value of all four
  31309. surrounding pixels. The default is enabled. If disabled current pixel is
  31310. compared with all four surrounding pixels. The pixel is considered banded
  31311. if only all four differences with surrounding pixels are less than threshold.
  31312. </p>
  31313. </dd>
  31314. <dt><samp>coupling, c</samp></dt>
  31315. <dd><p>If enabled, current pixel is changed if and only if all pixel components are banded,
  31316. e.g. banding detection threshold is triggered for all color components.
  31317. The default is disabled.
  31318. </p></dd>
  31319. </dl>
  31320. <a name="Commands-68"></a>
  31321. <h4 class="subsection">39.47.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-68" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-68" aria-hidden="true">TOC</a></span></h4>
  31322. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  31323. </p>
  31324. <a name="deblock"></a>
  31325. <h3 class="section">39.48 deblock<span class="pull-right"><a class="anchor hidden-xs" href="#deblock" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deblock" aria-hidden="true">TOC</a></span></h3>
  31326. <p>Remove blocking artifacts from input video.
  31327. </p>
  31328. <p>The filter accepts the following options:
  31329. </p>
  31330. <dl compact="compact">
  31331. <dt><samp>filter</samp></dt>
  31332. <dd><p>Set filter type, can be <var>weak</var> or <var>strong</var>. Default is <var>strong</var>.
  31333. This controls what kind of deblocking is applied.
  31334. </p>
  31335. </dd>
  31336. <dt><samp>block</samp></dt>
  31337. <dd><p>Set size of block, allowed range is from 4 to 512. Default is <var>8</var>.
  31338. </p>
  31339. </dd>
  31340. <dt><samp>alpha</samp></dt>
  31341. <dt><samp>beta</samp></dt>
  31342. <dt><samp>gamma</samp></dt>
  31343. <dt><samp>delta</samp></dt>
  31344. <dd><p>Set blocking detection thresholds. Allowed range is 0 to 1.
  31345. Defaults are: <var>0.098</var> for <var>alpha</var> and <var>0.05</var> for the rest.
  31346. Using higher threshold gives more deblocking strength.
  31347. Setting <var>alpha</var> controls threshold detection at exact edge of block.
  31348. Remaining options controls threshold detection near the edge. Each one for
  31349. below/above or left/right. Setting any of those to <var>0</var> disables
  31350. deblocking.
  31351. </p>
  31352. </dd>
  31353. <dt><samp>planes</samp></dt>
  31354. <dd><p>Set planes to filter. Default is to filter all available planes.
  31355. </p></dd>
  31356. </dl>
  31357. <a name="Examples-94"></a>
  31358. <h4 class="subsection">39.48.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-94" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-94" aria-hidden="true">TOC</a></span></h4>
  31359. <ul>
  31360. <li> Deblock using weak filter and block size of 4 pixels.
  31361. <div class="example">
  31362. <pre class="example">deblock=filter=weak:block=4
  31363. </pre></div>
  31364. </li><li> Deblock using strong filter, block size of 4 pixels and custom thresholds for
  31365. deblocking more edges.
  31366. <div class="example">
  31367. <pre class="example">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05
  31368. </pre></div>
  31369. </li><li> Similar as above, but filter only first plane.
  31370. <div class="example">
  31371. <pre class="example">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1
  31372. </pre></div>
  31373. </li><li> Similar as above, but filter only second and third plane.
  31374. <div class="example">
  31375. <pre class="example">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6
  31376. </pre></div>
  31377. </li></ul>
  31378. <a name="Commands-69"></a>
  31379. <h4 class="subsection">39.48.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-69" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-69" aria-hidden="true">TOC</a></span></h4>
  31380. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  31381. </p>
  31382. <span id="decimate"></span><a name="decimate-1"></a>
  31383. <h3 class="section">39.49 decimate<span class="pull-right"><a class="anchor hidden-xs" href="#decimate-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-decimate-1" aria-hidden="true">TOC</a></span></h3>
  31384. <p>Drop duplicated frames at regular intervals.
  31385. </p>
  31386. <p>The filter accepts the following options:
  31387. </p>
  31388. <dl compact="compact">
  31389. <dt><samp>cycle</samp></dt>
  31390. <dd><p>Set the number of frames from which one will be dropped. Setting this to
  31391. <var>N</var> means one frame in every batch of <var>N</var> frames will be dropped.
  31392. Default is <code>5</code>.
  31393. </p>
  31394. </dd>
  31395. <dt><samp>dupthresh</samp></dt>
  31396. <dd><p>Set the threshold for duplicate detection. If the difference metric for a frame
  31397. is less than or equal to this value, then it is declared as duplicate. Default
  31398. is <code>1.1</code>
  31399. </p>
  31400. </dd>
  31401. <dt><samp>scthresh</samp></dt>
  31402. <dd><p>Set scene change threshold. Default is <code>15</code>.
  31403. </p>
  31404. </dd>
  31405. <dt><samp>blockx</samp></dt>
  31406. <dt><samp>blocky</samp></dt>
  31407. <dd><p>Set the size of the x and y-axis blocks used during metric calculations.
  31408. Larger blocks give better noise suppression, but also give worse detection of
  31409. small movements. Must be a power of two. Default is <code>32</code>.
  31410. </p>
  31411. </dd>
  31412. <dt><samp>ppsrc</samp></dt>
  31413. <dd><p>Mark main input as a pre-processed input and activate clean source input
  31414. stream. This allows the input to be pre-processed with various filters to help
  31415. the metrics calculation while keeping the frame selection lossless. When set to
  31416. <code>1</code>, the first stream is for the pre-processed input, and the second
  31417. stream is the clean source from where the kept frames are chosen. Default is
  31418. <code>0</code>.
  31419. </p>
  31420. </dd>
  31421. <dt><samp>chroma</samp></dt>
  31422. <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
  31423. <code>1</code>.
  31424. </p></dd>
  31425. </dl>
  31426. <a name="deconvolve"></a>
  31427. <h3 class="section">39.50 deconvolve<span class="pull-right"><a class="anchor hidden-xs" href="#deconvolve" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deconvolve" aria-hidden="true">TOC</a></span></h3>
  31428. <p>Apply 2D deconvolution of video stream in frequency domain using second stream
  31429. as impulse.
  31430. </p>
  31431. <p>The filter accepts the following options:
  31432. </p>
  31433. <dl compact="compact">
  31434. <dt><samp>planes</samp></dt>
  31435. <dd><p>Set which planes to process.
  31436. </p>
  31437. </dd>
  31438. <dt><samp>impulse</samp></dt>
  31439. <dd><p>Set which impulse video frames will be processed, can be <var>first</var>
  31440. or <var>all</var>. Default is <var>all</var>.
  31441. </p>
  31442. </dd>
  31443. <dt><samp>noise</samp></dt>
  31444. <dd><p>Set noise when doing divisions. Default is <var>0.0000001</var>. Useful when width
  31445. and height are not same and not power of 2 or if stream prior to convolving
  31446. had noise.
  31447. </p></dd>
  31448. </dl>
  31449. <p>The <code>deconvolve</code> filter also supports the <a href="#framesync">framesync</a> options.
  31450. </p>
  31451. <a name="dedot"></a>
  31452. <h3 class="section">39.51 dedot<span class="pull-right"><a class="anchor hidden-xs" href="#dedot" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dedot" aria-hidden="true">TOC</a></span></h3>
  31453. <p>Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video.
  31454. </p>
  31455. <p>It accepts the following options:
  31456. </p>
  31457. <dl compact="compact">
  31458. <dt><samp>m</samp></dt>
  31459. <dd><p>Set mode of operation. Can be combination of <var>dotcrawl</var> for cross-luminance reduction and/or
  31460. <var>rainbows</var> for cross-color reduction.
  31461. </p>
  31462. </dd>
  31463. <dt><samp>lt</samp></dt>
  31464. <dd><p>Set spatial luma threshold. Lower values increases reduction of cross-luminance.
  31465. </p>
  31466. </dd>
  31467. <dt><samp>tl</samp></dt>
  31468. <dd><p>Set tolerance for temporal luma. Higher values increases reduction of cross-luminance.
  31469. </p>
  31470. </dd>
  31471. <dt><samp>tc</samp></dt>
  31472. <dd><p>Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color.
  31473. </p>
  31474. </dd>
  31475. <dt><samp>ct</samp></dt>
  31476. <dd><p>Set temporal chroma threshold. Lower values increases reduction of cross-color.
  31477. </p></dd>
  31478. </dl>
  31479. <a name="deflate"></a>
  31480. <h3 class="section">39.52 deflate<span class="pull-right"><a class="anchor hidden-xs" href="#deflate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deflate" aria-hidden="true">TOC</a></span></h3>
  31481. <p>Apply deflate effect to the video.
  31482. </p>
  31483. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  31484. only values lower than the pixel.
  31485. </p>
  31486. <p>It accepts the following options:
  31487. </p>
  31488. <dl compact="compact">
  31489. <dt><samp>threshold0</samp></dt>
  31490. <dt><samp>threshold1</samp></dt>
  31491. <dt><samp>threshold2</samp></dt>
  31492. <dt><samp>threshold3</samp></dt>
  31493. <dd><p>Limit the maximum change for each plane, default is 65535.
  31494. If 0, plane will remain unchanged.
  31495. </p></dd>
  31496. </dl>
  31497. <a name="Commands-70"></a>
  31498. <h4 class="subsection">39.52.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-70" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-70" aria-hidden="true">TOC</a></span></h4>
  31499. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  31500. </p>
  31501. <a name="deflicker"></a>
  31502. <h3 class="section">39.53 deflicker<span class="pull-right"><a class="anchor hidden-xs" href="#deflicker" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deflicker" aria-hidden="true">TOC</a></span></h3>
  31503. <p>Remove temporal frame luminance variations.
  31504. </p>
  31505. <p>It accepts the following options:
  31506. </p>
  31507. <dl compact="compact">
  31508. <dt><samp>size, s</samp></dt>
  31509. <dd><p>Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129.
  31510. </p>
  31511. </dd>
  31512. <dt><samp>mode, m</samp></dt>
  31513. <dd><p>Set averaging mode to smooth temporal luminance variations.
  31514. </p>
  31515. <p>Available values are:
  31516. </p><dl compact="compact">
  31517. <dt>&lsquo;<samp>am</samp>&rsquo;</dt>
  31518. <dd><p>Arithmetic mean
  31519. </p>
  31520. </dd>
  31521. <dt>&lsquo;<samp>gm</samp>&rsquo;</dt>
  31522. <dd><p>Geometric mean
  31523. </p>
  31524. </dd>
  31525. <dt>&lsquo;<samp>hm</samp>&rsquo;</dt>
  31526. <dd><p>Harmonic mean
  31527. </p>
  31528. </dd>
  31529. <dt>&lsquo;<samp>qm</samp>&rsquo;</dt>
  31530. <dd><p>Quadratic mean
  31531. </p>
  31532. </dd>
  31533. <dt>&lsquo;<samp>cm</samp>&rsquo;</dt>
  31534. <dd><p>Cubic mean
  31535. </p>
  31536. </dd>
  31537. <dt>&lsquo;<samp>pm</samp>&rsquo;</dt>
  31538. <dd><p>Power mean
  31539. </p>
  31540. </dd>
  31541. <dt>&lsquo;<samp>median</samp>&rsquo;</dt>
  31542. <dd><p>Median
  31543. </p></dd>
  31544. </dl>
  31545. </dd>
  31546. <dt><samp>bypass</samp></dt>
  31547. <dd><p>Do not actually modify frame. Useful when one only wants metadata.
  31548. </p></dd>
  31549. </dl>
  31550. <a name="dejudder"></a>
  31551. <h3 class="section">39.54 dejudder<span class="pull-right"><a class="anchor hidden-xs" href="#dejudder" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dejudder" aria-hidden="true">TOC</a></span></h3>
  31552. <p>Remove judder produced by partially interlaced telecined content.
  31553. </p>
  31554. <p>Judder can be introduced, for instance, by <a href="#pullup">pullup</a> filter. If the original
  31555. source was partially telecined content then the output of <code>pullup,dejudder</code>
  31556. will have a variable frame rate. May change the recorded frame rate of the
  31557. container. Aside from that change, this filter will not affect constant frame
  31558. rate video.
  31559. </p>
  31560. <p>The option available in this filter is:
  31561. </p><dl compact="compact">
  31562. <dt><samp>cycle</samp></dt>
  31563. <dd><p>Specify the length of the window over which the judder repeats.
  31564. </p>
  31565. <p>Accepts any integer greater than 1. Useful values are:
  31566. </p><dl compact="compact">
  31567. <dt>&lsquo;<samp>4</samp>&rsquo;</dt>
  31568. <dd><p>If the original was telecined from 24 to 30 fps (Film to NTSC).
  31569. </p>
  31570. </dd>
  31571. <dt>&lsquo;<samp>5</samp>&rsquo;</dt>
  31572. <dd><p>If the original was telecined from 25 to 30 fps (PAL to NTSC).
  31573. </p>
  31574. </dd>
  31575. <dt>&lsquo;<samp>20</samp>&rsquo;</dt>
  31576. <dd><p>If a mixture of the two.
  31577. </p></dd>
  31578. </dl>
  31579. <p>The default is &lsquo;<samp>4</samp>&rsquo;.
  31580. </p></dd>
  31581. </dl>
  31582. <a name="delogo"></a>
  31583. <h3 class="section">39.55 delogo<span class="pull-right"><a class="anchor hidden-xs" href="#delogo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-delogo" aria-hidden="true">TOC</a></span></h3>
  31584. <p>Suppress a TV station logo by a simple interpolation of the surrounding
  31585. pixels. Just set a rectangle covering the logo and watch it disappear
  31586. (and sometimes something even uglier appear - your mileage may vary).
  31587. </p>
  31588. <p>It accepts the following parameters:
  31589. </p><dl compact="compact">
  31590. <dt><samp>x</samp></dt>
  31591. <dt><samp>y</samp></dt>
  31592. <dd><p>Specify the top left corner coordinates of the logo. They must be
  31593. specified.
  31594. </p>
  31595. </dd>
  31596. <dt><samp>w</samp></dt>
  31597. <dt><samp>h</samp></dt>
  31598. <dd><p>Specify the width and height of the logo to clear. They must be
  31599. specified.
  31600. </p>
  31601. </dd>
  31602. <dt><samp>show</samp></dt>
  31603. <dd><p>When set to 1, a green rectangle is drawn on the screen to simplify
  31604. finding the right <var>x</var>, <var>y</var>, <var>w</var>, and <var>h</var> parameters.
  31605. The default value is 0.
  31606. </p>
  31607. <p>The rectangle is drawn on the outermost pixels which will be (partly)
  31608. replaced with interpolated values. The values of the next pixels
  31609. immediately outside this rectangle in each direction will be used to
  31610. compute the interpolated pixel values inside the rectangle.
  31611. </p>
  31612. </dd>
  31613. </dl>
  31614. <a name="Examples-95"></a>
  31615. <h4 class="subsection">39.55.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-95" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-95" aria-hidden="true">TOC</a></span></h4>
  31616. <ul>
  31617. <li> Set a rectangle covering the area with top left corner coordinates 0,0
  31618. and size 100x77:
  31619. <div class="example">
  31620. <pre class="example">delogo=x=0:y=0:w=100:h=77
  31621. </pre></div>
  31622. </li></ul>
  31623. <span id="derain"></span><a name="derain-1"></a>
  31624. <h3 class="section">39.56 derain<span class="pull-right"><a class="anchor hidden-xs" href="#derain-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-derain-1" aria-hidden="true">TOC</a></span></h3>
  31625. <p>Remove the rain in the input image/video by applying the derain methods based on
  31626. convolutional neural networks. Supported models:
  31627. </p>
  31628. <ul>
  31629. <li> Recurrent Squeeze-and-Excitation Context Aggregation Net (RESCAN).
  31630. See <a href="http://openaccess.thecvf.com/content_ECCV_2018/papers/Xia_Li_Recurrent_Squeeze-and-Excitation_Context_ECCV_2018_paper.pdf">http://openaccess.thecvf.com/content_ECCV_2018/papers/Xia_Li_Recurrent_Squeeze-and-Excitation_Context_ECCV_2018_paper.pdf</a>.
  31631. </li></ul>
  31632. <p>Training as well as model generation scripts are provided in
  31633. the repository at <a href="https://github.com/XueweiMeng/derain_filter.git">https://github.com/XueweiMeng/derain_filter.git</a>.
  31634. </p>
  31635. <p>Native model files (.model) can be generated from TensorFlow model
  31636. files (.pb) by using tools/python/convert.py
  31637. </p>
  31638. <p>The filter accepts the following options:
  31639. </p>
  31640. <dl compact="compact">
  31641. <dt><samp>filter_type</samp></dt>
  31642. <dd><p>Specify which filter to use. This option accepts the following values:
  31643. </p>
  31644. <dl compact="compact">
  31645. <dt>&lsquo;<samp>derain</samp>&rsquo;</dt>
  31646. <dd><p>Derain filter. To conduct derain filter, you need to use a derain model.
  31647. </p>
  31648. </dd>
  31649. <dt>&lsquo;<samp>dehaze</samp>&rsquo;</dt>
  31650. <dd><p>Dehaze filter. To conduct dehaze filter, you need to use a dehaze model.
  31651. </p></dd>
  31652. </dl>
  31653. <p>Default value is &lsquo;<samp>derain</samp>&rsquo;.
  31654. </p>
  31655. </dd>
  31656. <dt><samp>dnn_backend</samp></dt>
  31657. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  31658. the following values:
  31659. </p>
  31660. <dl compact="compact">
  31661. <dt>&lsquo;<samp>native</samp>&rsquo;</dt>
  31662. <dd><p>Native implementation of DNN loading and execution.
  31663. </p>
  31664. </dd>
  31665. <dt>&lsquo;<samp>tensorflow</samp>&rsquo;</dt>
  31666. <dd><p>TensorFlow backend. To enable this backend you
  31667. need to install the TensorFlow for C library (see
  31668. <a href="https://www.tensorflow.org/install/install_c">https://www.tensorflow.org/install/install_c</a>) and configure FFmpeg with
  31669. <code>--enable-libtensorflow</code>
  31670. </p></dd>
  31671. </dl>
  31672. <p>Default value is &lsquo;<samp>native</samp>&rsquo;.
  31673. </p>
  31674. </dd>
  31675. <dt><samp>model</samp></dt>
  31676. <dd><p>Set path to model file specifying network architecture and its parameters.
  31677. Note that different backends use different file formats. TensorFlow and native
  31678. backend can load files for only its format.
  31679. </p></dd>
  31680. </dl>
  31681. <p>It can also be finished with <a href="#dnn_005fprocessing">dnn_processing</a> filter.
  31682. </p>
  31683. <a name="deshake"></a>
  31684. <h3 class="section">39.57 deshake<span class="pull-right"><a class="anchor hidden-xs" href="#deshake" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deshake" aria-hidden="true">TOC</a></span></h3>
  31685. <p>Attempt to fix small changes in horizontal and/or vertical shift. This
  31686. filter helps remove camera shake from hand-holding a camera, bumping a
  31687. tripod, moving on a vehicle, etc.
  31688. </p>
  31689. <p>The filter accepts the following options:
  31690. </p>
  31691. <dl compact="compact">
  31692. <dt><samp>x</samp></dt>
  31693. <dt><samp>y</samp></dt>
  31694. <dt><samp>w</samp></dt>
  31695. <dt><samp>h</samp></dt>
  31696. <dd><p>Specify a rectangular area where to limit the search for motion
  31697. vectors.
  31698. If desired the search for motion vectors can be limited to a
  31699. rectangular area of the frame defined by its top left corner, width
  31700. and height. These parameters have the same meaning as the drawbox
  31701. filter which can be used to visualise the position of the bounding
  31702. box.
  31703. </p>
  31704. <p>This is useful when simultaneous movement of subjects within the frame
  31705. might be confused for camera motion by the motion vector search.
  31706. </p>
  31707. <p>If any or all of <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> are set to -1
  31708. then the full frame is used. This allows later options to be set
  31709. without specifying the bounding box for the motion vector search.
  31710. </p>
  31711. <p>Default - search the whole frame.
  31712. </p>
  31713. </dd>
  31714. <dt><samp>rx</samp></dt>
  31715. <dt><samp>ry</samp></dt>
  31716. <dd><p>Specify the maximum extent of movement in x and y directions in the
  31717. range 0-64 pixels. Default 16.
  31718. </p>
  31719. </dd>
  31720. <dt><samp>edge</samp></dt>
  31721. <dd><p>Specify how to generate pixels to fill blanks at the edge of the
  31722. frame. Available values are:
  31723. </p><dl compact="compact">
  31724. <dt>&lsquo;<samp>blank, 0</samp>&rsquo;</dt>
  31725. <dd><p>Fill zeroes at blank locations
  31726. </p></dd>
  31727. <dt>&lsquo;<samp>original, 1</samp>&rsquo;</dt>
  31728. <dd><p>Original image at blank locations
  31729. </p></dd>
  31730. <dt>&lsquo;<samp>clamp, 2</samp>&rsquo;</dt>
  31731. <dd><p>Extruded edge value at blank locations
  31732. </p></dd>
  31733. <dt>&lsquo;<samp>mirror, 3</samp>&rsquo;</dt>
  31734. <dd><p>Mirrored edge at blank locations
  31735. </p></dd>
  31736. </dl>
  31737. <p>Default value is &lsquo;<samp>mirror</samp>&rsquo;.
  31738. </p>
  31739. </dd>
  31740. <dt><samp>blocksize</samp></dt>
  31741. <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
  31742. default 8.
  31743. </p>
  31744. </dd>
  31745. <dt><samp>contrast</samp></dt>
  31746. <dd><p>Specify the contrast threshold for blocks. Only blocks with more than
  31747. the specified contrast (difference between darkest and lightest
  31748. pixels) will be considered. Range 1-255, default 125.
  31749. </p>
  31750. </dd>
  31751. <dt><samp>search</samp></dt>
  31752. <dd><p>Specify the search strategy. Available values are:
  31753. </p><dl compact="compact">
  31754. <dt>&lsquo;<samp>exhaustive, 0</samp>&rsquo;</dt>
  31755. <dd><p>Set exhaustive search
  31756. </p></dd>
  31757. <dt>&lsquo;<samp>less, 1</samp>&rsquo;</dt>
  31758. <dd><p>Set less exhaustive search.
  31759. </p></dd>
  31760. </dl>
  31761. <p>Default value is &lsquo;<samp>exhaustive</samp>&rsquo;.
  31762. </p>
  31763. </dd>
  31764. <dt><samp>filename</samp></dt>
  31765. <dd><p>If set then a detailed log of the motion search is written to the
  31766. specified file.
  31767. </p>
  31768. </dd>
  31769. </dl>
  31770. <a name="despill"></a>
  31771. <h3 class="section">39.58 despill<span class="pull-right"><a class="anchor hidden-xs" href="#despill" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-despill" aria-hidden="true">TOC</a></span></h3>
  31772. <p>Remove unwanted contamination of foreground colors, caused by reflected color of
  31773. greenscreen or bluescreen.
  31774. </p>
  31775. <p>This filter accepts the following options:
  31776. </p>
  31777. <dl compact="compact">
  31778. <dt><samp>type</samp></dt>
  31779. <dd><p>Set what type of despill to use.
  31780. </p>
  31781. </dd>
  31782. <dt><samp>mix</samp></dt>
  31783. <dd><p>Set how spillmap will be generated.
  31784. </p>
  31785. </dd>
  31786. <dt><samp>expand</samp></dt>
  31787. <dd><p>Set how much to get rid of still remaining spill.
  31788. </p>
  31789. </dd>
  31790. <dt><samp>red</samp></dt>
  31791. <dd><p>Controls amount of red in spill area.
  31792. </p>
  31793. </dd>
  31794. <dt><samp>green</samp></dt>
  31795. <dd><p>Controls amount of green in spill area.
  31796. Should be -1 for greenscreen.
  31797. </p>
  31798. </dd>
  31799. <dt><samp>blue</samp></dt>
  31800. <dd><p>Controls amount of blue in spill area.
  31801. Should be -1 for bluescreen.
  31802. </p>
  31803. </dd>
  31804. <dt><samp>brightness</samp></dt>
  31805. <dd><p>Controls brightness of spill area, preserving colors.
  31806. </p>
  31807. </dd>
  31808. <dt><samp>alpha</samp></dt>
  31809. <dd><p>Modify alpha from generated spillmap.
  31810. </p></dd>
  31811. </dl>
  31812. <a name="Commands-71"></a>
  31813. <h4 class="subsection">39.58.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-71" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-71" aria-hidden="true">TOC</a></span></h4>
  31814. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  31815. </p>
  31816. <a name="detelecine"></a>
  31817. <h3 class="section">39.59 detelecine<span class="pull-right"><a class="anchor hidden-xs" href="#detelecine" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-detelecine" aria-hidden="true">TOC</a></span></h3>
  31818. <p>Apply an exact inverse of the telecine operation. It requires a predefined
  31819. pattern specified using the pattern option which must be the same as that passed
  31820. to the telecine filter.
  31821. </p>
  31822. <p>This filter accepts the following options:
  31823. </p>
  31824. <dl compact="compact">
  31825. <dt><samp>first_field</samp></dt>
  31826. <dd><dl compact="compact">
  31827. <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
  31828. <dd><p>top field first
  31829. </p></dd>
  31830. <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
  31831. <dd><p>bottom field first
  31832. The default value is <code>top</code>.
  31833. </p></dd>
  31834. </dl>
  31835. </dd>
  31836. <dt><samp>pattern</samp></dt>
  31837. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  31838. The default value is <code>23</code>.
  31839. </p>
  31840. </dd>
  31841. <dt><samp>start_frame</samp></dt>
  31842. <dd><p>A number representing position of the first frame with respect to the telecine
  31843. pattern. This is to be used if the stream is cut. The default value is <code>0</code>.
  31844. </p></dd>
  31845. </dl>
  31846. <a name="dilation"></a>
  31847. <h3 class="section">39.60 dilation<span class="pull-right"><a class="anchor hidden-xs" href="#dilation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dilation" aria-hidden="true">TOC</a></span></h3>
  31848. <p>Apply dilation effect to the video.
  31849. </p>
  31850. <p>This filter replaces the pixel by the local(3x3) maximum.
  31851. </p>
  31852. <p>It accepts the following options:
  31853. </p>
  31854. <dl compact="compact">
  31855. <dt><samp>threshold0</samp></dt>
  31856. <dt><samp>threshold1</samp></dt>
  31857. <dt><samp>threshold2</samp></dt>
  31858. <dt><samp>threshold3</samp></dt>
  31859. <dd><p>Limit the maximum change for each plane, default is 65535.
  31860. If 0, plane will remain unchanged.
  31861. </p>
  31862. </dd>
  31863. <dt><samp>coordinates</samp></dt>
  31864. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  31865. pixels are used.
  31866. </p>
  31867. <p>Flags to local 3x3 coordinates maps like this:
  31868. </p>
  31869. <p>1 2 3
  31870. 4 5
  31871. 6 7 8
  31872. </p></dd>
  31873. </dl>
  31874. <a name="Commands-72"></a>
  31875. <h4 class="subsection">39.60.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-72" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-72" aria-hidden="true">TOC</a></span></h4>
  31876. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  31877. </p>
  31878. <a name="displace"></a>
  31879. <h3 class="section">39.61 displace<span class="pull-right"><a class="anchor hidden-xs" href="#displace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-displace" aria-hidden="true">TOC</a></span></h3>
  31880. <p>Displace pixels as indicated by second and third input stream.
  31881. </p>
  31882. <p>It takes three input streams and outputs one stream, the first input is the
  31883. source, and second and third input are displacement maps.
  31884. </p>
  31885. <p>The second input specifies how much to displace pixels along the
  31886. x-axis, while the third input specifies how much to displace pixels
  31887. along the y-axis.
  31888. If one of displacement map streams terminates, last frame from that
  31889. displacement map will be used.
  31890. </p>
  31891. <p>Note that once generated, displacements maps can be reused over and over again.
  31892. </p>
  31893. <p>A description of the accepted options follows.
  31894. </p>
  31895. <dl compact="compact">
  31896. <dt><samp>edge</samp></dt>
  31897. <dd><p>Set displace behavior for pixels that are out of range.
  31898. </p>
  31899. <p>Available values are:
  31900. </p><dl compact="compact">
  31901. <dt>&lsquo;<samp>blank</samp>&rsquo;</dt>
  31902. <dd><p>Missing pixels are replaced by black pixels.
  31903. </p>
  31904. </dd>
  31905. <dt>&lsquo;<samp>smear</samp>&rsquo;</dt>
  31906. <dd><p>Adjacent pixels will spread out to replace missing pixels.
  31907. </p>
  31908. </dd>
  31909. <dt>&lsquo;<samp>wrap</samp>&rsquo;</dt>
  31910. <dd><p>Out of range pixels are wrapped so they point to pixels of other side.
  31911. </p>
  31912. </dd>
  31913. <dt>&lsquo;<samp>mirror</samp>&rsquo;</dt>
  31914. <dd><p>Out of range pixels will be replaced with mirrored pixels.
  31915. </p></dd>
  31916. </dl>
  31917. <p>Default is &lsquo;<samp>smear</samp>&rsquo;.
  31918. </p>
  31919. </dd>
  31920. </dl>
  31921. <a name="Examples-96"></a>
  31922. <h4 class="subsection">39.61.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-96" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-96" aria-hidden="true">TOC</a></span></h4>
  31923. <ul>
  31924. <li> Add ripple effect to rgb input of video size hd720:
  31925. <div class="example">
  31926. <pre class="example">ffmpeg -i INPUT -f lavfi -i nullsrc=s=hd720,lutrgb=128:128:128 -f lavfi -i nullsrc=s=hd720,geq='r=128+30*sin(2*PI*X/400+T):g=128+30*sin(2*PI*X/400+T):b=128+30*sin(2*PI*X/400+T)' -lavfi '[0][1][2]displace' OUTPUT
  31927. </pre></div>
  31928. </li><li> Add wave effect to rgb input of video size hd720:
  31929. <div class="example">
  31930. <pre class="example">ffmpeg -i INPUT -f lavfi -i nullsrc=hd720,geq='r=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):g=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):b=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T))' -lavfi '[1]split[x][y],[0][x][y]displace' OUTPUT
  31931. </pre></div>
  31932. </li></ul>
  31933. <span id="dnn_005fprocessing"></span><a name="dnn_005fprocessing-1"></a>
  31934. <h3 class="section">39.62 dnn_processing<span class="pull-right"><a class="anchor hidden-xs" href="#dnn_005fprocessing-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dnn_005fprocessing-1" aria-hidden="true">TOC</a></span></h3>
  31935. <p>Do image processing with deep neural networks. It works together with another filter
  31936. which converts the pixel format of the Frame to what the dnn network requires.
  31937. </p>
  31938. <p>The filter accepts the following options:
  31939. </p>
  31940. <dl compact="compact">
  31941. <dt><samp>dnn_backend</samp></dt>
  31942. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  31943. the following values:
  31944. </p>
  31945. <dl compact="compact">
  31946. <dt>&lsquo;<samp>native</samp>&rsquo;</dt>
  31947. <dd><p>Native implementation of DNN loading and execution.
  31948. </p>
  31949. </dd>
  31950. <dt>&lsquo;<samp>tensorflow</samp>&rsquo;</dt>
  31951. <dd><p>TensorFlow backend. To enable this backend you
  31952. need to install the TensorFlow for C library (see
  31953. <a href="https://www.tensorflow.org/install/install_c">https://www.tensorflow.org/install/install_c</a>) and configure FFmpeg with
  31954. <code>--enable-libtensorflow</code>
  31955. </p>
  31956. </dd>
  31957. <dt>&lsquo;<samp>openvino</samp>&rsquo;</dt>
  31958. <dd><p>OpenVINO backend. To enable this backend you
  31959. need to build and install the OpenVINO for C library (see
  31960. <a 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
  31961. <code>--enable-libopenvino</code> (&ndash;extra-cflags=-I... &ndash;extra-ldflags=-L... might
  31962. be needed if the header files and libraries are not installed into system path)
  31963. </p>
  31964. </dd>
  31965. </dl>
  31966. <p>Default value is &lsquo;<samp>native</samp>&rsquo;.
  31967. </p>
  31968. </dd>
  31969. <dt><samp>model</samp></dt>
  31970. <dd><p>Set path to model file specifying network architecture and its parameters.
  31971. Note that different backends use different file formats. TensorFlow, OpenVINO and native
  31972. backend can load files for only its format.
  31973. </p>
  31974. <p>Native model file (.model) can be generated from TensorFlow model file (.pb) by using tools/python/convert.py
  31975. </p>
  31976. </dd>
  31977. <dt><samp>input</samp></dt>
  31978. <dd><p>Set the input name of the dnn network.
  31979. </p>
  31980. </dd>
  31981. <dt><samp>output</samp></dt>
  31982. <dd><p>Set the output name of the dnn network.
  31983. </p>
  31984. </dd>
  31985. <dt><samp>async</samp></dt>
  31986. <dd><p>use DNN async execution if set (default: set),
  31987. roll back to sync execution if the backend does not support async.
  31988. </p>
  31989. </dd>
  31990. </dl>
  31991. <a name="Examples-97"></a>
  31992. <h4 class="subsection">39.62.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-97" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-97" aria-hidden="true">TOC</a></span></h4>
  31993. <ul>
  31994. <li> Remove rain in rgb24 frame with can.pb (see <a href="#derain">derain</a> filter):
  31995. <div class="example">
  31996. <pre class="example">./ffmpeg -i rain.jpg -vf format=rgb24,dnn_processing=dnn_backend=tensorflow:model=can.pb:input=x:output=y derain.jpg
  31997. </pre></div>
  31998. </li><li> Halve the pixel value of the frame with format gray32f:
  31999. <div class="example">
  32000. <pre class="example">ffmpeg -i input.jpg -vf format=grayf32,dnn_processing=model=halve_gray_float.model:input=dnn_in:output=dnn_out:dnn_backend=native -y out.native.png
  32001. </pre></div>
  32002. </li><li> Handle the Y channel with srcnn.pb (see <a href="#sr">sr</a> filter) for frame with yuv420p (planar YUV formats supported):
  32003. <div class="example">
  32004. <pre class="example">./ffmpeg -i 480p.jpg -vf format=yuv420p,scale=w=iw*2:h=ih*2,dnn_processing=dnn_backend=tensorflow:model=srcnn.pb:input=x:output=y -y srcnn.jpg
  32005. </pre></div>
  32006. </li><li> Handle the Y channel with espcn.pb (see <a href="#sr">sr</a> filter), which changes frame size, for format yuv420p (planar YUV formats supported):
  32007. <div class="example">
  32008. <pre class="example">./ffmpeg -i 480p.jpg -vf format=yuv420p,dnn_processing=dnn_backend=tensorflow:model=espcn.pb:input=x:output=y -y tmp.espcn.jpg
  32009. </pre></div>
  32010. </li></ul>
  32011. <a name="drawbox"></a>
  32012. <h3 class="section">39.63 drawbox<span class="pull-right"><a class="anchor hidden-xs" href="#drawbox" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawbox" aria-hidden="true">TOC</a></span></h3>
  32013. <p>Draw a colored box on the input image.
  32014. </p>
  32015. <p>It accepts the following parameters:
  32016. </p>
  32017. <dl compact="compact">
  32018. <dt><samp>x</samp></dt>
  32019. <dt><samp>y</samp></dt>
  32020. <dd><p>The expressions which specify the top left corner coordinates of the box. It defaults to 0.
  32021. </p>
  32022. </dd>
  32023. <dt><samp>width, w</samp></dt>
  32024. <dt><samp>height, h</samp></dt>
  32025. <dd><p>The expressions which specify the width and height of the box; if 0 they are interpreted as
  32026. the input width and height. It defaults to 0.
  32027. </p>
  32028. </dd>
  32029. <dt><samp>color, c</samp></dt>
  32030. <dd><p>Specify the color of the box to write. For the general syntax of this option,
  32031. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>. If the special
  32032. value <code>invert</code> is used, the box edge color is the same as the
  32033. video with inverted luma.
  32034. </p>
  32035. </dd>
  32036. <dt><samp>thickness, t</samp></dt>
  32037. <dd><p>The expression which sets the thickness of the box edge.
  32038. A value of <code>fill</code> will create a filled box. Default value is <code>3</code>.
  32039. </p>
  32040. <p>See below for the list of accepted constants.
  32041. </p>
  32042. </dd>
  32043. <dt><samp>replace</samp></dt>
  32044. <dd><p>Applicable if the input has alpha. With value <code>1</code>, the pixels of the painted box
  32045. will overwrite the video&rsquo;s color and alpha pixels.
  32046. Default is <code>0</code>, which composites the box onto the input, leaving the video&rsquo;s alpha intact.
  32047. </p></dd>
  32048. </dl>
  32049. <p>The parameters for <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> and <var>t</var> are expressions containing the
  32050. following constants:
  32051. </p>
  32052. <dl compact="compact">
  32053. <dt><samp>dar</samp></dt>
  32054. <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
  32055. </p>
  32056. </dd>
  32057. <dt><samp>hsub</samp></dt>
  32058. <dt><samp>vsub</samp></dt>
  32059. <dd><p>horizontal and vertical chroma subsample values. For example for the
  32060. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  32061. </p>
  32062. </dd>
  32063. <dt><samp>in_h, ih</samp></dt>
  32064. <dt><samp>in_w, iw</samp></dt>
  32065. <dd><p>The input width and height.
  32066. </p>
  32067. </dd>
  32068. <dt><samp>sar</samp></dt>
  32069. <dd><p>The input sample aspect ratio.
  32070. </p>
  32071. </dd>
  32072. <dt><samp>x</samp></dt>
  32073. <dt><samp>y</samp></dt>
  32074. <dd><p>The x and y offset coordinates where the box is drawn.
  32075. </p>
  32076. </dd>
  32077. <dt><samp>w</samp></dt>
  32078. <dt><samp>h</samp></dt>
  32079. <dd><p>The width and height of the drawn box.
  32080. </p>
  32081. </dd>
  32082. <dt><samp>t</samp></dt>
  32083. <dd><p>The thickness of the drawn box.
  32084. </p>
  32085. <p>These constants allow the <var>x</var>, <var>y</var>, <var>w</var>, <var>h</var> and <var>t</var> expressions to refer to
  32086. each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
  32087. </p>
  32088. </dd>
  32089. </dl>
  32090. <a name="Examples-98"></a>
  32091. <h4 class="subsection">39.63.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-98" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-98" aria-hidden="true">TOC</a></span></h4>
  32092. <ul>
  32093. <li> Draw a black box around the edge of the input image:
  32094. <div class="example">
  32095. <pre class="example">drawbox
  32096. </pre></div>
  32097. </li><li> Draw a box with color red and an opacity of 50%:
  32098. <div class="example">
  32099. <pre class="example">drawbox=10:20:200:60:red@0.5
  32100. </pre></div>
  32101. <p>The previous example can be specified as:
  32102. </p><div class="example">
  32103. <pre class="example">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
  32104. </pre></div>
  32105. </li><li> Fill the box with pink color:
  32106. <div class="example">
  32107. <pre class="example">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
  32108. </pre></div>
  32109. </li><li> Draw a 2-pixel red 2.40:1 mask:
  32110. <div class="example">
  32111. <pre class="example">drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
  32112. </pre></div>
  32113. </li></ul>
  32114. <a name="Commands-73"></a>
  32115. <h4 class="subsection">39.63.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-73" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-73" aria-hidden="true">TOC</a></span></h4>
  32116. <p>This filter supports same commands as options.
  32117. The command accepts the same syntax of the corresponding option.
  32118. </p>
  32119. <p>If the specified expression is not valid, it is kept at its current
  32120. value.
  32121. </p>
  32122. <span id="drawgraph"></span><a name="drawgraph-1"></a>
  32123. <h3 class="section">39.64 drawgraph<span class="pull-right"><a class="anchor hidden-xs" href="#drawgraph-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawgraph-1" aria-hidden="true">TOC</a></span></h3>
  32124. <p>Draw a graph using input video metadata.
  32125. </p>
  32126. <p>It accepts the following parameters:
  32127. </p>
  32128. <dl compact="compact">
  32129. <dt><samp>m1</samp></dt>
  32130. <dd><p>Set 1st frame metadata key from which metadata values will be used to draw a graph.
  32131. </p>
  32132. </dd>
  32133. <dt><samp>fg1</samp></dt>
  32134. <dd><p>Set 1st foreground color expression.
  32135. </p>
  32136. </dd>
  32137. <dt><samp>m2</samp></dt>
  32138. <dd><p>Set 2nd frame metadata key from which metadata values will be used to draw a graph.
  32139. </p>
  32140. </dd>
  32141. <dt><samp>fg2</samp></dt>
  32142. <dd><p>Set 2nd foreground color expression.
  32143. </p>
  32144. </dd>
  32145. <dt><samp>m3</samp></dt>
  32146. <dd><p>Set 3rd frame metadata key from which metadata values will be used to draw a graph.
  32147. </p>
  32148. </dd>
  32149. <dt><samp>fg3</samp></dt>
  32150. <dd><p>Set 3rd foreground color expression.
  32151. </p>
  32152. </dd>
  32153. <dt><samp>m4</samp></dt>
  32154. <dd><p>Set 4th frame metadata key from which metadata values will be used to draw a graph.
  32155. </p>
  32156. </dd>
  32157. <dt><samp>fg4</samp></dt>
  32158. <dd><p>Set 4th foreground color expression.
  32159. </p>
  32160. </dd>
  32161. <dt><samp>min</samp></dt>
  32162. <dd><p>Set minimal value of metadata value.
  32163. </p>
  32164. </dd>
  32165. <dt><samp>max</samp></dt>
  32166. <dd><p>Set maximal value of metadata value.
  32167. </p>
  32168. </dd>
  32169. <dt><samp>bg</samp></dt>
  32170. <dd><p>Set graph background color. Default is white.
  32171. </p>
  32172. </dd>
  32173. <dt><samp>mode</samp></dt>
  32174. <dd><p>Set graph mode.
  32175. </p>
  32176. <p>Available values for mode is:
  32177. </p><dl compact="compact">
  32178. <dt>&lsquo;<samp>bar</samp>&rsquo;</dt>
  32179. <dt>&lsquo;<samp>dot</samp>&rsquo;</dt>
  32180. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  32181. </dl>
  32182. <p>Default is <code>line</code>.
  32183. </p>
  32184. </dd>
  32185. <dt><samp>slide</samp></dt>
  32186. <dd><p>Set slide mode.
  32187. </p>
  32188. <p>Available values for slide is:
  32189. </p><dl compact="compact">
  32190. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  32191. <dd><p>Draw new frame when right border is reached.
  32192. </p>
  32193. </dd>
  32194. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  32195. <dd><p>Replace old columns with new ones.
  32196. </p>
  32197. </dd>
  32198. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  32199. <dd><p>Scroll from right to left.
  32200. </p>
  32201. </dd>
  32202. <dt>&lsquo;<samp>rscroll</samp>&rsquo;</dt>
  32203. <dd><p>Scroll from left to right.
  32204. </p>
  32205. </dd>
  32206. <dt>&lsquo;<samp>picture</samp>&rsquo;</dt>
  32207. <dd><p>Draw single picture.
  32208. </p></dd>
  32209. </dl>
  32210. <p>Default is <code>frame</code>.
  32211. </p>
  32212. </dd>
  32213. <dt><samp>size</samp></dt>
  32214. <dd><p>Set size of graph video. For the syntax of this option, check the
  32215. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  32216. The default value is <code>900x256</code>.
  32217. </p>
  32218. </dd>
  32219. <dt><samp>rate, r</samp></dt>
  32220. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  32221. </p>
  32222. <p>The foreground color expressions can use the following variables:
  32223. </p><dl compact="compact">
  32224. <dt><samp>MIN</samp></dt>
  32225. <dd><p>Minimal value of metadata value.
  32226. </p>
  32227. </dd>
  32228. <dt><samp>MAX</samp></dt>
  32229. <dd><p>Maximal value of metadata value.
  32230. </p>
  32231. </dd>
  32232. <dt><samp>VAL</samp></dt>
  32233. <dd><p>Current metadata key value.
  32234. </p></dd>
  32235. </dl>
  32236. <p>The color is defined as 0xAABBGGRR.
  32237. </p></dd>
  32238. </dl>
  32239. <p>Example using metadata from <a href="#signalstats">signalstats</a> filter:
  32240. </p><div class="example">
  32241. <pre class="example">signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
  32242. </pre></div>
  32243. <p>Example using metadata from <a href="#ebur128">ebur128</a> filter:
  32244. </p><div class="example">
  32245. <pre class="example">ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
  32246. </pre></div>
  32247. <a name="drawgrid"></a>
  32248. <h3 class="section">39.65 drawgrid<span class="pull-right"><a class="anchor hidden-xs" href="#drawgrid" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawgrid" aria-hidden="true">TOC</a></span></h3>
  32249. <p>Draw a grid on the input image.
  32250. </p>
  32251. <p>It accepts the following parameters:
  32252. </p>
  32253. <dl compact="compact">
  32254. <dt><samp>x</samp></dt>
  32255. <dt><samp>y</samp></dt>
  32256. <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
  32257. </p>
  32258. </dd>
  32259. <dt><samp>width, w</samp></dt>
  32260. <dt><samp>height, h</samp></dt>
  32261. <dd><p>The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
  32262. input width and height, respectively, minus <code>thickness</code>, so image gets
  32263. framed. Default to 0.
  32264. </p>
  32265. </dd>
  32266. <dt><samp>color, c</samp></dt>
  32267. <dd><p>Specify the color of the grid. For the general syntax of this option,
  32268. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>. If the special
  32269. value <code>invert</code> is used, the grid color is the same as the
  32270. video with inverted luma.
  32271. </p>
  32272. </dd>
  32273. <dt><samp>thickness, t</samp></dt>
  32274. <dd><p>The expression which sets the thickness of the grid line. Default value is <code>1</code>.
  32275. </p>
  32276. <p>See below for the list of accepted constants.
  32277. </p>
  32278. </dd>
  32279. <dt><samp>replace</samp></dt>
  32280. <dd><p>Applicable if the input has alpha. With <code>1</code> the pixels of the painted grid
  32281. will overwrite the video&rsquo;s color and alpha pixels.
  32282. Default is <code>0</code>, which composites the grid onto the input, leaving the video&rsquo;s alpha intact.
  32283. </p></dd>
  32284. </dl>
  32285. <p>The parameters for <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> and <var>t</var> are expressions containing the
  32286. following constants:
  32287. </p>
  32288. <dl compact="compact">
  32289. <dt><samp>dar</samp></dt>
  32290. <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
  32291. </p>
  32292. </dd>
  32293. <dt><samp>hsub</samp></dt>
  32294. <dt><samp>vsub</samp></dt>
  32295. <dd><p>horizontal and vertical chroma subsample values. For example for the
  32296. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  32297. </p>
  32298. </dd>
  32299. <dt><samp>in_h, ih</samp></dt>
  32300. <dt><samp>in_w, iw</samp></dt>
  32301. <dd><p>The input grid cell width and height.
  32302. </p>
  32303. </dd>
  32304. <dt><samp>sar</samp></dt>
  32305. <dd><p>The input sample aspect ratio.
  32306. </p>
  32307. </dd>
  32308. <dt><samp>x</samp></dt>
  32309. <dt><samp>y</samp></dt>
  32310. <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
  32311. </p>
  32312. </dd>
  32313. <dt><samp>w</samp></dt>
  32314. <dt><samp>h</samp></dt>
  32315. <dd><p>The width and height of the drawn cell.
  32316. </p>
  32317. </dd>
  32318. <dt><samp>t</samp></dt>
  32319. <dd><p>The thickness of the drawn cell.
  32320. </p>
  32321. <p>These constants allow the <var>x</var>, <var>y</var>, <var>w</var>, <var>h</var> and <var>t</var> expressions to refer to
  32322. each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
  32323. </p>
  32324. </dd>
  32325. </dl>
  32326. <a name="Examples-99"></a>
  32327. <h4 class="subsection">39.65.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-99" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-99" aria-hidden="true">TOC</a></span></h4>
  32328. <ul>
  32329. <li> Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
  32330. <div class="example">
  32331. <pre class="example">drawgrid=width=100:height=100:thickness=2:color=red@0.5
  32332. </pre></div>
  32333. </li><li> Draw a white 3x3 grid with an opacity of 50%:
  32334. <div class="example">
  32335. <pre class="example">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
  32336. </pre></div>
  32337. </li></ul>
  32338. <a name="Commands-74"></a>
  32339. <h4 class="subsection">39.65.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-74" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-74" aria-hidden="true">TOC</a></span></h4>
  32340. <p>This filter supports same commands as options.
  32341. The command accepts the same syntax of the corresponding option.
  32342. </p>
  32343. <p>If the specified expression is not valid, it is kept at its current
  32344. value.
  32345. </p>
  32346. <span id="drawtext"></span><a name="drawtext-1"></a>
  32347. <h3 class="section">39.66 drawtext<span class="pull-right"><a class="anchor hidden-xs" href="#drawtext-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawtext-1" aria-hidden="true">TOC</a></span></h3>
  32348. <p>Draw a text string or text from a specified file on top of a video, using the
  32349. libfreetype library.
  32350. </p>
  32351. <p>To enable compilation of this filter, you need to configure FFmpeg with
  32352. <code>--enable-libfreetype</code>.
  32353. To enable default font fallback and the <var>font</var> option you need to
  32354. configure FFmpeg with <code>--enable-libfontconfig</code>.
  32355. To enable the <var>text_shaping</var> option, you need to configure FFmpeg with
  32356. <code>--enable-libfribidi</code>.
  32357. </p>
  32358. <a name="Syntax-2"></a>
  32359. <h4 class="subsection">39.66.1 Syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Syntax-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Syntax-2" aria-hidden="true">TOC</a></span></h4>
  32360. <p>It accepts the following parameters:
  32361. </p>
  32362. <dl compact="compact">
  32363. <dt><samp>box</samp></dt>
  32364. <dd><p>Used to draw a box around text using the background color.
  32365. The value must be either 1 (enable) or 0 (disable).
  32366. The default value of <var>box</var> is 0.
  32367. </p>
  32368. </dd>
  32369. <dt><samp>boxborderw</samp></dt>
  32370. <dd><p>Set the width of the border to be drawn around the box using <var>boxcolor</var>.
  32371. The default value of <var>boxborderw</var> is 0.
  32372. </p>
  32373. </dd>
  32374. <dt><samp>boxcolor</samp></dt>
  32375. <dd><p>The color to be used for drawing box around text. For the syntax of this
  32376. option, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  32377. </p>
  32378. <p>The default value of <var>boxcolor</var> is &quot;white&quot;.
  32379. </p>
  32380. </dd>
  32381. <dt><samp>line_spacing</samp></dt>
  32382. <dd><p>Set the line spacing in pixels of the border to be drawn around the box using <var>box</var>.
  32383. The default value of <var>line_spacing</var> is 0.
  32384. </p>
  32385. </dd>
  32386. <dt><samp>borderw</samp></dt>
  32387. <dd><p>Set the width of the border to be drawn around the text using <var>bordercolor</var>.
  32388. The default value of <var>borderw</var> is 0.
  32389. </p>
  32390. </dd>
  32391. <dt><samp>bordercolor</samp></dt>
  32392. <dd><p>Set the color to be used for drawing border around text. For the syntax of this
  32393. option, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  32394. </p>
  32395. <p>The default value of <var>bordercolor</var> is &quot;black&quot;.
  32396. </p>
  32397. </dd>
  32398. <dt><samp>expansion</samp></dt>
  32399. <dd><p>Select how the <var>text</var> is expanded. Can be either <code>none</code>,
  32400. <code>strftime</code> (deprecated) or
  32401. <code>normal</code> (default). See the <a href="#drawtext_005fexpansion">Text expansion</a> section
  32402. below for details.
  32403. </p>
  32404. </dd>
  32405. <dt><samp>basetime</samp></dt>
  32406. <dd><p>Set a start time for the count. Value is in microseconds. Only applied
  32407. in the deprecated strftime expansion mode. To emulate in normal expansion
  32408. mode use the <code>pts</code> function, supplying the start time (in seconds)
  32409. as the second argument.
  32410. </p>
  32411. </dd>
  32412. <dt><samp>fix_bounds</samp></dt>
  32413. <dd><p>If true, check and fix text coords to avoid clipping.
  32414. </p>
  32415. </dd>
  32416. <dt><samp>fontcolor</samp></dt>
  32417. <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
  32418. the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  32419. </p>
  32420. <p>The default value of <var>fontcolor</var> is &quot;black&quot;.
  32421. </p>
  32422. </dd>
  32423. <dt><samp>fontcolor_expr</samp></dt>
  32424. <dd><p>String which is expanded the same way as <var>text</var> to obtain dynamic
  32425. <var>fontcolor</var> value. By default this option has empty value and is not
  32426. processed. When this option is set, it overrides <var>fontcolor</var> option.
  32427. </p>
  32428. </dd>
  32429. <dt><samp>font</samp></dt>
  32430. <dd><p>The font family to be used for drawing text. By default Sans.
  32431. </p>
  32432. </dd>
  32433. <dt><samp>fontfile</samp></dt>
  32434. <dd><p>The font file to be used for drawing text. The path must be included.
  32435. This parameter is mandatory if the fontconfig support is disabled.
  32436. </p>
  32437. </dd>
  32438. <dt><samp>alpha</samp></dt>
  32439. <dd><p>Draw the text applying alpha blending. The value can
  32440. be a number between 0.0 and 1.0.
  32441. The expression accepts the same variables <var>x, y</var> as well.
  32442. The default value is 1.
  32443. Please see <var>fontcolor_expr</var>.
  32444. </p>
  32445. </dd>
  32446. <dt><samp>fontsize</samp></dt>
  32447. <dd><p>The font size to be used for drawing text.
  32448. The default value of <var>fontsize</var> is 16.
  32449. </p>
  32450. </dd>
  32451. <dt><samp>text_shaping</samp></dt>
  32452. <dd><p>If set to 1, attempt to shape the text (for example, reverse the order of
  32453. right-to-left text and join Arabic characters) before drawing it.
  32454. Otherwise, just draw the text exactly as given.
  32455. By default 1 (if supported).
  32456. </p>
  32457. </dd>
  32458. <dt><samp>ft_load_flags</samp></dt>
  32459. <dd><p>The flags to be used for loading the fonts.
  32460. </p>
  32461. <p>The flags map the corresponding flags supported by libfreetype, and are
  32462. a combination of the following values:
  32463. </p><dl compact="compact">
  32464. <dt><var>default</var></dt>
  32465. <dt><var>no_scale</var></dt>
  32466. <dt><var>no_hinting</var></dt>
  32467. <dt><var>render</var></dt>
  32468. <dt><var>no_bitmap</var></dt>
  32469. <dt><var>vertical_layout</var></dt>
  32470. <dt><var>force_autohint</var></dt>
  32471. <dt><var>crop_bitmap</var></dt>
  32472. <dt><var>pedantic</var></dt>
  32473. <dt><var>ignore_global_advance_width</var></dt>
  32474. <dt><var>no_recurse</var></dt>
  32475. <dt><var>ignore_transform</var></dt>
  32476. <dt><var>monochrome</var></dt>
  32477. <dt><var>linear_design</var></dt>
  32478. <dt><var>no_autohint</var></dt>
  32479. </dl>
  32480. <p>Default value is &quot;default&quot;.
  32481. </p>
  32482. <p>For more information consult the documentation for the FT_LOAD_*
  32483. libfreetype flags.
  32484. </p>
  32485. </dd>
  32486. <dt><samp>shadowcolor</samp></dt>
  32487. <dd><p>The color to be used for drawing a shadow behind the drawn text. For the
  32488. syntax of this option, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the
  32489. ffmpeg-utils manual</a>.
  32490. </p>
  32491. <p>The default value of <var>shadowcolor</var> is &quot;black&quot;.
  32492. </p>
  32493. </dd>
  32494. <dt><samp>shadowx</samp></dt>
  32495. <dt><samp>shadowy</samp></dt>
  32496. <dd><p>The x and y offsets for the text shadow position with respect to the
  32497. position of the text. They can be either positive or negative
  32498. values. The default value for both is &quot;0&quot;.
  32499. </p>
  32500. </dd>
  32501. <dt><samp>start_number</samp></dt>
  32502. <dd><p>The starting frame number for the n/frame_num variable. The default value
  32503. is &quot;0&quot;.
  32504. </p>
  32505. </dd>
  32506. <dt><samp>tabsize</samp></dt>
  32507. <dd><p>The size in number of spaces to use for rendering the tab.
  32508. Default value is 4.
  32509. </p>
  32510. </dd>
  32511. <dt><samp>timecode</samp></dt>
  32512. <dd><p>Set the initial timecode representation in &quot;hh:mm:ss[:;.]ff&quot;
  32513. format. It can be used with or without text parameter. <var>timecode_rate</var>
  32514. option must be specified.
  32515. </p>
  32516. </dd>
  32517. <dt><samp>timecode_rate, rate, r</samp></dt>
  32518. <dd><p>Set the timecode frame rate (timecode only). Value will be rounded to nearest
  32519. integer. Minimum value is &quot;1&quot;.
  32520. Drop-frame timecode is supported for frame rates 30 &amp; 60.
  32521. </p>
  32522. </dd>
  32523. <dt><samp>tc24hmax</samp></dt>
  32524. <dd><p>If set to 1, the output of the timecode option will wrap around at 24 hours.
  32525. Default is 0 (disabled).
  32526. </p>
  32527. </dd>
  32528. <dt><samp>text</samp></dt>
  32529. <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
  32530. encoded characters.
  32531. This parameter is mandatory if no file is specified with the parameter
  32532. <var>textfile</var>.
  32533. </p>
  32534. </dd>
  32535. <dt><samp>textfile</samp></dt>
  32536. <dd><p>A text file containing text to be drawn. The text must be a sequence
  32537. of UTF-8 encoded characters.
  32538. </p>
  32539. <p>This parameter is mandatory if no text string is specified with the
  32540. parameter <var>text</var>.
  32541. </p>
  32542. <p>If both <var>text</var> and <var>textfile</var> are specified, an error is thrown.
  32543. </p>
  32544. </dd>
  32545. <dt><samp>reload</samp></dt>
  32546. <dd><p>If set to 1, the <var>textfile</var> will be reloaded before each frame.
  32547. Be sure to update it atomically, or it may be read partially, or even fail.
  32548. </p>
  32549. </dd>
  32550. <dt><samp>x</samp></dt>
  32551. <dt><samp>y</samp></dt>
  32552. <dd><p>The expressions which specify the offsets where text will be drawn
  32553. within the video frame. They are relative to the top/left border of the
  32554. output image.
  32555. </p>
  32556. <p>The default value of <var>x</var> and <var>y</var> is &quot;0&quot;.
  32557. </p>
  32558. <p>See below for the list of accepted constants and functions.
  32559. </p></dd>
  32560. </dl>
  32561. <p>The parameters for <var>x</var> and <var>y</var> are expressions containing the
  32562. following constants and functions:
  32563. </p>
  32564. <dl compact="compact">
  32565. <dt><samp>dar</samp></dt>
  32566. <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
  32567. </p>
  32568. </dd>
  32569. <dt><samp>hsub</samp></dt>
  32570. <dt><samp>vsub</samp></dt>
  32571. <dd><p>horizontal and vertical chroma subsample values. For example for the
  32572. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  32573. </p>
  32574. </dd>
  32575. <dt><samp>line_h, lh</samp></dt>
  32576. <dd><p>the height of each text line
  32577. </p>
  32578. </dd>
  32579. <dt><samp>main_h, h, H</samp></dt>
  32580. <dd><p>the input height
  32581. </p>
  32582. </dd>
  32583. <dt><samp>main_w, w, W</samp></dt>
  32584. <dd><p>the input width
  32585. </p>
  32586. </dd>
  32587. <dt><samp>max_glyph_a, ascent</samp></dt>
  32588. <dd><p>the maximum distance from the baseline to the highest/upper grid
  32589. coordinate used to place a glyph outline point, for all the rendered
  32590. glyphs.
  32591. It is a positive value, due to the grid&rsquo;s orientation with the Y axis
  32592. upwards.
  32593. </p>
  32594. </dd>
  32595. <dt><samp>max_glyph_d, descent</samp></dt>
  32596. <dd><p>the maximum distance from the baseline to the lowest grid coordinate
  32597. used to place a glyph outline point, for all the rendered glyphs.
  32598. This is a negative value, due to the grid&rsquo;s orientation, with the Y axis
  32599. upwards.
  32600. </p>
  32601. </dd>
  32602. <dt><samp>max_glyph_h</samp></dt>
  32603. <dd><p>maximum glyph height, that is the maximum height for all the glyphs
  32604. contained in the rendered text, it is equivalent to <var>ascent</var> -
  32605. <var>descent</var>.
  32606. </p>
  32607. </dd>
  32608. <dt><samp>max_glyph_w</samp></dt>
  32609. <dd><p>maximum glyph width, that is the maximum width for all the glyphs
  32610. contained in the rendered text
  32611. </p>
  32612. </dd>
  32613. <dt><samp>n</samp></dt>
  32614. <dd><p>the number of input frame, starting from 0
  32615. </p>
  32616. </dd>
  32617. <dt><samp>rand(min, max)</samp></dt>
  32618. <dd><p>return a random number included between <var>min</var> and <var>max</var>
  32619. </p>
  32620. </dd>
  32621. <dt><samp>sar</samp></dt>
  32622. <dd><p>The input sample aspect ratio.
  32623. </p>
  32624. </dd>
  32625. <dt><samp>t</samp></dt>
  32626. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  32627. </p>
  32628. </dd>
  32629. <dt><samp>text_h, th</samp></dt>
  32630. <dd><p>the height of the rendered text
  32631. </p>
  32632. </dd>
  32633. <dt><samp>text_w, tw</samp></dt>
  32634. <dd><p>the width of the rendered text
  32635. </p>
  32636. </dd>
  32637. <dt><samp>x</samp></dt>
  32638. <dt><samp>y</samp></dt>
  32639. <dd><p>the x and y offset coordinates where the text is drawn.
  32640. </p>
  32641. <p>These parameters allow the <var>x</var> and <var>y</var> expressions to refer
  32642. to each other, so you can for example specify <code>y=x/dar</code>.
  32643. </p>
  32644. </dd>
  32645. <dt><samp>pict_type</samp></dt>
  32646. <dd><p>A one character description of the current frame&rsquo;s picture type.
  32647. </p>
  32648. </dd>
  32649. <dt><samp>pkt_pos</samp></dt>
  32650. <dd><p>The current packet&rsquo;s position in the input file or stream
  32651. (in bytes, from the start of the input). A value of -1 indicates
  32652. this info is not available.
  32653. </p>
  32654. </dd>
  32655. <dt><samp>pkt_duration</samp></dt>
  32656. <dd><p>The current packet&rsquo;s duration, in seconds.
  32657. </p>
  32658. </dd>
  32659. <dt><samp>pkt_size</samp></dt>
  32660. <dd><p>The current packet&rsquo;s size (in bytes).
  32661. </p></dd>
  32662. </dl>
  32663. <span id="drawtext_005fexpansion"></span><a name="Text-expansion"></a>
  32664. <h4 class="subsection">39.66.2 Text expansion<span class="pull-right"><a class="anchor hidden-xs" href="#Text-expansion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Text-expansion" aria-hidden="true">TOC</a></span></h4>
  32665. <p>If <samp>expansion</samp> is set to <code>strftime</code>,
  32666. the filter recognizes strftime() sequences in the provided text and
  32667. expands them accordingly. Check the documentation of strftime(). This
  32668. feature is deprecated.
  32669. </p>
  32670. <p>If <samp>expansion</samp> is set to <code>none</code>, the text is printed verbatim.
  32671. </p>
  32672. <p>If <samp>expansion</samp> is set to <code>normal</code> (which is the default),
  32673. the following expansion mechanism is used.
  32674. </p>
  32675. <p>The backslash character &lsquo;<samp>\</samp>&rsquo;, followed by any character, always expands to
  32676. the second character.
  32677. </p>
  32678. <p>Sequences of the form <code>%{...}</code> are expanded. The text between the
  32679. braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
  32680. If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
  32681. they should be escaped.
  32682. </p>
  32683. <p>Note that they probably must also be escaped as the value for the
  32684. <samp>text</samp> option in the filter argument string and as the filter
  32685. argument in the filtergraph description, and possibly also for the shell,
  32686. that makes up to four levels of escaping; using a text file avoids these
  32687. problems.
  32688. </p>
  32689. <p>The following functions are available:
  32690. </p>
  32691. <dl compact="compact">
  32692. <dt><code>expr, e</code></dt>
  32693. <dd><p>The expression evaluation result.
  32694. </p>
  32695. <p>It must take one argument specifying the expression to be evaluated,
  32696. which accepts the same constants and functions as the <var>x</var> and
  32697. <var>y</var> values. Note that not all constants should be used, for
  32698. example the text size is not known when evaluating the expression, so
  32699. the constants <var>text_w</var> and <var>text_h</var> will have an undefined
  32700. value.
  32701. </p>
  32702. </dd>
  32703. <dt><code>expr_int_format, eif</code></dt>
  32704. <dd><p>Evaluate the expression&rsquo;s value and output as formatted integer.
  32705. </p>
  32706. <p>The first argument is the expression to be evaluated, just as for the <var>expr</var> function.
  32707. The second argument specifies the output format. Allowed values are &lsquo;<samp>x</samp>&rsquo;,
  32708. &lsquo;<samp>X</samp>&rsquo;, &lsquo;<samp>d</samp>&rsquo; and &lsquo;<samp>u</samp>&rsquo;. They are treated exactly as in the
  32709. <code>printf</code> function.
  32710. The third parameter is optional and sets the number of positions taken by the output.
  32711. It can be used to add padding with zeros from the left.
  32712. </p>
  32713. </dd>
  32714. <dt><code>gmtime</code></dt>
  32715. <dd><p>The time at which the filter is running, expressed in UTC.
  32716. It can accept an argument: a strftime() format string.
  32717. </p>
  32718. </dd>
  32719. <dt><code>localtime</code></dt>
  32720. <dd><p>The time at which the filter is running, expressed in the local time zone.
  32721. It can accept an argument: a strftime() format string.
  32722. </p>
  32723. </dd>
  32724. <dt><code>metadata</code></dt>
  32725. <dd><p>Frame metadata. Takes one or two arguments.
  32726. </p>
  32727. <p>The first argument is mandatory and specifies the metadata key.
  32728. </p>
  32729. <p>The second argument is optional and specifies a default value, used when the
  32730. metadata key is not found or empty.
  32731. </p>
  32732. <p>Available metadata can be identified by inspecting entries
  32733. starting with TAG included within each frame section
  32734. printed by running <code>ffprobe -show_frames</code>.
  32735. </p>
  32736. <p>String metadata generated in filters leading to
  32737. the drawtext filter are also available.
  32738. </p>
  32739. </dd>
  32740. <dt><code>n, frame_num</code></dt>
  32741. <dd><p>The frame number, starting from 0.
  32742. </p>
  32743. </dd>
  32744. <dt><code>pict_type</code></dt>
  32745. <dd><p>A one character description of the current picture type.
  32746. </p>
  32747. </dd>
  32748. <dt><code>pts</code></dt>
  32749. <dd><p>The timestamp of the current frame.
  32750. It can take up to three arguments.
  32751. </p>
  32752. <p>The first argument is the format of the timestamp; it defaults to <code>flt</code>
  32753. for seconds as a decimal number with microsecond accuracy; <code>hms</code> stands
  32754. for a formatted <var>[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
  32755. <code>gmtime</code> stands for the timestamp of the frame formatted as UTC time;
  32756. <code>localtime</code> stands for the timestamp of the frame formatted as
  32757. local time zone time.
  32758. </p>
  32759. <p>The second argument is an offset added to the timestamp.
  32760. </p>
  32761. <p>If the format is set to <code>hms</code>, a third argument <code>24HH</code> may be
  32762. supplied to present the hour part of the formatted timestamp in 24h format
  32763. (00-23).
  32764. </p>
  32765. <p>If the format is set to <code>localtime</code> or <code>gmtime</code>,
  32766. a third argument may be supplied: a strftime() format string.
  32767. By default, <var>YYYY-MM-DD HH:MM:SS</var> format will be used.
  32768. </p></dd>
  32769. </dl>
  32770. <a name="Commands-75"></a>
  32771. <h4 class="subsection">39.66.3 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-75" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-75" aria-hidden="true">TOC</a></span></h4>
  32772. <p>This filter supports altering parameters via commands:
  32773. </p><dl compact="compact">
  32774. <dt><samp>reinit</samp></dt>
  32775. <dd><p>Alter existing filter parameters.
  32776. </p>
  32777. <p>Syntax for the argument is the same as for filter invocation, e.g.
  32778. </p>
  32779. <div class="example">
  32780. <pre class="example">fontsize=56:fontcolor=green:text='Hello World'
  32781. </pre></div>
  32782. <p>Full filter invocation with sendcmd would look like this:
  32783. </p>
  32784. <div class="example">
  32785. <pre class="example">sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
  32786. </pre></div>
  32787. </dd>
  32788. </dl>
  32789. <p>If the entire argument can&rsquo;t be parsed or applied as valid values then the filter will
  32790. continue with its existing parameters.
  32791. </p>
  32792. <a name="Examples-100"></a>
  32793. <h4 class="subsection">39.66.4 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-100" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-100" aria-hidden="true">TOC</a></span></h4>
  32794. <ul>
  32795. <li> Draw &quot;Test Text&quot; with font FreeSerif, using the default values for the
  32796. optional parameters.
  32797. <div class="example">
  32798. <pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
  32799. </pre></div>
  32800. </li><li> Draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
  32801. and y=50 (counting from the top-left corner of the screen), text is
  32802. yellow with a red box around it. Both the text and the box have an
  32803. opacity of 20%.
  32804. <div class="example">
  32805. <pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
  32806. x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
  32807. </pre></div>
  32808. <p>Note that the double quotes are not necessary if spaces are not used
  32809. within the parameter list.
  32810. </p>
  32811. </li><li> Show the text at the center of the video frame:
  32812. <div class="example">
  32813. <pre class="example">drawtext=&quot;fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2&quot;
  32814. </pre></div>
  32815. </li><li> Show the text at a random position, switching to a new position every 30 seconds:
  32816. <div class="example">
  32817. <pre class="example">drawtext=&quot;fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=if(eq(mod(t\,30)\,0)\,rand(0\,(w-text_w))\,x):y=if(eq(mod(t\,30)\,0)\,rand(0\,(h-text_h))\,y)&quot;
  32818. </pre></div>
  32819. </li><li> Show a text line sliding from right to left in the last row of the video
  32820. frame. The file <samp>LONG_LINE</samp> is assumed to contain a single line
  32821. with no newlines.
  32822. <div class="example">
  32823. <pre class="example">drawtext=&quot;fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t&quot;
  32824. </pre></div>
  32825. </li><li> Show the content of file <samp>CREDITS</samp> off the bottom of the frame and scroll up.
  32826. <div class="example">
  32827. <pre class="example">drawtext=&quot;fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t&quot;
  32828. </pre></div>
  32829. </li><li> Draw a single green letter &quot;g&quot;, at the center of the input video.
  32830. The glyph baseline is placed at half screen height.
  32831. <div class="example">
  32832. <pre class="example">drawtext=&quot;fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent&quot;
  32833. </pre></div>
  32834. </li><li> Show text for 1 second every 3 seconds:
  32835. <div class="example">
  32836. <pre class="example">drawtext=&quot;fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'&quot;
  32837. </pre></div>
  32838. </li><li> Use fontconfig to set the font. Note that the colons need to be escaped.
  32839. <div class="example">
  32840. <pre class="example">drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
  32841. </pre></div>
  32842. </li><li> Draw &quot;Test Text&quot; with font size dependent on height of the video.
  32843. <div class="example">
  32844. <pre class="example">drawtext=&quot;text='Test Text': fontsize=h/30: x=(w-text_w)/2: y=(h-text_h*2)&quot;
  32845. </pre></div>
  32846. </li><li> Print the date of a real-time encoding (see strftime(3)):
  32847. <div class="example">
  32848. <pre class="example">drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
  32849. </pre></div>
  32850. </li><li> Show text fading in and out (appearing/disappearing):
  32851. <div class="example">
  32852. <pre class="example">#!/bin/sh
  32853. DS=1.0 # display start
  32854. DE=10.0 # display end
  32855. FID=1.5 # fade in duration
  32856. FOD=5 # fade out duration
  32857. 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;
  32858. </pre></div>
  32859. </li><li> Horizontally align multiple separate texts. Note that <samp>max_glyph_a</samp>
  32860. and the <samp>fontsize</samp> value are included in the <samp>y</samp> offset.
  32861. <div class="example">
  32862. <pre class="example">drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
  32863. drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
  32864. </pre></div>
  32865. </li><li> Plot special <var>lavf.image2dec.source_basename</var> metadata onto each frame if
  32866. such metadata exists. Otherwise, plot the string &quot;NA&quot;. Note that image2 demuxer
  32867. must have option <samp>-export_path_metadata 1</samp> for the special metadata fields
  32868. to be available for filters.
  32869. <div class="example">
  32870. <pre class="example">drawtext=&quot;fontsize=20:fontcolor=white:fontfile=FreeSans.ttf:text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=10:y=10&quot;
  32871. </pre></div>
  32872. </li></ul>
  32873. <p>For more information about libfreetype, check:
  32874. <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
  32875. </p>
  32876. <p>For more information about fontconfig, check:
  32877. <a href="http://freedesktop.org/software/fontconfig/fontconfig-user.html">http://freedesktop.org/software/fontconfig/fontconfig-user.html</a>.
  32878. </p>
  32879. <p>For more information about libfribidi, check:
  32880. <a href="http://fribidi.org/">http://fribidi.org/</a>.
  32881. </p>
  32882. <a name="edgedetect"></a>
  32883. <h3 class="section">39.67 edgedetect<span class="pull-right"><a class="anchor hidden-xs" href="#edgedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-edgedetect" aria-hidden="true">TOC</a></span></h3>
  32884. <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
  32885. </p>
  32886. <p>The filter accepts the following options:
  32887. </p>
  32888. <dl compact="compact">
  32889. <dt><samp>low</samp></dt>
  32890. <dt><samp>high</samp></dt>
  32891. <dd><p>Set low and high threshold values used by the Canny thresholding
  32892. algorithm.
  32893. </p>
  32894. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  32895. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  32896. by the low threshold.
  32897. </p>
  32898. <p><var>low</var> and <var>high</var> threshold values must be chosen in the range
  32899. [0,1], and <var>low</var> should be lesser or equal to <var>high</var>.
  32900. </p>
  32901. <p>Default value for <var>low</var> is <code>20/255</code>, and default value for <var>high</var>
  32902. is <code>50/255</code>.
  32903. </p>
  32904. </dd>
  32905. <dt><samp>mode</samp></dt>
  32906. <dd><p>Define the drawing mode.
  32907. </p>
  32908. <dl compact="compact">
  32909. <dt>&lsquo;<samp>wires</samp>&rsquo;</dt>
  32910. <dd><p>Draw white/gray wires on black background.
  32911. </p>
  32912. </dd>
  32913. <dt>&lsquo;<samp>colormix</samp>&rsquo;</dt>
  32914. <dd><p>Mix the colors to create a paint/cartoon effect.
  32915. </p>
  32916. </dd>
  32917. <dt>&lsquo;<samp>canny</samp>&rsquo;</dt>
  32918. <dd><p>Apply Canny edge detector on all selected planes.
  32919. </p></dd>
  32920. </dl>
  32921. <p>Default value is <var>wires</var>.
  32922. </p>
  32923. </dd>
  32924. <dt><samp>planes</samp></dt>
  32925. <dd><p>Select planes for filtering. By default all available planes are filtered.
  32926. </p></dd>
  32927. </dl>
  32928. <a name="Examples-101"></a>
  32929. <h4 class="subsection">39.67.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-101" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-101" aria-hidden="true">TOC</a></span></h4>
  32930. <ul>
  32931. <li> Standard edge detection with custom values for the hysteresis thresholding:
  32932. <div class="example">
  32933. <pre class="example">edgedetect=low=0.1:high=0.4
  32934. </pre></div>
  32935. </li><li> Painting effect without thresholding:
  32936. <div class="example">
  32937. <pre class="example">edgedetect=mode=colormix:high=0
  32938. </pre></div>
  32939. </li></ul>
  32940. <a name="elbg"></a>
  32941. <h3 class="section">39.68 elbg<span class="pull-right"><a class="anchor hidden-xs" href="#elbg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-elbg" aria-hidden="true">TOC</a></span></h3>
  32942. <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
  32943. </p>
  32944. <p>For each input image, the filter will compute the optimal mapping from
  32945. the input to the output given the codebook length, that is the number
  32946. of distinct output colors.
  32947. </p>
  32948. <p>This filter accepts the following options.
  32949. </p>
  32950. <dl compact="compact">
  32951. <dt><samp>codebook_length, l</samp></dt>
  32952. <dd><p>Set codebook length. The value must be a positive integer, and
  32953. represents the number of distinct output colors. Default value is 256.
  32954. </p>
  32955. </dd>
  32956. <dt><samp>nb_steps, n</samp></dt>
  32957. <dd><p>Set the maximum number of iterations to apply for computing the optimal
  32958. mapping. The higher the value the better the result and the higher the
  32959. computation time. Default value is 1.
  32960. </p>
  32961. </dd>
  32962. <dt><samp>seed, s</samp></dt>
  32963. <dd><p>Set a random seed, must be an integer included between 0 and
  32964. UINT32_MAX. If not specified, or if explicitly set to -1, the filter
  32965. will try to use a good random seed on a best effort basis.
  32966. </p>
  32967. </dd>
  32968. <dt><samp>pal8</samp></dt>
  32969. <dd><p>Set pal8 output pixel format. This option does not work with codebook
  32970. length greater than 256.
  32971. </p></dd>
  32972. </dl>
  32973. <a name="entropy"></a>
  32974. <h3 class="section">39.69 entropy<span class="pull-right"><a class="anchor hidden-xs" href="#entropy" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-entropy" aria-hidden="true">TOC</a></span></h3>
  32975. <p>Measure graylevel entropy in histogram of color channels of video frames.
  32976. </p>
  32977. <p>It accepts the following parameters:
  32978. </p>
  32979. <dl compact="compact">
  32980. <dt><samp>mode</samp></dt>
  32981. <dd><p>Can be either <var>normal</var> or <var>diff</var>. Default is <var>normal</var>.
  32982. </p>
  32983. <p><var>diff</var> mode measures entropy of histogram delta values, absolute differences
  32984. between neighbour histogram values.
  32985. </p></dd>
  32986. </dl>
  32987. <a name="epx"></a>
  32988. <h3 class="section">39.70 epx<span class="pull-right"><a class="anchor hidden-xs" href="#epx" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-epx" aria-hidden="true">TOC</a></span></h3>
  32989. <p>Apply the EPX magnification filter which is designed for pixel art.
  32990. </p>
  32991. <p>It accepts the following option:
  32992. </p>
  32993. <dl compact="compact">
  32994. <dt><samp>n</samp></dt>
  32995. <dd><p>Set the scaling dimension: <code>2</code> for <code>2xEPX</code>, <code>3</code> for
  32996. <code>3xEPX</code>.
  32997. Default is <code>3</code>.
  32998. </p></dd>
  32999. </dl>
  33000. <a name="eq"></a>
  33001. <h3 class="section">39.71 eq<span class="pull-right"><a class="anchor hidden-xs" href="#eq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eq" aria-hidden="true">TOC</a></span></h3>
  33002. <p>Set brightness, contrast, saturation and approximate gamma adjustment.
  33003. </p>
  33004. <p>The filter accepts the following options:
  33005. </p>
  33006. <dl compact="compact">
  33007. <dt><samp>contrast</samp></dt>
  33008. <dd><p>Set the contrast expression. The value must be a float value in range
  33009. <code>-1000.0</code> to <code>1000.0</code>. The default value is &quot;1&quot;.
  33010. </p>
  33011. </dd>
  33012. <dt><samp>brightness</samp></dt>
  33013. <dd><p>Set the brightness expression. The value must be a float value in
  33014. range <code>-1.0</code> to <code>1.0</code>. The default value is &quot;0&quot;.
  33015. </p>
  33016. </dd>
  33017. <dt><samp>saturation</samp></dt>
  33018. <dd><p>Set the saturation expression. The value must be a float in
  33019. range <code>0.0</code> to <code>3.0</code>. The default value is &quot;1&quot;.
  33020. </p>
  33021. </dd>
  33022. <dt><samp>gamma</samp></dt>
  33023. <dd><p>Set the gamma expression. The value must be a float in range
  33024. <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  33025. </p>
  33026. </dd>
  33027. <dt><samp>gamma_r</samp></dt>
  33028. <dd><p>Set the gamma expression for red. The value must be a float in
  33029. range <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  33030. </p>
  33031. </dd>
  33032. <dt><samp>gamma_g</samp></dt>
  33033. <dd><p>Set the gamma expression for green. The value must be a float in range
  33034. <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  33035. </p>
  33036. </dd>
  33037. <dt><samp>gamma_b</samp></dt>
  33038. <dd><p>Set the gamma expression for blue. The value must be a float in range
  33039. <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  33040. </p>
  33041. </dd>
  33042. <dt><samp>gamma_weight</samp></dt>
  33043. <dd><p>Set the gamma weight expression. It can be used to reduce the effect
  33044. of a high gamma value on bright image areas, e.g. keep them from
  33045. getting overamplified and just plain white. The value must be a float
  33046. in range <code>0.0</code> to <code>1.0</code>. A value of <code>0.0</code> turns the
  33047. gamma correction all the way down while <code>1.0</code> leaves it at its
  33048. full strength. Default is &quot;1&quot;.
  33049. </p>
  33050. </dd>
  33051. <dt><samp>eval</samp></dt>
  33052. <dd><p>Set when the expressions for brightness, contrast, saturation and
  33053. gamma expressions are evaluated.
  33054. </p>
  33055. <p>It accepts the following values:
  33056. </p><dl compact="compact">
  33057. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  33058. <dd><p>only evaluate expressions once during the filter initialization or
  33059. when a command is processed
  33060. </p>
  33061. </dd>
  33062. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  33063. <dd><p>evaluate expressions for each incoming frame
  33064. </p></dd>
  33065. </dl>
  33066. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  33067. </p></dd>
  33068. </dl>
  33069. <p>The expressions accept the following parameters:
  33070. </p><dl compact="compact">
  33071. <dt><samp>n</samp></dt>
  33072. <dd><p>frame count of the input frame starting from 0
  33073. </p>
  33074. </dd>
  33075. <dt><samp>pos</samp></dt>
  33076. <dd><p>byte position of the corresponding packet in the input file, NAN if
  33077. unspecified
  33078. </p>
  33079. </dd>
  33080. <dt><samp>r</samp></dt>
  33081. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  33082. </p>
  33083. </dd>
  33084. <dt><samp>t</samp></dt>
  33085. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  33086. </p></dd>
  33087. </dl>
  33088. <a name="Commands-76"></a>
  33089. <h4 class="subsection">39.71.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-76" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-76" aria-hidden="true">TOC</a></span></h4>
  33090. <p>The filter supports the following commands:
  33091. </p>
  33092. <dl compact="compact">
  33093. <dt><samp>contrast</samp></dt>
  33094. <dd><p>Set the contrast expression.
  33095. </p>
  33096. </dd>
  33097. <dt><samp>brightness</samp></dt>
  33098. <dd><p>Set the brightness expression.
  33099. </p>
  33100. </dd>
  33101. <dt><samp>saturation</samp></dt>
  33102. <dd><p>Set the saturation expression.
  33103. </p>
  33104. </dd>
  33105. <dt><samp>gamma</samp></dt>
  33106. <dd><p>Set the gamma expression.
  33107. </p>
  33108. </dd>
  33109. <dt><samp>gamma_r</samp></dt>
  33110. <dd><p>Set the gamma_r expression.
  33111. </p>
  33112. </dd>
  33113. <dt><samp>gamma_g</samp></dt>
  33114. <dd><p>Set gamma_g expression.
  33115. </p>
  33116. </dd>
  33117. <dt><samp>gamma_b</samp></dt>
  33118. <dd><p>Set gamma_b expression.
  33119. </p>
  33120. </dd>
  33121. <dt><samp>gamma_weight</samp></dt>
  33122. <dd><p>Set gamma_weight expression.
  33123. </p>
  33124. <p>The command accepts the same syntax of the corresponding option.
  33125. </p>
  33126. <p>If the specified expression is not valid, it is kept at its current
  33127. value.
  33128. </p>
  33129. </dd>
  33130. </dl>
  33131. <a name="erosion"></a>
  33132. <h3 class="section">39.72 erosion<span class="pull-right"><a class="anchor hidden-xs" href="#erosion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-erosion" aria-hidden="true">TOC</a></span></h3>
  33133. <p>Apply erosion effect to the video.
  33134. </p>
  33135. <p>This filter replaces the pixel by the local(3x3) minimum.
  33136. </p>
  33137. <p>It accepts the following options:
  33138. </p>
  33139. <dl compact="compact">
  33140. <dt><samp>threshold0</samp></dt>
  33141. <dt><samp>threshold1</samp></dt>
  33142. <dt><samp>threshold2</samp></dt>
  33143. <dt><samp>threshold3</samp></dt>
  33144. <dd><p>Limit the maximum change for each plane, default is 65535.
  33145. If 0, plane will remain unchanged.
  33146. </p>
  33147. </dd>
  33148. <dt><samp>coordinates</samp></dt>
  33149. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  33150. pixels are used.
  33151. </p>
  33152. <p>Flags to local 3x3 coordinates maps like this:
  33153. </p>
  33154. <p>1 2 3
  33155. 4 5
  33156. 6 7 8
  33157. </p></dd>
  33158. </dl>
  33159. <a name="Commands-77"></a>
  33160. <h4 class="subsection">39.72.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-77" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-77" aria-hidden="true">TOC</a></span></h4>
  33161. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  33162. </p>
  33163. <a name="estdif"></a>
  33164. <h3 class="section">39.73 estdif<span class="pull-right"><a class="anchor hidden-xs" href="#estdif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-estdif" aria-hidden="true">TOC</a></span></h3>
  33165. <p>Deinterlace the input video (&quot;estdif&quot; stands for &quot;Edge Slope
  33166. Tracing Deinterlacing Filter&quot;).
  33167. </p>
  33168. <p>Spatial only filter that uses edge slope tracing algorithm
  33169. to interpolate missing lines.
  33170. It accepts the following parameters:
  33171. </p>
  33172. <dl compact="compact">
  33173. <dt><samp>mode</samp></dt>
  33174. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  33175. </p>
  33176. <dl compact="compact">
  33177. <dt><samp>frame</samp></dt>
  33178. <dd><p>Output one frame for each frame.
  33179. </p></dd>
  33180. <dt><samp>field</samp></dt>
  33181. <dd><p>Output one frame for each field.
  33182. </p></dd>
  33183. </dl>
  33184. <p>The default value is <code>field</code>.
  33185. </p>
  33186. </dd>
  33187. <dt><samp>parity</samp></dt>
  33188. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  33189. of the following values:
  33190. </p>
  33191. <dl compact="compact">
  33192. <dt><samp>tff</samp></dt>
  33193. <dd><p>Assume the top field is first.
  33194. </p></dd>
  33195. <dt><samp>bff</samp></dt>
  33196. <dd><p>Assume the bottom field is first.
  33197. </p></dd>
  33198. <dt><samp>auto</samp></dt>
  33199. <dd><p>Enable automatic detection of field parity.
  33200. </p></dd>
  33201. </dl>
  33202. <p>The default value is <code>auto</code>.
  33203. If the interlacing is unknown or the decoder does not export this information,
  33204. top field first will be assumed.
  33205. </p>
  33206. </dd>
  33207. <dt><samp>deint</samp></dt>
  33208. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  33209. values:
  33210. </p>
  33211. <dl compact="compact">
  33212. <dt><samp>all</samp></dt>
  33213. <dd><p>Deinterlace all frames.
  33214. </p></dd>
  33215. <dt><samp>interlaced</samp></dt>
  33216. <dd><p>Only deinterlace frames marked as interlaced.
  33217. </p></dd>
  33218. </dl>
  33219. <p>The default value is <code>all</code>.
  33220. </p>
  33221. </dd>
  33222. <dt><samp>rslope</samp></dt>
  33223. <dd><p>Specify the search radius for edge slope tracing. Default value is 1.
  33224. Allowed range is from 1 to 15.
  33225. </p>
  33226. </dd>
  33227. <dt><samp>redge</samp></dt>
  33228. <dd><p>Specify the search radius for best edge matching. Default value is 2.
  33229. Allowed range is from 0 to 15.
  33230. </p>
  33231. </dd>
  33232. <dt><samp>interp</samp></dt>
  33233. <dd><p>Specify the interpolation used. Default is 4-point interpolation. It accepts one
  33234. of the following values:
  33235. </p>
  33236. <dl compact="compact">
  33237. <dt><samp>2p</samp></dt>
  33238. <dd><p>Two-point interpolation.
  33239. </p></dd>
  33240. <dt><samp>4p</samp></dt>
  33241. <dd><p>Four-point interpolation.
  33242. </p></dd>
  33243. <dt><samp>6p</samp></dt>
  33244. <dd><p>Six-point interpolation.
  33245. </p></dd>
  33246. </dl>
  33247. </dd>
  33248. </dl>
  33249. <a name="Commands-78"></a>
  33250. <h4 class="subsection">39.73.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-78" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-78" aria-hidden="true">TOC</a></span></h4>
  33251. <p>This filter supports same <a href="#commands">commands</a> as options.
  33252. </p>
  33253. <a name="exposure"></a>
  33254. <h3 class="section">39.74 exposure<span class="pull-right"><a class="anchor hidden-xs" href="#exposure" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-exposure" aria-hidden="true">TOC</a></span></h3>
  33255. <p>Adjust exposure of the video stream.
  33256. </p>
  33257. <p>The filter accepts the following options:
  33258. </p>
  33259. <dl compact="compact">
  33260. <dt><samp>exposure</samp></dt>
  33261. <dd><p>Set the exposure correction in EV. Allowed range is from -3.0 to 3.0 EV
  33262. Default value is 0 EV.
  33263. </p>
  33264. </dd>
  33265. <dt><samp>black</samp></dt>
  33266. <dd><p>Set the black level correction. Allowed range is from -1.0 to 1.0.
  33267. Default value is 0.
  33268. </p></dd>
  33269. </dl>
  33270. <a name="Commands-79"></a>
  33271. <h4 class="subsection">39.74.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-79" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-79" aria-hidden="true">TOC</a></span></h4>
  33272. <p>This filter supports same <a href="#commands">commands</a> as options.
  33273. </p>
  33274. <a name="extractplanes"></a>
  33275. <h3 class="section">39.75 extractplanes<span class="pull-right"><a class="anchor hidden-xs" href="#extractplanes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-extractplanes" aria-hidden="true">TOC</a></span></h3>
  33276. <p>Extract color channel components from input video stream into
  33277. separate grayscale video streams.
  33278. </p>
  33279. <p>The filter accepts the following option:
  33280. </p>
  33281. <dl compact="compact">
  33282. <dt><samp>planes</samp></dt>
  33283. <dd><p>Set plane(s) to extract.
  33284. </p>
  33285. <p>Available values for planes are:
  33286. </p><dl compact="compact">
  33287. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  33288. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  33289. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  33290. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  33291. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  33292. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  33293. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  33294. </dl>
  33295. <p>Choosing planes not available in the input will result in an error.
  33296. That means you cannot select <code>r</code>, <code>g</code>, <code>b</code> planes
  33297. with <code>y</code>, <code>u</code>, <code>v</code> planes at same time.
  33298. </p></dd>
  33299. </dl>
  33300. <a name="Examples-102"></a>
  33301. <h4 class="subsection">39.75.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-102" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-102" aria-hidden="true">TOC</a></span></h4>
  33302. <ul>
  33303. <li> Extract luma, u and v color channel component from input video frame
  33304. into 3 grayscale outputs:
  33305. <div class="example">
  33306. <pre class="example">ffmpeg -i video.avi -filter_complex 'extractplanes=y+u+v[y][u][v]' -map '[y]' y.avi -map '[u]' u.avi -map '[v]' v.avi
  33307. </pre></div>
  33308. </li></ul>
  33309. <a name="fade"></a>
  33310. <h3 class="section">39.76 fade<span class="pull-right"><a class="anchor hidden-xs" href="#fade" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fade" aria-hidden="true">TOC</a></span></h3>
  33311. <p>Apply a fade-in/out effect to the input video.
  33312. </p>
  33313. <p>It accepts the following parameters:
  33314. </p>
  33315. <dl compact="compact">
  33316. <dt><samp>type, t</samp></dt>
  33317. <dd><p>The effect type can be either &quot;in&quot; for a fade-in, or &quot;out&quot; for a fade-out
  33318. effect.
  33319. Default is <code>in</code>.
  33320. </p>
  33321. </dd>
  33322. <dt><samp>start_frame, s</samp></dt>
  33323. <dd><p>Specify the number of the frame to start applying the fade
  33324. effect at. Default is 0.
  33325. </p>
  33326. </dd>
  33327. <dt><samp>nb_frames, n</samp></dt>
  33328. <dd><p>The number of frames that the fade effect lasts. At the end of the
  33329. fade-in effect, the output video will have the same intensity as the input video.
  33330. At the end of the fade-out transition, the output video will be filled with the
  33331. selected <samp>color</samp>.
  33332. Default is 25.
  33333. </p>
  33334. </dd>
  33335. <dt><samp>alpha</samp></dt>
  33336. <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
  33337. Default value is 0.
  33338. </p>
  33339. </dd>
  33340. <dt><samp>start_time, st</samp></dt>
  33341. <dd><p>Specify the timestamp (in seconds) of the frame to start to apply the fade
  33342. effect. If both start_frame and start_time are specified, the fade will start at
  33343. whichever comes last. Default is 0.
  33344. </p>
  33345. </dd>
  33346. <dt><samp>duration, d</samp></dt>
  33347. <dd><p>The number of seconds for which the fade effect has to last. At the end of the
  33348. fade-in effect the output video will have the same intensity as the input video,
  33349. at the end of the fade-out transition the output video will be filled with the
  33350. selected <samp>color</samp>.
  33351. If both duration and nb_frames are specified, duration is used. Default is 0
  33352. (nb_frames is used by default).
  33353. </p>
  33354. </dd>
  33355. <dt><samp>color, c</samp></dt>
  33356. <dd><p>Specify the color of the fade. Default is &quot;black&quot;.
  33357. </p></dd>
  33358. </dl>
  33359. <a name="Examples-103"></a>
  33360. <h4 class="subsection">39.76.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-103" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-103" aria-hidden="true">TOC</a></span></h4>
  33361. <ul>
  33362. <li> Fade in the first 30 frames of video:
  33363. <div class="example">
  33364. <pre class="example">fade=in:0:30
  33365. </pre></div>
  33366. <p>The command above is equivalent to:
  33367. </p><div class="example">
  33368. <pre class="example">fade=t=in:s=0:n=30
  33369. </pre></div>
  33370. </li><li> Fade out the last 45 frames of a 200-frame video:
  33371. <div class="example">
  33372. <pre class="example">fade=out:155:45
  33373. fade=type=out:start_frame=155:nb_frames=45
  33374. </pre></div>
  33375. </li><li> Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video:
  33376. <div class="example">
  33377. <pre class="example">fade=in:0:25, fade=out:975:25
  33378. </pre></div>
  33379. </li><li> Make the first 5 frames yellow, then fade in from frame 5-24:
  33380. <div class="example">
  33381. <pre class="example">fade=in:5:20:color=yellow
  33382. </pre></div>
  33383. </li><li> Fade in alpha over first 25 frames of video:
  33384. <div class="example">
  33385. <pre class="example">fade=in:0:25:alpha=1
  33386. </pre></div>
  33387. </li><li> Make the first 5.5 seconds black, then fade in for 0.5 seconds:
  33388. <div class="example">
  33389. <pre class="example">fade=t=in:st=5.5:d=0.5
  33390. </pre></div>
  33391. </li></ul>
  33392. <a name="fftdnoiz"></a>
  33393. <h3 class="section">39.77 fftdnoiz<span class="pull-right"><a class="anchor hidden-xs" href="#fftdnoiz" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fftdnoiz" aria-hidden="true">TOC</a></span></h3>
  33394. <p>Denoise frames using 3D FFT (frequency domain filtering).
  33395. </p>
  33396. <p>The filter accepts the following options:
  33397. </p>
  33398. <dl compact="compact">
  33399. <dt><samp>sigma</samp></dt>
  33400. <dd><p>Set the noise sigma constant. This sets denoising strength.
  33401. Default value is 1. Allowed range is from 0 to 30.
  33402. Using very high sigma with low overlap may give blocking artifacts.
  33403. </p>
  33404. </dd>
  33405. <dt><samp>amount</samp></dt>
  33406. <dd><p>Set amount of denoising. By default all detected noise is reduced.
  33407. Default value is 1. Allowed range is from 0 to 1.
  33408. </p>
  33409. </dd>
  33410. <dt><samp>block</samp></dt>
  33411. <dd><p>Set size of block, Default is 4, can be 3, 4, 5 or 6.
  33412. Actual size of block in pixels is 2 to power of <var>block</var>, so by default
  33413. block size in pixels is 2^4 which is 16.
  33414. </p>
  33415. </dd>
  33416. <dt><samp>overlap</samp></dt>
  33417. <dd><p>Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8.
  33418. </p>
  33419. </dd>
  33420. <dt><samp>prev</samp></dt>
  33421. <dd><p>Set number of previous frames to use for denoising. By default is set to 0.
  33422. </p>
  33423. </dd>
  33424. <dt><samp>next</samp></dt>
  33425. <dd><p>Set number of next frames to to use for denoising. By default is set to 0.
  33426. </p>
  33427. </dd>
  33428. <dt><samp>planes</samp></dt>
  33429. <dd><p>Set planes which will be filtered, by default are all available filtered
  33430. except alpha.
  33431. </p></dd>
  33432. </dl>
  33433. <a name="fftfilt"></a>
  33434. <h3 class="section">39.78 fftfilt<span class="pull-right"><a class="anchor hidden-xs" href="#fftfilt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fftfilt" aria-hidden="true">TOC</a></span></h3>
  33435. <p>Apply arbitrary expressions to samples in frequency domain
  33436. </p>
  33437. <dl compact="compact">
  33438. <dt><samp>dc_Y</samp></dt>
  33439. <dd><p>Adjust the dc value (gain) of the luma plane of the image. The filter
  33440. accepts an integer value in range <code>0</code> to <code>1000</code>. The default
  33441. value is set to <code>0</code>.
  33442. </p>
  33443. </dd>
  33444. <dt><samp>dc_U</samp></dt>
  33445. <dd><p>Adjust the dc value (gain) of the 1st chroma plane of the image. The
  33446. filter accepts an integer value in range <code>0</code> to <code>1000</code>. The
  33447. default value is set to <code>0</code>.
  33448. </p>
  33449. </dd>
  33450. <dt><samp>dc_V</samp></dt>
  33451. <dd><p>Adjust the dc value (gain) of the 2nd chroma plane of the image. The
  33452. filter accepts an integer value in range <code>0</code> to <code>1000</code>. The
  33453. default value is set to <code>0</code>.
  33454. </p>
  33455. </dd>
  33456. <dt><samp>weight_Y</samp></dt>
  33457. <dd><p>Set the frequency domain weight expression for the luma plane.
  33458. </p>
  33459. </dd>
  33460. <dt><samp>weight_U</samp></dt>
  33461. <dd><p>Set the frequency domain weight expression for the 1st chroma plane.
  33462. </p>
  33463. </dd>
  33464. <dt><samp>weight_V</samp></dt>
  33465. <dd><p>Set the frequency domain weight expression for the 2nd chroma plane.
  33466. </p>
  33467. </dd>
  33468. <dt><samp>eval</samp></dt>
  33469. <dd><p>Set when the expressions are evaluated.
  33470. </p>
  33471. <p>It accepts the following values:
  33472. </p><dl compact="compact">
  33473. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  33474. <dd><p>Only evaluate expressions once during the filter initialization.
  33475. </p>
  33476. </dd>
  33477. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  33478. <dd><p>Evaluate expressions for each incoming frame.
  33479. </p></dd>
  33480. </dl>
  33481. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  33482. </p>
  33483. <p>The filter accepts the following variables:
  33484. </p></dd>
  33485. <dt><samp>X</samp></dt>
  33486. <dt><samp>Y</samp></dt>
  33487. <dd><p>The coordinates of the current sample.
  33488. </p>
  33489. </dd>
  33490. <dt><samp>W</samp></dt>
  33491. <dt><samp>H</samp></dt>
  33492. <dd><p>The width and height of the image.
  33493. </p>
  33494. </dd>
  33495. <dt><samp>N</samp></dt>
  33496. <dd><p>The number of input frame, starting from 0.
  33497. </p></dd>
  33498. </dl>
  33499. <a name="Examples-104"></a>
  33500. <h4 class="subsection">39.78.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-104" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-104" aria-hidden="true">TOC</a></span></h4>
  33501. <ul>
  33502. <li> High-pass:
  33503. <div class="example">
  33504. <pre class="example">fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
  33505. </pre></div>
  33506. </li><li> Low-pass:
  33507. <div class="example">
  33508. <pre class="example">fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
  33509. </pre></div>
  33510. </li><li> Sharpen:
  33511. <div class="example">
  33512. <pre class="example">fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
  33513. </pre></div>
  33514. </li><li> Blur:
  33515. <div class="example">
  33516. <pre class="example">fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
  33517. </pre></div>
  33518. </li></ul>
  33519. <a name="field"></a>
  33520. <h3 class="section">39.79 field<span class="pull-right"><a class="anchor hidden-xs" href="#field" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-field" aria-hidden="true">TOC</a></span></h3>
  33521. <p>Extract a single field from an interlaced image using stride
  33522. arithmetic to avoid wasting CPU time. The output frames are marked as
  33523. non-interlaced.
  33524. </p>
  33525. <p>The filter accepts the following options:
  33526. </p>
  33527. <dl compact="compact">
  33528. <dt><samp>type</samp></dt>
  33529. <dd><p>Specify whether to extract the top (if the value is <code>0</code> or
  33530. <code>top</code>) or the bottom field (if the value is <code>1</code> or
  33531. <code>bottom</code>).
  33532. </p></dd>
  33533. </dl>
  33534. <a name="fieldhint"></a>
  33535. <h3 class="section">39.80 fieldhint<span class="pull-right"><a class="anchor hidden-xs" href="#fieldhint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fieldhint" aria-hidden="true">TOC</a></span></h3>
  33536. <p>Create new frames by copying the top and bottom fields from surrounding frames
  33537. supplied as numbers by the hint file.
  33538. </p>
  33539. <dl compact="compact">
  33540. <dt><samp>hint</samp></dt>
  33541. <dd><p>Set file containing hints: absolute/relative frame numbers.
  33542. </p>
  33543. <p>There must be one line for each frame in a clip. Each line must contain two
  33544. numbers separated by the comma, optionally followed by <code>-</code> or <code>+</code>.
  33545. Numbers supplied on each line of file can not be out of [N-1,N+1] where N
  33546. is current frame number for <code>absolute</code> mode or out of [-1, 1] range
  33547. for <code>relative</code> mode. First number tells from which frame to pick up top
  33548. field and second number tells from which frame to pick up bottom field.
  33549. </p>
  33550. <p>If optionally followed by <code>+</code> output frame will be marked as interlaced,
  33551. else if followed by <code>-</code> output frame will be marked as progressive, else
  33552. it will be marked same as input frame.
  33553. If optionally followed by <code>t</code> output frame will use only top field, or in
  33554. case of <code>b</code> it will use only bottom field.
  33555. If line starts with <code>#</code> or <code>;</code> that line is skipped.
  33556. </p>
  33557. </dd>
  33558. <dt><samp>mode</samp></dt>
  33559. <dd><p>Can be item <code>absolute</code> or <code>relative</code>. Default is <code>absolute</code>.
  33560. </p></dd>
  33561. </dl>
  33562. <p>Example of first several lines of <code>hint</code> file for <code>relative</code> mode:
  33563. </p><div class="example">
  33564. <pre class="example">0,0 - # first frame
  33565. 1,0 - # second frame, use third's frame top field and second's frame bottom field
  33566. 1,0 - # third frame, use fourth's frame top field and third's frame bottom field
  33567. 1,0 -
  33568. 0,0 -
  33569. 0,0 -
  33570. 1,0 -
  33571. 1,0 -
  33572. 1,0 -
  33573. 0,0 -
  33574. 0,0 -
  33575. 1,0 -
  33576. 1,0 -
  33577. 1,0 -
  33578. 0,0 -
  33579. </pre></div>
  33580. <a name="fieldmatch"></a>
  33581. <h3 class="section">39.81 fieldmatch<span class="pull-right"><a class="anchor hidden-xs" href="#fieldmatch" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fieldmatch" aria-hidden="true">TOC</a></span></h3>
  33582. <p>Field matching filter for inverse telecine. It is meant to reconstruct the
  33583. progressive frames from a telecined stream. The filter does not drop duplicated
  33584. frames, so to achieve a complete inverse telecine <code>fieldmatch</code> needs to be
  33585. followed by a decimation filter such as <a href="#decimate">decimate</a> in the filtergraph.
  33586. </p>
  33587. <p>The separation of the field matching and the decimation is notably motivated by
  33588. the possibility of inserting a de-interlacing filter fallback between the two.
  33589. If the source has mixed telecined and real interlaced content,
  33590. <code>fieldmatch</code> will not be able to match fields for the interlaced parts.
  33591. But these remaining combed frames will be marked as interlaced, and thus can be
  33592. de-interlaced by a later filter such as <a href="#yadif">yadif</a> before decimation.
  33593. </p>
  33594. <p>In addition to the various configuration options, <code>fieldmatch</code> can take an
  33595. optional second stream, activated through the <samp>ppsrc</samp> option. If
  33596. enabled, the frames reconstruction will be based on the fields and frames from
  33597. this second stream. This allows the first input to be pre-processed in order to
  33598. help the various algorithms of the filter, while keeping the output lossless
  33599. (assuming the fields are matched properly). Typically, a field-aware denoiser,
  33600. or brightness/contrast adjustments can help.
  33601. </p>
  33602. <p>Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
  33603. and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
  33604. which <code>fieldmatch</code> is based on. While the semantic and usage are very
  33605. close, some behaviour and options names can differ.
  33606. </p>
  33607. <p>The <a href="#decimate">decimate</a> filter currently only works for constant frame rate input.
  33608. If your input has mixed telecined (30fps) and progressive content with a lower
  33609. framerate like 24fps use the following filterchain to produce the necessary cfr
  33610. stream: <code>dejudder,fps=30000/1001,fieldmatch,decimate</code>.
  33611. </p>
  33612. <p>The filter accepts the following options:
  33613. </p>
  33614. <dl compact="compact">
  33615. <dt><samp>order</samp></dt>
  33616. <dd><p>Specify the assumed field order of the input stream. Available values are:
  33617. </p>
  33618. <dl compact="compact">
  33619. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  33620. <dd><p>Auto detect parity (use FFmpeg&rsquo;s internal parity value).
  33621. </p></dd>
  33622. <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
  33623. <dd><p>Assume bottom field first.
  33624. </p></dd>
  33625. <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
  33626. <dd><p>Assume top field first.
  33627. </p></dd>
  33628. </dl>
  33629. <p>Note that it is sometimes recommended not to trust the parity announced by the
  33630. stream.
  33631. </p>
  33632. <p>Default value is <var>auto</var>.
  33633. </p>
  33634. </dd>
  33635. <dt><samp>mode</samp></dt>
  33636. <dd><p>Set the matching mode or strategy to use. <samp>pc</samp> mode is the safest in the
  33637. sense that it won&rsquo;t risk creating jerkiness due to duplicate frames when
  33638. possible, but if there are bad edits or blended fields it will end up
  33639. outputting combed frames when a good match might actually exist. On the other
  33640. hand, <samp>pcn_ub</samp> mode is the most risky in terms of creating jerkiness,
  33641. but will almost always find a good frame if there is one. The other values are
  33642. all somewhere in between <samp>pc</samp> and <samp>pcn_ub</samp> in terms of risking
  33643. jerkiness and creating duplicate frames versus finding good matches in sections
  33644. with bad edits, orphaned fields, blended fields, etc.
  33645. </p>
  33646. <p>More details about p/c/n/u/b are available in <a href="#p_002fc_002fn_002fu_002fb-meaning">p/c/n/u/b meaning</a> section.
  33647. </p>
  33648. <p>Available values are:
  33649. </p>
  33650. <dl compact="compact">
  33651. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  33652. <dd><p>2-way matching (p/c)
  33653. </p></dd>
  33654. <dt>&lsquo;<samp>pc_n</samp>&rsquo;</dt>
  33655. <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
  33656. </p></dd>
  33657. <dt>&lsquo;<samp>pc_u</samp>&rsquo;</dt>
  33658. <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
  33659. </p></dd>
  33660. <dt>&lsquo;<samp>pc_n_ub</samp>&rsquo;</dt>
  33661. <dd><p>2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
  33662. still combed (p/c + n + u/b)
  33663. </p></dd>
  33664. <dt>&lsquo;<samp>pcn</samp>&rsquo;</dt>
  33665. <dd><p>3-way matching (p/c/n)
  33666. </p></dd>
  33667. <dt>&lsquo;<samp>pcn_ub</samp>&rsquo;</dt>
  33668. <dd><p>3-way matching, and trying 4th/5th matches if all 3 of the original matches are
  33669. detected as combed (p/c/n + u/b)
  33670. </p></dd>
  33671. </dl>
  33672. <p>The parenthesis at the end indicate the matches that would be used for that
  33673. mode assuming <samp>order</samp>=<var>tff</var> (and <samp>field</samp> on <var>auto</var> or
  33674. <var>top</var>).
  33675. </p>
  33676. <p>In terms of speed <samp>pc</samp> mode is by far the fastest and <samp>pcn_ub</samp> is
  33677. the slowest.
  33678. </p>
  33679. <p>Default value is <var>pc_n</var>.
  33680. </p>
  33681. </dd>
  33682. <dt><samp>ppsrc</samp></dt>
  33683. <dd><p>Mark the main input stream as a pre-processed input, and enable the secondary
  33684. input stream as the clean source to pick the fields from. See the filter
  33685. introduction for more details. It is similar to the <samp>clip2</samp> feature from
  33686. VFM/TFM.
  33687. </p>
  33688. <p>Default value is <code>0</code> (disabled).
  33689. </p>
  33690. </dd>
  33691. <dt><samp>field</samp></dt>
  33692. <dd><p>Set the field to match from. It is recommended to set this to the same value as
  33693. <samp>order</samp> unless you experience matching failures with that setting. In
  33694. certain circumstances changing the field that is used to match from can have a
  33695. large impact on matching performance. Available values are:
  33696. </p>
  33697. <dl compact="compact">
  33698. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  33699. <dd><p>Automatic (same value as <samp>order</samp>).
  33700. </p></dd>
  33701. <dt>&lsquo;<samp>bottom</samp>&rsquo;</dt>
  33702. <dd><p>Match from the bottom field.
  33703. </p></dd>
  33704. <dt>&lsquo;<samp>top</samp>&rsquo;</dt>
  33705. <dd><p>Match from the top field.
  33706. </p></dd>
  33707. </dl>
  33708. <p>Default value is <var>auto</var>.
  33709. </p>
  33710. </dd>
  33711. <dt><samp>mchroma</samp></dt>
  33712. <dd><p>Set whether or not chroma is included during the match comparisons. In most
  33713. cases it is recommended to leave this enabled. You should set this to <code>0</code>
  33714. only if your clip has bad chroma problems such as heavy rainbowing or other
  33715. artifacts. Setting this to <code>0</code> could also be used to speed things up at
  33716. the cost of some accuracy.
  33717. </p>
  33718. <p>Default value is <code>1</code>.
  33719. </p>
  33720. </dd>
  33721. <dt><samp>y0</samp></dt>
  33722. <dt><samp>y1</samp></dt>
  33723. <dd><p>These define an exclusion band which excludes the lines between <samp>y0</samp> and
  33724. <samp>y1</samp> from being included in the field matching decision. An exclusion
  33725. band can be used to ignore subtitles, a logo, or other things that may
  33726. interfere with the matching. <samp>y0</samp> sets the starting scan line and
  33727. <samp>y1</samp> sets the ending line; all lines in between <samp>y0</samp> and
  33728. <samp>y1</samp> (including <samp>y0</samp> and <samp>y1</samp>) will be ignored. Setting
  33729. <samp>y0</samp> and <samp>y1</samp> to the same value will disable the feature.
  33730. <samp>y0</samp> and <samp>y1</samp> defaults to <code>0</code>.
  33731. </p>
  33732. </dd>
  33733. <dt><samp>scthresh</samp></dt>
  33734. <dd><p>Set the scene change detection threshold as a percentage of maximum change on
  33735. the luma plane. Good values are in the <code>[8.0, 14.0]</code> range. Scene change
  33736. detection is only relevant in case <samp>combmatch</samp>=<var>sc</var>. The range for
  33737. <samp>scthresh</samp> is <code>[0.0, 100.0]</code>.
  33738. </p>
  33739. <p>Default value is <code>12.0</code>.
  33740. </p>
  33741. </dd>
  33742. <dt><samp>combmatch</samp></dt>
  33743. <dd><p>When <samp>combatch</samp> is not <var>none</var>, <code>fieldmatch</code> will take into
  33744. account the combed scores of matches when deciding what match to use as the
  33745. final match. Available values are:
  33746. </p>
  33747. <dl compact="compact">
  33748. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  33749. <dd><p>No final matching based on combed scores.
  33750. </p></dd>
  33751. <dt>&lsquo;<samp>sc</samp>&rsquo;</dt>
  33752. <dd><p>Combed scores are only used when a scene change is detected.
  33753. </p></dd>
  33754. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  33755. <dd><p>Use combed scores all the time.
  33756. </p></dd>
  33757. </dl>
  33758. <p>Default is <var>sc</var>.
  33759. </p>
  33760. </dd>
  33761. <dt><samp>combdbg</samp></dt>
  33762. <dd><p>Force <code>fieldmatch</code> to calculate the combed metrics for certain matches and
  33763. print them. This setting is known as <samp>micout</samp> in TFM/VFM vocabulary.
  33764. Available values are:
  33765. </p>
  33766. <dl compact="compact">
  33767. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  33768. <dd><p>No forced calculation.
  33769. </p></dd>
  33770. <dt>&lsquo;<samp>pcn</samp>&rsquo;</dt>
  33771. <dd><p>Force p/c/n calculations.
  33772. </p></dd>
  33773. <dt>&lsquo;<samp>pcnub</samp>&rsquo;</dt>
  33774. <dd><p>Force p/c/n/u/b calculations.
  33775. </p></dd>
  33776. </dl>
  33777. <p>Default value is <var>none</var>.
  33778. </p>
  33779. </dd>
  33780. <dt><samp>cthresh</samp></dt>
  33781. <dd><p>This is the area combing threshold used for combed frame detection. This
  33782. essentially controls how &quot;strong&quot; or &quot;visible&quot; combing must be to be detected.
  33783. Larger values mean combing must be more visible and smaller values mean combing
  33784. can be less visible or strong and still be detected. Valid settings are from
  33785. <code>-1</code> (every pixel will be detected as combed) to <code>255</code> (no pixel will
  33786. be detected as combed). This is basically a pixel difference value. A good
  33787. range is <code>[8, 12]</code>.
  33788. </p>
  33789. <p>Default value is <code>9</code>.
  33790. </p>
  33791. </dd>
  33792. <dt><samp>chroma</samp></dt>
  33793. <dd><p>Sets whether or not chroma is considered in the combed frame decision. Only
  33794. disable this if your source has chroma problems (rainbowing, etc.) that are
  33795. causing problems for the combed frame detection with chroma enabled. Actually,
  33796. using <samp>chroma</samp>=<var>0</var> is usually more reliable, except for the case
  33797. where there is chroma only combing in the source.
  33798. </p>
  33799. <p>Default value is <code>0</code>.
  33800. </p>
  33801. </dd>
  33802. <dt><samp>blockx</samp></dt>
  33803. <dt><samp>blocky</samp></dt>
  33804. <dd><p>Respectively set the x-axis and y-axis size of the window used during combed
  33805. frame detection. This has to do with the size of the area in which
  33806. <samp>combpel</samp> pixels are required to be detected as combed for a frame to be
  33807. declared combed. See the <samp>combpel</samp> parameter description for more info.
  33808. Possible values are any number that is a power of 2 starting at 4 and going up
  33809. to 512.
  33810. </p>
  33811. <p>Default value is <code>16</code>.
  33812. </p>
  33813. </dd>
  33814. <dt><samp>combpel</samp></dt>
  33815. <dd><p>The number of combed pixels inside any of the <samp>blocky</samp> by
  33816. <samp>blockx</samp> size blocks on the frame for the frame to be detected as
  33817. combed. While <samp>cthresh</samp> controls how &quot;visible&quot; the combing must be, this
  33818. setting controls &quot;how much&quot; combing there must be in any localized area (a
  33819. window defined by the <samp>blockx</samp> and <samp>blocky</samp> settings) on the
  33820. frame. Minimum value is <code>0</code> and maximum is <code>blocky x blockx</code> (at
  33821. which point no frames will ever be detected as combed). This setting is known
  33822. as <samp>MI</samp> in TFM/VFM vocabulary.
  33823. </p>
  33824. <p>Default value is <code>80</code>.
  33825. </p></dd>
  33826. </dl>
  33827. <span id="p_002fc_002fn_002fu_002fb-meaning"></span><a name="p_002fc_002fn_002fu_002fb-meaning-1"></a>
  33828. <h4 class="subsection">39.81.1 p/c/n/u/b meaning<span class="pull-right"><a class="anchor hidden-xs" href="#p_002fc_002fn_002fu_002fb-meaning-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-p_002fc_002fn_002fu_002fb-meaning-1" aria-hidden="true">TOC</a></span></h4>
  33829. <a name="p_002fc_002fn"></a>
  33830. <h4 class="subsubsection">39.81.1.1 p/c/n<span class="pull-right"><a class="anchor hidden-xs" href="#p_002fc_002fn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-p_002fc_002fn" aria-hidden="true">TOC</a></span></h4>
  33831. <p>We assume the following telecined stream:
  33832. </p>
  33833. <div class="example">
  33834. <pre class="example">Top fields: 1 2 2 3 4
  33835. Bottom fields: 1 2 3 4 4
  33836. </pre></div>
  33837. <p>The numbers correspond to the progressive frame the fields relate to. Here, the
  33838. first two frames are progressive, the 3rd and 4th are combed, and so on.
  33839. </p>
  33840. <p>When <code>fieldmatch</code> is configured to run a matching from bottom
  33841. (<samp>field</samp>=<var>bottom</var>) this is how this input stream get transformed:
  33842. </p>
  33843. <div class="example">
  33844. <pre class="example">Input stream:
  33845. T 1 2 2 3 4
  33846. B 1 2 3 4 4 &lt;-- matching reference
  33847. Matches: c c n n c
  33848. Output stream:
  33849. T 1 2 3 4 4
  33850. B 1 2 3 4 4
  33851. </pre></div>
  33852. <p>As a result of the field matching, we can see that some frames get duplicated.
  33853. To perform a complete inverse telecine, you need to rely on a decimation filter
  33854. after this operation. See for instance the <a href="#decimate">decimate</a> filter.
  33855. </p>
  33856. <p>The same operation now matching from top fields (<samp>field</samp>=<var>top</var>)
  33857. looks like this:
  33858. </p>
  33859. <div class="example">
  33860. <pre class="example">Input stream:
  33861. T 1 2 2 3 4 &lt;-- matching reference
  33862. B 1 2 3 4 4
  33863. Matches: c c p p c
  33864. Output stream:
  33865. T 1 2 2 3 4
  33866. B 1 2 2 3 4
  33867. </pre></div>
  33868. <p>In these examples, we can see what <var>p</var>, <var>c</var> and <var>n</var> mean;
  33869. basically, they refer to the frame and field of the opposite parity:
  33870. </p>
  33871. <ul>
  33872. <li> <var>p</var> matches the field of the opposite parity in the previous frame
  33873. </li><li> <var>c</var> matches the field of the opposite parity in the current frame
  33874. </li><li> <var>n</var> matches the field of the opposite parity in the next frame
  33875. </li></ul>
  33876. <a name="u_002fb"></a>
  33877. <h4 class="subsubsection">39.81.1.2 u/b<span class="pull-right"><a class="anchor hidden-xs" href="#u_002fb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-u_002fb" aria-hidden="true">TOC</a></span></h4>
  33878. <p>The <var>u</var> and <var>b</var> matching are a bit special in the sense that they match
  33879. from the opposite parity flag. In the following examples, we assume that we are
  33880. currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
  33881. &rsquo;x&rsquo; is placed above and below each matched fields.
  33882. </p>
  33883. <p>With bottom matching (<samp>field</samp>=<var>bottom</var>):
  33884. </p><div class="example">
  33885. <pre class="example">Match: c p n b u
  33886. x x x x x
  33887. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  33888. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  33889. x x x x x
  33890. Output frames:
  33891. 2 1 2 2 2
  33892. 2 2 2 1 3
  33893. </pre></div>
  33894. <p>With top matching (<samp>field</samp>=<var>top</var>):
  33895. </p><div class="example">
  33896. <pre class="example">Match: c p n b u
  33897. x x x x x
  33898. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  33899. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  33900. x x x x x
  33901. Output frames:
  33902. 2 2 2 1 2
  33903. 2 1 3 2 2
  33904. </pre></div>
  33905. <a name="Examples-105"></a>
  33906. <h4 class="subsection">39.81.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-105" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-105" aria-hidden="true">TOC</a></span></h4>
  33907. <p>Simple IVTC of a top field first telecined stream:
  33908. </p><div class="example">
  33909. <pre class="example">fieldmatch=order=tff:combmatch=none, decimate
  33910. </pre></div>
  33911. <p>Advanced IVTC, with fallback on <a href="#yadif">yadif</a> for still combed frames:
  33912. </p><div class="example">
  33913. <pre class="example">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
  33914. </pre></div>
  33915. <a name="fieldorder"></a>
  33916. <h3 class="section">39.82 fieldorder<span class="pull-right"><a class="anchor hidden-xs" href="#fieldorder" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fieldorder" aria-hidden="true">TOC</a></span></h3>
  33917. <p>Transform the field order of the input video.
  33918. </p>
  33919. <p>It accepts the following parameters:
  33920. </p>
  33921. <dl compact="compact">
  33922. <dt><samp>order</samp></dt>
  33923. <dd><p>The output field order. Valid values are <var>tff</var> for top field first or <var>bff</var>
  33924. for bottom field first.
  33925. </p></dd>
  33926. </dl>
  33927. <p>The default value is &lsquo;<samp>tff</samp>&rsquo;.
  33928. </p>
  33929. <p>The transformation is done by shifting the picture content up or down
  33930. by one line, and filling the remaining line with appropriate picture content.
  33931. This method is consistent with most broadcast field order converters.
  33932. </p>
  33933. <p>If the input video is not flagged as being interlaced, or it is already
  33934. flagged as being of the required output field order, then this filter does
  33935. not alter the incoming video.
  33936. </p>
  33937. <p>It is very useful when converting to or from PAL DV material,
  33938. which is bottom field first.
  33939. </p>
  33940. <p>For example:
  33941. </p><div class="example">
  33942. <pre class="example">ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
  33943. </pre></div>
  33944. <a name="fifo_002c-afifo"></a>
  33945. <h3 class="section">39.83 fifo, afifo<span class="pull-right"><a class="anchor hidden-xs" href="#fifo_002c-afifo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fifo_002c-afifo" aria-hidden="true">TOC</a></span></h3>
  33946. <p>Buffer input images and send them when they are requested.
  33947. </p>
  33948. <p>It is mainly useful when auto-inserted by the libavfilter
  33949. framework.
  33950. </p>
  33951. <p>It does not take parameters.
  33952. </p>
  33953. <a name="fillborders"></a>
  33954. <h3 class="section">39.84 fillborders<span class="pull-right"><a class="anchor hidden-xs" href="#fillborders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fillborders" aria-hidden="true">TOC</a></span></h3>
  33955. <p>Fill borders of the input video, without changing video stream dimensions.
  33956. Sometimes video can have garbage at the four edges and you may not want to
  33957. crop video input to keep size multiple of some number.
  33958. </p>
  33959. <p>This filter accepts the following options:
  33960. </p>
  33961. <dl compact="compact">
  33962. <dt><samp>left</samp></dt>
  33963. <dd><p>Number of pixels to fill from left border.
  33964. </p>
  33965. </dd>
  33966. <dt><samp>right</samp></dt>
  33967. <dd><p>Number of pixels to fill from right border.
  33968. </p>
  33969. </dd>
  33970. <dt><samp>top</samp></dt>
  33971. <dd><p>Number of pixels to fill from top border.
  33972. </p>
  33973. </dd>
  33974. <dt><samp>bottom</samp></dt>
  33975. <dd><p>Number of pixels to fill from bottom border.
  33976. </p>
  33977. </dd>
  33978. <dt><samp>mode</samp></dt>
  33979. <dd><p>Set fill mode.
  33980. </p>
  33981. <p>It accepts the following values:
  33982. </p><dl compact="compact">
  33983. <dt>&lsquo;<samp>smear</samp>&rsquo;</dt>
  33984. <dd><p>fill pixels using outermost pixels
  33985. </p>
  33986. </dd>
  33987. <dt>&lsquo;<samp>mirror</samp>&rsquo;</dt>
  33988. <dd><p>fill pixels using mirroring (half sample symmetric)
  33989. </p>
  33990. </dd>
  33991. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  33992. <dd><p>fill pixels with constant value
  33993. </p>
  33994. </dd>
  33995. <dt>&lsquo;<samp>reflect</samp>&rsquo;</dt>
  33996. <dd><p>fill pixels using reflecting (whole sample symmetric)
  33997. </p>
  33998. </dd>
  33999. <dt>&lsquo;<samp>wrap</samp>&rsquo;</dt>
  34000. <dd><p>fill pixels using wrapping
  34001. </p>
  34002. </dd>
  34003. <dt>&lsquo;<samp>fade</samp>&rsquo;</dt>
  34004. <dd><p>fade pixels to constant value
  34005. </p></dd>
  34006. </dl>
  34007. <p>Default is <var>smear</var>.
  34008. </p>
  34009. </dd>
  34010. <dt><samp>color</samp></dt>
  34011. <dd><p>Set color for pixels in fixed or fade mode. Default is <var>black</var>.
  34012. </p></dd>
  34013. </dl>
  34014. <a name="Commands-80"></a>
  34015. <h4 class="subsection">39.84.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-80" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-80" aria-hidden="true">TOC</a></span></h4>
  34016. <p>This filter supports same <a href="#commands">commands</a> as options.
  34017. The command accepts the same syntax of the corresponding option.
  34018. </p>
  34019. <p>If the specified expression is not valid, it is kept at its current
  34020. value.
  34021. </p>
  34022. <a name="find_005frect"></a>
  34023. <h3 class="section">39.85 find_rect<span class="pull-right"><a class="anchor hidden-xs" href="#find_005frect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-find_005frect" aria-hidden="true">TOC</a></span></h3>
  34024. <p>Find a rectangular object
  34025. </p>
  34026. <p>It accepts the following options:
  34027. </p>
  34028. <dl compact="compact">
  34029. <dt><samp>object</samp></dt>
  34030. <dd><p>Filepath of the object image, needs to be in gray8.
  34031. </p>
  34032. </dd>
  34033. <dt><samp>threshold</samp></dt>
  34034. <dd><p>Detection threshold, default is 0.5.
  34035. </p>
  34036. </dd>
  34037. <dt><samp>mipmaps</samp></dt>
  34038. <dd><p>Number of mipmaps, default is 3.
  34039. </p>
  34040. </dd>
  34041. <dt><samp>xmin, ymin, xmax, ymax</samp></dt>
  34042. <dd><p>Specifies the rectangle in which to search.
  34043. </p></dd>
  34044. </dl>
  34045. <a name="Examples-106"></a>
  34046. <h4 class="subsection">39.85.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-106" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-106" aria-hidden="true">TOC</a></span></h4>
  34047. <ul>
  34048. <li> Cover a rectangular object by the supplied image of a given video using <code>ffmpeg</code>:
  34049. <div class="example">
  34050. <pre class="example">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  34051. </pre></div>
  34052. </li></ul>
  34053. <a name="floodfill"></a>
  34054. <h3 class="section">39.86 floodfill<span class="pull-right"><a class="anchor hidden-xs" href="#floodfill" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-floodfill" aria-hidden="true">TOC</a></span></h3>
  34055. <p>Flood area with values of same pixel components with another values.
  34056. </p>
  34057. <p>It accepts the following options:
  34058. </p><dl compact="compact">
  34059. <dt><samp>x</samp></dt>
  34060. <dd><p>Set pixel x coordinate.
  34061. </p>
  34062. </dd>
  34063. <dt><samp>y</samp></dt>
  34064. <dd><p>Set pixel y coordinate.
  34065. </p>
  34066. </dd>
  34067. <dt><samp>s0</samp></dt>
  34068. <dd><p>Set source #0 component value.
  34069. </p>
  34070. </dd>
  34071. <dt><samp>s1</samp></dt>
  34072. <dd><p>Set source #1 component value.
  34073. </p>
  34074. </dd>
  34075. <dt><samp>s2</samp></dt>
  34076. <dd><p>Set source #2 component value.
  34077. </p>
  34078. </dd>
  34079. <dt><samp>s3</samp></dt>
  34080. <dd><p>Set source #3 component value.
  34081. </p>
  34082. </dd>
  34083. <dt><samp>d0</samp></dt>
  34084. <dd><p>Set destination #0 component value.
  34085. </p>
  34086. </dd>
  34087. <dt><samp>d1</samp></dt>
  34088. <dd><p>Set destination #1 component value.
  34089. </p>
  34090. </dd>
  34091. <dt><samp>d2</samp></dt>
  34092. <dd><p>Set destination #2 component value.
  34093. </p>
  34094. </dd>
  34095. <dt><samp>d3</samp></dt>
  34096. <dd><p>Set destination #3 component value.
  34097. </p></dd>
  34098. </dl>
  34099. <span id="format"></span><a name="format-1"></a>
  34100. <h3 class="section">39.87 format<span class="pull-right"><a class="anchor hidden-xs" href="#format-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-format-1" aria-hidden="true">TOC</a></span></h3>
  34101. <p>Convert the input video to one of the specified pixel formats.
  34102. Libavfilter will try to pick one that is suitable as input to
  34103. the next filter.
  34104. </p>
  34105. <p>It accepts the following parameters:
  34106. </p><dl compact="compact">
  34107. <dt><samp>pix_fmts</samp></dt>
  34108. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  34109. &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
  34110. </p>
  34111. </dd>
  34112. </dl>
  34113. <a name="Examples-107"></a>
  34114. <h4 class="subsection">39.87.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-107" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-107" aria-hidden="true">TOC</a></span></h4>
  34115. <ul>
  34116. <li> Convert the input video to the <var>yuv420p</var> format
  34117. <div class="example">
  34118. <pre class="example">format=pix_fmts=yuv420p
  34119. </pre></div>
  34120. <p>Convert the input video to any of the formats in the list
  34121. </p><div class="example">
  34122. <pre class="example">format=pix_fmts=yuv420p|yuv444p|yuv410p
  34123. </pre></div>
  34124. </li></ul>
  34125. <span id="fps"></span><a name="fps-1"></a>
  34126. <h3 class="section">39.88 fps<span class="pull-right"><a class="anchor hidden-xs" href="#fps-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fps-1" aria-hidden="true">TOC</a></span></h3>
  34127. <p>Convert the video to specified constant frame rate by duplicating or dropping
  34128. frames as necessary.
  34129. </p>
  34130. <p>It accepts the following parameters:
  34131. </p><dl compact="compact">
  34132. <dt><samp>fps</samp></dt>
  34133. <dd><p>The desired output frame rate. The default is <code>25</code>.
  34134. </p>
  34135. </dd>
  34136. <dt><samp>start_time</samp></dt>
  34137. <dd><p>Assume the first PTS should be the given value, in seconds. This allows for
  34138. padding/trimming at the start of stream. By default, no assumption is made
  34139. about the first frame&rsquo;s expected PTS, so no padding or trimming is done.
  34140. For example, this could be set to 0 to pad the beginning with duplicates of
  34141. the first frame if a video stream starts after the audio stream or to trim any
  34142. frames with a negative PTS.
  34143. </p>
  34144. </dd>
  34145. <dt><samp>round</samp></dt>
  34146. <dd><p>Timestamp (PTS) rounding method.
  34147. </p>
  34148. <p>Possible values are:
  34149. </p><dl compact="compact">
  34150. <dt><samp>zero</samp></dt>
  34151. <dd><p>round towards 0
  34152. </p></dd>
  34153. <dt><samp>inf</samp></dt>
  34154. <dd><p>round away from 0
  34155. </p></dd>
  34156. <dt><samp>down</samp></dt>
  34157. <dd><p>round towards -infinity
  34158. </p></dd>
  34159. <dt><samp>up</samp></dt>
  34160. <dd><p>round towards +infinity
  34161. </p></dd>
  34162. <dt><samp>near</samp></dt>
  34163. <dd><p>round to nearest
  34164. </p></dd>
  34165. </dl>
  34166. <p>The default is <code>near</code>.
  34167. </p>
  34168. </dd>
  34169. <dt><samp>eof_action</samp></dt>
  34170. <dd><p>Action performed when reading the last frame.
  34171. </p>
  34172. <p>Possible values are:
  34173. </p><dl compact="compact">
  34174. <dt><samp>round</samp></dt>
  34175. <dd><p>Use same timestamp rounding method as used for other frames.
  34176. </p></dd>
  34177. <dt><samp>pass</samp></dt>
  34178. <dd><p>Pass through last frame if input duration has not been reached yet.
  34179. </p></dd>
  34180. </dl>
  34181. <p>The default is <code>round</code>.
  34182. </p>
  34183. </dd>
  34184. </dl>
  34185. <p>Alternatively, the options can be specified as a flat string:
  34186. <var>fps</var>[:<var>start_time</var>[:<var>round</var>]].
  34187. </p>
  34188. <p>See also the <a href="#setpts">setpts</a> filter.
  34189. </p>
  34190. <a name="Examples-108"></a>
  34191. <h4 class="subsection">39.88.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-108" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-108" aria-hidden="true">TOC</a></span></h4>
  34192. <ul>
  34193. <li> A typical usage in order to set the fps to 25:
  34194. <div class="example">
  34195. <pre class="example">fps=fps=25
  34196. </pre></div>
  34197. </li><li> Sets the fps to 24, using abbreviation and rounding method to round to nearest:
  34198. <div class="example">
  34199. <pre class="example">fps=fps=film:round=near
  34200. </pre></div>
  34201. </li></ul>
  34202. <a name="framepack"></a>
  34203. <h3 class="section">39.89 framepack<span class="pull-right"><a class="anchor hidden-xs" href="#framepack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framepack" aria-hidden="true">TOC</a></span></h3>
  34204. <p>Pack two different video streams into a stereoscopic video, setting proper
  34205. metadata on supported codecs. The two views should have the same size and
  34206. framerate and processing will stop when the shorter video ends. Please note
  34207. that you may conveniently adjust view properties with the <a href="#scale">scale</a> and
  34208. <a href="#fps">fps</a> filters.
  34209. </p>
  34210. <p>It accepts the following parameters:
  34211. </p><dl compact="compact">
  34212. <dt><samp>format</samp></dt>
  34213. <dd><p>The desired packing format. Supported values are:
  34214. </p>
  34215. <dl compact="compact">
  34216. <dt><samp>sbs</samp></dt>
  34217. <dd><p>The views are next to each other (default).
  34218. </p>
  34219. </dd>
  34220. <dt><samp>tab</samp></dt>
  34221. <dd><p>The views are on top of each other.
  34222. </p>
  34223. </dd>
  34224. <dt><samp>lines</samp></dt>
  34225. <dd><p>The views are packed by line.
  34226. </p>
  34227. </dd>
  34228. <dt><samp>columns</samp></dt>
  34229. <dd><p>The views are packed by column.
  34230. </p>
  34231. </dd>
  34232. <dt><samp>frameseq</samp></dt>
  34233. <dd><p>The views are temporally interleaved.
  34234. </p>
  34235. </dd>
  34236. </dl>
  34237. </dd>
  34238. </dl>
  34239. <p>Some examples:
  34240. </p>
  34241. <div class="example">
  34242. <pre class="example"># Convert left and right views into a frame-sequential video
  34243. ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
  34244. # Convert views into a side-by-side video with the same output resolution as the input
  34245. 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
  34246. </pre></div>
  34247. <a name="framerate"></a>
  34248. <h3 class="section">39.90 framerate<span class="pull-right"><a class="anchor hidden-xs" href="#framerate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framerate" aria-hidden="true">TOC</a></span></h3>
  34249. <p>Change the frame rate by interpolating new video output frames from the source
  34250. frames.
  34251. </p>
  34252. <p>This filter is not designed to function correctly with interlaced media. If
  34253. you wish to change the frame rate of interlaced media then you are required
  34254. to deinterlace before this filter and re-interlace after this filter.
  34255. </p>
  34256. <p>A description of the accepted options follows.
  34257. </p>
  34258. <dl compact="compact">
  34259. <dt><samp>fps</samp></dt>
  34260. <dd><p>Specify the output frames per second. This option can also be specified
  34261. as a value alone. The default is <code>50</code>.
  34262. </p>
  34263. </dd>
  34264. <dt><samp>interp_start</samp></dt>
  34265. <dd><p>Specify the start of a range where the output frame will be created as a
  34266. linear interpolation of two frames. The range is [<code>0</code>-<code>255</code>],
  34267. the default is <code>15</code>.
  34268. </p>
  34269. </dd>
  34270. <dt><samp>interp_end</samp></dt>
  34271. <dd><p>Specify the end of a range where the output frame will be created as a
  34272. linear interpolation of two frames. The range is [<code>0</code>-<code>255</code>],
  34273. the default is <code>240</code>.
  34274. </p>
  34275. </dd>
  34276. <dt><samp>scene</samp></dt>
  34277. <dd><p>Specify the level at which a scene change is detected as a value between
  34278. 0 and 100 to indicate a new scene; a low value reflects a low
  34279. probability for the current frame to introduce a new scene, while a higher
  34280. value means the current frame is more likely to be one.
  34281. The default is <code>8.2</code>.
  34282. </p>
  34283. </dd>
  34284. <dt><samp>flags</samp></dt>
  34285. <dd><p>Specify flags influencing the filter process.
  34286. </p>
  34287. <p>Available value for <var>flags</var> is:
  34288. </p>
  34289. <dl compact="compact">
  34290. <dt><samp>scene_change_detect, scd</samp></dt>
  34291. <dd><p>Enable scene change detection using the value of the option <var>scene</var>.
  34292. This flag is enabled by default.
  34293. </p></dd>
  34294. </dl>
  34295. </dd>
  34296. </dl>
  34297. <a name="framestep"></a>
  34298. <h3 class="section">39.91 framestep<span class="pull-right"><a class="anchor hidden-xs" href="#framestep" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framestep" aria-hidden="true">TOC</a></span></h3>
  34299. <p>Select one frame every N-th frame.
  34300. </p>
  34301. <p>This filter accepts the following option:
  34302. </p><dl compact="compact">
  34303. <dt><samp>step</samp></dt>
  34304. <dd><p>Select frame after every <code>step</code> frames.
  34305. Allowed values are positive integers higher than 0. Default value is <code>1</code>.
  34306. </p></dd>
  34307. </dl>
  34308. <a name="freezedetect"></a>
  34309. <h3 class="section">39.92 freezedetect<span class="pull-right"><a class="anchor hidden-xs" href="#freezedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-freezedetect" aria-hidden="true">TOC</a></span></h3>
  34310. <p>Detect frozen video.
  34311. </p>
  34312. <p>This filter logs a message and sets frame metadata when it detects that the
  34313. input video has no significant change in content during a specified duration.
  34314. Video freeze detection calculates the mean average absolute difference of all
  34315. the components of video frames and compares it to a noise floor.
  34316. </p>
  34317. <p>The printed times and duration are expressed in seconds. The
  34318. <code>lavfi.freezedetect.freeze_start</code> metadata key is set on the first frame
  34319. whose timestamp equals or exceeds the detection duration and it contains the
  34320. timestamp of the first frame of the freeze. The
  34321. <code>lavfi.freezedetect.freeze_duration</code> and
  34322. <code>lavfi.freezedetect.freeze_end</code> metadata keys are set on the first frame
  34323. after the freeze.
  34324. </p>
  34325. <p>The filter accepts the following options:
  34326. </p>
  34327. <dl compact="compact">
  34328. <dt><samp>noise, n</samp></dt>
  34329. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  34330. specified value) or as a difference ratio between 0 and 1. Default is -60dB, or
  34331. 0.001.
  34332. </p>
  34333. </dd>
  34334. <dt><samp>duration, d</samp></dt>
  34335. <dd><p>Set freeze duration until notification (default is 2 seconds).
  34336. </p></dd>
  34337. </dl>
  34338. <a name="freezeframes"></a>
  34339. <h3 class="section">39.93 freezeframes<span class="pull-right"><a class="anchor hidden-xs" href="#freezeframes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-freezeframes" aria-hidden="true">TOC</a></span></h3>
  34340. <p>Freeze video frames.
  34341. </p>
  34342. <p>This filter freezes video frames using frame from 2nd input.
  34343. </p>
  34344. <p>The filter accepts the following options:
  34345. </p>
  34346. <dl compact="compact">
  34347. <dt><samp>first</samp></dt>
  34348. <dd><p>Set number of first frame from which to start freeze.
  34349. </p>
  34350. </dd>
  34351. <dt><samp>last</samp></dt>
  34352. <dd><p>Set number of last frame from which to end freeze.
  34353. </p>
  34354. </dd>
  34355. <dt><samp>replace</samp></dt>
  34356. <dd><p>Set number of frame from 2nd input which will be used instead of replaced frames.
  34357. </p></dd>
  34358. </dl>
  34359. <span id="frei0r"></span><a name="frei0r-1"></a>
  34360. <h3 class="section">39.94 frei0r<span class="pull-right"><a class="anchor hidden-xs" href="#frei0r-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-frei0r-1" aria-hidden="true">TOC</a></span></h3>
  34361. <p>Apply a frei0r effect to the input video.
  34362. </p>
  34363. <p>To enable the compilation of this filter, you need to install the frei0r
  34364. header and configure FFmpeg with <code>--enable-frei0r</code>.
  34365. </p>
  34366. <p>It accepts the following parameters:
  34367. </p>
  34368. <dl compact="compact">
  34369. <dt><samp>filter_name</samp></dt>
  34370. <dd><p>The name of the frei0r effect to load. If the environment variable
  34371. <code>FREI0R_PATH</code> is defined, the frei0r effect is searched for in each of the
  34372. directories specified by the colon-separated list in <code>FREI0R_PATH</code>.
  34373. Otherwise, the standard frei0r paths are searched, in this order:
  34374. <samp>HOME/.frei0r-1/lib/</samp>, <samp>/usr/local/lib/frei0r-1/</samp>,
  34375. <samp>/usr/lib/frei0r-1/</samp>.
  34376. </p>
  34377. </dd>
  34378. <dt><samp>filter_params</samp></dt>
  34379. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r effect.
  34380. </p>
  34381. </dd>
  34382. </dl>
  34383. <p>A frei0r effect parameter can be a boolean (its value is either
  34384. &quot;y&quot; or &quot;n&quot;), a double, a color (specified as
  34385. <var>R</var>/<var>G</var>/<var>B</var>, where <var>R</var>, <var>G</var>, and <var>B</var> are floating point
  34386. numbers between 0.0 and 1.0, inclusive) or a color description as specified in the
  34387. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>,
  34388. a position (specified as <var>X</var>/<var>Y</var>, where
  34389. <var>X</var> and <var>Y</var> are floating point numbers) and/or a string.
  34390. </p>
  34391. <p>The number and types of parameters depend on the loaded effect. If an
  34392. effect parameter is not specified, the default value is set.
  34393. </p>
  34394. <a name="Examples-109"></a>
  34395. <h4 class="subsection">39.94.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-109" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-109" aria-hidden="true">TOC</a></span></h4>
  34396. <ul>
  34397. <li> Apply the distort0r effect, setting the first two double parameters:
  34398. <div class="example">
  34399. <pre class="example">frei0r=filter_name=distort0r:filter_params=0.5|0.01
  34400. </pre></div>
  34401. </li><li> Apply the colordistance effect, taking a color as the first parameter:
  34402. <div class="example">
  34403. <pre class="example">frei0r=colordistance:0.2/0.3/0.4
  34404. frei0r=colordistance:violet
  34405. frei0r=colordistance:0x112233
  34406. </pre></div>
  34407. </li><li> Apply the perspective effect, specifying the top left and top right image
  34408. positions:
  34409. <div class="example">
  34410. <pre class="example">frei0r=perspective:0.2/0.2|0.8/0.2
  34411. </pre></div>
  34412. </li></ul>
  34413. <p>For more information, see
  34414. <a href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
  34415. </p>
  34416. <a name="Commands-81"></a>
  34417. <h4 class="subsection">39.94.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-81" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-81" aria-hidden="true">TOC</a></span></h4>
  34418. <p>This filter supports the <samp>filter_params</samp> option as <a href="#commands">commands</a>.
  34419. </p>
  34420. <a name="fspp"></a>
  34421. <h3 class="section">39.95 fspp<span class="pull-right"><a class="anchor hidden-xs" href="#fspp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fspp" aria-hidden="true">TOC</a></span></h3>
  34422. <p>Apply fast and simple postprocessing. It is a faster version of <a href="#spp">spp</a>.
  34423. </p>
  34424. <p>It splits (I)DCT into horizontal/vertical passes. Unlike the simple post-
  34425. processing filter, one of them is performed once per block, not per pixel.
  34426. This allows for much higher speed.
  34427. </p>
  34428. <p>The filter accepts the following options:
  34429. </p>
  34430. <dl compact="compact">
  34431. <dt><samp>quality</samp></dt>
  34432. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  34433. an integer in the range 4-5. Default value is <code>4</code>.
  34434. </p>
  34435. </dd>
  34436. <dt><samp>qp</samp></dt>
  34437. <dd><p>Force a constant quantization parameter. It accepts an integer in range 0-63.
  34438. If not set, the filter will use the QP from the video stream (if available).
  34439. </p>
  34440. </dd>
  34441. <dt><samp>strength</samp></dt>
  34442. <dd><p>Set filter strength. It accepts an integer in range -15 to 32. Lower values mean
  34443. more details but also more artifacts, while higher values make the image smoother
  34444. but also blurrier. Default value is <code>0</code> − PSNR optimal.
  34445. </p>
  34446. </dd>
  34447. <dt><samp>use_bframe_qp</samp></dt>
  34448. <dd><p>Enable the use of the QP from the B-Frames if set to <code>1</code>. Using this
  34449. option may cause flicker since the B-Frames have often larger QP. Default is
  34450. <code>0</code> (not enabled).
  34451. </p>
  34452. </dd>
  34453. </dl>
  34454. <a name="gblur"></a>
  34455. <h3 class="section">39.96 gblur<span class="pull-right"><a class="anchor hidden-xs" href="#gblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gblur" aria-hidden="true">TOC</a></span></h3>
  34456. <p>Apply Gaussian blur filter.
  34457. </p>
  34458. <p>The filter accepts the following options:
  34459. </p>
  34460. <dl compact="compact">
  34461. <dt><samp>sigma</samp></dt>
  34462. <dd><p>Set horizontal sigma, standard deviation of Gaussian blur. Default is <code>0.5</code>.
  34463. </p>
  34464. </dd>
  34465. <dt><samp>steps</samp></dt>
  34466. <dd><p>Set number of steps for Gaussian approximation. Default is <code>1</code>.
  34467. </p>
  34468. </dd>
  34469. <dt><samp>planes</samp></dt>
  34470. <dd><p>Set which planes to filter. By default all planes are filtered.
  34471. </p>
  34472. </dd>
  34473. <dt><samp>sigmaV</samp></dt>
  34474. <dd><p>Set vertical sigma, if negative it will be same as <code>sigma</code>.
  34475. Default is <code>-1</code>.
  34476. </p></dd>
  34477. </dl>
  34478. <a name="Commands-82"></a>
  34479. <h4 class="subsection">39.96.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-82" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-82" aria-hidden="true">TOC</a></span></h4>
  34480. <p>This filter supports same commands as options.
  34481. The command accepts the same syntax of the corresponding option.
  34482. </p>
  34483. <p>If the specified expression is not valid, it is kept at its current
  34484. value.
  34485. </p>
  34486. <a name="geq"></a>
  34487. <h3 class="section">39.97 geq<span class="pull-right"><a class="anchor hidden-xs" href="#geq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-geq" aria-hidden="true">TOC</a></span></h3>
  34488. <p>Apply generic equation to each pixel.
  34489. </p>
  34490. <p>The filter accepts the following options:
  34491. </p>
  34492. <dl compact="compact">
  34493. <dt><samp>lum_expr, lum</samp></dt>
  34494. <dd><p>Set the luminance expression.
  34495. </p></dd>
  34496. <dt><samp>cb_expr, cb</samp></dt>
  34497. <dd><p>Set the chrominance blue expression.
  34498. </p></dd>
  34499. <dt><samp>cr_expr, cr</samp></dt>
  34500. <dd><p>Set the chrominance red expression.
  34501. </p></dd>
  34502. <dt><samp>alpha_expr, a</samp></dt>
  34503. <dd><p>Set the alpha expression.
  34504. </p></dd>
  34505. <dt><samp>red_expr, r</samp></dt>
  34506. <dd><p>Set the red expression.
  34507. </p></dd>
  34508. <dt><samp>green_expr, g</samp></dt>
  34509. <dd><p>Set the green expression.
  34510. </p></dd>
  34511. <dt><samp>blue_expr, b</samp></dt>
  34512. <dd><p>Set the blue expression.
  34513. </p></dd>
  34514. </dl>
  34515. <p>The colorspace is selected according to the specified options. If one
  34516. of the <samp>lum_expr</samp>, <samp>cb_expr</samp>, or <samp>cr_expr</samp>
  34517. options is specified, the filter will automatically select a YCbCr
  34518. colorspace. If one of the <samp>red_expr</samp>, <samp>green_expr</samp>, or
  34519. <samp>blue_expr</samp> options is specified, it will select an RGB
  34520. colorspace.
  34521. </p>
  34522. <p>If one of the chrominance expression is not defined, it falls back on the other
  34523. one. If no alpha expression is specified it will evaluate to opaque value.
  34524. If none of chrominance expressions are specified, they will evaluate
  34525. to the luminance expression.
  34526. </p>
  34527. <p>The expressions can use the following variables and functions:
  34528. </p>
  34529. <dl compact="compact">
  34530. <dt><samp>N</samp></dt>
  34531. <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
  34532. </p>
  34533. </dd>
  34534. <dt><samp>X</samp></dt>
  34535. <dt><samp>Y</samp></dt>
  34536. <dd><p>The coordinates of the current sample.
  34537. </p>
  34538. </dd>
  34539. <dt><samp>W</samp></dt>
  34540. <dt><samp>H</samp></dt>
  34541. <dd><p>The width and height of the image.
  34542. </p>
  34543. </dd>
  34544. <dt><samp>SW</samp></dt>
  34545. <dt><samp>SH</samp></dt>
  34546. <dd><p>Width and height scale depending on the currently filtered plane. It is the
  34547. ratio between the corresponding luma plane number of pixels and the current
  34548. plane ones. E.g. for YUV4:2:0 the values are <code>1,1</code> for the luma plane, and
  34549. <code>0.5,0.5</code> for chroma planes.
  34550. </p>
  34551. </dd>
  34552. <dt><samp>T</samp></dt>
  34553. <dd><p>Time of the current frame, expressed in seconds.
  34554. </p>
  34555. </dd>
  34556. <dt><samp>p(x, y)</samp></dt>
  34557. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the current
  34558. plane.
  34559. </p>
  34560. </dd>
  34561. <dt><samp>lum(x, y)</samp></dt>
  34562. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the luminance
  34563. plane.
  34564. </p>
  34565. </dd>
  34566. <dt><samp>cb(x, y)</samp></dt>
  34567. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  34568. blue-difference chroma plane. Return 0 if there is no such plane.
  34569. </p>
  34570. </dd>
  34571. <dt><samp>cr(x, y)</samp></dt>
  34572. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  34573. red-difference chroma plane. Return 0 if there is no such plane.
  34574. </p>
  34575. </dd>
  34576. <dt><samp>r(x, y)</samp></dt>
  34577. <dt><samp>g(x, y)</samp></dt>
  34578. <dt><samp>b(x, y)</samp></dt>
  34579. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  34580. red/green/blue component. Return 0 if there is no such component.
  34581. </p>
  34582. </dd>
  34583. <dt><samp>alpha(x, y)</samp></dt>
  34584. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the alpha
  34585. plane. Return 0 if there is no such plane.
  34586. </p>
  34587. </dd>
  34588. <dt><samp>psum(x,y), lumsum(x, y), cbsum(x,y), crsum(x,y), rsum(x,y), gsum(x,y), bsum(x,y), alphasum(x,y)</samp></dt>
  34589. <dd><p>Sum of sample values in the rectangle from (0,0) to (x,y), this allows obtaining
  34590. sums of samples within a rectangle. See the functions without the sum postfix.
  34591. </p>
  34592. </dd>
  34593. <dt><samp>interpolation</samp></dt>
  34594. <dd><p>Set one of interpolation methods:
  34595. </p><dl compact="compact">
  34596. <dt><samp>nearest, n</samp></dt>
  34597. <dt><samp>bilinear, b</samp></dt>
  34598. </dl>
  34599. <p>Default is bilinear.
  34600. </p></dd>
  34601. </dl>
  34602. <p>For functions, if <var>x</var> and <var>y</var> are outside the area, the value will be
  34603. automatically clipped to the closer edge.
  34604. </p>
  34605. <p>Please note that this filter can use multiple threads in which case each slice
  34606. will have its own expression state. If you want to use only a single expression
  34607. state because your expressions depend on previous state then you should limit
  34608. the number of filter threads to 1.
  34609. </p>
  34610. <a name="Examples-110"></a>
  34611. <h4 class="subsection">39.97.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-110" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-110" aria-hidden="true">TOC</a></span></h4>
  34612. <ul>
  34613. <li> Flip the image horizontally:
  34614. <div class="example">
  34615. <pre class="example">geq=p(W-X\,Y)
  34616. </pre></div>
  34617. </li><li> Generate a bidimensional sine wave, with angle <code>PI/3</code> and a
  34618. wavelength of 100 pixels:
  34619. <div class="example">
  34620. <pre class="example">geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
  34621. </pre></div>
  34622. </li><li> Generate a fancy enigmatic moving light:
  34623. <div class="example">
  34624. <pre class="example">nullsrc=s=256x256,geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128
  34625. </pre></div>
  34626. </li><li> Generate a quick emboss effect:
  34627. <div class="example">
  34628. <pre class="example">format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
  34629. </pre></div>
  34630. </li><li> Modify RGB components depending on pixel position:
  34631. <div class="example">
  34632. <pre class="example">geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
  34633. </pre></div>
  34634. </li><li> Create a radial gradient that is the same size as the input (also see
  34635. the <a href="#vignette">vignette</a> filter):
  34636. <div class="example">
  34637. <pre class="example">geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray
  34638. </pre></div>
  34639. </li></ul>
  34640. <a name="gradfun"></a>
  34641. <h3 class="section">39.98 gradfun<span class="pull-right"><a class="anchor hidden-xs" href="#gradfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gradfun" aria-hidden="true">TOC</a></span></h3>
  34642. <p>Fix the banding artifacts that are sometimes introduced into nearly flat
  34643. regions by truncation to 8-bit color depth.
  34644. Interpolate the gradients that should go where the bands are, and
  34645. dither them.
  34646. </p>
  34647. <p>It is designed for playback only. Do not use it prior to
  34648. lossy compression, because compression tends to lose the dither and
  34649. bring back the bands.
  34650. </p>
  34651. <p>It accepts the following parameters:
  34652. </p>
  34653. <dl compact="compact">
  34654. <dt><samp>strength</samp></dt>
  34655. <dd><p>The maximum amount by which the filter will change any one pixel. This is also
  34656. the threshold for detecting nearly flat regions. Acceptable values range from
  34657. .51 to 64; the default value is 1.2. Out-of-range values will be clipped to the
  34658. valid range.
  34659. </p>
  34660. </dd>
  34661. <dt><samp>radius</samp></dt>
  34662. <dd><p>The neighborhood to fit the gradient to. A larger radius makes for smoother
  34663. gradients, but also prevents the filter from modifying the pixels near detailed
  34664. regions. Acceptable values are 8-32; the default value is 16. Out-of-range
  34665. values will be clipped to the valid range.
  34666. </p>
  34667. </dd>
  34668. </dl>
  34669. <p>Alternatively, the options can be specified as a flat string:
  34670. <var>strength</var>[:<var>radius</var>]
  34671. </p>
  34672. <a name="Examples-111"></a>
  34673. <h4 class="subsection">39.98.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-111" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-111" aria-hidden="true">TOC</a></span></h4>
  34674. <ul>
  34675. <li> Apply the filter with a <code>3.5</code> strength and radius of <code>8</code>:
  34676. <div class="example">
  34677. <pre class="example">gradfun=3.5:8
  34678. </pre></div>
  34679. </li><li> Specify radius, omitting the strength (which will fall-back to the default
  34680. value):
  34681. <div class="example">
  34682. <pre class="example">gradfun=radius=8
  34683. </pre></div>
  34684. </li></ul>
  34685. <span id="graphmonitor"></span><a name="graphmonitor-1"></a>
  34686. <h3 class="section">39.99 graphmonitor<span class="pull-right"><a class="anchor hidden-xs" href="#graphmonitor-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-graphmonitor-1" aria-hidden="true">TOC</a></span></h3>
  34687. <p>Show various filtergraph stats.
  34688. </p>
  34689. <p>With this filter one can debug complete filtergraph.
  34690. Especially issues with links filling with queued frames.
  34691. </p>
  34692. <p>The filter accepts the following options:
  34693. </p>
  34694. <dl compact="compact">
  34695. <dt><samp>size, s</samp></dt>
  34696. <dd><p>Set video output size. Default is <var>hd720</var>.
  34697. </p>
  34698. </dd>
  34699. <dt><samp>opacity, o</samp></dt>
  34700. <dd><p>Set video opacity. Default is <var>0.9</var>. Allowed range is from <var>0</var> to <var>1</var>.
  34701. </p>
  34702. </dd>
  34703. <dt><samp>mode, m</samp></dt>
  34704. <dd><p>Set output mode, can be <var>fulll</var> or <var>compact</var>.
  34705. In <var>compact</var> mode only filters with some queued frames have displayed stats.
  34706. </p>
  34707. </dd>
  34708. <dt><samp>flags, f</samp></dt>
  34709. <dd><p>Set flags which enable which stats are shown in video.
  34710. </p>
  34711. <p>Available values for flags are:
  34712. </p><dl compact="compact">
  34713. <dt>&lsquo;<samp>queue</samp>&rsquo;</dt>
  34714. <dd><p>Display number of queued frames in each link.
  34715. </p>
  34716. </dd>
  34717. <dt>&lsquo;<samp>frame_count_in</samp>&rsquo;</dt>
  34718. <dd><p>Display number of frames taken from filter.
  34719. </p>
  34720. </dd>
  34721. <dt>&lsquo;<samp>frame_count_out</samp>&rsquo;</dt>
  34722. <dd><p>Display number of frames given out from filter.
  34723. </p>
  34724. </dd>
  34725. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  34726. <dd><p>Display current filtered frame pts.
  34727. </p>
  34728. </dd>
  34729. <dt>&lsquo;<samp>time</samp>&rsquo;</dt>
  34730. <dd><p>Display current filtered frame time.
  34731. </p>
  34732. </dd>
  34733. <dt>&lsquo;<samp>timebase</samp>&rsquo;</dt>
  34734. <dd><p>Display time base for filter link.
  34735. </p>
  34736. </dd>
  34737. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  34738. <dd><p>Display used format for filter link.
  34739. </p>
  34740. </dd>
  34741. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  34742. <dd><p>Display video size or number of audio channels in case of audio used by filter link.
  34743. </p>
  34744. </dd>
  34745. <dt>&lsquo;<samp>rate</samp>&rsquo;</dt>
  34746. <dd><p>Display video frame rate or sample rate in case of audio used by filter link.
  34747. </p>
  34748. </dd>
  34749. <dt>&lsquo;<samp>eof</samp>&rsquo;</dt>
  34750. <dd><p>Display link output status.
  34751. </p></dd>
  34752. </dl>
  34753. </dd>
  34754. <dt><samp>rate, r</samp></dt>
  34755. <dd><p>Set upper limit for video rate of output stream, Default value is <var>25</var>.
  34756. This guarantee that output video frame rate will not be higher than this value.
  34757. </p></dd>
  34758. </dl>
  34759. <a name="greyedge"></a>
  34760. <h3 class="section">39.100 greyedge<span class="pull-right"><a class="anchor hidden-xs" href="#greyedge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-greyedge" aria-hidden="true">TOC</a></span></h3>
  34761. <p>A color constancy variation filter which estimates scene illumination via grey edge algorithm
  34762. and corrects the scene colors accordingly.
  34763. </p>
  34764. <p>See: <a href="https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf">https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf</a>
  34765. </p>
  34766. <p>The filter accepts the following options:
  34767. </p>
  34768. <dl compact="compact">
  34769. <dt><samp>difford</samp></dt>
  34770. <dd><p>The order of differentiation to be applied on the scene. Must be chosen in the range
  34771. [0,2] and default value is 1.
  34772. </p>
  34773. </dd>
  34774. <dt><samp>minknorm</samp></dt>
  34775. <dd><p>The Minkowski parameter to be used for calculating the Minkowski distance. Must
  34776. be chosen in the range [0,20] and default value is 1. Set to 0 for getting
  34777. max value instead of calculating Minkowski distance.
  34778. </p>
  34779. </dd>
  34780. <dt><samp>sigma</samp></dt>
  34781. <dd><p>The standard deviation of Gaussian blur to be applied on the scene. Must be
  34782. chosen in the range [0,1024.0] and default value = 1. floor( <var>sigma</var> * break_off_sigma(3) )
  34783. can&rsquo;t be equal to 0 if <var>difford</var> is greater than 0.
  34784. </p></dd>
  34785. </dl>
  34786. <a name="Examples-112"></a>
  34787. <h4 class="subsection">39.100.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-112" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-112" aria-hidden="true">TOC</a></span></h4>
  34788. <ul>
  34789. <li> Grey Edge:
  34790. <div class="example">
  34791. <pre class="example">greyedge=difford=1:minknorm=5:sigma=2
  34792. </pre></div>
  34793. </li><li> Max Edge:
  34794. <div class="example">
  34795. <pre class="example">greyedge=difford=1:minknorm=0:sigma=2
  34796. </pre></div>
  34797. </li></ul>
  34798. <span id="haldclut"></span><a name="haldclut-1"></a>
  34799. <h3 class="section">39.101 haldclut<span class="pull-right"><a class="anchor hidden-xs" href="#haldclut-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-haldclut-1" aria-hidden="true">TOC</a></span></h3>
  34800. <p>Apply a Hald CLUT to a video stream.
  34801. </p>
  34802. <p>First input is the video stream to process, and second one is the Hald CLUT.
  34803. The Hald CLUT input can be a simple picture or a complete video stream.
  34804. </p>
  34805. <p>The filter accepts the following options:
  34806. </p>
  34807. <dl compact="compact">
  34808. <dt><samp>shortest</samp></dt>
  34809. <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
  34810. </p></dd>
  34811. <dt><samp>repeatlast</samp></dt>
  34812. <dd><p>Continue applying the last CLUT after the end of the stream. A value of
  34813. <code>0</code> disable the filter after the last frame of the CLUT is reached.
  34814. Default is <code>1</code>.
  34815. </p></dd>
  34816. </dl>
  34817. <p><code>haldclut</code> also has the same interpolation options as <a href="#lut3d">lut3d</a> (both
  34818. filters share the same internals).
  34819. </p>
  34820. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  34821. </p>
  34822. <p>More information about the Hald CLUT can be found on Eskil Steenberg&rsquo;s website
  34823. (Hald CLUT author) at <a href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
  34824. </p>
  34825. <a name="Commands-83"></a>
  34826. <h4 class="subsection">39.101.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-83" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-83" aria-hidden="true">TOC</a></span></h4>
  34827. <p>This filter supports the <code>interp</code> option as <a href="#commands">commands</a>.
  34828. </p>
  34829. <a name="Workflow-examples"></a>
  34830. <h4 class="subsection">39.101.2 Workflow examples<span class="pull-right"><a class="anchor hidden-xs" href="#Workflow-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Workflow-examples" aria-hidden="true">TOC</a></span></h4>
  34831. <a name="Hald-CLUT-video-stream"></a>
  34832. <h4 class="subsubsection">39.101.2.1 Hald CLUT video stream<span class="pull-right"><a class="anchor hidden-xs" href="#Hald-CLUT-video-stream" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Hald-CLUT-video-stream" aria-hidden="true">TOC</a></span></h4>
  34833. <p>Generate an identity Hald CLUT stream altered with various effects:
  34834. </p><div class="example">
  34835. <pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;hue=H=2*PI*t:s=sin(2*PI*t)+1, curves=cross_process&quot; -t 10 -c:v ffv1 clut.nut
  34836. </pre></div>
  34837. <p>Note: make sure you use a lossless codec.
  34838. </p>
  34839. <p>Then use it with <code>haldclut</code> to apply it on some random stream:
  34840. </p><div class="example">
  34841. <pre class="example">ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
  34842. </pre></div>
  34843. <p>The Hald CLUT will be applied to the 10 first seconds (duration of
  34844. <samp>clut.nut</samp>), then the latest picture of that CLUT stream will be applied
  34845. to the remaining frames of the <code>mandelbrot</code> stream.
  34846. </p>
  34847. <a name="Hald-CLUT-with-preview"></a>
  34848. <h4 class="subsubsection">39.101.2.2 Hald CLUT with preview<span class="pull-right"><a class="anchor hidden-xs" href="#Hald-CLUT-with-preview" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Hald-CLUT-with-preview" aria-hidden="true">TOC</a></span></h4>
  34849. <p>A Hald CLUT is supposed to be a squared image of <code>Level*Level*Level</code> by
  34850. <code>Level*Level*Level</code> pixels. For a given Hald CLUT, FFmpeg will select the
  34851. biggest possible square starting at the top left of the picture. The remaining
  34852. padding pixels (bottom or right) will be ignored. This area can be used to add
  34853. a preview of the Hald CLUT.
  34854. </p>
  34855. <p>Typically, the following generated Hald CLUT will be supported by the
  34856. <code>haldclut</code> filter:
  34857. </p>
  34858. <div class="example">
  34859. <pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;
  34860. pad=iw+320 [padded_clut];
  34861. smptebars=s=320x256, split [a][b];
  34862. [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
  34863. [main][b] overlay=W-320&quot; -frames:v 1 clut.png
  34864. </pre></div>
  34865. <p>It contains the original and a preview of the effect of the CLUT: SMPTE color
  34866. bars are displayed on the right-top, and below the same color bars processed by
  34867. the color changes.
  34868. </p>
  34869. <p>Then, the effect of this Hald CLUT can be visualized with:
  34870. </p><div class="example">
  34871. <pre class="example">ffplay input.mkv -vf &quot;movie=clut.png, [in] haldclut&quot;
  34872. </pre></div>
  34873. <a name="hflip"></a>
  34874. <h3 class="section">39.102 hflip<span class="pull-right"><a class="anchor hidden-xs" href="#hflip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hflip" aria-hidden="true">TOC</a></span></h3>
  34875. <p>Flip the input video horizontally.
  34876. </p>
  34877. <p>For example, to horizontally flip the input video with <code>ffmpeg</code>:
  34878. </p><div class="example">
  34879. <pre class="example">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
  34880. </pre></div>
  34881. <a name="histeq"></a>
  34882. <h3 class="section">39.103 histeq<span class="pull-right"><a class="anchor hidden-xs" href="#histeq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-histeq" aria-hidden="true">TOC</a></span></h3>
  34883. <p>This filter applies a global color histogram equalization on a
  34884. per-frame basis.
  34885. </p>
  34886. <p>It can be used to correct video that has a compressed range of pixel
  34887. intensities. The filter redistributes the pixel intensities to
  34888. equalize their distribution across the intensity range. It may be
  34889. viewed as an &quot;automatically adjusting contrast filter&quot;. This filter is
  34890. useful only for correcting degraded or poorly captured source
  34891. video.
  34892. </p>
  34893. <p>The filter accepts the following options:
  34894. </p>
  34895. <dl compact="compact">
  34896. <dt><samp>strength</samp></dt>
  34897. <dd><p>Determine the amount of equalization to be applied. As the strength
  34898. is reduced, the distribution of pixel intensities more-and-more
  34899. approaches that of the input frame. The value must be a float number
  34900. in the range [0,1] and defaults to 0.200.
  34901. </p>
  34902. </dd>
  34903. <dt><samp>intensity</samp></dt>
  34904. <dd><p>Set the maximum intensity that can generated and scale the output
  34905. values appropriately. The strength should be set as desired and then
  34906. the intensity can be limited if needed to avoid washing-out. The value
  34907. must be a float number in the range [0,1] and defaults to 0.210.
  34908. </p>
  34909. </dd>
  34910. <dt><samp>antibanding</samp></dt>
  34911. <dd><p>Set the antibanding level. If enabled the filter will randomly vary
  34912. the luminance of output pixels by a small amount to avoid banding of
  34913. the histogram. Possible values are <code>none</code>, <code>weak</code> or
  34914. <code>strong</code>. It defaults to <code>none</code>.
  34915. </p></dd>
  34916. </dl>
  34917. <span id="histogram"></span><a name="histogram-1"></a>
  34918. <h3 class="section">39.104 histogram<span class="pull-right"><a class="anchor hidden-xs" href="#histogram-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-histogram-1" aria-hidden="true">TOC</a></span></h3>
  34919. <p>Compute and draw a color distribution histogram for the input video.
  34920. </p>
  34921. <p>The computed histogram is a representation of the color component
  34922. distribution in an image.
  34923. </p>
  34924. <p>Standard histogram displays the color components distribution in an image.
  34925. Displays color graph for each color component. Shows distribution of
  34926. the Y, U, V, A or R, G, B components, depending on input format, in the
  34927. current frame. Below each graph a color component scale meter is shown.
  34928. </p>
  34929. <p>The filter accepts the following options:
  34930. </p>
  34931. <dl compact="compact">
  34932. <dt><samp>level_height</samp></dt>
  34933. <dd><p>Set height of level. Default value is <code>200</code>.
  34934. Allowed range is [50, 2048].
  34935. </p>
  34936. </dd>
  34937. <dt><samp>scale_height</samp></dt>
  34938. <dd><p>Set height of color scale. Default value is <code>12</code>.
  34939. Allowed range is [0, 40].
  34940. </p>
  34941. </dd>
  34942. <dt><samp>display_mode</samp></dt>
  34943. <dd><p>Set display mode.
  34944. It accepts the following values:
  34945. </p><dl compact="compact">
  34946. <dt>&lsquo;<samp>stack</samp>&rsquo;</dt>
  34947. <dd><p>Per color component graphs are placed below each other.
  34948. </p>
  34949. </dd>
  34950. <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
  34951. <dd><p>Per color component graphs are placed side by side.
  34952. </p>
  34953. </dd>
  34954. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  34955. <dd><p>Presents information identical to that in the <code>parade</code>, except
  34956. that the graphs representing color components are superimposed directly
  34957. over one another.
  34958. </p></dd>
  34959. </dl>
  34960. <p>Default is <code>stack</code>.
  34961. </p>
  34962. </dd>
  34963. <dt><samp>levels_mode</samp></dt>
  34964. <dd><p>Set mode. Can be either <code>linear</code>, or <code>logarithmic</code>.
  34965. Default is <code>linear</code>.
  34966. </p>
  34967. </dd>
  34968. <dt><samp>components</samp></dt>
  34969. <dd><p>Set what color components to display.
  34970. Default is <code>7</code>.
  34971. </p>
  34972. </dd>
  34973. <dt><samp>fgopacity</samp></dt>
  34974. <dd><p>Set foreground opacity. Default is <code>0.7</code>.
  34975. </p>
  34976. </dd>
  34977. <dt><samp>bgopacity</samp></dt>
  34978. <dd><p>Set background opacity. Default is <code>0.5</code>.
  34979. </p></dd>
  34980. </dl>
  34981. <a name="Examples-113"></a>
  34982. <h4 class="subsection">39.104.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-113" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-113" aria-hidden="true">TOC</a></span></h4>
  34983. <ul>
  34984. <li> Calculate and draw histogram:
  34985. <div class="example">
  34986. <pre class="example">ffplay -i input -vf histogram
  34987. </pre></div>
  34988. </li></ul>
  34989. <span id="hqdn3d"></span><a name="hqdn3d-1"></a>
  34990. <h3 class="section">39.105 hqdn3d<span class="pull-right"><a class="anchor hidden-xs" href="#hqdn3d-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hqdn3d-1" aria-hidden="true">TOC</a></span></h3>
  34991. <p>This is a high precision/quality 3d denoise filter. It aims to reduce
  34992. image noise, producing smooth images and making still images really
  34993. still. It should enhance compressibility.
  34994. </p>
  34995. <p>It accepts the following optional parameters:
  34996. </p>
  34997. <dl compact="compact">
  34998. <dt><samp>luma_spatial</samp></dt>
  34999. <dd><p>A non-negative floating point number which specifies spatial luma strength.
  35000. It defaults to 4.0.
  35001. </p>
  35002. </dd>
  35003. <dt><samp>chroma_spatial</samp></dt>
  35004. <dd><p>A non-negative floating point number which specifies spatial chroma strength.
  35005. It defaults to 3.0*<var>luma_spatial</var>/4.0.
  35006. </p>
  35007. </dd>
  35008. <dt><samp>luma_tmp</samp></dt>
  35009. <dd><p>A floating point number which specifies luma temporal strength. It defaults to
  35010. 6.0*<var>luma_spatial</var>/4.0.
  35011. </p>
  35012. </dd>
  35013. <dt><samp>chroma_tmp</samp></dt>
  35014. <dd><p>A floating point number which specifies chroma temporal strength. It defaults to
  35015. <var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>.
  35016. </p></dd>
  35017. </dl>
  35018. <a name="Commands-84"></a>
  35019. <h4 class="subsection">39.105.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-84" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-84" aria-hidden="true">TOC</a></span></h4>
  35020. <p>This filter supports same <a href="#commands">commands</a> as options.
  35021. The command accepts the same syntax of the corresponding option.
  35022. </p>
  35023. <p>If the specified expression is not valid, it is kept at its current
  35024. value.
  35025. </p>
  35026. <span id="hwdownload"></span><a name="hwdownload-1"></a>
  35027. <h3 class="section">39.106 hwdownload<span class="pull-right"><a class="anchor hidden-xs" href="#hwdownload-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwdownload-1" aria-hidden="true">TOC</a></span></h3>
  35028. <p>Download hardware frames to system memory.
  35029. </p>
  35030. <p>The input must be in hardware frames, and the output a non-hardware format.
  35031. Not all formats will be supported on the output - it may be necessary to insert
  35032. an additional <samp>format</samp> filter immediately following in the graph to get
  35033. the output in a supported format.
  35034. </p>
  35035. <a name="hwmap"></a>
  35036. <h3 class="section">39.107 hwmap<span class="pull-right"><a class="anchor hidden-xs" href="#hwmap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwmap" aria-hidden="true">TOC</a></span></h3>
  35037. <p>Map hardware frames to system memory or to another device.
  35038. </p>
  35039. <p>This filter has several different modes of operation; which one is used depends
  35040. on the input and output formats:
  35041. </p><ul>
  35042. <li> Hardware frame input, normal frame output
  35043. <p>Map the input frames to system memory and pass them to the output. If the
  35044. original hardware frame is later required (for example, after overlaying
  35045. something else on part of it), the <samp>hwmap</samp> filter can be used again
  35046. in the next mode to retrieve it.
  35047. </p></li><li> Normal frame input, hardware frame output
  35048. <p>If the input is actually a software-mapped hardware frame, then unmap it -
  35049. that is, return the original hardware frame.
  35050. </p>
  35051. <p>Otherwise, a device must be provided. Create new hardware surfaces on that
  35052. device for the output, then map them back to the software format at the input
  35053. and give those frames to the preceding filter. This will then act like the
  35054. <samp>hwupload</samp> filter, but may be able to avoid an additional copy when
  35055. the input is already in a compatible format.
  35056. </p></li><li> Hardware frame input and output
  35057. <p>A device must be supplied for the output, either directly or with the
  35058. <samp>derive_device</samp> option. The input and output devices must be of
  35059. different types and compatible - the exact meaning of this is
  35060. system-dependent, but typically it means that they must refer to the same
  35061. underlying hardware context (for example, refer to the same graphics card).
  35062. </p>
  35063. <p>If the input frames were originally created on the output device, then unmap
  35064. to retrieve the original frames.
  35065. </p>
  35066. <p>Otherwise, map the frames to the output device - create new hardware frames
  35067. on the output corresponding to the frames on the input.
  35068. </p></li></ul>
  35069. <p>The following additional parameters are accepted:
  35070. </p>
  35071. <dl compact="compact">
  35072. <dt><samp>mode</samp></dt>
  35073. <dd><p>Set the frame mapping mode. Some combination of:
  35074. </p><dl compact="compact">
  35075. <dt><var>read</var></dt>
  35076. <dd><p>The mapped frame should be readable.
  35077. </p></dd>
  35078. <dt><var>write</var></dt>
  35079. <dd><p>The mapped frame should be writeable.
  35080. </p></dd>
  35081. <dt><var>overwrite</var></dt>
  35082. <dd><p>The mapping will always overwrite the entire frame.
  35083. </p>
  35084. <p>This may improve performance in some cases, as the original contents of the
  35085. frame need not be loaded.
  35086. </p></dd>
  35087. <dt><var>direct</var></dt>
  35088. <dd><p>The mapping must not involve any copying.
  35089. </p>
  35090. <p>Indirect mappings to copies of frames are created in some cases where either
  35091. direct mapping is not possible or it would have unexpected properties.
  35092. Setting this flag ensures that the mapping is direct and will fail if that is
  35093. not possible.
  35094. </p></dd>
  35095. </dl>
  35096. <p>Defaults to <var>read+write</var> if not specified.
  35097. </p>
  35098. </dd>
  35099. <dt><samp>derive_device <var>type</var></samp></dt>
  35100. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  35101. device of type <var>type</var> from the device the input frames exist on.
  35102. </p>
  35103. </dd>
  35104. <dt><samp>reverse</samp></dt>
  35105. <dd><p>In a hardware to hardware mapping, map in reverse - create frames in the sink
  35106. and map them back to the source. This may be necessary in some cases where
  35107. a mapping in one direction is required but only the opposite direction is
  35108. supported by the devices being used.
  35109. </p>
  35110. <p>This option is dangerous - it may break the preceding filter in undefined
  35111. ways if there are any additional constraints on that filter&rsquo;s output.
  35112. Do not use it without fully understanding the implications of its use.
  35113. </p></dd>
  35114. </dl>
  35115. <span id="hwupload"></span><a name="hwupload-1"></a>
  35116. <h3 class="section">39.108 hwupload<span class="pull-right"><a class="anchor hidden-xs" href="#hwupload-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwupload-1" aria-hidden="true">TOC</a></span></h3>
  35117. <p>Upload system memory frames to hardware surfaces.
  35118. </p>
  35119. <p>The device to upload to must be supplied when the filter is initialised. If
  35120. using ffmpeg, select the appropriate device with the <samp>-filter_hw_device</samp>
  35121. option or with the <samp>derive_device</samp> option. The input and output devices
  35122. must be of different types and compatible - the exact meaning of this is
  35123. system-dependent, but typically it means that they must refer to the same
  35124. underlying hardware context (for example, refer to the same graphics card).
  35125. </p>
  35126. <p>The following additional parameters are accepted:
  35127. </p>
  35128. <dl compact="compact">
  35129. <dt><samp>derive_device <var>type</var></samp></dt>
  35130. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  35131. device of type <var>type</var> from the device the input frames exist on.
  35132. </p></dd>
  35133. </dl>
  35134. <span id="hwupload_005fcuda"></span><a name="hwupload_005fcuda-1"></a>
  35135. <h3 class="section">39.109 hwupload_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#hwupload_005fcuda-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwupload_005fcuda-1" aria-hidden="true">TOC</a></span></h3>
  35136. <p>Upload system memory frames to a CUDA device.
  35137. </p>
  35138. <p>It accepts the following optional parameters:
  35139. </p>
  35140. <dl compact="compact">
  35141. <dt><samp>device</samp></dt>
  35142. <dd><p>The number of the CUDA device to use
  35143. </p></dd>
  35144. </dl>
  35145. <a name="hqx"></a>
  35146. <h3 class="section">39.110 hqx<span class="pull-right"><a class="anchor hidden-xs" href="#hqx" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hqx" aria-hidden="true">TOC</a></span></h3>
  35147. <p>Apply a high-quality magnification filter designed for pixel art. This filter
  35148. was originally created by Maxim Stepin.
  35149. </p>
  35150. <p>It accepts the following option:
  35151. </p>
  35152. <dl compact="compact">
  35153. <dt><samp>n</samp></dt>
  35154. <dd><p>Set the scaling dimension: <code>2</code> for <code>hq2x</code>, <code>3</code> for
  35155. <code>hq3x</code> and <code>4</code> for <code>hq4x</code>.
  35156. Default is <code>3</code>.
  35157. </p></dd>
  35158. </dl>
  35159. <a name="hstack"></a>
  35160. <h3 class="section">39.111 hstack<span class="pull-right"><a class="anchor hidden-xs" href="#hstack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hstack" aria-hidden="true">TOC</a></span></h3>
  35161. <p>Stack input videos horizontally.
  35162. </p>
  35163. <p>All streams must be of same pixel format and of same height.
  35164. </p>
  35165. <p>Note that this filter is faster than using <a href="#overlay">overlay</a> and <a href="#pad">pad</a> filter
  35166. to create same output.
  35167. </p>
  35168. <p>The filter accepts the following option:
  35169. </p>
  35170. <dl compact="compact">
  35171. <dt><samp>inputs</samp></dt>
  35172. <dd><p>Set number of input streams. Default is 2.
  35173. </p>
  35174. </dd>
  35175. <dt><samp>shortest</samp></dt>
  35176. <dd><p>If set to 1, force the output to terminate when the shortest input
  35177. terminates. Default value is 0.
  35178. </p></dd>
  35179. </dl>
  35180. <a name="hue"></a>
  35181. <h3 class="section">39.112 hue<span class="pull-right"><a class="anchor hidden-xs" href="#hue" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hue" aria-hidden="true">TOC</a></span></h3>
  35182. <p>Modify the hue and/or the saturation of the input.
  35183. </p>
  35184. <p>It accepts the following parameters:
  35185. </p>
  35186. <dl compact="compact">
  35187. <dt><samp>h</samp></dt>
  35188. <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
  35189. and defaults to &quot;0&quot;.
  35190. </p>
  35191. </dd>
  35192. <dt><samp>s</samp></dt>
  35193. <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
  35194. defaults to &quot;1&quot;.
  35195. </p>
  35196. </dd>
  35197. <dt><samp>H</samp></dt>
  35198. <dd><p>Specify the hue angle as a number of radians. It accepts an
  35199. expression, and defaults to &quot;0&quot;.
  35200. </p>
  35201. </dd>
  35202. <dt><samp>b</samp></dt>
  35203. <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
  35204. defaults to &quot;0&quot;.
  35205. </p></dd>
  35206. </dl>
  35207. <p><samp>h</samp> and <samp>H</samp> are mutually exclusive, and can&rsquo;t be
  35208. specified at the same time.
  35209. </p>
  35210. <p>The <samp>b</samp>, <samp>h</samp>, <samp>H</samp> and <samp>s</samp> option values are
  35211. expressions containing the following constants:
  35212. </p>
  35213. <dl compact="compact">
  35214. <dt><samp>n</samp></dt>
  35215. <dd><p>frame count of the input frame starting from 0
  35216. </p>
  35217. </dd>
  35218. <dt><samp>pts</samp></dt>
  35219. <dd><p>presentation timestamp of the input frame expressed in time base units
  35220. </p>
  35221. </dd>
  35222. <dt><samp>r</samp></dt>
  35223. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  35224. </p>
  35225. </dd>
  35226. <dt><samp>t</samp></dt>
  35227. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  35228. </p>
  35229. </dd>
  35230. <dt><samp>tb</samp></dt>
  35231. <dd><p>time base of the input video
  35232. </p></dd>
  35233. </dl>
  35234. <a name="Examples-114"></a>
  35235. <h4 class="subsection">39.112.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-114" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-114" aria-hidden="true">TOC</a></span></h4>
  35236. <ul>
  35237. <li> Set the hue to 90 degrees and the saturation to 1.0:
  35238. <div class="example">
  35239. <pre class="example">hue=h=90:s=1
  35240. </pre></div>
  35241. </li><li> Same command but expressing the hue in radians:
  35242. <div class="example">
  35243. <pre class="example">hue=H=PI/2:s=1
  35244. </pre></div>
  35245. </li><li> Rotate hue and make the saturation swing between 0
  35246. and 2 over a period of 1 second:
  35247. <div class="example">
  35248. <pre class="example">hue=&quot;H=2*PI*t: s=sin(2*PI*t)+1&quot;
  35249. </pre></div>
  35250. </li><li> Apply a 3 seconds saturation fade-in effect starting at 0:
  35251. <div class="example">
  35252. <pre class="example">hue=&quot;s=min(t/3\,1)&quot;
  35253. </pre></div>
  35254. <p>The general fade-in expression can be written as:
  35255. </p><div class="example">
  35256. <pre class="example">hue=&quot;s=min(0\, max((t-START)/DURATION\, 1))&quot;
  35257. </pre></div>
  35258. </li><li> Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
  35259. <div class="example">
  35260. <pre class="example">hue=&quot;s=max(0\, min(1\, (8-t)/3))&quot;
  35261. </pre></div>
  35262. <p>The general fade-out expression can be written as:
  35263. </p><div class="example">
  35264. <pre class="example">hue=&quot;s=max(0\, min(1\, (START+DURATION-t)/DURATION))&quot;
  35265. </pre></div>
  35266. </li></ul>
  35267. <a name="Commands-85"></a>
  35268. <h4 class="subsection">39.112.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-85" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-85" aria-hidden="true">TOC</a></span></h4>
  35269. <p>This filter supports the following commands:
  35270. </p><dl compact="compact">
  35271. <dt><samp>b</samp></dt>
  35272. <dt><samp>s</samp></dt>
  35273. <dt><samp>h</samp></dt>
  35274. <dt><samp>H</samp></dt>
  35275. <dd><p>Modify the hue and/or the saturation and/or brightness of the input video.
  35276. The command accepts the same syntax of the corresponding option.
  35277. </p>
  35278. <p>If the specified expression is not valid, it is kept at its current
  35279. value.
  35280. </p></dd>
  35281. </dl>
  35282. <a name="hysteresis"></a>
  35283. <h3 class="section">39.113 hysteresis<span class="pull-right"><a class="anchor hidden-xs" href="#hysteresis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hysteresis" aria-hidden="true">TOC</a></span></h3>
  35284. <p>Grow first stream into second stream by connecting components.
  35285. This makes it possible to build more robust edge masks.
  35286. </p>
  35287. <p>This filter accepts the following options:
  35288. </p>
  35289. <dl compact="compact">
  35290. <dt><samp>planes</samp></dt>
  35291. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  35292. copied from first stream.
  35293. By default value 0xf, all planes will be processed.
  35294. </p>
  35295. </dd>
  35296. <dt><samp>threshold</samp></dt>
  35297. <dd><p>Set threshold which is used in filtering. If pixel component value is higher than
  35298. this value filter algorithm for connecting components is activated.
  35299. By default value is 0.
  35300. </p></dd>
  35301. </dl>
  35302. <p>The <code>hysteresis</code> filter also supports the <a href="#framesync">framesync</a> options.
  35303. </p>
  35304. <a name="identity"></a>
  35305. <h3 class="section">39.114 identity<span class="pull-right"><a class="anchor hidden-xs" href="#identity" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-identity" aria-hidden="true">TOC</a></span></h3>
  35306. <p>Obtain the identity score between two input videos.
  35307. </p>
  35308. <p>This filter takes two input videos.
  35309. </p>
  35310. <p>Both input videos must have the same resolution and pixel format for
  35311. this filter to work correctly. Also it assumes that both inputs
  35312. have the same number of frames, which are compared one by one.
  35313. </p>
  35314. <p>The obtained per component, average, min and max identity score is printed through
  35315. the logging system.
  35316. </p>
  35317. <p>The filter stores the calculated identity scores of each frame in frame metadata.
  35318. </p>
  35319. <p>In the below example the input file <samp>main.mpg</samp> being processed is compared
  35320. with the reference file <samp>ref.mpg</samp>.
  35321. </p>
  35322. <div class="example">
  35323. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi identity -f null -
  35324. </pre></div>
  35325. <a name="idet"></a>
  35326. <h3 class="section">39.115 idet<span class="pull-right"><a class="anchor hidden-xs" href="#idet" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-idet" aria-hidden="true">TOC</a></span></h3>
  35327. <p>Detect video interlacing type.
  35328. </p>
  35329. <p>This filter tries to detect if the input frames are interlaced, progressive,
  35330. top or bottom field first. It will also try to detect fields that are
  35331. repeated between adjacent frames (a sign of telecine).
  35332. </p>
  35333. <p>Single frame detection considers only immediately adjacent frames when classifying each frame.
  35334. Multiple frame detection incorporates the classification history of previous frames.
  35335. </p>
  35336. <p>The filter will log these metadata values:
  35337. </p>
  35338. <dl compact="compact">
  35339. <dt><samp>single.current_frame</samp></dt>
  35340. <dd><p>Detected type of current frame using single-frame detection. One of:
  35341. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  35342. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  35343. </p>
  35344. </dd>
  35345. <dt><samp>single.tff</samp></dt>
  35346. <dd><p>Cumulative number of frames detected as top field first using single-frame detection.
  35347. </p>
  35348. </dd>
  35349. <dt><samp>multiple.tff</samp></dt>
  35350. <dd><p>Cumulative number of frames detected as top field first using multiple-frame detection.
  35351. </p>
  35352. </dd>
  35353. <dt><samp>single.bff</samp></dt>
  35354. <dd><p>Cumulative number of frames detected as bottom field first using single-frame detection.
  35355. </p>
  35356. </dd>
  35357. <dt><samp>multiple.current_frame</samp></dt>
  35358. <dd><p>Detected type of current frame using multiple-frame detection. One of:
  35359. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  35360. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  35361. </p>
  35362. </dd>
  35363. <dt><samp>multiple.bff</samp></dt>
  35364. <dd><p>Cumulative number of frames detected as bottom field first using multiple-frame detection.
  35365. </p>
  35366. </dd>
  35367. <dt><samp>single.progressive</samp></dt>
  35368. <dd><p>Cumulative number of frames detected as progressive using single-frame detection.
  35369. </p>
  35370. </dd>
  35371. <dt><samp>multiple.progressive</samp></dt>
  35372. <dd><p>Cumulative number of frames detected as progressive using multiple-frame detection.
  35373. </p>
  35374. </dd>
  35375. <dt><samp>single.undetermined</samp></dt>
  35376. <dd><p>Cumulative number of frames that could not be classified using single-frame detection.
  35377. </p>
  35378. </dd>
  35379. <dt><samp>multiple.undetermined</samp></dt>
  35380. <dd><p>Cumulative number of frames that could not be classified using multiple-frame detection.
  35381. </p>
  35382. </dd>
  35383. <dt><samp>repeated.current_frame</samp></dt>
  35384. <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;.
  35385. </p>
  35386. </dd>
  35387. <dt><samp>repeated.neither</samp></dt>
  35388. <dd><p>Cumulative number of frames with no repeated field.
  35389. </p>
  35390. </dd>
  35391. <dt><samp>repeated.top</samp></dt>
  35392. <dd><p>Cumulative number of frames with the top field repeated from the previous frame&rsquo;s top field.
  35393. </p>
  35394. </dd>
  35395. <dt><samp>repeated.bottom</samp></dt>
  35396. <dd><p>Cumulative number of frames with the bottom field repeated from the previous frame&rsquo;s bottom field.
  35397. </p></dd>
  35398. </dl>
  35399. <p>The filter accepts the following options:
  35400. </p>
  35401. <dl compact="compact">
  35402. <dt><samp>intl_thres</samp></dt>
  35403. <dd><p>Set interlacing threshold.
  35404. </p></dd>
  35405. <dt><samp>prog_thres</samp></dt>
  35406. <dd><p>Set progressive threshold.
  35407. </p></dd>
  35408. <dt><samp>rep_thres</samp></dt>
  35409. <dd><p>Threshold for repeated field detection.
  35410. </p></dd>
  35411. <dt><samp>half_life</samp></dt>
  35412. <dd><p>Number of frames after which a given frame&rsquo;s contribution to the
  35413. statistics is halved (i.e., it contributes only 0.5 to its
  35414. classification). The default of 0 means that all frames seen are given
  35415. full weight of 1.0 forever.
  35416. </p></dd>
  35417. <dt><samp>analyze_interlaced_flag</samp></dt>
  35418. <dd><p>When this is not 0 then idet will use the specified number of frames to determine
  35419. if the interlaced flag is accurate, it will not count undetermined frames.
  35420. If the flag is found to be accurate it will be used without any further
  35421. computations, if it is found to be inaccurate it will be cleared without any
  35422. further computations. This allows inserting the idet filter as a low computational
  35423. method to clean up the interlaced flag
  35424. </p></dd>
  35425. </dl>
  35426. <a name="il"></a>
  35427. <h3 class="section">39.116 il<span class="pull-right"><a class="anchor hidden-xs" href="#il" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-il" aria-hidden="true">TOC</a></span></h3>
  35428. <p>Deinterleave or interleave fields.
  35429. </p>
  35430. <p>This filter allows one to process interlaced images fields without
  35431. deinterlacing them. Deinterleaving splits the input frame into 2
  35432. fields (so called half pictures). Odd lines are moved to the top
  35433. half of the output image, even lines to the bottom half.
  35434. You can process (filter) them independently and then re-interleave them.
  35435. </p>
  35436. <p>The filter accepts the following options:
  35437. </p>
  35438. <dl compact="compact">
  35439. <dt><samp>luma_mode, l</samp></dt>
  35440. <dt><samp>chroma_mode, c</samp></dt>
  35441. <dt><samp>alpha_mode, a</samp></dt>
  35442. <dd><p>Available values for <var>luma_mode</var>, <var>chroma_mode</var> and
  35443. <var>alpha_mode</var> are:
  35444. </p>
  35445. <dl compact="compact">
  35446. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  35447. <dd><p>Do nothing.
  35448. </p>
  35449. </dd>
  35450. <dt>&lsquo;<samp>deinterleave, d</samp>&rsquo;</dt>
  35451. <dd><p>Deinterleave fields, placing one above the other.
  35452. </p>
  35453. </dd>
  35454. <dt>&lsquo;<samp>interleave, i</samp>&rsquo;</dt>
  35455. <dd><p>Interleave fields. Reverse the effect of deinterleaving.
  35456. </p></dd>
  35457. </dl>
  35458. <p>Default value is <code>none</code>.
  35459. </p>
  35460. </dd>
  35461. <dt><samp>luma_swap, ls</samp></dt>
  35462. <dt><samp>chroma_swap, cs</samp></dt>
  35463. <dt><samp>alpha_swap, as</samp></dt>
  35464. <dd><p>Swap luma/chroma/alpha fields. Exchange even &amp; odd lines. Default value is <code>0</code>.
  35465. </p></dd>
  35466. </dl>
  35467. <a name="Commands-86"></a>
  35468. <h4 class="subsection">39.116.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-86" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-86" aria-hidden="true">TOC</a></span></h4>
  35469. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  35470. </p>
  35471. <a name="inflate"></a>
  35472. <h3 class="section">39.117 inflate<span class="pull-right"><a class="anchor hidden-xs" href="#inflate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-inflate" aria-hidden="true">TOC</a></span></h3>
  35473. <p>Apply inflate effect to the video.
  35474. </p>
  35475. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  35476. only values higher than the pixel.
  35477. </p>
  35478. <p>It accepts the following options:
  35479. </p>
  35480. <dl compact="compact">
  35481. <dt><samp>threshold0</samp></dt>
  35482. <dt><samp>threshold1</samp></dt>
  35483. <dt><samp>threshold2</samp></dt>
  35484. <dt><samp>threshold3</samp></dt>
  35485. <dd><p>Limit the maximum change for each plane, default is 65535.
  35486. If 0, plane will remain unchanged.
  35487. </p></dd>
  35488. </dl>
  35489. <a name="Commands-87"></a>
  35490. <h4 class="subsection">39.117.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-87" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-87" aria-hidden="true">TOC</a></span></h4>
  35491. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  35492. </p>
  35493. <a name="interlace"></a>
  35494. <h3 class="section">39.118 interlace<span class="pull-right"><a class="anchor hidden-xs" href="#interlace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-interlace" aria-hidden="true">TOC</a></span></h3>
  35495. <p>Simple interlacing filter from progressive contents. This interleaves upper (or
  35496. lower) lines from odd frames with lower (or upper) lines from even frames,
  35497. halving the frame rate and preserving image height.
  35498. </p>
  35499. <div class="example">
  35500. <pre class="example"> Original Original New Frame
  35501. Frame 'j' Frame 'j+1' (tff)
  35502. ========== =========== ==================
  35503. Line 0 --------------------&gt; Frame 'j' Line 0
  35504. Line 1 Line 1 ----&gt; Frame 'j+1' Line 1
  35505. Line 2 ---------------------&gt; Frame 'j' Line 2
  35506. Line 3 Line 3 ----&gt; Frame 'j+1' Line 3
  35507. ... ... ...
  35508. New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
  35509. </pre></div>
  35510. <p>It accepts the following optional parameters:
  35511. </p>
  35512. <dl compact="compact">
  35513. <dt><samp>scan</samp></dt>
  35514. <dd><p>This determines whether the interlaced frame is taken from the even
  35515. (tff - default) or odd (bff) lines of the progressive frame.
  35516. </p>
  35517. </dd>
  35518. <dt><samp>lowpass</samp></dt>
  35519. <dd><p>Vertical lowpass filter to avoid twitter interlacing and
  35520. reduce moire patterns.
  35521. </p>
  35522. <dl compact="compact">
  35523. <dt>&lsquo;<samp>0, off</samp>&rsquo;</dt>
  35524. <dd><p>Disable vertical lowpass filter
  35525. </p>
  35526. </dd>
  35527. <dt>&lsquo;<samp>1, linear</samp>&rsquo;</dt>
  35528. <dd><p>Enable linear filter (default)
  35529. </p>
  35530. </dd>
  35531. <dt>&lsquo;<samp>2, complex</samp>&rsquo;</dt>
  35532. <dd><p>Enable complex filter. This will slightly less reduce twitter and moire
  35533. but better retain detail and subjective sharpness impression.
  35534. </p>
  35535. </dd>
  35536. </dl>
  35537. </dd>
  35538. </dl>
  35539. <a name="kerndeint"></a>
  35540. <h3 class="section">39.119 kerndeint<span class="pull-right"><a class="anchor hidden-xs" href="#kerndeint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-kerndeint" aria-hidden="true">TOC</a></span></h3>
  35541. <p>Deinterlace input video by applying Donald Graft&rsquo;s adaptive kernel
  35542. deinterling. Work on interlaced parts of a video to produce
  35543. progressive frames.
  35544. </p>
  35545. <p>The description of the accepted parameters follows.
  35546. </p>
  35547. <dl compact="compact">
  35548. <dt><samp>thresh</samp></dt>
  35549. <dd><p>Set the threshold which affects the filter&rsquo;s tolerance when
  35550. determining if a pixel line must be processed. It must be an integer
  35551. in the range [0,255] and defaults to 10. A value of 0 will result in
  35552. applying the process on every pixels.
  35553. </p>
  35554. </dd>
  35555. <dt><samp>map</samp></dt>
  35556. <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
  35557. Default is 0.
  35558. </p>
  35559. </dd>
  35560. <dt><samp>order</samp></dt>
  35561. <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
  35562. 0. Default is 0.
  35563. </p>
  35564. </dd>
  35565. <dt><samp>sharp</samp></dt>
  35566. <dd><p>Enable additional sharpening if set to 1. Default is 0.
  35567. </p>
  35568. </dd>
  35569. <dt><samp>twoway</samp></dt>
  35570. <dd><p>Enable twoway sharpening if set to 1. Default is 0.
  35571. </p></dd>
  35572. </dl>
  35573. <a name="Examples-115"></a>
  35574. <h4 class="subsection">39.119.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-115" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-115" aria-hidden="true">TOC</a></span></h4>
  35575. <ul>
  35576. <li> Apply default values:
  35577. <div class="example">
  35578. <pre class="example">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
  35579. </pre></div>
  35580. </li><li> Enable additional sharpening:
  35581. <div class="example">
  35582. <pre class="example">kerndeint=sharp=1
  35583. </pre></div>
  35584. </li><li> Paint processed pixels in white:
  35585. <div class="example">
  35586. <pre class="example">kerndeint=map=1
  35587. </pre></div>
  35588. </li></ul>
  35589. <a name="kirsch"></a>
  35590. <h3 class="section">39.120 kirsch<span class="pull-right"><a class="anchor hidden-xs" href="#kirsch" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-kirsch" aria-hidden="true">TOC</a></span></h3>
  35591. <p>Apply kirsch operator to input video stream.
  35592. </p>
  35593. <p>The filter accepts the following option:
  35594. </p>
  35595. <dl compact="compact">
  35596. <dt><samp>planes</samp></dt>
  35597. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  35598. By default value 0xf, all planes will be processed.
  35599. </p>
  35600. </dd>
  35601. <dt><samp>scale</samp></dt>
  35602. <dd><p>Set value which will be multiplied with filtered result.
  35603. </p>
  35604. </dd>
  35605. <dt><samp>delta</samp></dt>
  35606. <dd><p>Set value which will be added to filtered result.
  35607. </p></dd>
  35608. </dl>
  35609. <a name="Commands-88"></a>
  35610. <h4 class="subsection">39.120.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-88" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-88" aria-hidden="true">TOC</a></span></h4>
  35611. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  35612. </p>
  35613. <a name="lagfun"></a>
  35614. <h3 class="section">39.121 lagfun<span class="pull-right"><a class="anchor hidden-xs" href="#lagfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lagfun" aria-hidden="true">TOC</a></span></h3>
  35615. <p>Slowly update darker pixels.
  35616. </p>
  35617. <p>This filter makes short flashes of light appear longer.
  35618. This filter accepts the following options:
  35619. </p>
  35620. <dl compact="compact">
  35621. <dt><samp>decay</samp></dt>
  35622. <dd><p>Set factor for decaying. Default is .95. Allowed range is from 0 to 1.
  35623. </p>
  35624. </dd>
  35625. <dt><samp>planes</samp></dt>
  35626. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  35627. </p></dd>
  35628. </dl>
  35629. <a name="Commands-89"></a>
  35630. <h4 class="subsection">39.121.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-89" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-89" aria-hidden="true">TOC</a></span></h4>
  35631. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  35632. </p>
  35633. <a name="lenscorrection"></a>
  35634. <h3 class="section">39.122 lenscorrection<span class="pull-right"><a class="anchor hidden-xs" href="#lenscorrection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lenscorrection" aria-hidden="true">TOC</a></span></h3>
  35635. <p>Correct radial lens distortion
  35636. </p>
  35637. <p>This filter can be used to correct for radial distortion as can result from the use
  35638. of wide angle lenses, and thereby re-rectify the image. To find the right parameters
  35639. one can use tools available for example as part of opencv or simply trial-and-error.
  35640. To use opencv use the calibration sample (under samples/cpp) from the opencv sources
  35641. and extract the k1 and k2 coefficients from the resulting matrix.
  35642. </p>
  35643. <p>Note that effectively the same filter is available in the open-source tools Krita and
  35644. Digikam from the KDE project.
  35645. </p>
  35646. <p>In contrast to the <a href="#vignette">vignette</a> filter, which can also be used to compensate lens errors,
  35647. this filter corrects the distortion of the image, whereas <a href="#vignette">vignette</a> corrects the
  35648. brightness distribution, so you may want to use both filters together in certain
  35649. cases, though you will have to take care of ordering, i.e. whether vignetting should
  35650. be applied before or after lens correction.
  35651. </p>
  35652. <a name="Options-85"></a>
  35653. <h4 class="subsection">39.122.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-85" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-85" aria-hidden="true">TOC</a></span></h4>
  35654. <p>The filter accepts the following options:
  35655. </p>
  35656. <dl compact="compact">
  35657. <dt><samp>cx</samp></dt>
  35658. <dd><p>Relative x-coordinate of the focal point of the image, and thereby the center of the
  35659. distortion. This value has a range [0,1] and is expressed as fractions of the image
  35660. width. Default is 0.5.
  35661. </p></dd>
  35662. <dt><samp>cy</samp></dt>
  35663. <dd><p>Relative y-coordinate of the focal point of the image, and thereby the center of the
  35664. distortion. This value has a range [0,1] and is expressed as fractions of the image
  35665. height. Default is 0.5.
  35666. </p></dd>
  35667. <dt><samp>k1</samp></dt>
  35668. <dd><p>Coefficient of the quadratic correction term. This value has a range [-1,1]. 0 means
  35669. no correction. Default is 0.
  35670. </p></dd>
  35671. <dt><samp>k2</samp></dt>
  35672. <dd><p>Coefficient of the double quadratic correction term. This value has a range [-1,1].
  35673. 0 means no correction. Default is 0.
  35674. </p></dd>
  35675. <dt><samp>i</samp></dt>
  35676. <dd><p>Set interpolation type. Can be <code>nearest</code> or <code>bilinear</code>.
  35677. Default is <code>nearest</code>.
  35678. </p></dd>
  35679. <dt><samp>fc</samp></dt>
  35680. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  35681. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils
  35682. manual</a>. Default color is <code>black@0</code>.
  35683. </p></dd>
  35684. </dl>
  35685. <p>The formula that generates the correction is:
  35686. </p>
  35687. <p><var>r_src</var> = <var>r_tgt</var> * (1 + <var>k1</var> * (<var>r_tgt</var> / <var>r_0</var>)^2 + <var>k2</var> * (<var>r_tgt</var> / <var>r_0</var>)^4)
  35688. </p>
  35689. <p>where <var>r_0</var> is halve of the image diagonal and <var>r_src</var> and <var>r_tgt</var> are the
  35690. distances from the focal point in the source and target images, respectively.
  35691. </p>
  35692. <a name="Commands-90"></a>
  35693. <h4 class="subsection">39.122.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-90" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-90" aria-hidden="true">TOC</a></span></h4>
  35694. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  35695. </p>
  35696. <a name="lensfun"></a>
  35697. <h3 class="section">39.123 lensfun<span class="pull-right"><a class="anchor hidden-xs" href="#lensfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lensfun" aria-hidden="true">TOC</a></span></h3>
  35698. <p>Apply lens correction via the lensfun library (<a href="http://lensfun.sourceforge.net/">http://lensfun.sourceforge.net/</a>).
  35699. </p>
  35700. <p>The <code>lensfun</code> filter requires the camera make, camera model, and lens model
  35701. to apply the lens correction. The filter will load the lensfun database and
  35702. query it to find the corresponding camera and lens entries in the database. As
  35703. long as these entries can be found with the given options, the filter can
  35704. perform corrections on frames. Note that incomplete strings will result in the
  35705. filter choosing the best match with the given options, and the filter will
  35706. output the chosen camera and lens models (logged with level &quot;info&quot;). You must
  35707. provide the make, camera model, and lens model as they are required.
  35708. </p>
  35709. <p>The filter accepts the following options:
  35710. </p>
  35711. <dl compact="compact">
  35712. <dt><samp>make</samp></dt>
  35713. <dd><p>The make of the camera (for example, &quot;Canon&quot;). This option is required.
  35714. </p>
  35715. </dd>
  35716. <dt><samp>model</samp></dt>
  35717. <dd><p>The model of the camera (for example, &quot;Canon EOS 100D&quot;). This option is
  35718. required.
  35719. </p>
  35720. </dd>
  35721. <dt><samp>lens_model</samp></dt>
  35722. <dd><p>The model of the lens (for example, &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;). This
  35723. option is required.
  35724. </p>
  35725. </dd>
  35726. <dt><samp>mode</samp></dt>
  35727. <dd><p>The type of correction to apply. The following values are valid options:
  35728. </p>
  35729. <dl compact="compact">
  35730. <dt>&lsquo;<samp>vignetting</samp>&rsquo;</dt>
  35731. <dd><p>Enables fixing lens vignetting.
  35732. </p>
  35733. </dd>
  35734. <dt>&lsquo;<samp>geometry</samp>&rsquo;</dt>
  35735. <dd><p>Enables fixing lens geometry. This is the default.
  35736. </p>
  35737. </dd>
  35738. <dt>&lsquo;<samp>subpixel</samp>&rsquo;</dt>
  35739. <dd><p>Enables fixing chromatic aberrations.
  35740. </p>
  35741. </dd>
  35742. <dt>&lsquo;<samp>vig_geo</samp>&rsquo;</dt>
  35743. <dd><p>Enables fixing lens vignetting and lens geometry.
  35744. </p>
  35745. </dd>
  35746. <dt>&lsquo;<samp>vig_subpixel</samp>&rsquo;</dt>
  35747. <dd><p>Enables fixing lens vignetting and chromatic aberrations.
  35748. </p>
  35749. </dd>
  35750. <dt>&lsquo;<samp>distortion</samp>&rsquo;</dt>
  35751. <dd><p>Enables fixing both lens geometry and chromatic aberrations.
  35752. </p>
  35753. </dd>
  35754. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  35755. <dd><p>Enables all possible corrections.
  35756. </p>
  35757. </dd>
  35758. </dl>
  35759. </dd>
  35760. <dt><samp>focal_length</samp></dt>
  35761. <dd><p>The focal length of the image/video (zoom; expected constant for video). For
  35762. example, a 18&ndash;55mm lens has focal length range of [18&ndash;55], so a value in that
  35763. range should be chosen when using that lens. Default 18.
  35764. </p>
  35765. </dd>
  35766. <dt><samp>aperture</samp></dt>
  35767. <dd><p>The aperture of the image/video (expected constant for video). Note that
  35768. aperture is only used for vignetting correction. Default 3.5.
  35769. </p>
  35770. </dd>
  35771. <dt><samp>focus_distance</samp></dt>
  35772. <dd><p>The focus distance of the image/video (expected constant for video). Note that
  35773. focus distance is only used for vignetting and only slightly affects the
  35774. vignetting correction process. If unknown, leave it at the default value (which
  35775. is 1000).
  35776. </p>
  35777. </dd>
  35778. <dt><samp>scale</samp></dt>
  35779. <dd><p>The scale factor which is applied after transformation. After correction the
  35780. video is no longer necessarily rectangular. This parameter controls how much of
  35781. the resulting image is visible. The value 0 means that a value will be chosen
  35782. automatically such that there is little or no unmapped area in the output
  35783. image. 1.0 means that no additional scaling is done. Lower values may result
  35784. in more of the corrected image being visible, while higher values may avoid
  35785. unmapped areas in the output.
  35786. </p>
  35787. </dd>
  35788. <dt><samp>target_geometry</samp></dt>
  35789. <dd><p>The target geometry of the output image/video. The following values are valid
  35790. options:
  35791. </p>
  35792. <dl compact="compact">
  35793. <dt>&lsquo;<samp>rectilinear (default)</samp>&rsquo;</dt>
  35794. <dt>&lsquo;<samp>fisheye</samp>&rsquo;</dt>
  35795. <dt>&lsquo;<samp>panoramic</samp>&rsquo;</dt>
  35796. <dt>&lsquo;<samp>equirectangular</samp>&rsquo;</dt>
  35797. <dt>&lsquo;<samp>fisheye_orthographic</samp>&rsquo;</dt>
  35798. <dt>&lsquo;<samp>fisheye_stereographic</samp>&rsquo;</dt>
  35799. <dt>&lsquo;<samp>fisheye_equisolid</samp>&rsquo;</dt>
  35800. <dt>&lsquo;<samp>fisheye_thoby</samp>&rsquo;</dt>
  35801. </dl>
  35802. </dd>
  35803. <dt><samp>reverse</samp></dt>
  35804. <dd><p>Apply the reverse of image correction (instead of correcting distortion, apply
  35805. it).
  35806. </p>
  35807. </dd>
  35808. <dt><samp>interpolation</samp></dt>
  35809. <dd><p>The type of interpolation used when correcting distortion. The following values
  35810. are valid options:
  35811. </p>
  35812. <dl compact="compact">
  35813. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  35814. <dt>&lsquo;<samp>linear (default)</samp>&rsquo;</dt>
  35815. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  35816. </dl>
  35817. </dd>
  35818. </dl>
  35819. <a name="Examples-116"></a>
  35820. <h4 class="subsection">39.123.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-116" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-116" aria-hidden="true">TOC</a></span></h4>
  35821. <ul>
  35822. <li> Apply lens correction with make &quot;Canon&quot;, camera model &quot;Canon EOS 100D&quot;, and lens
  35823. model &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot; with focal length of &quot;18&quot; and
  35824. aperture of &quot;8.0&quot;.
  35825. <div class="example">
  35826. <pre class="example">ffmpeg -i input.mov -vf lensfun=make=Canon:model=&quot;Canon EOS 100D&quot;:lens_model=&quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;:focal_length=18:aperture=8 -c:v h264 -b:v 8000k output.mov
  35827. </pre></div>
  35828. </li><li> Apply the same as before, but only for the first 5 seconds of video.
  35829. <div class="example">
  35830. <pre class="example">ffmpeg -i input.mov -vf lensfun=make=Canon:model=&quot;Canon EOS 100D&quot;:lens_model=&quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;:focal_length=18:aperture=8:enable='lte(t\,5)' -c:v h264 -b:v 8000k output.mov
  35831. </pre></div>
  35832. </li></ul>
  35833. <a name="libvmaf"></a>
  35834. <h3 class="section">39.124 libvmaf<span class="pull-right"><a class="anchor hidden-xs" href="#libvmaf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvmaf" aria-hidden="true">TOC</a></span></h3>
  35835. <p>Obtain the VMAF (Video Multi-Method Assessment Fusion)
  35836. score between two input videos.
  35837. </p>
  35838. <p>The obtained VMAF score is printed through the logging system.
  35839. </p>
  35840. <p>It requires Netflix&rsquo;s vmaf library (libvmaf) as a pre-requisite.
  35841. After installing the library it can be enabled using:
  35842. <code>./configure --enable-libvmaf</code>.
  35843. If no model path is specified it uses the default model: <code>vmaf_v0.6.1.pkl</code>.
  35844. </p>
  35845. <p>The filter has following options:
  35846. </p>
  35847. <dl compact="compact">
  35848. <dt><samp>model_path</samp></dt>
  35849. <dd><p>Set the model path which is to be used for SVM.
  35850. Default value: <code>&quot;/usr/local/share/model/vmaf_v0.6.1.pkl&quot;</code>
  35851. </p>
  35852. </dd>
  35853. <dt><samp>log_path</samp></dt>
  35854. <dd><p>Set the file path to be used to store logs.
  35855. </p>
  35856. </dd>
  35857. <dt><samp>log_fmt</samp></dt>
  35858. <dd><p>Set the format of the log file (csv, json or xml).
  35859. </p>
  35860. </dd>
  35861. <dt><samp>enable_transform</samp></dt>
  35862. <dd><p>This option can enable/disable the <code>score_transform</code> applied to the final predicted VMAF score,
  35863. if you have specified score_transform option in the input parameter file passed to <code>run_vmaf_training.py</code>
  35864. Default value: <code>false</code>
  35865. </p>
  35866. </dd>
  35867. <dt><samp>phone_model</samp></dt>
  35868. <dd><p>Invokes the phone model which will generate VMAF scores higher than in the
  35869. regular model, which is more suitable for laptop, TV, etc. viewing conditions.
  35870. Default value: <code>false</code>
  35871. </p>
  35872. </dd>
  35873. <dt><samp>psnr</samp></dt>
  35874. <dd><p>Enables computing psnr along with vmaf.
  35875. Default value: <code>false</code>
  35876. </p>
  35877. </dd>
  35878. <dt><samp>ssim</samp></dt>
  35879. <dd><p>Enables computing ssim along with vmaf.
  35880. Default value: <code>false</code>
  35881. </p>
  35882. </dd>
  35883. <dt><samp>ms_ssim</samp></dt>
  35884. <dd><p>Enables computing ms_ssim along with vmaf.
  35885. Default value: <code>false</code>
  35886. </p>
  35887. </dd>
  35888. <dt><samp>pool</samp></dt>
  35889. <dd><p>Set the pool method to be used for computing vmaf.
  35890. Options are <code>min</code>, <code>harmonic_mean</code> or <code>mean</code> (default).
  35891. </p>
  35892. </dd>
  35893. <dt><samp>n_threads</samp></dt>
  35894. <dd><p>Set number of threads to be used when computing vmaf.
  35895. Default value: <code>0</code>, which makes use of all available logical processors.
  35896. </p>
  35897. </dd>
  35898. <dt><samp>n_subsample</samp></dt>
  35899. <dd><p>Set interval for frame subsampling used when computing vmaf.
  35900. Default value: <code>1</code>
  35901. </p>
  35902. </dd>
  35903. <dt><samp>enable_conf_interval</samp></dt>
  35904. <dd><p>Enables confidence interval.
  35905. Default value: <code>false</code>
  35906. </p></dd>
  35907. </dl>
  35908. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  35909. </p>
  35910. <a name="Examples-117"></a>
  35911. <h4 class="subsection">39.124.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-117" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-117" aria-hidden="true">TOC</a></span></h4>
  35912. <ul>
  35913. <li> On the below examples the input file <samp>main.mpg</samp> being processed is
  35914. compared with the reference file <samp>ref.mpg</samp>.
  35915. <div class="example">
  35916. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf -f null -
  35917. </pre></div>
  35918. </li><li> Example with options:
  35919. <div class="example">
  35920. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf=&quot;psnr=1:log_fmt=json&quot; -f null -
  35921. </pre></div>
  35922. </li><li> Example with options and different containers:
  35923. <div class="example">
  35924. <pre class="example">ffmpeg -i main.mpg -i ref.mkv -lavfi &quot;[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]libvmaf=psnr=1:log_fmt=json&quot; -f null -
  35925. </pre></div>
  35926. </li></ul>
  35927. <a name="limiter"></a>
  35928. <h3 class="section">39.125 limiter<span class="pull-right"><a class="anchor hidden-xs" href="#limiter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-limiter" aria-hidden="true">TOC</a></span></h3>
  35929. <p>Limits the pixel components values to the specified range [min, max].
  35930. </p>
  35931. <p>The filter accepts the following options:
  35932. </p>
  35933. <dl compact="compact">
  35934. <dt><samp>min</samp></dt>
  35935. <dd><p>Lower bound. Defaults to the lowest allowed value for the input.
  35936. </p>
  35937. </dd>
  35938. <dt><samp>max</samp></dt>
  35939. <dd><p>Upper bound. Defaults to the highest allowed value for the input.
  35940. </p>
  35941. </dd>
  35942. <dt><samp>planes</samp></dt>
  35943. <dd><p>Specify which planes will be processed. Defaults to all available.
  35944. </p></dd>
  35945. </dl>
  35946. <a name="Commands-91"></a>
  35947. <h4 class="subsection">39.125.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-91" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-91" aria-hidden="true">TOC</a></span></h4>
  35948. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  35949. </p>
  35950. <a name="loop"></a>
  35951. <h3 class="section">39.126 loop<span class="pull-right"><a class="anchor hidden-xs" href="#loop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-loop" aria-hidden="true">TOC</a></span></h3>
  35952. <p>Loop video frames.
  35953. </p>
  35954. <p>The filter accepts the following options:
  35955. </p>
  35956. <dl compact="compact">
  35957. <dt><samp>loop</samp></dt>
  35958. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  35959. Default is 0.
  35960. </p>
  35961. </dd>
  35962. <dt><samp>size</samp></dt>
  35963. <dd><p>Set maximal size in number of frames. Default is 0.
  35964. </p>
  35965. </dd>
  35966. <dt><samp>start</samp></dt>
  35967. <dd><p>Set first frame of loop. Default is 0.
  35968. </p></dd>
  35969. </dl>
  35970. <a name="Examples-118"></a>
  35971. <h4 class="subsection">39.126.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-118" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-118" aria-hidden="true">TOC</a></span></h4>
  35972. <ul>
  35973. <li> Loop single first frame infinitely:
  35974. <div class="example">
  35975. <pre class="example">loop=loop=-1:size=1:start=0
  35976. </pre></div>
  35977. </li><li> Loop single first frame 10 times:
  35978. <div class="example">
  35979. <pre class="example">loop=loop=10:size=1:start=0
  35980. </pre></div>
  35981. </li><li> Loop 10 first frames 5 times:
  35982. <div class="example">
  35983. <pre class="example">loop=loop=5:size=10:start=0
  35984. </pre></div>
  35985. </li></ul>
  35986. <a name="lut1d"></a>
  35987. <h3 class="section">39.127 lut1d<span class="pull-right"><a class="anchor hidden-xs" href="#lut1d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut1d" aria-hidden="true">TOC</a></span></h3>
  35988. <p>Apply a 1D LUT to an input video.
  35989. </p>
  35990. <p>The filter accepts the following options:
  35991. </p>
  35992. <dl compact="compact">
  35993. <dt><samp>file</samp></dt>
  35994. <dd><p>Set the 1D LUT file name.
  35995. </p>
  35996. <p>Currently supported formats:
  35997. </p><dl compact="compact">
  35998. <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
  35999. <dd><p>Iridas
  36000. </p></dd>
  36001. <dt>&lsquo;<samp>csp</samp>&rsquo;</dt>
  36002. <dd><p>cineSpace
  36003. </p></dd>
  36004. </dl>
  36005. </dd>
  36006. <dt><samp>interp</samp></dt>
  36007. <dd><p>Select interpolation mode.
  36008. </p>
  36009. <p>Available values are:
  36010. </p>
  36011. <dl compact="compact">
  36012. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  36013. <dd><p>Use values from the nearest defined point.
  36014. </p></dd>
  36015. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  36016. <dd><p>Interpolate values using the linear interpolation.
  36017. </p></dd>
  36018. <dt>&lsquo;<samp>cosine</samp>&rsquo;</dt>
  36019. <dd><p>Interpolate values using the cosine interpolation.
  36020. </p></dd>
  36021. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  36022. <dd><p>Interpolate values using the cubic interpolation.
  36023. </p></dd>
  36024. <dt>&lsquo;<samp>spline</samp>&rsquo;</dt>
  36025. <dd><p>Interpolate values using the spline interpolation.
  36026. </p></dd>
  36027. </dl>
  36028. </dd>
  36029. </dl>
  36030. <a name="Commands-92"></a>
  36031. <h4 class="subsection">39.127.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-92" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-92" aria-hidden="true">TOC</a></span></h4>
  36032. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  36033. </p>
  36034. <span id="lut3d"></span><a name="lut3d-1"></a>
  36035. <h3 class="section">39.128 lut3d<span class="pull-right"><a class="anchor hidden-xs" href="#lut3d-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut3d-1" aria-hidden="true">TOC</a></span></h3>
  36036. <p>Apply a 3D LUT to an input video.
  36037. </p>
  36038. <p>The filter accepts the following options:
  36039. </p>
  36040. <dl compact="compact">
  36041. <dt><samp>file</samp></dt>
  36042. <dd><p>Set the 3D LUT file name.
  36043. </p>
  36044. <p>Currently supported formats:
  36045. </p><dl compact="compact">
  36046. <dt>&lsquo;<samp>3dl</samp>&rsquo;</dt>
  36047. <dd><p>AfterEffects
  36048. </p></dd>
  36049. <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
  36050. <dd><p>Iridas
  36051. </p></dd>
  36052. <dt>&lsquo;<samp>dat</samp>&rsquo;</dt>
  36053. <dd><p>DaVinci
  36054. </p></dd>
  36055. <dt>&lsquo;<samp>m3d</samp>&rsquo;</dt>
  36056. <dd><p>Pandora
  36057. </p></dd>
  36058. <dt>&lsquo;<samp>csp</samp>&rsquo;</dt>
  36059. <dd><p>cineSpace
  36060. </p></dd>
  36061. </dl>
  36062. </dd>
  36063. <dt><samp>interp</samp></dt>
  36064. <dd><p>Select interpolation mode.
  36065. </p>
  36066. <p>Available values are:
  36067. </p>
  36068. <dl compact="compact">
  36069. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  36070. <dd><p>Use values from the nearest defined point.
  36071. </p></dd>
  36072. <dt>&lsquo;<samp>trilinear</samp>&rsquo;</dt>
  36073. <dd><p>Interpolate values using the 8 points defining a cube.
  36074. </p></dd>
  36075. <dt>&lsquo;<samp>tetrahedral</samp>&rsquo;</dt>
  36076. <dd><p>Interpolate values using a tetrahedron.
  36077. </p></dd>
  36078. <dt>&lsquo;<samp>pyramid</samp>&rsquo;</dt>
  36079. <dd><p>Interpolate values using a pyramid.
  36080. </p></dd>
  36081. <dt>&lsquo;<samp>prism</samp>&rsquo;</dt>
  36082. <dd><p>Interpolate values using a prism.
  36083. </p></dd>
  36084. </dl>
  36085. </dd>
  36086. </dl>
  36087. <a name="Commands-93"></a>
  36088. <h4 class="subsection">39.128.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-93" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-93" aria-hidden="true">TOC</a></span></h4>
  36089. <p>This filter supports the <code>interp</code> option as <a href="#commands">commands</a>.
  36090. </p>
  36091. <a name="lumakey"></a>
  36092. <h3 class="section">39.129 lumakey<span class="pull-right"><a class="anchor hidden-xs" href="#lumakey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lumakey" aria-hidden="true">TOC</a></span></h3>
  36093. <p>Turn certain luma values into transparency.
  36094. </p>
  36095. <p>The filter accepts the following options:
  36096. </p>
  36097. <dl compact="compact">
  36098. <dt><samp>threshold</samp></dt>
  36099. <dd><p>Set the luma which will be used as base for transparency.
  36100. Default value is <code>0</code>.
  36101. </p>
  36102. </dd>
  36103. <dt><samp>tolerance</samp></dt>
  36104. <dd><p>Set the range of luma values to be keyed out.
  36105. Default value is <code>0.01</code>.
  36106. </p>
  36107. </dd>
  36108. <dt><samp>softness</samp></dt>
  36109. <dd><p>Set the range of softness. Default value is <code>0</code>.
  36110. Use this to control gradual transition from zero to full transparency.
  36111. </p></dd>
  36112. </dl>
  36113. <a name="Commands-94"></a>
  36114. <h4 class="subsection">39.129.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-94" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-94" aria-hidden="true">TOC</a></span></h4>
  36115. <p>This filter supports same <a href="#commands">commands</a> as options.
  36116. The command accepts the same syntax of the corresponding option.
  36117. </p>
  36118. <p>If the specified expression is not valid, it is kept at its current
  36119. value.
  36120. </p>
  36121. <a name="lut_002c-lutrgb_002c-lutyuv"></a>
  36122. <h3 class="section">39.130 lut, lutrgb, lutyuv<span class="pull-right"><a class="anchor hidden-xs" href="#lut_002c-lutrgb_002c-lutyuv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut_002c-lutrgb_002c-lutyuv" aria-hidden="true">TOC</a></span></h3>
  36123. <p>Compute a look-up table for binding each pixel component input value
  36124. to an output value, and apply it to the input video.
  36125. </p>
  36126. <p><var>lutyuv</var> applies a lookup table to a YUV input video, <var>lutrgb</var>
  36127. to an RGB input video.
  36128. </p>
  36129. <p>These filters accept the following parameters:
  36130. </p><dl compact="compact">
  36131. <dt><samp>c0</samp></dt>
  36132. <dd><p>set first pixel component expression
  36133. </p></dd>
  36134. <dt><samp>c1</samp></dt>
  36135. <dd><p>set second pixel component expression
  36136. </p></dd>
  36137. <dt><samp>c2</samp></dt>
  36138. <dd><p>set third pixel component expression
  36139. </p></dd>
  36140. <dt><samp>c3</samp></dt>
  36141. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  36142. </p>
  36143. </dd>
  36144. <dt><samp>r</samp></dt>
  36145. <dd><p>set red component expression
  36146. </p></dd>
  36147. <dt><samp>g</samp></dt>
  36148. <dd><p>set green component expression
  36149. </p></dd>
  36150. <dt><samp>b</samp></dt>
  36151. <dd><p>set blue component expression
  36152. </p></dd>
  36153. <dt><samp>a</samp></dt>
  36154. <dd><p>alpha component expression
  36155. </p>
  36156. </dd>
  36157. <dt><samp>y</samp></dt>
  36158. <dd><p>set Y/luminance component expression
  36159. </p></dd>
  36160. <dt><samp>u</samp></dt>
  36161. <dd><p>set U/Cb component expression
  36162. </p></dd>
  36163. <dt><samp>v</samp></dt>
  36164. <dd><p>set V/Cr component expression
  36165. </p></dd>
  36166. </dl>
  36167. <p>Each of them specifies the expression to use for computing the lookup table for
  36168. the corresponding pixel component values.
  36169. </p>
  36170. <p>The exact component associated to each of the <var>c*</var> options depends on the
  36171. format in input.
  36172. </p>
  36173. <p>The <var>lut</var> filter requires either YUV or RGB pixel formats in input,
  36174. <var>lutrgb</var> requires RGB pixel formats in input, and <var>lutyuv</var> requires YUV.
  36175. </p>
  36176. <p>The expressions can contain the following constants and functions:
  36177. </p>
  36178. <dl compact="compact">
  36179. <dt><samp>w</samp></dt>
  36180. <dt><samp>h</samp></dt>
  36181. <dd><p>The input width and height.
  36182. </p>
  36183. </dd>
  36184. <dt><samp>val</samp></dt>
  36185. <dd><p>The input value for the pixel component.
  36186. </p>
  36187. </dd>
  36188. <dt><samp>clipval</samp></dt>
  36189. <dd><p>The input value, clipped to the <var>minval</var>-<var>maxval</var> range.
  36190. </p>
  36191. </dd>
  36192. <dt><samp>maxval</samp></dt>
  36193. <dd><p>The maximum value for the pixel component.
  36194. </p>
  36195. </dd>
  36196. <dt><samp>minval</samp></dt>
  36197. <dd><p>The minimum value for the pixel component.
  36198. </p>
  36199. </dd>
  36200. <dt><samp>negval</samp></dt>
  36201. <dd><p>The negated value for the pixel component value, clipped to the
  36202. <var>minval</var>-<var>maxval</var> range; it corresponds to the expression
  36203. &quot;maxval-clipval+minval&quot;.
  36204. </p>
  36205. </dd>
  36206. <dt><samp>clip(val)</samp></dt>
  36207. <dd><p>The computed value in <var>val</var>, clipped to the
  36208. <var>minval</var>-<var>maxval</var> range.
  36209. </p>
  36210. </dd>
  36211. <dt><samp>gammaval(gamma)</samp></dt>
  36212. <dd><p>The computed gamma correction value of the pixel component value,
  36213. clipped to the <var>minval</var>-<var>maxval</var> range. It corresponds to the
  36214. expression
  36215. &quot;pow((clipval-minval)/(maxval-minval)\,<var>gamma</var>)*(maxval-minval)+minval&quot;
  36216. </p>
  36217. </dd>
  36218. </dl>
  36219. <p>All expressions default to &quot;val&quot;.
  36220. </p>
  36221. <a name="Commands-95"></a>
  36222. <h4 class="subsection">39.130.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-95" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-95" aria-hidden="true">TOC</a></span></h4>
  36223. <p>This filter supports same <a href="#commands">commands</a> as options.
  36224. </p>
  36225. <a name="Examples-119"></a>
  36226. <h4 class="subsection">39.130.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-119" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-119" aria-hidden="true">TOC</a></span></h4>
  36227. <ul>
  36228. <li> Negate input video:
  36229. <div class="example">
  36230. <pre class="example">lutrgb=&quot;r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val&quot;
  36231. lutyuv=&quot;y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val&quot;
  36232. </pre></div>
  36233. <p>The above is the same as:
  36234. </p><div class="example">
  36235. <pre class="example">lutrgb=&quot;r=negval:g=negval:b=negval&quot;
  36236. lutyuv=&quot;y=negval:u=negval:v=negval&quot;
  36237. </pre></div>
  36238. </li><li> Negate luminance:
  36239. <div class="example">
  36240. <pre class="example">lutyuv=y=negval
  36241. </pre></div>
  36242. </li><li> Remove chroma components, turning the video into a graytone image:
  36243. <div class="example">
  36244. <pre class="example">lutyuv=&quot;u=128:v=128&quot;
  36245. </pre></div>
  36246. </li><li> Apply a luma burning effect:
  36247. <div class="example">
  36248. <pre class="example">lutyuv=&quot;y=2*val&quot;
  36249. </pre></div>
  36250. </li><li> Remove green and blue components:
  36251. <div class="example">
  36252. <pre class="example">lutrgb=&quot;g=0:b=0&quot;
  36253. </pre></div>
  36254. </li><li> Set a constant alpha channel value on input:
  36255. <div class="example">
  36256. <pre class="example">format=rgba,lutrgb=a=&quot;maxval-minval/2&quot;
  36257. </pre></div>
  36258. </li><li> Correct luminance gamma by a factor of 0.5:
  36259. <div class="example">
  36260. <pre class="example">lutyuv=y=gammaval(0.5)
  36261. </pre></div>
  36262. </li><li> Discard least significant bits of luma:
  36263. <div class="example">
  36264. <pre class="example">lutyuv=y='bitand(val, 128+64+32)'
  36265. </pre></div>
  36266. </li><li> Technicolor like effect:
  36267. <div class="example">
  36268. <pre class="example">lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/2)*2+maxval/2'
  36269. </pre></div>
  36270. </li></ul>
  36271. <a name="lut2_002c-tlut2"></a>
  36272. <h3 class="section">39.131 lut2, tlut2<span class="pull-right"><a class="anchor hidden-xs" href="#lut2_002c-tlut2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut2_002c-tlut2" aria-hidden="true">TOC</a></span></h3>
  36273. <p>The <code>lut2</code> filter takes two input streams and outputs one
  36274. stream.
  36275. </p>
  36276. <p>The <code>tlut2</code> (time lut2) filter takes two consecutive frames
  36277. from one single stream.
  36278. </p>
  36279. <p>This filter accepts the following parameters:
  36280. </p><dl compact="compact">
  36281. <dt><samp>c0</samp></dt>
  36282. <dd><p>set first pixel component expression
  36283. </p></dd>
  36284. <dt><samp>c1</samp></dt>
  36285. <dd><p>set second pixel component expression
  36286. </p></dd>
  36287. <dt><samp>c2</samp></dt>
  36288. <dd><p>set third pixel component expression
  36289. </p></dd>
  36290. <dt><samp>c3</samp></dt>
  36291. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  36292. </p>
  36293. </dd>
  36294. <dt><samp>d</samp></dt>
  36295. <dd><p>set output bit depth, only available for <code>lut2</code> filter. By default is 0,
  36296. which means bit depth is automatically picked from first input format.
  36297. </p></dd>
  36298. </dl>
  36299. <p>The <code>lut2</code> filter also supports the <a href="#framesync">framesync</a> options.
  36300. </p>
  36301. <p>Each of them specifies the expression to use for computing the lookup table for
  36302. the corresponding pixel component values.
  36303. </p>
  36304. <p>The exact component associated to each of the <var>c*</var> options depends on the
  36305. format in inputs.
  36306. </p>
  36307. <p>The expressions can contain the following constants:
  36308. </p>
  36309. <dl compact="compact">
  36310. <dt><samp>w</samp></dt>
  36311. <dt><samp>h</samp></dt>
  36312. <dd><p>The input width and height.
  36313. </p>
  36314. </dd>
  36315. <dt><samp>x</samp></dt>
  36316. <dd><p>The first input value for the pixel component.
  36317. </p>
  36318. </dd>
  36319. <dt><samp>y</samp></dt>
  36320. <dd><p>The second input value for the pixel component.
  36321. </p>
  36322. </dd>
  36323. <dt><samp>bdx</samp></dt>
  36324. <dd><p>The first input video bit depth.
  36325. </p>
  36326. </dd>
  36327. <dt><samp>bdy</samp></dt>
  36328. <dd><p>The second input video bit depth.
  36329. </p></dd>
  36330. </dl>
  36331. <p>All expressions default to &quot;x&quot;.
  36332. </p>
  36333. <a name="Commands-96"></a>
  36334. <h4 class="subsection">39.131.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-96" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-96" aria-hidden="true">TOC</a></span></h4>
  36335. <p>This filter supports the all above options as <a href="#commands">commands</a> except option <code>d</code>.
  36336. </p>
  36337. <a name="Examples-120"></a>
  36338. <h4 class="subsection">39.131.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-120" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-120" aria-hidden="true">TOC</a></span></h4>
  36339. <ul>
  36340. <li> Highlight differences between two RGB video streams:
  36341. <div class="example">
  36342. <pre class="example">lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1)'
  36343. </pre></div>
  36344. </li><li> Highlight differences between two YUV video streams:
  36345. <div class="example">
  36346. <pre class="example">lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1)'
  36347. </pre></div>
  36348. </li><li> Show max difference between two video streams:
  36349. <div class="example">
  36350. <pre class="example">lut2='if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1)))'
  36351. </pre></div>
  36352. </li></ul>
  36353. <a name="maskedclamp"></a>
  36354. <h3 class="section">39.132 maskedclamp<span class="pull-right"><a class="anchor hidden-xs" href="#maskedclamp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedclamp" aria-hidden="true">TOC</a></span></h3>
  36355. <p>Clamp the first input stream with the second input and third input stream.
  36356. </p>
  36357. <p>Returns the value of first stream to be between second input
  36358. stream - <code>undershoot</code> and third input stream + <code>overshoot</code>.
  36359. </p>
  36360. <p>This filter accepts the following options:
  36361. </p><dl compact="compact">
  36362. <dt><samp>undershoot</samp></dt>
  36363. <dd><p>Default value is <code>0</code>.
  36364. </p>
  36365. </dd>
  36366. <dt><samp>overshoot</samp></dt>
  36367. <dd><p>Default value is <code>0</code>.
  36368. </p>
  36369. </dd>
  36370. <dt><samp>planes</samp></dt>
  36371. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  36372. copied from first stream.
  36373. By default value 0xf, all planes will be processed.
  36374. </p></dd>
  36375. </dl>
  36376. <a name="Commands-97"></a>
  36377. <h4 class="subsection">39.132.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-97" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-97" aria-hidden="true">TOC</a></span></h4>
  36378. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  36379. </p>
  36380. <a name="maskedmax"></a>
  36381. <h3 class="section">39.133 maskedmax<span class="pull-right"><a class="anchor hidden-xs" href="#maskedmax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedmax" aria-hidden="true">TOC</a></span></h3>
  36382. <p>Merge the second and third input stream into output stream using absolute differences
  36383. between second input stream and first input stream and absolute difference between
  36384. third input stream and first input stream. The picked value will be from second input
  36385. stream if second absolute difference is greater than first one or from third input stream
  36386. otherwise.
  36387. </p>
  36388. <p>This filter accepts the following options:
  36389. </p><dl compact="compact">
  36390. <dt><samp>planes</samp></dt>
  36391. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  36392. copied from first stream.
  36393. By default value 0xf, all planes will be processed.
  36394. </p></dd>
  36395. </dl>
  36396. <a name="Commands-98"></a>
  36397. <h4 class="subsection">39.133.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-98" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-98" aria-hidden="true">TOC</a></span></h4>
  36398. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  36399. </p>
  36400. <a name="maskedmerge"></a>
  36401. <h3 class="section">39.134 maskedmerge<span class="pull-right"><a class="anchor hidden-xs" href="#maskedmerge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedmerge" aria-hidden="true">TOC</a></span></h3>
  36402. <p>Merge the first input stream with the second input stream using per pixel
  36403. weights in the third input stream.
  36404. </p>
  36405. <p>A value of 0 in the third stream pixel component means that pixel component
  36406. from first stream is returned unchanged, while maximum value (eg. 255 for
  36407. 8-bit videos) means that pixel component from second stream is returned
  36408. unchanged. Intermediate values define the amount of merging between both
  36409. input stream&rsquo;s pixel components.
  36410. </p>
  36411. <p>This filter accepts the following options:
  36412. </p><dl compact="compact">
  36413. <dt><samp>planes</samp></dt>
  36414. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  36415. copied from first stream.
  36416. By default value 0xf, all planes will be processed.
  36417. </p></dd>
  36418. </dl>
  36419. <a name="Commands-99"></a>
  36420. <h4 class="subsection">39.134.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-99" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-99" aria-hidden="true">TOC</a></span></h4>
  36421. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  36422. </p>
  36423. <a name="maskedmin"></a>
  36424. <h3 class="section">39.135 maskedmin<span class="pull-right"><a class="anchor hidden-xs" href="#maskedmin" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedmin" aria-hidden="true">TOC</a></span></h3>
  36425. <p>Merge the second and third input stream into output stream using absolute differences
  36426. between second input stream and first input stream and absolute difference between
  36427. third input stream and first input stream. The picked value will be from second input
  36428. stream if second absolute difference is less than first one or from third input stream
  36429. otherwise.
  36430. </p>
  36431. <p>This filter accepts the following options:
  36432. </p><dl compact="compact">
  36433. <dt><samp>planes</samp></dt>
  36434. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  36435. copied from first stream.
  36436. By default value 0xf, all planes will be processed.
  36437. </p></dd>
  36438. </dl>
  36439. <a name="Commands-100"></a>
  36440. <h4 class="subsection">39.135.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-100" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-100" aria-hidden="true">TOC</a></span></h4>
  36441. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  36442. </p>
  36443. <a name="maskedthreshold"></a>
  36444. <h3 class="section">39.136 maskedthreshold<span class="pull-right"><a class="anchor hidden-xs" href="#maskedthreshold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedthreshold" aria-hidden="true">TOC</a></span></h3>
  36445. <p>Pick pixels comparing absolute difference of two video streams with fixed
  36446. threshold.
  36447. </p>
  36448. <p>If absolute difference between pixel component of first and second video
  36449. stream is equal or lower than user supplied threshold than pixel component
  36450. from first video stream is picked, otherwise pixel component from second
  36451. video stream is picked.
  36452. </p>
  36453. <p>This filter accepts the following options:
  36454. </p><dl compact="compact">
  36455. <dt><samp>threshold</samp></dt>
  36456. <dd><p>Set threshold used when picking pixels from absolute difference from two input
  36457. video streams.
  36458. </p>
  36459. </dd>
  36460. <dt><samp>planes</samp></dt>
  36461. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  36462. copied from second stream.
  36463. By default value 0xf, all planes will be processed.
  36464. </p></dd>
  36465. </dl>
  36466. <a name="Commands-101"></a>
  36467. <h4 class="subsection">39.136.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-101" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-101" aria-hidden="true">TOC</a></span></h4>
  36468. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  36469. </p>
  36470. <a name="maskfun"></a>
  36471. <h3 class="section">39.137 maskfun<span class="pull-right"><a class="anchor hidden-xs" href="#maskfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskfun" aria-hidden="true">TOC</a></span></h3>
  36472. <p>Create mask from input video.
  36473. </p>
  36474. <p>For example it is useful to create motion masks after <code>tblend</code> filter.
  36475. </p>
  36476. <p>This filter accepts the following options:
  36477. </p>
  36478. <dl compact="compact">
  36479. <dt><samp>low</samp></dt>
  36480. <dd><p>Set low threshold. Any pixel component lower or exact than this value will be set to 0.
  36481. </p>
  36482. </dd>
  36483. <dt><samp>high</samp></dt>
  36484. <dd><p>Set high threshold. Any pixel component higher than this value will be set to max value
  36485. allowed for current pixel format.
  36486. </p>
  36487. </dd>
  36488. <dt><samp>planes</samp></dt>
  36489. <dd><p>Set planes to filter, by default all available planes are filtered.
  36490. </p>
  36491. </dd>
  36492. <dt><samp>fill</samp></dt>
  36493. <dd><p>Fill all frame pixels with this value.
  36494. </p>
  36495. </dd>
  36496. <dt><samp>sum</samp></dt>
  36497. <dd><p>Set max average pixel value for frame. If sum of all pixel components is higher that this
  36498. average, output frame will be completely filled with value set by <var>fill</var> option.
  36499. Typically useful for scene changes when used in combination with <code>tblend</code> filter.
  36500. </p></dd>
  36501. </dl>
  36502. <a name="Commands-102"></a>
  36503. <h4 class="subsection">39.137.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-102" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-102" aria-hidden="true">TOC</a></span></h4>
  36504. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  36505. </p>
  36506. <a name="mcdeint"></a>
  36507. <h3 class="section">39.138 mcdeint<span class="pull-right"><a class="anchor hidden-xs" href="#mcdeint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mcdeint" aria-hidden="true">TOC</a></span></h3>
  36508. <p>Apply motion-compensation deinterlacing.
  36509. </p>
  36510. <p>It needs one field per frame as input and must thus be used together
  36511. with yadif=1/3 or equivalent.
  36512. </p>
  36513. <p>This filter accepts the following options:
  36514. </p><dl compact="compact">
  36515. <dt><samp>mode</samp></dt>
  36516. <dd><p>Set the deinterlacing mode.
  36517. </p>
  36518. <p>It accepts one of the following values:
  36519. </p><dl compact="compact">
  36520. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  36521. <dt>&lsquo;<samp>medium</samp>&rsquo;</dt>
  36522. <dt>&lsquo;<samp>slow</samp>&rsquo;</dt>
  36523. <dd><p>use iterative motion estimation
  36524. </p></dd>
  36525. <dt>&lsquo;<samp>extra_slow</samp>&rsquo;</dt>
  36526. <dd><p>like &lsquo;<samp>slow</samp>&rsquo;, but use multiple reference frames.
  36527. </p></dd>
  36528. </dl>
  36529. <p>Default value is &lsquo;<samp>fast</samp>&rsquo;.
  36530. </p>
  36531. </dd>
  36532. <dt><samp>parity</samp></dt>
  36533. <dd><p>Set the picture field parity assumed for the input video. It must be
  36534. one of the following values:
  36535. </p>
  36536. <dl compact="compact">
  36537. <dt>&lsquo;<samp>0, tff</samp>&rsquo;</dt>
  36538. <dd><p>assume top field first
  36539. </p></dd>
  36540. <dt>&lsquo;<samp>1, bff</samp>&rsquo;</dt>
  36541. <dd><p>assume bottom field first
  36542. </p></dd>
  36543. </dl>
  36544. <p>Default value is &lsquo;<samp>bff</samp>&rsquo;.
  36545. </p>
  36546. </dd>
  36547. <dt><samp>qp</samp></dt>
  36548. <dd><p>Set per-block quantization parameter (QP) used by the internal
  36549. encoder.
  36550. </p>
  36551. <p>Higher values should result in a smoother motion vector field but less
  36552. optimal individual vectors. Default value is 1.
  36553. </p></dd>
  36554. </dl>
  36555. <a name="median"></a>
  36556. <h3 class="section">39.139 median<span class="pull-right"><a class="anchor hidden-xs" href="#median" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-median" aria-hidden="true">TOC</a></span></h3>
  36557. <p>Pick median pixel from certain rectangle defined by radius.
  36558. </p>
  36559. <p>This filter accepts the following options:
  36560. </p>
  36561. <dl compact="compact">
  36562. <dt><samp>radius</samp></dt>
  36563. <dd><p>Set horizontal radius size. Default value is <code>1</code>.
  36564. Allowed range is integer from 1 to 127.
  36565. </p>
  36566. </dd>
  36567. <dt><samp>planes</samp></dt>
  36568. <dd><p>Set which planes to process. Default is <code>15</code>, which is all available planes.
  36569. </p>
  36570. </dd>
  36571. <dt><samp>radiusV</samp></dt>
  36572. <dd><p>Set vertical radius size. Default value is <code>0</code>.
  36573. Allowed range is integer from 0 to 127.
  36574. If it is 0, value will be picked from horizontal <code>radius</code> option.
  36575. </p>
  36576. </dd>
  36577. <dt><samp>percentile</samp></dt>
  36578. <dd><p>Set median percentile. Default value is <code>0.5</code>.
  36579. Default value of <code>0.5</code> will pick always median values, while <code>0</code> will pick
  36580. minimum values, and <code>1</code> maximum values.
  36581. </p></dd>
  36582. </dl>
  36583. <a name="Commands-103"></a>
  36584. <h4 class="subsection">39.139.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-103" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-103" aria-hidden="true">TOC</a></span></h4>
  36585. <p>This filter supports same <a href="#commands">commands</a> as options.
  36586. The command accepts the same syntax of the corresponding option.
  36587. </p>
  36588. <p>If the specified expression is not valid, it is kept at its current
  36589. value.
  36590. </p>
  36591. <a name="mergeplanes"></a>
  36592. <h3 class="section">39.140 mergeplanes<span class="pull-right"><a class="anchor hidden-xs" href="#mergeplanes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mergeplanes" aria-hidden="true">TOC</a></span></h3>
  36593. <p>Merge color channel components from several video streams.
  36594. </p>
  36595. <p>The filter accepts up to 4 input streams, and merge selected input
  36596. planes to the output video.
  36597. </p>
  36598. <p>This filter accepts the following options:
  36599. </p><dl compact="compact">
  36600. <dt><samp>mapping</samp></dt>
  36601. <dd><p>Set input to output plane mapping. Default is <code>0</code>.
  36602. </p>
  36603. <p>The mappings is specified as a bitmap. It should be specified as a
  36604. hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. &rsquo;Aa&rsquo; describes the
  36605. mapping for the first plane of the output stream. &rsquo;A&rsquo; sets the number of
  36606. the input stream to use (from 0 to 3), and &rsquo;a&rsquo; the plane number of the
  36607. corresponding input to use (from 0 to 3). The rest of the mappings is
  36608. similar, &rsquo;Bb&rsquo; describes the mapping for the output stream second
  36609. plane, &rsquo;Cc&rsquo; describes the mapping for the output stream third plane and
  36610. &rsquo;Dd&rsquo; describes the mapping for the output stream fourth plane.
  36611. </p>
  36612. </dd>
  36613. <dt><samp>format</samp></dt>
  36614. <dd><p>Set output pixel format. Default is <code>yuva444p</code>.
  36615. </p></dd>
  36616. </dl>
  36617. <a name="Examples-121"></a>
  36618. <h4 class="subsection">39.140.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-121" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-121" aria-hidden="true">TOC</a></span></h4>
  36619. <ul>
  36620. <li> Merge three gray video streams of same width and height into single video stream:
  36621. <div class="example">
  36622. <pre class="example">[a0][a1][a2]mergeplanes=0x001020:yuv444p
  36623. </pre></div>
  36624. </li><li> Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
  36625. <div class="example">
  36626. <pre class="example">[a0][a1]mergeplanes=0x00010210:yuva444p
  36627. </pre></div>
  36628. </li><li> Swap Y and A plane in yuva444p stream:
  36629. <div class="example">
  36630. <pre class="example">format=yuva444p,mergeplanes=0x03010200:yuva444p
  36631. </pre></div>
  36632. </li><li> Swap U and V plane in yuv420p stream:
  36633. <div class="example">
  36634. <pre class="example">format=yuv420p,mergeplanes=0x000201:yuv420p
  36635. </pre></div>
  36636. </li><li> Cast a rgb24 clip to yuv444p:
  36637. <div class="example">
  36638. <pre class="example">format=rgb24,mergeplanes=0x000102:yuv444p
  36639. </pre></div>
  36640. </li></ul>
  36641. <a name="mestimate"></a>
  36642. <h3 class="section">39.141 mestimate<span class="pull-right"><a class="anchor hidden-xs" href="#mestimate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mestimate" aria-hidden="true">TOC</a></span></h3>
  36643. <p>Estimate and export motion vectors using block matching algorithms.
  36644. Motion vectors are stored in frame side data to be used by other filters.
  36645. </p>
  36646. <p>This filter accepts the following options:
  36647. </p><dl compact="compact">
  36648. <dt><samp>method</samp></dt>
  36649. <dd><p>Specify the motion estimation method. Accepts one of the following values:
  36650. </p>
  36651. <dl compact="compact">
  36652. <dt>&lsquo;<samp>esa</samp>&rsquo;</dt>
  36653. <dd><p>Exhaustive search algorithm.
  36654. </p></dd>
  36655. <dt>&lsquo;<samp>tss</samp>&rsquo;</dt>
  36656. <dd><p>Three step search algorithm.
  36657. </p></dd>
  36658. <dt>&lsquo;<samp>tdls</samp>&rsquo;</dt>
  36659. <dd><p>Two dimensional logarithmic search algorithm.
  36660. </p></dd>
  36661. <dt>&lsquo;<samp>ntss</samp>&rsquo;</dt>
  36662. <dd><p>New three step search algorithm.
  36663. </p></dd>
  36664. <dt>&lsquo;<samp>fss</samp>&rsquo;</dt>
  36665. <dd><p>Four step search algorithm.
  36666. </p></dd>
  36667. <dt>&lsquo;<samp>ds</samp>&rsquo;</dt>
  36668. <dd><p>Diamond search algorithm.
  36669. </p></dd>
  36670. <dt>&lsquo;<samp>hexbs</samp>&rsquo;</dt>
  36671. <dd><p>Hexagon-based search algorithm.
  36672. </p></dd>
  36673. <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
  36674. <dd><p>Enhanced predictive zonal search algorithm.
  36675. </p></dd>
  36676. <dt>&lsquo;<samp>umh</samp>&rsquo;</dt>
  36677. <dd><p>Uneven multi-hexagon search algorithm.
  36678. </p></dd>
  36679. </dl>
  36680. <p>Default value is &lsquo;<samp>esa</samp>&rsquo;.
  36681. </p>
  36682. </dd>
  36683. <dt><samp>mb_size</samp></dt>
  36684. <dd><p>Macroblock size. Default <code>16</code>.
  36685. </p>
  36686. </dd>
  36687. <dt><samp>search_param</samp></dt>
  36688. <dd><p>Search parameter. Default <code>7</code>.
  36689. </p></dd>
  36690. </dl>
  36691. <a name="midequalizer"></a>
  36692. <h3 class="section">39.142 midequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#midequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-midequalizer" aria-hidden="true">TOC</a></span></h3>
  36693. <p>Apply Midway Image Equalization effect using two video streams.
  36694. </p>
  36695. <p>Midway Image Equalization adjusts a pair of images to have the same
  36696. histogram, while maintaining their dynamics as much as possible. It&rsquo;s
  36697. useful for e.g. matching exposures from a pair of stereo cameras.
  36698. </p>
  36699. <p>This filter has two inputs and one output, which must be of same pixel format, but
  36700. may be of different sizes. The output of filter is first input adjusted with
  36701. midway histogram of both inputs.
  36702. </p>
  36703. <p>This filter accepts the following option:
  36704. </p>
  36705. <dl compact="compact">
  36706. <dt><samp>planes</samp></dt>
  36707. <dd><p>Set which planes to process. Default is <code>15</code>, which is all available planes.
  36708. </p></dd>
  36709. </dl>
  36710. <a name="minterpolate"></a>
  36711. <h3 class="section">39.143 minterpolate<span class="pull-right"><a class="anchor hidden-xs" href="#minterpolate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-minterpolate" aria-hidden="true">TOC</a></span></h3>
  36712. <p>Convert the video to specified frame rate using motion interpolation.
  36713. </p>
  36714. <p>This filter accepts the following options:
  36715. </p><dl compact="compact">
  36716. <dt><samp>fps</samp></dt>
  36717. <dd><p>Specify the output frame rate. This can be rational e.g. <code>60000/1001</code>. Frames are dropped if <var>fps</var> is lower than source fps. Default <code>60</code>.
  36718. </p>
  36719. </dd>
  36720. <dt><samp>mi_mode</samp></dt>
  36721. <dd><p>Motion interpolation mode. Following values are accepted:
  36722. </p><dl compact="compact">
  36723. <dt>&lsquo;<samp>dup</samp>&rsquo;</dt>
  36724. <dd><p>Duplicate previous or next frame for interpolating new ones.
  36725. </p></dd>
  36726. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  36727. <dd><p>Blend source frames. Interpolated frame is mean of previous and next frames.
  36728. </p></dd>
  36729. <dt>&lsquo;<samp>mci</samp>&rsquo;</dt>
  36730. <dd><p>Motion compensated interpolation. Following options are effective when this mode is selected:
  36731. </p>
  36732. <dl compact="compact">
  36733. <dt>&lsquo;<samp>mc_mode</samp>&rsquo;</dt>
  36734. <dd><p>Motion compensation mode. Following values are accepted:
  36735. </p><dl compact="compact">
  36736. <dt>&lsquo;<samp>obmc</samp>&rsquo;</dt>
  36737. <dd><p>Overlapped block motion compensation.
  36738. </p></dd>
  36739. <dt>&lsquo;<samp>aobmc</samp>&rsquo;</dt>
  36740. <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.
  36741. </p></dd>
  36742. </dl>
  36743. <p>Default mode is &lsquo;<samp>obmc</samp>&rsquo;.
  36744. </p>
  36745. </dd>
  36746. <dt>&lsquo;<samp>me_mode</samp>&rsquo;</dt>
  36747. <dd><p>Motion estimation mode. Following values are accepted:
  36748. </p><dl compact="compact">
  36749. <dt>&lsquo;<samp>bidir</samp>&rsquo;</dt>
  36750. <dd><p>Bidirectional motion estimation. Motion vectors are estimated for each source frame in both forward and backward directions.
  36751. </p></dd>
  36752. <dt>&lsquo;<samp>bilat</samp>&rsquo;</dt>
  36753. <dd><p>Bilateral motion estimation. Motion vectors are estimated directly for interpolated frame.
  36754. </p></dd>
  36755. </dl>
  36756. <p>Default mode is &lsquo;<samp>bilat</samp>&rsquo;.
  36757. </p>
  36758. </dd>
  36759. <dt>&lsquo;<samp>me</samp>&rsquo;</dt>
  36760. <dd><p>The algorithm to be used for motion estimation. Following values are accepted:
  36761. </p><dl compact="compact">
  36762. <dt>&lsquo;<samp>esa</samp>&rsquo;</dt>
  36763. <dd><p>Exhaustive search algorithm.
  36764. </p></dd>
  36765. <dt>&lsquo;<samp>tss</samp>&rsquo;</dt>
  36766. <dd><p>Three step search algorithm.
  36767. </p></dd>
  36768. <dt>&lsquo;<samp>tdls</samp>&rsquo;</dt>
  36769. <dd><p>Two dimensional logarithmic search algorithm.
  36770. </p></dd>
  36771. <dt>&lsquo;<samp>ntss</samp>&rsquo;</dt>
  36772. <dd><p>New three step search algorithm.
  36773. </p></dd>
  36774. <dt>&lsquo;<samp>fss</samp>&rsquo;</dt>
  36775. <dd><p>Four step search algorithm.
  36776. </p></dd>
  36777. <dt>&lsquo;<samp>ds</samp>&rsquo;</dt>
  36778. <dd><p>Diamond search algorithm.
  36779. </p></dd>
  36780. <dt>&lsquo;<samp>hexbs</samp>&rsquo;</dt>
  36781. <dd><p>Hexagon-based search algorithm.
  36782. </p></dd>
  36783. <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
  36784. <dd><p>Enhanced predictive zonal search algorithm.
  36785. </p></dd>
  36786. <dt>&lsquo;<samp>umh</samp>&rsquo;</dt>
  36787. <dd><p>Uneven multi-hexagon search algorithm.
  36788. </p></dd>
  36789. </dl>
  36790. <p>Default algorithm is &lsquo;<samp>epzs</samp>&rsquo;.
  36791. </p>
  36792. </dd>
  36793. <dt>&lsquo;<samp>mb_size</samp>&rsquo;</dt>
  36794. <dd><p>Macroblock size. Default <code>16</code>.
  36795. </p>
  36796. </dd>
  36797. <dt>&lsquo;<samp>search_param</samp>&rsquo;</dt>
  36798. <dd><p>Motion estimation search parameter. Default <code>32</code>.
  36799. </p>
  36800. </dd>
  36801. <dt>&lsquo;<samp>vsbmc</samp>&rsquo;</dt>
  36802. <dd><p>Enable variable-size block motion compensation. Motion estimation is applied with smaller block sizes at object boundaries in order to make the them less blur. Default is <code>0</code> (disabled).
  36803. </p></dd>
  36804. </dl>
  36805. </dd>
  36806. </dl>
  36807. </dd>
  36808. <dt><samp>scd</samp></dt>
  36809. <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:
  36810. </p><dl compact="compact">
  36811. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  36812. <dd><p>Disable scene change detection.
  36813. </p></dd>
  36814. <dt>&lsquo;<samp>fdiff</samp>&rsquo;</dt>
  36815. <dd><p>Frame difference. Corresponding pixel values are compared and if it satisfies <var>scd_threshold</var> scene change is detected.
  36816. </p></dd>
  36817. </dl>
  36818. <p>Default method is &lsquo;<samp>fdiff</samp>&rsquo;.
  36819. </p>
  36820. </dd>
  36821. <dt><samp>scd_threshold</samp></dt>
  36822. <dd><p>Scene change detection threshold. Default is <code>10.</code>.
  36823. </p></dd>
  36824. </dl>
  36825. <a name="mix"></a>
  36826. <h3 class="section">39.144 mix<span class="pull-right"><a class="anchor hidden-xs" href="#mix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mix" aria-hidden="true">TOC</a></span></h3>
  36827. <p>Mix several video input streams into one video stream.
  36828. </p>
  36829. <p>A description of the accepted options follows.
  36830. </p>
  36831. <dl compact="compact">
  36832. <dt><samp>nb_inputs</samp></dt>
  36833. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  36834. </p>
  36835. </dd>
  36836. <dt><samp>weights</samp></dt>
  36837. <dd><p>Specify weight of each input video stream as sequence.
  36838. Each weight is separated by space. If number of weights
  36839. is smaller than number of <var>frames</var> last specified
  36840. weight will be used for all remaining unset weights.
  36841. </p>
  36842. </dd>
  36843. <dt><samp>scale</samp></dt>
  36844. <dd><p>Specify scale, if it is set it will be multiplied with sum
  36845. of each weight multiplied with pixel values to give final destination
  36846. pixel value. By default <var>scale</var> is auto scaled to sum of weights.
  36847. </p>
  36848. </dd>
  36849. <dt><samp>duration</samp></dt>
  36850. <dd><p>Specify how end of stream is determined.
  36851. </p><dl compact="compact">
  36852. <dt>&lsquo;<samp>longest</samp>&rsquo;</dt>
  36853. <dd><p>The duration of the longest input. (default)
  36854. </p>
  36855. </dd>
  36856. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  36857. <dd><p>The duration of the shortest input.
  36858. </p>
  36859. </dd>
  36860. <dt>&lsquo;<samp>first</samp>&rsquo;</dt>
  36861. <dd><p>The duration of the first input.
  36862. </p></dd>
  36863. </dl>
  36864. </dd>
  36865. </dl>
  36866. <a name="Commands-104"></a>
  36867. <h4 class="subsection">39.144.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-104" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-104" aria-hidden="true">TOC</a></span></h4>
  36868. <p>This filter supports the following commands:
  36869. </p><dl compact="compact">
  36870. <dt><samp>weights</samp></dt>
  36871. <dt><samp>scale</samp></dt>
  36872. <dd><p>Syntax is same as option with same name.
  36873. </p></dd>
  36874. </dl>
  36875. <a name="monochrome"></a>
  36876. <h3 class="section">39.145 monochrome<span class="pull-right"><a class="anchor hidden-xs" href="#monochrome" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-monochrome" aria-hidden="true">TOC</a></span></h3>
  36877. <p>Convert video to gray using custom color filter.
  36878. </p>
  36879. <p>A description of the accepted options follows.
  36880. </p>
  36881. <dl compact="compact">
  36882. <dt><samp>cb</samp></dt>
  36883. <dd><p>Set the chroma blue spot. Allowed range is from -1 to 1.
  36884. Default value is 0.
  36885. </p>
  36886. </dd>
  36887. <dt><samp>cr</samp></dt>
  36888. <dd><p>Set the chroma red spot. Allowed range is from -1 to 1.
  36889. Default value is 0.
  36890. </p>
  36891. </dd>
  36892. <dt><samp>size</samp></dt>
  36893. <dd><p>Set the color filter size. Allowed range is from .1 to 10.
  36894. Default value is 1.
  36895. </p>
  36896. </dd>
  36897. <dt><samp>high</samp></dt>
  36898. <dd><p>Set the highlights strength. Allowed range is from 0 to 1.
  36899. Default value is 0.
  36900. </p></dd>
  36901. </dl>
  36902. <a name="Commands-105"></a>
  36903. <h4 class="subsection">39.145.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-105" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-105" aria-hidden="true">TOC</a></span></h4>
  36904. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  36905. </p>
  36906. <a name="mpdecimate"></a>
  36907. <h3 class="section">39.146 mpdecimate<span class="pull-right"><a class="anchor hidden-xs" href="#mpdecimate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpdecimate" aria-hidden="true">TOC</a></span></h3>
  36908. <p>Drop frames that do not differ greatly from the previous frame in
  36909. order to reduce frame rate.
  36910. </p>
  36911. <p>The main use of this filter is for very-low-bitrate encoding
  36912. (e.g. streaming over dialup modem), but it could in theory be used for
  36913. fixing movies that were inverse-telecined incorrectly.
  36914. </p>
  36915. <p>A description of the accepted options follows.
  36916. </p>
  36917. <dl compact="compact">
  36918. <dt><samp>max</samp></dt>
  36919. <dd><p>Set the maximum number of consecutive frames which can be dropped (if
  36920. positive), or the minimum interval between dropped frames (if
  36921. negative). If the value is 0, the frame is dropped disregarding the
  36922. number of previous sequentially dropped frames.
  36923. </p>
  36924. <p>Default value is 0.
  36925. </p>
  36926. </dd>
  36927. <dt><samp>hi</samp></dt>
  36928. <dt><samp>lo</samp></dt>
  36929. <dt><samp>frac</samp></dt>
  36930. <dd><p>Set the dropping threshold values.
  36931. </p>
  36932. <p>Values for <samp>hi</samp> and <samp>lo</samp> are for 8x8 pixel blocks and
  36933. represent actual pixel value differences, so a threshold of 64
  36934. corresponds to 1 unit of difference for each pixel, or the same spread
  36935. out differently over the block.
  36936. </p>
  36937. <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
  36938. than a threshold of <samp>hi</samp>, and if no more than <samp>frac</samp> blocks (1
  36939. meaning the whole image) differ by more than a threshold of <samp>lo</samp>.
  36940. </p>
  36941. <p>Default value for <samp>hi</samp> is 64*12, default value for <samp>lo</samp> is
  36942. 64*5, and default value for <samp>frac</samp> is 0.33.
  36943. </p></dd>
  36944. </dl>
  36945. <a name="msad"></a>
  36946. <h3 class="section">39.147 msad<span class="pull-right"><a class="anchor hidden-xs" href="#msad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-msad" aria-hidden="true">TOC</a></span></h3>
  36947. <p>Obtain the MSAD (Mean Sum of Absolute Differences) between two input videos.
  36948. </p>
  36949. <p>This filter takes two input videos.
  36950. </p>
  36951. <p>Both input videos must have the same resolution and pixel format for
  36952. this filter to work correctly. Also it assumes that both inputs
  36953. have the same number of frames, which are compared one by one.
  36954. </p>
  36955. <p>The obtained per component, average, min and max MSAD is printed through
  36956. the logging system.
  36957. </p>
  36958. <p>The filter stores the calculated MSAD of each frame in frame metadata.
  36959. </p>
  36960. <p>In the below example the input file <samp>main.mpg</samp> being processed is compared
  36961. with the reference file <samp>ref.mpg</samp>.
  36962. </p>
  36963. <div class="example">
  36964. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi msad -f null -
  36965. </pre></div>
  36966. <a name="negate"></a>
  36967. <h3 class="section">39.148 negate<span class="pull-right"><a class="anchor hidden-xs" href="#negate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-negate" aria-hidden="true">TOC</a></span></h3>
  36968. <p>Negate (invert) the input video.
  36969. </p>
  36970. <p>It accepts the following option:
  36971. </p>
  36972. <dl compact="compact">
  36973. <dt><samp>negate_alpha</samp></dt>
  36974. <dd><p>With value 1, it negates the alpha component, if present. Default value is 0.
  36975. </p></dd>
  36976. </dl>
  36977. <a name="Commands-106"></a>
  36978. <h4 class="subsection">39.148.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-106" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-106" aria-hidden="true">TOC</a></span></h4>
  36979. <p>This filter supports same <a href="#commands">commands</a> as options.
  36980. </p>
  36981. <span id="nlmeans"></span><a name="nlmeans-1"></a>
  36982. <h3 class="section">39.149 nlmeans<span class="pull-right"><a class="anchor hidden-xs" href="#nlmeans-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nlmeans-1" aria-hidden="true">TOC</a></span></h3>
  36983. <p>Denoise frames using Non-Local Means algorithm.
  36984. </p>
  36985. <p>Each pixel is adjusted by looking for other pixels with similar contexts. This
  36986. context similarity is defined by comparing their surrounding patches of size
  36987. <samp>p</samp>x<samp>p</samp>. Patches are searched in an area of <samp>r</samp>x<samp>r</samp>
  36988. around the pixel.
  36989. </p>
  36990. <p>Note that the research area defines centers for patches, which means some
  36991. patches will be made of pixels outside that research area.
  36992. </p>
  36993. <p>The filter accepts the following options.
  36994. </p>
  36995. <dl compact="compact">
  36996. <dt><samp>s</samp></dt>
  36997. <dd><p>Set denoising strength. Default is 1.0. Must be in range [1.0, 30.0].
  36998. </p>
  36999. </dd>
  37000. <dt><samp>p</samp></dt>
  37001. <dd><p>Set patch size. Default is 7. Must be odd number in range [0, 99].
  37002. </p>
  37003. </dd>
  37004. <dt><samp>pc</samp></dt>
  37005. <dd><p>Same as <samp>p</samp> but for chroma planes.
  37006. </p>
  37007. <p>The default value is <var>0</var> and means automatic.
  37008. </p>
  37009. </dd>
  37010. <dt><samp>r</samp></dt>
  37011. <dd><p>Set research size. Default is 15. Must be odd number in range [0, 99].
  37012. </p>
  37013. </dd>
  37014. <dt><samp>rc</samp></dt>
  37015. <dd><p>Same as <samp>r</samp> but for chroma planes.
  37016. </p>
  37017. <p>The default value is <var>0</var> and means automatic.
  37018. </p></dd>
  37019. </dl>
  37020. <a name="nnedi"></a>
  37021. <h3 class="section">39.150 nnedi<span class="pull-right"><a class="anchor hidden-xs" href="#nnedi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nnedi" aria-hidden="true">TOC</a></span></h3>
  37022. <p>Deinterlace video using neural network edge directed interpolation.
  37023. </p>
  37024. <p>This filter accepts the following options:
  37025. </p>
  37026. <dl compact="compact">
  37027. <dt><samp>weights</samp></dt>
  37028. <dd><p>Mandatory option, without binary file filter can not work.
  37029. Currently file can be found here:
  37030. https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin
  37031. </p>
  37032. </dd>
  37033. <dt><samp>deint</samp></dt>
  37034. <dd><p>Set which frames to deinterlace, by default it is <code>all</code>.
  37035. Can be <code>all</code> or <code>interlaced</code>.
  37036. </p>
  37037. </dd>
  37038. <dt><samp>field</samp></dt>
  37039. <dd><p>Set mode of operation.
  37040. </p>
  37041. <p>Can be one of the following:
  37042. </p>
  37043. <dl compact="compact">
  37044. <dt>&lsquo;<samp>af</samp>&rsquo;</dt>
  37045. <dd><p>Use frame flags, both fields.
  37046. </p></dd>
  37047. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  37048. <dd><p>Use frame flags, single field.
  37049. </p></dd>
  37050. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  37051. <dd><p>Use top field only.
  37052. </p></dd>
  37053. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  37054. <dd><p>Use bottom field only.
  37055. </p></dd>
  37056. <dt>&lsquo;<samp>tf</samp>&rsquo;</dt>
  37057. <dd><p>Use both fields, top first.
  37058. </p></dd>
  37059. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  37060. <dd><p>Use both fields, bottom first.
  37061. </p></dd>
  37062. </dl>
  37063. </dd>
  37064. <dt><samp>planes</samp></dt>
  37065. <dd><p>Set which planes to process, by default filter process all frames.
  37066. </p>
  37067. </dd>
  37068. <dt><samp>nsize</samp></dt>
  37069. <dd><p>Set size of local neighborhood around each pixel, used by the predictor neural
  37070. network.
  37071. </p>
  37072. <p>Can be one of the following:
  37073. </p>
  37074. <dl compact="compact">
  37075. <dt>&lsquo;<samp>s8x6</samp>&rsquo;</dt>
  37076. <dt>&lsquo;<samp>s16x6</samp>&rsquo;</dt>
  37077. <dt>&lsquo;<samp>s32x6</samp>&rsquo;</dt>
  37078. <dt>&lsquo;<samp>s48x6</samp>&rsquo;</dt>
  37079. <dt>&lsquo;<samp>s8x4</samp>&rsquo;</dt>
  37080. <dt>&lsquo;<samp>s16x4</samp>&rsquo;</dt>
  37081. <dt>&lsquo;<samp>s32x4</samp>&rsquo;</dt>
  37082. </dl>
  37083. </dd>
  37084. <dt><samp>nns</samp></dt>
  37085. <dd><p>Set the number of neurons in predictor neural network.
  37086. Can be one of the following:
  37087. </p>
  37088. <dl compact="compact">
  37089. <dt>&lsquo;<samp>n16</samp>&rsquo;</dt>
  37090. <dt>&lsquo;<samp>n32</samp>&rsquo;</dt>
  37091. <dt>&lsquo;<samp>n64</samp>&rsquo;</dt>
  37092. <dt>&lsquo;<samp>n128</samp>&rsquo;</dt>
  37093. <dt>&lsquo;<samp>n256</samp>&rsquo;</dt>
  37094. </dl>
  37095. </dd>
  37096. <dt><samp>qual</samp></dt>
  37097. <dd><p>Controls the number of different neural network predictions that are blended
  37098. together to compute the final output value. Can be <code>fast</code>, default or
  37099. <code>slow</code>.
  37100. </p>
  37101. </dd>
  37102. <dt><samp>etype</samp></dt>
  37103. <dd><p>Set which set of weights to use in the predictor.
  37104. Can be one of the following:
  37105. </p>
  37106. <dl compact="compact">
  37107. <dt>&lsquo;<samp>a, abs</samp>&rsquo;</dt>
  37108. <dd><p>weights trained to minimize absolute error
  37109. </p></dd>
  37110. <dt>&lsquo;<samp>s, mse</samp>&rsquo;</dt>
  37111. <dd><p>weights trained to minimize squared error
  37112. </p></dd>
  37113. </dl>
  37114. </dd>
  37115. <dt><samp>pscrn</samp></dt>
  37116. <dd><p>Controls whether or not the prescreener neural network is used to decide
  37117. which pixels should be processed by the predictor neural network and which
  37118. can be handled by simple cubic interpolation.
  37119. The prescreener is trained to know whether cubic interpolation will be
  37120. sufficient for a pixel or whether it should be predicted by the predictor nn.
  37121. The computational complexity of the prescreener nn is much less than that of
  37122. the predictor nn. Since most pixels can be handled by cubic interpolation,
  37123. using the prescreener generally results in much faster processing.
  37124. The prescreener is pretty accurate, so the difference between using it and not
  37125. using it is almost always unnoticeable.
  37126. </p>
  37127. <p>Can be one of the following:
  37128. </p>
  37129. <dl compact="compact">
  37130. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  37131. <dt>&lsquo;<samp>original</samp>&rsquo;</dt>
  37132. <dt>&lsquo;<samp>new</samp>&rsquo;</dt>
  37133. <dt>&lsquo;<samp>new2</samp>&rsquo;</dt>
  37134. <dt>&lsquo;<samp>new3</samp>&rsquo;</dt>
  37135. </dl>
  37136. <p>Default is <code>new</code>.
  37137. </p></dd>
  37138. </dl>
  37139. <a name="Commands-107"></a>
  37140. <h4 class="subsection">39.150.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-107" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-107" aria-hidden="true">TOC</a></span></h4>
  37141. <p>This filter supports same <a href="#commands">commands</a> as options, excluding <var>weights</var> option.
  37142. </p>
  37143. <a name="noformat"></a>
  37144. <h3 class="section">39.151 noformat<span class="pull-right"><a class="anchor hidden-xs" href="#noformat" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-noformat" aria-hidden="true">TOC</a></span></h3>
  37145. <p>Force libavfilter not to use any of the specified pixel formats for the
  37146. input to the next filter.
  37147. </p>
  37148. <p>It accepts the following parameters:
  37149. </p><dl compact="compact">
  37150. <dt><samp>pix_fmts</samp></dt>
  37151. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  37152. pix_fmts=yuv420p|monow|rgb24&quot;.
  37153. </p>
  37154. </dd>
  37155. </dl>
  37156. <a name="Examples-122"></a>
  37157. <h4 class="subsection">39.151.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-122" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-122" aria-hidden="true">TOC</a></span></h4>
  37158. <ul>
  37159. <li> Force libavfilter to use a format different from <var>yuv420p</var> for the
  37160. input to the vflip filter:
  37161. <div class="example">
  37162. <pre class="example">noformat=pix_fmts=yuv420p,vflip
  37163. </pre></div>
  37164. </li><li> Convert the input video to any of the formats not contained in the list:
  37165. <div class="example">
  37166. <pre class="example">noformat=yuv420p|yuv444p|yuv410p
  37167. </pre></div>
  37168. </li></ul>
  37169. <a name="noise-1"></a>
  37170. <h3 class="section">39.152 noise<span class="pull-right"><a class="anchor hidden-xs" href="#noise-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-noise-1" aria-hidden="true">TOC</a></span></h3>
  37171. <p>Add noise on video input frame.
  37172. </p>
  37173. <p>The filter accepts the following options:
  37174. </p>
  37175. <dl compact="compact">
  37176. <dt><samp>all_seed</samp></dt>
  37177. <dt><samp>c0_seed</samp></dt>
  37178. <dt><samp>c1_seed</samp></dt>
  37179. <dt><samp>c2_seed</samp></dt>
  37180. <dt><samp>c3_seed</samp></dt>
  37181. <dd><p>Set noise seed for specific pixel component or all pixel components in case
  37182. of <var>all_seed</var>. Default value is <code>123457</code>.
  37183. </p>
  37184. </dd>
  37185. <dt><samp>all_strength, alls</samp></dt>
  37186. <dt><samp>c0_strength, c0s</samp></dt>
  37187. <dt><samp>c1_strength, c1s</samp></dt>
  37188. <dt><samp>c2_strength, c2s</samp></dt>
  37189. <dt><samp>c3_strength, c3s</samp></dt>
  37190. <dd><p>Set noise strength for specific pixel component or all pixel components in case
  37191. <var>all_strength</var>. Default value is <code>0</code>. Allowed range is [0, 100].
  37192. </p>
  37193. </dd>
  37194. <dt><samp>all_flags, allf</samp></dt>
  37195. <dt><samp>c0_flags, c0f</samp></dt>
  37196. <dt><samp>c1_flags, c1f</samp></dt>
  37197. <dt><samp>c2_flags, c2f</samp></dt>
  37198. <dt><samp>c3_flags, c3f</samp></dt>
  37199. <dd><p>Set pixel component flags or set flags for all components if <var>all_flags</var>.
  37200. Available values for component flags are:
  37201. </p><dl compact="compact">
  37202. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  37203. <dd><p>averaged temporal noise (smoother)
  37204. </p></dd>
  37205. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  37206. <dd><p>mix random noise with a (semi)regular pattern
  37207. </p></dd>
  37208. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  37209. <dd><p>temporal noise (noise pattern changes between frames)
  37210. </p></dd>
  37211. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  37212. <dd><p>uniform noise (gaussian otherwise)
  37213. </p></dd>
  37214. </dl>
  37215. </dd>
  37216. </dl>
  37217. <a name="Examples-123"></a>
  37218. <h4 class="subsection">39.152.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-123" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-123" aria-hidden="true">TOC</a></span></h4>
  37219. <p>Add temporal and uniform noise to input video:
  37220. </p><div class="example">
  37221. <pre class="example">noise=alls=20:allf=t+u
  37222. </pre></div>
  37223. <a name="normalize"></a>
  37224. <h3 class="section">39.153 normalize<span class="pull-right"><a class="anchor hidden-xs" href="#normalize" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-normalize" aria-hidden="true">TOC</a></span></h3>
  37225. <p>Normalize RGB video (aka histogram stretching, contrast stretching).
  37226. See: https://en.wikipedia.org/wiki/Normalization_(image_processing)
  37227. </p>
  37228. <p>For each channel of each frame, the filter computes the input range and maps
  37229. it linearly to the user-specified output range. The output range defaults
  37230. to the full dynamic range from pure black to pure white.
  37231. </p>
  37232. <p>Temporal smoothing can be used on the input range to reduce flickering (rapid
  37233. changes in brightness) caused when small dark or bright objects enter or leave
  37234. the scene. This is similar to the auto-exposure (automatic gain control) on a
  37235. video camera, and, like a video camera, it may cause a period of over- or
  37236. under-exposure of the video.
  37237. </p>
  37238. <p>The R,G,B channels can be normalized independently, which may cause some
  37239. color shifting, or linked together as a single channel, which prevents
  37240. color shifting. Linked normalization preserves hue. Independent normalization
  37241. does not, so it can be used to remove some color casts. Independent and linked
  37242. normalization can be combined in any ratio.
  37243. </p>
  37244. <p>The normalize filter accepts the following options:
  37245. </p>
  37246. <dl compact="compact">
  37247. <dt><samp>blackpt</samp></dt>
  37248. <dt><samp>whitept</samp></dt>
  37249. <dd><p>Colors which define the output range. The minimum input value is mapped to
  37250. the <var>blackpt</var>. The maximum input value is mapped to the <var>whitept</var>.
  37251. The defaults are black and white respectively. Specifying white for
  37252. <var>blackpt</var> and black for <var>whitept</var> will give color-inverted,
  37253. normalized video. Shades of grey can be used to reduce the dynamic range
  37254. (contrast). Specifying saturated colors here can create some interesting
  37255. effects.
  37256. </p>
  37257. </dd>
  37258. <dt><samp>smoothing</samp></dt>
  37259. <dd><p>The number of previous frames to use for temporal smoothing. The input range
  37260. of each channel is smoothed using a rolling average over the current frame
  37261. and the <var>smoothing</var> previous frames. The default is 0 (no temporal
  37262. smoothing).
  37263. </p>
  37264. </dd>
  37265. <dt><samp>independence</samp></dt>
  37266. <dd><p>Controls the ratio of independent (color shifting) channel normalization to
  37267. linked (color preserving) normalization. 0.0 is fully linked, 1.0 is fully
  37268. independent. Defaults to 1.0 (fully independent).
  37269. </p>
  37270. </dd>
  37271. <dt><samp>strength</samp></dt>
  37272. <dd><p>Overall strength of the filter. 1.0 is full strength. 0.0 is a rather
  37273. expensive no-op. Defaults to 1.0 (full strength).
  37274. </p>
  37275. </dd>
  37276. </dl>
  37277. <a name="Commands-108"></a>
  37278. <h4 class="subsection">39.153.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-108" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-108" aria-hidden="true">TOC</a></span></h4>
  37279. <p>This filter supports same <a href="#commands">commands</a> as options, excluding <var>smoothing</var> option.
  37280. The command accepts the same syntax of the corresponding option.
  37281. </p>
  37282. <p>If the specified expression is not valid, it is kept at its current
  37283. value.
  37284. </p>
  37285. <a name="Examples-124"></a>
  37286. <h4 class="subsection">39.153.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-124" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-124" aria-hidden="true">TOC</a></span></h4>
  37287. <p>Stretch video contrast to use the full dynamic range, with no temporal
  37288. smoothing; may flicker depending on the source content:
  37289. </p><div class="example">
  37290. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=0
  37291. </pre></div>
  37292. <p>As above, but with 50 frames of temporal smoothing; flicker should be
  37293. reduced, depending on the source content:
  37294. </p><div class="example">
  37295. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=50
  37296. </pre></div>
  37297. <p>As above, but with hue-preserving linked channel normalization:
  37298. </p><div class="example">
  37299. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=50:independence=0
  37300. </pre></div>
  37301. <p>As above, but with half strength:
  37302. </p><div class="example">
  37303. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=50:independence=0:strength=0.5
  37304. </pre></div>
  37305. <p>Map the darkest input color to red, the brightest input color to cyan:
  37306. </p><div class="example">
  37307. <pre class="example">normalize=blackpt=red:whitept=cyan
  37308. </pre></div>
  37309. <a name="null-2"></a>
  37310. <h3 class="section">39.154 null<span class="pull-right"><a class="anchor hidden-xs" href="#null-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-null-2" aria-hidden="true">TOC</a></span></h3>
  37311. <p>Pass the video source unchanged to the output.
  37312. </p>
  37313. <a name="ocr"></a>
  37314. <h3 class="section">39.155 ocr<span class="pull-right"><a class="anchor hidden-xs" href="#ocr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ocr" aria-hidden="true">TOC</a></span></h3>
  37315. <p>Optical Character Recognition
  37316. </p>
  37317. <p>This filter uses Tesseract for optical character recognition. To enable
  37318. compilation of this filter, you need to configure FFmpeg with
  37319. <code>--enable-libtesseract</code>.
  37320. </p>
  37321. <p>It accepts the following options:
  37322. </p>
  37323. <dl compact="compact">
  37324. <dt><samp>datapath</samp></dt>
  37325. <dd><p>Set datapath to tesseract data. Default is to use whatever was
  37326. set at installation.
  37327. </p>
  37328. </dd>
  37329. <dt><samp>language</samp></dt>
  37330. <dd><p>Set language, default is &quot;eng&quot;.
  37331. </p>
  37332. </dd>
  37333. <dt><samp>whitelist</samp></dt>
  37334. <dd><p>Set character whitelist.
  37335. </p>
  37336. </dd>
  37337. <dt><samp>blacklist</samp></dt>
  37338. <dd><p>Set character blacklist.
  37339. </p></dd>
  37340. </dl>
  37341. <p>The filter exports recognized text as the frame metadata <code>lavfi.ocr.text</code>.
  37342. The filter exports confidence of recognized words as the frame metadata <code>lavfi.ocr.confidence</code>.
  37343. </p>
  37344. <a name="ocv"></a>
  37345. <h3 class="section">39.156 ocv<span class="pull-right"><a class="anchor hidden-xs" href="#ocv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ocv" aria-hidden="true">TOC</a></span></h3>
  37346. <p>Apply a video transform using libopencv.
  37347. </p>
  37348. <p>To enable this filter, install the libopencv library and headers and
  37349. configure FFmpeg with <code>--enable-libopencv</code>.
  37350. </p>
  37351. <p>It accepts the following parameters:
  37352. </p>
  37353. <dl compact="compact">
  37354. <dt><samp>filter_name</samp></dt>
  37355. <dd><p>The name of the libopencv filter to apply.
  37356. </p>
  37357. </dd>
  37358. <dt><samp>filter_params</samp></dt>
  37359. <dd><p>The parameters to pass to the libopencv filter. If not specified, the default
  37360. values are assumed.
  37361. </p>
  37362. </dd>
  37363. </dl>
  37364. <p>Refer to the official libopencv documentation for more precise
  37365. information:
  37366. <a href="http://docs.opencv.org/master/modules/imgproc/doc/filtering.html">http://docs.opencv.org/master/modules/imgproc/doc/filtering.html</a>
  37367. </p>
  37368. <p>Several libopencv filters are supported; see the following subsections.
  37369. </p>
  37370. <span id="dilate"></span><a name="dilate-1"></a>
  37371. <h4 class="subsection">39.156.1 dilate<span class="pull-right"><a class="anchor hidden-xs" href="#dilate-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dilate-1" aria-hidden="true">TOC</a></span></h4>
  37372. <p>Dilate an image by using a specific structuring element.
  37373. It corresponds to the libopencv function <code>cvDilate</code>.
  37374. </p>
  37375. <p>It accepts the parameters: <var>struct_el</var>|<var>nb_iterations</var>.
  37376. </p>
  37377. <p><var>struct_el</var> represents a structuring element, and has the syntax:
  37378. <var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
  37379. </p>
  37380. <p><var>cols</var> and <var>rows</var> represent the number of columns and rows of
  37381. the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
  37382. point, and <var>shape</var> the shape for the structuring element. <var>shape</var>
  37383. must be &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, or &quot;custom&quot;.
  37384. </p>
  37385. <p>If the value for <var>shape</var> is &quot;custom&quot;, it must be followed by a
  37386. string of the form &quot;=<var>filename</var>&quot;. The file with name
  37387. <var>filename</var> is assumed to represent a binary image, with each
  37388. printable character corresponding to a bright pixel. When a custom
  37389. <var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
  37390. or columns and rows of the read file are assumed instead.
  37391. </p>
  37392. <p>The default value for <var>struct_el</var> is &quot;3x3+0x0/rect&quot;.
  37393. </p>
  37394. <p><var>nb_iterations</var> specifies the number of times the transform is
  37395. applied to the image, and defaults to 1.
  37396. </p>
  37397. <p>Some examples:
  37398. </p><div class="example">
  37399. <pre class="example"># Use the default values
  37400. ocv=dilate
  37401. # Dilate using a structuring element with a 5x5 cross, iterating two times
  37402. ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
  37403. # Read the shape from the file diamond.shape, iterating two times.
  37404. # The file diamond.shape may contain a pattern of characters like this
  37405. # *
  37406. # ***
  37407. # *****
  37408. # ***
  37409. # *
  37410. # The specified columns and rows are ignored
  37411. # but the anchor point coordinates are not
  37412. ocv=dilate:0x0+2x2/custom=diamond.shape|2
  37413. </pre></div>
  37414. <a name="erode"></a>
  37415. <h4 class="subsection">39.156.2 erode<span class="pull-right"><a class="anchor hidden-xs" href="#erode" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-erode" aria-hidden="true">TOC</a></span></h4>
  37416. <p>Erode an image by using a specific structuring element.
  37417. It corresponds to the libopencv function <code>cvErode</code>.
  37418. </p>
  37419. <p>It accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
  37420. with the same syntax and semantics as the <a href="#dilate">dilate</a> filter.
  37421. </p>
  37422. <a name="smooth"></a>
  37423. <h4 class="subsection">39.156.3 smooth<span class="pull-right"><a class="anchor hidden-xs" href="#smooth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smooth" aria-hidden="true">TOC</a></span></h4>
  37424. <p>Smooth the input video.
  37425. </p>
  37426. <p>The filter takes the following parameters:
  37427. <var>type</var>|<var>param1</var>|<var>param2</var>|<var>param3</var>|<var>param4</var>.
  37428. </p>
  37429. <p><var>type</var> is the type of smooth filter to apply, and must be one of
  37430. the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
  37431. or &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
  37432. </p>
  37433. <p>The meaning of <var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var>
  37434. depends on the smooth type. <var>param1</var> and
  37435. <var>param2</var> accept integer positive values or 0. <var>param3</var> and
  37436. <var>param4</var> accept floating point values.
  37437. </p>
  37438. <p>The default value for <var>param1</var> is 3. The default value for the
  37439. other parameters is 0.
  37440. </p>
  37441. <p>These parameters correspond to the parameters assigned to the
  37442. libopencv function <code>cvSmooth</code>.
  37443. </p>
  37444. <a name="oscilloscope"></a>
  37445. <h3 class="section">39.157 oscilloscope<span class="pull-right"><a class="anchor hidden-xs" href="#oscilloscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-oscilloscope" aria-hidden="true">TOC</a></span></h3>
  37446. <p>2D Video Oscilloscope.
  37447. </p>
  37448. <p>Useful to measure spatial impulse, step responses, chroma delays, etc.
  37449. </p>
  37450. <p>It accepts the following parameters:
  37451. </p>
  37452. <dl compact="compact">
  37453. <dt><samp>x</samp></dt>
  37454. <dd><p>Set scope center x position.
  37455. </p>
  37456. </dd>
  37457. <dt><samp>y</samp></dt>
  37458. <dd><p>Set scope center y position.
  37459. </p>
  37460. </dd>
  37461. <dt><samp>s</samp></dt>
  37462. <dd><p>Set scope size, relative to frame diagonal.
  37463. </p>
  37464. </dd>
  37465. <dt><samp>t</samp></dt>
  37466. <dd><p>Set scope tilt/rotation.
  37467. </p>
  37468. </dd>
  37469. <dt><samp>o</samp></dt>
  37470. <dd><p>Set trace opacity.
  37471. </p>
  37472. </dd>
  37473. <dt><samp>tx</samp></dt>
  37474. <dd><p>Set trace center x position.
  37475. </p>
  37476. </dd>
  37477. <dt><samp>ty</samp></dt>
  37478. <dd><p>Set trace center y position.
  37479. </p>
  37480. </dd>
  37481. <dt><samp>tw</samp></dt>
  37482. <dd><p>Set trace width, relative to width of frame.
  37483. </p>
  37484. </dd>
  37485. <dt><samp>th</samp></dt>
  37486. <dd><p>Set trace height, relative to height of frame.
  37487. </p>
  37488. </dd>
  37489. <dt><samp>c</samp></dt>
  37490. <dd><p>Set which components to trace. By default it traces first three components.
  37491. </p>
  37492. </dd>
  37493. <dt><samp>g</samp></dt>
  37494. <dd><p>Draw trace grid. By default is enabled.
  37495. </p>
  37496. </dd>
  37497. <dt><samp>st</samp></dt>
  37498. <dd><p>Draw some statistics. By default is enabled.
  37499. </p>
  37500. </dd>
  37501. <dt><samp>sc</samp></dt>
  37502. <dd><p>Draw scope. By default is enabled.
  37503. </p></dd>
  37504. </dl>
  37505. <a name="Commands-109"></a>
  37506. <h4 class="subsection">39.157.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-109" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-109" aria-hidden="true">TOC</a></span></h4>
  37507. <p>This filter supports same <a href="#commands">commands</a> as options.
  37508. The command accepts the same syntax of the corresponding option.
  37509. </p>
  37510. <p>If the specified expression is not valid, it is kept at its current
  37511. value.
  37512. </p>
  37513. <a name="Examples-125"></a>
  37514. <h4 class="subsection">39.157.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-125" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-125" aria-hidden="true">TOC</a></span></h4>
  37515. <ul>
  37516. <li> Inspect full first row of video frame.
  37517. <div class="example">
  37518. <pre class="example">oscilloscope=x=0.5:y=0:s=1
  37519. </pre></div>
  37520. </li><li> Inspect full last row of video frame.
  37521. <div class="example">
  37522. <pre class="example">oscilloscope=x=0.5:y=1:s=1
  37523. </pre></div>
  37524. </li><li> Inspect full 5th line of video frame of height 1080.
  37525. <div class="example">
  37526. <pre class="example">oscilloscope=x=0.5:y=5/1080:s=1
  37527. </pre></div>
  37528. </li><li> Inspect full last column of video frame.
  37529. <div class="example">
  37530. <pre class="example">oscilloscope=x=1:y=0.5:s=1:t=1
  37531. </pre></div>
  37532. </li></ul>
  37533. <span id="overlay"></span><a name="overlay-1"></a>
  37534. <h3 class="section">39.158 overlay<span class="pull-right"><a class="anchor hidden-xs" href="#overlay-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay-1" aria-hidden="true">TOC</a></span></h3>
  37535. <p>Overlay one video on top of another.
  37536. </p>
  37537. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  37538. video on which the second input is overlaid.
  37539. </p>
  37540. <p>It accepts the following parameters:
  37541. </p>
  37542. <p>A description of the accepted options follows.
  37543. </p>
  37544. <dl compact="compact">
  37545. <dt><samp>x</samp></dt>
  37546. <dt><samp>y</samp></dt>
  37547. <dd><p>Set the expression for the x and y coordinates of the overlaid video
  37548. on the main video. Default value is &quot;0&quot; for both expressions. In case
  37549. the expression is invalid, it is set to a huge value (meaning that the
  37550. overlay will not be displayed within the output visible area).
  37551. </p>
  37552. </dd>
  37553. <dt><samp>eof_action</samp></dt>
  37554. <dd><p>See <a href="#framesync">framesync</a>.
  37555. </p>
  37556. </dd>
  37557. <dt><samp>eval</samp></dt>
  37558. <dd><p>Set when the expressions for <samp>x</samp>, and <samp>y</samp> are evaluated.
  37559. </p>
  37560. <p>It accepts the following values:
  37561. </p><dl compact="compact">
  37562. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  37563. <dd><p>only evaluate expressions once during the filter initialization or
  37564. when a command is processed
  37565. </p>
  37566. </dd>
  37567. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  37568. <dd><p>evaluate expressions for each incoming frame
  37569. </p></dd>
  37570. </dl>
  37571. <p>Default value is &lsquo;<samp>frame</samp>&rsquo;.
  37572. </p>
  37573. </dd>
  37574. <dt><samp>shortest</samp></dt>
  37575. <dd><p>See <a href="#framesync">framesync</a>.
  37576. </p>
  37577. </dd>
  37578. <dt><samp>format</samp></dt>
  37579. <dd><p>Set the format for the output video.
  37580. </p>
  37581. <p>It accepts the following values:
  37582. </p><dl compact="compact">
  37583. <dt>&lsquo;<samp>yuv420</samp>&rsquo;</dt>
  37584. <dd><p>force YUV420 output
  37585. </p>
  37586. </dd>
  37587. <dt>&lsquo;<samp>yuv420p10</samp>&rsquo;</dt>
  37588. <dd><p>force YUV420p10 output
  37589. </p>
  37590. </dd>
  37591. <dt>&lsquo;<samp>yuv422</samp>&rsquo;</dt>
  37592. <dd><p>force YUV422 output
  37593. </p>
  37594. </dd>
  37595. <dt>&lsquo;<samp>yuv422p10</samp>&rsquo;</dt>
  37596. <dd><p>force YUV422p10 output
  37597. </p>
  37598. </dd>
  37599. <dt>&lsquo;<samp>yuv444</samp>&rsquo;</dt>
  37600. <dd><p>force YUV444 output
  37601. </p>
  37602. </dd>
  37603. <dt>&lsquo;<samp>rgb</samp>&rsquo;</dt>
  37604. <dd><p>force packed RGB output
  37605. </p>
  37606. </dd>
  37607. <dt>&lsquo;<samp>gbrp</samp>&rsquo;</dt>
  37608. <dd><p>force planar RGB output
  37609. </p>
  37610. </dd>
  37611. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  37612. <dd><p>automatically pick format
  37613. </p></dd>
  37614. </dl>
  37615. <p>Default value is &lsquo;<samp>yuv420</samp>&rsquo;.
  37616. </p>
  37617. </dd>
  37618. <dt><samp>repeatlast</samp></dt>
  37619. <dd><p>See <a href="#framesync">framesync</a>.
  37620. </p>
  37621. </dd>
  37622. <dt><samp>alpha</samp></dt>
  37623. <dd><p>Set format of alpha of the overlaid video, it can be <var>straight</var> or
  37624. <var>premultiplied</var>. Default is <var>straight</var>.
  37625. </p></dd>
  37626. </dl>
  37627. <p>The <samp>x</samp>, and <samp>y</samp> expressions can contain the following
  37628. parameters.
  37629. </p>
  37630. <dl compact="compact">
  37631. <dt><samp>main_w, W</samp></dt>
  37632. <dt><samp>main_h, H</samp></dt>
  37633. <dd><p>The main input width and height.
  37634. </p>
  37635. </dd>
  37636. <dt><samp>overlay_w, w</samp></dt>
  37637. <dt><samp>overlay_h, h</samp></dt>
  37638. <dd><p>The overlay input width and height.
  37639. </p>
  37640. </dd>
  37641. <dt><samp>x</samp></dt>
  37642. <dt><samp>y</samp></dt>
  37643. <dd><p>The computed values for <var>x</var> and <var>y</var>. They are evaluated for
  37644. each new frame.
  37645. </p>
  37646. </dd>
  37647. <dt><samp>hsub</samp></dt>
  37648. <dt><samp>vsub</samp></dt>
  37649. <dd><p>horizontal and vertical chroma subsample values of the output
  37650. format. For example for the pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and
  37651. <var>vsub</var> is 1.
  37652. </p>
  37653. </dd>
  37654. <dt><samp>n</samp></dt>
  37655. <dd><p>the number of input frame, starting from 0
  37656. </p>
  37657. </dd>
  37658. <dt><samp>pos</samp></dt>
  37659. <dd><p>the position in the file of the input frame, NAN if unknown
  37660. </p>
  37661. </dd>
  37662. <dt><samp>t</samp></dt>
  37663. <dd><p>The timestamp, expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  37664. </p>
  37665. </dd>
  37666. </dl>
  37667. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  37668. </p>
  37669. <p>Note that the <var>n</var>, <var>pos</var>, <var>t</var> variables are available only
  37670. when evaluation is done <em>per frame</em>, and will evaluate to NAN
  37671. when <samp>eval</samp> is set to &lsquo;<samp>init</samp>&rsquo;.
  37672. </p>
  37673. <p>Be aware that frames are taken from each input video in timestamp
  37674. order, hence, if their initial timestamps differ, it is a good idea
  37675. to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
  37676. have them begin in the same zero timestamp, as the example for
  37677. the <var>movie</var> filter does.
  37678. </p>
  37679. <p>You can chain together more overlays but you should test the
  37680. efficiency of such approach.
  37681. </p>
  37682. <a name="Commands-110"></a>
  37683. <h4 class="subsection">39.158.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-110" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-110" aria-hidden="true">TOC</a></span></h4>
  37684. <p>This filter supports the following commands:
  37685. </p><dl compact="compact">
  37686. <dt><samp>x</samp></dt>
  37687. <dt><samp>y</samp></dt>
  37688. <dd><p>Modify the x and y of the overlay input.
  37689. The command accepts the same syntax of the corresponding option.
  37690. </p>
  37691. <p>If the specified expression is not valid, it is kept at its current
  37692. value.
  37693. </p></dd>
  37694. </dl>
  37695. <a name="Examples-126"></a>
  37696. <h4 class="subsection">39.158.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-126" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-126" aria-hidden="true">TOC</a></span></h4>
  37697. <ul>
  37698. <li> Draw the overlay at 10 pixels from the bottom right corner of the main
  37699. video:
  37700. <div class="example">
  37701. <pre class="example">overlay=main_w-overlay_w-10:main_h-overlay_h-10
  37702. </pre></div>
  37703. <p>Using named options the example above becomes:
  37704. </p><div class="example">
  37705. <pre class="example">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
  37706. </pre></div>
  37707. </li><li> Insert a transparent PNG logo in the bottom left corner of the input,
  37708. using the <code>ffmpeg</code> tool with the <code>-filter_complex</code> option:
  37709. <div class="example">
  37710. <pre class="example">ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
  37711. </pre></div>
  37712. </li><li> Insert 2 different transparent PNG logos (second logo on bottom
  37713. right corner) using the <code>ffmpeg</code> tool:
  37714. <div class="example">
  37715. <pre class="example">ffmpeg -i input -i logo1 -i logo2 -filter_complex 'overlay=x=10:y=H-h-10,overlay=x=W-w-10:y=H-h-10' output
  37716. </pre></div>
  37717. </li><li> Add a transparent color layer on top of the main video; <code>WxH</code>
  37718. must specify the size of the main input to the overlay filter:
  37719. <div class="example">
  37720. <pre class="example">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
  37721. </pre></div>
  37722. </li><li> Play an original video and a filtered version (here with the deshake
  37723. filter) side by side using the <code>ffplay</code> tool:
  37724. <div class="example">
  37725. <pre class="example">ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
  37726. </pre></div>
  37727. <p>The above command is the same as:
  37728. </p><div class="example">
  37729. <pre class="example">ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
  37730. </pre></div>
  37731. </li><li> Make a sliding overlay appearing from the left to the right top part of the
  37732. screen starting since time 2:
  37733. <div class="example">
  37734. <pre class="example">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
  37735. </pre></div>
  37736. </li><li> Compose output by putting two input videos side to side:
  37737. <div class="example">
  37738. <pre class="example">ffmpeg -i left.avi -i right.avi -filter_complex &quot;
  37739. nullsrc=size=200x100 [background];
  37740. [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
  37741. [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
  37742. [background][left] overlay=shortest=1 [background+left];
  37743. [background+left][right] overlay=shortest=1:x=100 [left+right]
  37744. &quot;
  37745. </pre></div>
  37746. </li><li> Mask 10-20 seconds of a video by applying the delogo filter to a section
  37747. <div class="example">
  37748. <pre class="example">ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
  37749. -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]'
  37750. masked.avi
  37751. </pre></div>
  37752. </li><li> Chain several overlays in cascade:
  37753. <div class="example">
  37754. <pre class="example">nullsrc=s=200x200 [bg];
  37755. testsrc=s=100x100, split=4 [in0][in1][in2][in3];
  37756. [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
  37757. [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
  37758. [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
  37759. [in3] null, [mid2] overlay=100:100 [out0]
  37760. </pre></div>
  37761. </li></ul>
  37762. <span id="overlay_005fcuda"></span><a name="overlay_005fcuda-1"></a>
  37763. <h3 class="section">39.159 overlay_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#overlay_005fcuda-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay_005fcuda-1" aria-hidden="true">TOC</a></span></h3>
  37764. <p>Overlay one video on top of another.
  37765. </p>
  37766. <p>This is the CUDA variant of the <a href="#overlay">overlay</a> filter.
  37767. It only accepts CUDA frames. The underlying input pixel formats have to match.
  37768. </p>
  37769. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  37770. video on which the second input is overlaid.
  37771. </p>
  37772. <p>It accepts the following parameters:
  37773. </p>
  37774. <dl compact="compact">
  37775. <dt><samp>x</samp></dt>
  37776. <dt><samp>y</samp></dt>
  37777. <dd><p>Set the x and y coordinates of the overlaid video on the main video.
  37778. Default value is &quot;0&quot; for both expressions.
  37779. </p>
  37780. </dd>
  37781. <dt><samp>eof_action</samp></dt>
  37782. <dd><p>See <a href="#framesync">framesync</a>.
  37783. </p>
  37784. </dd>
  37785. <dt><samp>shortest</samp></dt>
  37786. <dd><p>See <a href="#framesync">framesync</a>.
  37787. </p>
  37788. </dd>
  37789. <dt><samp>repeatlast</samp></dt>
  37790. <dd><p>See <a href="#framesync">framesync</a>.
  37791. </p>
  37792. </dd>
  37793. </dl>
  37794. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  37795. </p>
  37796. <a name="owdenoise"></a>
  37797. <h3 class="section">39.160 owdenoise<span class="pull-right"><a class="anchor hidden-xs" href="#owdenoise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-owdenoise" aria-hidden="true">TOC</a></span></h3>
  37798. <p>Apply Overcomplete Wavelet denoiser.
  37799. </p>
  37800. <p>The filter accepts the following options:
  37801. </p>
  37802. <dl compact="compact">
  37803. <dt><samp>depth</samp></dt>
  37804. <dd><p>Set depth.
  37805. </p>
  37806. <p>Larger depth values will denoise lower frequency components more, but
  37807. slow down filtering.
  37808. </p>
  37809. <p>Must be an int in the range 8-16, default is <code>8</code>.
  37810. </p>
  37811. </dd>
  37812. <dt><samp>luma_strength, ls</samp></dt>
  37813. <dd><p>Set luma strength.
  37814. </p>
  37815. <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
  37816. </p>
  37817. </dd>
  37818. <dt><samp>chroma_strength, cs</samp></dt>
  37819. <dd><p>Set chroma strength.
  37820. </p>
  37821. <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
  37822. </p></dd>
  37823. </dl>
  37824. <span id="pad"></span><a name="pad-1"></a>
  37825. <h3 class="section">39.161 pad<span class="pull-right"><a class="anchor hidden-xs" href="#pad-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pad-1" aria-hidden="true">TOC</a></span></h3>
  37826. <p>Add paddings to the input image, and place the original input at the
  37827. provided <var>x</var>, <var>y</var> coordinates.
  37828. </p>
  37829. <p>It accepts the following parameters:
  37830. </p>
  37831. <dl compact="compact">
  37832. <dt><samp>width, w</samp></dt>
  37833. <dt><samp>height, h</samp></dt>
  37834. <dd><p>Specify an expression for the size of the output image with the
  37835. paddings added. If the value for <var>width</var> or <var>height</var> is 0, the
  37836. corresponding input size is used for the output.
  37837. </p>
  37838. <p>The <var>width</var> expression can reference the value set by the
  37839. <var>height</var> expression, and vice versa.
  37840. </p>
  37841. <p>The default value of <var>width</var> and <var>height</var> is 0.
  37842. </p>
  37843. </dd>
  37844. <dt><samp>x</samp></dt>
  37845. <dt><samp>y</samp></dt>
  37846. <dd><p>Specify the offsets to place the input image at within the padded area,
  37847. with respect to the top/left border of the output image.
  37848. </p>
  37849. <p>The <var>x</var> expression can reference the value set by the <var>y</var>
  37850. expression, and vice versa.
  37851. </p>
  37852. <p>The default value of <var>x</var> and <var>y</var> is 0.
  37853. </p>
  37854. <p>If <var>x</var> or <var>y</var> evaluate to a negative number, they&rsquo;ll be changed
  37855. so the input image is centered on the padded area.
  37856. </p>
  37857. </dd>
  37858. <dt><samp>color</samp></dt>
  37859. <dd><p>Specify the color of the padded area. For the syntax of this option,
  37860. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils
  37861. manual</a>.
  37862. </p>
  37863. <p>The default value of <var>color</var> is &quot;black&quot;.
  37864. </p>
  37865. </dd>
  37866. <dt><samp>eval</samp></dt>
  37867. <dd><p>Specify when to evaluate <var>width</var>, <var>height</var>, <var>x</var> and <var>y</var> expression.
  37868. </p>
  37869. <p>It accepts the following values:
  37870. </p>
  37871. <dl compact="compact">
  37872. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  37873. <dd><p>Only evaluate expressions once during the filter initialization or when
  37874. a command is processed.
  37875. </p>
  37876. </dd>
  37877. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  37878. <dd><p>Evaluate expressions for each incoming frame.
  37879. </p>
  37880. </dd>
  37881. </dl>
  37882. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  37883. </p>
  37884. </dd>
  37885. <dt><samp>aspect</samp></dt>
  37886. <dd><p>Pad to aspect instead to a resolution.
  37887. </p>
  37888. </dd>
  37889. </dl>
  37890. <p>The value for the <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var>
  37891. options are expressions containing the following constants:
  37892. </p>
  37893. <dl compact="compact">
  37894. <dt><samp>in_w</samp></dt>
  37895. <dt><samp>in_h</samp></dt>
  37896. <dd><p>The input video width and height.
  37897. </p>
  37898. </dd>
  37899. <dt><samp>iw</samp></dt>
  37900. <dt><samp>ih</samp></dt>
  37901. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  37902. </p>
  37903. </dd>
  37904. <dt><samp>out_w</samp></dt>
  37905. <dt><samp>out_h</samp></dt>
  37906. <dd><p>The output width and height (the size of the padded area), as
  37907. specified by the <var>width</var> and <var>height</var> expressions.
  37908. </p>
  37909. </dd>
  37910. <dt><samp>ow</samp></dt>
  37911. <dt><samp>oh</samp></dt>
  37912. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
  37913. </p>
  37914. </dd>
  37915. <dt><samp>x</samp></dt>
  37916. <dt><samp>y</samp></dt>
  37917. <dd><p>The x and y offsets as specified by the <var>x</var> and <var>y</var>
  37918. expressions, or NAN if not yet specified.
  37919. </p>
  37920. </dd>
  37921. <dt><samp>a</samp></dt>
  37922. <dd><p>same as <var>iw</var> / <var>ih</var>
  37923. </p>
  37924. </dd>
  37925. <dt><samp>sar</samp></dt>
  37926. <dd><p>input sample aspect ratio
  37927. </p>
  37928. </dd>
  37929. <dt><samp>dar</samp></dt>
  37930. <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
  37931. </p>
  37932. </dd>
  37933. <dt><samp>hsub</samp></dt>
  37934. <dt><samp>vsub</samp></dt>
  37935. <dd><p>The horizontal and vertical chroma subsample values. For example for the
  37936. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  37937. </p></dd>
  37938. </dl>
  37939. <a name="Examples-127"></a>
  37940. <h4 class="subsection">39.161.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-127" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-127" aria-hidden="true">TOC</a></span></h4>
  37941. <ul>
  37942. <li> Add paddings with the color &quot;violet&quot; to the input video. The output video
  37943. size is 640x480, and the top-left corner of the input video is placed at
  37944. column 0, row 40
  37945. <div class="example">
  37946. <pre class="example">pad=640:480:0:40:violet
  37947. </pre></div>
  37948. <p>The example above is equivalent to the following command:
  37949. </p><div class="example">
  37950. <pre class="example">pad=width=640:height=480:x=0:y=40:color=violet
  37951. </pre></div>
  37952. </li><li> Pad the input to get an output with dimensions increased by 3/2,
  37953. and put the input video at the center of the padded area:
  37954. <div class="example">
  37955. <pre class="example">pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
  37956. </pre></div>
  37957. </li><li> Pad the input to get a squared output with size equal to the maximum
  37958. value between the input width and height, and put the input video at
  37959. the center of the padded area:
  37960. <div class="example">
  37961. <pre class="example">pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
  37962. </pre></div>
  37963. </li><li> Pad the input to get a final w/h ratio of 16:9:
  37964. <div class="example">
  37965. <pre class="example">pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
  37966. </pre></div>
  37967. </li><li> In case of anamorphic video, in order to set the output display aspect
  37968. correctly, it is necessary to use <var>sar</var> in the expression,
  37969. according to the relation:
  37970. <div class="example">
  37971. <pre class="example">(ih * X / ih) * sar = output_dar
  37972. X = output_dar / sar
  37973. </pre></div>
  37974. <p>Thus the previous example needs to be modified to:
  37975. </p><div class="example">
  37976. <pre class="example">pad=&quot;ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2&quot;
  37977. </pre></div>
  37978. </li><li> Double the output size and put the input video in the bottom-right
  37979. corner of the output padded area:
  37980. <div class="example">
  37981. <pre class="example">pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
  37982. </pre></div>
  37983. </li></ul>
  37984. <span id="palettegen"></span><a name="palettegen-1"></a>
  37985. <h3 class="section">39.162 palettegen<span class="pull-right"><a class="anchor hidden-xs" href="#palettegen-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-palettegen-1" aria-hidden="true">TOC</a></span></h3>
  37986. <p>Generate one palette for a whole video stream.
  37987. </p>
  37988. <p>It accepts the following options:
  37989. </p>
  37990. <dl compact="compact">
  37991. <dt><samp>max_colors</samp></dt>
  37992. <dd><p>Set the maximum number of colors to quantize in the palette.
  37993. Note: the palette will still contain 256 colors; the unused palette entries
  37994. will be black.
  37995. </p>
  37996. </dd>
  37997. <dt><samp>reserve_transparent</samp></dt>
  37998. <dd><p>Create a palette of 255 colors maximum and reserve the last one for
  37999. transparency. Reserving the transparency color is useful for GIF optimization.
  38000. If not set, the maximum of colors in the palette will be 256. You probably want
  38001. to disable this option for a standalone image.
  38002. Set by default.
  38003. </p>
  38004. </dd>
  38005. <dt><samp>transparency_color</samp></dt>
  38006. <dd><p>Set the color that will be used as background for transparency.
  38007. </p>
  38008. </dd>
  38009. <dt><samp>stats_mode</samp></dt>
  38010. <dd><p>Set statistics mode.
  38011. </p>
  38012. <p>It accepts the following values:
  38013. </p><dl compact="compact">
  38014. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  38015. <dd><p>Compute full frame histograms.
  38016. </p></dd>
  38017. <dt>&lsquo;<samp>diff</samp>&rsquo;</dt>
  38018. <dd><p>Compute histograms only for the part that differs from previous frame. This
  38019. might be relevant to give more importance to the moving part of your input if
  38020. the background is static.
  38021. </p></dd>
  38022. <dt>&lsquo;<samp>single</samp>&rsquo;</dt>
  38023. <dd><p>Compute new histogram for each frame.
  38024. </p></dd>
  38025. </dl>
  38026. <p>Default value is <var>full</var>.
  38027. </p></dd>
  38028. </dl>
  38029. <p>The filter also exports the frame metadata <code>lavfi.color_quant_ratio</code>
  38030. (<code>nb_color_in / nb_color_out</code>) which you can use to evaluate the degree of
  38031. color quantization of the palette. This information is also visible at
  38032. <var>info</var> logging level.
  38033. </p>
  38034. <a name="Examples-128"></a>
  38035. <h4 class="subsection">39.162.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-128" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-128" aria-hidden="true">TOC</a></span></h4>
  38036. <ul>
  38037. <li> Generate a representative palette of a given video using <code>ffmpeg</code>:
  38038. <div class="example">
  38039. <pre class="example">ffmpeg -i input.mkv -vf palettegen palette.png
  38040. </pre></div>
  38041. </li></ul>
  38042. <a name="paletteuse"></a>
  38043. <h3 class="section">39.163 paletteuse<span class="pull-right"><a class="anchor hidden-xs" href="#paletteuse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-paletteuse" aria-hidden="true">TOC</a></span></h3>
  38044. <p>Use a palette to downsample an input video stream.
  38045. </p>
  38046. <p>The filter takes two inputs: one video stream and a palette. The palette must
  38047. be a 256 pixels image.
  38048. </p>
  38049. <p>It accepts the following options:
  38050. </p>
  38051. <dl compact="compact">
  38052. <dt><samp>dither</samp></dt>
  38053. <dd><p>Select dithering mode. Available algorithms are:
  38054. </p><dl compact="compact">
  38055. <dt>&lsquo;<samp>bayer</samp>&rsquo;</dt>
  38056. <dd><p>Ordered 8x8 bayer dithering (deterministic)
  38057. </p></dd>
  38058. <dt>&lsquo;<samp>heckbert</samp>&rsquo;</dt>
  38059. <dd><p>Dithering as defined by Paul Heckbert in 1982 (simple error diffusion).
  38060. Note: this dithering is sometimes considered &quot;wrong&quot; and is included as a
  38061. reference.
  38062. </p></dd>
  38063. <dt>&lsquo;<samp>floyd_steinberg</samp>&rsquo;</dt>
  38064. <dd><p>Floyd and Steingberg dithering (error diffusion)
  38065. </p></dd>
  38066. <dt>&lsquo;<samp>sierra2</samp>&rsquo;</dt>
  38067. <dd><p>Frankie Sierra dithering v2 (error diffusion)
  38068. </p></dd>
  38069. <dt>&lsquo;<samp>sierra2_4a</samp>&rsquo;</dt>
  38070. <dd><p>Frankie Sierra dithering v2 &quot;Lite&quot; (error diffusion)
  38071. </p></dd>
  38072. </dl>
  38073. <p>Default is <var>sierra2_4a</var>.
  38074. </p>
  38075. </dd>
  38076. <dt><samp>bayer_scale</samp></dt>
  38077. <dd><p>When <var>bayer</var> dithering is selected, this option defines the scale of the
  38078. pattern (how much the crosshatch pattern is visible). A low value means more
  38079. visible pattern for less banding, and higher value means less visible pattern
  38080. at the cost of more banding.
  38081. </p>
  38082. <p>The option must be an integer value in the range [0,5]. Default is <var>2</var>.
  38083. </p>
  38084. </dd>
  38085. <dt><samp>diff_mode</samp></dt>
  38086. <dd><p>If set, define the zone to process
  38087. </p>
  38088. <dl compact="compact">
  38089. <dt>&lsquo;<samp>rectangle</samp>&rsquo;</dt>
  38090. <dd><p>Only the changing rectangle will be reprocessed. This is similar to GIF
  38091. cropping/offsetting compression mechanism. This option can be useful for speed
  38092. if only a part of the image is changing, and has use cases such as limiting the
  38093. scope of the error diffusal <samp>dither</samp> to the rectangle that bounds the
  38094. moving scene (it leads to more deterministic output if the scene doesn&rsquo;t change
  38095. much, and as a result less moving noise and better GIF compression).
  38096. </p></dd>
  38097. </dl>
  38098. <p>Default is <var>none</var>.
  38099. </p>
  38100. </dd>
  38101. <dt><samp>new</samp></dt>
  38102. <dd><p>Take new palette for each output frame.
  38103. </p>
  38104. </dd>
  38105. <dt><samp>alpha_threshold</samp></dt>
  38106. <dd><p>Sets the alpha threshold for transparency. Alpha values above this threshold
  38107. will be treated as completely opaque, and values below this threshold will be
  38108. treated as completely transparent.
  38109. </p>
  38110. <p>The option must be an integer value in the range [0,255]. Default is <var>128</var>.
  38111. </p></dd>
  38112. </dl>
  38113. <a name="Examples-129"></a>
  38114. <h4 class="subsection">39.163.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-129" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-129" aria-hidden="true">TOC</a></span></h4>
  38115. <ul>
  38116. <li> Use a palette (generated for example with <a href="#palettegen">palettegen</a>) to encode a GIF
  38117. using <code>ffmpeg</code>:
  38118. <div class="example">
  38119. <pre class="example">ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
  38120. </pre></div>
  38121. </li></ul>
  38122. <a name="perspective"></a>
  38123. <h3 class="section">39.164 perspective<span class="pull-right"><a class="anchor hidden-xs" href="#perspective" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-perspective" aria-hidden="true">TOC</a></span></h3>
  38124. <p>Correct perspective of video not recorded perpendicular to the screen.
  38125. </p>
  38126. <p>A description of the accepted parameters follows.
  38127. </p>
  38128. <dl compact="compact">
  38129. <dt><samp>x0</samp></dt>
  38130. <dt><samp>y0</samp></dt>
  38131. <dt><samp>x1</samp></dt>
  38132. <dt><samp>y1</samp></dt>
  38133. <dt><samp>x2</samp></dt>
  38134. <dt><samp>y2</samp></dt>
  38135. <dt><samp>x3</samp></dt>
  38136. <dt><samp>y3</samp></dt>
  38137. <dd><p>Set coordinates expression for top left, top right, bottom left and bottom right corners.
  38138. Default values are <code>0:0:W:0:0:H:W:H</code> with which perspective will remain unchanged.
  38139. If the <code>sense</code> option is set to <code>source</code>, then the specified points will be sent
  38140. to the corners of the destination. If the <code>sense</code> option is set to <code>destination</code>,
  38141. then the corners of the source will be sent to the specified coordinates.
  38142. </p>
  38143. <p>The expressions can use the following variables:
  38144. </p>
  38145. <dl compact="compact">
  38146. <dt><samp>W</samp></dt>
  38147. <dt><samp>H</samp></dt>
  38148. <dd><p>the width and height of video frame.
  38149. </p></dd>
  38150. <dt><samp>in</samp></dt>
  38151. <dd><p>Input frame count.
  38152. </p></dd>
  38153. <dt><samp>on</samp></dt>
  38154. <dd><p>Output frame count.
  38155. </p></dd>
  38156. </dl>
  38157. </dd>
  38158. <dt><samp>interpolation</samp></dt>
  38159. <dd><p>Set interpolation for perspective correction.
  38160. </p>
  38161. <p>It accepts the following values:
  38162. </p><dl compact="compact">
  38163. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  38164. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  38165. </dl>
  38166. <p>Default value is &lsquo;<samp>linear</samp>&rsquo;.
  38167. </p>
  38168. </dd>
  38169. <dt><samp>sense</samp></dt>
  38170. <dd><p>Set interpretation of coordinate options.
  38171. </p>
  38172. <p>It accepts the following values:
  38173. </p><dl compact="compact">
  38174. <dt>&lsquo;<samp>0, source</samp>&rsquo;</dt>
  38175. <dd>
  38176. <p>Send point in the source specified by the given coordinates to
  38177. the corners of the destination.
  38178. </p>
  38179. </dd>
  38180. <dt>&lsquo;<samp>1, destination</samp>&rsquo;</dt>
  38181. <dd>
  38182. <p>Send the corners of the source to the point in the destination specified
  38183. by the given coordinates.
  38184. </p>
  38185. <p>Default value is &lsquo;<samp>source</samp>&rsquo;.
  38186. </p></dd>
  38187. </dl>
  38188. </dd>
  38189. <dt><samp>eval</samp></dt>
  38190. <dd><p>Set when the expressions for coordinates <samp>x0,y0,...x3,y3</samp> are evaluated.
  38191. </p>
  38192. <p>It accepts the following values:
  38193. </p><dl compact="compact">
  38194. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  38195. <dd><p>only evaluate expressions once during the filter initialization or
  38196. when a command is processed
  38197. </p>
  38198. </dd>
  38199. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  38200. <dd><p>evaluate expressions for each incoming frame
  38201. </p></dd>
  38202. </dl>
  38203. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  38204. </p></dd>
  38205. </dl>
  38206. <a name="phase"></a>
  38207. <h3 class="section">39.165 phase<span class="pull-right"><a class="anchor hidden-xs" href="#phase" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-phase" aria-hidden="true">TOC</a></span></h3>
  38208. <p>Delay interlaced video by one field time so that the field order changes.
  38209. </p>
  38210. <p>The intended use is to fix PAL movies that have been captured with the
  38211. opposite field order to the film-to-video transfer.
  38212. </p>
  38213. <p>A description of the accepted parameters follows.
  38214. </p>
  38215. <dl compact="compact">
  38216. <dt><samp>mode</samp></dt>
  38217. <dd><p>Set phase mode.
  38218. </p>
  38219. <p>It accepts the following values:
  38220. </p><dl compact="compact">
  38221. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  38222. <dd><p>Capture field order top-first, transfer bottom-first.
  38223. Filter will delay the bottom field.
  38224. </p>
  38225. </dd>
  38226. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  38227. <dd><p>Capture field order bottom-first, transfer top-first.
  38228. Filter will delay the top field.
  38229. </p>
  38230. </dd>
  38231. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  38232. <dd><p>Capture and transfer with the same field order. This mode only exists
  38233. for the documentation of the other options to refer to, but if you
  38234. actually select it, the filter will faithfully do nothing.
  38235. </p>
  38236. </dd>
  38237. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  38238. <dd><p>Capture field order determined automatically by field flags, transfer
  38239. opposite.
  38240. Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; modes on a frame by frame
  38241. basis using field flags. If no field information is available,
  38242. then this works just like &lsquo;<samp>u</samp>&rsquo;.
  38243. </p>
  38244. </dd>
  38245. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  38246. <dd><p>Capture unknown or varying, transfer opposite.
  38247. Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; on a frame by frame basis by
  38248. analyzing the images and selecting the alternative that produces best
  38249. match between the fields.
  38250. </p>
  38251. </dd>
  38252. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  38253. <dd><p>Capture top-first, transfer unknown or varying.
  38254. Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
  38255. </p>
  38256. </dd>
  38257. <dt>&lsquo;<samp>B</samp>&rsquo;</dt>
  38258. <dd><p>Capture bottom-first, transfer unknown or varying.
  38259. Filter selects among &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
  38260. </p>
  38261. </dd>
  38262. <dt>&lsquo;<samp>A</samp>&rsquo;</dt>
  38263. <dd><p>Capture determined by field flags, transfer unknown or varying.
  38264. Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using field flags and
  38265. image analysis. If no field information is available, then this works just
  38266. like &lsquo;<samp>U</samp>&rsquo;. This is the default mode.
  38267. </p>
  38268. </dd>
  38269. <dt>&lsquo;<samp>U</samp>&rsquo;</dt>
  38270. <dd><p>Both capture and transfer unknown or varying.
  38271. Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis only.
  38272. </p></dd>
  38273. </dl>
  38274. </dd>
  38275. </dl>
  38276. <a name="Commands-111"></a>
  38277. <h4 class="subsection">39.165.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-111" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-111" aria-hidden="true">TOC</a></span></h4>
  38278. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  38279. </p>
  38280. <a name="photosensitivity"></a>
  38281. <h3 class="section">39.166 photosensitivity<span class="pull-right"><a class="anchor hidden-xs" href="#photosensitivity" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-photosensitivity" aria-hidden="true">TOC</a></span></h3>
  38282. <p>Reduce various flashes in video, so to help users with epilepsy.
  38283. </p>
  38284. <p>It accepts the following options:
  38285. </p><dl compact="compact">
  38286. <dt><samp>frames, f</samp></dt>
  38287. <dd><p>Set how many frames to use when filtering. Default is 30.
  38288. </p>
  38289. </dd>
  38290. <dt><samp>threshold, t</samp></dt>
  38291. <dd><p>Set detection threshold factor. Default is 1.
  38292. Lower is stricter.
  38293. </p>
  38294. </dd>
  38295. <dt><samp>skip</samp></dt>
  38296. <dd><p>Set how many pixels to skip when sampling frames. Default is 1.
  38297. Allowed range is from 1 to 1024.
  38298. </p>
  38299. </dd>
  38300. <dt><samp>bypass</samp></dt>
  38301. <dd><p>Leave frames unchanged. Default is disabled.
  38302. </p></dd>
  38303. </dl>
  38304. <a name="pixdesctest"></a>
  38305. <h3 class="section">39.167 pixdesctest<span class="pull-right"><a class="anchor hidden-xs" href="#pixdesctest" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pixdesctest" aria-hidden="true">TOC</a></span></h3>
  38306. <p>Pixel format descriptor test filter, mainly useful for internal
  38307. testing. The output video should be equal to the input video.
  38308. </p>
  38309. <p>For example:
  38310. </p><div class="example">
  38311. <pre class="example">format=monow, pixdesctest
  38312. </pre></div>
  38313. <p>can be used to test the monowhite pixel format descriptor definition.
  38314. </p>
  38315. <a name="pixscope"></a>
  38316. <h3 class="section">39.168 pixscope<span class="pull-right"><a class="anchor hidden-xs" href="#pixscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pixscope" aria-hidden="true">TOC</a></span></h3>
  38317. <p>Display sample values of color channels. Mainly useful for checking color
  38318. and levels. Minimum supported resolution is 640x480.
  38319. </p>
  38320. <p>The filters accept the following options:
  38321. </p>
  38322. <dl compact="compact">
  38323. <dt><samp>x</samp></dt>
  38324. <dd><p>Set scope X position, relative offset on X axis.
  38325. </p>
  38326. </dd>
  38327. <dt><samp>y</samp></dt>
  38328. <dd><p>Set scope Y position, relative offset on Y axis.
  38329. </p>
  38330. </dd>
  38331. <dt><samp>w</samp></dt>
  38332. <dd><p>Set scope width.
  38333. </p>
  38334. </dd>
  38335. <dt><samp>h</samp></dt>
  38336. <dd><p>Set scope height.
  38337. </p>
  38338. </dd>
  38339. <dt><samp>o</samp></dt>
  38340. <dd><p>Set window opacity. This window also holds statistics about pixel area.
  38341. </p>
  38342. </dd>
  38343. <dt><samp>wx</samp></dt>
  38344. <dd><p>Set window X position, relative offset on X axis.
  38345. </p>
  38346. </dd>
  38347. <dt><samp>wy</samp></dt>
  38348. <dd><p>Set window Y position, relative offset on Y axis.
  38349. </p></dd>
  38350. </dl>
  38351. <a name="Commands-112"></a>
  38352. <h4 class="subsection">39.168.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-112" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-112" aria-hidden="true">TOC</a></span></h4>
  38353. <p>This filter supports same <a href="#commands">commands</a> as options.
  38354. </p>
  38355. <a name="pp"></a>
  38356. <h3 class="section">39.169 pp<span class="pull-right"><a class="anchor hidden-xs" href="#pp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pp" aria-hidden="true">TOC</a></span></h3>
  38357. <p>Enable the specified chain of postprocessing subfilters using libpostproc. This
  38358. library should be automatically selected with a GPL build (<code>--enable-gpl</code>).
  38359. Subfilters must be separated by &rsquo;/&rsquo; and can be disabled by prepending a &rsquo;-&rsquo;.
  38360. Each subfilter and some options have a short and a long name that can be used
  38361. interchangeably, i.e. dr/dering are the same.
  38362. </p>
  38363. <p>The filters accept the following options:
  38364. </p>
  38365. <dl compact="compact">
  38366. <dt><samp>subfilters</samp></dt>
  38367. <dd><p>Set postprocessing subfilters string.
  38368. </p></dd>
  38369. </dl>
  38370. <p>All subfilters share common options to determine their scope:
  38371. </p>
  38372. <dl compact="compact">
  38373. <dt><samp>a/autoq</samp></dt>
  38374. <dd><p>Honor the quality commands for this subfilter.
  38375. </p>
  38376. </dd>
  38377. <dt><samp>c/chrom</samp></dt>
  38378. <dd><p>Do chrominance filtering, too (default).
  38379. </p>
  38380. </dd>
  38381. <dt><samp>y/nochrom</samp></dt>
  38382. <dd><p>Do luminance filtering only (no chrominance).
  38383. </p>
  38384. </dd>
  38385. <dt><samp>n/noluma</samp></dt>
  38386. <dd><p>Do chrominance filtering only (no luminance).
  38387. </p></dd>
  38388. </dl>
  38389. <p>These options can be appended after the subfilter name, separated by a &rsquo;|&rsquo;.
  38390. </p>
  38391. <p>Available subfilters are:
  38392. </p>
  38393. <dl compact="compact">
  38394. <dt><samp>hb/hdeblock[|difference[|flatness]]</samp></dt>
  38395. <dd><p>Horizontal deblocking filter
  38396. </p><dl compact="compact">
  38397. <dt><samp>difference</samp></dt>
  38398. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  38399. </p></dd>
  38400. <dt><samp>flatness</samp></dt>
  38401. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  38402. </p></dd>
  38403. </dl>
  38404. </dd>
  38405. <dt><samp>vb/vdeblock[|difference[|flatness]]</samp></dt>
  38406. <dd><p>Vertical deblocking filter
  38407. </p><dl compact="compact">
  38408. <dt><samp>difference</samp></dt>
  38409. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  38410. </p></dd>
  38411. <dt><samp>flatness</samp></dt>
  38412. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  38413. </p></dd>
  38414. </dl>
  38415. </dd>
  38416. <dt><samp>ha/hadeblock[|difference[|flatness]]</samp></dt>
  38417. <dd><p>Accurate horizontal deblocking filter
  38418. </p><dl compact="compact">
  38419. <dt><samp>difference</samp></dt>
  38420. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  38421. </p></dd>
  38422. <dt><samp>flatness</samp></dt>
  38423. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  38424. </p></dd>
  38425. </dl>
  38426. </dd>
  38427. <dt><samp>va/vadeblock[|difference[|flatness]]</samp></dt>
  38428. <dd><p>Accurate vertical deblocking filter
  38429. </p><dl compact="compact">
  38430. <dt><samp>difference</samp></dt>
  38431. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  38432. </p></dd>
  38433. <dt><samp>flatness</samp></dt>
  38434. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  38435. </p></dd>
  38436. </dl>
  38437. </dd>
  38438. </dl>
  38439. <p>The horizontal and vertical deblocking filters share the difference and
  38440. flatness values so you cannot set different horizontal and vertical
  38441. thresholds.
  38442. </p>
  38443. <dl compact="compact">
  38444. <dt><samp>h1/x1hdeblock</samp></dt>
  38445. <dd><p>Experimental horizontal deblocking filter
  38446. </p>
  38447. </dd>
  38448. <dt><samp>v1/x1vdeblock</samp></dt>
  38449. <dd><p>Experimental vertical deblocking filter
  38450. </p>
  38451. </dd>
  38452. <dt><samp>dr/dering</samp></dt>
  38453. <dd><p>Deringing filter
  38454. </p>
  38455. </dd>
  38456. <dt><samp>tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer</samp></dt>
  38457. <dd><dl compact="compact">
  38458. <dt><samp>threshold1</samp></dt>
  38459. <dd><p>larger -&gt; stronger filtering
  38460. </p></dd>
  38461. <dt><samp>threshold2</samp></dt>
  38462. <dd><p>larger -&gt; stronger filtering
  38463. </p></dd>
  38464. <dt><samp>threshold3</samp></dt>
  38465. <dd><p>larger -&gt; stronger filtering
  38466. </p></dd>
  38467. </dl>
  38468. </dd>
  38469. <dt><samp>al/autolevels[:f/fullyrange], automatic brightness / contrast correction</samp></dt>
  38470. <dd><dl compact="compact">
  38471. <dt><samp>f/fullyrange</samp></dt>
  38472. <dd><p>Stretch luminance to <code>0-255</code>.
  38473. </p></dd>
  38474. </dl>
  38475. </dd>
  38476. <dt><samp>lb/linblenddeint</samp></dt>
  38477. <dd><p>Linear blend deinterlacing filter that deinterlaces the given block by
  38478. filtering all lines with a <code>(1 2 1)</code> filter.
  38479. </p>
  38480. </dd>
  38481. <dt><samp>li/linipoldeint</samp></dt>
  38482. <dd><p>Linear interpolating deinterlacing filter that deinterlaces the given block by
  38483. linearly interpolating every second line.
  38484. </p>
  38485. </dd>
  38486. <dt><samp>ci/cubicipoldeint</samp></dt>
  38487. <dd><p>Cubic interpolating deinterlacing filter deinterlaces the given block by
  38488. cubically interpolating every second line.
  38489. </p>
  38490. </dd>
  38491. <dt><samp>md/mediandeint</samp></dt>
  38492. <dd><p>Median deinterlacing filter that deinterlaces the given block by applying a
  38493. median filter to every second line.
  38494. </p>
  38495. </dd>
  38496. <dt><samp>fd/ffmpegdeint</samp></dt>
  38497. <dd><p>FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
  38498. second line with a <code>(-1 4 2 4 -1)</code> filter.
  38499. </p>
  38500. </dd>
  38501. <dt><samp>l5/lowpass5</samp></dt>
  38502. <dd><p>Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
  38503. block by filtering all lines with a <code>(-1 2 6 2 -1)</code> filter.
  38504. </p>
  38505. </dd>
  38506. <dt><samp>fq/forceQuant[|quantizer]</samp></dt>
  38507. <dd><p>Overrides the quantizer table from the input with the constant quantizer you
  38508. specify.
  38509. </p><dl compact="compact">
  38510. <dt><samp>quantizer</samp></dt>
  38511. <dd><p>Quantizer to use
  38512. </p></dd>
  38513. </dl>
  38514. </dd>
  38515. <dt><samp>de/default</samp></dt>
  38516. <dd><p>Default pp filter combination (<code>hb|a,vb|a,dr|a</code>)
  38517. </p>
  38518. </dd>
  38519. <dt><samp>fa/fast</samp></dt>
  38520. <dd><p>Fast pp filter combination (<code>h1|a,v1|a,dr|a</code>)
  38521. </p>
  38522. </dd>
  38523. <dt><samp>ac</samp></dt>
  38524. <dd><p>High quality pp filter combination (<code>ha|a|128|7,va|a,dr|a</code>)
  38525. </p></dd>
  38526. </dl>
  38527. <a name="Examples-130"></a>
  38528. <h4 class="subsection">39.169.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-130" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-130" aria-hidden="true">TOC</a></span></h4>
  38529. <ul>
  38530. <li> Apply horizontal and vertical deblocking, deringing and automatic
  38531. brightness/contrast:
  38532. <div class="example">
  38533. <pre class="example">pp=hb/vb/dr/al
  38534. </pre></div>
  38535. </li><li> Apply default filters without brightness/contrast correction:
  38536. <div class="example">
  38537. <pre class="example">pp=de/-al
  38538. </pre></div>
  38539. </li><li> Apply default filters and temporal denoiser:
  38540. <div class="example">
  38541. <pre class="example">pp=default/tmpnoise|1|2|3
  38542. </pre></div>
  38543. </li><li> Apply deblocking on luminance only, and switch vertical deblocking on or off
  38544. automatically depending on available CPU time:
  38545. <div class="example">
  38546. <pre class="example">pp=hb|y/vb|a
  38547. </pre></div>
  38548. </li></ul>
  38549. <a name="pp7"></a>
  38550. <h3 class="section">39.170 pp7<span class="pull-right"><a class="anchor hidden-xs" href="#pp7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pp7" aria-hidden="true">TOC</a></span></h3>
  38551. <p>Apply Postprocessing filter 7. It is variant of the <a href="#spp">spp</a> filter,
  38552. similar to spp = 6 with 7 point DCT, where only the center sample is
  38553. used after IDCT.
  38554. </p>
  38555. <p>The filter accepts the following options:
  38556. </p>
  38557. <dl compact="compact">
  38558. <dt><samp>qp</samp></dt>
  38559. <dd><p>Force a constant quantization parameter. It accepts an integer in range
  38560. 0 to 63. If not set, the filter will use the QP from the video stream
  38561. (if available).
  38562. </p>
  38563. </dd>
  38564. <dt><samp>mode</samp></dt>
  38565. <dd><p>Set thresholding mode. Available modes are:
  38566. </p>
  38567. <dl compact="compact">
  38568. <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
  38569. <dd><p>Set hard thresholding.
  38570. </p></dd>
  38571. <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
  38572. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  38573. </p></dd>
  38574. <dt>&lsquo;<samp>medium</samp>&rsquo;</dt>
  38575. <dd><p>Set medium thresholding (good results, default).
  38576. </p></dd>
  38577. </dl>
  38578. </dd>
  38579. </dl>
  38580. <a name="premultiply"></a>
  38581. <h3 class="section">39.171 premultiply<span class="pull-right"><a class="anchor hidden-xs" href="#premultiply" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-premultiply" aria-hidden="true">TOC</a></span></h3>
  38582. <p>Apply alpha premultiply effect to input video stream using first plane
  38583. of second stream as alpha.
  38584. </p>
  38585. <p>Both streams must have same dimensions and same pixel format.
  38586. </p>
  38587. <p>The filter accepts the following option:
  38588. </p>
  38589. <dl compact="compact">
  38590. <dt><samp>planes</samp></dt>
  38591. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  38592. By default value 0xf, all planes will be processed.
  38593. </p>
  38594. </dd>
  38595. <dt><samp>inplace</samp></dt>
  38596. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  38597. </p></dd>
  38598. </dl>
  38599. <a name="prewitt"></a>
  38600. <h3 class="section">39.172 prewitt<span class="pull-right"><a class="anchor hidden-xs" href="#prewitt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prewitt" aria-hidden="true">TOC</a></span></h3>
  38601. <p>Apply prewitt operator to input video stream.
  38602. </p>
  38603. <p>The filter accepts the following option:
  38604. </p>
  38605. <dl compact="compact">
  38606. <dt><samp>planes</samp></dt>
  38607. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  38608. By default value 0xf, all planes will be processed.
  38609. </p>
  38610. </dd>
  38611. <dt><samp>scale</samp></dt>
  38612. <dd><p>Set value which will be multiplied with filtered result.
  38613. </p>
  38614. </dd>
  38615. <dt><samp>delta</samp></dt>
  38616. <dd><p>Set value which will be added to filtered result.
  38617. </p></dd>
  38618. </dl>
  38619. <a name="Commands-113"></a>
  38620. <h4 class="subsection">39.172.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-113" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-113" aria-hidden="true">TOC</a></span></h4>
  38621. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  38622. </p>
  38623. <a name="pseudocolor"></a>
  38624. <h3 class="section">39.173 pseudocolor<span class="pull-right"><a class="anchor hidden-xs" href="#pseudocolor" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pseudocolor" aria-hidden="true">TOC</a></span></h3>
  38625. <p>Alter frame colors in video with pseudocolors.
  38626. </p>
  38627. <p>This filter accepts the following options:
  38628. </p>
  38629. <dl compact="compact">
  38630. <dt><samp>c0</samp></dt>
  38631. <dd><p>set pixel first component expression
  38632. </p>
  38633. </dd>
  38634. <dt><samp>c1</samp></dt>
  38635. <dd><p>set pixel second component expression
  38636. </p>
  38637. </dd>
  38638. <dt><samp>c2</samp></dt>
  38639. <dd><p>set pixel third component expression
  38640. </p>
  38641. </dd>
  38642. <dt><samp>c3</samp></dt>
  38643. <dd><p>set pixel fourth component expression, corresponds to the alpha component
  38644. </p>
  38645. </dd>
  38646. <dt><samp>index, i</samp></dt>
  38647. <dd><p>set component to use as base for altering colors
  38648. </p>
  38649. </dd>
  38650. <dt><samp>preset, p</samp></dt>
  38651. <dd><p>Pick one of built-in LUTs. By default is set to none.
  38652. </p>
  38653. <p>Available LUTs:
  38654. </p><dl compact="compact">
  38655. <dt>&lsquo;<samp>magma</samp>&rsquo;</dt>
  38656. <dt>&lsquo;<samp>inferno</samp>&rsquo;</dt>
  38657. <dt>&lsquo;<samp>plasma</samp>&rsquo;</dt>
  38658. <dt>&lsquo;<samp>viridis</samp>&rsquo;</dt>
  38659. <dt>&lsquo;<samp>turbo</samp>&rsquo;</dt>
  38660. <dt>&lsquo;<samp>cividis</samp>&rsquo;</dt>
  38661. <dt>&lsquo;<samp>range1</samp>&rsquo;</dt>
  38662. <dt>&lsquo;<samp>range2</samp>&rsquo;</dt>
  38663. <dt>&lsquo;<samp>shadows</samp>&rsquo;</dt>
  38664. <dt>&lsquo;<samp>highlights</samp>&rsquo;</dt>
  38665. </dl>
  38666. </dd>
  38667. <dt><samp>opacity</samp></dt>
  38668. <dd><p>Set opacity of output colors. Allowed range is from 0 to 1.
  38669. Default value is set to 1.
  38670. </p></dd>
  38671. </dl>
  38672. <p>Each of the expression options specifies the expression to use for computing
  38673. the lookup table for the corresponding pixel component values.
  38674. </p>
  38675. <p>The expressions can contain the following constants and functions:
  38676. </p>
  38677. <dl compact="compact">
  38678. <dt><samp>w</samp></dt>
  38679. <dt><samp>h</samp></dt>
  38680. <dd><p>The input width and height.
  38681. </p>
  38682. </dd>
  38683. <dt><samp>val</samp></dt>
  38684. <dd><p>The input value for the pixel component.
  38685. </p>
  38686. </dd>
  38687. <dt><samp>ymin, umin, vmin, amin</samp></dt>
  38688. <dd><p>The minimum allowed component value.
  38689. </p>
  38690. </dd>
  38691. <dt><samp>ymax, umax, vmax, amax</samp></dt>
  38692. <dd><p>The maximum allowed component value.
  38693. </p></dd>
  38694. </dl>
  38695. <p>All expressions default to &quot;val&quot;.
  38696. </p>
  38697. <a name="Commands-114"></a>
  38698. <h4 class="subsection">39.173.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-114" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-114" aria-hidden="true">TOC</a></span></h4>
  38699. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  38700. </p>
  38701. <a name="Examples-131"></a>
  38702. <h4 class="subsection">39.173.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-131" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-131" aria-hidden="true">TOC</a></span></h4>
  38703. <ul>
  38704. <li> Change too high luma values to gradient:
  38705. <div class="example">
  38706. <pre class="example">pseudocolor=&quot;'if(between(val,ymax,amax),lerp(ymin,ymax,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(umax,umin,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(vmin,vmax,(val-ymax)/(amax-ymax)),-1):-1'&quot;
  38707. </pre></div>
  38708. </li></ul>
  38709. <a name="psnr"></a>
  38710. <h3 class="section">39.174 psnr<span class="pull-right"><a class="anchor hidden-xs" href="#psnr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-psnr" aria-hidden="true">TOC</a></span></h3>
  38711. <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
  38712. Ratio) between two input videos.
  38713. </p>
  38714. <p>This filter takes in input two input videos, the first input is
  38715. considered the &quot;main&quot; source and is passed unchanged to the
  38716. output. The second input is used as a &quot;reference&quot; video for computing
  38717. the PSNR.
  38718. </p>
  38719. <p>Both video inputs must have the same resolution and pixel format for
  38720. this filter to work correctly. Also it assumes that both inputs
  38721. have the same number of frames, which are compared one by one.
  38722. </p>
  38723. <p>The obtained average PSNR is printed through the logging system.
  38724. </p>
  38725. <p>The filter stores the accumulated MSE (mean squared error) of each
  38726. frame, and at the end of the processing it is averaged across all frames
  38727. equally, and the following formula is applied to obtain the PSNR:
  38728. </p>
  38729. <div class="example">
  38730. <pre class="example">PSNR = 10*log10(MAX^2/MSE)
  38731. </pre></div>
  38732. <p>Where MAX is the average of the maximum values of each component of the
  38733. image.
  38734. </p>
  38735. <p>The description of the accepted parameters follows.
  38736. </p>
  38737. <dl compact="compact">
  38738. <dt><samp>stats_file, f</samp></dt>
  38739. <dd><p>If specified the filter will use the named file to save the PSNR of
  38740. each individual frame. When filename equals &quot;-&quot; the data is sent to
  38741. standard output.
  38742. </p>
  38743. </dd>
  38744. <dt><samp>stats_version</samp></dt>
  38745. <dd><p>Specifies which version of the stats file format to use. Details of
  38746. each format are written below.
  38747. Default value is 1.
  38748. </p>
  38749. </dd>
  38750. <dt><samp>stats_add_max</samp></dt>
  38751. <dd><p>Determines whether the max value is output to the stats log.
  38752. Default value is 0.
  38753. Requires stats_version &gt;= 2. If this is set and stats_version &lt; 2,
  38754. the filter will return an error.
  38755. </p></dd>
  38756. </dl>
  38757. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  38758. </p>
  38759. <p>The file printed if <var>stats_file</var> is selected, contains a sequence of
  38760. key/value pairs of the form <var>key</var>:<var>value</var> for each compared
  38761. couple of frames.
  38762. </p>
  38763. <p>If a <var>stats_version</var> greater than 1 is specified, a header line precedes
  38764. the list of per-frame-pair stats, with key value pairs following the frame
  38765. format with the following parameters:
  38766. </p>
  38767. <dl compact="compact">
  38768. <dt><samp>psnr_log_version</samp></dt>
  38769. <dd><p>The version of the log file format. Will match <var>stats_version</var>.
  38770. </p>
  38771. </dd>
  38772. <dt><samp>fields</samp></dt>
  38773. <dd><p>A comma separated list of the per-frame-pair parameters included in
  38774. the log.
  38775. </p></dd>
  38776. </dl>
  38777. <p>A description of each shown per-frame-pair parameter follows:
  38778. </p>
  38779. <dl compact="compact">
  38780. <dt><samp>n</samp></dt>
  38781. <dd><p>sequential number of the input frame, starting from 1
  38782. </p>
  38783. </dd>
  38784. <dt><samp>mse_avg</samp></dt>
  38785. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  38786. frames, averaged over all the image components.
  38787. </p>
  38788. </dd>
  38789. <dt><samp>mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a</samp></dt>
  38790. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  38791. frames for the component specified by the suffix.
  38792. </p>
  38793. </dd>
  38794. <dt><samp>psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp></dt>
  38795. <dd><p>Peak Signal to Noise ratio of the compared frames for the component
  38796. specified by the suffix.
  38797. </p>
  38798. </dd>
  38799. <dt><samp>max_avg, max_y, max_u, max_v</samp></dt>
  38800. <dd><p>Maximum allowed value for each channel, and average over all
  38801. channels.
  38802. </p></dd>
  38803. </dl>
  38804. <a name="Examples-132"></a>
  38805. <h4 class="subsection">39.174.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-132" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-132" aria-hidden="true">TOC</a></span></h4>
  38806. <ul>
  38807. <li> For example:
  38808. <div class="example">
  38809. <pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  38810. [main][ref] psnr=&quot;stats_file=stats.log&quot; [out]
  38811. </pre></div>
  38812. <p>On this example the input file being processed is compared with the
  38813. reference file <samp>ref_movie.mpg</samp>. The PSNR of each individual frame
  38814. is stored in <samp>stats.log</samp>.
  38815. </p>
  38816. </li><li> Another example with different containers:
  38817. <div class="example">
  38818. <pre class="example">ffmpeg -i main.mpg -i ref.mkv -lavfi &quot;[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]psnr&quot; -f null -
  38819. </pre></div>
  38820. </li></ul>
  38821. <span id="pullup"></span><a name="pullup-1"></a>
  38822. <h3 class="section">39.175 pullup<span class="pull-right"><a class="anchor hidden-xs" href="#pullup-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pullup-1" aria-hidden="true">TOC</a></span></h3>
  38823. <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
  38824. hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
  38825. content.
  38826. </p>
  38827. <p>The pullup filter is designed to take advantage of future context in making
  38828. its decisions. This filter is stateless in the sense that it does not lock
  38829. onto a pattern to follow, but it instead looks forward to the following
  38830. fields in order to identify matches and rebuild progressive frames.
  38831. </p>
  38832. <p>To produce content with an even framerate, insert the fps filter after
  38833. pullup, use <code>fps=24000/1001</code> if the input frame rate is 29.97fps,
  38834. <code>fps=24</code> for 30fps and the (rare) telecined 25fps input.
  38835. </p>
  38836. <p>The filter accepts the following options:
  38837. </p>
  38838. <dl compact="compact">
  38839. <dt><samp>jl</samp></dt>
  38840. <dt><samp>jr</samp></dt>
  38841. <dt><samp>jt</samp></dt>
  38842. <dt><samp>jb</samp></dt>
  38843. <dd><p>These options set the amount of &quot;junk&quot; to ignore at the left, right, top, and
  38844. bottom of the image, respectively. Left and right are in units of 8 pixels,
  38845. while top and bottom are in units of 2 lines.
  38846. The default is 8 pixels on each side.
  38847. </p>
  38848. </dd>
  38849. <dt><samp>sb</samp></dt>
  38850. <dd><p>Set the strict breaks. Setting this option to 1 will reduce the chances of
  38851. filter generating an occasional mismatched frame, but it may also cause an
  38852. excessive number of frames to be dropped during high motion sequences.
  38853. Conversely, setting it to -1 will make filter match fields more easily.
  38854. This may help processing of video where there is slight blurring between
  38855. the fields, but may also cause there to be interlaced frames in the output.
  38856. Default value is <code>0</code>.
  38857. </p>
  38858. </dd>
  38859. <dt><samp>mp</samp></dt>
  38860. <dd><p>Set the metric plane to use. It accepts the following values:
  38861. </p><dl compact="compact">
  38862. <dt>&lsquo;<samp>l</samp>&rsquo;</dt>
  38863. <dd><p>Use luma plane.
  38864. </p>
  38865. </dd>
  38866. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  38867. <dd><p>Use chroma blue plane.
  38868. </p>
  38869. </dd>
  38870. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  38871. <dd><p>Use chroma red plane.
  38872. </p></dd>
  38873. </dl>
  38874. <p>This option may be set to use chroma plane instead of the default luma plane
  38875. for doing filter&rsquo;s computations. This may improve accuracy on very clean
  38876. source material, but more likely will decrease accuracy, especially if there
  38877. is chroma noise (rainbow effect) or any grayscale video.
  38878. The main purpose of setting <samp>mp</samp> to a chroma plane is to reduce CPU
  38879. load and make pullup usable in realtime on slow machines.
  38880. </p></dd>
  38881. </dl>
  38882. <p>For best results (without duplicated frames in the output file) it is
  38883. necessary to change the output frame rate. For example, to inverse
  38884. telecine NTSC input:
  38885. </p><div class="example">
  38886. <pre class="example">ffmpeg -i input -vf pullup -r 24000/1001 ...
  38887. </pre></div>
  38888. <a name="qp"></a>
  38889. <h3 class="section">39.176 qp<span class="pull-right"><a class="anchor hidden-xs" href="#qp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qp" aria-hidden="true">TOC</a></span></h3>
  38890. <p>Change video quantization parameters (QP).
  38891. </p>
  38892. <p>The filter accepts the following option:
  38893. </p>
  38894. <dl compact="compact">
  38895. <dt><samp>qp</samp></dt>
  38896. <dd><p>Set expression for quantization parameter.
  38897. </p></dd>
  38898. </dl>
  38899. <p>The expression is evaluated through the eval API and can contain, among others,
  38900. the following constants:
  38901. </p>
  38902. <dl compact="compact">
  38903. <dt><var>known</var></dt>
  38904. <dd><p>1 if index is not 129, 0 otherwise.
  38905. </p>
  38906. </dd>
  38907. <dt><var>qp</var></dt>
  38908. <dd><p>Sequential index starting from -129 to 128.
  38909. </p></dd>
  38910. </dl>
  38911. <a name="Examples-133"></a>
  38912. <h4 class="subsection">39.176.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-133" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-133" aria-hidden="true">TOC</a></span></h4>
  38913. <ul>
  38914. <li> Some equation like:
  38915. <div class="example">
  38916. <pre class="example">qp=2+2*sin(PI*qp)
  38917. </pre></div>
  38918. </li></ul>
  38919. <a name="random"></a>
  38920. <h3 class="section">39.177 random<span class="pull-right"><a class="anchor hidden-xs" href="#random" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-random" aria-hidden="true">TOC</a></span></h3>
  38921. <p>Flush video frames from internal cache of frames into a random order.
  38922. No frame is discarded.
  38923. Inspired by <a href="#frei0r">frei0r</a> nervous filter.
  38924. </p>
  38925. <dl compact="compact">
  38926. <dt><samp>frames</samp></dt>
  38927. <dd><p>Set size in number of frames of internal cache, in range from <code>2</code> to
  38928. <code>512</code>. Default is <code>30</code>.
  38929. </p>
  38930. </dd>
  38931. <dt><samp>seed</samp></dt>
  38932. <dd><p>Set seed for random number generator, must be an integer included between
  38933. <code>0</code> and <code>UINT32_MAX</code>. If not specified, or if explicitly set to
  38934. less than <code>0</code>, the filter will try to use a good random seed on a
  38935. best effort basis.
  38936. </p></dd>
  38937. </dl>
  38938. <a name="readeia608"></a>
  38939. <h3 class="section">39.178 readeia608<span class="pull-right"><a class="anchor hidden-xs" href="#readeia608" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-readeia608" aria-hidden="true">TOC</a></span></h3>
  38940. <p>Read closed captioning (EIA-608) information from the top lines of a video frame.
  38941. </p>
  38942. <p>This filter adds frame metadata for <code>lavfi.readeia608.X.cc</code> and
  38943. <code>lavfi.readeia608.X.line</code>, where <code>X</code> is the number of the identified line
  38944. with EIA-608 data (starting from 0). A description of each metadata value follows:
  38945. </p>
  38946. <dl compact="compact">
  38947. <dt><samp>lavfi.readeia608.X.cc</samp></dt>
  38948. <dd><p>The two bytes stored as EIA-608 data (printed in hexadecimal).
  38949. </p>
  38950. </dd>
  38951. <dt><samp>lavfi.readeia608.X.line</samp></dt>
  38952. <dd><p>The number of the line on which the EIA-608 data was identified and read.
  38953. </p></dd>
  38954. </dl>
  38955. <p>This filter accepts the following options:
  38956. </p>
  38957. <dl compact="compact">
  38958. <dt><samp>scan_min</samp></dt>
  38959. <dd><p>Set the line to start scanning for EIA-608 data. Default is <code>0</code>.
  38960. </p>
  38961. </dd>
  38962. <dt><samp>scan_max</samp></dt>
  38963. <dd><p>Set the line to end scanning for EIA-608 data. Default is <code>29</code>.
  38964. </p>
  38965. </dd>
  38966. <dt><samp>spw</samp></dt>
  38967. <dd><p>Set the ratio of width reserved for sync code detection.
  38968. Default is <code>0.27</code>. Allowed range is <code>[0.1 - 0.7]</code>.
  38969. </p>
  38970. </dd>
  38971. <dt><samp>chp</samp></dt>
  38972. <dd><p>Enable checking the parity bit. In the event of a parity error, the filter will output
  38973. <code>0x00</code> for that character. Default is false.
  38974. </p>
  38975. </dd>
  38976. <dt><samp>lp</samp></dt>
  38977. <dd><p>Lowpass lines prior to further processing. Default is enabled.
  38978. </p></dd>
  38979. </dl>
  38980. <a name="Commands-115"></a>
  38981. <h4 class="subsection">39.178.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-115" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-115" aria-hidden="true">TOC</a></span></h4>
  38982. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  38983. </p>
  38984. <a name="Examples-134"></a>
  38985. <h4 class="subsection">39.178.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-134" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-134" aria-hidden="true">TOC</a></span></h4>
  38986. <ul>
  38987. <li> Output a csv with presentation time and the first two lines of identified EIA-608 captioning data.
  38988. <div class="example">
  38989. <pre class="example">ffprobe -f lavfi -i movie=captioned_video.mov,readeia608 -show_entries frame=pkt_pts_time:frame_tags=lavfi.readeia608.0.cc,lavfi.readeia608.1.cc -of csv
  38990. </pre></div>
  38991. </li></ul>
  38992. <a name="readvitc"></a>
  38993. <h3 class="section">39.179 readvitc<span class="pull-right"><a class="anchor hidden-xs" href="#readvitc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-readvitc" aria-hidden="true">TOC</a></span></h3>
  38994. <p>Read vertical interval timecode (VITC) information from the top lines of a
  38995. video frame.
  38996. </p>
  38997. <p>The filter adds frame metadata key <code>lavfi.readvitc.tc_str</code> with the
  38998. timecode value, if a valid timecode has been detected. Further metadata key
  38999. <code>lavfi.readvitc.found</code> is set to 0/1 depending on whether
  39000. timecode data has been found or not.
  39001. </p>
  39002. <p>This filter accepts the following options:
  39003. </p>
  39004. <dl compact="compact">
  39005. <dt><samp>scan_max</samp></dt>
  39006. <dd><p>Set the maximum number of lines to scan for VITC data. If the value is set to
  39007. <code>-1</code> the full video frame is scanned. Default is <code>45</code>.
  39008. </p>
  39009. </dd>
  39010. <dt><samp>thr_b</samp></dt>
  39011. <dd><p>Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0],
  39012. default value is <code>0.2</code>. The value must be equal or less than <code>thr_w</code>.
  39013. </p>
  39014. </dd>
  39015. <dt><samp>thr_w</samp></dt>
  39016. <dd><p>Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0],
  39017. default value is <code>0.6</code>. The value must be equal or greater than <code>thr_b</code>.
  39018. </p></dd>
  39019. </dl>
  39020. <a name="Examples-135"></a>
  39021. <h4 class="subsection">39.179.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-135" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-135" aria-hidden="true">TOC</a></span></h4>
  39022. <ul>
  39023. <li> Detect and draw VITC data onto the video frame; if no valid VITC is detected,
  39024. draw <code>--:--:--:--</code> as a placeholder:
  39025. <div class="example">
  39026. <pre class="example">ffmpeg -i input.avi -filter:v 'readvitc,drawtext=fontfile=FreeMono.ttf:text=%{metadata\\:lavfi.readvitc.tc_str\\:--\\\\\\:--\\\\\\:--\\\\\\:--}:x=(w-tw)/2:y=400-ascent'
  39027. </pre></div>
  39028. </li></ul>
  39029. <a name="remap"></a>
  39030. <h3 class="section">39.180 remap<span class="pull-right"><a class="anchor hidden-xs" href="#remap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-remap" aria-hidden="true">TOC</a></span></h3>
  39031. <p>Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
  39032. </p>
  39033. <p>Destination pixel at position (X, Y) will be picked from source (x, y) position
  39034. where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
  39035. value for pixel will be used for destination pixel.
  39036. </p>
  39037. <p>Xmap and Ymap input video streams must be of same dimensions. Output video stream
  39038. will have Xmap/Ymap video stream dimensions.
  39039. Xmap and Ymap input video streams are 16bit depth, single channel.
  39040. </p>
  39041. <dl compact="compact">
  39042. <dt><samp>format</samp></dt>
  39043. <dd><p>Specify pixel format of output from this filter. Can be <code>color</code> or <code>gray</code>.
  39044. Default is <code>color</code>.
  39045. </p>
  39046. </dd>
  39047. <dt><samp>fill</samp></dt>
  39048. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  39049. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils
  39050. manual</a>. Default color is <code>black</code>.
  39051. </p></dd>
  39052. </dl>
  39053. <a name="removegrain"></a>
  39054. <h3 class="section">39.181 removegrain<span class="pull-right"><a class="anchor hidden-xs" href="#removegrain" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-removegrain" aria-hidden="true">TOC</a></span></h3>
  39055. <p>The removegrain filter is a spatial denoiser for progressive video.
  39056. </p>
  39057. <dl compact="compact">
  39058. <dt><samp>m0</samp></dt>
  39059. <dd><p>Set mode for the first plane.
  39060. </p>
  39061. </dd>
  39062. <dt><samp>m1</samp></dt>
  39063. <dd><p>Set mode for the second plane.
  39064. </p>
  39065. </dd>
  39066. <dt><samp>m2</samp></dt>
  39067. <dd><p>Set mode for the third plane.
  39068. </p>
  39069. </dd>
  39070. <dt><samp>m3</samp></dt>
  39071. <dd><p>Set mode for the fourth plane.
  39072. </p></dd>
  39073. </dl>
  39074. <p>Range of mode is from 0 to 24. Description of each mode follows:
  39075. </p>
  39076. <dl compact="compact">
  39077. <dt><var>0</var></dt>
  39078. <dd><p>Leave input plane unchanged. Default.
  39079. </p>
  39080. </dd>
  39081. <dt><var>1</var></dt>
  39082. <dd><p>Clips the pixel with the minimum and maximum of the 8 neighbour pixels.
  39083. </p>
  39084. </dd>
  39085. <dt><var>2</var></dt>
  39086. <dd><p>Clips the pixel with the second minimum and maximum of the 8 neighbour pixels.
  39087. </p>
  39088. </dd>
  39089. <dt><var>3</var></dt>
  39090. <dd><p>Clips the pixel with the third minimum and maximum of the 8 neighbour pixels.
  39091. </p>
  39092. </dd>
  39093. <dt><var>4</var></dt>
  39094. <dd><p>Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels.
  39095. This is equivalent to a median filter.
  39096. </p>
  39097. </dd>
  39098. <dt><var>5</var></dt>
  39099. <dd><p>Line-sensitive clipping giving the minimal change.
  39100. </p>
  39101. </dd>
  39102. <dt><var>6</var></dt>
  39103. <dd><p>Line-sensitive clipping, intermediate.
  39104. </p>
  39105. </dd>
  39106. <dt><var>7</var></dt>
  39107. <dd><p>Line-sensitive clipping, intermediate.
  39108. </p>
  39109. </dd>
  39110. <dt><var>8</var></dt>
  39111. <dd><p>Line-sensitive clipping, intermediate.
  39112. </p>
  39113. </dd>
  39114. <dt><var>9</var></dt>
  39115. <dd><p>Line-sensitive clipping on a line where the neighbours pixels are the closest.
  39116. </p>
  39117. </dd>
  39118. <dt><var>10</var></dt>
  39119. <dd><p>Replaces the target pixel with the closest neighbour.
  39120. </p>
  39121. </dd>
  39122. <dt><var>11</var></dt>
  39123. <dd><p>[1 2 1] horizontal and vertical kernel blur.
  39124. </p>
  39125. </dd>
  39126. <dt><var>12</var></dt>
  39127. <dd><p>Same as mode 11.
  39128. </p>
  39129. </dd>
  39130. <dt><var>13</var></dt>
  39131. <dd><p>Bob mode, interpolates top field from the line where the neighbours
  39132. pixels are the closest.
  39133. </p>
  39134. </dd>
  39135. <dt><var>14</var></dt>
  39136. <dd><p>Bob mode, interpolates bottom field from the line where the neighbours
  39137. pixels are the closest.
  39138. </p>
  39139. </dd>
  39140. <dt><var>15</var></dt>
  39141. <dd><p>Bob mode, interpolates top field. Same as 13 but with a more complicated
  39142. interpolation formula.
  39143. </p>
  39144. </dd>
  39145. <dt><var>16</var></dt>
  39146. <dd><p>Bob mode, interpolates bottom field. Same as 14 but with a more complicated
  39147. interpolation formula.
  39148. </p>
  39149. </dd>
  39150. <dt><var>17</var></dt>
  39151. <dd><p>Clips the pixel with the minimum and maximum of respectively the maximum and
  39152. minimum of each pair of opposite neighbour pixels.
  39153. </p>
  39154. </dd>
  39155. <dt><var>18</var></dt>
  39156. <dd><p>Line-sensitive clipping using opposite neighbours whose greatest distance from
  39157. the current pixel is minimal.
  39158. </p>
  39159. </dd>
  39160. <dt><var>19</var></dt>
  39161. <dd><p>Replaces the pixel with the average of its 8 neighbours.
  39162. </p>
  39163. </dd>
  39164. <dt><var>20</var></dt>
  39165. <dd><p>Averages the 9 pixels ([1 1 1] horizontal and vertical blur).
  39166. </p>
  39167. </dd>
  39168. <dt><var>21</var></dt>
  39169. <dd><p>Clips pixels using the averages of opposite neighbour.
  39170. </p>
  39171. </dd>
  39172. <dt><var>22</var></dt>
  39173. <dd><p>Same as mode 21 but simpler and faster.
  39174. </p>
  39175. </dd>
  39176. <dt><var>23</var></dt>
  39177. <dd><p>Small edge and halo removal, but reputed useless.
  39178. </p>
  39179. </dd>
  39180. <dt><var>24</var></dt>
  39181. <dd><p>Similar as 23.
  39182. </p></dd>
  39183. </dl>
  39184. <a name="removelogo"></a>
  39185. <h3 class="section">39.182 removelogo<span class="pull-right"><a class="anchor hidden-xs" href="#removelogo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-removelogo" aria-hidden="true">TOC</a></span></h3>
  39186. <p>Suppress a TV station logo, using an image file to determine which
  39187. pixels comprise the logo. It works by filling in the pixels that
  39188. comprise the logo with neighboring pixels.
  39189. </p>
  39190. <p>The filter accepts the following options:
  39191. </p>
  39192. <dl compact="compact">
  39193. <dt><samp>filename, f</samp></dt>
  39194. <dd><p>Set the filter bitmap file, which can be any image format supported by
  39195. libavformat. The width and height of the image file must match those of the
  39196. video stream being processed.
  39197. </p></dd>
  39198. </dl>
  39199. <p>Pixels in the provided bitmap image with a value of zero are not
  39200. considered part of the logo, non-zero pixels are considered part of
  39201. the logo. If you use white (255) for the logo and black (0) for the
  39202. rest, you will be safe. For making the filter bitmap, it is
  39203. recommended to take a screen capture of a black frame with the logo
  39204. visible, and then using a threshold filter followed by the erode
  39205. filter once or twice.
  39206. </p>
  39207. <p>If needed, little splotches can be fixed manually. Remember that if
  39208. logo pixels are not covered, the filter quality will be much
  39209. reduced. Marking too many pixels as part of the logo does not hurt as
  39210. much, but it will increase the amount of blurring needed to cover over
  39211. the image and will destroy more information than necessary, and extra
  39212. pixels will slow things down on a large logo.
  39213. </p>
  39214. <a name="repeatfields"></a>
  39215. <h3 class="section">39.183 repeatfields<span class="pull-right"><a class="anchor hidden-xs" href="#repeatfields" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-repeatfields" aria-hidden="true">TOC</a></span></h3>
  39216. <p>This filter uses the repeat_field flag from the Video ES headers and hard repeats
  39217. fields based on its value.
  39218. </p>
  39219. <a name="reverse"></a>
  39220. <h3 class="section">39.184 reverse<span class="pull-right"><a class="anchor hidden-xs" href="#reverse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-reverse" aria-hidden="true">TOC</a></span></h3>
  39221. <p>Reverse a video clip.
  39222. </p>
  39223. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  39224. is suggested.
  39225. </p>
  39226. <a name="Examples-136"></a>
  39227. <h4 class="subsection">39.184.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-136" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-136" aria-hidden="true">TOC</a></span></h4>
  39228. <ul>
  39229. <li> Take the first 5 seconds of a clip, and reverse it.
  39230. <div class="example">
  39231. <pre class="example">trim=end=5,reverse
  39232. </pre></div>
  39233. </li></ul>
  39234. <a name="rgbashift"></a>
  39235. <h3 class="section">39.185 rgbashift<span class="pull-right"><a class="anchor hidden-xs" href="#rgbashift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rgbashift" aria-hidden="true">TOC</a></span></h3>
  39236. <p>Shift R/G/B/A pixels horizontally and/or vertically.
  39237. </p>
  39238. <p>The filter accepts the following options:
  39239. </p><dl compact="compact">
  39240. <dt><samp>rh</samp></dt>
  39241. <dd><p>Set amount to shift red horizontally.
  39242. </p></dd>
  39243. <dt><samp>rv</samp></dt>
  39244. <dd><p>Set amount to shift red vertically.
  39245. </p></dd>
  39246. <dt><samp>gh</samp></dt>
  39247. <dd><p>Set amount to shift green horizontally.
  39248. </p></dd>
  39249. <dt><samp>gv</samp></dt>
  39250. <dd><p>Set amount to shift green vertically.
  39251. </p></dd>
  39252. <dt><samp>bh</samp></dt>
  39253. <dd><p>Set amount to shift blue horizontally.
  39254. </p></dd>
  39255. <dt><samp>bv</samp></dt>
  39256. <dd><p>Set amount to shift blue vertically.
  39257. </p></dd>
  39258. <dt><samp>ah</samp></dt>
  39259. <dd><p>Set amount to shift alpha horizontally.
  39260. </p></dd>
  39261. <dt><samp>av</samp></dt>
  39262. <dd><p>Set amount to shift alpha vertically.
  39263. </p></dd>
  39264. <dt><samp>edge</samp></dt>
  39265. <dd><p>Set edge mode, can be <var>smear</var>, default, or <var>warp</var>.
  39266. </p></dd>
  39267. </dl>
  39268. <a name="Commands-116"></a>
  39269. <h4 class="subsection">39.185.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-116" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-116" aria-hidden="true">TOC</a></span></h4>
  39270. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  39271. </p>
  39272. <a name="roberts"></a>
  39273. <h3 class="section">39.186 roberts<span class="pull-right"><a class="anchor hidden-xs" href="#roberts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-roberts" aria-hidden="true">TOC</a></span></h3>
  39274. <p>Apply roberts cross operator to input video stream.
  39275. </p>
  39276. <p>The filter accepts the following option:
  39277. </p>
  39278. <dl compact="compact">
  39279. <dt><samp>planes</samp></dt>
  39280. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  39281. By default value 0xf, all planes will be processed.
  39282. </p>
  39283. </dd>
  39284. <dt><samp>scale</samp></dt>
  39285. <dd><p>Set value which will be multiplied with filtered result.
  39286. </p>
  39287. </dd>
  39288. <dt><samp>delta</samp></dt>
  39289. <dd><p>Set value which will be added to filtered result.
  39290. </p></dd>
  39291. </dl>
  39292. <a name="Commands-117"></a>
  39293. <h4 class="subsection">39.186.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-117" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-117" aria-hidden="true">TOC</a></span></h4>
  39294. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  39295. </p>
  39296. <a name="rotate"></a>
  39297. <h3 class="section">39.187 rotate<span class="pull-right"><a class="anchor hidden-xs" href="#rotate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rotate" aria-hidden="true">TOC</a></span></h3>
  39298. <p>Rotate video by an arbitrary angle expressed in radians.
  39299. </p>
  39300. <p>The filter accepts the following options:
  39301. </p>
  39302. <p>A description of the optional parameters follows.
  39303. </p><dl compact="compact">
  39304. <dt><samp>angle, a</samp></dt>
  39305. <dd><p>Set an expression for the angle by which to rotate the input video
  39306. clockwise, expressed as a number of radians. A negative value will
  39307. result in a counter-clockwise rotation. By default it is set to &quot;0&quot;.
  39308. </p>
  39309. <p>This expression is evaluated for each frame.
  39310. </p>
  39311. </dd>
  39312. <dt><samp>out_w, ow</samp></dt>
  39313. <dd><p>Set the output width expression, default value is &quot;iw&quot;.
  39314. This expression is evaluated just once during configuration.
  39315. </p>
  39316. </dd>
  39317. <dt><samp>out_h, oh</samp></dt>
  39318. <dd><p>Set the output height expression, default value is &quot;ih&quot;.
  39319. This expression is evaluated just once during configuration.
  39320. </p>
  39321. </dd>
  39322. <dt><samp>bilinear</samp></dt>
  39323. <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
  39324. it. Default value is 1.
  39325. </p>
  39326. </dd>
  39327. <dt><samp>fillcolor, c</samp></dt>
  39328. <dd><p>Set the color used to fill the output area not covered by the rotated
  39329. image. For the general syntax of this option, check the
  39330. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  39331. If the special value &quot;none&quot; is selected then no
  39332. background is printed (useful for example if the background is never shown).
  39333. </p>
  39334. <p>Default value is &quot;black&quot;.
  39335. </p></dd>
  39336. </dl>
  39337. <p>The expressions for the angle and the output size can contain the
  39338. following constants and functions:
  39339. </p>
  39340. <dl compact="compact">
  39341. <dt><samp>n</samp></dt>
  39342. <dd><p>sequential number of the input frame, starting from 0. It is always NAN
  39343. before the first frame is filtered.
  39344. </p>
  39345. </dd>
  39346. <dt><samp>t</samp></dt>
  39347. <dd><p>time in seconds of the input frame, it is set to 0 when the filter is
  39348. configured. It is always NAN before the first frame is filtered.
  39349. </p>
  39350. </dd>
  39351. <dt><samp>hsub</samp></dt>
  39352. <dt><samp>vsub</samp></dt>
  39353. <dd><p>horizontal and vertical chroma subsample values. For example for the
  39354. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  39355. </p>
  39356. </dd>
  39357. <dt><samp>in_w, iw</samp></dt>
  39358. <dt><samp>in_h, ih</samp></dt>
  39359. <dd><p>the input video width and height
  39360. </p>
  39361. </dd>
  39362. <dt><samp>out_w, ow</samp></dt>
  39363. <dt><samp>out_h, oh</samp></dt>
  39364. <dd><p>the output width and height, that is the size of the padded area as
  39365. specified by the <var>width</var> and <var>height</var> expressions
  39366. </p>
  39367. </dd>
  39368. <dt><samp>rotw(a)</samp></dt>
  39369. <dt><samp>roth(a)</samp></dt>
  39370. <dd><p>the minimal width/height required for completely containing the input
  39371. video rotated by <var>a</var> radians.
  39372. </p>
  39373. <p>These are only available when computing the <samp>out_w</samp> and
  39374. <samp>out_h</samp> expressions.
  39375. </p></dd>
  39376. </dl>
  39377. <a name="Examples-137"></a>
  39378. <h4 class="subsection">39.187.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-137" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-137" aria-hidden="true">TOC</a></span></h4>
  39379. <ul>
  39380. <li> Rotate the input by PI/6 radians clockwise:
  39381. <div class="example">
  39382. <pre class="example">rotate=PI/6
  39383. </pre></div>
  39384. </li><li> Rotate the input by PI/6 radians counter-clockwise:
  39385. <div class="example">
  39386. <pre class="example">rotate=-PI/6
  39387. </pre></div>
  39388. </li><li> Rotate the input by 45 degrees clockwise:
  39389. <div class="example">
  39390. <pre class="example">rotate=45*PI/180
  39391. </pre></div>
  39392. </li><li> Apply a constant rotation with period T, starting from an angle of PI/3:
  39393. <div class="example">
  39394. <pre class="example">rotate=PI/3+2*PI*t/T
  39395. </pre></div>
  39396. </li><li> Make the input video rotation oscillating with a period of T
  39397. seconds and an amplitude of A radians:
  39398. <div class="example">
  39399. <pre class="example">rotate=A*sin(2*PI/T*t)
  39400. </pre></div>
  39401. </li><li> Rotate the video, output size is chosen so that the whole rotating
  39402. input video is always completely contained in the output:
  39403. <div class="example">
  39404. <pre class="example">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
  39405. </pre></div>
  39406. </li><li> Rotate the video, reduce the output size so that no background is ever
  39407. shown:
  39408. <div class="example">
  39409. <pre class="example">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
  39410. </pre></div>
  39411. </li></ul>
  39412. <a name="Commands-118"></a>
  39413. <h4 class="subsection">39.187.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-118" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-118" aria-hidden="true">TOC</a></span></h4>
  39414. <p>The filter supports the following commands:
  39415. </p>
  39416. <dl compact="compact">
  39417. <dt><samp>a, angle</samp></dt>
  39418. <dd><p>Set the angle expression.
  39419. The command accepts the same syntax of the corresponding option.
  39420. </p>
  39421. <p>If the specified expression is not valid, it is kept at its current
  39422. value.
  39423. </p></dd>
  39424. </dl>
  39425. <a name="sab"></a>
  39426. <h3 class="section">39.188 sab<span class="pull-right"><a class="anchor hidden-xs" href="#sab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sab" aria-hidden="true">TOC</a></span></h3>
  39427. <p>Apply Shape Adaptive Blur.
  39428. </p>
  39429. <p>The filter accepts the following options:
  39430. </p>
  39431. <dl compact="compact">
  39432. <dt><samp>luma_radius, lr</samp></dt>
  39433. <dd><p>Set luma blur filter strength, must be a value in range 0.1-4.0, default
  39434. value is 1.0. A greater value will result in a more blurred image, and
  39435. in slower processing.
  39436. </p>
  39437. </dd>
  39438. <dt><samp>luma_pre_filter_radius, lpfr</samp></dt>
  39439. <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
  39440. value is 1.0.
  39441. </p>
  39442. </dd>
  39443. <dt><samp>luma_strength, ls</samp></dt>
  39444. <dd><p>Set luma maximum difference between pixels to still be considered, must
  39445. be a value in the 0.1-100.0 range, default value is 1.0.
  39446. </p>
  39447. </dd>
  39448. <dt><samp>chroma_radius, cr</samp></dt>
  39449. <dd><p>Set chroma blur filter strength, must be a value in range -0.9-4.0. A
  39450. greater value will result in a more blurred image, and in slower
  39451. processing.
  39452. </p>
  39453. </dd>
  39454. <dt><samp>chroma_pre_filter_radius, cpfr</samp></dt>
  39455. <dd><p>Set chroma pre-filter radius, must be a value in the -0.9-2.0 range.
  39456. </p>
  39457. </dd>
  39458. <dt><samp>chroma_strength, cs</samp></dt>
  39459. <dd><p>Set chroma maximum difference between pixels to still be considered,
  39460. must be a value in the -0.9-100.0 range.
  39461. </p></dd>
  39462. </dl>
  39463. <p>Each chroma option value, if not explicitly specified, is set to the
  39464. corresponding luma option value.
  39465. </p>
  39466. <span id="scale"></span><a name="scale-1"></a>
  39467. <h3 class="section">39.189 scale<span class="pull-right"><a class="anchor hidden-xs" href="#scale-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale-1" aria-hidden="true">TOC</a></span></h3>
  39468. <p>Scale (resize) the input video, using the libswscale library.
  39469. </p>
  39470. <p>The scale filter forces the output display aspect ratio to be the same
  39471. of the input, by changing the output sample aspect ratio.
  39472. </p>
  39473. <p>If the input image format is different from the format requested by
  39474. the next filter, the scale filter will convert the input to the
  39475. requested format.
  39476. </p>
  39477. <a name="Options-86"></a>
  39478. <h4 class="subsection">39.189.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-86" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-86" aria-hidden="true">TOC</a></span></h4>
  39479. <p>The filter accepts the following options, or any of the options
  39480. supported by the libswscale scaler.
  39481. </p>
  39482. <p>See <a href="ffmpeg-scaler.html#scaler_005foptions">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for
  39483. the complete list of scaler options.
  39484. </p>
  39485. <dl compact="compact">
  39486. <dt><samp>width, w</samp></dt>
  39487. <dt><samp>height, h</samp></dt>
  39488. <dd><p>Set the output video dimension expression. Default value is the input
  39489. dimension.
  39490. </p>
  39491. <p>If the <var>width</var> or <var>w</var> value is 0, the input width is used for
  39492. the output. If the <var>height</var> or <var>h</var> value is 0, the input height
  39493. is used for the output.
  39494. </p>
  39495. <p>If one and only one of the values is -n with n &gt;= 1, the scale filter
  39496. will use a value that maintains the aspect ratio of the input image,
  39497. calculated from the other specified dimension. After that it will,
  39498. however, make sure that the calculated dimension is divisible by n and
  39499. adjust the value if necessary.
  39500. </p>
  39501. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  39502. both values being set to 0 as previously detailed.
  39503. </p>
  39504. <p>See below for the list of accepted constants for use in the dimension
  39505. expression.
  39506. </p>
  39507. </dd>
  39508. <dt><samp>eval</samp></dt>
  39509. <dd><p>Specify when to evaluate <var>width</var> and <var>height</var> expression. It accepts the following values:
  39510. </p>
  39511. <dl compact="compact">
  39512. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  39513. <dd><p>Only evaluate expressions once during the filter initialization or when a command is processed.
  39514. </p>
  39515. </dd>
  39516. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  39517. <dd><p>Evaluate expressions for each incoming frame.
  39518. </p>
  39519. </dd>
  39520. </dl>
  39521. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  39522. </p>
  39523. </dd>
  39524. <dt><samp>interl</samp></dt>
  39525. <dd><p>Set the interlacing mode. It accepts the following values:
  39526. </p>
  39527. <dl compact="compact">
  39528. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  39529. <dd><p>Force interlaced aware scaling.
  39530. </p>
  39531. </dd>
  39532. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  39533. <dd><p>Do not apply interlaced scaling.
  39534. </p>
  39535. </dd>
  39536. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  39537. <dd><p>Select interlaced aware scaling depending on whether the source frames
  39538. are flagged as interlaced or not.
  39539. </p></dd>
  39540. </dl>
  39541. <p>Default value is &lsquo;<samp>0</samp>&rsquo;.
  39542. </p>
  39543. </dd>
  39544. <dt><samp>flags</samp></dt>
  39545. <dd><p>Set libswscale scaling flags. See
  39546. <a href="ffmpeg-scaler.html#sws_005fflags">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for the
  39547. complete list of values. If not explicitly specified the filter applies
  39548. the default flags.
  39549. </p>
  39550. </dd>
  39551. <dt><samp>param0, param1</samp></dt>
  39552. <dd><p>Set libswscale input parameters for scaling algorithms that need them. See
  39553. <a href="ffmpeg-scaler.html#sws_005fparams">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for the
  39554. complete documentation. If not explicitly specified the filter applies
  39555. empty parameters.
  39556. </p>
  39557. </dd>
  39558. <dt><samp>size, s</samp></dt>
  39559. <dd><p>Set the video size. For the syntax of this option, check the
  39560. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  39561. </p>
  39562. </dd>
  39563. <dt><samp>in_color_matrix</samp></dt>
  39564. <dt><samp>out_color_matrix</samp></dt>
  39565. <dd><p>Set in/output YCbCr color space type.
  39566. </p>
  39567. <p>This allows the autodetected value to be overridden as well as allows forcing
  39568. a specific value used for the output and encoder.
  39569. </p>
  39570. <p>If not specified, the color space type depends on the pixel format.
  39571. </p>
  39572. <p>Possible values:
  39573. </p>
  39574. <dl compact="compact">
  39575. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  39576. <dd><p>Choose automatically.
  39577. </p>
  39578. </dd>
  39579. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  39580. <dd><p>Format conforming to International Telecommunication Union (ITU)
  39581. Recommendation BT.709.
  39582. </p>
  39583. </dd>
  39584. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  39585. <dd><p>Set color space conforming to the United States Federal Communications
  39586. Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a).
  39587. </p>
  39588. </dd>
  39589. <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
  39590. <dt>&lsquo;<samp>bt470</samp>&rsquo;</dt>
  39591. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  39592. <dd><p>Set color space conforming to:
  39593. </p>
  39594. <ul>
  39595. <li> ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
  39596. </li><li> ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
  39597. </li><li> Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
  39598. </li></ul>
  39599. </dd>
  39600. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  39601. <dd><p>Set color space conforming to SMPTE ST 240:1999.
  39602. </p>
  39603. </dd>
  39604. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  39605. <dd><p>Set color space conforming to ITU-R BT.2020 non-constant luminance system.
  39606. </p></dd>
  39607. </dl>
  39608. </dd>
  39609. <dt><samp>in_range</samp></dt>
  39610. <dt><samp>out_range</samp></dt>
  39611. <dd><p>Set in/output YCbCr sample range.
  39612. </p>
  39613. <p>This allows the autodetected value to be overridden as well as allows forcing
  39614. a specific value used for the output and encoder. If not specified, the
  39615. range depends on the pixel format. Possible values:
  39616. </p>
  39617. <dl compact="compact">
  39618. <dt>&lsquo;<samp>auto/unknown</samp>&rsquo;</dt>
  39619. <dd><p>Choose automatically.
  39620. </p>
  39621. </dd>
  39622. <dt>&lsquo;<samp>jpeg/full/pc</samp>&rsquo;</dt>
  39623. <dd><p>Set full range (0-255 in case of 8-bit luma).
  39624. </p>
  39625. </dd>
  39626. <dt>&lsquo;<samp>mpeg/limited/tv</samp>&rsquo;</dt>
  39627. <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
  39628. </p></dd>
  39629. </dl>
  39630. </dd>
  39631. <dt><samp>force_original_aspect_ratio</samp></dt>
  39632. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  39633. keep the original aspect ratio. Possible values:
  39634. </p>
  39635. <dl compact="compact">
  39636. <dt>&lsquo;<samp>disable</samp>&rsquo;</dt>
  39637. <dd><p>Scale the video as specified and disable this feature.
  39638. </p>
  39639. </dd>
  39640. <dt>&lsquo;<samp>decrease</samp>&rsquo;</dt>
  39641. <dd><p>The output video dimensions will automatically be decreased if needed.
  39642. </p>
  39643. </dd>
  39644. <dt>&lsquo;<samp>increase</samp>&rsquo;</dt>
  39645. <dd><p>The output video dimensions will automatically be increased if needed.
  39646. </p>
  39647. </dd>
  39648. </dl>
  39649. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  39650. maximum allowed resolution, you can use this to limit the output video to
  39651. that, while retaining the aspect ratio. For example, device A allows
  39652. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  39653. decrease) and specifying 1280x720 to the command line makes the output
  39654. 1280x533.
  39655. </p>
  39656. <p>Please note that this is a different thing than specifying -1 for <samp>w</samp>
  39657. or <samp>h</samp>, you still need to specify the output resolution for this option
  39658. to work.
  39659. </p>
  39660. </dd>
  39661. <dt><samp>force_divisible_by</samp></dt>
  39662. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  39663. given integer when used together with <samp>force_original_aspect_ratio</samp>. This
  39664. works similar to using <code>-n</code> in the <samp>w</samp> and <samp>h</samp> options.
  39665. </p>
  39666. <p>This option respects the value set for <samp>force_original_aspect_ratio</samp>,
  39667. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  39668. may be slightly modified.
  39669. </p>
  39670. <p>This option can be handy if you need to have a video fit within or exceed
  39671. a defined resolution using <samp>force_original_aspect_ratio</samp> but also have
  39672. encoder restrictions on width or height divisibility.
  39673. </p>
  39674. </dd>
  39675. </dl>
  39676. <p>The values of the <samp>w</samp> and <samp>h</samp> options are expressions
  39677. containing the following constants:
  39678. </p>
  39679. <dl compact="compact">
  39680. <dt><var>in_w</var></dt>
  39681. <dt><var>in_h</var></dt>
  39682. <dd><p>The input width and height
  39683. </p>
  39684. </dd>
  39685. <dt><var>iw</var></dt>
  39686. <dt><var>ih</var></dt>
  39687. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  39688. </p>
  39689. </dd>
  39690. <dt><var>out_w</var></dt>
  39691. <dt><var>out_h</var></dt>
  39692. <dd><p>The output (scaled) width and height
  39693. </p>
  39694. </dd>
  39695. <dt><var>ow</var></dt>
  39696. <dt><var>oh</var></dt>
  39697. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>
  39698. </p>
  39699. </dd>
  39700. <dt><var>a</var></dt>
  39701. <dd><p>The same as <var>iw</var> / <var>ih</var>
  39702. </p>
  39703. </dd>
  39704. <dt><var>sar</var></dt>
  39705. <dd><p>input sample aspect ratio
  39706. </p>
  39707. </dd>
  39708. <dt><var>dar</var></dt>
  39709. <dd><p>The input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
  39710. </p>
  39711. </dd>
  39712. <dt><var>hsub</var></dt>
  39713. <dt><var>vsub</var></dt>
  39714. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  39715. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  39716. </p>
  39717. </dd>
  39718. <dt><var>ohsub</var></dt>
  39719. <dt><var>ovsub</var></dt>
  39720. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  39721. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  39722. </p>
  39723. </dd>
  39724. <dt><var>n</var></dt>
  39725. <dd><p>The (sequential) number of the input frame, starting from 0.
  39726. Only available with <code>eval=frame</code>.
  39727. </p>
  39728. </dd>
  39729. <dt><var>t</var></dt>
  39730. <dd><p>The presentation timestamp of the input frame, expressed as a number of
  39731. seconds. Only available with <code>eval=frame</code>.
  39732. </p>
  39733. </dd>
  39734. <dt><var>pos</var></dt>
  39735. <dd><p>The position (byte offset) of the frame in the input stream, or NaN if
  39736. this information is unavailable and/or meaningless (for example in case of synthetic video).
  39737. Only available with <code>eval=frame</code>.
  39738. </p></dd>
  39739. </dl>
  39740. <a name="Examples-138"></a>
  39741. <h4 class="subsection">39.189.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-138" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-138" aria-hidden="true">TOC</a></span></h4>
  39742. <ul>
  39743. <li> Scale the input video to a size of 200x100
  39744. <div class="example">
  39745. <pre class="example">scale=w=200:h=100
  39746. </pre></div>
  39747. <p>This is equivalent to:
  39748. </p><div class="example">
  39749. <pre class="example">scale=200:100
  39750. </pre></div>
  39751. <p>or:
  39752. </p><div class="example">
  39753. <pre class="example">scale=200x100
  39754. </pre></div>
  39755. </li><li> Specify a size abbreviation for the output size:
  39756. <div class="example">
  39757. <pre class="example">scale=qcif
  39758. </pre></div>
  39759. <p>which can also be written as:
  39760. </p><div class="example">
  39761. <pre class="example">scale=size=qcif
  39762. </pre></div>
  39763. </li><li> Scale the input to 2x:
  39764. <div class="example">
  39765. <pre class="example">scale=w=2*iw:h=2*ih
  39766. </pre></div>
  39767. </li><li> The above is the same as:
  39768. <div class="example">
  39769. <pre class="example">scale=2*in_w:2*in_h
  39770. </pre></div>
  39771. </li><li> Scale the input to 2x with forced interlaced scaling:
  39772. <div class="example">
  39773. <pre class="example">scale=2*iw:2*ih:interl=1
  39774. </pre></div>
  39775. </li><li> Scale the input to half size:
  39776. <div class="example">
  39777. <pre class="example">scale=w=iw/2:h=ih/2
  39778. </pre></div>
  39779. </li><li> Increase the width, and set the height to the same size:
  39780. <div class="example">
  39781. <pre class="example">scale=3/2*iw:ow
  39782. </pre></div>
  39783. </li><li> Seek Greek harmony:
  39784. <div class="example">
  39785. <pre class="example">scale=iw:1/PHI*iw
  39786. scale=ih*PHI:ih
  39787. </pre></div>
  39788. </li><li> Increase the height, and set the width to 3/2 of the height:
  39789. <div class="example">
  39790. <pre class="example">scale=w=3/2*oh:h=3/5*ih
  39791. </pre></div>
  39792. </li><li> Increase the size, making the size a multiple of the chroma
  39793. subsample values:
  39794. <div class="example">
  39795. <pre class="example">scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
  39796. </pre></div>
  39797. </li><li> Increase the width to a maximum of 500 pixels,
  39798. keeping the same aspect ratio as the input:
  39799. <div class="example">
  39800. <pre class="example">scale=w='min(500\, iw*3/2):h=-1'
  39801. </pre></div>
  39802. </li><li> Make pixels square by combining scale and setsar:
  39803. <div class="example">
  39804. <pre class="example">scale='trunc(ih*dar):ih',setsar=1/1
  39805. </pre></div>
  39806. </li><li> Make pixels square by combining scale and setsar,
  39807. making sure the resulting resolution is even (required by some codecs):
  39808. <div class="example">
  39809. <pre class="example">scale='trunc(ih*dar/2)*2:trunc(ih/2)*2',setsar=1/1
  39810. </pre></div>
  39811. </li></ul>
  39812. <a name="Commands-119"></a>
  39813. <h4 class="subsection">39.189.3 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-119" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-119" aria-hidden="true">TOC</a></span></h4>
  39814. <p>This filter supports the following commands:
  39815. </p><dl compact="compact">
  39816. <dt><samp>width, w</samp></dt>
  39817. <dt><samp>height, h</samp></dt>
  39818. <dd><p>Set the output video dimension expression.
  39819. The command accepts the same syntax of the corresponding option.
  39820. </p>
  39821. <p>If the specified expression is not valid, it is kept at its current
  39822. value.
  39823. </p></dd>
  39824. </dl>
  39825. <a name="scale_005fnpp"></a>
  39826. <h3 class="section">39.190 scale_npp<span class="pull-right"><a class="anchor hidden-xs" href="#scale_005fnpp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale_005fnpp" aria-hidden="true">TOC</a></span></h3>
  39827. <p>Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel
  39828. format conversion on CUDA video frames. Setting the output width and height
  39829. works in the same way as for the <var>scale</var> filter.
  39830. </p>
  39831. <p>The following additional options are accepted:
  39832. </p><dl compact="compact">
  39833. <dt><samp>format</samp></dt>
  39834. <dd><p>The pixel format of the output CUDA frames. If set to the string &quot;same&quot; (the
  39835. default), the input format will be kept. Note that automatic format negotiation
  39836. and conversion is not yet supported for hardware frames
  39837. </p>
  39838. </dd>
  39839. <dt><samp>interp_algo</samp></dt>
  39840. <dd><p>The interpolation algorithm used for resizing. One of the following:
  39841. </p><dl compact="compact">
  39842. <dt><samp>nn</samp></dt>
  39843. <dd><p>Nearest neighbour.
  39844. </p>
  39845. </dd>
  39846. <dt><samp>linear</samp></dt>
  39847. <dt><samp>cubic</samp></dt>
  39848. <dt><samp>cubic2p_bspline</samp></dt>
  39849. <dd><p>2-parameter cubic (B=1, C=0)
  39850. </p>
  39851. </dd>
  39852. <dt><samp>cubic2p_catmullrom</samp></dt>
  39853. <dd><p>2-parameter cubic (B=0, C=1/2)
  39854. </p>
  39855. </dd>
  39856. <dt><samp>cubic2p_b05c03</samp></dt>
  39857. <dd><p>2-parameter cubic (B=1/2, C=3/10)
  39858. </p>
  39859. </dd>
  39860. <dt><samp>super</samp></dt>
  39861. <dd><p>Supersampling
  39862. </p>
  39863. </dd>
  39864. <dt><samp>lanczos</samp></dt>
  39865. </dl>
  39866. </dd>
  39867. <dt><samp>force_original_aspect_ratio</samp></dt>
  39868. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  39869. keep the original aspect ratio. Possible values:
  39870. </p>
  39871. <dl compact="compact">
  39872. <dt>&lsquo;<samp>disable</samp>&rsquo;</dt>
  39873. <dd><p>Scale the video as specified and disable this feature.
  39874. </p>
  39875. </dd>
  39876. <dt>&lsquo;<samp>decrease</samp>&rsquo;</dt>
  39877. <dd><p>The output video dimensions will automatically be decreased if needed.
  39878. </p>
  39879. </dd>
  39880. <dt>&lsquo;<samp>increase</samp>&rsquo;</dt>
  39881. <dd><p>The output video dimensions will automatically be increased if needed.
  39882. </p>
  39883. </dd>
  39884. </dl>
  39885. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  39886. maximum allowed resolution, you can use this to limit the output video to
  39887. that, while retaining the aspect ratio. For example, device A allows
  39888. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  39889. decrease) and specifying 1280x720 to the command line makes the output
  39890. 1280x533.
  39891. </p>
  39892. <p>Please note that this is a different thing than specifying -1 for <samp>w</samp>
  39893. or <samp>h</samp>, you still need to specify the output resolution for this option
  39894. to work.
  39895. </p>
  39896. </dd>
  39897. <dt><samp>force_divisible_by</samp></dt>
  39898. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  39899. given integer when used together with <samp>force_original_aspect_ratio</samp>. This
  39900. works similar to using <code>-n</code> in the <samp>w</samp> and <samp>h</samp> options.
  39901. </p>
  39902. <p>This option respects the value set for <samp>force_original_aspect_ratio</samp>,
  39903. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  39904. may be slightly modified.
  39905. </p>
  39906. <p>This option can be handy if you need to have a video fit within or exceed
  39907. a defined resolution using <samp>force_original_aspect_ratio</samp> but also have
  39908. encoder restrictions on width or height divisibility.
  39909. </p>
  39910. </dd>
  39911. </dl>
  39912. <a name="scale2ref"></a>
  39913. <h3 class="section">39.191 scale2ref<span class="pull-right"><a class="anchor hidden-xs" href="#scale2ref" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale2ref" aria-hidden="true">TOC</a></span></h3>
  39914. <p>Scale (resize) the input video, based on a reference video.
  39915. </p>
  39916. <p>See the scale filter for available options, scale2ref supports the same but
  39917. uses the reference video instead of the main input as basis. scale2ref also
  39918. supports the following additional constants for the <samp>w</samp> and
  39919. <samp>h</samp> options:
  39920. </p>
  39921. <dl compact="compact">
  39922. <dt><var>main_w</var></dt>
  39923. <dt><var>main_h</var></dt>
  39924. <dd><p>The main input video&rsquo;s width and height
  39925. </p>
  39926. </dd>
  39927. <dt><var>main_a</var></dt>
  39928. <dd><p>The same as <var>main_w</var> / <var>main_h</var>
  39929. </p>
  39930. </dd>
  39931. <dt><var>main_sar</var></dt>
  39932. <dd><p>The main input video&rsquo;s sample aspect ratio
  39933. </p>
  39934. </dd>
  39935. <dt><var>main_dar, mdar</var></dt>
  39936. <dd><p>The main input video&rsquo;s display aspect ratio. Calculated from
  39937. <code>(main_w / main_h) * main_sar</code>.
  39938. </p>
  39939. </dd>
  39940. <dt><var>main_hsub</var></dt>
  39941. <dt><var>main_vsub</var></dt>
  39942. <dd><p>The main input video&rsquo;s horizontal and vertical chroma subsample values.
  39943. For example for the pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var>
  39944. is 1.
  39945. </p>
  39946. </dd>
  39947. <dt><var>main_n</var></dt>
  39948. <dd><p>The (sequential) number of the main input frame, starting from 0.
  39949. Only available with <code>eval=frame</code>.
  39950. </p>
  39951. </dd>
  39952. <dt><var>main_t</var></dt>
  39953. <dd><p>The presentation timestamp of the main input frame, expressed as a number of
  39954. seconds. Only available with <code>eval=frame</code>.
  39955. </p>
  39956. </dd>
  39957. <dt><var>main_pos</var></dt>
  39958. <dd><p>The position (byte offset) of the frame in the main input stream, or NaN if
  39959. this information is unavailable and/or meaningless (for example in case of synthetic video).
  39960. Only available with <code>eval=frame</code>.
  39961. </p></dd>
  39962. </dl>
  39963. <a name="Examples-139"></a>
  39964. <h4 class="subsection">39.191.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-139" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-139" aria-hidden="true">TOC</a></span></h4>
  39965. <ul>
  39966. <li> Scale a subtitle stream (b) to match the main video (a) in size before overlaying
  39967. <div class="example">
  39968. <pre class="example">'scale2ref[b][a];[a][b]overlay'
  39969. </pre></div>
  39970. </li><li> Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio.
  39971. <div class="example">
  39972. <pre class="example">[logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out]
  39973. </pre></div>
  39974. </li></ul>
  39975. <a name="Commands-120"></a>
  39976. <h4 class="subsection">39.191.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-120" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-120" aria-hidden="true">TOC</a></span></h4>
  39977. <p>This filter supports the following commands:
  39978. </p><dl compact="compact">
  39979. <dt><samp>width, w</samp></dt>
  39980. <dt><samp>height, h</samp></dt>
  39981. <dd><p>Set the output video dimension expression.
  39982. The command accepts the same syntax of the corresponding option.
  39983. </p>
  39984. <p>If the specified expression is not valid, it is kept at its current
  39985. value.
  39986. </p></dd>
  39987. </dl>
  39988. <a name="scroll"></a>
  39989. <h3 class="section">39.192 scroll<span class="pull-right"><a class="anchor hidden-xs" href="#scroll" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scroll" aria-hidden="true">TOC</a></span></h3>
  39990. <p>Scroll input video horizontally and/or vertically by constant speed.
  39991. </p>
  39992. <p>The filter accepts the following options:
  39993. </p><dl compact="compact">
  39994. <dt><samp>horizontal, h</samp></dt>
  39995. <dd><p>Set the horizontal scrolling speed. Default is 0. Allowed range is from -1 to 1.
  39996. Negative values changes scrolling direction.
  39997. </p>
  39998. </dd>
  39999. <dt><samp>vertical, v</samp></dt>
  40000. <dd><p>Set the vertical scrolling speed. Default is 0. Allowed range is from -1 to 1.
  40001. Negative values changes scrolling direction.
  40002. </p>
  40003. </dd>
  40004. <dt><samp>hpos</samp></dt>
  40005. <dd><p>Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1.
  40006. </p>
  40007. </dd>
  40008. <dt><samp>vpos</samp></dt>
  40009. <dd><p>Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1.
  40010. </p></dd>
  40011. </dl>
  40012. <a name="Commands-121"></a>
  40013. <h4 class="subsection">39.192.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-121" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-121" aria-hidden="true">TOC</a></span></h4>
  40014. <p>This filter supports the following <a href="#commands">commands</a>:
  40015. </p><dl compact="compact">
  40016. <dt><samp>horizontal, h</samp></dt>
  40017. <dd><p>Set the horizontal scrolling speed.
  40018. </p></dd>
  40019. <dt><samp>vertical, v</samp></dt>
  40020. <dd><p>Set the vertical scrolling speed.
  40021. </p></dd>
  40022. </dl>
  40023. <span id="scdet"></span><a name="scdet-1"></a>
  40024. <h3 class="section">39.193 scdet<span class="pull-right"><a class="anchor hidden-xs" href="#scdet-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scdet-1" aria-hidden="true">TOC</a></span></h3>
  40025. <p>Detect video scene change.
  40026. </p>
  40027. <p>This filter sets frame metadata with mafd between frame, the scene score, and
  40028. forward the frame to the next filter, so they can use these metadata to detect
  40029. scene change or others.
  40030. </p>
  40031. <p>In addition, this filter logs a message and sets frame metadata when it detects
  40032. a scene change by <samp>threshold</samp>.
  40033. </p>
  40034. <p><code>lavfi.scd.mafd</code> metadata keys are set with mafd for every frame.
  40035. </p>
  40036. <p><code>lavfi.scd.score</code> metadata keys are set with scene change score for every frame
  40037. to detect scene change.
  40038. </p>
  40039. <p><code>lavfi.scd.time</code> metadata keys are set with current filtered frame time which
  40040. detect scene change with <samp>threshold</samp>.
  40041. </p>
  40042. <p>The filter accepts the following options:
  40043. </p>
  40044. <dl compact="compact">
  40045. <dt><samp>threshold, t</samp></dt>
  40046. <dd><p>Set the scene change detection threshold as a percentage of maximum change. Good
  40047. values are in the <code>[8.0, 14.0]</code> range. The range for <samp>threshold</samp> is
  40048. <code>[0., 100.]</code>.
  40049. </p>
  40050. <p>Default value is <code>10.</code>.
  40051. </p>
  40052. </dd>
  40053. <dt><samp>sc_pass, s</samp></dt>
  40054. <dd><p>Set the flag to pass scene change frames to the next filter. Default value is <code>0</code>
  40055. You can enable it if you want to get snapshot of scene change frames only.
  40056. </p></dd>
  40057. </dl>
  40058. <span id="selectivecolor"></span><a name="selectivecolor-1"></a>
  40059. <h3 class="section">39.194 selectivecolor<span class="pull-right"><a class="anchor hidden-xs" href="#selectivecolor-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-selectivecolor-1" aria-hidden="true">TOC</a></span></h3>
  40060. <p>Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such
  40061. as &quot;reds&quot;, &quot;yellows&quot;, &quot;greens&quot;, &quot;cyans&quot;, ...). The adjustment range is defined
  40062. by the &quot;purity&quot; of the color (that is, how saturated it already is).
  40063. </p>
  40064. <p>This filter is similar to the Adobe Photoshop Selective Color tool.
  40065. </p>
  40066. <p>The filter accepts the following options:
  40067. </p>
  40068. <dl compact="compact">
  40069. <dt><samp>correction_method</samp></dt>
  40070. <dd><p>Select color correction method.
  40071. </p>
  40072. <p>Available values are:
  40073. </p><dl compact="compact">
  40074. <dt>&lsquo;<samp>absolute</samp>&rsquo;</dt>
  40075. <dd><p>Specified adjustments are applied &quot;as-is&quot; (added/subtracted to original pixel
  40076. component value).
  40077. </p></dd>
  40078. <dt>&lsquo;<samp>relative</samp>&rsquo;</dt>
  40079. <dd><p>Specified adjustments are relative to the original component value.
  40080. </p></dd>
  40081. </dl>
  40082. <p>Default is <code>absolute</code>.
  40083. </p></dd>
  40084. <dt><samp>reds</samp></dt>
  40085. <dd><p>Adjustments for red pixels (pixels where the red component is the maximum)
  40086. </p></dd>
  40087. <dt><samp>yellows</samp></dt>
  40088. <dd><p>Adjustments for yellow pixels (pixels where the blue component is the minimum)
  40089. </p></dd>
  40090. <dt><samp>greens</samp></dt>
  40091. <dd><p>Adjustments for green pixels (pixels where the green component is the maximum)
  40092. </p></dd>
  40093. <dt><samp>cyans</samp></dt>
  40094. <dd><p>Adjustments for cyan pixels (pixels where the red component is the minimum)
  40095. </p></dd>
  40096. <dt><samp>blues</samp></dt>
  40097. <dd><p>Adjustments for blue pixels (pixels where the blue component is the maximum)
  40098. </p></dd>
  40099. <dt><samp>magentas</samp></dt>
  40100. <dd><p>Adjustments for magenta pixels (pixels where the green component is the minimum)
  40101. </p></dd>
  40102. <dt><samp>whites</samp></dt>
  40103. <dd><p>Adjustments for white pixels (pixels where all components are greater than 128)
  40104. </p></dd>
  40105. <dt><samp>neutrals</samp></dt>
  40106. <dd><p>Adjustments for all pixels except pure black and pure white
  40107. </p></dd>
  40108. <dt><samp>blacks</samp></dt>
  40109. <dd><p>Adjustments for black pixels (pixels where all components are lesser than 128)
  40110. </p></dd>
  40111. <dt><samp>psfile</samp></dt>
  40112. <dd><p>Specify a Photoshop selective color file (<code>.asv</code>) to import the settings from.
  40113. </p></dd>
  40114. </dl>
  40115. <p>All the adjustment settings (<samp>reds</samp>, <samp>yellows</samp>, ...) accept up to
  40116. 4 space separated floating point adjustment values in the [-1,1] range,
  40117. respectively to adjust the amount of cyan, magenta, yellow and black for the
  40118. pixels of its range.
  40119. </p>
  40120. <a name="Examples-140"></a>
  40121. <h4 class="subsection">39.194.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-140" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-140" aria-hidden="true">TOC</a></span></h4>
  40122. <ul>
  40123. <li> Increase cyan by 50% and reduce yellow by 33% in every green areas, and
  40124. increase magenta by 27% in blue areas:
  40125. <div class="example">
  40126. <pre class="example">selectivecolor=greens=.5 0 -.33 0:blues=0 .27
  40127. </pre></div>
  40128. </li><li> Use a Photoshop selective color preset:
  40129. <div class="example">
  40130. <pre class="example">selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
  40131. </pre></div>
  40132. </li></ul>
  40133. <span id="separatefields"></span><a name="separatefields-1"></a>
  40134. <h3 class="section">39.195 separatefields<span class="pull-right"><a class="anchor hidden-xs" href="#separatefields-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-separatefields-1" aria-hidden="true">TOC</a></span></h3>
  40135. <p>The <code>separatefields</code> takes a frame-based video input and splits
  40136. each frame into its components fields, producing a new half height clip
  40137. with twice the frame rate and twice the frame count.
  40138. </p>
  40139. <p>This filter use field-dominance information in frame to decide which
  40140. of each pair of fields to place first in the output.
  40141. If it gets it wrong use <a href="#setfield">setfield</a> filter before <code>separatefields</code> filter.
  40142. </p>
  40143. <a name="setdar_002c-setsar"></a>
  40144. <h3 class="section">39.196 setdar, setsar<span class="pull-right"><a class="anchor hidden-xs" href="#setdar_002c-setsar" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setdar_002c-setsar" aria-hidden="true">TOC</a></span></h3>
  40145. <p>The <code>setdar</code> filter sets the Display Aspect Ratio for the filter
  40146. output video.
  40147. </p>
  40148. <p>This is done by changing the specified Sample (aka Pixel) Aspect
  40149. Ratio, according to the following equation:
  40150. </p><div class="example">
  40151. <pre class="example"><var>DAR</var> = <var>HORIZONTAL_RESOLUTION</var> / <var>VERTICAL_RESOLUTION</var> * <var>SAR</var>
  40152. </pre></div>
  40153. <p>Keep in mind that the <code>setdar</code> filter does not modify the pixel
  40154. dimensions of the video frame. Also, the display aspect ratio set by
  40155. this filter may be changed by later filters in the filterchain,
  40156. e.g. in case of scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is
  40157. applied.
  40158. </p>
  40159. <p>The <code>setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
  40160. the filter output video.
  40161. </p>
  40162. <p>Note that as a consequence of the application of this filter, the
  40163. output display aspect ratio will change according to the equation
  40164. above.
  40165. </p>
  40166. <p>Keep in mind that the sample aspect ratio set by the <code>setsar</code>
  40167. filter may be changed by later filters in the filterchain, e.g. if
  40168. another &quot;setsar&quot; or a &quot;setdar&quot; filter is applied.
  40169. </p>
  40170. <p>It accepts the following parameters:
  40171. </p>
  40172. <dl compact="compact">
  40173. <dt><samp>r, ratio, dar (<code>setdar</code> only), sar (<code>setsar</code> only)</samp></dt>
  40174. <dd><p>Set the aspect ratio used by the filter.
  40175. </p>
  40176. <p>The parameter can be a floating point number string, an expression, or
  40177. a string of the form <var>num</var>:<var>den</var>, where <var>num</var> and
  40178. <var>den</var> are the numerator and denominator of the aspect ratio. If
  40179. the parameter is not specified, it is assumed the value &quot;0&quot;.
  40180. In case the form &quot;<var>num</var>:<var>den</var>&quot; is used, the <code>:</code> character
  40181. should be escaped.
  40182. </p>
  40183. </dd>
  40184. <dt><samp>max</samp></dt>
  40185. <dd><p>Set the maximum integer value to use for expressing numerator and
  40186. denominator when reducing the expressed aspect ratio to a rational.
  40187. Default value is <code>100</code>.
  40188. </p>
  40189. </dd>
  40190. </dl>
  40191. <p>The parameter <var>sar</var> is an expression containing
  40192. the following constants:
  40193. </p>
  40194. <dl compact="compact">
  40195. <dt><samp>E, PI, PHI</samp></dt>
  40196. <dd><p>These are approximated values for the mathematical constants e
  40197. (Euler&rsquo;s number), pi (Greek pi), and phi (the golden ratio).
  40198. </p>
  40199. </dd>
  40200. <dt><samp>w, h</samp></dt>
  40201. <dd><p>The input width and height.
  40202. </p>
  40203. </dd>
  40204. <dt><samp>a</samp></dt>
  40205. <dd><p>These are the same as <var>w</var> / <var>h</var>.
  40206. </p>
  40207. </dd>
  40208. <dt><samp>sar</samp></dt>
  40209. <dd><p>The input sample aspect ratio.
  40210. </p>
  40211. </dd>
  40212. <dt><samp>dar</samp></dt>
  40213. <dd><p>The input display aspect ratio. It is the same as
  40214. (<var>w</var> / <var>h</var>) * <var>sar</var>.
  40215. </p>
  40216. </dd>
  40217. <dt><samp>hsub, vsub</samp></dt>
  40218. <dd><p>Horizontal and vertical chroma subsample values. For example, for the
  40219. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  40220. </p></dd>
  40221. </dl>
  40222. <a name="Examples-141"></a>
  40223. <h4 class="subsection">39.196.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-141" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-141" aria-hidden="true">TOC</a></span></h4>
  40224. <ul>
  40225. <li> To change the display aspect ratio to 16:9, specify one of the following:
  40226. <div class="example">
  40227. <pre class="example">setdar=dar=1.77777
  40228. setdar=dar=16/9
  40229. </pre></div>
  40230. </li><li> To change the sample aspect ratio to 10:11, specify:
  40231. <div class="example">
  40232. <pre class="example">setsar=sar=10/11
  40233. </pre></div>
  40234. </li><li> To set a display aspect ratio of 16:9, and specify a maximum integer value of
  40235. 1000 in the aspect ratio reduction, use the command:
  40236. <div class="example">
  40237. <pre class="example">setdar=ratio=16/9:max=1000
  40238. </pre></div>
  40239. </li></ul>
  40240. <span id="setfield"></span><a name="setfield-1"></a>
  40241. <h3 class="section">39.197 setfield<span class="pull-right"><a class="anchor hidden-xs" href="#setfield-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setfield-1" aria-hidden="true">TOC</a></span></h3>
  40242. <p>Force field for the output video frame.
  40243. </p>
  40244. <p>The <code>setfield</code> filter marks the interlace type field for the
  40245. output frames. It does not change the input frame, but only sets the
  40246. corresponding property, which affects how the frame is treated by
  40247. following filters (e.g. <code>fieldorder</code> or <code>yadif</code>).
  40248. </p>
  40249. <p>The filter accepts the following options:
  40250. </p>
  40251. <dl compact="compact">
  40252. <dt><samp>mode</samp></dt>
  40253. <dd><p>Available values are:
  40254. </p>
  40255. <dl compact="compact">
  40256. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  40257. <dd><p>Keep the same field property.
  40258. </p>
  40259. </dd>
  40260. <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
  40261. <dd><p>Mark the frame as bottom-field-first.
  40262. </p>
  40263. </dd>
  40264. <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
  40265. <dd><p>Mark the frame as top-field-first.
  40266. </p>
  40267. </dd>
  40268. <dt>&lsquo;<samp>prog</samp>&rsquo;</dt>
  40269. <dd><p>Mark the frame as progressive.
  40270. </p></dd>
  40271. </dl>
  40272. </dd>
  40273. </dl>
  40274. <span id="setparams"></span><a name="setparams-1"></a>
  40275. <h3 class="section">39.198 setparams<span class="pull-right"><a class="anchor hidden-xs" href="#setparams-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setparams-1" aria-hidden="true">TOC</a></span></h3>
  40276. <p>Force frame parameter for the output video frame.
  40277. </p>
  40278. <p>The <code>setparams</code> filter marks interlace and color range for the
  40279. output frames. It does not change the input frame, but only sets the
  40280. corresponding property, which affects how the frame is treated by
  40281. filters/encoders.
  40282. </p>
  40283. <dl compact="compact">
  40284. <dt><samp>field_mode</samp></dt>
  40285. <dd><p>Available values are:
  40286. </p>
  40287. <dl compact="compact">
  40288. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  40289. <dd><p>Keep the same field property (default).
  40290. </p>
  40291. </dd>
  40292. <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
  40293. <dd><p>Mark the frame as bottom-field-first.
  40294. </p>
  40295. </dd>
  40296. <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
  40297. <dd><p>Mark the frame as top-field-first.
  40298. </p>
  40299. </dd>
  40300. <dt>&lsquo;<samp>prog</samp>&rsquo;</dt>
  40301. <dd><p>Mark the frame as progressive.
  40302. </p></dd>
  40303. </dl>
  40304. </dd>
  40305. <dt><samp>range</samp></dt>
  40306. <dd><p>Available values are:
  40307. </p>
  40308. <dl compact="compact">
  40309. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  40310. <dd><p>Keep the same color range property (default).
  40311. </p>
  40312. </dd>
  40313. <dt>&lsquo;<samp>unspecified, unknown</samp>&rsquo;</dt>
  40314. <dd><p>Mark the frame as unspecified color range.
  40315. </p>
  40316. </dd>
  40317. <dt>&lsquo;<samp>limited, tv, mpeg</samp>&rsquo;</dt>
  40318. <dd><p>Mark the frame as limited range.
  40319. </p>
  40320. </dd>
  40321. <dt>&lsquo;<samp>full, pc, jpeg</samp>&rsquo;</dt>
  40322. <dd><p>Mark the frame as full range.
  40323. </p></dd>
  40324. </dl>
  40325. </dd>
  40326. <dt><samp>color_primaries</samp></dt>
  40327. <dd><p>Set the color primaries.
  40328. Available values are:
  40329. </p>
  40330. <dl compact="compact">
  40331. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  40332. <dd><p>Keep the same color primaries property (default).
  40333. </p>
  40334. </dd>
  40335. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  40336. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  40337. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  40338. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  40339. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  40340. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  40341. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  40342. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  40343. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  40344. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  40345. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  40346. <dt>&lsquo;<samp>jedec-p22</samp>&rsquo;</dt>
  40347. </dl>
  40348. </dd>
  40349. <dt><samp>color_trc</samp></dt>
  40350. <dd><p>Set the color transfer.
  40351. Available values are:
  40352. </p>
  40353. <dl compact="compact">
  40354. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  40355. <dd><p>Keep the same color trc property (default).
  40356. </p>
  40357. </dd>
  40358. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  40359. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  40360. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  40361. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  40362. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  40363. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  40364. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  40365. <dt>&lsquo;<samp>log100</samp>&rsquo;</dt>
  40366. <dt>&lsquo;<samp>log316</samp>&rsquo;</dt>
  40367. <dt>&lsquo;<samp>iec61966-2-4</samp>&rsquo;</dt>
  40368. <dt>&lsquo;<samp>bt1361e</samp>&rsquo;</dt>
  40369. <dt>&lsquo;<samp>iec61966-2-1</samp>&rsquo;</dt>
  40370. <dt>&lsquo;<samp>bt2020-10</samp>&rsquo;</dt>
  40371. <dt>&lsquo;<samp>bt2020-12</samp>&rsquo;</dt>
  40372. <dt>&lsquo;<samp>smpte2084</samp>&rsquo;</dt>
  40373. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  40374. <dt>&lsquo;<samp>arib-std-b67</samp>&rsquo;</dt>
  40375. </dl>
  40376. </dd>
  40377. <dt><samp>colorspace</samp></dt>
  40378. <dd><p>Set the colorspace.
  40379. Available values are:
  40380. </p>
  40381. <dl compact="compact">
  40382. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  40383. <dd><p>Keep the same colorspace property (default).
  40384. </p>
  40385. </dd>
  40386. <dt>&lsquo;<samp>gbr</samp>&rsquo;</dt>
  40387. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  40388. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  40389. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  40390. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  40391. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  40392. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  40393. <dt>&lsquo;<samp>ycgco</samp>&rsquo;</dt>
  40394. <dt>&lsquo;<samp>bt2020nc</samp>&rsquo;</dt>
  40395. <dt>&lsquo;<samp>bt2020c</samp>&rsquo;</dt>
  40396. <dt>&lsquo;<samp>smpte2085</samp>&rsquo;</dt>
  40397. <dt>&lsquo;<samp>chroma-derived-nc</samp>&rsquo;</dt>
  40398. <dt>&lsquo;<samp>chroma-derived-c</samp>&rsquo;</dt>
  40399. <dt>&lsquo;<samp>ictcp</samp>&rsquo;</dt>
  40400. </dl>
  40401. </dd>
  40402. </dl>
  40403. <a name="shear"></a>
  40404. <h3 class="section">39.199 shear<span class="pull-right"><a class="anchor hidden-xs" href="#shear" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shear" aria-hidden="true">TOC</a></span></h3>
  40405. <p>Apply shear transform to input video.
  40406. </p>
  40407. <p>This filter supports the following options:
  40408. </p>
  40409. <dl compact="compact">
  40410. <dt><samp>shx</samp></dt>
  40411. <dd><p>Shear factor in X-direction. Default value is 0.
  40412. Allowed range is from -2 to 2.
  40413. </p>
  40414. </dd>
  40415. <dt><samp>shy</samp></dt>
  40416. <dd><p>Shear factor in Y-direction. Default value is 0.
  40417. Allowed range is from -2 to 2.
  40418. </p>
  40419. </dd>
  40420. <dt><samp>fillcolor, c</samp></dt>
  40421. <dd><p>Set the color used to fill the output area not covered by the transformed
  40422. video. For the general syntax of this option, check the
  40423. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  40424. If the special value &quot;none&quot; is selected then no
  40425. background is printed (useful for example if the background is never shown).
  40426. </p>
  40427. <p>Default value is &quot;black&quot;.
  40428. </p>
  40429. </dd>
  40430. <dt><samp>interp</samp></dt>
  40431. <dd><p>Set interpolation type. Can be <code>bilinear</code> or <code>nearest</code>. Default is <code>bilinear</code>.
  40432. </p></dd>
  40433. </dl>
  40434. <a name="Commands-122"></a>
  40435. <h4 class="subsection">39.199.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-122" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-122" aria-hidden="true">TOC</a></span></h4>
  40436. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  40437. </p>
  40438. <a name="showinfo"></a>
  40439. <h3 class="section">39.200 showinfo<span class="pull-right"><a class="anchor hidden-xs" href="#showinfo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showinfo" aria-hidden="true">TOC</a></span></h3>
  40440. <p>Show a line containing various information for each input video frame.
  40441. The input video is not modified.
  40442. </p>
  40443. <p>This filter supports the following options:
  40444. </p>
  40445. <dl compact="compact">
  40446. <dt><samp>checksum</samp></dt>
  40447. <dd><p>Calculate checksums of each plane. By default enabled.
  40448. </p></dd>
  40449. </dl>
  40450. <p>The shown line contains a sequence of key/value pairs of the form
  40451. <var>key</var>:<var>value</var>.
  40452. </p>
  40453. <p>The following values are shown in the output:
  40454. </p>
  40455. <dl compact="compact">
  40456. <dt><samp>n</samp></dt>
  40457. <dd><p>The (sequential) number of the input frame, starting from 0.
  40458. </p>
  40459. </dd>
  40460. <dt><samp>pts</samp></dt>
  40461. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  40462. time base units. The time base unit depends on the filter input pad.
  40463. </p>
  40464. </dd>
  40465. <dt><samp>pts_time</samp></dt>
  40466. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  40467. seconds.
  40468. </p>
  40469. </dd>
  40470. <dt><samp>pos</samp></dt>
  40471. <dd><p>The position of the frame in the input stream, or -1 if this information is
  40472. unavailable and/or meaningless (for example in case of synthetic video).
  40473. </p>
  40474. </dd>
  40475. <dt><samp>fmt</samp></dt>
  40476. <dd><p>The pixel format name.
  40477. </p>
  40478. </dd>
  40479. <dt><samp>sar</samp></dt>
  40480. <dd><p>The sample aspect ratio of the input frame, expressed in the form
  40481. <var>num</var>/<var>den</var>.
  40482. </p>
  40483. </dd>
  40484. <dt><samp>s</samp></dt>
  40485. <dd><p>The size of the input frame. For the syntax of this option, check the
  40486. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  40487. </p>
  40488. </dd>
  40489. <dt><samp>i</samp></dt>
  40490. <dd><p>The type of interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
  40491. for bottom field first).
  40492. </p>
  40493. </dd>
  40494. <dt><samp>iskey</samp></dt>
  40495. <dd><p>This is 1 if the frame is a key frame, 0 otherwise.
  40496. </p>
  40497. </dd>
  40498. <dt><samp>type</samp></dt>
  40499. <dd><p>The picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
  40500. P-frame, &quot;B&quot; for a B-frame, or &quot;?&quot; for an unknown type).
  40501. Also refer to the documentation of the <code>AVPictureType</code> enum and of
  40502. the <code>av_get_picture_type_char</code> function defined in
  40503. <samp>libavutil/avutil.h</samp>.
  40504. </p>
  40505. </dd>
  40506. <dt><samp>checksum</samp></dt>
  40507. <dd><p>The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame.
  40508. </p>
  40509. </dd>
  40510. <dt><samp>plane_checksum</samp></dt>
  40511. <dd><p>The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
  40512. expressed in the form &quot;[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]&quot;.
  40513. </p>
  40514. </dd>
  40515. <dt><samp>mean</samp></dt>
  40516. <dd><p>The mean value of pixels in each plane of the input frame, expressed in the form
  40517. &quot;[<var>mean0</var> <var>mean1</var> <var>mean2</var> <var>mean3</var>]&quot;.
  40518. </p>
  40519. </dd>
  40520. <dt><samp>stdev</samp></dt>
  40521. <dd><p>The standard deviation of pixel values in each plane of the input frame, expressed
  40522. in the form &quot;[<var>stdev0</var> <var>stdev1</var> <var>stdev2</var> <var>stdev3</var>]&quot;.
  40523. </p>
  40524. </dd>
  40525. </dl>
  40526. <a name="showpalette"></a>
  40527. <h3 class="section">39.201 showpalette<span class="pull-right"><a class="anchor hidden-xs" href="#showpalette" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showpalette" aria-hidden="true">TOC</a></span></h3>
  40528. <p>Displays the 256 colors palette of each frame. This filter is only relevant for
  40529. <var>pal8</var> pixel format frames.
  40530. </p>
  40531. <p>It accepts the following option:
  40532. </p>
  40533. <dl compact="compact">
  40534. <dt><samp>s</samp></dt>
  40535. <dd><p>Set the size of the box used to represent one palette color entry. Default is
  40536. <code>30</code> (for a <code>30x30</code> pixel box).
  40537. </p></dd>
  40538. </dl>
  40539. <a name="shuffleframes"></a>
  40540. <h3 class="section">39.202 shuffleframes<span class="pull-right"><a class="anchor hidden-xs" href="#shuffleframes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shuffleframes" aria-hidden="true">TOC</a></span></h3>
  40541. <p>Reorder and/or duplicate and/or drop video frames.
  40542. </p>
  40543. <p>It accepts the following parameters:
  40544. </p>
  40545. <dl compact="compact">
  40546. <dt><samp>mapping</samp></dt>
  40547. <dd><p>Set the destination indexes of input frames.
  40548. This is space or &rsquo;|&rsquo; separated list of indexes that maps input frames to output
  40549. frames. Number of indexes also sets maximal value that each index may have.
  40550. &rsquo;-1&rsquo; index have special meaning and that is to drop frame.
  40551. </p></dd>
  40552. </dl>
  40553. <p>The first frame has the index 0. The default is to keep the input unchanged.
  40554. </p>
  40555. <a name="Examples-142"></a>
  40556. <h4 class="subsection">39.202.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-142" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-142" aria-hidden="true">TOC</a></span></h4>
  40557. <ul>
  40558. <li> Swap second and third frame of every three frames of the input:
  40559. <div class="example">
  40560. <pre class="example">ffmpeg -i INPUT -vf &quot;shuffleframes=0 2 1&quot; OUTPUT
  40561. </pre></div>
  40562. </li><li> Swap 10th and 1st frame of every ten frames of the input:
  40563. <div class="example">
  40564. <pre class="example">ffmpeg -i INPUT -vf &quot;shuffleframes=9 1 2 3 4 5 6 7 8 0&quot; OUTPUT
  40565. </pre></div>
  40566. </li></ul>
  40567. <a name="shufflepixels"></a>
  40568. <h3 class="section">39.203 shufflepixels<span class="pull-right"><a class="anchor hidden-xs" href="#shufflepixels" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shufflepixels" aria-hidden="true">TOC</a></span></h3>
  40569. <p>Reorder pixels in video frames.
  40570. </p>
  40571. <p>This filter accepts the following options:
  40572. </p>
  40573. <dl compact="compact">
  40574. <dt><samp>direction, d</samp></dt>
  40575. <dd><p>Set shuffle direction. Can be forward or inverse direction.
  40576. Default direction is forward.
  40577. </p>
  40578. </dd>
  40579. <dt><samp>mode, m</samp></dt>
  40580. <dd><p>Set shuffle mode. Can be horizontal, vertical or block mode.
  40581. </p>
  40582. </dd>
  40583. <dt><samp>width, w</samp></dt>
  40584. <dt><samp>height, h</samp></dt>
  40585. <dd><p>Set shuffle block_size. In case of horizontal shuffle mode only width
  40586. part of size is used, and in case of vertical shuffle mode only height
  40587. part of size is used.
  40588. </p>
  40589. </dd>
  40590. <dt><samp>seed, s</samp></dt>
  40591. <dd><p>Set random seed used with shuffling pixels. Mainly useful to set to be able
  40592. to reverse filtering process to get original input.
  40593. For example, to reverse forward shuffle you need to use same parameters
  40594. and exact same seed and to set direction to inverse.
  40595. </p></dd>
  40596. </dl>
  40597. <a name="shuffleplanes"></a>
  40598. <h3 class="section">39.204 shuffleplanes<span class="pull-right"><a class="anchor hidden-xs" href="#shuffleplanes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shuffleplanes" aria-hidden="true">TOC</a></span></h3>
  40599. <p>Reorder and/or duplicate video planes.
  40600. </p>
  40601. <p>It accepts the following parameters:
  40602. </p>
  40603. <dl compact="compact">
  40604. <dt><samp>map0</samp></dt>
  40605. <dd><p>The index of the input plane to be used as the first output plane.
  40606. </p>
  40607. </dd>
  40608. <dt><samp>map1</samp></dt>
  40609. <dd><p>The index of the input plane to be used as the second output plane.
  40610. </p>
  40611. </dd>
  40612. <dt><samp>map2</samp></dt>
  40613. <dd><p>The index of the input plane to be used as the third output plane.
  40614. </p>
  40615. </dd>
  40616. <dt><samp>map3</samp></dt>
  40617. <dd><p>The index of the input plane to be used as the fourth output plane.
  40618. </p>
  40619. </dd>
  40620. </dl>
  40621. <p>The first plane has the index 0. The default is to keep the input unchanged.
  40622. </p>
  40623. <a name="Examples-143"></a>
  40624. <h4 class="subsection">39.204.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-143" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-143" aria-hidden="true">TOC</a></span></h4>
  40625. <ul>
  40626. <li> Swap the second and third planes of the input:
  40627. <div class="example">
  40628. <pre class="example">ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
  40629. </pre></div>
  40630. </li></ul>
  40631. <span id="signalstats"></span><a name="signalstats-1"></a>
  40632. <h3 class="section">39.205 signalstats<span class="pull-right"><a class="anchor hidden-xs" href="#signalstats-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-signalstats-1" aria-hidden="true">TOC</a></span></h3>
  40633. <p>Evaluate various visual metrics that assist in determining issues associated
  40634. with the digitization of analog video media.
  40635. </p>
  40636. <p>By default the filter will log these metadata values:
  40637. </p>
  40638. <dl compact="compact">
  40639. <dt><samp>YMIN</samp></dt>
  40640. <dd><p>Display the minimal Y value contained within the input frame. Expressed in
  40641. range of [0-255].
  40642. </p>
  40643. </dd>
  40644. <dt><samp>YLOW</samp></dt>
  40645. <dd><p>Display the Y value at the 10% percentile within the input frame. Expressed in
  40646. range of [0-255].
  40647. </p>
  40648. </dd>
  40649. <dt><samp>YAVG</samp></dt>
  40650. <dd><p>Display the average Y value within the input frame. Expressed in range of
  40651. [0-255].
  40652. </p>
  40653. </dd>
  40654. <dt><samp>YHIGH</samp></dt>
  40655. <dd><p>Display the Y value at the 90% percentile within the input frame. Expressed in
  40656. range of [0-255].
  40657. </p>
  40658. </dd>
  40659. <dt><samp>YMAX</samp></dt>
  40660. <dd><p>Display the maximum Y value contained within the input frame. Expressed in
  40661. range of [0-255].
  40662. </p>
  40663. </dd>
  40664. <dt><samp>UMIN</samp></dt>
  40665. <dd><p>Display the minimal U value contained within the input frame. Expressed in
  40666. range of [0-255].
  40667. </p>
  40668. </dd>
  40669. <dt><samp>ULOW</samp></dt>
  40670. <dd><p>Display the U value at the 10% percentile within the input frame. Expressed in
  40671. range of [0-255].
  40672. </p>
  40673. </dd>
  40674. <dt><samp>UAVG</samp></dt>
  40675. <dd><p>Display the average U value within the input frame. Expressed in range of
  40676. [0-255].
  40677. </p>
  40678. </dd>
  40679. <dt><samp>UHIGH</samp></dt>
  40680. <dd><p>Display the U value at the 90% percentile within the input frame. Expressed in
  40681. range of [0-255].
  40682. </p>
  40683. </dd>
  40684. <dt><samp>UMAX</samp></dt>
  40685. <dd><p>Display the maximum U value contained within the input frame. Expressed in
  40686. range of [0-255].
  40687. </p>
  40688. </dd>
  40689. <dt><samp>VMIN</samp></dt>
  40690. <dd><p>Display the minimal V value contained within the input frame. Expressed in
  40691. range of [0-255].
  40692. </p>
  40693. </dd>
  40694. <dt><samp>VLOW</samp></dt>
  40695. <dd><p>Display the V value at the 10% percentile within the input frame. Expressed in
  40696. range of [0-255].
  40697. </p>
  40698. </dd>
  40699. <dt><samp>VAVG</samp></dt>
  40700. <dd><p>Display the average V value within the input frame. Expressed in range of
  40701. [0-255].
  40702. </p>
  40703. </dd>
  40704. <dt><samp>VHIGH</samp></dt>
  40705. <dd><p>Display the V value at the 90% percentile within the input frame. Expressed in
  40706. range of [0-255].
  40707. </p>
  40708. </dd>
  40709. <dt><samp>VMAX</samp></dt>
  40710. <dd><p>Display the maximum V value contained within the input frame. Expressed in
  40711. range of [0-255].
  40712. </p>
  40713. </dd>
  40714. <dt><samp>SATMIN</samp></dt>
  40715. <dd><p>Display the minimal saturation value contained within the input frame.
  40716. Expressed in range of [0-~181.02].
  40717. </p>
  40718. </dd>
  40719. <dt><samp>SATLOW</samp></dt>
  40720. <dd><p>Display the saturation value at the 10% percentile within the input frame.
  40721. Expressed in range of [0-~181.02].
  40722. </p>
  40723. </dd>
  40724. <dt><samp>SATAVG</samp></dt>
  40725. <dd><p>Display the average saturation value within the input frame. Expressed in range
  40726. of [0-~181.02].
  40727. </p>
  40728. </dd>
  40729. <dt><samp>SATHIGH</samp></dt>
  40730. <dd><p>Display the saturation value at the 90% percentile within the input frame.
  40731. Expressed in range of [0-~181.02].
  40732. </p>
  40733. </dd>
  40734. <dt><samp>SATMAX</samp></dt>
  40735. <dd><p>Display the maximum saturation value contained within the input frame.
  40736. Expressed in range of [0-~181.02].
  40737. </p>
  40738. </dd>
  40739. <dt><samp>HUEMED</samp></dt>
  40740. <dd><p>Display the median value for hue within the input frame. Expressed in range of
  40741. [0-360].
  40742. </p>
  40743. </dd>
  40744. <dt><samp>HUEAVG</samp></dt>
  40745. <dd><p>Display the average value for hue within the input frame. Expressed in range of
  40746. [0-360].
  40747. </p>
  40748. </dd>
  40749. <dt><samp>YDIF</samp></dt>
  40750. <dd><p>Display the average of sample value difference between all values of the Y
  40751. plane in the current frame and corresponding values of the previous input frame.
  40752. Expressed in range of [0-255].
  40753. </p>
  40754. </dd>
  40755. <dt><samp>UDIF</samp></dt>
  40756. <dd><p>Display the average of sample value difference between all values of the U
  40757. plane in the current frame and corresponding values of the previous input frame.
  40758. Expressed in range of [0-255].
  40759. </p>
  40760. </dd>
  40761. <dt><samp>VDIF</samp></dt>
  40762. <dd><p>Display the average of sample value difference between all values of the V
  40763. plane in the current frame and corresponding values of the previous input frame.
  40764. Expressed in range of [0-255].
  40765. </p>
  40766. </dd>
  40767. <dt><samp>YBITDEPTH</samp></dt>
  40768. <dd><p>Display bit depth of Y plane in current frame.
  40769. Expressed in range of [0-16].
  40770. </p>
  40771. </dd>
  40772. <dt><samp>UBITDEPTH</samp></dt>
  40773. <dd><p>Display bit depth of U plane in current frame.
  40774. Expressed in range of [0-16].
  40775. </p>
  40776. </dd>
  40777. <dt><samp>VBITDEPTH</samp></dt>
  40778. <dd><p>Display bit depth of V plane in current frame.
  40779. Expressed in range of [0-16].
  40780. </p></dd>
  40781. </dl>
  40782. <p>The filter accepts the following options:
  40783. </p>
  40784. <dl compact="compact">
  40785. <dt><samp>stat</samp></dt>
  40786. <dt><samp>out</samp></dt>
  40787. <dd>
  40788. <p><samp>stat</samp> specify an additional form of image analysis.
  40789. <samp>out</samp> output video with the specified type of pixel highlighted.
  40790. </p>
  40791. <p>Both options accept the following values:
  40792. </p>
  40793. <dl compact="compact">
  40794. <dt>&lsquo;<samp>tout</samp>&rsquo;</dt>
  40795. <dd><p>Identify <var>temporal outliers</var> pixels. A <var>temporal outlier</var> is a pixel
  40796. unlike the neighboring pixels of the same field. Examples of temporal outliers
  40797. include the results of video dropouts, head clogs, or tape tracking issues.
  40798. </p>
  40799. </dd>
  40800. <dt>&lsquo;<samp>vrep</samp>&rsquo;</dt>
  40801. <dd><p>Identify <var>vertical line repetition</var>. Vertical line repetition includes
  40802. similar rows of pixels within a frame. In born-digital video vertical line
  40803. repetition is common, but this pattern is uncommon in video digitized from an
  40804. analog source. When it occurs in video that results from the digitization of an
  40805. analog source it can indicate concealment from a dropout compensator.
  40806. </p>
  40807. </dd>
  40808. <dt>&lsquo;<samp>brng</samp>&rsquo;</dt>
  40809. <dd><p>Identify pixels that fall outside of legal broadcast range.
  40810. </p></dd>
  40811. </dl>
  40812. </dd>
  40813. <dt><samp>color, c</samp></dt>
  40814. <dd><p>Set the highlight color for the <samp>out</samp> option. The default color is
  40815. yellow.
  40816. </p></dd>
  40817. </dl>
  40818. <a name="Examples-144"></a>
  40819. <h4 class="subsection">39.205.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-144" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-144" aria-hidden="true">TOC</a></span></h4>
  40820. <ul>
  40821. <li> Output data of various video metrics:
  40822. <div class="example">
  40823. <pre class="example">ffprobe -f lavfi movie=example.mov,signalstats=&quot;stat=tout+vrep+brng&quot; -show_frames
  40824. </pre></div>
  40825. </li><li> Output specific data about the minimum and maximum values of the Y plane per frame:
  40826. <div class="example">
  40827. <pre class="example">ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
  40828. </pre></div>
  40829. </li><li> Playback video while highlighting pixels that are outside of broadcast range in red.
  40830. <div class="example">
  40831. <pre class="example">ffplay example.mov -vf signalstats=&quot;out=brng:color=red&quot;
  40832. </pre></div>
  40833. </li><li> Playback video with signalstats metadata drawn over the frame.
  40834. <div class="example">
  40835. <pre class="example">ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
  40836. </pre></div>
  40837. <p>The contents of signalstat_drawtext.txt used in the command are:
  40838. </p><div class="example">
  40839. <pre class="example">time %{pts:hms}
  40840. Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
  40841. U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
  40842. V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
  40843. saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
  40844. </pre></div>
  40845. </li></ul>
  40846. <span id="signature"></span><a name="signature-1"></a>
  40847. <h3 class="section">39.206 signature<span class="pull-right"><a class="anchor hidden-xs" href="#signature-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-signature-1" aria-hidden="true">TOC</a></span></h3>
  40848. <p>Calculates the MPEG-7 Video Signature. The filter can handle more than one
  40849. input. In this case the matching between the inputs can be calculated additionally.
  40850. The filter always passes through the first input. The signature of each stream can
  40851. be written into a file.
  40852. </p>
  40853. <p>It accepts the following options:
  40854. </p>
  40855. <dl compact="compact">
  40856. <dt><samp>detectmode</samp></dt>
  40857. <dd><p>Enable or disable the matching process.
  40858. </p>
  40859. <p>Available values are:
  40860. </p>
  40861. <dl compact="compact">
  40862. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  40863. <dd><p>Disable the calculation of a matching (default).
  40864. </p></dd>
  40865. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  40866. <dd><p>Calculate the matching for the whole video and output whether the whole video
  40867. matches or only parts.
  40868. </p></dd>
  40869. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  40870. <dd><p>Calculate only until a matching is found or the video ends. Should be faster in
  40871. some cases.
  40872. </p></dd>
  40873. </dl>
  40874. </dd>
  40875. <dt><samp>nb_inputs</samp></dt>
  40876. <dd><p>Set the number of inputs. The option value must be a non negative integer.
  40877. Default value is 1.
  40878. </p>
  40879. </dd>
  40880. <dt><samp>filename</samp></dt>
  40881. <dd><p>Set the path to which the output is written. If there is more than one input,
  40882. the path must be a prototype, i.e. must contain %d or %0nd (where n is a positive
  40883. integer), that will be replaced with the input number. If no filename is
  40884. specified, no output will be written. This is the default.
  40885. </p>
  40886. </dd>
  40887. <dt><samp>format</samp></dt>
  40888. <dd><p>Choose the output format.
  40889. </p>
  40890. <p>Available values are:
  40891. </p>
  40892. <dl compact="compact">
  40893. <dt>&lsquo;<samp>binary</samp>&rsquo;</dt>
  40894. <dd><p>Use the specified binary representation (default).
  40895. </p></dd>
  40896. <dt>&lsquo;<samp>xml</samp>&rsquo;</dt>
  40897. <dd><p>Use the specified xml representation.
  40898. </p></dd>
  40899. </dl>
  40900. </dd>
  40901. <dt><samp>th_d</samp></dt>
  40902. <dd><p>Set threshold to detect one word as similar. The option value must be an integer
  40903. greater than zero. The default value is 9000.
  40904. </p>
  40905. </dd>
  40906. <dt><samp>th_dc</samp></dt>
  40907. <dd><p>Set threshold to detect all words as similar. The option value must be an integer
  40908. greater than zero. The default value is 60000.
  40909. </p>
  40910. </dd>
  40911. <dt><samp>th_xh</samp></dt>
  40912. <dd><p>Set threshold to detect frames as similar. The option value must be an integer
  40913. greater than zero. The default value is 116.
  40914. </p>
  40915. </dd>
  40916. <dt><samp>th_di</samp></dt>
  40917. <dd><p>Set the minimum length of a sequence in frames to recognize it as matching
  40918. sequence. The option value must be a non negative integer value.
  40919. The default value is 0.
  40920. </p>
  40921. </dd>
  40922. <dt><samp>th_it</samp></dt>
  40923. <dd><p>Set the minimum relation, that matching frames to all frames must have.
  40924. The option value must be a double value between 0 and 1. The default value is 0.5.
  40925. </p></dd>
  40926. </dl>
  40927. <a name="Examples-145"></a>
  40928. <h4 class="subsection">39.206.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-145" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-145" aria-hidden="true">TOC</a></span></h4>
  40929. <ul>
  40930. <li> To calculate the signature of an input video and store it in signature.bin:
  40931. <div class="example">
  40932. <pre class="example">ffmpeg -i input.mkv -vf signature=filename=signature.bin -map 0:v -f null -
  40933. </pre></div>
  40934. </li><li> To detect whether two videos match and store the signatures in XML format in
  40935. signature0.xml and signature1.xml:
  40936. <div class="example">
  40937. <pre class="example">ffmpeg -i input1.mkv -i input2.mkv -filter_complex &quot;[0:v][1:v] signature=nb_inputs=2:detectmode=full:format=xml:filename=signature%d.xml&quot; -map :v -f null -
  40938. </pre></div>
  40939. </li></ul>
  40940. <span id="smartblur"></span><a name="smartblur-1"></a>
  40941. <h3 class="section">39.207 smartblur<span class="pull-right"><a class="anchor hidden-xs" href="#smartblur-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smartblur-1" aria-hidden="true">TOC</a></span></h3>
  40942. <p>Blur the input video without impacting the outlines.
  40943. </p>
  40944. <p>It accepts the following options:
  40945. </p>
  40946. <dl compact="compact">
  40947. <dt><samp>luma_radius, lr</samp></dt>
  40948. <dd><p>Set the luma radius. The option value must be a float number in
  40949. the range [0.1,5.0] that specifies the variance of the gaussian filter
  40950. used to blur the image (slower if larger). Default value is 1.0.
  40951. </p>
  40952. </dd>
  40953. <dt><samp>luma_strength, ls</samp></dt>
  40954. <dd><p>Set the luma strength. The option value must be a float number
  40955. in the range [-1.0,1.0] that configures the blurring. A value included
  40956. in [0.0,1.0] will blur the image whereas a value included in
  40957. [-1.0,0.0] will sharpen the image. Default value is 1.0.
  40958. </p>
  40959. </dd>
  40960. <dt><samp>luma_threshold, lt</samp></dt>
  40961. <dd><p>Set the luma threshold used as a coefficient to determine
  40962. whether a pixel should be blurred or not. The option value must be an
  40963. integer in the range [-30,30]. A value of 0 will filter all the image,
  40964. a value included in [0,30] will filter flat areas and a value included
  40965. in [-30,0] will filter edges. Default value is 0.
  40966. </p>
  40967. </dd>
  40968. <dt><samp>chroma_radius, cr</samp></dt>
  40969. <dd><p>Set the chroma radius. The option value must be a float number in
  40970. the range [0.1,5.0] that specifies the variance of the gaussian filter
  40971. used to blur the image (slower if larger). Default value is <samp>luma_radius</samp>.
  40972. </p>
  40973. </dd>
  40974. <dt><samp>chroma_strength, cs</samp></dt>
  40975. <dd><p>Set the chroma strength. The option value must be a float number
  40976. in the range [-1.0,1.0] that configures the blurring. A value included
  40977. in [0.0,1.0] will blur the image whereas a value included in
  40978. [-1.0,0.0] will sharpen the image. Default value is <samp>luma_strength</samp>.
  40979. </p>
  40980. </dd>
  40981. <dt><samp>chroma_threshold, ct</samp></dt>
  40982. <dd><p>Set the chroma threshold used as a coefficient to determine
  40983. whether a pixel should be blurred or not. The option value must be an
  40984. integer in the range [-30,30]. A value of 0 will filter all the image,
  40985. a value included in [0,30] will filter flat areas and a value included
  40986. in [-30,0] will filter edges. Default value is <samp>luma_threshold</samp>.
  40987. </p></dd>
  40988. </dl>
  40989. <p>If a chroma option is not explicitly set, the corresponding luma value
  40990. is set.
  40991. </p>
  40992. <a name="sobel"></a>
  40993. <h3 class="section">39.208 sobel<span class="pull-right"><a class="anchor hidden-xs" href="#sobel" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sobel" aria-hidden="true">TOC</a></span></h3>
  40994. <p>Apply sobel operator to input video stream.
  40995. </p>
  40996. <p>The filter accepts the following option:
  40997. </p>
  40998. <dl compact="compact">
  40999. <dt><samp>planes</samp></dt>
  41000. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  41001. By default value 0xf, all planes will be processed.
  41002. </p>
  41003. </dd>
  41004. <dt><samp>scale</samp></dt>
  41005. <dd><p>Set value which will be multiplied with filtered result.
  41006. </p>
  41007. </dd>
  41008. <dt><samp>delta</samp></dt>
  41009. <dd><p>Set value which will be added to filtered result.
  41010. </p></dd>
  41011. </dl>
  41012. <a name="Commands-123"></a>
  41013. <h4 class="subsection">39.208.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-123" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-123" aria-hidden="true">TOC</a></span></h4>
  41014. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  41015. </p>
  41016. <span id="spp"></span><a name="spp-1"></a>
  41017. <h3 class="section">39.209 spp<span class="pull-right"><a class="anchor hidden-xs" href="#spp-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-spp-1" aria-hidden="true">TOC</a></span></h3>
  41018. <p>Apply a simple postprocessing filter that compresses and decompresses the image
  41019. at several (or - in the case of <samp>quality</samp> level <code>6</code> - all) shifts
  41020. and average the results.
  41021. </p>
  41022. <p>The filter accepts the following options:
  41023. </p>
  41024. <dl compact="compact">
  41025. <dt><samp>quality</samp></dt>
  41026. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  41027. an integer in the range 0-6. If set to <code>0</code>, the filter will have no
  41028. effect. A value of <code>6</code> means the higher quality. For each increment of
  41029. that value the speed drops by a factor of approximately 2. Default value is
  41030. <code>3</code>.
  41031. </p>
  41032. </dd>
  41033. <dt><samp>qp</samp></dt>
  41034. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  41035. from the video stream (if available).
  41036. </p>
  41037. </dd>
  41038. <dt><samp>mode</samp></dt>
  41039. <dd><p>Set thresholding mode. Available modes are:
  41040. </p>
  41041. <dl compact="compact">
  41042. <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
  41043. <dd><p>Set hard thresholding (default).
  41044. </p></dd>
  41045. <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
  41046. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  41047. </p></dd>
  41048. </dl>
  41049. </dd>
  41050. <dt><samp>use_bframe_qp</samp></dt>
  41051. <dd><p>Enable the use of the QP from the B-Frames if set to <code>1</code>. Using this
  41052. option may cause flicker since the B-Frames have often larger QP. Default is
  41053. <code>0</code> (not enabled).
  41054. </p></dd>
  41055. </dl>
  41056. <a name="Commands-124"></a>
  41057. <h4 class="subsection">39.209.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-124" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-124" aria-hidden="true">TOC</a></span></h4>
  41058. <p>This filter supports the following commands:
  41059. </p><dl compact="compact">
  41060. <dt><samp>quality, level</samp></dt>
  41061. <dd><p>Set quality level. The value <code>max</code> can be used to set the maximum level,
  41062. currently <code>6</code>.
  41063. </p></dd>
  41064. </dl>
  41065. <span id="sr"></span><a name="sr-1"></a>
  41066. <h3 class="section">39.210 sr<span class="pull-right"><a class="anchor hidden-xs" href="#sr-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sr-1" aria-hidden="true">TOC</a></span></h3>
  41067. <p>Scale the input by applying one of the super-resolution methods based on
  41068. convolutional neural networks. Supported models:
  41069. </p>
  41070. <ul>
  41071. <li> Super-Resolution Convolutional Neural Network model (SRCNN).
  41072. See <a href="https://arxiv.org/abs/1501.00092">https://arxiv.org/abs/1501.00092</a>.
  41073. </li><li> Efficient Sub-Pixel Convolutional Neural Network model (ESPCN).
  41074. See <a href="https://arxiv.org/abs/1609.05158">https://arxiv.org/abs/1609.05158</a>.
  41075. </li></ul>
  41076. <p>Training scripts as well as scripts for model file (.pb) saving can be found at
  41077. <a href="https://github.com/XueweiMeng/sr/tree/sr_dnn_native">https://github.com/XueweiMeng/sr/tree/sr_dnn_native</a>. Original repository
  41078. is at <a href="https://github.com/HighVoltageRocknRoll/sr.git">https://github.com/HighVoltageRocknRoll/sr.git</a>.
  41079. </p>
  41080. <p>Native model files (.model) can be generated from TensorFlow model
  41081. files (.pb) by using tools/python/convert.py
  41082. </p>
  41083. <p>The filter accepts the following options:
  41084. </p>
  41085. <dl compact="compact">
  41086. <dt><samp>dnn_backend</samp></dt>
  41087. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  41088. the following values:
  41089. </p>
  41090. <dl compact="compact">
  41091. <dt>&lsquo;<samp>native</samp>&rsquo;</dt>
  41092. <dd><p>Native implementation of DNN loading and execution.
  41093. </p>
  41094. </dd>
  41095. <dt>&lsquo;<samp>tensorflow</samp>&rsquo;</dt>
  41096. <dd><p>TensorFlow backend. To enable this backend you
  41097. need to install the TensorFlow for C library (see
  41098. <a href="https://www.tensorflow.org/install/install_c">https://www.tensorflow.org/install/install_c</a>) and configure FFmpeg with
  41099. <code>--enable-libtensorflow</code>
  41100. </p></dd>
  41101. </dl>
  41102. <p>Default value is &lsquo;<samp>native</samp>&rsquo;.
  41103. </p>
  41104. </dd>
  41105. <dt><samp>model</samp></dt>
  41106. <dd><p>Set path to model file specifying network architecture and its parameters.
  41107. Note that different backends use different file formats. TensorFlow backend
  41108. can load files for both formats, while native backend can load files for only
  41109. its format.
  41110. </p>
  41111. </dd>
  41112. <dt><samp>scale_factor</samp></dt>
  41113. <dd><p>Set scale factor for SRCNN model. Allowed values are <code>2</code>, <code>3</code> and <code>4</code>.
  41114. Default value is <code>2</code>. Scale factor is necessary for SRCNN model, because it accepts
  41115. input upscaled using bicubic upscaling with proper scale factor.
  41116. </p></dd>
  41117. </dl>
  41118. <p>This feature can also be finished with <a href="#dnn_005fprocessing">dnn_processing</a> filter.
  41119. </p>
  41120. <a name="ssim"></a>
  41121. <h3 class="section">39.211 ssim<span class="pull-right"><a class="anchor hidden-xs" href="#ssim" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ssim" aria-hidden="true">TOC</a></span></h3>
  41122. <p>Obtain the SSIM (Structural SImilarity Metric) between two input videos.
  41123. </p>
  41124. <p>This filter takes in input two input videos, the first input is
  41125. considered the &quot;main&quot; source and is passed unchanged to the
  41126. output. The second input is used as a &quot;reference&quot; video for computing
  41127. the SSIM.
  41128. </p>
  41129. <p>Both video inputs must have the same resolution and pixel format for
  41130. this filter to work correctly. Also it assumes that both inputs
  41131. have the same number of frames, which are compared one by one.
  41132. </p>
  41133. <p>The filter stores the calculated SSIM of each frame.
  41134. </p>
  41135. <p>The description of the accepted parameters follows.
  41136. </p>
  41137. <dl compact="compact">
  41138. <dt><samp>stats_file, f</samp></dt>
  41139. <dd><p>If specified the filter will use the named file to save the SSIM of
  41140. each individual frame. When filename equals &quot;-&quot; the data is sent to
  41141. standard output.
  41142. </p></dd>
  41143. </dl>
  41144. <p>The file printed if <var>stats_file</var> is selected, contains a sequence of
  41145. key/value pairs of the form <var>key</var>:<var>value</var> for each compared
  41146. couple of frames.
  41147. </p>
  41148. <p>A description of each shown parameter follows:
  41149. </p>
  41150. <dl compact="compact">
  41151. <dt><samp>n</samp></dt>
  41152. <dd><p>sequential number of the input frame, starting from 1
  41153. </p>
  41154. </dd>
  41155. <dt><samp>Y, U, V, R, G, B</samp></dt>
  41156. <dd><p>SSIM of the compared frames for the component specified by the suffix.
  41157. </p>
  41158. </dd>
  41159. <dt><samp>All</samp></dt>
  41160. <dd><p>SSIM of the compared frames for the whole frame.
  41161. </p>
  41162. </dd>
  41163. <dt><samp>dB</samp></dt>
  41164. <dd><p>Same as above but in dB representation.
  41165. </p></dd>
  41166. </dl>
  41167. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  41168. </p>
  41169. <a name="Examples-146"></a>
  41170. <h4 class="subsection">39.211.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-146" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-146" aria-hidden="true">TOC</a></span></h4>
  41171. <ul>
  41172. <li> For example:
  41173. <div class="example">
  41174. <pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  41175. [main][ref] ssim=&quot;stats_file=stats.log&quot; [out]
  41176. </pre></div>
  41177. <p>On this example the input file being processed is compared with the
  41178. reference file <samp>ref_movie.mpg</samp>. The SSIM of each individual frame
  41179. is stored in <samp>stats.log</samp>.
  41180. </p>
  41181. </li><li> Another example with both psnr and ssim at same time:
  41182. <div class="example">
  41183. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi &quot;ssim;[0:v][1:v]psnr&quot; -f null -
  41184. </pre></div>
  41185. </li><li> Another example with different containers:
  41186. <div class="example">
  41187. <pre class="example">ffmpeg -i main.mpg -i ref.mkv -lavfi &quot;[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]ssim&quot; -f null -
  41188. </pre></div>
  41189. </li></ul>
  41190. <a name="stereo3d"></a>
  41191. <h3 class="section">39.212 stereo3d<span class="pull-right"><a class="anchor hidden-xs" href="#stereo3d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-stereo3d" aria-hidden="true">TOC</a></span></h3>
  41192. <p>Convert between different stereoscopic image formats.
  41193. </p>
  41194. <p>The filters accept the following options:
  41195. </p>
  41196. <dl compact="compact">
  41197. <dt><samp>in</samp></dt>
  41198. <dd><p>Set stereoscopic image format of input.
  41199. </p>
  41200. <p>Available values for input image formats are:
  41201. </p><dl compact="compact">
  41202. <dt>&lsquo;<samp>sbsl</samp>&rsquo;</dt>
  41203. <dd><p>side by side parallel (left eye left, right eye right)
  41204. </p>
  41205. </dd>
  41206. <dt>&lsquo;<samp>sbsr</samp>&rsquo;</dt>
  41207. <dd><p>side by side crosseye (right eye left, left eye right)
  41208. </p>
  41209. </dd>
  41210. <dt>&lsquo;<samp>sbs2l</samp>&rsquo;</dt>
  41211. <dd><p>side by side parallel with half width resolution
  41212. (left eye left, right eye right)
  41213. </p>
  41214. </dd>
  41215. <dt>&lsquo;<samp>sbs2r</samp>&rsquo;</dt>
  41216. <dd><p>side by side crosseye with half width resolution
  41217. (right eye left, left eye right)
  41218. </p>
  41219. </dd>
  41220. <dt>&lsquo;<samp>abl</samp>&rsquo;</dt>
  41221. <dt>&lsquo;<samp>tbl</samp>&rsquo;</dt>
  41222. <dd><p>above-below (left eye above, right eye below)
  41223. </p>
  41224. </dd>
  41225. <dt>&lsquo;<samp>abr</samp>&rsquo;</dt>
  41226. <dt>&lsquo;<samp>tbr</samp>&rsquo;</dt>
  41227. <dd><p>above-below (right eye above, left eye below)
  41228. </p>
  41229. </dd>
  41230. <dt>&lsquo;<samp>ab2l</samp>&rsquo;</dt>
  41231. <dt>&lsquo;<samp>tb2l</samp>&rsquo;</dt>
  41232. <dd><p>above-below with half height resolution
  41233. (left eye above, right eye below)
  41234. </p>
  41235. </dd>
  41236. <dt>&lsquo;<samp>ab2r</samp>&rsquo;</dt>
  41237. <dt>&lsquo;<samp>tb2r</samp>&rsquo;</dt>
  41238. <dd><p>above-below with half height resolution
  41239. (right eye above, left eye below)
  41240. </p>
  41241. </dd>
  41242. <dt>&lsquo;<samp>al</samp>&rsquo;</dt>
  41243. <dd><p>alternating frames (left eye first, right eye second)
  41244. </p>
  41245. </dd>
  41246. <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
  41247. <dd><p>alternating frames (right eye first, left eye second)
  41248. </p>
  41249. </dd>
  41250. <dt>&lsquo;<samp>irl</samp>&rsquo;</dt>
  41251. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  41252. </p>
  41253. </dd>
  41254. <dt>&lsquo;<samp>irr</samp>&rsquo;</dt>
  41255. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  41256. </p>
  41257. </dd>
  41258. <dt>&lsquo;<samp>icl</samp>&rsquo;</dt>
  41259. <dd><p>interleaved columns, left eye first
  41260. </p>
  41261. </dd>
  41262. <dt>&lsquo;<samp>icr</samp>&rsquo;</dt>
  41263. <dd><p>interleaved columns, right eye first
  41264. </p>
  41265. <p>Default value is &lsquo;<samp>sbsl</samp>&rsquo;.
  41266. </p></dd>
  41267. </dl>
  41268. </dd>
  41269. <dt><samp>out</samp></dt>
  41270. <dd><p>Set stereoscopic image format of output.
  41271. </p>
  41272. <dl compact="compact">
  41273. <dt>&lsquo;<samp>sbsl</samp>&rsquo;</dt>
  41274. <dd><p>side by side parallel (left eye left, right eye right)
  41275. </p>
  41276. </dd>
  41277. <dt>&lsquo;<samp>sbsr</samp>&rsquo;</dt>
  41278. <dd><p>side by side crosseye (right eye left, left eye right)
  41279. </p>
  41280. </dd>
  41281. <dt>&lsquo;<samp>sbs2l</samp>&rsquo;</dt>
  41282. <dd><p>side by side parallel with half width resolution
  41283. (left eye left, right eye right)
  41284. </p>
  41285. </dd>
  41286. <dt>&lsquo;<samp>sbs2r</samp>&rsquo;</dt>
  41287. <dd><p>side by side crosseye with half width resolution
  41288. (right eye left, left eye right)
  41289. </p>
  41290. </dd>
  41291. <dt>&lsquo;<samp>abl</samp>&rsquo;</dt>
  41292. <dt>&lsquo;<samp>tbl</samp>&rsquo;</dt>
  41293. <dd><p>above-below (left eye above, right eye below)
  41294. </p>
  41295. </dd>
  41296. <dt>&lsquo;<samp>abr</samp>&rsquo;</dt>
  41297. <dt>&lsquo;<samp>tbr</samp>&rsquo;</dt>
  41298. <dd><p>above-below (right eye above, left eye below)
  41299. </p>
  41300. </dd>
  41301. <dt>&lsquo;<samp>ab2l</samp>&rsquo;</dt>
  41302. <dt>&lsquo;<samp>tb2l</samp>&rsquo;</dt>
  41303. <dd><p>above-below with half height resolution
  41304. (left eye above, right eye below)
  41305. </p>
  41306. </dd>
  41307. <dt>&lsquo;<samp>ab2r</samp>&rsquo;</dt>
  41308. <dt>&lsquo;<samp>tb2r</samp>&rsquo;</dt>
  41309. <dd><p>above-below with half height resolution
  41310. (right eye above, left eye below)
  41311. </p>
  41312. </dd>
  41313. <dt>&lsquo;<samp>al</samp>&rsquo;</dt>
  41314. <dd><p>alternating frames (left eye first, right eye second)
  41315. </p>
  41316. </dd>
  41317. <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
  41318. <dd><p>alternating frames (right eye first, left eye second)
  41319. </p>
  41320. </dd>
  41321. <dt>&lsquo;<samp>irl</samp>&rsquo;</dt>
  41322. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  41323. </p>
  41324. </dd>
  41325. <dt>&lsquo;<samp>irr</samp>&rsquo;</dt>
  41326. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  41327. </p>
  41328. </dd>
  41329. <dt>&lsquo;<samp>arbg</samp>&rsquo;</dt>
  41330. <dd><p>anaglyph red/blue gray
  41331. (red filter on left eye, blue filter on right eye)
  41332. </p>
  41333. </dd>
  41334. <dt>&lsquo;<samp>argg</samp>&rsquo;</dt>
  41335. <dd><p>anaglyph red/green gray
  41336. (red filter on left eye, green filter on right eye)
  41337. </p>
  41338. </dd>
  41339. <dt>&lsquo;<samp>arcg</samp>&rsquo;</dt>
  41340. <dd><p>anaglyph red/cyan gray
  41341. (red filter on left eye, cyan filter on right eye)
  41342. </p>
  41343. </dd>
  41344. <dt>&lsquo;<samp>arch</samp>&rsquo;</dt>
  41345. <dd><p>anaglyph red/cyan half colored
  41346. (red filter on left eye, cyan filter on right eye)
  41347. </p>
  41348. </dd>
  41349. <dt>&lsquo;<samp>arcc</samp>&rsquo;</dt>
  41350. <dd><p>anaglyph red/cyan color
  41351. (red filter on left eye, cyan filter on right eye)
  41352. </p>
  41353. </dd>
  41354. <dt>&lsquo;<samp>arcd</samp>&rsquo;</dt>
  41355. <dd><p>anaglyph red/cyan color optimized with the least squares projection of dubois
  41356. (red filter on left eye, cyan filter on right eye)
  41357. </p>
  41358. </dd>
  41359. <dt>&lsquo;<samp>agmg</samp>&rsquo;</dt>
  41360. <dd><p>anaglyph green/magenta gray
  41361. (green filter on left eye, magenta filter on right eye)
  41362. </p>
  41363. </dd>
  41364. <dt>&lsquo;<samp>agmh</samp>&rsquo;</dt>
  41365. <dd><p>anaglyph green/magenta half colored
  41366. (green filter on left eye, magenta filter on right eye)
  41367. </p>
  41368. </dd>
  41369. <dt>&lsquo;<samp>agmc</samp>&rsquo;</dt>
  41370. <dd><p>anaglyph green/magenta colored
  41371. (green filter on left eye, magenta filter on right eye)
  41372. </p>
  41373. </dd>
  41374. <dt>&lsquo;<samp>agmd</samp>&rsquo;</dt>
  41375. <dd><p>anaglyph green/magenta color optimized with the least squares projection of dubois
  41376. (green filter on left eye, magenta filter on right eye)
  41377. </p>
  41378. </dd>
  41379. <dt>&lsquo;<samp>aybg</samp>&rsquo;</dt>
  41380. <dd><p>anaglyph yellow/blue gray
  41381. (yellow filter on left eye, blue filter on right eye)
  41382. </p>
  41383. </dd>
  41384. <dt>&lsquo;<samp>aybh</samp>&rsquo;</dt>
  41385. <dd><p>anaglyph yellow/blue half colored
  41386. (yellow filter on left eye, blue filter on right eye)
  41387. </p>
  41388. </dd>
  41389. <dt>&lsquo;<samp>aybc</samp>&rsquo;</dt>
  41390. <dd><p>anaglyph yellow/blue colored
  41391. (yellow filter on left eye, blue filter on right eye)
  41392. </p>
  41393. </dd>
  41394. <dt>&lsquo;<samp>aybd</samp>&rsquo;</dt>
  41395. <dd><p>anaglyph yellow/blue color optimized with the least squares projection of dubois
  41396. (yellow filter on left eye, blue filter on right eye)
  41397. </p>
  41398. </dd>
  41399. <dt>&lsquo;<samp>ml</samp>&rsquo;</dt>
  41400. <dd><p>mono output (left eye only)
  41401. </p>
  41402. </dd>
  41403. <dt>&lsquo;<samp>mr</samp>&rsquo;</dt>
  41404. <dd><p>mono output (right eye only)
  41405. </p>
  41406. </dd>
  41407. <dt>&lsquo;<samp>chl</samp>&rsquo;</dt>
  41408. <dd><p>checkerboard, left eye first
  41409. </p>
  41410. </dd>
  41411. <dt>&lsquo;<samp>chr</samp>&rsquo;</dt>
  41412. <dd><p>checkerboard, right eye first
  41413. </p>
  41414. </dd>
  41415. <dt>&lsquo;<samp>icl</samp>&rsquo;</dt>
  41416. <dd><p>interleaved columns, left eye first
  41417. </p>
  41418. </dd>
  41419. <dt>&lsquo;<samp>icr</samp>&rsquo;</dt>
  41420. <dd><p>interleaved columns, right eye first
  41421. </p>
  41422. </dd>
  41423. <dt>&lsquo;<samp>hdmi</samp>&rsquo;</dt>
  41424. <dd><p>HDMI frame pack
  41425. </p></dd>
  41426. </dl>
  41427. <p>Default value is &lsquo;<samp>arcd</samp>&rsquo;.
  41428. </p></dd>
  41429. </dl>
  41430. <a name="Examples-147"></a>
  41431. <h4 class="subsection">39.212.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-147" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-147" aria-hidden="true">TOC</a></span></h4>
  41432. <ul>
  41433. <li> Convert input video from side by side parallel to anaglyph yellow/blue dubois:
  41434. <div class="example">
  41435. <pre class="example">stereo3d=sbsl:aybd
  41436. </pre></div>
  41437. </li><li> Convert input video from above below (left eye above, right eye below) to side by side crosseye.
  41438. <div class="example">
  41439. <pre class="example">stereo3d=abl:sbsr
  41440. </pre></div>
  41441. </li></ul>
  41442. <a name="streamselect_002c-astreamselect"></a>
  41443. <h3 class="section">39.213 streamselect, astreamselect<span class="pull-right"><a class="anchor hidden-xs" href="#streamselect_002c-astreamselect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-streamselect_002c-astreamselect" aria-hidden="true">TOC</a></span></h3>
  41444. <p>Select video or audio streams.
  41445. </p>
  41446. <p>The filter accepts the following options:
  41447. </p>
  41448. <dl compact="compact">
  41449. <dt><samp>inputs</samp></dt>
  41450. <dd><p>Set number of inputs. Default is 2.
  41451. </p>
  41452. </dd>
  41453. <dt><samp>map</samp></dt>
  41454. <dd><p>Set input indexes to remap to outputs.
  41455. </p></dd>
  41456. </dl>
  41457. <a name="Commands-125"></a>
  41458. <h4 class="subsection">39.213.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-125" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-125" aria-hidden="true">TOC</a></span></h4>
  41459. <p>The <code>streamselect</code> and <code>astreamselect</code> filter supports the following
  41460. commands:
  41461. </p>
  41462. <dl compact="compact">
  41463. <dt><samp>map</samp></dt>
  41464. <dd><p>Set input indexes to remap to outputs.
  41465. </p></dd>
  41466. </dl>
  41467. <a name="Examples-148"></a>
  41468. <h4 class="subsection">39.213.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-148" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-148" aria-hidden="true">TOC</a></span></h4>
  41469. <ul>
  41470. <li> Select first 5 seconds 1st stream and rest of time 2nd stream:
  41471. <div class="example">
  41472. <pre class="example">sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
  41473. </pre></div>
  41474. </li><li> Same as above, but for audio:
  41475. <div class="example">
  41476. <pre class="example">asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
  41477. </pre></div>
  41478. </li></ul>
  41479. <span id="subtitles"></span><a name="subtitles-1"></a>
  41480. <h3 class="section">39.214 subtitles<span class="pull-right"><a class="anchor hidden-xs" href="#subtitles-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-subtitles-1" aria-hidden="true">TOC</a></span></h3>
  41481. <p>Draw subtitles on top of input video using the libass library.
  41482. </p>
  41483. <p>To enable compilation of this filter you need to configure FFmpeg with
  41484. <code>--enable-libass</code>. This filter also requires a build with libavcodec and
  41485. libavformat to convert the passed subtitles file to ASS (Advanced Substation
  41486. Alpha) subtitles format.
  41487. </p>
  41488. <p>The filter accepts the following options:
  41489. </p>
  41490. <dl compact="compact">
  41491. <dt><samp>filename, f</samp></dt>
  41492. <dd><p>Set the filename of the subtitle file to read. It must be specified.
  41493. </p>
  41494. </dd>
  41495. <dt><samp>original_size</samp></dt>
  41496. <dd><p>Specify the size of the original video, the video for which the ASS file
  41497. was composed. For the syntax of this option, check the
  41498. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  41499. Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to
  41500. correctly scale the fonts if the aspect ratio has been changed.
  41501. </p>
  41502. </dd>
  41503. <dt><samp>fontsdir</samp></dt>
  41504. <dd><p>Set a directory path containing fonts that can be used by the filter.
  41505. These fonts will be used in addition to whatever the font provider uses.
  41506. </p>
  41507. </dd>
  41508. <dt><samp>alpha</samp></dt>
  41509. <dd><p>Process alpha channel, by default alpha channel is untouched.
  41510. </p>
  41511. </dd>
  41512. <dt><samp>charenc</samp></dt>
  41513. <dd><p>Set subtitles input character encoding. <code>subtitles</code> filter only. Only
  41514. useful if not UTF-8.
  41515. </p>
  41516. </dd>
  41517. <dt><samp>stream_index, si</samp></dt>
  41518. <dd><p>Set subtitles stream index. <code>subtitles</code> filter only.
  41519. </p>
  41520. </dd>
  41521. <dt><samp>force_style</samp></dt>
  41522. <dd><p>Override default style or script info parameters of the subtitles. It accepts a
  41523. string containing ASS style format <code>KEY=VALUE</code> couples separated by &quot;,&quot;.
  41524. </p></dd>
  41525. </dl>
  41526. <p>If the first key is not specified, it is assumed that the first value
  41527. specifies the <samp>filename</samp>.
  41528. </p>
  41529. <p>For example, to render the file <samp>sub.srt</samp> on top of the input
  41530. video, use the command:
  41531. </p><div class="example">
  41532. <pre class="example">subtitles=sub.srt
  41533. </pre></div>
  41534. <p>which is equivalent to:
  41535. </p><div class="example">
  41536. <pre class="example">subtitles=filename=sub.srt
  41537. </pre></div>
  41538. <p>To render the default subtitles stream from file <samp>video.mkv</samp>, use:
  41539. </p><div class="example">
  41540. <pre class="example">subtitles=video.mkv
  41541. </pre></div>
  41542. <p>To render the second subtitles stream from that file, use:
  41543. </p><div class="example">
  41544. <pre class="example">subtitles=video.mkv:si=1
  41545. </pre></div>
  41546. <p>To make the subtitles stream from <samp>sub.srt</samp> appear in 80% transparent blue
  41547. <code>DejaVu Serif</code>, use:
  41548. </p><div class="example">
  41549. <pre class="example">subtitles=sub.srt:force_style='Fontname=DejaVu Serif,PrimaryColour=&amp;HCCFF0000'
  41550. </pre></div>
  41551. <a name="super2xsai"></a>
  41552. <h3 class="section">39.215 super2xsai<span class="pull-right"><a class="anchor hidden-xs" href="#super2xsai" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-super2xsai" aria-hidden="true">TOC</a></span></h3>
  41553. <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
  41554. Interpolate) pixel art scaling algorithm.
  41555. </p>
  41556. <p>Useful for enlarging pixel art images without reducing sharpness.
  41557. </p>
  41558. <a name="swaprect"></a>
  41559. <h3 class="section">39.216 swaprect<span class="pull-right"><a class="anchor hidden-xs" href="#swaprect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-swaprect" aria-hidden="true">TOC</a></span></h3>
  41560. <p>Swap two rectangular objects in video.
  41561. </p>
  41562. <p>This filter accepts the following options:
  41563. </p>
  41564. <dl compact="compact">
  41565. <dt><samp>w</samp></dt>
  41566. <dd><p>Set object width.
  41567. </p>
  41568. </dd>
  41569. <dt><samp>h</samp></dt>
  41570. <dd><p>Set object height.
  41571. </p>
  41572. </dd>
  41573. <dt><samp>x1</samp></dt>
  41574. <dd><p>Set 1st rect x coordinate.
  41575. </p>
  41576. </dd>
  41577. <dt><samp>y1</samp></dt>
  41578. <dd><p>Set 1st rect y coordinate.
  41579. </p>
  41580. </dd>
  41581. <dt><samp>x2</samp></dt>
  41582. <dd><p>Set 2nd rect x coordinate.
  41583. </p>
  41584. </dd>
  41585. <dt><samp>y2</samp></dt>
  41586. <dd><p>Set 2nd rect y coordinate.
  41587. </p>
  41588. <p>All expressions are evaluated once for each frame.
  41589. </p></dd>
  41590. </dl>
  41591. <p>The all options are expressions containing the following constants:
  41592. </p>
  41593. <dl compact="compact">
  41594. <dt><samp>w</samp></dt>
  41595. <dt><samp>h</samp></dt>
  41596. <dd><p>The input width and height.
  41597. </p>
  41598. </dd>
  41599. <dt><samp>a</samp></dt>
  41600. <dd><p>same as <var>w</var> / <var>h</var>
  41601. </p>
  41602. </dd>
  41603. <dt><samp>sar</samp></dt>
  41604. <dd><p>input sample aspect ratio
  41605. </p>
  41606. </dd>
  41607. <dt><samp>dar</samp></dt>
  41608. <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
  41609. </p>
  41610. </dd>
  41611. <dt><samp>n</samp></dt>
  41612. <dd><p>The number of the input frame, starting from 0.
  41613. </p>
  41614. </dd>
  41615. <dt><samp>t</samp></dt>
  41616. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  41617. </p>
  41618. </dd>
  41619. <dt><samp>pos</samp></dt>
  41620. <dd><p>the position in the file of the input frame, NAN if unknown
  41621. </p></dd>
  41622. </dl>
  41623. <a name="Commands-126"></a>
  41624. <h4 class="subsection">39.216.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-126" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-126" aria-hidden="true">TOC</a></span></h4>
  41625. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  41626. </p>
  41627. <a name="swapuv"></a>
  41628. <h3 class="section">39.217 swapuv<span class="pull-right"><a class="anchor hidden-xs" href="#swapuv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-swapuv" aria-hidden="true">TOC</a></span></h3>
  41629. <p>Swap U &amp; V plane.
  41630. </p>
  41631. <a name="tblend"></a>
  41632. <h3 class="section">39.218 tblend<span class="pull-right"><a class="anchor hidden-xs" href="#tblend" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tblend" aria-hidden="true">TOC</a></span></h3>
  41633. <p>Blend successive video frames.
  41634. </p>
  41635. <p>See <a href="#blend">blend</a>
  41636. </p>
  41637. <a name="telecine"></a>
  41638. <h3 class="section">39.219 telecine<span class="pull-right"><a class="anchor hidden-xs" href="#telecine" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-telecine" aria-hidden="true">TOC</a></span></h3>
  41639. <p>Apply telecine process to the video.
  41640. </p>
  41641. <p>This filter accepts the following options:
  41642. </p>
  41643. <dl compact="compact">
  41644. <dt><samp>first_field</samp></dt>
  41645. <dd><dl compact="compact">
  41646. <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
  41647. <dd><p>top field first
  41648. </p></dd>
  41649. <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
  41650. <dd><p>bottom field first
  41651. The default value is <code>top</code>.
  41652. </p></dd>
  41653. </dl>
  41654. </dd>
  41655. <dt><samp>pattern</samp></dt>
  41656. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  41657. The default value is <code>23</code>.
  41658. </p></dd>
  41659. </dl>
  41660. <div class="example">
  41661. <pre class="example">Some typical patterns:
  41662. NTSC output (30i):
  41663. 27.5p: 32222
  41664. 24p: 23 (classic)
  41665. 24p: 2332 (preferred)
  41666. 20p: 33
  41667. 18p: 334
  41668. 16p: 3444
  41669. PAL output (25i):
  41670. 27.5p: 12222
  41671. 24p: 222222222223 (&quot;Euro pulldown&quot;)
  41672. 16.67p: 33
  41673. 16p: 33333334
  41674. </pre></div>
  41675. <a name="thistogram"></a>
  41676. <h3 class="section">39.220 thistogram<span class="pull-right"><a class="anchor hidden-xs" href="#thistogram" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-thistogram" aria-hidden="true">TOC</a></span></h3>
  41677. <p>Compute and draw a color distribution histogram for the input video across time.
  41678. </p>
  41679. <p>Unlike <a href="#histogram">histogram</a> video filter which only shows histogram of single input frame
  41680. at certain time, this filter shows also past histograms of number of frames defined
  41681. by <code>width</code> option.
  41682. </p>
  41683. <p>The computed histogram is a representation of the color component
  41684. distribution in an image.
  41685. </p>
  41686. <p>The filter accepts the following options:
  41687. </p>
  41688. <dl compact="compact">
  41689. <dt><samp>width, w</samp></dt>
  41690. <dd><p>Set width of single color component output. Default value is <code>0</code>.
  41691. Value of <code>0</code> means width will be picked from input video.
  41692. This also set number of passed histograms to keep.
  41693. Allowed range is [0, 8192].
  41694. </p>
  41695. </dd>
  41696. <dt><samp>display_mode, d</samp></dt>
  41697. <dd><p>Set display mode.
  41698. It accepts the following values:
  41699. </p><dl compact="compact">
  41700. <dt>&lsquo;<samp>stack</samp>&rsquo;</dt>
  41701. <dd><p>Per color component graphs are placed below each other.
  41702. </p>
  41703. </dd>
  41704. <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
  41705. <dd><p>Per color component graphs are placed side by side.
  41706. </p>
  41707. </dd>
  41708. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  41709. <dd><p>Presents information identical to that in the <code>parade</code>, except
  41710. that the graphs representing color components are superimposed directly
  41711. over one another.
  41712. </p></dd>
  41713. </dl>
  41714. <p>Default is <code>stack</code>.
  41715. </p>
  41716. </dd>
  41717. <dt><samp>levels_mode, m</samp></dt>
  41718. <dd><p>Set mode. Can be either <code>linear</code>, or <code>logarithmic</code>.
  41719. Default is <code>linear</code>.
  41720. </p>
  41721. </dd>
  41722. <dt><samp>components, c</samp></dt>
  41723. <dd><p>Set what color components to display.
  41724. Default is <code>7</code>.
  41725. </p>
  41726. </dd>
  41727. <dt><samp>bgopacity, b</samp></dt>
  41728. <dd><p>Set background opacity. Default is <code>0.9</code>.
  41729. </p>
  41730. </dd>
  41731. <dt><samp>envelope, e</samp></dt>
  41732. <dd><p>Show envelope. Default is disabled.
  41733. </p>
  41734. </dd>
  41735. <dt><samp>ecolor, ec</samp></dt>
  41736. <dd><p>Set envelope color. Default is <code>gold</code>.
  41737. </p>
  41738. </dd>
  41739. <dt><samp>slide</samp></dt>
  41740. <dd><p>Set slide mode.
  41741. </p>
  41742. <p>Available values for slide is:
  41743. </p><dl compact="compact">
  41744. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  41745. <dd><p>Draw new frame when right border is reached.
  41746. </p>
  41747. </dd>
  41748. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  41749. <dd><p>Replace old columns with new ones.
  41750. </p>
  41751. </dd>
  41752. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  41753. <dd><p>Scroll from right to left.
  41754. </p>
  41755. </dd>
  41756. <dt>&lsquo;<samp>rscroll</samp>&rsquo;</dt>
  41757. <dd><p>Scroll from left to right.
  41758. </p>
  41759. </dd>
  41760. <dt>&lsquo;<samp>picture</samp>&rsquo;</dt>
  41761. <dd><p>Draw single picture.
  41762. </p></dd>
  41763. </dl>
  41764. <p>Default is <code>replace</code>.
  41765. </p></dd>
  41766. </dl>
  41767. <a name="threshold"></a>
  41768. <h3 class="section">39.221 threshold<span class="pull-right"><a class="anchor hidden-xs" href="#threshold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-threshold" aria-hidden="true">TOC</a></span></h3>
  41769. <p>Apply threshold effect to video stream.
  41770. </p>
  41771. <p>This filter needs four video streams to perform thresholding.
  41772. First stream is stream we are filtering.
  41773. Second stream is holding threshold values, third stream is holding min values,
  41774. and last, fourth stream is holding max values.
  41775. </p>
  41776. <p>The filter accepts the following option:
  41777. </p>
  41778. <dl compact="compact">
  41779. <dt><samp>planes</samp></dt>
  41780. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  41781. By default value 0xf, all planes will be processed.
  41782. </p></dd>
  41783. </dl>
  41784. <p>For example if first stream pixel&rsquo;s component value is less then threshold value
  41785. of pixel component from 2nd threshold stream, third stream value will picked,
  41786. otherwise fourth stream pixel component value will be picked.
  41787. </p>
  41788. <p>Using color source filter one can perform various types of thresholding:
  41789. </p>
  41790. <a name="Examples-149"></a>
  41791. <h4 class="subsection">39.221.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-149" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-149" aria-hidden="true">TOC</a></span></h4>
  41792. <ul>
  41793. <li> Binary threshold, using gray color as threshold:
  41794. <div class="example">
  41795. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=black -f lavfi -i color=white -lavfi threshold output.avi
  41796. </pre></div>
  41797. </li><li> Inverted binary threshold, using gray color as threshold:
  41798. <div class="example">
  41799. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -f lavfi -i color=black -lavfi threshold output.avi
  41800. </pre></div>
  41801. </li><li> Truncate binary threshold, using gray color as threshold:
  41802. <div class="example">
  41803. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=gray -lavfi threshold output.avi
  41804. </pre></div>
  41805. </li><li> Threshold to zero, using gray color as threshold:
  41806. <div class="example">
  41807. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -i 320x240.avi -lavfi threshold output.avi
  41808. </pre></div>
  41809. </li><li> Inverted threshold to zero, using gray color as threshold:
  41810. <div class="example">
  41811. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=white -lavfi threshold output.avi
  41812. </pre></div>
  41813. </li></ul>
  41814. <a name="thumbnail"></a>
  41815. <h3 class="section">39.222 thumbnail<span class="pull-right"><a class="anchor hidden-xs" href="#thumbnail" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-thumbnail" aria-hidden="true">TOC</a></span></h3>
  41816. <p>Select the most representative frame in a given sequence of consecutive frames.
  41817. </p>
  41818. <p>The filter accepts the following options:
  41819. </p>
  41820. <dl compact="compact">
  41821. <dt><samp>n</samp></dt>
  41822. <dd><p>Set the frames batch size to analyze; in a set of <var>n</var> frames, the filter
  41823. will pick one of them, and then handle the next batch of <var>n</var> frames until
  41824. the end. Default is <code>100</code>.
  41825. </p></dd>
  41826. </dl>
  41827. <p>Since the filter keeps track of the whole frames sequence, a bigger <var>n</var>
  41828. value will result in a higher memory usage, so a high value is not recommended.
  41829. </p>
  41830. <a name="Examples-150"></a>
  41831. <h4 class="subsection">39.222.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-150" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-150" aria-hidden="true">TOC</a></span></h4>
  41832. <ul>
  41833. <li> Extract one picture each 50 frames:
  41834. <div class="example">
  41835. <pre class="example">thumbnail=50
  41836. </pre></div>
  41837. </li><li> Complete example of a thumbnail creation with <code>ffmpeg</code>:
  41838. <div class="example">
  41839. <pre class="example">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
  41840. </pre></div>
  41841. </li></ul>
  41842. <span id="tile"></span><a name="tile-1"></a>
  41843. <h3 class="section">39.223 tile<span class="pull-right"><a class="anchor hidden-xs" href="#tile-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tile-1" aria-hidden="true">TOC</a></span></h3>
  41844. <p>Tile several successive frames together.
  41845. </p>
  41846. <p>The <a href="#untile">untile</a> filter can do the reverse.
  41847. </p>
  41848. <p>The filter accepts the following options:
  41849. </p>
  41850. <dl compact="compact">
  41851. <dt><samp>layout</samp></dt>
  41852. <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
  41853. this option, check the
  41854. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  41855. </p>
  41856. </dd>
  41857. <dt><samp>nb_frames</samp></dt>
  41858. <dd><p>Set the maximum number of frames to render in the given area. It must be less
  41859. than or equal to <var>w</var>x<var>h</var>. The default value is <code>0</code>, meaning all
  41860. the area will be used.
  41861. </p>
  41862. </dd>
  41863. <dt><samp>margin</samp></dt>
  41864. <dd><p>Set the outer border margin in pixels.
  41865. </p>
  41866. </dd>
  41867. <dt><samp>padding</samp></dt>
  41868. <dd><p>Set the inner border thickness (i.e. the number of pixels between frames). For
  41869. more advanced padding options (such as having different values for the edges),
  41870. refer to the pad video filter.
  41871. </p>
  41872. </dd>
  41873. <dt><samp>color</samp></dt>
  41874. <dd><p>Specify the color of the unused area. For the syntax of this option, check the
  41875. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  41876. The default value of <var>color</var> is &quot;black&quot;.
  41877. </p>
  41878. </dd>
  41879. <dt><samp>overlap</samp></dt>
  41880. <dd><p>Set the number of frames to overlap when tiling several successive frames together.
  41881. The value must be between <code>0</code> and <var>nb_frames - 1</var>.
  41882. </p>
  41883. </dd>
  41884. <dt><samp>init_padding</samp></dt>
  41885. <dd><p>Set the number of frames to initially be empty before displaying first output frame.
  41886. This controls how soon will one get first output frame.
  41887. The value must be between <code>0</code> and <var>nb_frames - 1</var>.
  41888. </p></dd>
  41889. </dl>
  41890. <a name="Examples-151"></a>
  41891. <h4 class="subsection">39.223.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-151" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-151" aria-hidden="true">TOC</a></span></h4>
  41892. <ul>
  41893. <li> Produce 8x8 PNG tiles of all keyframes (<samp>-skip_frame nokey</samp>) in a movie:
  41894. <div class="example">
  41895. <pre class="example">ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
  41896. </pre></div>
  41897. <p>The <samp>-vsync 0</samp> is necessary to prevent <code>ffmpeg</code> from
  41898. duplicating each output frame to accommodate the originally detected frame
  41899. rate.
  41900. </p>
  41901. </li><li> Display <code>5</code> pictures in an area of <code>3x2</code> frames,
  41902. with <code>7</code> pixels between them, and <code>2</code> pixels of initial margin, using
  41903. mixed flat and named options:
  41904. <div class="example">
  41905. <pre class="example">tile=3x2:nb_frames=5:padding=7:margin=2
  41906. </pre></div>
  41907. </li></ul>
  41908. <a name="tinterlace"></a>
  41909. <h3 class="section">39.224 tinterlace<span class="pull-right"><a class="anchor hidden-xs" href="#tinterlace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tinterlace" aria-hidden="true">TOC</a></span></h3>
  41910. <p>Perform various types of temporal field interlacing.
  41911. </p>
  41912. <p>Frames are counted starting from 1, so the first input frame is
  41913. considered odd.
  41914. </p>
  41915. <p>The filter accepts the following options:
  41916. </p>
  41917. <dl compact="compact">
  41918. <dt><samp>mode</samp></dt>
  41919. <dd><p>Specify the mode of the interlacing. This option can also be specified
  41920. as a value alone. See below for a list of values for this option.
  41921. </p>
  41922. <p>Available values are:
  41923. </p>
  41924. <dl compact="compact">
  41925. <dt>&lsquo;<samp>merge, 0</samp>&rsquo;</dt>
  41926. <dd><p>Move odd frames into the upper field, even into the lower field,
  41927. generating a double height frame at half frame rate.
  41928. </p><div class="example">
  41929. <pre class="example"> ------&gt; time
  41930. Input:
  41931. Frame 1 Frame 2 Frame 3 Frame 4
  41932. 11111 22222 33333 44444
  41933. 11111 22222 33333 44444
  41934. 11111 22222 33333 44444
  41935. 11111 22222 33333 44444
  41936. Output:
  41937. 11111 33333
  41938. 22222 44444
  41939. 11111 33333
  41940. 22222 44444
  41941. 11111 33333
  41942. 22222 44444
  41943. 11111 33333
  41944. 22222 44444
  41945. </pre></div>
  41946. </dd>
  41947. <dt>&lsquo;<samp>drop_even, 1</samp>&rsquo;</dt>
  41948. <dd><p>Only output odd frames, even frames are dropped, generating a frame with
  41949. unchanged height at half frame rate.
  41950. </p>
  41951. <div class="example">
  41952. <pre class="example"> ------&gt; time
  41953. Input:
  41954. Frame 1 Frame 2 Frame 3 Frame 4
  41955. 11111 22222 33333 44444
  41956. 11111 22222 33333 44444
  41957. 11111 22222 33333 44444
  41958. 11111 22222 33333 44444
  41959. Output:
  41960. 11111 33333
  41961. 11111 33333
  41962. 11111 33333
  41963. 11111 33333
  41964. </pre></div>
  41965. </dd>
  41966. <dt>&lsquo;<samp>drop_odd, 2</samp>&rsquo;</dt>
  41967. <dd><p>Only output even frames, odd frames are dropped, generating a frame with
  41968. unchanged height at half frame rate.
  41969. </p>
  41970. <div class="example">
  41971. <pre class="example"> ------&gt; time
  41972. Input:
  41973. Frame 1 Frame 2 Frame 3 Frame 4
  41974. 11111 22222 33333 44444
  41975. 11111 22222 33333 44444
  41976. 11111 22222 33333 44444
  41977. 11111 22222 33333 44444
  41978. Output:
  41979. 22222 44444
  41980. 22222 44444
  41981. 22222 44444
  41982. 22222 44444
  41983. </pre></div>
  41984. </dd>
  41985. <dt>&lsquo;<samp>pad, 3</samp>&rsquo;</dt>
  41986. <dd><p>Expand each frame to full height, but pad alternate lines with black,
  41987. generating a frame with double height at the same input frame rate.
  41988. </p>
  41989. <div class="example">
  41990. <pre class="example"> ------&gt; time
  41991. Input:
  41992. Frame 1 Frame 2 Frame 3 Frame 4
  41993. 11111 22222 33333 44444
  41994. 11111 22222 33333 44444
  41995. 11111 22222 33333 44444
  41996. 11111 22222 33333 44444
  41997. Output:
  41998. 11111 ..... 33333 .....
  41999. ..... 22222 ..... 44444
  42000. 11111 ..... 33333 .....
  42001. ..... 22222 ..... 44444
  42002. 11111 ..... 33333 .....
  42003. ..... 22222 ..... 44444
  42004. 11111 ..... 33333 .....
  42005. ..... 22222 ..... 44444
  42006. </pre></div>
  42007. </dd>
  42008. <dt>&lsquo;<samp>interleave_top, 4</samp>&rsquo;</dt>
  42009. <dd><p>Interleave the upper field from odd frames with the lower field from
  42010. even frames, generating a frame with unchanged height at half frame rate.
  42011. </p>
  42012. <div class="example">
  42013. <pre class="example"> ------&gt; time
  42014. Input:
  42015. Frame 1 Frame 2 Frame 3 Frame 4
  42016. 11111&lt;- 22222 33333&lt;- 44444
  42017. 11111 22222&lt;- 33333 44444&lt;-
  42018. 11111&lt;- 22222 33333&lt;- 44444
  42019. 11111 22222&lt;- 33333 44444&lt;-
  42020. Output:
  42021. 11111 33333
  42022. 22222 44444
  42023. 11111 33333
  42024. 22222 44444
  42025. </pre></div>
  42026. </dd>
  42027. <dt>&lsquo;<samp>interleave_bottom, 5</samp>&rsquo;</dt>
  42028. <dd><p>Interleave the lower field from odd frames with the upper field from
  42029. even frames, generating a frame with unchanged height at half frame rate.
  42030. </p>
  42031. <div class="example">
  42032. <pre class="example"> ------&gt; time
  42033. Input:
  42034. Frame 1 Frame 2 Frame 3 Frame 4
  42035. 11111 22222&lt;- 33333 44444&lt;-
  42036. 11111&lt;- 22222 33333&lt;- 44444
  42037. 11111 22222&lt;- 33333 44444&lt;-
  42038. 11111&lt;- 22222 33333&lt;- 44444
  42039. Output:
  42040. 22222 44444
  42041. 11111 33333
  42042. 22222 44444
  42043. 11111 33333
  42044. </pre></div>
  42045. </dd>
  42046. <dt>&lsquo;<samp>interlacex2, 6</samp>&rsquo;</dt>
  42047. <dd><p>Double frame rate with unchanged height. Frames are inserted each
  42048. containing the second temporal field from the previous input frame and
  42049. the first temporal field from the next input frame. This mode relies on
  42050. the top_field_first flag. Useful for interlaced video displays with no
  42051. field synchronisation.
  42052. </p>
  42053. <div class="example">
  42054. <pre class="example"> ------&gt; time
  42055. Input:
  42056. Frame 1 Frame 2 Frame 3 Frame 4
  42057. 11111 22222 33333 44444
  42058. 11111 22222 33333 44444
  42059. 11111 22222 33333 44444
  42060. 11111 22222 33333 44444
  42061. Output:
  42062. 11111 22222 22222 33333 33333 44444 44444
  42063. 11111 11111 22222 22222 33333 33333 44444
  42064. 11111 22222 22222 33333 33333 44444 44444
  42065. 11111 11111 22222 22222 33333 33333 44444
  42066. </pre></div>
  42067. </dd>
  42068. <dt>&lsquo;<samp>mergex2, 7</samp>&rsquo;</dt>
  42069. <dd><p>Move odd frames into the upper field, even into the lower field,
  42070. generating a double height frame at same frame rate.
  42071. </p>
  42072. <div class="example">
  42073. <pre class="example"> ------&gt; time
  42074. Input:
  42075. Frame 1 Frame 2 Frame 3 Frame 4
  42076. 11111 22222 33333 44444
  42077. 11111 22222 33333 44444
  42078. 11111 22222 33333 44444
  42079. 11111 22222 33333 44444
  42080. Output:
  42081. 11111 33333 33333 55555
  42082. 22222 22222 44444 44444
  42083. 11111 33333 33333 55555
  42084. 22222 22222 44444 44444
  42085. 11111 33333 33333 55555
  42086. 22222 22222 44444 44444
  42087. 11111 33333 33333 55555
  42088. 22222 22222 44444 44444
  42089. </pre></div>
  42090. </dd>
  42091. </dl>
  42092. <p>Numeric values are deprecated but are accepted for backward
  42093. compatibility reasons.
  42094. </p>
  42095. <p>Default mode is <code>merge</code>.
  42096. </p>
  42097. </dd>
  42098. <dt><samp>flags</samp></dt>
  42099. <dd><p>Specify flags influencing the filter process.
  42100. </p>
  42101. <p>Available value for <var>flags</var> is:
  42102. </p>
  42103. <dl compact="compact">
  42104. <dt><samp>low_pass_filter, vlpf</samp></dt>
  42105. <dd><p>Enable linear vertical low-pass filtering in the filter.
  42106. Vertical low-pass filtering is required when creating an interlaced
  42107. destination from a progressive source which contains high-frequency
  42108. vertical detail. Filtering will reduce interlace &rsquo;twitter&rsquo; and Moire
  42109. patterning.
  42110. </p>
  42111. </dd>
  42112. <dt><samp>complex_filter, cvlpf</samp></dt>
  42113. <dd><p>Enable complex vertical low-pass filtering.
  42114. This will slightly less reduce interlace &rsquo;twitter&rsquo; and Moire
  42115. patterning but better retain detail and subjective sharpness impression.
  42116. </p>
  42117. </dd>
  42118. <dt><samp>bypass_il</samp></dt>
  42119. <dd><p>Bypass already interlaced frames, only adjust the frame rate.
  42120. </p></dd>
  42121. </dl>
  42122. <p>Vertical low-pass filtering and bypassing already interlaced frames can only be
  42123. enabled for <samp>mode</samp> <var>interleave_top</var> and <var>interleave_bottom</var>.
  42124. </p>
  42125. </dd>
  42126. </dl>
  42127. <a name="tmedian"></a>
  42128. <h3 class="section">39.225 tmedian<span class="pull-right"><a class="anchor hidden-xs" href="#tmedian" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tmedian" aria-hidden="true">TOC</a></span></h3>
  42129. <p>Pick median pixels from several successive input video frames.
  42130. </p>
  42131. <p>The filter accepts the following options:
  42132. </p>
  42133. <dl compact="compact">
  42134. <dt><samp>radius</samp></dt>
  42135. <dd><p>Set radius of median filter.
  42136. Default is 1. Allowed range is from 1 to 127.
  42137. </p>
  42138. </dd>
  42139. <dt><samp>planes</samp></dt>
  42140. <dd><p>Set which planes to filter. Default value is <code>15</code>, by which all planes are processed.
  42141. </p>
  42142. </dd>
  42143. <dt><samp>percentile</samp></dt>
  42144. <dd><p>Set median percentile. Default value is <code>0.5</code>.
  42145. Default value of <code>0.5</code> will pick always median values, while <code>0</code> will pick
  42146. minimum values, and <code>1</code> maximum values.
  42147. </p></dd>
  42148. </dl>
  42149. <a name="Commands-127"></a>
  42150. <h4 class="subsection">39.225.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-127" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-127" aria-hidden="true">TOC</a></span></h4>
  42151. <p>This filter supports all above options as <a href="#commands">commands</a>, excluding option <code>radius</code>.
  42152. </p>
  42153. <a name="tmidequalizer"></a>
  42154. <h3 class="section">39.226 tmidequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#tmidequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tmidequalizer" aria-hidden="true">TOC</a></span></h3>
  42155. <p>Apply Temporal Midway Video Equalization effect.
  42156. </p>
  42157. <p>Midway Video Equalization adjusts a sequence of video frames to have the same
  42158. histograms, while maintaining their dynamics as much as possible. It&rsquo;s
  42159. useful for e.g. matching exposures from a video frames sequence.
  42160. </p>
  42161. <p>This filter accepts the following option:
  42162. </p>
  42163. <dl compact="compact">
  42164. <dt><samp>radius</samp></dt>
  42165. <dd><p>Set filtering radius. Default is <code>5</code>. Allowed range is from 1 to 127.
  42166. </p>
  42167. </dd>
  42168. <dt><samp>sigma</samp></dt>
  42169. <dd><p>Set filtering sigma. Default is <code>0.5</code>. This controls strength of filtering.
  42170. Setting this option to 0 effectively does nothing.
  42171. </p>
  42172. </dd>
  42173. <dt><samp>planes</samp></dt>
  42174. <dd><p>Set which planes to process. Default is <code>15</code>, which is all available planes.
  42175. </p></dd>
  42176. </dl>
  42177. <a name="tmix"></a>
  42178. <h3 class="section">39.227 tmix<span class="pull-right"><a class="anchor hidden-xs" href="#tmix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tmix" aria-hidden="true">TOC</a></span></h3>
  42179. <p>Mix successive video frames.
  42180. </p>
  42181. <p>A description of the accepted options follows.
  42182. </p>
  42183. <dl compact="compact">
  42184. <dt><samp>frames</samp></dt>
  42185. <dd><p>The number of successive frames to mix. If unspecified, it defaults to 3.
  42186. </p>
  42187. </dd>
  42188. <dt><samp>weights</samp></dt>
  42189. <dd><p>Specify weight of each input video frame.
  42190. Each weight is separated by space. If number of weights is smaller than
  42191. number of <var>frames</var> last specified weight will be used for all remaining
  42192. unset weights.
  42193. </p>
  42194. </dd>
  42195. <dt><samp>scale</samp></dt>
  42196. <dd><p>Specify scale, if it is set it will be multiplied with sum
  42197. of each weight multiplied with pixel values to give final destination
  42198. pixel value. By default <var>scale</var> is auto scaled to sum of weights.
  42199. </p></dd>
  42200. </dl>
  42201. <a name="Examples-152"></a>
  42202. <h4 class="subsection">39.227.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-152" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-152" aria-hidden="true">TOC</a></span></h4>
  42203. <ul>
  42204. <li> Average 7 successive frames:
  42205. <div class="example">
  42206. <pre class="example">tmix=frames=7:weights=&quot;1 1 1 1 1 1 1&quot;
  42207. </pre></div>
  42208. </li><li> Apply simple temporal convolution:
  42209. <div class="example">
  42210. <pre class="example">tmix=frames=3:weights=&quot;-1 3 -1&quot;
  42211. </pre></div>
  42212. </li><li> Similar as above but only showing temporal differences:
  42213. <div class="example">
  42214. <pre class="example">tmix=frames=3:weights=&quot;-1 2 -1&quot;:scale=1
  42215. </pre></div>
  42216. </li></ul>
  42217. <a name="Commands-128"></a>
  42218. <h4 class="subsection">39.227.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-128" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-128" aria-hidden="true">TOC</a></span></h4>
  42219. <p>This filter supports the following commands:
  42220. </p><dl compact="compact">
  42221. <dt><samp>weights</samp></dt>
  42222. <dt><samp>scale</samp></dt>
  42223. <dd><p>Syntax is same as option with same name.
  42224. </p></dd>
  42225. </dl>
  42226. <span id="tonemap"></span><a name="tonemap-1"></a>
  42227. <h3 class="section">39.228 tonemap<span class="pull-right"><a class="anchor hidden-xs" href="#tonemap-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tonemap-1" aria-hidden="true">TOC</a></span></h3>
  42228. <p>Tone map colors from different dynamic ranges.
  42229. </p>
  42230. <p>This filter expects data in single precision floating point, as it needs to
  42231. operate on (and can output) out-of-range values. Another filter, such as
  42232. <a href="#zscale">zscale</a>, is needed to convert the resulting frame to a usable format.
  42233. </p>
  42234. <p>The tonemapping algorithms implemented only work on linear light, so input
  42235. data should be linearized beforehand (and possibly correctly tagged).
  42236. </p>
  42237. <div class="example">
  42238. <pre class="example">ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT
  42239. </pre></div>
  42240. <a name="Options-87"></a>
  42241. <h4 class="subsection">39.228.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-87" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-87" aria-hidden="true">TOC</a></span></h4>
  42242. <p>The filter accepts the following options.
  42243. </p>
  42244. <dl compact="compact">
  42245. <dt><samp>tonemap</samp></dt>
  42246. <dd><p>Set the tone map algorithm to use.
  42247. </p>
  42248. <p>Possible values are:
  42249. </p><dl compact="compact">
  42250. <dt><var>none</var></dt>
  42251. <dd><p>Do not apply any tone map, only desaturate overbright pixels.
  42252. </p>
  42253. </dd>
  42254. <dt><var>clip</var></dt>
  42255. <dd><p>Hard-clip any out-of-range values. Use it for perfect color accuracy for
  42256. in-range values, while distorting out-of-range values.
  42257. </p>
  42258. </dd>
  42259. <dt><var>linear</var></dt>
  42260. <dd><p>Stretch the entire reference gamut to a linear multiple of the display.
  42261. </p>
  42262. </dd>
  42263. <dt><var>gamma</var></dt>
  42264. <dd><p>Fit a logarithmic transfer between the tone curves.
  42265. </p>
  42266. </dd>
  42267. <dt><var>reinhard</var></dt>
  42268. <dd><p>Preserve overall image brightness with a simple curve, using nonlinear
  42269. contrast, which results in flattening details and degrading color accuracy.
  42270. </p>
  42271. </dd>
  42272. <dt><var>hable</var></dt>
  42273. <dd><p>Preserve both dark and bright details better than <var>reinhard</var>, at the cost
  42274. of slightly darkening everything. Use it when detail preservation is more
  42275. important than color and brightness accuracy.
  42276. </p>
  42277. </dd>
  42278. <dt><var>mobius</var></dt>
  42279. <dd><p>Smoothly map out-of-range values, while retaining contrast and colors for
  42280. in-range material as much as possible. Use it when color accuracy is more
  42281. important than detail preservation.
  42282. </p></dd>
  42283. </dl>
  42284. <p>Default is none.
  42285. </p>
  42286. </dd>
  42287. <dt><samp>param</samp></dt>
  42288. <dd><p>Tune the tone mapping algorithm.
  42289. </p>
  42290. <p>This affects the following algorithms:
  42291. </p><dl compact="compact">
  42292. <dt><var>none</var></dt>
  42293. <dd><p>Ignored.
  42294. </p>
  42295. </dd>
  42296. <dt><var>linear</var></dt>
  42297. <dd><p>Specifies the scale factor to use while stretching.
  42298. Default to 1.0.
  42299. </p>
  42300. </dd>
  42301. <dt><var>gamma</var></dt>
  42302. <dd><p>Specifies the exponent of the function.
  42303. Default to 1.8.
  42304. </p>
  42305. </dd>
  42306. <dt><var>clip</var></dt>
  42307. <dd><p>Specify an extra linear coefficient to multiply into the signal before clipping.
  42308. Default to 1.0.
  42309. </p>
  42310. </dd>
  42311. <dt><var>reinhard</var></dt>
  42312. <dd><p>Specify the local contrast coefficient at the display peak.
  42313. Default to 0.5, which means that in-gamut values will be about half as bright
  42314. as when clipping.
  42315. </p>
  42316. </dd>
  42317. <dt><var>hable</var></dt>
  42318. <dd><p>Ignored.
  42319. </p>
  42320. </dd>
  42321. <dt><var>mobius</var></dt>
  42322. <dd><p>Specify the transition point from linear to mobius transform. Every value
  42323. below this point is guaranteed to be mapped 1:1. The higher the value, the
  42324. more accurate the result will be, at the cost of losing bright details.
  42325. Default to 0.3, which due to the steep initial slope still preserves in-range
  42326. colors fairly accurately.
  42327. </p></dd>
  42328. </dl>
  42329. </dd>
  42330. <dt><samp>desat</samp></dt>
  42331. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  42332. higher the parameter, the more color information will be preserved. This
  42333. setting helps prevent unnaturally blown-out colors for super-highlights, by
  42334. (smoothly) turning into white instead. This makes images feel more natural,
  42335. at the cost of reducing information about out-of-range colors.
  42336. </p>
  42337. <p>The default of 2.0 is somewhat conservative and will mostly just apply to
  42338. skies or directly sunlit surfaces. A setting of 0.0 disables this option.
  42339. </p>
  42340. <p>This option works only if the input frame has a supported color tag.
  42341. </p>
  42342. </dd>
  42343. <dt><samp>peak</samp></dt>
  42344. <dd><p>Override signal/nominal/reference peak with this value. Useful when the
  42345. embedded peak information in display metadata is not reliable or when tone
  42346. mapping from a lower range to a higher range.
  42347. </p></dd>
  42348. </dl>
  42349. <a name="tpad"></a>
  42350. <h3 class="section">39.229 tpad<span class="pull-right"><a class="anchor hidden-xs" href="#tpad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tpad" aria-hidden="true">TOC</a></span></h3>
  42351. <p>Temporarily pad video frames.
  42352. </p>
  42353. <p>The filter accepts the following options:
  42354. </p>
  42355. <dl compact="compact">
  42356. <dt><samp>start</samp></dt>
  42357. <dd><p>Specify number of delay frames before input video stream. Default is 0.
  42358. </p>
  42359. </dd>
  42360. <dt><samp>stop</samp></dt>
  42361. <dd><p>Specify number of padding frames after input video stream.
  42362. Set to -1 to pad indefinitely. Default is 0.
  42363. </p>
  42364. </dd>
  42365. <dt><samp>start_mode</samp></dt>
  42366. <dd><p>Set kind of frames added to beginning of stream.
  42367. Can be either <var>add</var> or <var>clone</var>.
  42368. With <var>add</var> frames of solid-color are added.
  42369. With <var>clone</var> frames are clones of first frame.
  42370. Default is <var>add</var>.
  42371. </p>
  42372. </dd>
  42373. <dt><samp>stop_mode</samp></dt>
  42374. <dd><p>Set kind of frames added to end of stream.
  42375. Can be either <var>add</var> or <var>clone</var>.
  42376. With <var>add</var> frames of solid-color are added.
  42377. With <var>clone</var> frames are clones of last frame.
  42378. Default is <var>add</var>.
  42379. </p>
  42380. </dd>
  42381. <dt><samp>start_duration, stop_duration</samp></dt>
  42382. <dd><p>Specify the duration of the start/stop delay. See
  42383. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  42384. for the accepted syntax.
  42385. These options override <var>start</var> and <var>stop</var>. Default is 0.
  42386. </p>
  42387. </dd>
  42388. <dt><samp>color</samp></dt>
  42389. <dd><p>Specify the color of the padded area. For the syntax of this option,
  42390. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils
  42391. manual</a>.
  42392. </p>
  42393. <p>The default value of <var>color</var> is &quot;black&quot;.
  42394. </p></dd>
  42395. </dl>
  42396. <span id="transpose"></span><a name="transpose-1"></a>
  42397. <h3 class="section">39.230 transpose<span class="pull-right"><a class="anchor hidden-xs" href="#transpose-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-transpose-1" aria-hidden="true">TOC</a></span></h3>
  42398. <p>Transpose rows with columns in the input video and optionally flip it.
  42399. </p>
  42400. <p>It accepts the following parameters:
  42401. </p>
  42402. <dl compact="compact">
  42403. <dt><samp>dir</samp></dt>
  42404. <dd><p>Specify the transposition direction.
  42405. </p>
  42406. <p>Can assume the following values:
  42407. </p><dl compact="compact">
  42408. <dt>&lsquo;<samp>0, 4, cclock_flip</samp>&rsquo;</dt>
  42409. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
  42410. </p><div class="example">
  42411. <pre class="example">L.R L.l
  42412. . . -&gt; . .
  42413. l.r R.r
  42414. </pre></div>
  42415. </dd>
  42416. <dt>&lsquo;<samp>1, 5, clock</samp>&rsquo;</dt>
  42417. <dd><p>Rotate by 90 degrees clockwise, that is:
  42418. </p><div class="example">
  42419. <pre class="example">L.R l.L
  42420. . . -&gt; . .
  42421. l.r r.R
  42422. </pre></div>
  42423. </dd>
  42424. <dt>&lsquo;<samp>2, 6, cclock</samp>&rsquo;</dt>
  42425. <dd><p>Rotate by 90 degrees counterclockwise, that is:
  42426. </p><div class="example">
  42427. <pre class="example">L.R R.r
  42428. . . -&gt; . .
  42429. l.r L.l
  42430. </pre></div>
  42431. </dd>
  42432. <dt>&lsquo;<samp>3, 7, clock_flip</samp>&rsquo;</dt>
  42433. <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
  42434. </p><div class="example">
  42435. <pre class="example">L.R r.R
  42436. . . -&gt; . .
  42437. l.r l.L
  42438. </pre></div>
  42439. </dd>
  42440. </dl>
  42441. <p>For values between 4-7, the transposition is only done if the input
  42442. video geometry is portrait and not landscape. These values are
  42443. deprecated, the <code>passthrough</code> option should be used instead.
  42444. </p>
  42445. <p>Numerical values are deprecated, and should be dropped in favor of
  42446. symbolic constants.
  42447. </p>
  42448. </dd>
  42449. <dt><samp>passthrough</samp></dt>
  42450. <dd><p>Do not apply the transposition if the input geometry matches the one
  42451. specified by the specified value. It accepts the following values:
  42452. </p><dl compact="compact">
  42453. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  42454. <dd><p>Always apply transposition.
  42455. </p></dd>
  42456. <dt>&lsquo;<samp>portrait</samp>&rsquo;</dt>
  42457. <dd><p>Preserve portrait geometry (when <var>height</var> &gt;= <var>width</var>).
  42458. </p></dd>
  42459. <dt>&lsquo;<samp>landscape</samp>&rsquo;</dt>
  42460. <dd><p>Preserve landscape geometry (when <var>width</var> &gt;= <var>height</var>).
  42461. </p></dd>
  42462. </dl>
  42463. <p>Default value is <code>none</code>.
  42464. </p></dd>
  42465. </dl>
  42466. <p>For example to rotate by 90 degrees clockwise and preserve portrait
  42467. layout:
  42468. </p><div class="example">
  42469. <pre class="example">transpose=dir=1:passthrough=portrait
  42470. </pre></div>
  42471. <p>The command above can also be specified as:
  42472. </p><div class="example">
  42473. <pre class="example">transpose=1:portrait
  42474. </pre></div>
  42475. <a name="transpose_005fnpp"></a>
  42476. <h3 class="section">39.231 transpose_npp<span class="pull-right"><a class="anchor hidden-xs" href="#transpose_005fnpp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-transpose_005fnpp" aria-hidden="true">TOC</a></span></h3>
  42477. <p>Transpose rows with columns in the input video and optionally flip it.
  42478. For more in depth examples see the <a href="#transpose">transpose</a> video filter, which shares mostly the same options.
  42479. </p>
  42480. <p>It accepts the following parameters:
  42481. </p>
  42482. <dl compact="compact">
  42483. <dt><samp>dir</samp></dt>
  42484. <dd><p>Specify the transposition direction.
  42485. </p>
  42486. <p>Can assume the following values:
  42487. </p><dl compact="compact">
  42488. <dt>&lsquo;<samp>cclock_flip</samp>&rsquo;</dt>
  42489. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  42490. </p>
  42491. </dd>
  42492. <dt>&lsquo;<samp>clock</samp>&rsquo;</dt>
  42493. <dd><p>Rotate by 90 degrees clockwise.
  42494. </p>
  42495. </dd>
  42496. <dt>&lsquo;<samp>cclock</samp>&rsquo;</dt>
  42497. <dd><p>Rotate by 90 degrees counterclockwise.
  42498. </p>
  42499. </dd>
  42500. <dt>&lsquo;<samp>clock_flip</samp>&rsquo;</dt>
  42501. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  42502. </p></dd>
  42503. </dl>
  42504. </dd>
  42505. <dt><samp>passthrough</samp></dt>
  42506. <dd><p>Do not apply the transposition if the input geometry matches the one
  42507. specified by the specified value. It accepts the following values:
  42508. </p><dl compact="compact">
  42509. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  42510. <dd><p>Always apply transposition. (default)
  42511. </p></dd>
  42512. <dt>&lsquo;<samp>portrait</samp>&rsquo;</dt>
  42513. <dd><p>Preserve portrait geometry (when <var>height</var> &gt;= <var>width</var>).
  42514. </p></dd>
  42515. <dt>&lsquo;<samp>landscape</samp>&rsquo;</dt>
  42516. <dd><p>Preserve landscape geometry (when <var>width</var> &gt;= <var>height</var>).
  42517. </p></dd>
  42518. </dl>
  42519. </dd>
  42520. </dl>
  42521. <a name="trim"></a>
  42522. <h3 class="section">39.232 trim<span class="pull-right"><a class="anchor hidden-xs" href="#trim" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-trim" aria-hidden="true">TOC</a></span></h3>
  42523. <p>Trim the input so that the output contains one continuous subpart of the input.
  42524. </p>
  42525. <p>It accepts the following parameters:
  42526. </p><dl compact="compact">
  42527. <dt><samp>start</samp></dt>
  42528. <dd><p>Specify the time of the start of the kept section, i.e. the frame with the
  42529. timestamp <var>start</var> will be the first frame in the output.
  42530. </p>
  42531. </dd>
  42532. <dt><samp>end</samp></dt>
  42533. <dd><p>Specify the time of the first frame that will be dropped, i.e. the frame
  42534. immediately preceding the one with the timestamp <var>end</var> will be the last
  42535. frame in the output.
  42536. </p>
  42537. </dd>
  42538. <dt><samp>start_pts</samp></dt>
  42539. <dd><p>This is the same as <var>start</var>, except this option sets the start timestamp
  42540. in timebase units instead of seconds.
  42541. </p>
  42542. </dd>
  42543. <dt><samp>end_pts</samp></dt>
  42544. <dd><p>This is the same as <var>end</var>, except this option sets the end timestamp
  42545. in timebase units instead of seconds.
  42546. </p>
  42547. </dd>
  42548. <dt><samp>duration</samp></dt>
  42549. <dd><p>The maximum duration of the output in seconds.
  42550. </p>
  42551. </dd>
  42552. <dt><samp>start_frame</samp></dt>
  42553. <dd><p>The number of the first frame that should be passed to the output.
  42554. </p>
  42555. </dd>
  42556. <dt><samp>end_frame</samp></dt>
  42557. <dd><p>The number of the first frame that should be dropped.
  42558. </p></dd>
  42559. </dl>
  42560. <p><samp>start</samp>, <samp>end</samp>, and <samp>duration</samp> are expressed as time
  42561. duration specifications; see
  42562. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  42563. for the accepted syntax.
  42564. </p>
  42565. <p>Note that the first two sets of the start/end options and the <samp>duration</samp>
  42566. option look at the frame timestamp, while the _frame variants simply count the
  42567. frames that pass through the filter. Also note that this filter does not modify
  42568. the timestamps. If you wish for the output timestamps to start at zero, insert a
  42569. setpts filter after the trim filter.
  42570. </p>
  42571. <p>If multiple start or end options are set, this filter tries to be greedy and
  42572. keep all the frames that match at least one of the specified constraints. To keep
  42573. only the part that matches all the constraints at once, chain multiple trim
  42574. filters.
  42575. </p>
  42576. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  42577. just the end values to keep everything before the specified time.
  42578. </p>
  42579. <p>Examples:
  42580. </p><ul>
  42581. <li> Drop everything except the second minute of input:
  42582. <div class="example">
  42583. <pre class="example">ffmpeg -i INPUT -vf trim=60:120
  42584. </pre></div>
  42585. </li><li> Keep only the first second:
  42586. <div class="example">
  42587. <pre class="example">ffmpeg -i INPUT -vf trim=duration=1
  42588. </pre></div>
  42589. </li></ul>
  42590. <a name="unpremultiply"></a>
  42591. <h3 class="section">39.233 unpremultiply<span class="pull-right"><a class="anchor hidden-xs" href="#unpremultiply" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unpremultiply" aria-hidden="true">TOC</a></span></h3>
  42592. <p>Apply alpha unpremultiply effect to input video stream using first plane
  42593. of second stream as alpha.
  42594. </p>
  42595. <p>Both streams must have same dimensions and same pixel format.
  42596. </p>
  42597. <p>The filter accepts the following option:
  42598. </p>
  42599. <dl compact="compact">
  42600. <dt><samp>planes</samp></dt>
  42601. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  42602. By default value 0xf, all planes will be processed.
  42603. </p>
  42604. <p>If the format has 1 or 2 components, then luma is bit 0.
  42605. If the format has 3 or 4 components:
  42606. for RGB formats bit 0 is green, bit 1 is blue and bit 2 is red;
  42607. for YUV formats bit 0 is luma, bit 1 is chroma-U and bit 2 is chroma-V.
  42608. If present, the alpha channel is always the last bit.
  42609. </p>
  42610. </dd>
  42611. <dt><samp>inplace</samp></dt>
  42612. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  42613. </p></dd>
  42614. </dl>
  42615. <span id="unsharp"></span><a name="unsharp-1"></a>
  42616. <h3 class="section">39.234 unsharp<span class="pull-right"><a class="anchor hidden-xs" href="#unsharp-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unsharp-1" aria-hidden="true">TOC</a></span></h3>
  42617. <p>Sharpen or blur the input video.
  42618. </p>
  42619. <p>It accepts the following parameters:
  42620. </p>
  42621. <dl compact="compact">
  42622. <dt><samp>luma_msize_x, lx</samp></dt>
  42623. <dd><p>Set the luma matrix horizontal size. It must be an odd integer between
  42624. 3 and 23. The default value is 5.
  42625. </p>
  42626. </dd>
  42627. <dt><samp>luma_msize_y, ly</samp></dt>
  42628. <dd><p>Set the luma matrix vertical size. It must be an odd integer between 3
  42629. and 23. The default value is 5.
  42630. </p>
  42631. </dd>
  42632. <dt><samp>luma_amount, la</samp></dt>
  42633. <dd><p>Set the luma effect strength. It must be a floating point number, reasonable
  42634. values lay between -1.5 and 1.5.
  42635. </p>
  42636. <p>Negative values will blur the input video, while positive values will
  42637. sharpen it, a value of zero will disable the effect.
  42638. </p>
  42639. <p>Default value is 1.0.
  42640. </p>
  42641. </dd>
  42642. <dt><samp>chroma_msize_x, cx</samp></dt>
  42643. <dd><p>Set the chroma matrix horizontal size. It must be an odd integer
  42644. between 3 and 23. The default value is 5.
  42645. </p>
  42646. </dd>
  42647. <dt><samp>chroma_msize_y, cy</samp></dt>
  42648. <dd><p>Set the chroma matrix vertical size. It must be an odd integer
  42649. between 3 and 23. The default value is 5.
  42650. </p>
  42651. </dd>
  42652. <dt><samp>chroma_amount, ca</samp></dt>
  42653. <dd><p>Set the chroma effect strength. It must be a floating point number, reasonable
  42654. values lay between -1.5 and 1.5.
  42655. </p>
  42656. <p>Negative values will blur the input video, while positive values will
  42657. sharpen it, a value of zero will disable the effect.
  42658. </p>
  42659. <p>Default value is 0.0.
  42660. </p>
  42661. </dd>
  42662. </dl>
  42663. <p>All parameters are optional and default to the equivalent of the
  42664. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  42665. </p>
  42666. <a name="Examples-153"></a>
  42667. <h4 class="subsection">39.234.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-153" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-153" aria-hidden="true">TOC</a></span></h4>
  42668. <ul>
  42669. <li> Apply strong luma sharpen effect:
  42670. <div class="example">
  42671. <pre class="example">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
  42672. </pre></div>
  42673. </li><li> Apply a strong blur of both luma and chroma parameters:
  42674. <div class="example">
  42675. <pre class="example">unsharp=7:7:-2:7:7:-2
  42676. </pre></div>
  42677. </li></ul>
  42678. <span id="untile"></span><a name="untile-1"></a>
  42679. <h3 class="section">39.235 untile<span class="pull-right"><a class="anchor hidden-xs" href="#untile-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-untile-1" aria-hidden="true">TOC</a></span></h3>
  42680. <p>Decompose a video made of tiled images into the individual images.
  42681. </p>
  42682. <p>The frame rate of the output video is the frame rate of the input video
  42683. multiplied by the number of tiles.
  42684. </p>
  42685. <p>This filter does the reverse of <a href="#tile">tile</a>.
  42686. </p>
  42687. <p>The filter accepts the following options:
  42688. </p>
  42689. <dl compact="compact">
  42690. <dt><samp>layout</samp></dt>
  42691. <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
  42692. this option, check the
  42693. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  42694. </p></dd>
  42695. </dl>
  42696. <a name="Examples-154"></a>
  42697. <h4 class="subsection">39.235.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-154" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-154" aria-hidden="true">TOC</a></span></h4>
  42698. <ul>
  42699. <li> Produce a 1-second video from a still image file made of 25 frames stacked
  42700. vertically, like an analogic film reel:
  42701. <div class="example">
  42702. <pre class="example">ffmpeg -r 1 -i image.jpg -vf untile=1x25 movie.mkv
  42703. </pre></div>
  42704. </li></ul>
  42705. <a name="uspp"></a>
  42706. <h3 class="section">39.236 uspp<span class="pull-right"><a class="anchor hidden-xs" href="#uspp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-uspp" aria-hidden="true">TOC</a></span></h3>
  42707. <p>Apply ultra slow/simple postprocessing filter that compresses and decompresses
  42708. the image at several (or - in the case of <samp>quality</samp> level <code>8</code> - all)
  42709. shifts and average the results.
  42710. </p>
  42711. <p>The way this differs from the behavior of spp is that uspp actually encodes &amp;
  42712. decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8
  42713. DCT similar to MJPEG.
  42714. </p>
  42715. <p>The filter accepts the following options:
  42716. </p>
  42717. <dl compact="compact">
  42718. <dt><samp>quality</samp></dt>
  42719. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  42720. an integer in the range 0-8. If set to <code>0</code>, the filter will have no
  42721. effect. A value of <code>8</code> means the higher quality. For each increment of
  42722. that value the speed drops by a factor of approximately 2. Default value is
  42723. <code>3</code>.
  42724. </p>
  42725. </dd>
  42726. <dt><samp>qp</samp></dt>
  42727. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  42728. from the video stream (if available).
  42729. </p></dd>
  42730. </dl>
  42731. <a name="v360"></a>
  42732. <h3 class="section">39.237 v360<span class="pull-right"><a class="anchor hidden-xs" href="#v360" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-v360" aria-hidden="true">TOC</a></span></h3>
  42733. <p>Convert 360 videos between various formats.
  42734. </p>
  42735. <p>The filter accepts the following options:
  42736. </p>
  42737. <dl compact="compact">
  42738. <dt><samp>input</samp></dt>
  42739. <dt><samp>output</samp></dt>
  42740. <dd><p>Set format of the input/output video.
  42741. </p>
  42742. <p>Available formats:
  42743. </p>
  42744. <dl compact="compact">
  42745. <dt>&lsquo;<samp>e</samp>&rsquo;</dt>
  42746. <dt>&lsquo;<samp>equirect</samp>&rsquo;</dt>
  42747. <dd><p>Equirectangular projection.
  42748. </p>
  42749. </dd>
  42750. <dt>&lsquo;<samp>c3x2</samp>&rsquo;</dt>
  42751. <dt>&lsquo;<samp>c6x1</samp>&rsquo;</dt>
  42752. <dt>&lsquo;<samp>c1x6</samp>&rsquo;</dt>
  42753. <dd><p>Cubemap with 3x2/6x1/1x6 layout.
  42754. </p>
  42755. <p>Format specific options:
  42756. </p>
  42757. <dl compact="compact">
  42758. <dt><samp>in_pad</samp></dt>
  42759. <dt><samp>out_pad</samp></dt>
  42760. <dd><p>Set padding proportion for the input/output cubemap. Values in decimals.
  42761. </p>
  42762. <p>Example values:
  42763. </p><dl compact="compact">
  42764. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  42765. <dd><p>No padding.
  42766. </p></dd>
  42767. <dt>&lsquo;<samp>0.01</samp>&rsquo;</dt>
  42768. <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)
  42769. </p></dd>
  42770. </dl>
  42771. <p>Default value is <b>&lsquo;<samp>0</samp>&rsquo;</b>.
  42772. Maximum value is <b>&lsquo;<samp>0.1</samp>&rsquo;</b>.
  42773. </p>
  42774. </dd>
  42775. <dt><samp>fin_pad</samp></dt>
  42776. <dt><samp>fout_pad</samp></dt>
  42777. <dd><p>Set fixed padding for the input/output cubemap. Values in pixels.
  42778. </p>
  42779. <p>Default value is <b>&lsquo;<samp>0</samp>&rsquo;</b>. If greater than zero it overrides other padding options.
  42780. </p>
  42781. </dd>
  42782. <dt><samp>in_forder</samp></dt>
  42783. <dt><samp>out_forder</samp></dt>
  42784. <dd><p>Set order of faces for the input/output cubemap. Choose one direction for each position.
  42785. </p>
  42786. <p>Designation of directions:
  42787. </p><dl compact="compact">
  42788. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  42789. <dd><p>right
  42790. </p></dd>
  42791. <dt>&lsquo;<samp>l</samp>&rsquo;</dt>
  42792. <dd><p>left
  42793. </p></dd>
  42794. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  42795. <dd><p>up
  42796. </p></dd>
  42797. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  42798. <dd><p>down
  42799. </p></dd>
  42800. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  42801. <dd><p>forward
  42802. </p></dd>
  42803. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  42804. <dd><p>back
  42805. </p></dd>
  42806. </dl>
  42807. <p>Default value is <b>&lsquo;<samp>rludfb</samp>&rsquo;</b>.
  42808. </p>
  42809. </dd>
  42810. <dt><samp>in_frot</samp></dt>
  42811. <dt><samp>out_frot</samp></dt>
  42812. <dd><p>Set rotation of faces for the input/output cubemap. Choose one angle for each position.
  42813. </p>
  42814. <p>Designation of angles:
  42815. </p><dl compact="compact">
  42816. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  42817. <dd><p>0 degrees clockwise
  42818. </p></dd>
  42819. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  42820. <dd><p>90 degrees clockwise
  42821. </p></dd>
  42822. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  42823. <dd><p>180 degrees clockwise
  42824. </p></dd>
  42825. <dt>&lsquo;<samp>3</samp>&rsquo;</dt>
  42826. <dd><p>270 degrees clockwise
  42827. </p></dd>
  42828. </dl>
  42829. <p>Default value is <b>&lsquo;<samp>000000</samp>&rsquo;</b>.
  42830. </p></dd>
  42831. </dl>
  42832. </dd>
  42833. <dt>&lsquo;<samp>eac</samp>&rsquo;</dt>
  42834. <dd><p>Equi-Angular Cubemap.
  42835. </p>
  42836. </dd>
  42837. <dt>&lsquo;<samp>flat</samp>&rsquo;</dt>
  42838. <dt>&lsquo;<samp>gnomonic</samp>&rsquo;</dt>
  42839. <dt>&lsquo;<samp>rectilinear</samp>&rsquo;</dt>
  42840. <dd><p>Regular video.
  42841. </p>
  42842. <p>Format specific options:
  42843. </p><dl compact="compact">
  42844. <dt><samp>h_fov</samp></dt>
  42845. <dt><samp>v_fov</samp></dt>
  42846. <dt><samp>d_fov</samp></dt>
  42847. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  42848. </p>
  42849. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  42850. </p>
  42851. </dd>
  42852. <dt><samp>ih_fov</samp></dt>
  42853. <dt><samp>iv_fov</samp></dt>
  42854. <dt><samp>id_fov</samp></dt>
  42855. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  42856. </p>
  42857. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  42858. </p></dd>
  42859. </dl>
  42860. </dd>
  42861. <dt>&lsquo;<samp>dfisheye</samp>&rsquo;</dt>
  42862. <dd><p>Dual fisheye.
  42863. </p>
  42864. <p>Format specific options:
  42865. </p><dl compact="compact">
  42866. <dt><samp>h_fov</samp></dt>
  42867. <dt><samp>v_fov</samp></dt>
  42868. <dt><samp>d_fov</samp></dt>
  42869. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  42870. </p>
  42871. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  42872. </p>
  42873. </dd>
  42874. <dt><samp>ih_fov</samp></dt>
  42875. <dt><samp>iv_fov</samp></dt>
  42876. <dt><samp>id_fov</samp></dt>
  42877. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  42878. </p>
  42879. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  42880. </p></dd>
  42881. </dl>
  42882. </dd>
  42883. <dt>&lsquo;<samp>barrel</samp>&rsquo;</dt>
  42884. <dt>&lsquo;<samp>fb</samp>&rsquo;</dt>
  42885. <dt>&lsquo;<samp>barrelsplit</samp>&rsquo;</dt>
  42886. <dd><p>Facebook&rsquo;s 360 formats.
  42887. </p>
  42888. </dd>
  42889. <dt>&lsquo;<samp>sg</samp>&rsquo;</dt>
  42890. <dd><p>Stereographic format.
  42891. </p>
  42892. <p>Format specific options:
  42893. </p><dl compact="compact">
  42894. <dt><samp>h_fov</samp></dt>
  42895. <dt><samp>v_fov</samp></dt>
  42896. <dt><samp>d_fov</samp></dt>
  42897. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  42898. </p>
  42899. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  42900. </p>
  42901. </dd>
  42902. <dt><samp>ih_fov</samp></dt>
  42903. <dt><samp>iv_fov</samp></dt>
  42904. <dt><samp>id_fov</samp></dt>
  42905. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  42906. </p>
  42907. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  42908. </p></dd>
  42909. </dl>
  42910. </dd>
  42911. <dt>&lsquo;<samp>mercator</samp>&rsquo;</dt>
  42912. <dd><p>Mercator format.
  42913. </p>
  42914. </dd>
  42915. <dt>&lsquo;<samp>ball</samp>&rsquo;</dt>
  42916. <dd><p>Ball format, gives significant distortion toward the back.
  42917. </p>
  42918. </dd>
  42919. <dt>&lsquo;<samp>hammer</samp>&rsquo;</dt>
  42920. <dd><p>Hammer-Aitoff map projection format.
  42921. </p>
  42922. </dd>
  42923. <dt>&lsquo;<samp>sinusoidal</samp>&rsquo;</dt>
  42924. <dd><p>Sinusoidal map projection format.
  42925. </p>
  42926. </dd>
  42927. <dt>&lsquo;<samp>fisheye</samp>&rsquo;</dt>
  42928. <dd><p>Fisheye projection.
  42929. </p>
  42930. <p>Format specific options:
  42931. </p><dl compact="compact">
  42932. <dt><samp>h_fov</samp></dt>
  42933. <dt><samp>v_fov</samp></dt>
  42934. <dt><samp>d_fov</samp></dt>
  42935. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  42936. </p>
  42937. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  42938. </p>
  42939. </dd>
  42940. <dt><samp>ih_fov</samp></dt>
  42941. <dt><samp>iv_fov</samp></dt>
  42942. <dt><samp>id_fov</samp></dt>
  42943. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  42944. </p>
  42945. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  42946. </p></dd>
  42947. </dl>
  42948. </dd>
  42949. <dt>&lsquo;<samp>pannini</samp>&rsquo;</dt>
  42950. <dd><p>Pannini projection.
  42951. </p>
  42952. <p>Format specific options:
  42953. </p><dl compact="compact">
  42954. <dt><samp>h_fov</samp></dt>
  42955. <dd><p>Set output pannini parameter.
  42956. </p>
  42957. </dd>
  42958. <dt><samp>ih_fov</samp></dt>
  42959. <dd><p>Set input pannini parameter.
  42960. </p></dd>
  42961. </dl>
  42962. </dd>
  42963. <dt>&lsquo;<samp>cylindrical</samp>&rsquo;</dt>
  42964. <dd><p>Cylindrical projection.
  42965. </p>
  42966. <p>Format specific options:
  42967. </p><dl compact="compact">
  42968. <dt><samp>h_fov</samp></dt>
  42969. <dt><samp>v_fov</samp></dt>
  42970. <dt><samp>d_fov</samp></dt>
  42971. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  42972. </p>
  42973. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  42974. </p>
  42975. </dd>
  42976. <dt><samp>ih_fov</samp></dt>
  42977. <dt><samp>iv_fov</samp></dt>
  42978. <dt><samp>id_fov</samp></dt>
  42979. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  42980. </p>
  42981. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  42982. </p></dd>
  42983. </dl>
  42984. </dd>
  42985. <dt>&lsquo;<samp>perspective</samp>&rsquo;</dt>
  42986. <dd><p>Perspective projection. <i>(output only)</i>
  42987. </p>
  42988. <p>Format specific options:
  42989. </p><dl compact="compact">
  42990. <dt><samp>v_fov</samp></dt>
  42991. <dd><p>Set perspective parameter.
  42992. </p></dd>
  42993. </dl>
  42994. </dd>
  42995. <dt>&lsquo;<samp>tetrahedron</samp>&rsquo;</dt>
  42996. <dd><p>Tetrahedron projection.
  42997. </p>
  42998. </dd>
  42999. <dt>&lsquo;<samp>tsp</samp>&rsquo;</dt>
  43000. <dd><p>Truncated square pyramid projection.
  43001. </p>
  43002. </dd>
  43003. <dt>&lsquo;<samp>he</samp>&rsquo;</dt>
  43004. <dt>&lsquo;<samp>hequirect</samp>&rsquo;</dt>
  43005. <dd><p>Half equirectangular projection.
  43006. </p>
  43007. </dd>
  43008. <dt>&lsquo;<samp>equisolid</samp>&rsquo;</dt>
  43009. <dd><p>Equisolid format.
  43010. </p>
  43011. <p>Format specific options:
  43012. </p><dl compact="compact">
  43013. <dt><samp>h_fov</samp></dt>
  43014. <dt><samp>v_fov</samp></dt>
  43015. <dt><samp>d_fov</samp></dt>
  43016. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  43017. </p>
  43018. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  43019. </p>
  43020. </dd>
  43021. <dt><samp>ih_fov</samp></dt>
  43022. <dt><samp>iv_fov</samp></dt>
  43023. <dt><samp>id_fov</samp></dt>
  43024. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  43025. </p>
  43026. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  43027. </p></dd>
  43028. </dl>
  43029. </dd>
  43030. <dt>&lsquo;<samp>og</samp>&rsquo;</dt>
  43031. <dd><p>Orthographic format.
  43032. </p>
  43033. <p>Format specific options:
  43034. </p><dl compact="compact">
  43035. <dt><samp>h_fov</samp></dt>
  43036. <dt><samp>v_fov</samp></dt>
  43037. <dt><samp>d_fov</samp></dt>
  43038. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  43039. </p>
  43040. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  43041. </p>
  43042. </dd>
  43043. <dt><samp>ih_fov</samp></dt>
  43044. <dt><samp>iv_fov</samp></dt>
  43045. <dt><samp>id_fov</samp></dt>
  43046. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  43047. </p>
  43048. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  43049. </p></dd>
  43050. </dl>
  43051. </dd>
  43052. <dt>&lsquo;<samp>octahedron</samp>&rsquo;</dt>
  43053. <dd><p>Octahedron projection.
  43054. </p></dd>
  43055. </dl>
  43056. </dd>
  43057. <dt><samp>interp</samp></dt>
  43058. <dd><p>Set interpolation method.<br>
  43059. <i>Note: more complex interpolation methods require much more memory to run.</i>
  43060. </p>
  43061. <p>Available methods:
  43062. </p>
  43063. <dl compact="compact">
  43064. <dt>&lsquo;<samp>near</samp>&rsquo;</dt>
  43065. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  43066. <dd><p>Nearest neighbour.
  43067. </p></dd>
  43068. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  43069. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  43070. <dd><p>Bilinear interpolation.
  43071. </p></dd>
  43072. <dt>&lsquo;<samp>lagrange9</samp>&rsquo;</dt>
  43073. <dd><p>Lagrange9 interpolation.
  43074. </p></dd>
  43075. <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
  43076. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  43077. <dd><p>Bicubic interpolation.
  43078. </p></dd>
  43079. <dt>&lsquo;<samp>lanc</samp>&rsquo;</dt>
  43080. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  43081. <dd><p>Lanczos interpolation.
  43082. </p></dd>
  43083. <dt>&lsquo;<samp>sp16</samp>&rsquo;</dt>
  43084. <dt>&lsquo;<samp>spline16</samp>&rsquo;</dt>
  43085. <dd><p>Spline16 interpolation.
  43086. </p></dd>
  43087. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  43088. <dt>&lsquo;<samp>gaussian</samp>&rsquo;</dt>
  43089. <dd><p>Gaussian interpolation.
  43090. </p></dd>
  43091. <dt>&lsquo;<samp>mitchell</samp>&rsquo;</dt>
  43092. <dd><p>Mitchell interpolation.
  43093. </p></dd>
  43094. </dl>
  43095. <p>Default value is <b>&lsquo;<samp>line</samp>&rsquo;</b>.
  43096. </p>
  43097. </dd>
  43098. <dt><samp>w</samp></dt>
  43099. <dt><samp>h</samp></dt>
  43100. <dd><p>Set the output video resolution.
  43101. </p>
  43102. <p>Default resolution depends on formats.
  43103. </p>
  43104. </dd>
  43105. <dt><samp>in_stereo</samp></dt>
  43106. <dt><samp>out_stereo</samp></dt>
  43107. <dd><p>Set the input/output stereo format.
  43108. </p>
  43109. <dl compact="compact">
  43110. <dt>&lsquo;<samp>2d</samp>&rsquo;</dt>
  43111. <dd><p>2D mono
  43112. </p></dd>
  43113. <dt>&lsquo;<samp>sbs</samp>&rsquo;</dt>
  43114. <dd><p>Side by side
  43115. </p></dd>
  43116. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  43117. <dd><p>Top bottom
  43118. </p></dd>
  43119. </dl>
  43120. <p>Default value is <b>&lsquo;<samp>2d</samp>&rsquo;</b> for input and output format.
  43121. </p>
  43122. </dd>
  43123. <dt><samp>yaw</samp></dt>
  43124. <dt><samp>pitch</samp></dt>
  43125. <dt><samp>roll</samp></dt>
  43126. <dd><p>Set rotation for the output video. Values in degrees.
  43127. </p>
  43128. </dd>
  43129. <dt><samp>rorder</samp></dt>
  43130. <dd><p>Set rotation order for the output video. Choose one item for each position.
  43131. </p>
  43132. <dl compact="compact">
  43133. <dt>&lsquo;<samp>y, Y</samp>&rsquo;</dt>
  43134. <dd><p>yaw
  43135. </p></dd>
  43136. <dt>&lsquo;<samp>p, P</samp>&rsquo;</dt>
  43137. <dd><p>pitch
  43138. </p></dd>
  43139. <dt>&lsquo;<samp>r, R</samp>&rsquo;</dt>
  43140. <dd><p>roll
  43141. </p></dd>
  43142. </dl>
  43143. <p>Default value is <b>&lsquo;<samp>ypr</samp>&rsquo;</b>.
  43144. </p>
  43145. </dd>
  43146. <dt><samp>h_flip</samp></dt>
  43147. <dt><samp>v_flip</samp></dt>
  43148. <dt><samp>d_flip</samp></dt>
  43149. <dd><p>Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values.
  43150. </p>
  43151. </dd>
  43152. <dt><samp>ih_flip</samp></dt>
  43153. <dt><samp>iv_flip</samp></dt>
  43154. <dd><p>Set if input video is flipped horizontally/vertically. Boolean values.
  43155. </p>
  43156. </dd>
  43157. <dt><samp>in_trans</samp></dt>
  43158. <dd><p>Set if input video is transposed. Boolean value, by default disabled.
  43159. </p>
  43160. </dd>
  43161. <dt><samp>out_trans</samp></dt>
  43162. <dd><p>Set if output video needs to be transposed. Boolean value, by default disabled.
  43163. </p>
  43164. </dd>
  43165. <dt><samp>alpha_mask</samp></dt>
  43166. <dd><p>Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled.
  43167. </p></dd>
  43168. </dl>
  43169. <a name="Examples-155"></a>
  43170. <h4 class="subsection">39.237.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-155" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-155" aria-hidden="true">TOC</a></span></h4>
  43171. <ul>
  43172. <li> Convert equirectangular video to cubemap with 3x2 layout and 1% padding using bicubic interpolation:
  43173. <div class="example">
  43174. <pre class="example">ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
  43175. </pre></div>
  43176. </li><li> Extract back view of Equi-Angular Cubemap:
  43177. <div class="example">
  43178. <pre class="example">ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
  43179. </pre></div>
  43180. </li><li> Convert transposed and horizontally flipped Equi-Angular Cubemap in side-by-side stereo format to equirectangular top-bottom stereo format:
  43181. <div class="example">
  43182. <pre class="example">v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
  43183. </pre></div>
  43184. </li></ul>
  43185. <a name="Commands-129"></a>
  43186. <h4 class="subsection">39.237.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-129" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-129" aria-hidden="true">TOC</a></span></h4>
  43187. <p>This filter supports subset of above options as <a href="#commands">commands</a>.
  43188. </p>
  43189. <a name="vaguedenoiser"></a>
  43190. <h3 class="section">39.238 vaguedenoiser<span class="pull-right"><a class="anchor hidden-xs" href="#vaguedenoiser" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vaguedenoiser" aria-hidden="true">TOC</a></span></h3>
  43191. <p>Apply a wavelet based denoiser.
  43192. </p>
  43193. <p>It transforms each frame from the video input into the wavelet domain,
  43194. using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to
  43195. the obtained coefficients. It does an inverse wavelet transform after.
  43196. Due to wavelet properties, it should give a nice smoothed result, and
  43197. reduced noise, without blurring picture features.
  43198. </p>
  43199. <p>This filter accepts the following options:
  43200. </p>
  43201. <dl compact="compact">
  43202. <dt><samp>threshold</samp></dt>
  43203. <dd><p>The filtering strength. The higher, the more filtered the video will be.
  43204. Hard thresholding can use a higher threshold than soft thresholding
  43205. before the video looks overfiltered. Default value is 2.
  43206. </p>
  43207. </dd>
  43208. <dt><samp>method</samp></dt>
  43209. <dd><p>The filtering method the filter will use.
  43210. </p>
  43211. <p>It accepts the following values:
  43212. </p><dl compact="compact">
  43213. <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
  43214. <dd><p>All values under the threshold will be zeroed.
  43215. </p>
  43216. </dd>
  43217. <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
  43218. <dd><p>All values under the threshold will be zeroed. All values above will be
  43219. reduced by the threshold.
  43220. </p>
  43221. </dd>
  43222. <dt>&lsquo;<samp>garrote</samp>&rsquo;</dt>
  43223. <dd><p>Scales or nullifies coefficients - intermediary between (more) soft and
  43224. (less) hard thresholding.
  43225. </p></dd>
  43226. </dl>
  43227. <p>Default is garrote.
  43228. </p>
  43229. </dd>
  43230. <dt><samp>nsteps</samp></dt>
  43231. <dd><p>Number of times, the wavelet will decompose the picture. Picture can&rsquo;t
  43232. be decomposed beyond a particular point (typically, 8 for a 640x480
  43233. frame - as 2^9 = 512 &gt; 480). Valid values are integers between 1 and 32. Default value is 6.
  43234. </p>
  43235. </dd>
  43236. <dt><samp>percent</samp></dt>
  43237. <dd><p>Partial of full denoising (limited coefficients shrinking), from 0 to 100. Default value is 85.
  43238. </p>
  43239. </dd>
  43240. <dt><samp>planes</samp></dt>
  43241. <dd><p>A list of the planes to process. By default all planes are processed.
  43242. </p>
  43243. </dd>
  43244. <dt><samp>type</samp></dt>
  43245. <dd><p>The threshold type the filter will use.
  43246. </p>
  43247. <p>It accepts the following values:
  43248. </p><dl compact="compact">
  43249. <dt>&lsquo;<samp>universal</samp>&rsquo;</dt>
  43250. <dd><p>Threshold used is same for all decompositions.
  43251. </p>
  43252. </dd>
  43253. <dt>&lsquo;<samp>bayes</samp>&rsquo;</dt>
  43254. <dd><p>Threshold used depends also on each decomposition coefficients.
  43255. </p></dd>
  43256. </dl>
  43257. <p>Default is universal.
  43258. </p></dd>
  43259. </dl>
  43260. <a name="vectorscope"></a>
  43261. <h3 class="section">39.239 vectorscope<span class="pull-right"><a class="anchor hidden-xs" href="#vectorscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vectorscope" aria-hidden="true">TOC</a></span></h3>
  43262. <p>Display 2 color component values in the two dimensional graph (which is called
  43263. a vectorscope).
  43264. </p>
  43265. <p>This filter accepts the following options:
  43266. </p>
  43267. <dl compact="compact">
  43268. <dt><samp>mode, m</samp></dt>
  43269. <dd><p>Set vectorscope mode.
  43270. </p>
  43271. <p>It accepts the following values:
  43272. </p><dl compact="compact">
  43273. <dt>&lsquo;<samp>gray</samp>&rsquo;</dt>
  43274. <dt>&lsquo;<samp>tint</samp>&rsquo;</dt>
  43275. <dd><p>Gray values are displayed on graph, higher brightness means more pixels have
  43276. same component color value on location in graph. This is the default mode.
  43277. </p>
  43278. </dd>
  43279. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  43280. <dd><p>Gray values are displayed on graph. Surrounding pixels values which are not
  43281. present in video frame are drawn in gradient of 2 color components which are
  43282. set by option <code>x</code> and <code>y</code>. The 3rd color component is static.
  43283. </p>
  43284. </dd>
  43285. <dt>&lsquo;<samp>color2</samp>&rsquo;</dt>
  43286. <dd><p>Actual color components values present in video frame are displayed on graph.
  43287. </p>
  43288. </dd>
  43289. <dt>&lsquo;<samp>color3</samp>&rsquo;</dt>
  43290. <dd><p>Similar as color2 but higher frequency of same values <code>x</code> and <code>y</code>
  43291. on graph increases value of another color component, which is luminance by
  43292. default values of <code>x</code> and <code>y</code>.
  43293. </p>
  43294. </dd>
  43295. <dt>&lsquo;<samp>color4</samp>&rsquo;</dt>
  43296. <dd><p>Actual colors present in video frame are displayed on graph. If two different
  43297. colors map to same position on graph then color with higher value of component
  43298. not present in graph is picked.
  43299. </p>
  43300. </dd>
  43301. <dt>&lsquo;<samp>color5</samp>&rsquo;</dt>
  43302. <dd><p>Gray values are displayed on graph. Similar to <code>color</code> but with 3rd color
  43303. component picked from radial gradient.
  43304. </p></dd>
  43305. </dl>
  43306. </dd>
  43307. <dt><samp>x</samp></dt>
  43308. <dd><p>Set which color component will be represented on X-axis. Default is <code>1</code>.
  43309. </p>
  43310. </dd>
  43311. <dt><samp>y</samp></dt>
  43312. <dd><p>Set which color component will be represented on Y-axis. Default is <code>2</code>.
  43313. </p>
  43314. </dd>
  43315. <dt><samp>intensity, i</samp></dt>
  43316. <dd><p>Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness
  43317. of color component which represents frequency of (X, Y) location in graph.
  43318. </p>
  43319. </dd>
  43320. <dt><samp>envelope, e</samp></dt>
  43321. <dd><dl compact="compact">
  43322. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  43323. <dd><p>No envelope, this is default.
  43324. </p>
  43325. </dd>
  43326. <dt>&lsquo;<samp>instant</samp>&rsquo;</dt>
  43327. <dd><p>Instant envelope, even darkest single pixel will be clearly highlighted.
  43328. </p>
  43329. </dd>
  43330. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  43331. <dd><p>Hold maximum and minimum values presented in graph over time. This way you
  43332. can still spot out of range values without constantly looking at vectorscope.
  43333. </p>
  43334. </dd>
  43335. <dt>&lsquo;<samp>peak+instant</samp>&rsquo;</dt>
  43336. <dd><p>Peak and instant envelope combined together.
  43337. </p></dd>
  43338. </dl>
  43339. </dd>
  43340. <dt><samp>graticule, g</samp></dt>
  43341. <dd><p>Set what kind of graticule to draw.
  43342. </p><dl compact="compact">
  43343. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  43344. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  43345. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  43346. <dt>&lsquo;<samp>invert</samp>&rsquo;</dt>
  43347. </dl>
  43348. </dd>
  43349. <dt><samp>opacity, o</samp></dt>
  43350. <dd><p>Set graticule opacity.
  43351. </p>
  43352. </dd>
  43353. <dt><samp>flags, f</samp></dt>
  43354. <dd><p>Set graticule flags.
  43355. </p>
  43356. <dl compact="compact">
  43357. <dt>&lsquo;<samp>white</samp>&rsquo;</dt>
  43358. <dd><p>Draw graticule for white point.
  43359. </p>
  43360. </dd>
  43361. <dt>&lsquo;<samp>black</samp>&rsquo;</dt>
  43362. <dd><p>Draw graticule for black point.
  43363. </p>
  43364. </dd>
  43365. <dt>&lsquo;<samp>name</samp>&rsquo;</dt>
  43366. <dd><p>Draw color points short names.
  43367. </p></dd>
  43368. </dl>
  43369. </dd>
  43370. <dt><samp>bgopacity, b</samp></dt>
  43371. <dd><p>Set background opacity.
  43372. </p>
  43373. </dd>
  43374. <dt><samp>lthreshold, l</samp></dt>
  43375. <dd><p>Set low threshold for color component not represented on X or Y axis.
  43376. Values lower than this value will be ignored. Default is 0.
  43377. Note this value is multiplied with actual max possible value one pixel component
  43378. can have. So for 8-bit input and low threshold value of 0.1 actual threshold
  43379. is 0.1 * 255 = 25.
  43380. </p>
  43381. </dd>
  43382. <dt><samp>hthreshold, h</samp></dt>
  43383. <dd><p>Set high threshold for color component not represented on X or Y axis.
  43384. Values higher than this value will be ignored. Default is 1.
  43385. Note this value is multiplied with actual max possible value one pixel component
  43386. can have. So for 8-bit input and high threshold value of 0.9 actual threshold
  43387. is 0.9 * 255 = 230.
  43388. </p>
  43389. </dd>
  43390. <dt><samp>colorspace, c</samp></dt>
  43391. <dd><p>Set what kind of colorspace to use when drawing graticule.
  43392. </p><dl compact="compact">
  43393. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  43394. <dt>&lsquo;<samp>601</samp>&rsquo;</dt>
  43395. <dt>&lsquo;<samp>709</samp>&rsquo;</dt>
  43396. </dl>
  43397. <p>Default is auto.
  43398. </p>
  43399. </dd>
  43400. <dt><samp>tint0, t0</samp></dt>
  43401. <dt><samp>tint1, t1</samp></dt>
  43402. <dd><p>Set color tint for gray/tint vectorscope mode. By default both options are zero.
  43403. This means no tint, and output will remain gray.
  43404. </p></dd>
  43405. </dl>
  43406. <span id="vidstabdetect"></span><a name="vidstabdetect-1"></a>
  43407. <h3 class="section">39.240 vidstabdetect<span class="pull-right"><a class="anchor hidden-xs" href="#vidstabdetect-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vidstabdetect-1" aria-hidden="true">TOC</a></span></h3>
  43408. <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
  43409. <a href="#vidstabtransform">vidstabtransform</a> for pass 2.
  43410. </p>
  43411. <p>This filter generates a file with relative translation and rotation
  43412. transform information about subsequent frames, which is then used by
  43413. the <a href="#vidstabtransform">vidstabtransform</a> filter.
  43414. </p>
  43415. <p>To enable compilation of this filter you need to configure FFmpeg with
  43416. <code>--enable-libvidstab</code>.
  43417. </p>
  43418. <p>This filter accepts the following options:
  43419. </p>
  43420. <dl compact="compact">
  43421. <dt><samp>result</samp></dt>
  43422. <dd><p>Set the path to the file used to write the transforms information.
  43423. Default value is <samp>transforms.trf</samp>.
  43424. </p>
  43425. </dd>
  43426. <dt><samp>shakiness</samp></dt>
  43427. <dd><p>Set how shaky the video is and how quick the camera is. It accepts an
  43428. integer in the range 1-10, a value of 1 means little shakiness, a
  43429. value of 10 means strong shakiness. Default value is 5.
  43430. </p>
  43431. </dd>
  43432. <dt><samp>accuracy</samp></dt>
  43433. <dd><p>Set the accuracy of the detection process. It must be a value in the
  43434. range 1-15. A value of 1 means low accuracy, a value of 15 means high
  43435. accuracy. Default value is 15.
  43436. </p>
  43437. </dd>
  43438. <dt><samp>stepsize</samp></dt>
  43439. <dd><p>Set stepsize of the search process. The region around minimum is
  43440. scanned with 1 pixel resolution. Default value is 6.
  43441. </p>
  43442. </dd>
  43443. <dt><samp>mincontrast</samp></dt>
  43444. <dd><p>Set minimum contrast. Below this value a local measurement field is
  43445. discarded. Must be a floating point value in the range 0-1. Default
  43446. value is 0.3.
  43447. </p>
  43448. </dd>
  43449. <dt><samp>tripod</samp></dt>
  43450. <dd><p>Set reference frame number for tripod mode.
  43451. </p>
  43452. <p>If enabled, the motion of the frames is compared to a reference frame
  43453. in the filtered stream, identified by the specified number. The idea
  43454. is to compensate all movements in a more-or-less static scene and keep
  43455. the camera view absolutely still.
  43456. </p>
  43457. <p>If set to 0, it is disabled. The frames are counted starting from 1.
  43458. </p>
  43459. </dd>
  43460. <dt><samp>show</samp></dt>
  43461. <dd><p>Show fields and transforms in the resulting frames. It accepts an
  43462. integer in the range 0-2. Default value is 0, which disables any
  43463. visualization.
  43464. </p></dd>
  43465. </dl>
  43466. <a name="Examples-156"></a>
  43467. <h4 class="subsection">39.240.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-156" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-156" aria-hidden="true">TOC</a></span></h4>
  43468. <ul>
  43469. <li> Use default values:
  43470. <div class="example">
  43471. <pre class="example">vidstabdetect
  43472. </pre></div>
  43473. </li><li> Analyze strongly shaky movie and put the results in file
  43474. <samp>mytransforms.trf</samp>:
  43475. <div class="example">
  43476. <pre class="example">vidstabdetect=shakiness=10:accuracy=15:result=&quot;mytransforms.trf&quot;
  43477. </pre></div>
  43478. </li><li> Visualize the result of internal transformations in the resulting
  43479. video:
  43480. <div class="example">
  43481. <pre class="example">vidstabdetect=show=1
  43482. </pre></div>
  43483. </li><li> Analyze a video with medium shakiness using <code>ffmpeg</code>:
  43484. <div class="example">
  43485. <pre class="example">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
  43486. </pre></div>
  43487. </li></ul>
  43488. <span id="vidstabtransform"></span><a name="vidstabtransform-1"></a>
  43489. <h3 class="section">39.241 vidstabtransform<span class="pull-right"><a class="anchor hidden-xs" href="#vidstabtransform-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vidstabtransform-1" aria-hidden="true">TOC</a></span></h3>
  43490. <p>Video stabilization/deshaking: pass 2 of 2,
  43491. see <a href="#vidstabdetect">vidstabdetect</a> for pass 1.
  43492. </p>
  43493. <p>Read a file with transform information for each frame and
  43494. apply/compensate them. Together with the <a href="#vidstabdetect">vidstabdetect</a>
  43495. filter this can be used to deshake videos. See also
  43496. <a href="http://public.hronopik.de/vid.stab">http://public.hronopik.de/vid.stab</a>. It is important to also use
  43497. the <a href="#unsharp">unsharp</a> filter, see below.
  43498. </p>
  43499. <p>To enable compilation of this filter you need to configure FFmpeg with
  43500. <code>--enable-libvidstab</code>.
  43501. </p>
  43502. <a name="Options-88"></a>
  43503. <h4 class="subsection">39.241.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-88" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-88" aria-hidden="true">TOC</a></span></h4>
  43504. <dl compact="compact">
  43505. <dt><samp>input</samp></dt>
  43506. <dd><p>Set path to the file used to read the transforms. Default value is
  43507. <samp>transforms.trf</samp>.
  43508. </p>
  43509. </dd>
  43510. <dt><samp>smoothing</samp></dt>
  43511. <dd><p>Set the number of frames (value*2 + 1) used for lowpass filtering the
  43512. camera movements. Default value is 10.
  43513. </p>
  43514. <p>For example a number of 10 means that 21 frames are used (10 in the
  43515. past and 10 in the future) to smoothen the motion in the video. A
  43516. larger value leads to a smoother video, but limits the acceleration of
  43517. the camera (pan/tilt movements). 0 is a special case where a static
  43518. camera is simulated.
  43519. </p>
  43520. </dd>
  43521. <dt><samp>optalgo</samp></dt>
  43522. <dd><p>Set the camera path optimization algorithm.
  43523. </p>
  43524. <p>Accepted values are:
  43525. </p><dl compact="compact">
  43526. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  43527. <dd><p>gaussian kernel low-pass filter on camera motion (default)
  43528. </p></dd>
  43529. <dt>&lsquo;<samp>avg</samp>&rsquo;</dt>
  43530. <dd><p>averaging on transformations
  43531. </p></dd>
  43532. </dl>
  43533. </dd>
  43534. <dt><samp>maxshift</samp></dt>
  43535. <dd><p>Set maximal number of pixels to translate frames. Default value is -1,
  43536. meaning no limit.
  43537. </p>
  43538. </dd>
  43539. <dt><samp>maxangle</samp></dt>
  43540. <dd><p>Set maximal angle in radians (degree*PI/180) to rotate frames. Default
  43541. value is -1, meaning no limit.
  43542. </p>
  43543. </dd>
  43544. <dt><samp>crop</samp></dt>
  43545. <dd><p>Specify how to deal with borders that may be visible due to movement
  43546. compensation.
  43547. </p>
  43548. <p>Available values are:
  43549. </p><dl compact="compact">
  43550. <dt>&lsquo;<samp>keep</samp>&rsquo;</dt>
  43551. <dd><p>keep image information from previous frame (default)
  43552. </p></dd>
  43553. <dt>&lsquo;<samp>black</samp>&rsquo;</dt>
  43554. <dd><p>fill the border black
  43555. </p></dd>
  43556. </dl>
  43557. </dd>
  43558. <dt><samp>invert</samp></dt>
  43559. <dd><p>Invert transforms if set to 1. Default value is 0.
  43560. </p>
  43561. </dd>
  43562. <dt><samp>relative</samp></dt>
  43563. <dd><p>Consider transforms as relative to previous frame if set to 1,
  43564. absolute if set to 0. Default value is 0.
  43565. </p>
  43566. </dd>
  43567. <dt><samp>zoom</samp></dt>
  43568. <dd><p>Set percentage to zoom. A positive value will result in a zoom-in
  43569. effect, a negative value in a zoom-out effect. Default value is 0 (no
  43570. zoom).
  43571. </p>
  43572. </dd>
  43573. <dt><samp>optzoom</samp></dt>
  43574. <dd><p>Set optimal zooming to avoid borders.
  43575. </p>
  43576. <p>Accepted values are:
  43577. </p><dl compact="compact">
  43578. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  43579. <dd><p>disabled
  43580. </p></dd>
  43581. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  43582. <dd><p>optimal static zoom value is determined (only very strong movements
  43583. will lead to visible borders) (default)
  43584. </p></dd>
  43585. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  43586. <dd><p>optimal adaptive zoom value is determined (no borders will be
  43587. visible), see <samp>zoomspeed</samp>
  43588. </p></dd>
  43589. </dl>
  43590. <p>Note that the value given at zoom is added to the one calculated here.
  43591. </p>
  43592. </dd>
  43593. <dt><samp>zoomspeed</samp></dt>
  43594. <dd><p>Set percent to zoom maximally each frame (enabled when
  43595. <samp>optzoom</samp> is set to 2). Range is from 0 to 5, default value is
  43596. 0.25.
  43597. </p>
  43598. </dd>
  43599. <dt><samp>interpol</samp></dt>
  43600. <dd><p>Specify type of interpolation.
  43601. </p>
  43602. <p>Available values are:
  43603. </p><dl compact="compact">
  43604. <dt>&lsquo;<samp>no</samp>&rsquo;</dt>
  43605. <dd><p>no interpolation
  43606. </p></dd>
  43607. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  43608. <dd><p>linear only horizontal
  43609. </p></dd>
  43610. <dt>&lsquo;<samp>bilinear</samp>&rsquo;</dt>
  43611. <dd><p>linear in both directions (default)
  43612. </p></dd>
  43613. <dt>&lsquo;<samp>bicubic</samp>&rsquo;</dt>
  43614. <dd><p>cubic in both directions (slow)
  43615. </p></dd>
  43616. </dl>
  43617. </dd>
  43618. <dt><samp>tripod</samp></dt>
  43619. <dd><p>Enable virtual tripod mode if set to 1, which is equivalent to
  43620. <code>relative=0:smoothing=0</code>. Default value is 0.
  43621. </p>
  43622. <p>Use also <code>tripod</code> option of <a href="#vidstabdetect">vidstabdetect</a>.
  43623. </p>
  43624. </dd>
  43625. <dt><samp>debug</samp></dt>
  43626. <dd><p>Increase log verbosity if set to 1. Also the detected global motions
  43627. are written to the temporary file <samp>global_motions.trf</samp>. Default
  43628. value is 0.
  43629. </p></dd>
  43630. </dl>
  43631. <a name="Examples-157"></a>
  43632. <h4 class="subsection">39.241.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-157" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-157" aria-hidden="true">TOC</a></span></h4>
  43633. <ul>
  43634. <li> Use <code>ffmpeg</code> for a typical stabilization with default values:
  43635. <div class="example">
  43636. <pre class="example">ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
  43637. </pre></div>
  43638. <p>Note the use of the <a href="#unsharp">unsharp</a> filter which is always recommended.
  43639. </p>
  43640. </li><li> Zoom in a bit more and load transform data from a given file:
  43641. <div class="example">
  43642. <pre class="example">vidstabtransform=zoom=5:input=&quot;mytransforms.trf&quot;
  43643. </pre></div>
  43644. </li><li> Smoothen the video even more:
  43645. <div class="example">
  43646. <pre class="example">vidstabtransform=smoothing=30
  43647. </pre></div>
  43648. </li></ul>
  43649. <a name="vflip"></a>
  43650. <h3 class="section">39.242 vflip<span class="pull-right"><a class="anchor hidden-xs" href="#vflip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vflip" aria-hidden="true">TOC</a></span></h3>
  43651. <p>Flip the input video vertically.
  43652. </p>
  43653. <p>For example, to vertically flip a video with <code>ffmpeg</code>:
  43654. </p><div class="example">
  43655. <pre class="example">ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
  43656. </pre></div>
  43657. <a name="vfrdet"></a>
  43658. <h3 class="section">39.243 vfrdet<span class="pull-right"><a class="anchor hidden-xs" href="#vfrdet" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vfrdet" aria-hidden="true">TOC</a></span></h3>
  43659. <p>Detect variable frame rate video.
  43660. </p>
  43661. <p>This filter tries to detect if the input is variable or constant frame rate.
  43662. </p>
  43663. <p>At end it will output number of frames detected as having variable delta pts,
  43664. and ones with constant delta pts.
  43665. If there was frames with variable delta, than it will also show min, max and
  43666. average delta encountered.
  43667. </p>
  43668. <a name="vibrance"></a>
  43669. <h3 class="section">39.244 vibrance<span class="pull-right"><a class="anchor hidden-xs" href="#vibrance" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vibrance" aria-hidden="true">TOC</a></span></h3>
  43670. <p>Boost or alter saturation.
  43671. </p>
  43672. <p>The filter accepts the following options:
  43673. </p><dl compact="compact">
  43674. <dt><samp>intensity</samp></dt>
  43675. <dd><p>Set strength of boost if positive value or strength of alter if negative value.
  43676. Default is 0. Allowed range is from -2 to 2.
  43677. </p>
  43678. </dd>
  43679. <dt><samp>rbal</samp></dt>
  43680. <dd><p>Set the red balance. Default is 1. Allowed range is from -10 to 10.
  43681. </p>
  43682. </dd>
  43683. <dt><samp>gbal</samp></dt>
  43684. <dd><p>Set the green balance. Default is 1. Allowed range is from -10 to 10.
  43685. </p>
  43686. </dd>
  43687. <dt><samp>bbal</samp></dt>
  43688. <dd><p>Set the blue balance. Default is 1. Allowed range is from -10 to 10.
  43689. </p>
  43690. </dd>
  43691. <dt><samp>rlum</samp></dt>
  43692. <dd><p>Set the red luma coefficient.
  43693. </p>
  43694. </dd>
  43695. <dt><samp>glum</samp></dt>
  43696. <dd><p>Set the green luma coefficient.
  43697. </p>
  43698. </dd>
  43699. <dt><samp>blum</samp></dt>
  43700. <dd><p>Set the blue luma coefficient.
  43701. </p>
  43702. </dd>
  43703. <dt><samp>alternate</samp></dt>
  43704. <dd><p>If <code>intensity</code> is negative and this is set to 1, colors will change,
  43705. otherwise colors will be less saturated, more towards gray.
  43706. </p></dd>
  43707. </dl>
  43708. <a name="Commands-130"></a>
  43709. <h4 class="subsection">39.244.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-130" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-130" aria-hidden="true">TOC</a></span></h4>
  43710. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  43711. </p>
  43712. <a name="vif"></a>
  43713. <h3 class="section">39.245 vif<span class="pull-right"><a class="anchor hidden-xs" href="#vif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vif" aria-hidden="true">TOC</a></span></h3>
  43714. <p>Obtain the average VIF (Visual Information Fidelity) between two input videos.
  43715. </p>
  43716. <p>This filter takes two input videos.
  43717. </p>
  43718. <p>Both input videos must have the same resolution and pixel format for
  43719. this filter to work correctly. Also it assumes that both inputs
  43720. have the same number of frames, which are compared one by one.
  43721. </p>
  43722. <p>The obtained average VIF score is printed through the logging system.
  43723. </p>
  43724. <p>The filter stores the calculated VIF score of each frame.
  43725. </p>
  43726. <p>In the below example the input file <samp>main.mpg</samp> being processed is compared
  43727. with the reference file <samp>ref.mpg</samp>.
  43728. </p>
  43729. <div class="example">
  43730. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi vif -f null -
  43731. </pre></div>
  43732. <span id="vignette"></span><a name="vignette-1"></a>
  43733. <h3 class="section">39.246 vignette<span class="pull-right"><a class="anchor hidden-xs" href="#vignette-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vignette-1" aria-hidden="true">TOC</a></span></h3>
  43734. <p>Make or reverse a natural vignetting effect.
  43735. </p>
  43736. <p>The filter accepts the following options:
  43737. </p>
  43738. <dl compact="compact">
  43739. <dt><samp>angle, a</samp></dt>
  43740. <dd><p>Set lens angle expression as a number of radians.
  43741. </p>
  43742. <p>The value is clipped in the <code>[0,PI/2]</code> range.
  43743. </p>
  43744. <p>Default value: <code>&quot;PI/5&quot;</code>
  43745. </p>
  43746. </dd>
  43747. <dt><samp>x0</samp></dt>
  43748. <dt><samp>y0</samp></dt>
  43749. <dd><p>Set center coordinates expressions. Respectively <code>&quot;w/2&quot;</code> and <code>&quot;h/2&quot;</code>
  43750. by default.
  43751. </p>
  43752. </dd>
  43753. <dt><samp>mode</samp></dt>
  43754. <dd><p>Set forward/backward mode.
  43755. </p>
  43756. <p>Available modes are:
  43757. </p><dl compact="compact">
  43758. <dt>&lsquo;<samp>forward</samp>&rsquo;</dt>
  43759. <dd><p>The larger the distance from the central point, the darker the image becomes.
  43760. </p>
  43761. </dd>
  43762. <dt>&lsquo;<samp>backward</samp>&rsquo;</dt>
  43763. <dd><p>The larger the distance from the central point, the brighter the image becomes.
  43764. This can be used to reverse a vignette effect, though there is no automatic
  43765. detection to extract the lens <samp>angle</samp> and other settings (yet). It can
  43766. also be used to create a burning effect.
  43767. </p></dd>
  43768. </dl>
  43769. <p>Default value is &lsquo;<samp>forward</samp>&rsquo;.
  43770. </p>
  43771. </dd>
  43772. <dt><samp>eval</samp></dt>
  43773. <dd><p>Set evaluation mode for the expressions (<samp>angle</samp>, <samp>x0</samp>, <samp>y0</samp>).
  43774. </p>
  43775. <p>It accepts the following values:
  43776. </p><dl compact="compact">
  43777. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  43778. <dd><p>Evaluate expressions only once during the filter initialization.
  43779. </p>
  43780. </dd>
  43781. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  43782. <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
  43783. &lsquo;<samp>init</samp>&rsquo; mode since it requires all the scalers to be re-computed, but it
  43784. allows advanced dynamic expressions.
  43785. </p></dd>
  43786. </dl>
  43787. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  43788. </p>
  43789. </dd>
  43790. <dt><samp>dither</samp></dt>
  43791. <dd><p>Set dithering to reduce the circular banding effects. Default is <code>1</code>
  43792. (enabled).
  43793. </p>
  43794. </dd>
  43795. <dt><samp>aspect</samp></dt>
  43796. <dd><p>Set vignette aspect. This setting allows one to adjust the shape of the vignette.
  43797. Setting this value to the SAR of the input will make a rectangular vignetting
  43798. following the dimensions of the video.
  43799. </p>
  43800. <p>Default is <code>1/1</code>.
  43801. </p></dd>
  43802. </dl>
  43803. <a name="Expressions"></a>
  43804. <h4 class="subsection">39.246.1 Expressions<span class="pull-right"><a class="anchor hidden-xs" href="#Expressions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Expressions" aria-hidden="true">TOC</a></span></h4>
  43805. <p>The <samp>alpha</samp>, <samp>x0</samp> and <samp>y0</samp> expressions can contain the
  43806. following parameters.
  43807. </p>
  43808. <dl compact="compact">
  43809. <dt><samp>w</samp></dt>
  43810. <dt><samp>h</samp></dt>
  43811. <dd><p>input width and height
  43812. </p>
  43813. </dd>
  43814. <dt><samp>n</samp></dt>
  43815. <dd><p>the number of input frame, starting from 0
  43816. </p>
  43817. </dd>
  43818. <dt><samp>pts</samp></dt>
  43819. <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
  43820. <var>TB</var> units, NAN if undefined
  43821. </p>
  43822. </dd>
  43823. <dt><samp>r</samp></dt>
  43824. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  43825. </p>
  43826. </dd>
  43827. <dt><samp>t</samp></dt>
  43828. <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
  43829. expressed in seconds, NAN if undefined
  43830. </p>
  43831. </dd>
  43832. <dt><samp>tb</samp></dt>
  43833. <dd><p>time base of the input video
  43834. </p></dd>
  43835. </dl>
  43836. <a name="Examples-158"></a>
  43837. <h4 class="subsection">39.246.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-158" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-158" aria-hidden="true">TOC</a></span></h4>
  43838. <ul>
  43839. <li> Apply simple strong vignetting effect:
  43840. <div class="example">
  43841. <pre class="example">vignette=PI/4
  43842. </pre></div>
  43843. </li><li> Make a flickering vignetting:
  43844. <div class="example">
  43845. <pre class="example">vignette='PI/4+random(1)*PI/50':eval=frame
  43846. </pre></div>
  43847. </li></ul>
  43848. <a name="vmafmotion"></a>
  43849. <h3 class="section">39.247 vmafmotion<span class="pull-right"><a class="anchor hidden-xs" href="#vmafmotion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vmafmotion" aria-hidden="true">TOC</a></span></h3>
  43850. <p>Obtain the average VMAF motion score of a video.
  43851. It is one of the component metrics of VMAF.
  43852. </p>
  43853. <p>The obtained average motion score is printed through the logging system.
  43854. </p>
  43855. <p>The filter accepts the following options:
  43856. </p>
  43857. <dl compact="compact">
  43858. <dt><samp>stats_file</samp></dt>
  43859. <dd><p>If specified, the filter will use the named file to save the motion score of
  43860. each frame with respect to the previous frame.
  43861. When filename equals &quot;-&quot; the data is sent to standard output.
  43862. </p></dd>
  43863. </dl>
  43864. <p>Example:
  43865. </p><div class="example">
  43866. <pre class="example">ffmpeg -i ref.mpg -vf vmafmotion -f null -
  43867. </pre></div>
  43868. <a name="vstack"></a>
  43869. <h3 class="section">39.248 vstack<span class="pull-right"><a class="anchor hidden-xs" href="#vstack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vstack" aria-hidden="true">TOC</a></span></h3>
  43870. <p>Stack input videos vertically.
  43871. </p>
  43872. <p>All streams must be of same pixel format and of same width.
  43873. </p>
  43874. <p>Note that this filter is faster than using <a href="#overlay">overlay</a> and <a href="#pad">pad</a> filter
  43875. to create same output.
  43876. </p>
  43877. <p>The filter accepts the following options:
  43878. </p>
  43879. <dl compact="compact">
  43880. <dt><samp>inputs</samp></dt>
  43881. <dd><p>Set number of input streams. Default is 2.
  43882. </p>
  43883. </dd>
  43884. <dt><samp>shortest</samp></dt>
  43885. <dd><p>If set to 1, force the output to terminate when the shortest input
  43886. terminates. Default value is 0.
  43887. </p></dd>
  43888. </dl>
  43889. <a name="w3fdif"></a>
  43890. <h3 class="section">39.249 w3fdif<span class="pull-right"><a class="anchor hidden-xs" href="#w3fdif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-w3fdif" aria-hidden="true">TOC</a></span></h3>
  43891. <p>Deinterlace the input video (&quot;w3fdif&quot; stands for &quot;Weston 3 Field
  43892. Deinterlacing Filter&quot;).
  43893. </p>
  43894. <p>Based on the process described by Martin Weston for BBC R&amp;D, and
  43895. implemented based on the de-interlace algorithm written by Jim
  43896. Easterbrook for BBC R&amp;D, the Weston 3 field deinterlacing filter
  43897. uses filter coefficients calculated by BBC R&amp;D.
  43898. </p>
  43899. <p>This filter uses field-dominance information in frame to decide which
  43900. of each pair of fields to place first in the output.
  43901. If it gets it wrong use <a href="#setfield">setfield</a> filter before <code>w3fdif</code> filter.
  43902. </p>
  43903. <p>There are two sets of filter coefficients, so called &quot;simple&quot;
  43904. and &quot;complex&quot;. Which set of filter coefficients is used can
  43905. be set by passing an optional parameter:
  43906. </p>
  43907. <dl compact="compact">
  43908. <dt><samp>filter</samp></dt>
  43909. <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
  43910. </p>
  43911. <dl compact="compact">
  43912. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  43913. <dd><p>Simple filter coefficient set.
  43914. </p></dd>
  43915. <dt>&lsquo;<samp>complex</samp>&rsquo;</dt>
  43916. <dd><p>More-complex filter coefficient set.
  43917. </p></dd>
  43918. </dl>
  43919. <p>Default value is &lsquo;<samp>complex</samp>&rsquo;.
  43920. </p>
  43921. </dd>
  43922. <dt><samp>mode</samp></dt>
  43923. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  43924. </p>
  43925. <dl compact="compact">
  43926. <dt><samp>frame</samp></dt>
  43927. <dd><p>Output one frame for each frame.
  43928. </p></dd>
  43929. <dt><samp>field</samp></dt>
  43930. <dd><p>Output one frame for each field.
  43931. </p></dd>
  43932. </dl>
  43933. <p>The default value is <code>field</code>.
  43934. </p>
  43935. </dd>
  43936. <dt><samp>parity</samp></dt>
  43937. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  43938. of the following values:
  43939. </p>
  43940. <dl compact="compact">
  43941. <dt><samp>tff</samp></dt>
  43942. <dd><p>Assume the top field is first.
  43943. </p></dd>
  43944. <dt><samp>bff</samp></dt>
  43945. <dd><p>Assume the bottom field is first.
  43946. </p></dd>
  43947. <dt><samp>auto</samp></dt>
  43948. <dd><p>Enable automatic detection of field parity.
  43949. </p></dd>
  43950. </dl>
  43951. <p>The default value is <code>auto</code>.
  43952. If the interlacing is unknown or the decoder does not export this information,
  43953. top field first will be assumed.
  43954. </p>
  43955. </dd>
  43956. <dt><samp>deint</samp></dt>
  43957. <dd><p>Specify which frames to deinterlace. Accepts one of the following values:
  43958. </p>
  43959. <dl compact="compact">
  43960. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  43961. <dd><p>Deinterlace all frames,
  43962. </p></dd>
  43963. <dt>&lsquo;<samp>interlaced</samp>&rsquo;</dt>
  43964. <dd><p>Only deinterlace frames marked as interlaced.
  43965. </p></dd>
  43966. </dl>
  43967. <p>Default value is &lsquo;<samp>all</samp>&rsquo;.
  43968. </p></dd>
  43969. </dl>
  43970. <a name="Commands-131"></a>
  43971. <h4 class="subsection">39.249.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-131" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-131" aria-hidden="true">TOC</a></span></h4>
  43972. <p>This filter supports same <a href="#commands">commands</a> as options.
  43973. </p>
  43974. <a name="waveform"></a>
  43975. <h3 class="section">39.250 waveform<span class="pull-right"><a class="anchor hidden-xs" href="#waveform" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-waveform" aria-hidden="true">TOC</a></span></h3>
  43976. <p>Video waveform monitor.
  43977. </p>
  43978. <p>The waveform monitor plots color component intensity. By default luminance
  43979. only. Each column of the waveform corresponds to a column of pixels in the
  43980. source video.
  43981. </p>
  43982. <p>It accepts the following options:
  43983. </p>
  43984. <dl compact="compact">
  43985. <dt><samp>mode, m</samp></dt>
  43986. <dd><p>Can be either <code>row</code>, or <code>column</code>. Default is <code>column</code>.
  43987. In row mode, the graph on the left side represents color component value 0 and
  43988. the right side represents value = 255. In column mode, the top side represents
  43989. color component value = 0 and bottom side represents value = 255.
  43990. </p>
  43991. </dd>
  43992. <dt><samp>intensity, i</samp></dt>
  43993. <dd><p>Set intensity. Smaller values are useful to find out how many values of the same
  43994. luminance are distributed across input rows/columns.
  43995. Default value is <code>0.04</code>. Allowed range is [0, 1].
  43996. </p>
  43997. </dd>
  43998. <dt><samp>mirror, r</samp></dt>
  43999. <dd><p>Set mirroring mode. <code>0</code> means unmirrored, <code>1</code> means mirrored.
  44000. In mirrored mode, higher values will be represented on the left
  44001. side for <code>row</code> mode and at the top for <code>column</code> mode. Default is
  44002. <code>1</code> (mirrored).
  44003. </p>
  44004. </dd>
  44005. <dt><samp>display, d</samp></dt>
  44006. <dd><p>Set display mode.
  44007. It accepts the following values:
  44008. </p><dl compact="compact">
  44009. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  44010. <dd><p>Presents information identical to that in the <code>parade</code>, except
  44011. that the graphs representing color components are superimposed directly
  44012. over one another.
  44013. </p>
  44014. <p>This display mode makes it easier to spot relative differences or similarities
  44015. in overlapping areas of the color components that are supposed to be identical,
  44016. such as neutral whites, grays, or blacks.
  44017. </p>
  44018. </dd>
  44019. <dt>&lsquo;<samp>stack</samp>&rsquo;</dt>
  44020. <dd><p>Display separate graph for the color components side by side in
  44021. <code>row</code> mode or one below the other in <code>column</code> mode.
  44022. </p>
  44023. </dd>
  44024. <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
  44025. <dd><p>Display separate graph for the color components side by side in
  44026. <code>column</code> mode or one below the other in <code>row</code> mode.
  44027. </p>
  44028. <p>Using this display mode makes it easy to spot color casts in the highlights
  44029. and shadows of an image, by comparing the contours of the top and the bottom
  44030. graphs of each waveform. Since whites, grays, and blacks are characterized
  44031. by exactly equal amounts of red, green, and blue, neutral areas of the picture
  44032. should display three waveforms of roughly equal width/height. If not, the
  44033. correction is easy to perform by making level adjustments the three waveforms.
  44034. </p></dd>
  44035. </dl>
  44036. <p>Default is <code>stack</code>.
  44037. </p>
  44038. </dd>
  44039. <dt><samp>components, c</samp></dt>
  44040. <dd><p>Set which color components to display. Default is 1, which means only luminance
  44041. or red color component if input is in RGB colorspace. If is set for example to
  44042. 7 it will display all 3 (if) available color components.
  44043. </p>
  44044. </dd>
  44045. <dt><samp>envelope, e</samp></dt>
  44046. <dd><dl compact="compact">
  44047. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  44048. <dd><p>No envelope, this is default.
  44049. </p>
  44050. </dd>
  44051. <dt>&lsquo;<samp>instant</samp>&rsquo;</dt>
  44052. <dd><p>Instant envelope, minimum and maximum values presented in graph will be easily
  44053. visible even with small <code>step</code> value.
  44054. </p>
  44055. </dd>
  44056. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  44057. <dd><p>Hold minimum and maximum values presented in graph across time. This way you
  44058. can still spot out of range values without constantly looking at waveforms.
  44059. </p>
  44060. </dd>
  44061. <dt>&lsquo;<samp>peak+instant</samp>&rsquo;</dt>
  44062. <dd><p>Peak and instant envelope combined together.
  44063. </p></dd>
  44064. </dl>
  44065. </dd>
  44066. <dt><samp>filter, f</samp></dt>
  44067. <dd><dl compact="compact">
  44068. <dt>&lsquo;<samp>lowpass</samp>&rsquo;</dt>
  44069. <dd><p>No filtering, this is default.
  44070. </p>
  44071. </dd>
  44072. <dt>&lsquo;<samp>flat</samp>&rsquo;</dt>
  44073. <dd><p>Luma and chroma combined together.
  44074. </p>
  44075. </dd>
  44076. <dt>&lsquo;<samp>aflat</samp>&rsquo;</dt>
  44077. <dd><p>Similar as above, but shows difference between blue and red chroma.
  44078. </p>
  44079. </dd>
  44080. <dt>&lsquo;<samp>xflat</samp>&rsquo;</dt>
  44081. <dd><p>Similar as above, but use different colors.
  44082. </p>
  44083. </dd>
  44084. <dt>&lsquo;<samp>yflat</samp>&rsquo;</dt>
  44085. <dd><p>Similar as above, but again with different colors.
  44086. </p>
  44087. </dd>
  44088. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  44089. <dd><p>Displays only chroma.
  44090. </p>
  44091. </dd>
  44092. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  44093. <dd><p>Displays actual color value on waveform.
  44094. </p>
  44095. </dd>
  44096. <dt>&lsquo;<samp>acolor</samp>&rsquo;</dt>
  44097. <dd><p>Similar as above, but with luma showing frequency of chroma values.
  44098. </p></dd>
  44099. </dl>
  44100. </dd>
  44101. <dt><samp>graticule, g</samp></dt>
  44102. <dd><p>Set which graticule to display.
  44103. </p>
  44104. <dl compact="compact">
  44105. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  44106. <dd><p>Do not display graticule.
  44107. </p>
  44108. </dd>
  44109. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  44110. <dd><p>Display green graticule showing legal broadcast ranges.
  44111. </p>
  44112. </dd>
  44113. <dt>&lsquo;<samp>orange</samp>&rsquo;</dt>
  44114. <dd><p>Display orange graticule showing legal broadcast ranges.
  44115. </p>
  44116. </dd>
  44117. <dt>&lsquo;<samp>invert</samp>&rsquo;</dt>
  44118. <dd><p>Display invert graticule showing legal broadcast ranges.
  44119. </p></dd>
  44120. </dl>
  44121. </dd>
  44122. <dt><samp>opacity, o</samp></dt>
  44123. <dd><p>Set graticule opacity.
  44124. </p>
  44125. </dd>
  44126. <dt><samp>flags, fl</samp></dt>
  44127. <dd><p>Set graticule flags.
  44128. </p>
  44129. <dl compact="compact">
  44130. <dt>&lsquo;<samp>numbers</samp>&rsquo;</dt>
  44131. <dd><p>Draw numbers above lines. By default enabled.
  44132. </p>
  44133. </dd>
  44134. <dt>&lsquo;<samp>dots</samp>&rsquo;</dt>
  44135. <dd><p>Draw dots instead of lines.
  44136. </p></dd>
  44137. </dl>
  44138. </dd>
  44139. <dt><samp>scale, s</samp></dt>
  44140. <dd><p>Set scale used for displaying graticule.
  44141. </p>
  44142. <dl compact="compact">
  44143. <dt>&lsquo;<samp>digital</samp>&rsquo;</dt>
  44144. <dt>&lsquo;<samp>millivolts</samp>&rsquo;</dt>
  44145. <dt>&lsquo;<samp>ire</samp>&rsquo;</dt>
  44146. </dl>
  44147. <p>Default is digital.
  44148. </p>
  44149. </dd>
  44150. <dt><samp>bgopacity, b</samp></dt>
  44151. <dd><p>Set background opacity.
  44152. </p>
  44153. </dd>
  44154. <dt><samp>tint0, t0</samp></dt>
  44155. <dt><samp>tint1, t1</samp></dt>
  44156. <dd><p>Set tint for output.
  44157. Only used with lowpass filter and when display is not overlay and input
  44158. pixel formats are not RGB.
  44159. </p></dd>
  44160. </dl>
  44161. <a name="weave_002c-doubleweave"></a>
  44162. <h3 class="section">39.251 weave, doubleweave<span class="pull-right"><a class="anchor hidden-xs" href="#weave_002c-doubleweave" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-weave_002c-doubleweave" aria-hidden="true">TOC</a></span></h3>
  44163. <p>The <code>weave</code> takes a field-based video input and join
  44164. each two sequential fields into single frame, producing a new double
  44165. height clip with half the frame rate and half the frame count.
  44166. </p>
  44167. <p>The <code>doubleweave</code> works same as <code>weave</code> but without
  44168. halving frame rate and frame count.
  44169. </p>
  44170. <p>It accepts the following option:
  44171. </p>
  44172. <dl compact="compact">
  44173. <dt><samp>first_field</samp></dt>
  44174. <dd><p>Set first field. Available values are:
  44175. </p>
  44176. <dl compact="compact">
  44177. <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
  44178. <dd><p>Set the frame as top-field-first.
  44179. </p>
  44180. </dd>
  44181. <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
  44182. <dd><p>Set the frame as bottom-field-first.
  44183. </p></dd>
  44184. </dl>
  44185. </dd>
  44186. </dl>
  44187. <a name="Examples-159"></a>
  44188. <h4 class="subsection">39.251.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-159" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-159" aria-hidden="true">TOC</a></span></h4>
  44189. <ul>
  44190. <li> Interlace video using <a href="#select">select</a> and <a href="#separatefields">separatefields</a> filter:
  44191. <div class="example">
  44192. <pre class="example">separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
  44193. </pre></div>
  44194. </li></ul>
  44195. <a name="xbr"></a>
  44196. <h3 class="section">39.252 xbr<span class="pull-right"><a class="anchor hidden-xs" href="#xbr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xbr" aria-hidden="true">TOC</a></span></h3>
  44197. <p>Apply the xBR high-quality magnification filter which is designed for pixel
  44198. art. It follows a set of edge-detection rules, see
  44199. <a href="https://forums.libretro.com/t/xbr-algorithm-tutorial/123">https://forums.libretro.com/t/xbr-algorithm-tutorial/123</a>.
  44200. </p>
  44201. <p>It accepts the following option:
  44202. </p>
  44203. <dl compact="compact">
  44204. <dt><samp>n</samp></dt>
  44205. <dd><p>Set the scaling dimension: <code>2</code> for <code>2xBR</code>, <code>3</code> for
  44206. <code>3xBR</code> and <code>4</code> for <code>4xBR</code>.
  44207. Default is <code>3</code>.
  44208. </p></dd>
  44209. </dl>
  44210. <a name="xfade"></a>
  44211. <h3 class="section">39.253 xfade<span class="pull-right"><a class="anchor hidden-xs" href="#xfade" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xfade" aria-hidden="true">TOC</a></span></h3>
  44212. <p>Apply cross fade from one input video stream to another input video stream.
  44213. The cross fade is applied for specified duration.
  44214. </p>
  44215. <p>The filter accepts the following options:
  44216. </p>
  44217. <dl compact="compact">
  44218. <dt><samp>transition</samp></dt>
  44219. <dd><p>Set one of available transition effects:
  44220. </p>
  44221. <dl compact="compact">
  44222. <dt>&lsquo;<samp>custom</samp>&rsquo;</dt>
  44223. <dt>&lsquo;<samp>fade</samp>&rsquo;</dt>
  44224. <dt>&lsquo;<samp>wipeleft</samp>&rsquo;</dt>
  44225. <dt>&lsquo;<samp>wiperight</samp>&rsquo;</dt>
  44226. <dt>&lsquo;<samp>wipeup</samp>&rsquo;</dt>
  44227. <dt>&lsquo;<samp>wipedown</samp>&rsquo;</dt>
  44228. <dt>&lsquo;<samp>slideleft</samp>&rsquo;</dt>
  44229. <dt>&lsquo;<samp>slideright</samp>&rsquo;</dt>
  44230. <dt>&lsquo;<samp>slideup</samp>&rsquo;</dt>
  44231. <dt>&lsquo;<samp>slidedown</samp>&rsquo;</dt>
  44232. <dt>&lsquo;<samp>circlecrop</samp>&rsquo;</dt>
  44233. <dt>&lsquo;<samp>rectcrop</samp>&rsquo;</dt>
  44234. <dt>&lsquo;<samp>distance</samp>&rsquo;</dt>
  44235. <dt>&lsquo;<samp>fadeblack</samp>&rsquo;</dt>
  44236. <dt>&lsquo;<samp>fadewhite</samp>&rsquo;</dt>
  44237. <dt>&lsquo;<samp>radial</samp>&rsquo;</dt>
  44238. <dt>&lsquo;<samp>smoothleft</samp>&rsquo;</dt>
  44239. <dt>&lsquo;<samp>smoothright</samp>&rsquo;</dt>
  44240. <dt>&lsquo;<samp>smoothup</samp>&rsquo;</dt>
  44241. <dt>&lsquo;<samp>smoothdown</samp>&rsquo;</dt>
  44242. <dt>&lsquo;<samp>circleopen</samp>&rsquo;</dt>
  44243. <dt>&lsquo;<samp>circleclose</samp>&rsquo;</dt>
  44244. <dt>&lsquo;<samp>vertopen</samp>&rsquo;</dt>
  44245. <dt>&lsquo;<samp>vertclose</samp>&rsquo;</dt>
  44246. <dt>&lsquo;<samp>horzopen</samp>&rsquo;</dt>
  44247. <dt>&lsquo;<samp>horzclose</samp>&rsquo;</dt>
  44248. <dt>&lsquo;<samp>dissolve</samp>&rsquo;</dt>
  44249. <dt>&lsquo;<samp>pixelize</samp>&rsquo;</dt>
  44250. <dt>&lsquo;<samp>diagtl</samp>&rsquo;</dt>
  44251. <dt>&lsquo;<samp>diagtr</samp>&rsquo;</dt>
  44252. <dt>&lsquo;<samp>diagbl</samp>&rsquo;</dt>
  44253. <dt>&lsquo;<samp>diagbr</samp>&rsquo;</dt>
  44254. <dt>&lsquo;<samp>hlslice</samp>&rsquo;</dt>
  44255. <dt>&lsquo;<samp>hrslice</samp>&rsquo;</dt>
  44256. <dt>&lsquo;<samp>vuslice</samp>&rsquo;</dt>
  44257. <dt>&lsquo;<samp>vdslice</samp>&rsquo;</dt>
  44258. <dt>&lsquo;<samp>hblur</samp>&rsquo;</dt>
  44259. <dt>&lsquo;<samp>fadegrays</samp>&rsquo;</dt>
  44260. <dt>&lsquo;<samp>wipetl</samp>&rsquo;</dt>
  44261. <dt>&lsquo;<samp>wipetr</samp>&rsquo;</dt>
  44262. <dt>&lsquo;<samp>wipebl</samp>&rsquo;</dt>
  44263. <dt>&lsquo;<samp>wipebr</samp>&rsquo;</dt>
  44264. <dt>&lsquo;<samp>squeezeh</samp>&rsquo;</dt>
  44265. <dt>&lsquo;<samp>squeezev</samp>&rsquo;</dt>
  44266. </dl>
  44267. <p>Default transition effect is fade.
  44268. </p>
  44269. </dd>
  44270. <dt><samp>duration</samp></dt>
  44271. <dd><p>Set cross fade duration in seconds.
  44272. Default duration is 1 second.
  44273. </p>
  44274. </dd>
  44275. <dt><samp>offset</samp></dt>
  44276. <dd><p>Set cross fade start relative to first input stream in seconds.
  44277. Default offset is 0.
  44278. </p>
  44279. </dd>
  44280. <dt><samp>expr</samp></dt>
  44281. <dd><p>Set expression for custom transition effect.
  44282. </p>
  44283. <p>The expressions can use the following variables and functions:
  44284. </p>
  44285. <dl compact="compact">
  44286. <dt><samp>X</samp></dt>
  44287. <dt><samp>Y</samp></dt>
  44288. <dd><p>The coordinates of the current sample.
  44289. </p>
  44290. </dd>
  44291. <dt><samp>W</samp></dt>
  44292. <dt><samp>H</samp></dt>
  44293. <dd><p>The width and height of the image.
  44294. </p>
  44295. </dd>
  44296. <dt><samp>P</samp></dt>
  44297. <dd><p>Progress of transition effect.
  44298. </p>
  44299. </dd>
  44300. <dt><samp>PLANE</samp></dt>
  44301. <dd><p>Currently processed plane.
  44302. </p>
  44303. </dd>
  44304. <dt><samp>A</samp></dt>
  44305. <dd><p>Return value of first input at current location and plane.
  44306. </p>
  44307. </dd>
  44308. <dt><samp>B</samp></dt>
  44309. <dd><p>Return value of second input at current location and plane.
  44310. </p>
  44311. </dd>
  44312. <dt><samp>a0(x, y)</samp></dt>
  44313. <dt><samp>a1(x, y)</samp></dt>
  44314. <dt><samp>a2(x, y)</samp></dt>
  44315. <dt><samp>a3(x, y)</samp></dt>
  44316. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  44317. first/second/third/fourth component of first input.
  44318. </p>
  44319. </dd>
  44320. <dt><samp>b0(x, y)</samp></dt>
  44321. <dt><samp>b1(x, y)</samp></dt>
  44322. <dt><samp>b2(x, y)</samp></dt>
  44323. <dt><samp>b3(x, y)</samp></dt>
  44324. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  44325. first/second/third/fourth component of second input.
  44326. </p></dd>
  44327. </dl>
  44328. </dd>
  44329. </dl>
  44330. <a name="Examples-160"></a>
  44331. <h4 class="subsection">39.253.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-160" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-160" aria-hidden="true">TOC</a></span></h4>
  44332. <ul>
  44333. <li> Cross fade from one input video to another input video, with fade transition and duration of transition
  44334. of 2 seconds starting at offset of 5 seconds:
  44335. <div class="example">
  44336. <pre class="example">ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
  44337. </pre></div>
  44338. </li></ul>
  44339. <a name="xmedian"></a>
  44340. <h3 class="section">39.254 xmedian<span class="pull-right"><a class="anchor hidden-xs" href="#xmedian" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xmedian" aria-hidden="true">TOC</a></span></h3>
  44341. <p>Pick median pixels from several input videos.
  44342. </p>
  44343. <p>The filter accepts the following options:
  44344. </p>
  44345. <dl compact="compact">
  44346. <dt><samp>inputs</samp></dt>
  44347. <dd><p>Set number of inputs.
  44348. Default is 3. Allowed range is from 3 to 255.
  44349. If number of inputs is even number, than result will be mean value between two median values.
  44350. </p>
  44351. </dd>
  44352. <dt><samp>planes</samp></dt>
  44353. <dd><p>Set which planes to filter. Default value is <code>15</code>, by which all planes are processed.
  44354. </p>
  44355. </dd>
  44356. <dt><samp>percentile</samp></dt>
  44357. <dd><p>Set median percentile. Default value is <code>0.5</code>.
  44358. Default value of <code>0.5</code> will pick always median values, while <code>0</code> will pick
  44359. minimum values, and <code>1</code> maximum values.
  44360. </p></dd>
  44361. </dl>
  44362. <a name="Commands-132"></a>
  44363. <h4 class="subsection">39.254.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-132" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-132" aria-hidden="true">TOC</a></span></h4>
  44364. <p>This filter supports all above options as <a href="#commands">commands</a>, excluding option <code>inputs</code>.
  44365. </p>
  44366. <a name="xstack"></a>
  44367. <h3 class="section">39.255 xstack<span class="pull-right"><a class="anchor hidden-xs" href="#xstack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xstack" aria-hidden="true">TOC</a></span></h3>
  44368. <p>Stack video inputs into custom layout.
  44369. </p>
  44370. <p>All streams must be of same pixel format.
  44371. </p>
  44372. <p>The filter accepts the following options:
  44373. </p>
  44374. <dl compact="compact">
  44375. <dt><samp>inputs</samp></dt>
  44376. <dd><p>Set number of input streams. Default is 2.
  44377. </p>
  44378. </dd>
  44379. <dt><samp>layout</samp></dt>
  44380. <dd><p>Specify layout of inputs.
  44381. This option requires the desired layout configuration to be explicitly set by the user.
  44382. This sets position of each video input in output. Each input
  44383. is separated by &rsquo;|&rsquo;.
  44384. The first number represents the column, and the second number represents the row.
  44385. Numbers start at 0 and are separated by &rsquo;_&rsquo;. Optionally one can use wX and hX,
  44386. where X is video input from which to take width or height.
  44387. Multiple values can be used when separated by &rsquo;+&rsquo;. In such
  44388. case values are summed together.
  44389. </p>
  44390. <p>Note that if inputs are of different sizes gaps may appear, as not all of
  44391. the output video frame will be filled. Similarly, videos can overlap each
  44392. other if their position doesn&rsquo;t leave enough space for the full frame of
  44393. adjoining videos.
  44394. </p>
  44395. <p>For 2 inputs, a default layout of <code>0_0|w0_0</code> is set. In all other cases,
  44396. a layout must be set by the user.
  44397. </p>
  44398. </dd>
  44399. <dt><samp>shortest</samp></dt>
  44400. <dd><p>If set to 1, force the output to terminate when the shortest input
  44401. terminates. Default value is 0.
  44402. </p>
  44403. </dd>
  44404. <dt><samp>fill</samp></dt>
  44405. <dd><p>If set to valid color, all unused pixels will be filled with that color.
  44406. By default fill is set to none, so it is disabled.
  44407. </p></dd>
  44408. </dl>
  44409. <a name="Examples-161"></a>
  44410. <h4 class="subsection">39.255.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-161" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-161" aria-hidden="true">TOC</a></span></h4>
  44411. <ul>
  44412. <li> Display 4 inputs into 2x2 grid.
  44413. <p>Layout:
  44414. </p><div class="example">
  44415. <pre class="example">input1(0, 0) | input3(w0, 0)
  44416. input2(0, h0) | input4(w0, h0)
  44417. </pre></div>
  44418. <div class="example">
  44419. <pre class="example">xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0
  44420. </pre></div>
  44421. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  44422. </p>
  44423. </li><li> Display 4 inputs into 1x4 grid.
  44424. <p>Layout:
  44425. </p><div class="example">
  44426. <pre class="example">input1(0, 0)
  44427. input2(0, h0)
  44428. input3(0, h0+h1)
  44429. input4(0, h0+h1+h2)
  44430. </pre></div>
  44431. <div class="example">
  44432. <pre class="example">xstack=inputs=4:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2
  44433. </pre></div>
  44434. <p>Note that if inputs are of different widths, unused space will appear.
  44435. </p>
  44436. </li><li> Display 9 inputs into 3x3 grid.
  44437. <p>Layout:
  44438. </p><div class="example">
  44439. <pre class="example">input1(0, 0) | input4(w0, 0) | input7(w0+w3, 0)
  44440. input2(0, h0) | input5(w0, h0) | input8(w0+w3, h0)
  44441. input3(0, h0+h1) | input6(w0, h0+h1) | input9(w0+w3, h0+h1)
  44442. </pre></div>
  44443. <div class="example">
  44444. <pre class="example">xstack=inputs=9:layout=0_0|0_h0|0_h0+h1|w0_0|w0_h0|w0_h0+h1|w0+w3_0|w0+w3_h0|w0+w3_h0+h1
  44445. </pre></div>
  44446. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  44447. </p>
  44448. </li><li> Display 16 inputs into 4x4 grid.
  44449. <p>Layout:
  44450. </p><div class="example">
  44451. <pre class="example">input1(0, 0) | input5(w0, 0) | input9 (w0+w4, 0) | input13(w0+w4+w8, 0)
  44452. input2(0, h0) | input6(w0, h0) | input10(w0+w4, h0) | input14(w0+w4+w8, h0)
  44453. input3(0, h0+h1) | input7(w0, h0+h1) | input11(w0+w4, h0+h1) | input15(w0+w4+w8, h0+h1)
  44454. input4(0, h0+h1+h2)| input8(w0, h0+h1+h2)| input12(w0+w4, h0+h1+h2)| input16(w0+w4+w8, h0+h1+h2)
  44455. </pre></div>
  44456. <div class="example">
  44457. <pre class="example">xstack=inputs=16:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|w0_0|w0_h0|w0_h0+h1|w0_h0+h1+h2|w0+w4_0|
  44458. 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
  44459. </pre></div>
  44460. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  44461. </p>
  44462. </li></ul>
  44463. <span id="yadif"></span><a name="yadif-1"></a>
  44464. <h3 class="section">39.256 yadif<span class="pull-right"><a class="anchor hidden-xs" href="#yadif-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-yadif-1" aria-hidden="true">TOC</a></span></h3>
  44465. <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
  44466. filter&quot;).
  44467. </p>
  44468. <p>It accepts the following parameters:
  44469. </p>
  44470. <dl compact="compact">
  44471. <dt><samp>mode</samp></dt>
  44472. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  44473. </p>
  44474. <dl compact="compact">
  44475. <dt><samp>0, send_frame</samp></dt>
  44476. <dd><p>Output one frame for each frame.
  44477. </p></dd>
  44478. <dt><samp>1, send_field</samp></dt>
  44479. <dd><p>Output one frame for each field.
  44480. </p></dd>
  44481. <dt><samp>2, send_frame_nospatial</samp></dt>
  44482. <dd><p>Like <code>send_frame</code>, but it skips the spatial interlacing check.
  44483. </p></dd>
  44484. <dt><samp>3, send_field_nospatial</samp></dt>
  44485. <dd><p>Like <code>send_field</code>, but it skips the spatial interlacing check.
  44486. </p></dd>
  44487. </dl>
  44488. <p>The default value is <code>send_frame</code>.
  44489. </p>
  44490. </dd>
  44491. <dt><samp>parity</samp></dt>
  44492. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  44493. of the following values:
  44494. </p>
  44495. <dl compact="compact">
  44496. <dt><samp>0, tff</samp></dt>
  44497. <dd><p>Assume the top field is first.
  44498. </p></dd>
  44499. <dt><samp>1, bff</samp></dt>
  44500. <dd><p>Assume the bottom field is first.
  44501. </p></dd>
  44502. <dt><samp>-1, auto</samp></dt>
  44503. <dd><p>Enable automatic detection of field parity.
  44504. </p></dd>
  44505. </dl>
  44506. <p>The default value is <code>auto</code>.
  44507. If the interlacing is unknown or the decoder does not export this information,
  44508. top field first will be assumed.
  44509. </p>
  44510. </dd>
  44511. <dt><samp>deint</samp></dt>
  44512. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  44513. values:
  44514. </p>
  44515. <dl compact="compact">
  44516. <dt><samp>0, all</samp></dt>
  44517. <dd><p>Deinterlace all frames.
  44518. </p></dd>
  44519. <dt><samp>1, interlaced</samp></dt>
  44520. <dd><p>Only deinterlace frames marked as interlaced.
  44521. </p></dd>
  44522. </dl>
  44523. <p>The default value is <code>all</code>.
  44524. </p></dd>
  44525. </dl>
  44526. <a name="yadif_005fcuda"></a>
  44527. <h3 class="section">39.257 yadif_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#yadif_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-yadif_005fcuda" aria-hidden="true">TOC</a></span></h3>
  44528. <p>Deinterlace the input video using the <a href="#yadif">yadif</a> algorithm, but implemented
  44529. in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec
  44530. and/or nvenc.
  44531. </p>
  44532. <p>It accepts the following parameters:
  44533. </p>
  44534. <dl compact="compact">
  44535. <dt><samp>mode</samp></dt>
  44536. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  44537. </p>
  44538. <dl compact="compact">
  44539. <dt><samp>0, send_frame</samp></dt>
  44540. <dd><p>Output one frame for each frame.
  44541. </p></dd>
  44542. <dt><samp>1, send_field</samp></dt>
  44543. <dd><p>Output one frame for each field.
  44544. </p></dd>
  44545. <dt><samp>2, send_frame_nospatial</samp></dt>
  44546. <dd><p>Like <code>send_frame</code>, but it skips the spatial interlacing check.
  44547. </p></dd>
  44548. <dt><samp>3, send_field_nospatial</samp></dt>
  44549. <dd><p>Like <code>send_field</code>, but it skips the spatial interlacing check.
  44550. </p></dd>
  44551. </dl>
  44552. <p>The default value is <code>send_frame</code>.
  44553. </p>
  44554. </dd>
  44555. <dt><samp>parity</samp></dt>
  44556. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  44557. of the following values:
  44558. </p>
  44559. <dl compact="compact">
  44560. <dt><samp>0, tff</samp></dt>
  44561. <dd><p>Assume the top field is first.
  44562. </p></dd>
  44563. <dt><samp>1, bff</samp></dt>
  44564. <dd><p>Assume the bottom field is first.
  44565. </p></dd>
  44566. <dt><samp>-1, auto</samp></dt>
  44567. <dd><p>Enable automatic detection of field parity.
  44568. </p></dd>
  44569. </dl>
  44570. <p>The default value is <code>auto</code>.
  44571. If the interlacing is unknown or the decoder does not export this information,
  44572. top field first will be assumed.
  44573. </p>
  44574. </dd>
  44575. <dt><samp>deint</samp></dt>
  44576. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  44577. values:
  44578. </p>
  44579. <dl compact="compact">
  44580. <dt><samp>0, all</samp></dt>
  44581. <dd><p>Deinterlace all frames.
  44582. </p></dd>
  44583. <dt><samp>1, interlaced</samp></dt>
  44584. <dd><p>Only deinterlace frames marked as interlaced.
  44585. </p></dd>
  44586. </dl>
  44587. <p>The default value is <code>all</code>.
  44588. </p></dd>
  44589. </dl>
  44590. <a name="yaepblur"></a>
  44591. <h3 class="section">39.258 yaepblur<span class="pull-right"><a class="anchor hidden-xs" href="#yaepblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-yaepblur" aria-hidden="true">TOC</a></span></h3>
  44592. <p>Apply blur filter while preserving edges (&quot;yaepblur&quot; means &quot;yet another edge preserving blur filter&quot;).
  44593. The algorithm is described in
  44594. &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;
  44595. </p>
  44596. <p>It accepts the following parameters:
  44597. </p>
  44598. <dl compact="compact">
  44599. <dt><samp>radius, r</samp></dt>
  44600. <dd><p>Set the window radius. Default value is 3.
  44601. </p>
  44602. </dd>
  44603. <dt><samp>planes, p</samp></dt>
  44604. <dd><p>Set which planes to filter. Default is only the first plane.
  44605. </p>
  44606. </dd>
  44607. <dt><samp>sigma, s</samp></dt>
  44608. <dd><p>Set blur strength. Default value is 128.
  44609. </p></dd>
  44610. </dl>
  44611. <a name="Commands-133"></a>
  44612. <h4 class="subsection">39.258.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-133" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-133" aria-hidden="true">TOC</a></span></h4>
  44613. <p>This filter supports same <a href="#commands">commands</a> as options.
  44614. </p>
  44615. <a name="zoompan"></a>
  44616. <h3 class="section">39.259 zoompan<span class="pull-right"><a class="anchor hidden-xs" href="#zoompan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zoompan" aria-hidden="true">TOC</a></span></h3>
  44617. <p>Apply Zoom &amp; Pan effect.
  44618. </p>
  44619. <p>This filter accepts the following options:
  44620. </p>
  44621. <dl compact="compact">
  44622. <dt><samp>zoom, z</samp></dt>
  44623. <dd><p>Set the zoom expression. Range is 1-10. Default is 1.
  44624. </p>
  44625. </dd>
  44626. <dt><samp>x</samp></dt>
  44627. <dt><samp>y</samp></dt>
  44628. <dd><p>Set the x and y expression. Default is 0.
  44629. </p>
  44630. </dd>
  44631. <dt><samp>d</samp></dt>
  44632. <dd><p>Set the duration expression in number of frames.
  44633. This sets for how many number of frames effect will last for
  44634. single input image. Default is 90.
  44635. </p>
  44636. </dd>
  44637. <dt><samp>s</samp></dt>
  44638. <dd><p>Set the output image size, default is &rsquo;hd720&rsquo;.
  44639. </p>
  44640. </dd>
  44641. <dt><samp>fps</samp></dt>
  44642. <dd><p>Set the output frame rate, default is &rsquo;25&rsquo;.
  44643. </p></dd>
  44644. </dl>
  44645. <p>Each expression can contain the following constants:
  44646. </p>
  44647. <dl compact="compact">
  44648. <dt><samp>in_w, iw</samp></dt>
  44649. <dd><p>Input width.
  44650. </p>
  44651. </dd>
  44652. <dt><samp>in_h, ih</samp></dt>
  44653. <dd><p>Input height.
  44654. </p>
  44655. </dd>
  44656. <dt><samp>out_w, ow</samp></dt>
  44657. <dd><p>Output width.
  44658. </p>
  44659. </dd>
  44660. <dt><samp>out_h, oh</samp></dt>
  44661. <dd><p>Output height.
  44662. </p>
  44663. </dd>
  44664. <dt><samp>in</samp></dt>
  44665. <dd><p>Input frame count.
  44666. </p>
  44667. </dd>
  44668. <dt><samp>on</samp></dt>
  44669. <dd><p>Output frame count.
  44670. </p>
  44671. </dd>
  44672. <dt><samp>in_time, it</samp></dt>
  44673. <dd><p>The input timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  44674. </p>
  44675. </dd>
  44676. <dt><samp>out_time, time, ot</samp></dt>
  44677. <dd><p>The output timestamp expressed in seconds.
  44678. </p>
  44679. </dd>
  44680. <dt><samp>x</samp></dt>
  44681. <dt><samp>y</samp></dt>
  44682. <dd><p>Last calculated &rsquo;x&rsquo; and &rsquo;y&rsquo; position from &rsquo;x&rsquo; and &rsquo;y&rsquo; expression
  44683. for current input frame.
  44684. </p>
  44685. </dd>
  44686. <dt><samp>px</samp></dt>
  44687. <dt><samp>py</samp></dt>
  44688. <dd><p>&rsquo;x&rsquo; and &rsquo;y&rsquo; of last output frame of previous input frame or 0 when there was
  44689. not yet such frame (first input frame).
  44690. </p>
  44691. </dd>
  44692. <dt><samp>zoom</samp></dt>
  44693. <dd><p>Last calculated zoom from &rsquo;z&rsquo; expression for current input frame.
  44694. </p>
  44695. </dd>
  44696. <dt><samp>pzoom</samp></dt>
  44697. <dd><p>Last calculated zoom of last output frame of previous input frame.
  44698. </p>
  44699. </dd>
  44700. <dt><samp>duration</samp></dt>
  44701. <dd><p>Number of output frames for current input frame. Calculated from &rsquo;d&rsquo; expression
  44702. for each input frame.
  44703. </p>
  44704. </dd>
  44705. <dt><samp>pduration</samp></dt>
  44706. <dd><p>number of output frames created for previous input frame
  44707. </p>
  44708. </dd>
  44709. <dt><samp>a</samp></dt>
  44710. <dd><p>Rational number: input width / input height
  44711. </p>
  44712. </dd>
  44713. <dt><samp>sar</samp></dt>
  44714. <dd><p>sample aspect ratio
  44715. </p>
  44716. </dd>
  44717. <dt><samp>dar</samp></dt>
  44718. <dd><p>display aspect ratio
  44719. </p>
  44720. </dd>
  44721. </dl>
  44722. <a name="Examples-162"></a>
  44723. <h4 class="subsection">39.259.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-162" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-162" aria-hidden="true">TOC</a></span></h4>
  44724. <ul>
  44725. <li> Zoom in up to 1.5x and pan at same time to some spot near center of picture:
  44726. <div class="example">
  44727. <pre class="example">zoompan=z='min(zoom+0.0015,1.5)':d=700:x='if(gte(zoom,1.5),x,x+1/a)':y='if(gte(zoom,1.5),y,y+1)':s=640x360
  44728. </pre></div>
  44729. </li><li> Zoom in up to 1.5x and pan always at center of picture:
  44730. <div class="example">
  44731. <pre class="example">zoompan=z='min(zoom+0.0015,1.5)':d=700:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
  44732. </pre></div>
  44733. </li><li> Same as above but without pausing:
  44734. <div class="example">
  44735. <pre class="example">zoompan=z='min(max(zoom,pzoom)+0.0015,1.5)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
  44736. </pre></div>
  44737. </li><li> Zoom in 2x into center of picture only for the first second of the input video:
  44738. <div class="example">
  44739. <pre class="example">zoompan=z='if(between(in_time,0,1),2,1)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
  44740. </pre></div>
  44741. </li></ul>
  44742. <span id="zscale"></span><a name="zscale-1"></a>
  44743. <h3 class="section">39.260 zscale<span class="pull-right"><a class="anchor hidden-xs" href="#zscale-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zscale-1" aria-hidden="true">TOC</a></span></h3>
  44744. <p>Scale (resize) the input video, using the z.lib library:
  44745. <a href="https://github.com/sekrit-twc/zimg">https://github.com/sekrit-twc/zimg</a>. To enable compilation of this
  44746. filter, you need to configure FFmpeg with <code>--enable-libzimg</code>.
  44747. </p>
  44748. <p>The zscale filter forces the output display aspect ratio to be the same
  44749. as the input, by changing the output sample aspect ratio.
  44750. </p>
  44751. <p>If the input image format is different from the format requested by
  44752. the next filter, the zscale filter will convert the input to the
  44753. requested format.
  44754. </p>
  44755. <a name="Options-89"></a>
  44756. <h4 class="subsection">39.260.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-89" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-89" aria-hidden="true">TOC</a></span></h4>
  44757. <p>The filter accepts the following options.
  44758. </p>
  44759. <dl compact="compact">
  44760. <dt><samp>width, w</samp></dt>
  44761. <dt><samp>height, h</samp></dt>
  44762. <dd><p>Set the output video dimension expression. Default value is the input
  44763. dimension.
  44764. </p>
  44765. <p>If the <var>width</var> or <var>w</var> value is 0, the input width is used for
  44766. the output. If the <var>height</var> or <var>h</var> value is 0, the input height
  44767. is used for the output.
  44768. </p>
  44769. <p>If one and only one of the values is -n with n &gt;= 1, the zscale filter
  44770. will use a value that maintains the aspect ratio of the input image,
  44771. calculated from the other specified dimension. After that it will,
  44772. however, make sure that the calculated dimension is divisible by n and
  44773. adjust the value if necessary.
  44774. </p>
  44775. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  44776. both values being set to 0 as previously detailed.
  44777. </p>
  44778. <p>See below for the list of accepted constants for use in the dimension
  44779. expression.
  44780. </p>
  44781. </dd>
  44782. <dt><samp>size, s</samp></dt>
  44783. <dd><p>Set the video size. For the syntax of this option, check the
  44784. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  44785. </p>
  44786. </dd>
  44787. <dt><samp>dither, d</samp></dt>
  44788. <dd><p>Set the dither type.
  44789. </p>
  44790. <p>Possible values are:
  44791. </p><dl compact="compact">
  44792. <dt><var>none</var></dt>
  44793. <dt><var>ordered</var></dt>
  44794. <dt><var>random</var></dt>
  44795. <dt><var>error_diffusion</var></dt>
  44796. </dl>
  44797. <p>Default is none.
  44798. </p>
  44799. </dd>
  44800. <dt><samp>filter, f</samp></dt>
  44801. <dd><p>Set the resize filter type.
  44802. </p>
  44803. <p>Possible values are:
  44804. </p><dl compact="compact">
  44805. <dt><var>point</var></dt>
  44806. <dt><var>bilinear</var></dt>
  44807. <dt><var>bicubic</var></dt>
  44808. <dt><var>spline16</var></dt>
  44809. <dt><var>spline36</var></dt>
  44810. <dt><var>lanczos</var></dt>
  44811. </dl>
  44812. <p>Default is bilinear.
  44813. </p>
  44814. </dd>
  44815. <dt><samp>range, r</samp></dt>
  44816. <dd><p>Set the color range.
  44817. </p>
  44818. <p>Possible values are:
  44819. </p><dl compact="compact">
  44820. <dt><var>input</var></dt>
  44821. <dt><var>limited</var></dt>
  44822. <dt><var>full</var></dt>
  44823. </dl>
  44824. <p>Default is same as input.
  44825. </p>
  44826. </dd>
  44827. <dt><samp>primaries, p</samp></dt>
  44828. <dd><p>Set the color primaries.
  44829. </p>
  44830. <p>Possible values are:
  44831. </p><dl compact="compact">
  44832. <dt><var>input</var></dt>
  44833. <dt><var>709</var></dt>
  44834. <dt><var>unspecified</var></dt>
  44835. <dt><var>170m</var></dt>
  44836. <dt><var>240m</var></dt>
  44837. <dt><var>2020</var></dt>
  44838. </dl>
  44839. <p>Default is same as input.
  44840. </p>
  44841. </dd>
  44842. <dt><samp>transfer, t</samp></dt>
  44843. <dd><p>Set the transfer characteristics.
  44844. </p>
  44845. <p>Possible values are:
  44846. </p><dl compact="compact">
  44847. <dt><var>input</var></dt>
  44848. <dt><var>709</var></dt>
  44849. <dt><var>unspecified</var></dt>
  44850. <dt><var>601</var></dt>
  44851. <dt><var>linear</var></dt>
  44852. <dt><var>2020_10</var></dt>
  44853. <dt><var>2020_12</var></dt>
  44854. <dt><var>smpte2084</var></dt>
  44855. <dt><var>iec61966-2-1</var></dt>
  44856. <dt><var>arib-std-b67</var></dt>
  44857. </dl>
  44858. <p>Default is same as input.
  44859. </p>
  44860. </dd>
  44861. <dt><samp>matrix, m</samp></dt>
  44862. <dd><p>Set the colorspace matrix.
  44863. </p>
  44864. <p>Possible value are:
  44865. </p><dl compact="compact">
  44866. <dt><var>input</var></dt>
  44867. <dt><var>709</var></dt>
  44868. <dt><var>unspecified</var></dt>
  44869. <dt><var>470bg</var></dt>
  44870. <dt><var>170m</var></dt>
  44871. <dt><var>2020_ncl</var></dt>
  44872. <dt><var>2020_cl</var></dt>
  44873. </dl>
  44874. <p>Default is same as input.
  44875. </p>
  44876. </dd>
  44877. <dt><samp>rangein, rin</samp></dt>
  44878. <dd><p>Set the input color range.
  44879. </p>
  44880. <p>Possible values are:
  44881. </p><dl compact="compact">
  44882. <dt><var>input</var></dt>
  44883. <dt><var>limited</var></dt>
  44884. <dt><var>full</var></dt>
  44885. </dl>
  44886. <p>Default is same as input.
  44887. </p>
  44888. </dd>
  44889. <dt><samp>primariesin, pin</samp></dt>
  44890. <dd><p>Set the input color primaries.
  44891. </p>
  44892. <p>Possible values are:
  44893. </p><dl compact="compact">
  44894. <dt><var>input</var></dt>
  44895. <dt><var>709</var></dt>
  44896. <dt><var>unspecified</var></dt>
  44897. <dt><var>170m</var></dt>
  44898. <dt><var>240m</var></dt>
  44899. <dt><var>2020</var></dt>
  44900. </dl>
  44901. <p>Default is same as input.
  44902. </p>
  44903. </dd>
  44904. <dt><samp>transferin, tin</samp></dt>
  44905. <dd><p>Set the input transfer characteristics.
  44906. </p>
  44907. <p>Possible values are:
  44908. </p><dl compact="compact">
  44909. <dt><var>input</var></dt>
  44910. <dt><var>709</var></dt>
  44911. <dt><var>unspecified</var></dt>
  44912. <dt><var>601</var></dt>
  44913. <dt><var>linear</var></dt>
  44914. <dt><var>2020_10</var></dt>
  44915. <dt><var>2020_12</var></dt>
  44916. </dl>
  44917. <p>Default is same as input.
  44918. </p>
  44919. </dd>
  44920. <dt><samp>matrixin, min</samp></dt>
  44921. <dd><p>Set the input colorspace matrix.
  44922. </p>
  44923. <p>Possible value are:
  44924. </p><dl compact="compact">
  44925. <dt><var>input</var></dt>
  44926. <dt><var>709</var></dt>
  44927. <dt><var>unspecified</var></dt>
  44928. <dt><var>470bg</var></dt>
  44929. <dt><var>170m</var></dt>
  44930. <dt><var>2020_ncl</var></dt>
  44931. <dt><var>2020_cl</var></dt>
  44932. </dl>
  44933. </dd>
  44934. <dt><samp>chromal, c</samp></dt>
  44935. <dd><p>Set the output chroma location.
  44936. </p>
  44937. <p>Possible values are:
  44938. </p><dl compact="compact">
  44939. <dt><var>input</var></dt>
  44940. <dt><var>left</var></dt>
  44941. <dt><var>center</var></dt>
  44942. <dt><var>topleft</var></dt>
  44943. <dt><var>top</var></dt>
  44944. <dt><var>bottomleft</var></dt>
  44945. <dt><var>bottom</var></dt>
  44946. </dl>
  44947. </dd>
  44948. <dt><samp>chromalin, cin</samp></dt>
  44949. <dd><p>Set the input chroma location.
  44950. </p>
  44951. <p>Possible values are:
  44952. </p><dl compact="compact">
  44953. <dt><var>input</var></dt>
  44954. <dt><var>left</var></dt>
  44955. <dt><var>center</var></dt>
  44956. <dt><var>topleft</var></dt>
  44957. <dt><var>top</var></dt>
  44958. <dt><var>bottomleft</var></dt>
  44959. <dt><var>bottom</var></dt>
  44960. </dl>
  44961. </dd>
  44962. <dt><samp>npl</samp></dt>
  44963. <dd><p>Set the nominal peak luminance.
  44964. </p>
  44965. </dd>
  44966. <dt><samp>param_a</samp></dt>
  44967. <dd><p>Parameter A for scaling filters. Parameter &quot;b&quot; for bicubic, and the number of
  44968. filter taps for lanczos.
  44969. </p>
  44970. </dd>
  44971. <dt><samp>param_b</samp></dt>
  44972. <dd><p>Parameter B for scaling filters. Parameter &quot;c&quot; for bicubic.
  44973. </p></dd>
  44974. </dl>
  44975. <p>The values of the <samp>w</samp> and <samp>h</samp> options are expressions
  44976. containing the following constants:
  44977. </p>
  44978. <dl compact="compact">
  44979. <dt><var>in_w</var></dt>
  44980. <dt><var>in_h</var></dt>
  44981. <dd><p>The input width and height
  44982. </p>
  44983. </dd>
  44984. <dt><var>iw</var></dt>
  44985. <dt><var>ih</var></dt>
  44986. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  44987. </p>
  44988. </dd>
  44989. <dt><var>out_w</var></dt>
  44990. <dt><var>out_h</var></dt>
  44991. <dd><p>The output (scaled) width and height
  44992. </p>
  44993. </dd>
  44994. <dt><var>ow</var></dt>
  44995. <dt><var>oh</var></dt>
  44996. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>
  44997. </p>
  44998. </dd>
  44999. <dt><var>a</var></dt>
  45000. <dd><p>The same as <var>iw</var> / <var>ih</var>
  45001. </p>
  45002. </dd>
  45003. <dt><var>sar</var></dt>
  45004. <dd><p>input sample aspect ratio
  45005. </p>
  45006. </dd>
  45007. <dt><var>dar</var></dt>
  45008. <dd><p>The input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
  45009. </p>
  45010. </dd>
  45011. <dt><var>hsub</var></dt>
  45012. <dt><var>vsub</var></dt>
  45013. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  45014. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  45015. </p>
  45016. </dd>
  45017. <dt><var>ohsub</var></dt>
  45018. <dt><var>ovsub</var></dt>
  45019. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  45020. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  45021. </p></dd>
  45022. </dl>
  45023. <a name="Commands-134"></a>
  45024. <h4 class="subsection">39.260.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-134" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-134" aria-hidden="true">TOC</a></span></h4>
  45025. <p>This filter supports the following commands:
  45026. </p><dl compact="compact">
  45027. <dt><samp>width, w</samp></dt>
  45028. <dt><samp>height, h</samp></dt>
  45029. <dd><p>Set the output video dimension expression.
  45030. The command accepts the same syntax of the corresponding option.
  45031. </p>
  45032. <p>If the specified expression is not valid, it is kept at its current
  45033. value.
  45034. </p></dd>
  45035. </dl>
  45036. <a name="OpenCL-Video-Filters"></a>
  45037. <h2 class="chapter">40 OpenCL Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#OpenCL-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenCL-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  45038. <p>Below is a description of the currently available OpenCL video filters.
  45039. </p>
  45040. <p>To enable compilation of these filters you need to configure FFmpeg with
  45041. <code>--enable-opencl</code>.
  45042. </p>
  45043. <p>Running OpenCL filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  45044. </p><dl compact="compact">
  45045. <dt><samp>-init_hw_device opencl[=<var>name</var>][:<var>device</var>[,<var>key=value</var>...]]</samp></dt>
  45046. <dd><p>Initialise a new hardware device of type <var>opencl</var> called <var>name</var>, using the
  45047. given device parameters.
  45048. </p>
  45049. </dd>
  45050. <dt><samp>-filter_hw_device <var>name</var></samp></dt>
  45051. <dd><p>Pass the hardware device called <var>name</var> to all filters in any filter graph.
  45052. </p>
  45053. </dd>
  45054. </dl>
  45055. <p>For more detailed information see <a href="https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options">https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options</a>
  45056. </p>
  45057. <ul>
  45058. <li> Example of choosing the first device on the second platform and running avgblur_opencl filter with default parameters on it.
  45059. <div class="example">
  45060. <pre class="example">-init_hw_device opencl=gpu:1.0 -filter_hw_device gpu -i INPUT -vf &quot;hwupload, avgblur_opencl, hwdownload&quot; OUTPUT
  45061. </pre></div>
  45062. </li></ul>
  45063. <p>Since OpenCL filters are not able to access frame data in normal memory, all frame data needs to be uploaded(<a href="#hwupload">hwupload</a>) to hardware surfaces connected to the appropriate device before being used and then downloaded(<a href="#hwdownload">hwdownload</a>) back to normal memory. Note that <a href="#hwupload">hwupload</a> will upload to a surface with the same layout as the software frame, so it may be necessary to add a <a href="#format">format</a> filter immediately before to get the input into the right format and <a href="#hwdownload">hwdownload</a> does not support all formats on the output - it may be necessary to insert an additional <a href="#format">format</a> filter immediately following in the graph to get the output in a supported format.
  45064. </p>
  45065. <a name="avgblur_005fopencl"></a>
  45066. <h3 class="section">40.1 avgblur_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#avgblur_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avgblur_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45067. <p>Apply average blur filter.
  45068. </p>
  45069. <p>The filter accepts the following options:
  45070. </p>
  45071. <dl compact="compact">
  45072. <dt><samp>sizeX</samp></dt>
  45073. <dd><p>Set horizontal radius size.
  45074. Range is <code>[1, 1024]</code> and default value is <code>1</code>.
  45075. </p>
  45076. </dd>
  45077. <dt><samp>planes</samp></dt>
  45078. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  45079. </p>
  45080. </dd>
  45081. <dt><samp>sizeY</samp></dt>
  45082. <dd><p>Set vertical radius size. Range is <code>[1, 1024]</code> and default value is <code>0</code>. If zero, <code>sizeX</code> value will be used.
  45083. </p></dd>
  45084. </dl>
  45085. <a name="Example-4"></a>
  45086. <h4 class="subsection">40.1.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-4" aria-hidden="true">TOC</a></span></h4>
  45087. <ul>
  45088. <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.
  45089. <div class="example">
  45090. <pre class="example">-i INPUT -vf &quot;hwupload, avgblur_opencl=3, hwdownload&quot; OUTPUT
  45091. </pre></div>
  45092. </li></ul>
  45093. <a name="boxblur_005fopencl"></a>
  45094. <h3 class="section">40.2 boxblur_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#boxblur_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-boxblur_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45095. <p>Apply a boxblur algorithm to the input video.
  45096. </p>
  45097. <p>It accepts the following parameters:
  45098. </p>
  45099. <dl compact="compact">
  45100. <dt><samp>luma_radius, lr</samp></dt>
  45101. <dt><samp>luma_power, lp</samp></dt>
  45102. <dt><samp>chroma_radius, cr</samp></dt>
  45103. <dt><samp>chroma_power, cp</samp></dt>
  45104. <dt><samp>alpha_radius, ar</samp></dt>
  45105. <dt><samp>alpha_power, ap</samp></dt>
  45106. </dl>
  45107. <p>A description of the accepted options follows.
  45108. </p>
  45109. <dl compact="compact">
  45110. <dt><samp>luma_radius, lr</samp></dt>
  45111. <dt><samp>chroma_radius, cr</samp></dt>
  45112. <dt><samp>alpha_radius, ar</samp></dt>
  45113. <dd><p>Set an expression for the box radius in pixels used for blurring the
  45114. corresponding input plane.
  45115. </p>
  45116. <p>The radius value must be a non-negative number, and must not be
  45117. greater than the value of the expression <code>min(w,h)/2</code> for the
  45118. luma and alpha planes, and of <code>min(cw,ch)/2</code> for the chroma
  45119. planes.
  45120. </p>
  45121. <p>Default value for <samp>luma_radius</samp> is &quot;2&quot;. If not specified,
  45122. <samp>chroma_radius</samp> and <samp>alpha_radius</samp> default to the
  45123. corresponding value set for <samp>luma_radius</samp>.
  45124. </p>
  45125. <p>The expressions can contain the following constants:
  45126. </p><dl compact="compact">
  45127. <dt><samp>w</samp></dt>
  45128. <dt><samp>h</samp></dt>
  45129. <dd><p>The input width and height in pixels.
  45130. </p>
  45131. </dd>
  45132. <dt><samp>cw</samp></dt>
  45133. <dt><samp>ch</samp></dt>
  45134. <dd><p>The input chroma image width and height in pixels.
  45135. </p>
  45136. </dd>
  45137. <dt><samp>hsub</samp></dt>
  45138. <dt><samp>vsub</samp></dt>
  45139. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  45140. pixel format &quot;yuv422p&quot;, <var>hsub</var> is 2 and <var>vsub</var> is 1.
  45141. </p></dd>
  45142. </dl>
  45143. </dd>
  45144. <dt><samp>luma_power, lp</samp></dt>
  45145. <dt><samp>chroma_power, cp</samp></dt>
  45146. <dt><samp>alpha_power, ap</samp></dt>
  45147. <dd><p>Specify how many times the boxblur filter is applied to the
  45148. corresponding plane.
  45149. </p>
  45150. <p>Default value for <samp>luma_power</samp> is 2. If not specified,
  45151. <samp>chroma_power</samp> and <samp>alpha_power</samp> default to the
  45152. corresponding value set for <samp>luma_power</samp>.
  45153. </p>
  45154. <p>A value of 0 will disable the effect.
  45155. </p></dd>
  45156. </dl>
  45157. <a name="Examples-163"></a>
  45158. <h4 class="subsection">40.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-163" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-163" aria-hidden="true">TOC</a></span></h4>
  45159. <p>Apply boxblur filter, setting each pixel of the output to the average value of box-radiuses <var>luma_radius</var>, <var>chroma_radius</var>, <var>alpha_radius</var> for each plane respectively. The filter will apply <var>luma_power</var>, <var>chroma_power</var>, <var>alpha_power</var> times onto the corresponding plane. For pixels on the edges of the image, the radius does not extend beyond the image boundaries, and so out-of-range coordinates are not used in the calculations.
  45160. </p>
  45161. <ul>
  45162. <li> Apply a boxblur filter with the luma, chroma, and alpha radius
  45163. 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.
  45164. <div class="example">
  45165. <pre class="example">-i INPUT -vf &quot;hwupload, boxblur_opencl=luma_radius=2:luma_power=3, hwdownload&quot; OUTPUT
  45166. -i INPUT -vf &quot;hwupload, boxblur_opencl=2:3, hwdownload&quot; OUTPUT
  45167. </pre></div>
  45168. </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.
  45169. <p>For the luma plane, a 2x2 box radius will be run once.
  45170. </p>
  45171. <p>For the chroma plane, a 4x4 box radius will be run 5 times.
  45172. </p>
  45173. <p>For the alpha plane, a 3x3 box radius will be run 7 times.
  45174. </p><div class="example">
  45175. <pre class="example">-i INPUT -vf &quot;hwupload, boxblur_opencl=2:1:4:5:3:7, hwdownload&quot; OUTPUT
  45176. </pre></div>
  45177. </li></ul>
  45178. <a name="colorkey_005fopencl"></a>
  45179. <h3 class="section">40.3 colorkey_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#colorkey_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorkey_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45180. <p>RGB colorspace color keying.
  45181. </p>
  45182. <p>The filter accepts the following options:
  45183. </p>
  45184. <dl compact="compact">
  45185. <dt><samp>color</samp></dt>
  45186. <dd><p>The color which will be replaced with transparency.
  45187. </p>
  45188. </dd>
  45189. <dt><samp>similarity</samp></dt>
  45190. <dd><p>Similarity percentage with the key color.
  45191. </p>
  45192. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  45193. </p>
  45194. </dd>
  45195. <dt><samp>blend</samp></dt>
  45196. <dd><p>Blend percentage.
  45197. </p>
  45198. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  45199. </p>
  45200. <p>Higher values result in semi-transparent pixels, with a higher transparency
  45201. the more similar the pixels color is to the key color.
  45202. </p></dd>
  45203. </dl>
  45204. <a name="Examples-164"></a>
  45205. <h4 class="subsection">40.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-164" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-164" aria-hidden="true">TOC</a></span></h4>
  45206. <ul>
  45207. <li> Make every semi-green pixel in the input transparent with some slight blending:
  45208. <div class="example">
  45209. <pre class="example">-i INPUT -vf &quot;hwupload, colorkey_opencl=green:0.3:0.1, hwdownload&quot; OUTPUT
  45210. </pre></div>
  45211. </li></ul>
  45212. <a name="convolution_005fopencl"></a>
  45213. <h3 class="section">40.4 convolution_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#convolution_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-convolution_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45214. <p>Apply convolution of 3x3, 5x5, 7x7 matrix.
  45215. </p>
  45216. <p>The filter accepts the following options:
  45217. </p>
  45218. <dl compact="compact">
  45219. <dt><samp>0m</samp></dt>
  45220. <dt><samp>1m</samp></dt>
  45221. <dt><samp>2m</samp></dt>
  45222. <dt><samp>3m</samp></dt>
  45223. <dd><p>Set matrix for each plane.
  45224. Matrix is sequence of 9, 25 or 49 signed numbers.
  45225. Default value for each plane is <code>0 0 0 0 1 0 0 0 0</code>.
  45226. </p>
  45227. </dd>
  45228. <dt><samp>0rdiv</samp></dt>
  45229. <dt><samp>1rdiv</samp></dt>
  45230. <dt><samp>2rdiv</samp></dt>
  45231. <dt><samp>3rdiv</samp></dt>
  45232. <dd><p>Set multiplier for calculated value for each plane.
  45233. If unset or 0, it will be sum of all matrix elements.
  45234. The option value must be a float number greater or equal to <code>0.0</code>. Default value is <code>1.0</code>.
  45235. </p>
  45236. </dd>
  45237. <dt><samp>0bias</samp></dt>
  45238. <dt><samp>1bias</samp></dt>
  45239. <dt><samp>2bias</samp></dt>
  45240. <dt><samp>3bias</samp></dt>
  45241. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  45242. Useful for making the overall image brighter or darker.
  45243. The option value must be a float number greater or equal to <code>0.0</code>. Default value is <code>0.0</code>.
  45244. </p>
  45245. </dd>
  45246. </dl>
  45247. <a name="Examples-165"></a>
  45248. <h4 class="subsection">40.4.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-165" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-165" aria-hidden="true">TOC</a></span></h4>
  45249. <ul>
  45250. <li> Apply sharpen:
  45251. <div class="example">
  45252. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0, hwdownload&quot; OUTPUT
  45253. </pre></div>
  45254. </li><li> Apply blur:
  45255. <div class="example">
  45256. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9, hwdownload&quot; OUTPUT
  45257. </pre></div>
  45258. </li><li> Apply edge enhance:
  45259. <div class="example">
  45260. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128, hwdownload&quot; OUTPUT
  45261. </pre></div>
  45262. </li><li> Apply edge detect:
  45263. <div class="example">
  45264. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128, hwdownload&quot; OUTPUT
  45265. </pre></div>
  45266. </li><li> Apply laplacian edge detector which includes diagonals:
  45267. <div class="example">
  45268. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0, hwdownload&quot; OUTPUT
  45269. </pre></div>
  45270. </li><li> Apply emboss:
  45271. <div class="example">
  45272. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2, hwdownload&quot; OUTPUT
  45273. </pre></div>
  45274. </li></ul>
  45275. <a name="erosion_005fopencl"></a>
  45276. <h3 class="section">40.5 erosion_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#erosion_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-erosion_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45277. <p>Apply erosion effect to the video.
  45278. </p>
  45279. <p>This filter replaces the pixel by the local(3x3) minimum.
  45280. </p>
  45281. <p>It accepts the following options:
  45282. </p>
  45283. <dl compact="compact">
  45284. <dt><samp>threshold0</samp></dt>
  45285. <dt><samp>threshold1</samp></dt>
  45286. <dt><samp>threshold2</samp></dt>
  45287. <dt><samp>threshold3</samp></dt>
  45288. <dd><p>Limit the maximum change for each plane. Range is <code>[0, 65535]</code> and default value is <code>65535</code>.
  45289. If <code>0</code>, plane will remain unchanged.
  45290. </p>
  45291. </dd>
  45292. <dt><samp>coordinates</samp></dt>
  45293. <dd><p>Flag which specifies the pixel to refer to.
  45294. Range is <code>[0, 255]</code> and default value is <code>255</code>, i.e. all eight pixels are used.
  45295. </p>
  45296. <p>Flags to local 3x3 coordinates region centered on <code>x</code>:
  45297. </p>
  45298. <p>1 2 3
  45299. </p>
  45300. <p>4 x 5
  45301. </p>
  45302. <p>6 7 8
  45303. </p></dd>
  45304. </dl>
  45305. <a name="Example-5"></a>
  45306. <h4 class="subsection">40.5.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-5" aria-hidden="true">TOC</a></span></h4>
  45307. <ul>
  45308. <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.
  45309. <div class="example">
  45310. <pre class="example">-i INPUT -vf &quot;hwupload, erosion_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  45311. </pre></div>
  45312. </li></ul>
  45313. <a name="deshake_005fopencl"></a>
  45314. <h3 class="section">40.6 deshake_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#deshake_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deshake_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45315. <p>Feature-point based video stabilization filter.
  45316. </p>
  45317. <p>The filter accepts the following options:
  45318. </p>
  45319. <dl compact="compact">
  45320. <dt><samp>tripod</samp></dt>
  45321. <dd><p>Simulates a tripod by preventing any camera movement whatsoever from the original frame. Defaults to <code>0</code>.
  45322. </p>
  45323. </dd>
  45324. <dt><samp>debug</samp></dt>
  45325. <dd><p>Whether or not additional debug info should be displayed, both in the processed output and in the console.
  45326. </p>
  45327. <p>Note that in order to see console debug output you will also need to pass <code>-v verbose</code> to ffmpeg.
  45328. </p>
  45329. <p>Viewing point matches in the output video is only supported for RGB input.
  45330. </p>
  45331. <p>Defaults to <code>0</code>.
  45332. </p>
  45333. </dd>
  45334. <dt><samp>adaptive_crop</samp></dt>
  45335. <dd><p>Whether or not to do a tiny bit of cropping at the borders to cut down on the amount of mirrored pixels.
  45336. </p>
  45337. <p>Defaults to <code>1</code>.
  45338. </p>
  45339. </dd>
  45340. <dt><samp>refine_features</samp></dt>
  45341. <dd><p>Whether or not feature points should be refined at a sub-pixel level.
  45342. </p>
  45343. <p>This can be turned off for a slight performance gain at the cost of precision.
  45344. </p>
  45345. <p>Defaults to <code>1</code>.
  45346. </p>
  45347. </dd>
  45348. <dt><samp>smooth_strength</samp></dt>
  45349. <dd><p>The strength of the smoothing applied to the camera path from <code>0.0</code> to <code>1.0</code>.
  45350. </p>
  45351. <p><code>1.0</code> is the maximum smoothing strength while values less than that result in less smoothing.
  45352. </p>
  45353. <p><code>0.0</code> causes the filter to adaptively choose a smoothing strength on a per-frame basis.
  45354. </p>
  45355. <p>Defaults to <code>0.0</code>.
  45356. </p>
  45357. </dd>
  45358. <dt><samp>smooth_window_multiplier</samp></dt>
  45359. <dd><p>Controls the size of the smoothing window (the number of frames buffered to determine motion information from).
  45360. </p>
  45361. <p>The size of the smoothing window is determined by multiplying the framerate of the video by this number.
  45362. </p>
  45363. <p>Acceptable values range from <code>0.1</code> to <code>10.0</code>.
  45364. </p>
  45365. <p>Larger values increase the amount of motion data available for determining how to smooth the camera path,
  45366. potentially improving smoothness, but also increase latency and memory usage.
  45367. </p>
  45368. <p>Defaults to <code>2.0</code>.
  45369. </p>
  45370. </dd>
  45371. </dl>
  45372. <a name="Examples-166"></a>
  45373. <h4 class="subsection">40.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-166" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-166" aria-hidden="true">TOC</a></span></h4>
  45374. <ul>
  45375. <li> Stabilize a video with a fixed, medium smoothing strength:
  45376. <div class="example">
  45377. <pre class="example">-i INPUT -vf &quot;hwupload, deshake_opencl=smooth_strength=0.5, hwdownload&quot; OUTPUT
  45378. </pre></div>
  45379. </li><li> Stabilize a video with debugging (both in console and in rendered video):
  45380. <div class="example">
  45381. <pre class="example">-i INPUT -filter_complex &quot;[0:v]format=rgba, hwupload, deshake_opencl=debug=1, hwdownload, format=rgba, format=yuv420p&quot; -v verbose OUTPUT
  45382. </pre></div>
  45383. </li></ul>
  45384. <a name="dilation_005fopencl"></a>
  45385. <h3 class="section">40.7 dilation_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#dilation_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dilation_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45386. <p>Apply dilation effect to the video.
  45387. </p>
  45388. <p>This filter replaces the pixel by the local(3x3) maximum.
  45389. </p>
  45390. <p>It accepts the following options:
  45391. </p>
  45392. <dl compact="compact">
  45393. <dt><samp>threshold0</samp></dt>
  45394. <dt><samp>threshold1</samp></dt>
  45395. <dt><samp>threshold2</samp></dt>
  45396. <dt><samp>threshold3</samp></dt>
  45397. <dd><p>Limit the maximum change for each plane. Range is <code>[0, 65535]</code> and default value is <code>65535</code>.
  45398. If <code>0</code>, plane will remain unchanged.
  45399. </p>
  45400. </dd>
  45401. <dt><samp>coordinates</samp></dt>
  45402. <dd><p>Flag which specifies the pixel to refer to.
  45403. Range is <code>[0, 255]</code> and default value is <code>255</code>, i.e. all eight pixels are used.
  45404. </p>
  45405. <p>Flags to local 3x3 coordinates region centered on <code>x</code>:
  45406. </p>
  45407. <p>1 2 3
  45408. </p>
  45409. <p>4 x 5
  45410. </p>
  45411. <p>6 7 8
  45412. </p></dd>
  45413. </dl>
  45414. <a name="Example-6"></a>
  45415. <h4 class="subsection">40.7.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-6" aria-hidden="true">TOC</a></span></h4>
  45416. <ul>
  45417. <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.
  45418. <div class="example">
  45419. <pre class="example">-i INPUT -vf &quot;hwupload, dilation_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  45420. </pre></div>
  45421. </li></ul>
  45422. <a name="nlmeans_005fopencl"></a>
  45423. <h3 class="section">40.8 nlmeans_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#nlmeans_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nlmeans_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45424. <p>Non-local Means denoise filter through OpenCL, this filter accepts same options as <a href="#nlmeans">nlmeans</a>.
  45425. </p>
  45426. <a name="overlay_005fopencl"></a>
  45427. <h3 class="section">40.9 overlay_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#overlay_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45428. <p>Overlay one video on top of another.
  45429. </p>
  45430. <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.
  45431. This filter requires same memory layout for all the inputs. So, format conversion may be needed.
  45432. </p>
  45433. <p>The filter accepts the following options:
  45434. </p>
  45435. <dl compact="compact">
  45436. <dt><samp>x</samp></dt>
  45437. <dd><p>Set the x coordinate of the overlaid video on the main video.
  45438. Default value is <code>0</code>.
  45439. </p>
  45440. </dd>
  45441. <dt><samp>y</samp></dt>
  45442. <dd><p>Set the y coordinate of the overlaid video on the main video.
  45443. Default value is <code>0</code>.
  45444. </p>
  45445. </dd>
  45446. </dl>
  45447. <a name="Examples-167"></a>
  45448. <h4 class="subsection">40.9.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-167" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-167" aria-hidden="true">TOC</a></span></h4>
  45449. <ul>
  45450. <li> Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs are yuv420p format.
  45451. <div class="example">
  45452. <pre class="example">-i INPUT -i LOGO -filter_complex &quot;[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_opencl, hwdownload&quot; OUTPUT
  45453. </pre></div>
  45454. </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.
  45455. <div class="example">
  45456. <pre class="example">-i INPUT -i LOGO -filter_complex &quot;[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_opencl, hwdownload&quot; OUTPUT
  45457. </pre></div>
  45458. </li></ul>
  45459. <a name="pad_005fopencl"></a>
  45460. <h3 class="section">40.10 pad_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#pad_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pad_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45461. <p>Add paddings to the input image, and place the original input at the
  45462. provided <var>x</var>, <var>y</var> coordinates.
  45463. </p>
  45464. <p>It accepts the following options:
  45465. </p>
  45466. <dl compact="compact">
  45467. <dt><samp>width, w</samp></dt>
  45468. <dt><samp>height, h</samp></dt>
  45469. <dd><p>Specify an expression for the size of the output image with the
  45470. paddings added. If the value for <var>width</var> or <var>height</var> is 0, the
  45471. corresponding input size is used for the output.
  45472. </p>
  45473. <p>The <var>width</var> expression can reference the value set by the
  45474. <var>height</var> expression, and vice versa.
  45475. </p>
  45476. <p>The default value of <var>width</var> and <var>height</var> is 0.
  45477. </p>
  45478. </dd>
  45479. <dt><samp>x</samp></dt>
  45480. <dt><samp>y</samp></dt>
  45481. <dd><p>Specify the offsets to place the input image at within the padded area,
  45482. with respect to the top/left border of the output image.
  45483. </p>
  45484. <p>The <var>x</var> expression can reference the value set by the <var>y</var>
  45485. expression, and vice versa.
  45486. </p>
  45487. <p>The default value of <var>x</var> and <var>y</var> is 0.
  45488. </p>
  45489. <p>If <var>x</var> or <var>y</var> evaluate to a negative number, they&rsquo;ll be changed
  45490. so the input image is centered on the padded area.
  45491. </p>
  45492. </dd>
  45493. <dt><samp>color</samp></dt>
  45494. <dd><p>Specify the color of the padded area. For the syntax of this option,
  45495. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils
  45496. manual</a>.
  45497. </p>
  45498. </dd>
  45499. <dt><samp>aspect</samp></dt>
  45500. <dd><p>Pad to an aspect instead to a resolution.
  45501. </p></dd>
  45502. </dl>
  45503. <p>The value for the <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var>
  45504. options are expressions containing the following constants:
  45505. </p>
  45506. <dl compact="compact">
  45507. <dt><samp>in_w</samp></dt>
  45508. <dt><samp>in_h</samp></dt>
  45509. <dd><p>The input video width and height.
  45510. </p>
  45511. </dd>
  45512. <dt><samp>iw</samp></dt>
  45513. <dt><samp>ih</samp></dt>
  45514. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  45515. </p>
  45516. </dd>
  45517. <dt><samp>out_w</samp></dt>
  45518. <dt><samp>out_h</samp></dt>
  45519. <dd><p>The output width and height (the size of the padded area), as
  45520. specified by the <var>width</var> and <var>height</var> expressions.
  45521. </p>
  45522. </dd>
  45523. <dt><samp>ow</samp></dt>
  45524. <dt><samp>oh</samp></dt>
  45525. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
  45526. </p>
  45527. </dd>
  45528. <dt><samp>x</samp></dt>
  45529. <dt><samp>y</samp></dt>
  45530. <dd><p>The x and y offsets as specified by the <var>x</var> and <var>y</var>
  45531. expressions, or NAN if not yet specified.
  45532. </p>
  45533. </dd>
  45534. <dt><samp>a</samp></dt>
  45535. <dd><p>same as <var>iw</var> / <var>ih</var>
  45536. </p>
  45537. </dd>
  45538. <dt><samp>sar</samp></dt>
  45539. <dd><p>input sample aspect ratio
  45540. </p>
  45541. </dd>
  45542. <dt><samp>dar</samp></dt>
  45543. <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
  45544. </p></dd>
  45545. </dl>
  45546. <a name="prewitt_005fopencl"></a>
  45547. <h3 class="section">40.11 prewitt_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#prewitt_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prewitt_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45548. <p>Apply the Prewitt operator (<a href="https://en.wikipedia.org/wiki/Prewitt_operator">https://en.wikipedia.org/wiki/Prewitt_operator</a>) to input video stream.
  45549. </p>
  45550. <p>The filter accepts the following option:
  45551. </p>
  45552. <dl compact="compact">
  45553. <dt><samp>planes</samp></dt>
  45554. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  45555. </p>
  45556. </dd>
  45557. <dt><samp>scale</samp></dt>
  45558. <dd><p>Set value which will be multiplied with filtered result.
  45559. Range is <code>[0.0, 65535]</code> and default value is <code>1.0</code>.
  45560. </p>
  45561. </dd>
  45562. <dt><samp>delta</samp></dt>
  45563. <dd><p>Set value which will be added to filtered result.
  45564. Range is <code>[-65535, 65535]</code> and default value is <code>0.0</code>.
  45565. </p></dd>
  45566. </dl>
  45567. <a name="Example-7"></a>
  45568. <h4 class="subsection">40.11.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-7" aria-hidden="true">TOC</a></span></h4>
  45569. <ul>
  45570. <li> Apply the Prewitt operator with scale set to 2 and delta set to 10.
  45571. <div class="example">
  45572. <pre class="example">-i INPUT -vf &quot;hwupload, prewitt_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  45573. </pre></div>
  45574. </li></ul>
  45575. <span id="program_005fopencl"></span><a name="program_005fopencl-1"></a>
  45576. <h3 class="section">40.12 program_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#program_005fopencl-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-program_005fopencl-1" aria-hidden="true">TOC</a></span></h3>
  45577. <p>Filter video using an OpenCL program.
  45578. </p>
  45579. <dl compact="compact">
  45580. <dt><samp>source</samp></dt>
  45581. <dd><p>OpenCL program source file.
  45582. </p>
  45583. </dd>
  45584. <dt><samp>kernel</samp></dt>
  45585. <dd><p>Kernel name in program.
  45586. </p>
  45587. </dd>
  45588. <dt><samp>inputs</samp></dt>
  45589. <dd><p>Number of inputs to the filter. Defaults to 1.
  45590. </p>
  45591. </dd>
  45592. <dt><samp>size, s</samp></dt>
  45593. <dd><p>Size of output frames. Defaults to the same as the first input.
  45594. </p>
  45595. </dd>
  45596. </dl>
  45597. <p>The <code>program_opencl</code> filter also supports the <a href="#framesync">framesync</a> options.
  45598. </p>
  45599. <p>The program source file must contain a kernel function with the given name,
  45600. which will be run once for each plane of the output. Each run on a plane
  45601. gets enqueued as a separate 2D global NDRange with one work-item for each
  45602. pixel to be generated. The global ID offset for each work-item is therefore
  45603. the coordinates of a pixel in the destination image.
  45604. </p>
  45605. <p>The kernel function needs to take the following arguments:
  45606. </p><ul>
  45607. <li> Destination image, <var>__write_only image2d_t</var>.
  45608. <p>This image will become the output; the kernel should write all of it.
  45609. </p></li><li> Frame index, <var>unsigned int</var>.
  45610. <p>This is a counter starting from zero and increasing by one for each frame.
  45611. </p></li><li> Source images, <var>__read_only image2d_t</var>.
  45612. <p>These are the most recent images on each input. The kernel may read from
  45613. them to generate the output, but they can&rsquo;t be written to.
  45614. </p></li></ul>
  45615. <p>Example programs:
  45616. </p>
  45617. <ul>
  45618. <li> Copy the input to the output (output must be the same size as the input).
  45619. <pre class="verbatim">__kernel void copy(__write_only image2d_t destination,
  45620. unsigned int index,
  45621. __read_only image2d_t source)
  45622. {
  45623. const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE;
  45624. int2 location = (int2)(get_global_id(0), get_global_id(1));
  45625. float4 value = read_imagef(source, sampler, location);
  45626. write_imagef(destination, location, value);
  45627. }
  45628. </pre>
  45629. </li><li> Apply a simple transformation, rotating the input by an amount increasing
  45630. with the index counter. Pixel values are linearly interpolated by the
  45631. sampler, and the output need not have the same dimensions as the input.
  45632. <pre class="verbatim">__kernel void rotate_image(__write_only image2d_t dst,
  45633. unsigned int index,
  45634. __read_only image2d_t src)
  45635. {
  45636. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  45637. CLK_FILTER_LINEAR);
  45638. float angle = (float)index / 100.0f;
  45639. float2 dst_dim = convert_float2(get_image_dim(dst));
  45640. float2 src_dim = convert_float2(get_image_dim(src));
  45641. float2 dst_cen = dst_dim / 2.0f;
  45642. float2 src_cen = src_dim / 2.0f;
  45643. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  45644. float2 dst_pos = convert_float2(dst_loc) - dst_cen;
  45645. float2 src_pos = {
  45646. cos(angle) * dst_pos.x - sin(angle) * dst_pos.y,
  45647. sin(angle) * dst_pos.x + cos(angle) * dst_pos.y
  45648. };
  45649. src_pos = src_pos * src_dim / dst_dim;
  45650. float2 src_loc = src_pos + src_cen;
  45651. if (src_loc.x &lt; 0.0f || src_loc.y &lt; 0.0f ||
  45652. src_loc.x &gt; src_dim.x || src_loc.y &gt; src_dim.y)
  45653. write_imagef(dst, dst_loc, 0.5f);
  45654. else
  45655. write_imagef(dst, dst_loc, read_imagef(src, sampler, src_loc));
  45656. }
  45657. </pre>
  45658. </li><li> Blend two inputs together, with the amount of each input used varying
  45659. with the index counter.
  45660. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  45661. unsigned int index,
  45662. __read_only image2d_t src1,
  45663. __read_only image2d_t src2)
  45664. {
  45665. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  45666. CLK_FILTER_LINEAR);
  45667. float blend = (cos((float)index / 50.0f) + 1.0f) / 2.0f;
  45668. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  45669. int2 src1_loc = dst_loc * get_image_dim(src1) / get_image_dim(dst);
  45670. int2 src2_loc = dst_loc * get_image_dim(src2) / get_image_dim(dst);
  45671. float4 val1 = read_imagef(src1, sampler, src1_loc);
  45672. float4 val2 = read_imagef(src2, sampler, src2_loc);
  45673. write_imagef(dst, dst_loc, val1 * blend + val2 * (1.0f - blend));
  45674. }
  45675. </pre>
  45676. </li></ul>
  45677. <a name="roberts_005fopencl"></a>
  45678. <h3 class="section">40.13 roberts_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#roberts_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-roberts_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45679. <p>Apply the Roberts cross operator (<a href="https://en.wikipedia.org/wiki/Roberts_cross">https://en.wikipedia.org/wiki/Roberts_cross</a>) to input video stream.
  45680. </p>
  45681. <p>The filter accepts the following option:
  45682. </p>
  45683. <dl compact="compact">
  45684. <dt><samp>planes</samp></dt>
  45685. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  45686. </p>
  45687. </dd>
  45688. <dt><samp>scale</samp></dt>
  45689. <dd><p>Set value which will be multiplied with filtered result.
  45690. Range is <code>[0.0, 65535]</code> and default value is <code>1.0</code>.
  45691. </p>
  45692. </dd>
  45693. <dt><samp>delta</samp></dt>
  45694. <dd><p>Set value which will be added to filtered result.
  45695. Range is <code>[-65535, 65535]</code> and default value is <code>0.0</code>.
  45696. </p></dd>
  45697. </dl>
  45698. <a name="Example-8"></a>
  45699. <h4 class="subsection">40.13.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-8" aria-hidden="true">TOC</a></span></h4>
  45700. <ul>
  45701. <li> Apply the Roberts cross operator with scale set to 2 and delta set to 10
  45702. <div class="example">
  45703. <pre class="example">-i INPUT -vf &quot;hwupload, roberts_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  45704. </pre></div>
  45705. </li></ul>
  45706. <a name="sobel_005fopencl"></a>
  45707. <h3 class="section">40.14 sobel_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#sobel_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sobel_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45708. <p>Apply the Sobel operator (<a href="https://en.wikipedia.org/wiki/Sobel_operator">https://en.wikipedia.org/wiki/Sobel_operator</a>) to input video stream.
  45709. </p>
  45710. <p>The filter accepts the following option:
  45711. </p>
  45712. <dl compact="compact">
  45713. <dt><samp>planes</samp></dt>
  45714. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  45715. </p>
  45716. </dd>
  45717. <dt><samp>scale</samp></dt>
  45718. <dd><p>Set value which will be multiplied with filtered result.
  45719. Range is <code>[0.0, 65535]</code> and default value is <code>1.0</code>.
  45720. </p>
  45721. </dd>
  45722. <dt><samp>delta</samp></dt>
  45723. <dd><p>Set value which will be added to filtered result.
  45724. Range is <code>[-65535, 65535]</code> and default value is <code>0.0</code>.
  45725. </p></dd>
  45726. </dl>
  45727. <a name="Example-9"></a>
  45728. <h4 class="subsection">40.14.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-9" aria-hidden="true">TOC</a></span></h4>
  45729. <ul>
  45730. <li> Apply sobel operator with scale set to 2 and delta set to 10
  45731. <div class="example">
  45732. <pre class="example">-i INPUT -vf &quot;hwupload, sobel_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  45733. </pre></div>
  45734. </li></ul>
  45735. <a name="tonemap_005fopencl"></a>
  45736. <h3 class="section">40.15 tonemap_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#tonemap_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tonemap_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45737. <p>Perform HDR(PQ/HLG) to SDR conversion with tone-mapping.
  45738. </p>
  45739. <p>It accepts the following parameters:
  45740. </p>
  45741. <dl compact="compact">
  45742. <dt><samp>tonemap</samp></dt>
  45743. <dd><p>Specify the tone-mapping operator to be used. Same as tonemap option in <a href="#tonemap">tonemap</a>.
  45744. </p>
  45745. </dd>
  45746. <dt><samp>param</samp></dt>
  45747. <dd><p>Tune the tone mapping algorithm. same as param option in <a href="#tonemap">tonemap</a>.
  45748. </p>
  45749. </dd>
  45750. <dt><samp>desat</samp></dt>
  45751. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  45752. higher the parameter, the more color information will be preserved. This
  45753. setting helps prevent unnaturally blown-out colors for super-highlights, by
  45754. (smoothly) turning into white instead. This makes images feel more natural,
  45755. at the cost of reducing information about out-of-range colors.
  45756. </p>
  45757. <p>The default value is 0.5, and the algorithm here is a little different from
  45758. the cpu version tonemap currently. A setting of 0.0 disables this option.
  45759. </p>
  45760. </dd>
  45761. <dt><samp>threshold</samp></dt>
  45762. <dd><p>The tonemapping algorithm parameters is fine-tuned per each scene. And a threshold
  45763. is used to detect whether the scene has changed or not. If the distance between
  45764. the current frame average brightness and the current running average exceeds
  45765. a threshold value, we would re-calculate scene average and peak brightness.
  45766. The default value is 0.2.
  45767. </p>
  45768. </dd>
  45769. <dt><samp>format</samp></dt>
  45770. <dd><p>Specify the output pixel format.
  45771. </p>
  45772. <p>Currently supported formats are:
  45773. </p><dl compact="compact">
  45774. <dt><var>p010</var></dt>
  45775. <dt><var>nv12</var></dt>
  45776. </dl>
  45777. </dd>
  45778. <dt><samp>range, r</samp></dt>
  45779. <dd><p>Set the output color range.
  45780. </p>
  45781. <p>Possible values are:
  45782. </p><dl compact="compact">
  45783. <dt><var>tv/mpeg</var></dt>
  45784. <dt><var>pc/jpeg</var></dt>
  45785. </dl>
  45786. <p>Default is same as input.
  45787. </p>
  45788. </dd>
  45789. <dt><samp>primaries, p</samp></dt>
  45790. <dd><p>Set the output color primaries.
  45791. </p>
  45792. <p>Possible values are:
  45793. </p><dl compact="compact">
  45794. <dt><var>bt709</var></dt>
  45795. <dt><var>bt2020</var></dt>
  45796. </dl>
  45797. <p>Default is same as input.
  45798. </p>
  45799. </dd>
  45800. <dt><samp>transfer, t</samp></dt>
  45801. <dd><p>Set the output transfer characteristics.
  45802. </p>
  45803. <p>Possible values are:
  45804. </p><dl compact="compact">
  45805. <dt><var>bt709</var></dt>
  45806. <dt><var>bt2020</var></dt>
  45807. </dl>
  45808. <p>Default is bt709.
  45809. </p>
  45810. </dd>
  45811. <dt><samp>matrix, m</samp></dt>
  45812. <dd><p>Set the output colorspace matrix.
  45813. </p>
  45814. <p>Possible value are:
  45815. </p><dl compact="compact">
  45816. <dt><var>bt709</var></dt>
  45817. <dt><var>bt2020</var></dt>
  45818. </dl>
  45819. <p>Default is same as input.
  45820. </p>
  45821. </dd>
  45822. </dl>
  45823. <a name="Example-10"></a>
  45824. <h4 class="subsection">40.15.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-10" aria-hidden="true">TOC</a></span></h4>
  45825. <ul>
  45826. <li> Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010 format using linear operator.
  45827. <div class="example">
  45828. <pre class="example">-i INPUT -vf &quot;format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010&quot; OUTPUT
  45829. </pre></div>
  45830. </li></ul>
  45831. <a name="unsharp_005fopencl"></a>
  45832. <h3 class="section">40.16 unsharp_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#unsharp_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unsharp_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45833. <p>Sharpen or blur the input video.
  45834. </p>
  45835. <p>It accepts the following parameters:
  45836. </p>
  45837. <dl compact="compact">
  45838. <dt><samp>luma_msize_x, lx</samp></dt>
  45839. <dd><p>Set the luma matrix horizontal size.
  45840. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  45841. </p>
  45842. </dd>
  45843. <dt><samp>luma_msize_y, ly</samp></dt>
  45844. <dd><p>Set the luma matrix vertical size.
  45845. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  45846. </p>
  45847. </dd>
  45848. <dt><samp>luma_amount, la</samp></dt>
  45849. <dd><p>Set the luma effect strength.
  45850. Range is <code>[-10, 10]</code> and default value is <code>1.0</code>.
  45851. </p>
  45852. <p>Negative values will blur the input video, while positive values will
  45853. sharpen it, a value of zero will disable the effect.
  45854. </p>
  45855. </dd>
  45856. <dt><samp>chroma_msize_x, cx</samp></dt>
  45857. <dd><p>Set the chroma matrix horizontal size.
  45858. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  45859. </p>
  45860. </dd>
  45861. <dt><samp>chroma_msize_y, cy</samp></dt>
  45862. <dd><p>Set the chroma matrix vertical size.
  45863. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  45864. </p>
  45865. </dd>
  45866. <dt><samp>chroma_amount, ca</samp></dt>
  45867. <dd><p>Set the chroma effect strength.
  45868. Range is <code>[-10, 10]</code> and default value is <code>0.0</code>.
  45869. </p>
  45870. <p>Negative values will blur the input video, while positive values will
  45871. sharpen it, a value of zero will disable the effect.
  45872. </p>
  45873. </dd>
  45874. </dl>
  45875. <p>All parameters are optional and default to the equivalent of the
  45876. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  45877. </p>
  45878. <a name="Examples-168"></a>
  45879. <h4 class="subsection">40.16.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-168" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-168" aria-hidden="true">TOC</a></span></h4>
  45880. <ul>
  45881. <li> Apply strong luma sharpen effect:
  45882. <div class="example">
  45883. <pre class="example">-i INPUT -vf &quot;hwupload, unsharp_opencl=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5, hwdownload&quot; OUTPUT
  45884. </pre></div>
  45885. </li><li> Apply a strong blur of both luma and chroma parameters:
  45886. <div class="example">
  45887. <pre class="example">-i INPUT -vf &quot;hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload&quot; OUTPUT
  45888. </pre></div>
  45889. </li></ul>
  45890. <a name="xfade_005fopencl"></a>
  45891. <h3 class="section">40.17 xfade_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#xfade_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xfade_005fopencl" aria-hidden="true">TOC</a></span></h3>
  45892. <p>Cross fade two videos with custom transition effect by using OpenCL.
  45893. </p>
  45894. <p>It accepts the following options:
  45895. </p>
  45896. <dl compact="compact">
  45897. <dt><samp>transition</samp></dt>
  45898. <dd><p>Set one of possible transition effects.
  45899. </p>
  45900. <dl compact="compact">
  45901. <dt><samp>custom</samp></dt>
  45902. <dd><p>Select custom transition effect, the actual transition description
  45903. will be picked from source and kernel options.
  45904. </p>
  45905. </dd>
  45906. <dt><samp>fade</samp></dt>
  45907. <dt><samp>wipeleft</samp></dt>
  45908. <dt><samp>wiperight</samp></dt>
  45909. <dt><samp>wipeup</samp></dt>
  45910. <dt><samp>wipedown</samp></dt>
  45911. <dt><samp>slideleft</samp></dt>
  45912. <dt><samp>slideright</samp></dt>
  45913. <dt><samp>slideup</samp></dt>
  45914. <dt><samp>slidedown</samp></dt>
  45915. <dd>
  45916. <p>Default transition is fade.
  45917. </p></dd>
  45918. </dl>
  45919. </dd>
  45920. <dt><samp>source</samp></dt>
  45921. <dd><p>OpenCL program source file for custom transition.
  45922. </p>
  45923. </dd>
  45924. <dt><samp>kernel</samp></dt>
  45925. <dd><p>Set name of kernel to use for custom transition from program source file.
  45926. </p>
  45927. </dd>
  45928. <dt><samp>duration</samp></dt>
  45929. <dd><p>Set duration of video transition.
  45930. </p>
  45931. </dd>
  45932. <dt><samp>offset</samp></dt>
  45933. <dd><p>Set time of start of transition relative to first video.
  45934. </p></dd>
  45935. </dl>
  45936. <p>The program source file must contain a kernel function with the given name,
  45937. which will be run once for each plane of the output. Each run on a plane
  45938. gets enqueued as a separate 2D global NDRange with one work-item for each
  45939. pixel to be generated. The global ID offset for each work-item is therefore
  45940. the coordinates of a pixel in the destination image.
  45941. </p>
  45942. <p>The kernel function needs to take the following arguments:
  45943. </p><ul>
  45944. <li> Destination image, <var>__write_only image2d_t</var>.
  45945. <p>This image will become the output; the kernel should write all of it.
  45946. </p>
  45947. </li><li> First Source image, <var>__read_only image2d_t</var>.
  45948. Second Source image, <var>__read_only image2d_t</var>.
  45949. <p>These are the most recent images on each input. The kernel may read from
  45950. them to generate the output, but they can&rsquo;t be written to.
  45951. </p>
  45952. </li><li> Transition progress, <var>float</var>. This value is always between 0 and 1 inclusive.
  45953. </li></ul>
  45954. <p>Example programs:
  45955. </p>
  45956. <ul>
  45957. <li> Apply dots curtain transition effect:
  45958. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  45959. __read_only image2d_t src1,
  45960. __read_only image2d_t src2,
  45961. float progress)
  45962. {
  45963. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  45964. CLK_FILTER_LINEAR);
  45965. int2 p = (int2)(get_global_id(0), get_global_id(1));
  45966. float2 rp = (float2)(get_global_id(0), get_global_id(1));
  45967. float2 dim = (float2)(get_image_dim(src1).x, get_image_dim(src1).y);
  45968. rp = rp / dim;
  45969. float2 dots = (float2)(20.0, 20.0);
  45970. float2 center = (float2)(0,0);
  45971. float2 unused;
  45972. float4 val1 = read_imagef(src1, sampler, p);
  45973. float4 val2 = read_imagef(src2, sampler, p);
  45974. bool next = distance(fract(rp * dots, &amp;unused), (float2)(0.5, 0.5)) &lt; (progress / distance(rp, center));
  45975. write_imagef(dst, p, next ? val1 : val2);
  45976. }
  45977. </pre>
  45978. </li></ul>
  45979. <a name="VAAPI-Video-Filters"></a>
  45980. <h2 class="chapter">41 VAAPI Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#VAAPI-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VAAPI-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  45981. <p>VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters.
  45982. </p>
  45983. <p>To enable compilation of these filters you need to configure FFmpeg with
  45984. <code>--enable-vaapi</code>.
  45985. </p>
  45986. <p>To use vaapi filters, you need to setup the vaapi device correctly. For more information, please read <a href="https://trac.ffmpeg.org/wiki/Hardware/VAAPI">https://trac.ffmpeg.org/wiki/Hardware/VAAPI</a>
  45987. </p>
  45988. <a name="tonemap_005fvaapi"></a>
  45989. <h3 class="section">41.1 tonemap_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#tonemap_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tonemap_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  45990. <p>Perform HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion with tone-mapping.
  45991. It maps the dynamic range of HDR10 content to the SDR content.
  45992. It currently only accepts HDR10 as input.
  45993. </p>
  45994. <p>It accepts the following parameters:
  45995. </p>
  45996. <dl compact="compact">
  45997. <dt><samp>format</samp></dt>
  45998. <dd><p>Specify the output pixel format.
  45999. </p>
  46000. <p>Currently supported formats are:
  46001. </p><dl compact="compact">
  46002. <dt><var>p010</var></dt>
  46003. <dt><var>nv12</var></dt>
  46004. </dl>
  46005. <p>Default is nv12.
  46006. </p>
  46007. </dd>
  46008. <dt><samp>primaries, p</samp></dt>
  46009. <dd><p>Set the output color primaries.
  46010. </p>
  46011. <p>Default is same as input.
  46012. </p>
  46013. </dd>
  46014. <dt><samp>transfer, t</samp></dt>
  46015. <dd><p>Set the output transfer characteristics.
  46016. </p>
  46017. <p>Default is bt709.
  46018. </p>
  46019. </dd>
  46020. <dt><samp>matrix, m</samp></dt>
  46021. <dd><p>Set the output colorspace matrix.
  46022. </p>
  46023. <p>Default is same as input.
  46024. </p>
  46025. </dd>
  46026. </dl>
  46027. <a name="Example-11"></a>
  46028. <h4 class="subsection">41.1.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-11" aria-hidden="true">TOC</a></span></h4>
  46029. <ul>
  46030. <li> Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format
  46031. <div class="example">
  46032. <pre class="example">tonemap_vaapi=format=p010:t=bt2020-10
  46033. </pre></div>
  46034. </li></ul>
  46035. <a name="Video-Sources"></a>
  46036. <h2 class="chapter">42 Video Sources<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Sources" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Sources" aria-hidden="true">TOC</a></span></h2>
  46037. <p>Below is a description of the currently available video sources.
  46038. </p>
  46039. <a name="buffer"></a>
  46040. <h3 class="section">42.1 buffer<span class="pull-right"><a class="anchor hidden-xs" href="#buffer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-buffer" aria-hidden="true">TOC</a></span></h3>
  46041. <p>Buffer video frames, and make them available to the filter chain.
  46042. </p>
  46043. <p>This source is mainly intended for a programmatic use, in particular
  46044. through the interface defined in <samp>libavfilter/buffersrc.h</samp>.
  46045. </p>
  46046. <p>It accepts the following parameters:
  46047. </p>
  46048. <dl compact="compact">
  46049. <dt><samp>video_size</samp></dt>
  46050. <dd><p>Specify the size (width and height) of the buffered video frames. For the
  46051. syntax of this option, check the
  46052. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46053. </p>
  46054. </dd>
  46055. <dt><samp>width</samp></dt>
  46056. <dd><p>The input video width.
  46057. </p>
  46058. </dd>
  46059. <dt><samp>height</samp></dt>
  46060. <dd><p>The input video height.
  46061. </p>
  46062. </dd>
  46063. <dt><samp>pix_fmt</samp></dt>
  46064. <dd><p>A string representing the pixel format of the buffered video frames.
  46065. It may be a number corresponding to a pixel format, or a pixel format
  46066. name.
  46067. </p>
  46068. </dd>
  46069. <dt><samp>time_base</samp></dt>
  46070. <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
  46071. </p>
  46072. </dd>
  46073. <dt><samp>frame_rate</samp></dt>
  46074. <dd><p>Specify the frame rate expected for the video stream.
  46075. </p>
  46076. </dd>
  46077. <dt><samp>pixel_aspect, sar</samp></dt>
  46078. <dd><p>The sample (pixel) aspect ratio of the input video.
  46079. </p>
  46080. </dd>
  46081. <dt><samp>sws_param</samp></dt>
  46082. <dd><p>This option is deprecated and ignored. Prepend <code>sws_flags=<var>flags</var>;</code>
  46083. to the filtergraph description to specify swscale flags for automatically
  46084. inserted scalers. See <a href="#Filtergraph-syntax">Filtergraph syntax</a>.
  46085. </p>
  46086. </dd>
  46087. <dt><samp>hw_frames_ctx</samp></dt>
  46088. <dd><p>When using a hardware pixel format, this should be a reference to an
  46089. AVHWFramesContext describing input frames.
  46090. </p></dd>
  46091. </dl>
  46092. <p>For example:
  46093. </p><div class="example">
  46094. <pre class="example">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
  46095. </pre></div>
  46096. <p>will instruct the source to accept video frames with size 320x240 and
  46097. with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
  46098. square pixels (1:1 sample aspect ratio).
  46099. Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
  46100. (check the enum AVPixelFormat definition in <samp>libavutil/pixfmt.h</samp>),
  46101. this example corresponds to:
  46102. </p><div class="example">
  46103. <pre class="example">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
  46104. </pre></div>
  46105. <p>Alternatively, the options can be specified as a flat string, but this
  46106. syntax is deprecated:
  46107. </p>
  46108. <p><var>width</var>:<var>height</var>:<var>pix_fmt</var>:<var>time_base.num</var>:<var>time_base.den</var>:<var>pixel_aspect.num</var>:<var>pixel_aspect.den</var>
  46109. </p>
  46110. <a name="cellauto"></a>
  46111. <h3 class="section">42.2 cellauto<span class="pull-right"><a class="anchor hidden-xs" href="#cellauto" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cellauto" aria-hidden="true">TOC</a></span></h3>
  46112. <p>Create a pattern generated by an elementary cellular automaton.
  46113. </p>
  46114. <p>The initial state of the cellular automaton can be defined through the
  46115. <samp>filename</samp> and <samp>pattern</samp> options. If such options are
  46116. not specified an initial state is created randomly.
  46117. </p>
  46118. <p>At each new frame a new row in the video is filled with the result of
  46119. the cellular automaton next generation. The behavior when the whole
  46120. frame is filled is defined by the <samp>scroll</samp> option.
  46121. </p>
  46122. <p>This source accepts the following options:
  46123. </p>
  46124. <dl compact="compact">
  46125. <dt><samp>filename, f</samp></dt>
  46126. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  46127. the specified file.
  46128. In the file, each non-whitespace character is considered an alive
  46129. cell, a newline will terminate the row, and further characters in the
  46130. file will be ignored.
  46131. </p>
  46132. </dd>
  46133. <dt><samp>pattern, p</samp></dt>
  46134. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  46135. the specified string.
  46136. </p>
  46137. <p>Each non-whitespace character in the string is considered an alive
  46138. cell, a newline will terminate the row, and further characters in the
  46139. string will be ignored.
  46140. </p>
  46141. </dd>
  46142. <dt><samp>rate, r</samp></dt>
  46143. <dd><p>Set the video rate, that is the number of frames generated per second.
  46144. Default is 25.
  46145. </p>
  46146. </dd>
  46147. <dt><samp>random_fill_ratio, ratio</samp></dt>
  46148. <dd><p>Set the random fill ratio for the initial cellular automaton row. It
  46149. is a floating point number value ranging from 0 to 1, defaults to
  46150. 1/PHI.
  46151. </p>
  46152. <p>This option is ignored when a file or a pattern is specified.
  46153. </p>
  46154. </dd>
  46155. <dt><samp>random_seed, seed</samp></dt>
  46156. <dd><p>Set the seed for filling randomly the initial row, must be an integer
  46157. included between 0 and UINT32_MAX. If not specified, or if explicitly
  46158. set to -1, the filter will try to use a good random seed on a best
  46159. effort basis.
  46160. </p>
  46161. </dd>
  46162. <dt><samp>rule</samp></dt>
  46163. <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
  46164. Default value is 110.
  46165. </p>
  46166. </dd>
  46167. <dt><samp>size, s</samp></dt>
  46168. <dd><p>Set the size of the output video. For the syntax of this option, check the
  46169. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46170. </p>
  46171. <p>If <samp>filename</samp> or <samp>pattern</samp> is specified, the size is set
  46172. by default to the width of the specified initial state row, and the
  46173. height is set to <var>width</var> * PHI.
  46174. </p>
  46175. <p>If <samp>size</samp> is set, it must contain the width of the specified
  46176. pattern string, and the specified pattern will be centered in the
  46177. larger row.
  46178. </p>
  46179. <p>If a filename or a pattern string is not specified, the size value
  46180. defaults to &quot;320x518&quot; (used for a randomly generated initial state).
  46181. </p>
  46182. </dd>
  46183. <dt><samp>scroll</samp></dt>
  46184. <dd><p>If set to 1, scroll the output upward when all the rows in the output
  46185. have been already filled. If set to 0, the new generated row will be
  46186. written over the top row just after the bottom row is filled.
  46187. Defaults to 1.
  46188. </p>
  46189. </dd>
  46190. <dt><samp>start_full, full</samp></dt>
  46191. <dd><p>If set to 1, completely fill the output with generated rows before
  46192. outputting the first frame.
  46193. This is the default behavior, for disabling set the value to 0.
  46194. </p>
  46195. </dd>
  46196. <dt><samp>stitch</samp></dt>
  46197. <dd><p>If set to 1, stitch the left and right row edges together.
  46198. This is the default behavior, for disabling set the value to 0.
  46199. </p></dd>
  46200. </dl>
  46201. <a name="Examples-169"></a>
  46202. <h4 class="subsection">42.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-169" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-169" aria-hidden="true">TOC</a></span></h4>
  46203. <ul>
  46204. <li> Read the initial state from <samp>pattern</samp>, and specify an output of
  46205. size 200x400.
  46206. <div class="example">
  46207. <pre class="example">cellauto=f=pattern:s=200x400
  46208. </pre></div>
  46209. </li><li> Generate a random initial row with a width of 200 cells, with a fill
  46210. ratio of 2/3:
  46211. <div class="example">
  46212. <pre class="example">cellauto=ratio=2/3:s=200x200
  46213. </pre></div>
  46214. </li><li> Create a pattern generated by rule 18 starting by a single alive cell
  46215. centered on an initial row with width 100:
  46216. <div class="example">
  46217. <pre class="example">cellauto=p=@:s=100x400:full=0:rule=18
  46218. </pre></div>
  46219. </li><li> Specify a more elaborated initial pattern:
  46220. <div class="example">
  46221. <pre class="example">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
  46222. </pre></div>
  46223. </li></ul>
  46224. <span id="coreimagesrc"></span><a name="coreimagesrc-1"></a>
  46225. <h3 class="section">42.3 coreimagesrc<span class="pull-right"><a class="anchor hidden-xs" href="#coreimagesrc-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-coreimagesrc-1" aria-hidden="true">TOC</a></span></h3>
  46226. <p>Video source generated on GPU using Apple&rsquo;s CoreImage API on OSX.
  46227. </p>
  46228. <p>This video source is a specialized version of the <a href="#coreimage">coreimage</a> video filter.
  46229. Use a core image generator at the beginning of the applied filterchain to
  46230. generate the content.
  46231. </p>
  46232. <p>The coreimagesrc video source accepts the following options:
  46233. </p><dl compact="compact">
  46234. <dt><samp>list_generators</samp></dt>
  46235. <dd><p>List all available generators along with all their respective options as well as
  46236. possible minimum and maximum values along with the default values.
  46237. </p><div class="example">
  46238. <pre class="example">list_generators=true
  46239. </pre></div>
  46240. </dd>
  46241. <dt><samp>size, s</samp></dt>
  46242. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  46243. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46244. The default value is <code>320x240</code>.
  46245. </p>
  46246. </dd>
  46247. <dt><samp>rate, r</samp></dt>
  46248. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  46249. generated per second. It has to be a string in the format
  46250. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
  46251. number or a valid video frame rate abbreviation. The default value is
  46252. &quot;25&quot;.
  46253. </p>
  46254. </dd>
  46255. <dt><samp>sar</samp></dt>
  46256. <dd><p>Set the sample aspect ratio of the sourced video.
  46257. </p>
  46258. </dd>
  46259. <dt><samp>duration, d</samp></dt>
  46260. <dd><p>Set the duration of the sourced video. See
  46261. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  46262. for the accepted syntax.
  46263. </p>
  46264. <p>If not specified, or the expressed duration is negative, the video is
  46265. supposed to be generated forever.
  46266. </p></dd>
  46267. </dl>
  46268. <p>Additionally, all options of the <a href="#coreimage">coreimage</a> video filter are accepted.
  46269. A complete filterchain can be used for further processing of the
  46270. generated input without CPU-HOST transfer. See <a href="#coreimage">coreimage</a> documentation
  46271. and examples for details.
  46272. </p>
  46273. <a name="Examples-170"></a>
  46274. <h4 class="subsection">42.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-170" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-170" aria-hidden="true">TOC</a></span></h4>
  46275. <ul>
  46276. <li> Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  46277. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  46278. <div class="example">
  46279. <pre class="example">ffmpeg -f lavfi -i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  46280. </pre></div>
  46281. <p>This example is equivalent to the QRCode example of <a href="#coreimage">coreimage</a> without the
  46282. need for a nullsrc video source.
  46283. </p></li></ul>
  46284. <a name="gradients"></a>
  46285. <h3 class="section">42.4 gradients<span class="pull-right"><a class="anchor hidden-xs" href="#gradients" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gradients" aria-hidden="true">TOC</a></span></h3>
  46286. <p>Generate several gradients.
  46287. </p>
  46288. <dl compact="compact">
  46289. <dt><samp>size, s</samp></dt>
  46290. <dd><p>Set frame size. For the syntax of this option, check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video
  46291. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  46292. </p>
  46293. </dd>
  46294. <dt><samp>rate, r</samp></dt>
  46295. <dd><p>Set frame rate, expressed as number of frames per second. Default
  46296. value is &quot;25&quot;.
  46297. </p>
  46298. </dd>
  46299. <dt><samp>c0, c1, c2, c3, c4, c5, c6, c7</samp></dt>
  46300. <dd><p>Set 8 colors. Default values for colors is to pick random one.
  46301. </p>
  46302. </dd>
  46303. <dt><samp>x0, y0, y0, y1</samp></dt>
  46304. <dd><p>Set gradient line source and destination points. If negative or out of range, random ones
  46305. are picked.
  46306. </p>
  46307. </dd>
  46308. <dt><samp>nb_colors, n</samp></dt>
  46309. <dd><p>Set number of colors to use at once. Allowed range is from 2 to 8. Default value is 2.
  46310. </p>
  46311. </dd>
  46312. <dt><samp>seed</samp></dt>
  46313. <dd><p>Set seed for picking gradient line points.
  46314. </p>
  46315. </dd>
  46316. <dt><samp>duration, d</samp></dt>
  46317. <dd><p>Set the duration of the sourced video. See
  46318. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  46319. for the accepted syntax.
  46320. </p>
  46321. <p>If not specified, or the expressed duration is negative, the video is
  46322. supposed to be generated forever.
  46323. </p>
  46324. </dd>
  46325. <dt><samp>speed</samp></dt>
  46326. <dd><p>Set speed of gradients rotation.
  46327. </p></dd>
  46328. </dl>
  46329. <a name="mandelbrot"></a>
  46330. <h3 class="section">42.5 mandelbrot<span class="pull-right"><a class="anchor hidden-xs" href="#mandelbrot" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mandelbrot" aria-hidden="true">TOC</a></span></h3>
  46331. <p>Generate a Mandelbrot set fractal, and progressively zoom towards the
  46332. point specified with <var>start_x</var> and <var>start_y</var>.
  46333. </p>
  46334. <p>This source accepts the following options:
  46335. </p>
  46336. <dl compact="compact">
  46337. <dt><samp>end_pts</samp></dt>
  46338. <dd><p>Set the terminal pts value. Default value is 400.
  46339. </p>
  46340. </dd>
  46341. <dt><samp>end_scale</samp></dt>
  46342. <dd><p>Set the terminal scale value.
  46343. Must be a floating point value. Default value is 0.3.
  46344. </p>
  46345. </dd>
  46346. <dt><samp>inner</samp></dt>
  46347. <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
  46348. Mandelbrot fractal internal region.
  46349. </p>
  46350. <p>It shall assume one of the following values:
  46351. </p><dl compact="compact">
  46352. <dt><samp>black</samp></dt>
  46353. <dd><p>Set black mode.
  46354. </p></dd>
  46355. <dt><samp>convergence</samp></dt>
  46356. <dd><p>Show time until convergence.
  46357. </p></dd>
  46358. <dt><samp>mincol</samp></dt>
  46359. <dd><p>Set color based on point closest to the origin of the iterations.
  46360. </p></dd>
  46361. <dt><samp>period</samp></dt>
  46362. <dd><p>Set period mode.
  46363. </p></dd>
  46364. </dl>
  46365. <p>Default value is <var>mincol</var>.
  46366. </p>
  46367. </dd>
  46368. <dt><samp>bailout</samp></dt>
  46369. <dd><p>Set the bailout value. Default value is 10.0.
  46370. </p>
  46371. </dd>
  46372. <dt><samp>maxiter</samp></dt>
  46373. <dd><p>Set the maximum of iterations performed by the rendering
  46374. algorithm. Default value is 7189.
  46375. </p>
  46376. </dd>
  46377. <dt><samp>outer</samp></dt>
  46378. <dd><p>Set outer coloring mode.
  46379. It shall assume one of following values:
  46380. </p><dl compact="compact">
  46381. <dt><samp>iteration_count</samp></dt>
  46382. <dd><p>Set iteration count mode.
  46383. </p></dd>
  46384. <dt><samp>normalized_iteration_count</samp></dt>
  46385. <dd><p>set normalized iteration count mode.
  46386. </p></dd>
  46387. </dl>
  46388. <p>Default value is <var>normalized_iteration_count</var>.
  46389. </p>
  46390. </dd>
  46391. <dt><samp>rate, r</samp></dt>
  46392. <dd><p>Set frame rate, expressed as number of frames per second. Default
  46393. value is &quot;25&quot;.
  46394. </p>
  46395. </dd>
  46396. <dt><samp>size, s</samp></dt>
  46397. <dd><p>Set frame size. For the syntax of this option, check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video
  46398. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  46399. </p>
  46400. </dd>
  46401. <dt><samp>start_scale</samp></dt>
  46402. <dd><p>Set the initial scale value. Default value is 3.0.
  46403. </p>
  46404. </dd>
  46405. <dt><samp>start_x</samp></dt>
  46406. <dd><p>Set the initial x position. Must be a floating point value between
  46407. -100 and 100. Default value is -0.743643887037158704752191506114774.
  46408. </p>
  46409. </dd>
  46410. <dt><samp>start_y</samp></dt>
  46411. <dd><p>Set the initial y position. Must be a floating point value between
  46412. -100 and 100. Default value is -0.131825904205311970493132056385139.
  46413. </p></dd>
  46414. </dl>
  46415. <a name="mptestsrc"></a>
  46416. <h3 class="section">42.6 mptestsrc<span class="pull-right"><a class="anchor hidden-xs" href="#mptestsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mptestsrc" aria-hidden="true">TOC</a></span></h3>
  46417. <p>Generate various test patterns, as generated by the MPlayer test filter.
  46418. </p>
  46419. <p>The size of the generated video is fixed, and is 256x256.
  46420. This source is useful in particular for testing encoding features.
  46421. </p>
  46422. <p>This source accepts the following options:
  46423. </p>
  46424. <dl compact="compact">
  46425. <dt><samp>rate, r</samp></dt>
  46426. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  46427. generated per second. It has to be a string in the format
  46428. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
  46429. number or a valid video frame rate abbreviation. The default value is
  46430. &quot;25&quot;.
  46431. </p>
  46432. </dd>
  46433. <dt><samp>duration, d</samp></dt>
  46434. <dd><p>Set the duration of the sourced video. See
  46435. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  46436. for the accepted syntax.
  46437. </p>
  46438. <p>If not specified, or the expressed duration is negative, the video is
  46439. supposed to be generated forever.
  46440. </p>
  46441. </dd>
  46442. <dt><samp>test, t</samp></dt>
  46443. <dd>
  46444. <p>Set the number or the name of the test to perform. Supported tests are:
  46445. </p><dl compact="compact">
  46446. <dt><samp>dc_luma</samp></dt>
  46447. <dt><samp>dc_chroma</samp></dt>
  46448. <dt><samp>freq_luma</samp></dt>
  46449. <dt><samp>freq_chroma</samp></dt>
  46450. <dt><samp>amp_luma</samp></dt>
  46451. <dt><samp>amp_chroma</samp></dt>
  46452. <dt><samp>cbp</samp></dt>
  46453. <dt><samp>mv</samp></dt>
  46454. <dt><samp>ring1</samp></dt>
  46455. <dt><samp>ring2</samp></dt>
  46456. <dt><samp>all</samp></dt>
  46457. <dt><samp>max_frames, m</samp></dt>
  46458. <dd><p>Set the maximum number of frames generated for each test, default value is 30.
  46459. </p>
  46460. </dd>
  46461. </dl>
  46462. <p>Default value is &quot;all&quot;, which will cycle through the list of all tests.
  46463. </p></dd>
  46464. </dl>
  46465. <p>Some examples:
  46466. </p><div class="example">
  46467. <pre class="example">mptestsrc=t=dc_luma
  46468. </pre></div>
  46469. <p>will generate a &quot;dc_luma&quot; test pattern.
  46470. </p>
  46471. <a name="frei0r_005fsrc"></a>
  46472. <h3 class="section">42.7 frei0r_src<span class="pull-right"><a class="anchor hidden-xs" href="#frei0r_005fsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-frei0r_005fsrc" aria-hidden="true">TOC</a></span></h3>
  46473. <p>Provide a frei0r source.
  46474. </p>
  46475. <p>To enable compilation of this filter you need to install the frei0r
  46476. header and configure FFmpeg with <code>--enable-frei0r</code>.
  46477. </p>
  46478. <p>This source accepts the following parameters:
  46479. </p>
  46480. <dl compact="compact">
  46481. <dt><samp>size</samp></dt>
  46482. <dd><p>The size of the video to generate. For the syntax of this option, check the
  46483. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46484. </p>
  46485. </dd>
  46486. <dt><samp>framerate</samp></dt>
  46487. <dd><p>The framerate of the generated video. It may be a string of the form
  46488. <var>num</var>/<var>den</var> or a frame rate abbreviation.
  46489. </p>
  46490. </dd>
  46491. <dt><samp>filter_name</samp></dt>
  46492. <dd><p>The name to the frei0r source to load. For more information regarding frei0r and
  46493. how to set the parameters, read the <a href="#frei0r">frei0r</a> section in the video filters
  46494. documentation.
  46495. </p>
  46496. </dd>
  46497. <dt><samp>filter_params</samp></dt>
  46498. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r source.
  46499. </p>
  46500. </dd>
  46501. </dl>
  46502. <p>For example, to generate a frei0r partik0l source with size 200x200
  46503. and frame rate 10 which is overlaid on the overlay filter main input:
  46504. </p><div class="example">
  46505. <pre class="example">frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
  46506. </pre></div>
  46507. <a name="life"></a>
  46508. <h3 class="section">42.8 life<span class="pull-right"><a class="anchor hidden-xs" href="#life" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-life" aria-hidden="true">TOC</a></span></h3>
  46509. <p>Generate a life pattern.
  46510. </p>
  46511. <p>This source is based on a generalization of John Conway&rsquo;s life game.
  46512. </p>
  46513. <p>The sourced input represents a life grid, each pixel represents a cell
  46514. which can be in one of two possible states, alive or dead. Every cell
  46515. interacts with its eight neighbours, which are the cells that are
  46516. horizontally, vertically, or diagonally adjacent.
  46517. </p>
  46518. <p>At each interaction the grid evolves according to the adopted rule,
  46519. which specifies the number of neighbor alive cells which will make a
  46520. cell stay alive or born. The <samp>rule</samp> option allows one to specify
  46521. the rule to adopt.
  46522. </p>
  46523. <p>This source accepts the following options:
  46524. </p>
  46525. <dl compact="compact">
  46526. <dt><samp>filename, f</samp></dt>
  46527. <dd><p>Set the file from which to read the initial grid state. In the file,
  46528. each non-whitespace character is considered an alive cell, and newline
  46529. is used to delimit the end of each row.
  46530. </p>
  46531. <p>If this option is not specified, the initial grid is generated
  46532. randomly.
  46533. </p>
  46534. </dd>
  46535. <dt><samp>rate, r</samp></dt>
  46536. <dd><p>Set the video rate, that is the number of frames generated per second.
  46537. Default is 25.
  46538. </p>
  46539. </dd>
  46540. <dt><samp>random_fill_ratio, ratio</samp></dt>
  46541. <dd><p>Set the random fill ratio for the initial random grid. It is a
  46542. floating point number value ranging from 0 to 1, defaults to 1/PHI.
  46543. It is ignored when a file is specified.
  46544. </p>
  46545. </dd>
  46546. <dt><samp>random_seed, seed</samp></dt>
  46547. <dd><p>Set the seed for filling the initial random grid, must be an integer
  46548. included between 0 and UINT32_MAX. If not specified, or if explicitly
  46549. set to -1, the filter will try to use a good random seed on a best
  46550. effort basis.
  46551. </p>
  46552. </dd>
  46553. <dt><samp>rule</samp></dt>
  46554. <dd><p>Set the life rule.
  46555. </p>
  46556. <p>A rule can be specified with a code of the kind &quot;S<var>NS</var>/B<var>NB</var>&quot;,
  46557. where <var>NS</var> and <var>NB</var> are sequences of numbers in the range 0-8,
  46558. <var>NS</var> specifies the number of alive neighbor cells which make a
  46559. live cell stay alive, and <var>NB</var> the number of alive neighbor cells
  46560. which make a dead cell to become alive (i.e. to &quot;born&quot;).
  46561. &quot;s&quot; and &quot;b&quot; can be used in place of &quot;S&quot; and &quot;B&quot;, respectively.
  46562. </p>
  46563. <p>Alternatively a rule can be specified by an 18-bits integer. The 9
  46564. high order bits are used to encode the next cell state if it is alive
  46565. for each number of neighbor alive cells, the low order bits specify
  46566. the rule for &quot;borning&quot; new cells. Higher order bits encode for an
  46567. higher number of neighbor cells.
  46568. For example the number 6153 = <code>(12&lt;&lt;9)+9</code> specifies a stay alive
  46569. rule of 12 and a born rule of 9, which corresponds to &quot;S23/B03&quot;.
  46570. </p>
  46571. <p>Default value is &quot;S23/B3&quot;, which is the original Conway&rsquo;s game of life
  46572. rule, and will keep a cell alive if it has 2 or 3 neighbor alive
  46573. cells, and will born a new cell if there are three alive cells around
  46574. a dead cell.
  46575. </p>
  46576. </dd>
  46577. <dt><samp>size, s</samp></dt>
  46578. <dd><p>Set the size of the output video. For the syntax of this option, check the
  46579. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46580. </p>
  46581. <p>If <samp>filename</samp> is specified, the size is set by default to the
  46582. same size of the input file. If <samp>size</samp> is set, it must contain
  46583. the size specified in the input file, and the initial grid defined in
  46584. that file is centered in the larger resulting area.
  46585. </p>
  46586. <p>If a filename is not specified, the size value defaults to &quot;320x240&quot;
  46587. (used for a randomly generated initial grid).
  46588. </p>
  46589. </dd>
  46590. <dt><samp>stitch</samp></dt>
  46591. <dd><p>If set to 1, stitch the left and right grid edges together, and the
  46592. top and bottom edges also. Defaults to 1.
  46593. </p>
  46594. </dd>
  46595. <dt><samp>mold</samp></dt>
  46596. <dd><p>Set cell mold speed. If set, a dead cell will go from <samp>death_color</samp> to
  46597. <samp>mold_color</samp> with a step of <samp>mold</samp>. <samp>mold</samp> can have a
  46598. value from 0 to 255.
  46599. </p>
  46600. </dd>
  46601. <dt><samp>life_color</samp></dt>
  46602. <dd><p>Set the color of living (or new born) cells.
  46603. </p>
  46604. </dd>
  46605. <dt><samp>death_color</samp></dt>
  46606. <dd><p>Set the color of dead cells. If <samp>mold</samp> is set, this is the first color
  46607. used to represent a dead cell.
  46608. </p>
  46609. </dd>
  46610. <dt><samp>mold_color</samp></dt>
  46611. <dd><p>Set mold color, for definitely dead and moldy cells.
  46612. </p>
  46613. <p>For the syntax of these 3 color options, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the
  46614. ffmpeg-utils manual</a>.
  46615. </p></dd>
  46616. </dl>
  46617. <a name="Examples-171"></a>
  46618. <h4 class="subsection">42.8.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-171" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-171" aria-hidden="true">TOC</a></span></h4>
  46619. <ul>
  46620. <li> Read a grid from <samp>pattern</samp>, and center it on a grid of size
  46621. 300x300 pixels:
  46622. <div class="example">
  46623. <pre class="example">life=f=pattern:s=300x300
  46624. </pre></div>
  46625. </li><li> Generate a random grid of size 200x200, with a fill ratio of 2/3:
  46626. <div class="example">
  46627. <pre class="example">life=ratio=2/3:s=200x200
  46628. </pre></div>
  46629. </li><li> Specify a custom rule for evolving a randomly generated grid:
  46630. <div class="example">
  46631. <pre class="example">life=rule=S14/B34
  46632. </pre></div>
  46633. </li><li> Full example with slow death effect (mold) using <code>ffplay</code>:
  46634. <div class="example">
  46635. <pre class="example">ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
  46636. </pre></div>
  46637. </li></ul>
  46638. <span id="allrgb"></span><span id="allyuv"></span><span id="color"></span><span id="haldclutsrc"></span><span id="nullsrc"></span><span id="pal75bars"></span><span id="pal100bars"></span><span id="rgbtestsrc"></span><span id="smptebars"></span><span id="smptehdbars"></span><span id="testsrc"></span><span id="testsrc2"></span><span id="yuvtestsrc"></span><a name="allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc"></a>
  46639. <h3 class="section">42.9 allrgb, allyuv, color, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc<span class="pull-right"><a class="anchor hidden-xs" href="#allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc" aria-hidden="true">TOC</a></span></h3>
  46640. <p>The <code>allrgb</code> source returns frames of size 4096x4096 of all rgb colors.
  46641. </p>
  46642. <p>The <code>allyuv</code> source returns frames of size 4096x4096 of all yuv colors.
  46643. </p>
  46644. <p>The <code>color</code> source provides an uniformly colored input.
  46645. </p>
  46646. <p>The <code>haldclutsrc</code> source provides an identity Hald CLUT. See also
  46647. <a href="#haldclut">haldclut</a> filter.
  46648. </p>
  46649. <p>The <code>nullsrc</code> source returns unprocessed video frames. It is
  46650. mainly useful to be employed in analysis / debugging tools, or as the
  46651. source for filters which ignore the input data.
  46652. </p>
  46653. <p>The <code>pal75bars</code> source generates a color bars pattern, based on
  46654. EBU PAL recommendations with 75% color levels.
  46655. </p>
  46656. <p>The <code>pal100bars</code> source generates a color bars pattern, based on
  46657. EBU PAL recommendations with 100% color levels.
  46658. </p>
  46659. <p>The <code>rgbtestsrc</code> source generates an RGB test pattern useful for
  46660. detecting RGB vs BGR issues. You should see a red, green and blue
  46661. stripe from top to bottom.
  46662. </p>
  46663. <p>The <code>smptebars</code> source generates a color bars pattern, based on
  46664. the SMPTE Engineering Guideline EG 1-1990.
  46665. </p>
  46666. <p>The <code>smptehdbars</code> source generates a color bars pattern, based on
  46667. the SMPTE RP 219-2002.
  46668. </p>
  46669. <p>The <code>testsrc</code> source generates a test video pattern, showing a
  46670. color pattern, a scrolling gradient and a timestamp. This is mainly
  46671. intended for testing purposes.
  46672. </p>
  46673. <p>The <code>testsrc2</code> source is similar to testsrc, but supports more
  46674. pixel formats instead of just <code>rgb24</code>. This allows using it as an
  46675. input for other tests without requiring a format conversion.
  46676. </p>
  46677. <p>The <code>yuvtestsrc</code> source generates an YUV test pattern. You should
  46678. see a y, cb and cr stripe from top to bottom.
  46679. </p>
  46680. <p>The sources accept the following parameters:
  46681. </p>
  46682. <dl compact="compact">
  46683. <dt><samp>level</samp></dt>
  46684. <dd><p>Specify the level of the Hald CLUT, only available in the <code>haldclutsrc</code>
  46685. source. A level of <code>N</code> generates a picture of <code>N*N*N</code> by <code>N*N*N</code>
  46686. pixels to be used as identity matrix for 3D lookup tables. Each component is
  46687. coded on a <code>1/(N*N)</code> scale.
  46688. </p>
  46689. </dd>
  46690. <dt><samp>color, c</samp></dt>
  46691. <dd><p>Specify the color of the source, only available in the <code>color</code>
  46692. source. For the syntax of this option, check the
  46693. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  46694. </p>
  46695. </dd>
  46696. <dt><samp>size, s</samp></dt>
  46697. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  46698. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46699. The default value is <code>320x240</code>.
  46700. </p>
  46701. <p>This option is not available with the <code>allrgb</code>, <code>allyuv</code>, and
  46702. <code>haldclutsrc</code> filters.
  46703. </p>
  46704. </dd>
  46705. <dt><samp>rate, r</samp></dt>
  46706. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  46707. generated per second. It has to be a string in the format
  46708. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
  46709. number or a valid video frame rate abbreviation. The default value is
  46710. &quot;25&quot;.
  46711. </p>
  46712. </dd>
  46713. <dt><samp>duration, d</samp></dt>
  46714. <dd><p>Set the duration of the sourced video. See
  46715. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  46716. for the accepted syntax.
  46717. </p>
  46718. <p>If not specified, or the expressed duration is negative, the video is
  46719. supposed to be generated forever.
  46720. </p>
  46721. <p>Since the frame rate is used as time base, all frames including the last one
  46722. will have their full duration. If the specified duration is not a multiple
  46723. of the frame duration, it will be rounded up.
  46724. </p>
  46725. </dd>
  46726. <dt><samp>sar</samp></dt>
  46727. <dd><p>Set the sample aspect ratio of the sourced video.
  46728. </p>
  46729. </dd>
  46730. <dt><samp>alpha</samp></dt>
  46731. <dd><p>Specify the alpha (opacity) of the background, only available in the
  46732. <code>testsrc2</code> source. The value must be between 0 (fully transparent) and
  46733. 255 (fully opaque, the default).
  46734. </p>
  46735. </dd>
  46736. <dt><samp>decimals, n</samp></dt>
  46737. <dd><p>Set the number of decimals to show in the timestamp, only available in the
  46738. <code>testsrc</code> source.
  46739. </p>
  46740. <p>The displayed timestamp value will correspond to the original
  46741. timestamp value multiplied by the power of 10 of the specified
  46742. value. Default value is 0.
  46743. </p></dd>
  46744. </dl>
  46745. <a name="Examples-172"></a>
  46746. <h4 class="subsection">42.9.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-172" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-172" aria-hidden="true">TOC</a></span></h4>
  46747. <ul>
  46748. <li> Generate a video with a duration of 5.3 seconds, with size
  46749. 176x144 and a frame rate of 10 frames per second:
  46750. <div class="example">
  46751. <pre class="example">testsrc=duration=5.3:size=qcif:rate=10
  46752. </pre></div>
  46753. </li><li> The following graph description will generate a red source
  46754. with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
  46755. frames per second:
  46756. <div class="example">
  46757. <pre class="example">color=c=red@0.2:s=qcif:r=10
  46758. </pre></div>
  46759. </li><li> If the input content is to be ignored, <code>nullsrc</code> can be used. The
  46760. following command generates noise in the luminance plane by employing
  46761. the <code>geq</code> filter:
  46762. <div class="example">
  46763. <pre class="example">nullsrc=s=256x256, geq=random(1)*255:128:128
  46764. </pre></div>
  46765. </li></ul>
  46766. <a name="Commands-135"></a>
  46767. <h4 class="subsection">42.9.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-135" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-135" aria-hidden="true">TOC</a></span></h4>
  46768. <p>The <code>color</code> source supports the following commands:
  46769. </p>
  46770. <dl compact="compact">
  46771. <dt><samp>c, color</samp></dt>
  46772. <dd><p>Set the color of the created image. Accepts the same syntax of the
  46773. corresponding <samp>color</samp> option.
  46774. </p></dd>
  46775. </dl>
  46776. <a name="openclsrc"></a>
  46777. <h3 class="section">42.10 openclsrc<span class="pull-right"><a class="anchor hidden-xs" href="#openclsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-openclsrc" aria-hidden="true">TOC</a></span></h3>
  46778. <p>Generate video using an OpenCL program.
  46779. </p>
  46780. <dl compact="compact">
  46781. <dt><samp>source</samp></dt>
  46782. <dd><p>OpenCL program source file.
  46783. </p>
  46784. </dd>
  46785. <dt><samp>kernel</samp></dt>
  46786. <dd><p>Kernel name in program.
  46787. </p>
  46788. </dd>
  46789. <dt><samp>size, s</samp></dt>
  46790. <dd><p>Size of frames to generate. This must be set.
  46791. </p>
  46792. </dd>
  46793. <dt><samp>format</samp></dt>
  46794. <dd><p>Pixel format to use for the generated frames. This must be set.
  46795. </p>
  46796. </dd>
  46797. <dt><samp>rate, r</samp></dt>
  46798. <dd><p>Number of frames generated every second. Default value is &rsquo;25&rsquo;.
  46799. </p>
  46800. </dd>
  46801. </dl>
  46802. <p>For details of how the program loading works, see the <a href="#program_005fopencl">program_opencl</a>
  46803. filter.
  46804. </p>
  46805. <p>Example programs:
  46806. </p>
  46807. <ul>
  46808. <li> Generate a colour ramp by setting pixel values from the position of the pixel
  46809. in the output image. (Note that this will work with all pixel formats, but
  46810. the generated output will not be the same.)
  46811. <pre class="verbatim">__kernel void ramp(__write_only image2d_t dst,
  46812. unsigned int index)
  46813. {
  46814. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  46815. float4 val;
  46816. val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));
  46817. write_imagef(dst, loc, val);
  46818. }
  46819. </pre>
  46820. </li><li> Generate a Sierpinski carpet pattern, panning by a single pixel each frame.
  46821. <pre class="verbatim">__kernel void sierpinski_carpet(__write_only image2d_t dst,
  46822. unsigned int index)
  46823. {
  46824. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  46825. float4 value = 0.0f;
  46826. int x = loc.x + index;
  46827. int y = loc.y + index;
  46828. while (x &gt; 0 || y &gt; 0) {
  46829. if (x % 3 == 1 &amp;&amp; y % 3 == 1) {
  46830. value = 1.0f;
  46831. break;
  46832. }
  46833. x /= 3;
  46834. y /= 3;
  46835. }
  46836. write_imagef(dst, loc, value);
  46837. }
  46838. </pre>
  46839. </li></ul>
  46840. <a name="sierpinski"></a>
  46841. <h3 class="section">42.11 sierpinski<span class="pull-right"><a class="anchor hidden-xs" href="#sierpinski" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sierpinski" aria-hidden="true">TOC</a></span></h3>
  46842. <p>Generate a Sierpinski carpet/triangle fractal, and randomly pan around.
  46843. </p>
  46844. <p>This source accepts the following options:
  46845. </p>
  46846. <dl compact="compact">
  46847. <dt><samp>size, s</samp></dt>
  46848. <dd><p>Set frame size. For the syntax of this option, check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video
  46849. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  46850. </p>
  46851. </dd>
  46852. <dt><samp>rate, r</samp></dt>
  46853. <dd><p>Set frame rate, expressed as number of frames per second. Default
  46854. value is &quot;25&quot;.
  46855. </p>
  46856. </dd>
  46857. <dt><samp>seed</samp></dt>
  46858. <dd><p>Set seed which is used for random panning.
  46859. </p>
  46860. </dd>
  46861. <dt><samp>jump</samp></dt>
  46862. <dd><p>Set max jump for single pan destination. Allowed range is from 1 to 10000.
  46863. </p>
  46864. </dd>
  46865. <dt><samp>type</samp></dt>
  46866. <dd><p>Set fractal type, can be default <code>carpet</code> or <code>triangle</code>.
  46867. </p></dd>
  46868. </dl>
  46869. <a name="Video-Sinks"></a>
  46870. <h2 class="chapter">43 Video Sinks<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Sinks" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Sinks" aria-hidden="true">TOC</a></span></h2>
  46871. <p>Below is a description of the currently available video sinks.
  46872. </p>
  46873. <a name="buffersink"></a>
  46874. <h3 class="section">43.1 buffersink<span class="pull-right"><a class="anchor hidden-xs" href="#buffersink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-buffersink" aria-hidden="true">TOC</a></span></h3>
  46875. <p>Buffer video frames, and make them available to the end of the filter
  46876. graph.
  46877. </p>
  46878. <p>This sink is mainly intended for programmatic use, in particular
  46879. through the interface defined in <samp>libavfilter/buffersink.h</samp>
  46880. or the options system.
  46881. </p>
  46882. <p>It accepts a pointer to an AVBufferSinkContext structure, which
  46883. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  46884. parameter to <code>avfilter_init_filter</code> for initialization.
  46885. </p>
  46886. <a name="nullsink"></a>
  46887. <h3 class="section">43.2 nullsink<span class="pull-right"><a class="anchor hidden-xs" href="#nullsink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nullsink" aria-hidden="true">TOC</a></span></h3>
  46888. <p>Null video sink: do absolutely nothing with the input video. It is
  46889. mainly useful as a template and for use in analysis / debugging
  46890. tools.
  46891. </p>
  46892. <a name="Multimedia-Filters"></a>
  46893. <h2 class="chapter">44 Multimedia Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Multimedia-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Multimedia-Filters" aria-hidden="true">TOC</a></span></h2>
  46894. <p>Below is a description of the currently available multimedia filters.
  46895. </p>
  46896. <a name="abitscope"></a>
  46897. <h3 class="section">44.1 abitscope<span class="pull-right"><a class="anchor hidden-xs" href="#abitscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-abitscope" aria-hidden="true">TOC</a></span></h3>
  46898. <p>Convert input audio to a video output, displaying the audio bit scope.
  46899. </p>
  46900. <p>The filter accepts the following options:
  46901. </p>
  46902. <dl compact="compact">
  46903. <dt><samp>rate, r</samp></dt>
  46904. <dd><p>Set frame rate, expressed as number of frames per second. Default
  46905. value is &quot;25&quot;.
  46906. </p>
  46907. </dd>
  46908. <dt><samp>size, s</samp></dt>
  46909. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  46910. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46911. Default value is <code>1024x256</code>.
  46912. </p>
  46913. </dd>
  46914. <dt><samp>colors</samp></dt>
  46915. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  46916. draw channels. Unrecognized or missing colors will be replaced
  46917. by white color.
  46918. </p></dd>
  46919. </dl>
  46920. <a name="adrawgraph"></a>
  46921. <h3 class="section">44.2 adrawgraph<span class="pull-right"><a class="anchor hidden-xs" href="#adrawgraph" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adrawgraph" aria-hidden="true">TOC</a></span></h3>
  46922. <p>Draw a graph using input audio metadata.
  46923. </p>
  46924. <p>See <a href="#drawgraph">drawgraph</a>
  46925. </p>
  46926. <a name="agraphmonitor"></a>
  46927. <h3 class="section">44.3 agraphmonitor<span class="pull-right"><a class="anchor hidden-xs" href="#agraphmonitor" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-agraphmonitor" aria-hidden="true">TOC</a></span></h3>
  46928. <p>See <a href="#graphmonitor">graphmonitor</a>.
  46929. </p>
  46930. <a name="ahistogram"></a>
  46931. <h3 class="section">44.4 ahistogram<span class="pull-right"><a class="anchor hidden-xs" href="#ahistogram" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ahistogram" aria-hidden="true">TOC</a></span></h3>
  46932. <p>Convert input audio to a video output, displaying the volume histogram.
  46933. </p>
  46934. <p>The filter accepts the following options:
  46935. </p>
  46936. <dl compact="compact">
  46937. <dt><samp>dmode</samp></dt>
  46938. <dd><p>Specify how histogram is calculated.
  46939. </p>
  46940. <p>It accepts the following values:
  46941. </p><dl compact="compact">
  46942. <dt>&lsquo;<samp>single</samp>&rsquo;</dt>
  46943. <dd><p>Use single histogram for all channels.
  46944. </p></dd>
  46945. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  46946. <dd><p>Use separate histogram for each channel.
  46947. </p></dd>
  46948. </dl>
  46949. <p>Default is <code>single</code>.
  46950. </p>
  46951. </dd>
  46952. <dt><samp>rate, r</samp></dt>
  46953. <dd><p>Set frame rate, expressed as number of frames per second. Default
  46954. value is &quot;25&quot;.
  46955. </p>
  46956. </dd>
  46957. <dt><samp>size, s</samp></dt>
  46958. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  46959. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46960. Default value is <code>hd720</code>.
  46961. </p>
  46962. </dd>
  46963. <dt><samp>scale</samp></dt>
  46964. <dd><p>Set display scale.
  46965. </p>
  46966. <p>It accepts the following values:
  46967. </p><dl compact="compact">
  46968. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  46969. <dd><p>logarithmic
  46970. </p></dd>
  46971. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  46972. <dd><p>square root
  46973. </p></dd>
  46974. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  46975. <dd><p>cubic root
  46976. </p></dd>
  46977. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  46978. <dd><p>linear
  46979. </p></dd>
  46980. <dt>&lsquo;<samp>rlog</samp>&rsquo;</dt>
  46981. <dd><p>reverse logarithmic
  46982. </p></dd>
  46983. </dl>
  46984. <p>Default is <code>log</code>.
  46985. </p>
  46986. </dd>
  46987. <dt><samp>ascale</samp></dt>
  46988. <dd><p>Set amplitude scale.
  46989. </p>
  46990. <p>It accepts the following values:
  46991. </p><dl compact="compact">
  46992. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  46993. <dd><p>logarithmic
  46994. </p></dd>
  46995. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  46996. <dd><p>linear
  46997. </p></dd>
  46998. </dl>
  46999. <p>Default is <code>log</code>.
  47000. </p>
  47001. </dd>
  47002. <dt><samp>acount</samp></dt>
  47003. <dd><p>Set how much frames to accumulate in histogram.
  47004. Default is 1. Setting this to -1 accumulates all frames.
  47005. </p>
  47006. </dd>
  47007. <dt><samp>rheight</samp></dt>
  47008. <dd><p>Set histogram ratio of window height.
  47009. </p>
  47010. </dd>
  47011. <dt><samp>slide</samp></dt>
  47012. <dd><p>Set sonogram sliding.
  47013. </p>
  47014. <p>It accepts the following values:
  47015. </p><dl compact="compact">
  47016. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  47017. <dd><p>replace old rows with new ones.
  47018. </p></dd>
  47019. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  47020. <dd><p>scroll from top to bottom.
  47021. </p></dd>
  47022. </dl>
  47023. <p>Default is <code>replace</code>.
  47024. </p></dd>
  47025. </dl>
  47026. <a name="aphasemeter"></a>
  47027. <h3 class="section">44.5 aphasemeter<span class="pull-right"><a class="anchor hidden-xs" href="#aphasemeter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aphasemeter" aria-hidden="true">TOC</a></span></h3>
  47028. <p>Measures phase of input audio, which is exported as metadata <code>lavfi.aphasemeter.phase</code>,
  47029. representing mean phase of current audio frame. A video output can also be produced and is
  47030. enabled by default. The audio is passed through as first output.
  47031. </p>
  47032. <p>Audio will be rematrixed to stereo if it has a different channel layout. Phase value is in
  47033. range <code>[-1, 1]</code> where <code>-1</code> means left and right channels are completely out of phase
  47034. and <code>1</code> means channels are in phase.
  47035. </p>
  47036. <p>The filter accepts the following options, all related to its video output:
  47037. </p>
  47038. <dl compact="compact">
  47039. <dt><samp>rate, r</samp></dt>
  47040. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  47041. </p>
  47042. </dd>
  47043. <dt><samp>size, s</samp></dt>
  47044. <dd><p>Set the video size for the output. For the syntax of this option, check the
  47045. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  47046. Default value is <code>800x400</code>.
  47047. </p>
  47048. </dd>
  47049. <dt><samp>rc</samp></dt>
  47050. <dt><samp>gc</samp></dt>
  47051. <dt><samp>bc</samp></dt>
  47052. <dd><p>Specify the red, green, blue contrast. Default values are <code>2</code>,
  47053. <code>7</code> and <code>1</code>.
  47054. Allowed range is <code>[0, 255]</code>.
  47055. </p>
  47056. </dd>
  47057. <dt><samp>mpc</samp></dt>
  47058. <dd><p>Set color which will be used for drawing median phase. If color is
  47059. <code>none</code> which is default, no median phase value will be drawn.
  47060. </p>
  47061. </dd>
  47062. <dt><samp>video</samp></dt>
  47063. <dd><p>Enable video output. Default is enabled.
  47064. </p></dd>
  47065. </dl>
  47066. <a name="phasing-detection"></a>
  47067. <h4 class="subsection">44.5.1 phasing detection<span class="pull-right"><a class="anchor hidden-xs" href="#phasing-detection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-phasing-detection" aria-hidden="true">TOC</a></span></h4>
  47068. <p>The filter also detects out of phase and mono sequences in stereo streams.
  47069. It logs the sequence start, end and duration when it lasts longer or as long as the minimum set.
  47070. </p>
  47071. <p>The filter accepts the following options for this detection:
  47072. </p>
  47073. <dl compact="compact">
  47074. <dt><samp>phasing</samp></dt>
  47075. <dd><p>Enable mono and out of phase detection. Default is disabled.
  47076. </p>
  47077. </dd>
  47078. <dt><samp>tolerance, t</samp></dt>
  47079. <dd><p>Set phase tolerance for mono detection, in amplitude ratio. Default is <code>0</code>.
  47080. Allowed range is <code>[0, 1]</code>.
  47081. </p>
  47082. </dd>
  47083. <dt><samp>angle, a</samp></dt>
  47084. <dd><p>Set angle threshold for out of phase detection, in degree. Default is <code>170</code>.
  47085. Allowed range is <code>[90, 180]</code>.
  47086. </p>
  47087. </dd>
  47088. <dt><samp>duration, d</samp></dt>
  47089. <dd><p>Set mono or out of phase duration until notification, expressed in seconds. Default is <code>2</code>.
  47090. </p></dd>
  47091. </dl>
  47092. <a name="Examples-173"></a>
  47093. <h4 class="subsection">44.5.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-173" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-173" aria-hidden="true">TOC</a></span></h4>
  47094. <ul>
  47095. <li> Complete example with <code>ffmpeg</code> to detect 1 second of mono with 0.001 phase tolerance:
  47096. <div class="example">
  47097. <pre class="example">ffmpeg -i stereo.wav -af aphasemeter=video=0:phasing=1:duration=1:tolerance=0.001 -f null -
  47098. </pre></div>
  47099. </li></ul>
  47100. <a name="avectorscope"></a>
  47101. <h3 class="section">44.6 avectorscope<span class="pull-right"><a class="anchor hidden-xs" href="#avectorscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avectorscope" aria-hidden="true">TOC</a></span></h3>
  47102. <p>Convert input audio to a video output, representing the audio vector
  47103. scope.
  47104. </p>
  47105. <p>The filter is used to measure the difference between channels of stereo
  47106. audio stream. A monaural signal, consisting of identical left and right
  47107. signal, results in straight vertical line. Any stereo separation is visible
  47108. as a deviation from this line, creating a Lissajous figure.
  47109. If the straight (or deviation from it) but horizontal line appears this
  47110. indicates that the left and right channels are out of phase.
  47111. </p>
  47112. <p>The filter accepts the following options:
  47113. </p>
  47114. <dl compact="compact">
  47115. <dt><samp>mode, m</samp></dt>
  47116. <dd><p>Set the vectorscope mode.
  47117. </p>
  47118. <p>Available values are:
  47119. </p><dl compact="compact">
  47120. <dt>&lsquo;<samp>lissajous</samp>&rsquo;</dt>
  47121. <dd><p>Lissajous rotated by 45 degrees.
  47122. </p>
  47123. </dd>
  47124. <dt>&lsquo;<samp>lissajous_xy</samp>&rsquo;</dt>
  47125. <dd><p>Same as above but not rotated.
  47126. </p>
  47127. </dd>
  47128. <dt>&lsquo;<samp>polar</samp>&rsquo;</dt>
  47129. <dd><p>Shape resembling half of circle.
  47130. </p></dd>
  47131. </dl>
  47132. <p>Default value is &lsquo;<samp>lissajous</samp>&rsquo;.
  47133. </p>
  47134. </dd>
  47135. <dt><samp>size, s</samp></dt>
  47136. <dd><p>Set the video size for the output. For the syntax of this option, check the
  47137. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  47138. Default value is <code>400x400</code>.
  47139. </p>
  47140. </dd>
  47141. <dt><samp>rate, r</samp></dt>
  47142. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  47143. </p>
  47144. </dd>
  47145. <dt><samp>rc</samp></dt>
  47146. <dt><samp>gc</samp></dt>
  47147. <dt><samp>bc</samp></dt>
  47148. <dt><samp>ac</samp></dt>
  47149. <dd><p>Specify the red, green, blue and alpha contrast. Default values are <code>40</code>,
  47150. <code>160</code>, <code>80</code> and <code>255</code>.
  47151. Allowed range is <code>[0, 255]</code>.
  47152. </p>
  47153. </dd>
  47154. <dt><samp>rf</samp></dt>
  47155. <dt><samp>gf</samp></dt>
  47156. <dt><samp>bf</samp></dt>
  47157. <dt><samp>af</samp></dt>
  47158. <dd><p>Specify the red, green, blue and alpha fade. Default values are <code>15</code>,
  47159. <code>10</code>, <code>5</code> and <code>5</code>.
  47160. Allowed range is <code>[0, 255]</code>.
  47161. </p>
  47162. </dd>
  47163. <dt><samp>zoom</samp></dt>
  47164. <dd><p>Set the zoom factor. Default value is <code>1</code>. Allowed range is <code>[0, 10]</code>.
  47165. Values lower than <var>1</var> will auto adjust zoom factor to maximal possible value.
  47166. </p>
  47167. </dd>
  47168. <dt><samp>draw</samp></dt>
  47169. <dd><p>Set the vectorscope drawing mode.
  47170. </p>
  47171. <p>Available values are:
  47172. </p><dl compact="compact">
  47173. <dt>&lsquo;<samp>dot</samp>&rsquo;</dt>
  47174. <dd><p>Draw dot for each sample.
  47175. </p>
  47176. </dd>
  47177. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  47178. <dd><p>Draw line between previous and current sample.
  47179. </p></dd>
  47180. </dl>
  47181. <p>Default value is &lsquo;<samp>dot</samp>&rsquo;.
  47182. </p>
  47183. </dd>
  47184. <dt><samp>scale</samp></dt>
  47185. <dd><p>Specify amplitude scale of audio samples.
  47186. </p>
  47187. <p>Available values are:
  47188. </p><dl compact="compact">
  47189. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  47190. <dd><p>Linear.
  47191. </p>
  47192. </dd>
  47193. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  47194. <dd><p>Square root.
  47195. </p>
  47196. </dd>
  47197. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  47198. <dd><p>Cubic root.
  47199. </p>
  47200. </dd>
  47201. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  47202. <dd><p>Logarithmic.
  47203. </p></dd>
  47204. </dl>
  47205. </dd>
  47206. <dt><samp>swap</samp></dt>
  47207. <dd><p>Swap left channel axis with right channel axis.
  47208. </p>
  47209. </dd>
  47210. <dt><samp>mirror</samp></dt>
  47211. <dd><p>Mirror axis.
  47212. </p>
  47213. <dl compact="compact">
  47214. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  47215. <dd><p>No mirror.
  47216. </p>
  47217. </dd>
  47218. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  47219. <dd><p>Mirror only x axis.
  47220. </p>
  47221. </dd>
  47222. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  47223. <dd><p>Mirror only y axis.
  47224. </p>
  47225. </dd>
  47226. <dt>&lsquo;<samp>xy</samp>&rsquo;</dt>
  47227. <dd><p>Mirror both axis.
  47228. </p></dd>
  47229. </dl>
  47230. </dd>
  47231. </dl>
  47232. <a name="Examples-174"></a>
  47233. <h4 class="subsection">44.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-174" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-174" aria-hidden="true">TOC</a></span></h4>
  47234. <ul>
  47235. <li> Complete example using <code>ffplay</code>:
  47236. <div class="example">
  47237. <pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  47238. [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
  47239. </pre></div>
  47240. </li></ul>
  47241. <a name="bench_002c-abench"></a>
  47242. <h3 class="section">44.7 bench, abench<span class="pull-right"><a class="anchor hidden-xs" href="#bench_002c-abench" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bench_002c-abench" aria-hidden="true">TOC</a></span></h3>
  47243. <p>Benchmark part of a filtergraph.
  47244. </p>
  47245. <p>The filter accepts the following options:
  47246. </p>
  47247. <dl compact="compact">
  47248. <dt><samp>action</samp></dt>
  47249. <dd><p>Start or stop a timer.
  47250. </p>
  47251. <p>Available values are:
  47252. </p><dl compact="compact">
  47253. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  47254. <dd><p>Get the current time, set it as frame metadata (using the key
  47255. <code>lavfi.bench.start_time</code>), and forward the frame to the next filter.
  47256. </p>
  47257. </dd>
  47258. <dt>&lsquo;<samp>stop</samp>&rsquo;</dt>
  47259. <dd><p>Get the current time and fetch the <code>lavfi.bench.start_time</code> metadata from
  47260. the input frame metadata to get the time difference. Time difference, average,
  47261. maximum and minimum time (respectively <code>t</code>, <code>avg</code>, <code>max</code> and
  47262. <code>min</code>) are then printed. The timestamps are expressed in seconds.
  47263. </p></dd>
  47264. </dl>
  47265. </dd>
  47266. </dl>
  47267. <a name="Examples-175"></a>
  47268. <h4 class="subsection">44.7.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-175" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-175" aria-hidden="true">TOC</a></span></h4>
  47269. <ul>
  47270. <li> Benchmark <a href="#selectivecolor">selectivecolor</a> filter:
  47271. <div class="example">
  47272. <pre class="example">bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
  47273. </pre></div>
  47274. </li></ul>
  47275. <a name="concat-3"></a>
  47276. <h3 class="section">44.8 concat<span class="pull-right"><a class="anchor hidden-xs" href="#concat-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concat-3" aria-hidden="true">TOC</a></span></h3>
  47277. <p>Concatenate audio and video streams, joining them together one after the
  47278. other.
  47279. </p>
  47280. <p>The filter works on segments of synchronized video and audio streams. All
  47281. segments must have the same number of streams of each type, and that will
  47282. also be the number of streams at output.
  47283. </p>
  47284. <p>The filter accepts the following options:
  47285. </p>
  47286. <dl compact="compact">
  47287. <dt><samp>n</samp></dt>
  47288. <dd><p>Set the number of segments. Default is 2.
  47289. </p>
  47290. </dd>
  47291. <dt><samp>v</samp></dt>
  47292. <dd><p>Set the number of output video streams, that is also the number of video
  47293. streams in each segment. Default is 1.
  47294. </p>
  47295. </dd>
  47296. <dt><samp>a</samp></dt>
  47297. <dd><p>Set the number of output audio streams, that is also the number of audio
  47298. streams in each segment. Default is 0.
  47299. </p>
  47300. </dd>
  47301. <dt><samp>unsafe</samp></dt>
  47302. <dd><p>Activate unsafe mode: do not fail if segments have a different format.
  47303. </p>
  47304. </dd>
  47305. </dl>
  47306. <p>The filter has <var>v</var>+<var>a</var> outputs: first <var>v</var> video outputs, then
  47307. <var>a</var> audio outputs.
  47308. </p>
  47309. <p>There are <var>n</var>x(<var>v</var>+<var>a</var>) inputs: first the inputs for the first
  47310. segment, in the same order as the outputs, then the inputs for the second
  47311. segment, etc.
  47312. </p>
  47313. <p>Related streams do not always have exactly the same duration, for various
  47314. reasons including codec frame size or sloppy authoring. For that reason,
  47315. related synchronized streams (e.g. a video and its audio track) should be
  47316. concatenated at once. The concat filter will use the duration of the longest
  47317. stream in each segment (except the last one), and if necessary pad shorter
  47318. audio streams with silence.
  47319. </p>
  47320. <p>For this filter to work correctly, all segments must start at timestamp 0.
  47321. </p>
  47322. <p>All corresponding streams must have the same parameters in all segments; the
  47323. filtering system will automatically select a common pixel format for video
  47324. streams, and a common sample format, sample rate and channel layout for
  47325. audio streams, but other settings, such as resolution, must be converted
  47326. explicitly by the user.
  47327. </p>
  47328. <p>Different frame rates are acceptable but will result in variable frame rate
  47329. at output; be sure to configure the output file to handle it.
  47330. </p>
  47331. <a name="Examples-176"></a>
  47332. <h4 class="subsection">44.8.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-176" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-176" aria-hidden="true">TOC</a></span></h4>
  47333. <ul>
  47334. <li> Concatenate an opening, an episode and an ending, all in bilingual version
  47335. (video in stream 0, audio in streams 1 and 2):
  47336. <div class="example">
  47337. <pre class="example">ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
  47338. '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
  47339. concat=n=3:v=1:a=2 [v] [a1] [a2]' \
  47340. -map '[v]' -map '[a1]' -map '[a2]' output.mkv
  47341. </pre></div>
  47342. </li><li> Concatenate two parts, handling audio and video separately, using the
  47343. (a)movie sources, and adjusting the resolution:
  47344. <div class="example">
  47345. <pre class="example">movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
  47346. movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
  47347. [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
  47348. </pre></div>
  47349. <p>Note that a desync will happen at the stitch if the audio and video streams
  47350. do not have exactly the same duration in the first file.
  47351. </p>
  47352. </li></ul>
  47353. <a name="Commands-136"></a>
  47354. <h4 class="subsection">44.8.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-136" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-136" aria-hidden="true">TOC</a></span></h4>
  47355. <p>This filter supports the following commands:
  47356. </p><dl compact="compact">
  47357. <dt><samp>next</samp></dt>
  47358. <dd><p>Close the current segment and step to the next one
  47359. </p></dd>
  47360. </dl>
  47361. <span id="ebur128"></span><a name="ebur128-1"></a>
  47362. <h3 class="section">44.9 ebur128<span class="pull-right"><a class="anchor hidden-xs" href="#ebur128-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ebur128-1" aria-hidden="true">TOC</a></span></h3>
  47363. <p>EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness
  47364. level. By default, it logs a message at a frequency of 10Hz with the
  47365. Momentary loudness (identified by <code>M</code>), Short-term loudness (<code>S</code>),
  47366. Integrated loudness (<code>I</code>) and Loudness Range (<code>LRA</code>).
  47367. </p>
  47368. <p>The filter can only analyze streams which have a sampling rate of 48000 Hz and whose
  47369. sample format is double-precision floating point. The input stream will be converted to
  47370. this specification, if needed. Users may need to insert aformat and/or aresample filters
  47371. after this filter to obtain the original parameters.
  47372. </p>
  47373. <p>The filter also has a video output (see the <var>video</var> option) with a real
  47374. time graph to observe the loudness evolution. The graphic contains the logged
  47375. message mentioned above, so it is not printed anymore when this option is set,
  47376. unless the verbose logging is set. The main graphing area contains the
  47377. short-term loudness (3 seconds of analysis), and the gauge on the right is for
  47378. the momentary loudness (400 milliseconds), but can optionally be configured
  47379. to instead display short-term loudness (see <var>gauge</var>).
  47380. </p>
  47381. <p>The green area marks a +/- 1LU target range around the target loudness
  47382. (-23LUFS by default, unless modified through <var>target</var>).
  47383. </p>
  47384. <p>More information about the Loudness Recommendation EBU R128 on
  47385. <a href="http://tech.ebu.ch/loudness">http://tech.ebu.ch/loudness</a>.
  47386. </p>
  47387. <p>The filter accepts the following options:
  47388. </p>
  47389. <dl compact="compact">
  47390. <dt><samp>video</samp></dt>
  47391. <dd><p>Activate the video output. The audio stream is passed unchanged whether this
  47392. option is set or no. The video stream will be the first output stream if
  47393. activated. Default is <code>0</code>.
  47394. </p>
  47395. </dd>
  47396. <dt><samp>size</samp></dt>
  47397. <dd><p>Set the video size. This option is for video only. For the syntax of this
  47398. option, check the
  47399. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  47400. Default and minimum resolution is <code>640x480</code>.
  47401. </p>
  47402. </dd>
  47403. <dt><samp>meter</samp></dt>
  47404. <dd><p>Set the EBU scale meter. Default is <code>9</code>. Common values are <code>9</code> and
  47405. <code>18</code>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
  47406. other integer value between this range is allowed.
  47407. </p>
  47408. </dd>
  47409. <dt><samp>metadata</samp></dt>
  47410. <dd><p>Set metadata injection. If set to <code>1</code>, the audio input will be segmented
  47411. into 100ms output frames, each of them containing various loudness information
  47412. in metadata. All the metadata keys are prefixed with <code>lavfi.r128.</code>.
  47413. </p>
  47414. <p>Default is <code>0</code>.
  47415. </p>
  47416. </dd>
  47417. <dt><samp>framelog</samp></dt>
  47418. <dd><p>Force the frame logging level.
  47419. </p>
  47420. <p>Available values are:
  47421. </p><dl compact="compact">
  47422. <dt>&lsquo;<samp>info</samp>&rsquo;</dt>
  47423. <dd><p>information logging level
  47424. </p></dd>
  47425. <dt>&lsquo;<samp>verbose</samp>&rsquo;</dt>
  47426. <dd><p>verbose logging level
  47427. </p></dd>
  47428. </dl>
  47429. <p>By default, the logging level is set to <var>info</var>. If the <samp>video</samp> or
  47430. the <samp>metadata</samp> options are set, it switches to <var>verbose</var>.
  47431. </p>
  47432. </dd>
  47433. <dt><samp>peak</samp></dt>
  47434. <dd><p>Set peak mode(s).
  47435. </p>
  47436. <p>Available modes can be cumulated (the option is a <code>flag</code> type). Possible
  47437. values are:
  47438. </p><dl compact="compact">
  47439. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  47440. <dd><p>Disable any peak mode (default).
  47441. </p></dd>
  47442. <dt>&lsquo;<samp>sample</samp>&rsquo;</dt>
  47443. <dd><p>Enable sample-peak mode.
  47444. </p>
  47445. <p>Simple peak mode looking for the higher sample value. It logs a message
  47446. for sample-peak (identified by <code>SPK</code>).
  47447. </p></dd>
  47448. <dt>&lsquo;<samp>true</samp>&rsquo;</dt>
  47449. <dd><p>Enable true-peak mode.
  47450. </p>
  47451. <p>If enabled, the peak lookup is done on an over-sampled version of the input
  47452. stream for better peak accuracy. It logs a message for true-peak.
  47453. (identified by <code>TPK</code>) and true-peak per frame (identified by <code>FTPK</code>).
  47454. This mode requires a build with <code>libswresample</code>.
  47455. </p></dd>
  47456. </dl>
  47457. </dd>
  47458. <dt><samp>dualmono</samp></dt>
  47459. <dd><p>Treat mono input files as &quot;dual mono&quot;. If a mono file is intended for playback
  47460. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  47461. If set to <code>true</code>, this option will compensate for this effect.
  47462. Multi-channel input files are not affected by this option.
  47463. </p>
  47464. </dd>
  47465. <dt><samp>panlaw</samp></dt>
  47466. <dd><p>Set a specific pan law to be used for the measurement of dual mono files.
  47467. This parameter is optional, and has a default value of -3.01dB.
  47468. </p>
  47469. </dd>
  47470. <dt><samp>target</samp></dt>
  47471. <dd><p>Set a specific target level (in LUFS) used as relative zero in the visualization.
  47472. This parameter is optional and has a default value of -23LUFS as specified
  47473. by EBU R128. However, material published online may prefer a level of -16LUFS
  47474. (e.g. for use with podcasts or video platforms).
  47475. </p>
  47476. </dd>
  47477. <dt><samp>gauge</samp></dt>
  47478. <dd><p>Set the value displayed by the gauge. Valid values are <code>momentary</code> and s
  47479. <code>shortterm</code>. By default the momentary value will be used, but in certain
  47480. scenarios it may be more useful to observe the short term value instead (e.g.
  47481. live mixing).
  47482. </p>
  47483. </dd>
  47484. <dt><samp>scale</samp></dt>
  47485. <dd><p>Sets the display scale for the loudness. Valid parameters are <code>absolute</code>
  47486. (in LUFS) or <code>relative</code> (LU) relative to the target. This only affects the
  47487. video output, not the summary or continuous log output.
  47488. </p></dd>
  47489. </dl>
  47490. <a name="Examples-177"></a>
  47491. <h4 class="subsection">44.9.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-177" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-177" aria-hidden="true">TOC</a></span></h4>
  47492. <ul>
  47493. <li> Real-time graph using <code>ffplay</code>, with a EBU scale meter +18:
  47494. <div class="example">
  47495. <pre class="example">ffplay -f lavfi -i &quot;amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]&quot;
  47496. </pre></div>
  47497. </li><li> Run an analysis with <code>ffmpeg</code>:
  47498. <div class="example">
  47499. <pre class="example">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
  47500. </pre></div>
  47501. </li></ul>
  47502. <a name="interleave_002c-ainterleave"></a>
  47503. <h3 class="section">44.10 interleave, ainterleave<span class="pull-right"><a class="anchor hidden-xs" href="#interleave_002c-ainterleave" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-interleave_002c-ainterleave" aria-hidden="true">TOC</a></span></h3>
  47504. <p>Temporally interleave frames from several inputs.
  47505. </p>
  47506. <p><code>interleave</code> works with video inputs, <code>ainterleave</code> with audio.
  47507. </p>
  47508. <p>These filters read frames from several inputs and send the oldest
  47509. queued frame to the output.
  47510. </p>
  47511. <p>Input streams must have well defined, monotonically increasing frame
  47512. timestamp values.
  47513. </p>
  47514. <p>In order to submit one frame to output, these filters need to enqueue
  47515. at least one frame for each input, so they cannot work in case one
  47516. input is not yet terminated and will not receive incoming frames.
  47517. </p>
  47518. <p>For example consider the case when one input is a <code>select</code> filter
  47519. which always drops input frames. The <code>interleave</code> filter will keep
  47520. reading from that input, but it will never be able to send new frames
  47521. to output until the input sends an end-of-stream signal.
  47522. </p>
  47523. <p>Also, depending on inputs synchronization, the filters will drop
  47524. frames in case one input receives more frames than the other ones, and
  47525. the queue is already filled.
  47526. </p>
  47527. <p>These filters accept the following options:
  47528. </p>
  47529. <dl compact="compact">
  47530. <dt><samp>nb_inputs, n</samp></dt>
  47531. <dd><p>Set the number of different inputs, it is 2 by default.
  47532. </p>
  47533. </dd>
  47534. <dt><samp>duration</samp></dt>
  47535. <dd><p>How to determine the end-of-stream.
  47536. </p>
  47537. <dl compact="compact">
  47538. <dt><samp>longest</samp></dt>
  47539. <dd><p>The duration of the longest input. (default)
  47540. </p>
  47541. </dd>
  47542. <dt><samp>shortest</samp></dt>
  47543. <dd><p>The duration of the shortest input.
  47544. </p>
  47545. </dd>
  47546. <dt><samp>first</samp></dt>
  47547. <dd><p>The duration of the first input.
  47548. </p></dd>
  47549. </dl>
  47550. </dd>
  47551. </dl>
  47552. <a name="Examples-178"></a>
  47553. <h4 class="subsection">44.10.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-178" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-178" aria-hidden="true">TOC</a></span></h4>
  47554. <ul>
  47555. <li> Interleave frames belonging to different streams using <code>ffmpeg</code>:
  47556. <div class="example">
  47557. <pre class="example">ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex &quot;[0:v][1:v] interleave&quot; out.avi
  47558. </pre></div>
  47559. </li><li> Add flickering blur effect:
  47560. <div class="example">
  47561. <pre class="example">select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
  47562. </pre></div>
  47563. </li></ul>
  47564. <a name="metadata_002c-ametadata"></a>
  47565. <h3 class="section">44.11 metadata, ametadata<span class="pull-right"><a class="anchor hidden-xs" href="#metadata_002c-ametadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-metadata_002c-ametadata" aria-hidden="true">TOC</a></span></h3>
  47566. <p>Manipulate frame metadata.
  47567. </p>
  47568. <p>This filter accepts the following options:
  47569. </p>
  47570. <dl compact="compact">
  47571. <dt><samp>mode</samp></dt>
  47572. <dd><p>Set mode of operation of the filter.
  47573. </p>
  47574. <p>Can be one of the following:
  47575. </p>
  47576. <dl compact="compact">
  47577. <dt>&lsquo;<samp>select</samp>&rsquo;</dt>
  47578. <dd><p>If both <code>value</code> and <code>key</code> is set, select frames
  47579. which have such metadata. If only <code>key</code> is set, select
  47580. every frame that has such key in metadata.
  47581. </p>
  47582. </dd>
  47583. <dt>&lsquo;<samp>add</samp>&rsquo;</dt>
  47584. <dd><p>Add new metadata <code>key</code> and <code>value</code>. If key is already available
  47585. do nothing.
  47586. </p>
  47587. </dd>
  47588. <dt>&lsquo;<samp>modify</samp>&rsquo;</dt>
  47589. <dd><p>Modify value of already present key.
  47590. </p>
  47591. </dd>
  47592. <dt>&lsquo;<samp>delete</samp>&rsquo;</dt>
  47593. <dd><p>If <code>value</code> is set, delete only keys that have such value.
  47594. Otherwise, delete key. If <code>key</code> is not set, delete all metadata values in
  47595. the frame.
  47596. </p>
  47597. </dd>
  47598. <dt>&lsquo;<samp>print</samp>&rsquo;</dt>
  47599. <dd><p>Print key and its value if metadata was found. If <code>key</code> is not set print all
  47600. metadata values available in frame.
  47601. </p></dd>
  47602. </dl>
  47603. </dd>
  47604. <dt><samp>key</samp></dt>
  47605. <dd><p>Set key used with all modes. Must be set for all modes except <code>print</code> and <code>delete</code>.
  47606. </p>
  47607. </dd>
  47608. <dt><samp>value</samp></dt>
  47609. <dd><p>Set metadata value which will be used. This option is mandatory for
  47610. <code>modify</code> and <code>add</code> mode.
  47611. </p>
  47612. </dd>
  47613. <dt><samp>function</samp></dt>
  47614. <dd><p>Which function to use when comparing metadata value and <code>value</code>.
  47615. </p>
  47616. <p>Can be one of following:
  47617. </p>
  47618. <dl compact="compact">
  47619. <dt>&lsquo;<samp>same_str</samp>&rsquo;</dt>
  47620. <dd><p>Values are interpreted as strings, returns true if metadata value is same as <code>value</code>.
  47621. </p>
  47622. </dd>
  47623. <dt>&lsquo;<samp>starts_with</samp>&rsquo;</dt>
  47624. <dd><p>Values are interpreted as strings, returns true if metadata value starts with
  47625. the <code>value</code> option string.
  47626. </p>
  47627. </dd>
  47628. <dt>&lsquo;<samp>less</samp>&rsquo;</dt>
  47629. <dd><p>Values are interpreted as floats, returns true if metadata value is less than <code>value</code>.
  47630. </p>
  47631. </dd>
  47632. <dt>&lsquo;<samp>equal</samp>&rsquo;</dt>
  47633. <dd><p>Values are interpreted as floats, returns true if <code>value</code> is equal with metadata value.
  47634. </p>
  47635. </dd>
  47636. <dt>&lsquo;<samp>greater</samp>&rsquo;</dt>
  47637. <dd><p>Values are interpreted as floats, returns true if metadata value is greater than <code>value</code>.
  47638. </p>
  47639. </dd>
  47640. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  47641. <dd><p>Values are interpreted as floats, returns true if expression from option <code>expr</code>
  47642. evaluates to true.
  47643. </p>
  47644. </dd>
  47645. <dt>&lsquo;<samp>ends_with</samp>&rsquo;</dt>
  47646. <dd><p>Values are interpreted as strings, returns true if metadata value ends with
  47647. the <code>value</code> option string.
  47648. </p></dd>
  47649. </dl>
  47650. </dd>
  47651. <dt><samp>expr</samp></dt>
  47652. <dd><p>Set expression which is used when <code>function</code> is set to <code>expr</code>.
  47653. The expression is evaluated through the eval API and can contain the following
  47654. constants:
  47655. </p>
  47656. <dl compact="compact">
  47657. <dt><samp>VALUE1</samp></dt>
  47658. <dd><p>Float representation of <code>value</code> from metadata key.
  47659. </p>
  47660. </dd>
  47661. <dt><samp>VALUE2</samp></dt>
  47662. <dd><p>Float representation of <code>value</code> as supplied by user in <code>value</code> option.
  47663. </p></dd>
  47664. </dl>
  47665. </dd>
  47666. <dt><samp>file</samp></dt>
  47667. <dd><p>If specified in <code>print</code> mode, output is written to the named file. Instead of
  47668. plain filename any writable url can be specified. Filename &ldquo;-&rdquo; is a shorthand
  47669. for standard output. If <code>file</code> option is not set, output is written to the log
  47670. with AV_LOG_INFO loglevel.
  47671. </p>
  47672. </dd>
  47673. <dt><samp>direct</samp></dt>
  47674. <dd><p>Reduces buffering in print mode when output is written to a URL set using <var>file</var>.
  47675. </p>
  47676. </dd>
  47677. </dl>
  47678. <a name="Examples-179"></a>
  47679. <h4 class="subsection">44.11.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-179" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-179" aria-hidden="true">TOC</a></span></h4>
  47680. <ul>
  47681. <li> Print all metadata values for frames with key <code>lavfi.signalstats.YDIF</code> with values
  47682. between 0 and 1.
  47683. <div class="example">
  47684. <pre class="example">signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
  47685. </pre></div>
  47686. </li><li> Print silencedetect output to file <samp>metadata.txt</samp>.
  47687. <div class="example">
  47688. <pre class="example">silencedetect,ametadata=mode=print:file=metadata.txt
  47689. </pre></div>
  47690. </li><li> Direct all metadata to a pipe with file descriptor 4.
  47691. <div class="example">
  47692. <pre class="example">metadata=mode=print:file='pipe\:4'
  47693. </pre></div>
  47694. </li></ul>
  47695. <a name="perms_002c-aperms"></a>
  47696. <h3 class="section">44.12 perms, aperms<span class="pull-right"><a class="anchor hidden-xs" href="#perms_002c-aperms" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-perms_002c-aperms" aria-hidden="true">TOC</a></span></h3>
  47697. <p>Set read/write permissions for the output frames.
  47698. </p>
  47699. <p>These filters are mainly aimed at developers to test direct path in the
  47700. following filter in the filtergraph.
  47701. </p>
  47702. <p>The filters accept the following options:
  47703. </p>
  47704. <dl compact="compact">
  47705. <dt><samp>mode</samp></dt>
  47706. <dd><p>Select the permissions mode.
  47707. </p>
  47708. <p>It accepts the following values:
  47709. </p><dl compact="compact">
  47710. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  47711. <dd><p>Do nothing. This is the default.
  47712. </p></dd>
  47713. <dt>&lsquo;<samp>ro</samp>&rsquo;</dt>
  47714. <dd><p>Set all the output frames read-only.
  47715. </p></dd>
  47716. <dt>&lsquo;<samp>rw</samp>&rsquo;</dt>
  47717. <dd><p>Set all the output frames directly writable.
  47718. </p></dd>
  47719. <dt>&lsquo;<samp>toggle</samp>&rsquo;</dt>
  47720. <dd><p>Make the frame read-only if writable, and writable if read-only.
  47721. </p></dd>
  47722. <dt>&lsquo;<samp>random</samp>&rsquo;</dt>
  47723. <dd><p>Set each output frame read-only or writable randomly.
  47724. </p></dd>
  47725. </dl>
  47726. </dd>
  47727. <dt><samp>seed</samp></dt>
  47728. <dd><p>Set the seed for the <var>random</var> mode, must be an integer included between
  47729. <code>0</code> and <code>UINT32_MAX</code>. If not specified, or if explicitly set to
  47730. <code>-1</code>, the filter will try to use a good random seed on a best effort
  47731. basis.
  47732. </p></dd>
  47733. </dl>
  47734. <p>Note: in case of auto-inserted filter between the permission filter and the
  47735. following one, the permission might not be received as expected in that
  47736. following filter. Inserting a <a href="#format">format</a> or <a href="#aformat">aformat</a> filter before the
  47737. perms/aperms filter can avoid this problem.
  47738. </p>
  47739. <a name="realtime_002c-arealtime"></a>
  47740. <h3 class="section">44.13 realtime, arealtime<span class="pull-right"><a class="anchor hidden-xs" href="#realtime_002c-arealtime" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-realtime_002c-arealtime" aria-hidden="true">TOC</a></span></h3>
  47741. <p>Slow down filtering to match real time approximately.
  47742. </p>
  47743. <p>These filters will pause the filtering for a variable amount of time to
  47744. match the output rate with the input timestamps.
  47745. They are similar to the <samp>re</samp> option to <code>ffmpeg</code>.
  47746. </p>
  47747. <p>They accept the following options:
  47748. </p>
  47749. <dl compact="compact">
  47750. <dt><samp>limit</samp></dt>
  47751. <dd><p>Time limit for the pauses. Any pause longer than that will be considered
  47752. a timestamp discontinuity and reset the timer. Default is 2 seconds.
  47753. </p></dd>
  47754. <dt><samp>speed</samp></dt>
  47755. <dd><p>Speed factor for processing. The value must be a float larger than zero.
  47756. Values larger than 1.0 will result in faster than realtime processing,
  47757. smaller will slow processing down. The <var>limit</var> is automatically adapted
  47758. accordingly. Default is 1.0.
  47759. </p>
  47760. <p>A processing speed faster than what is possible without these filters cannot
  47761. be achieved.
  47762. </p></dd>
  47763. </dl>
  47764. <span id="select"></span><a name="select_002c-aselect"></a>
  47765. <h3 class="section">44.14 select, aselect<span class="pull-right"><a class="anchor hidden-xs" href="#select_002c-aselect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-select_002c-aselect" aria-hidden="true">TOC</a></span></h3>
  47766. <p>Select frames to pass in output.
  47767. </p>
  47768. <p>This filter accepts the following options:
  47769. </p>
  47770. <dl compact="compact">
  47771. <dt><samp>expr, e</samp></dt>
  47772. <dd><p>Set expression, which is evaluated for each input frame.
  47773. </p>
  47774. <p>If the expression is evaluated to zero, the frame is discarded.
  47775. </p>
  47776. <p>If the evaluation result is negative or NaN, the frame is sent to the
  47777. first output; otherwise it is sent to the output with index
  47778. <code>ceil(val)-1</code>, assuming that the input index starts from 0.
  47779. </p>
  47780. <p>For example a value of <code>1.2</code> corresponds to the output with index
  47781. <code>ceil(1.2)-1 = 2-1 = 1</code>, that is the second output.
  47782. </p>
  47783. </dd>
  47784. <dt><samp>outputs, n</samp></dt>
  47785. <dd><p>Set the number of outputs. The output to which to send the selected
  47786. frame is based on the result of the evaluation. Default value is 1.
  47787. </p></dd>
  47788. </dl>
  47789. <p>The expression can contain the following constants:
  47790. </p>
  47791. <dl compact="compact">
  47792. <dt><samp>n</samp></dt>
  47793. <dd><p>The (sequential) number of the filtered frame, starting from 0.
  47794. </p>
  47795. </dd>
  47796. <dt><samp>selected_n</samp></dt>
  47797. <dd><p>The (sequential) number of the selected frame, starting from 0.
  47798. </p>
  47799. </dd>
  47800. <dt><samp>prev_selected_n</samp></dt>
  47801. <dd><p>The sequential number of the last selected frame. It&rsquo;s NAN if undefined.
  47802. </p>
  47803. </dd>
  47804. <dt><samp>TB</samp></dt>
  47805. <dd><p>The timebase of the input timestamps.
  47806. </p>
  47807. </dd>
  47808. <dt><samp>pts</samp></dt>
  47809. <dd><p>The PTS (Presentation TimeStamp) of the filtered video frame,
  47810. expressed in <var>TB</var> units. It&rsquo;s NAN if undefined.
  47811. </p>
  47812. </dd>
  47813. <dt><samp>t</samp></dt>
  47814. <dd><p>The PTS of the filtered video frame,
  47815. expressed in seconds. It&rsquo;s NAN if undefined.
  47816. </p>
  47817. </dd>
  47818. <dt><samp>prev_pts</samp></dt>
  47819. <dd><p>The PTS of the previously filtered video frame. It&rsquo;s NAN if undefined.
  47820. </p>
  47821. </dd>
  47822. <dt><samp>prev_selected_pts</samp></dt>
  47823. <dd><p>The PTS of the last previously filtered video frame. It&rsquo;s NAN if undefined.
  47824. </p>
  47825. </dd>
  47826. <dt><samp>prev_selected_t</samp></dt>
  47827. <dd><p>The PTS of the last previously selected video frame, expressed in seconds. It&rsquo;s NAN if undefined.
  47828. </p>
  47829. </dd>
  47830. <dt><samp>start_pts</samp></dt>
  47831. <dd><p>The PTS of the first video frame in the video. It&rsquo;s NAN if undefined.
  47832. </p>
  47833. </dd>
  47834. <dt><samp>start_t</samp></dt>
  47835. <dd><p>The time of the first video frame in the video. It&rsquo;s NAN if undefined.
  47836. </p>
  47837. </dd>
  47838. <dt><samp>pict_type <em>(video only)</em></samp></dt>
  47839. <dd><p>The type of the filtered frame. It can assume one of the following
  47840. values:
  47841. </p><dl compact="compact">
  47842. <dt><samp>I</samp></dt>
  47843. <dt><samp>P</samp></dt>
  47844. <dt><samp>B</samp></dt>
  47845. <dt><samp>S</samp></dt>
  47846. <dt><samp>SI</samp></dt>
  47847. <dt><samp>SP</samp></dt>
  47848. <dt><samp>BI</samp></dt>
  47849. </dl>
  47850. </dd>
  47851. <dt><samp>interlace_type <em>(video only)</em></samp></dt>
  47852. <dd><p>The frame interlace type. It can assume one of the following values:
  47853. </p><dl compact="compact">
  47854. <dt><samp>PROGRESSIVE</samp></dt>
  47855. <dd><p>The frame is progressive (not interlaced).
  47856. </p></dd>
  47857. <dt><samp>TOPFIRST</samp></dt>
  47858. <dd><p>The frame is top-field-first.
  47859. </p></dd>
  47860. <dt><samp>BOTTOMFIRST</samp></dt>
  47861. <dd><p>The frame is bottom-field-first.
  47862. </p></dd>
  47863. </dl>
  47864. </dd>
  47865. <dt><samp>consumed_sample_n <em>(audio only)</em></samp></dt>
  47866. <dd><p>the number of selected samples before the current frame
  47867. </p>
  47868. </dd>
  47869. <dt><samp>samples_n <em>(audio only)</em></samp></dt>
  47870. <dd><p>the number of samples in the current frame
  47871. </p>
  47872. </dd>
  47873. <dt><samp>sample_rate <em>(audio only)</em></samp></dt>
  47874. <dd><p>the input sample rate
  47875. </p>
  47876. </dd>
  47877. <dt><samp>key</samp></dt>
  47878. <dd><p>This is 1 if the filtered frame is a key-frame, 0 otherwise.
  47879. </p>
  47880. </dd>
  47881. <dt><samp>pos</samp></dt>
  47882. <dd><p>the position in the file of the filtered frame, -1 if the information
  47883. is not available (e.g. for synthetic video)
  47884. </p>
  47885. </dd>
  47886. <dt><samp>scene <em>(video only)</em></samp></dt>
  47887. <dd><p>value between 0 and 1 to indicate a new scene; a low value reflects a low
  47888. probability for the current frame to introduce a new scene, while a higher
  47889. value means the current frame is more likely to be one (see the example below)
  47890. </p>
  47891. </dd>
  47892. <dt><samp>concatdec_select</samp></dt>
  47893. <dd><p>The concat demuxer can select only part of a concat input file by setting an
  47894. inpoint and an outpoint, but the output packets may not be entirely contained
  47895. in the selected interval. By using this variable, it is possible to skip frames
  47896. generated by the concat demuxer which are not exactly contained in the selected
  47897. interval.
  47898. </p>
  47899. <p>This works by comparing the frame pts against the <var>lavf.concat.start_time</var>
  47900. and the <var>lavf.concat.duration</var> packet metadata values which are also
  47901. present in the decoded frames.
  47902. </p>
  47903. <p>The <var>concatdec_select</var> variable is -1 if the frame pts is at least
  47904. start_time and either the duration metadata is missing or the frame pts is less
  47905. than start_time + duration, 0 otherwise, and NaN if the start_time metadata is
  47906. missing.
  47907. </p>
  47908. <p>That basically means that an input frame is selected if its pts is within the
  47909. interval set by the concat demuxer.
  47910. </p>
  47911. </dd>
  47912. </dl>
  47913. <p>The default value of the select expression is &quot;1&quot;.
  47914. </p>
  47915. <a name="Examples-180"></a>
  47916. <h4 class="subsection">44.14.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-180" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-180" aria-hidden="true">TOC</a></span></h4>
  47917. <ul>
  47918. <li> Select all frames in input:
  47919. <div class="example">
  47920. <pre class="example">select
  47921. </pre></div>
  47922. <p>The example above is the same as:
  47923. </p><div class="example">
  47924. <pre class="example">select=1
  47925. </pre></div>
  47926. </li><li> Skip all frames:
  47927. <div class="example">
  47928. <pre class="example">select=0
  47929. </pre></div>
  47930. </li><li> Select only I-frames:
  47931. <div class="example">
  47932. <pre class="example">select='eq(pict_type\,I)'
  47933. </pre></div>
  47934. </li><li> Select one frame every 100:
  47935. <div class="example">
  47936. <pre class="example">select='not(mod(n\,100))'
  47937. </pre></div>
  47938. </li><li> Select only frames contained in the 10-20 time interval:
  47939. <div class="example">
  47940. <pre class="example">select=between(t\,10\,20)
  47941. </pre></div>
  47942. </li><li> Select only I-frames contained in the 10-20 time interval:
  47943. <div class="example">
  47944. <pre class="example">select=between(t\,10\,20)*eq(pict_type\,I)
  47945. </pre></div>
  47946. </li><li> Select frames with a minimum distance of 10 seconds:
  47947. <div class="example">
  47948. <pre class="example">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
  47949. </pre></div>
  47950. </li><li> Use aselect to select only audio frames with samples number &gt; 100:
  47951. <div class="example">
  47952. <pre class="example">aselect='gt(samples_n\,100)'
  47953. </pre></div>
  47954. </li><li> Create a mosaic of the first scenes:
  47955. <div class="example">
  47956. <pre class="example">ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
  47957. </pre></div>
  47958. <p>Comparing <var>scene</var> against a value between 0.3 and 0.5 is generally a sane
  47959. choice.
  47960. </p>
  47961. </li><li> Send even and odd frames to separate outputs, and compose them:
  47962. <div class="example">
  47963. <pre class="example">select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
  47964. </pre></div>
  47965. </li><li> Select useful frames from an ffconcat file which is using inpoints and
  47966. outpoints but where the source files are not intra frame only.
  47967. <div class="example">
  47968. <pre class="example">ffmpeg -copyts -vsync 0 -segment_time_metadata 1 -i input.ffconcat -vf select=concatdec_select -af aselect=concatdec_select output.avi
  47969. </pre></div>
  47970. </li></ul>
  47971. <a name="sendcmd_002c-asendcmd"></a>
  47972. <h3 class="section">44.15 sendcmd, asendcmd<span class="pull-right"><a class="anchor hidden-xs" href="#sendcmd_002c-asendcmd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sendcmd_002c-asendcmd" aria-hidden="true">TOC</a></span></h3>
  47973. <p>Send commands to filters in the filtergraph.
  47974. </p>
  47975. <p>These filters read commands to be sent to other filters in the
  47976. filtergraph.
  47977. </p>
  47978. <p><code>sendcmd</code> must be inserted between two video filters,
  47979. <code>asendcmd</code> must be inserted between two audio filters, but apart
  47980. from that they act the same way.
  47981. </p>
  47982. <p>The specification of commands can be provided in the filter arguments
  47983. with the <var>commands</var> option, or in a file specified by the
  47984. <var>filename</var> option.
  47985. </p>
  47986. <p>These filters accept the following options:
  47987. </p><dl compact="compact">
  47988. <dt><samp>commands, c</samp></dt>
  47989. <dd><p>Set the commands to be read and sent to the other filters.
  47990. </p></dd>
  47991. <dt><samp>filename, f</samp></dt>
  47992. <dd><p>Set the filename of the commands to be read and sent to the other
  47993. filters.
  47994. </p></dd>
  47995. </dl>
  47996. <a name="Commands-syntax"></a>
  47997. <h4 class="subsection">44.15.1 Commands syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-syntax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-syntax" aria-hidden="true">TOC</a></span></h4>
  47998. <p>A commands description consists of a sequence of interval
  47999. specifications, comprising a list of commands to be executed when a
  48000. particular event related to that interval occurs. The occurring event
  48001. is typically the current frame time entering or leaving a given time
  48002. interval.
  48003. </p>
  48004. <p>An interval is specified by the following syntax:
  48005. </p><div class="example">
  48006. <pre class="example"><var>START</var>[-<var>END</var>] <var>COMMANDS</var>;
  48007. </pre></div>
  48008. <p>The time interval is specified by the <var>START</var> and <var>END</var> times.
  48009. <var>END</var> is optional and defaults to the maximum time.
  48010. </p>
  48011. <p>The current frame time is considered within the specified interval if
  48012. it is included in the interval [<var>START</var>, <var>END</var>), that is when
  48013. the time is greater or equal to <var>START</var> and is lesser than
  48014. <var>END</var>.
  48015. </p>
  48016. <p><var>COMMANDS</var> consists of a sequence of one or more command
  48017. specifications, separated by &quot;,&quot;, relating to that interval. The
  48018. syntax of a command specification is given by:
  48019. </p><div class="example">
  48020. <pre class="example">[<var>FLAGS</var>] <var>TARGET</var> <var>COMMAND</var> <var>ARG</var>
  48021. </pre></div>
  48022. <p><var>FLAGS</var> is optional and specifies the type of events relating to
  48023. the time interval which enable sending the specified command, and must
  48024. be a non-null sequence of identifier flags separated by &quot;+&quot; or &quot;|&quot; and
  48025. enclosed between &quot;[&quot; and &quot;]&quot;.
  48026. </p>
  48027. <p>The following flags are recognized:
  48028. </p><dl compact="compact">
  48029. <dt><samp>enter</samp></dt>
  48030. <dd><p>The command is sent when the current frame timestamp enters the
  48031. specified interval. In other words, the command is sent when the
  48032. previous frame timestamp was not in the given interval, and the
  48033. current is.
  48034. </p>
  48035. </dd>
  48036. <dt><samp>leave</samp></dt>
  48037. <dd><p>The command is sent when the current frame timestamp leaves the
  48038. specified interval. In other words, the command is sent when the
  48039. previous frame timestamp was in the given interval, and the
  48040. current is not.
  48041. </p>
  48042. </dd>
  48043. <dt><samp>expr</samp></dt>
  48044. <dd><p>The command <var>ARG</var> is interpreted as expression and result of
  48045. expression is passed as <var>ARG</var>.
  48046. </p>
  48047. <p>The expression is evaluated through the eval API and can contain the following
  48048. constants:
  48049. </p>
  48050. <dl compact="compact">
  48051. <dt><samp>POS</samp></dt>
  48052. <dd><p>Original position in the file of the frame, or undefined if undefined
  48053. for the current frame.
  48054. </p>
  48055. </dd>
  48056. <dt><samp>PTS</samp></dt>
  48057. <dd><p>The presentation timestamp in input.
  48058. </p>
  48059. </dd>
  48060. <dt><samp>N</samp></dt>
  48061. <dd><p>The count of the input frame for video or audio, starting from 0.
  48062. </p>
  48063. </dd>
  48064. <dt><samp>T</samp></dt>
  48065. <dd><p>The time in seconds of the current frame.
  48066. </p>
  48067. </dd>
  48068. <dt><samp>TS</samp></dt>
  48069. <dd><p>The start time in seconds of the current command interval.
  48070. </p>
  48071. </dd>
  48072. <dt><samp>TE</samp></dt>
  48073. <dd><p>The end time in seconds of the current command interval.
  48074. </p>
  48075. </dd>
  48076. <dt><samp>TI</samp></dt>
  48077. <dd><p>The interpolated time of the current command interval, TI = (T - TS) / (TE - TS).
  48078. </p></dd>
  48079. </dl>
  48080. </dd>
  48081. </dl>
  48082. <p>If <var>FLAGS</var> is not specified, a default value of <code>[enter]</code> is
  48083. assumed.
  48084. </p>
  48085. <p><var>TARGET</var> specifies the target of the command, usually the name of
  48086. the filter class or a specific filter instance name.
  48087. </p>
  48088. <p><var>COMMAND</var> specifies the name of the command for the target filter.
  48089. </p>
  48090. <p><var>ARG</var> is optional and specifies the optional list of argument for
  48091. the given <var>COMMAND</var>.
  48092. </p>
  48093. <p>Between one interval specification and another, whitespaces, or
  48094. sequences of characters starting with <code>#</code> until the end of line,
  48095. are ignored and can be used to annotate comments.
  48096. </p>
  48097. <p>A simplified BNF description of the commands specification syntax
  48098. follows:
  48099. </p><div class="example">
  48100. <pre class="example"><var>COMMAND_FLAG</var> ::= &quot;enter&quot; | &quot;leave&quot;
  48101. <var>COMMAND_FLAGS</var> ::= <var>COMMAND_FLAG</var> [(+|&quot;|&quot;)<var>COMMAND_FLAG</var>]
  48102. <var>COMMAND</var> ::= [&quot;[&quot; <var>COMMAND_FLAGS</var> &quot;]&quot;] <var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
  48103. <var>COMMANDS</var> ::= <var>COMMAND</var> [,<var>COMMANDS</var>]
  48104. <var>INTERVAL</var> ::= <var>START</var>[-<var>END</var>] <var>COMMANDS</var>
  48105. <var>INTERVALS</var> ::= <var>INTERVAL</var>[;<var>INTERVALS</var>]
  48106. </pre></div>
  48107. <a name="Examples-181"></a>
  48108. <h4 class="subsection">44.15.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-181" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-181" aria-hidden="true">TOC</a></span></h4>
  48109. <ul>
  48110. <li> Specify audio tempo change at second 4:
  48111. <div class="example">
  48112. <pre class="example">asendcmd=c='4.0 atempo tempo 1.5',atempo
  48113. </pre></div>
  48114. </li><li> Target a specific filter instance:
  48115. <div class="example">
  48116. <pre class="example">asendcmd=c='4.0 atempo@my tempo 1.5',atempo@my
  48117. </pre></div>
  48118. </li><li> Specify a list of drawtext and hue commands in a file.
  48119. <div class="example">
  48120. <pre class="example"># show text in the interval 5-10
  48121. 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
  48122. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
  48123. # desaturate the image in the interval 15-20
  48124. 15.0-20.0 [enter] hue s 0,
  48125. [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
  48126. [leave] hue s 1,
  48127. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
  48128. # apply an exponential saturation fade-out effect, starting from time 25
  48129. 25 [enter] hue s exp(25-t)
  48130. </pre></div>
  48131. <p>A filtergraph allowing to read and process the above command list
  48132. stored in a file <samp>test.cmd</samp>, can be specified with:
  48133. </p><div class="example">
  48134. <pre class="example">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
  48135. </pre></div>
  48136. </li></ul>
  48137. <span id="setpts"></span><a name="setpts_002c-asetpts"></a>
  48138. <h3 class="section">44.16 setpts, asetpts<span class="pull-right"><a class="anchor hidden-xs" href="#setpts_002c-asetpts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setpts_002c-asetpts" aria-hidden="true">TOC</a></span></h3>
  48139. <p>Change the PTS (presentation timestamp) of the input frames.
  48140. </p>
  48141. <p><code>setpts</code> works on video frames, <code>asetpts</code> on audio frames.
  48142. </p>
  48143. <p>This filter accepts the following options:
  48144. </p>
  48145. <dl compact="compact">
  48146. <dt><samp>expr</samp></dt>
  48147. <dd><p>The expression which is evaluated for each frame to construct its timestamp.
  48148. </p>
  48149. </dd>
  48150. </dl>
  48151. <p>The expression is evaluated through the eval API and can contain the following
  48152. constants:
  48153. </p>
  48154. <dl compact="compact">
  48155. <dt><samp>FRAME_RATE, FR</samp></dt>
  48156. <dd><p>frame rate, only defined for constant frame-rate video
  48157. </p>
  48158. </dd>
  48159. <dt><samp>PTS</samp></dt>
  48160. <dd><p>The presentation timestamp in input
  48161. </p>
  48162. </dd>
  48163. <dt><samp>N</samp></dt>
  48164. <dd><p>The count of the input frame for video or the number of consumed samples,
  48165. not including the current frame for audio, starting from 0.
  48166. </p>
  48167. </dd>
  48168. <dt><samp>NB_CONSUMED_SAMPLES</samp></dt>
  48169. <dd><p>The number of consumed samples, not including the current frame (only
  48170. audio)
  48171. </p>
  48172. </dd>
  48173. <dt><samp>NB_SAMPLES, S</samp></dt>
  48174. <dd><p>The number of samples in the current frame (only audio)
  48175. </p>
  48176. </dd>
  48177. <dt><samp>SAMPLE_RATE, SR</samp></dt>
  48178. <dd><p>The audio sample rate.
  48179. </p>
  48180. </dd>
  48181. <dt><samp>STARTPTS</samp></dt>
  48182. <dd><p>The PTS of the first frame.
  48183. </p>
  48184. </dd>
  48185. <dt><samp>STARTT</samp></dt>
  48186. <dd><p>the time in seconds of the first frame
  48187. </p>
  48188. </dd>
  48189. <dt><samp>INTERLACED</samp></dt>
  48190. <dd><p>State whether the current frame is interlaced.
  48191. </p>
  48192. </dd>
  48193. <dt><samp>T</samp></dt>
  48194. <dd><p>the time in seconds of the current frame
  48195. </p>
  48196. </dd>
  48197. <dt><samp>POS</samp></dt>
  48198. <dd><p>original position in the file of the frame, or undefined if undefined
  48199. for the current frame
  48200. </p>
  48201. </dd>
  48202. <dt><samp>PREV_INPTS</samp></dt>
  48203. <dd><p>The previous input PTS.
  48204. </p>
  48205. </dd>
  48206. <dt><samp>PREV_INT</samp></dt>
  48207. <dd><p>previous input time in seconds
  48208. </p>
  48209. </dd>
  48210. <dt><samp>PREV_OUTPTS</samp></dt>
  48211. <dd><p>The previous output PTS.
  48212. </p>
  48213. </dd>
  48214. <dt><samp>PREV_OUTT</samp></dt>
  48215. <dd><p>previous output time in seconds
  48216. </p>
  48217. </dd>
  48218. <dt><samp>RTCTIME</samp></dt>
  48219. <dd><p>The wallclock (RTC) time in microseconds. This is deprecated, use time(0)
  48220. instead.
  48221. </p>
  48222. </dd>
  48223. <dt><samp>RTCSTART</samp></dt>
  48224. <dd><p>The wallclock (RTC) time at the start of the movie in microseconds.
  48225. </p>
  48226. </dd>
  48227. <dt><samp>TB</samp></dt>
  48228. <dd><p>The timebase of the input timestamps.
  48229. </p>
  48230. </dd>
  48231. </dl>
  48232. <a name="Examples-182"></a>
  48233. <h4 class="subsection">44.16.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-182" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-182" aria-hidden="true">TOC</a></span></h4>
  48234. <ul>
  48235. <li> Start counting PTS from zero
  48236. <div class="example">
  48237. <pre class="example">setpts=PTS-STARTPTS
  48238. </pre></div>
  48239. </li><li> Apply fast motion effect:
  48240. <div class="example">
  48241. <pre class="example">setpts=0.5*PTS
  48242. </pre></div>
  48243. </li><li> Apply slow motion effect:
  48244. <div class="example">
  48245. <pre class="example">setpts=2.0*PTS
  48246. </pre></div>
  48247. </li><li> Set fixed rate of 25 frames per second:
  48248. <div class="example">
  48249. <pre class="example">setpts=N/(25*TB)
  48250. </pre></div>
  48251. </li><li> Set fixed rate 25 fps with some jitter:
  48252. <div class="example">
  48253. <pre class="example">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
  48254. </pre></div>
  48255. </li><li> Apply an offset of 10 seconds to the input PTS:
  48256. <div class="example">
  48257. <pre class="example">setpts=PTS+10/TB
  48258. </pre></div>
  48259. </li><li> Generate timestamps from a &quot;live source&quot; and rebase onto the current timebase:
  48260. <div class="example">
  48261. <pre class="example">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
  48262. </pre></div>
  48263. </li><li> Generate timestamps by counting samples:
  48264. <div class="example">
  48265. <pre class="example">asetpts=N/SR/TB
  48266. </pre></div>
  48267. </li></ul>
  48268. <a name="setrange"></a>
  48269. <h3 class="section">44.17 setrange<span class="pull-right"><a class="anchor hidden-xs" href="#setrange" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setrange" aria-hidden="true">TOC</a></span></h3>
  48270. <p>Force color range for the output video frame.
  48271. </p>
  48272. <p>The <code>setrange</code> filter marks the color range property for the
  48273. output frames. It does not change the input frame, but only sets the
  48274. corresponding property, which affects how the frame is treated by
  48275. following filters.
  48276. </p>
  48277. <p>The filter accepts the following options:
  48278. </p>
  48279. <dl compact="compact">
  48280. <dt><samp>range</samp></dt>
  48281. <dd><p>Available values are:
  48282. </p>
  48283. <dl compact="compact">
  48284. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  48285. <dd><p>Keep the same color range property.
  48286. </p>
  48287. </dd>
  48288. <dt>&lsquo;<samp>unspecified, unknown</samp>&rsquo;</dt>
  48289. <dd><p>Set the color range as unspecified.
  48290. </p>
  48291. </dd>
  48292. <dt>&lsquo;<samp>limited, tv, mpeg</samp>&rsquo;</dt>
  48293. <dd><p>Set the color range as limited.
  48294. </p>
  48295. </dd>
  48296. <dt>&lsquo;<samp>full, pc, jpeg</samp>&rsquo;</dt>
  48297. <dd><p>Set the color range as full.
  48298. </p></dd>
  48299. </dl>
  48300. </dd>
  48301. </dl>
  48302. <a name="settb_002c-asettb"></a>
  48303. <h3 class="section">44.18 settb, asettb<span class="pull-right"><a class="anchor hidden-xs" href="#settb_002c-asettb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-settb_002c-asettb" aria-hidden="true">TOC</a></span></h3>
  48304. <p>Set the timebase to use for the output frames timestamps.
  48305. It is mainly useful for testing timebase configuration.
  48306. </p>
  48307. <p>It accepts the following parameters:
  48308. </p>
  48309. <dl compact="compact">
  48310. <dt><samp>expr, tb</samp></dt>
  48311. <dd><p>The expression which is evaluated into the output timebase.
  48312. </p>
  48313. </dd>
  48314. </dl>
  48315. <p>The value for <samp>tb</samp> is an arithmetic expression representing a
  48316. rational. The expression can contain the constants &quot;AVTB&quot; (the default
  48317. timebase), &quot;intb&quot; (the input timebase) and &quot;sr&quot; (the sample rate,
  48318. audio only). Default value is &quot;intb&quot;.
  48319. </p>
  48320. <a name="Examples-183"></a>
  48321. <h4 class="subsection">44.18.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-183" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-183" aria-hidden="true">TOC</a></span></h4>
  48322. <ul>
  48323. <li> Set the timebase to 1/25:
  48324. <div class="example">
  48325. <pre class="example">settb=expr=1/25
  48326. </pre></div>
  48327. </li><li> Set the timebase to 1/10:
  48328. <div class="example">
  48329. <pre class="example">settb=expr=0.1
  48330. </pre></div>
  48331. </li><li> Set the timebase to 1001/1000:
  48332. <div class="example">
  48333. <pre class="example">settb=1+0.001
  48334. </pre></div>
  48335. </li><li> Set the timebase to 2*intb:
  48336. <div class="example">
  48337. <pre class="example">settb=2*intb
  48338. </pre></div>
  48339. </li><li> Set the default timebase value:
  48340. <div class="example">
  48341. <pre class="example">settb=AVTB
  48342. </pre></div>
  48343. </li></ul>
  48344. <a name="showcqt"></a>
  48345. <h3 class="section">44.19 showcqt<span class="pull-right"><a class="anchor hidden-xs" href="#showcqt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showcqt" aria-hidden="true">TOC</a></span></h3>
  48346. <p>Convert input audio to a video output representing frequency spectrum
  48347. logarithmically using Brown-Puckette constant Q transform algorithm with
  48348. direct frequency domain coefficient calculation (but the transform itself
  48349. is not really constant Q, instead the Q factor is actually variable/clamped),
  48350. with musical tone scale, from E0 to D#10.
  48351. </p>
  48352. <p>The filter accepts the following options:
  48353. </p>
  48354. <dl compact="compact">
  48355. <dt><samp>size, s</samp></dt>
  48356. <dd><p>Specify the video size for the output. It must be even. For the syntax of this option,
  48357. check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  48358. Default value is <code>1920x1080</code>.
  48359. </p>
  48360. </dd>
  48361. <dt><samp>fps, rate, r</samp></dt>
  48362. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  48363. </p>
  48364. </dd>
  48365. <dt><samp>bar_h</samp></dt>
  48366. <dd><p>Set the bargraph height. It must be even. Default value is <code>-1</code> which
  48367. computes the bargraph height automatically.
  48368. </p>
  48369. </dd>
  48370. <dt><samp>axis_h</samp></dt>
  48371. <dd><p>Set the axis height. It must be even. Default value is <code>-1</code> which computes
  48372. the axis height automatically.
  48373. </p>
  48374. </dd>
  48375. <dt><samp>sono_h</samp></dt>
  48376. <dd><p>Set the sonogram height. It must be even. Default value is <code>-1</code> which
  48377. computes the sonogram height automatically.
  48378. </p>
  48379. </dd>
  48380. <dt><samp>fullhd</samp></dt>
  48381. <dd><p>Set the fullhd resolution. This option is deprecated, use <var>size</var>, <var>s</var>
  48382. instead. Default value is <code>1</code>.
  48383. </p>
  48384. </dd>
  48385. <dt><samp>sono_v, volume</samp></dt>
  48386. <dd><p>Specify the sonogram volume expression. It can contain variables:
  48387. </p><dl compact="compact">
  48388. <dt><samp>bar_v</samp></dt>
  48389. <dd><p>the <var>bar_v</var> evaluated expression
  48390. </p></dd>
  48391. <dt><samp>frequency, freq, f</samp></dt>
  48392. <dd><p>the frequency where it is evaluated
  48393. </p></dd>
  48394. <dt><samp>timeclamp, tc</samp></dt>
  48395. <dd><p>the value of <var>timeclamp</var> option
  48396. </p></dd>
  48397. </dl>
  48398. <p>and functions:
  48399. </p><dl compact="compact">
  48400. <dt><samp>a_weighting(f)</samp></dt>
  48401. <dd><p>A-weighting of equal loudness
  48402. </p></dd>
  48403. <dt><samp>b_weighting(f)</samp></dt>
  48404. <dd><p>B-weighting of equal loudness
  48405. </p></dd>
  48406. <dt><samp>c_weighting(f)</samp></dt>
  48407. <dd><p>C-weighting of equal loudness.
  48408. </p></dd>
  48409. </dl>
  48410. <p>Default value is <code>16</code>.
  48411. </p>
  48412. </dd>
  48413. <dt><samp>bar_v, volume2</samp></dt>
  48414. <dd><p>Specify the bargraph volume expression. It can contain variables:
  48415. </p><dl compact="compact">
  48416. <dt><samp>sono_v</samp></dt>
  48417. <dd><p>the <var>sono_v</var> evaluated expression
  48418. </p></dd>
  48419. <dt><samp>frequency, freq, f</samp></dt>
  48420. <dd><p>the frequency where it is evaluated
  48421. </p></dd>
  48422. <dt><samp>timeclamp, tc</samp></dt>
  48423. <dd><p>the value of <var>timeclamp</var> option
  48424. </p></dd>
  48425. </dl>
  48426. <p>and functions:
  48427. </p><dl compact="compact">
  48428. <dt><samp>a_weighting(f)</samp></dt>
  48429. <dd><p>A-weighting of equal loudness
  48430. </p></dd>
  48431. <dt><samp>b_weighting(f)</samp></dt>
  48432. <dd><p>B-weighting of equal loudness
  48433. </p></dd>
  48434. <dt><samp>c_weighting(f)</samp></dt>
  48435. <dd><p>C-weighting of equal loudness.
  48436. </p></dd>
  48437. </dl>
  48438. <p>Default value is <code>sono_v</code>.
  48439. </p>
  48440. </dd>
  48441. <dt><samp>sono_g, gamma</samp></dt>
  48442. <dd><p>Specify the sonogram gamma. Lower gamma makes the spectrum more contrast,
  48443. higher gamma makes the spectrum having more range. Default value is <code>3</code>.
  48444. Acceptable range is <code>[1, 7]</code>.
  48445. </p>
  48446. </dd>
  48447. <dt><samp>bar_g, gamma2</samp></dt>
  48448. <dd><p>Specify the bargraph gamma. Default value is <code>1</code>. Acceptable range is
  48449. <code>[1, 7]</code>.
  48450. </p>
  48451. </dd>
  48452. <dt><samp>bar_t</samp></dt>
  48453. <dd><p>Specify the bargraph transparency level. Lower value makes the bargraph sharper.
  48454. Default value is <code>1</code>. Acceptable range is <code>[0, 1]</code>.
  48455. </p>
  48456. </dd>
  48457. <dt><samp>timeclamp, tc</samp></dt>
  48458. <dd><p>Specify the transform timeclamp. At low frequency, there is trade-off between
  48459. accuracy in time domain and frequency domain. If timeclamp is lower,
  48460. event in time domain is represented more accurately (such as fast bass drum),
  48461. otherwise event in frequency domain is represented more accurately
  48462. (such as bass guitar). Acceptable range is <code>[0.002, 1]</code>. Default value is <code>0.17</code>.
  48463. </p>
  48464. </dd>
  48465. <dt><samp>attack</samp></dt>
  48466. <dd><p>Set attack time in seconds. The default is <code>0</code> (disabled). Otherwise, it
  48467. limits future samples by applying asymmetric windowing in time domain, useful
  48468. when low latency is required. Accepted range is <code>[0, 1]</code>.
  48469. </p>
  48470. </dd>
  48471. <dt><samp>basefreq</samp></dt>
  48472. <dd><p>Specify the transform base frequency. Default value is <code>20.01523126408007475</code>,
  48473. which is frequency 50 cents below E0. Acceptable range is <code>[10, 100000]</code>.
  48474. </p>
  48475. </dd>
  48476. <dt><samp>endfreq</samp></dt>
  48477. <dd><p>Specify the transform end frequency. Default value is <code>20495.59681441799654</code>,
  48478. which is frequency 50 cents above D#10. Acceptable range is <code>[10, 100000]</code>.
  48479. </p>
  48480. </dd>
  48481. <dt><samp>coeffclamp</samp></dt>
  48482. <dd><p>This option is deprecated and ignored.
  48483. </p>
  48484. </dd>
  48485. <dt><samp>tlength</samp></dt>
  48486. <dd><p>Specify the transform length in time domain. Use this option to control accuracy
  48487. trade-off between time domain and frequency domain at every frequency sample.
  48488. It can contain variables:
  48489. </p><dl compact="compact">
  48490. <dt><samp>frequency, freq, f</samp></dt>
  48491. <dd><p>the frequency where it is evaluated
  48492. </p></dd>
  48493. <dt><samp>timeclamp, tc</samp></dt>
  48494. <dd><p>the value of <var>timeclamp</var> option.
  48495. </p></dd>
  48496. </dl>
  48497. <p>Default value is <code>384*tc/(384+tc*f)</code>.
  48498. </p>
  48499. </dd>
  48500. <dt><samp>count</samp></dt>
  48501. <dd><p>Specify the transform count for every video frame. Default value is <code>6</code>.
  48502. Acceptable range is <code>[1, 30]</code>.
  48503. </p>
  48504. </dd>
  48505. <dt><samp>fcount</samp></dt>
  48506. <dd><p>Specify the transform count for every single pixel. Default value is <code>0</code>,
  48507. which makes it computed automatically. Acceptable range is <code>[0, 10]</code>.
  48508. </p>
  48509. </dd>
  48510. <dt><samp>fontfile</samp></dt>
  48511. <dd><p>Specify font file for use with freetype to draw the axis. If not specified,
  48512. use embedded font. Note that drawing with font file or embedded font is not
  48513. implemented with custom <var>basefreq</var> and <var>endfreq</var>, use <var>axisfile</var>
  48514. option instead.
  48515. </p>
  48516. </dd>
  48517. <dt><samp>font</samp></dt>
  48518. <dd><p>Specify fontconfig pattern. This has lower priority than <var>fontfile</var>. The
  48519. <code>:</code> in the pattern may be replaced by <code>|</code> to avoid unnecessary
  48520. escaping.
  48521. </p>
  48522. </dd>
  48523. <dt><samp>fontcolor</samp></dt>
  48524. <dd><p>Specify font color expression. This is arithmetic expression that should return
  48525. integer value 0xRRGGBB. It can contain variables:
  48526. </p><dl compact="compact">
  48527. <dt><samp>frequency, freq, f</samp></dt>
  48528. <dd><p>the frequency where it is evaluated
  48529. </p></dd>
  48530. <dt><samp>timeclamp, tc</samp></dt>
  48531. <dd><p>the value of <var>timeclamp</var> option
  48532. </p></dd>
  48533. </dl>
  48534. <p>and functions:
  48535. </p><dl compact="compact">
  48536. <dt><samp>midi(f)</samp></dt>
  48537. <dd><p>midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69)
  48538. </p></dd>
  48539. <dt><samp>r(x), g(x), b(x)</samp></dt>
  48540. <dd><p>red, green, and blue value of intensity x.
  48541. </p></dd>
  48542. </dl>
  48543. <p>Default value is <code>st(0, (midi(f)-59.5)/12);
  48544. st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0));
  48545. r(1-ld(1)) + b(ld(1))</code>.
  48546. </p>
  48547. </dd>
  48548. <dt><samp>axisfile</samp></dt>
  48549. <dd><p>Specify image file to draw the axis. This option override <var>fontfile</var> and
  48550. <var>fontcolor</var> option.
  48551. </p>
  48552. </dd>
  48553. <dt><samp>axis, text</samp></dt>
  48554. <dd><p>Enable/disable drawing text to the axis. If it is set to <code>0</code>, drawing to
  48555. the axis is disabled, ignoring <var>fontfile</var> and <var>axisfile</var> option.
  48556. Default value is <code>1</code>.
  48557. </p>
  48558. </dd>
  48559. <dt><samp>csp</samp></dt>
  48560. <dd><p>Set colorspace. The accepted values are:
  48561. </p><dl compact="compact">
  48562. <dt>&lsquo;<samp>unspecified</samp>&rsquo;</dt>
  48563. <dd><p>Unspecified (default)
  48564. </p>
  48565. </dd>
  48566. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  48567. <dd><p>BT.709
  48568. </p>
  48569. </dd>
  48570. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  48571. <dd><p>FCC
  48572. </p>
  48573. </dd>
  48574. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  48575. <dd><p>BT.470BG or BT.601-6 625
  48576. </p>
  48577. </dd>
  48578. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  48579. <dd><p>SMPTE-170M or BT.601-6 525
  48580. </p>
  48581. </dd>
  48582. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  48583. <dd><p>SMPTE-240M
  48584. </p>
  48585. </dd>
  48586. <dt>&lsquo;<samp>bt2020ncl</samp>&rsquo;</dt>
  48587. <dd><p>BT.2020 with non-constant luminance
  48588. </p>
  48589. </dd>
  48590. </dl>
  48591. </dd>
  48592. <dt><samp>cscheme</samp></dt>
  48593. <dd><p>Set spectrogram color scheme. This is list of floating point values with format
  48594. <code>left_r|left_g|left_b|right_r|right_g|right_b</code>.
  48595. The default is <code>1|0.5|0|0|0.5|1</code>.
  48596. </p>
  48597. </dd>
  48598. </dl>
  48599. <a name="Examples-184"></a>
  48600. <h4 class="subsection">44.19.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-184" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-184" aria-hidden="true">TOC</a></span></h4>
  48601. <ul>
  48602. <li> Playing audio while showing the spectrum:
  48603. <div class="example">
  48604. <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
  48605. </pre></div>
  48606. </li><li> Same as above, but with frame rate 30 fps:
  48607. <div class="example">
  48608. <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
  48609. </pre></div>
  48610. </li><li> Playing at 1280x720:
  48611. <div class="example">
  48612. <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]'
  48613. </pre></div>
  48614. </li><li> Disable sonogram display:
  48615. <div class="example">
  48616. <pre class="example">sono_h=0
  48617. </pre></div>
  48618. </li><li> A1 and its harmonics: A1, A2, (near)E3, A3:
  48619. <div class="example">
  48620. <pre class="example">ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
  48621. asplit[a][out1]; [a] showcqt [out0]'
  48622. </pre></div>
  48623. </li><li> Same as above, but with more accuracy in frequency domain:
  48624. <div class="example">
  48625. <pre class="example">ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
  48626. asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
  48627. </pre></div>
  48628. </li><li> Custom volume:
  48629. <div class="example">
  48630. <pre class="example">bar_v=10:sono_v=bar_v*a_weighting(f)
  48631. </pre></div>
  48632. </li><li> Custom gamma, now spectrum is linear to the amplitude.
  48633. <div class="example">
  48634. <pre class="example">bar_g=2:sono_g=2
  48635. </pre></div>
  48636. </li><li> Custom tlength equation:
  48637. <div class="example">
  48638. <pre class="example">tc=0.33:tlength='st(0,0.17); 384*tc / (384 / ld(0) + tc*f /(1-ld(0))) + 384*tc / (tc*f / ld(0) + 384 /(1-ld(0)))'
  48639. </pre></div>
  48640. </li><li> Custom fontcolor and fontfile, C-note is colored green, others are colored blue:
  48641. <div class="example">
  48642. <pre class="example">fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))':fontfile=myfont.ttf
  48643. </pre></div>
  48644. </li><li> Custom font using fontconfig:
  48645. <div class="example">
  48646. <pre class="example">font='Courier New,Monospace,mono|bold'
  48647. </pre></div>
  48648. </li><li> Custom frequency range with custom axis using image file:
  48649. <div class="example">
  48650. <pre class="example">axisfile=myaxis.png:basefreq=40:endfreq=10000
  48651. </pre></div>
  48652. </li></ul>
  48653. <a name="showfreqs"></a>
  48654. <h3 class="section">44.20 showfreqs<span class="pull-right"><a class="anchor hidden-xs" href="#showfreqs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showfreqs" aria-hidden="true">TOC</a></span></h3>
  48655. <p>Convert input audio to video output representing the audio power spectrum.
  48656. Audio amplitude is on Y-axis while frequency is on X-axis.
  48657. </p>
  48658. <p>The filter accepts the following options:
  48659. </p>
  48660. <dl compact="compact">
  48661. <dt><samp>size, s</samp></dt>
  48662. <dd><p>Specify size of video. For the syntax of this option, check the
  48663. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  48664. Default is <code>1024x512</code>.
  48665. </p>
  48666. </dd>
  48667. <dt><samp>mode</samp></dt>
  48668. <dd><p>Set display mode.
  48669. This set how each frequency bin will be represented.
  48670. </p>
  48671. <p>It accepts the following values:
  48672. </p><dl compact="compact">
  48673. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  48674. <dt>&lsquo;<samp>bar</samp>&rsquo;</dt>
  48675. <dt>&lsquo;<samp>dot</samp>&rsquo;</dt>
  48676. </dl>
  48677. <p>Default is <code>bar</code>.
  48678. </p>
  48679. </dd>
  48680. <dt><samp>ascale</samp></dt>
  48681. <dd><p>Set amplitude scale.
  48682. </p>
  48683. <p>It accepts the following values:
  48684. </p><dl compact="compact">
  48685. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  48686. <dd><p>Linear scale.
  48687. </p>
  48688. </dd>
  48689. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  48690. <dd><p>Square root scale.
  48691. </p>
  48692. </dd>
  48693. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  48694. <dd><p>Cubic root scale.
  48695. </p>
  48696. </dd>
  48697. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  48698. <dd><p>Logarithmic scale.
  48699. </p></dd>
  48700. </dl>
  48701. <p>Default is <code>log</code>.
  48702. </p>
  48703. </dd>
  48704. <dt><samp>fscale</samp></dt>
  48705. <dd><p>Set frequency scale.
  48706. </p>
  48707. <p>It accepts the following values:
  48708. </p><dl compact="compact">
  48709. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  48710. <dd><p>Linear scale.
  48711. </p>
  48712. </dd>
  48713. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  48714. <dd><p>Logarithmic scale.
  48715. </p>
  48716. </dd>
  48717. <dt>&lsquo;<samp>rlog</samp>&rsquo;</dt>
  48718. <dd><p>Reverse logarithmic scale.
  48719. </p></dd>
  48720. </dl>
  48721. <p>Default is <code>lin</code>.
  48722. </p>
  48723. </dd>
  48724. <dt><samp>win_size</samp></dt>
  48725. <dd><p>Set window size. Allowed range is from 16 to 65536.
  48726. </p>
  48727. <p>Default is <code>2048</code>
  48728. </p>
  48729. </dd>
  48730. <dt><samp>win_func</samp></dt>
  48731. <dd><p>Set windowing function.
  48732. </p>
  48733. <p>It accepts the following values:
  48734. </p><dl compact="compact">
  48735. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  48736. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  48737. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  48738. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  48739. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  48740. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  48741. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  48742. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  48743. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  48744. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  48745. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  48746. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  48747. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  48748. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  48749. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  48750. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  48751. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  48752. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  48753. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  48754. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  48755. </dl>
  48756. <p>Default is <code>hanning</code>.
  48757. </p>
  48758. </dd>
  48759. <dt><samp>overlap</samp></dt>
  48760. <dd><p>Set window overlap. In range <code>[0, 1]</code>. Default is <code>1</code>,
  48761. which means optimal overlap for selected window function will be picked.
  48762. </p>
  48763. </dd>
  48764. <dt><samp>averaging</samp></dt>
  48765. <dd><p>Set time averaging. Setting this to 0 will display current maximal peaks.
  48766. Default is <code>1</code>, which means time averaging is disabled.
  48767. </p>
  48768. </dd>
  48769. <dt><samp>colors</samp></dt>
  48770. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  48771. draw channel frequencies. Unrecognized or missing colors will be replaced
  48772. by white color.
  48773. </p>
  48774. </dd>
  48775. <dt><samp>cmode</samp></dt>
  48776. <dd><p>Set channel display mode.
  48777. </p>
  48778. <p>It accepts the following values:
  48779. </p><dl compact="compact">
  48780. <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
  48781. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  48782. </dl>
  48783. <p>Default is <code>combined</code>.
  48784. </p>
  48785. </dd>
  48786. <dt><samp>minamp</samp></dt>
  48787. <dd><p>Set minimum amplitude used in <code>log</code> amplitude scaler.
  48788. </p>
  48789. </dd>
  48790. <dt><samp>data</samp></dt>
  48791. <dd><p>Set data display mode.
  48792. </p>
  48793. <p>It accepts the following values:
  48794. </p><dl compact="compact">
  48795. <dt>&lsquo;<samp>magnitude</samp>&rsquo;</dt>
  48796. <dt>&lsquo;<samp>phase</samp>&rsquo;</dt>
  48797. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  48798. </dl>
  48799. <p>Default is <code>magnitude</code>.
  48800. </p></dd>
  48801. </dl>
  48802. <a name="showspatial"></a>
  48803. <h3 class="section">44.21 showspatial<span class="pull-right"><a class="anchor hidden-xs" href="#showspatial" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showspatial" aria-hidden="true">TOC</a></span></h3>
  48804. <p>Convert stereo input audio to a video output, representing the spatial relationship
  48805. between two channels.
  48806. </p>
  48807. <p>The filter accepts the following options:
  48808. </p>
  48809. <dl compact="compact">
  48810. <dt><samp>size, s</samp></dt>
  48811. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  48812. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  48813. Default value is <code>512x512</code>.
  48814. </p>
  48815. </dd>
  48816. <dt><samp>win_size</samp></dt>
  48817. <dd><p>Set window size. Allowed range is from <var>1024</var> to <var>65536</var>. Default size is <var>4096</var>.
  48818. </p>
  48819. </dd>
  48820. <dt><samp>win_func</samp></dt>
  48821. <dd><p>Set window function.
  48822. </p>
  48823. <p>It accepts the following values:
  48824. </p><dl compact="compact">
  48825. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  48826. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  48827. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  48828. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  48829. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  48830. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  48831. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  48832. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  48833. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  48834. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  48835. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  48836. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  48837. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  48838. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  48839. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  48840. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  48841. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  48842. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  48843. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  48844. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  48845. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  48846. </dl>
  48847. <p>Default value is <code>hann</code>.
  48848. </p>
  48849. </dd>
  48850. <dt><samp>overlap</samp></dt>
  48851. <dd><p>Set ratio of overlap window. Default value is <code>0.5</code>.
  48852. When value is <code>1</code> overlap is set to recommended size for specific
  48853. window function currently used.
  48854. </p></dd>
  48855. </dl>
  48856. <span id="showspectrum"></span><a name="showspectrum-1"></a>
  48857. <h3 class="section">44.22 showspectrum<span class="pull-right"><a class="anchor hidden-xs" href="#showspectrum-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showspectrum-1" aria-hidden="true">TOC</a></span></h3>
  48858. <p>Convert input audio to a video output, representing the audio frequency
  48859. spectrum.
  48860. </p>
  48861. <p>The filter accepts the following options:
  48862. </p>
  48863. <dl compact="compact">
  48864. <dt><samp>size, s</samp></dt>
  48865. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  48866. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  48867. Default value is <code>640x512</code>.
  48868. </p>
  48869. </dd>
  48870. <dt><samp>slide</samp></dt>
  48871. <dd><p>Specify how the spectrum should slide along the window.
  48872. </p>
  48873. <p>It accepts the following values:
  48874. </p><dl compact="compact">
  48875. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  48876. <dd><p>the samples start again on the left when they reach the right
  48877. </p></dd>
  48878. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  48879. <dd><p>the samples scroll from right to left
  48880. </p></dd>
  48881. <dt>&lsquo;<samp>fullframe</samp>&rsquo;</dt>
  48882. <dd><p>frames are only produced when the samples reach the right
  48883. </p></dd>
  48884. <dt>&lsquo;<samp>rscroll</samp>&rsquo;</dt>
  48885. <dd><p>the samples scroll from left to right
  48886. </p></dd>
  48887. </dl>
  48888. <p>Default value is <code>replace</code>.
  48889. </p>
  48890. </dd>
  48891. <dt><samp>mode</samp></dt>
  48892. <dd><p>Specify display mode.
  48893. </p>
  48894. <p>It accepts the following values:
  48895. </p><dl compact="compact">
  48896. <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
  48897. <dd><p>all channels are displayed in the same row
  48898. </p></dd>
  48899. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  48900. <dd><p>all channels are displayed in separate rows
  48901. </p></dd>
  48902. </dl>
  48903. <p>Default value is &lsquo;<samp>combined</samp>&rsquo;.
  48904. </p>
  48905. </dd>
  48906. <dt><samp>color</samp></dt>
  48907. <dd><p>Specify display color mode.
  48908. </p>
  48909. <p>It accepts the following values:
  48910. </p><dl compact="compact">
  48911. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  48912. <dd><p>each channel is displayed in a separate color
  48913. </p></dd>
  48914. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  48915. <dd><p>each channel is displayed using the same color scheme
  48916. </p></dd>
  48917. <dt>&lsquo;<samp>rainbow</samp>&rsquo;</dt>
  48918. <dd><p>each channel is displayed using the rainbow color scheme
  48919. </p></dd>
  48920. <dt>&lsquo;<samp>moreland</samp>&rsquo;</dt>
  48921. <dd><p>each channel is displayed using the moreland color scheme
  48922. </p></dd>
  48923. <dt>&lsquo;<samp>nebulae</samp>&rsquo;</dt>
  48924. <dd><p>each channel is displayed using the nebulae color scheme
  48925. </p></dd>
  48926. <dt>&lsquo;<samp>fire</samp>&rsquo;</dt>
  48927. <dd><p>each channel is displayed using the fire color scheme
  48928. </p></dd>
  48929. <dt>&lsquo;<samp>fiery</samp>&rsquo;</dt>
  48930. <dd><p>each channel is displayed using the fiery color scheme
  48931. </p></dd>
  48932. <dt>&lsquo;<samp>fruit</samp>&rsquo;</dt>
  48933. <dd><p>each channel is displayed using the fruit color scheme
  48934. </p></dd>
  48935. <dt>&lsquo;<samp>cool</samp>&rsquo;</dt>
  48936. <dd><p>each channel is displayed using the cool color scheme
  48937. </p></dd>
  48938. <dt>&lsquo;<samp>magma</samp>&rsquo;</dt>
  48939. <dd><p>each channel is displayed using the magma color scheme
  48940. </p></dd>
  48941. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  48942. <dd><p>each channel is displayed using the green color scheme
  48943. </p></dd>
  48944. <dt>&lsquo;<samp>viridis</samp>&rsquo;</dt>
  48945. <dd><p>each channel is displayed using the viridis color scheme
  48946. </p></dd>
  48947. <dt>&lsquo;<samp>plasma</samp>&rsquo;</dt>
  48948. <dd><p>each channel is displayed using the plasma color scheme
  48949. </p></dd>
  48950. <dt>&lsquo;<samp>cividis</samp>&rsquo;</dt>
  48951. <dd><p>each channel is displayed using the cividis color scheme
  48952. </p></dd>
  48953. <dt>&lsquo;<samp>terrain</samp>&rsquo;</dt>
  48954. <dd><p>each channel is displayed using the terrain color scheme
  48955. </p></dd>
  48956. </dl>
  48957. <p>Default value is &lsquo;<samp>channel</samp>&rsquo;.
  48958. </p>
  48959. </dd>
  48960. <dt><samp>scale</samp></dt>
  48961. <dd><p>Specify scale used for calculating intensity color values.
  48962. </p>
  48963. <p>It accepts the following values:
  48964. </p><dl compact="compact">
  48965. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  48966. <dd><p>linear
  48967. </p></dd>
  48968. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  48969. <dd><p>square root, default
  48970. </p></dd>
  48971. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  48972. <dd><p>cubic root
  48973. </p></dd>
  48974. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  48975. <dd><p>logarithmic
  48976. </p></dd>
  48977. <dt>&lsquo;<samp>4thrt</samp>&rsquo;</dt>
  48978. <dd><p>4th root
  48979. </p></dd>
  48980. <dt>&lsquo;<samp>5thrt</samp>&rsquo;</dt>
  48981. <dd><p>5th root
  48982. </p></dd>
  48983. </dl>
  48984. <p>Default value is &lsquo;<samp>sqrt</samp>&rsquo;.
  48985. </p>
  48986. </dd>
  48987. <dt><samp>fscale</samp></dt>
  48988. <dd><p>Specify frequency scale.
  48989. </p>
  48990. <p>It accepts the following values:
  48991. </p><dl compact="compact">
  48992. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  48993. <dd><p>linear
  48994. </p></dd>
  48995. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  48996. <dd><p>logarithmic
  48997. </p></dd>
  48998. </dl>
  48999. <p>Default value is &lsquo;<samp>lin</samp>&rsquo;.
  49000. </p>
  49001. </dd>
  49002. <dt><samp>saturation</samp></dt>
  49003. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  49004. alternative color scheme. <code>0</code> is no saturation at all.
  49005. Saturation must be in [-10.0, 10.0] range.
  49006. Default value is <code>1</code>.
  49007. </p>
  49008. </dd>
  49009. <dt><samp>win_func</samp></dt>
  49010. <dd><p>Set window function.
  49011. </p>
  49012. <p>It accepts the following values:
  49013. </p><dl compact="compact">
  49014. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  49015. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  49016. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  49017. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  49018. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  49019. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  49020. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  49021. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  49022. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  49023. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  49024. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  49025. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  49026. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  49027. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  49028. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  49029. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  49030. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  49031. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  49032. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  49033. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  49034. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  49035. </dl>
  49036. <p>Default value is <code>hann</code>.
  49037. </p>
  49038. </dd>
  49039. <dt><samp>orientation</samp></dt>
  49040. <dd><p>Set orientation of time vs frequency axis. Can be <code>vertical</code> or
  49041. <code>horizontal</code>. Default is <code>vertical</code>.
  49042. </p>
  49043. </dd>
  49044. <dt><samp>overlap</samp></dt>
  49045. <dd><p>Set ratio of overlap window. Default value is <code>0</code>.
  49046. When value is <code>1</code> overlap is set to recommended size for specific
  49047. window function currently used.
  49048. </p>
  49049. </dd>
  49050. <dt><samp>gain</samp></dt>
  49051. <dd><p>Set scale gain for calculating intensity color values.
  49052. Default value is <code>1</code>.
  49053. </p>
  49054. </dd>
  49055. <dt><samp>data</samp></dt>
  49056. <dd><p>Set which data to display. Can be <code>magnitude</code>, default or <code>phase</code>.
  49057. </p>
  49058. </dd>
  49059. <dt><samp>rotation</samp></dt>
  49060. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  49061. Default value is <code>0</code>.
  49062. </p>
  49063. </dd>
  49064. <dt><samp>start</samp></dt>
  49065. <dd><p>Set start frequency from which to display spectrogram. Default is <code>0</code>.
  49066. </p>
  49067. </dd>
  49068. <dt><samp>stop</samp></dt>
  49069. <dd><p>Set stop frequency to which to display spectrogram. Default is <code>0</code>.
  49070. </p>
  49071. </dd>
  49072. <dt><samp>fps</samp></dt>
  49073. <dd><p>Set upper frame rate limit. Default is <code>auto</code>, unlimited.
  49074. </p>
  49075. </dd>
  49076. <dt><samp>legend</samp></dt>
  49077. <dd><p>Draw time and frequency axes and legends. Default is disabled.
  49078. </p></dd>
  49079. </dl>
  49080. <p>The usage is very similar to the showwaves filter; see the examples in that
  49081. section.
  49082. </p>
  49083. <a name="Examples-185"></a>
  49084. <h4 class="subsection">44.22.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-185" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-185" aria-hidden="true">TOC</a></span></h4>
  49085. <ul>
  49086. <li> Large window with logarithmic color scaling:
  49087. <div class="example">
  49088. <pre class="example">showspectrum=s=1280x480:scale=log
  49089. </pre></div>
  49090. </li><li> Complete example for a colored and sliding spectrum per channel using <code>ffplay</code>:
  49091. <div class="example">
  49092. <pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  49093. [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
  49094. </pre></div>
  49095. </li></ul>
  49096. <a name="showspectrumpic"></a>
  49097. <h3 class="section">44.23 showspectrumpic<span class="pull-right"><a class="anchor hidden-xs" href="#showspectrumpic" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showspectrumpic" aria-hidden="true">TOC</a></span></h3>
  49098. <p>Convert input audio to a single video frame, representing the audio frequency
  49099. spectrum.
  49100. </p>
  49101. <p>The filter accepts the following options:
  49102. </p>
  49103. <dl compact="compact">
  49104. <dt><samp>size, s</samp></dt>
  49105. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  49106. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  49107. Default value is <code>4096x2048</code>.
  49108. </p>
  49109. </dd>
  49110. <dt><samp>mode</samp></dt>
  49111. <dd><p>Specify display mode.
  49112. </p>
  49113. <p>It accepts the following values:
  49114. </p><dl compact="compact">
  49115. <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
  49116. <dd><p>all channels are displayed in the same row
  49117. </p></dd>
  49118. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  49119. <dd><p>all channels are displayed in separate rows
  49120. </p></dd>
  49121. </dl>
  49122. <p>Default value is &lsquo;<samp>combined</samp>&rsquo;.
  49123. </p>
  49124. </dd>
  49125. <dt><samp>color</samp></dt>
  49126. <dd><p>Specify display color mode.
  49127. </p>
  49128. <p>It accepts the following values:
  49129. </p><dl compact="compact">
  49130. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  49131. <dd><p>each channel is displayed in a separate color
  49132. </p></dd>
  49133. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  49134. <dd><p>each channel is displayed using the same color scheme
  49135. </p></dd>
  49136. <dt>&lsquo;<samp>rainbow</samp>&rsquo;</dt>
  49137. <dd><p>each channel is displayed using the rainbow color scheme
  49138. </p></dd>
  49139. <dt>&lsquo;<samp>moreland</samp>&rsquo;</dt>
  49140. <dd><p>each channel is displayed using the moreland color scheme
  49141. </p></dd>
  49142. <dt>&lsquo;<samp>nebulae</samp>&rsquo;</dt>
  49143. <dd><p>each channel is displayed using the nebulae color scheme
  49144. </p></dd>
  49145. <dt>&lsquo;<samp>fire</samp>&rsquo;</dt>
  49146. <dd><p>each channel is displayed using the fire color scheme
  49147. </p></dd>
  49148. <dt>&lsquo;<samp>fiery</samp>&rsquo;</dt>
  49149. <dd><p>each channel is displayed using the fiery color scheme
  49150. </p></dd>
  49151. <dt>&lsquo;<samp>fruit</samp>&rsquo;</dt>
  49152. <dd><p>each channel is displayed using the fruit color scheme
  49153. </p></dd>
  49154. <dt>&lsquo;<samp>cool</samp>&rsquo;</dt>
  49155. <dd><p>each channel is displayed using the cool color scheme
  49156. </p></dd>
  49157. <dt>&lsquo;<samp>magma</samp>&rsquo;</dt>
  49158. <dd><p>each channel is displayed using the magma color scheme
  49159. </p></dd>
  49160. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  49161. <dd><p>each channel is displayed using the green color scheme
  49162. </p></dd>
  49163. <dt>&lsquo;<samp>viridis</samp>&rsquo;</dt>
  49164. <dd><p>each channel is displayed using the viridis color scheme
  49165. </p></dd>
  49166. <dt>&lsquo;<samp>plasma</samp>&rsquo;</dt>
  49167. <dd><p>each channel is displayed using the plasma color scheme
  49168. </p></dd>
  49169. <dt>&lsquo;<samp>cividis</samp>&rsquo;</dt>
  49170. <dd><p>each channel is displayed using the cividis color scheme
  49171. </p></dd>
  49172. <dt>&lsquo;<samp>terrain</samp>&rsquo;</dt>
  49173. <dd><p>each channel is displayed using the terrain color scheme
  49174. </p></dd>
  49175. </dl>
  49176. <p>Default value is &lsquo;<samp>intensity</samp>&rsquo;.
  49177. </p>
  49178. </dd>
  49179. <dt><samp>scale</samp></dt>
  49180. <dd><p>Specify scale used for calculating intensity color values.
  49181. </p>
  49182. <p>It accepts the following values:
  49183. </p><dl compact="compact">
  49184. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  49185. <dd><p>linear
  49186. </p></dd>
  49187. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  49188. <dd><p>square root, default
  49189. </p></dd>
  49190. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  49191. <dd><p>cubic root
  49192. </p></dd>
  49193. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  49194. <dd><p>logarithmic
  49195. </p></dd>
  49196. <dt>&lsquo;<samp>4thrt</samp>&rsquo;</dt>
  49197. <dd><p>4th root
  49198. </p></dd>
  49199. <dt>&lsquo;<samp>5thrt</samp>&rsquo;</dt>
  49200. <dd><p>5th root
  49201. </p></dd>
  49202. </dl>
  49203. <p>Default value is &lsquo;<samp>log</samp>&rsquo;.
  49204. </p>
  49205. </dd>
  49206. <dt><samp>fscale</samp></dt>
  49207. <dd><p>Specify frequency scale.
  49208. </p>
  49209. <p>It accepts the following values:
  49210. </p><dl compact="compact">
  49211. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  49212. <dd><p>linear
  49213. </p></dd>
  49214. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  49215. <dd><p>logarithmic
  49216. </p></dd>
  49217. </dl>
  49218. <p>Default value is &lsquo;<samp>lin</samp>&rsquo;.
  49219. </p>
  49220. </dd>
  49221. <dt><samp>saturation</samp></dt>
  49222. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  49223. alternative color scheme. <code>0</code> is no saturation at all.
  49224. Saturation must be in [-10.0, 10.0] range.
  49225. Default value is <code>1</code>.
  49226. </p>
  49227. </dd>
  49228. <dt><samp>win_func</samp></dt>
  49229. <dd><p>Set window function.
  49230. </p>
  49231. <p>It accepts the following values:
  49232. </p><dl compact="compact">
  49233. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  49234. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  49235. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  49236. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  49237. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  49238. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  49239. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  49240. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  49241. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  49242. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  49243. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  49244. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  49245. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  49246. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  49247. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  49248. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  49249. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  49250. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  49251. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  49252. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  49253. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  49254. </dl>
  49255. <p>Default value is <code>hann</code>.
  49256. </p>
  49257. </dd>
  49258. <dt><samp>orientation</samp></dt>
  49259. <dd><p>Set orientation of time vs frequency axis. Can be <code>vertical</code> or
  49260. <code>horizontal</code>. Default is <code>vertical</code>.
  49261. </p>
  49262. </dd>
  49263. <dt><samp>gain</samp></dt>
  49264. <dd><p>Set scale gain for calculating intensity color values.
  49265. Default value is <code>1</code>.
  49266. </p>
  49267. </dd>
  49268. <dt><samp>legend</samp></dt>
  49269. <dd><p>Draw time and frequency axes and legends. Default is enabled.
  49270. </p>
  49271. </dd>
  49272. <dt><samp>rotation</samp></dt>
  49273. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  49274. Default value is <code>0</code>.
  49275. </p>
  49276. </dd>
  49277. <dt><samp>start</samp></dt>
  49278. <dd><p>Set start frequency from which to display spectrogram. Default is <code>0</code>.
  49279. </p>
  49280. </dd>
  49281. <dt><samp>stop</samp></dt>
  49282. <dd><p>Set stop frequency to which to display spectrogram. Default is <code>0</code>.
  49283. </p></dd>
  49284. </dl>
  49285. <a name="Examples-186"></a>
  49286. <h4 class="subsection">44.23.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-186" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-186" aria-hidden="true">TOC</a></span></h4>
  49287. <ul>
  49288. <li> Extract an audio spectrogram of a whole audio track
  49289. in a 1024x1024 picture using <code>ffmpeg</code>:
  49290. <div class="example">
  49291. <pre class="example">ffmpeg -i audio.flac -lavfi showspectrumpic=s=1024x1024 spectrogram.png
  49292. </pre></div>
  49293. </li></ul>
  49294. <a name="showvolume"></a>
  49295. <h3 class="section">44.24 showvolume<span class="pull-right"><a class="anchor hidden-xs" href="#showvolume" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showvolume" aria-hidden="true">TOC</a></span></h3>
  49296. <p>Convert input audio volume to a video output.
  49297. </p>
  49298. <p>The filter accepts the following options:
  49299. </p>
  49300. <dl compact="compact">
  49301. <dt><samp>rate, r</samp></dt>
  49302. <dd><p>Set video rate.
  49303. </p>
  49304. </dd>
  49305. <dt><samp>b</samp></dt>
  49306. <dd><p>Set border width, allowed range is [0, 5]. Default is 1.
  49307. </p>
  49308. </dd>
  49309. <dt><samp>w</samp></dt>
  49310. <dd><p>Set channel width, allowed range is [80, 8192]. Default is 400.
  49311. </p>
  49312. </dd>
  49313. <dt><samp>h</samp></dt>
  49314. <dd><p>Set channel height, allowed range is [1, 900]. Default is 20.
  49315. </p>
  49316. </dd>
  49317. <dt><samp>f</samp></dt>
  49318. <dd><p>Set fade, allowed range is [0, 1]. Default is 0.95.
  49319. </p>
  49320. </dd>
  49321. <dt><samp>c</samp></dt>
  49322. <dd><p>Set volume color expression.
  49323. </p>
  49324. <p>The expression can use the following variables:
  49325. </p>
  49326. <dl compact="compact">
  49327. <dt><samp>VOLUME</samp></dt>
  49328. <dd><p>Current max volume of channel in dB.
  49329. </p>
  49330. </dd>
  49331. <dt><samp>PEAK</samp></dt>
  49332. <dd><p>Current peak.
  49333. </p>
  49334. </dd>
  49335. <dt><samp>CHANNEL</samp></dt>
  49336. <dd><p>Current channel number, starting from 0.
  49337. </p></dd>
  49338. </dl>
  49339. </dd>
  49340. <dt><samp>t</samp></dt>
  49341. <dd><p>If set, displays channel names. Default is enabled.
  49342. </p>
  49343. </dd>
  49344. <dt><samp>v</samp></dt>
  49345. <dd><p>If set, displays volume values. Default is enabled.
  49346. </p>
  49347. </dd>
  49348. <dt><samp>o</samp></dt>
  49349. <dd><p>Set orientation, can be horizontal: <code>h</code> or vertical: <code>v</code>,
  49350. default is <code>h</code>.
  49351. </p>
  49352. </dd>
  49353. <dt><samp>s</samp></dt>
  49354. <dd><p>Set step size, allowed range is [0, 5]. Default is 0, which means
  49355. step is disabled.
  49356. </p>
  49357. </dd>
  49358. <dt><samp>p</samp></dt>
  49359. <dd><p>Set background opacity, allowed range is [0, 1]. Default is 0.
  49360. </p>
  49361. </dd>
  49362. <dt><samp>m</samp></dt>
  49363. <dd><p>Set metering mode, can be peak: <code>p</code> or rms: <code>r</code>,
  49364. default is <code>p</code>.
  49365. </p>
  49366. </dd>
  49367. <dt><samp>ds</samp></dt>
  49368. <dd><p>Set display scale, can be linear: <code>lin</code> or log: <code>log</code>,
  49369. default is <code>lin</code>.
  49370. </p>
  49371. </dd>
  49372. <dt><samp>dm</samp></dt>
  49373. <dd><p>In second.
  49374. If set to &gt; 0., display a line for the max level
  49375. in the previous seconds.
  49376. default is disabled: <code>0.</code>
  49377. </p>
  49378. </dd>
  49379. <dt><samp>dmc</samp></dt>
  49380. <dd><p>The color of the max line. Use when <code>dm</code> option is set to &gt; 0.
  49381. default is: <code>orange</code>
  49382. </p></dd>
  49383. </dl>
  49384. <a name="showwaves"></a>
  49385. <h3 class="section">44.25 showwaves<span class="pull-right"><a class="anchor hidden-xs" href="#showwaves" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showwaves" aria-hidden="true">TOC</a></span></h3>
  49386. <p>Convert input audio to a video output, representing the samples waves.
  49387. </p>
  49388. <p>The filter accepts the following options:
  49389. </p>
  49390. <dl compact="compact">
  49391. <dt><samp>size, s</samp></dt>
  49392. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  49393. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  49394. Default value is <code>600x240</code>.
  49395. </p>
  49396. </dd>
  49397. <dt><samp>mode</samp></dt>
  49398. <dd><p>Set display mode.
  49399. </p>
  49400. <p>Available values are:
  49401. </p><dl compact="compact">
  49402. <dt>&lsquo;<samp>point</samp>&rsquo;</dt>
  49403. <dd><p>Draw a point for each sample.
  49404. </p>
  49405. </dd>
  49406. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  49407. <dd><p>Draw a vertical line for each sample.
  49408. </p>
  49409. </dd>
  49410. <dt>&lsquo;<samp>p2p</samp>&rsquo;</dt>
  49411. <dd><p>Draw a point for each sample and a line between them.
  49412. </p>
  49413. </dd>
  49414. <dt>&lsquo;<samp>cline</samp>&rsquo;</dt>
  49415. <dd><p>Draw a centered vertical line for each sample.
  49416. </p></dd>
  49417. </dl>
  49418. <p>Default value is <code>point</code>.
  49419. </p>
  49420. </dd>
  49421. <dt><samp>n</samp></dt>
  49422. <dd><p>Set the number of samples which are printed on the same column. A
  49423. larger value will decrease the frame rate. Must be a positive
  49424. integer. This option can be set only if the value for <var>rate</var>
  49425. is not explicitly specified.
  49426. </p>
  49427. </dd>
  49428. <dt><samp>rate, r</samp></dt>
  49429. <dd><p>Set the (approximate) output frame rate. This is done by setting the
  49430. option <var>n</var>. Default value is &quot;25&quot;.
  49431. </p>
  49432. </dd>
  49433. <dt><samp>split_channels</samp></dt>
  49434. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  49435. </p>
  49436. </dd>
  49437. <dt><samp>colors</samp></dt>
  49438. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  49439. </p>
  49440. </dd>
  49441. <dt><samp>scale</samp></dt>
  49442. <dd><p>Set amplitude scale.
  49443. </p>
  49444. <p>Available values are:
  49445. </p><dl compact="compact">
  49446. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  49447. <dd><p>Linear.
  49448. </p>
  49449. </dd>
  49450. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  49451. <dd><p>Logarithmic.
  49452. </p>
  49453. </dd>
  49454. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  49455. <dd><p>Square root.
  49456. </p>
  49457. </dd>
  49458. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  49459. <dd><p>Cubic root.
  49460. </p></dd>
  49461. </dl>
  49462. <p>Default is linear.
  49463. </p>
  49464. </dd>
  49465. <dt><samp>draw</samp></dt>
  49466. <dd><p>Set the draw mode. This is mostly useful to set for high <var>n</var>.
  49467. </p>
  49468. <p>Available values are:
  49469. </p><dl compact="compact">
  49470. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  49471. <dd><p>Scale pixel values for each drawn sample.
  49472. </p>
  49473. </dd>
  49474. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  49475. <dd><p>Draw every sample directly.
  49476. </p></dd>
  49477. </dl>
  49478. <p>Default value is <code>scale</code>.
  49479. </p></dd>
  49480. </dl>
  49481. <a name="Examples-187"></a>
  49482. <h4 class="subsection">44.25.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-187" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-187" aria-hidden="true">TOC</a></span></h4>
  49483. <ul>
  49484. <li> Output the input file audio and the corresponding video representation
  49485. at the same time:
  49486. <div class="example">
  49487. <pre class="example">amovie=a.mp3,asplit[out0],showwaves[out1]
  49488. </pre></div>
  49489. </li><li> Create a synthetic signal and show it with showwaves, forcing a
  49490. frame rate of 30 frames per second:
  49491. <div class="example">
  49492. <pre class="example">aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
  49493. </pre></div>
  49494. </li></ul>
  49495. <a name="showwavespic"></a>
  49496. <h3 class="section">44.26 showwavespic<span class="pull-right"><a class="anchor hidden-xs" href="#showwavespic" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showwavespic" aria-hidden="true">TOC</a></span></h3>
  49497. <p>Convert input audio to a single video frame, representing the samples waves.
  49498. </p>
  49499. <p>The filter accepts the following options:
  49500. </p>
  49501. <dl compact="compact">
  49502. <dt><samp>size, s</samp></dt>
  49503. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  49504. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  49505. Default value is <code>600x240</code>.
  49506. </p>
  49507. </dd>
  49508. <dt><samp>split_channels</samp></dt>
  49509. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  49510. </p>
  49511. </dd>
  49512. <dt><samp>colors</samp></dt>
  49513. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  49514. </p>
  49515. </dd>
  49516. <dt><samp>scale</samp></dt>
  49517. <dd><p>Set amplitude scale.
  49518. </p>
  49519. <p>Available values are:
  49520. </p><dl compact="compact">
  49521. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  49522. <dd><p>Linear.
  49523. </p>
  49524. </dd>
  49525. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  49526. <dd><p>Logarithmic.
  49527. </p>
  49528. </dd>
  49529. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  49530. <dd><p>Square root.
  49531. </p>
  49532. </dd>
  49533. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  49534. <dd><p>Cubic root.
  49535. </p></dd>
  49536. </dl>
  49537. <p>Default is linear.
  49538. </p>
  49539. </dd>
  49540. <dt><samp>draw</samp></dt>
  49541. <dd><p>Set the draw mode.
  49542. </p>
  49543. <p>Available values are:
  49544. </p><dl compact="compact">
  49545. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  49546. <dd><p>Scale pixel values for each drawn sample.
  49547. </p>
  49548. </dd>
  49549. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  49550. <dd><p>Draw every sample directly.
  49551. </p></dd>
  49552. </dl>
  49553. <p>Default value is <code>scale</code>.
  49554. </p>
  49555. </dd>
  49556. <dt><samp>filter</samp></dt>
  49557. <dd><p>Set the filter mode.
  49558. </p>
  49559. <p>Available values are:
  49560. </p><dl compact="compact">
  49561. <dt>&lsquo;<samp>average</samp>&rsquo;</dt>
  49562. <dd><p>Use average samples values for each drawn sample.
  49563. </p>
  49564. </dd>
  49565. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  49566. <dd><p>Use peak samples values for each drawn sample.
  49567. </p></dd>
  49568. </dl>
  49569. <p>Default value is <code>average</code>.
  49570. </p></dd>
  49571. </dl>
  49572. <a name="Examples-188"></a>
  49573. <h4 class="subsection">44.26.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-188" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-188" aria-hidden="true">TOC</a></span></h4>
  49574. <ul>
  49575. <li> Extract a channel split representation of the wave form of a whole audio track
  49576. in a 1024x800 picture using <code>ffmpeg</code>:
  49577. <div class="example">
  49578. <pre class="example">ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
  49579. </pre></div>
  49580. </li></ul>
  49581. <a name="sidedata_002c-asidedata"></a>
  49582. <h3 class="section">44.27 sidedata, asidedata<span class="pull-right"><a class="anchor hidden-xs" href="#sidedata_002c-asidedata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sidedata_002c-asidedata" aria-hidden="true">TOC</a></span></h3>
  49583. <p>Delete frame side data, or select frames based on it.
  49584. </p>
  49585. <p>This filter accepts the following options:
  49586. </p>
  49587. <dl compact="compact">
  49588. <dt><samp>mode</samp></dt>
  49589. <dd><p>Set mode of operation of the filter.
  49590. </p>
  49591. <p>Can be one of the following:
  49592. </p>
  49593. <dl compact="compact">
  49594. <dt>&lsquo;<samp>select</samp>&rsquo;</dt>
  49595. <dd><p>Select every frame with side data of <code>type</code>.
  49596. </p>
  49597. </dd>
  49598. <dt>&lsquo;<samp>delete</samp>&rsquo;</dt>
  49599. <dd><p>Delete side data of <code>type</code>. If <code>type</code> is not set, delete all side
  49600. data in the frame.
  49601. </p>
  49602. </dd>
  49603. </dl>
  49604. </dd>
  49605. <dt><samp>type</samp></dt>
  49606. <dd><p>Set side data type used with all modes. Must be set for <code>select</code> mode. For
  49607. the list of frame side data types, refer to the <code>AVFrameSideDataType</code> enum
  49608. in <samp>libavutil/frame.h</samp>. For example, to choose
  49609. <code>AV_FRAME_DATA_PANSCAN</code> side data, you must specify <code>PANSCAN</code>.
  49610. </p>
  49611. </dd>
  49612. </dl>
  49613. <a name="spectrumsynth"></a>
  49614. <h3 class="section">44.28 spectrumsynth<span class="pull-right"><a class="anchor hidden-xs" href="#spectrumsynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-spectrumsynth" aria-hidden="true">TOC</a></span></h3>
  49615. <p>Synthesize audio from 2 input video spectrums, first input stream represents
  49616. magnitude across time and second represents phase across time.
  49617. The filter will transform from frequency domain as displayed in videos back
  49618. to time domain as presented in audio output.
  49619. </p>
  49620. <p>This filter is primarily created for reversing processed <a href="#showspectrum">showspectrum</a>
  49621. filter outputs, but can synthesize sound from other spectrograms too.
  49622. But in such case results are going to be poor if the phase data is not
  49623. available, because in such cases phase data need to be recreated, usually
  49624. it&rsquo;s just recreated from random noise.
  49625. For best results use gray only output (<code>channel</code> color mode in
  49626. <a href="#showspectrum">showspectrum</a> filter) and <code>log</code> scale for magnitude video and
  49627. <code>lin</code> scale for phase video. To produce phase, for 2nd video, use
  49628. <code>data</code> option. Inputs videos should generally use <code>fullframe</code>
  49629. slide mode as that saves resources needed for decoding video.
  49630. </p>
  49631. <p>The filter accepts the following options:
  49632. </p>
  49633. <dl compact="compact">
  49634. <dt><samp>sample_rate</samp></dt>
  49635. <dd><p>Specify sample rate of output audio, the sample rate of audio from which
  49636. spectrum was generated may differ.
  49637. </p>
  49638. </dd>
  49639. <dt><samp>channels</samp></dt>
  49640. <dd><p>Set number of channels represented in input video spectrums.
  49641. </p>
  49642. </dd>
  49643. <dt><samp>scale</samp></dt>
  49644. <dd><p>Set scale which was used when generating magnitude input spectrum.
  49645. Can be <code>lin</code> or <code>log</code>. Default is <code>log</code>.
  49646. </p>
  49647. </dd>
  49648. <dt><samp>slide</samp></dt>
  49649. <dd><p>Set slide which was used when generating inputs spectrums.
  49650. Can be <code>replace</code>, <code>scroll</code>, <code>fullframe</code> or <code>rscroll</code>.
  49651. Default is <code>fullframe</code>.
  49652. </p>
  49653. </dd>
  49654. <dt><samp>win_func</samp></dt>
  49655. <dd><p>Set window function used for resynthesis.
  49656. </p>
  49657. </dd>
  49658. <dt><samp>overlap</samp></dt>
  49659. <dd><p>Set window overlap. In range <code>[0, 1]</code>. Default is <code>1</code>,
  49660. which means optimal overlap for selected window function will be picked.
  49661. </p>
  49662. </dd>
  49663. <dt><samp>orientation</samp></dt>
  49664. <dd><p>Set orientation of input videos. Can be <code>vertical</code> or <code>horizontal</code>.
  49665. Default is <code>vertical</code>.
  49666. </p></dd>
  49667. </dl>
  49668. <a name="Examples-189"></a>
  49669. <h4 class="subsection">44.28.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-189" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-189" aria-hidden="true">TOC</a></span></h4>
  49670. <ul>
  49671. <li> First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate,
  49672. then resynthesize videos back to audio with spectrumsynth:
  49673. <div class="example">
  49674. <pre class="example">ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=log:overlap=0.875:color=channel:slide=fullframe:data=magnitude -an -c:v rawvideo magnitude.nut
  49675. 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
  49676. ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
  49677. </pre></div>
  49678. </li></ul>
  49679. <a name="split_002c-asplit"></a>
  49680. <h3 class="section">44.29 split, asplit<span class="pull-right"><a class="anchor hidden-xs" href="#split_002c-asplit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-split_002c-asplit" aria-hidden="true">TOC</a></span></h3>
  49681. <p>Split input into several identical outputs.
  49682. </p>
  49683. <p><code>asplit</code> works with audio input, <code>split</code> with video.
  49684. </p>
  49685. <p>The filter accepts a single parameter which specifies the number of outputs. If
  49686. unspecified, it defaults to 2.
  49687. </p>
  49688. <a name="Examples-190"></a>
  49689. <h4 class="subsection">44.29.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-190" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-190" aria-hidden="true">TOC</a></span></h4>
  49690. <ul>
  49691. <li> Create two separate outputs from the same input:
  49692. <div class="example">
  49693. <pre class="example">[in] split [out0][out1]
  49694. </pre></div>
  49695. </li><li> To create 3 or more outputs, you need to specify the number of
  49696. outputs, like in:
  49697. <div class="example">
  49698. <pre class="example">[in] asplit=3 [out0][out1][out2]
  49699. </pre></div>
  49700. </li><li> Create two separate outputs from the same input, one cropped and
  49701. one padded:
  49702. <div class="example">
  49703. <pre class="example">[in] split [splitout1][splitout2];
  49704. [splitout1] crop=100:100:0:0 [cropout];
  49705. [splitout2] pad=200:200:100:100 [padout];
  49706. </pre></div>
  49707. </li><li> Create 5 copies of the input audio with <code>ffmpeg</code>:
  49708. <div class="example">
  49709. <pre class="example">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
  49710. </pre></div>
  49711. </li></ul>
  49712. <a name="zmq_002c-azmq"></a>
  49713. <h3 class="section">44.30 zmq, azmq<span class="pull-right"><a class="anchor hidden-xs" href="#zmq_002c-azmq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zmq_002c-azmq" aria-hidden="true">TOC</a></span></h3>
  49714. <p>Receive commands sent through a libzmq client, and forward them to
  49715. filters in the filtergraph.
  49716. </p>
  49717. <p><code>zmq</code> and <code>azmq</code> work as a pass-through filters. <code>zmq</code>
  49718. must be inserted between two video filters, <code>azmq</code> between two
  49719. audio filters. Both are capable to send messages to any filter type.
  49720. </p>
  49721. <p>To enable these filters you need to install the libzmq library and
  49722. headers and configure FFmpeg with <code>--enable-libzmq</code>.
  49723. </p>
  49724. <p>For more information about libzmq see:
  49725. <a href="http://www.zeromq.org/">http://www.zeromq.org/</a>
  49726. </p>
  49727. <p>The <code>zmq</code> and <code>azmq</code> filters work as a libzmq server, which
  49728. receives messages sent through a network interface defined by the
  49729. <samp>bind_address</samp> (or the abbreviation &quot;<samp>b</samp>&quot;) option.
  49730. Default value of this option is <samp>tcp://localhost:5555</samp>. You may
  49731. want to alter this value to your needs, but do not forget to escape any
  49732. &rsquo;:&rsquo; signs (see <a href="#filtergraph-escaping">filtergraph escaping</a>).
  49733. </p>
  49734. <p>The received message must be in the form:
  49735. </p><div class="example">
  49736. <pre class="example"><var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
  49737. </pre></div>
  49738. <p><var>TARGET</var> specifies the target of the command, usually the name of
  49739. the filter class or a specific filter instance name. The default
  49740. filter instance name uses the pattern &lsquo;<samp>Parsed_&lt;filter_name&gt;_&lt;index&gt;</samp>&rsquo;,
  49741. but you can override this by using the &lsquo;<samp>filter_name@id</samp>&rsquo; syntax
  49742. (see <a href="#Filtergraph-syntax">Filtergraph syntax</a>).
  49743. </p>
  49744. <p><var>COMMAND</var> specifies the name of the command for the target filter.
  49745. </p>
  49746. <p><var>ARG</var> is optional and specifies the optional argument list for the
  49747. given <var>COMMAND</var>.
  49748. </p>
  49749. <p>Upon reception, the message is processed and the corresponding command
  49750. is injected into the filtergraph. Depending on the result, the filter
  49751. will send a reply to the client, adopting the format:
  49752. </p><div class="example">
  49753. <pre class="example"><var>ERROR_CODE</var> <var>ERROR_REASON</var>
  49754. <var>MESSAGE</var>
  49755. </pre></div>
  49756. <p><var>MESSAGE</var> is optional.
  49757. </p>
  49758. <a name="Examples-191"></a>
  49759. <h4 class="subsection">44.30.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-191" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-191" aria-hidden="true">TOC</a></span></h4>
  49760. <p>Look at <samp>tools/zmqsend</samp> for an example of a zmq client which can
  49761. be used to send commands processed by these filters.
  49762. </p>
  49763. <p>Consider the following filtergraph generated by <code>ffplay</code>.
  49764. In this example the last overlay filter has an instance name. All other
  49765. filters will have default instance names.
  49766. </p>
  49767. <div class="example">
  49768. <pre class="example">ffplay -dumpgraph 1 -f lavfi &quot;
  49769. color=s=100x100:c=red [l];
  49770. color=s=100x100:c=blue [r];
  49771. nullsrc=s=200x100, zmq [bg];
  49772. [bg][l] overlay [bg+l];
  49773. [bg+l][r] overlay@my=x=100 &quot;
  49774. </pre></div>
  49775. <p>To change the color of the left side of the video, the following
  49776. command can be used:
  49777. </p><div class="example">
  49778. <pre class="example">echo Parsed_color_0 c yellow | tools/zmqsend
  49779. </pre></div>
  49780. <p>To change the right side:
  49781. </p><div class="example">
  49782. <pre class="example">echo Parsed_color_1 c pink | tools/zmqsend
  49783. </pre></div>
  49784. <p>To change the position of the right side:
  49785. </p><div class="example">
  49786. <pre class="example">echo overlay@my x 150 | tools/zmqsend
  49787. </pre></div>
  49788. <a name="Multimedia-Sources"></a>
  49789. <h2 class="chapter">45 Multimedia Sources<span class="pull-right"><a class="anchor hidden-xs" href="#Multimedia-Sources" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Multimedia-Sources" aria-hidden="true">TOC</a></span></h2>
  49790. <p>Below is a description of the currently available multimedia sources.
  49791. </p>
  49792. <a name="amovie"></a>
  49793. <h3 class="section">45.1 amovie<span class="pull-right"><a class="anchor hidden-xs" href="#amovie" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amovie" aria-hidden="true">TOC</a></span></h3>
  49794. <p>This is the same as <a href="#movie">movie</a> source, except it selects an audio
  49795. stream by default.
  49796. </p>
  49797. <span id="movie"></span><a name="movie-1"></a>
  49798. <h3 class="section">45.2 movie<span class="pull-right"><a class="anchor hidden-xs" href="#movie-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-movie-1" aria-hidden="true">TOC</a></span></h3>
  49799. <p>Read audio and/or video stream(s) from a movie container.
  49800. </p>
  49801. <p>It accepts the following parameters:
  49802. </p>
  49803. <dl compact="compact">
  49804. <dt><samp>filename</samp></dt>
  49805. <dd><p>The name of the resource to read (not necessarily a file; it can also be a
  49806. device or a stream accessed through some protocol).
  49807. </p>
  49808. </dd>
  49809. <dt><samp>format_name, f</samp></dt>
  49810. <dd><p>Specifies the format assumed for the movie to read, and can be either
  49811. the name of a container or an input device. If not specified, the
  49812. format is guessed from <var>movie_name</var> or by probing.
  49813. </p>
  49814. </dd>
  49815. <dt><samp>seek_point, sp</samp></dt>
  49816. <dd><p>Specifies the seek point in seconds. The frames will be output
  49817. starting from this seek point. The parameter is evaluated with
  49818. <code>av_strtod</code>, so the numerical value may be suffixed by an IS
  49819. postfix. The default value is &quot;0&quot;.
  49820. </p>
  49821. </dd>
  49822. <dt><samp>streams, s</samp></dt>
  49823. <dd><p>Specifies the streams to read. Several streams can be specified,
  49824. separated by &quot;+&quot;. The source will then have as many outputs, in the
  49825. same order. The syntax is explained in the <a href="ffmpeg.html#Stream-specifiers">(ffmpeg)&quot;Stream specifiers&quot;
  49826. section in the ffmpeg manual</a>. Two special names, &quot;dv&quot; and &quot;da&quot; specify
  49827. respectively the default (best suited) video and audio stream. Default
  49828. is &quot;dv&quot;, or &quot;da&quot; if the filter is called as &quot;amovie&quot;.
  49829. </p>
  49830. </dd>
  49831. <dt><samp>stream_index, si</samp></dt>
  49832. <dd><p>Specifies the index of the video stream to read. If the value is -1,
  49833. the most suitable video stream will be automatically selected. The default
  49834. value is &quot;-1&quot;. Deprecated. If the filter is called &quot;amovie&quot;, it will select
  49835. audio instead of video.
  49836. </p>
  49837. </dd>
  49838. <dt><samp>loop</samp></dt>
  49839. <dd><p>Specifies how many times to read the stream in sequence.
  49840. If the value is 0, the stream will be looped infinitely.
  49841. Default value is &quot;1&quot;.
  49842. </p>
  49843. <p>Note that when the movie is looped the source timestamps are not
  49844. changed, so it will generate non monotonically increasing timestamps.
  49845. </p>
  49846. </dd>
  49847. <dt><samp>discontinuity</samp></dt>
  49848. <dd><p>Specifies the time difference between frames above which the point is
  49849. considered a timestamp discontinuity which is removed by adjusting the later
  49850. timestamps.
  49851. </p></dd>
  49852. </dl>
  49853. <p>It allows overlaying a second video on top of the main input of
  49854. a filtergraph, as shown in this graph:
  49855. </p><div class="example">
  49856. <pre class="example">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
  49857. ^
  49858. |
  49859. movie --&gt; scale--&gt; deltapts1 -------+
  49860. </pre></div>
  49861. <a name="Examples-192"></a>
  49862. <h4 class="subsection">45.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-192" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-192" aria-hidden="true">TOC</a></span></h4>
  49863. <ul>
  49864. <li> Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it
  49865. on top of the input labelled &quot;in&quot;:
  49866. <div class="example">
  49867. <pre class="example">movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
  49868. [in] setpts=PTS-STARTPTS [main];
  49869. [main][over] overlay=16:16 [out]
  49870. </pre></div>
  49871. </li><li> Read from a video4linux2 device, and overlay it on top of the input
  49872. labelled &quot;in&quot;:
  49873. <div class="example">
  49874. <pre class="example">movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
  49875. [in] setpts=PTS-STARTPTS [main];
  49876. [main][over] overlay=16:16 [out]
  49877. </pre></div>
  49878. </li><li> Read the first video stream and the audio stream with id 0x81 from
  49879. dvd.vob; the video is connected to the pad named &quot;video&quot; and the audio is
  49880. connected to the pad named &quot;audio&quot;:
  49881. <div class="example">
  49882. <pre class="example">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
  49883. </pre></div>
  49884. </li></ul>
  49885. <a name="Commands-137"></a>
  49886. <h4 class="subsection">45.2.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-137" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-137" aria-hidden="true">TOC</a></span></h4>
  49887. <p>Both movie and amovie support the following commands:
  49888. </p><dl compact="compact">
  49889. <dt><samp>seek</samp></dt>
  49890. <dd><p>Perform seek using &quot;av_seek_frame&quot;.
  49891. The syntax is: seek <var>stream_index</var>|<var>timestamp</var>|<var>flags</var>
  49892. </p><ul>
  49893. <li> <var>stream_index</var>: If stream_index is -1, a default
  49894. stream is selected, and <var>timestamp</var> is automatically converted
  49895. from AV_TIME_BASE units to the stream specific time_base.
  49896. </li><li> <var>timestamp</var>: Timestamp in AVStream.time_base units
  49897. or, if no stream is specified, in AV_TIME_BASE units.
  49898. </li><li> <var>flags</var>: Flags which select direction and seeking mode.
  49899. </li></ul>
  49900. </dd>
  49901. <dt><samp>get_duration</samp></dt>
  49902. <dd><p>Get movie duration in AV_TIME_BASE units.
  49903. </p>
  49904. </dd>
  49905. </dl>
  49906. <a name="External-libraries"></a>
  49907. <h2 class="chapter">46 External libraries<span class="pull-right"><a class="anchor hidden-xs" href="#External-libraries" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-External-libraries" aria-hidden="true">TOC</a></span></h2>
  49908. <p>FFmpeg can be hooked up with a number of external libraries to add support
  49909. for more formats. None of them are used by default, their use has to be
  49910. explicitly requested by passing the appropriate flags to
  49911. <code>./configure</code>.
  49912. </p>
  49913. <a name="Alliance-for-Open-Media-_0028AOM_0029"></a>
  49914. <h3 class="section">46.1 Alliance for Open Media (AOM)<span class="pull-right"><a class="anchor hidden-xs" href="#Alliance-for-Open-Media-_0028AOM_0029" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Alliance-for-Open-Media-_0028AOM_0029" aria-hidden="true">TOC</a></span></h3>
  49915. <p>FFmpeg can make use of the AOM library for AV1 decoding and encoding.
  49916. </p>
  49917. <p>Go to <a href="http://aomedia.org/">http://aomedia.org/</a> and follow the instructions for
  49918. installing the library. Then pass <code>--enable-libaom</code> to configure to
  49919. enable it.
  49920. </p>
  49921. <a name="AMD-AMF_002fVCE"></a>
  49922. <h3 class="section">46.2 AMD AMF/VCE<span class="pull-right"><a class="anchor hidden-xs" href="#AMD-AMF_002fVCE" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AMD-AMF_002fVCE" aria-hidden="true">TOC</a></span></h3>
  49923. <p>FFmpeg can use the AMD Advanced Media Framework library
  49924. for accelerated H.264 and HEVC(only windows) encoding on hardware with Video Coding Engine (VCE).
  49925. </p>
  49926. <p>To enable support you must obtain the AMF framework header files(version 1.4.9+) from
  49927. <a href="https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git">https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git</a>.
  49928. </p>
  49929. <p>Create an <code>AMF/</code> directory in the system include path.
  49930. Copy the contents of <code>AMF/amf/public/include/</code> into that directory.
  49931. Then configure FFmpeg with <code>--enable-amf</code>.
  49932. </p>
  49933. <p>Initialization of amf encoder occurs in this order:
  49934. 1) trying to initialize through dx11(only windows)
  49935. 2) trying to initialize through dx9(only windows)
  49936. 3) trying to initialize through vulkan
  49937. </p>
  49938. <p>To use h.264(AMD VCE) encoder on linux amdgru-pro version 19.20+ and amf-amdgpu-pro
  49939. package(amdgru-pro contains, but does not install automatically) are required.
  49940. </p>
  49941. <p>This driver can be installed using amdgpu-pro-install script in official amd driver archive.
  49942. </p>
  49943. <a name="AviSynth"></a>
  49944. <h3 class="section">46.3 AviSynth<span class="pull-right"><a class="anchor hidden-xs" href="#AviSynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AviSynth" aria-hidden="true">TOC</a></span></h3>
  49945. <p>FFmpeg can read AviSynth scripts as input. To enable support, pass
  49946. <code>--enable-avisynth</code> to configure after installing the headers
  49947. provided by <a href="https://github.com/AviSynth/AviSynthPlus">AviSynth+</a>.
  49948. AviSynth+ can be configured to install only the headers by either
  49949. passing <code>-DHEADERS_ONLY:bool=on</code> to the normal CMake-based build
  49950. system, or by using the supplied <code>GNUmakefile</code>.
  49951. </p>
  49952. <p>For Windows, supported AviSynth variants are
  49953. <a href="http://avisynth.nl">AviSynth 2.6 RC1 or higher</a> for 32-bit builds and
  49954. <a href="http://avisynth.nl/index.php/AviSynth+">AviSynth+ r1718 or higher</a> for 32-bit and 64-bit builds.
  49955. </p>
  49956. <p>For Linux, macOS, and BSD, the only supported AviSynth variant is
  49957. <a href="https://github.com/AviSynth/AviSynthPlus">AviSynth+</a>, starting with version 3.5.
  49958. </p>
  49959. <div class="info">
  49960. <p>In 2016, AviSynth+ added support for building with GCC. However, due to
  49961. the eccentricities of Windows&rsquo; calling conventions, 32-bit GCC builds
  49962. of AviSynth+ are not compatible with typical 32-bit builds of FFmpeg.
  49963. </p>
  49964. <p>By default, FFmpeg assumes compatibility with 32-bit MSVC builds of
  49965. AviSynth+ since that is the most widely-used and entrenched build
  49966. configuration. Users can override this and enable support for 32-bit
  49967. GCC builds of AviSynth+ by passing <code>-DAVSC_WIN32_GCC32</code> to
  49968. <code>--extra-cflags</code> when configuring FFmpeg.
  49969. </p>
  49970. <p>64-bit builds of FFmpeg are not affected, and can use either MSVC or
  49971. GCC builds of AviSynth+ without any special flags.
  49972. </p></div>
  49973. <div class="info">
  49974. <p>AviSynth(+) is loaded dynamically. Distributors can build FFmpeg
  49975. with <code>--enable-avisynth</code>, and the binaries will work regardless
  49976. of the end user having AviSynth installed. If/when an end user
  49977. would like to use AviSynth scripts, then they can install AviSynth(+)
  49978. and FFmpeg will be able to find and use it to open scripts.
  49979. </p></div>
  49980. <a name="Chromaprint"></a>
  49981. <h3 class="section">46.4 Chromaprint<span class="pull-right"><a class="anchor hidden-xs" href="#Chromaprint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Chromaprint" aria-hidden="true">TOC</a></span></h3>
  49982. <p>FFmpeg can make use of the Chromaprint library for generating audio fingerprints.
  49983. Pass <code>--enable-chromaprint</code> to configure to
  49984. enable it. See <a href="https://acoustid.org/chromaprint">https://acoustid.org/chromaprint</a>.
  49985. </p>
  49986. <a name="codec2"></a>
  49987. <h3 class="section">46.5 codec2<span class="pull-right"><a class="anchor hidden-xs" href="#codec2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-codec2" aria-hidden="true">TOC</a></span></h3>
  49988. <p>FFmpeg can make use of the codec2 library for codec2 decoding and encoding.
  49989. There is currently no native decoder, so libcodec2 must be used for decoding.
  49990. </p>
  49991. <p>Go to <a href="http://freedv.org/">http://freedv.org/</a>, download &quot;Codec 2 source archive&quot;.
  49992. Build and install using CMake. Debian users can install the libcodec2-dev package instead.
  49993. Once libcodec2 is installed you can pass <code>--enable-libcodec2</code> to configure to enable it.
  49994. </p>
  49995. <p>The easiest way to use codec2 is with .c2 files, since they contain the mode information required for decoding.
  49996. To encode such a file, use a .c2 file extension and give the libcodec2 encoder the -mode option:
  49997. <code>ffmpeg -i input.wav -mode 700C output.c2</code>.
  49998. Playback is as simple as <code>ffplay output.c2</code>.
  49999. For a list of supported modes, run <code>ffmpeg -h encoder=libcodec2</code>.
  50000. Raw codec2 files are also supported.
  50001. To make sense of them the mode in use needs to be specified as a format option:
  50002. <code>ffmpeg -f codec2raw -mode 1300 -i input.raw output.wav</code>.
  50003. </p>
  50004. <a name="dav1d"></a>
  50005. <h3 class="section">46.6 dav1d<span class="pull-right"><a class="anchor hidden-xs" href="#dav1d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dav1d" aria-hidden="true">TOC</a></span></h3>
  50006. <p>FFmpeg can make use of the dav1d library for AV1 video decoding.
  50007. </p>
  50008. <p>Go to <a href="https://code.videolan.org/videolan/dav1d">https://code.videolan.org/videolan/dav1d</a> and follow the instructions for
  50009. installing the library. Then pass <code>--enable-libdav1d</code> to configure to enable it.
  50010. </p>
  50011. <a name="davs2"></a>
  50012. <h3 class="section">46.7 davs2<span class="pull-right"><a class="anchor hidden-xs" href="#davs2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-davs2" aria-hidden="true">TOC</a></span></h3>
  50013. <p>FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video decoding.
  50014. </p>
  50015. <p>Go to <a href="https://github.com/pkuvcl/davs2">https://github.com/pkuvcl/davs2</a> and follow the instructions for
  50016. installing the library. Then pass <code>--enable-libdavs2</code> to configure to
  50017. enable it.
  50018. </p>
  50019. <div class="info">
  50020. <p>libdavs2 is under the GNU Public License Version 2 or later
  50021. (see <a 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
  50022. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  50023. </p></div>
  50024. <a name="uavs3d"></a>
  50025. <h3 class="section">46.8 uavs3d<span class="pull-right"><a class="anchor hidden-xs" href="#uavs3d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-uavs3d" aria-hidden="true">TOC</a></span></h3>
  50026. <p>FFmpeg can make use of the uavs3d library for AVS3-P2/IEEE1857.10 video decoding.
  50027. </p>
  50028. <p>Go to <a href="https://github.com/uavs3/uavs3d">https://github.com/uavs3/uavs3d</a> and follow the instructions for
  50029. installing the library. Then pass <code>--enable-libuavs3d</code> to configure to
  50030. enable it.
  50031. </p>
  50032. <a name="Game-Music-Emu"></a>
  50033. <h3 class="section">46.9 Game Music Emu<span class="pull-right"><a class="anchor hidden-xs" href="#Game-Music-Emu" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Game-Music-Emu" aria-hidden="true">TOC</a></span></h3>
  50034. <p>FFmpeg can make use of the Game Music Emu library to read audio from supported video game
  50035. music file formats. Pass <code>--enable-libgme</code> to configure to
  50036. enable it. See <a href="https://bitbucket.org/mpyne/game-music-emu/overview">https://bitbucket.org/mpyne/game-music-emu/overview</a>.
  50037. </p>
  50038. <a name="Intel-QuickSync-Video"></a>
  50039. <h3 class="section">46.10 Intel QuickSync Video<span class="pull-right"><a class="anchor hidden-xs" href="#Intel-QuickSync-Video" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Intel-QuickSync-Video" aria-hidden="true">TOC</a></span></h3>
  50040. <p>FFmpeg can use Intel QuickSync Video (QSV) for accelerated decoding and encoding
  50041. of multiple codecs. To use QSV, FFmpeg must be linked against the <code>libmfx</code>
  50042. dispatcher, which loads the actual decoding libraries.
  50043. </p>
  50044. <p>The dispatcher is open source and can be downloaded from
  50045. <a href="https://github.com/lu-zero/mfx_dispatch.git">https://github.com/lu-zero/mfx_dispatch.git</a>. FFmpeg needs to be configured
  50046. with the <code>--enable-libmfx</code> option and <code>pkg-config</code> needs to be able to
  50047. locate the dispatcher&rsquo;s <code>.pc</code> files.
  50048. </p>
  50049. <a name="Kvazaar"></a>
  50050. <h3 class="section">46.11 Kvazaar<span class="pull-right"><a class="anchor hidden-xs" href="#Kvazaar" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Kvazaar" aria-hidden="true">TOC</a></span></h3>
  50051. <p>FFmpeg can make use of the Kvazaar library for HEVC encoding.
  50052. </p>
  50053. <p>Go to <a href="https://github.com/ultravideo/kvazaar">https://github.com/ultravideo/kvazaar</a> and follow the
  50054. instructions for installing the library. Then pass
  50055. <code>--enable-libkvazaar</code> to configure to enable it.
  50056. </p>
  50057. <a name="LAME"></a>
  50058. <h3 class="section">46.12 LAME<span class="pull-right"><a class="anchor hidden-xs" href="#LAME" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-LAME" aria-hidden="true">TOC</a></span></h3>
  50059. <p>FFmpeg can make use of the LAME library for MP3 encoding.
  50060. </p>
  50061. <p>Go to <a href="http://lame.sourceforge.net/">http://lame.sourceforge.net/</a> and follow the
  50062. instructions for installing the library.
  50063. Then pass <code>--enable-libmp3lame</code> to configure to enable it.
  50064. </p>
  50065. <a name="libilbc-1"></a>
  50066. <h3 class="section">46.13 libilbc<span class="pull-right"><a class="anchor hidden-xs" href="#libilbc-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libilbc-1" aria-hidden="true">TOC</a></span></h3>
  50067. <p>iLBC is a narrowband speech codec that has been made freely available
  50068. by Google as part of the WebRTC project. libilbc is a packaging friendly
  50069. copy of the iLBC codec. FFmpeg can make use of the libilbc library for
  50070. iLBC decoding and encoding.
  50071. </p>
  50072. <p>Go to <a href="https://github.com/TimothyGu/libilbc">https://github.com/TimothyGu/libilbc</a> and follow the instructions for
  50073. installing the library. Then pass <code>--enable-libilbc</code> to configure to
  50074. enable it.
  50075. </p>
  50076. <a name="libvpx-1"></a>
  50077. <h3 class="section">46.14 libvpx<span class="pull-right"><a class="anchor hidden-xs" href="#libvpx-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvpx-1" aria-hidden="true">TOC</a></span></h3>
  50078. <p>FFmpeg can make use of the libvpx library for VP8/VP9 decoding and encoding.
  50079. </p>
  50080. <p>Go to <a href="http://www.webmproject.org/">http://www.webmproject.org/</a> and follow the instructions for
  50081. installing the library. Then pass <code>--enable-libvpx</code> to configure to
  50082. enable it.
  50083. </p>
  50084. <a name="ModPlug"></a>
  50085. <h3 class="section">46.15 ModPlug<span class="pull-right"><a class="anchor hidden-xs" href="#ModPlug" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ModPlug" aria-hidden="true">TOC</a></span></h3>
  50086. <p>FFmpeg can make use of this library, originating in Modplug-XMMS, to read from MOD-like music files.
  50087. See <a href="https://github.com/Konstanty/libmodplug">https://github.com/Konstanty/libmodplug</a>. Pass <code>--enable-libmodplug</code> to configure to
  50088. enable it.
  50089. </p>
  50090. <a name="OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries"></a>
  50091. <h3 class="section">46.16 OpenCORE, VisualOn, and Fraunhofer libraries<span class="pull-right"><a class="anchor hidden-xs" href="#OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenCORE_002c-VisualOn_002c-and-Fraunhofer-libraries" aria-hidden="true">TOC</a></span></h3>
  50092. <p>Spun off Google Android sources, OpenCore, VisualOn and Fraunhofer
  50093. libraries provide encoders for a number of audio codecs.
  50094. </p>
  50095. <div class="info">
  50096. <p>OpenCORE and VisualOn libraries are under the Apache License 2.0
  50097. (see <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a> for details), which is
  50098. incompatible to the LGPL version 2.1 and GPL version 2. You have to
  50099. upgrade FFmpeg&rsquo;s license to LGPL version 3 (or if you have enabled
  50100. GPL components, GPL version 3) by passing <code>--enable-version3</code> to configure in
  50101. order to use it.
  50102. </p>
  50103. <p>The license of the Fraunhofer AAC library is incompatible with the GPL.
  50104. Therefore, for GPL builds, you have to pass <code>--enable-nonfree</code> to
  50105. configure in order to use it. To the best of our knowledge, it is
  50106. compatible with the LGPL.
  50107. </p></div>
  50108. <a name="OpenCORE-AMR"></a>
  50109. <h4 class="subsection">46.16.1 OpenCORE AMR<span class="pull-right"><a class="anchor hidden-xs" href="#OpenCORE-AMR" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenCORE-AMR" aria-hidden="true">TOC</a></span></h4>
  50110. <p>FFmpeg can make use of the OpenCORE libraries for AMR-NB
  50111. decoding/encoding and AMR-WB decoding.
  50112. </p>
  50113. <p>Go to <a href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the
  50114. instructions for installing the libraries.
  50115. Then pass <code>--enable-libopencore-amrnb</code> and/or
  50116. <code>--enable-libopencore-amrwb</code> to configure to enable them.
  50117. </p>
  50118. <a name="VisualOn-AMR_002dWB-encoder-library"></a>
  50119. <h4 class="subsection">46.16.2 VisualOn AMR-WB encoder library<span class="pull-right"><a class="anchor hidden-xs" href="#VisualOn-AMR_002dWB-encoder-library" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VisualOn-AMR_002dWB-encoder-library" aria-hidden="true">TOC</a></span></h4>
  50120. <p>FFmpeg can make use of the VisualOn AMR-WBenc library for AMR-WB encoding.
  50121. </p>
  50122. <p>Go to <a href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the
  50123. instructions for installing the library.
  50124. Then pass <code>--enable-libvo-amrwbenc</code> to configure to enable it.
  50125. </p>
  50126. <a name="Fraunhofer-AAC-library"></a>
  50127. <h4 class="subsection">46.16.3 Fraunhofer AAC library<span class="pull-right"><a class="anchor hidden-xs" href="#Fraunhofer-AAC-library" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Fraunhofer-AAC-library" aria-hidden="true">TOC</a></span></h4>
  50128. <p>FFmpeg can make use of the Fraunhofer AAC library for AAC decoding &amp; encoding.
  50129. </p>
  50130. <p>Go to <a href="http://sourceforge.net/projects/opencore-amr/">http://sourceforge.net/projects/opencore-amr/</a> and follow the
  50131. instructions for installing the library.
  50132. Then pass <code>--enable-libfdk-aac</code> to configure to enable it.
  50133. </p>
  50134. <a name="OpenH264"></a>
  50135. <h3 class="section">46.17 OpenH264<span class="pull-right"><a class="anchor hidden-xs" href="#OpenH264" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenH264" aria-hidden="true">TOC</a></span></h3>
  50136. <p>FFmpeg can make use of the OpenH264 library for H.264 decoding and encoding.
  50137. </p>
  50138. <p>Go to <a href="http://www.openh264.org/">http://www.openh264.org/</a> and follow the instructions for
  50139. installing the library. Then pass <code>--enable-libopenh264</code> to configure to
  50140. enable it.
  50141. </p>
  50142. <p>For decoding, this library is much more limited than the built-in decoder
  50143. in libavcodec; currently, this library lacks support for decoding B-frames
  50144. and some other main/high profile features. (It currently only supports
  50145. constrained baseline profile and CABAC.) Using it is mostly useful for
  50146. testing and for taking advantage of Cisco&rsquo;s patent portfolio license
  50147. (<a href="http://www.openh264.org/BINARY_LICENSE.txt">http://www.openh264.org/BINARY_LICENSE.txt</a>).
  50148. </p>
  50149. <a name="OpenJPEG"></a>
  50150. <h3 class="section">46.18 OpenJPEG<span class="pull-right"><a class="anchor hidden-xs" href="#OpenJPEG" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenJPEG" aria-hidden="true">TOC</a></span></h3>
  50151. <p>FFmpeg can use the OpenJPEG libraries for decoding/encoding J2K videos. Go to
  50152. <a href="http://www.openjpeg.org/">http://www.openjpeg.org/</a> to get the libraries and follow the installation
  50153. instructions. To enable using OpenJPEG in FFmpeg, pass <code>--enable-libopenjpeg</code> to
  50154. <samp>./configure</samp>.
  50155. </p>
  50156. <a name="rav1e"></a>
  50157. <h3 class="section">46.19 rav1e<span class="pull-right"><a class="anchor hidden-xs" href="#rav1e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rav1e" aria-hidden="true">TOC</a></span></h3>
  50158. <p>FFmpeg can make use of rav1e (Rust AV1 Encoder) via its C bindings to encode videos.
  50159. Go to <a href="https://github.com/xiph/rav1e/">https://github.com/xiph/rav1e/</a> and follow the instructions to build
  50160. the C library. To enable using rav1e in FFmpeg, pass <code>--enable-librav1e</code>
  50161. to <samp>./configure</samp>.
  50162. </p>
  50163. <a name="SVT_002dAV1"></a>
  50164. <h3 class="section">46.20 SVT-AV1<span class="pull-right"><a class="anchor hidden-xs" href="#SVT_002dAV1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-SVT_002dAV1" aria-hidden="true">TOC</a></span></h3>
  50165. <p>FFmpeg can make use of the Scalable Video Technology for AV1 library for AV1 encoding.
  50166. </p>
  50167. <p>Go to <a href="https://github.com/OpenVisualCloud/SVT-AV1/">https://github.com/OpenVisualCloud/SVT-AV1/</a> and follow the instructions
  50168. for installing the library. Then pass <code>--enable-libsvtav1</code> to configure to
  50169. enable it.
  50170. </p>
  50171. <a name="TwoLAME"></a>
  50172. <h3 class="section">46.21 TwoLAME<span class="pull-right"><a class="anchor hidden-xs" href="#TwoLAME" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-TwoLAME" aria-hidden="true">TOC</a></span></h3>
  50173. <p>FFmpeg can make use of the TwoLAME library for MP2 encoding.
  50174. </p>
  50175. <p>Go to <a href="http://www.twolame.org/">http://www.twolame.org/</a> and follow the
  50176. instructions for installing the library.
  50177. Then pass <code>--enable-libtwolame</code> to configure to enable it.
  50178. </p>
  50179. <a name="VapourSynth"></a>
  50180. <h3 class="section">46.22 VapourSynth<span class="pull-right"><a class="anchor hidden-xs" href="#VapourSynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VapourSynth" aria-hidden="true">TOC</a></span></h3>
  50181. <p>FFmpeg can read VapourSynth scripts as input. To enable support, pass
  50182. <code>--enable-vapoursynth</code> to configure. Vapoursynth is detected via
  50183. <code>pkg-config</code>. Versions 42 or greater supported.
  50184. See <a href="http://www.vapoursynth.com/">http://www.vapoursynth.com/</a>.
  50185. </p>
  50186. <p>Due to security concerns, Vapoursynth scripts will not
  50187. be autodetected so the input format has to be forced. For ff* CLI tools,
  50188. add <code>-f vapoursynth</code> before the input <code>-i yourscript.vpy</code>.
  50189. </p>
  50190. <a name="x264"></a>
  50191. <h3 class="section">46.23 x264<span class="pull-right"><a class="anchor hidden-xs" href="#x264" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-x264" aria-hidden="true">TOC</a></span></h3>
  50192. <p>FFmpeg can make use of the x264 library for H.264 encoding.
  50193. </p>
  50194. <p>Go to <a href="http://www.videolan.org/developers/x264.html">http://www.videolan.org/developers/x264.html</a> and follow the
  50195. instructions for installing the library. Then pass <code>--enable-libx264</code> to
  50196. configure to enable it.
  50197. </p>
  50198. <div class="info">
  50199. <p>x264 is under the GNU Public License Version 2 or later
  50200. (see <a 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
  50201. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  50202. </p></div>
  50203. <a name="x265"></a>
  50204. <h3 class="section">46.24 x265<span class="pull-right"><a class="anchor hidden-xs" href="#x265" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-x265" aria-hidden="true">TOC</a></span></h3>
  50205. <p>FFmpeg can make use of the x265 library for HEVC encoding.
  50206. </p>
  50207. <p>Go to <a href="http://x265.org/developers.html">http://x265.org/developers.html</a> and follow the instructions
  50208. for installing the library. Then pass <code>--enable-libx265</code> to configure
  50209. to enable it.
  50210. </p>
  50211. <div class="info">
  50212. <p>x265 is under the GNU Public License Version 2 or later
  50213. (see <a 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
  50214. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  50215. </p></div>
  50216. <a name="xavs"></a>
  50217. <h3 class="section">46.25 xavs<span class="pull-right"><a class="anchor hidden-xs" href="#xavs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xavs" aria-hidden="true">TOC</a></span></h3>
  50218. <p>FFmpeg can make use of the xavs library for AVS encoding.
  50219. </p>
  50220. <p>Go to <a href="http://xavs.sf.net/">http://xavs.sf.net/</a> and follow the instructions for
  50221. installing the library. Then pass <code>--enable-libxavs</code> to configure to
  50222. enable it.
  50223. </p>
  50224. <a name="xavs2"></a>
  50225. <h3 class="section">46.26 xavs2<span class="pull-right"><a class="anchor hidden-xs" href="#xavs2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xavs2" aria-hidden="true">TOC</a></span></h3>
  50226. <p>FFmpeg can make use of the xavs2 library for AVS2-P2/IEEE1857.4 video encoding.
  50227. </p>
  50228. <p>Go to <a href="https://github.com/pkuvcl/xavs2">https://github.com/pkuvcl/xavs2</a> and follow the instructions for
  50229. installing the library. Then pass <code>--enable-libxavs2</code> to configure to
  50230. enable it.
  50231. </p>
  50232. <div class="info">
  50233. <p>libxavs2 is under the GNU Public License Version 2 or later
  50234. (see <a 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
  50235. details), you must upgrade FFmpeg&rsquo;s license to GPL in order to use it.
  50236. </p></div>
  50237. <a name="ZVBI"></a>
  50238. <h3 class="section">46.27 ZVBI<span class="pull-right"><a class="anchor hidden-xs" href="#ZVBI" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ZVBI" aria-hidden="true">TOC</a></span></h3>
  50239. <p>ZVBI is a VBI decoding library which can be used by FFmpeg to decode DVB
  50240. teletext pages and DVB teletext subtitles.
  50241. </p>
  50242. <p>Go to <a href="http://sourceforge.net/projects/zapping/">http://sourceforge.net/projects/zapping/</a> and follow the instructions for
  50243. installing the library. Then pass <code>--enable-libzvbi</code> to configure to
  50244. enable it.
  50245. </p>
  50246. <a name="Supported-File-Formats_002c-Codecs-or-Features"></a>
  50247. <h2 class="chapter">47 Supported File Formats, Codecs or Features<span class="pull-right"><a class="anchor hidden-xs" href="#Supported-File-Formats_002c-Codecs-or-Features" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Supported-File-Formats_002c-Codecs-or-Features" aria-hidden="true">TOC</a></span></h2>
  50248. <p>You can use the <code>-formats</code> and <code>-codecs</code> options to have an exhaustive list.
  50249. </p>
  50250. <a name="File-Formats"></a>
  50251. <h3 class="section">47.1 File Formats<span class="pull-right"><a class="anchor hidden-xs" href="#File-Formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-File-Formats" aria-hidden="true">TOC</a></span></h3>
  50252. <p>FFmpeg supports the following file formats through the <code>libavformat</code>
  50253. library:
  50254. </p>
  50255. <table>
  50256. <tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  50257. <tr><td width="40%">3dostr</td><td width="10%"></td><td width="10%">X</td></tr>
  50258. <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>
  50259. <tr><td width="40%">8088flex TMV</td><td width="10%"></td><td width="10%">X</td></tr>
  50260. <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>
  50261. <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>
  50262. <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>
  50263. <tr><td width="40%">Adobe Filmstrip</td><td width="10%">X</td><td width="10%">X</td></tr>
  50264. <tr><td width="40%">Audio IFF (AIFF)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50265. <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>
  50266. <tr><td width="40%">3GPP AMR</td><td width="10%">X</td><td width="10%">X</td></tr>
  50267. <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>
  50268. <tr><td width="40%">Apple HTTP Live Streaming</td><td width="10%"></td><td width="10%">X</td></tr>
  50269. <tr><td width="40%">Artworx Data Format</td><td width="10%"></td><td width="10%">X</td></tr>
  50270. <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>
  50271. <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>
  50272. <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>
  50273. <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>
  50274. <tr><td width="40%">APNG</td><td width="10%">X</td><td width="10%">X</td></tr>
  50275. <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>
  50276. <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>
  50277. <tr><td width="40%">AVI</td><td width="10%">X</td><td width="10%">X</td></tr>
  50278. <tr><td width="40%">AviSynth</td><td width="10%"></td><td width="10%">X</td></tr>
  50279. <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>
  50280. <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>
  50281. <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>
  50282. <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>
  50283. <tr><td width="40%">Binary text</td><td width="10%"></td><td width="10%">X</td></tr>
  50284. <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>
  50285. <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>
  50286. <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>
  50287. <tr><td width="40%">BRP</td><td width="10%"></td><td width="10%">X</td><td width="40%">Argonaut Games format.</td></tr>
  50288. <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>
  50289. <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>
  50290. <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>
  50291. <tr><td width="40%">BW64</td><td width="10%"></td><td width="10%">X</td><td width="40%">Broadcast Wave 64bit.</td></tr>
  50292. <tr><td width="40%">BWF</td><td width="10%">X</td><td width="10%">X</td></tr>
  50293. <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>
  50294. <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>
  50295. <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>
  50296. <tr><td width="40%">CRI AIX</td><td width="10%"></td><td width="10%">X</td></tr>
  50297. <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>
  50298. <tr><td width="40%">Discworld II BMV</td><td width="10%"></td><td width="10%">X</td></tr>
  50299. <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>
  50300. <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>
  50301. <tr><td width="40%">Digital Speech Standard (DSS)</td><td width="10%"></td><td width="10%">X</td></tr>
  50302. <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>
  50303. <tr><td width="40%">Phantom Cine</td><td width="10%"></td><td width="10%">X</td></tr>
  50304. <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>
  50305. <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>
  50306. <tr><td width="40%">CRC testing format</td><td width="10%">X</td><td width="10%"></td></tr>
  50307. <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>
  50308. <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>
  50309. <tr><td width="40%">D-Cinema audio</td><td width="10%">X</td><td width="10%">X</td></tr>
  50310. <tr><td width="40%">Deluxe Paint Animation</td><td width="10%"></td><td width="10%">X</td></tr>
  50311. <tr><td width="40%">DCSTR</td><td width="10%"></td><td width="10%">X</td></tr>
  50312. <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>
  50313. <tr><td width="40%">DirectDraw Surface</td><td width="10%"></td><td width="10%">X</td></tr>
  50314. <tr><td width="40%">DSD Stream File (DSF)</td><td width="10%"></td><td width="10%">X</td></tr>
  50315. <tr><td width="40%">DV video</td><td width="10%">X</td><td width="10%">X</td></tr>
  50316. <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
  50317. game and different game cutscenes repacked for use with ScummVM.</td></tr>
  50318. <tr><td width="40%">Electronic Arts cdata</td><td width="10%"></td><td width="10%">X</td></tr>
  50319. <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>
  50320. <tr><td width="40%">Ensoniq Paris Audio File</td><td width="10%"></td><td width="10%">X</td></tr>
  50321. <tr><td width="40%">FFM (FFserver live feed)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50322. <tr><td width="40%">Flash (SWF)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50323. <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>
  50324. <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>
  50325. <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>
  50326. <tr><td width="40%">framecrc testing format</td><td width="10%">X</td><td width="10%"></td></tr>
  50327. <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>
  50328. <tr><td width="40%">G.723.1</td><td width="10%">X</td><td width="10%">X</td></tr>
  50329. <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>
  50330. <tr><td width="40%">G.729 BIT</td><td width="10%">X</td><td width="10%">X</td></tr>
  50331. <tr><td width="40%">G.729 raw</td><td width="10%"></td><td width="10%">X</td></tr>
  50332. <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>
  50333. <tr><td width="40%">GIF Animation</td><td width="10%">X</td><td width="10%">X</td></tr>
  50334. <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
  50335. playout servers.</td></tr>
  50336. <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>
  50337. <tr><td width="40%">iCEDraw File</td><td width="10%"></td><td width="10%">X</td></tr>
  50338. <tr><td width="40%">ICO</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Microsoft Windows ICO</td></tr>
  50339. <tr><td width="40%">id Quake II CIN video</td><td width="10%"></td><td width="10%">X</td></tr>
  50340. <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>
  50341. <tr><td width="40%">IEC61937 encapsulation</td><td width="10%">X</td><td width="10%">X</td></tr>
  50342. <tr><td width="40%">IFF</td><td width="10%"></td><td width="10%">X</td><td width="40%">Interchange File Format</td></tr>
  50343. <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>
  50344. <tr><td width="40%">iLBC</td><td width="10%">X</td><td width="10%">X</td></tr>
  50345. <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>
  50346. <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>
  50347. <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>
  50348. <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>
  50349. <tr><td width="40%">Internet Video Recording</td><td width="10%"></td><td width="10%">X</td></tr>
  50350. <tr><td width="40%">IRCAM</td><td width="10%">X</td><td width="10%">X</td></tr>
  50351. <tr><td width="40%">LATM</td><td width="10%">X</td><td width="10%">X</td></tr>
  50352. <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>
  50353. <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>
  50354. <tr><td width="40%">LRC</td><td width="10%">X</td><td width="10%">X</td></tr>
  50355. <tr><td width="40%">LVF</td><td width="10%"></td><td width="10%">X</td></tr>
  50356. <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>
  50357. <tr><td width="40%">Magic Lantern Video (MLV)</td><td width="10%"></td><td width="10%">X</td></tr>
  50358. <tr><td width="40%">Matroska</td><td width="10%">X</td><td width="10%">X</td></tr>
  50359. <tr><td width="40%">Matroska audio</td><td width="10%">X</td><td width="10%"></td></tr>
  50360. <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>
  50361. <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>
  50362. <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>
  50363. <tr><td width="40%">MD Studio</td><td width="10%"></td><td width="10%">X</td></tr>
  50364. <tr><td width="40%">Metal Gear Solid: The Twin Snakes</td><td width="10%"></td><td width="10%">X</td></tr>
  50365. <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>
  50366. <tr><td width="40%">Mobotix .mxg</td><td width="10%"></td><td width="10%">X</td></tr>
  50367. <tr><td width="40%">Monkey&rsquo;s Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  50368. <tr><td width="40%">Motion Pixels MVI</td><td width="10%"></td><td width="10%">X</td></tr>
  50369. <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>
  50370. <tr><td width="40%">MP2</td><td width="10%">X</td><td width="10%">X</td></tr>
  50371. <tr><td width="40%">MP3</td><td width="10%">X</td><td width="10%">X</td></tr>
  50372. <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>
  50373. <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>VOB</code> file, SVCD and DVD format supported</td></tr>
  50374. <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>
  50375. <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>
  50376. <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>
  50377. <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>
  50378. <tr><td width="40%">MIDI Sample Dump Standard</td><td width="10%"></td><td width="10%">X</td></tr>
  50379. <tr><td width="40%">MIME multipart JPEG</td><td width="10%">X</td><td width="10%"></td></tr>
  50380. <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>
  50381. <tr><td width="40%">MTV</td><td width="10%"></td><td width="10%">X</td></tr>
  50382. <tr><td width="40%">Musepack</td><td width="10%"></td><td width="10%">X</td></tr>
  50383. <tr><td width="40%">Musepack SV8</td><td width="10%"></td><td width="10%">X</td></tr>
  50384. <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>
  50385. <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>
  50386. <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>
  50387. <tr><td width="40%">NIST SPeech HEader REsources</td><td width="10%"></td><td width="10%">X</td></tr>
  50388. <tr><td width="40%">Computerized Speech Lab NSP</td><td width="10%"></td><td width="10%">X</td></tr>
  50389. <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>
  50390. <tr><td width="40%">Nullsoft Streaming Video</td><td width="10%"></td><td width="10%">X</td></tr>
  50391. <tr><td width="40%">NuppelVideo</td><td width="10%"></td><td width="10%">X</td></tr>
  50392. <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>
  50393. <tr><td width="40%">Ogg</td><td width="10%">X</td><td width="10%">X</td></tr>
  50394. <tr><td width="40%">Playstation Portable PMP</td><td width="10%"></td><td width="10%">X</td></tr>
  50395. <tr><td width="40%">Portable Voice Format</td><td width="10%"></td><td width="10%">X</td></tr>
  50396. <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>
  50397. <tr><td width="40%">QCP</td><td width="10%"></td><td width="10%">X</td></tr>
  50398. <tr><td width="40%">raw ADTS (AAC)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50399. <tr><td width="40%">raw AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
  50400. <tr><td width="40%">raw AMR-NB</td><td width="10%"></td><td width="10%">X</td></tr>
  50401. <tr><td width="40%">raw AMR-WB</td><td width="10%"></td><td width="10%">X</td></tr>
  50402. <tr><td width="40%">raw aptX</td><td width="10%">X</td><td width="10%">X</td></tr>
  50403. <tr><td width="40%">raw aptX HD</td><td width="10%">X</td><td width="10%">X</td></tr>
  50404. <tr><td width="40%">raw Chinese AVS video</td><td width="10%">X</td><td width="10%">X</td></tr>
  50405. <tr><td width="40%">raw Dirac</td><td width="10%">X</td><td width="10%">X</td></tr>
  50406. <tr><td width="40%">raw DNxHD</td><td width="10%">X</td><td width="10%">X</td></tr>
  50407. <tr><td width="40%">raw DTS</td><td width="10%">X</td><td width="10%">X</td></tr>
  50408. <tr><td width="40%">raw DTS-HD</td><td width="10%"></td><td width="10%">X</td></tr>
  50409. <tr><td width="40%">raw E-AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
  50410. <tr><td width="40%">raw FLAC</td><td width="10%">X</td><td width="10%">X</td></tr>
  50411. <tr><td width="40%">raw GSM</td><td width="10%"></td><td width="10%">X</td></tr>
  50412. <tr><td width="40%">raw H.261</td><td width="10%">X</td><td width="10%">X</td></tr>
  50413. <tr><td width="40%">raw H.263</td><td width="10%">X</td><td width="10%">X</td></tr>
  50414. <tr><td width="40%">raw H.264</td><td width="10%">X</td><td width="10%">X</td></tr>
  50415. <tr><td width="40%">raw HEVC</td><td width="10%">X</td><td width="10%">X</td></tr>
  50416. <tr><td width="40%">raw Ingenient MJPEG</td><td width="10%"></td><td width="10%">X</td></tr>
  50417. <tr><td width="40%">raw MJPEG</td><td width="10%">X</td><td width="10%">X</td></tr>
  50418. <tr><td width="40%">raw MLP</td><td width="10%"></td><td width="10%">X</td></tr>
  50419. <tr><td width="40%">raw MPEG</td><td width="10%"></td><td width="10%">X</td></tr>
  50420. <tr><td width="40%">raw MPEG-1</td><td width="10%"></td><td width="10%">X</td></tr>
  50421. <tr><td width="40%">raw MPEG-2</td><td width="10%"></td><td width="10%">X</td></tr>
  50422. <tr><td width="40%">raw MPEG-4</td><td width="10%">X</td><td width="10%">X</td></tr>
  50423. <tr><td width="40%">raw NULL</td><td width="10%">X</td><td width="10%"></td></tr>
  50424. <tr><td width="40%">raw video</td><td width="10%">X</td><td width="10%">X</td></tr>
  50425. <tr><td width="40%">raw id RoQ</td><td width="10%">X</td><td width="10%"></td></tr>
  50426. <tr><td width="40%">raw SBC</td><td width="10%">X</td><td width="10%">X</td></tr>
  50427. <tr><td width="40%">raw Shorten</td><td width="10%"></td><td width="10%">X</td></tr>
  50428. <tr><td width="40%">raw TAK</td><td width="10%"></td><td width="10%">X</td></tr>
  50429. <tr><td width="40%">raw TrueHD</td><td width="10%">X</td><td width="10%">X</td></tr>
  50430. <tr><td width="40%">raw VC-1</td><td width="10%">X</td><td width="10%">X</td></tr>
  50431. <tr><td width="40%">raw PCM A-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  50432. <tr><td width="40%">raw PCM mu-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  50433. <tr><td width="40%">raw PCM Archimedes VIDC</td><td width="10%">X</td><td width="10%">X</td></tr>
  50434. <tr><td width="40%">raw PCM signed 8 bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  50435. <tr><td width="40%">raw PCM signed 16 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50436. <tr><td width="40%">raw PCM signed 16 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50437. <tr><td width="40%">raw PCM signed 24 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50438. <tr><td width="40%">raw PCM signed 24 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50439. <tr><td width="40%">raw PCM signed 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50440. <tr><td width="40%">raw PCM signed 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50441. <tr><td width="40%">raw PCM signed 64 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50442. <tr><td width="40%">raw PCM signed 64 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50443. <tr><td width="40%">raw PCM unsigned 8 bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  50444. <tr><td width="40%">raw PCM unsigned 16 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50445. <tr><td width="40%">raw PCM unsigned 16 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50446. <tr><td width="40%">raw PCM unsigned 24 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50447. <tr><td width="40%">raw PCM unsigned 24 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50448. <tr><td width="40%">raw PCM unsigned 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50449. <tr><td width="40%">raw PCM unsigned 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50450. <tr><td width="40%">raw PCM 16.8 floating point little-endian</td><td width="10%"></td><td width="10%">X</td></tr>
  50451. <tr><td width="40%">raw PCM 24.0 floating point little-endian</td><td width="10%"></td><td width="10%">X</td></tr>
  50452. <tr><td width="40%">raw PCM floating-point 32 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50453. <tr><td width="40%">raw PCM floating-point 32 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50454. <tr><td width="40%">raw PCM floating-point 64 bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50455. <tr><td width="40%">raw PCM floating-point 64 bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50456. <tr><td width="40%">RDT</td><td width="10%"></td><td width="10%">X</td></tr>
  50457. <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>
  50458. <tr><td width="40%">RealMedia</td><td width="10%">X</td><td width="10%">X</td></tr>
  50459. <tr><td width="40%">Redirector</td><td width="10%"></td><td width="10%">X</td></tr>
  50460. <tr><td width="40%">RedSpark</td><td width="10%"></td><td width="10%">X</td></tr>
  50461. <tr><td width="40%">Renderware TeXture Dictionary</td><td width="10%"></td><td width="10%">X</td></tr>
  50462. <tr><td width="40%">Resolume DXV</td><td width="10%"></td><td width="10%">X</td></tr>
  50463. <tr><td width="40%">RF64</td><td width="10%"></td><td width="10%">X</td></tr>
  50464. <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>
  50465. <tr><td width="40%">RPL/ARMovie</td><td width="10%"></td><td width="10%">X</td></tr>
  50466. <tr><td width="40%">Lego Mindstorms RSO</td><td width="10%">X</td><td width="10%">X</td></tr>
  50467. <tr><td width="40%">RSD</td><td width="10%"></td><td width="10%">X</td></tr>
  50468. <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>
  50469. <tr><td width="40%">RTP</td><td width="10%">X</td><td width="10%">X</td></tr>
  50470. <tr><td width="40%">RTSP</td><td width="10%">X</td><td width="10%">X</td></tr>
  50471. <tr><td width="40%">Sample Dump eXchange</td><td width="10%"></td><td width="10%">X</td></tr>
  50472. <tr><td width="40%">SAP</td><td width="10%">X</td><td width="10%">X</td></tr>
  50473. <tr><td width="40%">SBG</td><td width="10%"></td><td width="10%">X</td></tr>
  50474. <tr><td width="40%">SDP</td><td width="10%"></td><td width="10%">X</td></tr>
  50475. <tr><td width="40%">SER</td><td width="10%"></td><td width="10%">X</td></tr>
  50476. <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>
  50477. <tr><td width="40%">Silicon Graphics Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  50478. <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>
  50479. <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>
  50480. <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>
  50481. <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>
  50482. <tr><td width="40%">SMPTE 337M encapsulation</td><td width="10%"></td><td width="10%">X</td></tr>
  50483. <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>
  50484. <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>
  50485. <tr><td width="40%">Sony PlayStation STR</td><td width="10%"></td><td width="10%">X</td></tr>
  50486. <tr><td width="40%">Sony Wave64 (W64)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50487. <tr><td width="40%">SoX native format</td><td width="10%">X</td><td width="10%">X</td></tr>
  50488. <tr><td width="40%">SUN AU format</td><td width="10%">X</td><td width="10%">X</td></tr>
  50489. <tr><td width="40%">SUP raw PGS subtitles</td><td width="10%">X</td><td width="10%">X</td></tr>
  50490. <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>
  50491. <tr><td width="40%">TDSC</td><td width="10%"></td><td width="10%">X</td></tr>
  50492. <tr><td width="40%">Text files</td><td width="10%"></td><td width="10%">X</td></tr>
  50493. <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>
  50494. <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>
  50495. <tr><td width="40%">True Audio</td><td width="10%">X</td><td width="10%">X</td></tr>
  50496. <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>
  50497. <tr><td width="40%">VC-1 test bitstream</td><td width="10%">X</td><td width="10%">X</td></tr>
  50498. <tr><td width="40%">Vidvox Hap</td><td width="10%">X</td><td width="10%">X</td></tr>
  50499. <tr><td width="40%">Vivo</td><td width="10%"></td><td width="10%">X</td></tr>
  50500. <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>
  50501. <tr><td width="40%">WAV</td><td width="10%">X</td><td width="10%">X</td></tr>
  50502. <tr><td width="40%">WavPack</td><td width="10%">X</td><td width="10%">X</td></tr>
  50503. <tr><td width="40%">WebM</td><td width="10%">X</td><td width="10%">X</td></tr>
  50504. <tr><td width="40%">Windows Televison (WTV)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50505. <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>
  50506. <tr><td width="40%">Westwood Studios audio</td><td width="10%"></td><td width="10%">X</td><td width="40%">Multimedia format used in Westwood Studios games.</td></tr>
  50507. <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>
  50508. <tr><td width="40%">Wideband Single-bit Data (WSD)</td><td width="10%"></td><td width="10%">X</td></tr>
  50509. <tr><td width="40%">WVE</td><td width="10%"></td><td width="10%">X</td></tr>
  50510. <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>
  50511. <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>
  50512. <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>
  50513. <tr><td width="40%">eXtended BINary text (XBIN)</td><td width="10%"></td><td width="10%">X</td></tr>
  50514. <tr><td width="40%">YUV4MPEG pipe</td><td width="10%">X</td><td width="10%">X</td></tr>
  50515. <tr><td width="40%">Psygnosis YOP</td><td width="10%"></td><td width="10%">X</td></tr>
  50516. </table>
  50517. <p><code>X</code> means that the feature in that column (encoding / decoding) is supported.
  50518. </p>
  50519. <a name="Image-Formats"></a>
  50520. <h3 class="section">47.2 Image Formats<span class="pull-right"><a class="anchor hidden-xs" href="#Image-Formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Image-Formats" aria-hidden="true">TOC</a></span></h3>
  50521. <p>FFmpeg can read and write images for each frame of a video sequence. The
  50522. following image formats are supported:
  50523. </p>
  50524. <table>
  50525. <tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  50526. <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>
  50527. <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>
  50528. <tr><td width="40%">animated GIF</td><td width="10%">X</td><td width="10%">X</td></tr>
  50529. <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>
  50530. <tr><td width="40%">BMP</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Microsoft BMP image</td></tr>
  50531. <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>
  50532. <tr><td width="40%">CRI</td><td width="10%"></td><td width="10%">X</td><td width="40%">Cintel RAW</td></tr>
  50533. <tr><td width="40%">DPX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Digital Picture Exchange</td></tr>
  50534. <tr><td width="40%">EXR</td><td width="10%"></td><td width="10%">X</td><td width="40%">OpenEXR</td></tr>
  50535. <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>
  50536. <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>
  50537. <tr><td width="40%">JPEG 2000</td><td width="10%">X</td><td width="10%">X</td></tr>
  50538. <tr><td width="40%">JPEG-LS</td><td width="10%">X</td><td width="10%">X</td></tr>
  50539. <tr><td width="40%">LJPEG</td><td width="10%">X</td><td width="10%"></td><td width="40%">Lossless JPEG</td></tr>
  50540. <tr><td width="40%">MSP</td><td width="10%"></td><td width="10%">X</td><td width="40%">Microsoft Paint image</td></tr>
  50541. <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>
  50542. <tr><td width="40%">PBM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable BitMap image</td></tr>
  50543. <tr><td width="40%">PCD</td><td width="10%"></td><td width="10%">X</td><td width="40%">PhotoCD</td></tr>
  50544. <tr><td width="40%">PCX</td><td width="10%">X</td><td width="10%">X</td><td width="40%">PC Paintbrush</td></tr>
  50545. <tr><td width="40%">PFM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable FloatMap image</td></tr>
  50546. <tr><td width="40%">PGM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable GrayMap image</td></tr>
  50547. <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>
  50548. <tr><td width="40%">PGX</td><td width="10%"></td><td width="10%">X</td><td width="40%">PGX file decoder</td></tr>
  50549. <tr><td width="40%">PIC</td><td width="10%"></td><td width="10%">X</td><td width="40%">Pictor/PC Paint</td></tr>
  50550. <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>
  50551. <tr><td width="40%">PPM</td><td width="10%">X</td><td width="10%">X</td><td width="40%">Portable PixelMap image</td></tr>
  50552. <tr><td width="40%">PSD</td><td width="10%"></td><td width="10%">X</td><td width="40%">Photoshop</td></tr>
  50553. <tr><td width="40%">PTX</td><td width="10%"></td><td width="10%">X</td><td width="40%">V.Flash PTX format</td></tr>
  50554. <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>
  50555. <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>
  50556. <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>
  50557. <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>
  50558. <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>
  50559. <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>
  50560. <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>
  50561. <tr><td width="40%">XPM</td><td width="10%"></td><td width="10%">X</td><td width="40%">X PixMap image format</td></tr>
  50562. <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>
  50563. </table>
  50564. <p><code>X</code> means that the feature in that column (encoding / decoding) is supported.
  50565. </p>
  50566. <p><code>E</code> means that support is provided through an external library.
  50567. </p>
  50568. <a name="Video-Codecs"></a>
  50569. <h3 class="section">47.3 Video Codecs<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Codecs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Codecs" aria-hidden="true">TOC</a></span></h3>
  50570. <table>
  50571. <tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  50572. <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>
  50573. <tr><td width="40%">8088flex TMV</td><td width="10%"></td><td width="10%">X</td></tr>
  50574. <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>
  50575. <tr><td width="40%">Amazing Studio PAF Video</td><td width="10%"></td><td width="10%">X</td></tr>
  50576. <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>
  50577. <tr><td width="40%">Amuse Graphics Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  50578. <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>
  50579. <tr><td width="40%">ANSI/ASCII art</td><td width="10%"></td><td width="10%">X</td></tr>
  50580. <tr><td width="40%">Apple Intermediate Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  50581. <tr><td width="40%">Apple MJPEG-B</td><td width="10%"></td><td width="10%">X</td></tr>
  50582. <tr><td width="40%">Apple Pixlet</td><td width="10%"></td><td width="10%">X</td></tr>
  50583. <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>
  50584. <tr><td width="40%">Apple QuickDraw</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: qdrw</td></tr>
  50585. <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>
  50586. <tr><td width="40%">Asus v1</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: ASV1</td></tr>
  50587. <tr><td width="40%">Asus v2</td><td width="10%">X</td><td width="10%">X</td><td width="40%">fourcc: ASV2</td></tr>
  50588. <tr><td width="40%">ATI VCR1</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VCR1</td></tr>
  50589. <tr><td width="40%">ATI VCR2</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VCR2</td></tr>
  50590. <tr><td width="40%">Auravision Aura</td><td width="10%"></td><td width="10%">X</td></tr>
  50591. <tr><td width="40%">Auravision Aura 2</td><td width="10%"></td><td width="10%">X</td></tr>
  50592. <tr><td width="40%">Autodesk Animator Flic video</td><td width="10%"></td><td width="10%">X</td></tr>
  50593. <tr><td width="40%">Autodesk RLE</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: AASC</td></tr>
  50594. <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>
  50595. <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>
  50596. <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>
  50597. <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>
  50598. <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>
  50599. <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>
  50600. <tr><td width="40%">Beam Software VB</td><td width="10%"></td><td width="10%">X</td></tr>
  50601. <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>
  50602. <tr><td width="40%">Bink Video</td><td width="10%"></td><td width="10%">X</td></tr>
  50603. <tr><td width="40%">BitJazz SheerVideo</td><td width="10%"></td><td width="10%">X</td></tr>
  50604. <tr><td width="40%">Bitmap Brothers JV video</td><td width="10%"></td><td width="10%">X</td></tr>
  50605. <tr><td width="40%">y41p Brooktree uncompressed 4:1:1 12-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  50606. <tr><td width="40%">Brooktree ProSumer Video</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: BT20</td></tr>
  50607. <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>
  50608. <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>
  50609. <tr><td width="40%">CamStudio</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: CSCD</td></tr>
  50610. <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>
  50611. <tr><td width="40%">CDXL</td><td width="10%"></td><td width="10%">X</td><td width="40%">Amiga CD video codec</td></tr>
  50612. <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>
  50613. <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>
  50614. <tr><td width="40%">Discworld II BMV Video</td><td width="10%"></td><td width="10%">X</td></tr>
  50615. <tr><td width="40%">CineForm HD</td><td width="10%">X</td><td width="10%">X</td></tr>
  50616. <tr><td width="40%">Canopus HQ</td><td width="10%"></td><td width="10%">X</td></tr>
  50617. <tr><td width="40%">Canopus HQA</td><td width="10%"></td><td width="10%">X</td></tr>
  50618. <tr><td width="40%">Canopus HQX</td><td width="10%"></td><td width="10%">X</td></tr>
  50619. <tr><td width="40%">Canopus Lossless Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  50620. <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>
  50621. <tr><td width="40%">Cinepak</td><td width="10%"></td><td width="10%">X</td></tr>
  50622. <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>
  50623. <tr><td width="40%">CPiA Video Format</td><td width="10%"></td><td width="10%">X</td></tr>
  50624. <tr><td width="40%">Creative YUV (CYUV)</td><td width="10%"></td><td width="10%">X</td></tr>
  50625. <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>
  50626. <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>
  50627. <tr><td width="40%">Deluxe Paint Animation</td><td width="10%"></td><td width="10%">X</td></tr>
  50628. <tr><td width="40%">DNxHD</td><td width="10%">X</td><td width="10%">X</td><td width="40%">aka SMPTE VC3</td></tr>
  50629. <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>
  50630. <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>
  50631. <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>
  50632. <tr><td width="40%">DV (Digital Video)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50633. <tr><td width="40%">Dxtory capture format</td><td width="10%"></td><td width="10%">X</td></tr>
  50634. <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>
  50635. <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>
  50636. <tr><td width="40%">Electronic Arts Madcow video</td><td width="10%"></td><td width="10%">X</td></tr>
  50637. <tr><td width="40%">Electronic Arts TGV video</td><td width="10%"></td><td width="10%">X</td></tr>
  50638. <tr><td width="40%">Electronic Arts TGQ video</td><td width="10%"></td><td width="10%">X</td></tr>
  50639. <tr><td width="40%">Electronic Arts TQI video</td><td width="10%"></td><td width="10%">X</td></tr>
  50640. <tr><td width="40%">Escape 124</td><td width="10%"></td><td width="10%">X</td></tr>
  50641. <tr><td width="40%">Escape 130</td><td width="10%"></td><td width="10%">X</td></tr>
  50642. <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>
  50643. <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>
  50644. <tr><td width="40%">Flash Screen Video v2</td><td width="10%">X</td><td width="10%">X</td></tr>
  50645. <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>
  50646. <tr><td width="40%">FM Screen Capture Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  50647. <tr><td width="40%">Forward Uncompressed</td><td width="10%"></td><td width="10%">X</td></tr>
  50648. <tr><td width="40%">Fraps</td><td width="10%"></td><td width="10%">X</td></tr>
  50649. <tr><td width="40%">Go2Meeting</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: G2M2, G2M3</td></tr>
  50650. <tr><td width="40%">Go2Webinar</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: G2M4</td></tr>
  50651. <tr><td width="40%">Gremlin Digital Video</td><td width="10%"></td><td width="10%">X</td></tr>
  50652. <tr><td width="40%">H.261</td><td width="10%">X</td><td width="10%">X</td></tr>
  50653. <tr><td width="40%">H.263 / H.263-1996</td><td width="10%">X</td><td width="10%">X</td></tr>
  50654. <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>
  50655. <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>
  50656. <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>
  50657. <tr><td width="40%">HNM version 4</td><td width="10%"></td><td width="10%">X</td></tr>
  50658. <tr><td width="40%">HuffYUV</td><td width="10%">X</td><td width="10%">X</td></tr>
  50659. <tr><td width="40%">HuffYUV FFmpeg variant</td><td width="10%">X</td><td width="10%">X</td></tr>
  50660. <tr><td width="40%">IBM Ultimotion</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: ULTI</td></tr>
  50661. <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>
  50662. <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>
  50663. <tr><td width="40%">IFF ILBM</td><td width="10%"></td><td width="10%">X</td><td width="40%">IFF interleaved bitmap</td></tr>
  50664. <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>
  50665. <tr><td width="40%">Infinity IMM4</td><td width="10%"></td><td width="10%">X</td></tr>
  50666. <tr><td width="40%">Intel H.263</td><td width="10%"></td><td width="10%">X</td></tr>
  50667. <tr><td width="40%">Intel Indeo 2</td><td width="10%"></td><td width="10%">X</td></tr>
  50668. <tr><td width="40%">Intel Indeo 3</td><td width="10%"></td><td width="10%">X</td></tr>
  50669. <tr><td width="40%">Intel Indeo 4</td><td width="10%"></td><td width="10%">X</td></tr>
  50670. <tr><td width="40%">Intel Indeo 5</td><td width="10%"></td><td width="10%">X</td></tr>
  50671. <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>
  50672. <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>
  50673. <tr><td width="40%">J2K</td><td width="10%">X</td><td width="10%">X</td></tr>
  50674. <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>
  50675. <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>
  50676. <tr><td width="40%">Lagarith</td><td width="10%"></td><td width="10%">X</td></tr>
  50677. <tr><td width="40%">LCL (LossLess Codec Library) MSZH</td><td width="10%"></td><td width="10%">X</td></tr>
  50678. <tr><td width="40%">LCL (LossLess Codec Library) ZLIB</td><td width="10%">E</td><td width="10%">E</td></tr>
  50679. <tr><td width="40%">LOCO</td><td width="10%"></td><td width="10%">X</td></tr>
  50680. <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>
  50681. <tr><td width="40%">lossless MJPEG</td><td width="10%">X</td><td width="10%">X</td></tr>
  50682. <tr><td width="40%">MagicYUV Video</td><td width="10%">X</td><td width="10%">X</td></tr>
  50683. <tr><td width="40%">Mandsoft Screen Capture Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  50684. <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>
  50685. <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>
  50686. <tr><td width="40%">Microsoft RLE</td><td width="10%"></td><td width="10%">X</td></tr>
  50687. <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>
  50688. <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>
  50689. <tr><td width="40%">Microsoft Video 1</td><td width="10%"></td><td width="10%">X</td></tr>
  50690. <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>
  50691. <tr><td width="40%">Miro VideoXL</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VIXL</td></tr>
  50692. <tr><td width="40%">MJPEG (Motion JPEG)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50693. <tr><td width="40%">Mobotix MxPEG video</td><td width="10%"></td><td width="10%">X</td></tr>
  50694. <tr><td width="40%">Motion Pixels video</td><td width="10%"></td><td width="10%">X</td></tr>
  50695. <tr><td width="40%">MPEG-1 video</td><td width="10%">X</td><td width="10%">X</td></tr>
  50696. <tr><td width="40%">MPEG-2 video</td><td width="10%">X</td><td width="10%">X</td></tr>
  50697. <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>
  50698. <tr><td width="40%">MPEG-4 part 2 Microsoft variant version 1</td><td width="10%"></td><td width="10%">X</td></tr>
  50699. <tr><td width="40%">MPEG-4 part 2 Microsoft variant version 2</td><td width="10%">X</td><td width="10%">X</td></tr>
  50700. <tr><td width="40%">MPEG-4 part 2 Microsoft variant version 3</td><td width="10%">X</td><td width="10%">X</td></tr>
  50701. <tr><td width="40%">Newtek SpeedHQ</td><td width="10%">X</td><td width="10%">X</td></tr>
  50702. <tr><td width="40%">Nintendo Gamecube THP video</td><td width="10%"></td><td width="10%">X</td></tr>
  50703. <tr><td width="40%">NotchLC</td><td width="10%"></td><td width="10%">X</td></tr>
  50704. <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>
  50705. <tr><td width="40%">On2 VP3</td><td width="10%"></td><td width="10%">X</td><td width="40%">still experimental</td></tr>
  50706. <tr><td width="40%">On2 VP4</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP40</td></tr>
  50707. <tr><td width="40%">On2 VP5</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP50</td></tr>
  50708. <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>
  50709. <tr><td width="40%">On2 VP7</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: VP70,VP71</td></tr>
  50710. <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>
  50711. <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>
  50712. <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>
  50713. <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>
  50714. <tr><td width="40%">QuickTime 8BPS video</td><td width="10%"></td><td width="10%">X</td></tr>
  50715. <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>
  50716. <tr><td width="40%">QuickTime Graphics (SMC)</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: &rsquo;smc &rsquo;</td></tr>
  50717. <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>
  50718. <tr><td width="40%">R10K AJA Kona 10-bit RGB Codec</td><td width="10%">X</td><td width="10%">X</td></tr>
  50719. <tr><td width="40%">R210 Quicktime Uncompressed RGB 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  50720. <tr><td width="40%">Raw Video</td><td width="10%">X</td><td width="10%">X</td></tr>
  50721. <tr><td width="40%">RealVideo 1.0</td><td width="10%">X</td><td width="10%">X</td></tr>
  50722. <tr><td width="40%">RealVideo 2.0</td><td width="10%">X</td><td width="10%">X</td></tr>
  50723. <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>
  50724. <tr><td width="40%">RealVideo 4.0</td><td width="10%"></td><td width="10%">X</td></tr>
  50725. <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>
  50726. <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>
  50727. <tr><td width="40%">ScreenPressor</td><td width="10%"></td><td width="10%">X</td></tr>
  50728. <tr><td width="40%">Screenpresso</td><td width="10%"></td><td width="10%">X</td></tr>
  50729. <tr><td width="40%">Screen Recorder Gold Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  50730. <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>
  50731. <tr><td width="40%">Silicon Graphics Motion Video Compressor 1 (MVC1)</td><td width="10%"></td><td width="10%">X</td></tr>
  50732. <tr><td width="40%">Silicon Graphics Motion Video Compressor 2 (MVC2)</td><td width="10%"></td><td width="10%">X</td></tr>
  50733. <tr><td width="40%">Silicon Graphics RLE 8-bit video</td><td width="10%"></td><td width="10%">X</td></tr>
  50734. <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>
  50735. <tr><td width="40%">SMPTE VC-1</td><td width="10%"></td><td width="10%">X</td></tr>
  50736. <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>
  50737. <tr><td width="40%">Sony PlayStation MDEC (Motion DECoder)</td><td width="10%"></td><td width="10%">X</td></tr>
  50738. <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>
  50739. <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>
  50740. <tr><td width="40%">Sunplus JPEG (SP5X)</td><td width="10%"></td><td width="10%">X</td><td width="40%">fourcc: SP5X</td></tr>
  50741. <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>
  50742. <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>
  50743. <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>
  50744. <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>
  50745. <tr><td width="40%">Ut Video</td><td width="10%">X</td><td width="10%">X</td></tr>
  50746. <tr><td width="40%">v210 QuickTime uncompressed 4:2:2 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  50747. <tr><td width="40%">v308 QuickTime uncompressed 4:4:4</td><td width="10%">X</td><td width="10%">X</td></tr>
  50748. <tr><td width="40%">v408 QuickTime uncompressed 4:4:4:4</td><td width="10%">X</td><td width="10%">X</td></tr>
  50749. <tr><td width="40%">v410 QuickTime uncompressed 4:4:4 10-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  50750. <tr><td width="40%">VBLE Lossless Codec</td><td width="10%"></td><td width="10%">X</td></tr>
  50751. <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>
  50752. <tr><td width="40%">Westwood Studios VQA (Vector Quantized Animation) video</td><td width="10%"></td><td width="10%">X</td></tr>
  50753. <tr><td width="40%">Windows Media Image</td><td width="10%"></td><td width="10%">X</td></tr>
  50754. <tr><td width="40%">Windows Media Video 7</td><td width="10%">X</td><td width="10%">X</td></tr>
  50755. <tr><td width="40%">Windows Media Video 8</td><td width="10%">X</td><td width="10%">X</td></tr>
  50756. <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>
  50757. <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>
  50758. <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>
  50759. <tr><td width="40%">Winnov WNV1</td><td width="10%"></td><td width="10%">X</td></tr>
  50760. <tr><td width="40%">WMV7</td><td width="10%">X</td><td width="10%">X</td></tr>
  50761. <tr><td width="40%">YAMAHA SMAF</td><td width="10%">X</td><td width="10%">X</td></tr>
  50762. <tr><td width="40%">Psygnosis YOP Video</td><td width="10%"></td><td width="10%">X</td></tr>
  50763. <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>
  50764. <tr><td width="40%">ZeroCodec Lossless Video</td><td width="10%"></td><td width="10%">X</td></tr>
  50765. <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>
  50766. <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>
  50767. </table>
  50768. <p><code>X</code> means that the feature in that column (encoding / decoding) is supported.
  50769. </p>
  50770. <p><code>E</code> means that support is provided through an external library.
  50771. </p>
  50772. <a name="Audio-Codecs"></a>
  50773. <h3 class="section">47.4 Audio Codecs<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Codecs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Codecs" aria-hidden="true">TOC</a></span></h3>
  50774. <table>
  50775. <tr><td width="40%">Name</td><td width="10%">Encoding</td><td width="10%">Decoding</td><td width="40%">Comments</td></tr>
  50776. <tr><td width="40%">8SVX exponential</td><td width="10%"></td><td width="10%">X</td></tr>
  50777. <tr><td width="40%">8SVX fibonacci</td><td width="10%"></td><td width="10%">X</td></tr>
  50778. <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>
  50779. <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>
  50780. <tr><td width="40%">AC-3</td><td width="10%">IX</td><td width="10%">IX</td></tr>
  50781. <tr><td width="40%">ACELP.KELVIN</td><td width="10%"></td><td width="10%">X</td></tr>
  50782. <tr><td width="40%">ADPCM 4X Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  50783. <tr><td width="40%">ADPCM Yamaha AICA</td><td width="10%"></td><td width="10%">X</td></tr>
  50784. <tr><td width="40%">ADPCM AmuseGraphics Movie</td><td width="10%"></td><td width="10%">X</td></tr>
  50785. <tr><td width="40%">ADPCM Argonaut Games</td><td width="10%">X</td><td width="10%">X</td></tr>
  50786. <tr><td width="40%">ADPCM CDROM XA</td><td width="10%"></td><td width="10%">X</td></tr>
  50787. <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>
  50788. <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>
  50789. <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>
  50790. <tr><td width="40%">ADPCM Electronic Arts R1</td><td width="10%"></td><td width="10%">X</td></tr>
  50791. <tr><td width="40%">ADPCM Electronic Arts R2</td><td width="10%"></td><td width="10%">X</td></tr>
  50792. <tr><td width="40%">ADPCM Electronic Arts R3</td><td width="10%"></td><td width="10%">X</td></tr>
  50793. <tr><td width="40%">ADPCM Electronic Arts XAS</td><td width="10%"></td><td width="10%">X</td></tr>
  50794. <tr><td width="40%">ADPCM G.722</td><td width="10%">X</td><td width="10%">X</td></tr>
  50795. <tr><td width="40%">ADPCM G.726</td><td width="10%">X</td><td width="10%">X</td></tr>
  50796. <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>
  50797. <tr><td width="40%">ADPCM IMA Cunning Developments</td><td width="10%"></td><td width="10%">X</td></tr>
  50798. <tr><td width="40%">ADPCM IMA Electronic Arts EACS</td><td width="10%"></td><td width="10%">X</td></tr>
  50799. <tr><td width="40%">ADPCM IMA Electronic Arts SEAD</td><td width="10%"></td><td width="10%">X</td></tr>
  50800. <tr><td width="40%">ADPCM IMA Funcom</td><td width="10%"></td><td width="10%">X</td></tr>
  50801. <tr><td width="40%">ADPCM IMA High Voltage Software ALP</td><td width="10%">X</td><td width="10%">X</td></tr>
  50802. <tr><td width="40%">ADPCM IMA QuickTime</td><td width="10%">X</td><td width="10%">X</td></tr>
  50803. <tr><td width="40%">ADPCM IMA Simon &amp; Schuster Interactive</td><td width="10%">X</td><td width="10%">X</td></tr>
  50804. <tr><td width="40%">ADPCM IMA Ubisoft APM</td><td width="10%">X</td><td width="10%">X</td></tr>
  50805. <tr><td width="40%">ADPCM IMA Loki SDL MJPEG</td><td width="10%"></td><td width="10%">X</td></tr>
  50806. <tr><td width="40%">ADPCM IMA WAV</td><td width="10%">X</td><td width="10%">X</td></tr>
  50807. <tr><td width="40%">ADPCM IMA Westwood</td><td width="10%"></td><td width="10%">X</td></tr>
  50808. <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>
  50809. <tr><td width="40%">ADPCM IMA Dialogic</td><td width="10%"></td><td width="10%">X</td></tr>
  50810. <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>
  50811. <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>
  50812. <tr><td width="40%">ADPCM IMA Radical</td><td width="10%"></td><td width="10%">X</td></tr>
  50813. <tr><td width="40%">ADPCM Microsoft</td><td width="10%">X</td><td width="10%">X</td></tr>
  50814. <tr><td width="40%">ADPCM MS IMA</td><td width="10%">X</td><td width="10%">X</td></tr>
  50815. <tr><td width="40%">ADPCM Nintendo Gamecube AFC</td><td width="10%"></td><td width="10%">X</td></tr>
  50816. <tr><td width="40%">ADPCM Nintendo Gamecube DTK</td><td width="10%"></td><td width="10%">X</td></tr>
  50817. <tr><td width="40%">ADPCM Nintendo THP</td><td width="10%"></td><td width="10%">X</td></tr>
  50818. <tr><td width="40%">ADPCM Playstation</td><td width="10%"></td><td width="10%">X</td></tr>
  50819. <tr><td width="40%">ADPCM QT IMA</td><td width="10%">X</td><td width="10%">X</td></tr>
  50820. <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>
  50821. <tr><td width="40%">ADPCM Shockwave Flash</td><td width="10%">X</td><td width="10%">X</td></tr>
  50822. <tr><td width="40%">ADPCM Sound Blaster Pro 2-bit</td><td width="10%"></td><td width="10%">X</td></tr>
  50823. <tr><td width="40%">ADPCM Sound Blaster Pro 2.6-bit</td><td width="10%"></td><td width="10%">X</td></tr>
  50824. <tr><td width="40%">ADPCM Sound Blaster Pro 4-bit</td><td width="10%"></td><td width="10%">X</td></tr>
  50825. <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>
  50826. <tr><td width="40%">ADPCM Westwood Studios IMA</td><td width="10%"></td><td width="10%">X</td><td width="40%">Used in Westwood Studios games like Command and Conquer.</td></tr>
  50827. <tr><td width="40%">ADPCM Yamaha</td><td width="10%">X</td><td width="10%">X</td></tr>
  50828. <tr><td width="40%">ADPCM Zork</td><td width="10%"></td><td width="10%">X</td></tr>
  50829. <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>
  50830. <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>
  50831. <tr><td width="40%">Amazing Studio PAF Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  50832. <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>
  50833. <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>
  50834. <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>
  50835. <tr><td width="40%">ATRAC1</td><td width="10%"></td><td width="10%">X</td></tr>
  50836. <tr><td width="40%">ATRAC3</td><td width="10%"></td><td width="10%">X</td></tr>
  50837. <tr><td width="40%">ATRAC3+</td><td width="10%"></td><td width="10%">X</td></tr>
  50838. <tr><td width="40%">ATRAC9</td><td width="10%"></td><td width="10%">X</td></tr>
  50839. <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>
  50840. <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>
  50841. <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>
  50842. <tr><td width="40%">CRI HCA</td><td width="10%"></td><td width="10%">X</td></tr>
  50843. <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>
  50844. <tr><td width="40%">Digital Speech Standard - Standard Play mode (DSS SP)</td><td width="10%"></td><td width="10%">X</td></tr>
  50845. <tr><td width="40%">Discworld II BMV Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  50846. <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>
  50847. <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>
  50848. <tr><td width="40%">Dolby E</td><td width="10%"></td><td width="10%">X</td></tr>
  50849. <tr><td width="40%">DPCM Gremlin</td><td width="10%"></td><td width="10%">X</td></tr>
  50850. <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>
  50851. <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>
  50852. <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>
  50853. <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>
  50854. <tr><td width="40%">DPCM Sol</td><td width="10%"></td><td width="10%">X</td></tr>
  50855. <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>
  50856. <tr><td width="40%">DPCM Xilam DERF</td><td width="10%"></td><td width="10%">X</td></tr>
  50857. <tr><td width="40%">DSD (Direct Stream Digital), least significant bit first</td><td width="10%"></td><td width="10%">X</td></tr>
  50858. <tr><td width="40%">DSD (Direct Stream Digital), most significant bit first</td><td width="10%"></td><td width="10%">X</td></tr>
  50859. <tr><td width="40%">DSD (Direct Stream Digital), least significant bit first, planar</td><td width="10%"></td><td width="10%">X</td></tr>
  50860. <tr><td width="40%">DSD (Direct Stream Digital), most significant bit first, planar</td><td width="10%"></td><td width="10%">X</td></tr>
  50861. <tr><td width="40%">DSP Group TrueSpeech</td><td width="10%"></td><td width="10%">X</td></tr>
  50862. <tr><td width="40%">DST (Direct Stream Transfer)</td><td width="10%"></td><td width="10%">X</td></tr>
  50863. <tr><td width="40%">DV audio</td><td width="10%"></td><td width="10%">X</td></tr>
  50864. <tr><td width="40%">Enhanced AC-3</td><td width="10%">X</td><td width="10%">X</td></tr>
  50865. <tr><td width="40%">EVRC (Enhanced Variable Rate Codec)</td><td width="10%"></td><td width="10%">X</td></tr>
  50866. <tr><td width="40%">FLAC (Free Lossless Audio Codec)</td><td width="10%">X</td><td width="10%">IX</td></tr>
  50867. <tr><td width="40%">G.723.1</td><td width="10%">X</td><td width="10%">X</td></tr>
  50868. <tr><td width="40%">G.729</td><td width="10%"></td><td width="10%">X</td></tr>
  50869. <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>
  50870. <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>
  50871. <tr><td width="40%">IAC (Indeo Audio Coder)</td><td width="10%"></td><td width="10%">X</td></tr>
  50872. <tr><td width="40%">iLBC (Internet Low Bitrate Codec)</td><td width="10%">E</td><td width="10%">E</td><td width="40%">encoding and decoding supported through external library libilbc</td></tr>
  50873. <tr><td width="40%">IMC (Intel Music Coder)</td><td width="10%"></td><td width="10%">X</td></tr>
  50874. <tr><td width="40%">Interplay ACM</td><td width="10%"></td><td width="10%">X</td></tr>
  50875. <tr><td width="40%">MACE (Macintosh Audio Compression/Expansion) 3:1</td><td width="10%"></td><td width="10%">X</td></tr>
  50876. <tr><td width="40%">MACE (Macintosh Audio Compression/Expansion) 6:1</td><td width="10%"></td><td width="10%">X</td></tr>
  50877. <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>
  50878. <tr><td width="40%">Monkey&rsquo;s Audio</td><td width="10%"></td><td width="10%">X</td></tr>
  50879. <tr><td width="40%">MP1 (MPEG audio layer 1)</td><td width="10%"></td><td width="10%">IX</td></tr>
  50880. <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>
  50881. <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>
  50882. <tr><td width="40%">MPEG-4 Audio Lossless Coding (ALS)</td><td width="10%"></td><td width="10%">X</td></tr>
  50883. <tr><td width="40%">Musepack SV7</td><td width="10%"></td><td width="10%">X</td></tr>
  50884. <tr><td width="40%">Musepack SV8</td><td width="10%"></td><td width="10%">X</td></tr>
  50885. <tr><td width="40%">Nellymoser Asao</td><td width="10%">X</td><td width="10%">X</td></tr>
  50886. <tr><td width="40%">On2 AVC (Audio for Video Codec)</td><td width="10%"></td><td width="10%">X</td></tr>
  50887. <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>
  50888. <tr><td width="40%">PCM A-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  50889. <tr><td width="40%">PCM mu-law</td><td width="10%">X</td><td width="10%">X</td></tr>
  50890. <tr><td width="40%">PCM Archimedes VIDC</td><td width="10%">X</td><td width="10%">X</td></tr>
  50891. <tr><td width="40%">PCM signed 8-bit planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  50892. <tr><td width="40%">PCM signed 16-bit big-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  50893. <tr><td width="40%">PCM signed 16-bit little-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  50894. <tr><td width="40%">PCM signed 24-bit little-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  50895. <tr><td width="40%">PCM signed 32-bit little-endian planar</td><td width="10%">X</td><td width="10%">X</td></tr>
  50896. <tr><td width="40%">PCM 32-bit floating point big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50897. <tr><td width="40%">PCM 32-bit floating point little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50898. <tr><td width="40%">PCM 64-bit floating point big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50899. <tr><td width="40%">PCM 64-bit floating point little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50900. <tr><td width="40%">PCM D-Cinema audio signed 24-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  50901. <tr><td width="40%">PCM signed 8-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  50902. <tr><td width="40%">PCM signed 16-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50903. <tr><td width="40%">PCM signed 16-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50904. <tr><td width="40%">PCM signed 24-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50905. <tr><td width="40%">PCM signed 24-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50906. <tr><td width="40%">PCM signed 32-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50907. <tr><td width="40%">PCM signed 32-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50908. <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>
  50909. <tr><td width="40%">PCM unsigned 8-bit</td><td width="10%">X</td><td width="10%">X</td></tr>
  50910. <tr><td width="40%">PCM unsigned 16-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50911. <tr><td width="40%">PCM unsigned 16-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50912. <tr><td width="40%">PCM unsigned 24-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50913. <tr><td width="40%">PCM unsigned 24-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50914. <tr><td width="40%">PCM unsigned 32-bit big-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50915. <tr><td width="40%">PCM unsigned 32-bit little-endian</td><td width="10%">X</td><td width="10%">X</td></tr>
  50916. <tr><td width="40%">QCELP / PureVoice</td><td width="10%"></td><td width="10%">X</td></tr>
  50917. <tr><td width="40%">QDesign Music Codec 1</td><td width="10%"></td><td width="10%">X</td></tr>
  50918. <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>
  50919. <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>
  50920. <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>
  50921. <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>
  50922. <tr><td width="40%">RealAudio Lossless</td><td width="10%"></td><td width="10%">X</td></tr>
  50923. <tr><td width="40%">RealAudio SIPR / ACELP.NET</td><td width="10%"></td><td width="10%">X</td></tr>
  50924. <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>
  50925. <tr><td width="40%">Shorten</td><td width="10%"></td><td width="10%">X</td></tr>
  50926. <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>
  50927. <tr><td width="40%">Smacker audio</td><td width="10%"></td><td width="10%">X</td></tr>
  50928. <tr><td width="40%">SMPTE 302M AES3 audio</td><td width="10%">X</td><td width="10%">X</td></tr>
  50929. <tr><td width="40%">Sonic</td><td width="10%">X</td><td width="10%">X</td><td width="40%">experimental codec</td></tr>
  50930. <tr><td width="40%">Sonic lossless</td><td width="10%">X</td><td width="10%">X</td><td width="40%">experimental codec</td></tr>
  50931. <tr><td width="40%">Speex</td><td width="10%">E</td><td width="10%">E</td><td width="40%">supported through external library libspeex</td></tr>
  50932. <tr><td width="40%">TAK (Tom&rsquo;s lossless Audio Kompressor)</td><td width="10%"></td><td width="10%">X</td></tr>
  50933. <tr><td width="40%">True Audio (TTA)</td><td width="10%">X</td><td width="10%">X</td></tr>
  50934. <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>
  50935. <tr><td width="40%">TwinVQ (VQF flavor)</td><td width="10%"></td><td width="10%">X</td></tr>
  50936. <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>
  50937. <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>
  50938. <tr><td width="40%">Voxware MetaSound</td><td width="10%"></td><td width="10%">X</td></tr>
  50939. <tr><td width="40%">WavPack</td><td width="10%">X</td><td width="10%">X</td></tr>
  50940. <tr><td width="40%">Westwood Audio (SND1)</td><td width="10%"></td><td width="10%">X</td></tr>
  50941. <tr><td width="40%">Windows Media Audio 1</td><td width="10%">X</td><td width="10%">X</td></tr>
  50942. <tr><td width="40%">Windows Media Audio 2</td><td width="10%">X</td><td width="10%">X</td></tr>
  50943. <tr><td width="40%">Windows Media Audio Lossless</td><td width="10%"></td><td width="10%">X</td></tr>
  50944. <tr><td width="40%">Windows Media Audio Pro</td><td width="10%"></td><td width="10%">X</td></tr>
  50945. <tr><td width="40%">Windows Media Audio Voice</td><td width="10%"></td><td width="10%">X</td></tr>
  50946. <tr><td width="40%">Xbox Media Audio 1</td><td width="10%"></td><td width="10%">X</td></tr>
  50947. <tr><td width="40%">Xbox Media Audio 2</td><td width="10%"></td><td width="10%">X</td></tr>
  50948. </table>
  50949. <p><code>X</code> means that the feature in that column (encoding / decoding) is supported.
  50950. </p>
  50951. <p><code>E</code> means that support is provided through an external library.
  50952. </p>
  50953. <p><code>I</code> means that an integer-only version is available, too (ensures high
  50954. performance on systems without hardware floating point support).
  50955. </p>
  50956. <a name="Subtitle-Formats"></a>
  50957. <h3 class="section">47.5 Subtitle Formats<span class="pull-right"><a class="anchor hidden-xs" href="#Subtitle-Formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Subtitle-Formats" aria-hidden="true">TOC</a></span></h3>
  50958. <table>
  50959. <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>
  50960. <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>
  50961. <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>
  50962. <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>
  50963. <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>
  50964. <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>
  50965. <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>
  50966. <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>
  50967. <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>
  50968. <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>
  50969. <tr><td width="40%">PGS</td><td width="10%"></td><td width="10%"></td><td width="10%"></td><td width="10%">X</td></tr>
  50970. <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>
  50971. <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>
  50972. <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>
  50973. <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>
  50974. <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>
  50975. <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>
  50976. <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>
  50977. <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>
  50978. <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>
  50979. <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>
  50980. <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>
  50981. <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>
  50982. <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>
  50983. <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>
  50984. </table>
  50985. <p><code>X</code> means that the feature is supported.
  50986. </p>
  50987. <p><code>E</code> means that support is provided through an external library.
  50988. </p>
  50989. <a name="Network-Protocols"></a>
  50990. <h3 class="section">47.6 Network Protocols<span class="pull-right"><a class="anchor hidden-xs" href="#Network-Protocols" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Network-Protocols" aria-hidden="true">TOC</a></span></h3>
  50991. <table>
  50992. <tr><td width="40%">Name</td><td width="10%">Support</td></tr>
  50993. <tr><td width="40%">AMQP</td><td width="10%">E</td></tr>
  50994. <tr><td width="40%">file</td><td width="10%">X</td></tr>
  50995. <tr><td width="40%">FTP</td><td width="10%">X</td></tr>
  50996. <tr><td width="40%">Gopher</td><td width="10%">X</td></tr>
  50997. <tr><td width="40%">Gophers</td><td width="10%">X</td></tr>
  50998. <tr><td width="40%">HLS</td><td width="10%">X</td></tr>
  50999. <tr><td width="40%">HTTP</td><td width="10%">X</td></tr>
  51000. <tr><td width="40%">HTTPS</td><td width="10%">X</td></tr>
  51001. <tr><td width="40%">Icecast</td><td width="10%">X</td></tr>
  51002. <tr><td width="40%">MMSH</td><td width="10%">X</td></tr>
  51003. <tr><td width="40%">MMST</td><td width="10%">X</td></tr>
  51004. <tr><td width="40%">pipe</td><td width="10%">X</td></tr>
  51005. <tr><td width="40%">Pro-MPEG FEC</td><td width="10%">X</td></tr>
  51006. <tr><td width="40%">RTMP</td><td width="10%">X</td></tr>
  51007. <tr><td width="40%">RTMPE</td><td width="10%">X</td></tr>
  51008. <tr><td width="40%">RTMPS</td><td width="10%">X</td></tr>
  51009. <tr><td width="40%">RTMPT</td><td width="10%">X</td></tr>
  51010. <tr><td width="40%">RTMPTE</td><td width="10%">X</td></tr>
  51011. <tr><td width="40%">RTMPTS</td><td width="10%">X</td></tr>
  51012. <tr><td width="40%">RTP</td><td width="10%">X</td></tr>
  51013. <tr><td width="40%">SAMBA</td><td width="10%">E</td></tr>
  51014. <tr><td width="40%">SCTP</td><td width="10%">X</td></tr>
  51015. <tr><td width="40%">SFTP</td><td width="10%">E</td></tr>
  51016. <tr><td width="40%">TCP</td><td width="10%">X</td></tr>
  51017. <tr><td width="40%">TLS</td><td width="10%">X</td></tr>
  51018. <tr><td width="40%">UDP</td><td width="10%">X</td></tr>
  51019. <tr><td width="40%">ZMQ</td><td width="10%">E</td></tr>
  51020. </table>
  51021. <p><code>X</code> means that the protocol is supported.
  51022. </p>
  51023. <p><code>E</code> means that support is provided through an external library.
  51024. </p>
  51025. <a name="Input_002fOutput-Devices"></a>
  51026. <h3 class="section">47.7 Input/Output Devices<span class="pull-right"><a class="anchor hidden-xs" href="#Input_002fOutput-Devices" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Input_002fOutput-Devices" aria-hidden="true">TOC</a></span></h3>
  51027. <table>
  51028. <tr><td width="40%">Name</td><td width="10%">Input</td><td width="10%">Output</td></tr>
  51029. <tr><td width="40%">ALSA</td><td width="10%">X</td><td width="10%">X</td></tr>
  51030. <tr><td width="40%">BKTR</td><td width="10%">X</td><td width="10%"></td></tr>
  51031. <tr><td width="40%">caca</td><td width="10%"></td><td width="10%">X</td></tr>
  51032. <tr><td width="40%">DV1394</td><td width="10%">X</td><td width="10%"></td></tr>
  51033. <tr><td width="40%">Lavfi virtual device</td><td width="10%">X</td><td width="10%"></td></tr>
  51034. <tr><td width="40%">Linux framebuffer</td><td width="10%">X</td><td width="10%">X</td></tr>
  51035. <tr><td width="40%">JACK</td><td width="10%">X</td><td width="10%"></td></tr>
  51036. <tr><td width="40%">LIBCDIO</td><td width="10%">X</td></tr>
  51037. <tr><td width="40%">LIBDC1394</td><td width="10%">X</td><td width="10%"></td></tr>
  51038. <tr><td width="40%">OpenAL</td><td width="10%">X</td></tr>
  51039. <tr><td width="40%">OpenGL</td><td width="10%"></td><td width="10%">X</td></tr>
  51040. <tr><td width="40%">OSS</td><td width="10%">X</td><td width="10%">X</td></tr>
  51041. <tr><td width="40%">PulseAudio</td><td width="10%">X</td><td width="10%">X</td></tr>
  51042. <tr><td width="40%">SDL</td><td width="10%"></td><td width="10%">X</td></tr>
  51043. <tr><td width="40%">Video4Linux2</td><td width="10%">X</td><td width="10%">X</td></tr>
  51044. <tr><td width="40%">VfW capture</td><td width="10%">X</td><td width="10%"></td></tr>
  51045. <tr><td width="40%">X11 grabbing</td><td width="10%">X</td><td width="10%"></td></tr>
  51046. <tr><td width="40%">Win32 grabbing</td><td width="10%">X</td><td width="10%"></td></tr>
  51047. </table>
  51048. <p><code>X</code> means that input/output is supported.
  51049. </p>
  51050. <a name="Timecode"></a>
  51051. <h3 class="section">47.8 Timecode<span class="pull-right"><a class="anchor hidden-xs" href="#Timecode" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Timecode" aria-hidden="true">TOC</a></span></h3>
  51052. <table>
  51053. <tr><td width="40%">Codec/format</td><td width="10%">Read</td><td width="10%">Write</td></tr>
  51054. <tr><td width="40%">AVI</td><td width="10%">X</td><td width="10%">X</td></tr>
  51055. <tr><td width="40%">DV</td><td width="10%">X</td><td width="10%">X</td></tr>
  51056. <tr><td width="40%">GXF</td><td width="10%">X</td><td width="10%">X</td></tr>
  51057. <tr><td width="40%">MOV</td><td width="10%">X</td><td width="10%">X</td></tr>
  51058. <tr><td width="40%">MPEG1/2</td><td width="10%">X</td><td width="10%">X</td></tr>
  51059. <tr><td width="40%">MXF</td><td width="10%">X</td><td width="10%">X</td></tr>
  51060. </table>
  51061. <a name="See-Also"></a>
  51062. <h2 class="chapter">48 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
  51063. <p><a href="ffmpeg.html">ffmpeg</a>
  51064. <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
  51065. <a href="ffmpeg-utils.html">ffmpeg-utils</a>,
  51066. <a href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
  51067. <a href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
  51068. <a href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
  51069. <a href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
  51070. <a href="ffmpeg-formats.html">ffmpeg-formats</a>,
  51071. <a href="ffmpeg-devices.html">ffmpeg-devices</a>,
  51072. <a href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
  51073. <a href="ffmpeg-filters.html">ffmpeg-filters</a>
  51074. </p>
  51075. <a name="Authors"></a>
  51076. <h2 class="chapter">49 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
  51077. <p>The FFmpeg developers.
  51078. </p>
  51079. <p>For details about the authorship, see the Git history of the project
  51080. (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
  51081. <code>git log</code> in the FFmpeg source directory, or browsing the
  51082. online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
  51083. </p>
  51084. <p>Maintainers for the specific components are listed in the file
  51085. <samp>MAINTAINERS</samp> in the source code tree.
  51086. </p>
  51087. <p style="font-size: small;">
  51088. This document was generated using <a href="http://www.gnu.org/software/texinfo/"><em>makeinfo</em></a>.
  51089. </p>
  51090. </div>
  51091. </body>
  51092. </html>