ffmpeg-all.html 1.8 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <title>FFmpeg documentation</title>
  7. <link rel="stylesheet" href="bootstrap.min.css" />
  8. <link rel="stylesheet" href="style.min.css" />
  9. <meta name="description" content="ffmpeg Documentation: ">
  10. <meta name="keywords" content="FFmpeg documentation : ffmpeg ">
  11. <meta name="Generator" content="texi2html 5.0">
  12. <!-- Created on June 8, 2020 by texi2html 5.0 -->
  13. <!--
  14. texi2html was written by:
  15. Lionel Cons <Lionel.Cons@cern.ch> (original author)
  16. Karl Berry <karl@freefriends.org>
  17. Olaf Bachmann <obachman@mathematik.uni-kl.de>
  18. and many others.
  19. Maintained by: Many creative people.
  20. Send bugs and suggestions to <texi2html-bug@nongnu.org>
  21. -->
  22. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  23. </head>
  24. <body>
  25. <div class="container">
  26. <h1 class="titlefont">ffmpeg Documentation</h1>
  27. <hr>
  28. <a name="SEC_Top"></a>
  29. <a name="SEC_Contents"></a>
  30. <h1>Table of Contents</h1>
  31. <div class="contents">
  32. <ul class="no-bullet">
  33. <li><a name="toc-Synopsis" href="#Synopsis">1 Synopsis</a></li>
  34. <li><a name="toc-Description" href="#Description">2 Description</a></li>
  35. <li><a name="toc-Detailed-description" href="#Detailed-description">3 Detailed description</a>
  36. <ul class="no-bullet">
  37. <li><a name="toc-Filtering" href="#Filtering">3.1 Filtering</a>
  38. <ul class="no-bullet">
  39. <li><a name="toc-Simple-filtergraphs" href="#Simple-filtergraphs">3.1.1 Simple filtergraphs</a></li>
  40. <li><a name="toc-Complex-filtergraphs" href="#Complex-filtergraphs">3.1.2 Complex filtergraphs</a></li>
  41. </ul></li>
  42. <li><a name="toc-Stream-copy" href="#Stream-copy">3.2 Stream copy</a></li>
  43. </ul></li>
  44. <li><a name="toc-Stream-selection" href="#Stream-selection">4 Stream selection</a>
  45. <ul class="no-bullet">
  46. <li><a name="toc-Description-1" href="#Description-1">4.1 Description</a>
  47. <ul class="no-bullet">
  48. <li><a name="toc-Automatic-stream-selection" href="#Automatic-stream-selection">4.1.1 Automatic stream selection</a></li>
  49. <li><a name="toc-Manual-stream-selection" href="#Manual-stream-selection">4.1.2 Manual stream selection</a></li>
  50. <li><a name="toc-Complex-filtergraphs-1" href="#Complex-filtergraphs-1">4.1.3 Complex filtergraphs</a></li>
  51. <li><a name="toc-Stream-handling" href="#Stream-handling">4.1.4 Stream handling</a></li>
  52. </ul></li>
  53. <li><a name="toc-Examples-181" href="#Examples-181">4.2 Examples</a></li>
  54. </ul></li>
  55. <li><a name="toc-Options-17" href="#Options-17">5 Options</a>
  56. <ul class="no-bullet">
  57. <li><a name="toc-Stream-specifiers-1" href="#Stream-specifiers-1">5.1 Stream specifiers</a></li>
  58. <li><a name="toc-Generic-options" href="#Generic-options">5.2 Generic options</a></li>
  59. <li><a name="toc-AVOptions" href="#AVOptions">5.3 AVOptions</a></li>
  60. <li><a name="toc-Main-options" href="#Main-options">5.4 Main options</a></li>
  61. <li><a name="toc-Video-Options" href="#Video-Options">5.5 Video Options</a></li>
  62. <li><a name="toc-Advanced-Video-options" href="#Advanced-Video-options">5.6 Advanced Video options</a></li>
  63. <li><a name="toc-Audio-Options" href="#Audio-Options">5.7 Audio Options</a></li>
  64. <li><a name="toc-Advanced-Audio-options" href="#Advanced-Audio-options">5.8 Advanced Audio options</a></li>
  65. <li><a name="toc-Subtitle-options" href="#Subtitle-options">5.9 Subtitle options</a></li>
  66. <li><a name="toc-Advanced-Subtitle-options" href="#Advanced-Subtitle-options">5.10 Advanced Subtitle options</a></li>
  67. <li><a name="toc-Advanced-options" href="#Advanced-options">5.11 Advanced options</a></li>
  68. <li><a name="toc-Preset-files" href="#Preset-files">5.12 Preset files</a>
  69. <ul class="no-bullet">
  70. <li><a name="toc-ffpreset-files" href="#ffpreset-files">5.12.1 ffpreset files</a></li>
  71. <li><a name="toc-avpreset-files" href="#avpreset-files">5.12.2 avpreset files</a></li>
  72. </ul>
  73. </li>
  74. </ul></li>
  75. <li><a name="toc-Examples-57" href="#Examples-57">6 Examples</a>
  76. <ul class="no-bullet">
  77. <li><a name="toc-Video-and-Audio-grabbing" href="#Video-and-Audio-grabbing">6.1 Video and Audio grabbing</a></li>
  78. <li><a name="toc-X11-grabbing" href="#X11-grabbing">6.2 X11 grabbing</a></li>
  79. <li><a name="toc-Video-and-Audio-file-format-conversion" href="#Video-and-Audio-file-format-conversion">6.3 Video and Audio file format conversion</a></li>
  80. </ul></li>
  81. <li><a name="toc-Syntax-2" href="#Syntax-2">7 Syntax</a>
  82. <ul class="no-bullet">
  83. <li><a name="toc-Quoting-and-escaping" href="#Quoting-and-escaping">7.1 Quoting and escaping</a>
  84. <ul class="no-bullet">
  85. <li><a name="toc-Examples-3" href="#Examples-3">7.1.1 Examples</a></li>
  86. </ul></li>
  87. <li><a name="toc-Date" href="#Date">7.2 Date</a></li>
  88. <li><a name="toc-Time-duration" href="#Time-duration">7.3 Time duration</a>
  89. <ul class="no-bullet">
  90. <li><a name="toc-Examples-149" href="#Examples-149">7.3.1 Examples</a></li>
  91. </ul></li>
  92. <li><a name="toc-Video-size" href="#Video-size">7.4 Video size</a></li>
  93. <li><a name="toc-Video-rate" href="#Video-rate">7.5 Video rate</a></li>
  94. <li><a name="toc-Ratio" href="#Ratio">7.6 Ratio</a></li>
  95. <li><a name="toc-Color" href="#Color">7.7 Color</a></li>
  96. <li><a name="toc-Channel-Layout" href="#Channel-Layout">7.8 Channel Layout</a></li>
  97. </ul></li>
  98. <li><a name="toc-Expression-Evaluation" href="#Expression-Evaluation">8 Expression Evaluation</a></li>
  99. <li><a name="toc-Codec-Options" href="#Codec-Options">9 Codec Options</a></li>
  100. <li><a name="toc-Decoders" href="#Decoders">10 Decoders</a></li>
  101. <li><a name="toc-Video-Decoders" href="#Video-Decoders">11 Video Decoders</a>
  102. <ul class="no-bullet">
  103. <li><a name="toc-rawvideo" href="#rawvideo">11.1 rawvideo</a>
  104. <ul class="no-bullet">
  105. <li><a name="toc-Options-20" href="#Options-20">11.1.1 Options</a></li>
  106. </ul></li>
  107. <li><a name="toc-libdav1d" href="#libdav1d">11.2 libdav1d</a>
  108. <ul class="no-bullet">
  109. <li><a name="toc-Options-74" href="#Options-74">11.2.1 Options</a></li>
  110. </ul></li>
  111. <li><a name="toc-libdavs2" href="#libdavs2">11.3 libdavs2</a></li>
  112. </ul></li>
  113. <li><a name="toc-Audio-Decoders" href="#Audio-Decoders">12 Audio Decoders</a>
  114. <ul class="no-bullet">
  115. <li><a name="toc-ac3" href="#ac3">12.1 ac3</a>
  116. <ul class="no-bullet">
  117. <li><a name="toc-AC_002d3-Decoder-Options" href="#AC_002d3-Decoder-Options">12.1.1 AC-3 Decoder Options</a></li>
  118. </ul></li>
  119. <li><a name="toc-flac-1" href="#flac-1">12.2 flac</a>
  120. <ul class="no-bullet">
  121. <li><a name="toc-FLAC-Decoder-options" href="#FLAC-Decoder-options">12.2.1 FLAC Decoder options</a></li>
  122. </ul></li>
  123. <li><a name="toc-ffwavesynth" href="#ffwavesynth">12.3 ffwavesynth</a></li>
  124. <li><a name="toc-libcelt" href="#libcelt">12.4 libcelt</a></li>
  125. <li><a name="toc-libgsm" href="#libgsm">12.5 libgsm</a></li>
  126. <li><a name="toc-libilbc" href="#libilbc">12.6 libilbc</a>
  127. <ul class="no-bullet">
  128. <li><a name="toc-Options-4" href="#Options-4">12.6.1 Options</a></li>
  129. </ul></li>
  130. <li><a name="toc-libopencore_002damrnb-1" href="#libopencore_002damrnb-1">12.7 libopencore-amrnb</a></li>
  131. <li><a name="toc-libopencore_002damrwb" href="#libopencore_002damrwb">12.8 libopencore-amrwb</a></li>
  132. <li><a name="toc-libopus" href="#libopus">12.9 libopus</a></li>
  133. </ul></li>
  134. <li><a name="toc-Subtitles-Decoders" href="#Subtitles-Decoders">13 Subtitles Decoders</a>
  135. <ul class="no-bullet">
  136. <li><a name="toc-libaribb24" href="#libaribb24">13.1 libaribb24</a>
  137. <ul class="no-bullet">
  138. <li><a name="toc-libaribb24-Decoder-Options" href="#libaribb24-Decoder-Options">13.1.1 libaribb24 Decoder Options</a></li>
  139. </ul></li>
  140. <li><a name="toc-dvbsub" href="#dvbsub">13.2 dvbsub</a>
  141. <ul class="no-bullet">
  142. <li><a name="toc-Options-60" href="#Options-60">13.2.1 Options</a></li>
  143. </ul></li>
  144. <li><a name="toc-dvdsub" href="#dvdsub">13.3 dvdsub</a>
  145. <ul class="no-bullet">
  146. <li><a name="toc-Options-35" href="#Options-35">13.3.1 Options</a></li>
  147. </ul></li>
  148. <li><a name="toc-libzvbi_002dteletext" href="#libzvbi_002dteletext">13.4 libzvbi-teletext</a>
  149. <ul class="no-bullet">
  150. <li><a name="toc-Options-45" href="#Options-45">13.4.1 Options</a></li>
  151. </ul>
  152. </li>
  153. </ul></li>
  154. <li><a name="toc-Encoders" href="#Encoders">14 Encoders</a></li>
  155. <li><a name="toc-Audio-Encoders" href="#Audio-Encoders">15 Audio Encoders</a>
  156. <ul class="no-bullet">
  157. <li><a name="toc-aac" href="#aac">15.1 aac</a>
  158. <ul class="no-bullet">
  159. <li><a name="toc-Options-64" href="#Options-64">15.1.1 Options</a></li>
  160. </ul></li>
  161. <li><a name="toc-ac3-and-ac3_005ffixed" href="#ac3-and-ac3_005ffixed">15.2 ac3 and ac3_fixed</a>
  162. <ul class="no-bullet">
  163. <li><a name="toc-AC_002d3-Metadata" href="#AC_002d3-Metadata">15.2.1 AC-3 Metadata</a>
  164. <ul class="no-bullet">
  165. <li><a name="toc-Metadata-Control-Options" href="#Metadata-Control-Options">15.2.1.1 Metadata Control Options</a></li>
  166. <li><a name="toc-Downmix-Levels" href="#Downmix-Levels">15.2.1.2 Downmix Levels</a></li>
  167. <li><a name="toc-Audio-Production-Information" href="#Audio-Production-Information">15.2.1.3 Audio Production Information</a></li>
  168. <li><a name="toc-Other-Metadata-Options" href="#Other-Metadata-Options">15.2.1.4 Other Metadata Options</a></li>
  169. </ul></li>
  170. <li><a name="toc-Extended-Bitstream-Information" href="#Extended-Bitstream-Information">15.2.2 Extended Bitstream Information</a>
  171. <ul class="no-bullet">
  172. <li><a name="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>
  173. <li><a name="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>
  174. </ul></li>
  175. <li><a name="toc-Other-AC_002d3-Encoding-Options" href="#Other-AC_002d3-Encoding-Options">15.2.3 Other AC-3 Encoding Options</a></li>
  176. <li><a name="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>
  177. </ul></li>
  178. <li><a name="toc-flac-2" href="#flac-2">15.3 flac</a>
  179. <ul class="no-bullet">
  180. <li><a name="toc-Options-44" href="#Options-44">15.3.1 Options</a></li>
  181. </ul></li>
  182. <li><a name="toc-opus" href="#opus">15.4 opus</a>
  183. <ul class="no-bullet">
  184. <li><a name="toc-Options-63" href="#Options-63">15.4.1 Options</a></li>
  185. </ul></li>
  186. <li><a name="toc-libfdk_005faac" href="#libfdk_005faac">15.5 libfdk_aac</a>
  187. <ul class="no-bullet">
  188. <li><a name="toc-Options-50" href="#Options-50">15.5.1 Options</a></li>
  189. <li><a name="toc-Examples-76" href="#Examples-76">15.5.2 Examples</a></li>
  190. </ul></li>
  191. <li><a name="toc-libmp3lame-1" href="#libmp3lame-1">15.6 libmp3lame</a>
  192. <ul class="no-bullet">
  193. <li><a name="toc-Options-66" href="#Options-66">15.6.1 Options</a></li>
  194. </ul></li>
  195. <li><a name="toc-libopencore_002damrnb" href="#libopencore_002damrnb">15.7 libopencore-amrnb</a>
  196. <ul class="no-bullet">
  197. <li><a name="toc-Options-55" href="#Options-55">15.7.1 Options</a></li>
  198. </ul></li>
  199. <li><a name="toc-libopus-1" href="#libopus-1">15.8 libopus</a>
  200. <ul class="no-bullet">
  201. <li><a name="toc-Option-Mapping" href="#Option-Mapping">15.8.1 Option Mapping</a></li>
  202. </ul></li>
  203. <li><a name="toc-libshine-1" href="#libshine-1">15.9 libshine</a>
  204. <ul class="no-bullet">
  205. <li><a name="toc-Options-75" href="#Options-75">15.9.1 Options</a></li>
  206. </ul></li>
  207. <li><a name="toc-libtwolame" href="#libtwolame">15.10 libtwolame</a>
  208. <ul class="no-bullet">
  209. <li><a name="toc-Options-58" href="#Options-58">15.10.1 Options</a></li>
  210. </ul></li>
  211. <li><a name="toc-libvo_002damrwbenc" href="#libvo_002damrwbenc">15.11 libvo-amrwbenc</a>
  212. <ul class="no-bullet">
  213. <li><a name="toc-Options-48" href="#Options-48">15.11.1 Options</a></li>
  214. </ul></li>
  215. <li><a name="toc-libvorbis" href="#libvorbis">15.12 libvorbis</a>
  216. <ul class="no-bullet">
  217. <li><a name="toc-Options-32" href="#Options-32">15.12.1 Options</a></li>
  218. </ul></li>
  219. <li><a name="toc-libwavpack-1" href="#libwavpack-1">15.13 libwavpack</a>
  220. <ul class="no-bullet">
  221. <li><a name="toc-Options-30" href="#Options-30">15.13.1 Options</a></li>
  222. </ul></li>
  223. <li><a name="toc-mjpeg" href="#mjpeg">15.14 mjpeg</a>
  224. <ul class="no-bullet">
  225. <li><a name="toc-Options-82" href="#Options-82">15.14.1 Options</a></li>
  226. </ul></li>
  227. <li><a name="toc-wavpack" href="#wavpack">15.15 wavpack</a>
  228. <ul class="no-bullet">
  229. <li><a name="toc-Options-25" href="#Options-25">15.15.1 Options</a>
  230. <ul class="no-bullet">
  231. <li><a name="toc-Shared-options" href="#Shared-options">15.15.1.1 Shared options</a></li>
  232. <li><a name="toc-Private-options-1" href="#Private-options-1">15.15.1.2 Private options</a></li>
  233. </ul>
  234. </li>
  235. </ul>
  236. </li>
  237. </ul></li>
  238. <li><a name="toc-Video-Encoders" href="#Video-Encoders">16 Video Encoders</a>
  239. <ul class="no-bullet">
  240. <li><a name="toc-Hap" href="#Hap">16.1 Hap</a>
  241. <ul class="no-bullet">
  242. <li><a name="toc-Options-15" href="#Options-15">16.1.1 Options</a></li>
  243. </ul></li>
  244. <li><a name="toc-jpeg2000" href="#jpeg2000">16.2 jpeg2000</a>
  245. <ul class="no-bullet">
  246. <li><a name="toc-Options-3" href="#Options-3">16.2.1 Options</a></li>
  247. </ul></li>
  248. <li><a name="toc-librav1e" href="#librav1e">16.3 librav1e</a>
  249. <ul class="no-bullet">
  250. <li><a name="toc-Options-39" href="#Options-39">16.3.1 Options</a></li>
  251. </ul></li>
  252. <li><a name="toc-libaom_002dav1" href="#libaom_002dav1">16.4 libaom-av1</a>
  253. <ul class="no-bullet">
  254. <li><a name="toc-Options-19" href="#Options-19">16.4.1 Options</a></li>
  255. </ul></li>
  256. <li><a name="toc-libkvazaar" href="#libkvazaar">16.5 libkvazaar</a>
  257. <ul class="no-bullet">
  258. <li><a name="toc-Options" href="#Options">16.5.1 Options</a></li>
  259. </ul></li>
  260. <li><a name="toc-libopenh264" href="#libopenh264">16.6 libopenh264</a>
  261. <ul class="no-bullet">
  262. <li><a name="toc-Options-37" href="#Options-37">16.6.1 Options</a></li>
  263. </ul></li>
  264. <li><a name="toc-libtheora" href="#libtheora">16.7 libtheora</a>
  265. <ul class="no-bullet">
  266. <li><a name="toc-Options-80" href="#Options-80">16.7.1 Options</a></li>
  267. <li><a name="toc-Examples-136" href="#Examples-136">16.7.2 Examples</a></li>
  268. </ul></li>
  269. <li><a name="toc-libvpx" href="#libvpx">16.8 libvpx</a>
  270. <ul class="no-bullet">
  271. <li><a name="toc-Options-56" href="#Options-56">16.8.1 Options</a></li>
  272. </ul></li>
  273. <li><a name="toc-libwebp" href="#libwebp">16.9 libwebp</a>
  274. <ul class="no-bullet">
  275. <li><a name="toc-Pixel-Format" href="#Pixel-Format">16.9.1 Pixel Format</a></li>
  276. <li><a name="toc-Options-31" href="#Options-31">16.9.2 Options</a></li>
  277. </ul></li>
  278. <li><a name="toc-libx264_002c-libx264rgb" href="#libx264_002c-libx264rgb">16.10 libx264, libx264rgb</a>
  279. <ul class="no-bullet">
  280. <li><a name="toc-Supported-Pixel-Formats" href="#Supported-Pixel-Formats">16.10.1 Supported Pixel Formats</a></li>
  281. <li><a name="toc-Options-51" href="#Options-51">16.10.2 Options</a></li>
  282. </ul></li>
  283. <li><a name="toc-libx265" href="#libx265">16.11 libx265</a>
  284. <ul class="no-bullet">
  285. <li><a name="toc-Options-62" href="#Options-62">16.11.1 Options</a></li>
  286. </ul></li>
  287. <li><a name="toc-libxavs2" href="#libxavs2">16.12 libxavs2</a>
  288. <ul class="no-bullet">
  289. <li><a name="toc-Options-18" href="#Options-18">16.12.1 Options</a></li>
  290. </ul></li>
  291. <li><a name="toc-libxvid" href="#libxvid">16.13 libxvid</a>
  292. <ul class="no-bullet">
  293. <li><a name="toc-Options-22" href="#Options-22">16.13.1 Options</a></li>
  294. </ul></li>
  295. <li><a name="toc-MediaFoundation" href="#MediaFoundation">16.14 MediaFoundation</a></li>
  296. <li><a name="toc-mpeg2" href="#mpeg2">16.15 mpeg2</a>
  297. <ul class="no-bullet">
  298. <li><a name="toc-Options-26" href="#Options-26">16.15.1 Options</a></li>
  299. </ul></li>
  300. <li><a name="toc-png" href="#png">16.16 png</a>
  301. <ul class="no-bullet">
  302. <li><a name="toc-Private-options" href="#Private-options">16.16.1 Private options</a></li>
  303. </ul></li>
  304. <li><a name="toc-ProRes" href="#ProRes">16.17 ProRes</a>
  305. <ul class="no-bullet">
  306. <li><a name="toc-Private-Options-for-prores_002dks" href="#Private-Options-for-prores_002dks">16.17.1 Private Options for prores-ks</a></li>
  307. <li><a name="toc-Speed-considerations" href="#Speed-considerations">16.17.2 Speed considerations</a></li>
  308. </ul></li>
  309. <li><a name="toc-QSV-encoders" href="#QSV-encoders">16.18 QSV encoders</a></li>
  310. <li><a name="toc-snow" href="#snow">16.19 snow</a>
  311. <ul class="no-bullet">
  312. <li><a name="toc-Options-1" href="#Options-1">16.19.1 Options</a></li>
  313. </ul></li>
  314. <li><a name="toc-VAAPI-encoders" href="#VAAPI-encoders">16.20 VAAPI encoders</a></li>
  315. <li><a name="toc-vc2" href="#vc2">16.21 vc2</a>
  316. <ul class="no-bullet">
  317. <li><a name="toc-Options-24" href="#Options-24">16.21.1 Options</a></li>
  318. </ul>
  319. </li>
  320. </ul></li>
  321. <li><a name="toc-Subtitles-Encoders" href="#Subtitles-Encoders">17 Subtitles Encoders</a>
  322. <ul class="no-bullet">
  323. <li><a name="toc-dvdsub-1" href="#dvdsub-1">17.1 dvdsub</a>
  324. <ul class="no-bullet">
  325. <li><a name="toc-Options-61" href="#Options-61">17.1.1 Options</a></li>
  326. </ul>
  327. </li>
  328. </ul></li>
  329. <li><a name="toc-Bitstream-Filters" href="#Bitstream-Filters">18 Bitstream Filters</a>
  330. <ul class="no-bullet">
  331. <li><a name="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">18.1 aac_adtstoasc</a></li>
  332. <li><a name="toc-av1_005fmetadata" href="#av1_005fmetadata">18.2 av1_metadata</a></li>
  333. <li><a name="toc-chomp" href="#chomp">18.3 chomp</a></li>
  334. <li><a name="toc-dca_005fcore" href="#dca_005fcore">18.4 dca_core</a></li>
  335. <li><a name="toc-dump_005fextra" href="#dump_005fextra">18.5 dump_extra</a></li>
  336. <li><a name="toc-eac3_005fcore" href="#eac3_005fcore">18.6 eac3_core</a></li>
  337. <li><a name="toc-extract_005fextradata" href="#extract_005fextradata">18.7 extract_extradata</a></li>
  338. <li><a name="toc-filter_005funits" href="#filter_005funits">18.8 filter_units</a></li>
  339. <li><a name="toc-hapqa_005fextract" href="#hapqa_005fextract">18.9 hapqa_extract</a></li>
  340. <li><a name="toc-h264_005fmetadata" href="#h264_005fmetadata">18.10 h264_metadata</a></li>
  341. <li><a name="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">18.11 h264_mp4toannexb</a></li>
  342. <li><a name="toc-h264_005fredundant_005fpps" href="#h264_005fredundant_005fpps">18.12 h264_redundant_pps</a></li>
  343. <li><a name="toc-hevc_005fmetadata" href="#hevc_005fmetadata">18.13 hevc_metadata</a></li>
  344. <li><a name="toc-hevc_005fmp4toannexb" href="#hevc_005fmp4toannexb">18.14 hevc_mp4toannexb</a></li>
  345. <li><a name="toc-imxdump" href="#imxdump">18.15 imxdump</a></li>
  346. <li><a name="toc-mjpeg2jpeg" href="#mjpeg2jpeg">18.16 mjpeg2jpeg</a></li>
  347. <li><a name="toc-mjpegadump" href="#mjpegadump">18.17 mjpegadump</a></li>
  348. <li><a name="toc-mov2textsub-1" href="#mov2textsub-1">18.18 mov2textsub</a></li>
  349. <li><a name="toc-mp3decomp" href="#mp3decomp">18.19 mp3decomp</a></li>
  350. <li><a name="toc-mpeg2_005fmetadata" href="#mpeg2_005fmetadata">18.20 mpeg2_metadata</a></li>
  351. <li><a name="toc-mpeg4_005funpack_005fbframes" href="#mpeg4_005funpack_005fbframes">18.21 mpeg4_unpack_bframes</a></li>
  352. <li><a name="toc-noise-1" href="#noise-1">18.22 noise</a></li>
  353. <li><a name="toc-null-2" href="#null-2">18.23 null</a></li>
  354. <li><a name="toc-pcm_005frechunk" href="#pcm_005frechunk">18.24 pcm_rechunk</a></li>
  355. <li><a name="toc-prores_005fmetadata" href="#prores_005fmetadata">18.25 prores_metadata</a></li>
  356. <li><a name="toc-remove_005fextra" href="#remove_005fextra">18.26 remove_extra</a></li>
  357. <li><a name="toc-text2movsub-1" href="#text2movsub-1">18.27 text2movsub</a></li>
  358. <li><a name="toc-trace_005fheaders" href="#trace_005fheaders">18.28 trace_headers</a></li>
  359. <li><a name="toc-truehd_005fcore" href="#truehd_005fcore">18.29 truehd_core</a></li>
  360. <li><a name="toc-vp9_005fmetadata" href="#vp9_005fmetadata">18.30 vp9_metadata</a></li>
  361. <li><a name="toc-vp9_005fsuperframe" href="#vp9_005fsuperframe">18.31 vp9_superframe</a></li>
  362. <li><a name="toc-vp9_005fsuperframe_005fsplit" href="#vp9_005fsuperframe_005fsplit">18.32 vp9_superframe_split</a></li>
  363. <li><a name="toc-vp9_005fraw_005freorder" href="#vp9_005fraw_005freorder">18.33 vp9_raw_reorder</a></li>
  364. </ul></li>
  365. <li><a name="toc-Format-Options" href="#Format-Options">19 Format Options</a>
  366. <ul class="no-bullet">
  367. <li><a name="toc-Format-stream-specifiers-1" href="#Format-stream-specifiers-1">19.1 Format stream specifiers</a></li>
  368. </ul></li>
  369. <li><a name="toc-Demuxers" href="#Demuxers">20 Demuxers</a>
  370. <ul class="no-bullet">
  371. <li><a name="toc-aa" href="#aa">20.1 aa</a></li>
  372. <li><a name="toc-apng" href="#apng">20.2 apng</a></li>
  373. <li><a name="toc-asf-2" href="#asf-2">20.3 asf</a></li>
  374. <li><a name="toc-concat-3" href="#concat-3">20.4 concat</a>
  375. <ul class="no-bullet">
  376. <li><a name="toc-Syntax-1" href="#Syntax-1">20.4.1 Syntax</a></li>
  377. <li><a name="toc-Options-85" href="#Options-85">20.4.2 Options</a></li>
  378. <li><a name="toc-Examples-184" href="#Examples-184">20.4.3 Examples</a></li>
  379. </ul></li>
  380. <li><a name="toc-dash-1" href="#dash-1">20.5 dash</a></li>
  381. <li><a name="toc-flv_002c-live_005fflv" href="#flv_002c-live_005fflv">20.6 flv, live_flv</a></li>
  382. <li><a name="toc-gif-2" href="#gif-2">20.7 gif</a></li>
  383. <li><a name="toc-hls-1" href="#hls-1">20.8 hls</a></li>
  384. <li><a name="toc-image2-1" href="#image2-1">20.9 image2</a>
  385. <ul class="no-bullet">
  386. <li><a name="toc-Examples-105" href="#Examples-105">20.9.1 Examples</a></li>
  387. </ul></li>
  388. <li><a name="toc-libgme" href="#libgme">20.10 libgme</a></li>
  389. <li><a name="toc-libmodplug" href="#libmodplug">20.11 libmodplug</a></li>
  390. <li><a name="toc-libopenmpt" href="#libopenmpt">20.12 libopenmpt</a></li>
  391. <li><a name="toc-mov_002fmp4_002f3gp" href="#mov_002fmp4_002f3gp">20.13 mov/mp4/3gp</a>
  392. <ul class="no-bullet">
  393. <li><a name="toc-Options-8" href="#Options-8">20.13.1 Options</a></li>
  394. <li><a name="toc-Audible-AAX" href="#Audible-AAX">20.13.2 Audible AAX</a></li>
  395. </ul></li>
  396. <li><a name="toc-mpegts-1" href="#mpegts-1">20.14 mpegts</a></li>
  397. <li><a name="toc-mpjpeg" href="#mpjpeg">20.15 mpjpeg</a></li>
  398. <li><a name="toc-rawvideo-1" href="#rawvideo-1">20.16 rawvideo</a></li>
  399. <li><a name="toc-sbg" href="#sbg">20.17 sbg</a></li>
  400. <li><a name="toc-tedcaptions" href="#tedcaptions">20.18 tedcaptions</a></li>
  401. <li><a name="toc-vapoursynth" href="#vapoursynth">20.19 vapoursynth</a></li>
  402. </ul></li>
  403. <li><a name="toc-Muxers" href="#Muxers">21 Muxers</a>
  404. <ul class="no-bullet">
  405. <li><a name="toc-aiff-1" href="#aiff-1">21.1 aiff</a>
  406. <ul class="no-bullet">
  407. <li><a name="toc-Options-67" href="#Options-67">21.1.1 Options</a></li>
  408. </ul></li>
  409. <li><a name="toc-asf-1" href="#asf-1">21.2 asf</a>
  410. <ul class="no-bullet">
  411. <li><a name="toc-Options-38" href="#Options-38">21.2.1 Options</a></li>
  412. </ul></li>
  413. <li><a name="toc-avi-1" href="#avi-1">21.3 avi</a>
  414. <ul class="no-bullet">
  415. <li><a name="toc-Options-14" href="#Options-14">21.3.1 Options</a></li>
  416. </ul></li>
  417. <li><a name="toc-chromaprint-1" href="#chromaprint-1">21.4 chromaprint</a>
  418. <ul class="no-bullet">
  419. <li><a name="toc-Options-53" href="#Options-53">21.4.1 Options</a></li>
  420. </ul></li>
  421. <li><a name="toc-crc-1" href="#crc-1">21.5 crc</a>
  422. <ul class="no-bullet">
  423. <li><a name="toc-Examples-85" href="#Examples-85">21.5.1 Examples</a></li>
  424. </ul></li>
  425. <li><a name="toc-flv" href="#flv">21.6 flv</a></li>
  426. <li><a name="toc-dash-2" href="#dash-2">21.7 dash</a></li>
  427. <li><a name="toc-framecrc-1" href="#framecrc-1">21.8 framecrc</a>
  428. <ul class="no-bullet">
  429. <li><a name="toc-Examples-55" href="#Examples-55">21.8.1 Examples</a></li>
  430. </ul></li>
  431. <li><a name="toc-framehash-1" href="#framehash-1">21.9 framehash</a>
  432. <ul class="no-bullet">
  433. <li><a name="toc-Examples-177" href="#Examples-177">21.9.1 Examples</a></li>
  434. </ul></li>
  435. <li><a name="toc-framemd5-1" href="#framemd5-1">21.10 framemd5</a>
  436. <ul class="no-bullet">
  437. <li><a name="toc-Examples-25" href="#Examples-25">21.10.1 Examples</a></li>
  438. </ul></li>
  439. <li><a name="toc-gif-1" href="#gif-1">21.11 gif</a></li>
  440. <li><a name="toc-hash-1" href="#hash-1">21.12 hash</a>
  441. <ul class="no-bullet">
  442. <li><a name="toc-Examples-138" href="#Examples-138">21.12.1 Examples</a></li>
  443. </ul></li>
  444. <li><a name="toc-hls-2" href="#hls-2">21.13 hls</a>
  445. <ul class="no-bullet">
  446. <li><a name="toc-Options-40" href="#Options-40">21.13.1 Options</a></li>
  447. </ul></li>
  448. <li><a name="toc-ico-1" href="#ico-1">21.14 ico</a></li>
  449. <li><a name="toc-image2-2" href="#image2-2">21.15 image2</a>
  450. <ul class="no-bullet">
  451. <li><a name="toc-Options-43" href="#Options-43">21.15.1 Options</a></li>
  452. <li><a name="toc-Examples-5" href="#Examples-5">21.15.2 Examples</a></li>
  453. </ul></li>
  454. <li><a name="toc-matroska" href="#matroska">21.16 matroska</a>
  455. <ul class="no-bullet">
  456. <li><a name="toc-Metadata" href="#Metadata">21.16.1 Metadata</a></li>
  457. <li><a name="toc-Options-57" href="#Options-57">21.16.2 Options</a></li>
  458. </ul></li>
  459. <li><a name="toc-md5-2" href="#md5-2">21.17 md5</a>
  460. <ul class="no-bullet">
  461. <li><a name="toc-Examples-107" href="#Examples-107">21.17.1 Examples</a></li>
  462. </ul></li>
  463. <li><a name="toc-mov_002c-mp4_002c-ismv" href="#mov_002c-mp4_002c-ismv">21.18 mov, mp4, ismv</a>
  464. <ul class="no-bullet">
  465. <li><a name="toc-Options-81" href="#Options-81">21.18.1 Options</a></li>
  466. <li><a name="toc-Example-1" href="#Example-1">21.18.2 Example</a></li>
  467. </ul></li>
  468. <li><a name="toc-mp3" href="#mp3">21.19 mp3</a></li>
  469. <li><a name="toc-mpegts" href="#mpegts">21.20 mpegts</a>
  470. <ul class="no-bullet">
  471. <li><a name="toc-Options-69" href="#Options-69">21.20.1 Options</a></li>
  472. <li><a name="toc-Example-9" href="#Example-9">21.20.2 Example</a></li>
  473. </ul></li>
  474. <li><a name="toc-mxf_002c-mxf_005fd10_002c-mxf_005fopatom" href="#mxf_002c-mxf_005fd10_002c-mxf_005fopatom">21.21 mxf, mxf_d10, mxf_opatom</a>
  475. <ul class="no-bullet">
  476. <li><a name="toc-Options-73" href="#Options-73">21.21.1 Options</a></li>
  477. </ul></li>
  478. <li><a name="toc-null-1" href="#null-1">21.22 null</a></li>
  479. <li><a name="toc-nut" href="#nut">21.23 nut</a></li>
  480. <li><a name="toc-ogg" href="#ogg">21.24 ogg</a></li>
  481. <li><a name="toc-segment_002c-stream_005fsegment_002c-ssegment" href="#segment_002c-stream_005fsegment_002c-ssegment">21.25 segment, stream_segment, ssegment</a>
  482. <ul class="no-bullet">
  483. <li><a name="toc-Options-36" href="#Options-36">21.25.1 Options</a></li>
  484. <li><a name="toc-Examples-75" href="#Examples-75">21.25.2 Examples</a></li>
  485. </ul></li>
  486. <li><a name="toc-smoothstreaming" href="#smoothstreaming">21.26 smoothstreaming</a></li>
  487. <li><a name="toc-streamhash-1" href="#streamhash-1">21.27 streamhash</a>
  488. <ul class="no-bullet">
  489. <li><a name="toc-Examples-132" href="#Examples-132">21.27.1 Examples</a></li>
  490. </ul></li>
  491. <li><a name="toc-fifo-1" href="#fifo-1">21.28 fifo</a>
  492. <ul class="no-bullet">
  493. <li><a name="toc-Examples-9" href="#Examples-9">21.28.1 Examples</a></li>
  494. </ul></li>
  495. <li><a name="toc-tee-2" href="#tee-2">21.29 tee</a>
  496. <ul class="no-bullet">
  497. <li><a name="toc-Options-2" href="#Options-2">21.29.1 Options</a></li>
  498. <li><a name="toc-Examples-170" href="#Examples-170">21.29.2 Examples</a></li>
  499. </ul></li>
  500. <li><a name="toc-webm_005fdash_005fmanifest" href="#webm_005fdash_005fmanifest">21.30 webm_dash_manifest</a>
  501. <ul class="no-bullet">
  502. <li><a name="toc-Options-47" href="#Options-47">21.30.1 Options</a></li>
  503. <li><a name="toc-Example" href="#Example">21.30.2 Example</a></li>
  504. </ul></li>
  505. <li><a name="toc-webm_005fchunk" href="#webm_005fchunk">21.31 webm_chunk</a>
  506. <ul class="no-bullet">
  507. <li><a name="toc-Options-46" href="#Options-46">21.31.1 Options</a></li>
  508. <li><a name="toc-Example-5" href="#Example-5">21.31.2 Example</a></li>
  509. </ul>
  510. </li>
  511. </ul></li>
  512. <li><a name="toc-Metadata-1" href="#Metadata-1">22 Metadata</a></li>
  513. <li><a name="toc-Protocol-Options" href="#Protocol-Options">23 Protocol Options</a></li>
  514. <li><a name="toc-Protocols" href="#Protocols">24 Protocols</a>
  515. <ul class="no-bullet">
  516. <li><a name="toc-amqp" href="#amqp">24.1 amqp</a></li>
  517. <li><a name="toc-async" href="#async">24.2 async</a></li>
  518. <li><a name="toc-bluray" href="#bluray">24.3 bluray</a></li>
  519. <li><a name="toc-cache" href="#cache">24.4 cache</a></li>
  520. <li><a name="toc-concat-1" href="#concat-1">24.5 concat</a></li>
  521. <li><a name="toc-crypto" href="#crypto">24.6 crypto</a></li>
  522. <li><a name="toc-data" href="#data">24.7 data</a></li>
  523. <li><a name="toc-file" href="#file">24.8 file</a></li>
  524. <li><a name="toc-ftp" href="#ftp">24.9 ftp</a></li>
  525. <li><a name="toc-gopher" href="#gopher">24.10 gopher</a></li>
  526. <li><a name="toc-hls-3" href="#hls-3">24.11 hls</a></li>
  527. <li><a name="toc-http" href="#http">24.12 http</a>
  528. <ul class="no-bullet">
  529. <li><a name="toc-HTTP-Cookies" href="#HTTP-Cookies">24.12.1 HTTP Cookies</a></li>
  530. </ul></li>
  531. <li><a name="toc-Icecast" href="#Icecast">24.13 Icecast</a></li>
  532. <li><a name="toc-mmst" href="#mmst">24.14 mmst</a></li>
  533. <li><a name="toc-mmsh" href="#mmsh">24.15 mmsh</a></li>
  534. <li><a name="toc-md5-1" href="#md5-1">24.16 md5</a></li>
  535. <li><a name="toc-pipe" href="#pipe">24.17 pipe</a></li>
  536. <li><a name="toc-prompeg" href="#prompeg">24.18 prompeg</a></li>
  537. <li><a name="toc-rtmp" href="#rtmp">24.19 rtmp</a></li>
  538. <li><a name="toc-rtmpe" href="#rtmpe">24.20 rtmpe</a></li>
  539. <li><a name="toc-rtmps" href="#rtmps">24.21 rtmps</a></li>
  540. <li><a name="toc-rtmpt" href="#rtmpt">24.22 rtmpt</a></li>
  541. <li><a name="toc-rtmpte" href="#rtmpte">24.23 rtmpte</a></li>
  542. <li><a name="toc-rtmpts" href="#rtmpts">24.24 rtmpts</a></li>
  543. <li><a name="toc-libsmbclient" href="#libsmbclient">24.25 libsmbclient</a></li>
  544. <li><a name="toc-libssh" href="#libssh">24.26 libssh</a></li>
  545. <li><a name="toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" href="#librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">24.27 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
  546. <li><a name="toc-rtp" href="#rtp">24.28 rtp</a></li>
  547. <li><a name="toc-rtsp" href="#rtsp">24.29 rtsp</a>
  548. <ul class="no-bullet">
  549. <li><a name="toc-Examples-80" href="#Examples-80">24.29.1 Examples</a></li>
  550. </ul></li>
  551. <li><a name="toc-sap" href="#sap">24.30 sap</a>
  552. <ul class="no-bullet">
  553. <li><a name="toc-Muxer" href="#Muxer">24.30.1 Muxer</a></li>
  554. <li><a name="toc-Demuxer" href="#Demuxer">24.30.2 Demuxer</a></li>
  555. </ul></li>
  556. <li><a name="toc-sctp" href="#sctp">24.31 sctp</a></li>
  557. <li><a name="toc-srt" href="#srt">24.32 srt</a></li>
  558. <li><a name="toc-srtp" href="#srtp">24.33 srtp</a></li>
  559. <li><a name="toc-subfile" href="#subfile">24.34 subfile</a></li>
  560. <li><a name="toc-tee-1" href="#tee-1">24.35 tee</a></li>
  561. <li><a name="toc-tcp" href="#tcp">24.36 tcp</a></li>
  562. <li><a name="toc-tls" href="#tls">24.37 tls</a></li>
  563. <li><a name="toc-udp" href="#udp">24.38 udp</a>
  564. <ul class="no-bullet">
  565. <li><a name="toc-Examples-100" href="#Examples-100">24.38.1 Examples</a></li>
  566. </ul></li>
  567. <li><a name="toc-unix" href="#unix">24.39 unix</a></li>
  568. <li><a name="toc-zmq" href="#zmq">24.40 zmq</a></li>
  569. </ul></li>
  570. <li><a name="toc-Device-Options" href="#Device-Options">25 Device Options</a></li>
  571. <li><a name="toc-Input-Devices" href="#Input-Devices">26 Input Devices</a>
  572. <ul class="no-bullet">
  573. <li><a name="toc-alsa-1" href="#alsa-1">26.1 alsa</a>
  574. <ul class="no-bullet">
  575. <li><a name="toc-Options-34" href="#Options-34">26.1.1 Options</a></li>
  576. </ul></li>
  577. <li><a name="toc-android_005fcamera" href="#android_005fcamera">26.2 android_camera</a>
  578. <ul class="no-bullet">
  579. <li><a name="toc-Options-28" href="#Options-28">26.2.1 Options</a></li>
  580. </ul></li>
  581. <li><a name="toc-avfoundation" href="#avfoundation">26.3 avfoundation</a>
  582. <ul class="no-bullet">
  583. <li><a name="toc-Options-27" href="#Options-27">26.3.1 Options</a></li>
  584. <li><a name="toc-Examples-180" href="#Examples-180">26.3.2 Examples</a></li>
  585. </ul></li>
  586. <li><a name="toc-bktr" href="#bktr">26.4 bktr</a>
  587. <ul class="no-bullet">
  588. <li><a name="toc-Options-13" href="#Options-13">26.4.1 Options</a></li>
  589. </ul></li>
  590. <li><a name="toc-decklink" href="#decklink">26.5 decklink</a>
  591. <ul class="no-bullet">
  592. <li><a name="toc-Options-77" href="#Options-77">26.5.1 Options</a></li>
  593. <li><a name="toc-Examples-62" href="#Examples-62">26.5.2 Examples</a></li>
  594. </ul></li>
  595. <li><a name="toc-dshow" href="#dshow">26.6 dshow</a>
  596. <ul class="no-bullet">
  597. <li><a name="toc-Options-84" href="#Options-84">26.6.1 Options</a></li>
  598. <li><a name="toc-Examples-51" href="#Examples-51">26.6.2 Examples</a></li>
  599. </ul></li>
  600. <li><a name="toc-fbdev" href="#fbdev">26.7 fbdev</a>
  601. <ul class="no-bullet">
  602. <li><a name="toc-Options-7" href="#Options-7">26.7.1 Options</a></li>
  603. </ul></li>
  604. <li><a name="toc-gdigrab" href="#gdigrab">26.8 gdigrab</a>
  605. <ul class="no-bullet">
  606. <li><a name="toc-Options-49" href="#Options-49">26.8.1 Options</a></li>
  607. </ul></li>
  608. <li><a name="toc-iec61883" href="#iec61883">26.9 iec61883</a>
  609. <ul class="no-bullet">
  610. <li><a name="toc-Options-12" href="#Options-12">26.9.1 Options</a></li>
  611. <li><a name="toc-Examples-127" href="#Examples-127">26.9.2 Examples</a></li>
  612. </ul></li>
  613. <li><a name="toc-jack" href="#jack">26.10 jack</a>
  614. <ul class="no-bullet">
  615. <li><a name="toc-Options-6" href="#Options-6">26.10.1 Options</a></li>
  616. </ul></li>
  617. <li><a name="toc-kmsgrab" href="#kmsgrab">26.11 kmsgrab</a>
  618. <ul class="no-bullet">
  619. <li><a name="toc-Options-65" href="#Options-65">26.11.1 Options</a></li>
  620. <li><a name="toc-Examples-34" href="#Examples-34">26.11.2 Examples</a></li>
  621. </ul></li>
  622. <li><a name="toc-lavfi" href="#lavfi">26.12 lavfi</a>
  623. <ul class="no-bullet">
  624. <li><a name="toc-Options-21" href="#Options-21">26.12.1 Options</a></li>
  625. <li><a name="toc-Examples-40" href="#Examples-40">26.12.2 Examples</a></li>
  626. </ul></li>
  627. <li><a name="toc-libcdio" href="#libcdio">26.13 libcdio</a>
  628. <ul class="no-bullet">
  629. <li><a name="toc-Options-78" href="#Options-78">26.13.1 Options</a></li>
  630. </ul></li>
  631. <li><a name="toc-libdc1394" href="#libdc1394">26.14 libdc1394</a>
  632. <ul class="no-bullet">
  633. <li><a name="toc-Options-70" href="#Options-70">26.14.1 Options</a></li>
  634. </ul></li>
  635. <li><a name="toc-openal" href="#openal">26.15 openal</a>
  636. <ul class="no-bullet">
  637. <li><a name="toc-Options-52" href="#Options-52">26.15.1 Options</a></li>
  638. <li><a name="toc-Examples-157" href="#Examples-157">26.15.2 Examples</a></li>
  639. </ul></li>
  640. <li><a name="toc-oss-1" href="#oss-1">26.16 oss</a>
  641. <ul class="no-bullet">
  642. <li><a name="toc-Options-29" href="#Options-29">26.16.1 Options</a></li>
  643. </ul></li>
  644. <li><a name="toc-pulse" href="#pulse">26.17 pulse</a>
  645. <ul class="no-bullet">
  646. <li><a name="toc-Options-23" href="#Options-23">26.17.1 Options</a></li>
  647. <li><a name="toc-Examples-71" href="#Examples-71">26.17.2 Examples</a></li>
  648. </ul></li>
  649. <li><a name="toc-sndio-1" href="#sndio-1">26.18 sndio</a>
  650. <ul class="no-bullet">
  651. <li><a name="toc-Options-9" href="#Options-9">26.18.1 Options</a></li>
  652. </ul></li>
  653. <li><a name="toc-video4linux2_002c-v4l2" href="#video4linux2_002c-v4l2">26.19 video4linux2, v4l2</a>
  654. <ul class="no-bullet">
  655. <li><a name="toc-Options-59" href="#Options-59">26.19.1 Options</a></li>
  656. </ul></li>
  657. <li><a name="toc-vfwcap" href="#vfwcap">26.20 vfwcap</a>
  658. <ul class="no-bullet">
  659. <li><a name="toc-Options-16" href="#Options-16">26.20.1 Options</a></li>
  660. </ul></li>
  661. <li><a name="toc-x11grab" href="#x11grab">26.21 x11grab</a>
  662. <ul class="no-bullet">
  663. <li><a name="toc-Options-10" href="#Options-10">26.21.1 Options</a></li>
  664. </ul>
  665. </li>
  666. </ul></li>
  667. <li><a name="toc-Output-Devices" href="#Output-Devices">27 Output Devices</a>
  668. <ul class="no-bullet">
  669. <li><a name="toc-alsa" href="#alsa">27.1 alsa</a>
  670. <ul class="no-bullet">
  671. <li><a name="toc-Examples-164" href="#Examples-164">27.1.1 Examples</a></li>
  672. </ul></li>
  673. <li><a name="toc-caca" href="#caca">27.2 caca</a>
  674. <ul class="no-bullet">
  675. <li><a name="toc-Options-5" href="#Options-5">27.2.1 Options</a></li>
  676. <li><a name="toc-Examples-35" href="#Examples-35">27.2.2 Examples</a></li>
  677. </ul></li>
  678. <li><a name="toc-decklink-1" href="#decklink-1">27.3 decklink</a>
  679. <ul class="no-bullet">
  680. <li><a name="toc-Options-72" href="#Options-72">27.3.1 Options</a></li>
  681. <li><a name="toc-Examples-7" href="#Examples-7">27.3.2 Examples</a></li>
  682. </ul></li>
  683. <li><a name="toc-fbdev-1" href="#fbdev-1">27.4 fbdev</a>
  684. <ul class="no-bullet">
  685. <li><a name="toc-Options-68" href="#Options-68">27.4.1 Options</a></li>
  686. <li><a name="toc-Examples-151" href="#Examples-151">27.4.2 Examples</a></li>
  687. </ul></li>
  688. <li><a name="toc-opengl" href="#opengl">27.5 opengl</a>
  689. <ul class="no-bullet">
  690. <li><a name="toc-Options-41" href="#Options-41">27.5.1 Options</a></li>
  691. <li><a name="toc-Examples-96" href="#Examples-96">27.5.2 Examples</a></li>
  692. </ul></li>
  693. <li><a name="toc-oss" href="#oss">27.6 oss</a></li>
  694. <li><a name="toc-pulse-1" href="#pulse-1">27.7 pulse</a>
  695. <ul class="no-bullet">
  696. <li><a name="toc-Options-71" href="#Options-71">27.7.1 Options</a></li>
  697. <li><a name="toc-Examples-10" href="#Examples-10">27.7.2 Examples</a></li>
  698. </ul></li>
  699. <li><a name="toc-sdl" href="#sdl">27.8 sdl</a>
  700. <ul class="no-bullet">
  701. <li><a name="toc-Options-11" href="#Options-11">27.8.1 Options</a></li>
  702. <li><a name="toc-Interactive-commands" href="#Interactive-commands">27.8.2 Interactive commands</a></li>
  703. <li><a name="toc-Examples-64" href="#Examples-64">27.8.3 Examples</a></li>
  704. </ul></li>
  705. <li><a name="toc-sndio" href="#sndio">27.9 sndio</a></li>
  706. <li><a name="toc-v4l2" href="#v4l2">27.10 v4l2</a></li>
  707. <li><a name="toc-xv" href="#xv">27.11 xv</a>
  708. <ul class="no-bullet">
  709. <li><a name="toc-Options-33" href="#Options-33">27.11.1 Options</a></li>
  710. <li><a name="toc-Examples-11" href="#Examples-11">27.11.2 Examples</a></li>
  711. </ul>
  712. </li>
  713. </ul></li>
  714. <li><a name="toc-Resampler-Options" href="#Resampler-Options">28 Resampler Options</a></li>
  715. <li><a name="toc-Scaler-Options" href="#Scaler-Options">29 Scaler Options</a></li>
  716. <li><a name="toc-Filtering-Introduction" href="#Filtering-Introduction">30 Filtering Introduction</a></li>
  717. <li><a name="toc-graph2dot" href="#graph2dot">31 graph2dot</a></li>
  718. <li><a name="toc-Filtergraph-description" href="#Filtergraph-description">32 Filtergraph description</a>
  719. <ul class="no-bullet">
  720. <li><a name="toc-Filtergraph-syntax-1" href="#Filtergraph-syntax-1">32.1 Filtergraph syntax</a></li>
  721. <li><a name="toc-Notes-on-filtergraph-escaping" href="#Notes-on-filtergraph-escaping">32.2 Notes on filtergraph escaping</a></li>
  722. </ul></li>
  723. <li><a name="toc-Timeline-editing" href="#Timeline-editing">33 Timeline editing</a></li>
  724. <li><a name="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>
  725. <li><a name="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>
  726. <li><a name="toc-Audio-Filters" href="#Audio-Filters">36 Audio Filters</a>
  727. <ul class="no-bullet">
  728. <li><a name="toc-acompressor" href="#acompressor">36.1 acompressor</a>
  729. <ul class="no-bullet">
  730. <li><a name="toc-Commands-62" href="#Commands-62">36.1.1 Commands</a></li>
  731. </ul></li>
  732. <li><a name="toc-acontrast" href="#acontrast">36.2 acontrast</a></li>
  733. <li><a name="toc-acopy" href="#acopy">36.3 acopy</a></li>
  734. <li><a name="toc-acrossfade" href="#acrossfade">36.4 acrossfade</a>
  735. <ul class="no-bullet">
  736. <li><a name="toc-Examples-185" href="#Examples-185">36.4.1 Examples</a></li>
  737. </ul></li>
  738. <li><a name="toc-acrossover" href="#acrossover">36.5 acrossover</a></li>
  739. <li><a name="toc-acrusher" href="#acrusher">36.6 acrusher</a></li>
  740. <li><a name="toc-acue" href="#acue">36.7 acue</a></li>
  741. <li><a name="toc-adeclick" href="#adeclick">36.8 adeclick</a></li>
  742. <li><a name="toc-adeclip" href="#adeclip">36.9 adeclip</a></li>
  743. <li><a name="toc-adelay" href="#adelay">36.10 adelay</a>
  744. <ul class="no-bullet">
  745. <li><a name="toc-Examples-16" href="#Examples-16">36.10.1 Examples</a></li>
  746. </ul></li>
  747. <li><a name="toc-aderivative_002c-aintegral" href="#aderivative_002c-aintegral">36.11 aderivative, aintegral</a></li>
  748. <li><a name="toc-aecho" href="#aecho">36.12 aecho</a>
  749. <ul class="no-bullet">
  750. <li><a name="toc-Examples-160" href="#Examples-160">36.12.1 Examples</a></li>
  751. </ul></li>
  752. <li><a name="toc-aemphasis" href="#aemphasis">36.13 aemphasis</a></li>
  753. <li><a name="toc-aeval" href="#aeval">36.14 aeval</a>
  754. <ul class="no-bullet">
  755. <li><a name="toc-Examples-173" href="#Examples-173">36.14.1 Examples</a></li>
  756. </ul></li>
  757. <li><a name="toc-afade-1" href="#afade-1">36.15 afade</a>
  758. <ul class="no-bullet">
  759. <li><a name="toc-Examples-178" href="#Examples-178">36.15.1 Examples</a></li>
  760. </ul></li>
  761. <li><a name="toc-afftdn" href="#afftdn">36.16 afftdn</a>
  762. <ul class="no-bullet">
  763. <li><a name="toc-Commands-68" href="#Commands-68">36.16.1 Commands</a></li>
  764. </ul></li>
  765. <li><a name="toc-afftfilt" href="#afftfilt">36.17 afftfilt</a>
  766. <ul class="no-bullet">
  767. <li><a name="toc-Examples-46" href="#Examples-46">36.17.1 Examples</a></li>
  768. </ul></li>
  769. <li><a name="toc-afir-1" href="#afir-1">36.18 afir</a>
  770. <ul class="no-bullet">
  771. <li><a name="toc-Examples-21" href="#Examples-21">36.18.1 Examples</a></li>
  772. </ul></li>
  773. <li><a name="toc-aformat-1" href="#aformat-1">36.19 aformat</a></li>
  774. <li><a name="toc-agate" href="#agate">36.20 agate</a></li>
  775. <li><a name="toc-aiir" href="#aiir">36.21 aiir</a>
  776. <ul class="no-bullet">
  777. <li><a name="toc-Examples-22" href="#Examples-22">36.21.1 Examples</a></li>
  778. </ul></li>
  779. <li><a name="toc-alimiter" href="#alimiter">36.22 alimiter</a></li>
  780. <li><a name="toc-allpass" href="#allpass">36.23 allpass</a>
  781. <ul class="no-bullet">
  782. <li><a name="toc-Commands-1" href="#Commands-1">36.23.1 Commands</a></li>
  783. </ul></li>
  784. <li><a name="toc-aloop" href="#aloop">36.24 aloop</a></li>
  785. <li><a name="toc-amerge-1" href="#amerge-1">36.25 amerge</a>
  786. <ul class="no-bullet">
  787. <li><a name="toc-Examples-140" href="#Examples-140">36.25.1 Examples</a></li>
  788. </ul></li>
  789. <li><a name="toc-amix" href="#amix">36.26 amix</a>
  790. <ul class="no-bullet">
  791. <li><a name="toc-Commands-36" href="#Commands-36">36.26.1 Commands</a></li>
  792. </ul></li>
  793. <li><a name="toc-amultiply" href="#amultiply">36.27 amultiply</a></li>
  794. <li><a name="toc-anequalizer" href="#anequalizer">36.28 anequalizer</a>
  795. <ul class="no-bullet">
  796. <li><a name="toc-Examples-101" href="#Examples-101">36.28.1 Examples</a></li>
  797. <li><a name="toc-Commands-30" href="#Commands-30">36.28.2 Commands</a></li>
  798. </ul></li>
  799. <li><a name="toc-anlmdn" href="#anlmdn">36.29 anlmdn</a>
  800. <ul class="no-bullet">
  801. <li><a name="toc-Commands-15" href="#Commands-15">36.29.1 Commands</a></li>
  802. </ul></li>
  803. <li><a name="toc-anlms" href="#anlms">36.30 anlms</a>
  804. <ul class="no-bullet">
  805. <li><a name="toc-Examples-13" href="#Examples-13">36.30.1 Examples</a></li>
  806. <li><a name="toc-Commands-44" href="#Commands-44">36.30.2 Commands</a></li>
  807. </ul></li>
  808. <li><a name="toc-anull" href="#anull">36.31 anull</a></li>
  809. <li><a name="toc-apad" href="#apad">36.32 apad</a>
  810. <ul class="no-bullet">
  811. <li><a name="toc-Examples-14" href="#Examples-14">36.32.1 Examples</a></li>
  812. </ul></li>
  813. <li><a name="toc-aphaser" href="#aphaser">36.33 aphaser</a></li>
  814. <li><a name="toc-apulsator" href="#apulsator">36.34 apulsator</a></li>
  815. <li><a name="toc-aresample-1" href="#aresample-1">36.35 aresample</a>
  816. <ul class="no-bullet">
  817. <li><a name="toc-Examples-92" href="#Examples-92">36.35.1 Examples</a></li>
  818. </ul></li>
  819. <li><a name="toc-areverse" href="#areverse">36.36 areverse</a>
  820. <ul class="no-bullet">
  821. <li><a name="toc-Examples-148" href="#Examples-148">36.36.1 Examples</a></li>
  822. </ul></li>
  823. <li><a name="toc-arnndn" href="#arnndn">36.37 arnndn</a></li>
  824. <li><a name="toc-asetnsamples" href="#asetnsamples">36.38 asetnsamples</a></li>
  825. <li><a name="toc-asetrate" href="#asetrate">36.39 asetrate</a></li>
  826. <li><a name="toc-ashowinfo" href="#ashowinfo">36.40 ashowinfo</a></li>
  827. <li><a name="toc-asoftclip" href="#asoftclip">36.41 asoftclip</a>
  828. <ul class="no-bullet">
  829. <li><a name="toc-Commands-45" href="#Commands-45">36.41.1 Commands</a></li>
  830. </ul></li>
  831. <li><a name="toc-asr" href="#asr">36.42 asr</a></li>
  832. <li><a name="toc-astats-1" href="#astats-1">36.43 astats</a></li>
  833. <li><a name="toc-asubboost" href="#asubboost">36.44 asubboost</a>
  834. <ul class="no-bullet">
  835. <li><a name="toc-Commands-4" href="#Commands-4">36.44.1 Commands</a></li>
  836. </ul></li>
  837. <li><a name="toc-atempo" href="#atempo">36.45 atempo</a>
  838. <ul class="no-bullet">
  839. <li><a name="toc-Examples-82" href="#Examples-82">36.45.1 Examples</a></li>
  840. <li><a name="toc-Commands-14" href="#Commands-14">36.45.2 Commands</a></li>
  841. </ul></li>
  842. <li><a name="toc-atrim" href="#atrim">36.46 atrim</a></li>
  843. <li><a name="toc-axcorrelate" href="#axcorrelate">36.47 axcorrelate</a>
  844. <ul class="no-bullet">
  845. <li><a name="toc-Examples-79" href="#Examples-79">36.47.1 Examples</a></li>
  846. </ul></li>
  847. <li><a name="toc-bandpass" href="#bandpass">36.48 bandpass</a>
  848. <ul class="no-bullet">
  849. <li><a name="toc-Commands-40" href="#Commands-40">36.48.1 Commands</a></li>
  850. </ul></li>
  851. <li><a name="toc-bandreject" href="#bandreject">36.49 bandreject</a>
  852. <ul class="no-bullet">
  853. <li><a name="toc-Commands-52" href="#Commands-52">36.49.1 Commands</a></li>
  854. </ul></li>
  855. <li><a name="toc-bass_002c-lowshelf" href="#bass_002c-lowshelf">36.50 bass, lowshelf</a>
  856. <ul class="no-bullet">
  857. <li><a name="toc-Commands-58" href="#Commands-58">36.50.1 Commands</a></li>
  858. </ul></li>
  859. <li><a name="toc-biquad" href="#biquad">36.51 biquad</a>
  860. <ul class="no-bullet">
  861. <li><a name="toc-Commands-43" href="#Commands-43">36.51.1 Commands</a></li>
  862. </ul></li>
  863. <li><a name="toc-bs2b" href="#bs2b">36.52 bs2b</a></li>
  864. <li><a name="toc-channelmap" href="#channelmap">36.53 channelmap</a>
  865. <ul class="no-bullet">
  866. <li><a name="toc-Examples-169" href="#Examples-169">36.53.1 Examples</a></li>
  867. </ul></li>
  868. <li><a name="toc-channelsplit" href="#channelsplit">36.54 channelsplit</a>
  869. <ul class="no-bullet">
  870. <li><a name="toc-Examples-182" href="#Examples-182">36.54.1 Examples</a></li>
  871. </ul></li>
  872. <li><a name="toc-chorus" href="#chorus">36.55 chorus</a>
  873. <ul class="no-bullet">
  874. <li><a name="toc-Examples-189" href="#Examples-189">36.55.1 Examples</a></li>
  875. </ul></li>
  876. <li><a name="toc-compand" href="#compand">36.56 compand</a>
  877. <ul class="no-bullet">
  878. <li><a name="toc-Examples-23" href="#Examples-23">36.56.1 Examples</a></li>
  879. </ul></li>
  880. <li><a name="toc-compensationdelay" href="#compensationdelay">36.57 compensationdelay</a></li>
  881. <li><a name="toc-crossfeed" href="#crossfeed">36.58 crossfeed</a>
  882. <ul class="no-bullet">
  883. <li><a name="toc-Commands-51" href="#Commands-51">36.58.1 Commands</a></li>
  884. </ul></li>
  885. <li><a name="toc-crystalizer" href="#crystalizer">36.59 crystalizer</a>
  886. <ul class="no-bullet">
  887. <li><a name="toc-Commands-53" href="#Commands-53">36.59.1 Commands</a></li>
  888. </ul></li>
  889. <li><a name="toc-dcshift" href="#dcshift">36.60 dcshift</a></li>
  890. <li><a name="toc-deesser" href="#deesser">36.61 deesser</a></li>
  891. <li><a name="toc-drmeter" href="#drmeter">36.62 drmeter</a></li>
  892. <li><a name="toc-dynaudnorm" href="#dynaudnorm">36.63 dynaudnorm</a>
  893. <ul class="no-bullet">
  894. <li><a name="toc-Commands-67" href="#Commands-67">36.63.1 Commands</a></li>
  895. </ul></li>
  896. <li><a name="toc-earwax" href="#earwax">36.64 earwax</a></li>
  897. <li><a name="toc-equalizer" href="#equalizer">36.65 equalizer</a>
  898. <ul class="no-bullet">
  899. <li><a name="toc-Examples-152" href="#Examples-152">36.65.1 Examples</a></li>
  900. <li><a name="toc-Commands-39" href="#Commands-39">36.65.2 Commands</a></li>
  901. </ul></li>
  902. <li><a name="toc-extrastereo" href="#extrastereo">36.66 extrastereo</a>
  903. <ul class="no-bullet">
  904. <li><a name="toc-Commands-31" href="#Commands-31">36.66.1 Commands</a></li>
  905. </ul></li>
  906. <li><a name="toc-firequalizer" href="#firequalizer">36.67 firequalizer</a>
  907. <ul class="no-bullet">
  908. <li><a name="toc-Examples-115" href="#Examples-115">36.67.1 Examples</a></li>
  909. </ul></li>
  910. <li><a name="toc-flanger" href="#flanger">36.68 flanger</a></li>
  911. <li><a name="toc-haas" href="#haas">36.69 haas</a></li>
  912. <li><a name="toc-hdcd" href="#hdcd">36.70 hdcd</a></li>
  913. <li><a name="toc-headphone" href="#headphone">36.71 headphone</a>
  914. <ul class="no-bullet">
  915. <li><a name="toc-Examples-111" href="#Examples-111">36.71.1 Examples</a></li>
  916. </ul></li>
  917. <li><a name="toc-highpass" href="#highpass">36.72 highpass</a>
  918. <ul class="no-bullet">
  919. <li><a name="toc-Commands-2" href="#Commands-2">36.72.1 Commands</a></li>
  920. </ul></li>
  921. <li><a name="toc-join" href="#join">36.73 join</a></li>
  922. <li><a name="toc-ladspa" href="#ladspa">36.74 ladspa</a>
  923. <ul class="no-bullet">
  924. <li><a name="toc-Examples-161" href="#Examples-161">36.74.1 Examples</a></li>
  925. <li><a name="toc-Commands-61" href="#Commands-61">36.74.2 Commands</a></li>
  926. </ul></li>
  927. <li><a name="toc-loudnorm" href="#loudnorm">36.75 loudnorm</a></li>
  928. <li><a name="toc-lowpass" href="#lowpass">36.76 lowpass</a>
  929. <ul class="no-bullet">
  930. <li><a name="toc-Examples-15" href="#Examples-15">36.76.1 Examples</a></li>
  931. <li><a name="toc-Commands-35" href="#Commands-35">36.76.2 Commands</a></li>
  932. </ul></li>
  933. <li><a name="toc-lv2" href="#lv2">36.77 lv2</a>
  934. <ul class="no-bullet">
  935. <li><a name="toc-Examples-150" href="#Examples-150">36.77.1 Examples</a></li>
  936. </ul></li>
  937. <li><a name="toc-mcompand" href="#mcompand">36.78 mcompand</a></li>
  938. <li><a name="toc-pan-1" href="#pan-1">36.79 pan</a>
  939. <ul class="no-bullet">
  940. <li><a name="toc-Mixing-examples" href="#Mixing-examples">36.79.1 Mixing examples</a></li>
  941. <li><a name="toc-Remapping-examples" href="#Remapping-examples">36.79.2 Remapping examples</a></li>
  942. </ul></li>
  943. <li><a name="toc-replaygain" href="#replaygain">36.80 replaygain</a></li>
  944. <li><a name="toc-resample" href="#resample">36.81 resample</a></li>
  945. <li><a name="toc-rubberband" href="#rubberband">36.82 rubberband</a>
  946. <ul class="no-bullet">
  947. <li><a name="toc-Commands-63" href="#Commands-63">36.82.1 Commands</a></li>
  948. </ul></li>
  949. <li><a name="toc-sidechaincompress" href="#sidechaincompress">36.83 sidechaincompress</a>
  950. <ul class="no-bullet">
  951. <li><a name="toc-Commands-3" href="#Commands-3">36.83.1 Commands</a></li>
  952. <li><a name="toc-Examples-12" href="#Examples-12">36.83.2 Examples</a></li>
  953. </ul></li>
  954. <li><a name="toc-sidechaingate" href="#sidechaingate">36.84 sidechaingate</a></li>
  955. <li><a name="toc-silencedetect" href="#silencedetect">36.85 silencedetect</a>
  956. <ul class="no-bullet">
  957. <li><a name="toc-Examples-156" href="#Examples-156">36.85.1 Examples</a></li>
  958. </ul></li>
  959. <li><a name="toc-silenceremove" href="#silenceremove">36.86 silenceremove</a>
  960. <ul class="no-bullet">
  961. <li><a name="toc-Examples-146" href="#Examples-146">36.86.1 Examples</a></li>
  962. </ul></li>
  963. <li><a name="toc-sofalizer" href="#sofalizer">36.87 sofalizer</a>
  964. <ul class="no-bullet">
  965. <li><a name="toc-Examples-126" href="#Examples-126">36.87.1 Examples</a></li>
  966. </ul></li>
  967. <li><a name="toc-stereotools" href="#stereotools">36.88 stereotools</a>
  968. <ul class="no-bullet">
  969. <li><a name="toc-Examples-114" href="#Examples-114">36.88.1 Examples</a></li>
  970. </ul></li>
  971. <li><a name="toc-stereowiden" href="#stereowiden">36.89 stereowiden</a>
  972. <ul class="no-bullet">
  973. <li><a name="toc-Commands-19" href="#Commands-19">36.89.1 Commands</a></li>
  974. </ul></li>
  975. <li><a name="toc-superequalizer" href="#superequalizer">36.90 superequalizer</a></li>
  976. <li><a name="toc-surround" href="#surround">36.91 surround</a></li>
  977. <li><a name="toc-treble_002c-highshelf" href="#treble_002c-highshelf">36.92 treble, highshelf</a>
  978. <ul class="no-bullet">
  979. <li><a name="toc-Commands-12" href="#Commands-12">36.92.1 Commands</a></li>
  980. </ul></li>
  981. <li><a name="toc-tremolo" href="#tremolo">36.93 tremolo</a></li>
  982. <li><a name="toc-vibrato" href="#vibrato">36.94 vibrato</a></li>
  983. <li><a name="toc-volume" href="#volume">36.95 volume</a>
  984. <ul class="no-bullet">
  985. <li><a name="toc-Commands-10" href="#Commands-10">36.95.1 Commands</a></li>
  986. <li><a name="toc-Examples-70" href="#Examples-70">36.95.2 Examples</a></li>
  987. </ul></li>
  988. <li><a name="toc-volumedetect" href="#volumedetect">36.96 volumedetect</a>
  989. <ul class="no-bullet">
  990. <li><a name="toc-Examples-99" href="#Examples-99">36.96.1 Examples</a></li>
  991. </ul>
  992. </li>
  993. </ul></li>
  994. <li><a name="toc-Audio-Sources" href="#Audio-Sources">37 Audio Sources</a>
  995. <ul class="no-bullet">
  996. <li><a name="toc-abuffer" href="#abuffer">37.1 abuffer</a>
  997. <ul class="no-bullet">
  998. <li><a name="toc-Examples-113" href="#Examples-113">37.1.1 Examples</a></li>
  999. </ul></li>
  1000. <li><a name="toc-aevalsrc" href="#aevalsrc">37.2 aevalsrc</a>
  1001. <ul class="no-bullet">
  1002. <li><a name="toc-Examples-77" href="#Examples-77">37.2.1 Examples</a></li>
  1003. </ul></li>
  1004. <li><a name="toc-afirsrc" href="#afirsrc">37.3 afirsrc</a></li>
  1005. <li><a name="toc-anullsrc" href="#anullsrc">37.4 anullsrc</a>
  1006. <ul class="no-bullet">
  1007. <li><a name="toc-Examples-90" href="#Examples-90">37.4.1 Examples</a></li>
  1008. </ul></li>
  1009. <li><a name="toc-flite" href="#flite">37.5 flite</a>
  1010. <ul class="no-bullet">
  1011. <li><a name="toc-Examples-187" href="#Examples-187">37.5.1 Examples</a></li>
  1012. </ul></li>
  1013. <li><a name="toc-anoisesrc" href="#anoisesrc">37.6 anoisesrc</a>
  1014. <ul class="no-bullet">
  1015. <li><a name="toc-Examples-73" href="#Examples-73">37.6.1 Examples</a></li>
  1016. </ul></li>
  1017. <li><a name="toc-hilbert" href="#hilbert">37.7 hilbert</a></li>
  1018. <li><a name="toc-sinc" href="#sinc">37.8 sinc</a></li>
  1019. <li><a name="toc-sine" href="#sine">37.9 sine</a>
  1020. <ul class="no-bullet">
  1021. <li><a name="toc-Examples-65" href="#Examples-65">37.9.1 Examples</a></li>
  1022. </ul>
  1023. </li>
  1024. </ul></li>
  1025. <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">38 Audio Sinks</a>
  1026. <ul class="no-bullet">
  1027. <li><a name="toc-abuffersink" href="#abuffersink">38.1 abuffersink</a></li>
  1028. <li><a name="toc-anullsink" href="#anullsink">38.2 anullsink</a></li>
  1029. </ul></li>
  1030. <li><a name="toc-Video-Filters" href="#Video-Filters">39 Video Filters</a>
  1031. <ul class="no-bullet">
  1032. <li><a name="toc-addroi" href="#addroi">39.1 addroi</a>
  1033. <ul class="no-bullet">
  1034. <li><a name="toc-Examples-142" href="#Examples-142">39.1.1 Examples</a></li>
  1035. </ul></li>
  1036. <li><a name="toc-alphaextract" href="#alphaextract">39.2 alphaextract</a></li>
  1037. <li><a name="toc-alphamerge" href="#alphamerge">39.3 alphamerge</a></li>
  1038. <li><a name="toc-amplify" href="#amplify">39.4 amplify</a>
  1039. <ul class="no-bullet">
  1040. <li><a name="toc-Commands-9" href="#Commands-9">39.4.1 Commands</a></li>
  1041. </ul></li>
  1042. <li><a name="toc-ass" href="#ass">39.5 ass</a></li>
  1043. <li><a name="toc-atadenoise" href="#atadenoise">39.6 atadenoise</a>
  1044. <ul class="no-bullet">
  1045. <li><a name="toc-Commands-38" href="#Commands-38">39.6.1 Commands</a></li>
  1046. </ul></li>
  1047. <li><a name="toc-avgblur" href="#avgblur">39.7 avgblur</a>
  1048. <ul class="no-bullet">
  1049. <li><a name="toc-Commands-50" href="#Commands-50">39.7.1 Commands</a></li>
  1050. </ul></li>
  1051. <li><a name="toc-bbox" href="#bbox">39.8 bbox</a></li>
  1052. <li><a name="toc-bilateral" href="#bilateral">39.9 bilateral</a></li>
  1053. <li><a name="toc-bitplanenoise" href="#bitplanenoise">39.10 bitplanenoise</a></li>
  1054. <li><a name="toc-blackdetect" href="#blackdetect">39.11 blackdetect</a></li>
  1055. <li><a name="toc-blackframe" href="#blackframe">39.12 blackframe</a></li>
  1056. <li><a name="toc-blend-1" href="#blend-1">39.13 blend</a>
  1057. <ul class="no-bullet">
  1058. <li><a name="toc-Examples-2" href="#Examples-2">39.13.1 Examples</a></li>
  1059. </ul></li>
  1060. <li><a name="toc-bm3d" href="#bm3d">39.14 bm3d</a>
  1061. <ul class="no-bullet">
  1062. <li><a name="toc-Examples-135" href="#Examples-135">39.14.1 Examples</a></li>
  1063. </ul></li>
  1064. <li><a name="toc-boxblur" href="#boxblur">39.15 boxblur</a>
  1065. <ul class="no-bullet">
  1066. <li><a name="toc-Examples-59" href="#Examples-59">39.15.1 Examples</a></li>
  1067. </ul></li>
  1068. <li><a name="toc-bwdif" href="#bwdif">39.16 bwdif</a></li>
  1069. <li><a name="toc-cas" href="#cas">39.17 cas</a></li>
  1070. <li><a name="toc-chromahold" href="#chromahold">39.18 chromahold</a>
  1071. <ul class="no-bullet">
  1072. <li><a name="toc-Commands-54" href="#Commands-54">39.18.1 Commands</a></li>
  1073. </ul></li>
  1074. <li><a name="toc-chromakey" href="#chromakey">39.19 chromakey</a>
  1075. <ul class="no-bullet">
  1076. <li><a name="toc-Commands-66" href="#Commands-66">39.19.1 Commands</a></li>
  1077. <li><a name="toc-Examples-68" href="#Examples-68">39.19.2 Examples</a></li>
  1078. </ul></li>
  1079. <li><a name="toc-chromashift" href="#chromashift">39.20 chromashift</a>
  1080. <ul class="no-bullet">
  1081. <li><a name="toc-Commands-60" href="#Commands-60">39.20.1 Commands</a></li>
  1082. </ul></li>
  1083. <li><a name="toc-ciescope" href="#ciescope">39.21 ciescope</a></li>
  1084. <li><a name="toc-codecview" href="#codecview">39.22 codecview</a>
  1085. <ul class="no-bullet">
  1086. <li><a name="toc-Examples-50" href="#Examples-50">39.22.1 Examples</a></li>
  1087. </ul></li>
  1088. <li><a name="toc-colorbalance" href="#colorbalance">39.23 colorbalance</a>
  1089. <ul class="no-bullet">
  1090. <li><a name="toc-Examples-28" href="#Examples-28">39.23.1 Examples</a></li>
  1091. <li><a name="toc-Commands-55" href="#Commands-55">39.23.2 Commands</a></li>
  1092. </ul></li>
  1093. <li><a name="toc-colorchannelmixer" href="#colorchannelmixer">39.24 colorchannelmixer</a>
  1094. <ul class="no-bullet">
  1095. <li><a name="toc-Examples-121" href="#Examples-121">39.24.1 Examples</a></li>
  1096. <li><a name="toc-Commands-25" href="#Commands-25">39.24.2 Commands</a></li>
  1097. </ul></li>
  1098. <li><a name="toc-colorkey" href="#colorkey">39.25 colorkey</a>
  1099. <ul class="no-bullet">
  1100. <li><a name="toc-Examples-143" href="#Examples-143">39.25.1 Examples</a></li>
  1101. <li><a name="toc-Commands-27" href="#Commands-27">39.25.2 Commands</a></li>
  1102. </ul></li>
  1103. <li><a name="toc-colorhold" href="#colorhold">39.26 colorhold</a>
  1104. <ul class="no-bullet">
  1105. <li><a name="toc-Commands-13" href="#Commands-13">39.26.1 Commands</a></li>
  1106. </ul></li>
  1107. <li><a name="toc-colorlevels" href="#colorlevels">39.27 colorlevels</a>
  1108. <ul class="no-bullet">
  1109. <li><a name="toc-Examples-61" href="#Examples-61">39.27.1 Examples</a></li>
  1110. <li><a name="toc-Commands-6" href="#Commands-6">39.27.2 Commands</a></li>
  1111. </ul></li>
  1112. <li><a name="toc-colormatrix" href="#colormatrix">39.28 colormatrix</a></li>
  1113. <li><a name="toc-colorspace" href="#colorspace">39.29 colorspace</a></li>
  1114. <li><a name="toc-convolution" href="#convolution">39.30 convolution</a>
  1115. <ul class="no-bullet">
  1116. <li><a name="toc-Examples-137" href="#Examples-137">39.30.1 Examples</a></li>
  1117. </ul></li>
  1118. <li><a name="toc-convolve" href="#convolve">39.31 convolve</a></li>
  1119. <li><a name="toc-copy" href="#copy">39.32 copy</a></li>
  1120. <li><a name="toc-coreimage-1" href="#coreimage-1">39.33 coreimage</a>
  1121. <ul class="no-bullet">
  1122. <li><a name="toc-Examples-60" href="#Examples-60">39.33.1 Examples</a></li>
  1123. </ul></li>
  1124. <li><a name="toc-cover_005frect" href="#cover_005frect">39.34 cover_rect</a>
  1125. <ul class="no-bullet">
  1126. <li><a name="toc-Examples-97" href="#Examples-97">39.34.1 Examples</a></li>
  1127. </ul></li>
  1128. <li><a name="toc-crop" href="#crop">39.35 crop</a>
  1129. <ul class="no-bullet">
  1130. <li><a name="toc-Examples-84" href="#Examples-84">39.35.1 Examples</a></li>
  1131. <li><a name="toc-Commands-32" href="#Commands-32">39.35.2 Commands</a></li>
  1132. </ul></li>
  1133. <li><a name="toc-cropdetect" href="#cropdetect">39.36 cropdetect</a></li>
  1134. <li><a name="toc-cue-1" href="#cue-1">39.37 cue</a></li>
  1135. <li><a name="toc-curves-1" href="#curves-1">39.38 curves</a>
  1136. <ul class="no-bullet">
  1137. <li><a name="toc-Examples-163" href="#Examples-163">39.38.1 Examples</a></li>
  1138. </ul></li>
  1139. <li><a name="toc-datascope" href="#datascope">39.39 datascope</a></li>
  1140. <li><a name="toc-dblur" href="#dblur">39.40 dblur</a>
  1141. <ul class="no-bullet">
  1142. <li><a name="toc-Commands-34" href="#Commands-34">39.40.1 Commands</a></li>
  1143. </ul></li>
  1144. <li><a name="toc-dctdnoiz" href="#dctdnoiz">39.41 dctdnoiz</a>
  1145. <ul class="no-bullet">
  1146. <li><a name="toc-Examples-183" href="#Examples-183">39.41.1 Examples</a></li>
  1147. </ul></li>
  1148. <li><a name="toc-deband" href="#deband">39.42 deband</a></li>
  1149. <li><a name="toc-deblock" href="#deblock">39.43 deblock</a>
  1150. <ul class="no-bullet">
  1151. <li><a name="toc-Examples-42" href="#Examples-42">39.43.1 Examples</a></li>
  1152. </ul></li>
  1153. <li><a name="toc-decimate-1" href="#decimate-1">39.44 decimate</a></li>
  1154. <li><a name="toc-deconvolve" href="#deconvolve">39.45 deconvolve</a></li>
  1155. <li><a name="toc-dedot" href="#dedot">39.46 dedot</a></li>
  1156. <li><a name="toc-deflate" href="#deflate">39.47 deflate</a>
  1157. <ul class="no-bullet">
  1158. <li><a name="toc-Commands-69" href="#Commands-69">39.47.1 Commands</a></li>
  1159. </ul></li>
  1160. <li><a name="toc-deflicker" href="#deflicker">39.48 deflicker</a></li>
  1161. <li><a name="toc-dejudder" href="#dejudder">39.49 dejudder</a></li>
  1162. <li><a name="toc-delogo" href="#delogo">39.50 delogo</a>
  1163. <ul class="no-bullet">
  1164. <li><a name="toc-Examples-69" href="#Examples-69">39.50.1 Examples</a></li>
  1165. </ul></li>
  1166. <li><a name="toc-derain-1" href="#derain-1">39.51 derain</a></li>
  1167. <li><a name="toc-deshake" href="#deshake">39.52 deshake</a></li>
  1168. <li><a name="toc-despill" href="#despill">39.53 despill</a></li>
  1169. <li><a name="toc-detelecine" href="#detelecine">39.54 detelecine</a></li>
  1170. <li><a name="toc-dilation" href="#dilation">39.55 dilation</a>
  1171. <ul class="no-bullet">
  1172. <li><a name="toc-Commands-18" href="#Commands-18">39.55.1 Commands</a></li>
  1173. </ul></li>
  1174. <li><a name="toc-displace" href="#displace">39.56 displace</a>
  1175. <ul class="no-bullet">
  1176. <li><a name="toc-Examples-43" href="#Examples-43">39.56.1 Examples</a></li>
  1177. </ul></li>
  1178. <li><a name="toc-dnn_005fprocessing-1" href="#dnn_005fprocessing-1">39.57 dnn_processing</a>
  1179. <ul class="no-bullet">
  1180. <li><a name="toc-Examples-112" href="#Examples-112">39.57.1 Examples</a></li>
  1181. </ul></li>
  1182. <li><a name="toc-drawbox" href="#drawbox">39.58 drawbox</a>
  1183. <ul class="no-bullet">
  1184. <li><a name="toc-Examples-153" href="#Examples-153">39.58.1 Examples</a></li>
  1185. <li><a name="toc-Commands-33" href="#Commands-33">39.58.2 Commands</a></li>
  1186. </ul></li>
  1187. <li><a name="toc-drawgraph-1" href="#drawgraph-1">39.59 drawgraph</a></li>
  1188. <li><a name="toc-drawgrid" href="#drawgrid">39.60 drawgrid</a>
  1189. <ul class="no-bullet">
  1190. <li><a name="toc-Examples-128" href="#Examples-128">39.60.1 Examples</a></li>
  1191. <li><a name="toc-Commands-20" href="#Commands-20">39.60.2 Commands</a></li>
  1192. </ul></li>
  1193. <li><a name="toc-drawtext-1" href="#drawtext-1">39.61 drawtext</a>
  1194. <ul class="no-bullet">
  1195. <li><a name="toc-Syntax" href="#Syntax">39.61.1 Syntax</a></li>
  1196. <li><a name="toc-Text-expansion" href="#Text-expansion">39.61.2 Text expansion</a></li>
  1197. <li><a name="toc-Commands-57" href="#Commands-57">39.61.3 Commands</a></li>
  1198. <li><a name="toc-Examples-88" href="#Examples-88">39.61.4 Examples</a></li>
  1199. </ul></li>
  1200. <li><a name="toc-edgedetect" href="#edgedetect">39.62 edgedetect</a>
  1201. <ul class="no-bullet">
  1202. <li><a name="toc-Examples-89" href="#Examples-89">39.62.1 Examples</a></li>
  1203. </ul></li>
  1204. <li><a name="toc-elbg" href="#elbg">39.63 elbg</a></li>
  1205. <li><a name="toc-entropy" href="#entropy">39.64 entropy</a></li>
  1206. <li><a name="toc-eq" href="#eq">39.65 eq</a>
  1207. <ul class="no-bullet">
  1208. <li><a name="toc-Commands-65" href="#Commands-65">39.65.1 Commands</a></li>
  1209. </ul></li>
  1210. <li><a name="toc-erosion" href="#erosion">39.66 erosion</a>
  1211. <ul class="no-bullet">
  1212. <li><a name="toc-Commands-56" href="#Commands-56">39.66.1 Commands</a></li>
  1213. </ul></li>
  1214. <li><a name="toc-extractplanes" href="#extractplanes">39.67 extractplanes</a>
  1215. <ul class="no-bullet">
  1216. <li><a name="toc-Examples-110" href="#Examples-110">39.67.1 Examples</a></li>
  1217. </ul></li>
  1218. <li><a name="toc-fade" href="#fade">39.68 fade</a>
  1219. <ul class="no-bullet">
  1220. <li><a name="toc-Examples-144" href="#Examples-144">39.68.1 Examples</a></li>
  1221. </ul></li>
  1222. <li><a name="toc-fftdnoiz" href="#fftdnoiz">39.69 fftdnoiz</a></li>
  1223. <li><a name="toc-fftfilt" href="#fftfilt">39.70 fftfilt</a>
  1224. <ul class="no-bullet">
  1225. <li><a name="toc-Examples-103" href="#Examples-103">39.70.1 Examples</a></li>
  1226. </ul></li>
  1227. <li><a name="toc-field" href="#field">39.71 field</a></li>
  1228. <li><a name="toc-fieldhint" href="#fieldhint">39.72 fieldhint</a></li>
  1229. <li><a name="toc-fieldmatch" href="#fieldmatch">39.73 fieldmatch</a>
  1230. <ul class="no-bullet">
  1231. <li><a name="toc-p_002fc_002fn_002fu_002fb-meaning-1" href="#p_002fc_002fn_002fu_002fb-meaning-1">39.73.1 p/c/n/u/b meaning</a>
  1232. <ul class="no-bullet">
  1233. <li><a name="toc-p_002fc_002fn" href="#p_002fc_002fn">39.73.1.1 p/c/n</a></li>
  1234. <li><a name="toc-u_002fb" href="#u_002fb">39.73.1.2 u/b</a></li>
  1235. </ul></li>
  1236. <li><a name="toc-Examples-20" href="#Examples-20">39.73.2 Examples</a></li>
  1237. </ul></li>
  1238. <li><a name="toc-fieldorder" href="#fieldorder">39.74 fieldorder</a></li>
  1239. <li><a name="toc-fifo_002c-afifo" href="#fifo_002c-afifo">39.75 fifo, afifo</a></li>
  1240. <li><a name="toc-fillborders" href="#fillborders">39.76 fillborders</a>
  1241. <ul class="no-bullet">
  1242. <li><a name="toc-Commands-7" href="#Commands-7">39.76.1 Commands</a></li>
  1243. </ul></li>
  1244. <li><a name="toc-find_005frect" href="#find_005frect">39.77 find_rect</a>
  1245. <ul class="no-bullet">
  1246. <li><a name="toc-Examples-158" href="#Examples-158">39.77.1 Examples</a></li>
  1247. </ul></li>
  1248. <li><a name="toc-floodfill" href="#floodfill">39.78 floodfill</a></li>
  1249. <li><a name="toc-format-1" href="#format-1">39.79 format</a>
  1250. <ul class="no-bullet">
  1251. <li><a name="toc-Examples-48" href="#Examples-48">39.79.1 Examples</a></li>
  1252. </ul></li>
  1253. <li><a name="toc-fps-1" href="#fps-1">39.80 fps</a>
  1254. <ul class="no-bullet">
  1255. <li><a name="toc-Examples-145" href="#Examples-145">39.80.1 Examples</a></li>
  1256. </ul></li>
  1257. <li><a name="toc-framepack" href="#framepack">39.81 framepack</a></li>
  1258. <li><a name="toc-framerate" href="#framerate">39.82 framerate</a></li>
  1259. <li><a name="toc-framestep" href="#framestep">39.83 framestep</a></li>
  1260. <li><a name="toc-freezedetect" href="#freezedetect">39.84 freezedetect</a></li>
  1261. <li><a name="toc-freezeframes" href="#freezeframes">39.85 freezeframes</a></li>
  1262. <li><a name="toc-frei0r-1" href="#frei0r-1">39.86 frei0r</a>
  1263. <ul class="no-bullet">
  1264. <li><a name="toc-Examples-33" href="#Examples-33">39.86.1 Examples</a></li>
  1265. </ul></li>
  1266. <li><a name="toc-fspp" href="#fspp">39.87 fspp</a></li>
  1267. <li><a name="toc-gblur" href="#gblur">39.88 gblur</a>
  1268. <ul class="no-bullet">
  1269. <li><a name="toc-Commands-24" href="#Commands-24">39.88.1 Commands</a></li>
  1270. </ul></li>
  1271. <li><a name="toc-geq" href="#geq">39.89 geq</a>
  1272. <ul class="no-bullet">
  1273. <li><a name="toc-Examples-6" href="#Examples-6">39.89.1 Examples</a></li>
  1274. </ul></li>
  1275. <li><a name="toc-gradfun" href="#gradfun">39.90 gradfun</a>
  1276. <ul class="no-bullet">
  1277. <li><a name="toc-Examples" href="#Examples">39.90.1 Examples</a></li>
  1278. </ul></li>
  1279. <li><a name="toc-graphmonitor-1" href="#graphmonitor-1">39.91 graphmonitor</a></li>
  1280. <li><a name="toc-greyedge" href="#greyedge">39.92 greyedge</a>
  1281. <ul class="no-bullet">
  1282. <li><a name="toc-Examples-147" href="#Examples-147">39.92.1 Examples</a></li>
  1283. </ul></li>
  1284. <li><a name="toc-haldclut-1" href="#haldclut-1">39.93 haldclut</a>
  1285. <ul class="no-bullet">
  1286. <li><a name="toc-Workflow-examples" href="#Workflow-examples">39.93.1 Workflow examples</a>
  1287. <ul class="no-bullet">
  1288. <li><a name="toc-Hald-CLUT-video-stream" href="#Hald-CLUT-video-stream">39.93.1.1 Hald CLUT video stream</a></li>
  1289. <li><a name="toc-Hald-CLUT-with-preview" href="#Hald-CLUT-with-preview">39.93.1.2 Hald CLUT with preview</a></li>
  1290. </ul>
  1291. </li>
  1292. </ul></li>
  1293. <li><a name="toc-hflip" href="#hflip">39.94 hflip</a></li>
  1294. <li><a name="toc-histeq" href="#histeq">39.95 histeq</a></li>
  1295. <li><a name="toc-histogram-1" href="#histogram-1">39.96 histogram</a>
  1296. <ul class="no-bullet">
  1297. <li><a name="toc-Examples-78" href="#Examples-78">39.96.1 Examples</a></li>
  1298. </ul></li>
  1299. <li><a name="toc-hqdn3d-1" href="#hqdn3d-1">39.97 hqdn3d</a>
  1300. <ul class="no-bullet">
  1301. <li><a name="toc-Commands-59" href="#Commands-59">39.97.1 Commands</a></li>
  1302. </ul></li>
  1303. <li><a name="toc-hwdownload-1" href="#hwdownload-1">39.98 hwdownload</a></li>
  1304. <li><a name="toc-hwmap" href="#hwmap">39.99 hwmap</a></li>
  1305. <li><a name="toc-hwupload-1" href="#hwupload-1">39.100 hwupload</a></li>
  1306. <li><a name="toc-hwupload_005fcuda-1" href="#hwupload_005fcuda-1">39.101 hwupload_cuda</a></li>
  1307. <li><a name="toc-hqx" href="#hqx">39.102 hqx</a></li>
  1308. <li><a name="toc-hstack" href="#hstack">39.103 hstack</a></li>
  1309. <li><a name="toc-hue" href="#hue">39.104 hue</a>
  1310. <ul class="no-bullet">
  1311. <li><a name="toc-Examples-104" href="#Examples-104">39.104.1 Examples</a></li>
  1312. <li><a name="toc-Commands-28" href="#Commands-28">39.104.2 Commands</a></li>
  1313. </ul></li>
  1314. <li><a name="toc-hysteresis" href="#hysteresis">39.105 hysteresis</a></li>
  1315. <li><a name="toc-idet" href="#idet">39.106 idet</a></li>
  1316. <li><a name="toc-il" href="#il">39.107 il</a>
  1317. <ul class="no-bullet">
  1318. <li><a name="toc-Commands-49" href="#Commands-49">39.107.1 Commands</a></li>
  1319. </ul></li>
  1320. <li><a name="toc-inflate" href="#inflate">39.108 inflate</a>
  1321. <ul class="no-bullet">
  1322. <li><a name="toc-Commands-17" href="#Commands-17">39.108.1 Commands</a></li>
  1323. </ul></li>
  1324. <li><a name="toc-interlace" href="#interlace">39.109 interlace</a></li>
  1325. <li><a name="toc-kerndeint" href="#kerndeint">39.110 kerndeint</a>
  1326. <ul class="no-bullet">
  1327. <li><a name="toc-Examples-130" href="#Examples-130">39.110.1 Examples</a></li>
  1328. </ul></li>
  1329. <li><a name="toc-lagfun" href="#lagfun">39.111 lagfun</a></li>
  1330. <li><a name="toc-lenscorrection" href="#lenscorrection">39.112 lenscorrection</a>
  1331. <ul class="no-bullet">
  1332. <li><a name="toc-Options-79" href="#Options-79">39.112.1 Options</a></li>
  1333. </ul></li>
  1334. <li><a name="toc-lensfun" href="#lensfun">39.113 lensfun</a>
  1335. <ul class="no-bullet">
  1336. <li><a name="toc-Examples-93" href="#Examples-93">39.113.1 Examples</a></li>
  1337. </ul></li>
  1338. <li><a name="toc-libvmaf" href="#libvmaf">39.114 libvmaf</a>
  1339. <ul class="no-bullet">
  1340. <li><a name="toc-Examples-39" href="#Examples-39">39.114.1 Examples</a></li>
  1341. </ul></li>
  1342. <li><a name="toc-limiter" href="#limiter">39.115 limiter</a></li>
  1343. <li><a name="toc-loop" href="#loop">39.116 loop</a>
  1344. <ul class="no-bullet">
  1345. <li><a name="toc-Examples-172" href="#Examples-172">39.116.1 Examples</a></li>
  1346. </ul></li>
  1347. <li><a name="toc-lut1d" href="#lut1d">39.117 lut1d</a></li>
  1348. <li><a name="toc-lut3d-1" href="#lut3d-1">39.118 lut3d</a></li>
  1349. <li><a name="toc-lumakey" href="#lumakey">39.119 lumakey</a>
  1350. <ul class="no-bullet">
  1351. <li><a name="toc-Commands-64" href="#Commands-64">39.119.1 Commands</a></li>
  1352. </ul></li>
  1353. <li><a name="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">39.120 lut, lutrgb, lutyuv</a>
  1354. <ul class="no-bullet">
  1355. <li><a name="toc-Examples-102" href="#Examples-102">39.120.1 Examples</a></li>
  1356. </ul></li>
  1357. <li><a name="toc-lut2_002c-tlut2" href="#lut2_002c-tlut2">39.121 lut2, tlut2</a>
  1358. <ul class="no-bullet">
  1359. <li><a name="toc-Examples-58" href="#Examples-58">39.121.1 Examples</a></li>
  1360. </ul></li>
  1361. <li><a name="toc-maskedclamp" href="#maskedclamp">39.122 maskedclamp</a></li>
  1362. <li><a name="toc-maskedmax" href="#maskedmax">39.123 maskedmax</a></li>
  1363. <li><a name="toc-maskedmerge" href="#maskedmerge">39.124 maskedmerge</a></li>
  1364. <li><a name="toc-maskedmin" href="#maskedmin">39.125 maskedmin</a></li>
  1365. <li><a name="toc-maskedthreshold" href="#maskedthreshold">39.126 maskedthreshold</a></li>
  1366. <li><a name="toc-maskfun" href="#maskfun">39.127 maskfun</a></li>
  1367. <li><a name="toc-mcdeint" href="#mcdeint">39.128 mcdeint</a></li>
  1368. <li><a name="toc-median" href="#median">39.129 median</a>
  1369. <ul class="no-bullet">
  1370. <li><a name="toc-Commands-5" href="#Commands-5">39.129.1 Commands</a></li>
  1371. </ul></li>
  1372. <li><a name="toc-mergeplanes" href="#mergeplanes">39.130 mergeplanes</a>
  1373. <ul class="no-bullet">
  1374. <li><a name="toc-Examples-155" href="#Examples-155">39.130.1 Examples</a></li>
  1375. </ul></li>
  1376. <li><a name="toc-mestimate" href="#mestimate">39.131 mestimate</a></li>
  1377. <li><a name="toc-midequalizer" href="#midequalizer">39.132 midequalizer</a></li>
  1378. <li><a name="toc-minterpolate" href="#minterpolate">39.133 minterpolate</a></li>
  1379. <li><a name="toc-mix" href="#mix">39.134 mix</a></li>
  1380. <li><a name="toc-mpdecimate" href="#mpdecimate">39.135 mpdecimate</a></li>
  1381. <li><a name="toc-negate" href="#negate">39.136 negate</a></li>
  1382. <li><a name="toc-nlmeans-1" href="#nlmeans-1">39.137 nlmeans</a></li>
  1383. <li><a name="toc-nnedi" href="#nnedi">39.138 nnedi</a></li>
  1384. <li><a name="toc-noformat" href="#noformat">39.139 noformat</a>
  1385. <ul class="no-bullet">
  1386. <li><a name="toc-Examples-54" href="#Examples-54">39.139.1 Examples</a></li>
  1387. </ul></li>
  1388. <li><a name="toc-noise" href="#noise">39.140 noise</a>
  1389. <ul class="no-bullet">
  1390. <li><a name="toc-Examples-47" href="#Examples-47">39.140.1 Examples</a></li>
  1391. </ul></li>
  1392. <li><a name="toc-normalize" href="#normalize">39.141 normalize</a>
  1393. <ul class="no-bullet">
  1394. <li><a name="toc-Commands-41" href="#Commands-41">39.141.1 Commands</a></li>
  1395. <li><a name="toc-Examples-32" href="#Examples-32">39.141.2 Examples</a></li>
  1396. </ul></li>
  1397. <li><a name="toc-null" href="#null">39.142 null</a></li>
  1398. <li><a name="toc-ocr" href="#ocr">39.143 ocr</a></li>
  1399. <li><a name="toc-ocv" href="#ocv">39.144 ocv</a>
  1400. <ul class="no-bullet">
  1401. <li><a name="toc-dilate-1" href="#dilate-1">39.144.1 dilate</a></li>
  1402. <li><a name="toc-erode" href="#erode">39.144.2 erode</a></li>
  1403. <li><a name="toc-smooth" href="#smooth">39.144.3 smooth</a></li>
  1404. </ul></li>
  1405. <li><a name="toc-oscilloscope" href="#oscilloscope">39.145 oscilloscope</a>
  1406. <ul class="no-bullet">
  1407. <li><a name="toc-Commands-70" href="#Commands-70">39.145.1 Commands</a></li>
  1408. <li><a name="toc-Examples-91" href="#Examples-91">39.145.2 Examples</a></li>
  1409. </ul></li>
  1410. <li><a name="toc-overlay-1" href="#overlay-1">39.146 overlay</a>
  1411. <ul class="no-bullet">
  1412. <li><a name="toc-Commands-21" href="#Commands-21">39.146.1 Commands</a></li>
  1413. <li><a name="toc-Examples-53" href="#Examples-53">39.146.2 Examples</a></li>
  1414. </ul></li>
  1415. <li><a name="toc-overlay_005fcuda-1" href="#overlay_005fcuda-1">39.147 overlay_cuda</a></li>
  1416. <li><a name="toc-owdenoise" href="#owdenoise">39.148 owdenoise</a></li>
  1417. <li><a name="toc-pad-1" href="#pad-1">39.149 pad</a>
  1418. <ul class="no-bullet">
  1419. <li><a name="toc-Examples-109" href="#Examples-109">39.149.1 Examples</a></li>
  1420. </ul></li>
  1421. <li><a name="toc-palettegen-1" href="#palettegen-1">39.150 palettegen</a>
  1422. <ul class="no-bullet">
  1423. <li><a name="toc-Examples-74" href="#Examples-74">39.150.1 Examples</a></li>
  1424. </ul></li>
  1425. <li><a name="toc-paletteuse" href="#paletteuse">39.151 paletteuse</a>
  1426. <ul class="no-bullet">
  1427. <li><a name="toc-Examples-87" href="#Examples-87">39.151.1 Examples</a></li>
  1428. </ul></li>
  1429. <li><a name="toc-perspective" href="#perspective">39.152 perspective</a></li>
  1430. <li><a name="toc-phase" href="#phase">39.153 phase</a></li>
  1431. <li><a name="toc-photosensitivity" href="#photosensitivity">39.154 photosensitivity</a></li>
  1432. <li><a name="toc-pixdesctest" href="#pixdesctest">39.155 pixdesctest</a></li>
  1433. <li><a name="toc-pixscope" href="#pixscope">39.156 pixscope</a></li>
  1434. <li><a name="toc-pp" href="#pp">39.157 pp</a>
  1435. <ul class="no-bullet">
  1436. <li><a name="toc-Examples-98" href="#Examples-98">39.157.1 Examples</a></li>
  1437. </ul></li>
  1438. <li><a name="toc-pp7" href="#pp7">39.158 pp7</a></li>
  1439. <li><a name="toc-premultiply" href="#premultiply">39.159 premultiply</a></li>
  1440. <li><a name="toc-prewitt" href="#prewitt">39.160 prewitt</a></li>
  1441. <li><a name="toc-pseudocolor" href="#pseudocolor">39.161 pseudocolor</a>
  1442. <ul class="no-bullet">
  1443. <li><a name="toc-Examples-37" href="#Examples-37">39.161.1 Examples</a></li>
  1444. </ul></li>
  1445. <li><a name="toc-psnr" href="#psnr">39.162 psnr</a>
  1446. <ul class="no-bullet">
  1447. <li><a name="toc-Examples-139" href="#Examples-139">39.162.1 Examples</a></li>
  1448. </ul></li>
  1449. <li><a name="toc-pullup-1" href="#pullup-1">39.163 pullup</a></li>
  1450. <li><a name="toc-qp" href="#qp">39.164 qp</a>
  1451. <ul class="no-bullet">
  1452. <li><a name="toc-Examples-45" href="#Examples-45">39.164.1 Examples</a></li>
  1453. </ul></li>
  1454. <li><a name="toc-random" href="#random">39.165 random</a></li>
  1455. <li><a name="toc-readeia608" href="#readeia608">39.166 readeia608</a>
  1456. <ul class="no-bullet">
  1457. <li><a name="toc-Examples-133" href="#Examples-133">39.166.1 Examples</a></li>
  1458. </ul></li>
  1459. <li><a name="toc-readvitc" href="#readvitc">39.167 readvitc</a>
  1460. <ul class="no-bullet">
  1461. <li><a name="toc-Examples-44" href="#Examples-44">39.167.1 Examples</a></li>
  1462. </ul></li>
  1463. <li><a name="toc-remap" href="#remap">39.168 remap</a></li>
  1464. <li><a name="toc-removegrain" href="#removegrain">39.169 removegrain</a></li>
  1465. <li><a name="toc-removelogo" href="#removelogo">39.170 removelogo</a></li>
  1466. <li><a name="toc-repeatfields" href="#repeatfields">39.171 repeatfields</a></li>
  1467. <li><a name="toc-reverse" href="#reverse">39.172 reverse</a>
  1468. <ul class="no-bullet">
  1469. <li><a name="toc-Examples-168" href="#Examples-168">39.172.1 Examples</a></li>
  1470. </ul></li>
  1471. <li><a name="toc-rgbashift" href="#rgbashift">39.173 rgbashift</a>
  1472. <ul class="no-bullet">
  1473. <li><a name="toc-Commands-11" href="#Commands-11">39.173.1 Commands</a></li>
  1474. </ul></li>
  1475. <li><a name="toc-roberts" href="#roberts">39.174 roberts</a></li>
  1476. <li><a name="toc-rotate" href="#rotate">39.175 rotate</a>
  1477. <ul class="no-bullet">
  1478. <li><a name="toc-Examples-24" href="#Examples-24">39.175.1 Examples</a></li>
  1479. <li><a name="toc-Commands-8" href="#Commands-8">39.175.2 Commands</a></li>
  1480. </ul></li>
  1481. <li><a name="toc-sab" href="#sab">39.176 sab</a></li>
  1482. <li><a name="toc-scale-1" href="#scale-1">39.177 scale</a>
  1483. <ul class="no-bullet">
  1484. <li><a name="toc-Options-42" href="#Options-42">39.177.1 Options</a></li>
  1485. <li><a name="toc-Examples-176" href="#Examples-176">39.177.2 Examples</a></li>
  1486. <li><a name="toc-Commands-29" href="#Commands-29">39.177.3 Commands</a></li>
  1487. </ul></li>
  1488. <li><a name="toc-scale_005fnpp" href="#scale_005fnpp">39.178 scale_npp</a></li>
  1489. <li><a name="toc-scale2ref" href="#scale2ref">39.179 scale2ref</a>
  1490. <ul class="no-bullet">
  1491. <li><a name="toc-Examples-120" href="#Examples-120">39.179.1 Examples</a></li>
  1492. <li><a name="toc-Commands-16" href="#Commands-16">39.179.2 Commands</a></li>
  1493. </ul></li>
  1494. <li><a name="toc-scroll" href="#scroll">39.180 scroll</a>
  1495. <ul class="no-bullet">
  1496. <li><a name="toc-Commands-47" href="#Commands-47">39.180.1 Commands</a></li>
  1497. </ul></li>
  1498. <li><a name="toc-scdet-1" href="#scdet-1">39.181 scdet</a></li>
  1499. <li><a name="toc-selectivecolor-1" href="#selectivecolor-1">39.182 selectivecolor</a>
  1500. <ul class="no-bullet">
  1501. <li><a name="toc-Examples-119" href="#Examples-119">39.182.1 Examples</a></li>
  1502. </ul></li>
  1503. <li><a name="toc-separatefields-1" href="#separatefields-1">39.183 separatefields</a></li>
  1504. <li><a name="toc-setdar_002c-setsar" href="#setdar_002c-setsar">39.184 setdar, setsar</a>
  1505. <ul class="no-bullet">
  1506. <li><a name="toc-Examples-162" href="#Examples-162">39.184.1 Examples</a></li>
  1507. </ul></li>
  1508. <li><a name="toc-setfield-1" href="#setfield-1">39.185 setfield</a></li>
  1509. <li><a name="toc-setparams-1" href="#setparams-1">39.186 setparams</a></li>
  1510. <li><a name="toc-showinfo" href="#showinfo">39.187 showinfo</a></li>
  1511. <li><a name="toc-showpalette" href="#showpalette">39.188 showpalette</a></li>
  1512. <li><a name="toc-shuffleframes" href="#shuffleframes">39.189 shuffleframes</a>
  1513. <ul class="no-bullet">
  1514. <li><a name="toc-Examples-175" href="#Examples-175">39.189.1 Examples</a></li>
  1515. </ul></li>
  1516. <li><a name="toc-shuffleplanes" href="#shuffleplanes">39.190 shuffleplanes</a>
  1517. <ul class="no-bullet">
  1518. <li><a name="toc-Examples-49" href="#Examples-49">39.190.1 Examples</a></li>
  1519. </ul></li>
  1520. <li><a name="toc-signalstats-1" href="#signalstats-1">39.191 signalstats</a>
  1521. <ul class="no-bullet">
  1522. <li><a name="toc-Examples-17" href="#Examples-17">39.191.1 Examples</a></li>
  1523. </ul></li>
  1524. <li><a name="toc-signature-1" href="#signature-1">39.192 signature</a>
  1525. <ul class="no-bullet">
  1526. <li><a name="toc-Examples-118" href="#Examples-118">39.192.1 Examples</a></li>
  1527. </ul></li>
  1528. <li><a name="toc-smartblur-1" href="#smartblur-1">39.193 smartblur</a></li>
  1529. <li><a name="toc-sobel" href="#sobel">39.194 sobel</a></li>
  1530. <li><a name="toc-spp-1" href="#spp-1">39.195 spp</a>
  1531. <ul class="no-bullet">
  1532. <li><a name="toc-Commands-48" href="#Commands-48">39.195.1 Commands</a></li>
  1533. </ul></li>
  1534. <li><a name="toc-sr-1" href="#sr-1">39.196 sr</a></li>
  1535. <li><a name="toc-ssim" href="#ssim">39.197 ssim</a>
  1536. <ul class="no-bullet">
  1537. <li><a name="toc-Examples-165" href="#Examples-165">39.197.1 Examples</a></li>
  1538. </ul></li>
  1539. <li><a name="toc-stereo3d" href="#stereo3d">39.198 stereo3d</a>
  1540. <ul class="no-bullet">
  1541. <li><a name="toc-Examples-174" href="#Examples-174">39.198.1 Examples</a></li>
  1542. </ul></li>
  1543. <li><a name="toc-streamselect_002c-astreamselect" href="#streamselect_002c-astreamselect">39.199 streamselect, astreamselect</a>
  1544. <ul class="no-bullet">
  1545. <li><a name="toc-Commands" href="#Commands">39.199.1 Commands</a></li>
  1546. <li><a name="toc-Examples-106" href="#Examples-106">39.199.2 Examples</a></li>
  1547. </ul></li>
  1548. <li><a name="toc-subtitles-1" href="#subtitles-1">39.200 subtitles</a></li>
  1549. <li><a name="toc-super2xsai" href="#super2xsai">39.201 super2xsai</a></li>
  1550. <li><a name="toc-swaprect" href="#swaprect">39.202 swaprect</a></li>
  1551. <li><a name="toc-swapuv" href="#swapuv">39.203 swapuv</a></li>
  1552. <li><a name="toc-tblend" href="#tblend">39.204 tblend</a></li>
  1553. <li><a name="toc-telecine" href="#telecine">39.205 telecine</a></li>
  1554. <li><a name="toc-thistogram" href="#thistogram">39.206 thistogram</a></li>
  1555. <li><a name="toc-threshold" href="#threshold">39.207 threshold</a>
  1556. <ul class="no-bullet">
  1557. <li><a name="toc-Examples-171" href="#Examples-171">39.207.1 Examples</a></li>
  1558. </ul></li>
  1559. <li><a name="toc-thumbnail" href="#thumbnail">39.208 thumbnail</a>
  1560. <ul class="no-bullet">
  1561. <li><a name="toc-Examples-154" href="#Examples-154">39.208.1 Examples</a></li>
  1562. </ul></li>
  1563. <li><a name="toc-tile-1" href="#tile-1">39.209 tile</a>
  1564. <ul class="no-bullet">
  1565. <li><a name="toc-Examples-27" href="#Examples-27">39.209.1 Examples</a></li>
  1566. </ul></li>
  1567. <li><a name="toc-tinterlace" href="#tinterlace">39.210 tinterlace</a></li>
  1568. <li><a name="toc-tmedian" href="#tmedian">39.211 tmedian</a></li>
  1569. <li><a name="toc-tmix" href="#tmix">39.212 tmix</a>
  1570. <ul class="no-bullet">
  1571. <li><a name="toc-Examples-94" href="#Examples-94">39.212.1 Examples</a></li>
  1572. </ul></li>
  1573. <li><a name="toc-tonemap-1" href="#tonemap-1">39.213 tonemap</a>
  1574. <ul class="no-bullet">
  1575. <li><a name="toc-Options-54" href="#Options-54">39.213.1 Options</a></li>
  1576. </ul></li>
  1577. <li><a name="toc-tpad" href="#tpad">39.214 tpad</a></li>
  1578. <li><a name="toc-transpose-1" href="#transpose-1">39.215 transpose</a></li>
  1579. <li><a name="toc-transpose_005fnpp" href="#transpose_005fnpp">39.216 transpose_npp</a></li>
  1580. <li><a name="toc-trim" href="#trim">39.217 trim</a></li>
  1581. <li><a name="toc-unpremultiply" href="#unpremultiply">39.218 unpremultiply</a></li>
  1582. <li><a name="toc-unsharp-1" href="#unsharp-1">39.219 unsharp</a>
  1583. <ul class="no-bullet">
  1584. <li><a name="toc-Examples-38" href="#Examples-38">39.219.1 Examples</a></li>
  1585. </ul></li>
  1586. <li><a name="toc-untile-1" href="#untile-1">39.220 untile</a>
  1587. <ul class="no-bullet">
  1588. <li><a name="toc-Examples-72" href="#Examples-72">39.220.1 Examples</a></li>
  1589. </ul></li>
  1590. <li><a name="toc-uspp" href="#uspp">39.221 uspp</a></li>
  1591. <li><a name="toc-v360" href="#v360">39.222 v360</a>
  1592. <ul class="no-bullet">
  1593. <li><a name="toc-Examples-159" href="#Examples-159">39.222.1 Examples</a></li>
  1594. <li><a name="toc-Commands-71" href="#Commands-71">39.222.2 Commands</a></li>
  1595. </ul></li>
  1596. <li><a name="toc-vaguedenoiser" href="#vaguedenoiser">39.223 vaguedenoiser</a></li>
  1597. <li><a name="toc-vectorscope" href="#vectorscope">39.224 vectorscope</a></li>
  1598. <li><a name="toc-vidstabdetect-1" href="#vidstabdetect-1">39.225 vidstabdetect</a>
  1599. <ul class="no-bullet">
  1600. <li><a name="toc-Examples-131" href="#Examples-131">39.225.1 Examples</a></li>
  1601. </ul></li>
  1602. <li><a name="toc-vidstabtransform-1" href="#vidstabtransform-1">39.226 vidstabtransform</a>
  1603. <ul class="no-bullet">
  1604. <li><a name="toc-Options-76" href="#Options-76">39.226.1 Options</a></li>
  1605. <li><a name="toc-Examples-18" href="#Examples-18">39.226.2 Examples</a></li>
  1606. </ul></li>
  1607. <li><a name="toc-vflip" href="#vflip">39.227 vflip</a></li>
  1608. <li><a name="toc-vfrdet" href="#vfrdet">39.228 vfrdet</a></li>
  1609. <li><a name="toc-vibrance" href="#vibrance">39.229 vibrance</a>
  1610. <ul class="no-bullet">
  1611. <li><a name="toc-Commands-26" href="#Commands-26">39.229.1 Commands</a></li>
  1612. </ul></li>
  1613. <li><a name="toc-vignette-1" href="#vignette-1">39.230 vignette</a>
  1614. <ul class="no-bullet">
  1615. <li><a name="toc-Expressions" href="#Expressions">39.230.1 Expressions</a></li>
  1616. <li><a name="toc-Examples-30" href="#Examples-30">39.230.2 Examples</a></li>
  1617. </ul></li>
  1618. <li><a name="toc-vmafmotion" href="#vmafmotion">39.231 vmafmotion</a></li>
  1619. <li><a name="toc-vstack" href="#vstack">39.232 vstack</a></li>
  1620. <li><a name="toc-w3fdif" href="#w3fdif">39.233 w3fdif</a></li>
  1621. <li><a name="toc-waveform" href="#waveform">39.234 waveform</a></li>
  1622. <li><a name="toc-weave_002c-doubleweave" href="#weave_002c-doubleweave">39.235 weave, doubleweave</a>
  1623. <ul class="no-bullet">
  1624. <li><a name="toc-Examples-19" href="#Examples-19">39.235.1 Examples</a></li>
  1625. </ul></li>
  1626. <li><a name="toc-xbr" href="#xbr">39.236 xbr</a></li>
  1627. <li><a name="toc-xfade" href="#xfade">39.237 xfade</a>
  1628. <ul class="no-bullet">
  1629. <li><a name="toc-Examples-41" href="#Examples-41">39.237.1 Examples</a></li>
  1630. </ul></li>
  1631. <li><a name="toc-xmedian" href="#xmedian">39.238 xmedian</a></li>
  1632. <li><a name="toc-xstack" href="#xstack">39.239 xstack</a>
  1633. <ul class="no-bullet">
  1634. <li><a name="toc-Examples-81" href="#Examples-81">39.239.1 Examples</a></li>
  1635. </ul></li>
  1636. <li><a name="toc-yadif-1" href="#yadif-1">39.240 yadif</a></li>
  1637. <li><a name="toc-yadif_005fcuda" href="#yadif_005fcuda">39.241 yadif_cuda</a></li>
  1638. <li><a name="toc-yaepblur" href="#yaepblur">39.242 yaepblur</a>
  1639. <ul class="no-bullet">
  1640. <li><a name="toc-Commands-46" href="#Commands-46">39.242.1 Commands</a></li>
  1641. </ul></li>
  1642. <li><a name="toc-zoompan" href="#zoompan">39.243 zoompan</a>
  1643. <ul class="no-bullet">
  1644. <li><a name="toc-Examples-1" href="#Examples-1">39.243.1 Examples</a></li>
  1645. </ul></li>
  1646. <li><a name="toc-zscale-1" href="#zscale-1">39.244 zscale</a>
  1647. <ul class="no-bullet">
  1648. <li><a name="toc-Options-83" href="#Options-83">39.244.1 Options</a></li>
  1649. <li><a name="toc-Commands-37" href="#Commands-37">39.244.2 Commands</a></li>
  1650. </ul>
  1651. </li>
  1652. </ul></li>
  1653. <li><a name="toc-OpenCL-Video-Filters" href="#OpenCL-Video-Filters">40 OpenCL Video Filters</a>
  1654. <ul class="no-bullet">
  1655. <li><a name="toc-avgblur_005fopencl" href="#avgblur_005fopencl">40.1 avgblur_opencl</a>
  1656. <ul class="no-bullet">
  1657. <li><a name="toc-Example-4" href="#Example-4">40.1.1 Example</a></li>
  1658. </ul></li>
  1659. <li><a name="toc-boxblur_005fopencl" href="#boxblur_005fopencl">40.2 boxblur_opencl</a>
  1660. <ul class="no-bullet">
  1661. <li><a name="toc-Examples-4" href="#Examples-4">40.2.1 Examples</a></li>
  1662. </ul></li>
  1663. <li><a name="toc-colorkey_005fopencl" href="#colorkey_005fopencl">40.3 colorkey_opencl</a>
  1664. <ul class="no-bullet">
  1665. <li><a name="toc-Examples-95" href="#Examples-95">40.3.1 Examples</a></li>
  1666. </ul></li>
  1667. <li><a name="toc-convolution_005fopencl" href="#convolution_005fopencl">40.4 convolution_opencl</a>
  1668. <ul class="no-bullet">
  1669. <li><a name="toc-Examples-116" href="#Examples-116">40.4.1 Examples</a></li>
  1670. </ul></li>
  1671. <li><a name="toc-erosion_005fopencl" href="#erosion_005fopencl">40.5 erosion_opencl</a>
  1672. <ul class="no-bullet">
  1673. <li><a name="toc-Example-7" href="#Example-7">40.5.1 Example</a></li>
  1674. </ul></li>
  1675. <li><a name="toc-deshake_005fopencl" href="#deshake_005fopencl">40.6 deshake_opencl</a>
  1676. <ul class="no-bullet">
  1677. <li><a name="toc-Examples-83" href="#Examples-83">40.6.1 Examples</a></li>
  1678. </ul></li>
  1679. <li><a name="toc-dilation_005fopencl" href="#dilation_005fopencl">40.7 dilation_opencl</a>
  1680. <ul class="no-bullet">
  1681. <li><a name="toc-Example-10" href="#Example-10">40.7.1 Example</a></li>
  1682. </ul></li>
  1683. <li><a name="toc-nlmeans_005fopencl" href="#nlmeans_005fopencl">40.8 nlmeans_opencl</a></li>
  1684. <li><a name="toc-overlay_005fopencl" href="#overlay_005fopencl">40.9 overlay_opencl</a>
  1685. <ul class="no-bullet">
  1686. <li><a name="toc-Examples-166" href="#Examples-166">40.9.1 Examples</a></li>
  1687. </ul></li>
  1688. <li><a name="toc-pad_005fopencl" href="#pad_005fopencl">40.10 pad_opencl</a></li>
  1689. <li><a name="toc-prewitt_005fopencl" href="#prewitt_005fopencl">40.11 prewitt_opencl</a>
  1690. <ul class="no-bullet">
  1691. <li><a name="toc-Example-6" href="#Example-6">40.11.1 Example</a></li>
  1692. </ul></li>
  1693. <li><a name="toc-program_005fopencl-1" href="#program_005fopencl-1">40.12 program_opencl</a></li>
  1694. <li><a name="toc-roberts_005fopencl" href="#roberts_005fopencl">40.13 roberts_opencl</a>
  1695. <ul class="no-bullet">
  1696. <li><a name="toc-Example-11" href="#Example-11">40.13.1 Example</a></li>
  1697. </ul></li>
  1698. <li><a name="toc-sobel_005fopencl" href="#sobel_005fopencl">40.14 sobel_opencl</a>
  1699. <ul class="no-bullet">
  1700. <li><a name="toc-Example-2" href="#Example-2">40.14.1 Example</a></li>
  1701. </ul></li>
  1702. <li><a name="toc-tonemap_005fopencl" href="#tonemap_005fopencl">40.15 tonemap_opencl</a>
  1703. <ul class="no-bullet">
  1704. <li><a name="toc-Example-8" href="#Example-8">40.15.1 Example</a></li>
  1705. </ul></li>
  1706. <li><a name="toc-unsharp_005fopencl" href="#unsharp_005fopencl">40.16 unsharp_opencl</a>
  1707. <ul class="no-bullet">
  1708. <li><a name="toc-Examples-52" href="#Examples-52">40.16.1 Examples</a></li>
  1709. </ul></li>
  1710. <li><a name="toc-xfade_005fopencl" href="#xfade_005fopencl">40.17 xfade_opencl</a></li>
  1711. </ul></li>
  1712. <li><a name="toc-VAAPI-Video-Filters" href="#VAAPI-Video-Filters">41 VAAPI Video Filters</a>
  1713. <ul class="no-bullet">
  1714. <li><a name="toc-tonemap_005fvaapi" href="#tonemap_005fvaapi">41.1 tonemap_vaapi</a>
  1715. <ul class="no-bullet">
  1716. <li><a name="toc-Example-3" href="#Example-3">41.1.1 Example</a></li>
  1717. </ul>
  1718. </li>
  1719. </ul></li>
  1720. <li><a name="toc-Video-Sources" href="#Video-Sources">42 Video Sources</a>
  1721. <ul class="no-bullet">
  1722. <li><a name="toc-buffer" href="#buffer">42.1 buffer</a></li>
  1723. <li><a name="toc-cellauto" href="#cellauto">42.2 cellauto</a>
  1724. <ul class="no-bullet">
  1725. <li><a name="toc-Examples-122" href="#Examples-122">42.2.1 Examples</a></li>
  1726. </ul></li>
  1727. <li><a name="toc-coreimagesrc-1" href="#coreimagesrc-1">42.3 coreimagesrc</a>
  1728. <ul class="no-bullet">
  1729. <li><a name="toc-Examples-167" href="#Examples-167">42.3.1 Examples</a></li>
  1730. </ul></li>
  1731. <li><a name="toc-gradients" href="#gradients">42.4 gradients</a></li>
  1732. <li><a name="toc-mandelbrot" href="#mandelbrot">42.5 mandelbrot</a></li>
  1733. <li><a name="toc-mptestsrc" href="#mptestsrc">42.6 mptestsrc</a></li>
  1734. <li><a name="toc-frei0r_005fsrc" href="#frei0r_005fsrc">42.7 frei0r_src</a></li>
  1735. <li><a name="toc-life" href="#life">42.8 life</a>
  1736. <ul class="no-bullet">
  1737. <li><a name="toc-Examples-31" href="#Examples-31">42.8.1 Examples</a></li>
  1738. </ul></li>
  1739. <li><a name="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>
  1740. <ul class="no-bullet">
  1741. <li><a name="toc-Examples-63" href="#Examples-63">42.9.1 Examples</a></li>
  1742. <li><a name="toc-Commands-22" href="#Commands-22">42.9.2 Commands</a></li>
  1743. </ul></li>
  1744. <li><a name="toc-openclsrc" href="#openclsrc">42.10 openclsrc</a></li>
  1745. <li><a name="toc-sierpinski" href="#sierpinski">42.11 sierpinski</a></li>
  1746. </ul></li>
  1747. <li><a name="toc-Video-Sinks" href="#Video-Sinks">43 Video Sinks</a>
  1748. <ul class="no-bullet">
  1749. <li><a name="toc-buffersink" href="#buffersink">43.1 buffersink</a></li>
  1750. <li><a name="toc-nullsink" href="#nullsink">43.2 nullsink</a></li>
  1751. </ul></li>
  1752. <li><a name="toc-Multimedia-Filters" href="#Multimedia-Filters">44 Multimedia Filters</a>
  1753. <ul class="no-bullet">
  1754. <li><a name="toc-abitscope" href="#abitscope">44.1 abitscope</a></li>
  1755. <li><a name="toc-adrawgraph" href="#adrawgraph">44.2 adrawgraph</a></li>
  1756. <li><a name="toc-agraphmonitor" href="#agraphmonitor">44.3 agraphmonitor</a></li>
  1757. <li><a name="toc-ahistogram" href="#ahistogram">44.4 ahistogram</a></li>
  1758. <li><a name="toc-aphasemeter" href="#aphasemeter">44.5 aphasemeter</a></li>
  1759. <li><a name="toc-avectorscope" href="#avectorscope">44.6 avectorscope</a>
  1760. <ul class="no-bullet">
  1761. <li><a name="toc-Examples-8" href="#Examples-8">44.6.1 Examples</a></li>
  1762. </ul></li>
  1763. <li><a name="toc-bench_002c-abench" href="#bench_002c-abench">44.7 bench, abench</a>
  1764. <ul class="no-bullet">
  1765. <li><a name="toc-Examples-141" href="#Examples-141">44.7.1 Examples</a></li>
  1766. </ul></li>
  1767. <li><a name="toc-concat-2" href="#concat-2">44.8 concat</a>
  1768. <ul class="no-bullet">
  1769. <li><a name="toc-Examples-66" href="#Examples-66">44.8.1 Examples</a></li>
  1770. <li><a name="toc-Commands-23" href="#Commands-23">44.8.2 Commands</a></li>
  1771. </ul></li>
  1772. <li><a name="toc-ebur128-1" href="#ebur128-1">44.9 ebur128</a>
  1773. <ul class="no-bullet">
  1774. <li><a name="toc-Examples-134" href="#Examples-134">44.9.1 Examples</a></li>
  1775. </ul></li>
  1776. <li><a name="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">44.10 interleave, ainterleave</a>
  1777. <ul class="no-bullet">
  1778. <li><a name="toc-Examples-125" href="#Examples-125">44.10.1 Examples</a></li>
  1779. </ul></li>
  1780. <li><a name="toc-metadata_002c-ametadata" href="#metadata_002c-ametadata">44.11 metadata, ametadata</a>
  1781. <ul class="no-bullet">
  1782. <li><a name="toc-Examples-186" href="#Examples-186">44.11.1 Examples</a></li>
  1783. </ul></li>
  1784. <li><a name="toc-perms_002c-aperms" href="#perms_002c-aperms">44.12 perms, aperms</a></li>
  1785. <li><a name="toc-realtime_002c-arealtime" href="#realtime_002c-arealtime">44.13 realtime, arealtime</a></li>
  1786. <li><a name="toc-select_002c-aselect" href="#select_002c-aselect">44.14 select, aselect</a>
  1787. <ul class="no-bullet">
  1788. <li><a name="toc-Examples-86" href="#Examples-86">44.14.1 Examples</a></li>
  1789. </ul></li>
  1790. <li><a name="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">44.15 sendcmd, asendcmd</a>
  1791. <ul class="no-bullet">
  1792. <li><a name="toc-Commands-syntax" href="#Commands-syntax">44.15.1 Commands syntax</a></li>
  1793. <li><a name="toc-Examples-26" href="#Examples-26">44.15.2 Examples</a></li>
  1794. </ul></li>
  1795. <li><a name="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">44.16 setpts, asetpts</a>
  1796. <ul class="no-bullet">
  1797. <li><a name="toc-Examples-188" href="#Examples-188">44.16.1 Examples</a></li>
  1798. </ul></li>
  1799. <li><a name="toc-setrange" href="#setrange">44.17 setrange</a></li>
  1800. <li><a name="toc-settb_002c-asettb" href="#settb_002c-asettb">44.18 settb, asettb</a>
  1801. <ul class="no-bullet">
  1802. <li><a name="toc-Examples-108" href="#Examples-108">44.18.1 Examples</a></li>
  1803. </ul></li>
  1804. <li><a name="toc-showcqt" href="#showcqt">44.19 showcqt</a>
  1805. <ul class="no-bullet">
  1806. <li><a name="toc-Examples-29" href="#Examples-29">44.19.1 Examples</a></li>
  1807. </ul></li>
  1808. <li><a name="toc-showfreqs" href="#showfreqs">44.20 showfreqs</a></li>
  1809. <li><a name="toc-showspatial" href="#showspatial">44.21 showspatial</a></li>
  1810. <li><a name="toc-showspectrum-1" href="#showspectrum-1">44.22 showspectrum</a>
  1811. <ul class="no-bullet">
  1812. <li><a name="toc-Examples-179" href="#Examples-179">44.22.1 Examples</a></li>
  1813. </ul></li>
  1814. <li><a name="toc-showspectrumpic" href="#showspectrumpic">44.23 showspectrumpic</a>
  1815. <ul class="no-bullet">
  1816. <li><a name="toc-Examples-36" href="#Examples-36">44.23.1 Examples</a></li>
  1817. </ul></li>
  1818. <li><a name="toc-showvolume" href="#showvolume">44.24 showvolume</a></li>
  1819. <li><a name="toc-showwaves" href="#showwaves">44.25 showwaves</a>
  1820. <ul class="no-bullet">
  1821. <li><a name="toc-Examples-124" href="#Examples-124">44.25.1 Examples</a></li>
  1822. </ul></li>
  1823. <li><a name="toc-showwavespic" href="#showwavespic">44.26 showwavespic</a>
  1824. <ul class="no-bullet">
  1825. <li><a name="toc-Examples-123" href="#Examples-123">44.26.1 Examples</a></li>
  1826. </ul></li>
  1827. <li><a name="toc-sidedata_002c-asidedata" href="#sidedata_002c-asidedata">44.27 sidedata, asidedata</a></li>
  1828. <li><a name="toc-spectrumsynth" href="#spectrumsynth">44.28 spectrumsynth</a>
  1829. <ul class="no-bullet">
  1830. <li><a name="toc-Examples-56" href="#Examples-56">44.28.1 Examples</a></li>
  1831. </ul></li>
  1832. <li><a name="toc-split_002c-asplit" href="#split_002c-asplit">44.29 split, asplit</a>
  1833. <ul class="no-bullet">
  1834. <li><a name="toc-Examples-117" href="#Examples-117">44.29.1 Examples</a></li>
  1835. </ul></li>
  1836. <li><a name="toc-zmq_002c-azmq" href="#zmq_002c-azmq">44.30 zmq, azmq</a>
  1837. <ul class="no-bullet">
  1838. <li><a name="toc-Examples-67" href="#Examples-67">44.30.1 Examples</a></li>
  1839. </ul>
  1840. </li>
  1841. </ul></li>
  1842. <li><a name="toc-Multimedia-Sources" href="#Multimedia-Sources">45 Multimedia Sources</a>
  1843. <ul class="no-bullet">
  1844. <li><a name="toc-amovie" href="#amovie">45.1 amovie</a></li>
  1845. <li><a name="toc-movie-1" href="#movie-1">45.2 movie</a>
  1846. <ul class="no-bullet">
  1847. <li><a name="toc-Examples-129" href="#Examples-129">45.2.1 Examples</a></li>
  1848. <li><a name="toc-Commands-42" href="#Commands-42">45.2.2 Commands</a></li>
  1849. </ul>
  1850. </li>
  1851. </ul></li>
  1852. <li><a name="toc-See-Also" href="#See-Also">46 See Also</a></li>
  1853. <li><a name="toc-Authors" href="#Authors">47 Authors</a></li>
  1854. </ul>
  1855. </div>
  1856. <hr size="6">
  1857. <a name="Synopsis"></a>
  1858. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Synopsis">1 Synopsis</a></h1>
  1859. <p>ffmpeg [<var>global_options</var>] {[<var>input_file_options</var>] -i &lsquo;<tt>input_url</tt>&rsquo;} ... {[<var>output_file_options</var>] &lsquo;<tt>output_url</tt>&rsquo;} ...
  1860. </p>
  1861. <a name="Description"></a>
  1862. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Description">2 Description</a></h1>
  1863. <p><code>ffmpeg</code> is a very fast video and audio converter that can also grab from
  1864. a live audio/video source. It can also convert between arbitrary sample
  1865. rates and resize video on the fly with a high quality polyphase filter.
  1866. </p>
  1867. <p><code>ffmpeg</code> reads from an arbitrary number of input &quot;files&quot; (which can be regular
  1868. files, pipes, network streams, grabbing devices, etc.), specified by the
  1869. <code>-i</code> option, and writes to an arbitrary number of output &quot;files&quot;, which are
  1870. specified by a plain output url. Anything found on the command line which
  1871. cannot be interpreted as an option is considered to be an output url.
  1872. </p>
  1873. <p>Each input or output url can, in principle, contain any number of streams of
  1874. different types (video/audio/subtitle/attachment/data). The allowed number and/or
  1875. types of streams may be limited by the container format. Selecting which
  1876. streams from which inputs will go into which output is either done automatically
  1877. or with the <code>-map</code> option (see the Stream selection chapter).
  1878. </p>
  1879. <p>To refer to input files in options, you must use their indices (0-based). E.g.
  1880. the first input file is <code>0</code>, the second is <code>1</code>, etc. Similarly, streams
  1881. within a file are referred to by their indices. E.g. <code>2:3</code> refers to the
  1882. fourth stream in the third input file. Also see the Stream specifiers chapter.
  1883. </p>
  1884. <p>As a general rule, options are applied to the next specified
  1885. file. Therefore, order is important, and you can have the same
  1886. option on the command line multiple times. Each occurrence is
  1887. then applied to the next input or output file.
  1888. Exceptions from this rule are the global options (e.g. verbosity level),
  1889. which should be specified first.
  1890. </p>
  1891. <p>Do not mix input and output files &ndash; first specify all input files, then all
  1892. output files. Also do not mix options which belong to different files. All
  1893. options apply ONLY to the next input or output file and are reset between files.
  1894. </p>
  1895. <ul>
  1896. <li>
  1897. To set the video bitrate of the output file to 64 kbit/s:
  1898. <div class="example">
  1899. <pre class="example">ffmpeg -i input.avi -b:v 64k -bufsize 64k output.avi
  1900. </pre></div>
  1901. </li><li>
  1902. To force the frame rate of the output file to 24 fps:
  1903. <div class="example">
  1904. <pre class="example">ffmpeg -i input.avi -r 24 output.avi
  1905. </pre></div>
  1906. </li><li>
  1907. To force the frame rate of the input file (valid for raw formats only)
  1908. to 1 fps and the frame rate of the output file to 24 fps:
  1909. <div class="example">
  1910. <pre class="example">ffmpeg -r 1 -i input.m2v -r 24 output.avi
  1911. </pre></div>
  1912. </li></ul>
  1913. <p>The format option may be needed for raw input files.
  1914. </p>
  1915. <a name="Detailed-description"></a>
  1916. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Detailed-description">3 Detailed description</a></h1>
  1917. <p>The transcoding process in <code>ffmpeg</code> for each output can be described by
  1918. the following diagram:
  1919. </p>
  1920. <pre class="verbatim"> _______ ______________
  1921. | | | |
  1922. | input | demuxer | encoded data | decoder
  1923. | file | ---------&gt; | packets | -----+
  1924. |_______| |______________| |
  1925. v
  1926. _________
  1927. | |
  1928. | decoded |
  1929. | frames |
  1930. |_________|
  1931. ________ ______________ |
  1932. | | | | |
  1933. | output | &lt;-------- | encoded data | &lt;----+
  1934. | file | muxer | packets | encoder
  1935. |________| |______________|
  1936. </pre>
  1937. <p><code>ffmpeg</code> calls the libavformat library (containing demuxers) to read
  1938. input files and get packets containing encoded data from them. When there are
  1939. multiple input files, <code>ffmpeg</code> tries to keep them synchronized by
  1940. tracking lowest timestamp on any active input stream.
  1941. </p>
  1942. <p>Encoded packets are then passed to the decoder (unless streamcopy is selected
  1943. for the stream, see further for a description). The decoder produces
  1944. uncompressed frames (raw video/PCM audio/...) which can be processed further by
  1945. filtering (see next section). After filtering, the frames are passed to the
  1946. encoder, which encodes them and outputs encoded packets. Finally those are
  1947. passed to the muxer, which writes the encoded packets to the output file.
  1948. </p>
  1949. <a name="Filtering"></a>
  1950. <h2 class="section"><a href="ffmpeg-all.html#toc-Filtering">3.1 Filtering</a></h2>
  1951. <p>Before encoding, <code>ffmpeg</code> can process raw audio and video frames using
  1952. filters from the libavfilter library. Several chained filters form a filter
  1953. graph. <code>ffmpeg</code> distinguishes between two types of filtergraphs:
  1954. simple and complex.
  1955. </p>
  1956. <a name="Simple-filtergraphs"></a>
  1957. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Simple-filtergraphs">3.1.1 Simple filtergraphs</a></h3>
  1958. <p>Simple filtergraphs are those that have exactly one input and output, both of
  1959. the same type. In the above diagram they can be represented by simply inserting
  1960. an additional step between decoding and encoding:
  1961. </p>
  1962. <pre class="verbatim"> _________ ______________
  1963. | | | |
  1964. | decoded | | encoded data |
  1965. | frames |\ _ | packets |
  1966. |_________| \ /||______________|
  1967. \ __________ /
  1968. simple _\|| | / encoder
  1969. filtergraph | filtered |/
  1970. | frames |
  1971. |__________|
  1972. </pre>
  1973. <p>Simple filtergraphs are configured with the per-stream &lsquo;<samp>-filter</samp>&rsquo; option
  1974. (with &lsquo;<samp>-vf</samp>&rsquo; and &lsquo;<samp>-af</samp>&rsquo; aliases for video and audio respectively).
  1975. A simple filtergraph for video can look for example like this:
  1976. </p>
  1977. <pre class="verbatim"> _______ _____________ _______ ________
  1978. | | | | | | | |
  1979. | input | ---&gt; | deinterlace | ---&gt; | scale | ---&gt; | output |
  1980. |_______| |_____________| |_______| |________|
  1981. </pre>
  1982. <p>Note that some filters change frame properties but not frame contents. E.g. the
  1983. <code>fps</code> filter in the example above changes number of frames, but does not
  1984. touch the frame contents. Another example is the <code>setpts</code> filter, which
  1985. only sets timestamps and otherwise passes the frames unchanged.
  1986. </p>
  1987. <a name="Complex-filtergraphs"></a>
  1988. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Complex-filtergraphs">3.1.2 Complex filtergraphs</a></h3>
  1989. <p>Complex filtergraphs are those which cannot be described as simply a linear
  1990. processing chain applied to one stream. This is the case, for example, when the graph has
  1991. more than one input and/or output, or when output stream type is different from
  1992. input. They can be represented with the following diagram:
  1993. </p>
  1994. <pre class="verbatim"> _________
  1995. | |
  1996. | input 0 |\ __________
  1997. |_________| \ | |
  1998. \ _________ /| output 0 |
  1999. \ | | / |__________|
  2000. _________ \| complex | /
  2001. | | | |/
  2002. | input 1 |----&gt;| filter |\
  2003. |_________| | | \ __________
  2004. /| graph | \ | |
  2005. / | | \| output 1 |
  2006. _________ / |_________| |__________|
  2007. | | /
  2008. | input 2 |/
  2009. |_________|
  2010. </pre>
  2011. <p>Complex filtergraphs are configured with the &lsquo;<samp>-filter_complex</samp>&rsquo; option.
  2012. Note that this option is global, since a complex filtergraph, by its nature,
  2013. cannot be unambiguously associated with a single stream or file.
  2014. </p>
  2015. <p>The &lsquo;<samp>-lavfi</samp>&rsquo; option is equivalent to &lsquo;<samp>-filter_complex</samp>&rsquo;.
  2016. </p>
  2017. <p>A trivial example of a complex filtergraph is the <code>overlay</code> filter, which
  2018. has two video inputs and one video output, containing one video overlaid on top
  2019. of the other. Its audio counterpart is the <code>amix</code> filter.
  2020. </p>
  2021. <a name="Stream-copy"></a>
  2022. <h2 class="section"><a href="ffmpeg-all.html#toc-Stream-copy">3.2 Stream copy</a></h2>
  2023. <p>Stream copy is a mode selected by supplying the <code>copy</code> parameter to the
  2024. &lsquo;<samp>-codec</samp>&rsquo; option. It makes <code>ffmpeg</code> omit the decoding and encoding
  2025. step for the specified stream, so it does only demuxing and muxing. It is useful
  2026. for changing the container format or modifying container-level metadata. The
  2027. diagram above will, in this case, simplify to this:
  2028. </p>
  2029. <pre class="verbatim"> _______ ______________ ________
  2030. | | | | | |
  2031. | input | demuxer | encoded data | muxer | output |
  2032. | file | ---------&gt; | packets | -------&gt; | file |
  2033. |_______| |______________| |________|
  2034. </pre>
  2035. <p>Since there is no decoding or encoding, it is very fast and there is no quality
  2036. loss. However, it might not work in some cases because of many factors. Applying
  2037. filters is obviously also impossible, since filters work on uncompressed data.
  2038. </p>
  2039. <a name="Stream-selection"></a>
  2040. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Stream-selection">4 Stream selection</a></h1>
  2041. <p><code>ffmpeg</code> provides the <code>-map</code> option for manual control of stream selection in each
  2042. output file. Users can skip <code>-map</code> and let ffmpeg perform automatic stream selection as
  2043. described below. The <code>-vn / -an / -sn / -dn</code> options can be used to skip inclusion of
  2044. video, audio, subtitle and data streams respectively, whether manually mapped or automatically
  2045. selected, except for those streams which are outputs of complex filtergraphs.
  2046. </p>
  2047. <a name="Description-1"></a>
  2048. <h2 class="section"><a href="ffmpeg-all.html#toc-Description-1">4.1 Description</a></h2>
  2049. <p>The sub-sections that follow describe the various rules that are involved in stream selection.
  2050. The examples that follow next show how these rules are applied in practice.
  2051. </p>
  2052. <p>While every effort is made to accurately reflect the behavior of the program, FFmpeg is under
  2053. continuous development and the code may have changed since the time of this writing.
  2054. </p>
  2055. <a name="Automatic-stream-selection"></a>
  2056. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Automatic-stream-selection">4.1.1 Automatic stream selection</a></h3>
  2057. <p>In the absence of any map options for a particular output file, ffmpeg inspects the output
  2058. format to check which type of streams can be included in it, viz. video, audio and/or
  2059. subtitles. For each acceptable stream type, ffmpeg will pick one stream, when available,
  2060. from among all the inputs.
  2061. </p>
  2062. <p>It will select that stream based upon the following criteria:
  2063. </p><ul>
  2064. <li>
  2065. for video, it is the stream with the highest resolution,
  2066. </li><li>
  2067. for audio, it is the stream with the most channels,
  2068. </li><li>
  2069. for subtitles, it is the first subtitle stream found but there&rsquo;s a caveat.
  2070. The output format&rsquo;s default subtitle encoder can be either text-based or image-based,
  2071. and only a subtitle stream of the same type will be chosen.
  2072. </li></ul>
  2073. <p>In the case where several streams of the same type rate equally, the stream with the lowest
  2074. index is chosen.
  2075. </p>
  2076. <p>Data or attachment streams are not automatically selected and can only be included
  2077. using <code>-map</code>.
  2078. </p><a name="Manual-stream-selection"></a>
  2079. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Manual-stream-selection">4.1.2 Manual stream selection</a></h3>
  2080. <p>When <code>-map</code> is used, only user-mapped streams are included in that output file,
  2081. with one possible exception for filtergraph outputs described below.
  2082. </p>
  2083. <a name="Complex-filtergraphs-1"></a>
  2084. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Complex-filtergraphs-1">4.1.3 Complex filtergraphs</a></h3>
  2085. <p>If there are any complex filtergraph output streams with unlabeled pads, they will be added
  2086. to the first output file. This will lead to a fatal error if the stream type is not supported
  2087. by the output format. In the absence of the map option, the inclusion of these streams leads
  2088. to the automatic stream selection of their types being skipped. If map options are present,
  2089. these filtergraph streams are included in addition to the mapped streams.
  2090. </p>
  2091. <p>Complex filtergraph output streams with labeled pads must be mapped once and exactly once.
  2092. </p>
  2093. <a name="Stream-handling"></a>
  2094. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Stream-handling">4.1.4 Stream handling</a></h3>
  2095. <p>Stream handling is independent of stream selection, with an exception for subtitles described
  2096. below. Stream handling is set via the <code>-codec</code> option addressed to streams within a
  2097. specific <em>output</em> file. In particular, codec options are applied by ffmpeg after the
  2098. stream selection process and thus do not influence the latter. If no <code>-codec</code> option is
  2099. specified for a stream type, ffmpeg will select the default encoder registered by the output
  2100. file muxer.
  2101. </p>
  2102. <p>An exception exists for subtitles. If a subtitle encoder is specified for an output file, the
  2103. first subtitle stream found of any type, text or image, will be included. ffmpeg does not validate
  2104. if the specified encoder can convert the selected stream or if the converted stream is acceptable
  2105. within the output format. This applies generally as well: when the user sets an encoder manually,
  2106. the stream selection process cannot check if the encoded stream can be muxed into the output file.
  2107. If it cannot, ffmpeg will abort and <em>all</em> output files will fail to be processed.
  2108. </p>
  2109. <a name="Examples-181"></a>
  2110. <h2 class="section"><a href="ffmpeg-all.html#toc-Examples-181">4.2 Examples</a></h2>
  2111. <p>The following examples illustrate the behavior, quirks and limitations of ffmpeg&rsquo;s stream
  2112. selection methods.
  2113. </p>
  2114. <p>They assume the following three input files.
  2115. </p>
  2116. <pre class="verbatim">
  2117. input file 'A.avi'
  2118. stream 0: video 640x360
  2119. stream 1: audio 2 channels
  2120. input file 'B.mp4'
  2121. stream 0: video 1920x1080
  2122. stream 1: audio 2 channels
  2123. stream 2: subtitles (text)
  2124. stream 3: audio 5.1 channels
  2125. stream 4: subtitles (text)
  2126. input file 'C.mkv'
  2127. stream 0: video 1280x720
  2128. stream 1: audio 2 channels
  2129. stream 2: subtitles (image)
  2130. </pre>
  2131. <a name="Example_003a-automatic-stream-selection"></a>
  2132. <h4 class="subsubheading">Example: automatic stream selection</h4>
  2133. <div class="example">
  2134. <pre class="example">ffmpeg -i A.avi -i B.mp4 out1.mkv out2.wav -map 1:a -c:a copy out3.mov
  2135. </pre></div>
  2136. <p>There are three output files specified, and for the first two, no <code>-map</code> options
  2137. are set, so ffmpeg will select streams for these two files automatically.
  2138. </p>
  2139. <p>&lsquo;<tt>out1.mkv</tt>&rsquo; is a Matroska container file and accepts video, audio and subtitle streams,
  2140. so ffmpeg will try to select one of each type.<br>
  2141. For video, it will select <code>stream 0</code> from &lsquo;<tt>B.mp4</tt>&rsquo;, which has the highest
  2142. resolution among all the input video streams.<br>
  2143. For audio, it will select <code>stream 3</code> from &lsquo;<tt>B.mp4</tt>&rsquo;, since it has the greatest
  2144. number of channels.<br>
  2145. For subtitles, it will select <code>stream 2</code> from &lsquo;<tt>B.mp4</tt>&rsquo;, which is the first subtitle
  2146. stream from among &lsquo;<tt>A.avi</tt>&rsquo; and &lsquo;<tt>B.mp4</tt>&rsquo;.
  2147. </p>
  2148. <p>&lsquo;<tt>out2.wav</tt>&rsquo; accepts only audio streams, so only <code>stream 3</code> from &lsquo;<tt>B.mp4</tt>&rsquo; is
  2149. selected.
  2150. </p>
  2151. <p>For &lsquo;<tt>out3.mov</tt>&rsquo;, since a <code>-map</code> option is set, no automatic stream selection will
  2152. occur. The <code>-map 1:a</code> option will select all audio streams from the second input
  2153. &lsquo;<tt>B.mp4</tt>&rsquo;. No other streams will be included in this output file.
  2154. </p>
  2155. <p>For the first two outputs, all included streams will be transcoded. The encoders chosen will
  2156. be the default ones registered by each output format, which may not match the codec of the
  2157. selected input streams.
  2158. </p>
  2159. <p>For the third output, codec option for audio streams has been set
  2160. to <code>copy</code>, so no decoding-filtering-encoding operations will occur, or <em>can</em> occur.
  2161. Packets of selected streams shall be conveyed from the input file and muxed within the output
  2162. file.
  2163. </p>
  2164. <a name="Example_003a-automatic-subtitles-selection"></a>
  2165. <h4 class="subsubheading">Example: automatic subtitles selection</h4>
  2166. <div class="example">
  2167. <pre class="example">ffmpeg -i C.mkv out1.mkv -c:s dvdsub -an out2.mkv
  2168. </pre></div>
  2169. <p>Although &lsquo;<tt>out1.mkv</tt>&rsquo; is a Matroska container file which accepts subtitle streams, only a
  2170. video and audio stream shall be selected. The subtitle stream of &lsquo;<tt>C.mkv</tt>&rsquo; is image-based
  2171. and the default subtitle encoder of the Matroska muxer is text-based, so a transcode operation
  2172. for the subtitles is expected to fail and hence the stream isn&rsquo;t selected. However, in
  2173. &lsquo;<tt>out2.mkv</tt>&rsquo;, a subtitle encoder is specified in the command and so, the subtitle stream is
  2174. selected, in addition to the video stream. The presence of <code>-an</code> disables audio stream
  2175. selection for &lsquo;<tt>out2.mkv</tt>&rsquo;.
  2176. </p>
  2177. <a name="Example_003a-unlabeled-filtergraph-outputs"></a>
  2178. <h4 class="subsubheading">Example: unlabeled filtergraph outputs</h4>
  2179. <div class="example">
  2180. <pre class="example">ffmpeg -i A.avi -i C.mkv -i B.mp4 -filter_complex &quot;overlay&quot; out1.mp4 out2.srt
  2181. </pre></div>
  2182. <p>A filtergraph is setup here using the <code>-filter_complex</code> option and consists of a single
  2183. video filter. The <code>overlay</code> filter requires exactly two video inputs, but none are
  2184. specified, so the first two available video streams are used, those of &lsquo;<tt>A.avi</tt>&rsquo; and
  2185. &lsquo;<tt>C.mkv</tt>&rsquo;. The output pad of the filter has no label and so is sent to the first output file
  2186. &lsquo;<tt>out1.mp4</tt>&rsquo;. Due to this, automatic selection of the video stream is skipped, which would
  2187. have selected the stream in &lsquo;<tt>B.mp4</tt>&rsquo;. The audio stream with most channels viz. <code>stream 3</code>
  2188. in &lsquo;<tt>B.mp4</tt>&rsquo;, is chosen automatically. No subtitle stream is chosen however, since the MP4
  2189. format has no default subtitle encoder registered, and the user hasn&rsquo;t specified a subtitle encoder.
  2190. </p>
  2191. <p>The 2nd output file, &lsquo;<tt>out2.srt</tt>&rsquo;, only accepts text-based subtitle streams. So, even though
  2192. the first subtitle stream available belongs to &lsquo;<tt>C.mkv</tt>&rsquo;, it is image-based and hence skipped.
  2193. The selected stream, <code>stream 2</code> in &lsquo;<tt>B.mp4</tt>&rsquo;, is the first text-based subtitle stream.
  2194. </p>
  2195. <a name="Example_003a-labeled-filtergraph-outputs"></a>
  2196. <h4 class="subsubheading">Example: labeled filtergraph outputs</h4>
  2197. <div class="example">
  2198. <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; \
  2199. -map '[outv]' -an out1.mp4 \
  2200. out2.mkv \
  2201. -map '[outv]' -map 1:a:0 out3.mkv
  2202. </pre></div>
  2203. <p>The above command will fail, as the output pad labelled <code>[outv]</code> has been mapped twice.
  2204. None of the output files shall be processed.
  2205. </p>
  2206. <div class="example">
  2207. <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; \
  2208. -an out1.mp4 \
  2209. out2.mkv \
  2210. -map 1:a:0 out3.mkv
  2211. </pre></div>
  2212. <p>This command above will also fail as the hue filter output has a label, <code>[outv]</code>,
  2213. and hasn&rsquo;t been mapped anywhere.
  2214. </p>
  2215. <p>The command should be modified as follows,
  2216. </p><div class="example">
  2217. <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; \
  2218. -map '[outv1]' -an out1.mp4 \
  2219. out2.mkv \
  2220. -map '[outv2]' -map 1:a:0 out3.mkv
  2221. </pre></div>
  2222. <p>The video stream from &lsquo;<tt>B.mp4</tt>&rsquo; is sent to the hue filter, whose output is cloned once using
  2223. the split filter, and both outputs labelled. Then a copy each is mapped to the first and third
  2224. output files.
  2225. </p>
  2226. <p>The overlay filter, requiring two video inputs, uses the first two unused video streams. Those
  2227. are the streams from &lsquo;<tt>A.avi</tt>&rsquo; and &lsquo;<tt>C.mkv</tt>&rsquo;. The overlay output isn&rsquo;t labelled, so it is
  2228. sent to the first output file &lsquo;<tt>out1.mp4</tt>&rsquo;, regardless of the presence of the <code>-map</code> option.
  2229. </p>
  2230. <p>The aresample filter is sent the first unused audio stream, that of &lsquo;<tt>A.avi</tt>&rsquo;. Since this filter
  2231. output is also unlabelled, it too is mapped to the first output file. The presence of <code>-an</code>
  2232. only suppresses automatic or manual stream selection of audio streams, not outputs sent from
  2233. filtergraphs. Both these mapped streams shall be ordered before the mapped stream in &lsquo;<tt>out1.mp4</tt>&rsquo;.
  2234. </p>
  2235. <p>The video, audio and subtitle streams mapped to <code>out2.mkv</code> are entirely determined by
  2236. automatic stream selection.
  2237. </p>
  2238. <p>&lsquo;<tt>out3.mkv</tt>&rsquo; consists of the cloned video output from the hue filter and the first audio
  2239. stream from &lsquo;<tt>B.mp4</tt>&rsquo;.
  2240. <br>
  2241. </p>
  2242. <a name="Options-17"></a>
  2243. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Options-17">5 Options</a></h1>
  2244. <p>All the numerical options, if not specified otherwise, accept a string
  2245. representing a number as input, which may be followed by one of the SI
  2246. unit prefixes, for example: &rsquo;K&rsquo;, &rsquo;M&rsquo;, or &rsquo;G&rsquo;.
  2247. </p>
  2248. <p>If &rsquo;i&rsquo; is appended to the SI unit prefix, the complete prefix will be
  2249. interpreted as a unit prefix for binary multiples, which are based on
  2250. powers of 1024 instead of powers of 1000. Appending &rsquo;B&rsquo; to the SI unit
  2251. prefix multiplies the value by 8. This allows using, for example:
  2252. &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as number suffixes.
  2253. </p>
  2254. <p>Options which do not take arguments are boolean options, and set the
  2255. corresponding value to true. They can be set to false by prefixing
  2256. the option name with &quot;no&quot;. For example using &quot;-nofoo&quot;
  2257. will set the boolean option with name &quot;foo&quot; to false.
  2258. </p>
  2259. <p><a name="Stream-specifiers"></a>
  2260. </p><a name="Stream-specifiers-1"></a>
  2261. <h2 class="section"><a href="ffmpeg-all.html#toc-Stream-specifiers-1">5.1 Stream specifiers</a></h2>
  2262. <p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
  2263. are used to precisely specify which stream(s) a given option belongs to.
  2264. </p>
  2265. <p>A stream specifier is a string generally appended to the option name and
  2266. separated from it by a colon. E.g. <code>-codec:a:1 ac3</code> contains the
  2267. <code>a:1</code> stream specifier, which matches the second audio stream. Therefore, it
  2268. would select the ac3 codec for the second audio stream.
  2269. </p>
  2270. <p>A stream specifier can match several streams, so that the option is applied to all
  2271. of them. E.g. the stream specifier in <code>-b:a 128k</code> matches all audio
  2272. streams.
  2273. </p>
  2274. <p>An empty stream specifier matches all streams. For example, <code>-codec copy</code>
  2275. or <code>-codec: copy</code> would copy all the streams without reencoding.
  2276. </p>
  2277. <p>Possible forms of stream specifiers are:
  2278. </p><dl compact="compact">
  2279. <dt>&lsquo;<samp><var>stream_index</var></samp>&rsquo;</dt>
  2280. <dd><p>Matches the stream with this index. E.g. <code>-threads:1 4</code> would set the
  2281. thread count for the second stream to 4. If <var>stream_index</var> is used as an
  2282. additional stream specifier (see below), then it selects stream number
  2283. <var>stream_index</var> from the matching streams. Stream numbering is based on the
  2284. order of the streams as detected by libavformat except when a program ID is
  2285. also specified. In this case it is based on the ordering of the streams in the
  2286. program.
  2287. </p></dd>
  2288. <dt>&lsquo;<samp><var>stream_type</var>[:<var>additional_stream_specifier</var>]</samp>&rsquo;</dt>
  2289. <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;
  2290. for subtitle, &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. &rsquo;v&rsquo; matches all video
  2291. streams, &rsquo;V&rsquo; only matches video streams which are not attached pictures, video
  2292. thumbnails or cover arts. If <var>additional_stream_specifier</var> is used, then
  2293. it matches streams which both have this type and match the
  2294. <var>additional_stream_specifier</var>. Otherwise, it matches all streams of the
  2295. specified type.
  2296. </p></dd>
  2297. <dt>&lsquo;<samp>p:<var>program_id</var>[:<var>additional_stream_specifier</var>]</samp>&rsquo;</dt>
  2298. <dd><p>Matches streams which are in the program with the id <var>program_id</var>. If
  2299. <var>additional_stream_specifier</var> is used, then it matches streams which both
  2300. are part of the program and match the <var>additional_stream_specifier</var>.
  2301. </p>
  2302. </dd>
  2303. <dt>&lsquo;<samp>#<var>stream_id</var> or i:<var>stream_id</var></samp>&rsquo;</dt>
  2304. <dd><p>Match the stream by stream id (e.g. PID in MPEG-TS container).
  2305. </p></dd>
  2306. <dt>&lsquo;<samp>m:<var>key</var>[:<var>value</var>]</samp>&rsquo;</dt>
  2307. <dd><p>Matches streams with the metadata tag <var>key</var> having the specified value. If
  2308. <var>value</var> is not given, matches streams that contain the given tag with any
  2309. value.
  2310. </p></dd>
  2311. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  2312. <dd><p>Matches streams with usable configuration, the codec must be defined and the
  2313. essential information such as video dimension or audio sample rate must be present.
  2314. </p>
  2315. <p>Note that in <code>ffmpeg</code>, matching by metadata will only work properly for
  2316. input files.
  2317. </p></dd>
  2318. </dl>
  2319. <a name="Generic-options"></a>
  2320. <h2 class="section"><a href="ffmpeg-all.html#toc-Generic-options">5.2 Generic options</a></h2>
  2321. <p>These options are shared amongst the ff* tools.
  2322. </p>
  2323. <dl compact="compact">
  2324. <dt>&lsquo;<samp>-L</samp>&rsquo;</dt>
  2325. <dd><p>Show license.
  2326. </p>
  2327. </dd>
  2328. <dt>&lsquo;<samp>-h, -?, -help, --help [<var>arg</var>]</samp>&rsquo;</dt>
  2329. <dd><p>Show help. An optional parameter may be specified to print help about a specific
  2330. item. If no argument is specified, only basic (non advanced) tool
  2331. options are shown.
  2332. </p>
  2333. <p>Possible values of <var>arg</var> are:
  2334. </p><dl compact="compact">
  2335. <dt>&lsquo;<samp>long</samp>&rsquo;</dt>
  2336. <dd><p>Print advanced tool options in addition to the basic tool options.
  2337. </p>
  2338. </dd>
  2339. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  2340. <dd><p>Print complete list of options, including shared and private options
  2341. for encoders, decoders, demuxers, muxers, filters, etc.
  2342. </p>
  2343. </dd>
  2344. <dt>&lsquo;<samp>decoder=<var>decoder_name</var></samp>&rsquo;</dt>
  2345. <dd><p>Print detailed information about the decoder named <var>decoder_name</var>. Use the
  2346. &lsquo;<samp>-decoders</samp>&rsquo; option to get a list of all decoders.
  2347. </p>
  2348. </dd>
  2349. <dt>&lsquo;<samp>encoder=<var>encoder_name</var></samp>&rsquo;</dt>
  2350. <dd><p>Print detailed information about the encoder named <var>encoder_name</var>. Use the
  2351. &lsquo;<samp>-encoders</samp>&rsquo; option to get a list of all encoders.
  2352. </p>
  2353. </dd>
  2354. <dt>&lsquo;<samp>demuxer=<var>demuxer_name</var></samp>&rsquo;</dt>
  2355. <dd><p>Print detailed information about the demuxer named <var>demuxer_name</var>. Use the
  2356. &lsquo;<samp>-formats</samp>&rsquo; option to get a list of all demuxers and muxers.
  2357. </p>
  2358. </dd>
  2359. <dt>&lsquo;<samp>muxer=<var>muxer_name</var></samp>&rsquo;</dt>
  2360. <dd><p>Print detailed information about the muxer named <var>muxer_name</var>. Use the
  2361. &lsquo;<samp>-formats</samp>&rsquo; option to get a list of all muxers and demuxers.
  2362. </p>
  2363. </dd>
  2364. <dt>&lsquo;<samp>filter=<var>filter_name</var></samp>&rsquo;</dt>
  2365. <dd><p>Print detailed information about the filter name <var>filter_name</var>. Use the
  2366. &lsquo;<samp>-filters</samp>&rsquo; option to get a list of all filters.
  2367. </p>
  2368. </dd>
  2369. <dt>&lsquo;<samp>bsf=<var>bitstream_filter_name</var></samp>&rsquo;</dt>
  2370. <dd><p>Print detailed information about the bitstream filter name <var>bitstream_filter_name</var>.
  2371. Use the &lsquo;<samp>-bsfs</samp>&rsquo; option to get a list of all bitstream filters.
  2372. </p></dd>
  2373. </dl>
  2374. </dd>
  2375. <dt>&lsquo;<samp>-version</samp>&rsquo;</dt>
  2376. <dd><p>Show version.
  2377. </p>
  2378. </dd>
  2379. <dt>&lsquo;<samp>-formats</samp>&rsquo;</dt>
  2380. <dd><p>Show available formats (including devices).
  2381. </p>
  2382. </dd>
  2383. <dt>&lsquo;<samp>-demuxers</samp>&rsquo;</dt>
  2384. <dd><p>Show available demuxers.
  2385. </p>
  2386. </dd>
  2387. <dt>&lsquo;<samp>-muxers</samp>&rsquo;</dt>
  2388. <dd><p>Show available muxers.
  2389. </p>
  2390. </dd>
  2391. <dt>&lsquo;<samp>-devices</samp>&rsquo;</dt>
  2392. <dd><p>Show available devices.
  2393. </p>
  2394. </dd>
  2395. <dt>&lsquo;<samp>-codecs</samp>&rsquo;</dt>
  2396. <dd><p>Show all codecs known to libavcodec.
  2397. </p>
  2398. <p>Note that the term &rsquo;codec&rsquo; is used throughout this documentation as a shortcut
  2399. for what is more correctly called a media bitstream format.
  2400. </p>
  2401. </dd>
  2402. <dt>&lsquo;<samp>-decoders</samp>&rsquo;</dt>
  2403. <dd><p>Show available decoders.
  2404. </p>
  2405. </dd>
  2406. <dt>&lsquo;<samp>-encoders</samp>&rsquo;</dt>
  2407. <dd><p>Show all available encoders.
  2408. </p>
  2409. </dd>
  2410. <dt>&lsquo;<samp>-bsfs</samp>&rsquo;</dt>
  2411. <dd><p>Show available bitstream filters.
  2412. </p>
  2413. </dd>
  2414. <dt>&lsquo;<samp>-protocols</samp>&rsquo;</dt>
  2415. <dd><p>Show available protocols.
  2416. </p>
  2417. </dd>
  2418. <dt>&lsquo;<samp>-filters</samp>&rsquo;</dt>
  2419. <dd><p>Show available libavfilter filters.
  2420. </p>
  2421. </dd>
  2422. <dt>&lsquo;<samp>-pix_fmts</samp>&rsquo;</dt>
  2423. <dd><p>Show available pixel formats.
  2424. </p>
  2425. </dd>
  2426. <dt>&lsquo;<samp>-sample_fmts</samp>&rsquo;</dt>
  2427. <dd><p>Show available sample formats.
  2428. </p>
  2429. </dd>
  2430. <dt>&lsquo;<samp>-layouts</samp>&rsquo;</dt>
  2431. <dd><p>Show channel names and standard channel layouts.
  2432. </p>
  2433. </dd>
  2434. <dt>&lsquo;<samp>-colors</samp>&rsquo;</dt>
  2435. <dd><p>Show recognized color names.
  2436. </p>
  2437. </dd>
  2438. <dt>&lsquo;<samp>-sources <var>device</var>[,<var>opt1</var>=<var>val1</var>[,<var>opt2</var>=<var>val2</var>]...]</samp>&rsquo;</dt>
  2439. <dd><p>Show autodetected sources of the input device.
  2440. Some devices may provide system-dependent source names that cannot be autodetected.
  2441. The returned list cannot be assumed to be always complete.
  2442. </p><div class="example">
  2443. <pre class="example">ffmpeg -sources pulse,server=192.168.0.4
  2444. </pre></div>
  2445. </dd>
  2446. <dt>&lsquo;<samp>-sinks <var>device</var>[,<var>opt1</var>=<var>val1</var>[,<var>opt2</var>=<var>val2</var>]...]</samp>&rsquo;</dt>
  2447. <dd><p>Show autodetected sinks of the output device.
  2448. Some devices may provide system-dependent sink names that cannot be autodetected.
  2449. The returned list cannot be assumed to be always complete.
  2450. </p><div class="example">
  2451. <pre class="example">ffmpeg -sinks pulse,server=192.168.0.4
  2452. </pre></div>
  2453. </dd>
  2454. <dt>&lsquo;<samp>-loglevel [<var>flags</var>+]<var>loglevel</var> | -v [<var>flags</var>+]<var>loglevel</var></samp>&rsquo;</dt>
  2455. <dd><p>Set logging level and flags used by the library.
  2456. </p>
  2457. <p>The optional <var>flags</var> prefix can consist of the following values:
  2458. </p><dl compact="compact">
  2459. <dt>&lsquo;<samp>repeat</samp>&rsquo;</dt>
  2460. <dd><p>Indicates that repeated log output should not be compressed to the first line
  2461. and the &quot;Last message repeated n times&quot; line will be omitted.
  2462. </p></dd>
  2463. <dt>&lsquo;<samp>level</samp>&rsquo;</dt>
  2464. <dd><p>Indicates that log output should add a <code>[level]</code> prefix to each message
  2465. line. This can be used as an alternative to log coloring, e.g. when dumping the
  2466. log to file.
  2467. </p></dd>
  2468. </dl>
  2469. <p>Flags can also be used alone by adding a &rsquo;+&rsquo;/&rsquo;-&rsquo; prefix to set/reset a single
  2470. flag without affecting other <var>flags</var> or changing <var>loglevel</var>. When
  2471. setting both <var>flags</var> and <var>loglevel</var>, a &rsquo;+&rsquo; separator is expected
  2472. between the last <var>flags</var> value and before <var>loglevel</var>.
  2473. </p>
  2474. <p><var>loglevel</var> is a string or a number containing one of the following values:
  2475. </p><dl compact="compact">
  2476. <dt>&lsquo;<samp>quiet, -8</samp>&rsquo;</dt>
  2477. <dd><p>Show nothing at all; be silent.
  2478. </p></dd>
  2479. <dt>&lsquo;<samp>panic, 0</samp>&rsquo;</dt>
  2480. <dd><p>Only show fatal errors which could lead the process to crash, such as
  2481. an assertion failure. This is not currently used for anything.
  2482. </p></dd>
  2483. <dt>&lsquo;<samp>fatal, 8</samp>&rsquo;</dt>
  2484. <dd><p>Only show fatal errors. These are errors after which the process absolutely
  2485. cannot continue.
  2486. </p></dd>
  2487. <dt>&lsquo;<samp>error, 16</samp>&rsquo;</dt>
  2488. <dd><p>Show all errors, including ones which can be recovered from.
  2489. </p></dd>
  2490. <dt>&lsquo;<samp>warning, 24</samp>&rsquo;</dt>
  2491. <dd><p>Show all warnings and errors. Any message related to possibly
  2492. incorrect or unexpected events will be shown.
  2493. </p></dd>
  2494. <dt>&lsquo;<samp>info, 32</samp>&rsquo;</dt>
  2495. <dd><p>Show informative messages during processing. This is in addition to
  2496. warnings and errors. This is the default value.
  2497. </p></dd>
  2498. <dt>&lsquo;<samp>verbose, 40</samp>&rsquo;</dt>
  2499. <dd><p>Same as <code>info</code>, except more verbose.
  2500. </p></dd>
  2501. <dt>&lsquo;<samp>debug, 48</samp>&rsquo;</dt>
  2502. <dd><p>Show everything, including debugging information.
  2503. </p></dd>
  2504. <dt>&lsquo;<samp>trace, 56</samp>&rsquo;</dt>
  2505. </dl>
  2506. <p>For example to enable repeated log output, add the <code>level</code> prefix, and set
  2507. <var>loglevel</var> to <code>verbose</code>:
  2508. </p><div class="example">
  2509. <pre class="example">ffmpeg -loglevel repeat+level+verbose -i input output
  2510. </pre></div>
  2511. <p>Another example that enables repeated log output without affecting current
  2512. state of <code>level</code> prefix flag or <var>loglevel</var>:
  2513. </p><div class="example">
  2514. <pre class="example">ffmpeg [...] -loglevel +repeat
  2515. </pre></div>
  2516. <p>By default the program logs to stderr. If coloring is supported by the
  2517. terminal, colors are used to mark errors and warnings. Log coloring
  2518. can be disabled setting the environment variable
  2519. <code>AV_LOG_FORCE_NOCOLOR</code>, or can be forced setting
  2520. the environment variable <code>AV_LOG_FORCE_COLOR</code>.
  2521. </p>
  2522. </dd>
  2523. <dt>&lsquo;<samp>-report</samp>&rsquo;</dt>
  2524. <dd><p>Dump full command line and log output to a file named
  2525. <code><var>program</var>-<var>YYYYMMDD</var>-<var>HHMMSS</var>.log</code> in the current
  2526. directory.
  2527. This file can be useful for bug reports.
  2528. It also implies <code>-loglevel debug</code>.
  2529. </p>
  2530. <p>Setting the environment variable <code>FFREPORT</code> to any value has the
  2531. same effect. If the value is a &rsquo;:&rsquo;-separated key=value sequence, these
  2532. options will affect the report; option values must be escaped if they
  2533. contain special characters or the options delimiter &rsquo;:&rsquo; (see the
  2534. &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual).
  2535. </p>
  2536. <p>The following options are recognized:
  2537. </p><dl compact="compact">
  2538. <dt>&lsquo;<samp>file</samp>&rsquo;</dt>
  2539. <dd><p>set the file name to use for the report; <code>%p</code> is expanded to the name
  2540. of the program, <code>%t</code> is expanded to a timestamp, <code>%%</code> is expanded
  2541. to a plain <code>%</code>
  2542. </p></dd>
  2543. <dt>&lsquo;<samp>level</samp>&rsquo;</dt>
  2544. <dd><p>set the log verbosity level using a numerical value (see <code>-loglevel</code>).
  2545. </p></dd>
  2546. </dl>
  2547. <p>For example, to output a report to a file named &lsquo;<tt>ffreport.log</tt>&rsquo;
  2548. using a log level of <code>32</code> (alias for log level <code>info</code>):
  2549. </p>
  2550. <div class="example">
  2551. <pre class="example">FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
  2552. </pre></div>
  2553. <p>Errors in parsing the environment variable are not fatal, and will not
  2554. appear in the report.
  2555. </p>
  2556. </dd>
  2557. <dt>&lsquo;<samp>-hide_banner</samp>&rsquo;</dt>
  2558. <dd><p>Suppress printing banner.
  2559. </p>
  2560. <p>All FFmpeg tools will normally show a copyright notice, build options
  2561. and library versions. This option can be used to suppress printing
  2562. this information.
  2563. </p>
  2564. </dd>
  2565. <dt>&lsquo;<samp>-cpuflags flags (<em>global</em>)</samp>&rsquo;</dt>
  2566. <dd><p>Allows setting and clearing cpu flags. This option is intended
  2567. for testing. Do not use it unless you know what you&rsquo;re doing.
  2568. </p><div class="example">
  2569. <pre class="example">ffmpeg -cpuflags -sse+mmx ...
  2570. ffmpeg -cpuflags mmx ...
  2571. ffmpeg -cpuflags 0 ...
  2572. </pre></div>
  2573. <p>Possible flags for this option are:
  2574. </p><dl compact="compact">
  2575. <dt>&lsquo;<samp>x86</samp>&rsquo;</dt>
  2576. <dd><dl compact="compact">
  2577. <dt>&lsquo;<samp>mmx</samp>&rsquo;</dt>
  2578. <dt>&lsquo;<samp>mmxext</samp>&rsquo;</dt>
  2579. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  2580. <dt>&lsquo;<samp>sse2</samp>&rsquo;</dt>
  2581. <dt>&lsquo;<samp>sse2slow</samp>&rsquo;</dt>
  2582. <dt>&lsquo;<samp>sse3</samp>&rsquo;</dt>
  2583. <dt>&lsquo;<samp>sse3slow</samp>&rsquo;</dt>
  2584. <dt>&lsquo;<samp>ssse3</samp>&rsquo;</dt>
  2585. <dt>&lsquo;<samp>atom</samp>&rsquo;</dt>
  2586. <dt>&lsquo;<samp>sse4.1</samp>&rsquo;</dt>
  2587. <dt>&lsquo;<samp>sse4.2</samp>&rsquo;</dt>
  2588. <dt>&lsquo;<samp>avx</samp>&rsquo;</dt>
  2589. <dt>&lsquo;<samp>avx2</samp>&rsquo;</dt>
  2590. <dt>&lsquo;<samp>xop</samp>&rsquo;</dt>
  2591. <dt>&lsquo;<samp>fma3</samp>&rsquo;</dt>
  2592. <dt>&lsquo;<samp>fma4</samp>&rsquo;</dt>
  2593. <dt>&lsquo;<samp>3dnow</samp>&rsquo;</dt>
  2594. <dt>&lsquo;<samp>3dnowext</samp>&rsquo;</dt>
  2595. <dt>&lsquo;<samp>bmi1</samp>&rsquo;</dt>
  2596. <dt>&lsquo;<samp>bmi2</samp>&rsquo;</dt>
  2597. <dt>&lsquo;<samp>cmov</samp>&rsquo;</dt>
  2598. </dl>
  2599. </dd>
  2600. <dt>&lsquo;<samp>ARM</samp>&rsquo;</dt>
  2601. <dd><dl compact="compact">
  2602. <dt>&lsquo;<samp>armv5te</samp>&rsquo;</dt>
  2603. <dt>&lsquo;<samp>armv6</samp>&rsquo;</dt>
  2604. <dt>&lsquo;<samp>armv6t2</samp>&rsquo;</dt>
  2605. <dt>&lsquo;<samp>vfp</samp>&rsquo;</dt>
  2606. <dt>&lsquo;<samp>vfpv3</samp>&rsquo;</dt>
  2607. <dt>&lsquo;<samp>neon</samp>&rsquo;</dt>
  2608. <dt>&lsquo;<samp>setend</samp>&rsquo;</dt>
  2609. </dl>
  2610. </dd>
  2611. <dt>&lsquo;<samp>AArch64</samp>&rsquo;</dt>
  2612. <dd><dl compact="compact">
  2613. <dt>&lsquo;<samp>armv8</samp>&rsquo;</dt>
  2614. <dt>&lsquo;<samp>vfp</samp>&rsquo;</dt>
  2615. <dt>&lsquo;<samp>neon</samp>&rsquo;</dt>
  2616. </dl>
  2617. </dd>
  2618. <dt>&lsquo;<samp>PowerPC</samp>&rsquo;</dt>
  2619. <dd><dl compact="compact">
  2620. <dt>&lsquo;<samp>altivec</samp>&rsquo;</dt>
  2621. </dl>
  2622. </dd>
  2623. <dt>&lsquo;<samp>Specific Processors</samp>&rsquo;</dt>
  2624. <dd><dl compact="compact">
  2625. <dt>&lsquo;<samp>pentium2</samp>&rsquo;</dt>
  2626. <dt>&lsquo;<samp>pentium3</samp>&rsquo;</dt>
  2627. <dt>&lsquo;<samp>pentium4</samp>&rsquo;</dt>
  2628. <dt>&lsquo;<samp>k6</samp>&rsquo;</dt>
  2629. <dt>&lsquo;<samp>k62</samp>&rsquo;</dt>
  2630. <dt>&lsquo;<samp>athlon</samp>&rsquo;</dt>
  2631. <dt>&lsquo;<samp>athlonxp</samp>&rsquo;</dt>
  2632. <dt>&lsquo;<samp>k8</samp>&rsquo;</dt>
  2633. </dl>
  2634. </dd>
  2635. </dl>
  2636. </dd>
  2637. </dl>
  2638. <a name="AVOptions"></a>
  2639. <h2 class="section"><a href="ffmpeg-all.html#toc-AVOptions">5.3 AVOptions</a></h2>
  2640. <p>These options are provided directly by the libavformat, libavdevice and
  2641. libavcodec libraries. To see the list of available AVOptions, use the
  2642. &lsquo;<samp>-help</samp>&rsquo; option. They are separated into two categories:
  2643. </p><dl compact="compact">
  2644. <dt>&lsquo;<samp>generic</samp>&rsquo;</dt>
  2645. <dd><p>These options can be set for any container, codec or device. Generic options
  2646. are listed under AVFormatContext options for containers/devices and under
  2647. AVCodecContext options for codecs.
  2648. </p></dd>
  2649. <dt>&lsquo;<samp>private</samp>&rsquo;</dt>
  2650. <dd><p>These options are specific to the given container, device or codec. Private
  2651. options are listed under their corresponding containers/devices/codecs.
  2652. </p></dd>
  2653. </dl>
  2654. <p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
  2655. an MP3 file, use the &lsquo;<samp>id3v2_version</samp>&rsquo; private option of the MP3
  2656. muxer:
  2657. </p><div class="example">
  2658. <pre class="example">ffmpeg -i input.flac -id3v2_version 3 out.mp3
  2659. </pre></div>
  2660. <p>All codec AVOptions are per-stream, and thus a stream specifier
  2661. should be attached to them:
  2662. </p><div class="example">
  2663. <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
  2664. </pre></div>
  2665. <p>In the above example, a multichannel audio stream is mapped twice for output.
  2666. The first instance is encoded with codec ac3 and bitrate 640k.
  2667. The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using
  2668. absolute index of the output stream.
  2669. </p>
  2670. <p>Note: the &lsquo;<samp>-nooption</samp>&rsquo; syntax cannot be used for boolean
  2671. AVOptions, use &lsquo;<samp>-option 0</samp>&rsquo;/&lsquo;<samp>-option 1</samp>&rsquo;.
  2672. </p>
  2673. <p>Note: the old undocumented way of specifying per-stream AVOptions by
  2674. prepending v/a/s to the options name is now obsolete and will be
  2675. removed soon.
  2676. </p>
  2677. <a name="Main-options"></a>
  2678. <h2 class="section"><a href="ffmpeg-all.html#toc-Main-options">5.4 Main options</a></h2>
  2679. <dl compact="compact">
  2680. <dt>&lsquo;<samp>-f <var>fmt</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  2681. <dd><p>Force input or output file format. The format is normally auto detected for input
  2682. files and guessed from the file extension for output files, so this option is not
  2683. needed in most cases.
  2684. </p>
  2685. </dd>
  2686. <dt>&lsquo;<samp>-i <var>url</var> (<em>input</em>)</samp>&rsquo;</dt>
  2687. <dd><p>input file url
  2688. </p>
  2689. </dd>
  2690. <dt>&lsquo;<samp>-y (<em>global</em>)</samp>&rsquo;</dt>
  2691. <dd><p>Overwrite output files without asking.
  2692. </p>
  2693. </dd>
  2694. <dt>&lsquo;<samp>-n (<em>global</em>)</samp>&rsquo;</dt>
  2695. <dd><p>Do not overwrite output files, and exit immediately if a specified
  2696. output file already exists.
  2697. </p>
  2698. </dd>
  2699. <dt>&lsquo;<samp>-stream_loop <var>number</var> (<em>input</em>)</samp>&rsquo;</dt>
  2700. <dd><p>Set number of times input stream shall be looped. Loop 0 means no loop,
  2701. loop -1 means infinite loop.
  2702. </p>
  2703. </dd>
  2704. <dt>&lsquo;<samp>-c[:<var>stream_specifier</var>] <var>codec</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  2705. <dt>&lsquo;<samp>-codec[:<var>stream_specifier</var>] <var>codec</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  2706. <dd><p>Select an encoder (when used before an output file) or a decoder (when used
  2707. before an input file) for one or more streams. <var>codec</var> is the name of a
  2708. decoder/encoder or a special value <code>copy</code> (output only) to indicate that
  2709. the stream is not to be re-encoded.
  2710. </p>
  2711. <p>For example
  2712. </p><div class="example">
  2713. <pre class="example">ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
  2714. </pre></div>
  2715. <p>encodes all video streams with libx264 and copies all audio streams.
  2716. </p>
  2717. <p>For each stream, the last matching <code>c</code> option is applied, so
  2718. </p><div class="example">
  2719. <pre class="example">ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
  2720. </pre></div>
  2721. <p>will copy all the streams except the second video, which will be encoded with
  2722. libx264, and the 138th audio, which will be encoded with libvorbis.
  2723. </p>
  2724. </dd>
  2725. <dt>&lsquo;<samp>-t <var>duration</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  2726. <dd><p>When used as an input option (before <code>-i</code>), limit the <var>duration</var> of
  2727. data read from the input file.
  2728. </p>
  2729. <p>When used as an output option (before an output url), stop writing the
  2730. output after its duration reaches <var>duration</var>.
  2731. </p>
  2732. <p><var>duration</var> must be a time duration specification,
  2733. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  2734. </p>
  2735. <p>-to and -t are mutually exclusive and -t has priority.
  2736. </p>
  2737. </dd>
  2738. <dt>&lsquo;<samp>-to <var>position</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  2739. <dd><p>Stop writing the output or reading the input at <var>position</var>.
  2740. <var>position</var> must be a time duration specification,
  2741. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  2742. </p>
  2743. <p>-to and -t are mutually exclusive and -t has priority.
  2744. </p>
  2745. </dd>
  2746. <dt>&lsquo;<samp>-fs <var>limit_size</var> (<em>output</em>)</samp>&rsquo;</dt>
  2747. <dd><p>Set the file size limit, expressed in bytes. No further chunk of bytes is written
  2748. after the limit is exceeded. The size of the output file is slightly more than the
  2749. requested file size.
  2750. </p>
  2751. </dd>
  2752. <dt>&lsquo;<samp>-ss <var>position</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  2753. <dd><p>When used as an input option (before <code>-i</code>), seeks in this input file to
  2754. <var>position</var>. Note that in most formats it is not possible to seek exactly,
  2755. so <code>ffmpeg</code> will seek to the closest seek point before <var>position</var>.
  2756. When transcoding and &lsquo;<samp>-accurate_seek</samp>&rsquo; is enabled (the default), this
  2757. extra segment between the seek point and <var>position</var> will be decoded and
  2758. discarded. When doing stream copy or when &lsquo;<samp>-noaccurate_seek</samp>&rsquo; is used, it
  2759. will be preserved.
  2760. </p>
  2761. <p>When used as an output option (before an output url), decodes but discards
  2762. input until the timestamps reach <var>position</var>.
  2763. </p>
  2764. <p><var>position</var> must be a time duration specification,
  2765. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  2766. </p>
  2767. </dd>
  2768. <dt>&lsquo;<samp>-sseof <var>position</var> (<em>input</em>)</samp>&rsquo;</dt>
  2769. <dd>
  2770. <p>Like the <code>-ss</code> option but relative to the &quot;end of file&quot;. That is negative
  2771. values are earlier in the file, 0 is at EOF.
  2772. </p>
  2773. </dd>
  2774. <dt>&lsquo;<samp>-itsoffset <var>offset</var> (<em>input</em>)</samp>&rsquo;</dt>
  2775. <dd><p>Set the input time offset.
  2776. </p>
  2777. <p><var>offset</var> must be a time duration specification,
  2778. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  2779. </p>
  2780. <p>The offset is added to the timestamps of the input files. Specifying
  2781. a positive offset means that the corresponding streams are delayed by
  2782. the time duration specified in <var>offset</var>.
  2783. </p>
  2784. </dd>
  2785. <dt>&lsquo;<samp>-itsscale <var>scale</var> (<em>input,per-stream</em>)</samp>&rsquo;</dt>
  2786. <dd><p>Rescale input timestamps. <var>scale</var> should be a floating point number.
  2787. </p>
  2788. </dd>
  2789. <dt>&lsquo;<samp>-timestamp <var>date</var> (<em>output</em>)</samp>&rsquo;</dt>
  2790. <dd><p>Set the recording timestamp in the container.
  2791. </p>
  2792. <p><var>date</var> must be a date specification,
  2793. see <a href="ffmpeg-utils.html#date-syntax">(ffmpeg-utils)the Date section in the ffmpeg-utils(1) manual</a>.
  2794. </p>
  2795. </dd>
  2796. <dt>&lsquo;<samp>-metadata[:metadata_specifier] <var>key</var>=<var>value</var> (<em>output,per-metadata</em>)</samp>&rsquo;</dt>
  2797. <dd><p>Set a metadata key/value pair.
  2798. </p>
  2799. <p>An optional <var>metadata_specifier</var> may be given to set metadata
  2800. on streams, chapters or programs. See <code>-map_metadata</code>
  2801. documentation for details.
  2802. </p>
  2803. <p>This option overrides metadata set with <code>-map_metadata</code>. It is
  2804. also possible to delete metadata by using an empty value.
  2805. </p>
  2806. <p>For example, for setting the title in the output file:
  2807. </p><div class="example">
  2808. <pre class="example">ffmpeg -i in.avi -metadata title=&quot;my title&quot; out.flv
  2809. </pre></div>
  2810. <p>To set the language of the first audio stream:
  2811. </p><div class="example">
  2812. <pre class="example">ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
  2813. </pre></div>
  2814. </dd>
  2815. <dt>&lsquo;<samp>-disposition[:stream_specifier] <var>value</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  2816. <dd><p>Sets the disposition for a stream.
  2817. </p>
  2818. <p>This option overrides the disposition copied from the input stream. It is also
  2819. possible to delete the disposition by setting it to 0.
  2820. </p>
  2821. <p>The following dispositions are recognized:
  2822. </p><dl compact="compact">
  2823. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  2824. <dt>&lsquo;<samp>dub</samp>&rsquo;</dt>
  2825. <dt>&lsquo;<samp>original</samp>&rsquo;</dt>
  2826. <dt>&lsquo;<samp>comment</samp>&rsquo;</dt>
  2827. <dt>&lsquo;<samp>lyrics</samp>&rsquo;</dt>
  2828. <dt>&lsquo;<samp>karaoke</samp>&rsquo;</dt>
  2829. <dt>&lsquo;<samp>forced</samp>&rsquo;</dt>
  2830. <dt>&lsquo;<samp>hearing_impaired</samp>&rsquo;</dt>
  2831. <dt>&lsquo;<samp>visual_impaired</samp>&rsquo;</dt>
  2832. <dt>&lsquo;<samp>clean_effects</samp>&rsquo;</dt>
  2833. <dt>&lsquo;<samp>attached_pic</samp>&rsquo;</dt>
  2834. <dt>&lsquo;<samp>captions</samp>&rsquo;</dt>
  2835. <dt>&lsquo;<samp>descriptions</samp>&rsquo;</dt>
  2836. <dt>&lsquo;<samp>dependent</samp>&rsquo;</dt>
  2837. <dt>&lsquo;<samp>metadata</samp>&rsquo;</dt>
  2838. </dl>
  2839. <p>For example, to make the second audio stream the default stream:
  2840. </p><div class="example">
  2841. <pre class="example">ffmpeg -i in.mkv -c copy -disposition:a:1 default out.mkv
  2842. </pre></div>
  2843. <p>To make the second subtitle stream the default stream and remove the default
  2844. disposition from the first subtitle stream:
  2845. </p><div class="example">
  2846. <pre class="example">ffmpeg -i in.mkv -c copy -disposition:s:0 0 -disposition:s:1 default out.mkv
  2847. </pre></div>
  2848. <p>To add an embedded cover/thumbnail:
  2849. </p><div class="example">
  2850. <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
  2851. </pre></div>
  2852. <p>Not all muxers support embedded thumbnails, and those who do, only support a few formats, like JPEG or PNG.
  2853. </p>
  2854. </dd>
  2855. <dt>&lsquo;<samp>-program [title=<var>title</var>:][program_num=<var>program_num</var>:]st=<var>stream</var>[:st=<var>stream</var>...] (<em>output</em>)</samp>&rsquo;</dt>
  2856. <dd>
  2857. <p>Creates a program with the specified <var>title</var>, <var>program_num</var> and adds the specified
  2858. <var>stream</var>(s) to it.
  2859. </p>
  2860. </dd>
  2861. <dt>&lsquo;<samp>-target <var>type</var> (<em>output</em>)</samp>&rsquo;</dt>
  2862. <dd><p>Specify target file type (<code>vcd</code>, <code>svcd</code>, <code>dvd</code>, <code>dv</code>,
  2863. <code>dv50</code>). <var>type</var> may be prefixed with <code>pal-</code>, <code>ntsc-</code> or
  2864. <code>film-</code> to use the corresponding standard. All the format options
  2865. (bitrate, codecs, buffer sizes) are then set automatically. You can just type:
  2866. </p>
  2867. <div class="example">
  2868. <pre class="example">ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
  2869. </pre></div>
  2870. <p>Nevertheless you can specify additional options as long as you know
  2871. they do not conflict with the standard, as in:
  2872. </p>
  2873. <div class="example">
  2874. <pre class="example">ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
  2875. </pre></div>
  2876. </dd>
  2877. <dt>&lsquo;<samp>-dn (<em>input/output</em>)</samp>&rsquo;</dt>
  2878. <dd><p>As an input option, blocks all data streams of a file from being filtered or
  2879. being automatically selected or mapped for any output. See <code>-discard</code>
  2880. option to disable streams individually.
  2881. </p>
  2882. <p>As an output option, disables data recording i.e. automatic selection or
  2883. mapping of any data stream. For full manual control see the <code>-map</code>
  2884. option.
  2885. </p>
  2886. </dd>
  2887. <dt>&lsquo;<samp>-dframes <var>number</var> (<em>output</em>)</samp>&rsquo;</dt>
  2888. <dd><p>Set the number of data frames to output. This is an obsolete alias for
  2889. <code>-frames:d</code>, which you should use instead.
  2890. </p>
  2891. </dd>
  2892. <dt>&lsquo;<samp>-frames[:<var>stream_specifier</var>] <var>framecount</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  2893. <dd><p>Stop writing to the stream after <var>framecount</var> frames.
  2894. </p>
  2895. </dd>
  2896. <dt>&lsquo;<samp>-q[:<var>stream_specifier</var>] <var>q</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  2897. <dt>&lsquo;<samp>-qscale[:<var>stream_specifier</var>] <var>q</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  2898. <dd><p>Use fixed quality scale (VBR). The meaning of <var>q</var>/<var>qscale</var> is
  2899. codec-dependent.
  2900. If <var>qscale</var> is used without a <var>stream_specifier</var> then it applies only
  2901. to the video stream, this is to maintain compatibility with previous behavior
  2902. and as specifying the same codec specific value to 2 different codecs that is
  2903. audio and video generally is not what is intended when no stream_specifier is
  2904. used.
  2905. </p>
  2906. <p><a name="filter_005foption"></a>
  2907. </p></dd>
  2908. <dt>&lsquo;<samp>-filter[:<var>stream_specifier</var>] <var>filtergraph</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  2909. <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
  2910. filter the stream.
  2911. </p>
  2912. <p><var>filtergraph</var> is a description of the filtergraph to apply to
  2913. the stream, and must have a single input and a single output of the
  2914. same type of the stream. In the filtergraph, the input is associated
  2915. to the label <code>in</code>, and the output to the label <code>out</code>. See
  2916. the ffmpeg-filters manual for more information about the filtergraph
  2917. syntax.
  2918. </p>
  2919. <p>See the <a href="#filter_005fcomplex_005foption">-filter_complex option</a> if you
  2920. want to create filtergraphs with multiple inputs and/or outputs.
  2921. </p>
  2922. </dd>
  2923. <dt>&lsquo;<samp>-filter_script[:<var>stream_specifier</var>] <var>filename</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  2924. <dd><p>This option is similar to &lsquo;<samp>-filter</samp>&rsquo;, the only difference is that its
  2925. argument is the name of the file from which a filtergraph description is to be
  2926. read.
  2927. </p>
  2928. </dd>
  2929. <dt>&lsquo;<samp>-filter_threads <var>nb_threads</var> (<em>global</em>)</samp>&rsquo;</dt>
  2930. <dd><p>Defines how many threads are used to process a filter pipeline. Each pipeline
  2931. will produce a thread pool with this many threads available for parallel processing.
  2932. The default is the number of available CPUs.
  2933. </p>
  2934. </dd>
  2935. <dt>&lsquo;<samp>-pre[:<var>stream_specifier</var>] <var>preset_name</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  2936. <dd><p>Specify the preset for matching stream(s).
  2937. </p>
  2938. </dd>
  2939. <dt>&lsquo;<samp>-stats (<em>global</em>)</samp>&rsquo;</dt>
  2940. <dd><p>Print encoding progress/statistics. It is on by default, to explicitly
  2941. disable it you need to specify <code>-nostats</code>.
  2942. </p>
  2943. </dd>
  2944. <dt>&lsquo;<samp>-progress <var>url</var> (<em>global</em>)</samp>&rsquo;</dt>
  2945. <dd><p>Send program-friendly progress information to <var>url</var>.
  2946. </p>
  2947. <p>Progress information is written approximately every second and at the end of
  2948. the encoding process. It is made of &quot;<var>key</var>=<var>value</var>&quot; lines. <var>key</var>
  2949. consists of only alphanumeric characters. The last key of a sequence of
  2950. progress information is always &quot;progress&quot;.
  2951. </p>
  2952. <p><a name="stdin-option"></a>
  2953. </p></dd>
  2954. <dt>&lsquo;<samp>-stdin</samp>&rsquo;</dt>
  2955. <dd><p>Enable interaction on standard input. On by default unless standard input is
  2956. used as an input. To explicitly disable interaction you need to specify
  2957. <code>-nostdin</code>.
  2958. </p>
  2959. <p>Disabling interaction on standard input is useful, for example, if
  2960. ffmpeg is in the background process group. Roughly the same result can
  2961. be achieved with <code>ffmpeg ... &lt; /dev/null</code> but it requires a
  2962. shell.
  2963. </p>
  2964. </dd>
  2965. <dt>&lsquo;<samp>-debug_ts (<em>global</em>)</samp>&rsquo;</dt>
  2966. <dd><p>Print timestamp information. It is off by default. This option is
  2967. mostly useful for testing and debugging purposes, and the output
  2968. format may change from one version to another, so it should not be
  2969. employed by portable scripts.
  2970. </p>
  2971. <p>See also the option <code>-fdebug ts</code>.
  2972. </p>
  2973. </dd>
  2974. <dt>&lsquo;<samp>-attach <var>filename</var> (<em>output</em>)</samp>&rsquo;</dt>
  2975. <dd><p>Add an attachment to the output file. This is supported by a few formats
  2976. like Matroska for e.g. fonts used in rendering subtitles. Attachments
  2977. are implemented as a specific type of stream, so this option will add
  2978. a new stream to the file. It is then possible to use per-stream options
  2979. on this stream in the usual way. Attachment streams created with this
  2980. option will be created after all the other streams (i.e. those created
  2981. with <code>-map</code> or automatic mappings).
  2982. </p>
  2983. <p>Note that for Matroska you also have to set the mimetype metadata tag:
  2984. </p><div class="example">
  2985. <pre class="example">ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
  2986. </pre></div>
  2987. <p>(assuming that the attachment stream will be third in the output file).
  2988. </p>
  2989. </dd>
  2990. <dt>&lsquo;<samp>-dump_attachment[:<var>stream_specifier</var>] <var>filename</var> (<em>input,per-stream</em>)</samp>&rsquo;</dt>
  2991. <dd><p>Extract the matching attachment stream into a file named <var>filename</var>. If
  2992. <var>filename</var> is empty, then the value of the <code>filename</code> metadata tag
  2993. will be used.
  2994. </p>
  2995. <p>E.g. to extract the first attachment to a file named &rsquo;out.ttf&rsquo;:
  2996. </p><div class="example">
  2997. <pre class="example">ffmpeg -dump_attachment:t:0 out.ttf -i INPUT
  2998. </pre></div>
  2999. <p>To extract all attachments to files determined by the <code>filename</code> tag:
  3000. </p><div class="example">
  3001. <pre class="example">ffmpeg -dump_attachment:t &quot;&quot; -i INPUT
  3002. </pre></div>
  3003. <p>Technical note &ndash; attachments are implemented as codec extradata, so this
  3004. option can actually be used to extract extradata from any stream, not just
  3005. attachments.
  3006. </p>
  3007. </dd>
  3008. <dt>&lsquo;<samp>-noautorotate</samp>&rsquo;</dt>
  3009. <dd><p>Disable automatically rotating video based on file metadata.
  3010. </p>
  3011. </dd>
  3012. </dl>
  3013. <a name="Video-Options"></a>
  3014. <h2 class="section"><a href="ffmpeg-all.html#toc-Video-Options">5.5 Video Options</a></h2>
  3015. <dl compact="compact">
  3016. <dt>&lsquo;<samp>-vframes <var>number</var> (<em>output</em>)</samp>&rsquo;</dt>
  3017. <dd><p>Set the number of video frames to output. This is an obsolete alias for
  3018. <code>-frames:v</code>, which you should use instead.
  3019. </p></dd>
  3020. <dt>&lsquo;<samp>-r[:<var>stream_specifier</var>] <var>fps</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  3021. <dd><p>Set frame rate (Hz value, fraction or abbreviation).
  3022. </p>
  3023. <p>As an input option, ignore any timestamps stored in the file and instead
  3024. generate timestamps assuming constant frame rate <var>fps</var>.
  3025. This is not the same as the &lsquo;<samp>-framerate</samp>&rsquo; option used for some input formats
  3026. like image2 or v4l2 (it used to be the same in older versions of FFmpeg).
  3027. If in doubt use &lsquo;<samp>-framerate</samp>&rsquo; instead of the input option &lsquo;<samp>-r</samp>&rsquo;.
  3028. </p>
  3029. <p>As an output option, duplicate or drop input frames to achieve constant output
  3030. frame rate <var>fps</var>.
  3031. </p>
  3032. </dd>
  3033. <dt>&lsquo;<samp>-s[:<var>stream_specifier</var>] <var>size</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  3034. <dd><p>Set frame size.
  3035. </p>
  3036. <p>As an input option, this is a shortcut for the &lsquo;<samp>video_size</samp>&rsquo; private
  3037. option, recognized by some demuxers for which the frame size is either not
  3038. stored in the file or is configurable &ndash; e.g. raw video or video grabbers.
  3039. </p>
  3040. <p>As an output option, this inserts the <code>scale</code> video filter to the
  3041. <em>end</em> of the corresponding filtergraph. Please use the <code>scale</code> filter
  3042. directly to insert it at the beginning or some other place.
  3043. </p>
  3044. <p>The format is &lsquo;<samp>wxh</samp>&rsquo; (default - same as source).
  3045. </p>
  3046. </dd>
  3047. <dt>&lsquo;<samp>-aspect[:<var>stream_specifier</var>] <var>aspect</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3048. <dd><p>Set the video display aspect ratio specified by <var>aspect</var>.
  3049. </p>
  3050. <p><var>aspect</var> can be a floating point number string, or a string of the
  3051. form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
  3052. numerator and denominator of the aspect ratio. For example &quot;4:3&quot;,
  3053. &quot;16:9&quot;, &quot;1.3333&quot;, and &quot;1.7777&quot; are valid argument values.
  3054. </p>
  3055. <p>If used together with &lsquo;<samp>-vcodec copy</samp>&rsquo;, it will affect the aspect ratio
  3056. stored at container level, but not the aspect ratio stored in encoded
  3057. frames, if it exists.
  3058. </p>
  3059. </dd>
  3060. <dt>&lsquo;<samp>-vn (<em>input/output</em>)</samp>&rsquo;</dt>
  3061. <dd><p>As an input option, blocks all video streams of a file from being filtered or
  3062. being automatically selected or mapped for any output. See <code>-discard</code>
  3063. option to disable streams individually.
  3064. </p>
  3065. <p>As an output option, disables video recording i.e. automatic selection or
  3066. mapping of any video stream. For full manual control see the <code>-map</code>
  3067. option.
  3068. </p>
  3069. </dd>
  3070. <dt>&lsquo;<samp>-vcodec <var>codec</var> (<em>output</em>)</samp>&rsquo;</dt>
  3071. <dd><p>Set the video codec. This is an alias for <code>-codec:v</code>.
  3072. </p>
  3073. </dd>
  3074. <dt>&lsquo;<samp>-pass[:<var>stream_specifier</var>] <var>n</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3075. <dd><p>Select the pass number (1 or 2). It is used to do two-pass
  3076. video encoding. The statistics of the video are recorded in the first
  3077. pass into a log file (see also the option -passlogfile),
  3078. and in the second pass that log file is used to generate the video
  3079. at the exact requested bitrate.
  3080. On pass 1, you may just deactivate audio and set output to null,
  3081. examples for Windows and Unix:
  3082. </p><div class="example">
  3083. <pre class="example">ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
  3084. ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
  3085. </pre></div>
  3086. </dd>
  3087. <dt>&lsquo;<samp>-passlogfile[:<var>stream_specifier</var>] <var>prefix</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3088. <dd><p>Set two-pass log file name prefix to <var>prefix</var>, the default file name
  3089. prefix is &ldquo;ffmpeg2pass&rdquo;. The complete file name will be
  3090. &lsquo;<tt>PREFIX-N.log</tt>&rsquo;, where N is a number specific to the output
  3091. stream
  3092. </p>
  3093. </dd>
  3094. <dt>&lsquo;<samp>-vf <var>filtergraph</var> (<em>output</em>)</samp>&rsquo;</dt>
  3095. <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
  3096. filter the stream.
  3097. </p>
  3098. <p>This is an alias for <code>-filter:v</code>, see the <a href="#filter_005foption">-filter option</a>.
  3099. </p></dd>
  3100. </dl>
  3101. <a name="Advanced-Video-options"></a>
  3102. <h2 class="section"><a href="ffmpeg-all.html#toc-Advanced-Video-options">5.6 Advanced Video options</a></h2>
  3103. <dl compact="compact">
  3104. <dt>&lsquo;<samp>-pix_fmt[:<var>stream_specifier</var>] <var>format</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  3105. <dd><p>Set pixel format. Use <code>-pix_fmts</code> to show all the supported
  3106. pixel formats.
  3107. If the selected pixel format can not be selected, ffmpeg will print a
  3108. warning and select the best pixel format supported by the encoder.
  3109. If <var>pix_fmt</var> is prefixed by a <code>+</code>, ffmpeg will exit with an error
  3110. if the requested pixel format can not be selected, and automatic conversions
  3111. inside filtergraphs are disabled.
  3112. If <var>pix_fmt</var> is a single <code>+</code>, ffmpeg selects the same pixel format
  3113. as the input (or graph output) and automatic conversions are disabled.
  3114. </p>
  3115. </dd>
  3116. <dt>&lsquo;<samp>-sws_flags <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  3117. <dd><p>Set SwScaler flags.
  3118. </p>
  3119. </dd>
  3120. <dt>&lsquo;<samp>-rc_override[:<var>stream_specifier</var>] <var>override</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3121. <dd><p>Rate control override for specific intervals, formatted as &quot;int,int,int&quot;
  3122. list separated with slashes. Two first values are the beginning and
  3123. end frame numbers, last one is quantizer to use if positive, or quality
  3124. factor if negative.
  3125. </p>
  3126. </dd>
  3127. <dt>&lsquo;<samp>-ilme</samp>&rsquo;</dt>
  3128. <dd><p>Force interlacing support in encoder (MPEG-2 and MPEG-4 only).
  3129. Use this option if your input file is interlaced and you want
  3130. to keep the interlaced format for minimum losses.
  3131. The alternative is to deinterlace the input stream with
  3132. &lsquo;<samp>-deinterlace</samp>&rsquo;, but deinterlacing introduces losses.
  3133. </p></dd>
  3134. <dt>&lsquo;<samp>-psnr</samp>&rsquo;</dt>
  3135. <dd><p>Calculate PSNR of compressed frames.
  3136. </p></dd>
  3137. <dt>&lsquo;<samp>-vstats</samp>&rsquo;</dt>
  3138. <dd><p>Dump video coding statistics to &lsquo;<tt>vstats_HHMMSS.log</tt>&rsquo;.
  3139. </p></dd>
  3140. <dt>&lsquo;<samp>-vstats_file <var>file</var></samp>&rsquo;</dt>
  3141. <dd><p>Dump video coding statistics to <var>file</var>.
  3142. </p></dd>
  3143. <dt>&lsquo;<samp>-vstats_version <var>file</var></samp>&rsquo;</dt>
  3144. <dd><p>Specifies which version of the vstats format to use. Default is 2.
  3145. </p>
  3146. <p>version = 1 :
  3147. </p>
  3148. <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>
  3149. </p>
  3150. <p>version &gt; 1:
  3151. </p>
  3152. <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>
  3153. </p></dd>
  3154. <dt>&lsquo;<samp>-top[:<var>stream_specifier</var>] <var>n</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3155. <dd><p>top=1/bottom=0/auto=-1 field first
  3156. </p></dd>
  3157. <dt>&lsquo;<samp>-dc <var>precision</var></samp>&rsquo;</dt>
  3158. <dd><p>Intra_dc_precision.
  3159. </p></dd>
  3160. <dt>&lsquo;<samp>-vtag <var>fourcc/tag</var> (<em>output</em>)</samp>&rsquo;</dt>
  3161. <dd><p>Force video tag/fourcc. This is an alias for <code>-tag:v</code>.
  3162. </p></dd>
  3163. <dt>&lsquo;<samp>-qphist (<em>global</em>)</samp>&rsquo;</dt>
  3164. <dd><p>Show QP histogram
  3165. </p></dd>
  3166. <dt>&lsquo;<samp>-vbsf <var>bitstream_filter</var></samp>&rsquo;</dt>
  3167. <dd><p>Deprecated see -bsf
  3168. </p>
  3169. </dd>
  3170. <dt>&lsquo;<samp>-force_key_frames[:<var>stream_specifier</var>] <var>time</var>[,<var>time</var>...] (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3171. <dt>&lsquo;<samp>-force_key_frames[:<var>stream_specifier</var>] expr:<var>expr</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3172. <dt>&lsquo;<samp>-force_key_frames[:<var>stream_specifier</var>] source (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3173. <dd>
  3174. <p><var>force_key_frames</var> can take arguments of the following form:
  3175. </p>
  3176. <dl compact="compact">
  3177. <dt>&lsquo;<samp><var>time</var>[,<var>time</var>...]</samp>&rsquo;</dt>
  3178. <dd><p>If the argument consists of timestamps, ffmpeg will round the specified times to the nearest
  3179. output timestamp as per the encoder time base and force a keyframe at the first frame having
  3180. timestamp equal or greater than the computed timestamp. Note that if the encoder time base is too
  3181. coarse, then the keyframes may be forced on frames with timestamps lower than the specified time.
  3182. The default encoder time base is the inverse of the output framerate but may be set otherwise
  3183. via <code>-enc_time_base</code>.
  3184. </p>
  3185. <p>If one of the times is &quot;<code>chapters</code>[<var>delta</var>]&quot;, it is expanded into
  3186. the time of the beginning of all chapters in the file, shifted by
  3187. <var>delta</var>, expressed as a time in seconds.
  3188. This option can be useful to ensure that a seek point is present at a
  3189. chapter mark or any other designated place in the output file.
  3190. </p>
  3191. <p>For example, to insert a key frame at 5 minutes, plus key frames 0.1 second
  3192. before the beginning of every chapter:
  3193. </p><div class="example">
  3194. <pre class="example">-force_key_frames 0:05:00,chapters-0.1
  3195. </pre></div>
  3196. </dd>
  3197. <dt>&lsquo;<samp>expr:<var>expr</var></samp>&rsquo;</dt>
  3198. <dd><p>If the argument is prefixed with <code>expr:</code>, the string <var>expr</var>
  3199. is interpreted like an expression and is evaluated for each frame. A
  3200. key frame is forced in case the evaluation is non-zero.
  3201. </p>
  3202. <p>The expression in <var>expr</var> can contain the following constants:
  3203. </p><dl compact="compact">
  3204. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  3205. <dd><p>the number of current processed frame, starting from 0
  3206. </p></dd>
  3207. <dt>&lsquo;<samp>n_forced</samp>&rsquo;</dt>
  3208. <dd><p>the number of forced frames
  3209. </p></dd>
  3210. <dt>&lsquo;<samp>prev_forced_n</samp>&rsquo;</dt>
  3211. <dd><p>the number of the previous forced frame, it is <code>NAN</code> when no
  3212. keyframe was forced yet
  3213. </p></dd>
  3214. <dt>&lsquo;<samp>prev_forced_t</samp>&rsquo;</dt>
  3215. <dd><p>the time of the previous forced frame, it is <code>NAN</code> when no
  3216. keyframe was forced yet
  3217. </p></dd>
  3218. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  3219. <dd><p>the time of the current processed frame
  3220. </p></dd>
  3221. </dl>
  3222. <p>For example to force a key frame every 5 seconds, you can specify:
  3223. </p><div class="example">
  3224. <pre class="example">-force_key_frames expr:gte(t,n_forced*5)
  3225. </pre></div>
  3226. <p>To force a key frame 5 seconds after the time of the last forced one,
  3227. starting from second 13:
  3228. </p><div class="example">
  3229. <pre class="example">-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
  3230. </pre></div>
  3231. </dd>
  3232. <dt>&lsquo;<samp>source</samp>&rsquo;</dt>
  3233. <dd><p>If the argument is <code>source</code>, ffmpeg will force a key frame if
  3234. the current frame being encoded is marked as a key frame in its source.
  3235. </p>
  3236. </dd>
  3237. </dl>
  3238. <p>Note that forcing too many keyframes is very harmful for the lookahead
  3239. algorithms of certain encoders: using fixed-GOP options or similar
  3240. would be more efficient.
  3241. </p>
  3242. </dd>
  3243. <dt>&lsquo;<samp>-copyinkf[:<var>stream_specifier</var>] (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3244. <dd><p>When doing stream copy, copy also non-key frames found at the
  3245. beginning.
  3246. </p>
  3247. </dd>
  3248. <dt>&lsquo;<samp>-init_hw_device <var>type</var>[=<var>name</var>][:<var>device</var>[,<var>key=value</var>...]]</samp>&rsquo;</dt>
  3249. <dd><p>Initialise a new hardware device of type <var>type</var> called <var>name</var>, using the
  3250. given device parameters.
  3251. If no name is specified it will receive a default name of the form &quot;<var>type</var>%d&quot;.
  3252. </p>
  3253. <p>The meaning of <var>device</var> and the following arguments depends on the
  3254. device type:
  3255. </p><dl compact="compact">
  3256. <dt>&lsquo;<samp>cuda</samp>&rsquo;</dt>
  3257. <dd><p><var>device</var> is the number of the CUDA device.
  3258. </p>
  3259. </dd>
  3260. <dt>&lsquo;<samp>dxva2</samp>&rsquo;</dt>
  3261. <dd><p><var>device</var> is the number of the Direct3D 9 display adapter.
  3262. </p>
  3263. </dd>
  3264. <dt>&lsquo;<samp>vaapi</samp>&rsquo;</dt>
  3265. <dd><p><var>device</var> is either an X11 display name or a DRM render node.
  3266. If not specified, it will attempt to open the default X11 display (<em>$DISPLAY</em>)
  3267. and then the first DRM render node (<em>/dev/dri/renderD128</em>).
  3268. </p>
  3269. </dd>
  3270. <dt>&lsquo;<samp>vdpau</samp>&rsquo;</dt>
  3271. <dd><p><var>device</var> is an X11 display name.
  3272. If not specified, it will attempt to open the default X11 display (<em>$DISPLAY</em>).
  3273. </p>
  3274. </dd>
  3275. <dt>&lsquo;<samp>qsv</samp>&rsquo;</dt>
  3276. <dd><p><var>device</var> selects a value in &lsquo;<samp>MFX_IMPL_*</samp>&rsquo;. Allowed values are:
  3277. </p><dl compact="compact">
  3278. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  3279. <dt>&lsquo;<samp>sw</samp>&rsquo;</dt>
  3280. <dt>&lsquo;<samp>hw</samp>&rsquo;</dt>
  3281. <dt>&lsquo;<samp>auto_any</samp>&rsquo;</dt>
  3282. <dt>&lsquo;<samp>hw_any</samp>&rsquo;</dt>
  3283. <dt>&lsquo;<samp>hw2</samp>&rsquo;</dt>
  3284. <dt>&lsquo;<samp>hw3</samp>&rsquo;</dt>
  3285. <dt>&lsquo;<samp>hw4</samp>&rsquo;</dt>
  3286. </dl>
  3287. <p>If not specified, &lsquo;<samp>auto_any</samp>&rsquo; is used.
  3288. (Note that it may be easier to achieve the desired result for QSV by creating the
  3289. platform-appropriate subdevice (&lsquo;<samp>dxva2</samp>&rsquo; or &lsquo;<samp>vaapi</samp>&rsquo;) and then deriving a
  3290. QSV device from that.)
  3291. </p>
  3292. </dd>
  3293. <dt>&lsquo;<samp>opencl</samp>&rsquo;</dt>
  3294. <dd><p><var>device</var> selects the platform and device as <em>platform_index.device_index</em>.
  3295. </p>
  3296. <p>The set of devices can also be filtered using the key-value pairs to find only
  3297. devices matching particular platform or device strings.
  3298. </p>
  3299. <p>The strings usable as filters are:
  3300. </p><dl compact="compact">
  3301. <dt>&lsquo;<samp>platform_profile</samp>&rsquo;</dt>
  3302. <dt>&lsquo;<samp>platform_version</samp>&rsquo;</dt>
  3303. <dt>&lsquo;<samp>platform_name</samp>&rsquo;</dt>
  3304. <dt>&lsquo;<samp>platform_vendor</samp>&rsquo;</dt>
  3305. <dt>&lsquo;<samp>platform_extensions</samp>&rsquo;</dt>
  3306. <dt>&lsquo;<samp>device_name</samp>&rsquo;</dt>
  3307. <dt>&lsquo;<samp>device_vendor</samp>&rsquo;</dt>
  3308. <dt>&lsquo;<samp>driver_version</samp>&rsquo;</dt>
  3309. <dt>&lsquo;<samp>device_version</samp>&rsquo;</dt>
  3310. <dt>&lsquo;<samp>device_profile</samp>&rsquo;</dt>
  3311. <dt>&lsquo;<samp>device_extensions</samp>&rsquo;</dt>
  3312. <dt>&lsquo;<samp>device_type</samp>&rsquo;</dt>
  3313. </dl>
  3314. <p>The indices and filters must together uniquely select a device.
  3315. </p>
  3316. <p>Examples:
  3317. </p><dl compact="compact">
  3318. <dt><em>-init_hw_device opencl:0.1</em></dt>
  3319. <dd><p>Choose the second device on the first platform.
  3320. </p>
  3321. </dd>
  3322. <dt><em>-init_hw_device opencl:,device_name=Foo9000</em></dt>
  3323. <dd><p>Choose the device with a name containing the string <em>Foo9000</em>.
  3324. </p>
  3325. </dd>
  3326. <dt><em>-init_hw_device opencl:1,device_type=gpu,device_extensions=cl_khr_fp16</em></dt>
  3327. <dd><p>Choose the GPU device on the second platform supporting the <em>cl_khr_fp16</em>
  3328. extension.
  3329. </p></dd>
  3330. </dl>
  3331. </dd>
  3332. <dt>&lsquo;<samp>vulkan</samp>&rsquo;</dt>
  3333. <dd><p>If <var>device</var> is an integer, it selects the device by its index in a
  3334. system-dependent list of devices. If <var>device</var> is any other string, it
  3335. selects the first device with a name containing that string as a substring.
  3336. </p>
  3337. <p>The following options are recognized:
  3338. </p><dl compact="compact">
  3339. <dt>&lsquo;<samp>debug</samp>&rsquo;</dt>
  3340. <dd><p>If set to 1, enables the validation layer, if installed.
  3341. </p></dd>
  3342. <dt>&lsquo;<samp>linear_images</samp>&rsquo;</dt>
  3343. <dd><p>If set to 1, images allocated by the hwcontext will be linear and locally mappable.
  3344. </p></dd>
  3345. <dt>&lsquo;<samp>instance_extensions</samp>&rsquo;</dt>
  3346. <dd><p>A plus separated list of additional instance extensions to enable.
  3347. </p></dd>
  3348. <dt>&lsquo;<samp>device_extensions</samp>&rsquo;</dt>
  3349. <dd><p>A plus separated list of additional device extensions to enable.
  3350. </p></dd>
  3351. </dl>
  3352. <p>Examples:
  3353. </p><dl compact="compact">
  3354. <dt><em>-init_hw_device vulkan:1</em></dt>
  3355. <dd><p>Choose the second device on the system.
  3356. </p>
  3357. </dd>
  3358. <dt><em>-init_hw_device vulkan:RADV</em></dt>
  3359. <dd><p>Choose the first device with a name containing the string <em>RADV</em>.
  3360. </p>
  3361. </dd>
  3362. <dt><em>-init_hw_device vulkan:0,instance_extensions=VK_KHR_wayland_surface+VK_KHR_xcb_surface</em></dt>
  3363. <dd><p>Choose the first device and enable the Wayland and XCB instance extensions.
  3364. </p></dd>
  3365. </dl>
  3366. </dd>
  3367. </dl>
  3368. </dd>
  3369. <dt>&lsquo;<samp>-init_hw_device <var>type</var>[=<var>name</var>]@<var>source</var></samp>&rsquo;</dt>
  3370. <dd><p>Initialise a new hardware device of type <var>type</var> called <var>name</var>,
  3371. deriving it from the existing device with the name <var>source</var>.
  3372. </p>
  3373. </dd>
  3374. <dt>&lsquo;<samp>-init_hw_device list</samp>&rsquo;</dt>
  3375. <dd><p>List all hardware device types supported in this build of ffmpeg.
  3376. </p>
  3377. </dd>
  3378. <dt>&lsquo;<samp>-filter_hw_device <var>name</var></samp>&rsquo;</dt>
  3379. <dd><p>Pass the hardware device called <var>name</var> to all filters in any filter graph.
  3380. This can be used to set the device to upload to with the <code>hwupload</code> filter,
  3381. or the device to map to with the <code>hwmap</code> filter. Other filters may also
  3382. make use of this parameter when they require a hardware device. Note that this
  3383. is typically only required when the input is not already in hardware frames -
  3384. when it is, filters will derive the device they require from the context of the
  3385. frames they receive as input.
  3386. </p>
  3387. <p>This is a global setting, so all filters will receive the same device.
  3388. </p>
  3389. </dd>
  3390. <dt>&lsquo;<samp>-hwaccel[:<var>stream_specifier</var>] <var>hwaccel</var> (<em>input,per-stream</em>)</samp>&rsquo;</dt>
  3391. <dd><p>Use hardware acceleration to decode the matching stream(s). The allowed values
  3392. of <var>hwaccel</var> are:
  3393. </p><dl compact="compact">
  3394. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  3395. <dd><p>Do not use any hardware acceleration (the default).
  3396. </p>
  3397. </dd>
  3398. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  3399. <dd><p>Automatically select the hardware acceleration method.
  3400. </p>
  3401. </dd>
  3402. <dt>&lsquo;<samp>vdpau</samp>&rsquo;</dt>
  3403. <dd><p>Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration.
  3404. </p>
  3405. </dd>
  3406. <dt>&lsquo;<samp>dxva2</samp>&rsquo;</dt>
  3407. <dd><p>Use DXVA2 (DirectX Video Acceleration) hardware acceleration.
  3408. </p>
  3409. </dd>
  3410. <dt>&lsquo;<samp>vaapi</samp>&rsquo;</dt>
  3411. <dd><p>Use VAAPI (Video Acceleration API) hardware acceleration.
  3412. </p>
  3413. </dd>
  3414. <dt>&lsquo;<samp>qsv</samp>&rsquo;</dt>
  3415. <dd><p>Use the Intel QuickSync Video acceleration for video transcoding.
  3416. </p>
  3417. <p>Unlike most other values, this option does not enable accelerated decoding (that
  3418. is used automatically whenever a qsv decoder is selected), but accelerated
  3419. transcoding, without copying the frames into the system memory.
  3420. </p>
  3421. <p>For it to work, both the decoder and the encoder must support QSV acceleration
  3422. and no filters must be used.
  3423. </p></dd>
  3424. </dl>
  3425. <p>This option has no effect if the selected hwaccel is not available or not
  3426. supported by the chosen decoder.
  3427. </p>
  3428. <p>Note that most acceleration methods are intended for playback and will not be
  3429. faster than software decoding on modern CPUs. Additionally, <code>ffmpeg</code>
  3430. will usually need to copy the decoded frames from the GPU memory into the system
  3431. memory, resulting in further performance loss. This option is thus mainly
  3432. useful for testing.
  3433. </p>
  3434. </dd>
  3435. <dt>&lsquo;<samp>-hwaccel_device[:<var>stream_specifier</var>] <var>hwaccel_device</var> (<em>input,per-stream</em>)</samp>&rsquo;</dt>
  3436. <dd><p>Select a device to use for hardware acceleration.
  3437. </p>
  3438. <p>This option only makes sense when the &lsquo;<samp>-hwaccel</samp>&rsquo; option is also specified.
  3439. It can either refer to an existing device created with &lsquo;<samp>-init_hw_device</samp>&rsquo;
  3440. by name, or it can create a new device as if
  3441. &lsquo;<samp>-init_hw_device</samp>&rsquo; <var>type</var>:<var>hwaccel_device</var>
  3442. were called immediately before.
  3443. </p>
  3444. </dd>
  3445. <dt>&lsquo;<samp>-hwaccels</samp>&rsquo;</dt>
  3446. <dd><p>List all hardware acceleration methods supported in this build of ffmpeg.
  3447. </p>
  3448. </dd>
  3449. </dl>
  3450. <a name="Audio-Options"></a>
  3451. <h2 class="section"><a href="ffmpeg-all.html#toc-Audio-Options">5.7 Audio Options</a></h2>
  3452. <dl compact="compact">
  3453. <dt>&lsquo;<samp>-aframes <var>number</var> (<em>output</em>)</samp>&rsquo;</dt>
  3454. <dd><p>Set the number of audio frames to output. This is an obsolete alias for
  3455. <code>-frames:a</code>, which you should use instead.
  3456. </p></dd>
  3457. <dt>&lsquo;<samp>-ar[:<var>stream_specifier</var>] <var>freq</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  3458. <dd><p>Set the audio sampling frequency. For output streams it is set by
  3459. default to the frequency of the corresponding input stream. For input
  3460. streams this option only makes sense for audio grabbing devices and raw
  3461. demuxers and is mapped to the corresponding demuxer options.
  3462. </p></dd>
  3463. <dt>&lsquo;<samp>-aq <var>q</var> (<em>output</em>)</samp>&rsquo;</dt>
  3464. <dd><p>Set the audio quality (codec-specific, VBR). This is an alias for -q:a.
  3465. </p></dd>
  3466. <dt>&lsquo;<samp>-ac[:<var>stream_specifier</var>] <var>channels</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  3467. <dd><p>Set the number of audio channels. For output streams it is set by
  3468. default to the number of input audio channels. For input streams
  3469. this option only makes sense for audio grabbing devices and raw demuxers
  3470. and is mapped to the corresponding demuxer options.
  3471. </p></dd>
  3472. <dt>&lsquo;<samp>-an (<em>input/output</em>)</samp>&rsquo;</dt>
  3473. <dd><p>As an input option, blocks all audio streams of a file from being filtered or
  3474. being automatically selected or mapped for any output. See <code>-discard</code>
  3475. option to disable streams individually.
  3476. </p>
  3477. <p>As an output option, disables audio recording i.e. automatic selection or
  3478. mapping of any audio stream. For full manual control see the <code>-map</code>
  3479. option.
  3480. </p></dd>
  3481. <dt>&lsquo;<samp>-acodec <var>codec</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  3482. <dd><p>Set the audio codec. This is an alias for <code>-codec:a</code>.
  3483. </p></dd>
  3484. <dt>&lsquo;<samp>-sample_fmt[:<var>stream_specifier</var>] <var>sample_fmt</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3485. <dd><p>Set the audio sample format. Use <code>-sample_fmts</code> to get a list
  3486. of supported sample formats.
  3487. </p>
  3488. </dd>
  3489. <dt>&lsquo;<samp>-af <var>filtergraph</var> (<em>output</em>)</samp>&rsquo;</dt>
  3490. <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
  3491. filter the stream.
  3492. </p>
  3493. <p>This is an alias for <code>-filter:a</code>, see the <a href="#filter_005foption">-filter option</a>.
  3494. </p></dd>
  3495. </dl>
  3496. <a name="Advanced-Audio-options"></a>
  3497. <h2 class="section"><a href="ffmpeg-all.html#toc-Advanced-Audio-options">5.8 Advanced Audio options</a></h2>
  3498. <dl compact="compact">
  3499. <dt>&lsquo;<samp>-atag <var>fourcc/tag</var> (<em>output</em>)</samp>&rsquo;</dt>
  3500. <dd><p>Force audio tag/fourcc. This is an alias for <code>-tag:a</code>.
  3501. </p></dd>
  3502. <dt>&lsquo;<samp>-absf <var>bitstream_filter</var></samp>&rsquo;</dt>
  3503. <dd><p>Deprecated, see -bsf
  3504. </p></dd>
  3505. <dt>&lsquo;<samp>-guess_layout_max <var>channels</var> (<em>input,per-stream</em>)</samp>&rsquo;</dt>
  3506. <dd><p>If some input channel layout is not known, try to guess only if it
  3507. corresponds to at most the specified number of channels. For example, 2
  3508. tells to <code>ffmpeg</code> to recognize 1 channel as mono and 2 channels as
  3509. stereo but not 6 channels as 5.1. The default is to always try to guess. Use
  3510. 0 to disable all guessing.
  3511. </p></dd>
  3512. </dl>
  3513. <a name="Subtitle-options"></a>
  3514. <h2 class="section"><a href="ffmpeg-all.html#toc-Subtitle-options">5.9 Subtitle options</a></h2>
  3515. <dl compact="compact">
  3516. <dt>&lsquo;<samp>-scodec <var>codec</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  3517. <dd><p>Set the subtitle codec. This is an alias for <code>-codec:s</code>.
  3518. </p></dd>
  3519. <dt>&lsquo;<samp>-sn (<em>input/output</em>)</samp>&rsquo;</dt>
  3520. <dd><p>As an input option, blocks all subtitle streams of a file from being filtered or
  3521. being automatically selected or mapped for any output. See <code>-discard</code>
  3522. option to disable streams individually.
  3523. </p>
  3524. <p>As an output option, disables subtitle recording i.e. automatic selection or
  3525. mapping of any subtitle stream. For full manual control see the <code>-map</code>
  3526. option.
  3527. </p></dd>
  3528. <dt>&lsquo;<samp>-sbsf <var>bitstream_filter</var></samp>&rsquo;</dt>
  3529. <dd><p>Deprecated, see -bsf
  3530. </p></dd>
  3531. </dl>
  3532. <a name="Advanced-Subtitle-options"></a>
  3533. <h2 class="section"><a href="ffmpeg-all.html#toc-Advanced-Subtitle-options">5.10 Advanced Subtitle options</a></h2>
  3534. <dl compact="compact">
  3535. <dt>&lsquo;<samp>-fix_sub_duration</samp>&rsquo;</dt>
  3536. <dd><p>Fix subtitles durations. For each subtitle, wait for the next packet in the
  3537. same stream and adjust the duration of the first to avoid overlap. This is
  3538. necessary with some subtitles codecs, especially DVB subtitles, because the
  3539. duration in the original packet is only a rough estimate and the end is
  3540. actually marked by an empty subtitle frame. Failing to use this option when
  3541. necessary can result in exaggerated durations or muxing failures due to
  3542. non-monotonic timestamps.
  3543. </p>
  3544. <p>Note that this option will delay the output of all data until the next
  3545. subtitle packet is decoded: it may increase memory consumption and latency a
  3546. lot.
  3547. </p>
  3548. </dd>
  3549. <dt>&lsquo;<samp>-canvas_size <var>size</var></samp>&rsquo;</dt>
  3550. <dd><p>Set the size of the canvas used to render subtitles.
  3551. </p>
  3552. </dd>
  3553. </dl>
  3554. <a name="Advanced-options"></a>
  3555. <h2 class="section"><a href="ffmpeg-all.html#toc-Advanced-options">5.11 Advanced options</a></h2>
  3556. <dl compact="compact">
  3557. <dt>&lsquo;<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>&rsquo;</dt>
  3558. <dd>
  3559. <p>Designate one or more input streams as a source for the output file. Each input
  3560. stream is identified by the input file index <var>input_file_id</var> and
  3561. the input stream index <var>input_stream_id</var> within the input
  3562. file. Both indices start at 0. If specified,
  3563. <var>sync_file_id</var>:<var>stream_specifier</var> sets which input stream
  3564. is used as a presentation sync reference.
  3565. </p>
  3566. <p>The first <code>-map</code> option on the command line specifies the
  3567. source for output stream 0, the second <code>-map</code> option specifies
  3568. the source for output stream 1, etc.
  3569. </p>
  3570. <p>A <code>-</code> character before the stream identifier creates a &quot;negative&quot; mapping.
  3571. It disables matching streams from already created mappings.
  3572. </p>
  3573. <p>A trailing <code>?</code> after the stream index will allow the map to be
  3574. optional: if the map matches no streams the map will be ignored instead
  3575. of failing. Note the map will still fail if an invalid input file index
  3576. is used; such as if the map refers to a non-existent input.
  3577. </p>
  3578. <p>An alternative <var>[linklabel]</var> form will map outputs from complex filter
  3579. graphs (see the &lsquo;<samp>-filter_complex</samp>&rsquo; option) to the output file.
  3580. <var>linklabel</var> must correspond to a defined output link label in the graph.
  3581. </p>
  3582. <p>For example, to map ALL streams from the first input file to output
  3583. </p><div class="example">
  3584. <pre class="example">ffmpeg -i INPUT -map 0 output
  3585. </pre></div>
  3586. <p>For example, if you have two audio streams in the first input file,
  3587. these streams are identified by &quot;0:0&quot; and &quot;0:1&quot;. You can use
  3588. <code>-map</code> to select which streams to place in an output file. For
  3589. example:
  3590. </p><div class="example">
  3591. <pre class="example">ffmpeg -i INPUT -map 0:1 out.wav
  3592. </pre></div>
  3593. <p>will map the input stream in &lsquo;<tt>INPUT</tt>&rsquo; identified by &quot;0:1&quot; to
  3594. the (single) output stream in &lsquo;<tt>out.wav</tt>&rsquo;.
  3595. </p>
  3596. <p>For example, to select the stream with index 2 from input file
  3597. &lsquo;<tt>a.mov</tt>&rsquo; (specified by the identifier &quot;0:2&quot;), and stream with
  3598. index 6 from input &lsquo;<tt>b.mov</tt>&rsquo; (specified by the identifier &quot;1:6&quot;),
  3599. and copy them to the output file &lsquo;<tt>out.mov</tt>&rsquo;:
  3600. </p><div class="example">
  3601. <pre class="example">ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
  3602. </pre></div>
  3603. <p>To select all video and the third audio stream from an input file:
  3604. </p><div class="example">
  3605. <pre class="example">ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT
  3606. </pre></div>
  3607. <p>To map all the streams except the second audio, use negative mappings
  3608. </p><div class="example">
  3609. <pre class="example">ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT
  3610. </pre></div>
  3611. <p>To map the video and audio streams from the first input, and using the
  3612. trailing <code>?</code>, ignore the audio mapping if no audio streams exist in
  3613. the first input:
  3614. </p><div class="example">
  3615. <pre class="example">ffmpeg -i INPUT -map 0:v -map 0:a? OUTPUT
  3616. </pre></div>
  3617. <p>To pick the English audio stream:
  3618. </p><div class="example">
  3619. <pre class="example">ffmpeg -i INPUT -map 0:m:language:eng OUTPUT
  3620. </pre></div>
  3621. <p>Note that using this option disables the default mappings for this output file.
  3622. </p>
  3623. </dd>
  3624. <dt>&lsquo;<samp>-ignore_unknown</samp>&rsquo;</dt>
  3625. <dd><p>Ignore input streams with unknown type instead of failing if copying
  3626. such streams is attempted.
  3627. </p>
  3628. </dd>
  3629. <dt>&lsquo;<samp>-copy_unknown</samp>&rsquo;</dt>
  3630. <dd><p>Allow input streams with unknown type to be copied instead of failing if copying
  3631. such streams is attempted.
  3632. </p>
  3633. </dd>
  3634. <dt>&lsquo;<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>&rsquo;</dt>
  3635. <dd><p>Map an audio channel from a given input to an output. If
  3636. <var>output_file_id</var>.<var>stream_specifier</var> is not set, the audio channel will
  3637. be mapped on all the audio streams.
  3638. </p>
  3639. <p>Using &quot;-1&quot; instead of
  3640. <var>input_file_id</var>.<var>stream_specifier</var>.<var>channel_id</var> will map a muted
  3641. channel.
  3642. </p>
  3643. <p>A trailing <code>?</code> will allow the map_channel to be
  3644. optional: if the map_channel matches no channel the map_channel will be ignored instead
  3645. of failing.
  3646. </p>
  3647. <p>For example, assuming <var>INPUT</var> is a stereo audio file, you can switch the
  3648. two audio channels with the following command:
  3649. </p><div class="example">
  3650. <pre class="example">ffmpeg -i INPUT -map_channel 0.0.1 -map_channel 0.0.0 OUTPUT
  3651. </pre></div>
  3652. <p>If you want to mute the first channel and keep the second:
  3653. </p><div class="example">
  3654. <pre class="example">ffmpeg -i INPUT -map_channel -1 -map_channel 0.0.1 OUTPUT
  3655. </pre></div>
  3656. <p>The order of the &quot;-map_channel&quot; option specifies the order of the channels in
  3657. the output stream. The output channel layout is guessed from the number of
  3658. channels mapped (mono if one &quot;-map_channel&quot;, stereo if two, etc.). Using &quot;-ac&quot;
  3659. in combination of &quot;-map_channel&quot; makes the channel gain levels to be updated if
  3660. input and output channel layouts don&rsquo;t match (for instance two &quot;-map_channel&quot;
  3661. options and &quot;-ac 6&quot;).
  3662. </p>
  3663. <p>You can also extract each channel of an input to specific outputs; the following
  3664. command extracts two channels of the <var>INPUT</var> audio stream (file 0, stream 0)
  3665. to the respective <var>OUTPUT_CH0</var> and <var>OUTPUT_CH1</var> outputs:
  3666. </p><div class="example">
  3667. <pre class="example">ffmpeg -i INPUT -map_channel 0.0.0 OUTPUT_CH0 -map_channel 0.0.1 OUTPUT_CH1
  3668. </pre></div>
  3669. <p>The following example splits the channels of a stereo input into two separate
  3670. streams, which are put into the same output file:
  3671. </p><div class="example">
  3672. <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
  3673. </pre></div>
  3674. <p>Note that currently each output stream can only contain channels from a single
  3675. input stream; you can&rsquo;t for example use &quot;-map_channel&quot; to pick multiple input
  3676. audio channels contained in different streams (from the same or different files)
  3677. and merge them into a single output stream. It is therefore not currently
  3678. possible, for example, to turn two separate mono streams into a single stereo
  3679. stream. However splitting a stereo stream into two single channel mono streams
  3680. is possible.
  3681. </p>
  3682. <p>If you need this feature, a possible workaround is to use the <em>amerge</em>
  3683. filter. For example, if you need to merge a media (here &lsquo;<tt>input.mkv</tt>&rsquo;) with 2
  3684. mono audio streams into one single stereo channel audio stream (and keep the
  3685. video stream), you can use the following command:
  3686. </p><div class="example">
  3687. <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
  3688. </pre></div>
  3689. <p>To map the first two audio channels from the first input, and using the
  3690. trailing <code>?</code>, ignore the audio channel mapping if the first input is
  3691. mono instead of stereo:
  3692. </p><div class="example">
  3693. <pre class="example">ffmpeg -i INPUT -map_channel 0.0.0 -map_channel 0.0.1? OUTPUT
  3694. </pre></div>
  3695. </dd>
  3696. <dt>&lsquo;<samp>-map_metadata[:<var>metadata_spec_out</var>] <var>infile</var>[:<var>metadata_spec_in</var>] (<em>output,per-metadata</em>)</samp>&rsquo;</dt>
  3697. <dd><p>Set metadata information of the next output file from <var>infile</var>. Note that
  3698. those are file indices (zero-based), not filenames.
  3699. Optional <var>metadata_spec_in/out</var> parameters specify, which metadata to copy.
  3700. A metadata specifier can have the following forms:
  3701. </p><dl compact="compact">
  3702. <dt>&lsquo;<samp><var>g</var></samp>&rsquo;</dt>
  3703. <dd><p>global metadata, i.e. metadata that applies to the whole file
  3704. </p>
  3705. </dd>
  3706. <dt>&lsquo;<samp><var>s</var>[:<var>stream_spec</var>]</samp>&rsquo;</dt>
  3707. <dd><p>per-stream metadata. <var>stream_spec</var> is a stream specifier as described
  3708. in the <a href="#Stream-specifiers">Stream specifiers</a> chapter. In an input metadata specifier, the first
  3709. matching stream is copied from. In an output metadata specifier, all matching
  3710. streams are copied to.
  3711. </p>
  3712. </dd>
  3713. <dt>&lsquo;<samp><var>c</var>:<var>chapter_index</var></samp>&rsquo;</dt>
  3714. <dd><p>per-chapter metadata. <var>chapter_index</var> is the zero-based chapter index.
  3715. </p>
  3716. </dd>
  3717. <dt>&lsquo;<samp><var>p</var>:<var>program_index</var></samp>&rsquo;</dt>
  3718. <dd><p>per-program metadata. <var>program_index</var> is the zero-based program index.
  3719. </p></dd>
  3720. </dl>
  3721. <p>If metadata specifier is omitted, it defaults to global.
  3722. </p>
  3723. <p>By default, global metadata is copied from the first input file,
  3724. per-stream and per-chapter metadata is copied along with streams/chapters. These
  3725. default mappings are disabled by creating any mapping of the relevant type. A negative
  3726. file index can be used to create a dummy mapping that just disables automatic copying.
  3727. </p>
  3728. <p>For example to copy metadata from the first stream of the input file to global metadata
  3729. of the output file:
  3730. </p><div class="example">
  3731. <pre class="example">ffmpeg -i in.ogg -map_metadata 0:s:0 out.mp3
  3732. </pre></div>
  3733. <p>To do the reverse, i.e. copy global metadata to all audio streams:
  3734. </p><div class="example">
  3735. <pre class="example">ffmpeg -i in.mkv -map_metadata:s:a 0:g out.mkv
  3736. </pre></div>
  3737. <p>Note that simple <code>0</code> would work as well in this example, since global
  3738. metadata is assumed by default.
  3739. </p>
  3740. </dd>
  3741. <dt>&lsquo;<samp>-map_chapters <var>input_file_index</var> (<em>output</em>)</samp>&rsquo;</dt>
  3742. <dd><p>Copy chapters from input file with index <var>input_file_index</var> to the next
  3743. output file. If no chapter mapping is specified, then chapters are copied from
  3744. the first input file with at least one chapter. Use a negative file index to
  3745. disable any chapter copying.
  3746. </p>
  3747. </dd>
  3748. <dt>&lsquo;<samp>-benchmark (<em>global</em>)</samp>&rsquo;</dt>
  3749. <dd><p>Show benchmarking information at the end of an encode.
  3750. Shows real, system and user time used and maximum memory consumption.
  3751. Maximum memory consumption is not supported on all systems,
  3752. it will usually display as 0 if not supported.
  3753. </p></dd>
  3754. <dt>&lsquo;<samp>-benchmark_all (<em>global</em>)</samp>&rsquo;</dt>
  3755. <dd><p>Show benchmarking information during the encode.
  3756. Shows real, system and user time used in various steps (audio/video encode/decode).
  3757. </p></dd>
  3758. <dt>&lsquo;<samp>-timelimit <var>duration</var> (<em>global</em>)</samp>&rsquo;</dt>
  3759. <dd><p>Exit after ffmpeg has been running for <var>duration</var> seconds in CPU user time.
  3760. </p></dd>
  3761. <dt>&lsquo;<samp>-dump (<em>global</em>)</samp>&rsquo;</dt>
  3762. <dd><p>Dump each input packet to stderr.
  3763. </p></dd>
  3764. <dt>&lsquo;<samp>-hex (<em>global</em>)</samp>&rsquo;</dt>
  3765. <dd><p>When dumping packets, also dump the payload.
  3766. </p></dd>
  3767. <dt>&lsquo;<samp>-re (<em>input</em>)</samp>&rsquo;</dt>
  3768. <dd><p>Read input at native frame rate. Mainly used to simulate a grab device,
  3769. or live input stream (e.g. when reading from a file). Should not be used
  3770. with actual grab devices or live input streams (where it can cause packet
  3771. loss).
  3772. By default <code>ffmpeg</code> attempts to read the input(s) as fast as possible.
  3773. This option will slow down the reading of the input(s) to the native frame rate
  3774. of the input(s). It is useful for real-time output (e.g. live streaming).
  3775. </p></dd>
  3776. <dt>&lsquo;<samp>-vsync <var>parameter</var></samp>&rsquo;</dt>
  3777. <dd><p>Video sync method.
  3778. For compatibility reasons old values can be specified as numbers.
  3779. Newly added values will have to be specified as strings always.
  3780. </p>
  3781. <dl compact="compact">
  3782. <dt>&lsquo;<samp>0, passthrough</samp>&rsquo;</dt>
  3783. <dd><p>Each frame is passed with its timestamp from the demuxer to the muxer.
  3784. </p></dd>
  3785. <dt>&lsquo;<samp>1, cfr</samp>&rsquo;</dt>
  3786. <dd><p>Frames will be duplicated and dropped to achieve exactly the requested
  3787. constant frame rate.
  3788. </p></dd>
  3789. <dt>&lsquo;<samp>2, vfr</samp>&rsquo;</dt>
  3790. <dd><p>Frames are passed through with their timestamp or dropped so as to
  3791. prevent 2 frames from having the same timestamp.
  3792. </p></dd>
  3793. <dt>&lsquo;<samp>drop</samp>&rsquo;</dt>
  3794. <dd><p>As passthrough but destroys all timestamps, making the muxer generate
  3795. fresh timestamps based on frame-rate.
  3796. </p></dd>
  3797. <dt>&lsquo;<samp>-1, auto</samp>&rsquo;</dt>
  3798. <dd><p>Chooses between 1 and 2 depending on muxer capabilities. This is the
  3799. default method.
  3800. </p></dd>
  3801. </dl>
  3802. <p>Note that the timestamps may be further modified by the muxer, after this.
  3803. For example, in the case that the format option &lsquo;<samp>avoid_negative_ts</samp>&rsquo;
  3804. is enabled.
  3805. </p>
  3806. <p>With -map you can select from which stream the timestamps should be
  3807. taken. You can leave either video or audio unchanged and sync the
  3808. remaining stream(s) to the unchanged one.
  3809. </p>
  3810. </dd>
  3811. <dt>&lsquo;<samp>-frame_drop_threshold <var>parameter</var></samp>&rsquo;</dt>
  3812. <dd><p>Frame drop threshold, which specifies how much behind video frames can
  3813. be before they are dropped. In frame rate units, so 1.0 is one frame.
  3814. The default is -1.1. One possible usecase is to avoid framedrops in case
  3815. of noisy timestamps or to increase frame drop precision in case of exact
  3816. timestamps.
  3817. </p>
  3818. </dd>
  3819. <dt>&lsquo;<samp>-async <var>samples_per_second</var></samp>&rsquo;</dt>
  3820. <dd><p>Audio sync method. &quot;Stretches/squeezes&quot; the audio stream to match the timestamps,
  3821. the parameter is the maximum samples per second by which the audio is changed.
  3822. -async 1 is a special case where only the start of the audio stream is corrected
  3823. without any later correction.
  3824. </p>
  3825. <p>Note that the timestamps may be further modified by the muxer, after this.
  3826. For example, in the case that the format option &lsquo;<samp>avoid_negative_ts</samp>&rsquo;
  3827. is enabled.
  3828. </p>
  3829. <p>This option has been deprecated. Use the <code>aresample</code> audio filter instead.
  3830. </p>
  3831. </dd>
  3832. <dt>&lsquo;<samp>-copyts</samp>&rsquo;</dt>
  3833. <dd><p>Do not process input timestamps, but keep their values without trying
  3834. to sanitize them. In particular, do not remove the initial start time
  3835. offset value.
  3836. </p>
  3837. <p>Note that, depending on the &lsquo;<samp>vsync</samp>&rsquo; option or on specific muxer
  3838. processing (e.g. in case the format option &lsquo;<samp>avoid_negative_ts</samp>&rsquo;
  3839. is enabled) the output timestamps may mismatch with the input
  3840. timestamps even when this option is selected.
  3841. </p>
  3842. </dd>
  3843. <dt>&lsquo;<samp>-start_at_zero</samp>&rsquo;</dt>
  3844. <dd><p>When used with &lsquo;<samp>copyts</samp>&rsquo;, shift input timestamps so they start at zero.
  3845. </p>
  3846. <p>This means that using e.g. <code>-ss 50</code> will make output timestamps start at
  3847. 50 seconds, regardless of what timestamp the input file started at.
  3848. </p>
  3849. </dd>
  3850. <dt>&lsquo;<samp>-copytb <var>mode</var></samp>&rsquo;</dt>
  3851. <dd><p>Specify how to set the encoder timebase when stream copying. <var>mode</var> is an
  3852. integer numeric value, and can assume one of the following values:
  3853. </p>
  3854. <dl compact="compact">
  3855. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  3856. <dd><p>Use the demuxer timebase.
  3857. </p>
  3858. <p>The time base is copied to the output encoder from the corresponding input
  3859. demuxer. This is sometimes required to avoid non monotonically increasing
  3860. timestamps when copying video streams with variable frame rate.
  3861. </p>
  3862. </dd>
  3863. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  3864. <dd><p>Use the decoder timebase.
  3865. </p>
  3866. <p>The time base is copied to the output encoder from the corresponding input
  3867. decoder.
  3868. </p>
  3869. </dd>
  3870. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  3871. <dd><p>Try to make the choice automatically, in order to generate a sane output.
  3872. </p></dd>
  3873. </dl>
  3874. <p>Default value is -1.
  3875. </p>
  3876. </dd>
  3877. <dt>&lsquo;<samp>-enc_time_base[:<var>stream_specifier</var>] <var>timebase</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3878. <dd><p>Set the encoder timebase. <var>timebase</var> is a floating point number,
  3879. and can assume one of the following values:
  3880. </p>
  3881. <dl compact="compact">
  3882. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  3883. <dd><p>Assign a default value according to the media type.
  3884. </p>
  3885. <p>For video - use 1/framerate, for audio - use 1/samplerate.
  3886. </p>
  3887. </dd>
  3888. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  3889. <dd><p>Use the input stream timebase when possible.
  3890. </p>
  3891. <p>If an input stream is not available, the default timebase will be used.
  3892. </p>
  3893. </dd>
  3894. <dt>&lsquo;<samp>&gt;0</samp>&rsquo;</dt>
  3895. <dd><p>Use the provided number as the timebase.
  3896. </p>
  3897. <p>This field can be provided as a ratio of two integers (e.g. 1:24, 1:48000)
  3898. or as a floating point number (e.g. 0.04166, 2.0833e-5)
  3899. </p></dd>
  3900. </dl>
  3901. <p>Default value is 0.
  3902. </p>
  3903. </dd>
  3904. <dt>&lsquo;<samp>-bitexact (<em>input/output</em>)</samp>&rsquo;</dt>
  3905. <dd><p>Enable bitexact mode for (de)muxer and (de/en)coder
  3906. </p></dd>
  3907. <dt>&lsquo;<samp>-shortest (<em>output</em>)</samp>&rsquo;</dt>
  3908. <dd><p>Finish encoding when the shortest input stream ends.
  3909. </p></dd>
  3910. <dt>&lsquo;<samp>-dts_delta_threshold</samp>&rsquo;</dt>
  3911. <dd><p>Timestamp discontinuity delta threshold.
  3912. </p></dd>
  3913. <dt>&lsquo;<samp>-dts_error_threshold <var>seconds</var></samp>&rsquo;</dt>
  3914. <dd><p>Timestamp error delta threshold. This threshold use to discard crazy/damaged
  3915. timestamps and the default is 30 hours which is arbitrarily picked and quite
  3916. conservative.
  3917. </p></dd>
  3918. <dt>&lsquo;<samp>-muxdelay <var>seconds</var> (<em>output</em>)</samp>&rsquo;</dt>
  3919. <dd><p>Set the maximum demux-decode delay.
  3920. </p></dd>
  3921. <dt>&lsquo;<samp>-muxpreload <var>seconds</var> (<em>output</em>)</samp>&rsquo;</dt>
  3922. <dd><p>Set the initial demux-decode delay.
  3923. </p></dd>
  3924. <dt>&lsquo;<samp>-streamid <var>output-stream-index</var>:<var>new-value</var> (<em>output</em>)</samp>&rsquo;</dt>
  3925. <dd><p>Assign a new stream-id value to an output stream. This option should be
  3926. specified prior to the output filename to which it applies.
  3927. For the situation where multiple output files exist, a streamid
  3928. may be reassigned to a different value.
  3929. </p>
  3930. <p>For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
  3931. an output mpegts file:
  3932. </p><div class="example">
  3933. <pre class="example">ffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts
  3934. </pre></div>
  3935. </dd>
  3936. <dt>&lsquo;<samp>-bsf[:<var>stream_specifier</var>] <var>bitstream_filters</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3937. <dd><p>Set bitstream filters for matching streams. <var>bitstream_filters</var> is
  3938. a comma-separated list of bitstream filters. Use the <code>-bsfs</code> option
  3939. to get the list of bitstream filters.
  3940. </p><div class="example">
  3941. <pre class="example">ffmpeg -i h264.mp4 -c:v copy -bsf:v h264_mp4toannexb -an out.h264
  3942. </pre></div>
  3943. <div class="example">
  3944. <pre class="example">ffmpeg -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt
  3945. </pre></div>
  3946. </dd>
  3947. <dt>&lsquo;<samp>-tag[:<var>stream_specifier</var>] <var>codec_tag</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  3948. <dd><p>Force a tag/fourcc for matching streams.
  3949. </p>
  3950. </dd>
  3951. <dt>&lsquo;<samp>-timecode <var>hh</var>:<var>mm</var>:<var>ss</var>SEP<var>ff</var></samp>&rsquo;</dt>
  3952. <dd><p>Specify Timecode for writing. <var>SEP</var> is &rsquo;:&rsquo; for non drop timecode and &rsquo;;&rsquo;
  3953. (or &rsquo;.&rsquo;) for drop.
  3954. </p><div class="example">
  3955. <pre class="example">ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
  3956. </pre></div>
  3957. <p><a name="filter_005fcomplex_005foption"></a>
  3958. </p></dd>
  3959. <dt>&lsquo;<samp>-filter_complex <var>filtergraph</var> (<em>global</em>)</samp>&rsquo;</dt>
  3960. <dd><p>Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
  3961. outputs. For simple graphs &ndash; those with one input and one output of the same
  3962. type &ndash; see the &lsquo;<samp>-filter</samp>&rsquo; options. <var>filtergraph</var> is a description of
  3963. the filtergraph, as described in the &ldquo;Filtergraph syntax&rdquo; section of the
  3964. ffmpeg-filters manual.
  3965. </p>
  3966. <p>Input link labels must refer to input streams using the
  3967. <code>[file_index:stream_specifier]</code> syntax (i.e. the same as &lsquo;<samp>-map</samp>&rsquo;
  3968. uses). If <var>stream_specifier</var> matches multiple streams, the first one will be
  3969. used. An unlabeled input will be connected to the first unused input stream of
  3970. the matching type.
  3971. </p>
  3972. <p>Output link labels are referred to with &lsquo;<samp>-map</samp>&rsquo;. Unlabeled outputs are
  3973. added to the first output file.
  3974. </p>
  3975. <p>Note that with this option it is possible to use only lavfi sources without
  3976. normal input files.
  3977. </p>
  3978. <p>For example, to overlay an image over video
  3979. </p><div class="example">
  3980. <pre class="example">ffmpeg -i video.mkv -i image.png -filter_complex '[0:v][1:v]overlay[out]' -map
  3981. '[out]' out.mkv
  3982. </pre></div>
  3983. <p>Here <code>[0:v]</code> refers to the first video stream in the first input file,
  3984. which is linked to the first (main) input of the overlay filter. Similarly the
  3985. first video stream in the second input is linked to the second (overlay) input
  3986. of overlay.
  3987. </p>
  3988. <p>Assuming there is only one video stream in each input file, we can omit input
  3989. labels, so the above is equivalent to
  3990. </p><div class="example">
  3991. <pre class="example">ffmpeg -i video.mkv -i image.png -filter_complex 'overlay[out]' -map
  3992. '[out]' out.mkv
  3993. </pre></div>
  3994. <p>Furthermore we can omit the output label and the single output from the filter
  3995. graph will be added to the output file automatically, so we can simply write
  3996. </p><div class="example">
  3997. <pre class="example">ffmpeg -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
  3998. </pre></div>
  3999. <p>To generate 5 seconds of pure red video using lavfi <code>color</code> source:
  4000. </p><div class="example">
  4001. <pre class="example">ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
  4002. </pre></div>
  4003. </dd>
  4004. <dt>&lsquo;<samp>-filter_complex_threads <var>nb_threads</var> (<em>global</em>)</samp>&rsquo;</dt>
  4005. <dd><p>Defines how many threads are used to process a filter_complex graph.
  4006. Similar to filter_threads but used for <code>-filter_complex</code> graphs only.
  4007. The default is the number of available CPUs.
  4008. </p>
  4009. </dd>
  4010. <dt>&lsquo;<samp>-lavfi <var>filtergraph</var> (<em>global</em>)</samp>&rsquo;</dt>
  4011. <dd><p>Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
  4012. outputs. Equivalent to &lsquo;<samp>-filter_complex</samp>&rsquo;.
  4013. </p>
  4014. </dd>
  4015. <dt>&lsquo;<samp>-filter_complex_script <var>filename</var> (<em>global</em>)</samp>&rsquo;</dt>
  4016. <dd><p>This option is similar to &lsquo;<samp>-filter_complex</samp>&rsquo;, the only difference is that
  4017. its argument is the name of the file from which a complex filtergraph
  4018. description is to be read.
  4019. </p>
  4020. </dd>
  4021. <dt>&lsquo;<samp>-accurate_seek (<em>input</em>)</samp>&rsquo;</dt>
  4022. <dd><p>This option enables or disables accurate seeking in input files with the
  4023. &lsquo;<samp>-ss</samp>&rsquo; option. It is enabled by default, so seeking is accurate when
  4024. transcoding. Use &lsquo;<samp>-noaccurate_seek</samp>&rsquo; to disable it, which may be useful
  4025. e.g. when copying some streams and transcoding the others.
  4026. </p>
  4027. </dd>
  4028. <dt>&lsquo;<samp>-seek_timestamp (<em>input</em>)</samp>&rsquo;</dt>
  4029. <dd><p>This option enables or disables seeking by timestamp in input files with the
  4030. &lsquo;<samp>-ss</samp>&rsquo; option. It is disabled by default. If enabled, the argument
  4031. to the &lsquo;<samp>-ss</samp>&rsquo; option is considered an actual timestamp, and is not
  4032. offset by the start time of the file. This matters only for files which do
  4033. not start from timestamp 0, such as transport streams.
  4034. </p>
  4035. </dd>
  4036. <dt>&lsquo;<samp>-thread_queue_size <var>size</var> (<em>input</em>)</samp>&rsquo;</dt>
  4037. <dd><p>This option sets the maximum number of queued packets when reading from the
  4038. file or device. With low latency / high rate live streams, packets may be
  4039. discarded if they are not read in a timely manner; raising this value can
  4040. avoid it.
  4041. </p>
  4042. </dd>
  4043. <dt>&lsquo;<samp>-sdp_file <var>file</var> (<em>global</em>)</samp>&rsquo;</dt>
  4044. <dd><p>Print sdp information for an output stream to <var>file</var>.
  4045. This allows dumping sdp information when at least one output isn&rsquo;t an
  4046. rtp stream. (Requires at least one of the output formats to be rtp).
  4047. </p>
  4048. </dd>
  4049. <dt>&lsquo;<samp>-discard (<em>input</em>)</samp>&rsquo;</dt>
  4050. <dd><p>Allows discarding specific streams or frames from streams.
  4051. Any input stream can be fully discarded, using value <code>all</code> whereas
  4052. selective discarding of frames from a stream occurs at the demuxer
  4053. and is not supported by all demuxers.
  4054. </p>
  4055. <dl compact="compact">
  4056. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  4057. <dd><p>Discard no frame.
  4058. </p>
  4059. </dd>
  4060. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  4061. <dd><p>Default, which discards no frames.
  4062. </p>
  4063. </dd>
  4064. <dt>&lsquo;<samp>noref</samp>&rsquo;</dt>
  4065. <dd><p>Discard all non-reference frames.
  4066. </p>
  4067. </dd>
  4068. <dt>&lsquo;<samp>bidir</samp>&rsquo;</dt>
  4069. <dd><p>Discard all bidirectional frames.
  4070. </p>
  4071. </dd>
  4072. <dt>&lsquo;<samp>nokey</samp>&rsquo;</dt>
  4073. <dd><p>Discard all frames excepts keyframes.
  4074. </p>
  4075. </dd>
  4076. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  4077. <dd><p>Discard all frames.
  4078. </p></dd>
  4079. </dl>
  4080. </dd>
  4081. <dt>&lsquo;<samp>-abort_on <var>flags</var> (<em>global</em>)</samp>&rsquo;</dt>
  4082. <dd><p>Stop and abort on various conditions. The following flags are available:
  4083. </p>
  4084. <dl compact="compact">
  4085. <dt>&lsquo;<samp>empty_output</samp>&rsquo;</dt>
  4086. <dd><p>No packets were passed to the muxer, the output is empty.
  4087. </p></dd>
  4088. <dt>&lsquo;<samp>empty_output_stream</samp>&rsquo;</dt>
  4089. <dd><p>No packets were passed to the muxer in some of the output streams.
  4090. </p></dd>
  4091. </dl>
  4092. </dd>
  4093. <dt>&lsquo;<samp>-xerror (<em>global</em>)</samp>&rsquo;</dt>
  4094. <dd><p>Stop and exit on error
  4095. </p>
  4096. </dd>
  4097. <dt>&lsquo;<samp>-max_muxing_queue_size <var>packets</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  4098. <dd><p>When transcoding audio and/or video streams, ffmpeg will not begin writing into
  4099. the output until it has one packet for each such stream. While waiting for that
  4100. to happen, packets for other streams are buffered. This option sets the size of
  4101. this buffer, in packets, for the matching output stream.
  4102. </p>
  4103. <p>The default value of this option should be high enough for most uses, so only
  4104. touch this option if you are sure that you need it.
  4105. </p>
  4106. </dd>
  4107. </dl>
  4108. <p>As a special exception, you can use a bitmap subtitle stream as input: it
  4109. will be converted into a video with the same size as the largest video in
  4110. the file, or 720x576 if no video is present. Note that this is an
  4111. experimental and temporary solution. It will be removed once libavfilter has
  4112. proper support for subtitles.
  4113. </p>
  4114. <p>For example, to hardcode subtitles on top of a DVB-T recording stored in
  4115. MPEG-TS format, delaying the subtitles by 1 second:
  4116. </p><div class="example">
  4117. <pre class="example">ffmpeg -i input.ts -filter_complex \
  4118. '[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay' \
  4119. -sn -map '#0x2dc' output.mkv
  4120. </pre></div>
  4121. <p>(0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video,
  4122. audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too)
  4123. </p>
  4124. <a name="Preset-files"></a>
  4125. <h2 class="section"><a href="ffmpeg-all.html#toc-Preset-files">5.12 Preset files</a></h2>
  4126. <p>A preset file contains a sequence of <var>option</var>=<var>value</var> pairs,
  4127. one for each line, specifying a sequence of options which would be
  4128. awkward to specify on the command line. Lines starting with the hash
  4129. (&rsquo;#&rsquo;) character are ignored and are used to provide comments. Check
  4130. the &lsquo;<tt>presets</tt>&rsquo; directory in the FFmpeg source tree for examples.
  4131. </p>
  4132. <p>There are two types of preset files: ffpreset and avpreset files.
  4133. </p>
  4134. <a name="ffpreset-files"></a>
  4135. <h3 class="subsection"><a href="ffmpeg-all.html#toc-ffpreset-files">5.12.1 ffpreset files</a></h3>
  4136. <p>ffpreset files are specified with the <code>vpre</code>, <code>apre</code>,
  4137. <code>spre</code>, and <code>fpre</code> options. The <code>fpre</code> option takes the
  4138. filename of the preset instead of a preset name as input and can be
  4139. used for any kind of codec. For the <code>vpre</code>, <code>apre</code>, and
  4140. <code>spre</code> options, the options specified in a preset file are
  4141. applied to the currently selected codec of the same type as the preset
  4142. option.
  4143. </p>
  4144. <p>The argument passed to the <code>vpre</code>, <code>apre</code>, and <code>spre</code>
  4145. preset options identifies the preset file to use according to the
  4146. following rules:
  4147. </p>
  4148. <p>First ffmpeg searches for a file named <var>arg</var>.ffpreset in the
  4149. directories &lsquo;<tt>$FFMPEG_DATADIR</tt>&rsquo; (if set), and &lsquo;<tt>$HOME/.ffmpeg</tt>&rsquo;, and in
  4150. the datadir defined at configuration time (usually &lsquo;<tt>PREFIX/share/ffmpeg</tt>&rsquo;)
  4151. or in a &lsquo;<tt>ffpresets</tt>&rsquo; folder along the executable on win32,
  4152. in that order. For example, if the argument is <code>libvpx-1080p</code>, it will
  4153. search for the file &lsquo;<tt>libvpx-1080p.ffpreset</tt>&rsquo;.
  4154. </p>
  4155. <p>If no such file is found, then ffmpeg will search for a file named
  4156. <var>codec_name</var>-<var>arg</var>.ffpreset in the above-mentioned
  4157. directories, where <var>codec_name</var> is the name of the codec to which
  4158. the preset file options will be applied. For example, if you select
  4159. the video codec with <code>-vcodec libvpx</code> and use <code>-vpre 1080p</code>,
  4160. then it will search for the file &lsquo;<tt>libvpx-1080p.ffpreset</tt>&rsquo;.
  4161. </p>
  4162. <a name="avpreset-files"></a>
  4163. <h3 class="subsection"><a href="ffmpeg-all.html#toc-avpreset-files">5.12.2 avpreset files</a></h3>
  4164. <p>avpreset files are specified with the <code>pre</code> option. They work similar to
  4165. ffpreset files, but they only allow encoder- specific options. Therefore, an
  4166. <var>option</var>=<var>value</var> pair specifying an encoder cannot be used.
  4167. </p>
  4168. <p>When the <code>pre</code> option is specified, ffmpeg will look for files with the
  4169. suffix .avpreset in the directories &lsquo;<tt>$AVCONV_DATADIR</tt>&rsquo; (if set), and
  4170. &lsquo;<tt>$HOME/.avconv</tt>&rsquo;, and in the datadir defined at configuration time (usually
  4171. &lsquo;<tt>PREFIX/share/ffmpeg</tt>&rsquo;), in that order.
  4172. </p>
  4173. <p>First ffmpeg searches for a file named <var>codec_name</var>-<var>arg</var>.avpreset in
  4174. the above-mentioned directories, where <var>codec_name</var> is the name of the codec
  4175. to which the preset file options will be applied. For example, if you select the
  4176. video codec with <code>-vcodec libvpx</code> and use <code>-pre 1080p</code>, then it will
  4177. search for the file &lsquo;<tt>libvpx-1080p.avpreset</tt>&rsquo;.
  4178. </p>
  4179. <p>If no such file is found, then ffmpeg will search for a file named
  4180. <var>arg</var>.avpreset in the same directories.
  4181. </p>
  4182. <a name="Examples-57"></a>
  4183. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Examples-57">6 Examples</a></h1>
  4184. <a name="Video-and-Audio-grabbing"></a>
  4185. <h2 class="section"><a href="ffmpeg-all.html#toc-Video-and-Audio-grabbing">6.1 Video and Audio grabbing</a></h2>
  4186. <p>If you specify the input format and device then ffmpeg can grab video
  4187. and audio directly.
  4188. </p>
  4189. <div class="example">
  4190. <pre class="example">ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
  4191. </pre></div>
  4192. <p>Or with an ALSA audio source (mono input, card id 1) instead of OSS:
  4193. </p><div class="example">
  4194. <pre class="example">ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg
  4195. </pre></div>
  4196. <p>Note that you must activate the right video source and channel before
  4197. launching ffmpeg with any TV viewer such as
  4198. <a href="http://linux.bytesex.org/xawtv/">xawtv</a> by Gerd Knorr. You also
  4199. have to set the audio recording levels correctly with a
  4200. standard mixer.
  4201. </p>
  4202. <a name="X11-grabbing"></a>
  4203. <h2 class="section"><a href="ffmpeg-all.html#toc-X11-grabbing">6.2 X11 grabbing</a></h2>
  4204. <p>Grab the X11 display with ffmpeg via
  4205. </p>
  4206. <div class="example">
  4207. <pre class="example">ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0 /tmp/out.mpg
  4208. </pre></div>
  4209. <p>0.0 is display.screen number of your X11 server, same as
  4210. the DISPLAY environment variable.
  4211. </p>
  4212. <div class="example">
  4213. <pre class="example">ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0+10,20 /tmp/out.mpg
  4214. </pre></div>
  4215. <p>0.0 is display.screen number of your X11 server, same as the DISPLAY environment
  4216. variable. 10 is the x-offset and 20 the y-offset for the grabbing.
  4217. </p>
  4218. <a name="Video-and-Audio-file-format-conversion"></a>
  4219. <h2 class="section"><a href="ffmpeg-all.html#toc-Video-and-Audio-file-format-conversion">6.3 Video and Audio file format conversion</a></h2>
  4220. <p>Any supported file format and protocol can serve as input to ffmpeg:
  4221. </p>
  4222. <p>Examples:
  4223. </p><ul>
  4224. <li>
  4225. You can use YUV files as input:
  4226. <div class="example">
  4227. <pre class="example">ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
  4228. </pre></div>
  4229. <p>It will use the files:
  4230. </p><div class="example">
  4231. <pre class="example">/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
  4232. /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
  4233. </pre></div>
  4234. <p>The Y files use twice the resolution of the U and V files. They are
  4235. raw files, without header. They can be generated by all decent video
  4236. decoders. You must specify the size of the image with the &lsquo;<samp>-s</samp>&rsquo; option
  4237. if ffmpeg cannot guess it.
  4238. </p>
  4239. </li><li>
  4240. You can input from a raw YUV420P file:
  4241. <div class="example">
  4242. <pre class="example">ffmpeg -i /tmp/test.yuv /tmp/out.avi
  4243. </pre></div>
  4244. <p>test.yuv is a file containing raw YUV planar data. Each frame is composed
  4245. of the Y plane followed by the U and V planes at half vertical and
  4246. horizontal resolution.
  4247. </p>
  4248. </li><li>
  4249. You can output to a raw YUV420P file:
  4250. <div class="example">
  4251. <pre class="example">ffmpeg -i mydivx.avi hugefile.yuv
  4252. </pre></div>
  4253. </li><li>
  4254. You can set several input files and output files:
  4255. <div class="example">
  4256. <pre class="example">ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
  4257. </pre></div>
  4258. <p>Converts the audio file a.wav and the raw YUV video file a.yuv
  4259. to MPEG file a.mpg.
  4260. </p>
  4261. </li><li>
  4262. You can also do audio and video conversions at the same time:
  4263. <div class="example">
  4264. <pre class="example">ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
  4265. </pre></div>
  4266. <p>Converts a.wav to MPEG audio at 22050 Hz sample rate.
  4267. </p>
  4268. </li><li>
  4269. You can encode to several formats at the same time and define a
  4270. mapping from input stream to output streams:
  4271. <div class="example">
  4272. <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
  4273. </pre></div>
  4274. <p>Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. &rsquo;-map
  4275. file:index&rsquo; specifies which input stream is used for each output
  4276. stream, in the order of the definition of output streams.
  4277. </p>
  4278. </li><li>
  4279. You can transcode decrypted VOBs:
  4280. <div class="example">
  4281. <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
  4282. </pre></div>
  4283. <p>This is a typical DVD ripping example; the input is a VOB file, the
  4284. output an AVI file with MPEG-4 video and MP3 audio. Note that in this
  4285. command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
  4286. GOP size is 300 which means one intra frame every 10 seconds for 29.97fps
  4287. input video. Furthermore, the audio stream is MP3-encoded so you need
  4288. to enable LAME support by passing <code>--enable-libmp3lame</code> to configure.
  4289. The mapping is particularly useful for DVD transcoding
  4290. to get the desired audio language.
  4291. </p>
  4292. <p>NOTE: To see the supported input formats, use <code>ffmpeg -demuxers</code>.
  4293. </p>
  4294. </li><li>
  4295. You can extract images from a video, or create a video from many images:
  4296. <p>For extracting images from a video:
  4297. </p><div class="example">
  4298. <pre class="example">ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
  4299. </pre></div>
  4300. <p>This will extract one video frame per second from the video and will
  4301. output them in files named &lsquo;<tt>foo-001.jpeg</tt>&rsquo;, &lsquo;<tt>foo-002.jpeg</tt>&rsquo;,
  4302. etc. Images will be rescaled to fit the new WxH values.
  4303. </p>
  4304. <p>If you want to extract just a limited number of frames, you can use the
  4305. above command in combination with the <code>-frames:v</code> or <code>-t</code> option,
  4306. or in combination with -ss to start extracting from a certain point in time.
  4307. </p>
  4308. <p>For creating a video from many images:
  4309. </p><div class="example">
  4310. <pre class="example">ffmpeg -f image2 -framerate 12 -i foo-%03d.jpeg -s WxH foo.avi
  4311. </pre></div>
  4312. <p>The syntax <code>foo-%03d.jpeg</code> specifies to use a decimal number
  4313. composed of three digits padded with zeroes to express the sequence
  4314. number. It is the same syntax supported by the C printf function, but
  4315. only formats accepting a normal integer are suitable.
  4316. </p>
  4317. <p>When importing an image sequence, -i also supports expanding
  4318. shell-like wildcard patterns (globbing) internally, by selecting the
  4319. image2-specific <code>-pattern_type glob</code> option.
  4320. </p>
  4321. <p>For example, for creating a video from filenames matching the glob pattern
  4322. <code>foo-*.jpeg</code>:
  4323. </p><div class="example">
  4324. <pre class="example">ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi
  4325. </pre></div>
  4326. </li><li>
  4327. You can put many streams of the same type in the output:
  4328. <div class="example">
  4329. <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
  4330. </pre></div>
  4331. <p>The resulting output file &lsquo;<tt>test12.nut</tt>&rsquo; will contain the first four streams
  4332. from the input files in reverse order.
  4333. </p>
  4334. </li><li>
  4335. To force CBR video output:
  4336. <div class="example">
  4337. <pre class="example">ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
  4338. </pre></div>
  4339. </li><li>
  4340. The four options lmin, lmax, mblmin and mblmax use &rsquo;lambda&rsquo; units,
  4341. but you may use the QP2LAMBDA constant to easily convert from &rsquo;q&rsquo; units:
  4342. <div class="example">
  4343. <pre class="example">ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
  4344. </pre></div>
  4345. </li></ul>
  4346. <a name="Syntax-2"></a>
  4347. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Syntax-2">7 Syntax</a></h1>
  4348. <p>This section documents the syntax and formats employed by the FFmpeg
  4349. libraries and tools.
  4350. </p>
  4351. <p><a name="quoting_005fand_005fescaping"></a>
  4352. </p><a name="Quoting-and-escaping"></a>
  4353. <h2 class="section"><a href="ffmpeg-all.html#toc-Quoting-and-escaping">7.1 Quoting and escaping</a></h2>
  4354. <p>FFmpeg adopts the following quoting and escaping mechanism, unless
  4355. explicitly specified. The following rules are applied:
  4356. </p>
  4357. <ul>
  4358. <li>
  4359. &lsquo;<samp>'</samp>&rsquo; and &lsquo;<samp>\</samp>&rsquo; are special characters (respectively used for
  4360. quoting and escaping). In addition to them, there might be other
  4361. special characters depending on the specific syntax where the escaping
  4362. and quoting are employed.
  4363. </li><li>
  4364. A special character is escaped by prefixing it with a &lsquo;<samp>\</samp>&rsquo;.
  4365. </li><li>
  4366. All characters enclosed between &lsquo;<samp>''</samp>&rsquo; are included literally in the
  4367. parsed string. The quote character &lsquo;<samp>'</samp>&rsquo; itself cannot be quoted,
  4368. so you may need to close the quote and escape it.
  4369. </li><li>
  4370. Leading and trailing whitespaces, unless escaped or quoted, are
  4371. removed from the parsed string.
  4372. </li></ul>
  4373. <p>Note that you may need to add a second level of escaping when using
  4374. the command line or a script, which depends on the syntax of the
  4375. adopted shell language.
  4376. </p>
  4377. <p>The function <code>av_get_token</code> defined in
  4378. &lsquo;<tt>libavutil/avstring.h</tt>&rsquo; can be used to parse a token quoted or
  4379. escaped according to the rules defined above.
  4380. </p>
  4381. <p>The tool &lsquo;<tt>tools/ffescape</tt>&rsquo; in the FFmpeg source tree can be used
  4382. to automatically quote or escape a string in a script.
  4383. </p>
  4384. <a name="Examples-3"></a>
  4385. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-3">7.1.1 Examples</a></h3>
  4386. <ul>
  4387. <li>
  4388. Escape the string <code>Crime d'Amour</code> containing the <code>'</code> special
  4389. character:
  4390. <div class="example">
  4391. <pre class="example">Crime d\'Amour
  4392. </pre></div>
  4393. </li><li>
  4394. The string above contains a quote, so the <code>'</code> needs to be escaped
  4395. when quoting it:
  4396. <div class="example">
  4397. <pre class="example">'Crime d'\''Amour'
  4398. </pre></div>
  4399. </li><li>
  4400. Include leading or trailing whitespaces using quoting:
  4401. <div class="example">
  4402. <pre class="example">' this string starts and ends with whitespaces '
  4403. </pre></div>
  4404. </li><li>
  4405. Escaping and quoting can be mixed together:
  4406. <div class="example">
  4407. <pre class="example">' The string '\'string\'' is a string '
  4408. </pre></div>
  4409. </li><li>
  4410. To include a literal &lsquo;<samp>\</samp>&rsquo; you can use either escaping or quoting:
  4411. <div class="example">
  4412. <pre class="example">'c:\foo' can be written as c:\\foo
  4413. </pre></div>
  4414. </li></ul>
  4415. <p><a name="date-syntax"></a>
  4416. </p><a name="Date"></a>
  4417. <h2 class="section"><a href="ffmpeg-all.html#toc-Date">7.2 Date</a></h2>
  4418. <p>The accepted syntax is:
  4419. </p><div class="example">
  4420. <pre class="example">[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
  4421. now
  4422. </pre></div>
  4423. <p>If the value is &quot;now&quot; it takes the current time.
  4424. </p>
  4425. <p>Time is local time unless Z is appended, in which case it is
  4426. interpreted as UTC.
  4427. If the year-month-day part is not specified it takes the current
  4428. year-month-day.
  4429. </p>
  4430. <p><a name="time-duration-syntax"></a>
  4431. </p><a name="Time-duration"></a>
  4432. <h2 class="section"><a href="ffmpeg-all.html#toc-Time-duration">7.3 Time duration</a></h2>
  4433. <p>There are two accepted syntaxes for expressing time duration.
  4434. </p>
  4435. <div class="example">
  4436. <pre class="example">[-][<var>HH</var>:]<var>MM</var>:<var>SS</var>[.<var>m</var>...]
  4437. </pre></div>
  4438. <p><var>HH</var> expresses the number of hours, <var>MM</var> the number of minutes
  4439. for a maximum of 2 digits, and <var>SS</var> the number of seconds for a
  4440. maximum of 2 digits. The <var>m</var> at the end expresses decimal value for
  4441. <var>SS</var>.
  4442. </p>
  4443. <p><em>or</em>
  4444. </p>
  4445. <div class="example">
  4446. <pre class="example">[-]<var>S</var>+[.<var>m</var>...]
  4447. </pre></div>
  4448. <p><var>S</var> expresses the number of seconds, with the optional decimal part
  4449. <var>m</var>.
  4450. </p>
  4451. <p>In both expressions, the optional &lsquo;<samp>-</samp>&rsquo; indicates negative duration.
  4452. </p>
  4453. <a name="Examples-149"></a>
  4454. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-149">7.3.1 Examples</a></h3>
  4455. <p>The following examples are all valid time duration:
  4456. </p>
  4457. <dl compact="compact">
  4458. <dt>&lsquo;<samp>55</samp>&rsquo;</dt>
  4459. <dd><p>55 seconds
  4460. </p>
  4461. </dd>
  4462. <dt>&lsquo;<samp>0.2</samp>&rsquo;</dt>
  4463. <dd><p>0.2 seconds
  4464. </p>
  4465. </dd>
  4466. <dt>&lsquo;<samp>200ms</samp>&rsquo;</dt>
  4467. <dd><p>200 milliseconds, that&rsquo;s 0.2s
  4468. </p>
  4469. </dd>
  4470. <dt>&lsquo;<samp>200000us</samp>&rsquo;</dt>
  4471. <dd><p>200000 microseconds, that&rsquo;s 0.2s
  4472. </p>
  4473. </dd>
  4474. <dt>&lsquo;<samp>12:03:45</samp>&rsquo;</dt>
  4475. <dd><p>12 hours, 03 minutes and 45 seconds
  4476. </p>
  4477. </dd>
  4478. <dt>&lsquo;<samp>23.189</samp>&rsquo;</dt>
  4479. <dd><p>23.189 seconds
  4480. </p></dd>
  4481. </dl>
  4482. <p><a name="video-size-syntax"></a>
  4483. </p><a name="Video-size"></a>
  4484. <h2 class="section"><a href="ffmpeg-all.html#toc-Video-size">7.4 Video size</a></h2>
  4485. <p>Specify the size of the sourced video, it may be a string of the form
  4486. <var>width</var>x<var>height</var>, or the name of a size abbreviation.
  4487. </p>
  4488. <p>The following abbreviations are recognized:
  4489. </p><dl compact="compact">
  4490. <dt>&lsquo;<samp>ntsc</samp>&rsquo;</dt>
  4491. <dd><p>720x480
  4492. </p></dd>
  4493. <dt>&lsquo;<samp>pal</samp>&rsquo;</dt>
  4494. <dd><p>720x576
  4495. </p></dd>
  4496. <dt>&lsquo;<samp>qntsc</samp>&rsquo;</dt>
  4497. <dd><p>352x240
  4498. </p></dd>
  4499. <dt>&lsquo;<samp>qpal</samp>&rsquo;</dt>
  4500. <dd><p>352x288
  4501. </p></dd>
  4502. <dt>&lsquo;<samp>sntsc</samp>&rsquo;</dt>
  4503. <dd><p>640x480
  4504. </p></dd>
  4505. <dt>&lsquo;<samp>spal</samp>&rsquo;</dt>
  4506. <dd><p>768x576
  4507. </p></dd>
  4508. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  4509. <dd><p>352x240
  4510. </p></dd>
  4511. <dt>&lsquo;<samp>ntsc-film</samp>&rsquo;</dt>
  4512. <dd><p>352x240
  4513. </p></dd>
  4514. <dt>&lsquo;<samp>sqcif</samp>&rsquo;</dt>
  4515. <dd><p>128x96
  4516. </p></dd>
  4517. <dt>&lsquo;<samp>qcif</samp>&rsquo;</dt>
  4518. <dd><p>176x144
  4519. </p></dd>
  4520. <dt>&lsquo;<samp>cif</samp>&rsquo;</dt>
  4521. <dd><p>352x288
  4522. </p></dd>
  4523. <dt>&lsquo;<samp>4cif</samp>&rsquo;</dt>
  4524. <dd><p>704x576
  4525. </p></dd>
  4526. <dt>&lsquo;<samp>16cif</samp>&rsquo;</dt>
  4527. <dd><p>1408x1152
  4528. </p></dd>
  4529. <dt>&lsquo;<samp>qqvga</samp>&rsquo;</dt>
  4530. <dd><p>160x120
  4531. </p></dd>
  4532. <dt>&lsquo;<samp>qvga</samp>&rsquo;</dt>
  4533. <dd><p>320x240
  4534. </p></dd>
  4535. <dt>&lsquo;<samp>vga</samp>&rsquo;</dt>
  4536. <dd><p>640x480
  4537. </p></dd>
  4538. <dt>&lsquo;<samp>svga</samp>&rsquo;</dt>
  4539. <dd><p>800x600
  4540. </p></dd>
  4541. <dt>&lsquo;<samp>xga</samp>&rsquo;</dt>
  4542. <dd><p>1024x768
  4543. </p></dd>
  4544. <dt>&lsquo;<samp>uxga</samp>&rsquo;</dt>
  4545. <dd><p>1600x1200
  4546. </p></dd>
  4547. <dt>&lsquo;<samp>qxga</samp>&rsquo;</dt>
  4548. <dd><p>2048x1536
  4549. </p></dd>
  4550. <dt>&lsquo;<samp>sxga</samp>&rsquo;</dt>
  4551. <dd><p>1280x1024
  4552. </p></dd>
  4553. <dt>&lsquo;<samp>qsxga</samp>&rsquo;</dt>
  4554. <dd><p>2560x2048
  4555. </p></dd>
  4556. <dt>&lsquo;<samp>hsxga</samp>&rsquo;</dt>
  4557. <dd><p>5120x4096
  4558. </p></dd>
  4559. <dt>&lsquo;<samp>wvga</samp>&rsquo;</dt>
  4560. <dd><p>852x480
  4561. </p></dd>
  4562. <dt>&lsquo;<samp>wxga</samp>&rsquo;</dt>
  4563. <dd><p>1366x768
  4564. </p></dd>
  4565. <dt>&lsquo;<samp>wsxga</samp>&rsquo;</dt>
  4566. <dd><p>1600x1024
  4567. </p></dd>
  4568. <dt>&lsquo;<samp>wuxga</samp>&rsquo;</dt>
  4569. <dd><p>1920x1200
  4570. </p></dd>
  4571. <dt>&lsquo;<samp>woxga</samp>&rsquo;</dt>
  4572. <dd><p>2560x1600
  4573. </p></dd>
  4574. <dt>&lsquo;<samp>wqsxga</samp>&rsquo;</dt>
  4575. <dd><p>3200x2048
  4576. </p></dd>
  4577. <dt>&lsquo;<samp>wquxga</samp>&rsquo;</dt>
  4578. <dd><p>3840x2400
  4579. </p></dd>
  4580. <dt>&lsquo;<samp>whsxga</samp>&rsquo;</dt>
  4581. <dd><p>6400x4096
  4582. </p></dd>
  4583. <dt>&lsquo;<samp>whuxga</samp>&rsquo;</dt>
  4584. <dd><p>7680x4800
  4585. </p></dd>
  4586. <dt>&lsquo;<samp>cga</samp>&rsquo;</dt>
  4587. <dd><p>320x200
  4588. </p></dd>
  4589. <dt>&lsquo;<samp>ega</samp>&rsquo;</dt>
  4590. <dd><p>640x350
  4591. </p></dd>
  4592. <dt>&lsquo;<samp>hd480</samp>&rsquo;</dt>
  4593. <dd><p>852x480
  4594. </p></dd>
  4595. <dt>&lsquo;<samp>hd720</samp>&rsquo;</dt>
  4596. <dd><p>1280x720
  4597. </p></dd>
  4598. <dt>&lsquo;<samp>hd1080</samp>&rsquo;</dt>
  4599. <dd><p>1920x1080
  4600. </p></dd>
  4601. <dt>&lsquo;<samp>2k</samp>&rsquo;</dt>
  4602. <dd><p>2048x1080
  4603. </p></dd>
  4604. <dt>&lsquo;<samp>2kflat</samp>&rsquo;</dt>
  4605. <dd><p>1998x1080
  4606. </p></dd>
  4607. <dt>&lsquo;<samp>2kscope</samp>&rsquo;</dt>
  4608. <dd><p>2048x858
  4609. </p></dd>
  4610. <dt>&lsquo;<samp>4k</samp>&rsquo;</dt>
  4611. <dd><p>4096x2160
  4612. </p></dd>
  4613. <dt>&lsquo;<samp>4kflat</samp>&rsquo;</dt>
  4614. <dd><p>3996x2160
  4615. </p></dd>
  4616. <dt>&lsquo;<samp>4kscope</samp>&rsquo;</dt>
  4617. <dd><p>4096x1716
  4618. </p></dd>
  4619. <dt>&lsquo;<samp>nhd</samp>&rsquo;</dt>
  4620. <dd><p>640x360
  4621. </p></dd>
  4622. <dt>&lsquo;<samp>hqvga</samp>&rsquo;</dt>
  4623. <dd><p>240x160
  4624. </p></dd>
  4625. <dt>&lsquo;<samp>wqvga</samp>&rsquo;</dt>
  4626. <dd><p>400x240
  4627. </p></dd>
  4628. <dt>&lsquo;<samp>fwqvga</samp>&rsquo;</dt>
  4629. <dd><p>432x240
  4630. </p></dd>
  4631. <dt>&lsquo;<samp>hvga</samp>&rsquo;</dt>
  4632. <dd><p>480x320
  4633. </p></dd>
  4634. <dt>&lsquo;<samp>qhd</samp>&rsquo;</dt>
  4635. <dd><p>960x540
  4636. </p></dd>
  4637. <dt>&lsquo;<samp>2kdci</samp>&rsquo;</dt>
  4638. <dd><p>2048x1080
  4639. </p></dd>
  4640. <dt>&lsquo;<samp>4kdci</samp>&rsquo;</dt>
  4641. <dd><p>4096x2160
  4642. </p></dd>
  4643. <dt>&lsquo;<samp>uhd2160</samp>&rsquo;</dt>
  4644. <dd><p>3840x2160
  4645. </p></dd>
  4646. <dt>&lsquo;<samp>uhd4320</samp>&rsquo;</dt>
  4647. <dd><p>7680x4320
  4648. </p></dd>
  4649. </dl>
  4650. <p><a name="video-rate-syntax"></a>
  4651. </p><a name="Video-rate"></a>
  4652. <h2 class="section"><a href="ffmpeg-all.html#toc-Video-rate">7.5 Video rate</a></h2>
  4653. <p>Specify the frame rate of a video, expressed as the number of frames
  4654. generated per second. It has to be a string in the format
  4655. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
  4656. number or a valid video frame rate abbreviation.
  4657. </p>
  4658. <p>The following abbreviations are recognized:
  4659. </p><dl compact="compact">
  4660. <dt>&lsquo;<samp>ntsc</samp>&rsquo;</dt>
  4661. <dd><p>30000/1001
  4662. </p></dd>
  4663. <dt>&lsquo;<samp>pal</samp>&rsquo;</dt>
  4664. <dd><p>25/1
  4665. </p></dd>
  4666. <dt>&lsquo;<samp>qntsc</samp>&rsquo;</dt>
  4667. <dd><p>30000/1001
  4668. </p></dd>
  4669. <dt>&lsquo;<samp>qpal</samp>&rsquo;</dt>
  4670. <dd><p>25/1
  4671. </p></dd>
  4672. <dt>&lsquo;<samp>sntsc</samp>&rsquo;</dt>
  4673. <dd><p>30000/1001
  4674. </p></dd>
  4675. <dt>&lsquo;<samp>spal</samp>&rsquo;</dt>
  4676. <dd><p>25/1
  4677. </p></dd>
  4678. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  4679. <dd><p>24/1
  4680. </p></dd>
  4681. <dt>&lsquo;<samp>ntsc-film</samp>&rsquo;</dt>
  4682. <dd><p>24000/1001
  4683. </p></dd>
  4684. </dl>
  4685. <p><a name="ratio-syntax"></a>
  4686. </p><a name="Ratio"></a>
  4687. <h2 class="section"><a href="ffmpeg-all.html#toc-Ratio">7.6 Ratio</a></h2>
  4688. <p>A ratio can be expressed as an expression, or in the form
  4689. <var>numerator</var>:<var>denominator</var>.
  4690. </p>
  4691. <p>Note that a ratio with infinite (1/0) or negative value is
  4692. considered valid, so you should check on the returned value if you
  4693. want to exclude those values.
  4694. </p>
  4695. <p>The undefined value can be expressed using the &quot;0:0&quot; string.
  4696. </p>
  4697. <p><a name="color-syntax"></a>
  4698. </p><a name="Color"></a>
  4699. <h2 class="section"><a href="ffmpeg-all.html#toc-Color">7.7 Color</a></h2>
  4700. <p>It can be the name of a color as defined below (case insensitive match) or a
  4701. <code>[0x|#]RRGGBB[AA]</code> sequence, possibly followed by @ and a string
  4702. representing the alpha component.
  4703. </p>
  4704. <p>The alpha component may be a string composed by &quot;0x&quot; followed by an
  4705. hexadecimal number or a decimal number between 0.0 and 1.0, which
  4706. represents the opacity value (&lsquo;<samp>0x00</samp>&rsquo; or &lsquo;<samp>0.0</samp>&rsquo; means completely
  4707. transparent, &lsquo;<samp>0xff</samp>&rsquo; or &lsquo;<samp>1.0</samp>&rsquo; completely opaque). If the alpha
  4708. component is not specified then &lsquo;<samp>0xff</samp>&rsquo; is assumed.
  4709. </p>
  4710. <p>The string &lsquo;<samp>random</samp>&rsquo; will result in a random color.
  4711. </p>
  4712. <p>The following names of colors are recognized:
  4713. </p><dl compact="compact">
  4714. <dt>&lsquo;<samp>AliceBlue</samp>&rsquo;</dt>
  4715. <dd><p>0xF0F8FF
  4716. </p></dd>
  4717. <dt>&lsquo;<samp>AntiqueWhite</samp>&rsquo;</dt>
  4718. <dd><p>0xFAEBD7
  4719. </p></dd>
  4720. <dt>&lsquo;<samp>Aqua</samp>&rsquo;</dt>
  4721. <dd><p>0x00FFFF
  4722. </p></dd>
  4723. <dt>&lsquo;<samp>Aquamarine</samp>&rsquo;</dt>
  4724. <dd><p>0x7FFFD4
  4725. </p></dd>
  4726. <dt>&lsquo;<samp>Azure</samp>&rsquo;</dt>
  4727. <dd><p>0xF0FFFF
  4728. </p></dd>
  4729. <dt>&lsquo;<samp>Beige</samp>&rsquo;</dt>
  4730. <dd><p>0xF5F5DC
  4731. </p></dd>
  4732. <dt>&lsquo;<samp>Bisque</samp>&rsquo;</dt>
  4733. <dd><p>0xFFE4C4
  4734. </p></dd>
  4735. <dt>&lsquo;<samp>Black</samp>&rsquo;</dt>
  4736. <dd><p>0x000000
  4737. </p></dd>
  4738. <dt>&lsquo;<samp>BlanchedAlmond</samp>&rsquo;</dt>
  4739. <dd><p>0xFFEBCD
  4740. </p></dd>
  4741. <dt>&lsquo;<samp>Blue</samp>&rsquo;</dt>
  4742. <dd><p>0x0000FF
  4743. </p></dd>
  4744. <dt>&lsquo;<samp>BlueViolet</samp>&rsquo;</dt>
  4745. <dd><p>0x8A2BE2
  4746. </p></dd>
  4747. <dt>&lsquo;<samp>Brown</samp>&rsquo;</dt>
  4748. <dd><p>0xA52A2A
  4749. </p></dd>
  4750. <dt>&lsquo;<samp>BurlyWood</samp>&rsquo;</dt>
  4751. <dd><p>0xDEB887
  4752. </p></dd>
  4753. <dt>&lsquo;<samp>CadetBlue</samp>&rsquo;</dt>
  4754. <dd><p>0x5F9EA0
  4755. </p></dd>
  4756. <dt>&lsquo;<samp>Chartreuse</samp>&rsquo;</dt>
  4757. <dd><p>0x7FFF00
  4758. </p></dd>
  4759. <dt>&lsquo;<samp>Chocolate</samp>&rsquo;</dt>
  4760. <dd><p>0xD2691E
  4761. </p></dd>
  4762. <dt>&lsquo;<samp>Coral</samp>&rsquo;</dt>
  4763. <dd><p>0xFF7F50
  4764. </p></dd>
  4765. <dt>&lsquo;<samp>CornflowerBlue</samp>&rsquo;</dt>
  4766. <dd><p>0x6495ED
  4767. </p></dd>
  4768. <dt>&lsquo;<samp>Cornsilk</samp>&rsquo;</dt>
  4769. <dd><p>0xFFF8DC
  4770. </p></dd>
  4771. <dt>&lsquo;<samp>Crimson</samp>&rsquo;</dt>
  4772. <dd><p>0xDC143C
  4773. </p></dd>
  4774. <dt>&lsquo;<samp>Cyan</samp>&rsquo;</dt>
  4775. <dd><p>0x00FFFF
  4776. </p></dd>
  4777. <dt>&lsquo;<samp>DarkBlue</samp>&rsquo;</dt>
  4778. <dd><p>0x00008B
  4779. </p></dd>
  4780. <dt>&lsquo;<samp>DarkCyan</samp>&rsquo;</dt>
  4781. <dd><p>0x008B8B
  4782. </p></dd>
  4783. <dt>&lsquo;<samp>DarkGoldenRod</samp>&rsquo;</dt>
  4784. <dd><p>0xB8860B
  4785. </p></dd>
  4786. <dt>&lsquo;<samp>DarkGray</samp>&rsquo;</dt>
  4787. <dd><p>0xA9A9A9
  4788. </p></dd>
  4789. <dt>&lsquo;<samp>DarkGreen</samp>&rsquo;</dt>
  4790. <dd><p>0x006400
  4791. </p></dd>
  4792. <dt>&lsquo;<samp>DarkKhaki</samp>&rsquo;</dt>
  4793. <dd><p>0xBDB76B
  4794. </p></dd>
  4795. <dt>&lsquo;<samp>DarkMagenta</samp>&rsquo;</dt>
  4796. <dd><p>0x8B008B
  4797. </p></dd>
  4798. <dt>&lsquo;<samp>DarkOliveGreen</samp>&rsquo;</dt>
  4799. <dd><p>0x556B2F
  4800. </p></dd>
  4801. <dt>&lsquo;<samp>Darkorange</samp>&rsquo;</dt>
  4802. <dd><p>0xFF8C00
  4803. </p></dd>
  4804. <dt>&lsquo;<samp>DarkOrchid</samp>&rsquo;</dt>
  4805. <dd><p>0x9932CC
  4806. </p></dd>
  4807. <dt>&lsquo;<samp>DarkRed</samp>&rsquo;</dt>
  4808. <dd><p>0x8B0000
  4809. </p></dd>
  4810. <dt>&lsquo;<samp>DarkSalmon</samp>&rsquo;</dt>
  4811. <dd><p>0xE9967A
  4812. </p></dd>
  4813. <dt>&lsquo;<samp>DarkSeaGreen</samp>&rsquo;</dt>
  4814. <dd><p>0x8FBC8F
  4815. </p></dd>
  4816. <dt>&lsquo;<samp>DarkSlateBlue</samp>&rsquo;</dt>
  4817. <dd><p>0x483D8B
  4818. </p></dd>
  4819. <dt>&lsquo;<samp>DarkSlateGray</samp>&rsquo;</dt>
  4820. <dd><p>0x2F4F4F
  4821. </p></dd>
  4822. <dt>&lsquo;<samp>DarkTurquoise</samp>&rsquo;</dt>
  4823. <dd><p>0x00CED1
  4824. </p></dd>
  4825. <dt>&lsquo;<samp>DarkViolet</samp>&rsquo;</dt>
  4826. <dd><p>0x9400D3
  4827. </p></dd>
  4828. <dt>&lsquo;<samp>DeepPink</samp>&rsquo;</dt>
  4829. <dd><p>0xFF1493
  4830. </p></dd>
  4831. <dt>&lsquo;<samp>DeepSkyBlue</samp>&rsquo;</dt>
  4832. <dd><p>0x00BFFF
  4833. </p></dd>
  4834. <dt>&lsquo;<samp>DimGray</samp>&rsquo;</dt>
  4835. <dd><p>0x696969
  4836. </p></dd>
  4837. <dt>&lsquo;<samp>DodgerBlue</samp>&rsquo;</dt>
  4838. <dd><p>0x1E90FF
  4839. </p></dd>
  4840. <dt>&lsquo;<samp>FireBrick</samp>&rsquo;</dt>
  4841. <dd><p>0xB22222
  4842. </p></dd>
  4843. <dt>&lsquo;<samp>FloralWhite</samp>&rsquo;</dt>
  4844. <dd><p>0xFFFAF0
  4845. </p></dd>
  4846. <dt>&lsquo;<samp>ForestGreen</samp>&rsquo;</dt>
  4847. <dd><p>0x228B22
  4848. </p></dd>
  4849. <dt>&lsquo;<samp>Fuchsia</samp>&rsquo;</dt>
  4850. <dd><p>0xFF00FF
  4851. </p></dd>
  4852. <dt>&lsquo;<samp>Gainsboro</samp>&rsquo;</dt>
  4853. <dd><p>0xDCDCDC
  4854. </p></dd>
  4855. <dt>&lsquo;<samp>GhostWhite</samp>&rsquo;</dt>
  4856. <dd><p>0xF8F8FF
  4857. </p></dd>
  4858. <dt>&lsquo;<samp>Gold</samp>&rsquo;</dt>
  4859. <dd><p>0xFFD700
  4860. </p></dd>
  4861. <dt>&lsquo;<samp>GoldenRod</samp>&rsquo;</dt>
  4862. <dd><p>0xDAA520
  4863. </p></dd>
  4864. <dt>&lsquo;<samp>Gray</samp>&rsquo;</dt>
  4865. <dd><p>0x808080
  4866. </p></dd>
  4867. <dt>&lsquo;<samp>Green</samp>&rsquo;</dt>
  4868. <dd><p>0x008000
  4869. </p></dd>
  4870. <dt>&lsquo;<samp>GreenYellow</samp>&rsquo;</dt>
  4871. <dd><p>0xADFF2F
  4872. </p></dd>
  4873. <dt>&lsquo;<samp>HoneyDew</samp>&rsquo;</dt>
  4874. <dd><p>0xF0FFF0
  4875. </p></dd>
  4876. <dt>&lsquo;<samp>HotPink</samp>&rsquo;</dt>
  4877. <dd><p>0xFF69B4
  4878. </p></dd>
  4879. <dt>&lsquo;<samp>IndianRed</samp>&rsquo;</dt>
  4880. <dd><p>0xCD5C5C
  4881. </p></dd>
  4882. <dt>&lsquo;<samp>Indigo</samp>&rsquo;</dt>
  4883. <dd><p>0x4B0082
  4884. </p></dd>
  4885. <dt>&lsquo;<samp>Ivory</samp>&rsquo;</dt>
  4886. <dd><p>0xFFFFF0
  4887. </p></dd>
  4888. <dt>&lsquo;<samp>Khaki</samp>&rsquo;</dt>
  4889. <dd><p>0xF0E68C
  4890. </p></dd>
  4891. <dt>&lsquo;<samp>Lavender</samp>&rsquo;</dt>
  4892. <dd><p>0xE6E6FA
  4893. </p></dd>
  4894. <dt>&lsquo;<samp>LavenderBlush</samp>&rsquo;</dt>
  4895. <dd><p>0xFFF0F5
  4896. </p></dd>
  4897. <dt>&lsquo;<samp>LawnGreen</samp>&rsquo;</dt>
  4898. <dd><p>0x7CFC00
  4899. </p></dd>
  4900. <dt>&lsquo;<samp>LemonChiffon</samp>&rsquo;</dt>
  4901. <dd><p>0xFFFACD
  4902. </p></dd>
  4903. <dt>&lsquo;<samp>LightBlue</samp>&rsquo;</dt>
  4904. <dd><p>0xADD8E6
  4905. </p></dd>
  4906. <dt>&lsquo;<samp>LightCoral</samp>&rsquo;</dt>
  4907. <dd><p>0xF08080
  4908. </p></dd>
  4909. <dt>&lsquo;<samp>LightCyan</samp>&rsquo;</dt>
  4910. <dd><p>0xE0FFFF
  4911. </p></dd>
  4912. <dt>&lsquo;<samp>LightGoldenRodYellow</samp>&rsquo;</dt>
  4913. <dd><p>0xFAFAD2
  4914. </p></dd>
  4915. <dt>&lsquo;<samp>LightGreen</samp>&rsquo;</dt>
  4916. <dd><p>0x90EE90
  4917. </p></dd>
  4918. <dt>&lsquo;<samp>LightGrey</samp>&rsquo;</dt>
  4919. <dd><p>0xD3D3D3
  4920. </p></dd>
  4921. <dt>&lsquo;<samp>LightPink</samp>&rsquo;</dt>
  4922. <dd><p>0xFFB6C1
  4923. </p></dd>
  4924. <dt>&lsquo;<samp>LightSalmon</samp>&rsquo;</dt>
  4925. <dd><p>0xFFA07A
  4926. </p></dd>
  4927. <dt>&lsquo;<samp>LightSeaGreen</samp>&rsquo;</dt>
  4928. <dd><p>0x20B2AA
  4929. </p></dd>
  4930. <dt>&lsquo;<samp>LightSkyBlue</samp>&rsquo;</dt>
  4931. <dd><p>0x87CEFA
  4932. </p></dd>
  4933. <dt>&lsquo;<samp>LightSlateGray</samp>&rsquo;</dt>
  4934. <dd><p>0x778899
  4935. </p></dd>
  4936. <dt>&lsquo;<samp>LightSteelBlue</samp>&rsquo;</dt>
  4937. <dd><p>0xB0C4DE
  4938. </p></dd>
  4939. <dt>&lsquo;<samp>LightYellow</samp>&rsquo;</dt>
  4940. <dd><p>0xFFFFE0
  4941. </p></dd>
  4942. <dt>&lsquo;<samp>Lime</samp>&rsquo;</dt>
  4943. <dd><p>0x00FF00
  4944. </p></dd>
  4945. <dt>&lsquo;<samp>LimeGreen</samp>&rsquo;</dt>
  4946. <dd><p>0x32CD32
  4947. </p></dd>
  4948. <dt>&lsquo;<samp>Linen</samp>&rsquo;</dt>
  4949. <dd><p>0xFAF0E6
  4950. </p></dd>
  4951. <dt>&lsquo;<samp>Magenta</samp>&rsquo;</dt>
  4952. <dd><p>0xFF00FF
  4953. </p></dd>
  4954. <dt>&lsquo;<samp>Maroon</samp>&rsquo;</dt>
  4955. <dd><p>0x800000
  4956. </p></dd>
  4957. <dt>&lsquo;<samp>MediumAquaMarine</samp>&rsquo;</dt>
  4958. <dd><p>0x66CDAA
  4959. </p></dd>
  4960. <dt>&lsquo;<samp>MediumBlue</samp>&rsquo;</dt>
  4961. <dd><p>0x0000CD
  4962. </p></dd>
  4963. <dt>&lsquo;<samp>MediumOrchid</samp>&rsquo;</dt>
  4964. <dd><p>0xBA55D3
  4965. </p></dd>
  4966. <dt>&lsquo;<samp>MediumPurple</samp>&rsquo;</dt>
  4967. <dd><p>0x9370D8
  4968. </p></dd>
  4969. <dt>&lsquo;<samp>MediumSeaGreen</samp>&rsquo;</dt>
  4970. <dd><p>0x3CB371
  4971. </p></dd>
  4972. <dt>&lsquo;<samp>MediumSlateBlue</samp>&rsquo;</dt>
  4973. <dd><p>0x7B68EE
  4974. </p></dd>
  4975. <dt>&lsquo;<samp>MediumSpringGreen</samp>&rsquo;</dt>
  4976. <dd><p>0x00FA9A
  4977. </p></dd>
  4978. <dt>&lsquo;<samp>MediumTurquoise</samp>&rsquo;</dt>
  4979. <dd><p>0x48D1CC
  4980. </p></dd>
  4981. <dt>&lsquo;<samp>MediumVioletRed</samp>&rsquo;</dt>
  4982. <dd><p>0xC71585
  4983. </p></dd>
  4984. <dt>&lsquo;<samp>MidnightBlue</samp>&rsquo;</dt>
  4985. <dd><p>0x191970
  4986. </p></dd>
  4987. <dt>&lsquo;<samp>MintCream</samp>&rsquo;</dt>
  4988. <dd><p>0xF5FFFA
  4989. </p></dd>
  4990. <dt>&lsquo;<samp>MistyRose</samp>&rsquo;</dt>
  4991. <dd><p>0xFFE4E1
  4992. </p></dd>
  4993. <dt>&lsquo;<samp>Moccasin</samp>&rsquo;</dt>
  4994. <dd><p>0xFFE4B5
  4995. </p></dd>
  4996. <dt>&lsquo;<samp>NavajoWhite</samp>&rsquo;</dt>
  4997. <dd><p>0xFFDEAD
  4998. </p></dd>
  4999. <dt>&lsquo;<samp>Navy</samp>&rsquo;</dt>
  5000. <dd><p>0x000080
  5001. </p></dd>
  5002. <dt>&lsquo;<samp>OldLace</samp>&rsquo;</dt>
  5003. <dd><p>0xFDF5E6
  5004. </p></dd>
  5005. <dt>&lsquo;<samp>Olive</samp>&rsquo;</dt>
  5006. <dd><p>0x808000
  5007. </p></dd>
  5008. <dt>&lsquo;<samp>OliveDrab</samp>&rsquo;</dt>
  5009. <dd><p>0x6B8E23
  5010. </p></dd>
  5011. <dt>&lsquo;<samp>Orange</samp>&rsquo;</dt>
  5012. <dd><p>0xFFA500
  5013. </p></dd>
  5014. <dt>&lsquo;<samp>OrangeRed</samp>&rsquo;</dt>
  5015. <dd><p>0xFF4500
  5016. </p></dd>
  5017. <dt>&lsquo;<samp>Orchid</samp>&rsquo;</dt>
  5018. <dd><p>0xDA70D6
  5019. </p></dd>
  5020. <dt>&lsquo;<samp>PaleGoldenRod</samp>&rsquo;</dt>
  5021. <dd><p>0xEEE8AA
  5022. </p></dd>
  5023. <dt>&lsquo;<samp>PaleGreen</samp>&rsquo;</dt>
  5024. <dd><p>0x98FB98
  5025. </p></dd>
  5026. <dt>&lsquo;<samp>PaleTurquoise</samp>&rsquo;</dt>
  5027. <dd><p>0xAFEEEE
  5028. </p></dd>
  5029. <dt>&lsquo;<samp>PaleVioletRed</samp>&rsquo;</dt>
  5030. <dd><p>0xD87093
  5031. </p></dd>
  5032. <dt>&lsquo;<samp>PapayaWhip</samp>&rsquo;</dt>
  5033. <dd><p>0xFFEFD5
  5034. </p></dd>
  5035. <dt>&lsquo;<samp>PeachPuff</samp>&rsquo;</dt>
  5036. <dd><p>0xFFDAB9
  5037. </p></dd>
  5038. <dt>&lsquo;<samp>Peru</samp>&rsquo;</dt>
  5039. <dd><p>0xCD853F
  5040. </p></dd>
  5041. <dt>&lsquo;<samp>Pink</samp>&rsquo;</dt>
  5042. <dd><p>0xFFC0CB
  5043. </p></dd>
  5044. <dt>&lsquo;<samp>Plum</samp>&rsquo;</dt>
  5045. <dd><p>0xDDA0DD
  5046. </p></dd>
  5047. <dt>&lsquo;<samp>PowderBlue</samp>&rsquo;</dt>
  5048. <dd><p>0xB0E0E6
  5049. </p></dd>
  5050. <dt>&lsquo;<samp>Purple</samp>&rsquo;</dt>
  5051. <dd><p>0x800080
  5052. </p></dd>
  5053. <dt>&lsquo;<samp>Red</samp>&rsquo;</dt>
  5054. <dd><p>0xFF0000
  5055. </p></dd>
  5056. <dt>&lsquo;<samp>RosyBrown</samp>&rsquo;</dt>
  5057. <dd><p>0xBC8F8F
  5058. </p></dd>
  5059. <dt>&lsquo;<samp>RoyalBlue</samp>&rsquo;</dt>
  5060. <dd><p>0x4169E1
  5061. </p></dd>
  5062. <dt>&lsquo;<samp>SaddleBrown</samp>&rsquo;</dt>
  5063. <dd><p>0x8B4513
  5064. </p></dd>
  5065. <dt>&lsquo;<samp>Salmon</samp>&rsquo;</dt>
  5066. <dd><p>0xFA8072
  5067. </p></dd>
  5068. <dt>&lsquo;<samp>SandyBrown</samp>&rsquo;</dt>
  5069. <dd><p>0xF4A460
  5070. </p></dd>
  5071. <dt>&lsquo;<samp>SeaGreen</samp>&rsquo;</dt>
  5072. <dd><p>0x2E8B57
  5073. </p></dd>
  5074. <dt>&lsquo;<samp>SeaShell</samp>&rsquo;</dt>
  5075. <dd><p>0xFFF5EE
  5076. </p></dd>
  5077. <dt>&lsquo;<samp>Sienna</samp>&rsquo;</dt>
  5078. <dd><p>0xA0522D
  5079. </p></dd>
  5080. <dt>&lsquo;<samp>Silver</samp>&rsquo;</dt>
  5081. <dd><p>0xC0C0C0
  5082. </p></dd>
  5083. <dt>&lsquo;<samp>SkyBlue</samp>&rsquo;</dt>
  5084. <dd><p>0x87CEEB
  5085. </p></dd>
  5086. <dt>&lsquo;<samp>SlateBlue</samp>&rsquo;</dt>
  5087. <dd><p>0x6A5ACD
  5088. </p></dd>
  5089. <dt>&lsquo;<samp>SlateGray</samp>&rsquo;</dt>
  5090. <dd><p>0x708090
  5091. </p></dd>
  5092. <dt>&lsquo;<samp>Snow</samp>&rsquo;</dt>
  5093. <dd><p>0xFFFAFA
  5094. </p></dd>
  5095. <dt>&lsquo;<samp>SpringGreen</samp>&rsquo;</dt>
  5096. <dd><p>0x00FF7F
  5097. </p></dd>
  5098. <dt>&lsquo;<samp>SteelBlue</samp>&rsquo;</dt>
  5099. <dd><p>0x4682B4
  5100. </p></dd>
  5101. <dt>&lsquo;<samp>Tan</samp>&rsquo;</dt>
  5102. <dd><p>0xD2B48C
  5103. </p></dd>
  5104. <dt>&lsquo;<samp>Teal</samp>&rsquo;</dt>
  5105. <dd><p>0x008080
  5106. </p></dd>
  5107. <dt>&lsquo;<samp>Thistle</samp>&rsquo;</dt>
  5108. <dd><p>0xD8BFD8
  5109. </p></dd>
  5110. <dt>&lsquo;<samp>Tomato</samp>&rsquo;</dt>
  5111. <dd><p>0xFF6347
  5112. </p></dd>
  5113. <dt>&lsquo;<samp>Turquoise</samp>&rsquo;</dt>
  5114. <dd><p>0x40E0D0
  5115. </p></dd>
  5116. <dt>&lsquo;<samp>Violet</samp>&rsquo;</dt>
  5117. <dd><p>0xEE82EE
  5118. </p></dd>
  5119. <dt>&lsquo;<samp>Wheat</samp>&rsquo;</dt>
  5120. <dd><p>0xF5DEB3
  5121. </p></dd>
  5122. <dt>&lsquo;<samp>White</samp>&rsquo;</dt>
  5123. <dd><p>0xFFFFFF
  5124. </p></dd>
  5125. <dt>&lsquo;<samp>WhiteSmoke</samp>&rsquo;</dt>
  5126. <dd><p>0xF5F5F5
  5127. </p></dd>
  5128. <dt>&lsquo;<samp>Yellow</samp>&rsquo;</dt>
  5129. <dd><p>0xFFFF00
  5130. </p></dd>
  5131. <dt>&lsquo;<samp>YellowGreen</samp>&rsquo;</dt>
  5132. <dd><p>0x9ACD32
  5133. </p></dd>
  5134. </dl>
  5135. <p><a name="channel-layout-syntax"></a>
  5136. </p><a name="Channel-Layout"></a>
  5137. <h2 class="section"><a href="ffmpeg-all.html#toc-Channel-Layout">7.8 Channel Layout</a></h2>
  5138. <p>A channel layout specifies the spatial disposition of the channels in
  5139. a multi-channel audio stream. To specify a channel layout, FFmpeg
  5140. makes use of a special syntax.
  5141. </p>
  5142. <p>Individual channels are identified by an id, as given by the table
  5143. below:
  5144. </p><dl compact="compact">
  5145. <dt>&lsquo;<samp>FL</samp>&rsquo;</dt>
  5146. <dd><p>front left
  5147. </p></dd>
  5148. <dt>&lsquo;<samp>FR</samp>&rsquo;</dt>
  5149. <dd><p>front right
  5150. </p></dd>
  5151. <dt>&lsquo;<samp>FC</samp>&rsquo;</dt>
  5152. <dd><p>front center
  5153. </p></dd>
  5154. <dt>&lsquo;<samp>LFE</samp>&rsquo;</dt>
  5155. <dd><p>low frequency
  5156. </p></dd>
  5157. <dt>&lsquo;<samp>BL</samp>&rsquo;</dt>
  5158. <dd><p>back left
  5159. </p></dd>
  5160. <dt>&lsquo;<samp>BR</samp>&rsquo;</dt>
  5161. <dd><p>back right
  5162. </p></dd>
  5163. <dt>&lsquo;<samp>FLC</samp>&rsquo;</dt>
  5164. <dd><p>front left-of-center
  5165. </p></dd>
  5166. <dt>&lsquo;<samp>FRC</samp>&rsquo;</dt>
  5167. <dd><p>front right-of-center
  5168. </p></dd>
  5169. <dt>&lsquo;<samp>BC</samp>&rsquo;</dt>
  5170. <dd><p>back center
  5171. </p></dd>
  5172. <dt>&lsquo;<samp>SL</samp>&rsquo;</dt>
  5173. <dd><p>side left
  5174. </p></dd>
  5175. <dt>&lsquo;<samp>SR</samp>&rsquo;</dt>
  5176. <dd><p>side right
  5177. </p></dd>
  5178. <dt>&lsquo;<samp>TC</samp>&rsquo;</dt>
  5179. <dd><p>top center
  5180. </p></dd>
  5181. <dt>&lsquo;<samp>TFL</samp>&rsquo;</dt>
  5182. <dd><p>top front left
  5183. </p></dd>
  5184. <dt>&lsquo;<samp>TFC</samp>&rsquo;</dt>
  5185. <dd><p>top front center
  5186. </p></dd>
  5187. <dt>&lsquo;<samp>TFR</samp>&rsquo;</dt>
  5188. <dd><p>top front right
  5189. </p></dd>
  5190. <dt>&lsquo;<samp>TBL</samp>&rsquo;</dt>
  5191. <dd><p>top back left
  5192. </p></dd>
  5193. <dt>&lsquo;<samp>TBC</samp>&rsquo;</dt>
  5194. <dd><p>top back center
  5195. </p></dd>
  5196. <dt>&lsquo;<samp>TBR</samp>&rsquo;</dt>
  5197. <dd><p>top back right
  5198. </p></dd>
  5199. <dt>&lsquo;<samp>DL</samp>&rsquo;</dt>
  5200. <dd><p>downmix left
  5201. </p></dd>
  5202. <dt>&lsquo;<samp>DR</samp>&rsquo;</dt>
  5203. <dd><p>downmix right
  5204. </p></dd>
  5205. <dt>&lsquo;<samp>WL</samp>&rsquo;</dt>
  5206. <dd><p>wide left
  5207. </p></dd>
  5208. <dt>&lsquo;<samp>WR</samp>&rsquo;</dt>
  5209. <dd><p>wide right
  5210. </p></dd>
  5211. <dt>&lsquo;<samp>SDL</samp>&rsquo;</dt>
  5212. <dd><p>surround direct left
  5213. </p></dd>
  5214. <dt>&lsquo;<samp>SDR</samp>&rsquo;</dt>
  5215. <dd><p>surround direct right
  5216. </p></dd>
  5217. <dt>&lsquo;<samp>LFE2</samp>&rsquo;</dt>
  5218. <dd><p>low frequency 2
  5219. </p></dd>
  5220. </dl>
  5221. <p>Standard channel layout compositions can be specified by using the
  5222. following identifiers:
  5223. </p><dl compact="compact">
  5224. <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
  5225. <dd><p>FC
  5226. </p></dd>
  5227. <dt>&lsquo;<samp>stereo</samp>&rsquo;</dt>
  5228. <dd><p>FL+FR
  5229. </p></dd>
  5230. <dt>&lsquo;<samp>2.1</samp>&rsquo;</dt>
  5231. <dd><p>FL+FR+LFE
  5232. </p></dd>
  5233. <dt>&lsquo;<samp>3.0</samp>&rsquo;</dt>
  5234. <dd><p>FL+FR+FC
  5235. </p></dd>
  5236. <dt>&lsquo;<samp>3.0(back)</samp>&rsquo;</dt>
  5237. <dd><p>FL+FR+BC
  5238. </p></dd>
  5239. <dt>&lsquo;<samp>4.0</samp>&rsquo;</dt>
  5240. <dd><p>FL+FR+FC+BC
  5241. </p></dd>
  5242. <dt>&lsquo;<samp>quad</samp>&rsquo;</dt>
  5243. <dd><p>FL+FR+BL+BR
  5244. </p></dd>
  5245. <dt>&lsquo;<samp>quad(side)</samp>&rsquo;</dt>
  5246. <dd><p>FL+FR+SL+SR
  5247. </p></dd>
  5248. <dt>&lsquo;<samp>3.1</samp>&rsquo;</dt>
  5249. <dd><p>FL+FR+FC+LFE
  5250. </p></dd>
  5251. <dt>&lsquo;<samp>5.0</samp>&rsquo;</dt>
  5252. <dd><p>FL+FR+FC+BL+BR
  5253. </p></dd>
  5254. <dt>&lsquo;<samp>5.0(side)</samp>&rsquo;</dt>
  5255. <dd><p>FL+FR+FC+SL+SR
  5256. </p></dd>
  5257. <dt>&lsquo;<samp>4.1</samp>&rsquo;</dt>
  5258. <dd><p>FL+FR+FC+LFE+BC
  5259. </p></dd>
  5260. <dt>&lsquo;<samp>5.1</samp>&rsquo;</dt>
  5261. <dd><p>FL+FR+FC+LFE+BL+BR
  5262. </p></dd>
  5263. <dt>&lsquo;<samp>5.1(side)</samp>&rsquo;</dt>
  5264. <dd><p>FL+FR+FC+LFE+SL+SR
  5265. </p></dd>
  5266. <dt>&lsquo;<samp>6.0</samp>&rsquo;</dt>
  5267. <dd><p>FL+FR+FC+BC+SL+SR
  5268. </p></dd>
  5269. <dt>&lsquo;<samp>6.0(front)</samp>&rsquo;</dt>
  5270. <dd><p>FL+FR+FLC+FRC+SL+SR
  5271. </p></dd>
  5272. <dt>&lsquo;<samp>hexagonal</samp>&rsquo;</dt>
  5273. <dd><p>FL+FR+FC+BL+BR+BC
  5274. </p></dd>
  5275. <dt>&lsquo;<samp>6.1</samp>&rsquo;</dt>
  5276. <dd><p>FL+FR+FC+LFE+BC+SL+SR
  5277. </p></dd>
  5278. <dt>&lsquo;<samp>6.1</samp>&rsquo;</dt>
  5279. <dd><p>FL+FR+FC+LFE+BL+BR+BC
  5280. </p></dd>
  5281. <dt>&lsquo;<samp>6.1(front)</samp>&rsquo;</dt>
  5282. <dd><p>FL+FR+LFE+FLC+FRC+SL+SR
  5283. </p></dd>
  5284. <dt>&lsquo;<samp>7.0</samp>&rsquo;</dt>
  5285. <dd><p>FL+FR+FC+BL+BR+SL+SR
  5286. </p></dd>
  5287. <dt>&lsquo;<samp>7.0(front)</samp>&rsquo;</dt>
  5288. <dd><p>FL+FR+FC+FLC+FRC+SL+SR
  5289. </p></dd>
  5290. <dt>&lsquo;<samp>7.1</samp>&rsquo;</dt>
  5291. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR
  5292. </p></dd>
  5293. <dt>&lsquo;<samp>7.1(wide)</samp>&rsquo;</dt>
  5294. <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC
  5295. </p></dd>
  5296. <dt>&lsquo;<samp>7.1(wide-side)</samp>&rsquo;</dt>
  5297. <dd><p>FL+FR+FC+LFE+FLC+FRC+SL+SR
  5298. </p></dd>
  5299. <dt>&lsquo;<samp>octagonal</samp>&rsquo;</dt>
  5300. <dd><p>FL+FR+FC+BL+BR+BC+SL+SR
  5301. </p></dd>
  5302. <dt>&lsquo;<samp>hexadecagonal</samp>&rsquo;</dt>
  5303. <dd><p>FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR
  5304. </p></dd>
  5305. <dt>&lsquo;<samp>downmix</samp>&rsquo;</dt>
  5306. <dd><p>DL+DR
  5307. </p></dd>
  5308. </dl>
  5309. <p>A custom channel layout can be specified as a sequence of terms, separated by
  5310. &rsquo;+&rsquo; or &rsquo;|&rsquo;. Each term can be:
  5311. </p><ul>
  5312. <li>
  5313. the name of a standard channel layout (e.g. &lsquo;<samp>mono</samp>&rsquo;,
  5314. &lsquo;<samp>stereo</samp>&rsquo;, &lsquo;<samp>4.0</samp>&rsquo;, &lsquo;<samp>quad</samp>&rsquo;, &lsquo;<samp>5.0</samp>&rsquo;, etc.)
  5315. </li><li>
  5316. 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.)
  5317. </li><li>
  5318. a number of channels, in decimal, followed by &rsquo;c&rsquo;, yielding the default channel
  5319. layout for that number of channels (see the function
  5320. <code>av_get_default_channel_layout</code>). Note that not all channel counts have a
  5321. default layout.
  5322. </li><li>
  5323. a number of channels, in decimal, followed by &rsquo;C&rsquo;, yielding an unknown channel
  5324. layout with the specified number of channels. Note that not all channel layout
  5325. specification strings support unknown channel layouts.
  5326. </li><li>
  5327. a channel layout mask, in hexadecimal starting with &quot;0x&quot; (see the
  5328. <code>AV_CH_*</code> macros in &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;.
  5329. </li></ul>
  5330. <p>Before libavutil version 53 the trailing character &quot;c&quot; to specify a number of
  5331. channels was optional, but now it is required, while a channel layout mask can
  5332. also be specified as a decimal number (if and only if not followed by &quot;c&quot; or &quot;C&quot;).
  5333. </p>
  5334. <p>See also the function <code>av_get_channel_layout</code> defined in
  5335. &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;.
  5336. </p>
  5337. <a name="Expression-Evaluation"></a>
  5338. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Expression-Evaluation">8 Expression Evaluation</a></h1>
  5339. <p>When evaluating an arithmetic expression, FFmpeg uses an internal
  5340. formula evaluator, implemented through the &lsquo;<tt>libavutil/eval.h</tt>&rsquo;
  5341. interface.
  5342. </p>
  5343. <p>An expression may contain unary, binary operators, constants, and
  5344. functions.
  5345. </p>
  5346. <p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
  5347. another expression &quot;<var>expr1</var>;<var>expr2</var>&quot;.
  5348. <var>expr1</var> and <var>expr2</var> are evaluated in turn, and the new
  5349. expression evaluates to the value of <var>expr2</var>.
  5350. </p>
  5351. <p>The following binary operators are available: <code>+</code>, <code>-</code>,
  5352. <code>*</code>, <code>/</code>, <code>^</code>.
  5353. </p>
  5354. <p>The following unary operators are available: <code>+</code>, <code>-</code>.
  5355. </p>
  5356. <p>The following functions are available:
  5357. </p><dl compact="compact">
  5358. <dt>&lsquo;<samp>abs(x)</samp>&rsquo;</dt>
  5359. <dd><p>Compute absolute value of <var>x</var>.
  5360. </p>
  5361. </dd>
  5362. <dt>&lsquo;<samp>acos(x)</samp>&rsquo;</dt>
  5363. <dd><p>Compute arccosine of <var>x</var>.
  5364. </p>
  5365. </dd>
  5366. <dt>&lsquo;<samp>asin(x)</samp>&rsquo;</dt>
  5367. <dd><p>Compute arcsine of <var>x</var>.
  5368. </p>
  5369. </dd>
  5370. <dt>&lsquo;<samp>atan(x)</samp>&rsquo;</dt>
  5371. <dd><p>Compute arctangent of <var>x</var>.
  5372. </p>
  5373. </dd>
  5374. <dt>&lsquo;<samp>atan2(x, y)</samp>&rsquo;</dt>
  5375. <dd><p>Compute principal value of the arc tangent of <var>y</var>/<var>x</var>.
  5376. </p>
  5377. </dd>
  5378. <dt>&lsquo;<samp>between(x, min, max)</samp>&rsquo;</dt>
  5379. <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>min</var> and lesser than or
  5380. equal to <var>max</var>, 0 otherwise.
  5381. </p>
  5382. </dd>
  5383. <dt>&lsquo;<samp>bitand(x, y)</samp>&rsquo;</dt>
  5384. <dt>&lsquo;<samp>bitor(x, y)</samp>&rsquo;</dt>
  5385. <dd><p>Compute bitwise and/or operation on <var>x</var> and <var>y</var>.
  5386. </p>
  5387. <p>The results of the evaluation of <var>x</var> and <var>y</var> are converted to
  5388. integers before executing the bitwise operation.
  5389. </p>
  5390. <p>Note that both the conversion to integer and the conversion back to
  5391. floating point can lose precision. Beware of unexpected results for
  5392. large numbers (usually 2^53 and larger).
  5393. </p>
  5394. </dd>
  5395. <dt>&lsquo;<samp>ceil(expr)</samp>&rsquo;</dt>
  5396. <dd><p>Round the value of expression <var>expr</var> upwards to the nearest
  5397. integer. For example, &quot;ceil(1.5)&quot; is &quot;2.0&quot;.
  5398. </p>
  5399. </dd>
  5400. <dt>&lsquo;<samp>clip(x, min, max)</samp>&rsquo;</dt>
  5401. <dd><p>Return the value of <var>x</var> clipped between <var>min</var> and <var>max</var>.
  5402. </p>
  5403. </dd>
  5404. <dt>&lsquo;<samp>cos(x)</samp>&rsquo;</dt>
  5405. <dd><p>Compute cosine of <var>x</var>.
  5406. </p>
  5407. </dd>
  5408. <dt>&lsquo;<samp>cosh(x)</samp>&rsquo;</dt>
  5409. <dd><p>Compute hyperbolic cosine of <var>x</var>.
  5410. </p>
  5411. </dd>
  5412. <dt>&lsquo;<samp>eq(x, y)</samp>&rsquo;</dt>
  5413. <dd><p>Return 1 if <var>x</var> and <var>y</var> are equivalent, 0 otherwise.
  5414. </p>
  5415. </dd>
  5416. <dt>&lsquo;<samp>exp(x)</samp>&rsquo;</dt>
  5417. <dd><p>Compute exponential of <var>x</var> (with base <code>e</code>, the Euler&rsquo;s number).
  5418. </p>
  5419. </dd>
  5420. <dt>&lsquo;<samp>floor(expr)</samp>&rsquo;</dt>
  5421. <dd><p>Round the value of expression <var>expr</var> downwards to the nearest
  5422. integer. For example, &quot;floor(-1.5)&quot; is &quot;-2.0&quot;.
  5423. </p>
  5424. </dd>
  5425. <dt>&lsquo;<samp>gauss(x)</samp>&rsquo;</dt>
  5426. <dd><p>Compute Gauss function of <var>x</var>, corresponding to
  5427. <code>exp(-x*x/2) / sqrt(2*PI)</code>.
  5428. </p>
  5429. </dd>
  5430. <dt>&lsquo;<samp>gcd(x, y)</samp>&rsquo;</dt>
  5431. <dd><p>Return the greatest common divisor of <var>x</var> and <var>y</var>. If both <var>x</var> and
  5432. <var>y</var> are 0 or either or both are less than zero then behavior is undefined.
  5433. </p>
  5434. </dd>
  5435. <dt>&lsquo;<samp>gt(x, y)</samp>&rsquo;</dt>
  5436. <dd><p>Return 1 if <var>x</var> is greater than <var>y</var>, 0 otherwise.
  5437. </p>
  5438. </dd>
  5439. <dt>&lsquo;<samp>gte(x, y)</samp>&rsquo;</dt>
  5440. <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>y</var>, 0 otherwise.
  5441. </p>
  5442. </dd>
  5443. <dt>&lsquo;<samp>hypot(x, y)</samp>&rsquo;</dt>
  5444. <dd><p>This function is similar to the C function with the same name; it returns
  5445. &quot;sqrt(<var>x</var>*<var>x</var> + <var>y</var>*<var>y</var>)&quot;, the length of the hypotenuse of a
  5446. right triangle with sides of length <var>x</var> and <var>y</var>, or the distance of the
  5447. point (<var>x</var>, <var>y</var>) from the origin.
  5448. </p>
  5449. </dd>
  5450. <dt>&lsquo;<samp>if(x, y)</samp>&rsquo;</dt>
  5451. <dd><p>Evaluate <var>x</var>, and if the result is non-zero return the result of
  5452. the evaluation of <var>y</var>, return 0 otherwise.
  5453. </p>
  5454. </dd>
  5455. <dt>&lsquo;<samp>if(x, y, z)</samp>&rsquo;</dt>
  5456. <dd><p>Evaluate <var>x</var>, and if the result is non-zero return the evaluation
  5457. result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
  5458. </p>
  5459. </dd>
  5460. <dt>&lsquo;<samp>ifnot(x, y)</samp>&rsquo;</dt>
  5461. <dd><p>Evaluate <var>x</var>, and if the result is zero return the result of the
  5462. evaluation of <var>y</var>, return 0 otherwise.
  5463. </p>
  5464. </dd>
  5465. <dt>&lsquo;<samp>ifnot(x, y, z)</samp>&rsquo;</dt>
  5466. <dd><p>Evaluate <var>x</var>, and if the result is zero return the evaluation
  5467. result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
  5468. </p>
  5469. </dd>
  5470. <dt>&lsquo;<samp>isinf(x)</samp>&rsquo;</dt>
  5471. <dd><p>Return 1.0 if <var>x</var> is +/-INFINITY, 0.0 otherwise.
  5472. </p>
  5473. </dd>
  5474. <dt>&lsquo;<samp>isnan(x)</samp>&rsquo;</dt>
  5475. <dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
  5476. </p>
  5477. </dd>
  5478. <dt>&lsquo;<samp>ld(var)</samp>&rsquo;</dt>
  5479. <dd><p>Load the value of the internal variable with number
  5480. <var>var</var>, which was previously stored with st(<var>var</var>, <var>expr</var>).
  5481. The function returns the loaded value.
  5482. </p>
  5483. </dd>
  5484. <dt>&lsquo;<samp>lerp(x, y, z)</samp>&rsquo;</dt>
  5485. <dd><p>Return linear interpolation between <var>x</var> and <var>y</var> by amount of <var>z</var>.
  5486. </p>
  5487. </dd>
  5488. <dt>&lsquo;<samp>log(x)</samp>&rsquo;</dt>
  5489. <dd><p>Compute natural logarithm of <var>x</var>.
  5490. </p>
  5491. </dd>
  5492. <dt>&lsquo;<samp>lt(x, y)</samp>&rsquo;</dt>
  5493. <dd><p>Return 1 if <var>x</var> is lesser than <var>y</var>, 0 otherwise.
  5494. </p>
  5495. </dd>
  5496. <dt>&lsquo;<samp>lte(x, y)</samp>&rsquo;</dt>
  5497. <dd><p>Return 1 if <var>x</var> is lesser than or equal to <var>y</var>, 0 otherwise.
  5498. </p>
  5499. </dd>
  5500. <dt>&lsquo;<samp>max(x, y)</samp>&rsquo;</dt>
  5501. <dd><p>Return the maximum between <var>x</var> and <var>y</var>.
  5502. </p>
  5503. </dd>
  5504. <dt>&lsquo;<samp>min(x, y)</samp>&rsquo;</dt>
  5505. <dd><p>Return the minimum between <var>x</var> and <var>y</var>.
  5506. </p>
  5507. </dd>
  5508. <dt>&lsquo;<samp>mod(x, y)</samp>&rsquo;</dt>
  5509. <dd><p>Compute the remainder of division of <var>x</var> by <var>y</var>.
  5510. </p>
  5511. </dd>
  5512. <dt>&lsquo;<samp>not(expr)</samp>&rsquo;</dt>
  5513. <dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
  5514. </p>
  5515. </dd>
  5516. <dt>&lsquo;<samp>pow(x, y)</samp>&rsquo;</dt>
  5517. <dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
  5518. &quot;(<var>x</var>)^(<var>y</var>)&quot;.
  5519. </p>
  5520. </dd>
  5521. <dt>&lsquo;<samp>print(t)</samp>&rsquo;</dt>
  5522. <dt>&lsquo;<samp>print(t, l)</samp>&rsquo;</dt>
  5523. <dd><p>Print the value of expression <var>t</var> with loglevel <var>l</var>. If
  5524. <var>l</var> is not specified then a default log level is used.
  5525. Returns the value of the expression printed.
  5526. </p>
  5527. <p>Prints t with loglevel l
  5528. </p>
  5529. </dd>
  5530. <dt>&lsquo;<samp>random(x)</samp>&rsquo;</dt>
  5531. <dd><p>Return a pseudo random value between 0.0 and 1.0. <var>x</var> is the index of the
  5532. internal variable which will be used to save the seed/state.
  5533. </p>
  5534. </dd>
  5535. <dt>&lsquo;<samp>root(expr, max)</samp>&rsquo;</dt>
  5536. <dd><p>Find an input value for which the function represented by <var>expr</var>
  5537. with argument <var>ld(0)</var> is 0 in the interval 0..<var>max</var>.
  5538. </p>
  5539. <p>The expression in <var>expr</var> must denote a continuous function or the
  5540. result is undefined.
  5541. </p>
  5542. <p><var>ld(0)</var> is used to represent the function input value, which means
  5543. that the given expression will be evaluated multiple times with
  5544. various input values that the expression can access through
  5545. <code>ld(0)</code>. When the expression evaluates to 0 then the
  5546. corresponding input value will be returned.
  5547. </p>
  5548. </dd>
  5549. <dt>&lsquo;<samp>round(expr)</samp>&rsquo;</dt>
  5550. <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;.
  5551. </p>
  5552. </dd>
  5553. <dt>&lsquo;<samp>sgn(x)</samp>&rsquo;</dt>
  5554. <dd><p>Compute sign of <var>x</var>.
  5555. </p>
  5556. </dd>
  5557. <dt>&lsquo;<samp>sin(x)</samp>&rsquo;</dt>
  5558. <dd><p>Compute sine of <var>x</var>.
  5559. </p>
  5560. </dd>
  5561. <dt>&lsquo;<samp>sinh(x)</samp>&rsquo;</dt>
  5562. <dd><p>Compute hyperbolic sine of <var>x</var>.
  5563. </p>
  5564. </dd>
  5565. <dt>&lsquo;<samp>sqrt(expr)</samp>&rsquo;</dt>
  5566. <dd><p>Compute the square root of <var>expr</var>. This is equivalent to
  5567. &quot;(<var>expr</var>)^.5&quot;.
  5568. </p>
  5569. </dd>
  5570. <dt>&lsquo;<samp>squish(x)</samp>&rsquo;</dt>
  5571. <dd><p>Compute expression <code>1/(1 + exp(4*x))</code>.
  5572. </p>
  5573. </dd>
  5574. <dt>&lsquo;<samp>st(var, expr)</samp>&rsquo;</dt>
  5575. <dd><p>Store the value of the expression <var>expr</var> in an internal
  5576. variable. <var>var</var> specifies the number of the variable where to
  5577. store the value, and it is a value ranging from 0 to 9. The function
  5578. returns the value stored in the internal variable.
  5579. Note, Variables are currently not shared between expressions.
  5580. </p>
  5581. </dd>
  5582. <dt>&lsquo;<samp>tan(x)</samp>&rsquo;</dt>
  5583. <dd><p>Compute tangent of <var>x</var>.
  5584. </p>
  5585. </dd>
  5586. <dt>&lsquo;<samp>tanh(x)</samp>&rsquo;</dt>
  5587. <dd><p>Compute hyperbolic tangent of <var>x</var>.
  5588. </p>
  5589. </dd>
  5590. <dt>&lsquo;<samp>taylor(expr, x)</samp>&rsquo;</dt>
  5591. <dt>&lsquo;<samp>taylor(expr, x, id)</samp>&rsquo;</dt>
  5592. <dd><p>Evaluate a Taylor series at <var>x</var>, given an expression representing
  5593. the <code>ld(id)</code>-th derivative of a function at 0.
  5594. </p>
  5595. <p>When the series does not converge the result is undefined.
  5596. </p>
  5597. <p><var>ld(id)</var> is used to represent the derivative order in <var>expr</var>,
  5598. which means that the given expression will be evaluated multiple times
  5599. with various input values that the expression can access through
  5600. <code>ld(id)</code>. If <var>id</var> is not specified then 0 is assumed.
  5601. </p>
  5602. <p>Note, when you have the derivatives at y instead of 0,
  5603. <code>taylor(expr, x-y)</code> can be used.
  5604. </p>
  5605. </dd>
  5606. <dt>&lsquo;<samp>time(0)</samp>&rsquo;</dt>
  5607. <dd><p>Return the current (wallclock) time in seconds.
  5608. </p>
  5609. </dd>
  5610. <dt>&lsquo;<samp>trunc(expr)</samp>&rsquo;</dt>
  5611. <dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
  5612. integer. For example, &quot;trunc(-1.5)&quot; is &quot;-1.0&quot;.
  5613. </p>
  5614. </dd>
  5615. <dt>&lsquo;<samp>while(cond, expr)</samp>&rsquo;</dt>
  5616. <dd><p>Evaluate expression <var>expr</var> while the expression <var>cond</var> is
  5617. non-zero, and returns the value of the last <var>expr</var> evaluation, or
  5618. NAN if <var>cond</var> was always false.
  5619. </p></dd>
  5620. </dl>
  5621. <p>The following constants are available:
  5622. </p><dl compact="compact">
  5623. <dt>&lsquo;<samp>PI</samp>&rsquo;</dt>
  5624. <dd><p>area of the unit disc, approximately 3.14
  5625. </p></dd>
  5626. <dt>&lsquo;<samp>E</samp>&rsquo;</dt>
  5627. <dd><p>exp(1) (Euler&rsquo;s number), approximately 2.718
  5628. </p></dd>
  5629. <dt>&lsquo;<samp>PHI</samp>&rsquo;</dt>
  5630. <dd><p>golden ratio (1+sqrt(5))/2, approximately 1.618
  5631. </p></dd>
  5632. </dl>
  5633. <p>Assuming that an expression is considered &quot;true&quot; if it has a non-zero
  5634. value, note that:
  5635. </p>
  5636. <p><code>*</code> works like AND
  5637. </p>
  5638. <p><code>+</code> works like OR
  5639. </p>
  5640. <p>For example the construct:
  5641. </p><div class="example">
  5642. <pre class="example">if (A AND B) then C
  5643. </pre></div>
  5644. <p>is equivalent to:
  5645. </p><div class="example">
  5646. <pre class="example">if(A*B, C)
  5647. </pre></div>
  5648. <p>In your C code, you can extend the list of unary and binary functions,
  5649. and define recognized constants, so that they are available for your
  5650. expressions.
  5651. </p>
  5652. <p>The evaluator also recognizes the International System unit prefixes.
  5653. If &rsquo;i&rsquo; is appended after the prefix, binary prefixes are used, which
  5654. are based on powers of 1024 instead of powers of 1000.
  5655. The &rsquo;B&rsquo; postfix multiplies the value by 8, and can be appended after a
  5656. unit prefix or used alone. This allows using for example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;,
  5657. &rsquo;G&rsquo; and &rsquo;B&rsquo; as number postfix.
  5658. </p>
  5659. <p>The list of available International System prefixes follows, with
  5660. indication of the corresponding powers of 10 and of 2.
  5661. </p><dl compact="compact">
  5662. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  5663. <dd><p>10^-24 / 2^-80
  5664. </p></dd>
  5665. <dt>&lsquo;<samp>z</samp>&rsquo;</dt>
  5666. <dd><p>10^-21 / 2^-70
  5667. </p></dd>
  5668. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  5669. <dd><p>10^-18 / 2^-60
  5670. </p></dd>
  5671. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  5672. <dd><p>10^-15 / 2^-50
  5673. </p></dd>
  5674. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  5675. <dd><p>10^-12 / 2^-40
  5676. </p></dd>
  5677. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  5678. <dd><p>10^-9 / 2^-30
  5679. </p></dd>
  5680. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  5681. <dd><p>10^-6 / 2^-20
  5682. </p></dd>
  5683. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  5684. <dd><p>10^-3 / 2^-10
  5685. </p></dd>
  5686. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  5687. <dd><p>10^-2
  5688. </p></dd>
  5689. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  5690. <dd><p>10^-1
  5691. </p></dd>
  5692. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  5693. <dd><p>10^2
  5694. </p></dd>
  5695. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  5696. <dd><p>10^3 / 2^10
  5697. </p></dd>
  5698. <dt>&lsquo;<samp>K</samp>&rsquo;</dt>
  5699. <dd><p>10^3 / 2^10
  5700. </p></dd>
  5701. <dt>&lsquo;<samp>M</samp>&rsquo;</dt>
  5702. <dd><p>10^6 / 2^20
  5703. </p></dd>
  5704. <dt>&lsquo;<samp>G</samp>&rsquo;</dt>
  5705. <dd><p>10^9 / 2^30
  5706. </p></dd>
  5707. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  5708. <dd><p>10^12 / 2^40
  5709. </p></dd>
  5710. <dt>&lsquo;<samp>P</samp>&rsquo;</dt>
  5711. <dd><p>10^15 / 2^40
  5712. </p></dd>
  5713. <dt>&lsquo;<samp>E</samp>&rsquo;</dt>
  5714. <dd><p>10^18 / 2^50
  5715. </p></dd>
  5716. <dt>&lsquo;<samp>Z</samp>&rsquo;</dt>
  5717. <dd><p>10^21 / 2^60
  5718. </p></dd>
  5719. <dt>&lsquo;<samp>Y</samp>&rsquo;</dt>
  5720. <dd><p>10^24 / 2^70
  5721. </p></dd>
  5722. </dl>
  5723. <p><a name="codec_002doptions"></a>
  5724. </p><a name="Codec-Options"></a>
  5725. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Codec-Options">9 Codec Options</a></h1>
  5726. <p>libavcodec provides some generic global options, which can be set on
  5727. all the encoders and decoders. In addition each codec may support
  5728. so-called private options, which are specific for a given codec.
  5729. </p>
  5730. <p>Sometimes, a global option may only affect a specific kind of codec,
  5731. and may be nonsensical or ignored by another, so you need to be aware
  5732. of the meaning of the specified options. Also some options are
  5733. meant only for decoding or encoding.
  5734. </p>
  5735. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  5736. FFmpeg tools, or by setting the value explicitly in the
  5737. <code>AVCodecContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
  5738. for programmatic use.
  5739. </p>
  5740. <p>The list of supported options follow:
  5741. </p>
  5742. <dl compact="compact">
  5743. <dt>&lsquo;<samp>b <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  5744. <dd><p>Set bitrate in bits/s. Default value is 200K.
  5745. </p>
  5746. </dd>
  5747. <dt>&lsquo;<samp>ab <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
  5748. <dd><p>Set audio bitrate (in bits/s). Default value is 128K.
  5749. </p>
  5750. </dd>
  5751. <dt>&lsquo;<samp>bt <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5752. <dd><p>Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
  5753. tolerance specifies how far ratecontrol is willing to deviate from the
  5754. target average bitrate value. This is not related to min/max
  5755. bitrate. Lowering tolerance too much has an adverse effect on quality.
  5756. </p>
  5757. </dd>
  5758. <dt>&lsquo;<samp>flags <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>&rsquo;</dt>
  5759. <dd><p>Set generic flags.
  5760. </p>
  5761. <p>Possible values:
  5762. </p><dl compact="compact">
  5763. <dt>&lsquo;<samp>mv4</samp>&rsquo;</dt>
  5764. <dd><p>Use four motion vector by macroblock (mpeg4).
  5765. </p></dd>
  5766. <dt>&lsquo;<samp>qpel</samp>&rsquo;</dt>
  5767. <dd><p>Use 1/4 pel motion compensation.
  5768. </p></dd>
  5769. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  5770. <dd><p>Use loop filter.
  5771. </p></dd>
  5772. <dt>&lsquo;<samp>qscale</samp>&rsquo;</dt>
  5773. <dd><p>Use fixed qscale.
  5774. </p></dd>
  5775. <dt>&lsquo;<samp>pass1</samp>&rsquo;</dt>
  5776. <dd><p>Use internal 2pass ratecontrol in first pass mode.
  5777. </p></dd>
  5778. <dt>&lsquo;<samp>pass2</samp>&rsquo;</dt>
  5779. <dd><p>Use internal 2pass ratecontrol in second pass mode.
  5780. </p></dd>
  5781. <dt>&lsquo;<samp>gray</samp>&rsquo;</dt>
  5782. <dd><p>Only decode/encode grayscale.
  5783. </p></dd>
  5784. <dt>&lsquo;<samp>emu_edge</samp>&rsquo;</dt>
  5785. <dd><p>Do not draw edges.
  5786. </p></dd>
  5787. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  5788. <dd><p>Set error[?] variables during encoding.
  5789. </p></dd>
  5790. <dt>&lsquo;<samp>truncated</samp>&rsquo;</dt>
  5791. <dd><p>Input bitstream might be randomly truncated.
  5792. </p></dd>
  5793. <dt>&lsquo;<samp>drop_changed</samp>&rsquo;</dt>
  5794. <dd><p>Don&rsquo;t output frames whose parameters differ from first decoded frame in stream.
  5795. Error AVERROR_INPUT_CHANGED is returned when a frame is dropped.
  5796. </p>
  5797. </dd>
  5798. <dt>&lsquo;<samp>ildct</samp>&rsquo;</dt>
  5799. <dd><p>Use interlaced DCT.
  5800. </p></dd>
  5801. <dt>&lsquo;<samp>low_delay</samp>&rsquo;</dt>
  5802. <dd><p>Force low delay.
  5803. </p></dd>
  5804. <dt>&lsquo;<samp>global_header</samp>&rsquo;</dt>
  5805. <dd><p>Place global headers in extradata instead of every keyframe.
  5806. </p></dd>
  5807. <dt>&lsquo;<samp>bitexact</samp>&rsquo;</dt>
  5808. <dd><p>Only write platform-, build- and time-independent data. (except (I)DCT).
  5809. This ensures that file and data checksums are reproducible and match between
  5810. platforms. Its primary use is for regression testing.
  5811. </p></dd>
  5812. <dt>&lsquo;<samp>aic</samp>&rsquo;</dt>
  5813. <dd><p>Apply H263 advanced intra coding / mpeg4 ac prediction.
  5814. </p></dd>
  5815. <dt>&lsquo;<samp>cbp</samp>&rsquo;</dt>
  5816. <dd><p>Deprecated, use mpegvideo private options instead.
  5817. </p></dd>
  5818. <dt>&lsquo;<samp>qprd</samp>&rsquo;</dt>
  5819. <dd><p>Deprecated, use mpegvideo private options instead.
  5820. </p></dd>
  5821. <dt>&lsquo;<samp>ilme</samp>&rsquo;</dt>
  5822. <dd><p>Apply interlaced motion estimation.
  5823. </p></dd>
  5824. <dt>&lsquo;<samp>cgop</samp>&rsquo;</dt>
  5825. <dd><p>Use closed gop.
  5826. </p></dd>
  5827. <dt>&lsquo;<samp>output_corrupt</samp>&rsquo;</dt>
  5828. <dd><p>Output even potentially corrupted frames.
  5829. </p></dd>
  5830. </dl>
  5831. </dd>
  5832. <dt>&lsquo;<samp>me_method <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5833. <dd><p>Set motion estimation method.
  5834. </p>
  5835. <p>Possible values:
  5836. </p><dl compact="compact">
  5837. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  5838. <dd><p>zero motion estimation (fastest)
  5839. </p></dd>
  5840. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  5841. <dd><p>full motion estimation (slowest)
  5842. </p></dd>
  5843. <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
  5844. <dd><p>EPZS motion estimation (default)
  5845. </p></dd>
  5846. <dt>&lsquo;<samp>esa</samp>&rsquo;</dt>
  5847. <dd><p>esa motion estimation (alias for full)
  5848. </p></dd>
  5849. <dt>&lsquo;<samp>tesa</samp>&rsquo;</dt>
  5850. <dd><p>tesa motion estimation
  5851. </p></dd>
  5852. <dt>&lsquo;<samp>dia</samp>&rsquo;</dt>
  5853. <dd><p>dia motion estimation (alias for epzs)
  5854. </p></dd>
  5855. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  5856. <dd><p>log motion estimation
  5857. </p></dd>
  5858. <dt>&lsquo;<samp>phods</samp>&rsquo;</dt>
  5859. <dd><p>phods motion estimation
  5860. </p></dd>
  5861. <dt>&lsquo;<samp>x1</samp>&rsquo;</dt>
  5862. <dd><p>X1 motion estimation
  5863. </p></dd>
  5864. <dt>&lsquo;<samp>hex</samp>&rsquo;</dt>
  5865. <dd><p>hex motion estimation
  5866. </p></dd>
  5867. <dt>&lsquo;<samp>umh</samp>&rsquo;</dt>
  5868. <dd><p>umh motion estimation
  5869. </p></dd>
  5870. <dt>&lsquo;<samp>iter</samp>&rsquo;</dt>
  5871. <dd><p>iter motion estimation
  5872. </p></dd>
  5873. </dl>
  5874. </dd>
  5875. <dt>&lsquo;<samp>extradata_size <var>integer</var></samp>&rsquo;</dt>
  5876. <dd><p>Set extradata size.
  5877. </p>
  5878. </dd>
  5879. <dt>&lsquo;<samp>time_base <var>rational number</var></samp>&rsquo;</dt>
  5880. <dd><p>Set codec time base.
  5881. </p>
  5882. <p>It is the fundamental unit of time (in seconds) in terms of which
  5883. frame timestamps are represented. For fixed-fps content, timebase
  5884. should be <code>1 / frame_rate</code> and timestamp increments should be
  5885. identically 1.
  5886. </p>
  5887. </dd>
  5888. <dt>&lsquo;<samp>g <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5889. <dd><p>Set the group of picture (GOP) size. Default value is 12.
  5890. </p>
  5891. </dd>
  5892. <dt>&lsquo;<samp>ar <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>&rsquo;</dt>
  5893. <dd><p>Set audio sampling rate (in Hz).
  5894. </p>
  5895. </dd>
  5896. <dt>&lsquo;<samp>ac <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>&rsquo;</dt>
  5897. <dd><p>Set number of audio channels.
  5898. </p>
  5899. </dd>
  5900. <dt>&lsquo;<samp>cutoff <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
  5901. <dd><p>Set cutoff bandwidth. (Supported only by selected encoders, see
  5902. their respective documentation sections.)
  5903. </p>
  5904. </dd>
  5905. <dt>&lsquo;<samp>frame_size <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
  5906. <dd><p>Set audio frame size.
  5907. </p>
  5908. <p>Each submitted frame except the last must contain exactly frame_size
  5909. samples per channel. May be 0 when the codec has
  5910. CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
  5911. restricted. It is set by some decoders to indicate constant frame
  5912. size.
  5913. </p>
  5914. </dd>
  5915. <dt>&lsquo;<samp>frame_number <var>integer</var></samp>&rsquo;</dt>
  5916. <dd><p>Set the frame number.
  5917. </p>
  5918. </dd>
  5919. <dt>&lsquo;<samp>delay <var>integer</var></samp>&rsquo;</dt>
  5920. <dt>&lsquo;<samp>qcomp <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5921. <dd><p>Set video quantizer scale compression (VBR). It is used as a constant
  5922. in the ratecontrol equation. Recommended range for default rc_eq:
  5923. 0.0-1.0.
  5924. </p>
  5925. </dd>
  5926. <dt>&lsquo;<samp>qblur <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5927. <dd><p>Set video quantizer scale blur (VBR).
  5928. </p>
  5929. </dd>
  5930. <dt>&lsquo;<samp>qmin <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5931. <dd><p>Set min video quantizer scale (VBR). Must be included between -1 and
  5932. 69, default value is 2.
  5933. </p>
  5934. </dd>
  5935. <dt>&lsquo;<samp>qmax <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5936. <dd><p>Set max video quantizer scale (VBR). Must be included between -1 and
  5937. 1024, default value is 31.
  5938. </p>
  5939. </dd>
  5940. <dt>&lsquo;<samp>qdiff <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5941. <dd><p>Set max difference between the quantizer scale (VBR).
  5942. </p>
  5943. </dd>
  5944. <dt>&lsquo;<samp>bf <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5945. <dd><p>Set max number of B frames between non-B-frames.
  5946. </p>
  5947. <p>Must be an integer between -1 and 16. 0 means that B-frames are
  5948. disabled. If a value of -1 is used, it will choose an automatic value
  5949. depending on the encoder.
  5950. </p>
  5951. <p>Default value is 0.
  5952. </p>
  5953. </dd>
  5954. <dt>&lsquo;<samp>b_qfactor <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5955. <dd><p>Set qp factor between P and B frames.
  5956. </p>
  5957. </dd>
  5958. <dt>&lsquo;<samp>rc_strategy <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5959. <dd><p>Set ratecontrol method.
  5960. </p>
  5961. </dd>
  5962. <dt>&lsquo;<samp>b_strategy <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5963. <dd><p>Set strategy to choose between I/P/B-frames.
  5964. </p>
  5965. </dd>
  5966. <dt>&lsquo;<samp>ps <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5967. <dd><p>Set RTP payload size in bytes.
  5968. </p>
  5969. </dd>
  5970. <dt>&lsquo;<samp>mv_bits <var>integer</var></samp>&rsquo;</dt>
  5971. <dt>&lsquo;<samp>header_bits <var>integer</var></samp>&rsquo;</dt>
  5972. <dt>&lsquo;<samp>i_tex_bits <var>integer</var></samp>&rsquo;</dt>
  5973. <dt>&lsquo;<samp>p_tex_bits <var>integer</var></samp>&rsquo;</dt>
  5974. <dt>&lsquo;<samp>i_count <var>integer</var></samp>&rsquo;</dt>
  5975. <dt>&lsquo;<samp>p_count <var>integer</var></samp>&rsquo;</dt>
  5976. <dt>&lsquo;<samp>skip_count <var>integer</var></samp>&rsquo;</dt>
  5977. <dt>&lsquo;<samp>misc_bits <var>integer</var></samp>&rsquo;</dt>
  5978. <dt>&lsquo;<samp>frame_bits <var>integer</var></samp>&rsquo;</dt>
  5979. <dt>&lsquo;<samp>codec_tag <var>integer</var></samp>&rsquo;</dt>
  5980. <dt>&lsquo;<samp>bug <var>flags</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  5981. <dd><p>Workaround not auto detected encoder bugs.
  5982. </p>
  5983. <p>Possible values:
  5984. </p><dl compact="compact">
  5985. <dt>&lsquo;<samp>autodetect</samp>&rsquo;</dt>
  5986. <dt>&lsquo;<samp>old_msmpeg4</samp>&rsquo;</dt>
  5987. <dd><p>some old lavc generated msmpeg4v3 files (no autodetection)
  5988. </p></dd>
  5989. <dt>&lsquo;<samp>xvid_ilace</samp>&rsquo;</dt>
  5990. <dd><p>Xvid interlacing bug (autodetected if fourcc==XVIX)
  5991. </p></dd>
  5992. <dt>&lsquo;<samp>ump4</samp>&rsquo;</dt>
  5993. <dd><p>(autodetected if fourcc==UMP4)
  5994. </p></dd>
  5995. <dt>&lsquo;<samp>no_padding</samp>&rsquo;</dt>
  5996. <dd><p>padding bug (autodetected)
  5997. </p></dd>
  5998. <dt>&lsquo;<samp>amv</samp>&rsquo;</dt>
  5999. <dt>&lsquo;<samp>ac_vlc</samp>&rsquo;</dt>
  6000. <dd><p>illegal vlc bug (autodetected per fourcc)
  6001. </p></dd>
  6002. <dt>&lsquo;<samp>qpel_chroma</samp>&rsquo;</dt>
  6003. <dt>&lsquo;<samp>std_qpel</samp>&rsquo;</dt>
  6004. <dd><p>old standard qpel (autodetected per fourcc/version)
  6005. </p></dd>
  6006. <dt>&lsquo;<samp>qpel_chroma2</samp>&rsquo;</dt>
  6007. <dt>&lsquo;<samp>direct_blocksize</samp>&rsquo;</dt>
  6008. <dd><p>direct-qpel-blocksize bug (autodetected per fourcc/version)
  6009. </p></dd>
  6010. <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
  6011. <dd><p>edge padding bug (autodetected per fourcc/version)
  6012. </p></dd>
  6013. <dt>&lsquo;<samp>hpel_chroma</samp>&rsquo;</dt>
  6014. <dt>&lsquo;<samp>dc_clip</samp>&rsquo;</dt>
  6015. <dt>&lsquo;<samp>ms</samp>&rsquo;</dt>
  6016. <dd><p>Workaround various bugs in microsoft broken decoders.
  6017. </p></dd>
  6018. <dt>&lsquo;<samp>trunc</samp>&rsquo;</dt>
  6019. <dd><p>trancated frames
  6020. </p></dd>
  6021. </dl>
  6022. </dd>
  6023. <dt>&lsquo;<samp>lelim <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6024. <dd><p>Set single coefficient elimination threshold for luminance (negative
  6025. values also consider DC coefficient).
  6026. </p>
  6027. </dd>
  6028. <dt>&lsquo;<samp>celim <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6029. <dd><p>Set single coefficient elimination threshold for chrominance (negative
  6030. values also consider dc coefficient)
  6031. </p>
  6032. </dd>
  6033. <dt>&lsquo;<samp>strict <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp>&rsquo;</dt>
  6034. <dd><p>Specify how strictly to follow the standards.
  6035. </p>
  6036. <p>Possible values:
  6037. </p><dl compact="compact">
  6038. <dt>&lsquo;<samp>very</samp>&rsquo;</dt>
  6039. <dd><p>strictly conform to an older more strict version of the spec or reference software
  6040. </p></dd>
  6041. <dt>&lsquo;<samp>strict</samp>&rsquo;</dt>
  6042. <dd><p>strictly conform to all the things in the spec no matter what consequences
  6043. </p></dd>
  6044. <dt>&lsquo;<samp>normal</samp>&rsquo;</dt>
  6045. <dt>&lsquo;<samp>unofficial</samp>&rsquo;</dt>
  6046. <dd><p>allow unofficial extensions
  6047. </p></dd>
  6048. <dt>&lsquo;<samp>experimental</samp>&rsquo;</dt>
  6049. <dd><p>allow non standardized experimental things, experimental
  6050. (unfinished/work in progress/not well tested) decoders and encoders.
  6051. Note: experimental decoders can pose a security risk, do not use this for
  6052. decoding untrusted input.
  6053. </p></dd>
  6054. </dl>
  6055. </dd>
  6056. <dt>&lsquo;<samp>b_qoffset <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6057. <dd><p>Set QP offset between P and B frames.
  6058. </p>
  6059. </dd>
  6060. <dt>&lsquo;<samp>err_detect <var>flags</var> (<em>decoding,audio,video</em>)</samp>&rsquo;</dt>
  6061. <dd><p>Set error detection flags.
  6062. </p>
  6063. <p>Possible values:
  6064. </p><dl compact="compact">
  6065. <dt>&lsquo;<samp>crccheck</samp>&rsquo;</dt>
  6066. <dd><p>verify embedded CRCs
  6067. </p></dd>
  6068. <dt>&lsquo;<samp>bitstream</samp>&rsquo;</dt>
  6069. <dd><p>detect bitstream specification deviations
  6070. </p></dd>
  6071. <dt>&lsquo;<samp>buffer</samp>&rsquo;</dt>
  6072. <dd><p>detect improper bitstream length
  6073. </p></dd>
  6074. <dt>&lsquo;<samp>explode</samp>&rsquo;</dt>
  6075. <dd><p>abort decoding on minor error detection
  6076. </p></dd>
  6077. <dt>&lsquo;<samp>ignore_err</samp>&rsquo;</dt>
  6078. <dd><p>ignore decoding errors, and continue decoding.
  6079. This is useful if you want to analyze the content of a video and thus want
  6080. everything to be decoded no matter what. This option will not result in a video
  6081. that is pleasing to watch in case of errors.
  6082. </p></dd>
  6083. <dt>&lsquo;<samp>careful</samp>&rsquo;</dt>
  6084. <dd><p>consider things that violate the spec and have not been seen in the wild as errors
  6085. </p></dd>
  6086. <dt>&lsquo;<samp>compliant</samp>&rsquo;</dt>
  6087. <dd><p>consider all spec non compliancies as errors
  6088. </p></dd>
  6089. <dt>&lsquo;<samp>aggressive</samp>&rsquo;</dt>
  6090. <dd><p>consider things that a sane encoder should not do as an error
  6091. </p></dd>
  6092. </dl>
  6093. </dd>
  6094. <dt>&lsquo;<samp>has_b_frames <var>integer</var></samp>&rsquo;</dt>
  6095. <dt>&lsquo;<samp>block_align <var>integer</var></samp>&rsquo;</dt>
  6096. <dt>&lsquo;<samp>mpeg_quant <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6097. <dd><p>Use MPEG quantizers instead of H.263.
  6098. </p>
  6099. </dd>
  6100. <dt>&lsquo;<samp>qsquish <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6101. <dd><p>How to keep quantizer between qmin and qmax (0 = clip, 1 = use
  6102. differentiable function).
  6103. </p>
  6104. </dd>
  6105. <dt>&lsquo;<samp>rc_qmod_amp <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6106. <dd><p>Set experimental quantizer modulation.
  6107. </p>
  6108. </dd>
  6109. <dt>&lsquo;<samp>rc_qmod_freq <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6110. <dd><p>Set experimental quantizer modulation.
  6111. </p>
  6112. </dd>
  6113. <dt>&lsquo;<samp>rc_override_count <var>integer</var></samp>&rsquo;</dt>
  6114. <dt>&lsquo;<samp>rc_eq <var>string</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6115. <dd><p>Set rate control equation. When computing the expression, besides the
  6116. standard functions defined in the section &rsquo;Expression Evaluation&rsquo;, the
  6117. following functions are available: bits2qp(bits), qp2bits(qp). Also
  6118. the following constants are available: iTex pTex tex mv fCode iCount
  6119. mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
  6120. avgTex.
  6121. </p>
  6122. </dd>
  6123. <dt>&lsquo;<samp>maxrate <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6124. <dd><p>Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
  6125. </p>
  6126. </dd>
  6127. <dt>&lsquo;<samp>minrate <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6128. <dd><p>Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
  6129. encode. It is of little use elsewise.
  6130. </p>
  6131. </dd>
  6132. <dt>&lsquo;<samp>bufsize <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6133. <dd><p>Set ratecontrol buffer size (in bits).
  6134. </p>
  6135. </dd>
  6136. <dt>&lsquo;<samp>rc_buf_aggressivity <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6137. <dd><p>Currently useless.
  6138. </p>
  6139. </dd>
  6140. <dt>&lsquo;<samp>i_qfactor <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6141. <dd><p>Set QP factor between P and I frames.
  6142. </p>
  6143. </dd>
  6144. <dt>&lsquo;<samp>i_qoffset <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6145. <dd><p>Set QP offset between P and I frames.
  6146. </p>
  6147. </dd>
  6148. <dt>&lsquo;<samp>rc_init_cplx <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6149. <dd><p>Set initial complexity for 1-pass encoding.
  6150. </p>
  6151. </dd>
  6152. <dt>&lsquo;<samp>dct <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6153. <dd><p>Set DCT algorithm.
  6154. </p>
  6155. <p>Possible values:
  6156. </p><dl compact="compact">
  6157. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  6158. <dd><p>autoselect a good one (default)
  6159. </p></dd>
  6160. <dt>&lsquo;<samp>fastint</samp>&rsquo;</dt>
  6161. <dd><p>fast integer
  6162. </p></dd>
  6163. <dt>&lsquo;<samp>int</samp>&rsquo;</dt>
  6164. <dd><p>accurate integer
  6165. </p></dd>
  6166. <dt>&lsquo;<samp>mmx</samp>&rsquo;</dt>
  6167. <dt>&lsquo;<samp>altivec</samp>&rsquo;</dt>
  6168. <dt>&lsquo;<samp>faan</samp>&rsquo;</dt>
  6169. <dd><p>floating point AAN DCT
  6170. </p></dd>
  6171. </dl>
  6172. </dd>
  6173. <dt>&lsquo;<samp>lumi_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6174. <dd><p>Compress bright areas stronger than medium ones.
  6175. </p>
  6176. </dd>
  6177. <dt>&lsquo;<samp>tcplx_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6178. <dd><p>Set temporal complexity masking.
  6179. </p>
  6180. </dd>
  6181. <dt>&lsquo;<samp>scplx_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6182. <dd><p>Set spatial complexity masking.
  6183. </p>
  6184. </dd>
  6185. <dt>&lsquo;<samp>p_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6186. <dd><p>Set inter masking.
  6187. </p>
  6188. </dd>
  6189. <dt>&lsquo;<samp>dark_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6190. <dd><p>Compress dark areas stronger than medium ones.
  6191. </p>
  6192. </dd>
  6193. <dt>&lsquo;<samp>idct <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  6194. <dd><p>Select IDCT implementation.
  6195. </p>
  6196. <p>Possible values:
  6197. </p><dl compact="compact">
  6198. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  6199. <dt>&lsquo;<samp>int</samp>&rsquo;</dt>
  6200. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  6201. <dt>&lsquo;<samp>simplemmx</samp>&rsquo;</dt>
  6202. <dt>&lsquo;<samp>simpleauto</samp>&rsquo;</dt>
  6203. <dd><p>Automatically pick a IDCT compatible with the simple one
  6204. </p>
  6205. </dd>
  6206. <dt>&lsquo;<samp>arm</samp>&rsquo;</dt>
  6207. <dt>&lsquo;<samp>altivec</samp>&rsquo;</dt>
  6208. <dt>&lsquo;<samp>sh4</samp>&rsquo;</dt>
  6209. <dt>&lsquo;<samp>simplearm</samp>&rsquo;</dt>
  6210. <dt>&lsquo;<samp>simplearmv5te</samp>&rsquo;</dt>
  6211. <dt>&lsquo;<samp>simplearmv6</samp>&rsquo;</dt>
  6212. <dt>&lsquo;<samp>simpleneon</samp>&rsquo;</dt>
  6213. <dt>&lsquo;<samp>simplealpha</samp>&rsquo;</dt>
  6214. <dt>&lsquo;<samp>ipp</samp>&rsquo;</dt>
  6215. <dt>&lsquo;<samp>xvidmmx</samp>&rsquo;</dt>
  6216. <dt>&lsquo;<samp>faani</samp>&rsquo;</dt>
  6217. <dd><p>floating point AAN IDCT
  6218. </p></dd>
  6219. </dl>
  6220. </dd>
  6221. <dt>&lsquo;<samp>slice_count <var>integer</var></samp>&rsquo;</dt>
  6222. <dt>&lsquo;<samp>ec <var>flags</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  6223. <dd><p>Set error concealment strategy.
  6224. </p>
  6225. <p>Possible values:
  6226. </p><dl compact="compact">
  6227. <dt>&lsquo;<samp>guess_mvs</samp>&rsquo;</dt>
  6228. <dd><p>iterative motion vector (MV) search (slow)
  6229. </p></dd>
  6230. <dt>&lsquo;<samp>deblock</samp>&rsquo;</dt>
  6231. <dd><p>use strong deblock filter for damaged MBs
  6232. </p></dd>
  6233. <dt>&lsquo;<samp>favor_inter</samp>&rsquo;</dt>
  6234. <dd><p>favor predicting from the previous frame instead of the current
  6235. </p></dd>
  6236. </dl>
  6237. </dd>
  6238. <dt>&lsquo;<samp>bits_per_coded_sample <var>integer</var></samp>&rsquo;</dt>
  6239. <dt>&lsquo;<samp>pred <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6240. <dd><p>Set prediction method.
  6241. </p>
  6242. <p>Possible values:
  6243. </p><dl compact="compact">
  6244. <dt>&lsquo;<samp>left</samp>&rsquo;</dt>
  6245. <dt>&lsquo;<samp>plane</samp>&rsquo;</dt>
  6246. <dt>&lsquo;<samp>median</samp>&rsquo;</dt>
  6247. </dl>
  6248. </dd>
  6249. <dt>&lsquo;<samp>aspect <var>rational number</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6250. <dd><p>Set sample aspect ratio.
  6251. </p>
  6252. </dd>
  6253. <dt>&lsquo;<samp>sar <var>rational number</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6254. <dd><p>Set sample aspect ratio. Alias to <var>aspect</var>.
  6255. </p>
  6256. </dd>
  6257. <dt>&lsquo;<samp>debug <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>&rsquo;</dt>
  6258. <dd><p>Print specific debug info.
  6259. </p>
  6260. <p>Possible values:
  6261. </p><dl compact="compact">
  6262. <dt>&lsquo;<samp>pict</samp>&rsquo;</dt>
  6263. <dd><p>picture info
  6264. </p></dd>
  6265. <dt>&lsquo;<samp>rc</samp>&rsquo;</dt>
  6266. <dd><p>rate control
  6267. </p></dd>
  6268. <dt>&lsquo;<samp>bitstream</samp>&rsquo;</dt>
  6269. <dt>&lsquo;<samp>mb_type</samp>&rsquo;</dt>
  6270. <dd><p>macroblock (MB) type
  6271. </p></dd>
  6272. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  6273. <dd><p>per-block quantization parameter (QP)
  6274. </p></dd>
  6275. <dt>&lsquo;<samp>dct_coeff</samp>&rsquo;</dt>
  6276. <dt>&lsquo;<samp>green_metadata</samp>&rsquo;</dt>
  6277. <dd><p>display complexity metadata for the upcoming frame, GoP or for a given duration.
  6278. </p>
  6279. </dd>
  6280. <dt>&lsquo;<samp>skip</samp>&rsquo;</dt>
  6281. <dt>&lsquo;<samp>startcode</samp>&rsquo;</dt>
  6282. <dt>&lsquo;<samp>er</samp>&rsquo;</dt>
  6283. <dd><p>error recognition
  6284. </p></dd>
  6285. <dt>&lsquo;<samp>mmco</samp>&rsquo;</dt>
  6286. <dd><p>memory management control operations (H.264)
  6287. </p></dd>
  6288. <dt>&lsquo;<samp>bugs</samp>&rsquo;</dt>
  6289. <dt>&lsquo;<samp>buffers</samp>&rsquo;</dt>
  6290. <dd><p>picture buffer allocations
  6291. </p></dd>
  6292. <dt>&lsquo;<samp>thread_ops</samp>&rsquo;</dt>
  6293. <dd><p>threading operations
  6294. </p></dd>
  6295. <dt>&lsquo;<samp>nomc</samp>&rsquo;</dt>
  6296. <dd><p>skip motion compensation
  6297. </p></dd>
  6298. </dl>
  6299. </dd>
  6300. <dt>&lsquo;<samp>cmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6301. <dd><p>Set full pel me compare function.
  6302. </p>
  6303. <p>Possible values:
  6304. </p><dl compact="compact">
  6305. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6306. <dd><p>sum of absolute differences, fast (default)
  6307. </p></dd>
  6308. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6309. <dd><p>sum of squared errors
  6310. </p></dd>
  6311. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6312. <dd><p>sum of absolute Hadamard transformed differences
  6313. </p></dd>
  6314. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6315. <dd><p>sum of absolute DCT transformed differences
  6316. </p></dd>
  6317. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6318. <dd><p>sum of squared quantization errors (avoid, low quality)
  6319. </p></dd>
  6320. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6321. <dd><p>number of bits needed for the block
  6322. </p></dd>
  6323. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6324. <dd><p>rate distortion optimal, slow
  6325. </p></dd>
  6326. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6327. <dd><p>0
  6328. </p></dd>
  6329. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6330. <dd><p>sum of absolute vertical differences
  6331. </p></dd>
  6332. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6333. <dd><p>sum of squared vertical differences
  6334. </p></dd>
  6335. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6336. <dd><p>noise preserving sum of squared differences
  6337. </p></dd>
  6338. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6339. <dd><p>5/3 wavelet, only used in snow
  6340. </p></dd>
  6341. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6342. <dd><p>9/7 wavelet, only used in snow
  6343. </p></dd>
  6344. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6345. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6346. </dl>
  6347. </dd>
  6348. <dt>&lsquo;<samp>subcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6349. <dd><p>Set sub pel me compare function.
  6350. </p>
  6351. <p>Possible values:
  6352. </p><dl compact="compact">
  6353. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6354. <dd><p>sum of absolute differences, fast (default)
  6355. </p></dd>
  6356. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6357. <dd><p>sum of squared errors
  6358. </p></dd>
  6359. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6360. <dd><p>sum of absolute Hadamard transformed differences
  6361. </p></dd>
  6362. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6363. <dd><p>sum of absolute DCT transformed differences
  6364. </p></dd>
  6365. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6366. <dd><p>sum of squared quantization errors (avoid, low quality)
  6367. </p></dd>
  6368. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6369. <dd><p>number of bits needed for the block
  6370. </p></dd>
  6371. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6372. <dd><p>rate distortion optimal, slow
  6373. </p></dd>
  6374. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6375. <dd><p>0
  6376. </p></dd>
  6377. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6378. <dd><p>sum of absolute vertical differences
  6379. </p></dd>
  6380. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6381. <dd><p>sum of squared vertical differences
  6382. </p></dd>
  6383. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6384. <dd><p>noise preserving sum of squared differences
  6385. </p></dd>
  6386. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6387. <dd><p>5/3 wavelet, only used in snow
  6388. </p></dd>
  6389. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6390. <dd><p>9/7 wavelet, only used in snow
  6391. </p></dd>
  6392. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6393. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6394. </dl>
  6395. </dd>
  6396. <dt>&lsquo;<samp>mbcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6397. <dd><p>Set macroblock compare function.
  6398. </p>
  6399. <p>Possible values:
  6400. </p><dl compact="compact">
  6401. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6402. <dd><p>sum of absolute differences, fast (default)
  6403. </p></dd>
  6404. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6405. <dd><p>sum of squared errors
  6406. </p></dd>
  6407. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6408. <dd><p>sum of absolute Hadamard transformed differences
  6409. </p></dd>
  6410. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6411. <dd><p>sum of absolute DCT transformed differences
  6412. </p></dd>
  6413. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6414. <dd><p>sum of squared quantization errors (avoid, low quality)
  6415. </p></dd>
  6416. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6417. <dd><p>number of bits needed for the block
  6418. </p></dd>
  6419. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6420. <dd><p>rate distortion optimal, slow
  6421. </p></dd>
  6422. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6423. <dd><p>0
  6424. </p></dd>
  6425. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6426. <dd><p>sum of absolute vertical differences
  6427. </p></dd>
  6428. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6429. <dd><p>sum of squared vertical differences
  6430. </p></dd>
  6431. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6432. <dd><p>noise preserving sum of squared differences
  6433. </p></dd>
  6434. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6435. <dd><p>5/3 wavelet, only used in snow
  6436. </p></dd>
  6437. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6438. <dd><p>9/7 wavelet, only used in snow
  6439. </p></dd>
  6440. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6441. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6442. </dl>
  6443. </dd>
  6444. <dt>&lsquo;<samp>ildctcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6445. <dd><p>Set interlaced dct compare function.
  6446. </p>
  6447. <p>Possible values:
  6448. </p><dl compact="compact">
  6449. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6450. <dd><p>sum of absolute differences, fast (default)
  6451. </p></dd>
  6452. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6453. <dd><p>sum of squared errors
  6454. </p></dd>
  6455. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6456. <dd><p>sum of absolute Hadamard transformed differences
  6457. </p></dd>
  6458. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6459. <dd><p>sum of absolute DCT transformed differences
  6460. </p></dd>
  6461. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6462. <dd><p>sum of squared quantization errors (avoid, low quality)
  6463. </p></dd>
  6464. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6465. <dd><p>number of bits needed for the block
  6466. </p></dd>
  6467. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6468. <dd><p>rate distortion optimal, slow
  6469. </p></dd>
  6470. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6471. <dd><p>0
  6472. </p></dd>
  6473. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6474. <dd><p>sum of absolute vertical differences
  6475. </p></dd>
  6476. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6477. <dd><p>sum of squared vertical differences
  6478. </p></dd>
  6479. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6480. <dd><p>noise preserving sum of squared differences
  6481. </p></dd>
  6482. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6483. <dd><p>5/3 wavelet, only used in snow
  6484. </p></dd>
  6485. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6486. <dd><p>9/7 wavelet, only used in snow
  6487. </p></dd>
  6488. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6489. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6490. </dl>
  6491. </dd>
  6492. <dt>&lsquo;<samp>dia_size <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6493. <dd><p>Set diamond type &amp; size for motion estimation.
  6494. </p><dl compact="compact">
  6495. <dt>&lsquo;<samp>(1024, INT_MAX)</samp>&rsquo;</dt>
  6496. <dd><p>full motion estimation(slowest)
  6497. </p></dd>
  6498. <dt>&lsquo;<samp>(768, 1024]</samp>&rsquo;</dt>
  6499. <dd><p>umh motion estimation
  6500. </p></dd>
  6501. <dt>&lsquo;<samp>(512, 768]</samp>&rsquo;</dt>
  6502. <dd><p>hex motion estimation
  6503. </p></dd>
  6504. <dt>&lsquo;<samp>(256, 512]</samp>&rsquo;</dt>
  6505. <dd><p>l2s diamond motion estimation
  6506. </p></dd>
  6507. <dt>&lsquo;<samp>[2,256]</samp>&rsquo;</dt>
  6508. <dd><p>var diamond motion estimation
  6509. </p></dd>
  6510. <dt>&lsquo;<samp>(-1, 2)</samp>&rsquo;</dt>
  6511. <dd><p>small diamond motion estimation
  6512. </p></dd>
  6513. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  6514. <dd><p>funny diamond motion estimation
  6515. </p></dd>
  6516. <dt>&lsquo;<samp>(INT_MIN, -1)</samp>&rsquo;</dt>
  6517. <dd><p>sab diamond motion estimation
  6518. </p></dd>
  6519. </dl>
  6520. </dd>
  6521. <dt>&lsquo;<samp>last_pred <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6522. <dd><p>Set amount of motion predictors from the previous frame.
  6523. </p>
  6524. </dd>
  6525. <dt>&lsquo;<samp>preme <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6526. <dd><p>Set pre motion estimation.
  6527. </p>
  6528. </dd>
  6529. <dt>&lsquo;<samp>precmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6530. <dd><p>Set pre motion estimation compare function.
  6531. </p>
  6532. <p>Possible values:
  6533. </p><dl compact="compact">
  6534. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6535. <dd><p>sum of absolute differences, fast (default)
  6536. </p></dd>
  6537. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6538. <dd><p>sum of squared errors
  6539. </p></dd>
  6540. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6541. <dd><p>sum of absolute Hadamard transformed differences
  6542. </p></dd>
  6543. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6544. <dd><p>sum of absolute DCT transformed differences
  6545. </p></dd>
  6546. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6547. <dd><p>sum of squared quantization errors (avoid, low quality)
  6548. </p></dd>
  6549. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6550. <dd><p>number of bits needed for the block
  6551. </p></dd>
  6552. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6553. <dd><p>rate distortion optimal, slow
  6554. </p></dd>
  6555. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6556. <dd><p>0
  6557. </p></dd>
  6558. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6559. <dd><p>sum of absolute vertical differences
  6560. </p></dd>
  6561. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6562. <dd><p>sum of squared vertical differences
  6563. </p></dd>
  6564. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6565. <dd><p>noise preserving sum of squared differences
  6566. </p></dd>
  6567. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6568. <dd><p>5/3 wavelet, only used in snow
  6569. </p></dd>
  6570. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6571. <dd><p>9/7 wavelet, only used in snow
  6572. </p></dd>
  6573. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6574. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6575. </dl>
  6576. </dd>
  6577. <dt>&lsquo;<samp>pre_dia_size <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6578. <dd><p>Set diamond type &amp; size for motion estimation pre-pass.
  6579. </p>
  6580. </dd>
  6581. <dt>&lsquo;<samp>subq <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6582. <dd><p>Set sub pel motion estimation quality.
  6583. </p>
  6584. </dd>
  6585. <dt>&lsquo;<samp>dtg_active_format <var>integer</var></samp>&rsquo;</dt>
  6586. <dt>&lsquo;<samp>me_range <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6587. <dd><p>Set limit motion vectors range (1023 for DivX player).
  6588. </p>
  6589. </dd>
  6590. <dt>&lsquo;<samp>ibias <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6591. <dd><p>Set intra quant bias.
  6592. </p>
  6593. </dd>
  6594. <dt>&lsquo;<samp>pbias <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6595. <dd><p>Set inter quant bias.
  6596. </p>
  6597. </dd>
  6598. <dt>&lsquo;<samp>color_table_id <var>integer</var></samp>&rsquo;</dt>
  6599. <dt>&lsquo;<samp>global_quality <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6600. <dt>&lsquo;<samp>coder <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6601. <dd>
  6602. <p>Possible values:
  6603. </p><dl compact="compact">
  6604. <dt>&lsquo;<samp>vlc</samp>&rsquo;</dt>
  6605. <dd><p>variable length coder / huffman coder
  6606. </p></dd>
  6607. <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
  6608. <dd><p>arithmetic coder
  6609. </p></dd>
  6610. <dt>&lsquo;<samp>raw</samp>&rsquo;</dt>
  6611. <dd><p>raw (no encoding)
  6612. </p></dd>
  6613. <dt>&lsquo;<samp>rle</samp>&rsquo;</dt>
  6614. <dd><p>run-length coder
  6615. </p></dd>
  6616. <dt>&lsquo;<samp>deflate</samp>&rsquo;</dt>
  6617. <dd><p>deflate-based coder
  6618. </p></dd>
  6619. </dl>
  6620. </dd>
  6621. <dt>&lsquo;<samp>context <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6622. <dd><p>Set context model.
  6623. </p>
  6624. </dd>
  6625. <dt>&lsquo;<samp>slice_flags <var>integer</var></samp>&rsquo;</dt>
  6626. <dt>&lsquo;<samp>mbd <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6627. <dd><p>Set macroblock decision algorithm (high quality mode).
  6628. </p>
  6629. <p>Possible values:
  6630. </p><dl compact="compact">
  6631. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  6632. <dd><p>use mbcmp (default)
  6633. </p></dd>
  6634. <dt>&lsquo;<samp>bits</samp>&rsquo;</dt>
  6635. <dd><p>use fewest bits
  6636. </p></dd>
  6637. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6638. <dd><p>use best rate distortion
  6639. </p></dd>
  6640. </dl>
  6641. </dd>
  6642. <dt>&lsquo;<samp>stream_codec_tag <var>integer</var></samp>&rsquo;</dt>
  6643. <dt>&lsquo;<samp>sc_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6644. <dd><p>Set scene change threshold.
  6645. </p>
  6646. </dd>
  6647. <dt>&lsquo;<samp>lmin <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6648. <dd><p>Set min lagrange factor (VBR).
  6649. </p>
  6650. </dd>
  6651. <dt>&lsquo;<samp>lmax <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6652. <dd><p>Set max lagrange factor (VBR).
  6653. </p>
  6654. </dd>
  6655. <dt>&lsquo;<samp>nr <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6656. <dd><p>Set noise reduction.
  6657. </p>
  6658. </dd>
  6659. <dt>&lsquo;<samp>rc_init_occupancy <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6660. <dd><p>Set number of bits which should be loaded into the rc buffer before
  6661. decoding starts.
  6662. </p>
  6663. </dd>
  6664. <dt>&lsquo;<samp>flags2 <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>&rsquo;</dt>
  6665. <dd>
  6666. <p>Possible values:
  6667. </p><dl compact="compact">
  6668. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  6669. <dd><p>Allow non spec compliant speedup tricks.
  6670. </p></dd>
  6671. <dt>&lsquo;<samp>noout</samp>&rsquo;</dt>
  6672. <dd><p>Skip bitstream encoding.
  6673. </p></dd>
  6674. <dt>&lsquo;<samp>ignorecrop</samp>&rsquo;</dt>
  6675. <dd><p>Ignore cropping information from sps.
  6676. </p></dd>
  6677. <dt>&lsquo;<samp>local_header</samp>&rsquo;</dt>
  6678. <dd><p>Place global headers at every keyframe instead of in extradata.
  6679. </p></dd>
  6680. <dt>&lsquo;<samp>chunks</samp>&rsquo;</dt>
  6681. <dd><p>Frame data might be split into multiple chunks.
  6682. </p></dd>
  6683. <dt>&lsquo;<samp>showall</samp>&rsquo;</dt>
  6684. <dd><p>Show all frames before the first keyframe.
  6685. </p></dd>
  6686. <dt>&lsquo;<samp>export_mvs</samp>&rsquo;</dt>
  6687. <dd><p>Export motion vectors into frame side-data (see <code>AV_FRAME_DATA_MOTION_VECTORS</code>)
  6688. for codecs that support it. See also &lsquo;<tt>doc/examples/export_mvs.c</tt>&rsquo;.
  6689. </p></dd>
  6690. <dt>&lsquo;<samp>skip_manual</samp>&rsquo;</dt>
  6691. <dd><p>Do not skip samples and export skip information as frame side data.
  6692. </p></dd>
  6693. <dt>&lsquo;<samp>ass_ro_flush_noop</samp>&rsquo;</dt>
  6694. <dd><p>Do not reset ASS ReadOrder field on flush.
  6695. </p></dd>
  6696. </dl>
  6697. </dd>
  6698. <dt>&lsquo;<samp>export_side_data <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>&rsquo;</dt>
  6699. <dd>
  6700. <p>Possible values:
  6701. </p><dl compact="compact">
  6702. <dt>&lsquo;<samp>mvs</samp>&rsquo;</dt>
  6703. <dd><p>Export motion vectors into frame side-data (see <code>AV_FRAME_DATA_MOTION_VECTORS</code>)
  6704. for codecs that support it. See also &lsquo;<tt>doc/examples/export_mvs.c</tt>&rsquo;.
  6705. </p></dd>
  6706. <dt>&lsquo;<samp>prft</samp>&rsquo;</dt>
  6707. <dd><p>Export encoder Producer Reference Time into packet side-data (see <code>AV_PKT_DATA_PRFT</code>)
  6708. for codecs that support it.
  6709. </p></dd>
  6710. </dl>
  6711. </dd>
  6712. <dt>&lsquo;<samp>error <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6713. <dt>&lsquo;<samp>qns <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6714. <dd><p>Deprecated, use mpegvideo private options instead.
  6715. </p>
  6716. </dd>
  6717. <dt>&lsquo;<samp>threads <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  6718. <dd><p>Set the number of threads to be used, in case the selected codec
  6719. implementation supports multi-threading.
  6720. </p>
  6721. <p>Possible values:
  6722. </p><dl compact="compact">
  6723. <dt>&lsquo;<samp>auto, 0</samp>&rsquo;</dt>
  6724. <dd><p>automatically select the number of threads to set
  6725. </p></dd>
  6726. </dl>
  6727. <p>Default value is &lsquo;<samp>auto</samp>&rsquo;.
  6728. </p>
  6729. </dd>
  6730. <dt>&lsquo;<samp>me_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6731. <dd><p>Set motion estimation threshold.
  6732. </p>
  6733. </dd>
  6734. <dt>&lsquo;<samp>mb_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6735. <dd><p>Set macroblock threshold.
  6736. </p>
  6737. </dd>
  6738. <dt>&lsquo;<samp>dc <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6739. <dd><p>Set intra_dc_precision.
  6740. </p>
  6741. </dd>
  6742. <dt>&lsquo;<samp>nssew <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6743. <dd><p>Set nsse weight.
  6744. </p>
  6745. </dd>
  6746. <dt>&lsquo;<samp>skip_top <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  6747. <dd><p>Set number of macroblock rows at the top which are skipped.
  6748. </p>
  6749. </dd>
  6750. <dt>&lsquo;<samp>skip_bottom <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  6751. <dd><p>Set number of macroblock rows at the bottom which are skipped.
  6752. </p>
  6753. </dd>
  6754. <dt>&lsquo;<samp>profile <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6755. <dd>
  6756. <p>Set encoder codec profile. Default value is &lsquo;<samp>unknown</samp>&rsquo;. Encoder specific
  6757. profiles are documented in the relevant encoder documentation.
  6758. </p>
  6759. </dd>
  6760. <dt>&lsquo;<samp>level <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6761. <dd>
  6762. <p>Possible values:
  6763. </p><dl compact="compact">
  6764. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  6765. </dl>
  6766. </dd>
  6767. <dt>&lsquo;<samp>lowres <var>integer</var> (<em>decoding,audio,video</em>)</samp>&rsquo;</dt>
  6768. <dd><p>Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
  6769. </p>
  6770. </dd>
  6771. <dt>&lsquo;<samp>skip_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6772. <dd><p>Set frame skip threshold.
  6773. </p>
  6774. </dd>
  6775. <dt>&lsquo;<samp>skip_factor <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6776. <dd><p>Set frame skip factor.
  6777. </p>
  6778. </dd>
  6779. <dt>&lsquo;<samp>skip_exp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6780. <dd><p>Set frame skip exponent.
  6781. Negative values behave identical to the corresponding positive ones, except
  6782. that the score is normalized.
  6783. Positive values exist primarily for compatibility reasons and are not so useful.
  6784. </p>
  6785. </dd>
  6786. <dt>&lsquo;<samp>skipcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6787. <dd><p>Set frame skip compare function.
  6788. </p>
  6789. <p>Possible values:
  6790. </p><dl compact="compact">
  6791. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6792. <dd><p>sum of absolute differences, fast (default)
  6793. </p></dd>
  6794. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6795. <dd><p>sum of squared errors
  6796. </p></dd>
  6797. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6798. <dd><p>sum of absolute Hadamard transformed differences
  6799. </p></dd>
  6800. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6801. <dd><p>sum of absolute DCT transformed differences
  6802. </p></dd>
  6803. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6804. <dd><p>sum of squared quantization errors (avoid, low quality)
  6805. </p></dd>
  6806. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6807. <dd><p>number of bits needed for the block
  6808. </p></dd>
  6809. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6810. <dd><p>rate distortion optimal, slow
  6811. </p></dd>
  6812. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6813. <dd><p>0
  6814. </p></dd>
  6815. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6816. <dd><p>sum of absolute vertical differences
  6817. </p></dd>
  6818. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6819. <dd><p>sum of squared vertical differences
  6820. </p></dd>
  6821. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6822. <dd><p>noise preserving sum of squared differences
  6823. </p></dd>
  6824. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6825. <dd><p>5/3 wavelet, only used in snow
  6826. </p></dd>
  6827. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6828. <dd><p>9/7 wavelet, only used in snow
  6829. </p></dd>
  6830. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6831. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6832. </dl>
  6833. </dd>
  6834. <dt>&lsquo;<samp>border_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6835. <dd><p>Increase the quantizer for macroblocks close to borders.
  6836. </p>
  6837. </dd>
  6838. <dt>&lsquo;<samp>mblmin <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6839. <dd><p>Set min macroblock lagrange factor (VBR).
  6840. </p>
  6841. </dd>
  6842. <dt>&lsquo;<samp>mblmax <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6843. <dd><p>Set max macroblock lagrange factor (VBR).
  6844. </p>
  6845. </dd>
  6846. <dt>&lsquo;<samp>mepc <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6847. <dd><p>Set motion estimation bitrate penalty compensation (1.0 = 256).
  6848. </p>
  6849. </dd>
  6850. <dt>&lsquo;<samp>skip_loop_filter <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  6851. <dt>&lsquo;<samp>skip_idct <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  6852. <dt>&lsquo;<samp>skip_frame <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  6853. <dd>
  6854. <p>Make decoder discard processing depending on the frame type selected
  6855. by the option value.
  6856. </p>
  6857. <p>&lsquo;<samp>skip_loop_filter</samp>&rsquo; skips frame loop filtering, &lsquo;<samp>skip_idct</samp>&rsquo;
  6858. skips frame IDCT/dequantization, &lsquo;<samp>skip_frame</samp>&rsquo; skips decoding.
  6859. </p>
  6860. <p>Possible values:
  6861. </p><dl compact="compact">
  6862. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  6863. <dd><p>Discard no frame.
  6864. </p>
  6865. </dd>
  6866. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  6867. <dd><p>Discard useless frames like 0-sized frames.
  6868. </p>
  6869. </dd>
  6870. <dt>&lsquo;<samp>noref</samp>&rsquo;</dt>
  6871. <dd><p>Discard all non-reference frames.
  6872. </p>
  6873. </dd>
  6874. <dt>&lsquo;<samp>bidir</samp>&rsquo;</dt>
  6875. <dd><p>Discard all bidirectional frames.
  6876. </p>
  6877. </dd>
  6878. <dt>&lsquo;<samp>nokey</samp>&rsquo;</dt>
  6879. <dd><p>Discard all frames excepts keyframes.
  6880. </p>
  6881. </dd>
  6882. <dt>&lsquo;<samp>nointra</samp>&rsquo;</dt>
  6883. <dd><p>Discard all frames except I frames.
  6884. </p>
  6885. </dd>
  6886. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  6887. <dd><p>Discard all frames.
  6888. </p></dd>
  6889. </dl>
  6890. <p>Default value is &lsquo;<samp>default</samp>&rsquo;.
  6891. </p>
  6892. </dd>
  6893. <dt>&lsquo;<samp>bidir_refine <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6894. <dd><p>Refine the two motion vectors used in bidirectional macroblocks.
  6895. </p>
  6896. </dd>
  6897. <dt>&lsquo;<samp>brd_scale <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6898. <dd><p>Downscale frames for dynamic B-frame decision.
  6899. </p>
  6900. </dd>
  6901. <dt>&lsquo;<samp>keyint_min <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6902. <dd><p>Set minimum interval between IDR-frames.
  6903. </p>
  6904. </dd>
  6905. <dt>&lsquo;<samp>refs <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6906. <dd><p>Set reference frames to consider for motion compensation.
  6907. </p>
  6908. </dd>
  6909. <dt>&lsquo;<samp>chromaoffset <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6910. <dd><p>Set chroma qp offset from luma.
  6911. </p>
  6912. </dd>
  6913. <dt>&lsquo;<samp>trellis <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6914. <dd><p>Set rate-distortion optimal quantization.
  6915. </p>
  6916. </dd>
  6917. <dt>&lsquo;<samp>mv0_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6918. <dt>&lsquo;<samp>b_sensitivity <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6919. <dd><p>Adjust sensitivity of b_frame_strategy 1.
  6920. </p>
  6921. </dd>
  6922. <dt>&lsquo;<samp>compression_level <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6923. <dt>&lsquo;<samp>min_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
  6924. <dt>&lsquo;<samp>max_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
  6925. <dt>&lsquo;<samp>timecode_frame_start <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6926. <dd><p>Set GOP timecode frame start number, in non drop frame format.
  6927. </p>
  6928. </dd>
  6929. <dt>&lsquo;<samp>request_channels <var>integer</var> (<em>decoding,audio</em>)</samp>&rsquo;</dt>
  6930. <dd><p>Set desired number of audio channels.
  6931. </p>
  6932. </dd>
  6933. <dt>&lsquo;<samp>bits_per_raw_sample <var>integer</var></samp>&rsquo;</dt>
  6934. <dt>&lsquo;<samp>channel_layout <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>&rsquo;</dt>
  6935. <dd>
  6936. <p>Possible values:
  6937. </p></dd>
  6938. <dt>&lsquo;<samp>request_channel_layout <var>integer</var> (<em>decoding,audio</em>)</samp>&rsquo;</dt>
  6939. <dd>
  6940. <p>Possible values:
  6941. </p></dd>
  6942. <dt>&lsquo;<samp>rc_max_vbv_use <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6943. <dt>&lsquo;<samp>rc_min_vbv_use <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6944. <dt>&lsquo;<samp>ticks_per_frame <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp>&rsquo;</dt>
  6945. <dt>&lsquo;<samp>color_primaries <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  6946. <dd><p>Possible values:
  6947. </p><dl compact="compact">
  6948. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  6949. <dd><p>BT.709
  6950. </p></dd>
  6951. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  6952. <dd><p>BT.470 M
  6953. </p></dd>
  6954. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  6955. <dd><p>BT.470 BG
  6956. </p></dd>
  6957. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  6958. <dd><p>SMPTE 170 M
  6959. </p></dd>
  6960. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  6961. <dd><p>SMPTE 240 M
  6962. </p></dd>
  6963. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  6964. <dd><p>Film
  6965. </p></dd>
  6966. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  6967. <dd><p>BT.2020
  6968. </p></dd>
  6969. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  6970. <dt>&lsquo;<samp>smpte428_1</samp>&rsquo;</dt>
  6971. <dd><p>SMPTE ST 428-1
  6972. </p></dd>
  6973. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  6974. <dd><p>SMPTE 431-2
  6975. </p></dd>
  6976. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  6977. <dd><p>SMPTE 432-1
  6978. </p></dd>
  6979. <dt>&lsquo;<samp>jedec-p22</samp>&rsquo;</dt>
  6980. <dd><p>JEDEC P22
  6981. </p></dd>
  6982. </dl>
  6983. </dd>
  6984. <dt>&lsquo;<samp>color_trc <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  6985. <dd><p>Possible values:
  6986. </p><dl compact="compact">
  6987. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  6988. <dd><p>BT.709
  6989. </p></dd>
  6990. <dt>&lsquo;<samp>gamma22</samp>&rsquo;</dt>
  6991. <dd><p>BT.470 M
  6992. </p></dd>
  6993. <dt>&lsquo;<samp>gamma28</samp>&rsquo;</dt>
  6994. <dd><p>BT.470 BG
  6995. </p></dd>
  6996. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  6997. <dd><p>SMPTE 170 M
  6998. </p></dd>
  6999. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  7000. <dd><p>SMPTE 240 M
  7001. </p></dd>
  7002. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  7003. <dd><p>Linear
  7004. </p></dd>
  7005. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  7006. <dt>&lsquo;<samp>log100</samp>&rsquo;</dt>
  7007. <dd><p>Log
  7008. </p></dd>
  7009. <dt>&lsquo;<samp>log_sqrt</samp>&rsquo;</dt>
  7010. <dt>&lsquo;<samp>log316</samp>&rsquo;</dt>
  7011. <dd><p>Log square root
  7012. </p></dd>
  7013. <dt>&lsquo;<samp>iec61966_2_4</samp>&rsquo;</dt>
  7014. <dt>&lsquo;<samp>iec61966-2-4</samp>&rsquo;</dt>
  7015. <dd><p>IEC 61966-2-4
  7016. </p></dd>
  7017. <dt>&lsquo;<samp>bt1361</samp>&rsquo;</dt>
  7018. <dt>&lsquo;<samp>bt1361e</samp>&rsquo;</dt>
  7019. <dd><p>BT.1361
  7020. </p></dd>
  7021. <dt>&lsquo;<samp>iec61966_2_1</samp>&rsquo;</dt>
  7022. <dt>&lsquo;<samp>iec61966-2-1</samp>&rsquo;</dt>
  7023. <dd><p>IEC 61966-2-1
  7024. </p></dd>
  7025. <dt>&lsquo;<samp>bt2020_10</samp>&rsquo;</dt>
  7026. <dt>&lsquo;<samp>bt2020_10bit</samp>&rsquo;</dt>
  7027. <dd><p>BT.2020 - 10 bit
  7028. </p></dd>
  7029. <dt>&lsquo;<samp>bt2020_12</samp>&rsquo;</dt>
  7030. <dt>&lsquo;<samp>bt2020_12bit</samp>&rsquo;</dt>
  7031. <dd><p>BT.2020 - 12 bit
  7032. </p></dd>
  7033. <dt>&lsquo;<samp>smpte2084</samp>&rsquo;</dt>
  7034. <dd><p>SMPTE ST 2084
  7035. </p></dd>
  7036. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  7037. <dt>&lsquo;<samp>smpte428_1</samp>&rsquo;</dt>
  7038. <dd><p>SMPTE ST 428-1
  7039. </p></dd>
  7040. <dt>&lsquo;<samp>arib-std-b67</samp>&rsquo;</dt>
  7041. <dd><p>ARIB STD-B67
  7042. </p></dd>
  7043. </dl>
  7044. </dd>
  7045. <dt>&lsquo;<samp>colorspace <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  7046. <dd><p>Possible values:
  7047. </p><dl compact="compact">
  7048. <dt>&lsquo;<samp>rgb</samp>&rsquo;</dt>
  7049. <dd><p>RGB
  7050. </p></dd>
  7051. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  7052. <dd><p>BT.709
  7053. </p></dd>
  7054. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  7055. <dd><p>FCC
  7056. </p></dd>
  7057. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  7058. <dd><p>BT.470 BG
  7059. </p></dd>
  7060. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  7061. <dd><p>SMPTE 170 M
  7062. </p></dd>
  7063. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  7064. <dd><p>SMPTE 240 M
  7065. </p></dd>
  7066. <dt>&lsquo;<samp>ycocg</samp>&rsquo;</dt>
  7067. <dd><p>YCOCG
  7068. </p></dd>
  7069. <dt>&lsquo;<samp>bt2020nc</samp>&rsquo;</dt>
  7070. <dt>&lsquo;<samp>bt2020_ncl</samp>&rsquo;</dt>
  7071. <dd><p>BT.2020 NCL
  7072. </p></dd>
  7073. <dt>&lsquo;<samp>bt2020c</samp>&rsquo;</dt>
  7074. <dt>&lsquo;<samp>bt2020_cl</samp>&rsquo;</dt>
  7075. <dd><p>BT.2020 CL
  7076. </p></dd>
  7077. <dt>&lsquo;<samp>smpte2085</samp>&rsquo;</dt>
  7078. <dd><p>SMPTE 2085
  7079. </p></dd>
  7080. </dl>
  7081. </dd>
  7082. <dt>&lsquo;<samp>color_range <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  7083. <dd><p>If used as input parameter, it serves as a hint to the decoder, which
  7084. color_range the input has.
  7085. Possible values:
  7086. </p><dl compact="compact">
  7087. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  7088. <dt>&lsquo;<samp>mpeg</samp>&rsquo;</dt>
  7089. <dd><p>MPEG (219*2^(n-8))
  7090. </p></dd>
  7091. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  7092. <dt>&lsquo;<samp>jpeg</samp>&rsquo;</dt>
  7093. <dd><p>JPEG (2^n-1)
  7094. </p></dd>
  7095. </dl>
  7096. </dd>
  7097. <dt>&lsquo;<samp>chroma_sample_location <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  7098. <dd><p>Possible values:
  7099. </p><dl compact="compact">
  7100. <dt>&lsquo;<samp>left</samp>&rsquo;</dt>
  7101. <dt>&lsquo;<samp>center</samp>&rsquo;</dt>
  7102. <dt>&lsquo;<samp>topleft</samp>&rsquo;</dt>
  7103. <dt>&lsquo;<samp>top</samp>&rsquo;</dt>
  7104. <dt>&lsquo;<samp>bottomleft</samp>&rsquo;</dt>
  7105. <dt>&lsquo;<samp>bottom</samp>&rsquo;</dt>
  7106. </dl>
  7107. </dd>
  7108. <dt>&lsquo;<samp>log_level_offset <var>integer</var></samp>&rsquo;</dt>
  7109. <dd><p>Set the log level offset.
  7110. </p>
  7111. </dd>
  7112. <dt>&lsquo;<samp>slices <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  7113. <dd><p>Number of slices, used in parallelized encoding.
  7114. </p>
  7115. </dd>
  7116. <dt>&lsquo;<samp>thread_type <var>flags</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  7117. <dd><p>Select which multithreading methods to use.
  7118. </p>
  7119. <p>Use of &lsquo;<samp>frame</samp>&rsquo; will increase decoding delay by one frame per
  7120. thread, so clients which cannot provide future frames should not use
  7121. it.
  7122. </p>
  7123. <p>Possible values:
  7124. </p><dl compact="compact">
  7125. <dt>&lsquo;<samp>slice</samp>&rsquo;</dt>
  7126. <dd><p>Decode more than one part of a single frame at once.
  7127. </p>
  7128. <p>Multithreading using slices works only when the video was encoded with
  7129. slices.
  7130. </p>
  7131. </dd>
  7132. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  7133. <dd><p>Decode more than one frame at once.
  7134. </p></dd>
  7135. </dl>
  7136. <p>Default value is &lsquo;<samp>slice+frame</samp>&rsquo;.
  7137. </p>
  7138. </dd>
  7139. <dt>&lsquo;<samp>audio_service_type <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
  7140. <dd><p>Set audio service type.
  7141. </p>
  7142. <p>Possible values:
  7143. </p><dl compact="compact">
  7144. <dt>&lsquo;<samp>ma</samp>&rsquo;</dt>
  7145. <dd><p>Main Audio Service
  7146. </p></dd>
  7147. <dt>&lsquo;<samp>ef</samp>&rsquo;</dt>
  7148. <dd><p>Effects
  7149. </p></dd>
  7150. <dt>&lsquo;<samp>vi</samp>&rsquo;</dt>
  7151. <dd><p>Visually Impaired
  7152. </p></dd>
  7153. <dt>&lsquo;<samp>hi</samp>&rsquo;</dt>
  7154. <dd><p>Hearing Impaired
  7155. </p></dd>
  7156. <dt>&lsquo;<samp>di</samp>&rsquo;</dt>
  7157. <dd><p>Dialogue
  7158. </p></dd>
  7159. <dt>&lsquo;<samp>co</samp>&rsquo;</dt>
  7160. <dd><p>Commentary
  7161. </p></dd>
  7162. <dt>&lsquo;<samp>em</samp>&rsquo;</dt>
  7163. <dd><p>Emergency
  7164. </p></dd>
  7165. <dt>&lsquo;<samp>vo</samp>&rsquo;</dt>
  7166. <dd><p>Voice Over
  7167. </p></dd>
  7168. <dt>&lsquo;<samp>ka</samp>&rsquo;</dt>
  7169. <dd><p>Karaoke
  7170. </p></dd>
  7171. </dl>
  7172. </dd>
  7173. <dt>&lsquo;<samp>request_sample_fmt <var>sample_fmt</var> (<em>decoding,audio</em>)</samp>&rsquo;</dt>
  7174. <dd><p>Set sample format audio decoders should prefer. Default value is
  7175. <code>none</code>.
  7176. </p>
  7177. </dd>
  7178. <dt>&lsquo;<samp>pkt_timebase <var>rational number</var></samp>&rsquo;</dt>
  7179. <dt>&lsquo;<samp>sub_charenc <var>encoding</var> (<em>decoding,subtitles</em>)</samp>&rsquo;</dt>
  7180. <dd><p>Set the input subtitles character encoding.
  7181. </p>
  7182. </dd>
  7183. <dt>&lsquo;<samp>field_order <var>field_order</var> (<em>video</em>)</samp>&rsquo;</dt>
  7184. <dd><p>Set/override the field order of the video.
  7185. Possible values:
  7186. </p><dl compact="compact">
  7187. <dt>&lsquo;<samp>progressive</samp>&rsquo;</dt>
  7188. <dd><p>Progressive video
  7189. </p></dd>
  7190. <dt>&lsquo;<samp>tt</samp>&rsquo;</dt>
  7191. <dd><p>Interlaced video, top field coded and displayed first
  7192. </p></dd>
  7193. <dt>&lsquo;<samp>bb</samp>&rsquo;</dt>
  7194. <dd><p>Interlaced video, bottom field coded and displayed first
  7195. </p></dd>
  7196. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  7197. <dd><p>Interlaced video, top coded first, bottom displayed first
  7198. </p></dd>
  7199. <dt>&lsquo;<samp>bt</samp>&rsquo;</dt>
  7200. <dd><p>Interlaced video, bottom coded first, top displayed first
  7201. </p></dd>
  7202. </dl>
  7203. </dd>
  7204. <dt>&lsquo;<samp>skip_alpha <var>bool</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  7205. <dd><p>Set to 1 to disable processing alpha (transparency). This works like the
  7206. &lsquo;<samp>gray</samp>&rsquo; flag in the &lsquo;<samp>flags</samp>&rsquo; option which skips chroma information
  7207. instead of alpha. Default is 0.
  7208. </p>
  7209. </dd>
  7210. <dt>&lsquo;<samp>codec_whitelist <var>list</var> (<em>input</em>)</samp>&rsquo;</dt>
  7211. <dd><p>&quot;,&quot; separated list of allowed decoders. By default all are allowed.
  7212. </p>
  7213. </dd>
  7214. <dt>&lsquo;<samp>dump_separator <var>string</var> (<em>input</em>)</samp>&rsquo;</dt>
  7215. <dd><p>Separator used to separate the fields printed on the command line about the
  7216. Stream parameters.
  7217. For example, to separate the fields with newlines and indentation:
  7218. </p><div class="example">
  7219. <pre class="example">ffprobe -dump_separator &quot;
  7220. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  7221. </pre></div>
  7222. </dd>
  7223. <dt>&lsquo;<samp>max_pixels <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  7224. <dd><p>Maximum number of pixels per image. This value can be used to avoid out of
  7225. memory failures due to large images.
  7226. </p>
  7227. </dd>
  7228. <dt>&lsquo;<samp>apply_cropping <var>bool</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  7229. <dd><p>Enable cropping if cropping parameters are multiples of the required
  7230. alignment for the left and top parameters. If the alignment is not met the
  7231. cropping will be partially applied to maintain alignment.
  7232. Default is 1 (enabled).
  7233. Note: The required alignment depends on if <code>AV_CODEC_FLAG_UNALIGNED</code> is set and the
  7234. CPU. <code>AV_CODEC_FLAG_UNALIGNED</code> cannot be changed from the command line. Also hardware
  7235. decoders will not apply left/top Cropping.
  7236. </p>
  7237. </dd>
  7238. </dl>
  7239. <a name="Decoders"></a>
  7240. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Decoders">10 Decoders</a></h1>
  7241. <p>Decoders are configured elements in FFmpeg which allow the decoding of
  7242. multimedia streams.
  7243. </p>
  7244. <p>When you configure your FFmpeg build, all the supported native decoders
  7245. are enabled by default. Decoders requiring an external library must be enabled
  7246. manually via the corresponding <code>--enable-lib</code> option. You can list all
  7247. available decoders using the configure option <code>--list-decoders</code>.
  7248. </p>
  7249. <p>You can disable all the decoders with the configure option
  7250. <code>--disable-decoders</code> and selectively enable / disable single decoders
  7251. with the options <code>--enable-decoder=<var>DECODER</var></code> /
  7252. <code>--disable-decoder=<var>DECODER</var></code>.
  7253. </p>
  7254. <p>The option <code>-decoders</code> of the ff* tools will display the list of
  7255. enabled decoders.
  7256. </p>
  7257. <a name="Video-Decoders"></a>
  7258. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Video-Decoders">11 Video Decoders</a></h1>
  7259. <p>A description of some of the currently available video decoders
  7260. follows.
  7261. </p>
  7262. <a name="rawvideo"></a>
  7263. <h2 class="section"><a href="ffmpeg-all.html#toc-rawvideo">11.1 rawvideo</a></h2>
  7264. <p>Raw video decoder.
  7265. </p>
  7266. <p>This decoder decodes rawvideo streams.
  7267. </p>
  7268. <a name="Options-20"></a>
  7269. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-20">11.1.1 Options</a></h3>
  7270. <dl compact="compact">
  7271. <dt>&lsquo;<samp>top <var>top_field_first</var></samp>&rsquo;</dt>
  7272. <dd><p>Specify the assumed field type of the input video.
  7273. </p><dl compact="compact">
  7274. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  7275. <dd><p>the video is assumed to be progressive (default)
  7276. </p></dd>
  7277. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7278. <dd><p>bottom-field-first is assumed
  7279. </p></dd>
  7280. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7281. <dd><p>top-field-first is assumed
  7282. </p></dd>
  7283. </dl>
  7284. </dd>
  7285. </dl>
  7286. <a name="libdav1d"></a>
  7287. <h2 class="section"><a href="ffmpeg-all.html#toc-libdav1d">11.2 libdav1d</a></h2>
  7288. <p>dav1d AV1 decoder.
  7289. </p>
  7290. <p>libdav1d allows libavcodec to decode the AOMedia Video 1 (AV1) codec.
  7291. Requires the presence of the libdav1d headers and library during configuration.
  7292. You need to explicitly configure the build with <code>--enable-libdav1d</code>.
  7293. </p>
  7294. <a name="Options-74"></a>
  7295. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-74">11.2.1 Options</a></h3>
  7296. <p>The following options are supported by the libdav1d wrapper.
  7297. </p>
  7298. <dl compact="compact">
  7299. <dt>&lsquo;<samp>framethreads</samp>&rsquo;</dt>
  7300. <dd><p>Set amount of frame threads to use during decoding. The default value is 0 (autodetect).
  7301. </p>
  7302. </dd>
  7303. <dt>&lsquo;<samp>tilethreads</samp>&rsquo;</dt>
  7304. <dd><p>Set amount of tile threads to use during decoding. The default value is 0 (autodetect).
  7305. </p>
  7306. </dd>
  7307. <dt>&lsquo;<samp>filmgrain</samp>&rsquo;</dt>
  7308. <dd><p>Apply film grain to the decoded video if present in the bitstream. Defaults to the
  7309. internal default of the library.
  7310. </p>
  7311. </dd>
  7312. <dt>&lsquo;<samp>oppoint</samp>&rsquo;</dt>
  7313. <dd><p>Select an operating point of a scalable AV1 bitstream (0 - 31). Defaults to the
  7314. internal default of the library.
  7315. </p>
  7316. </dd>
  7317. <dt>&lsquo;<samp>alllayers</samp>&rsquo;</dt>
  7318. <dd><p>Output all spatial layers of a scalable AV1 bitstream. The default value is false.
  7319. </p>
  7320. </dd>
  7321. </dl>
  7322. <a name="libdavs2"></a>
  7323. <h2 class="section"><a href="ffmpeg-all.html#toc-libdavs2">11.3 libdavs2</a></h2>
  7324. <p>AVS2-P2/IEEE1857.4 video decoder wrapper.
  7325. </p>
  7326. <p>This decoder allows libavcodec to decode AVS2 streams with davs2 library.
  7327. </p>
  7328. <a name="Audio-Decoders"></a>
  7329. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Audio-Decoders">12 Audio Decoders</a></h1>
  7330. <p>A description of some of the currently available audio decoders
  7331. follows.
  7332. </p>
  7333. <a name="ac3"></a>
  7334. <h2 class="section"><a href="ffmpeg-all.html#toc-ac3">12.1 ac3</a></h2>
  7335. <p>AC-3 audio decoder.
  7336. </p>
  7337. <p>This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  7338. the undocumented RealAudio 3 (a.k.a. dnet).
  7339. </p>
  7340. <a name="AC_002d3-Decoder-Options"></a>
  7341. <h3 class="subsection"><a href="ffmpeg-all.html#toc-AC_002d3-Decoder-Options">12.1.1 AC-3 Decoder Options</a></h3>
  7342. <dl compact="compact">
  7343. <dt>&lsquo;<samp>-drc_scale <var>value</var></samp>&rsquo;</dt>
  7344. <dd><p>Dynamic Range Scale Factor. The factor to apply to dynamic range values
  7345. from the AC-3 stream. This factor is applied exponentially.
  7346. There are 3 notable scale factor ranges:
  7347. </p><dl compact="compact">
  7348. <dt>&lsquo;<samp>drc_scale == 0</samp>&rsquo;</dt>
  7349. <dd><p>DRC disabled. Produces full range audio.
  7350. </p></dd>
  7351. <dt>&lsquo;<samp>0 &lt; drc_scale &lt;= 1</samp>&rsquo;</dt>
  7352. <dd><p>DRC enabled. Applies a fraction of the stream DRC value.
  7353. Audio reproduction is between full range and full compression.
  7354. </p></dd>
  7355. <dt>&lsquo;<samp>drc_scale &gt; 1</samp>&rsquo;</dt>
  7356. <dd><p>DRC enabled. Applies drc_scale asymmetrically.
  7357. Loud sounds are fully compressed. Soft sounds are enhanced.
  7358. </p></dd>
  7359. </dl>
  7360. </dd>
  7361. </dl>
  7362. <a name="flac-1"></a>
  7363. <h2 class="section"><a href="ffmpeg-all.html#toc-flac-1">12.2 flac</a></h2>
  7364. <p>FLAC audio decoder.
  7365. </p>
  7366. <p>This decoder aims to implement the complete FLAC specification from Xiph.
  7367. </p>
  7368. <a name="FLAC-Decoder-options"></a>
  7369. <h3 class="subsection"><a href="ffmpeg-all.html#toc-FLAC-Decoder-options">12.2.1 FLAC Decoder options</a></h3>
  7370. <dl compact="compact">
  7371. <dt>&lsquo;<samp>-use_buggy_lpc</samp>&rsquo;</dt>
  7372. <dd><p>The lavc FLAC encoder used to produce buggy streams with high lpc values
  7373. (like the default value). This option makes it possible to decode such streams
  7374. correctly by using lavc&rsquo;s old buggy lpc logic for decoding.
  7375. </p>
  7376. </dd>
  7377. </dl>
  7378. <a name="ffwavesynth"></a>
  7379. <h2 class="section"><a href="ffmpeg-all.html#toc-ffwavesynth">12.3 ffwavesynth</a></h2>
  7380. <p>Internal wave synthesizer.
  7381. </p>
  7382. <p>This decoder generates wave patterns according to predefined sequences. Its
  7383. use is purely internal and the format of the data it accepts is not publicly
  7384. documented.
  7385. </p>
  7386. <a name="libcelt"></a>
  7387. <h2 class="section"><a href="ffmpeg-all.html#toc-libcelt">12.4 libcelt</a></h2>
  7388. <p>libcelt decoder wrapper.
  7389. </p>
  7390. <p>libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec.
  7391. Requires the presence of the libcelt headers and library during configuration.
  7392. You need to explicitly configure the build with <code>--enable-libcelt</code>.
  7393. </p>
  7394. <a name="libgsm"></a>
  7395. <h2 class="section"><a href="ffmpeg-all.html#toc-libgsm">12.5 libgsm</a></h2>
  7396. <p>libgsm decoder wrapper.
  7397. </p>
  7398. <p>libgsm allows libavcodec to decode the GSM full rate audio codec. Requires
  7399. the presence of the libgsm headers and library during configuration. You need
  7400. to explicitly configure the build with <code>--enable-libgsm</code>.
  7401. </p>
  7402. <p>This decoder supports both the ordinary GSM and the Microsoft variant.
  7403. </p>
  7404. <a name="libilbc"></a>
  7405. <h2 class="section"><a href="ffmpeg-all.html#toc-libilbc">12.6 libilbc</a></h2>
  7406. <p>libilbc decoder wrapper.
  7407. </p>
  7408. <p>libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC)
  7409. audio codec. Requires the presence of the libilbc headers and library during
  7410. configuration. You need to explicitly configure the build with
  7411. <code>--enable-libilbc</code>.
  7412. </p>
  7413. <a name="Options-4"></a>
  7414. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-4">12.6.1 Options</a></h3>
  7415. <p>The following option is supported by the libilbc wrapper.
  7416. </p>
  7417. <dl compact="compact">
  7418. <dt>&lsquo;<samp>enhance</samp>&rsquo;</dt>
  7419. <dd>
  7420. <p>Enable the enhancement of the decoded audio when set to 1. The default
  7421. value is 0 (disabled).
  7422. </p>
  7423. </dd>
  7424. </dl>
  7425. <a name="libopencore_002damrnb-1"></a>
  7426. <h2 class="section"><a href="ffmpeg-all.html#toc-libopencore_002damrnb-1">12.7 libopencore-amrnb</a></h2>
  7427. <p>libopencore-amrnb decoder wrapper.
  7428. </p>
  7429. <p>libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate
  7430. Narrowband audio codec. Using it requires the presence of the
  7431. libopencore-amrnb headers and library during configuration. You need to
  7432. explicitly configure the build with <code>--enable-libopencore-amrnb</code>.
  7433. </p>
  7434. <p>An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
  7435. without this library.
  7436. </p>
  7437. <a name="libopencore_002damrwb"></a>
  7438. <h2 class="section"><a href="ffmpeg-all.html#toc-libopencore_002damrwb">12.8 libopencore-amrwb</a></h2>
  7439. <p>libopencore-amrwb decoder wrapper.
  7440. </p>
  7441. <p>libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate
  7442. Wideband audio codec. Using it requires the presence of the
  7443. libopencore-amrwb headers and library during configuration. You need to
  7444. explicitly configure the build with <code>--enable-libopencore-amrwb</code>.
  7445. </p>
  7446. <p>An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
  7447. without this library.
  7448. </p>
  7449. <a name="libopus"></a>
  7450. <h2 class="section"><a href="ffmpeg-all.html#toc-libopus">12.9 libopus</a></h2>
  7451. <p>libopus decoder wrapper.
  7452. </p>
  7453. <p>libopus allows libavcodec to decode the Opus Interactive Audio Codec.
  7454. Requires the presence of the libopus headers and library during
  7455. configuration. You need to explicitly configure the build with
  7456. <code>--enable-libopus</code>.
  7457. </p>
  7458. <p>An FFmpeg native decoder for Opus exists, so users can decode Opus
  7459. without this library.
  7460. </p>
  7461. <a name="Subtitles-Decoders"></a>
  7462. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Subtitles-Decoders">13 Subtitles Decoders</a></h1>
  7463. <a name="libaribb24"></a>
  7464. <h2 class="section"><a href="ffmpeg-all.html#toc-libaribb24">13.1 libaribb24</a></h2>
  7465. <p>ARIB STD-B24 caption decoder.
  7466. </p>
  7467. <p>Implements profiles A and C of the ARIB STD-B24 standard.
  7468. </p>
  7469. <a name="libaribb24-Decoder-Options"></a>
  7470. <h3 class="subsection"><a href="ffmpeg-all.html#toc-libaribb24-Decoder-Options">13.1.1 libaribb24 Decoder Options</a></h3>
  7471. <dl compact="compact">
  7472. <dt>&lsquo;<samp>-aribb24-base-path <var>path</var></samp>&rsquo;</dt>
  7473. <dd><p>Sets the base path for the libaribb24 library. This is utilized for reading of
  7474. configuration files (for custom unicode conversions), and for dumping of
  7475. non-text symbols as images under that location.
  7476. </p>
  7477. <p>Unset by default.
  7478. </p>
  7479. </dd>
  7480. <dt>&lsquo;<samp>-aribb24-skip-ruby-text <var>boolean</var></samp>&rsquo;</dt>
  7481. <dd><p>Tells the decoder wrapper to skip text blocks that contain half-height ruby
  7482. text.
  7483. </p>
  7484. <p>Enabled by default.
  7485. </p>
  7486. </dd>
  7487. </dl>
  7488. <a name="dvbsub"></a>
  7489. <h2 class="section"><a href="ffmpeg-all.html#toc-dvbsub">13.2 dvbsub</a></h2>
  7490. <a name="Options-60"></a>
  7491. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-60">13.2.1 Options</a></h3>
  7492. <dl compact="compact">
  7493. <dt>&lsquo;<samp>compute_clut</samp>&rsquo;</dt>
  7494. <dd><dl compact="compact">
  7495. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  7496. <dd><p>Compute clut if no matching CLUT is in the stream.
  7497. </p></dd>
  7498. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7499. <dd><p>Never compute CLUT
  7500. </p></dd>
  7501. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7502. <dd><p>Always compute CLUT and override the one provided in the stream.
  7503. </p></dd>
  7504. </dl>
  7505. </dd>
  7506. <dt>&lsquo;<samp>dvb_substream</samp>&rsquo;</dt>
  7507. <dd><p>Selects the dvb substream, or all substreams if -1 which is default.
  7508. </p>
  7509. </dd>
  7510. </dl>
  7511. <a name="dvdsub"></a>
  7512. <h2 class="section"><a href="ffmpeg-all.html#toc-dvdsub">13.3 dvdsub</a></h2>
  7513. <p>This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
  7514. also be found in VobSub file pairs and in some Matroska files.
  7515. </p>
  7516. <a name="Options-35"></a>
  7517. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-35">13.3.1 Options</a></h3>
  7518. <dl compact="compact">
  7519. <dt>&lsquo;<samp>palette</samp>&rsquo;</dt>
  7520. <dd><p>Specify the global palette used by the bitmaps. When stored in VobSub, the
  7521. palette is normally specified in the index file; in Matroska, the palette is
  7522. stored in the codec extra-data in the same format as in VobSub. In DVDs, the
  7523. palette is stored in the IFO file, and therefore not available when reading
  7524. from dumped VOB files.
  7525. </p>
  7526. <p>The format for this option is a string containing 16 24-bits hexadecimal
  7527. numbers (without 0x prefix) separated by commas, for example <code>0d00ee,
  7528. ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
  7529. 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
  7530. </p>
  7531. </dd>
  7532. <dt>&lsquo;<samp>ifo_palette</samp>&rsquo;</dt>
  7533. <dd><p>Specify the IFO file from which the global palette is obtained.
  7534. (experimental)
  7535. </p>
  7536. </dd>
  7537. <dt>&lsquo;<samp>forced_subs_only</samp>&rsquo;</dt>
  7538. <dd><p>Only decode subtitle entries marked as forced. Some titles have forced
  7539. and non-forced subtitles in the same track. Setting this flag to <code>1</code>
  7540. will only keep the forced subtitles. Default value is <code>0</code>.
  7541. </p></dd>
  7542. </dl>
  7543. <a name="libzvbi_002dteletext"></a>
  7544. <h2 class="section"><a href="ffmpeg-all.html#toc-libzvbi_002dteletext">13.4 libzvbi-teletext</a></h2>
  7545. <p>Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext
  7546. subtitles. Requires the presence of the libzvbi headers and library during
  7547. configuration. You need to explicitly configure the build with
  7548. <code>--enable-libzvbi</code>.
  7549. </p>
  7550. <a name="Options-45"></a>
  7551. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-45">13.4.1 Options</a></h3>
  7552. <dl compact="compact">
  7553. <dt>&lsquo;<samp>txt_page</samp>&rsquo;</dt>
  7554. <dd><p>List of teletext page numbers to decode. Pages that do not match the specified
  7555. list are dropped. You may use the special <code>*</code> string to match all pages,
  7556. or <code>subtitle</code> to match all subtitle pages.
  7557. Default value is *.
  7558. </p></dd>
  7559. <dt>&lsquo;<samp>txt_default_region</samp>&rsquo;</dt>
  7560. <dd><p>Set default G0 character set used for decoding, a value between 0 and 80 (see
  7561. ETS 300 706, Section 15, Table 32). Default value is -1, which does not
  7562. override the libzvbi default. This option is needed for some legacy level 1.0
  7563. transmissions which cannot signal the proper charset.
  7564. </p></dd>
  7565. <dt>&lsquo;<samp>txt_chop_top</samp>&rsquo;</dt>
  7566. <dd><p>Discards the top teletext line. Default value is 1.
  7567. </p></dd>
  7568. <dt>&lsquo;<samp>txt_format</samp>&rsquo;</dt>
  7569. <dd><p>Specifies the format of the decoded subtitles.
  7570. </p><dl compact="compact">
  7571. <dt>&lsquo;<samp>bitmap</samp>&rsquo;</dt>
  7572. <dd><p>The default format, you should use this for teletext pages, because certain
  7573. graphics and colors cannot be expressed in simple text or even ASS.
  7574. </p></dd>
  7575. <dt>&lsquo;<samp>text</samp>&rsquo;</dt>
  7576. <dd><p>Simple text based output without formatting.
  7577. </p></dd>
  7578. <dt>&lsquo;<samp>ass</samp>&rsquo;</dt>
  7579. <dd><p>Formatted ASS output, subtitle pages and teletext pages are returned in
  7580. different styles, subtitle pages are stripped down to text, but an effort is
  7581. made to keep the text alignment and the formatting.
  7582. </p></dd>
  7583. </dl>
  7584. </dd>
  7585. <dt>&lsquo;<samp>txt_left</samp>&rsquo;</dt>
  7586. <dd><p>X offset of generated bitmaps, default is 0.
  7587. </p></dd>
  7588. <dt>&lsquo;<samp>txt_top</samp>&rsquo;</dt>
  7589. <dd><p>Y offset of generated bitmaps, default is 0.
  7590. </p></dd>
  7591. <dt>&lsquo;<samp>txt_chop_spaces</samp>&rsquo;</dt>
  7592. <dd><p>Chops leading and trailing spaces and removes empty lines from the generated
  7593. text. This option is useful for teletext based subtitles where empty spaces may
  7594. be present at the start or at the end of the lines or empty lines may be
  7595. present between the subtitle lines because of double-sized teletext characters.
  7596. Default value is 1.
  7597. </p></dd>
  7598. <dt>&lsquo;<samp>txt_duration</samp>&rsquo;</dt>
  7599. <dd><p>Sets the display duration of the decoded teletext pages or subtitles in
  7600. milliseconds. Default value is -1 which means infinity or until the next
  7601. subtitle event comes.
  7602. </p></dd>
  7603. <dt>&lsquo;<samp>txt_transparent</samp>&rsquo;</dt>
  7604. <dd><p>Force transparent background of the generated teletext bitmaps. Default value
  7605. is 0 which means an opaque background.
  7606. </p></dd>
  7607. <dt>&lsquo;<samp>txt_opacity</samp>&rsquo;</dt>
  7608. <dd><p>Sets the opacity (0-255) of the teletext background. If
  7609. &lsquo;<samp>txt_transparent</samp>&rsquo; is not set, it only affects characters between a start
  7610. box and an end box, typically subtitles. Default value is 0 if
  7611. &lsquo;<samp>txt_transparent</samp>&rsquo; is set, 255 otherwise.
  7612. </p>
  7613. </dd>
  7614. </dl>
  7615. <a name="Encoders"></a>
  7616. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Encoders">14 Encoders</a></h1>
  7617. <p>Encoders are configured elements in FFmpeg which allow the encoding of
  7618. multimedia streams.
  7619. </p>
  7620. <p>When you configure your FFmpeg build, all the supported native encoders
  7621. are enabled by default. Encoders requiring an external library must be enabled
  7622. manually via the corresponding <code>--enable-lib</code> option. You can list all
  7623. available encoders using the configure option <code>--list-encoders</code>.
  7624. </p>
  7625. <p>You can disable all the encoders with the configure option
  7626. <code>--disable-encoders</code> and selectively enable / disable single encoders
  7627. with the options <code>--enable-encoder=<var>ENCODER</var></code> /
  7628. <code>--disable-encoder=<var>ENCODER</var></code>.
  7629. </p>
  7630. <p>The option <code>-encoders</code> of the ff* tools will display the list of
  7631. enabled encoders.
  7632. </p>
  7633. <a name="Audio-Encoders"></a>
  7634. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Audio-Encoders">15 Audio Encoders</a></h1>
  7635. <p>A description of some of the currently available audio encoders
  7636. follows.
  7637. </p>
  7638. <p><a name="aacenc"></a>
  7639. </p><a name="aac"></a>
  7640. <h2 class="section"><a href="ffmpeg-all.html#toc-aac">15.1 aac</a></h2>
  7641. <p>Advanced Audio Coding (AAC) encoder.
  7642. </p>
  7643. <p>This encoder is the default AAC encoder, natively implemented into FFmpeg.
  7644. </p>
  7645. <a name="Options-64"></a>
  7646. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-64">15.1.1 Options</a></h3>
  7647. <dl compact="compact">
  7648. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  7649. <dd><p>Set bit rate in bits/s. Setting this automatically activates constant bit rate
  7650. (CBR) mode. If this option is unspecified it is set to 128kbps.
  7651. </p>
  7652. </dd>
  7653. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  7654. <dd><p>Set quality for variable bit rate (VBR) mode. This option is valid only using
  7655. the <code>ffmpeg</code> command-line tool. For library interface users, use
  7656. &lsquo;<samp>global_quality</samp>&rsquo;.
  7657. </p>
  7658. </dd>
  7659. <dt>&lsquo;<samp>cutoff</samp>&rsquo;</dt>
  7660. <dd><p>Set cutoff frequency. If unspecified will allow the encoder to dynamically
  7661. adjust the cutoff to improve clarity on low bitrates.
  7662. </p>
  7663. </dd>
  7664. <dt>&lsquo;<samp>aac_coder</samp>&rsquo;</dt>
  7665. <dd><p>Set AAC encoder coding method. Possible values:
  7666. </p>
  7667. <dl compact="compact">
  7668. <dt>&lsquo;<samp>twoloop</samp>&rsquo;</dt>
  7669. <dd><p>Two loop searching (TLS) method.
  7670. </p>
  7671. <p>This method first sets quantizers depending on band thresholds and then tries
  7672. to find an optimal combination by adding or subtracting a specific value from
  7673. all quantizers and adjusting some individual quantizer a little. Will tune
  7674. itself based on whether &lsquo;<samp>aac_is</samp>&rsquo;, &lsquo;<samp>aac_ms</samp>&rsquo; and &lsquo;<samp>aac_pns</samp>&rsquo;
  7675. are enabled.
  7676. </p>
  7677. </dd>
  7678. <dt>&lsquo;<samp>anmr</samp>&rsquo;</dt>
  7679. <dd><p>Average noise to mask ratio (ANMR) trellis-based solution.
  7680. </p>
  7681. <p>This is an experimental coder which currently produces a lower quality, is more
  7682. unstable and is slower than the default twoloop coder but has potential.
  7683. Currently has no support for the &lsquo;<samp>aac_is</samp>&rsquo; or &lsquo;<samp>aac_pns</samp>&rsquo; options.
  7684. Not currently recommended.
  7685. </p>
  7686. </dd>
  7687. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  7688. <dd><p>Constant quantizer method.
  7689. </p>
  7690. <p>Uses a cheaper version of twoloop algorithm that doesn&rsquo;t try to do as many
  7691. clever adjustments. Worse with low bitrates (less than 64kbps), but is better
  7692. and much faster at higher bitrates.
  7693. This is the default choice for a coder
  7694. </p>
  7695. </dd>
  7696. </dl>
  7697. </dd>
  7698. <dt>&lsquo;<samp>aac_ms</samp>&rsquo;</dt>
  7699. <dd><p>Sets mid/side coding mode. The default value of &quot;auto&quot; will automatically use
  7700. M/S with bands which will benefit from such coding. Can be forced for all bands
  7701. using the value &quot;enable&quot;, which is mainly useful for debugging or disabled using
  7702. &quot;disable&quot;.
  7703. </p>
  7704. </dd>
  7705. <dt>&lsquo;<samp>aac_is</samp>&rsquo;</dt>
  7706. <dd><p>Sets intensity stereo coding tool usage. By default, it&rsquo;s enabled and will
  7707. automatically toggle IS for similar pairs of stereo bands if it&rsquo;s beneficial.
  7708. Can be disabled for debugging by setting the value to &quot;disable&quot;.
  7709. </p>
  7710. </dd>
  7711. <dt>&lsquo;<samp>aac_pns</samp>&rsquo;</dt>
  7712. <dd><p>Uses perceptual noise substitution to replace low entropy high frequency bands
  7713. with imperceptible white noise during the decoding process. By default, it&rsquo;s
  7714. enabled, but can be disabled for debugging purposes by using &quot;disable&quot;.
  7715. </p>
  7716. </dd>
  7717. <dt>&lsquo;<samp>aac_tns</samp>&rsquo;</dt>
  7718. <dd><p>Enables the use of a multitap FIR filter which spans through the high frequency
  7719. bands to hide quantization noise during the encoding process and is reverted
  7720. by the decoder. As well as decreasing unpleasant artifacts in the high range
  7721. this also reduces the entropy in the high bands and allows for more bits to
  7722. be used by the mid-low bands. By default it&rsquo;s enabled but can be disabled for
  7723. debugging by setting the option to &quot;disable&quot;.
  7724. </p>
  7725. </dd>
  7726. <dt>&lsquo;<samp>aac_ltp</samp>&rsquo;</dt>
  7727. <dd><p>Enables the use of the long term prediction extension which increases coding
  7728. efficiency in very low bandwidth situations such as encoding of voice or
  7729. solo piano music by extending constant harmonic peaks in bands throughout
  7730. frames. This option is implied by profile:a aac_low and is incompatible with
  7731. aac_pred. Use in conjunction with &lsquo;<samp>-ar</samp>&rsquo; to decrease the samplerate.
  7732. </p>
  7733. </dd>
  7734. <dt>&lsquo;<samp>aac_pred</samp>&rsquo;</dt>
  7735. <dd><p>Enables the use of a more traditional style of prediction where the spectral
  7736. coefficients transmitted are replaced by the difference of the current
  7737. coefficients minus the previous &quot;predicted&quot; coefficients. In theory and sometimes
  7738. in practice this can improve quality for low to mid bitrate audio.
  7739. This option implies the aac_main profile and is incompatible with aac_ltp.
  7740. </p>
  7741. </dd>
  7742. <dt>&lsquo;<samp>profile</samp>&rsquo;</dt>
  7743. <dd><p>Sets the encoding profile, possible values:
  7744. </p>
  7745. <dl compact="compact">
  7746. <dt>&lsquo;<samp>aac_low</samp>&rsquo;</dt>
  7747. <dd><p>The default, AAC &quot;Low-complexity&quot; profile. Is the most compatible and produces
  7748. decent quality.
  7749. </p>
  7750. </dd>
  7751. <dt>&lsquo;<samp>mpeg2_aac_low</samp>&rsquo;</dt>
  7752. <dd><p>Equivalent to <code>-profile:a aac_low -aac_pns 0</code>. PNS was introduced with the
  7753. MPEG4 specifications.
  7754. </p>
  7755. </dd>
  7756. <dt>&lsquo;<samp>aac_ltp</samp>&rsquo;</dt>
  7757. <dd><p>Long term prediction profile, is enabled by and will enable the &lsquo;<samp>aac_ltp</samp>&rsquo;
  7758. option. Introduced in MPEG4.
  7759. </p>
  7760. </dd>
  7761. <dt>&lsquo;<samp>aac_main</samp>&rsquo;</dt>
  7762. <dd><p>Main-type prediction profile, is enabled by and will enable the &lsquo;<samp>aac_pred</samp>&rsquo;
  7763. option. Introduced in MPEG2.
  7764. </p>
  7765. </dd>
  7766. </dl>
  7767. <p>If this option is unspecified it is set to &lsquo;<samp>aac_low</samp>&rsquo;.
  7768. </p></dd>
  7769. </dl>
  7770. <a name="ac3-and-ac3_005ffixed"></a>
  7771. <h2 class="section"><a href="ffmpeg-all.html#toc-ac3-and-ac3_005ffixed">15.2 ac3 and ac3_fixed</a></h2>
  7772. <p>AC-3 audio encoders.
  7773. </p>
  7774. <p>These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  7775. the undocumented RealAudio 3 (a.k.a. dnet).
  7776. </p>
  7777. <p>The <var>ac3</var> encoder uses floating-point math, while the <var>ac3_fixed</var>
  7778. encoder only uses fixed-point integer math. This does not mean that one is
  7779. always faster, just that one or the other may be better suited to a
  7780. particular system. The floating-point encoder will generally produce better
  7781. quality audio for a given bitrate. The <var>ac3_fixed</var> encoder is not the
  7782. default codec for any of the output formats, so it must be specified explicitly
  7783. using the option <code>-acodec ac3_fixed</code> in order to use it.
  7784. </p>
  7785. <a name="AC_002d3-Metadata"></a>
  7786. <h3 class="subsection"><a href="ffmpeg-all.html#toc-AC_002d3-Metadata">15.2.1 AC-3 Metadata</a></h3>
  7787. <p>The AC-3 metadata options are used to set parameters that describe the audio,
  7788. but in most cases do not affect the audio encoding itself. Some of the options
  7789. do directly affect or influence the decoding and playback of the resulting
  7790. bitstream, while others are just for informational purposes. A few of the
  7791. options will add bits to the output stream that could otherwise be used for
  7792. audio data, and will thus affect the quality of the output. Those will be
  7793. indicated accordingly with a note in the option list below.
  7794. </p>
  7795. <p>These parameters are described in detail in several publicly-available
  7796. documents.
  7797. </p><ul>
  7798. <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>
  7799. </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>
  7800. </li><li> <a href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf">Dolby Metadata Guide</a>
  7801. </li><li> <a href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf">Dolby Digital Professional Encoding Guidelines</a>
  7802. </li></ul>
  7803. <a name="Metadata-Control-Options"></a>
  7804. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Metadata-Control-Options">15.2.1.1 Metadata Control Options</a></h4>
  7805. <dl compact="compact">
  7806. <dt>&lsquo;<samp>-per_frame_metadata <var>boolean</var></samp>&rsquo;</dt>
  7807. <dd><p>Allow Per-Frame Metadata. Specifies if the encoder should check for changing
  7808. metadata for each frame.
  7809. </p><dl compact="compact">
  7810. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7811. <dd><p>The metadata values set at initialization will be used for every frame in the
  7812. stream. (default)
  7813. </p></dd>
  7814. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7815. <dd><p>Metadata values can be changed before encoding each frame.
  7816. </p></dd>
  7817. </dl>
  7818. </dd>
  7819. </dl>
  7820. <a name="Downmix-Levels"></a>
  7821. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Downmix-Levels">15.2.1.2 Downmix Levels</a></h4>
  7822. <dl compact="compact">
  7823. <dt>&lsquo;<samp>-center_mixlev <var>level</var></samp>&rsquo;</dt>
  7824. <dd><p>Center Mix Level. The amount of gain the decoder should apply to the center
  7825. channel when downmixing to stereo. This field will only be written to the
  7826. bitstream if a center channel is present. The value is specified as a scale
  7827. factor. There are 3 valid values:
  7828. </p><dl compact="compact">
  7829. <dt>&lsquo;<samp>0.707</samp>&rsquo;</dt>
  7830. <dd><p>Apply -3dB gain
  7831. </p></dd>
  7832. <dt>&lsquo;<samp>0.595</samp>&rsquo;</dt>
  7833. <dd><p>Apply -4.5dB gain (default)
  7834. </p></dd>
  7835. <dt>&lsquo;<samp>0.500</samp>&rsquo;</dt>
  7836. <dd><p>Apply -6dB gain
  7837. </p></dd>
  7838. </dl>
  7839. </dd>
  7840. <dt>&lsquo;<samp>-surround_mixlev <var>level</var></samp>&rsquo;</dt>
  7841. <dd><p>Surround Mix Level. The amount of gain the decoder should apply to the surround
  7842. channel(s) when downmixing to stereo. This field will only be written to the
  7843. bitstream if one or more surround channels are present. The value is specified
  7844. as a scale factor. There are 3 valid values:
  7845. </p><dl compact="compact">
  7846. <dt>&lsquo;<samp>0.707</samp>&rsquo;</dt>
  7847. <dd><p>Apply -3dB gain
  7848. </p></dd>
  7849. <dt>&lsquo;<samp>0.500</samp>&rsquo;</dt>
  7850. <dd><p>Apply -6dB gain (default)
  7851. </p></dd>
  7852. <dt>&lsquo;<samp>0.000</samp>&rsquo;</dt>
  7853. <dd><p>Silence Surround Channel(s)
  7854. </p></dd>
  7855. </dl>
  7856. </dd>
  7857. </dl>
  7858. <a name="Audio-Production-Information"></a>
  7859. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Audio-Production-Information">15.2.1.3 Audio Production Information</a></h4>
  7860. <p>Audio Production Information is optional information describing the mixing
  7861. environment. Either none or both of the fields are written to the bitstream.
  7862. </p>
  7863. <dl compact="compact">
  7864. <dt>&lsquo;<samp>-mixing_level <var>number</var></samp>&rsquo;</dt>
  7865. <dd><p>Mixing Level. Specifies peak sound pressure level (SPL) in the production
  7866. environment when the mix was mastered. Valid values are 80 to 111, or -1 for
  7867. unknown or not indicated. The default value is -1, but that value cannot be
  7868. used if the Audio Production Information is written to the bitstream. Therefore,
  7869. if the <code>room_type</code> option is not the default value, the <code>mixing_level</code>
  7870. option must not be -1.
  7871. </p>
  7872. </dd>
  7873. <dt>&lsquo;<samp>-room_type <var>type</var></samp>&rsquo;</dt>
  7874. <dd><p>Room Type. Describes the equalization used during the final mixing session at
  7875. the studio or on the dubbing stage. A large room is a dubbing stage with the
  7876. industry standard X-curve equalization; a small room has flat equalization.
  7877. This field will not be written to the bitstream if both the <code>mixing_level</code>
  7878. option and the <code>room_type</code> option have the default values.
  7879. </p><dl compact="compact">
  7880. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7881. <dt>&lsquo;<samp>notindicated</samp>&rsquo;</dt>
  7882. <dd><p>Not Indicated (default)
  7883. </p></dd>
  7884. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7885. <dt>&lsquo;<samp>large</samp>&rsquo;</dt>
  7886. <dd><p>Large Room
  7887. </p></dd>
  7888. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  7889. <dt>&lsquo;<samp>small</samp>&rsquo;</dt>
  7890. <dd><p>Small Room
  7891. </p></dd>
  7892. </dl>
  7893. </dd>
  7894. </dl>
  7895. <a name="Other-Metadata-Options"></a>
  7896. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Other-Metadata-Options">15.2.1.4 Other Metadata Options</a></h4>
  7897. <dl compact="compact">
  7898. <dt>&lsquo;<samp>-copyright <var>boolean</var></samp>&rsquo;</dt>
  7899. <dd><p>Copyright Indicator. Specifies whether a copyright exists for this audio.
  7900. </p><dl compact="compact">
  7901. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7902. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  7903. <dd><p>No Copyright Exists (default)
  7904. </p></dd>
  7905. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7906. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  7907. <dd><p>Copyright Exists
  7908. </p></dd>
  7909. </dl>
  7910. </dd>
  7911. <dt>&lsquo;<samp>-dialnorm <var>value</var></samp>&rsquo;</dt>
  7912. <dd><p>Dialogue Normalization. Indicates how far the average dialogue level of the
  7913. program is below digital 100% full scale (0 dBFS). This parameter determines a
  7914. level shift during audio reproduction that sets the average volume of the
  7915. dialogue to a preset level. The goal is to match volume level between program
  7916. sources. A value of -31dB will result in no volume level change, relative to
  7917. the source volume, during audio reproduction. Valid values are whole numbers in
  7918. the range -31 to -1, with -31 being the default.
  7919. </p>
  7920. </dd>
  7921. <dt>&lsquo;<samp>-dsur_mode <var>mode</var></samp>&rsquo;</dt>
  7922. <dd><p>Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
  7923. (Pro Logic). This field will only be written to the bitstream if the audio
  7924. stream is stereo. Using this option does <b>NOT</b> mean the encoder will actually
  7925. apply Dolby Surround processing.
  7926. </p><dl compact="compact">
  7927. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7928. <dt>&lsquo;<samp>notindicated</samp>&rsquo;</dt>
  7929. <dd><p>Not Indicated (default)
  7930. </p></dd>
  7931. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7932. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  7933. <dd><p>Not Dolby Surround Encoded
  7934. </p></dd>
  7935. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  7936. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  7937. <dd><p>Dolby Surround Encoded
  7938. </p></dd>
  7939. </dl>
  7940. </dd>
  7941. <dt>&lsquo;<samp>-original <var>boolean</var></samp>&rsquo;</dt>
  7942. <dd><p>Original Bit Stream Indicator. Specifies whether this audio is from the
  7943. original source and not a copy.
  7944. </p><dl compact="compact">
  7945. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7946. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  7947. <dd><p>Not Original Source
  7948. </p></dd>
  7949. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7950. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  7951. <dd><p>Original Source (default)
  7952. </p></dd>
  7953. </dl>
  7954. </dd>
  7955. </dl>
  7956. <a name="Extended-Bitstream-Information"></a>
  7957. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Extended-Bitstream-Information">15.2.2 Extended Bitstream Information</a></h3>
  7958. <p>The extended bitstream options are part of the Alternate Bit Stream Syntax as
  7959. specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
  7960. If any one parameter in a group is specified, all values in that group will be
  7961. written to the bitstream. Default values are used for those that are written
  7962. but have not been specified. If the mixing levels are written, the decoder
  7963. will use these values instead of the ones specified in the <code>center_mixlev</code>
  7964. and <code>surround_mixlev</code> options if it supports the Alternate Bit Stream
  7965. Syntax.
  7966. </p>
  7967. <a name="Extended-Bitstream-Information-_002d-Part-1"></a>
  7968. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Extended-Bitstream-Information-_002d-Part-1">15.2.2.1 Extended Bitstream Information - Part 1</a></h4>
  7969. <dl compact="compact">
  7970. <dt>&lsquo;<samp>-dmix_mode <var>mode</var></samp>&rsquo;</dt>
  7971. <dd><p>Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
  7972. (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
  7973. </p><dl compact="compact">
  7974. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7975. <dt>&lsquo;<samp>notindicated</samp>&rsquo;</dt>
  7976. <dd><p>Not Indicated (default)
  7977. </p></dd>
  7978. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7979. <dt>&lsquo;<samp>ltrt</samp>&rsquo;</dt>
  7980. <dd><p>Lt/Rt Downmix Preferred
  7981. </p></dd>
  7982. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  7983. <dt>&lsquo;<samp>loro</samp>&rsquo;</dt>
  7984. <dd><p>Lo/Ro Downmix Preferred
  7985. </p></dd>
  7986. </dl>
  7987. </dd>
  7988. <dt>&lsquo;<samp>-ltrt_cmixlev <var>level</var></samp>&rsquo;</dt>
  7989. <dd><p>Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
  7990. center channel when downmixing to stereo in Lt/Rt mode.
  7991. </p><dl compact="compact">
  7992. <dt>&lsquo;<samp>1.414</samp>&rsquo;</dt>
  7993. <dd><p>Apply +3dB gain
  7994. </p></dd>
  7995. <dt>&lsquo;<samp>1.189</samp>&rsquo;</dt>
  7996. <dd><p>Apply +1.5dB gain
  7997. </p></dd>
  7998. <dt>&lsquo;<samp>1.000</samp>&rsquo;</dt>
  7999. <dd><p>Apply 0dB gain
  8000. </p></dd>
  8001. <dt>&lsquo;<samp>0.841</samp>&rsquo;</dt>
  8002. <dd><p>Apply -1.5dB gain
  8003. </p></dd>
  8004. <dt>&lsquo;<samp>0.707</samp>&rsquo;</dt>
  8005. <dd><p>Apply -3.0dB gain
  8006. </p></dd>
  8007. <dt>&lsquo;<samp>0.595</samp>&rsquo;</dt>
  8008. <dd><p>Apply -4.5dB gain (default)
  8009. </p></dd>
  8010. <dt>&lsquo;<samp>0.500</samp>&rsquo;</dt>
  8011. <dd><p>Apply -6.0dB gain
  8012. </p></dd>
  8013. <dt>&lsquo;<samp>0.000</samp>&rsquo;</dt>
  8014. <dd><p>Silence Center Channel
  8015. </p></dd>
  8016. </dl>
  8017. </dd>
  8018. <dt>&lsquo;<samp>-ltrt_surmixlev <var>level</var></samp>&rsquo;</dt>
  8019. <dd><p>Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
  8020. surround channel(s) when downmixing to stereo in Lt/Rt mode.
  8021. </p><dl compact="compact">
  8022. <dt>&lsquo;<samp>0.841</samp>&rsquo;</dt>
  8023. <dd><p>Apply -1.5dB gain
  8024. </p></dd>
  8025. <dt>&lsquo;<samp>0.707</samp>&rsquo;</dt>
  8026. <dd><p>Apply -3.0dB gain
  8027. </p></dd>
  8028. <dt>&lsquo;<samp>0.595</samp>&rsquo;</dt>
  8029. <dd><p>Apply -4.5dB gain
  8030. </p></dd>
  8031. <dt>&lsquo;<samp>0.500</samp>&rsquo;</dt>
  8032. <dd><p>Apply -6.0dB gain (default)
  8033. </p></dd>
  8034. <dt>&lsquo;<samp>0.000</samp>&rsquo;</dt>
  8035. <dd><p>Silence Surround Channel(s)
  8036. </p></dd>
  8037. </dl>
  8038. </dd>
  8039. <dt>&lsquo;<samp>-loro_cmixlev <var>level</var></samp>&rsquo;</dt>
  8040. <dd><p>Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
  8041. center channel when downmixing to stereo in Lo/Ro mode.
  8042. </p><dl compact="compact">
  8043. <dt>&lsquo;<samp>1.414</samp>&rsquo;</dt>
  8044. <dd><p>Apply +3dB gain
  8045. </p></dd>
  8046. <dt>&lsquo;<samp>1.189</samp>&rsquo;</dt>
  8047. <dd><p>Apply +1.5dB gain
  8048. </p></dd>
  8049. <dt>&lsquo;<samp>1.000</samp>&rsquo;</dt>
  8050. <dd><p>Apply 0dB gain
  8051. </p></dd>
  8052. <dt>&lsquo;<samp>0.841</samp>&rsquo;</dt>
  8053. <dd><p>Apply -1.5dB gain
  8054. </p></dd>
  8055. <dt>&lsquo;<samp>0.707</samp>&rsquo;</dt>
  8056. <dd><p>Apply -3.0dB gain
  8057. </p></dd>
  8058. <dt>&lsquo;<samp>0.595</samp>&rsquo;</dt>
  8059. <dd><p>Apply -4.5dB gain (default)
  8060. </p></dd>
  8061. <dt>&lsquo;<samp>0.500</samp>&rsquo;</dt>
  8062. <dd><p>Apply -6.0dB gain
  8063. </p></dd>
  8064. <dt>&lsquo;<samp>0.000</samp>&rsquo;</dt>
  8065. <dd><p>Silence Center Channel
  8066. </p></dd>
  8067. </dl>
  8068. </dd>
  8069. <dt>&lsquo;<samp>-loro_surmixlev <var>level</var></samp>&rsquo;</dt>
  8070. <dd><p>Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
  8071. surround channel(s) when downmixing to stereo in Lo/Ro mode.
  8072. </p><dl compact="compact">
  8073. <dt>&lsquo;<samp>0.841</samp>&rsquo;</dt>
  8074. <dd><p>Apply -1.5dB gain
  8075. </p></dd>
  8076. <dt>&lsquo;<samp>0.707</samp>&rsquo;</dt>
  8077. <dd><p>Apply -3.0dB gain
  8078. </p></dd>
  8079. <dt>&lsquo;<samp>0.595</samp>&rsquo;</dt>
  8080. <dd><p>Apply -4.5dB gain
  8081. </p></dd>
  8082. <dt>&lsquo;<samp>0.500</samp>&rsquo;</dt>
  8083. <dd><p>Apply -6.0dB gain (default)
  8084. </p></dd>
  8085. <dt>&lsquo;<samp>0.000</samp>&rsquo;</dt>
  8086. <dd><p>Silence Surround Channel(s)
  8087. </p></dd>
  8088. </dl>
  8089. </dd>
  8090. </dl>
  8091. <a name="Extended-Bitstream-Information-_002d-Part-2"></a>
  8092. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Extended-Bitstream-Information-_002d-Part-2">15.2.2.2 Extended Bitstream Information - Part 2</a></h4>
  8093. <dl compact="compact">
  8094. <dt>&lsquo;<samp>-dsurex_mode <var>mode</var></samp>&rsquo;</dt>
  8095. <dd><p>Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
  8096. (7.1 matrixed to 5.1). Using this option does <b>NOT</b> mean the encoder will actually
  8097. apply Dolby Surround EX processing.
  8098. </p><dl compact="compact">
  8099. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  8100. <dt>&lsquo;<samp>notindicated</samp>&rsquo;</dt>
  8101. <dd><p>Not Indicated (default)
  8102. </p></dd>
  8103. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  8104. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  8105. <dd><p>Dolby Surround EX Off
  8106. </p></dd>
  8107. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  8108. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  8109. <dd><p>Dolby Surround EX On
  8110. </p></dd>
  8111. </dl>
  8112. </dd>
  8113. <dt>&lsquo;<samp>-dheadphone_mode <var>mode</var></samp>&rsquo;</dt>
  8114. <dd><p>Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
  8115. encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
  8116. option does <b>NOT</b> mean the encoder will actually apply Dolby Headphone
  8117. processing.
  8118. </p><dl compact="compact">
  8119. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  8120. <dt>&lsquo;<samp>notindicated</samp>&rsquo;</dt>
  8121. <dd><p>Not Indicated (default)
  8122. </p></dd>
  8123. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  8124. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  8125. <dd><p>Dolby Headphone Off
  8126. </p></dd>
  8127. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  8128. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  8129. <dd><p>Dolby Headphone On
  8130. </p></dd>
  8131. </dl>
  8132. </dd>
  8133. <dt>&lsquo;<samp>-ad_conv_type <var>type</var></samp>&rsquo;</dt>
  8134. <dd><p>A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
  8135. conversion.
  8136. </p><dl compact="compact">
  8137. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  8138. <dt>&lsquo;<samp>standard</samp>&rsquo;</dt>
  8139. <dd><p>Standard A/D Converter (default)
  8140. </p></dd>
  8141. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  8142. <dt>&lsquo;<samp>hdcd</samp>&rsquo;</dt>
  8143. <dd><p>HDCD A/D Converter
  8144. </p></dd>
  8145. </dl>
  8146. </dd>
  8147. </dl>
  8148. <a name="Other-AC_002d3-Encoding-Options"></a>
  8149. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Other-AC_002d3-Encoding-Options">15.2.3 Other AC-3 Encoding Options</a></h3>
  8150. <dl compact="compact">
  8151. <dt>&lsquo;<samp>-stereo_rematrixing <var>boolean</var></samp>&rsquo;</dt>
  8152. <dd><p>Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
  8153. is an optional AC-3 feature that increases quality by selectively encoding
  8154. the left/right channels as mid/side. This option is enabled by default, and it
  8155. is highly recommended that it be left as enabled except for testing purposes.
  8156. </p>
  8157. </dd>
  8158. <dt>&lsquo;<samp>cutoff <var>frequency</var></samp>&rsquo;</dt>
  8159. <dd><p>Set lowpass cutoff frequency. If unspecified, the encoder selects a default
  8160. determined by various other encoding parameters.
  8161. </p>
  8162. </dd>
  8163. </dl>
  8164. <a name="Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options"></a>
  8165. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options">15.2.4 Floating-Point-Only AC-3 Encoding Options</a></h3>
  8166. <p>These options are only valid for the floating-point encoder and do not exist
  8167. for the fixed-point encoder due to the corresponding features not being
  8168. implemented in fixed-point.
  8169. </p>
  8170. <dl compact="compact">
  8171. <dt>&lsquo;<samp>-channel_coupling <var>boolean</var></samp>&rsquo;</dt>
  8172. <dd><p>Enables/Disables use of channel coupling, which is an optional AC-3 feature
  8173. that increases quality by combining high frequency information from multiple
  8174. channels into a single channel. The per-channel high frequency information is
  8175. sent with less accuracy in both the frequency and time domains. This allows
  8176. more bits to be used for lower frequencies while preserving enough information
  8177. to reconstruct the high frequencies. This option is enabled by default for the
  8178. floating-point encoder and should generally be left as enabled except for
  8179. testing purposes or to increase encoding speed.
  8180. </p><dl compact="compact">
  8181. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  8182. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  8183. <dd><p>Selected by Encoder (default)
  8184. </p></dd>
  8185. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  8186. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  8187. <dd><p>Disable Channel Coupling
  8188. </p></dd>
  8189. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  8190. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  8191. <dd><p>Enable Channel Coupling
  8192. </p></dd>
  8193. </dl>
  8194. </dd>
  8195. <dt>&lsquo;<samp>-cpl_start_band <var>number</var></samp>&rsquo;</dt>
  8196. <dd><p>Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
  8197. value higher than the bandwidth is used, it will be reduced to 1 less than the
  8198. coupling end band. If <var>auto</var> is used, the start band will be determined by
  8199. the encoder based on the bit rate, sample rate, and channel layout. This option
  8200. has no effect if channel coupling is disabled.
  8201. </p><dl compact="compact">
  8202. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  8203. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  8204. <dd><p>Selected by Encoder (default)
  8205. </p></dd>
  8206. </dl>
  8207. </dd>
  8208. </dl>
  8209. <p><a name="flac"></a>
  8210. </p><a name="flac-2"></a>
  8211. <h2 class="section"><a href="ffmpeg-all.html#toc-flac-2">15.3 flac</a></h2>
  8212. <p>FLAC (Free Lossless Audio Codec) Encoder
  8213. </p>
  8214. <a name="Options-44"></a>
  8215. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-44">15.3.1 Options</a></h3>
  8216. <p>The following options are supported by FFmpeg&rsquo;s flac encoder.
  8217. </p>
  8218. <dl compact="compact">
  8219. <dt>&lsquo;<samp>compression_level</samp>&rsquo;</dt>
  8220. <dd><p>Sets the compression level, which chooses defaults for many other options
  8221. if they are not set explicitly. Valid values are from 0 to 12, 5 is the
  8222. default.
  8223. </p>
  8224. </dd>
  8225. <dt>&lsquo;<samp>frame_size</samp>&rsquo;</dt>
  8226. <dd><p>Sets the size of the frames in samples per channel.
  8227. </p>
  8228. </dd>
  8229. <dt>&lsquo;<samp>lpc_coeff_precision</samp>&rsquo;</dt>
  8230. <dd><p>Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the
  8231. default.
  8232. </p>
  8233. </dd>
  8234. <dt>&lsquo;<samp>lpc_type</samp>&rsquo;</dt>
  8235. <dd><p>Sets the first stage LPC algorithm
  8236. </p><dl compact="compact">
  8237. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  8238. <dd><p>LPC is not used
  8239. </p>
  8240. </dd>
  8241. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  8242. <dd><p>fixed LPC coefficients
  8243. </p>
  8244. </dd>
  8245. <dt>&lsquo;<samp>levinson</samp>&rsquo;</dt>
  8246. <dt>&lsquo;<samp>cholesky</samp>&rsquo;</dt>
  8247. </dl>
  8248. </dd>
  8249. <dt>&lsquo;<samp>lpc_passes</samp>&rsquo;</dt>
  8250. <dd><p>Number of passes to use for Cholesky factorization during LPC analysis
  8251. </p>
  8252. </dd>
  8253. <dt>&lsquo;<samp>min_partition_order</samp>&rsquo;</dt>
  8254. <dd><p>The minimum partition order
  8255. </p>
  8256. </dd>
  8257. <dt>&lsquo;<samp>max_partition_order</samp>&rsquo;</dt>
  8258. <dd><p>The maximum partition order
  8259. </p>
  8260. </dd>
  8261. <dt>&lsquo;<samp>prediction_order_method</samp>&rsquo;</dt>
  8262. <dd><dl compact="compact">
  8263. <dt>&lsquo;<samp>estimation</samp>&rsquo;</dt>
  8264. <dt>&lsquo;<samp>2level</samp>&rsquo;</dt>
  8265. <dt>&lsquo;<samp>4level</samp>&rsquo;</dt>
  8266. <dt>&lsquo;<samp>8level</samp>&rsquo;</dt>
  8267. <dt>&lsquo;<samp>search</samp>&rsquo;</dt>
  8268. <dd><p>Bruteforce search
  8269. </p></dd>
  8270. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  8271. </dl>
  8272. </dd>
  8273. <dt>&lsquo;<samp>ch_mode</samp>&rsquo;</dt>
  8274. <dd><p>Channel mode
  8275. </p><dl compact="compact">
  8276. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  8277. <dd><p>The mode is chosen automatically for each frame
  8278. </p></dd>
  8279. <dt>&lsquo;<samp>indep</samp>&rsquo;</dt>
  8280. <dd><p>Channels are independently coded
  8281. </p></dd>
  8282. <dt>&lsquo;<samp>left_side</samp>&rsquo;</dt>
  8283. <dt>&lsquo;<samp>right_side</samp>&rsquo;</dt>
  8284. <dt>&lsquo;<samp>mid_side</samp>&rsquo;</dt>
  8285. </dl>
  8286. </dd>
  8287. <dt>&lsquo;<samp>exact_rice_parameters</samp>&rsquo;</dt>
  8288. <dd><p>Chooses if rice parameters are calculated exactly or approximately.
  8289. if set to 1 then they are chosen exactly, which slows the code down slightly and
  8290. improves compression slightly.
  8291. </p>
  8292. </dd>
  8293. <dt>&lsquo;<samp>multi_dim_quant</samp>&rsquo;</dt>
  8294. <dd><p>Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is
  8295. applied after the first stage to finetune the coefficients. This is quite slow
  8296. and slightly improves compression.
  8297. </p>
  8298. </dd>
  8299. </dl>
  8300. <p><a name="opusenc"></a>
  8301. </p><a name="opus"></a>
  8302. <h2 class="section"><a href="ffmpeg-all.html#toc-opus">15.4 opus</a></h2>
  8303. <p>Opus encoder.
  8304. </p>
  8305. <p>This is a native FFmpeg encoder for the Opus format. Currently its in development and
  8306. only implements the CELT part of the codec. Its quality is usually worse and at best
  8307. is equal to the libopus encoder.
  8308. </p>
  8309. <a name="Options-63"></a>
  8310. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-63">15.4.1 Options</a></h3>
  8311. <dl compact="compact">
  8312. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  8313. <dd><p>Set bit rate in bits/s. If unspecified it uses the number of channels and the layout
  8314. to make a good guess.
  8315. </p>
  8316. </dd>
  8317. <dt>&lsquo;<samp>opus_delay</samp>&rsquo;</dt>
  8318. <dd><p>Sets the maximum delay in milliseconds. Lower delays than 20ms will very quickly
  8319. decrease quality.
  8320. </p></dd>
  8321. </dl>
  8322. <p><a name="libfdk_002daac_002denc"></a>
  8323. </p><a name="libfdk_005faac"></a>
  8324. <h2 class="section"><a href="ffmpeg-all.html#toc-libfdk_005faac">15.5 libfdk_aac</a></h2>
  8325. <p>libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
  8326. </p>
  8327. <p>The libfdk-aac library is based on the Fraunhofer FDK AAC code from
  8328. the Android project.
  8329. </p>
  8330. <p>Requires the presence of the libfdk-aac headers and library during
  8331. configuration. You need to explicitly configure the build with
  8332. <code>--enable-libfdk-aac</code>. The library is also incompatible with GPL,
  8333. so if you allow the use of GPL, you should configure with
  8334. <code>--enable-gpl --enable-nonfree --enable-libfdk-aac</code>.
  8335. </p>
  8336. <p>This encoder has support for the AAC-HE profiles.
  8337. </p>
  8338. <p>VBR encoding, enabled through the &lsquo;<samp>vbr</samp>&rsquo; or &lsquo;<samp>flags
  8339. +qscale</samp>&rsquo; options, is experimental and only works with some
  8340. combinations of parameters.
  8341. </p>
  8342. <p>Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
  8343. higher.
  8344. </p>
  8345. <p>For more information see the fdk-aac project at
  8346. <a href="http://sourceforge.net/p/opencore-amr/fdk-aac/">http://sourceforge.net/p/opencore-amr/fdk-aac/</a>.
  8347. </p>
  8348. <a name="Options-50"></a>
  8349. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-50">15.5.1 Options</a></h3>
  8350. <p>The following options are mapped on the shared FFmpeg codec options.
  8351. </p>
  8352. <dl compact="compact">
  8353. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  8354. <dd><p>Set bit rate in bits/s. If the bitrate is not explicitly specified, it
  8355. is automatically set to a suitable value depending on the selected
  8356. profile.
  8357. </p>
  8358. <p>In case VBR mode is enabled the option is ignored.
  8359. </p>
  8360. </dd>
  8361. <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
  8362. <dd><p>Set audio sampling rate (in Hz).
  8363. </p>
  8364. </dd>
  8365. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  8366. <dd><p>Set the number of audio channels.
  8367. </p>
  8368. </dd>
  8369. <dt>&lsquo;<samp>flags +qscale</samp>&rsquo;</dt>
  8370. <dd><p>Enable fixed quality, VBR (Variable Bit Rate) mode.
  8371. Note that VBR is implicitly enabled when the &lsquo;<samp>vbr</samp>&rsquo; value is
  8372. positive.
  8373. </p>
  8374. </dd>
  8375. <dt>&lsquo;<samp>cutoff</samp>&rsquo;</dt>
  8376. <dd><p>Set cutoff frequency. If not specified (or explicitly set to 0) it
  8377. will use a value automatically computed by the library. Default value
  8378. is 0.
  8379. </p>
  8380. </dd>
  8381. <dt>&lsquo;<samp>profile</samp>&rsquo;</dt>
  8382. <dd><p>Set audio profile.
  8383. </p>
  8384. <p>The following profiles are recognized:
  8385. </p><dl compact="compact">
  8386. <dt>&lsquo;<samp>aac_low</samp>&rsquo;</dt>
  8387. <dd><p>Low Complexity AAC (LC)
  8388. </p>
  8389. </dd>
  8390. <dt>&lsquo;<samp>aac_he</samp>&rsquo;</dt>
  8391. <dd><p>High Efficiency AAC (HE-AAC)
  8392. </p>
  8393. </dd>
  8394. <dt>&lsquo;<samp>aac_he_v2</samp>&rsquo;</dt>
  8395. <dd><p>High Efficiency AAC version 2 (HE-AACv2)
  8396. </p>
  8397. </dd>
  8398. <dt>&lsquo;<samp>aac_ld</samp>&rsquo;</dt>
  8399. <dd><p>Low Delay AAC (LD)
  8400. </p>
  8401. </dd>
  8402. <dt>&lsquo;<samp>aac_eld</samp>&rsquo;</dt>
  8403. <dd><p>Enhanced Low Delay AAC (ELD)
  8404. </p></dd>
  8405. </dl>
  8406. <p>If not specified it is set to &lsquo;<samp>aac_low</samp>&rsquo;.
  8407. </p></dd>
  8408. </dl>
  8409. <p>The following are private options of the libfdk_aac encoder.
  8410. </p>
  8411. <dl compact="compact">
  8412. <dt>&lsquo;<samp>afterburner</samp>&rsquo;</dt>
  8413. <dd><p>Enable afterburner feature if set to 1, disabled if set to 0. This
  8414. improves the quality but also the required processing power.
  8415. </p>
  8416. <p>Default value is 1.
  8417. </p>
  8418. </dd>
  8419. <dt>&lsquo;<samp>eld_sbr</samp>&rsquo;</dt>
  8420. <dd><p>Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
  8421. if set to 0.
  8422. </p>
  8423. <p>Default value is 0.
  8424. </p>
  8425. </dd>
  8426. <dt>&lsquo;<samp>eld_v2</samp>&rsquo;</dt>
  8427. <dd><p>Enable ELDv2 (LD-MPS extension for ELD stereo signals) for ELDv2 if set to 1,
  8428. disabled if set to 0.
  8429. </p>
  8430. <p>Note that option is available when fdk-aac version (AACENCODER_LIB_VL0.AACENCODER_LIB_VL1.AACENCODER_LIB_VL2) &gt; (4.0.0).
  8431. </p>
  8432. <p>Default value is 0.
  8433. </p>
  8434. </dd>
  8435. <dt>&lsquo;<samp>signaling</samp>&rsquo;</dt>
  8436. <dd><p>Set SBR/PS signaling style.
  8437. </p>
  8438. <p>It can assume one of the following values:
  8439. </p><dl compact="compact">
  8440. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  8441. <dd><p>choose signaling implicitly (explicit hierarchical by default,
  8442. implicit if global header is disabled)
  8443. </p>
  8444. </dd>
  8445. <dt>&lsquo;<samp>implicit</samp>&rsquo;</dt>
  8446. <dd><p>implicit backwards compatible signaling
  8447. </p>
  8448. </dd>
  8449. <dt>&lsquo;<samp>explicit_sbr</samp>&rsquo;</dt>
  8450. <dd><p>explicit SBR, implicit PS signaling
  8451. </p>
  8452. </dd>
  8453. <dt>&lsquo;<samp>explicit_hierarchical</samp>&rsquo;</dt>
  8454. <dd><p>explicit hierarchical signaling
  8455. </p></dd>
  8456. </dl>
  8457. <p>Default value is &lsquo;<samp>default</samp>&rsquo;.
  8458. </p>
  8459. </dd>
  8460. <dt>&lsquo;<samp>latm</samp>&rsquo;</dt>
  8461. <dd><p>Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
  8462. </p>
  8463. <p>Default value is 0.
  8464. </p>
  8465. </dd>
  8466. <dt>&lsquo;<samp>header_period</samp>&rsquo;</dt>
  8467. <dd><p>Set StreamMuxConfig and PCE repetition period (in frames) for sending
  8468. in-band configuration buffers within LATM/LOAS transport layer.
  8469. </p>
  8470. <p>Must be a 16-bits non-negative integer.
  8471. </p>
  8472. <p>Default value is 0.
  8473. </p>
  8474. </dd>
  8475. <dt>&lsquo;<samp>vbr</samp>&rsquo;</dt>
  8476. <dd><p>Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
  8477. good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
  8478. (Constant Bit Rate) is enabled.
  8479. </p>
  8480. <p>Currently only the &lsquo;<samp>aac_low</samp>&rsquo; profile supports VBR encoding.
  8481. </p>
  8482. <p>VBR modes 1-5 correspond to roughly the following average bit rates:
  8483. </p>
  8484. <dl compact="compact">
  8485. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  8486. <dd><p>32 kbps/channel
  8487. </p></dd>
  8488. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  8489. <dd><p>40 kbps/channel
  8490. </p></dd>
  8491. <dt>&lsquo;<samp>3</samp>&rsquo;</dt>
  8492. <dd><p>48-56 kbps/channel
  8493. </p></dd>
  8494. <dt>&lsquo;<samp>4</samp>&rsquo;</dt>
  8495. <dd><p>64 kbps/channel
  8496. </p></dd>
  8497. <dt>&lsquo;<samp>5</samp>&rsquo;</dt>
  8498. <dd><p>about 80-96 kbps/channel
  8499. </p></dd>
  8500. </dl>
  8501. <p>Default value is 0.
  8502. </p></dd>
  8503. </dl>
  8504. <a name="Examples-76"></a>
  8505. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-76">15.5.2 Examples</a></h3>
  8506. <ul>
  8507. <li>
  8508. Use <code>ffmpeg</code> to convert an audio file to VBR AAC in an M4A (MP4)
  8509. container:
  8510. <div class="example">
  8511. <pre class="example">ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
  8512. </pre></div>
  8513. </li><li>
  8514. Use <code>ffmpeg</code> to convert an audio file to CBR 64k kbps AAC, using the
  8515. High-Efficiency AAC profile:
  8516. <div class="example">
  8517. <pre class="example">ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
  8518. </pre></div>
  8519. </li></ul>
  8520. <p><a name="libmp3lame"></a>
  8521. </p><a name="libmp3lame-1"></a>
  8522. <h2 class="section"><a href="ffmpeg-all.html#toc-libmp3lame-1">15.6 libmp3lame</a></h2>
  8523. <p>LAME (Lame Ain&rsquo;t an MP3 Encoder) MP3 encoder wrapper.
  8524. </p>
  8525. <p>Requires the presence of the libmp3lame headers and library during
  8526. configuration. You need to explicitly configure the build with
  8527. <code>--enable-libmp3lame</code>.
  8528. </p>
  8529. <p>See <a href="#libshine">libshine</a> for a fixed-point MP3 encoder, although with a
  8530. lower quality.
  8531. </p>
  8532. <a name="Options-66"></a>
  8533. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-66">15.6.1 Options</a></h3>
  8534. <p>The following options are supported by the libmp3lame wrapper. The
  8535. <code>lame</code>-equivalent of the options are listed in parentheses.
  8536. </p>
  8537. <dl compact="compact">
  8538. <dt>&lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
  8539. <dd><p>Set bitrate expressed in bits/s for CBR or ABR. LAME <code>bitrate</code> is
  8540. expressed in kilobits/s.
  8541. </p>
  8542. </dd>
  8543. <dt>&lsquo;<samp>q (<em>-V</em>)</samp>&rsquo;</dt>
  8544. <dd><p>Set constant quality setting for VBR. This option is valid only
  8545. using the <code>ffmpeg</code> command-line tool. For library interface
  8546. users, use &lsquo;<samp>global_quality</samp>&rsquo;.
  8547. </p>
  8548. </dd>
  8549. <dt>&lsquo;<samp>compression_level (<em>-q</em>)</samp>&rsquo;</dt>
  8550. <dd><p>Set algorithm quality. Valid arguments are integers in the 0-9 range,
  8551. with 0 meaning highest quality but slowest, and 9 meaning fastest
  8552. while producing the worst quality.
  8553. </p>
  8554. </dd>
  8555. <dt>&lsquo;<samp>cutoff (<em>--lowpass</em>)</samp>&rsquo;</dt>
  8556. <dd><p>Set lowpass cutoff frequency. If unspecified, the encoder dynamically
  8557. adjusts the cutoff.
  8558. </p>
  8559. </dd>
  8560. <dt>&lsquo;<samp>reservoir</samp>&rsquo;</dt>
  8561. <dd><p>Enable use of bit reservoir when set to 1. Default value is 1. LAME
  8562. has this enabled by default, but can be overridden by use
  8563. &lsquo;<samp>--nores</samp>&rsquo; option.
  8564. </p>
  8565. </dd>
  8566. <dt>&lsquo;<samp>joint_stereo (<em>-m j</em>)</samp>&rsquo;</dt>
  8567. <dd><p>Enable the encoder to use (on a frame by frame basis) either L/R
  8568. stereo or mid/side stereo. Default value is 1.
  8569. </p>
  8570. </dd>
  8571. <dt>&lsquo;<samp>abr (<em>--abr</em>)</samp>&rsquo;</dt>
  8572. <dd><p>Enable the encoder to use ABR when set to 1. The <code>lame</code>
  8573. &lsquo;<samp>--abr</samp>&rsquo; sets the target bitrate, while this options only
  8574. tells FFmpeg to use ABR still relies on &lsquo;<samp>b</samp>&rsquo; to set bitrate.
  8575. </p>
  8576. </dd>
  8577. </dl>
  8578. <a name="libopencore_002damrnb"></a>
  8579. <h2 class="section"><a href="ffmpeg-all.html#toc-libopencore_002damrnb">15.7 libopencore-amrnb</a></h2>
  8580. <p>OpenCORE Adaptive Multi-Rate Narrowband encoder.
  8581. </p>
  8582. <p>Requires the presence of the libopencore-amrnb headers and library during
  8583. configuration. You need to explicitly configure the build with
  8584. <code>--enable-libopencore-amrnb --enable-version3</code>.
  8585. </p>
  8586. <p>This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
  8587. but you can override it by setting &lsquo;<samp>strict</samp>&rsquo; to &lsquo;<samp>unofficial</samp>&rsquo; or
  8588. lower.
  8589. </p>
  8590. <a name="Options-55"></a>
  8591. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-55">15.7.1 Options</a></h3>
  8592. <dl compact="compact">
  8593. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  8594. <dd><p>Set bitrate in bits per second. Only the following bitrates are supported,
  8595. otherwise libavcodec will round to the nearest valid bitrate.
  8596. </p>
  8597. <dl compact="compact">
  8598. <dt>&lsquo;<samp>4750</samp>&rsquo;</dt>
  8599. <dt>&lsquo;<samp>5150</samp>&rsquo;</dt>
  8600. <dt>&lsquo;<samp>5900</samp>&rsquo;</dt>
  8601. <dt>&lsquo;<samp>6700</samp>&rsquo;</dt>
  8602. <dt>&lsquo;<samp>7400</samp>&rsquo;</dt>
  8603. <dt>&lsquo;<samp>7950</samp>&rsquo;</dt>
  8604. <dt>&lsquo;<samp>10200</samp>&rsquo;</dt>
  8605. <dt>&lsquo;<samp>12200</samp>&rsquo;</dt>
  8606. </dl>
  8607. </dd>
  8608. <dt>&lsquo;<samp>dtx</samp>&rsquo;</dt>
  8609. <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
  8610. default value is 0 (disabled).
  8611. </p>
  8612. </dd>
  8613. </dl>
  8614. <a name="libopus-1"></a>
  8615. <h2 class="section"><a href="ffmpeg-all.html#toc-libopus-1">15.8 libopus</a></h2>
  8616. <p>libopus Opus Interactive Audio Codec encoder wrapper.
  8617. </p>
  8618. <p>Requires the presence of the libopus headers and library during
  8619. configuration. You need to explicitly configure the build with
  8620. <code>--enable-libopus</code>.
  8621. </p>
  8622. <a name="Option-Mapping"></a>
  8623. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Option-Mapping">15.8.1 Option Mapping</a></h3>
  8624. <p>Most libopus options are modelled after the <code>opusenc</code> utility from
  8625. opus-tools. The following is an option mapping chart describing options
  8626. supported by the libopus wrapper, and their <code>opusenc</code>-equivalent
  8627. in parentheses.
  8628. </p>
  8629. <dl compact="compact">
  8630. <dt>&lsquo;<samp>b (<em>bitrate</em>)</samp>&rsquo;</dt>
  8631. <dd><p>Set the bit rate in bits/s. FFmpeg&rsquo;s &lsquo;<samp>b</samp>&rsquo; option is
  8632. expressed in bits/s, while <code>opusenc</code>&rsquo;s &lsquo;<samp>bitrate</samp>&rsquo; in
  8633. kilobits/s.
  8634. </p>
  8635. </dd>
  8636. <dt>&lsquo;<samp>vbr (<em>vbr</em>, <em>hard-cbr</em>, and <em>cvbr</em>)</samp>&rsquo;</dt>
  8637. <dd><p>Set VBR mode. The FFmpeg &lsquo;<samp>vbr</samp>&rsquo; option has the following
  8638. valid arguments, with the <code>opusenc</code> equivalent options
  8639. in parentheses:
  8640. </p>
  8641. <dl compact="compact">
  8642. <dt>&lsquo;<samp>off (<em>hard-cbr</em>)</samp>&rsquo;</dt>
  8643. <dd><p>Use constant bit rate encoding.
  8644. </p>
  8645. </dd>
  8646. <dt>&lsquo;<samp>on (<em>vbr</em>)</samp>&rsquo;</dt>
  8647. <dd><p>Use variable bit rate encoding (the default).
  8648. </p>
  8649. </dd>
  8650. <dt>&lsquo;<samp>constrained (<em>cvbr</em>)</samp>&rsquo;</dt>
  8651. <dd><p>Use constrained variable bit rate encoding.
  8652. </p></dd>
  8653. </dl>
  8654. </dd>
  8655. <dt>&lsquo;<samp>compression_level (<em>comp</em>)</samp>&rsquo;</dt>
  8656. <dd><p>Set encoding algorithm complexity. Valid options are integers in
  8657. the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
  8658. gives the highest quality but slowest encoding. The default is 10.
  8659. </p>
  8660. </dd>
  8661. <dt>&lsquo;<samp>frame_duration (<em>framesize</em>)</samp>&rsquo;</dt>
  8662. <dd><p>Set maximum frame size, or duration of a frame in milliseconds. The
  8663. argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
  8664. frame sizes achieve lower latency but less quality at a given bitrate.
  8665. Sizes greater than 20ms are only interesting at fairly low bitrates.
  8666. The default is 20ms.
  8667. </p>
  8668. </dd>
  8669. <dt>&lsquo;<samp>packet_loss (<em>expect-loss</em>)</samp>&rsquo;</dt>
  8670. <dd><p>Set expected packet loss percentage. The default is 0.
  8671. </p>
  8672. </dd>
  8673. <dt>&lsquo;<samp>application (N.A.)</samp>&rsquo;</dt>
  8674. <dd><p>Set intended application type. Valid options are listed below:
  8675. </p>
  8676. <dl compact="compact">
  8677. <dt>&lsquo;<samp>voip</samp>&rsquo;</dt>
  8678. <dd><p>Favor improved speech intelligibility.
  8679. </p></dd>
  8680. <dt>&lsquo;<samp>audio</samp>&rsquo;</dt>
  8681. <dd><p>Favor faithfulness to the input (the default).
  8682. </p></dd>
  8683. <dt>&lsquo;<samp>lowdelay</samp>&rsquo;</dt>
  8684. <dd><p>Restrict to only the lowest delay modes.
  8685. </p></dd>
  8686. </dl>
  8687. </dd>
  8688. <dt>&lsquo;<samp>cutoff (N.A.)</samp>&rsquo;</dt>
  8689. <dd><p>Set cutoff bandwidth in Hz. The argument must be exactly one of the
  8690. following: 4000, 6000, 8000, 12000, or 20000, corresponding to
  8691. narrowband, mediumband, wideband, super wideband, and fullband
  8692. respectively. The default is 0 (cutoff disabled).
  8693. </p>
  8694. </dd>
  8695. <dt>&lsquo;<samp>mapping_family (<em>mapping_family</em>)</samp>&rsquo;</dt>
  8696. <dd><p>Set channel mapping family to be used by the encoder. The default value of -1
  8697. uses mapping family 0 for mono and stereo inputs, and mapping family 1
  8698. otherwise. The default also disables the surround masking and LFE bandwidth
  8699. optimzations in libopus, and requires that the input contains 8 channels or
  8700. fewer.
  8701. </p>
  8702. <p>Other values include 0 for mono and stereo, 1 for surround sound with masking
  8703. and LFE bandwidth optimizations, and 255 for independent streams with an
  8704. unspecified channel layout.
  8705. </p>
  8706. </dd>
  8707. <dt>&lsquo;<samp>apply_phase_inv (N.A.) (requires libopus &gt;= 1.2)</samp>&rsquo;</dt>
  8708. <dd><p>If set to 0, disables the use of phase inversion for intensity stereo,
  8709. improving the quality of mono downmixes, but slightly reducing normal stereo
  8710. quality. The default is 1 (phase inversion enabled).
  8711. </p>
  8712. </dd>
  8713. </dl>
  8714. <p><a name="libshine"></a>
  8715. </p><a name="libshine-1"></a>
  8716. <h2 class="section"><a href="ffmpeg-all.html#toc-libshine-1">15.9 libshine</a></h2>
  8717. <p>Shine Fixed-Point MP3 encoder wrapper.
  8718. </p>
  8719. <p>Shine is a fixed-point MP3 encoder. It has a far better performance on
  8720. platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
  8721. However, as it is more targeted on performance than quality, it is not on par
  8722. with LAME and other production-grade encoders quality-wise. Also, according to
  8723. the project&rsquo;s homepage, this encoder may not be free of bugs as the code was
  8724. written a long time ago and the project was dead for at least 5 years.
  8725. </p>
  8726. <p>This encoder only supports stereo and mono input. This is also CBR-only.
  8727. </p>
  8728. <p>The original project (last updated in early 2007) is at
  8729. <a href="http://sourceforge.net/projects/libshine-fxp/">http://sourceforge.net/projects/libshine-fxp/</a>. We only support the
  8730. updated fork by the Savonet/Liquidsoap project at <a href="https://github.com/savonet/shine">https://github.com/savonet/shine</a>.
  8731. </p>
  8732. <p>Requires the presence of the libshine headers and library during
  8733. configuration. You need to explicitly configure the build with
  8734. <code>--enable-libshine</code>.
  8735. </p>
  8736. <p>See also <a href="#libmp3lame">libmp3lame</a>.
  8737. </p>
  8738. <a name="Options-75"></a>
  8739. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-75">15.9.1 Options</a></h3>
  8740. <p>The following options are supported by the libshine wrapper. The
  8741. <code>shineenc</code>-equivalent of the options are listed in parentheses.
  8742. </p>
  8743. <dl compact="compact">
  8744. <dt>&lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
  8745. <dd><p>Set bitrate expressed in bits/s for CBR. <code>shineenc</code> &lsquo;<samp>-b</samp>&rsquo; option
  8746. is expressed in kilobits/s.
  8747. </p>
  8748. </dd>
  8749. </dl>
  8750. <a name="libtwolame"></a>
  8751. <h2 class="section"><a href="ffmpeg-all.html#toc-libtwolame">15.10 libtwolame</a></h2>
  8752. <p>TwoLAME MP2 encoder wrapper.
  8753. </p>
  8754. <p>Requires the presence of the libtwolame headers and library during
  8755. configuration. You need to explicitly configure the build with
  8756. <code>--enable-libtwolame</code>.
  8757. </p>
  8758. <a name="Options-58"></a>
  8759. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-58">15.10.1 Options</a></h3>
  8760. <p>The following options are supported by the libtwolame wrapper. The
  8761. <code>twolame</code>-equivalent options follow the FFmpeg ones and are in
  8762. parentheses.
  8763. </p>
  8764. <dl compact="compact">
  8765. <dt>&lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
  8766. <dd><p>Set bitrate expressed in bits/s for CBR. <code>twolame</code> &lsquo;<samp>b</samp>&rsquo;
  8767. option is expressed in kilobits/s. Default value is 128k.
  8768. </p>
  8769. </dd>
  8770. <dt>&lsquo;<samp>q (<em>-V</em>)</samp>&rsquo;</dt>
  8771. <dd><p>Set quality for experimental VBR support. Maximum value range is
  8772. from -50 to 50, useful range is from -10 to 10. The higher the
  8773. value, the better the quality. This option is valid only using the
  8774. <code>ffmpeg</code> command-line tool. For library interface users,
  8775. use &lsquo;<samp>global_quality</samp>&rsquo;.
  8776. </p>
  8777. </dd>
  8778. <dt>&lsquo;<samp>mode (<em>--mode</em>)</samp>&rsquo;</dt>
  8779. <dd><p>Set the mode of the resulting audio. Possible values:
  8780. </p>
  8781. <dl compact="compact">
  8782. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  8783. <dd><p>Choose mode automatically based on the input. This is the default.
  8784. </p></dd>
  8785. <dt>&lsquo;<samp>stereo</samp>&rsquo;</dt>
  8786. <dd><p>Stereo
  8787. </p></dd>
  8788. <dt>&lsquo;<samp>joint_stereo</samp>&rsquo;</dt>
  8789. <dd><p>Joint stereo
  8790. </p></dd>
  8791. <dt>&lsquo;<samp>dual_channel</samp>&rsquo;</dt>
  8792. <dd><p>Dual channel
  8793. </p></dd>
  8794. <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
  8795. <dd><p>Mono
  8796. </p></dd>
  8797. </dl>
  8798. </dd>
  8799. <dt>&lsquo;<samp>psymodel (<em>--psyc-mode</em>)</samp>&rsquo;</dt>
  8800. <dd><p>Set psychoacoustic model to use in encoding. The argument must be
  8801. an integer between -1 and 4, inclusive. The higher the value, the
  8802. better the quality. The default value is 3.
  8803. </p>
  8804. </dd>
  8805. <dt>&lsquo;<samp>energy_levels (<em>--energy</em>)</samp>&rsquo;</dt>
  8806. <dd><p>Enable energy levels extensions when set to 1. The default value is
  8807. 0 (disabled).
  8808. </p>
  8809. </dd>
  8810. <dt>&lsquo;<samp>error_protection (<em>--protect</em>)</samp>&rsquo;</dt>
  8811. <dd><p>Enable CRC error protection when set to 1. The default value is 0
  8812. (disabled).
  8813. </p>
  8814. </dd>
  8815. <dt>&lsquo;<samp>copyright (<em>--copyright</em>)</samp>&rsquo;</dt>
  8816. <dd><p>Set MPEG audio copyright flag when set to 1. The default value is 0
  8817. (disabled).
  8818. </p>
  8819. </dd>
  8820. <dt>&lsquo;<samp>original (<em>--original</em>)</samp>&rsquo;</dt>
  8821. <dd><p>Set MPEG audio original flag when set to 1. The default value is 0
  8822. (disabled).
  8823. </p>
  8824. </dd>
  8825. </dl>
  8826. <a name="libvo_002damrwbenc"></a>
  8827. <h2 class="section"><a href="ffmpeg-all.html#toc-libvo_002damrwbenc">15.11 libvo-amrwbenc</a></h2>
  8828. <p>VisualOn Adaptive Multi-Rate Wideband encoder.
  8829. </p>
  8830. <p>Requires the presence of the libvo-amrwbenc headers and library during
  8831. configuration. You need to explicitly configure the build with
  8832. <code>--enable-libvo-amrwbenc --enable-version3</code>.
  8833. </p>
  8834. <p>This is a mono-only encoder. Officially it only supports 16000Hz sample
  8835. rate, but you can override it by setting &lsquo;<samp>strict</samp>&rsquo; to
  8836. &lsquo;<samp>unofficial</samp>&rsquo; or lower.
  8837. </p>
  8838. <a name="Options-48"></a>
  8839. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-48">15.11.1 Options</a></h3>
  8840. <dl compact="compact">
  8841. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  8842. <dd><p>Set bitrate in bits/s. Only the following bitrates are supported, otherwise
  8843. libavcodec will round to the nearest valid bitrate.
  8844. </p>
  8845. <dl compact="compact">
  8846. <dt>&lsquo;<samp>6600</samp>&rsquo;</dt>
  8847. <dt>&lsquo;<samp>8850</samp>&rsquo;</dt>
  8848. <dt>&lsquo;<samp>12650</samp>&rsquo;</dt>
  8849. <dt>&lsquo;<samp>14250</samp>&rsquo;</dt>
  8850. <dt>&lsquo;<samp>15850</samp>&rsquo;</dt>
  8851. <dt>&lsquo;<samp>18250</samp>&rsquo;</dt>
  8852. <dt>&lsquo;<samp>19850</samp>&rsquo;</dt>
  8853. <dt>&lsquo;<samp>23050</samp>&rsquo;</dt>
  8854. <dt>&lsquo;<samp>23850</samp>&rsquo;</dt>
  8855. </dl>
  8856. </dd>
  8857. <dt>&lsquo;<samp>dtx</samp>&rsquo;</dt>
  8858. <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
  8859. default value is 0 (disabled).
  8860. </p>
  8861. </dd>
  8862. </dl>
  8863. <a name="libvorbis"></a>
  8864. <h2 class="section"><a href="ffmpeg-all.html#toc-libvorbis">15.12 libvorbis</a></h2>
  8865. <p>libvorbis encoder wrapper.
  8866. </p>
  8867. <p>Requires the presence of the libvorbisenc headers and library during
  8868. configuration. You need to explicitly configure the build with
  8869. <code>--enable-libvorbis</code>.
  8870. </p>
  8871. <a name="Options-32"></a>
  8872. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-32">15.12.1 Options</a></h3>
  8873. <p>The following options are supported by the libvorbis wrapper. The
  8874. <code>oggenc</code>-equivalent of the options are listed in parentheses.
  8875. </p>
  8876. <p>To get a more accurate and extensive documentation of the libvorbis
  8877. options, consult the libvorbisenc&rsquo;s and <code>oggenc</code>&rsquo;s documentations.
  8878. See <a href="http://xiph.org/vorbis/">http://xiph.org/vorbis/</a>,
  8879. <a href="http://wiki.xiph.org/Vorbis-tools">http://wiki.xiph.org/Vorbis-tools</a>, and oggenc(1).
  8880. </p>
  8881. <dl compact="compact">
  8882. <dt>&lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
  8883. <dd><p>Set bitrate expressed in bits/s for ABR. <code>oggenc</code> &lsquo;<samp>-b</samp>&rsquo; is
  8884. expressed in kilobits/s.
  8885. </p>
  8886. </dd>
  8887. <dt>&lsquo;<samp>q (<em>-q</em>)</samp>&rsquo;</dt>
  8888. <dd><p>Set constant quality setting for VBR. The value should be a float
  8889. number in the range of -1.0 to 10.0. The higher the value, the better
  8890. the quality. The default value is &lsquo;<samp>3.0</samp>&rsquo;.
  8891. </p>
  8892. <p>This option is valid only using the <code>ffmpeg</code> command-line tool.
  8893. For library interface users, use &lsquo;<samp>global_quality</samp>&rsquo;.
  8894. </p>
  8895. </dd>
  8896. <dt>&lsquo;<samp>cutoff (<em>--advanced-encode-option lowpass_frequency=N</em>)</samp>&rsquo;</dt>
  8897. <dd><p>Set cutoff bandwidth in Hz, a value of 0 disables cutoff. <code>oggenc</code>&rsquo;s
  8898. related option is expressed in kHz. The default value is &lsquo;<samp>0</samp>&rsquo; (cutoff
  8899. disabled).
  8900. </p>
  8901. </dd>
  8902. <dt>&lsquo;<samp>minrate (<em>-m</em>)</samp>&rsquo;</dt>
  8903. <dd><p>Set minimum bitrate expressed in bits/s. <code>oggenc</code> &lsquo;<samp>-m</samp>&rsquo; is
  8904. expressed in kilobits/s.
  8905. </p>
  8906. </dd>
  8907. <dt>&lsquo;<samp>maxrate (<em>-M</em>)</samp>&rsquo;</dt>
  8908. <dd><p>Set maximum bitrate expressed in bits/s. <code>oggenc</code> &lsquo;<samp>-M</samp>&rsquo; is
  8909. expressed in kilobits/s. This only has effect on ABR mode.
  8910. </p>
  8911. </dd>
  8912. <dt>&lsquo;<samp>iblock (<em>--advanced-encode-option impulse_noisetune=N</em>)</samp>&rsquo;</dt>
  8913. <dd><p>Set noise floor bias for impulse blocks. The value is a float number from
  8914. -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
  8915. to the crispness of transients in the encoded audio. The tradeoff for better
  8916. transient response is a higher bitrate.
  8917. </p>
  8918. </dd>
  8919. </dl>
  8920. <p><a name="libwavpack"></a>
  8921. </p><a name="libwavpack-1"></a>
  8922. <h2 class="section"><a href="ffmpeg-all.html#toc-libwavpack-1">15.13 libwavpack</a></h2>
  8923. <p>A wrapper providing WavPack encoding through libwavpack.
  8924. </p>
  8925. <p>Only lossless mode using 32-bit integer samples is supported currently.
  8926. </p>
  8927. <p>Requires the presence of the libwavpack headers and library during
  8928. configuration. You need to explicitly configure the build with
  8929. <code>--enable-libwavpack</code>.
  8930. </p>
  8931. <p>Note that a libavcodec-native encoder for the WavPack codec exists so users can
  8932. encode audios with this codec without using this encoder. See <a href="#wavpackenc">wavpackenc</a>.
  8933. </p>
  8934. <a name="Options-30"></a>
  8935. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-30">15.13.1 Options</a></h3>
  8936. <p><code>wavpack</code> command line utility&rsquo;s corresponding options are listed in
  8937. parentheses, if any.
  8938. </p>
  8939. <dl compact="compact">
  8940. <dt>&lsquo;<samp>frame_size (<em>--blocksize</em>)</samp>&rsquo;</dt>
  8941. <dd><p>Default is 32768.
  8942. </p>
  8943. </dd>
  8944. <dt>&lsquo;<samp>compression_level</samp>&rsquo;</dt>
  8945. <dd><p>Set speed vs. compression tradeoff. Acceptable arguments are listed below:
  8946. </p>
  8947. <dl compact="compact">
  8948. <dt>&lsquo;<samp>0 (<em>-f</em>)</samp>&rsquo;</dt>
  8949. <dd><p>Fast mode.
  8950. </p>
  8951. </dd>
  8952. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  8953. <dd><p>Normal (default) settings.
  8954. </p>
  8955. </dd>
  8956. <dt>&lsquo;<samp>2 (<em>-h</em>)</samp>&rsquo;</dt>
  8957. <dd><p>High quality.
  8958. </p>
  8959. </dd>
  8960. <dt>&lsquo;<samp>3 (<em>-hh</em>)</samp>&rsquo;</dt>
  8961. <dd><p>Very high quality.
  8962. </p>
  8963. </dd>
  8964. <dt>&lsquo;<samp>4-8 (<em>-hh -x</em><var>EXTRAPROC</var>)</samp>&rsquo;</dt>
  8965. <dd><p>Same as &lsquo;<samp>3</samp>&rsquo;, but with extra processing enabled.
  8966. </p>
  8967. <p>&lsquo;<samp>4</samp>&rsquo; is the same as &lsquo;<samp>-x2</samp>&rsquo; and &lsquo;<samp>8</samp>&rsquo; is the same as &lsquo;<samp>-x6</samp>&rsquo;.
  8968. </p>
  8969. </dd>
  8970. </dl>
  8971. </dd>
  8972. </dl>
  8973. <p><a name="mjpegenc"></a>
  8974. </p><a name="mjpeg"></a>
  8975. <h2 class="section"><a href="ffmpeg-all.html#toc-mjpeg">15.14 mjpeg</a></h2>
  8976. <p>Motion JPEG encoder.
  8977. </p>
  8978. <a name="Options-82"></a>
  8979. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-82">15.14.1 Options</a></h3>
  8980. <dl compact="compact">
  8981. <dt>&lsquo;<samp>huffman</samp>&rsquo;</dt>
  8982. <dd><p>Set the huffman encoding strategy. Possible values:
  8983. </p>
  8984. <dl compact="compact">
  8985. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  8986. <dd><p>Use the default huffman tables. This is the default strategy.
  8987. </p>
  8988. </dd>
  8989. <dt>&lsquo;<samp>optimal</samp>&rsquo;</dt>
  8990. <dd><p>Compute and use optimal huffman tables.
  8991. </p>
  8992. </dd>
  8993. </dl>
  8994. </dd>
  8995. </dl>
  8996. <p><a name="wavpackenc"></a>
  8997. </p><a name="wavpack"></a>
  8998. <h2 class="section"><a href="ffmpeg-all.html#toc-wavpack">15.15 wavpack</a></h2>
  8999. <p>WavPack lossless audio encoder.
  9000. </p>
  9001. <p>This is a libavcodec-native WavPack encoder. There is also an encoder based on
  9002. libwavpack, but there is virtually no reason to use that encoder.
  9003. </p>
  9004. <p>See also <a href="#libwavpack">libwavpack</a>.
  9005. </p>
  9006. <a name="Options-25"></a>
  9007. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-25">15.15.1 Options</a></h3>
  9008. <p>The equivalent options for <code>wavpack</code> command line utility are listed in
  9009. parentheses.
  9010. </p>
  9011. <a name="Shared-options"></a>
  9012. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Shared-options">15.15.1.1 Shared options</a></h4>
  9013. <p>The following shared options are effective for this encoder. Only special notes
  9014. about this particular encoder will be documented here. For the general meaning
  9015. of the options, see <a href="#codec_002doptions">the Codec Options chapter</a>.
  9016. </p>
  9017. <dl compact="compact">
  9018. <dt>&lsquo;<samp>frame_size (<em>--blocksize</em>)</samp>&rsquo;</dt>
  9019. <dd><p>For this encoder, the range for this option is between 128 and 131072. Default
  9020. is automatically decided based on sample rate and number of channel.
  9021. </p>
  9022. <p>For the complete formula of calculating default, see
  9023. &lsquo;<tt>libavcodec/wavpackenc.c</tt>&rsquo;.
  9024. </p>
  9025. </dd>
  9026. <dt>&lsquo;<samp>compression_level (<em>-f</em>, <em>-h</em>, <em>-hh</em>, and <em>-x</em>)</samp>&rsquo;</dt>
  9027. <dd><p>This option&rsquo;s syntax is consistent with <a href="#libwavpack">libwavpack</a>&rsquo;s.
  9028. </p></dd>
  9029. </dl>
  9030. <a name="Private-options-1"></a>
  9031. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Private-options-1">15.15.1.2 Private options</a></h4>
  9032. <dl compact="compact">
  9033. <dt>&lsquo;<samp>joint_stereo (<em>-j</em>)</samp>&rsquo;</dt>
  9034. <dd><p>Set whether to enable joint stereo. Valid values are:
  9035. </p>
  9036. <dl compact="compact">
  9037. <dt>&lsquo;<samp>on (<em>1</em>)</samp>&rsquo;</dt>
  9038. <dd><p>Force mid/side audio encoding.
  9039. </p></dd>
  9040. <dt>&lsquo;<samp>off (<em>0</em>)</samp>&rsquo;</dt>
  9041. <dd><p>Force left/right audio encoding.
  9042. </p></dd>
  9043. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  9044. <dd><p>Let the encoder decide automatically.
  9045. </p></dd>
  9046. </dl>
  9047. </dd>
  9048. <dt>&lsquo;<samp>optimize_mono</samp>&rsquo;</dt>
  9049. <dd><p>Set whether to enable optimization for mono. This option is only effective for
  9050. non-mono streams. Available values:
  9051. </p>
  9052. <dl compact="compact">
  9053. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  9054. <dd><p>enabled
  9055. </p></dd>
  9056. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  9057. <dd><p>disabled
  9058. </p></dd>
  9059. </dl>
  9060. </dd>
  9061. </dl>
  9062. <a name="Video-Encoders"></a>
  9063. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Video-Encoders">16 Video Encoders</a></h1>
  9064. <p>A description of some of the currently available video encoders
  9065. follows.
  9066. </p>
  9067. <a name="Hap"></a>
  9068. <h2 class="section"><a href="ffmpeg-all.html#toc-Hap">16.1 Hap</a></h2>
  9069. <p>Vidvox Hap video encoder.
  9070. </p>
  9071. <a name="Options-15"></a>
  9072. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-15">16.1.1 Options</a></h3>
  9073. <dl compact="compact">
  9074. <dt>&lsquo;<samp>format <var>integer</var></samp>&rsquo;</dt>
  9075. <dd><p>Specifies the Hap format to encode.
  9076. </p>
  9077. <dl compact="compact">
  9078. <dt>&lsquo;<samp>hap</samp>&rsquo;</dt>
  9079. <dt>&lsquo;<samp>hap_alpha</samp>&rsquo;</dt>
  9080. <dt>&lsquo;<samp>hap_q</samp>&rsquo;</dt>
  9081. </dl>
  9082. <p>Default value is &lsquo;<samp>hap</samp>&rsquo;.
  9083. </p>
  9084. </dd>
  9085. <dt>&lsquo;<samp>chunks <var>integer</var></samp>&rsquo;</dt>
  9086. <dd><p>Specifies the number of chunks to split frames into, between 1 and 64. This
  9087. permits multithreaded decoding of large frames, potentially at the cost of
  9088. data-rate. The encoder may modify this value to divide frames evenly.
  9089. </p>
  9090. <p>Default value is <var>1</var>.
  9091. </p>
  9092. </dd>
  9093. <dt>&lsquo;<samp>compressor <var>integer</var></samp>&rsquo;</dt>
  9094. <dd><p>Specifies the second-stage compressor to use. If set to &lsquo;<samp>none</samp>&rsquo;,
  9095. &lsquo;<samp>chunks</samp>&rsquo; will be limited to 1, as chunked uncompressed frames offer no
  9096. benefit.
  9097. </p>
  9098. <dl compact="compact">
  9099. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  9100. <dt>&lsquo;<samp>snappy</samp>&rsquo;</dt>
  9101. </dl>
  9102. <p>Default value is &lsquo;<samp>snappy</samp>&rsquo;.
  9103. </p>
  9104. </dd>
  9105. </dl>
  9106. <a name="jpeg2000"></a>
  9107. <h2 class="section"><a href="ffmpeg-all.html#toc-jpeg2000">16.2 jpeg2000</a></h2>
  9108. <p>The native jpeg 2000 encoder is lossy by default, the <code>-q:v</code>
  9109. option can be used to set the encoding quality. Lossless encoding
  9110. can be selected with <code>-pred 1</code>.
  9111. </p>
  9112. <a name="Options-3"></a>
  9113. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-3">16.2.1 Options</a></h3>
  9114. <dl compact="compact">
  9115. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  9116. <dd><p>Can be set to either <code>j2k</code> or <code>jp2</code> (the default) that
  9117. makes it possible to store non-rgb pix_fmts.
  9118. </p>
  9119. </dd>
  9120. </dl>
  9121. <a name="librav1e"></a>
  9122. <h2 class="section"><a href="ffmpeg-all.html#toc-librav1e">16.3 librav1e</a></h2>
  9123. <p>rav1e AV1 encoder wrapper.
  9124. </p>
  9125. <p>Requires the presence of the rav1e headers and library during configuration.
  9126. You need to explicitly configure the build with <code>--enable-librav1e</code>.
  9127. </p>
  9128. <a name="Options-39"></a>
  9129. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-39">16.3.1 Options</a></h3>
  9130. <dl compact="compact">
  9131. <dt>&lsquo;<samp>qmax</samp>&rsquo;</dt>
  9132. <dd><p>Sets the maximum quantizer to use when using bitrate mode.
  9133. </p>
  9134. </dd>
  9135. <dt>&lsquo;<samp>qmin</samp>&rsquo;</dt>
  9136. <dd><p>Sets the minimum quantizer to use when using bitrate mode.
  9137. </p>
  9138. </dd>
  9139. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  9140. <dd><p>Uses quantizer mode to encode at the given quantizer (0-255).
  9141. </p>
  9142. </dd>
  9143. <dt>&lsquo;<samp>speed</samp>&rsquo;</dt>
  9144. <dd><p>Selects the speed preset (0-10) to encode with.
  9145. </p>
  9146. </dd>
  9147. <dt>&lsquo;<samp>tiles</samp>&rsquo;</dt>
  9148. <dd><p>Selects how many tiles to encode with.
  9149. </p>
  9150. </dd>
  9151. <dt>&lsquo;<samp>tile-rows</samp>&rsquo;</dt>
  9152. <dd><p>Selects how many rows of tiles to encode with.
  9153. </p>
  9154. </dd>
  9155. <dt>&lsquo;<samp>tile-columns</samp>&rsquo;</dt>
  9156. <dd><p>Selects how many columns of tiles to encode with.
  9157. </p>
  9158. </dd>
  9159. <dt>&lsquo;<samp>rav1e-params</samp>&rsquo;</dt>
  9160. <dd><p>Set rav1e options using a list of <var>key</var>=<var>value</var> pairs separated
  9161. by &quot;:&quot;. See <code>rav1e --help</code> for a list of options.
  9162. </p>
  9163. <p>For example to specify librav1e encoding options with &lsquo;<samp>-rav1e-params</samp>&rsquo;:
  9164. </p>
  9165. <div class="example">
  9166. <pre class="example">ffmpeg -i input -c:v librav1e -b:v 500K -rav1e-params speed=5:low_latency=true output.mp4
  9167. </pre></div>
  9168. </dd>
  9169. </dl>
  9170. <a name="libaom_002dav1"></a>
  9171. <h2 class="section"><a href="ffmpeg-all.html#toc-libaom_002dav1">16.4 libaom-av1</a></h2>
  9172. <p>libaom AV1 encoder wrapper.
  9173. </p>
  9174. <p>Requires the presence of the libaom headers and library during
  9175. configuration. You need to explicitly configure the build with
  9176. <code>--enable-libaom</code>.
  9177. </p>
  9178. <a name="Options-19"></a>
  9179. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-19">16.4.1 Options</a></h3>
  9180. <p>The wrapper supports the following standard libavcodec options:
  9181. </p>
  9182. <dl compact="compact">
  9183. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  9184. <dd><p>Set bitrate target in bits/second. By default this will use
  9185. variable-bitrate mode. If &lsquo;<samp>maxrate</samp>&rsquo; and &lsquo;<samp>minrate</samp>&rsquo; are
  9186. also set to the same value then it will use constant-bitrate mode,
  9187. otherwise if &lsquo;<samp>crf</samp>&rsquo; is set as well then it will use
  9188. constrained-quality mode.
  9189. </p>
  9190. </dd>
  9191. <dt>&lsquo;<samp>g keyint_min</samp>&rsquo;</dt>
  9192. <dd><p>Set key frame placement. The GOP size sets the maximum distance between
  9193. key frames; if zero the output stream will be intra-only. The minimum
  9194. distance is ignored unless it is the same as the GOP size, in which case
  9195. key frames will always appear at a fixed interval. Not set by default,
  9196. so without this option the library has completely free choice about
  9197. where to place key frames.
  9198. </p>
  9199. </dd>
  9200. <dt>&lsquo;<samp>qmin qmax</samp>&rsquo;</dt>
  9201. <dd><p>Set minimum/maximum quantisation values. Valid range is from 0 to 63
  9202. (warning: this does not match the quantiser values actually used by AV1
  9203. - divide by four to map real quantiser values to this range). Defaults
  9204. to min/max (no constraint).
  9205. </p>
  9206. </dd>
  9207. <dt>&lsquo;<samp>minrate maxrate bufsize rc_init_occupancy</samp>&rsquo;</dt>
  9208. <dd><p>Set rate control buffering parameters. Not used if not set - defaults
  9209. to unconstrained variable bitrate.
  9210. </p>
  9211. </dd>
  9212. <dt>&lsquo;<samp>threads</samp>&rsquo;</dt>
  9213. <dd><p>Set the number of threads to use while encoding. This may require the
  9214. &lsquo;<samp>tiles</samp>&rsquo; or &lsquo;<samp>row-mt</samp>&rsquo; options to also be set to actually
  9215. use the specified number of threads fully. Defaults to the number of
  9216. hardware threads supported by the host machine.
  9217. </p>
  9218. </dd>
  9219. <dt>&lsquo;<samp>profile</samp>&rsquo;</dt>
  9220. <dd><p>Set the encoding profile. Defaults to using the profile which matches
  9221. the bit depth and chroma subsampling of the input.
  9222. </p>
  9223. </dd>
  9224. </dl>
  9225. <p>The wrapper also has some specific options:
  9226. </p>
  9227. <dl compact="compact">
  9228. <dt>&lsquo;<samp>cpu-used</samp>&rsquo;</dt>
  9229. <dd><p>Set the quality/encoding speed tradeoff. Valid range is from 0 to 8,
  9230. higher numbers indicating greater speed and lower quality. The default
  9231. value is 1, which will be slow and high quality.
  9232. </p>
  9233. </dd>
  9234. <dt>&lsquo;<samp>auto-alt-ref</samp>&rsquo;</dt>
  9235. <dd><p>Enable use of alternate reference frames. Defaults to the internal
  9236. default of the library.
  9237. </p>
  9238. </dd>
  9239. <dt>&lsquo;<samp>arnr-max-frames (<em>frames</em>)</samp>&rsquo;</dt>
  9240. <dd><p>Set altref noise reduction max frame count. Default is -1.
  9241. </p>
  9242. </dd>
  9243. <dt>&lsquo;<samp>arnr-strength (<em>strength</em>)</samp>&rsquo;</dt>
  9244. <dd><p>Set altref noise reduction filter strength. Range is -1 to 6. Default is -1.
  9245. </p>
  9246. </dd>
  9247. <dt>&lsquo;<samp>aq-mode (<em>aq-mode</em>)</samp>&rsquo;</dt>
  9248. <dd><p>Set adaptive quantization mode. Possible values:
  9249. </p>
  9250. <dl compact="compact">
  9251. <dt>&lsquo;<samp>none (<em>0</em>)</samp>&rsquo;</dt>
  9252. <dd><p>Disabled.
  9253. </p>
  9254. </dd>
  9255. <dt>&lsquo;<samp>variance (<em>1</em>)</samp>&rsquo;</dt>
  9256. <dd><p>Variance-based.
  9257. </p>
  9258. </dd>
  9259. <dt>&lsquo;<samp>complexity (<em>2</em>)</samp>&rsquo;</dt>
  9260. <dd><p>Complexity-based.
  9261. </p>
  9262. </dd>
  9263. <dt>&lsquo;<samp>cyclic (<em>3</em>)</samp>&rsquo;</dt>
  9264. <dd><p>Cyclic refresh.
  9265. </p></dd>
  9266. </dl>
  9267. </dd>
  9268. <dt>&lsquo;<samp>tune (<em>tune</em>)</samp>&rsquo;</dt>
  9269. <dd><p>Set the distortion metric the encoder is tuned with. Default is <code>psnr</code>.
  9270. </p>
  9271. <dl compact="compact">
  9272. <dt>&lsquo;<samp>psnr (<em>0</em>)</samp>&rsquo;</dt>
  9273. <dt>&lsquo;<samp>ssim (<em>1</em>)</samp>&rsquo;</dt>
  9274. </dl>
  9275. </dd>
  9276. <dt>&lsquo;<samp>lag-in-frames</samp>&rsquo;</dt>
  9277. <dd><p>Set the maximum number of frames which the encoder may keep in flight
  9278. at any one time for lookahead purposes. Defaults to the internal
  9279. default of the library.
  9280. </p>
  9281. </dd>
  9282. <dt>&lsquo;<samp>error-resilience</samp>&rsquo;</dt>
  9283. <dd><p>Enable error resilience features:
  9284. </p><dl compact="compact">
  9285. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  9286. <dd><p>Improve resilience against losses of whole frames.
  9287. </p></dd>
  9288. </dl>
  9289. <p>Not enabled by default.
  9290. </p>
  9291. </dd>
  9292. <dt>&lsquo;<samp>crf</samp>&rsquo;</dt>
  9293. <dd><p>Set the quality/size tradeoff for constant-quality (no bitrate target)
  9294. and constrained-quality (with maximum bitrate target) modes. Valid
  9295. range is 0 to 63, higher numbers indicating lower quality and smaller
  9296. output size. Only used if set; by default only the bitrate target is
  9297. used.
  9298. </p>
  9299. </dd>
  9300. <dt>&lsquo;<samp>static-thresh</samp>&rsquo;</dt>
  9301. <dd><p>Set a change threshold on blocks below which they will be skipped by
  9302. the encoder. Defined in arbitrary units as a nonnegative integer,
  9303. defaulting to zero (no blocks are skipped).
  9304. </p>
  9305. </dd>
  9306. <dt>&lsquo;<samp>drop-threshold</samp>&rsquo;</dt>
  9307. <dd><p>Set a threshold for dropping frames when close to rate control bounds.
  9308. Defined as a percentage of the target buffer - when the rate control
  9309. buffer falls below this percentage, frames will be dropped until it
  9310. has refilled above the threshold. Defaults to zero (no frames are
  9311. dropped).
  9312. </p>
  9313. </dd>
  9314. <dt>&lsquo;<samp>denoise-noise-level (<em>level</em>)</samp>&rsquo;</dt>
  9315. <dd><p>Amount of noise to be removed for grain synthesis. Grain synthesis is disabled if
  9316. this option is not set or set to 0.
  9317. </p>
  9318. </dd>
  9319. <dt>&lsquo;<samp>denoise-block-size (<em>pixels</em>)</samp>&rsquo;</dt>
  9320. <dd><p>Block size used for denoising for grain synthesis. If not set, AV1 codec
  9321. uses the default value of 32.
  9322. </p>
  9323. </dd>
  9324. <dt>&lsquo;<samp>undershoot-pct (<em>pct</em>)</samp>&rsquo;</dt>
  9325. <dd><p>Set datarate undershoot (min) percentage of the target bitrate. Range is -1 to 100.
  9326. Default is -1.
  9327. </p>
  9328. </dd>
  9329. <dt>&lsquo;<samp>overshoot-pct (<em>pct</em>)</samp>&rsquo;</dt>
  9330. <dd><p>Set datarate overshoot (max) percentage of the target bitrate. Range is -1 to 1000.
  9331. Default is -1.
  9332. </p>
  9333. </dd>
  9334. <dt>&lsquo;<samp>minsection-pct (<em>pct</em>)</samp>&rsquo;</dt>
  9335. <dd><p>Minimum percentage variation of the GOP bitrate from the target bitrate. If minsection-pct
  9336. is not set, the libaomenc wrapper computes it as follows: <code>(minrate * 100 / bitrate)</code>.
  9337. Range is -1 to 100. Default is -1 (unset).
  9338. </p>
  9339. </dd>
  9340. <dt>&lsquo;<samp>maxsection-pct (<em>pct</em>)</samp>&rsquo;</dt>
  9341. <dd><p>Maximum percentage variation of the GOP bitrate from the target bitrate. If maxsection-pct
  9342. is not set, the libaomenc wrapper computes it as follows: <code>(maxrate * 100 / bitrate)</code>.
  9343. Range is -1 to 5000. Default is -1 (unset).
  9344. </p>
  9345. </dd>
  9346. <dt>&lsquo;<samp>frame-parallel (<em>boolean</em>)</samp>&rsquo;</dt>
  9347. <dd><p>Enable frame parallel decodability features. Default is true.
  9348. </p>
  9349. </dd>
  9350. <dt>&lsquo;<samp>tiles</samp>&rsquo;</dt>
  9351. <dd><p>Set the number of tiles to encode the input video with, as columns x
  9352. rows. Larger numbers allow greater parallelism in both encoding and
  9353. decoding, but may decrease coding efficiency. Defaults to the minimum
  9354. number of tiles required by the size of the input video (this is 1x1
  9355. (that is, a single tile) for sizes up to and including 4K).
  9356. </p>
  9357. </dd>
  9358. <dt>&lsquo;<samp>tile-columns tile-rows</samp>&rsquo;</dt>
  9359. <dd><p>Set the number of tiles as log2 of the number of tile rows and columns.
  9360. Provided for compatibility with libvpx/VP9.
  9361. </p>
  9362. </dd>
  9363. <dt>&lsquo;<samp>row-mt (Requires libaom &gt;= 1.0.0-759-g90a15f4f2)</samp>&rsquo;</dt>
  9364. <dd><p>Enable row based multi-threading. Disabled by default.
  9365. </p>
  9366. </dd>
  9367. <dt>&lsquo;<samp>enable-cdef (<em>boolean</em>)</samp>&rsquo;</dt>
  9368. <dd><p>Enable Constrained Directional Enhancement Filter. The libaom-av1
  9369. encoder enables CDEF by default.
  9370. </p>
  9371. </dd>
  9372. <dt>&lsquo;<samp>enable-restoration (<em>boolean</em>)</samp>&rsquo;</dt>
  9373. <dd><p>Enable Loop Restoration Filter. Default is true for libaom-av1.
  9374. </p>
  9375. </dd>
  9376. <dt>&lsquo;<samp>enable-global-motion (<em>boolean</em>)</samp>&rsquo;</dt>
  9377. <dd><p>Enable the use of global motion for block prediction. Default is true.
  9378. </p>
  9379. </dd>
  9380. <dt>&lsquo;<samp>enable-intrabc (<em>boolean</em>)</samp>&rsquo;</dt>
  9381. <dd><p>Enable block copy mode for intra block prediction. This mode is
  9382. useful for screen content. Default is true.
  9383. </p>
  9384. </dd>
  9385. </dl>
  9386. <a name="libkvazaar"></a>
  9387. <h2 class="section"><a href="ffmpeg-all.html#toc-libkvazaar">16.5 libkvazaar</a></h2>
  9388. <p>Kvazaar H.265/HEVC encoder.
  9389. </p>
  9390. <p>Requires the presence of the libkvazaar headers and library during
  9391. configuration. You need to explicitly configure the build with
  9392. &lsquo;<samp>--enable-libkvazaar</samp>&rsquo;.
  9393. </p>
  9394. <a name="Options"></a>
  9395. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options">16.5.1 Options</a></h3>
  9396. <dl compact="compact">
  9397. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  9398. <dd><p>Set target video bitrate in bit/s and enable rate control.
  9399. </p>
  9400. </dd>
  9401. <dt>&lsquo;<samp>kvazaar-params</samp>&rsquo;</dt>
  9402. <dd><p>Set kvazaar parameters as a list of <var>name</var>=<var>value</var> pairs separated
  9403. by commas (,). See kvazaar documentation for a list of options.
  9404. </p>
  9405. </dd>
  9406. </dl>
  9407. <a name="libopenh264"></a>
  9408. <h2 class="section"><a href="ffmpeg-all.html#toc-libopenh264">16.6 libopenh264</a></h2>
  9409. <p>Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper.
  9410. </p>
  9411. <p>This encoder requires the presence of the libopenh264 headers and
  9412. library during configuration. You need to explicitly configure the
  9413. build with <code>--enable-libopenh264</code>. The library is detected using
  9414. <code>pkg-config</code>.
  9415. </p>
  9416. <p>For more information about the library see
  9417. <a href="http://www.openh264.org">http://www.openh264.org</a>.
  9418. </p>
  9419. <a name="Options-37"></a>
  9420. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-37">16.6.1 Options</a></h3>
  9421. <p>The following FFmpeg global options affect the configurations of the
  9422. libopenh264 encoder.
  9423. </p>
  9424. <dl compact="compact">
  9425. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  9426. <dd><p>Set the bitrate (as a number of bits per second).
  9427. </p>
  9428. </dd>
  9429. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  9430. <dd><p>Set the GOP size.
  9431. </p>
  9432. </dd>
  9433. <dt>&lsquo;<samp>maxrate</samp>&rsquo;</dt>
  9434. <dd><p>Set the max bitrate (as a number of bits per second).
  9435. </p>
  9436. </dd>
  9437. <dt>&lsquo;<samp>flags +global_header</samp>&rsquo;</dt>
  9438. <dd><p>Set global header in the bitstream.
  9439. </p>
  9440. </dd>
  9441. <dt>&lsquo;<samp>slices</samp>&rsquo;</dt>
  9442. <dd><p>Set the number of slices, used in parallelized encoding. Default value
  9443. is 0. This is only used when &lsquo;<samp>slice_mode</samp>&rsquo; is set to
  9444. &lsquo;<samp>fixed</samp>&rsquo;.
  9445. </p>
  9446. </dd>
  9447. <dt>&lsquo;<samp>slice_mode</samp>&rsquo;</dt>
  9448. <dd><p>Set slice mode. Can assume one of the following possible values:
  9449. </p>
  9450. <dl compact="compact">
  9451. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  9452. <dd><p>a fixed number of slices
  9453. </p></dd>
  9454. <dt>&lsquo;<samp>rowmb</samp>&rsquo;</dt>
  9455. <dd><p>one slice per row of macroblocks
  9456. </p></dd>
  9457. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  9458. <dd><p>automatic number of slices according to number of threads
  9459. </p></dd>
  9460. <dt>&lsquo;<samp>dyn</samp>&rsquo;</dt>
  9461. <dd><p>dynamic slicing
  9462. </p></dd>
  9463. </dl>
  9464. <p>Default value is &lsquo;<samp>auto</samp>&rsquo;.
  9465. </p>
  9466. </dd>
  9467. <dt>&lsquo;<samp>loopfilter</samp>&rsquo;</dt>
  9468. <dd><p>Enable loop filter, if set to 1 (automatically enabled). To disable
  9469. set a value of 0.
  9470. </p>
  9471. </dd>
  9472. <dt>&lsquo;<samp>profile</samp>&rsquo;</dt>
  9473. <dd><p>Set profile restrictions. If set to the value of &lsquo;<samp>main</samp>&rsquo; enable
  9474. CABAC (set the <code>SEncParamExt.iEntropyCodingModeFlag</code> flag to 1).
  9475. </p>
  9476. </dd>
  9477. <dt>&lsquo;<samp>max_nal_size</samp>&rsquo;</dt>
  9478. <dd><p>Set maximum NAL size in bytes.
  9479. </p>
  9480. </dd>
  9481. <dt>&lsquo;<samp>allow_skip_frames</samp>&rsquo;</dt>
  9482. <dd><p>Allow skipping frames to hit the target bitrate if set to 1.
  9483. </p></dd>
  9484. </dl>
  9485. <a name="libtheora"></a>
  9486. <h2 class="section"><a href="ffmpeg-all.html#toc-libtheora">16.7 libtheora</a></h2>
  9487. <p>libtheora Theora encoder wrapper.
  9488. </p>
  9489. <p>Requires the presence of the libtheora headers and library during
  9490. configuration. You need to explicitly configure the build with
  9491. <code>--enable-libtheora</code>.
  9492. </p>
  9493. <p>For more information about the libtheora project see
  9494. <a href="http://www.theora.org/">http://www.theora.org/</a>.
  9495. </p>
  9496. <a name="Options-80"></a>
  9497. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-80">16.7.1 Options</a></h3>
  9498. <p>The following global options are mapped to internal libtheora options
  9499. which affect the quality and the bitrate of the encoded stream.
  9500. </p>
  9501. <dl compact="compact">
  9502. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  9503. <dd><p>Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In
  9504. case VBR (Variable Bit Rate) mode is enabled this option is ignored.
  9505. </p>
  9506. </dd>
  9507. <dt>&lsquo;<samp>flags</samp>&rsquo;</dt>
  9508. <dd><p>Used to enable constant quality mode (VBR) encoding through the
  9509. &lsquo;<samp>qscale</samp>&rsquo; flag, and to enable the <code>pass1</code> and <code>pass2</code>
  9510. modes.
  9511. </p>
  9512. </dd>
  9513. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  9514. <dd><p>Set the GOP size.
  9515. </p>
  9516. </dd>
  9517. <dt>&lsquo;<samp>global_quality</samp>&rsquo;</dt>
  9518. <dd><p>Set the global quality as an integer in lambda units.
  9519. </p>
  9520. <p>Only relevant when VBR mode is enabled with <code>flags +qscale</code>. The
  9521. value is converted to QP units by dividing it by <code>FF_QP2LAMBDA</code>,
  9522. clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
  9523. value in the native libtheora range [0-63]. A higher value corresponds
  9524. to a higher quality.
  9525. </p>
  9526. </dd>
  9527. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  9528. <dd><p>Enable VBR mode when set to a non-negative value, and set constant
  9529. quality value as a double floating point value in QP units.
  9530. </p>
  9531. <p>The value is clipped in the [0-10] range, and then multiplied by 6.3
  9532. to get a value in the native libtheora range [0-63].
  9533. </p>
  9534. <p>This option is valid only using the <code>ffmpeg</code> command-line
  9535. tool. For library interface users, use &lsquo;<samp>global_quality</samp>&rsquo;.
  9536. </p></dd>
  9537. </dl>
  9538. <a name="Examples-136"></a>
  9539. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-136">16.7.2 Examples</a></h3>
  9540. <ul>
  9541. <li>
  9542. Set maximum constant quality (VBR) encoding with <code>ffmpeg</code>:
  9543. <div class="example">
  9544. <pre class="example">ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
  9545. </pre></div>
  9546. </li><li>
  9547. Use <code>ffmpeg</code> to convert a CBR 1000 kbps Theora video stream:
  9548. <div class="example">
  9549. <pre class="example">ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
  9550. </pre></div>
  9551. </li></ul>
  9552. <a name="libvpx"></a>
  9553. <h2 class="section"><a href="ffmpeg-all.html#toc-libvpx">16.8 libvpx</a></h2>
  9554. <p>VP8/VP9 format supported through libvpx.
  9555. </p>
  9556. <p>Requires the presence of the libvpx headers and library during configuration.
  9557. You need to explicitly configure the build with <code>--enable-libvpx</code>.
  9558. </p>
  9559. <a name="Options-56"></a>
  9560. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-56">16.8.1 Options</a></h3>
  9561. <p>The following options are supported by the libvpx wrapper. The
  9562. <code>vpxenc</code>-equivalent options or values are listed in parentheses
  9563. for easy migration.
  9564. </p>
  9565. <p>To reduce the duplication of documentation, only the private options
  9566. and some others requiring special attention are documented here. For
  9567. the documentation of the undocumented generic options, see
  9568. <a href="#codec_002doptions">the Codec Options chapter</a>.
  9569. </p>
  9570. <p>To get more documentation of the libvpx options, invoke the command
  9571. <code>ffmpeg -h encoder=libvpx</code>, <code>ffmpeg -h encoder=libvpx-vp9</code> or
  9572. <code>vpxenc --help</code>. Further information is available in the libvpx API
  9573. documentation.
  9574. </p>
  9575. <dl compact="compact">
  9576. <dt>&lsquo;<samp>b (<em>target-bitrate</em>)</samp>&rsquo;</dt>
  9577. <dd><p>Set bitrate in bits/s. Note that FFmpeg&rsquo;s &lsquo;<samp>b</samp>&rsquo; option is
  9578. expressed in bits/s, while <code>vpxenc</code>&rsquo;s &lsquo;<samp>target-bitrate</samp>&rsquo; is in
  9579. kilobits/s.
  9580. </p>
  9581. </dd>
  9582. <dt>&lsquo;<samp>g (<em>kf-max-dist</em>)</samp>&rsquo;</dt>
  9583. <dt>&lsquo;<samp>keyint_min (<em>kf-min-dist</em>)</samp>&rsquo;</dt>
  9584. <dt>&lsquo;<samp>qmin (<em>min-q</em>)</samp>&rsquo;</dt>
  9585. <dt>&lsquo;<samp>qmax (<em>max-q</em>)</samp>&rsquo;</dt>
  9586. <dt>&lsquo;<samp>bufsize (<em>buf-sz</em>, <em>buf-optimal-sz</em>)</samp>&rsquo;</dt>
  9587. <dd><p>Set ratecontrol buffer size (in bits). Note <code>vpxenc</code>&rsquo;s options are
  9588. specified in milliseconds, the libvpx wrapper converts this value as follows:
  9589. <code>buf-sz = bufsize * 1000 / bitrate</code>,
  9590. <code>buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6</code>.
  9591. </p>
  9592. </dd>
  9593. <dt>&lsquo;<samp>rc_init_occupancy (<em>buf-initial-sz</em>)</samp>&rsquo;</dt>
  9594. <dd><p>Set number of bits which should be loaded into the rc buffer before decoding
  9595. starts. Note <code>vpxenc</code>&rsquo;s option is specified in milliseconds, the libvpx
  9596. wrapper converts this value as follows:
  9597. <code>rc_init_occupancy * 1000 / bitrate</code>.
  9598. </p>
  9599. </dd>
  9600. <dt>&lsquo;<samp>undershoot-pct</samp>&rsquo;</dt>
  9601. <dd><p>Set datarate undershoot (min) percentage of the target bitrate.
  9602. </p>
  9603. </dd>
  9604. <dt>&lsquo;<samp>overshoot-pct</samp>&rsquo;</dt>
  9605. <dd><p>Set datarate overshoot (max) percentage of the target bitrate.
  9606. </p>
  9607. </dd>
  9608. <dt>&lsquo;<samp>skip_threshold (<em>drop-frame</em>)</samp>&rsquo;</dt>
  9609. <dt>&lsquo;<samp>qcomp (<em>bias-pct</em>)</samp>&rsquo;</dt>
  9610. <dt>&lsquo;<samp>maxrate (<em>maxsection-pct</em>)</samp>&rsquo;</dt>
  9611. <dd><p>Set GOP max bitrate in bits/s. Note <code>vpxenc</code>&rsquo;s option is specified as a
  9612. percentage of the target bitrate, the libvpx wrapper converts this value as
  9613. follows: <code>(maxrate * 100 / bitrate)</code>.
  9614. </p>
  9615. </dd>
  9616. <dt>&lsquo;<samp>minrate (<em>minsection-pct</em>)</samp>&rsquo;</dt>
  9617. <dd><p>Set GOP min bitrate in bits/s. Note <code>vpxenc</code>&rsquo;s option is specified as a
  9618. percentage of the target bitrate, the libvpx wrapper converts this value as
  9619. follows: <code>(minrate * 100 / bitrate)</code>.
  9620. </p>
  9621. </dd>
  9622. <dt>&lsquo;<samp>minrate, maxrate, b <em>end-usage=cbr</em></samp>&rsquo;</dt>
  9623. <dd><p><code>(minrate == maxrate == bitrate)</code>.
  9624. </p>
  9625. </dd>
  9626. <dt>&lsquo;<samp>crf (<em>end-usage=cq</em>, <em>cq-level</em>)</samp>&rsquo;</dt>
  9627. <dt>&lsquo;<samp>tune (<em>tune</em>)</samp>&rsquo;</dt>
  9628. <dd><dl compact="compact">
  9629. <dt>&lsquo;<samp>psnr (<em>psnr</em>)</samp>&rsquo;</dt>
  9630. <dt>&lsquo;<samp>ssim (<em>ssim</em>)</samp>&rsquo;</dt>
  9631. </dl>
  9632. </dd>
  9633. <dt>&lsquo;<samp>quality, deadline (<em>deadline</em>)</samp>&rsquo;</dt>
  9634. <dd><dl compact="compact">
  9635. <dt>&lsquo;<samp>best</samp>&rsquo;</dt>
  9636. <dd><p>Use best quality deadline. Poorly named and quite slow, this option should be
  9637. avoided as it may give worse quality output than good.
  9638. </p></dd>
  9639. <dt>&lsquo;<samp>good</samp>&rsquo;</dt>
  9640. <dd><p>Use good quality deadline. This is a good trade-off between speed and quality
  9641. when used with the &lsquo;<samp>cpu-used</samp>&rsquo; option.
  9642. </p></dd>
  9643. <dt>&lsquo;<samp>realtime</samp>&rsquo;</dt>
  9644. <dd><p>Use realtime quality deadline.
  9645. </p></dd>
  9646. </dl>
  9647. </dd>
  9648. <dt>&lsquo;<samp>speed, cpu-used (<em>cpu-used</em>)</samp>&rsquo;</dt>
  9649. <dd><p>Set quality/speed ratio modifier. Higher values speed up the encode at the cost
  9650. of quality.
  9651. </p>
  9652. </dd>
  9653. <dt>&lsquo;<samp>nr (<em>noise-sensitivity</em>)</samp>&rsquo;</dt>
  9654. <dt>&lsquo;<samp>static-thresh</samp>&rsquo;</dt>
  9655. <dd><p>Set a change threshold on blocks below which they will be skipped by the
  9656. encoder.
  9657. </p>
  9658. </dd>
  9659. <dt>&lsquo;<samp>slices (<em>token-parts</em>)</samp>&rsquo;</dt>
  9660. <dd><p>Note that FFmpeg&rsquo;s &lsquo;<samp>slices</samp>&rsquo; option gives the total number of partitions,
  9661. while <code>vpxenc</code>&rsquo;s &lsquo;<samp>token-parts</samp>&rsquo; is given as
  9662. <code>log2(partitions)</code>.
  9663. </p>
  9664. </dd>
  9665. <dt>&lsquo;<samp>max-intra-rate</samp>&rsquo;</dt>
  9666. <dd><p>Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0
  9667. means unlimited.
  9668. </p>
  9669. </dd>
  9670. <dt>&lsquo;<samp>force_key_frames</samp>&rsquo;</dt>
  9671. <dd><p><code>VPX_EFLAG_FORCE_KF</code>
  9672. </p>
  9673. </dd>
  9674. <dt>&lsquo;<samp>Alternate reference frame related</samp>&rsquo;</dt>
  9675. <dd><dl compact="compact">
  9676. <dt>&lsquo;<samp>auto-alt-ref</samp>&rsquo;</dt>
  9677. <dd><p>Enable use of alternate reference frames (2-pass only).
  9678. Values greater than 1 enable multi-layer alternate reference frames (VP9 only).
  9679. </p></dd>
  9680. <dt>&lsquo;<samp>arnr-maxframes</samp>&rsquo;</dt>
  9681. <dd><p>Set altref noise reduction max frame count.
  9682. </p></dd>
  9683. <dt>&lsquo;<samp>arnr-type</samp>&rsquo;</dt>
  9684. <dd><p>Set altref noise reduction filter type: backward, forward, centered.
  9685. </p></dd>
  9686. <dt>&lsquo;<samp>arnr-strength</samp>&rsquo;</dt>
  9687. <dd><p>Set altref noise reduction filter strength.
  9688. </p></dd>
  9689. <dt>&lsquo;<samp>rc-lookahead, lag-in-frames (<em>lag-in-frames</em>)</samp>&rsquo;</dt>
  9690. <dd><p>Set number of frames to look ahead for frametype and ratecontrol.
  9691. </p></dd>
  9692. </dl>
  9693. </dd>
  9694. <dt>&lsquo;<samp>error-resilient</samp>&rsquo;</dt>
  9695. <dd><p>Enable error resiliency features.
  9696. </p>
  9697. </dd>
  9698. <dt>&lsquo;<samp>sharpness <var>integer</var></samp>&rsquo;</dt>
  9699. <dd><p>Increase sharpness at the expense of lower PSNR.
  9700. The valid range is [0, 7].
  9701. </p>
  9702. </dd>
  9703. <dt>&lsquo;<samp>ts-parameters</samp>&rsquo;</dt>
  9704. <dd><p>Sets the temporal scalability configuration using a :-separated list of
  9705. key=value pairs. For example, to specify temporal scalability parameters
  9706. with <code>ffmpeg</code>:
  9707. </p><div class="example">
  9708. <pre class="example">ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
  9709. ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
  9710. ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
  9711. </pre></div>
  9712. <p>Below is a brief explanation of each of the parameters, please
  9713. refer to <code>struct vpx_codec_enc_cfg</code> in <code>vpx/vpx_encoder.h</code> for more
  9714. details.
  9715. </p><dl compact="compact">
  9716. <dt>&lsquo;<samp>ts_number_layers</samp>&rsquo;</dt>
  9717. <dd><p>Number of temporal coding layers.
  9718. </p></dd>
  9719. <dt>&lsquo;<samp>ts_target_bitrate</samp>&rsquo;</dt>
  9720. <dd><p>Target bitrate for each temporal layer (in kbps).
  9721. (bitrate should be inclusive of the lower temporal layer).
  9722. </p></dd>
  9723. <dt>&lsquo;<samp>ts_rate_decimator</samp>&rsquo;</dt>
  9724. <dd><p>Frame rate decimation factor for each temporal layer.
  9725. </p></dd>
  9726. <dt>&lsquo;<samp>ts_periodicity</samp>&rsquo;</dt>
  9727. <dd><p>Length of the sequence defining frame temporal layer membership.
  9728. </p></dd>
  9729. <dt>&lsquo;<samp>ts_layer_id</samp>&rsquo;</dt>
  9730. <dd><p>Template defining the membership of frames to temporal layers.
  9731. </p></dd>
  9732. <dt>&lsquo;<samp>ts_layering_mode</samp>&rsquo;</dt>
  9733. <dd><p>(optional) Selecting the temporal structure from a set of pre-defined temporal layering modes.
  9734. Currently supports the following options.
  9735. </p><dl compact="compact">
  9736. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  9737. <dd><p>No temporal layering flags are provided internally,
  9738. relies on flags being passed in using <code>metadata</code> field in <code>AVFrame</code>
  9739. with following keys.
  9740. </p><dl compact="compact">
  9741. <dt>&lsquo;<samp>vp8-flags</samp>&rsquo;</dt>
  9742. <dd><p>Sets the flags passed into the encoder to indicate the referencing scheme for
  9743. the current frame.
  9744. Refer to function <code>vpx_codec_encode</code> in <code>vpx/vpx_encoder.h</code> for more
  9745. details.
  9746. </p></dd>
  9747. <dt>&lsquo;<samp>temporal_id</samp>&rsquo;</dt>
  9748. <dd><p>Explicitly sets the temporal id of the current frame to encode.
  9749. </p></dd>
  9750. </dl>
  9751. </dd>
  9752. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  9753. <dd><p>Two temporal layers. 0-1...
  9754. </p></dd>
  9755. <dt>&lsquo;<samp>3</samp>&rsquo;</dt>
  9756. <dd><p>Three temporal layers. 0-2-1-2...; with single reference frame.
  9757. </p></dd>
  9758. <dt>&lsquo;<samp>4</samp>&rsquo;</dt>
  9759. <dd><p>Same as option &quot;3&quot;, except there is a dependency between
  9760. the two temporal layer 2 frames within the temporal period.
  9761. </p></dd>
  9762. </dl>
  9763. </dd>
  9764. </dl>
  9765. </dd>
  9766. <dt>&lsquo;<samp>VP9-specific options</samp>&rsquo;</dt>
  9767. <dd><dl compact="compact">
  9768. <dt>&lsquo;<samp>lossless</samp>&rsquo;</dt>
  9769. <dd><p>Enable lossless mode.
  9770. </p></dd>
  9771. <dt>&lsquo;<samp>tile-columns</samp>&rsquo;</dt>
  9772. <dd><p>Set number of tile columns to use. Note this is given as
  9773. <code>log2(tile_columns)</code>. For example, 8 tile columns would be requested by
  9774. setting the &lsquo;<samp>tile-columns</samp>&rsquo; option to 3.
  9775. </p></dd>
  9776. <dt>&lsquo;<samp>tile-rows</samp>&rsquo;</dt>
  9777. <dd><p>Set number of tile rows to use. Note this is given as <code>log2(tile_rows)</code>.
  9778. For example, 4 tile rows would be requested by setting the &lsquo;<samp>tile-rows</samp>&rsquo;
  9779. option to 2.
  9780. </p></dd>
  9781. <dt>&lsquo;<samp>frame-parallel</samp>&rsquo;</dt>
  9782. <dd><p>Enable frame parallel decodability features.
  9783. </p></dd>
  9784. <dt>&lsquo;<samp>aq-mode</samp>&rsquo;</dt>
  9785. <dd><p>Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
  9786. cyclic refresh, 4: equator360).
  9787. </p></dd>
  9788. <dt>&lsquo;<samp>colorspace <em>color-space</em></samp>&rsquo;</dt>
  9789. <dd><p>Set input color space. The VP9 bitstream supports signaling the following
  9790. colorspaces:
  9791. </p><dl compact="compact">
  9792. <dt>&lsquo;<samp>&lsquo;<samp>rgb</samp>&rsquo; <em>sRGB</em></samp>&rsquo;</dt>
  9793. <dt>&lsquo;<samp>&lsquo;<samp>bt709</samp>&rsquo; <em>bt709</em></samp>&rsquo;</dt>
  9794. <dt>&lsquo;<samp>&lsquo;<samp>unspecified</samp>&rsquo; <em>unknown</em></samp>&rsquo;</dt>
  9795. <dt>&lsquo;<samp>&lsquo;<samp>bt470bg</samp>&rsquo; <em>bt601</em></samp>&rsquo;</dt>
  9796. <dt>&lsquo;<samp>&lsquo;<samp>smpte170m</samp>&rsquo; <em>smpte170</em></samp>&rsquo;</dt>
  9797. <dt>&lsquo;<samp>&lsquo;<samp>smpte240m</samp>&rsquo; <em>smpte240</em></samp>&rsquo;</dt>
  9798. <dt>&lsquo;<samp>&lsquo;<samp>bt2020_ncl</samp>&rsquo; <em>bt2020</em></samp>&rsquo;</dt>
  9799. </dl>
  9800. </dd>
  9801. <dt>&lsquo;<samp>row-mt <var>boolean</var></samp>&rsquo;</dt>
  9802. <dd><p>Enable row based multi-threading.
  9803. </p></dd>
  9804. <dt>&lsquo;<samp>tune-content</samp>&rsquo;</dt>
  9805. <dd><p>Set content type: default (0), screen (1), film (2).
  9806. </p></dd>
  9807. <dt>&lsquo;<samp>corpus-complexity</samp>&rsquo;</dt>
  9808. <dd><p>Corpus VBR mode is a variant of standard VBR where the complexity distribution
  9809. midpoint is passed in rather than calculated for a specific clip or chunk.
  9810. </p>
  9811. <p>The valid range is [0, 10000]. 0 (default) uses standard VBR.
  9812. </p></dd>
  9813. <dt>&lsquo;<samp>enable-tpl <var>boolean</var></samp>&rsquo;</dt>
  9814. <dd><p>Enable temporal dependency model.
  9815. </p></dd>
  9816. </dl>
  9817. </dd>
  9818. </dl>
  9819. <p>For more information about libvpx see:
  9820. <a href="http://www.webmproject.org/">http://www.webmproject.org/</a>
  9821. </p>
  9822. <a name="libwebp"></a>
  9823. <h2 class="section"><a href="ffmpeg-all.html#toc-libwebp">16.9 libwebp</a></h2>
  9824. <p>libwebp WebP Image encoder wrapper
  9825. </p>
  9826. <p>libwebp is Google&rsquo;s official encoder for WebP images. It can encode in either
  9827. lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
  9828. frame. Lossless images are a separate codec developed by Google.
  9829. </p>
  9830. <a name="Pixel-Format"></a>
  9831. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Pixel-Format">16.9.1 Pixel Format</a></h3>
  9832. <p>Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
  9833. to limitations of the format and libwebp. Alpha is supported for either mode.
  9834. Because of API limitations, if RGB is passed in when encoding lossy or YUV is
  9835. passed in for encoding lossless, the pixel format will automatically be
  9836. converted using functions from libwebp. This is not ideal and is done only for
  9837. convenience.
  9838. </p>
  9839. <a name="Options-31"></a>
  9840. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-31">16.9.2 Options</a></h3>
  9841. <dl compact="compact">
  9842. <dt>&lsquo;<samp>-lossless <var>boolean</var></samp>&rsquo;</dt>
  9843. <dd><p>Enables/Disables use of lossless mode. Default is 0.
  9844. </p>
  9845. </dd>
  9846. <dt>&lsquo;<samp>-compression_level <var>integer</var></samp>&rsquo;</dt>
  9847. <dd><p>For lossy, this is a quality/speed tradeoff. Higher values give better quality
  9848. for a given size at the cost of increased encoding time. For lossless, this is
  9849. a size/speed tradeoff. Higher values give smaller size at the cost of increased
  9850. encoding time. More specifically, it controls the number of extra algorithms
  9851. and compression tools used, and varies the combination of these tools. This
  9852. maps to the <var>method</var> option in libwebp. The valid range is 0 to 6.
  9853. Default is 4.
  9854. </p>
  9855. </dd>
  9856. <dt>&lsquo;<samp>-qscale <var>float</var></samp>&rsquo;</dt>
  9857. <dd><p>For lossy encoding, this controls image quality, 0 to 100. For lossless
  9858. encoding, this controls the effort and time spent at compressing more. The
  9859. default value is 75. Note that for usage via libavcodec, this option is called
  9860. <var>global_quality</var> and must be multiplied by <var>FF_QP2LAMBDA</var>.
  9861. </p>
  9862. </dd>
  9863. <dt>&lsquo;<samp>-preset <var>type</var></samp>&rsquo;</dt>
  9864. <dd><p>Configuration preset. This does some automatic settings based on the general
  9865. type of the image.
  9866. </p><dl compact="compact">
  9867. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  9868. <dd><p>Do not use a preset.
  9869. </p></dd>
  9870. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  9871. <dd><p>Use the encoder default.
  9872. </p></dd>
  9873. <dt>&lsquo;<samp>picture</samp>&rsquo;</dt>
  9874. <dd><p>Digital picture, like portrait, inner shot
  9875. </p></dd>
  9876. <dt>&lsquo;<samp>photo</samp>&rsquo;</dt>
  9877. <dd><p>Outdoor photograph, with natural lighting
  9878. </p></dd>
  9879. <dt>&lsquo;<samp>drawing</samp>&rsquo;</dt>
  9880. <dd><p>Hand or line drawing, with high-contrast details
  9881. </p></dd>
  9882. <dt>&lsquo;<samp>icon</samp>&rsquo;</dt>
  9883. <dd><p>Small-sized colorful images
  9884. </p></dd>
  9885. <dt>&lsquo;<samp>text</samp>&rsquo;</dt>
  9886. <dd><p>Text-like
  9887. </p></dd>
  9888. </dl>
  9889. </dd>
  9890. </dl>
  9891. <a name="libx264_002c-libx264rgb"></a>
  9892. <h2 class="section"><a href="ffmpeg-all.html#toc-libx264_002c-libx264rgb">16.10 libx264, libx264rgb</a></h2>
  9893. <p>x264 H.264/MPEG-4 AVC encoder wrapper.
  9894. </p>
  9895. <p>This encoder requires the presence of the libx264 headers and library
  9896. during configuration. You need to explicitly configure the build with
  9897. <code>--enable-libx264</code>.
  9898. </p>
  9899. <p>libx264 supports an impressive number of features, including 8x8 and
  9900. 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
  9901. entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
  9902. for detail retention (adaptive quantization, psy-RD, psy-trellis).
  9903. </p>
  9904. <p>Many libx264 encoder options are mapped to FFmpeg global codec
  9905. options, while unique encoder options are provided through private
  9906. options. Additionally the &lsquo;<samp>x264opts</samp>&rsquo; and &lsquo;<samp>x264-params</samp>&rsquo;
  9907. private options allows one to pass a list of key=value tuples as accepted
  9908. by the libx264 <code>x264_param_parse</code> function.
  9909. </p>
  9910. <p>The x264 project website is at
  9911. <a href="http://www.videolan.org/developers/x264.html">http://www.videolan.org/developers/x264.html</a>.
  9912. </p>
  9913. <p>The libx264rgb encoder is the same as libx264, except it accepts packed RGB
  9914. pixel formats as input instead of YUV.
  9915. </p>
  9916. <a name="Supported-Pixel-Formats"></a>
  9917. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Supported-Pixel-Formats">16.10.1 Supported Pixel Formats</a></h3>
  9918. <p>x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
  9919. x264&rsquo;s configure time. FFmpeg only supports one bit depth in one particular
  9920. build. In other words, it is not possible to build one FFmpeg with multiple
  9921. versions of x264 with different bit depths.
  9922. </p>
  9923. <a name="Options-51"></a>
  9924. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-51">16.10.2 Options</a></h3>
  9925. <p>The following options are supported by the libx264 wrapper. The
  9926. <code>x264</code>-equivalent options or values are listed in parentheses
  9927. for easy migration.
  9928. </p>
  9929. <p>To reduce the duplication of documentation, only the private options
  9930. and some others requiring special attention are documented here. For
  9931. the documentation of the undocumented generic options, see
  9932. <a href="#codec_002doptions">the Codec Options chapter</a>.
  9933. </p>
  9934. <p>To get a more accurate and extensive documentation of the libx264
  9935. options, invoke the command <code>x264 --fullhelp</code> or consult
  9936. the libx264 documentation.
  9937. </p>
  9938. <dl compact="compact">
  9939. <dt>&lsquo;<samp>b (<em>bitrate</em>)</samp>&rsquo;</dt>
  9940. <dd><p>Set bitrate in bits/s. Note that FFmpeg&rsquo;s &lsquo;<samp>b</samp>&rsquo; option is
  9941. expressed in bits/s, while <code>x264</code>&rsquo;s &lsquo;<samp>bitrate</samp>&rsquo; is in
  9942. kilobits/s.
  9943. </p>
  9944. </dd>
  9945. <dt>&lsquo;<samp>bf (<em>bframes</em>)</samp>&rsquo;</dt>
  9946. <dt>&lsquo;<samp>g (<em>keyint</em>)</samp>&rsquo;</dt>
  9947. <dt>&lsquo;<samp>qmin (<em>qpmin</em>)</samp>&rsquo;</dt>
  9948. <dd><p>Minimum quantizer scale.
  9949. </p>
  9950. </dd>
  9951. <dt>&lsquo;<samp>qmax (<em>qpmax</em>)</samp>&rsquo;</dt>
  9952. <dd><p>Maximum quantizer scale.
  9953. </p>
  9954. </dd>
  9955. <dt>&lsquo;<samp>qdiff (<em>qpstep</em>)</samp>&rsquo;</dt>
  9956. <dd><p>Maximum difference between quantizer scales.
  9957. </p>
  9958. </dd>
  9959. <dt>&lsquo;<samp>qblur (<em>qblur</em>)</samp>&rsquo;</dt>
  9960. <dd><p>Quantizer curve blur
  9961. </p>
  9962. </dd>
  9963. <dt>&lsquo;<samp>qcomp (<em>qcomp</em>)</samp>&rsquo;</dt>
  9964. <dd><p>Quantizer curve compression factor
  9965. </p>
  9966. </dd>
  9967. <dt>&lsquo;<samp>refs (<em>ref</em>)</samp>&rsquo;</dt>
  9968. <dd><p>Number of reference frames each P-frame can use. The range is from <var>0-16</var>.
  9969. </p>
  9970. </dd>
  9971. <dt>&lsquo;<samp>sc_threshold (<em>scenecut</em>)</samp>&rsquo;</dt>
  9972. <dd><p>Sets the threshold for the scene change detection.
  9973. </p>
  9974. </dd>
  9975. <dt>&lsquo;<samp>trellis (<em>trellis</em>)</samp>&rsquo;</dt>
  9976. <dd><p>Performs Trellis quantization to increase efficiency. Enabled by default.
  9977. </p>
  9978. </dd>
  9979. <dt>&lsquo;<samp>nr (<em>nr</em>)</samp>&rsquo;</dt>
  9980. <dt>&lsquo;<samp>me_range (<em>merange</em>)</samp>&rsquo;</dt>
  9981. <dd><p>Maximum range of the motion search in pixels.
  9982. </p>
  9983. </dd>
  9984. <dt>&lsquo;<samp>me_method (<em>me</em>)</samp>&rsquo;</dt>
  9985. <dd><p>Set motion estimation method. Possible values in the decreasing order
  9986. of speed:
  9987. </p>
  9988. <dl compact="compact">
  9989. <dt>&lsquo;<samp>dia (<em>dia</em>)</samp>&rsquo;</dt>
  9990. <dt>&lsquo;<samp>epzs (<em>dia</em>)</samp>&rsquo;</dt>
  9991. <dd><p>Diamond search with radius 1 (fastest). &lsquo;<samp>epzs</samp>&rsquo; is an alias for
  9992. &lsquo;<samp>dia</samp>&rsquo;.
  9993. </p></dd>
  9994. <dt>&lsquo;<samp>hex (<em>hex</em>)</samp>&rsquo;</dt>
  9995. <dd><p>Hexagonal search with radius 2.
  9996. </p></dd>
  9997. <dt>&lsquo;<samp>umh (<em>umh</em>)</samp>&rsquo;</dt>
  9998. <dd><p>Uneven multi-hexagon search.
  9999. </p></dd>
  10000. <dt>&lsquo;<samp>esa (<em>esa</em>)</samp>&rsquo;</dt>
  10001. <dd><p>Exhaustive search.
  10002. </p></dd>
  10003. <dt>&lsquo;<samp>tesa (<em>tesa</em>)</samp>&rsquo;</dt>
  10004. <dd><p>Hadamard exhaustive search (slowest).
  10005. </p></dd>
  10006. </dl>
  10007. </dd>
  10008. <dt>&lsquo;<samp>forced-idr</samp>&rsquo;</dt>
  10009. <dd><p>Normally, when forcing a I-frame type, the encoder can select any type
  10010. of I-frame. This option forces it to choose an IDR-frame.
  10011. </p>
  10012. </dd>
  10013. <dt>&lsquo;<samp>subq (<em>subme</em>)</samp>&rsquo;</dt>
  10014. <dd><p>Sub-pixel motion estimation method.
  10015. </p>
  10016. </dd>
  10017. <dt>&lsquo;<samp>b_strategy (<em>b-adapt</em>)</samp>&rsquo;</dt>
  10018. <dd><p>Adaptive B-frame placement decision algorithm. Use only on first-pass.
  10019. </p>
  10020. </dd>
  10021. <dt>&lsquo;<samp>keyint_min (<em>min-keyint</em>)</samp>&rsquo;</dt>
  10022. <dd><p>Minimum GOP size.
  10023. </p>
  10024. </dd>
  10025. <dt>&lsquo;<samp>coder</samp>&rsquo;</dt>
  10026. <dd><p>Set entropy encoder. Possible values:
  10027. </p>
  10028. <dl compact="compact">
  10029. <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
  10030. <dd><p>Enable CABAC.
  10031. </p>
  10032. </dd>
  10033. <dt>&lsquo;<samp>vlc</samp>&rsquo;</dt>
  10034. <dd><p>Enable CAVLC and disable CABAC. It generates the same effect as
  10035. <code>x264</code>&rsquo;s &lsquo;<samp>--no-cabac</samp>&rsquo; option.
  10036. </p></dd>
  10037. </dl>
  10038. </dd>
  10039. <dt>&lsquo;<samp>cmp</samp>&rsquo;</dt>
  10040. <dd><p>Set full pixel motion estimation comparison algorithm. Possible values:
  10041. </p>
  10042. <dl compact="compact">
  10043. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  10044. <dd><p>Enable chroma in motion estimation.
  10045. </p>
  10046. </dd>
  10047. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  10048. <dd><p>Ignore chroma in motion estimation. It generates the same effect as
  10049. <code>x264</code>&rsquo;s &lsquo;<samp>--no-chroma-me</samp>&rsquo; option.
  10050. </p></dd>
  10051. </dl>
  10052. </dd>
  10053. <dt>&lsquo;<samp>threads (<em>threads</em>)</samp>&rsquo;</dt>
  10054. <dd><p>Number of encoding threads.
  10055. </p>
  10056. </dd>
  10057. <dt>&lsquo;<samp>thread_type</samp>&rsquo;</dt>
  10058. <dd><p>Set multithreading technique. Possible values:
  10059. </p>
  10060. <dl compact="compact">
  10061. <dt>&lsquo;<samp>slice</samp>&rsquo;</dt>
  10062. <dd><p>Slice-based multithreading. It generates the same effect as
  10063. <code>x264</code>&rsquo;s &lsquo;<samp>--sliced-threads</samp>&rsquo; option.
  10064. </p></dd>
  10065. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  10066. <dd><p>Frame-based multithreading.
  10067. </p></dd>
  10068. </dl>
  10069. </dd>
  10070. <dt>&lsquo;<samp>flags</samp>&rsquo;</dt>
  10071. <dd><p>Set encoding flags. It can be used to disable closed GOP and enable
  10072. open GOP by setting it to <code>-cgop</code>. The result is similar to
  10073. the behavior of <code>x264</code>&rsquo;s &lsquo;<samp>--open-gop</samp>&rsquo; option.
  10074. </p>
  10075. </dd>
  10076. <dt>&lsquo;<samp>rc_init_occupancy (<em>vbv-init</em>)</samp>&rsquo;</dt>
  10077. <dt>&lsquo;<samp>preset (<em>preset</em>)</samp>&rsquo;</dt>
  10078. <dd><p>Set the encoding preset.
  10079. </p>
  10080. </dd>
  10081. <dt>&lsquo;<samp>tune (<em>tune</em>)</samp>&rsquo;</dt>
  10082. <dd><p>Set tuning of the encoding params.
  10083. </p>
  10084. </dd>
  10085. <dt>&lsquo;<samp>profile (<em>profile</em>)</samp>&rsquo;</dt>
  10086. <dd><p>Set profile restrictions.
  10087. </p>
  10088. </dd>
  10089. <dt>&lsquo;<samp>fastfirstpass</samp>&rsquo;</dt>
  10090. <dd><p>Enable fast settings when encoding first pass, when set to 1. When set
  10091. to 0, it has the same effect of <code>x264</code>&rsquo;s
  10092. &lsquo;<samp>--slow-firstpass</samp>&rsquo; option.
  10093. </p>
  10094. </dd>
  10095. <dt>&lsquo;<samp>crf (<em>crf</em>)</samp>&rsquo;</dt>
  10096. <dd><p>Set the quality for constant quality mode.
  10097. </p>
  10098. </dd>
  10099. <dt>&lsquo;<samp>crf_max (<em>crf-max</em>)</samp>&rsquo;</dt>
  10100. <dd><p>In CRF mode, prevents VBV from lowering quality beyond this point.
  10101. </p>
  10102. </dd>
  10103. <dt>&lsquo;<samp>qp (<em>qp</em>)</samp>&rsquo;</dt>
  10104. <dd><p>Set constant quantization rate control method parameter.
  10105. </p>
  10106. </dd>
  10107. <dt>&lsquo;<samp>aq-mode (<em>aq-mode</em>)</samp>&rsquo;</dt>
  10108. <dd><p>Set AQ method. Possible values:
  10109. </p>
  10110. <dl compact="compact">
  10111. <dt>&lsquo;<samp>none (<em>0</em>)</samp>&rsquo;</dt>
  10112. <dd><p>Disabled.
  10113. </p>
  10114. </dd>
  10115. <dt>&lsquo;<samp>variance (<em>1</em>)</samp>&rsquo;</dt>
  10116. <dd><p>Variance AQ (complexity mask).
  10117. </p>
  10118. </dd>
  10119. <dt>&lsquo;<samp>autovariance (<em>2</em>)</samp>&rsquo;</dt>
  10120. <dd><p>Auto-variance AQ (experimental).
  10121. </p></dd>
  10122. </dl>
  10123. </dd>
  10124. <dt>&lsquo;<samp>aq-strength (<em>aq-strength</em>)</samp>&rsquo;</dt>
  10125. <dd><p>Set AQ strength, reduce blocking and blurring in flat and textured areas.
  10126. </p>
  10127. </dd>
  10128. <dt>&lsquo;<samp>psy</samp>&rsquo;</dt>
  10129. <dd><p>Use psychovisual optimizations when set to 1. When set to 0, it has the
  10130. same effect as <code>x264</code>&rsquo;s &lsquo;<samp>--no-psy</samp>&rsquo; option.
  10131. </p>
  10132. </dd>
  10133. <dt>&lsquo;<samp>psy-rd (<em>psy-rd</em>)</samp>&rsquo;</dt>
  10134. <dd><p>Set strength of psychovisual optimization, in
  10135. <var>psy-rd</var>:<var>psy-trellis</var> format.
  10136. </p>
  10137. </dd>
  10138. <dt>&lsquo;<samp>rc-lookahead (<em>rc-lookahead</em>)</samp>&rsquo;</dt>
  10139. <dd><p>Set number of frames to look ahead for frametype and ratecontrol.
  10140. </p>
  10141. </dd>
  10142. <dt>&lsquo;<samp>weightb</samp>&rsquo;</dt>
  10143. <dd><p>Enable weighted prediction for B-frames when set to 1. When set to 0,
  10144. it has the same effect as <code>x264</code>&rsquo;s &lsquo;<samp>--no-weightb</samp>&rsquo; option.
  10145. </p>
  10146. </dd>
  10147. <dt>&lsquo;<samp>weightp (<em>weightp</em>)</samp>&rsquo;</dt>
  10148. <dd><p>Set weighted prediction method for P-frames. Possible values:
  10149. </p>
  10150. <dl compact="compact">
  10151. <dt>&lsquo;<samp>none (<em>0</em>)</samp>&rsquo;</dt>
  10152. <dd><p>Disabled
  10153. </p></dd>
  10154. <dt>&lsquo;<samp>simple (<em>1</em>)</samp>&rsquo;</dt>
  10155. <dd><p>Enable only weighted refs
  10156. </p></dd>
  10157. <dt>&lsquo;<samp>smart (<em>2</em>)</samp>&rsquo;</dt>
  10158. <dd><p>Enable both weighted refs and duplicates
  10159. </p></dd>
  10160. </dl>
  10161. </dd>
  10162. <dt>&lsquo;<samp>ssim (<em>ssim</em>)</samp>&rsquo;</dt>
  10163. <dd><p>Enable calculation and printing SSIM stats after the encoding.
  10164. </p>
  10165. </dd>
  10166. <dt>&lsquo;<samp>intra-refresh (<em>intra-refresh</em>)</samp>&rsquo;</dt>
  10167. <dd><p>Enable the use of Periodic Intra Refresh instead of IDR frames when set
  10168. to 1.
  10169. </p>
  10170. </dd>
  10171. <dt>&lsquo;<samp>avcintra-class (<em>class</em>)</samp>&rsquo;</dt>
  10172. <dd><p>Configure the encoder to generate AVC-Intra.
  10173. Valid values are 50,100 and 200
  10174. </p>
  10175. </dd>
  10176. <dt>&lsquo;<samp>bluray-compat (<em>bluray-compat</em>)</samp>&rsquo;</dt>
  10177. <dd><p>Configure the encoder to be compatible with the bluray standard.
  10178. It is a shorthand for setting &quot;bluray-compat=1 force-cfr=1&quot;.
  10179. </p>
  10180. </dd>
  10181. <dt>&lsquo;<samp>b-bias (<em>b-bias</em>)</samp>&rsquo;</dt>
  10182. <dd><p>Set the influence on how often B-frames are used.
  10183. </p>
  10184. </dd>
  10185. <dt>&lsquo;<samp>b-pyramid (<em>b-pyramid</em>)</samp>&rsquo;</dt>
  10186. <dd><p>Set method for keeping of some B-frames as references. Possible values:
  10187. </p>
  10188. <dl compact="compact">
  10189. <dt>&lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
  10190. <dd><p>Disabled.
  10191. </p></dd>
  10192. <dt>&lsquo;<samp>strict (<em>strict</em>)</samp>&rsquo;</dt>
  10193. <dd><p>Strictly hierarchical pyramid.
  10194. </p></dd>
  10195. <dt>&lsquo;<samp>normal (<em>normal</em>)</samp>&rsquo;</dt>
  10196. <dd><p>Non-strict (not Blu-ray compatible).
  10197. </p></dd>
  10198. </dl>
  10199. </dd>
  10200. <dt>&lsquo;<samp>mixed-refs</samp>&rsquo;</dt>
  10201. <dd><p>Enable the use of one reference per partition, as opposed to one
  10202. reference per macroblock when set to 1. When set to 0, it has the
  10203. same effect as <code>x264</code>&rsquo;s &lsquo;<samp>--no-mixed-refs</samp>&rsquo; option.
  10204. </p>
  10205. </dd>
  10206. <dt>&lsquo;<samp>8x8dct</samp>&rsquo;</dt>
  10207. <dd><p>Enable adaptive spatial transform (high profile 8x8 transform)
  10208. when set to 1. When set to 0, it has the same effect as
  10209. <code>x264</code>&rsquo;s &lsquo;<samp>--no-8x8dct</samp>&rsquo; option.
  10210. </p>
  10211. </dd>
  10212. <dt>&lsquo;<samp>fast-pskip</samp>&rsquo;</dt>
  10213. <dd><p>Enable early SKIP detection on P-frames when set to 1. When set
  10214. to 0, it has the same effect as <code>x264</code>&rsquo;s
  10215. &lsquo;<samp>--no-fast-pskip</samp>&rsquo; option.
  10216. </p>
  10217. </dd>
  10218. <dt>&lsquo;<samp>aud (<em>aud</em>)</samp>&rsquo;</dt>
  10219. <dd><p>Enable use of access unit delimiters when set to 1.
  10220. </p>
  10221. </dd>
  10222. <dt>&lsquo;<samp>mbtree</samp>&rsquo;</dt>
  10223. <dd><p>Enable use macroblock tree ratecontrol when set to 1. When set
  10224. to 0, it has the same effect as <code>x264</code>&rsquo;s
  10225. &lsquo;<samp>--no-mbtree</samp>&rsquo; option.
  10226. </p>
  10227. </dd>
  10228. <dt>&lsquo;<samp>deblock (<em>deblock</em>)</samp>&rsquo;</dt>
  10229. <dd><p>Set loop filter parameters, in <var>alpha</var>:<var>beta</var> form.
  10230. </p>
  10231. </dd>
  10232. <dt>&lsquo;<samp>cplxblur (<em>cplxblur</em>)</samp>&rsquo;</dt>
  10233. <dd><p>Set fluctuations reduction in QP (before curve compression).
  10234. </p>
  10235. </dd>
  10236. <dt>&lsquo;<samp>partitions (<em>partitions</em>)</samp>&rsquo;</dt>
  10237. <dd><p>Set partitions to consider as a comma-separated list of. Possible
  10238. values in the list:
  10239. </p>
  10240. <dl compact="compact">
  10241. <dt>&lsquo;<samp>p8x8</samp>&rsquo;</dt>
  10242. <dd><p>8x8 P-frame partition.
  10243. </p></dd>
  10244. <dt>&lsquo;<samp>p4x4</samp>&rsquo;</dt>
  10245. <dd><p>4x4 P-frame partition.
  10246. </p></dd>
  10247. <dt>&lsquo;<samp>b8x8</samp>&rsquo;</dt>
  10248. <dd><p>4x4 B-frame partition.
  10249. </p></dd>
  10250. <dt>&lsquo;<samp>i8x8</samp>&rsquo;</dt>
  10251. <dd><p>8x8 I-frame partition.
  10252. </p></dd>
  10253. <dt>&lsquo;<samp>i4x4</samp>&rsquo;</dt>
  10254. <dd><p>4x4 I-frame partition.
  10255. (Enabling &lsquo;<samp>p4x4</samp>&rsquo; requires &lsquo;<samp>p8x8</samp>&rsquo; to be enabled. Enabling
  10256. &lsquo;<samp>i8x8</samp>&rsquo; requires adaptive spatial transform (&lsquo;<samp>8x8dct</samp>&rsquo;
  10257. option) to be enabled.)
  10258. </p></dd>
  10259. <dt>&lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
  10260. <dd><p>Do not consider any partitions.
  10261. </p></dd>
  10262. <dt>&lsquo;<samp>all (<em>all</em>)</samp>&rsquo;</dt>
  10263. <dd><p>Consider every partition.
  10264. </p></dd>
  10265. </dl>
  10266. </dd>
  10267. <dt>&lsquo;<samp>direct-pred (<em>direct</em>)</samp>&rsquo;</dt>
  10268. <dd><p>Set direct MV prediction mode. Possible values:
  10269. </p>
  10270. <dl compact="compact">
  10271. <dt>&lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
  10272. <dd><p>Disable MV prediction.
  10273. </p></dd>
  10274. <dt>&lsquo;<samp>spatial (<em>spatial</em>)</samp>&rsquo;</dt>
  10275. <dd><p>Enable spatial predicting.
  10276. </p></dd>
  10277. <dt>&lsquo;<samp>temporal (<em>temporal</em>)</samp>&rsquo;</dt>
  10278. <dd><p>Enable temporal predicting.
  10279. </p></dd>
  10280. <dt>&lsquo;<samp>auto (<em>auto</em>)</samp>&rsquo;</dt>
  10281. <dd><p>Automatically decided.
  10282. </p></dd>
  10283. </dl>
  10284. </dd>
  10285. <dt>&lsquo;<samp>slice-max-size (<em>slice-max-size</em>)</samp>&rsquo;</dt>
  10286. <dd><p>Set the limit of the size of each slice in bytes. If not specified
  10287. but RTP payload size (&lsquo;<samp>ps</samp>&rsquo;) is specified, that is used.
  10288. </p>
  10289. </dd>
  10290. <dt>&lsquo;<samp>stats (<em>stats</em>)</samp>&rsquo;</dt>
  10291. <dd><p>Set the file name for multi-pass stats.
  10292. </p>
  10293. </dd>
  10294. <dt>&lsquo;<samp>nal-hrd (<em>nal-hrd</em>)</samp>&rsquo;</dt>
  10295. <dd><p>Set signal HRD information (requires &lsquo;<samp>vbv-bufsize</samp>&rsquo; to be set).
  10296. Possible values:
  10297. </p>
  10298. <dl compact="compact">
  10299. <dt>&lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
  10300. <dd><p>Disable HRD information signaling.
  10301. </p></dd>
  10302. <dt>&lsquo;<samp>vbr (<em>vbr</em>)</samp>&rsquo;</dt>
  10303. <dd><p>Variable bit rate.
  10304. </p></dd>
  10305. <dt>&lsquo;<samp>cbr (<em>cbr</em>)</samp>&rsquo;</dt>
  10306. <dd><p>Constant bit rate (not allowed in MP4 container).
  10307. </p></dd>
  10308. </dl>
  10309. </dd>
  10310. <dt>&lsquo;<samp>x264opts (N.A.)</samp>&rsquo;</dt>
  10311. <dd><p>Set any x264 option, see <code>x264 --fullhelp</code> for a list.
  10312. </p>
  10313. <p>Argument is a list of <var>key</var>=<var>value</var> couples separated by
  10314. &quot;:&quot;. In <var>filter</var> and <var>psy-rd</var> options that use &quot;:&quot; as a separator
  10315. themselves, use &quot;,&quot; instead. They accept it as well since long ago but this
  10316. is kept undocumented for some reason.
  10317. </p>
  10318. <p>For example to specify libx264 encoding options with <code>ffmpeg</code>:
  10319. </p><div class="example">
  10320. <pre class="example">ffmpeg -i foo.mpg -c:v libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
  10321. </pre></div>
  10322. </dd>
  10323. <dt>&lsquo;<samp>a53cc <var>boolean</var></samp>&rsquo;</dt>
  10324. <dd><p>Import closed captions (which must be ATSC compatible format) into output.
  10325. Only the mpeg2 and h264 decoders provide these. Default is 1 (on).
  10326. </p>
  10327. </dd>
  10328. <dt>&lsquo;<samp>x264-params (N.A.)</samp>&rsquo;</dt>
  10329. <dd><p>Override the x264 configuration using a :-separated list of key=value
  10330. parameters.
  10331. </p>
  10332. <p>This option is functionally the same as the &lsquo;<samp>x264opts</samp>&rsquo;, but is
  10333. duplicated for compatibility with the Libav fork.
  10334. </p>
  10335. <p>For example to specify libx264 encoding options with <code>ffmpeg</code>:
  10336. </p><div class="example">
  10337. <pre class="example">ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
  10338. cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
  10339. no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
  10340. </pre></div>
  10341. </dd>
  10342. </dl>
  10343. <p>Encoding ffpresets for common usages are provided so they can be used with the
  10344. general presets system (e.g. passing the &lsquo;<samp>pre</samp>&rsquo; option).
  10345. </p>
  10346. <a name="libx265"></a>
  10347. <h2 class="section"><a href="ffmpeg-all.html#toc-libx265">16.11 libx265</a></h2>
  10348. <p>x265 H.265/HEVC encoder wrapper.
  10349. </p>
  10350. <p>This encoder requires the presence of the libx265 headers and library
  10351. during configuration. You need to explicitly configure the build with
  10352. &lsquo;<samp>--enable-libx265</samp>&rsquo;.
  10353. </p>
  10354. <a name="Options-62"></a>
  10355. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-62">16.11.1 Options</a></h3>
  10356. <dl compact="compact">
  10357. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  10358. <dd><p>Sets target video bitrate.
  10359. </p>
  10360. </dd>
  10361. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  10362. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  10363. <dd><p>Set the GOP size.
  10364. </p>
  10365. </dd>
  10366. <dt>&lsquo;<samp>keyint_min</samp>&rsquo;</dt>
  10367. <dd><p>Minimum GOP size.
  10368. </p>
  10369. </dd>
  10370. <dt>&lsquo;<samp>refs</samp>&rsquo;</dt>
  10371. <dd><p>Number of reference frames each P-frame can use. The range is from <var>1-16</var>.
  10372. </p>
  10373. </dd>
  10374. <dt>&lsquo;<samp>preset</samp>&rsquo;</dt>
  10375. <dd><p>Set the x265 preset.
  10376. </p>
  10377. </dd>
  10378. <dt>&lsquo;<samp>tune</samp>&rsquo;</dt>
  10379. <dd><p>Set the x265 tune parameter.
  10380. </p>
  10381. </dd>
  10382. <dt>&lsquo;<samp>profile</samp>&rsquo;</dt>
  10383. <dd><p>Set profile restrictions.
  10384. </p>
  10385. </dd>
  10386. <dt>&lsquo;<samp>crf</samp>&rsquo;</dt>
  10387. <dd><p>Set the quality for constant quality mode.
  10388. </p>
  10389. </dd>
  10390. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  10391. <dd><p>Set constant quantization rate control method parameter.
  10392. </p>
  10393. </dd>
  10394. <dt>&lsquo;<samp>qmin</samp>&rsquo;</dt>
  10395. <dd><p>Minimum quantizer scale.
  10396. </p>
  10397. </dd>
  10398. <dt>&lsquo;<samp>qmax</samp>&rsquo;</dt>
  10399. <dd><p>Maximum quantizer scale.
  10400. </p>
  10401. </dd>
  10402. <dt>&lsquo;<samp>qdiff</samp>&rsquo;</dt>
  10403. <dd><p>Maximum difference between quantizer scales.
  10404. </p>
  10405. </dd>
  10406. <dt>&lsquo;<samp>qblur</samp>&rsquo;</dt>
  10407. <dd><p>Quantizer curve blur
  10408. </p>
  10409. </dd>
  10410. <dt>&lsquo;<samp>qcomp</samp>&rsquo;</dt>
  10411. <dd><p>Quantizer curve compression factor
  10412. </p>
  10413. </dd>
  10414. <dt>&lsquo;<samp>i_qfactor</samp>&rsquo;</dt>
  10415. <dt>&lsquo;<samp>b_qfactor</samp>&rsquo;</dt>
  10416. <dt>&lsquo;<samp>forced-idr</samp>&rsquo;</dt>
  10417. <dd><p>Normally, when forcing a I-frame type, the encoder can select any type
  10418. of I-frame. This option forces it to choose an IDR-frame.
  10419. </p>
  10420. </dd>
  10421. <dt>&lsquo;<samp>x265-params</samp>&rsquo;</dt>
  10422. <dd><p>Set x265 options using a list of <var>key</var>=<var>value</var> couples separated
  10423. by &quot;:&quot;. See <code>x265 --help</code> for a list of options.
  10424. </p>
  10425. <p>For example to specify libx265 encoding options with &lsquo;<samp>-x265-params</samp>&rsquo;:
  10426. </p>
  10427. <div class="example">
  10428. <pre class="example">ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
  10429. </pre></div>
  10430. </dd>
  10431. </dl>
  10432. <a name="libxavs2"></a>
  10433. <h2 class="section"><a href="ffmpeg-all.html#toc-libxavs2">16.12 libxavs2</a></h2>
  10434. <p>xavs2 AVS2-P2/IEEE1857.4 encoder wrapper.
  10435. </p>
  10436. <p>This encoder requires the presence of the libxavs2 headers and library
  10437. during configuration. You need to explicitly configure the build with
  10438. &lsquo;<samp>--enable-libxavs2</samp>&rsquo;.
  10439. </p>
  10440. <p>The following standard libavcodec options are used:
  10441. </p><ul>
  10442. <li>
  10443. &lsquo;<samp>b</samp>&rsquo; / &lsquo;<samp>bit_rate</samp>&rsquo;
  10444. </li><li>
  10445. &lsquo;<samp>g</samp>&rsquo; / &lsquo;<samp>gop_size</samp>&rsquo;
  10446. </li><li>
  10447. &lsquo;<samp>bf</samp>&rsquo; / &lsquo;<samp>max_b_frames</samp>&rsquo;
  10448. </li></ul>
  10449. <p>The encoder also has its own specific options:
  10450. </p><a name="Options-18"></a>
  10451. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-18">16.12.1 Options</a></h3>
  10452. <dl compact="compact">
  10453. <dt>&lsquo;<samp>lcu_row_threads</samp>&rsquo;</dt>
  10454. <dd><p>Set the number of parallel threads for rows from 1 to 8 (default 5).
  10455. </p>
  10456. </dd>
  10457. <dt>&lsquo;<samp>initial_qp</samp>&rsquo;</dt>
  10458. <dd><p>Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  10459. used to set the initial qp for the first frame.
  10460. </p>
  10461. </dd>
  10462. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  10463. <dd><p>Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  10464. used to set the qp value under constant-QP mode.
  10465. </p>
  10466. </dd>
  10467. <dt>&lsquo;<samp>max_qp</samp>&rsquo;</dt>
  10468. <dd><p>Set the max qp for rate control from 1 to 63 (default 55).
  10469. </p>
  10470. </dd>
  10471. <dt>&lsquo;<samp>min_qp</samp>&rsquo;</dt>
  10472. <dd><p>Set the min qp for rate control from 1 to 63 (default 20).
  10473. </p>
  10474. </dd>
  10475. <dt>&lsquo;<samp>speed_level</samp>&rsquo;</dt>
  10476. <dd><p>Set the Speed level from 0 to 9 (default 0). Higher is better but slower.
  10477. </p>
  10478. </dd>
  10479. <dt>&lsquo;<samp>log_level</samp>&rsquo;</dt>
  10480. <dd><p>Set the log level from -1 to 3 (default 0). -1: none, 0: error,
  10481. 1: warning, 2: info, 3: debug.
  10482. </p>
  10483. </dd>
  10484. <dt>&lsquo;<samp>xavs2-params</samp>&rsquo;</dt>
  10485. <dd><p>Set xavs2 options using a list of <var>key</var>=<var>value</var> couples separated
  10486. by &quot;:&quot;.
  10487. </p>
  10488. <p>For example to specify libxavs2 encoding options with &lsquo;<samp>-xavs2-params</samp>&rsquo;:
  10489. </p>
  10490. <div class="example">
  10491. <pre class="example">ffmpeg -i input -c:v libxavs2 -xavs2-params RdoqLevel=0 output.avs2
  10492. </pre></div>
  10493. </dd>
  10494. </dl>
  10495. <a name="libxvid"></a>
  10496. <h2 class="section"><a href="ffmpeg-all.html#toc-libxvid">16.13 libxvid</a></h2>
  10497. <p>Xvid MPEG-4 Part 2 encoder wrapper.
  10498. </p>
  10499. <p>This encoder requires the presence of the libxvidcore headers and library
  10500. during configuration. You need to explicitly configure the build with
  10501. <code>--enable-libxvid --enable-gpl</code>.
  10502. </p>
  10503. <p>The native <code>mpeg4</code> encoder supports the MPEG-4 Part 2 format, so
  10504. users can encode to this format without this library.
  10505. </p>
  10506. <a name="Options-22"></a>
  10507. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-22">16.13.1 Options</a></h3>
  10508. <p>The following options are supported by the libxvid wrapper. Some of
  10509. the following options are listed but are not documented, and
  10510. correspond to shared codec options. See <a href="#codec_002doptions">the Codec Options chapter</a> for their documentation. The other shared options
  10511. which are not listed have no effect for the libxvid encoder.
  10512. </p>
  10513. <dl compact="compact">
  10514. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  10515. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  10516. <dt>&lsquo;<samp>qmin</samp>&rsquo;</dt>
  10517. <dt>&lsquo;<samp>qmax</samp>&rsquo;</dt>
  10518. <dt>&lsquo;<samp>mpeg_quant</samp>&rsquo;</dt>
  10519. <dt>&lsquo;<samp>threads</samp>&rsquo;</dt>
  10520. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  10521. <dt>&lsquo;<samp>b_qfactor</samp>&rsquo;</dt>
  10522. <dt>&lsquo;<samp>b_qoffset</samp>&rsquo;</dt>
  10523. <dt>&lsquo;<samp>flags</samp>&rsquo;</dt>
  10524. <dd><p>Set specific encoding flags. Possible values:
  10525. </p>
  10526. <dl compact="compact">
  10527. <dt>&lsquo;<samp>mv4</samp>&rsquo;</dt>
  10528. <dd><p>Use four motion vector by macroblock.
  10529. </p>
  10530. </dd>
  10531. <dt>&lsquo;<samp>aic</samp>&rsquo;</dt>
  10532. <dd><p>Enable high quality AC prediction.
  10533. </p>
  10534. </dd>
  10535. <dt>&lsquo;<samp>gray</samp>&rsquo;</dt>
  10536. <dd><p>Only encode grayscale.
  10537. </p>
  10538. </dd>
  10539. <dt>&lsquo;<samp>gmc</samp>&rsquo;</dt>
  10540. <dd><p>Enable the use of global motion compensation (GMC).
  10541. </p>
  10542. </dd>
  10543. <dt>&lsquo;<samp>qpel</samp>&rsquo;</dt>
  10544. <dd><p>Enable quarter-pixel motion compensation.
  10545. </p>
  10546. </dd>
  10547. <dt>&lsquo;<samp>cgop</samp>&rsquo;</dt>
  10548. <dd><p>Enable closed GOP.
  10549. </p>
  10550. </dd>
  10551. <dt>&lsquo;<samp>global_header</samp>&rsquo;</dt>
  10552. <dd><p>Place global headers in extradata instead of every keyframe.
  10553. </p>
  10554. </dd>
  10555. </dl>
  10556. </dd>
  10557. <dt>&lsquo;<samp>trellis</samp>&rsquo;</dt>
  10558. <dt>&lsquo;<samp>me_method</samp>&rsquo;</dt>
  10559. <dd><p>Set motion estimation method. Possible values in decreasing order of
  10560. speed and increasing order of quality:
  10561. </p>
  10562. <dl compact="compact">
  10563. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  10564. <dd><p>Use no motion estimation (default).
  10565. </p>
  10566. </dd>
  10567. <dt>&lsquo;<samp>phods</samp>&rsquo;</dt>
  10568. <dt>&lsquo;<samp>x1</samp>&rsquo;</dt>
  10569. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  10570. <dd><p>Enable advanced diamond zonal search for 16x16 blocks and half-pixel
  10571. refinement for 16x16 blocks. &lsquo;<samp>x1</samp>&rsquo; and &lsquo;<samp>log</samp>&rsquo; are aliases for
  10572. &lsquo;<samp>phods</samp>&rsquo;.
  10573. </p>
  10574. </dd>
  10575. <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
  10576. <dd><p>Enable all of the things described above, plus advanced diamond zonal
  10577. search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
  10578. estimation on chroma planes.
  10579. </p>
  10580. </dd>
  10581. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  10582. <dd><p>Enable all of the things described above, plus extended 16x16 and 8x8
  10583. blocks search.
  10584. </p></dd>
  10585. </dl>
  10586. </dd>
  10587. <dt>&lsquo;<samp>mbd</samp>&rsquo;</dt>
  10588. <dd><p>Set macroblock decision algorithm. Possible values in the increasing
  10589. order of quality:
  10590. </p>
  10591. <dl compact="compact">
  10592. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  10593. <dd><p>Use macroblock comparing function algorithm (default).
  10594. </p>
  10595. </dd>
  10596. <dt>&lsquo;<samp>bits</samp>&rsquo;</dt>
  10597. <dd><p>Enable rate distortion-based half pixel and quarter pixel refinement for
  10598. 16x16 blocks.
  10599. </p>
  10600. </dd>
  10601. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  10602. <dd><p>Enable all of the things described above, plus rate distortion-based
  10603. half pixel and quarter pixel refinement for 8x8 blocks, and rate
  10604. distortion-based search using square pattern.
  10605. </p></dd>
  10606. </dl>
  10607. </dd>
  10608. <dt>&lsquo;<samp>lumi_aq</samp>&rsquo;</dt>
  10609. <dd><p>Enable lumi masking adaptive quantization when set to 1. Default is 0
  10610. (disabled).
  10611. </p>
  10612. </dd>
  10613. <dt>&lsquo;<samp>variance_aq</samp>&rsquo;</dt>
  10614. <dd><p>Enable variance adaptive quantization when set to 1. Default is 0
  10615. (disabled).
  10616. </p>
  10617. <p>When combined with &lsquo;<samp>lumi_aq</samp>&rsquo;, the resulting quality will not
  10618. be better than any of the two specified individually. In other
  10619. words, the resulting quality will be the worse one of the two
  10620. effects.
  10621. </p>
  10622. </dd>
  10623. <dt>&lsquo;<samp>ssim</samp>&rsquo;</dt>
  10624. <dd><p>Set structural similarity (SSIM) displaying method. Possible values:
  10625. </p>
  10626. <dl compact="compact">
  10627. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  10628. <dd><p>Disable displaying of SSIM information.
  10629. </p>
  10630. </dd>
  10631. <dt>&lsquo;<samp>avg</samp>&rsquo;</dt>
  10632. <dd><p>Output average SSIM at the end of encoding to stdout. The format of
  10633. showing the average SSIM is:
  10634. </p>
  10635. <div class="example">
  10636. <pre class="example">Average SSIM: %f
  10637. </pre></div>
  10638. <p>For users who are not familiar with C, %f means a float number, or
  10639. a decimal (e.g. 0.939232).
  10640. </p>
  10641. </dd>
  10642. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  10643. <dd><p>Output both per-frame SSIM data during encoding and average SSIM at
  10644. the end of encoding to stdout. The format of per-frame information
  10645. is:
  10646. </p>
  10647. <div class="example">
  10648. <pre class="example"> SSIM: avg: %1.3f min: %1.3f max: %1.3f
  10649. </pre></div>
  10650. <p>For users who are not familiar with C, %1.3f means a float number
  10651. rounded to 3 digits after the dot (e.g. 0.932).
  10652. </p>
  10653. </dd>
  10654. </dl>
  10655. </dd>
  10656. <dt>&lsquo;<samp>ssim_acc</samp>&rsquo;</dt>
  10657. <dd><p>Set SSIM accuracy. Valid options are integers within the range of
  10658. 0-4, while 0 gives the most accurate result and 4 computes the
  10659. fastest.
  10660. </p>
  10661. </dd>
  10662. </dl>
  10663. <a name="MediaFoundation"></a>
  10664. <h2 class="section"><a href="ffmpeg-all.html#toc-MediaFoundation">16.14 MediaFoundation</a></h2>
  10665. <p>This provides wrappers to encoders (both audio and video) in the
  10666. MediaFoundation framework. It can access both SW and HW encoders.
  10667. Video encoders can take input in either of nv12 or yuv420p form
  10668. (some encoders support both, some support only either - in practice,
  10669. nv12 is the safer choice, especially among HW encoders).
  10670. </p>
  10671. <a name="mpeg2"></a>
  10672. <h2 class="section"><a href="ffmpeg-all.html#toc-mpeg2">16.15 mpeg2</a></h2>
  10673. <p>MPEG-2 video encoder.
  10674. </p>
  10675. <a name="Options-26"></a>
  10676. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-26">16.15.1 Options</a></h3>
  10677. <dl compact="compact">
  10678. <dt>&lsquo;<samp>profile <var>integer</var></samp>&rsquo;</dt>
  10679. <dd><p>Select the mpeg2 profile to encode:
  10680. </p>
  10681. <dl compact="compact">
  10682. <dt>&lsquo;<samp>422</samp>&rsquo;</dt>
  10683. <dt>&lsquo;<samp>main</samp>&rsquo;</dt>
  10684. <dt>&lsquo;<samp>ss</samp>&rsquo;</dt>
  10685. <dd><p>Spatially Scalable
  10686. </p></dd>
  10687. <dt>&lsquo;<samp>snr</samp>&rsquo;</dt>
  10688. <dd><p>SNR Scalable
  10689. </p></dd>
  10690. <dt>&lsquo;<samp>high</samp>&rsquo;</dt>
  10691. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  10692. </dl>
  10693. </dd>
  10694. <dt>&lsquo;<samp>seq_disp_ext <var>integer</var></samp>&rsquo;</dt>
  10695. <dd><p>Specifies if the encoder should write a sequence_display_extension to the
  10696. output.
  10697. </p><dl compact="compact">
  10698. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  10699. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  10700. <dd><p>Decide automatically to write it or not (this is the default) by checking if
  10701. the data to be written is different from the default or unspecified values.
  10702. </p></dd>
  10703. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  10704. <dt>&lsquo;<samp>never</samp>&rsquo;</dt>
  10705. <dd><p>Never write it.
  10706. </p></dd>
  10707. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  10708. <dt>&lsquo;<samp>always</samp>&rsquo;</dt>
  10709. <dd><p>Always write it.
  10710. </p></dd>
  10711. </dl>
  10712. </dd>
  10713. <dt>&lsquo;<samp>video_format <var>integer</var></samp>&rsquo;</dt>
  10714. <dd><p>Specifies the video_format written into the sequence display extension
  10715. indicating the source of the video pictures. The default is &lsquo;<samp>unspecified</samp>&rsquo;,
  10716. 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;.
  10717. For maximum compatibility, use &lsquo;<samp>component</samp>&rsquo;.
  10718. </p></dd>
  10719. <dt>&lsquo;<samp>a53cc <var>boolean</var></samp>&rsquo;</dt>
  10720. <dd><p>Import closed captions (which must be ATSC compatible format) into output.
  10721. Default is 1 (on).
  10722. </p></dd>
  10723. </dl>
  10724. <a name="png"></a>
  10725. <h2 class="section"><a href="ffmpeg-all.html#toc-png">16.16 png</a></h2>
  10726. <p>PNG image encoder.
  10727. </p>
  10728. <a name="Private-options"></a>
  10729. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Private-options">16.16.1 Private options</a></h3>
  10730. <dl compact="compact">
  10731. <dt>&lsquo;<samp>dpi <var>integer</var></samp>&rsquo;</dt>
  10732. <dd><p>Set physical density of pixels, in dots per inch, unset by default
  10733. </p></dd>
  10734. <dt>&lsquo;<samp>dpm <var>integer</var></samp>&rsquo;</dt>
  10735. <dd><p>Set physical density of pixels, in dots per meter, unset by default
  10736. </p></dd>
  10737. </dl>
  10738. <a name="ProRes"></a>
  10739. <h2 class="section"><a href="ffmpeg-all.html#toc-ProRes">16.17 ProRes</a></h2>
  10740. <p>Apple ProRes encoder.
  10741. </p>
  10742. <p>FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
  10743. The used encoder can be chosen with the <code>-vcodec</code> option.
  10744. </p>
  10745. <a name="Private-Options-for-prores_002dks"></a>
  10746. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Private-Options-for-prores_002dks">16.17.1 Private Options for prores-ks</a></h3>
  10747. <dl compact="compact">
  10748. <dt>&lsquo;<samp>profile <var>integer</var></samp>&rsquo;</dt>
  10749. <dd><p>Select the ProRes profile to encode
  10750. </p><dl compact="compact">
  10751. <dt>&lsquo;<samp>proxy</samp>&rsquo;</dt>
  10752. <dt>&lsquo;<samp>lt</samp>&rsquo;</dt>
  10753. <dt>&lsquo;<samp>standard</samp>&rsquo;</dt>
  10754. <dt>&lsquo;<samp>hq</samp>&rsquo;</dt>
  10755. <dt>&lsquo;<samp>4444</samp>&rsquo;</dt>
  10756. <dt>&lsquo;<samp>4444xq</samp>&rsquo;</dt>
  10757. </dl>
  10758. </dd>
  10759. <dt>&lsquo;<samp>quant_mat <var>integer</var></samp>&rsquo;</dt>
  10760. <dd><p>Select quantization matrix.
  10761. </p><dl compact="compact">
  10762. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  10763. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  10764. <dt>&lsquo;<samp>proxy</samp>&rsquo;</dt>
  10765. <dt>&lsquo;<samp>lt</samp>&rsquo;</dt>
  10766. <dt>&lsquo;<samp>standard</samp>&rsquo;</dt>
  10767. <dt>&lsquo;<samp>hq</samp>&rsquo;</dt>
  10768. </dl>
  10769. <p>If set to <var>auto</var>, the matrix matching the profile will be picked.
  10770. If not set, the matrix providing the highest quality, <var>default</var>, will be
  10771. picked.
  10772. </p>
  10773. </dd>
  10774. <dt>&lsquo;<samp>bits_per_mb <var>integer</var></samp>&rsquo;</dt>
  10775. <dd><p>How many bits to allot for coding one macroblock. Different profiles use
  10776. between 200 and 2400 bits per macroblock, the maximum is 8000.
  10777. </p>
  10778. </dd>
  10779. <dt>&lsquo;<samp>mbs_per_slice <var>integer</var></samp>&rsquo;</dt>
  10780. <dd><p>Number of macroblocks in each slice (1-8); the default value (8)
  10781. should be good in almost all situations.
  10782. </p>
  10783. </dd>
  10784. <dt>&lsquo;<samp>vendor <var>string</var></samp>&rsquo;</dt>
  10785. <dd><p>Override the 4-byte vendor ID.
  10786. A custom vendor ID like <var>apl0</var> would claim the stream was produced by
  10787. the Apple encoder.
  10788. </p>
  10789. </dd>
  10790. <dt>&lsquo;<samp>alpha_bits <var>integer</var></samp>&rsquo;</dt>
  10791. <dd><p>Specify number of bits for alpha component.
  10792. Possible values are <var>0</var>, <var>8</var> and <var>16</var>.
  10793. Use <var>0</var> to disable alpha plane coding.
  10794. </p>
  10795. </dd>
  10796. </dl>
  10797. <a name="Speed-considerations"></a>
  10798. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Speed-considerations">16.17.2 Speed considerations</a></h3>
  10799. <p>In the default mode of operation the encoder has to honor frame constraints
  10800. (i.e. not produce frames with size bigger than requested) while still making
  10801. output picture as good as possible.
  10802. A frame containing a lot of small details is harder to compress and the encoder
  10803. would spend more time searching for appropriate quantizers for each slice.
  10804. </p>
  10805. <p>Setting a higher &lsquo;<samp>bits_per_mb</samp>&rsquo; limit will improve the speed.
  10806. </p>
  10807. <p>For the fastest encoding speed set the &lsquo;<samp>qscale</samp>&rsquo; parameter (4 is the
  10808. recommended value) and do not set a size constraint.
  10809. </p>
  10810. <a name="QSV-encoders"></a>
  10811. <h2 class="section"><a href="ffmpeg-all.html#toc-QSV-encoders">16.18 QSV encoders</a></h2>
  10812. <p>The family of Intel QuickSync Video encoders (MPEG-2, H.264, HEVC, JPEG/MJPEG and VP9)
  10813. </p>
  10814. <p>The ratecontrol method is selected as follows:
  10815. </p>
  10816. <ul>
  10817. <li>
  10818. When &lsquo;<samp>global_quality</samp>&rsquo; is specified, a quality-based mode is used.
  10819. Specifically this means either
  10820. <ul class="no-bullet">
  10821. <li>-
  10822. <var>CQP</var> - constant quantizer scale, when the &lsquo;<samp>qscale</samp>&rsquo; codec flag is
  10823. also set (the &lsquo;<samp>-qscale</samp>&rsquo; ffmpeg option).
  10824. </li><li>-
  10825. <var>LA_ICQ</var> - intelligent constant quality with lookahead, when the
  10826. &lsquo;<samp>look_ahead</samp>&rsquo; option is also set.
  10827. </li><li>-
  10828. <var>ICQ</var> &ndash; intelligent constant quality otherwise.
  10829. </li></ul>
  10830. </li><li>
  10831. Otherwise, a bitrate-based mode is used. For all of those, you should specify at
  10832. least the desired average bitrate with the &lsquo;<samp>b</samp>&rsquo; option.
  10833. <ul class="no-bullet">
  10834. <li>-
  10835. <var>LA</var> - VBR with lookahead, when the &lsquo;<samp>look_ahead</samp>&rsquo; option is specified.
  10836. </li><li>-
  10837. <var>VCM</var> - video conferencing mode, when the &lsquo;<samp>vcm</samp>&rsquo; option is set.
  10838. </li><li>-
  10839. <var>CBR</var> - constant bitrate, when &lsquo;<samp>maxrate</samp>&rsquo; is specified and equal to
  10840. the average bitrate.
  10841. </li><li>-
  10842. <var>VBR</var> - variable bitrate, when &lsquo;<samp>maxrate</samp>&rsquo; is specified, but is higher
  10843. than the average bitrate.
  10844. </li><li>-
  10845. <var>AVBR</var> - average VBR mode, when &lsquo;<samp>maxrate</samp>&rsquo; is not specified. This mode
  10846. is further configured by the &lsquo;<samp>avbr_accuracy</samp>&rsquo; and
  10847. &lsquo;<samp>avbr_convergence</samp>&rsquo; options.
  10848. </li></ul>
  10849. </li></ul>
  10850. <p>Note that depending on your system, a different mode than the one you specified
  10851. may be selected by the encoder. Set the verbosity level to <var>verbose</var> or
  10852. higher to see the actual settings used by the QSV runtime.
  10853. </p>
  10854. <p>Additional libavcodec global options are mapped to MSDK options as follows:
  10855. </p>
  10856. <ul>
  10857. <li>
  10858. &lsquo;<samp>g/gop_size</samp>&rsquo; -&gt; &lsquo;<samp>GopPicSize</samp>&rsquo;
  10859. </li><li>
  10860. &lsquo;<samp>bf/max_b_frames</samp>&rsquo;+1 -&gt; &lsquo;<samp>GopRefDist</samp>&rsquo;
  10861. </li><li>
  10862. &lsquo;<samp>rc_init_occupancy/rc_initial_buffer_occupancy</samp>&rsquo; -&gt;
  10863. &lsquo;<samp>InitialDelayInKB</samp>&rsquo;
  10864. </li><li>
  10865. &lsquo;<samp>slices</samp>&rsquo; -&gt; &lsquo;<samp>NumSlice</samp>&rsquo;
  10866. </li><li>
  10867. &lsquo;<samp>refs</samp>&rsquo; -&gt; &lsquo;<samp>NumRefFrame</samp>&rsquo;
  10868. </li><li>
  10869. &lsquo;<samp>b_strategy/b_frame_strategy</samp>&rsquo; -&gt; &lsquo;<samp>BRefType</samp>&rsquo;
  10870. </li><li>
  10871. &lsquo;<samp>cgop/CLOSED_GOP</samp>&rsquo; codec flag -&gt; &lsquo;<samp>GopOptFlag</samp>&rsquo;
  10872. </li><li>
  10873. For the <var>CQP</var> mode, the &lsquo;<samp>i_qfactor/i_qoffset</samp>&rsquo; and
  10874. &lsquo;<samp>b_qfactor/b_qoffset</samp>&rsquo; set the difference between <var>QPP</var> and <var>QPI</var>,
  10875. and <var>QPP</var> and <var>QPB</var> respectively.
  10876. </li><li>
  10877. Setting the &lsquo;<samp>coder</samp>&rsquo; option to the value <var>vlc</var> will make the H.264
  10878. encoder use CAVLC instead of CABAC.
  10879. </li></ul>
  10880. <a name="snow"></a>
  10881. <h2 class="section"><a href="ffmpeg-all.html#toc-snow">16.19 snow</a></h2>
  10882. <a name="Options-1"></a>
  10883. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-1">16.19.1 Options</a></h3>
  10884. <dl compact="compact">
  10885. <dt>&lsquo;<samp>iterative_dia_size</samp>&rsquo;</dt>
  10886. <dd><p>dia size for the iterative motion estimation
  10887. </p></dd>
  10888. </dl>
  10889. <a name="VAAPI-encoders"></a>
  10890. <h2 class="section"><a href="ffmpeg-all.html#toc-VAAPI-encoders">16.20 VAAPI encoders</a></h2>
  10891. <p>Wrappers for hardware encoders accessible via VAAPI.
  10892. </p>
  10893. <p>These encoders only accept input in VAAPI hardware surfaces. If you have input
  10894. in software frames, use the &lsquo;<samp>hwupload</samp>&rsquo; filter to upload them to the GPU.
  10895. </p>
  10896. <p>The following standard libavcodec options are used:
  10897. </p><ul>
  10898. <li>
  10899. &lsquo;<samp>g</samp>&rsquo; / &lsquo;<samp>gop_size</samp>&rsquo;
  10900. </li><li>
  10901. &lsquo;<samp>bf</samp>&rsquo; / &lsquo;<samp>max_b_frames</samp>&rsquo;
  10902. </li><li>
  10903. &lsquo;<samp>profile</samp>&rsquo;
  10904. <p>If not set, this will be determined automatically from the format of the input
  10905. frames and the profiles supported by the driver.
  10906. </p></li><li>
  10907. &lsquo;<samp>level</samp>&rsquo;
  10908. </li><li>
  10909. &lsquo;<samp>b</samp>&rsquo; / &lsquo;<samp>bit_rate</samp>&rsquo;
  10910. </li><li>
  10911. &lsquo;<samp>maxrate</samp>&rsquo; / &lsquo;<samp>rc_max_rate</samp>&rsquo;
  10912. </li><li>
  10913. &lsquo;<samp>bufsize</samp>&rsquo; / &lsquo;<samp>rc_buffer_size</samp>&rsquo;
  10914. </li><li>
  10915. &lsquo;<samp>rc_init_occupancy</samp>&rsquo; / &lsquo;<samp>rc_initial_buffer_occupancy</samp>&rsquo;
  10916. </li><li>
  10917. &lsquo;<samp>compression_level</samp>&rsquo;
  10918. <p>Speed / quality tradeoff: higher values are faster / worse quality.
  10919. </p></li><li>
  10920. &lsquo;<samp>q</samp>&rsquo; / &lsquo;<samp>global_quality</samp>&rsquo;
  10921. <p>Size / quality tradeoff: higher values are smaller / worse quality.
  10922. </p></li><li>
  10923. &lsquo;<samp>qmin</samp>&rsquo;
  10924. </li><li>
  10925. &lsquo;<samp>qmax</samp>&rsquo;
  10926. </li><li>
  10927. &lsquo;<samp>i_qfactor</samp>&rsquo; / &lsquo;<samp>i_quant_factor</samp>&rsquo;
  10928. </li><li>
  10929. &lsquo;<samp>i_qoffset</samp>&rsquo; / &lsquo;<samp>i_quant_offset</samp>&rsquo;
  10930. </li><li>
  10931. &lsquo;<samp>b_qfactor</samp>&rsquo; / &lsquo;<samp>b_quant_factor</samp>&rsquo;
  10932. </li><li>
  10933. &lsquo;<samp>b_qoffset</samp>&rsquo; / &lsquo;<samp>b_quant_offset</samp>&rsquo;
  10934. </li><li>
  10935. &lsquo;<samp>slices</samp>&rsquo;
  10936. </li></ul>
  10937. <p>All encoders support the following options:
  10938. </p><dl compact="compact">
  10939. <dt>&lsquo;<samp>low_power</samp>&rsquo;</dt>
  10940. <dd><p>Some drivers/platforms offer a second encoder for some codecs intended to use
  10941. less power than the default encoder; setting this option will attempt to use
  10942. that encoder. Note that it may support a reduced feature set, so some other
  10943. options may not be available in this mode.
  10944. </p>
  10945. </dd>
  10946. <dt>&lsquo;<samp>idr_interval</samp>&rsquo;</dt>
  10947. <dd><p>Set the number of normal intra frames between full-refresh (IDR) frames in
  10948. open-GOP mode. The intra frames are still IRAPs, but will not include global
  10949. headers and may have non-decodable leading pictures.
  10950. </p>
  10951. </dd>
  10952. <dt>&lsquo;<samp>b_depth</samp>&rsquo;</dt>
  10953. <dd><p>Set the B-frame reference depth. When set to one (the default), all B-frames
  10954. will refer only to P- or I-frames. When set to greater values multiple layers
  10955. of B-frames will be present, frames in each layer only referring to frames in
  10956. higher layers.
  10957. </p>
  10958. </dd>
  10959. <dt>&lsquo;<samp>rc_mode</samp>&rsquo;</dt>
  10960. <dd><p>Set the rate control mode to use. A given driver may only support a subset of
  10961. modes.
  10962. </p>
  10963. <p>Possible modes:
  10964. </p><dl compact="compact">
  10965. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  10966. <dd><p>Choose the mode automatically based on driver support and the other options.
  10967. This is the default.
  10968. </p></dd>
  10969. <dt>&lsquo;<samp>CQP</samp>&rsquo;</dt>
  10970. <dd><p>Constant-quality.
  10971. </p></dd>
  10972. <dt>&lsquo;<samp>CBR</samp>&rsquo;</dt>
  10973. <dd><p>Constant-bitrate.
  10974. </p></dd>
  10975. <dt>&lsquo;<samp>VBR</samp>&rsquo;</dt>
  10976. <dd><p>Variable-bitrate.
  10977. </p></dd>
  10978. <dt>&lsquo;<samp>ICQ</samp>&rsquo;</dt>
  10979. <dd><p>Intelligent constant-quality.
  10980. </p></dd>
  10981. <dt>&lsquo;<samp>QVBR</samp>&rsquo;</dt>
  10982. <dd><p>Quality-defined variable-bitrate.
  10983. </p></dd>
  10984. <dt>&lsquo;<samp>AVBR</samp>&rsquo;</dt>
  10985. <dd><p>Average variable bitrate.
  10986. </p></dd>
  10987. </dl>
  10988. </dd>
  10989. </dl>
  10990. <p>Each encoder also has its own specific options:
  10991. </p><dl compact="compact">
  10992. <dt>&lsquo;<samp>h264_vaapi</samp>&rsquo;</dt>
  10993. <dd><p>&lsquo;<samp>profile</samp>&rsquo; sets the value of <em>profile_idc</em> and the <em>constraint_set*_flag</em>s.
  10994. &lsquo;<samp>level</samp>&rsquo; sets the value of <em>level_idc</em>.
  10995. </p>
  10996. <dl compact="compact">
  10997. <dt>&lsquo;<samp>coder</samp>&rsquo;</dt>
  10998. <dd><p>Set entropy encoder (default is <em>cabac</em>). Possible values:
  10999. </p>
  11000. <dl compact="compact">
  11001. <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
  11002. <dt>&lsquo;<samp>cabac</samp>&rsquo;</dt>
  11003. <dd><p>Use CABAC.
  11004. </p>
  11005. </dd>
  11006. <dt>&lsquo;<samp>vlc</samp>&rsquo;</dt>
  11007. <dt>&lsquo;<samp>cavlc</samp>&rsquo;</dt>
  11008. <dd><p>Use CAVLC.
  11009. </p></dd>
  11010. </dl>
  11011. </dd>
  11012. <dt>&lsquo;<samp>aud</samp>&rsquo;</dt>
  11013. <dd><p>Include access unit delimiters in the stream (not included by default).
  11014. </p>
  11015. </dd>
  11016. <dt>&lsquo;<samp>sei</samp>&rsquo;</dt>
  11017. <dd><p>Set SEI message types to include.
  11018. Some combination of the following values:
  11019. </p><dl compact="compact">
  11020. <dt>&lsquo;<samp>identifier</samp>&rsquo;</dt>
  11021. <dd><p>Include a <em>user_data_unregistered</em> message containing information about
  11022. the encoder.
  11023. </p></dd>
  11024. <dt>&lsquo;<samp>timing</samp>&rsquo;</dt>
  11025. <dd><p>Include picture timing parameters (<em>buffering_period</em> and
  11026. <em>pic_timing</em> messages).
  11027. </p></dd>
  11028. <dt>&lsquo;<samp>recovery_point</samp>&rsquo;</dt>
  11029. <dd><p>Include recovery points where appropriate (<em>recovery_point</em> messages).
  11030. </p></dd>
  11031. </dl>
  11032. </dd>
  11033. </dl>
  11034. </dd>
  11035. <dt>&lsquo;<samp>hevc_vaapi</samp>&rsquo;</dt>
  11036. <dd><p>&lsquo;<samp>profile</samp>&rsquo; and &lsquo;<samp>level</samp>&rsquo; set the values of
  11037. <em>general_profile_idc</em> and <em>general_level_idc</em> respectively.
  11038. </p>
  11039. <dl compact="compact">
  11040. <dt>&lsquo;<samp>aud</samp>&rsquo;</dt>
  11041. <dd><p>Include access unit delimiters in the stream (not included by default).
  11042. </p>
  11043. </dd>
  11044. <dt>&lsquo;<samp>tier</samp>&rsquo;</dt>
  11045. <dd><p>Set <em>general_tier_flag</em>. This may affect the level chosen for the stream
  11046. if it is not explicitly specified.
  11047. </p>
  11048. </dd>
  11049. <dt>&lsquo;<samp>sei</samp>&rsquo;</dt>
  11050. <dd><p>Set SEI message types to include.
  11051. Some combination of the following values:
  11052. </p><dl compact="compact">
  11053. <dt>&lsquo;<samp>hdr</samp>&rsquo;</dt>
  11054. <dd><p>Include HDR metadata if the input frames have it
  11055. (<em>mastering_display_colour_volume</em> and <em>content_light_level</em>
  11056. messages).
  11057. </p></dd>
  11058. </dl>
  11059. </dd>
  11060. </dl>
  11061. </dd>
  11062. <dt>&lsquo;<samp>mjpeg_vaapi</samp>&rsquo;</dt>
  11063. <dd><p>Only baseline DCT encoding is supported. The encoder always uses the standard
  11064. quantisation and huffman tables - &lsquo;<samp>global_quality</samp>&rsquo; scales the standard
  11065. quantisation table (range 1-100).
  11066. </p>
  11067. <p>For YUV, 4:2:0, 4:2:2 and 4:4:4 subsampling modes are supported. RGB is also
  11068. supported, and will create an RGB JPEG.
  11069. </p>
  11070. <dl compact="compact">
  11071. <dt>&lsquo;<samp>jfif</samp>&rsquo;</dt>
  11072. <dd><p>Include JFIF header in each frame (not included by default).
  11073. </p></dd>
  11074. <dt>&lsquo;<samp>huffman</samp>&rsquo;</dt>
  11075. <dd><p>Include standard huffman tables (on by default). Turning this off will save
  11076. a few hundred bytes in each output frame, but may lose compatibility with some
  11077. JPEG decoders which don&rsquo;t fully handle MJPEG.
  11078. </p></dd>
  11079. </dl>
  11080. </dd>
  11081. <dt>&lsquo;<samp>mpeg2_vaapi</samp>&rsquo;</dt>
  11082. <dd><p>&lsquo;<samp>profile</samp>&rsquo; and &lsquo;<samp>level</samp>&rsquo; set the value of <em>profile_and_level_indication</em>.
  11083. </p>
  11084. </dd>
  11085. <dt>&lsquo;<samp>vp8_vaapi</samp>&rsquo;</dt>
  11086. <dd><p>B-frames are not supported.
  11087. </p>
  11088. <p>&lsquo;<samp>global_quality</samp>&rsquo; sets the <em>q_idx</em> used for non-key frames (range 0-127).
  11089. </p>
  11090. <dl compact="compact">
  11091. <dt>&lsquo;<samp>loop_filter_level</samp>&rsquo;</dt>
  11092. <dt>&lsquo;<samp>loop_filter_sharpness</samp>&rsquo;</dt>
  11093. <dd><p>Manually set the loop filter parameters.
  11094. </p></dd>
  11095. </dl>
  11096. </dd>
  11097. <dt>&lsquo;<samp>vp9_vaapi</samp>&rsquo;</dt>
  11098. <dd><p>&lsquo;<samp>global_quality</samp>&rsquo; sets the <em>q_idx</em> used for P-frames (range 0-255).
  11099. </p>
  11100. <dl compact="compact">
  11101. <dt>&lsquo;<samp>loop_filter_level</samp>&rsquo;</dt>
  11102. <dt>&lsquo;<samp>loop_filter_sharpness</samp>&rsquo;</dt>
  11103. <dd><p>Manually set the loop filter parameters.
  11104. </p></dd>
  11105. </dl>
  11106. <p>B-frames are supported, but the output stream is always in encode order rather than display
  11107. order. If B-frames are enabled, it may be necessary to use the &lsquo;<samp>vp9_raw_reorder</samp>&rsquo;
  11108. bitstream filter to modify the output stream to display frames in the correct order.
  11109. </p>
  11110. <p>Only normal frames are produced - the &lsquo;<samp>vp9_superframe</samp>&rsquo; bitstream filter may be
  11111. required to produce a stream usable with all decoders.
  11112. </p>
  11113. </dd>
  11114. </dl>
  11115. <a name="vc2"></a>
  11116. <h2 class="section"><a href="ffmpeg-all.html#toc-vc2">16.21 vc2</a></h2>
  11117. <p>SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at
  11118. professional broadcasting but since it supports yuv420, yuv422 and yuv444 at
  11119. 8 (limited range or full range), 10 or 12 bits, this makes it suitable for
  11120. other tasks which require low overhead and low compression (like screen
  11121. recording).
  11122. </p>
  11123. <a name="Options-24"></a>
  11124. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-24">16.21.1 Options</a></h3>
  11125. <dl compact="compact">
  11126. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  11127. <dd><p>Sets target video bitrate. Usually that&rsquo;s around 1:6 of the uncompressed
  11128. video bitrate (e.g. for 1920x1080 50fps yuv422p10 that&rsquo;s around 400Mbps). Higher
  11129. values (close to the uncompressed bitrate) turn on lossless compression mode.
  11130. </p>
  11131. </dd>
  11132. <dt>&lsquo;<samp>field_order</samp>&rsquo;</dt>
  11133. <dd><p>Enables field coding when set (e.g. to tt - top field first) for interlaced
  11134. inputs. Should increase compression with interlaced content as it splits the
  11135. fields and encodes each separately.
  11136. </p>
  11137. </dd>
  11138. <dt>&lsquo;<samp>wavelet_depth</samp>&rsquo;</dt>
  11139. <dd><p>Sets the total amount of wavelet transforms to apply, between 1 and 5 (default).
  11140. Lower values reduce compression and quality. Less capable decoders may not be
  11141. able to handle values of &lsquo;<samp>wavelet_depth</samp>&rsquo; over 3.
  11142. </p>
  11143. </dd>
  11144. <dt>&lsquo;<samp>wavelet_type</samp>&rsquo;</dt>
  11145. <dd><p>Sets the transform type. Currently only <var>5_3</var> (LeGall) and <var>9_7</var>
  11146. (Deslauriers-Dubuc)
  11147. are implemented, with 9_7 being the one with better compression and thus
  11148. is the default.
  11149. </p>
  11150. </dd>
  11151. <dt>&lsquo;<samp>slice_width</samp>&rsquo;</dt>
  11152. <dt>&lsquo;<samp>slice_height</samp>&rsquo;</dt>
  11153. <dd><p>Sets the slice size for each slice. Larger values result in better compression.
  11154. For compatibility with other more limited decoders use &lsquo;<samp>slice_width</samp>&rsquo; of
  11155. 32 and &lsquo;<samp>slice_height</samp>&rsquo; of 8.
  11156. </p>
  11157. </dd>
  11158. <dt>&lsquo;<samp>tolerance</samp>&rsquo;</dt>
  11159. <dd><p>Sets the undershoot tolerance of the rate control system in percent. This is
  11160. to prevent an expensive search from being run.
  11161. </p>
  11162. </dd>
  11163. <dt>&lsquo;<samp>qm</samp>&rsquo;</dt>
  11164. <dd><p>Sets the quantization matrix preset to use by default or when &lsquo;<samp>wavelet_depth</samp>&rsquo;
  11165. is set to 5
  11166. </p><ul class="no-bullet">
  11167. <li>-
  11168. <var>default</var>
  11169. Uses the default quantization matrix from the specifications, extended with
  11170. values for the fifth level. This provides a good balance between keeping detail
  11171. and omitting artifacts.
  11172. </li><li>-
  11173. <var>flat</var>
  11174. Use a completely zeroed out quantization matrix. This increases PSNR but might
  11175. reduce perception. Use in bogus benchmarks.
  11176. </li><li>-
  11177. <var>color</var>
  11178. Reduces detail but attempts to preserve color at extremely low bitrates.
  11179. </li></ul>
  11180. </dd>
  11181. </dl>
  11182. <a name="Subtitles-Encoders"></a>
  11183. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Subtitles-Encoders">17 Subtitles Encoders</a></h1>
  11184. <a name="dvdsub-1"></a>
  11185. <h2 class="section"><a href="ffmpeg-all.html#toc-dvdsub-1">17.1 dvdsub</a></h2>
  11186. <p>This codec encodes the bitmap subtitle format that is used in DVDs.
  11187. Typically they are stored in VOBSUB file pairs (*.idx + *.sub),
  11188. and they can also be used in Matroska files.
  11189. </p>
  11190. <a name="Options-61"></a>
  11191. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-61">17.1.1 Options</a></h3>
  11192. <dl compact="compact">
  11193. <dt>&lsquo;<samp>palette</samp>&rsquo;</dt>
  11194. <dd><p>Specify the global palette used by the bitmaps.
  11195. </p>
  11196. <p>The format for this option is a string containing 16 24-bits hexadecimal
  11197. numbers (without 0x prefix) separated by commas, for example <code>0d00ee,
  11198. ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
  11199. 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
  11200. </p>
  11201. </dd>
  11202. <dt>&lsquo;<samp>even_rows_fix</samp>&rsquo;</dt>
  11203. <dd><p>When set to 1, enable a work-around that makes the number of pixel rows
  11204. even in all subtitles. This fixes a problem with some players that
  11205. cut off the bottom row if the number is odd. The work-around just adds
  11206. a fully transparent row if needed. The overhead is low, typically
  11207. one byte per subtitle on average.
  11208. </p>
  11209. <p>By default, this work-around is disabled.
  11210. </p></dd>
  11211. </dl>
  11212. <a name="Bitstream-Filters"></a>
  11213. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Bitstream-Filters">18 Bitstream Filters</a></h1>
  11214. <p>When you configure your FFmpeg build, all the supported bitstream
  11215. filters are enabled by default. You can list all available ones using
  11216. the configure option <code>--list-bsfs</code>.
  11217. </p>
  11218. <p>You can disable all the bitstream filters using the configure option
  11219. <code>--disable-bsfs</code>, and selectively enable any bitstream filter using
  11220. the option <code>--enable-bsf=BSF</code>, or you can disable a particular
  11221. bitstream filter using the option <code>--disable-bsf=BSF</code>.
  11222. </p>
  11223. <p>The option <code>-bsfs</code> of the ff* tools will display the list of
  11224. all the supported bitstream filters included in your build.
  11225. </p>
  11226. <p>The ff* tools have a -bsf option applied per stream, taking a
  11227. comma-separated list of filters, whose parameters follow the filter
  11228. name after a &rsquo;=&rsquo;.
  11229. </p>
  11230. <div class="example">
  11231. <pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
  11232. </pre></div>
  11233. <p>Below is a description of the currently available bitstream filters,
  11234. with their parameters, if any.
  11235. </p>
  11236. <a name="aac_005fadtstoasc"></a>
  11237. <h2 class="section"><a href="ffmpeg-all.html#toc-aac_005fadtstoasc">18.1 aac_adtstoasc</a></h2>
  11238. <p>Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration
  11239. bitstream.
  11240. </p>
  11241. <p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
  11242. ADTS header and removes the ADTS header.
  11243. </p>
  11244. <p>This filter is required for example when copying an AAC stream from a
  11245. raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or
  11246. to MOV/MP4 files and related formats such as 3GP or M4A. Please note
  11247. that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats.
  11248. </p>
  11249. <a name="av1_005fmetadata"></a>
  11250. <h2 class="section"><a href="ffmpeg-all.html#toc-av1_005fmetadata">18.2 av1_metadata</a></h2>
  11251. <p>Modify metadata embedded in an AV1 stream.
  11252. </p>
  11253. <dl compact="compact">
  11254. <dt>&lsquo;<samp>td</samp>&rsquo;</dt>
  11255. <dd><p>Insert or remove temporal delimiter OBUs in all temporal units of the
  11256. stream.
  11257. </p>
  11258. <dl compact="compact">
  11259. <dt>&lsquo;<samp>insert</samp>&rsquo;</dt>
  11260. <dd><p>Insert a TD at the beginning of every TU which does not already have one.
  11261. </p></dd>
  11262. <dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
  11263. <dd><p>Remove the TD from the beginning of every TU which has one.
  11264. </p></dd>
  11265. </dl>
  11266. </dd>
  11267. <dt>&lsquo;<samp>color_primaries</samp>&rsquo;</dt>
  11268. <dt>&lsquo;<samp>transfer_characteristics</samp>&rsquo;</dt>
  11269. <dt>&lsquo;<samp>matrix_coefficients</samp>&rsquo;</dt>
  11270. <dd><p>Set the color description fields in the stream (see AV1 section 6.4.2).
  11271. </p>
  11272. </dd>
  11273. <dt>&lsquo;<samp>color_range</samp>&rsquo;</dt>
  11274. <dd><p>Set the color range in the stream (see AV1 section 6.4.2; note that
  11275. this cannot be set for streams using BT.709 primaries, sRGB transfer
  11276. characteristic and identity (RGB) matrix coefficients).
  11277. </p><dl compact="compact">
  11278. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  11279. <dd><p>Limited range.
  11280. </p></dd>
  11281. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  11282. <dd><p>Full range.
  11283. </p></dd>
  11284. </dl>
  11285. </dd>
  11286. <dt>&lsquo;<samp>chroma_sample_position</samp>&rsquo;</dt>
  11287. <dd><p>Set the chroma sample location in the stream (see AV1 section 6.4.2).
  11288. This can only be set for 4:2:0 streams.
  11289. </p>
  11290. <dl compact="compact">
  11291. <dt>&lsquo;<samp>vertical</samp>&rsquo;</dt>
  11292. <dd><p>Left position (matching the default in MPEG-2 and H.264).
  11293. </p></dd>
  11294. <dt>&lsquo;<samp>colocated</samp>&rsquo;</dt>
  11295. <dd><p>Top-left position.
  11296. </p></dd>
  11297. </dl>
  11298. </dd>
  11299. <dt>&lsquo;<samp>tick_rate</samp>&rsquo;</dt>
  11300. <dd><p>Set the tick rate (<em>num_units_in_display_tick / time_scale</em>) in
  11301. the timing info in the sequence header.
  11302. </p></dd>
  11303. <dt>&lsquo;<samp>num_ticks_per_picture</samp>&rsquo;</dt>
  11304. <dd><p>Set the number of ticks in each picture, to indicate that the stream
  11305. has a fixed framerate. Ignored if &lsquo;<samp>tick_rate</samp>&rsquo; is not also set.
  11306. </p>
  11307. </dd>
  11308. <dt>&lsquo;<samp>delete_padding</samp>&rsquo;</dt>
  11309. <dd><p>Deletes Padding OBUs.
  11310. </p>
  11311. </dd>
  11312. </dl>
  11313. <a name="chomp"></a>
  11314. <h2 class="section"><a href="ffmpeg-all.html#toc-chomp">18.3 chomp</a></h2>
  11315. <p>Remove zero padding at the end of a packet.
  11316. </p>
  11317. <a name="dca_005fcore"></a>
  11318. <h2 class="section"><a href="ffmpeg-all.html#toc-dca_005fcore">18.4 dca_core</a></h2>
  11319. <p>Extract the core from a DCA/DTS stream, dropping extensions such as
  11320. DTS-HD.
  11321. </p>
  11322. <a name="dump_005fextra"></a>
  11323. <h2 class="section"><a href="ffmpeg-all.html#toc-dump_005fextra">18.5 dump_extra</a></h2>
  11324. <p>Add extradata to the beginning of the filtered packets except when
  11325. said packets already exactly begin with the extradata that is intended
  11326. to be added.
  11327. </p>
  11328. <dl compact="compact">
  11329. <dt>&lsquo;<samp>freq</samp>&rsquo;</dt>
  11330. <dd><p>The additional argument specifies which packets should be filtered.
  11331. It accepts the values:
  11332. </p><dl compact="compact">
  11333. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  11334. <dt>&lsquo;<samp>keyframe</samp>&rsquo;</dt>
  11335. <dd><p>add extradata to all key packets
  11336. </p>
  11337. </dd>
  11338. <dt>&lsquo;<samp>e</samp>&rsquo;</dt>
  11339. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  11340. <dd><p>add extradata to all packets
  11341. </p></dd>
  11342. </dl>
  11343. </dd>
  11344. </dl>
  11345. <p>If not specified it is assumed &lsquo;<samp>k</samp>&rsquo;.
  11346. </p>
  11347. <p>For example the following <code>ffmpeg</code> command forces a global
  11348. header (thus disabling individual packet headers) in the H.264 packets
  11349. generated by the <code>libx264</code> encoder, but corrects them by adding
  11350. the header stored in extradata to the key packets:
  11351. </p><div class="example">
  11352. <pre class="example">ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
  11353. </pre></div>
  11354. <a name="eac3_005fcore"></a>
  11355. <h2 class="section"><a href="ffmpeg-all.html#toc-eac3_005fcore">18.6 eac3_core</a></h2>
  11356. <p>Extract the core from a E-AC-3 stream, dropping extra channels.
  11357. </p>
  11358. <a name="extract_005fextradata"></a>
  11359. <h2 class="section"><a href="ffmpeg-all.html#toc-extract_005fextradata">18.7 extract_extradata</a></h2>
  11360. <p>Extract the in-band extradata.
  11361. </p>
  11362. <p>Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers,
  11363. or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either &quot;in-band&quot; (i.e. as a part
  11364. of the bitstream containing the coded frames) or &quot;out of band&quot; (e.g. on the
  11365. container level). This latter form is called &quot;extradata&quot; in FFmpeg terminology.
  11366. </p>
  11367. <p>This bitstream filter detects the in-band headers and makes them available as
  11368. extradata.
  11369. </p>
  11370. <dl compact="compact">
  11371. <dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
  11372. <dd><p>When this option is enabled, the long-term headers are removed from the
  11373. bitstream after extraction.
  11374. </p></dd>
  11375. </dl>
  11376. <a name="filter_005funits"></a>
  11377. <h2 class="section"><a href="ffmpeg-all.html#toc-filter_005funits">18.8 filter_units</a></h2>
  11378. <p>Remove units with types in or not in a given set from the stream.
  11379. </p>
  11380. <dl compact="compact">
  11381. <dt>&lsquo;<samp>pass_types</samp>&rsquo;</dt>
  11382. <dd><p>List of unit types or ranges of unit types to pass through while removing
  11383. all others. This is specified as a &rsquo;|&rsquo;-separated list of unit type values
  11384. or ranges of values with &rsquo;-&rsquo;.
  11385. </p>
  11386. </dd>
  11387. <dt>&lsquo;<samp>remove_types</samp>&rsquo;</dt>
  11388. <dd><p>Identical to &lsquo;<samp>pass_types</samp>&rsquo;, except the units in the given set
  11389. removed and all others passed through.
  11390. </p></dd>
  11391. </dl>
  11392. <p>Extradata is unchanged by this transformation, but note that if the stream
  11393. contains inline parameter sets then the output may be unusable if they are
  11394. removed.
  11395. </p>
  11396. <p>For example, to remove all non-VCL NAL units from an H.264 stream:
  11397. </p><div class="example">
  11398. <pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
  11399. </pre></div>
  11400. <p>To remove all AUDs, SEI and filler from an H.265 stream:
  11401. </p><div class="example">
  11402. <pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
  11403. </pre></div>
  11404. <a name="hapqa_005fextract"></a>
  11405. <h2 class="section"><a href="ffmpeg-all.html#toc-hapqa_005fextract">18.9 hapqa_extract</a></h2>
  11406. <p>Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file.
  11407. </p>
  11408. <dl compact="compact">
  11409. <dt>&lsquo;<samp>texture</samp>&rsquo;</dt>
  11410. <dd><p>Specifies the texture to keep.
  11411. </p>
  11412. <dl compact="compact">
  11413. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  11414. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  11415. </dl>
  11416. </dd>
  11417. </dl>
  11418. <p>Convert HAPQA to HAPQ
  11419. </p><div class="example">
  11420. <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
  11421. </pre></div>
  11422. <p>Convert HAPQA to HAPAlphaOnly
  11423. </p><div class="example">
  11424. <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
  11425. </pre></div>
  11426. <a name="h264_005fmetadata"></a>
  11427. <h2 class="section"><a href="ffmpeg-all.html#toc-h264_005fmetadata">18.10 h264_metadata</a></h2>
  11428. <p>Modify metadata embedded in an H.264 stream.
  11429. </p>
  11430. <dl compact="compact">
  11431. <dt>&lsquo;<samp>aud</samp>&rsquo;</dt>
  11432. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  11433. </p>
  11434. <dl compact="compact">
  11435. <dt>&lsquo;<samp>insert</samp>&rsquo;</dt>
  11436. <dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
  11437. </dl>
  11438. </dd>
  11439. <dt>&lsquo;<samp>sample_aspect_ratio</samp>&rsquo;</dt>
  11440. <dd><p>Set the sample aspect ratio of the stream in the VUI parameters.
  11441. </p>
  11442. </dd>
  11443. <dt>&lsquo;<samp>overscan_appropriate_flag</samp>&rsquo;</dt>
  11444. <dd><p>Set whether the stream is suitable for display using overscan
  11445. or not (see H.264 section E.2.1).
  11446. </p>
  11447. </dd>
  11448. <dt>&lsquo;<samp>video_format</samp>&rsquo;</dt>
  11449. <dt>&lsquo;<samp>video_full_range_flag</samp>&rsquo;</dt>
  11450. <dd><p>Set the video format in the stream (see H.264 section E.2.1 and
  11451. table E-2).
  11452. </p>
  11453. </dd>
  11454. <dt>&lsquo;<samp>colour_primaries</samp>&rsquo;</dt>
  11455. <dt>&lsquo;<samp>transfer_characteristics</samp>&rsquo;</dt>
  11456. <dt>&lsquo;<samp>matrix_coefficients</samp>&rsquo;</dt>
  11457. <dd><p>Set the colour description in the stream (see H.264 section E.2.1
  11458. and tables E-3, E-4 and E-5).
  11459. </p>
  11460. </dd>
  11461. <dt>&lsquo;<samp>chroma_sample_loc_type</samp>&rsquo;</dt>
  11462. <dd><p>Set the chroma sample location in the stream (see H.264 section
  11463. E.2.1 and figure E-1).
  11464. </p>
  11465. </dd>
  11466. <dt>&lsquo;<samp>tick_rate</samp>&rsquo;</dt>
  11467. <dd><p>Set the tick rate (num_units_in_tick / time_scale) in the VUI
  11468. parameters. This is the smallest time unit representable in the
  11469. stream, and in many cases represents the field rate of the stream
  11470. (double the frame rate).
  11471. </p></dd>
  11472. <dt>&lsquo;<samp>fixed_frame_rate_flag</samp>&rsquo;</dt>
  11473. <dd><p>Set whether the stream has fixed framerate - typically this indicates
  11474. that the framerate is exactly half the tick rate, but the exact
  11475. meaning is dependent on interlacing and the picture structure (see
  11476. H.264 section E.2.1 and table E-6).
  11477. </p>
  11478. </dd>
  11479. <dt>&lsquo;<samp>crop_left</samp>&rsquo;</dt>
  11480. <dt>&lsquo;<samp>crop_right</samp>&rsquo;</dt>
  11481. <dt>&lsquo;<samp>crop_top</samp>&rsquo;</dt>
  11482. <dt>&lsquo;<samp>crop_bottom</samp>&rsquo;</dt>
  11483. <dd><p>Set the frame cropping offsets in the SPS. These values will replace
  11484. the current ones if the stream is already cropped.
  11485. </p>
  11486. <p>These fields are set in pixels. Note that some sizes may not be
  11487. representable if the chroma is subsampled or the stream is interlaced
  11488. (see H.264 section 7.4.2.1.1).
  11489. </p>
  11490. </dd>
  11491. <dt>&lsquo;<samp>sei_user_data</samp>&rsquo;</dt>
  11492. <dd><p>Insert a string as SEI unregistered user data. The argument must
  11493. be of the form <em>UUID+string</em>, where the UUID is as hex digits
  11494. possibly separated by hyphens, and the string can be anything.
  11495. </p>
  11496. <p>For example, &lsquo;<samp>086f3693-b7b3-4f2c-9653-21492feee5b8+hello</samp>&rsquo; will
  11497. insert the string &ldquo;hello&rdquo; associated with the given UUID.
  11498. </p>
  11499. </dd>
  11500. <dt>&lsquo;<samp>delete_filler</samp>&rsquo;</dt>
  11501. <dd><p>Deletes both filler NAL units and filler SEI messages.
  11502. </p>
  11503. </dd>
  11504. <dt>&lsquo;<samp>level</samp>&rsquo;</dt>
  11505. <dd><p>Set the level in the SPS. Refer to H.264 section A.3 and tables A-1
  11506. to A-5.
  11507. </p>
  11508. <p>The argument must be the name of a level (for example, &lsquo;<samp>4.2</samp>&rsquo;), a
  11509. level_idc value (for example, &lsquo;<samp>42</samp>&rsquo;), or the special name &lsquo;<samp>auto</samp>&rsquo;
  11510. indicating that the filter should attempt to guess the level from the
  11511. input stream properties.
  11512. </p>
  11513. </dd>
  11514. </dl>
  11515. <a name="h264_005fmp4toannexb"></a>
  11516. <h2 class="section"><a href="ffmpeg-all.html#toc-h264_005fmp4toannexb">18.11 h264_mp4toannexb</a></h2>
  11517. <p>Convert an H.264 bitstream from length prefixed mode to start code
  11518. prefixed mode (as defined in the Annex B of the ITU-T H.264
  11519. specification).
  11520. </p>
  11521. <p>This is required by some streaming formats, typically the MPEG-2
  11522. transport stream format (muxer <code>mpegts</code>).
  11523. </p>
  11524. <p>For example to remux an MP4 file containing an H.264 stream to mpegts
  11525. format with <code>ffmpeg</code>, you can use the command:
  11526. </p>
  11527. <div class="example">
  11528. <pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
  11529. </pre></div>
  11530. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  11531. <code>mpegts</code>) and raw H.264 (muxer <code>h264</code>) output formats.
  11532. </p>
  11533. <a name="h264_005fredundant_005fpps"></a>
  11534. <h2 class="section"><a href="ffmpeg-all.html#toc-h264_005fredundant_005fpps">18.12 h264_redundant_pps</a></h2>
  11535. <p>This applies a specific fixup to some Blu-ray streams which contain
  11536. redundant PPSs modifying irrelevant parameters of the stream which
  11537. confuse other transformations which require correct extradata.
  11538. </p>
  11539. <p>A new single global PPS is created, and all of the redundant PPSs
  11540. within the stream are removed.
  11541. </p>
  11542. <a name="hevc_005fmetadata"></a>
  11543. <h2 class="section"><a href="ffmpeg-all.html#toc-hevc_005fmetadata">18.13 hevc_metadata</a></h2>
  11544. <p>Modify metadata embedded in an HEVC stream.
  11545. </p>
  11546. <dl compact="compact">
  11547. <dt>&lsquo;<samp>aud</samp>&rsquo;</dt>
  11548. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  11549. </p>
  11550. <dl compact="compact">
  11551. <dt>&lsquo;<samp>insert</samp>&rsquo;</dt>
  11552. <dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
  11553. </dl>
  11554. </dd>
  11555. <dt>&lsquo;<samp>sample_aspect_ratio</samp>&rsquo;</dt>
  11556. <dd><p>Set the sample aspect ratio in the stream in the VUI parameters.
  11557. </p>
  11558. </dd>
  11559. <dt>&lsquo;<samp>video_format</samp>&rsquo;</dt>
  11560. <dt>&lsquo;<samp>video_full_range_flag</samp>&rsquo;</dt>
  11561. <dd><p>Set the video format in the stream (see H.265 section E.3.1 and
  11562. table E.2).
  11563. </p>
  11564. </dd>
  11565. <dt>&lsquo;<samp>colour_primaries</samp>&rsquo;</dt>
  11566. <dt>&lsquo;<samp>transfer_characteristics</samp>&rsquo;</dt>
  11567. <dt>&lsquo;<samp>matrix_coefficients</samp>&rsquo;</dt>
  11568. <dd><p>Set the colour description in the stream (see H.265 section E.3.1
  11569. and tables E.3, E.4 and E.5).
  11570. </p>
  11571. </dd>
  11572. <dt>&lsquo;<samp>chroma_sample_loc_type</samp>&rsquo;</dt>
  11573. <dd><p>Set the chroma sample location in the stream (see H.265 section
  11574. E.3.1 and figure E.1).
  11575. </p>
  11576. </dd>
  11577. <dt>&lsquo;<samp>tick_rate</samp>&rsquo;</dt>
  11578. <dd><p>Set the tick rate in the VPS and VUI parameters (num_units_in_tick /
  11579. time_scale). Combined with &lsquo;<samp>num_ticks_poc_diff_one</samp>&rsquo;, this can
  11580. set a constant framerate in the stream. Note that it is likely to be
  11581. overridden by container parameters when the stream is in a container.
  11582. </p>
  11583. </dd>
  11584. <dt>&lsquo;<samp>num_ticks_poc_diff_one</samp>&rsquo;</dt>
  11585. <dd><p>Set poc_proportional_to_timing_flag in VPS and VUI and use this value
  11586. to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and
  11587. E.3.1). Ignored if &lsquo;<samp>tick_rate</samp>&rsquo; is not also set.
  11588. </p>
  11589. </dd>
  11590. <dt>&lsquo;<samp>crop_left</samp>&rsquo;</dt>
  11591. <dt>&lsquo;<samp>crop_right</samp>&rsquo;</dt>
  11592. <dt>&lsquo;<samp>crop_top</samp>&rsquo;</dt>
  11593. <dt>&lsquo;<samp>crop_bottom</samp>&rsquo;</dt>
  11594. <dd><p>Set the conformance window cropping offsets in the SPS. These values
  11595. will replace the current ones if the stream is already cropped.
  11596. </p>
  11597. <p>These fields are set in pixels. Note that some sizes may not be
  11598. representable if the chroma is subsampled (H.265 section 7.4.3.2.1).
  11599. </p>
  11600. </dd>
  11601. <dt>&lsquo;<samp>level</samp>&rsquo;</dt>
  11602. <dd><p>Set the level in the VPS and SPS. See H.265 section A.4 and tables
  11603. A.6 and A.7.
  11604. </p>
  11605. <p>The argument must be the name of a level (for example, &lsquo;<samp>5.1</samp>&rsquo;), a
  11606. <em>general_level_idc</em> value (for example, &lsquo;<samp>153</samp>&rsquo; for level 5.1),
  11607. or the special name &lsquo;<samp>auto</samp>&rsquo; indicating that the filter should
  11608. attempt to guess the level from the input stream properties.
  11609. </p>
  11610. </dd>
  11611. </dl>
  11612. <a name="hevc_005fmp4toannexb"></a>
  11613. <h2 class="section"><a href="ffmpeg-all.html#toc-hevc_005fmp4toannexb">18.14 hevc_mp4toannexb</a></h2>
  11614. <p>Convert an HEVC/H.265 bitstream from length prefixed mode to start code
  11615. prefixed mode (as defined in the Annex B of the ITU-T H.265
  11616. specification).
  11617. </p>
  11618. <p>This is required by some streaming formats, typically the MPEG-2
  11619. transport stream format (muxer <code>mpegts</code>).
  11620. </p>
  11621. <p>For example to remux an MP4 file containing an HEVC stream to mpegts
  11622. format with <code>ffmpeg</code>, you can use the command:
  11623. </p>
  11624. <div class="example">
  11625. <pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
  11626. </pre></div>
  11627. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  11628. <code>mpegts</code>) and raw HEVC/H.265 (muxer <code>h265</code> or
  11629. <code>hevc</code>) output formats.
  11630. </p>
  11631. <a name="imxdump"></a>
  11632. <h2 class="section"><a href="ffmpeg-all.html#toc-imxdump">18.15 imxdump</a></h2>
  11633. <p>Modifies the bitstream to fit in MOV and to be usable by the Final Cut
  11634. Pro decoder. This filter only applies to the mpeg2video codec, and is
  11635. likely not needed for Final Cut Pro 7 and newer with the appropriate
  11636. &lsquo;<samp>-tag:v</samp>&rsquo;.
  11637. </p>
  11638. <p>For example, to remux 30 MB/sec NTSC IMX to MOV:
  11639. </p>
  11640. <div class="example">
  11641. <pre class="example">ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
  11642. </pre></div>
  11643. <a name="mjpeg2jpeg"></a>
  11644. <h2 class="section"><a href="ffmpeg-all.html#toc-mjpeg2jpeg">18.16 mjpeg2jpeg</a></h2>
  11645. <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
  11646. </p>
  11647. <p>MJPEG is a video codec wherein each video frame is essentially a
  11648. JPEG image. The individual frames can be extracted without loss,
  11649. e.g. by
  11650. </p>
  11651. <div class="example">
  11652. <pre class="example">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
  11653. </pre></div>
  11654. <p>Unfortunately, these chunks are incomplete JPEG images, because
  11655. they lack the DHT segment required for decoding. Quoting from
  11656. <a href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
  11657. </p>
  11658. <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
  11659. commented that &quot;MJPEG, or at least the MJPEG in AVIs having the
  11660. MJPG fourcc, is restricted JPEG with a fixed &ndash; and *omitted* &ndash;
  11661. Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
  11662. and it must use basic Huffman encoding, not arithmetic or
  11663. progressive. . . . You can indeed extract the MJPEG frames and
  11664. decode them with a regular JPEG decoder, but you have to prepend
  11665. the DHT segment to them, or else the decoder won&rsquo;t have any idea
  11666. how to decompress the data. The exact table necessary is given in
  11667. the OpenDML spec.&quot;
  11668. </p>
  11669. <p>This bitstream filter patches the header of frames extracted from an MJPEG
  11670. stream (carrying the AVI1 header ID and lacking a DHT segment) to
  11671. produce fully qualified JPEG images.
  11672. </p>
  11673. <div class="example">
  11674. <pre class="example">ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
  11675. exiftran -i -9 frame*.jpg
  11676. ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
  11677. </pre></div>
  11678. <a name="mjpegadump"></a>
  11679. <h2 class="section"><a href="ffmpeg-all.html#toc-mjpegadump">18.17 mjpegadump</a></h2>
  11680. <p>Add an MJPEG A header to the bitstream, to enable decoding by
  11681. Quicktime.
  11682. </p>
  11683. <p><a name="mov2textsub"></a>
  11684. </p><a name="mov2textsub-1"></a>
  11685. <h2 class="section"><a href="ffmpeg-all.html#toc-mov2textsub-1">18.18 mov2textsub</a></h2>
  11686. <p>Extract a representable text file from MOV subtitles, stripping the
  11687. metadata header from each subtitle packet.
  11688. </p>
  11689. <p>See also the <a href="#text2movsub">text2movsub</a> filter.
  11690. </p>
  11691. <a name="mp3decomp"></a>
  11692. <h2 class="section"><a href="ffmpeg-all.html#toc-mp3decomp">18.19 mp3decomp</a></h2>
  11693. <p>Decompress non-standard compressed MP3 audio headers.
  11694. </p>
  11695. <a name="mpeg2_005fmetadata"></a>
  11696. <h2 class="section"><a href="ffmpeg-all.html#toc-mpeg2_005fmetadata">18.20 mpeg2_metadata</a></h2>
  11697. <p>Modify metadata embedded in an MPEG-2 stream.
  11698. </p>
  11699. <dl compact="compact">
  11700. <dt>&lsquo;<samp>display_aspect_ratio</samp>&rsquo;</dt>
  11701. <dd><p>Set the display aspect ratio in the stream.
  11702. </p>
  11703. <p>The following fixed values are supported:
  11704. </p><dl compact="compact">
  11705. <dt>&lsquo;<samp>4/3</samp>&rsquo;</dt>
  11706. <dt>&lsquo;<samp>16/9</samp>&rsquo;</dt>
  11707. <dt>&lsquo;<samp>221/100</samp>&rsquo;</dt>
  11708. </dl>
  11709. <p>Any other value will result in square pixels being signalled instead
  11710. (see H.262 section 6.3.3 and table 6-3).
  11711. </p>
  11712. </dd>
  11713. <dt>&lsquo;<samp>frame_rate</samp>&rsquo;</dt>
  11714. <dd><p>Set the frame rate in the stream. This is constructed from a table
  11715. of known values combined with a small multiplier and divisor - if
  11716. the supplied value is not exactly representable, the nearest
  11717. representable value will be used instead (see H.262 section 6.3.3
  11718. and table 6-4).
  11719. </p>
  11720. </dd>
  11721. <dt>&lsquo;<samp>video_format</samp>&rsquo;</dt>
  11722. <dd><p>Set the video format in the stream (see H.262 section 6.3.6 and
  11723. table 6-6).
  11724. </p>
  11725. </dd>
  11726. <dt>&lsquo;<samp>colour_primaries</samp>&rsquo;</dt>
  11727. <dt>&lsquo;<samp>transfer_characteristics</samp>&rsquo;</dt>
  11728. <dt>&lsquo;<samp>matrix_coefficients</samp>&rsquo;</dt>
  11729. <dd><p>Set the colour description in the stream (see H.262 section 6.3.6
  11730. and tables 6-7, 6-8 and 6-9).
  11731. </p>
  11732. </dd>
  11733. </dl>
  11734. <a name="mpeg4_005funpack_005fbframes"></a>
  11735. <h2 class="section"><a href="ffmpeg-all.html#toc-mpeg4_005funpack_005fbframes">18.21 mpeg4_unpack_bframes</a></h2>
  11736. <p>Unpack DivX-style packed B-frames.
  11737. </p>
  11738. <p>DivX-style packed B-frames are not valid MPEG-4 and were only a
  11739. workaround for the broken Video for Windows subsystem.
  11740. They use more space, can cause minor AV sync issues, require more
  11741. CPU power to decode (unless the player has some decoded picture queue
  11742. to compensate the 2,0,2,0 frame per packet style) and cause
  11743. trouble if copied into a standard container like mp4 or mpeg-ps/ts,
  11744. because MPEG-4 decoders may not be able to decode them, since they are
  11745. not valid MPEG-4.
  11746. </p>
  11747. <p>For example to fix an AVI file containing an MPEG-4 stream with
  11748. DivX-style packed B-frames using <code>ffmpeg</code>, you can use the command:
  11749. </p>
  11750. <div class="example">
  11751. <pre class="example">ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
  11752. </pre></div>
  11753. <a name="noise-1"></a>
  11754. <h2 class="section"><a href="ffmpeg-all.html#toc-noise-1">18.22 noise</a></h2>
  11755. <p>Damages the contents of packets or simply drops them without damaging the
  11756. container. Can be used for fuzzing or testing error resilience/concealment.
  11757. </p>
  11758. <p>Parameters:
  11759. </p><dl compact="compact">
  11760. <dt>&lsquo;<samp>amount</samp>&rsquo;</dt>
  11761. <dd><p>A numeral string, whose value is related to how often output bytes will
  11762. be modified. Therefore, values below or equal to 0 are forbidden, and
  11763. the lower the more frequent bytes will be modified, with 1 meaning
  11764. every byte is modified.
  11765. </p></dd>
  11766. <dt>&lsquo;<samp>dropamount</samp>&rsquo;</dt>
  11767. <dd><p>A numeral string, whose value is related to how often packets will be dropped.
  11768. Therefore, values below or equal to 0 are forbidden, and the lower the more
  11769. frequent packets will be dropped, with 1 meaning every packet is dropped.
  11770. </p></dd>
  11771. </dl>
  11772. <p>The following example applies the modification to every byte but does not drop
  11773. any packets.
  11774. </p><div class="example">
  11775. <pre class="example">ffmpeg -i INPUT -c copy -bsf noise[=1] output.mkv
  11776. </pre></div>
  11777. <a name="null-2"></a>
  11778. <h2 class="section"><a href="ffmpeg-all.html#toc-null-2">18.23 null</a></h2>
  11779. <p>This bitstream filter passes the packets through unchanged.
  11780. </p>
  11781. <a name="pcm_005frechunk"></a>
  11782. <h2 class="section"><a href="ffmpeg-all.html#toc-pcm_005frechunk">18.24 pcm_rechunk</a></h2>
  11783. <p>Repacketize PCM audio to a fixed number of samples per packet or a fixed packet
  11784. rate per second. This is similar to the <a href="ffmpeg-filters.html#asetnsamples">(ffmpeg-filters)asetnsamples audio filter</a> but works on audio packets instead of audio frames.
  11785. </p>
  11786. <dl compact="compact">
  11787. <dt>&lsquo;<samp>nb_out_samples, n</samp>&rsquo;</dt>
  11788. <dd><p>Set the number of samples per each output audio packet. The number is intended
  11789. as the number of samples <em>per each channel</em>. Default value is 1024.
  11790. </p>
  11791. </dd>
  11792. <dt>&lsquo;<samp>pad, p</samp>&rsquo;</dt>
  11793. <dd><p>If set to 1, the filter will pad the last audio packet with silence, so that it
  11794. will contain the same number of samples (or roughly the same number of samples,
  11795. see &lsquo;<samp>frame_rate</samp>&rsquo;) as the previous ones. Default value is 1.
  11796. </p>
  11797. </dd>
  11798. <dt>&lsquo;<samp>frame_rate, r</samp>&rsquo;</dt>
  11799. <dd><p>This option makes the filter output a fixed number of packets per second instead
  11800. of a fixed number of samples per packet. If the audio sample rate is not
  11801. divisible by the frame rate then the number of samples will not be constant but
  11802. will vary slightly so that each packet will start as close to the frame
  11803. boundary as possible. Using this option has precedence over &lsquo;<samp>nb_out_samples</samp>&rsquo;.
  11804. </p></dd>
  11805. </dl>
  11806. <p>You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio
  11807. for NTSC frame rate using the &lsquo;<samp>frame_rate</samp>&rsquo; option.
  11808. </p><div class="example">
  11809. <pre class="example">ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc -
  11810. </pre></div>
  11811. <a name="prores_005fmetadata"></a>
  11812. <h2 class="section"><a href="ffmpeg-all.html#toc-prores_005fmetadata">18.25 prores_metadata</a></h2>
  11813. <p>Modify color property metadata embedded in prores stream.
  11814. </p>
  11815. <dl compact="compact">
  11816. <dt>&lsquo;<samp>color_primaries</samp>&rsquo;</dt>
  11817. <dd><p>Set the color primaries.
  11818. Available values are:
  11819. </p>
  11820. <dl compact="compact">
  11821. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  11822. <dd><p>Keep the same color primaries property (default).
  11823. </p>
  11824. </dd>
  11825. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  11826. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  11827. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  11828. <dd><p>BT601 625
  11829. </p>
  11830. </dd>
  11831. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  11832. <dd><p>BT601 525
  11833. </p>
  11834. </dd>
  11835. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  11836. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  11837. <dd><p>DCI P3
  11838. </p>
  11839. </dd>
  11840. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  11841. <dd><p>P3 D65
  11842. </p>
  11843. </dd>
  11844. </dl>
  11845. </dd>
  11846. <dt>&lsquo;<samp>transfer_characteristics</samp>&rsquo;</dt>
  11847. <dd><p>Set the color transfer.
  11848. Available values are:
  11849. </p>
  11850. <dl compact="compact">
  11851. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  11852. <dd><p>Keep the same transfer characteristics property (default).
  11853. </p>
  11854. </dd>
  11855. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  11856. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  11857. <dd><p>BT 601, BT 709, BT 2020
  11858. </p></dd>
  11859. <dt>&lsquo;<samp>smpte2084</samp>&rsquo;</dt>
  11860. <dd><p>SMPTE ST 2084
  11861. </p></dd>
  11862. <dt>&lsquo;<samp>arib-std-b67</samp>&rsquo;</dt>
  11863. <dd><p>ARIB STD-B67
  11864. </p></dd>
  11865. </dl>
  11866. </dd>
  11867. <dt>&lsquo;<samp>matrix_coefficients</samp>&rsquo;</dt>
  11868. <dd><p>Set the matrix coefficient.
  11869. Available values are:
  11870. </p>
  11871. <dl compact="compact">
  11872. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  11873. <dd><p>Keep the same colorspace property (default).
  11874. </p>
  11875. </dd>
  11876. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  11877. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  11878. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  11879. <dd><p>BT 601
  11880. </p>
  11881. </dd>
  11882. <dt>&lsquo;<samp>bt2020nc</samp>&rsquo;</dt>
  11883. </dl>
  11884. </dd>
  11885. </dl>
  11886. <p>Set Rec709 colorspace for each frame of the file
  11887. </p><div class="example">
  11888. <pre class="example">ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
  11889. </pre></div>
  11890. <p>Set Hybrid Log-Gamma parameters for each frame of the file
  11891. </p><div class="example">
  11892. <pre class="example">ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt2020:color_trc=arib-std-b67:colorspace=bt2020nc output.mov
  11893. </pre></div>
  11894. <a name="remove_005fextra"></a>
  11895. <h2 class="section"><a href="ffmpeg-all.html#toc-remove_005fextra">18.26 remove_extra</a></h2>
  11896. <p>Remove extradata from packets.
  11897. </p>
  11898. <p>It accepts the following parameter:
  11899. </p><dl compact="compact">
  11900. <dt>&lsquo;<samp>freq</samp>&rsquo;</dt>
  11901. <dd><p>Set which frame types to remove extradata from.
  11902. </p>
  11903. <dl compact="compact">
  11904. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  11905. <dd><p>Remove extradata from non-keyframes only.
  11906. </p>
  11907. </dd>
  11908. <dt>&lsquo;<samp>keyframe</samp>&rsquo;</dt>
  11909. <dd><p>Remove extradata from keyframes only.
  11910. </p>
  11911. </dd>
  11912. <dt>&lsquo;<samp>e, all</samp>&rsquo;</dt>
  11913. <dd><p>Remove extradata from all frames.
  11914. </p>
  11915. </dd>
  11916. </dl>
  11917. </dd>
  11918. </dl>
  11919. <p><a name="text2movsub"></a>
  11920. </p><a name="text2movsub-1"></a>
  11921. <h2 class="section"><a href="ffmpeg-all.html#toc-text2movsub-1">18.27 text2movsub</a></h2>
  11922. <p>Convert text subtitles to MOV subtitles (as used by the <code>mov_text</code>
  11923. codec) with metadata headers.
  11924. </p>
  11925. <p>See also the <a href="#mov2textsub">mov2textsub</a> filter.
  11926. </p>
  11927. <a name="trace_005fheaders"></a>
  11928. <h2 class="section"><a href="ffmpeg-all.html#toc-trace_005fheaders">18.28 trace_headers</a></h2>
  11929. <p>Log trace output containing all syntax elements in the coded stream
  11930. headers (everything above the level of individual coded blocks).
  11931. This can be useful for debugging low-level stream issues.
  11932. </p>
  11933. <p>Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending
  11934. on the build only a subset of these may be available.
  11935. </p>
  11936. <a name="truehd_005fcore"></a>
  11937. <h2 class="section"><a href="ffmpeg-all.html#toc-truehd_005fcore">18.29 truehd_core</a></h2>
  11938. <p>Extract the core from a TrueHD stream, dropping ATMOS data.
  11939. </p>
  11940. <a name="vp9_005fmetadata"></a>
  11941. <h2 class="section"><a href="ffmpeg-all.html#toc-vp9_005fmetadata">18.30 vp9_metadata</a></h2>
  11942. <p>Modify metadata embedded in a VP9 stream.
  11943. </p>
  11944. <dl compact="compact">
  11945. <dt>&lsquo;<samp>color_space</samp>&rsquo;</dt>
  11946. <dd><p>Set the color space value in the frame header. Note that any frame
  11947. set to RGB will be implicitly set to PC range and that RGB is
  11948. incompatible with profiles 0 and 2.
  11949. </p><dl compact="compact">
  11950. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  11951. <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
  11952. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  11953. <dt>&lsquo;<samp>smpte170</samp>&rsquo;</dt>
  11954. <dt>&lsquo;<samp>smpte240</samp>&rsquo;</dt>
  11955. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  11956. <dt>&lsquo;<samp>rgb</samp>&rsquo;</dt>
  11957. </dl>
  11958. </dd>
  11959. <dt>&lsquo;<samp>color_range</samp>&rsquo;</dt>
  11960. <dd><p>Set the color range value in the frame header. Note that any value
  11961. imposed by the color space will take precedence over this value.
  11962. </p><dl compact="compact">
  11963. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  11964. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  11965. </dl>
  11966. </dd>
  11967. </dl>
  11968. <a name="vp9_005fsuperframe"></a>
  11969. <h2 class="section"><a href="ffmpeg-all.html#toc-vp9_005fsuperframe">18.31 vp9_superframe</a></h2>
  11970. <p>Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This
  11971. fixes merging of split/segmented VP9 streams where the alt-ref frame
  11972. was split from its visible counterpart.
  11973. </p>
  11974. <a name="vp9_005fsuperframe_005fsplit"></a>
  11975. <h2 class="section"><a href="ffmpeg-all.html#toc-vp9_005fsuperframe_005fsplit">18.32 vp9_superframe_split</a></h2>
  11976. <p>Split VP9 superframes into single frames.
  11977. </p>
  11978. <a name="vp9_005fraw_005freorder"></a>
  11979. <h2 class="section"><a href="ffmpeg-all.html#toc-vp9_005fraw_005freorder">18.33 vp9_raw_reorder</a></h2>
  11980. <p>Given a VP9 stream with correct timestamps but possibly out of order,
  11981. insert additional show-existing-frame packets to correct the ordering.
  11982. </p>
  11983. <a name="Format-Options"></a>
  11984. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Format-Options">19 Format Options</a></h1>
  11985. <p>The libavformat library provides some generic global options, which
  11986. can be set on all the muxers and demuxers. In addition each muxer or
  11987. demuxer may support so-called private options, which are specific for
  11988. that component.
  11989. </p>
  11990. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  11991. FFmpeg tools, or by setting the value explicitly in the
  11992. <code>AVFormatContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
  11993. for programmatic use.
  11994. </p>
  11995. <p>The list of supported options follows:
  11996. </p>
  11997. <dl compact="compact">
  11998. <dt>&lsquo;<samp>avioflags <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  11999. <dd><p>Possible values:
  12000. </p><dl compact="compact">
  12001. <dt>&lsquo;<samp>direct</samp>&rsquo;</dt>
  12002. <dd><p>Reduce buffering.
  12003. </p></dd>
  12004. </dl>
  12005. </dd>
  12006. <dt>&lsquo;<samp>probesize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  12007. <dd><p>Set probing size in bytes, i.e. the size of the data to analyze to get
  12008. stream information. A higher value will enable detecting more
  12009. information in case it is dispersed into the stream, but will increase
  12010. latency. Must be an integer not lesser than 32. It is 5000000 by default.
  12011. </p>
  12012. </dd>
  12013. <dt>&lsquo;<samp>max_probe_packets <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  12014. <dd><p>Set the maximum number of buffered packets when probing a codec.
  12015. Default is 2500 packets.
  12016. </p>
  12017. </dd>
  12018. <dt>&lsquo;<samp>packetsize <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  12019. <dd><p>Set packet size.
  12020. </p>
  12021. </dd>
  12022. <dt>&lsquo;<samp>fflags <var>flags</var></samp>&rsquo;</dt>
  12023. <dd><p>Set format flags. Some are implemented for a limited number of formats.
  12024. </p>
  12025. <p>Possible values for input files:
  12026. </p><dl compact="compact">
  12027. <dt>&lsquo;<samp>discardcorrupt</samp>&rsquo;</dt>
  12028. <dd><p>Discard corrupted packets.
  12029. </p></dd>
  12030. <dt>&lsquo;<samp>fastseek</samp>&rsquo;</dt>
  12031. <dd><p>Enable fast, but inaccurate seeks for some formats.
  12032. </p></dd>
  12033. <dt>&lsquo;<samp>genpts</samp>&rsquo;</dt>
  12034. <dd><p>Generate missing PTS if DTS is present.
  12035. </p></dd>
  12036. <dt>&lsquo;<samp>igndts</samp>&rsquo;</dt>
  12037. <dd><p>Ignore DTS if PTS is set. Inert when nofillin is set.
  12038. </p></dd>
  12039. <dt>&lsquo;<samp>ignidx</samp>&rsquo;</dt>
  12040. <dd><p>Ignore index.
  12041. </p></dd>
  12042. <dt>&lsquo;<samp>keepside (<em>deprecated</em>,<em>inert</em>)</samp>&rsquo;</dt>
  12043. <dt>&lsquo;<samp>nobuffer</samp>&rsquo;</dt>
  12044. <dd><p>Reduce the latency introduced by buffering during initial input streams analysis.
  12045. </p></dd>
  12046. <dt>&lsquo;<samp>nofillin</samp>&rsquo;</dt>
  12047. <dd><p>Do not fill in missing values in packet fields that can be exactly calculated.
  12048. </p></dd>
  12049. <dt>&lsquo;<samp>noparse</samp>&rsquo;</dt>
  12050. <dd><p>Disable AVParsers, this needs <code>+nofillin</code> too.
  12051. </p></dd>
  12052. <dt>&lsquo;<samp>sortdts</samp>&rsquo;</dt>
  12053. <dd><p>Try to interleave output packets by DTS. At present, available only for AVIs with an index.
  12054. </p></dd>
  12055. </dl>
  12056. <p>Possible values for output files:
  12057. </p><dl compact="compact">
  12058. <dt>&lsquo;<samp>autobsf</samp>&rsquo;</dt>
  12059. <dd><p>Automatically apply bitstream filters as required by the output format. Enabled by default.
  12060. </p></dd>
  12061. <dt>&lsquo;<samp>bitexact</samp>&rsquo;</dt>
  12062. <dd><p>Only write platform-, build- and time-independent data.
  12063. This ensures that file and data checksums are reproducible and match between
  12064. platforms. Its primary use is for regression testing.
  12065. </p></dd>
  12066. <dt>&lsquo;<samp>flush_packets</samp>&rsquo;</dt>
  12067. <dd><p>Write out packets immediately.
  12068. </p></dd>
  12069. <dt>&lsquo;<samp>latm (<em>deprecated</em>,<em>inert</em>)</samp>&rsquo;</dt>
  12070. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  12071. <dd><p>Stop muxing at the end of the shortest stream.
  12072. It may be needed to increase max_interleave_delta to avoid flushing the longer
  12073. streams before EOF.
  12074. </p></dd>
  12075. </dl>
  12076. </dd>
  12077. <dt>&lsquo;<samp>seek2any <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  12078. <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
  12079. Default is 0.
  12080. </p>
  12081. </dd>
  12082. <dt>&lsquo;<samp>analyzeduration <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  12083. <dd><p>Specify how many microseconds are analyzed to probe the input. A
  12084. higher value will enable detecting more accurate information, but will
  12085. increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
  12086. </p>
  12087. </dd>
  12088. <dt>&lsquo;<samp>cryptokey <var>hexadecimal string</var> (<em>input</em>)</samp>&rsquo;</dt>
  12089. <dd><p>Set decryption key.
  12090. </p>
  12091. </dd>
  12092. <dt>&lsquo;<samp>indexmem <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  12093. <dd><p>Set max memory used for timestamp index (per stream).
  12094. </p>
  12095. </dd>
  12096. <dt>&lsquo;<samp>rtbufsize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  12097. <dd><p>Set max memory used for buffering real-time frames.
  12098. </p>
  12099. </dd>
  12100. <dt>&lsquo;<samp>fdebug <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  12101. <dd><p>Print specific debug info.
  12102. </p>
  12103. <p>Possible values:
  12104. </p><dl compact="compact">
  12105. <dt>&lsquo;<samp>ts</samp>&rsquo;</dt>
  12106. </dl>
  12107. </dd>
  12108. <dt>&lsquo;<samp>max_delay <var>integer</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  12109. <dd><p>Set maximum muxing or demuxing delay in microseconds.
  12110. </p>
  12111. </dd>
  12112. <dt>&lsquo;<samp>fpsprobesize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  12113. <dd><p>Set number of frames used to probe fps.
  12114. </p>
  12115. </dd>
  12116. <dt>&lsquo;<samp>audio_preload <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  12117. <dd><p>Set microseconds by which audio packets should be interleaved earlier.
  12118. </p>
  12119. </dd>
  12120. <dt>&lsquo;<samp>chunk_duration <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  12121. <dd><p>Set microseconds for each chunk.
  12122. </p>
  12123. </dd>
  12124. <dt>&lsquo;<samp>chunk_size <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  12125. <dd><p>Set size in bytes for each chunk.
  12126. </p>
  12127. </dd>
  12128. <dt>&lsquo;<samp>err_detect, f_err_detect <var>flags</var> (<em>input</em>)</samp>&rsquo;</dt>
  12129. <dd><p>Set error detection flags. <code>f_err_detect</code> is deprecated and
  12130. should be used only via the <code>ffmpeg</code> tool.
  12131. </p>
  12132. <p>Possible values:
  12133. </p><dl compact="compact">
  12134. <dt>&lsquo;<samp>crccheck</samp>&rsquo;</dt>
  12135. <dd><p>Verify embedded CRCs.
  12136. </p></dd>
  12137. <dt>&lsquo;<samp>bitstream</samp>&rsquo;</dt>
  12138. <dd><p>Detect bitstream specification deviations.
  12139. </p></dd>
  12140. <dt>&lsquo;<samp>buffer</samp>&rsquo;</dt>
  12141. <dd><p>Detect improper bitstream length.
  12142. </p></dd>
  12143. <dt>&lsquo;<samp>explode</samp>&rsquo;</dt>
  12144. <dd><p>Abort decoding on minor error detection.
  12145. </p></dd>
  12146. <dt>&lsquo;<samp>careful</samp>&rsquo;</dt>
  12147. <dd><p>Consider things that violate the spec and have not been seen in the
  12148. wild as errors.
  12149. </p></dd>
  12150. <dt>&lsquo;<samp>compliant</samp>&rsquo;</dt>
  12151. <dd><p>Consider all spec non compliancies as errors.
  12152. </p></dd>
  12153. <dt>&lsquo;<samp>aggressive</samp>&rsquo;</dt>
  12154. <dd><p>Consider things that a sane encoder should not do as an error.
  12155. </p></dd>
  12156. </dl>
  12157. </dd>
  12158. <dt>&lsquo;<samp>max_interleave_delta <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  12159. <dd><p>Set maximum buffering duration for interleaving. The duration is
  12160. expressed in microseconds, and defaults to 10000000 (10 seconds).
  12161. </p>
  12162. <p>To ensure all the streams are interleaved correctly, libavformat will
  12163. wait until it has at least one packet for each stream before actually
  12164. writing any packets to the output file. When some streams are
  12165. &quot;sparse&quot; (i.e. there are large gaps between successive packets), this
  12166. can result in excessive buffering.
  12167. </p>
  12168. <p>This field specifies the maximum difference between the timestamps of the
  12169. first and the last packet in the muxing queue, above which libavformat
  12170. will output a packet regardless of whether it has queued a packet for all
  12171. the streams.
  12172. </p>
  12173. <p>If set to 0, libavformat will continue buffering packets until it has
  12174. a packet for each stream, regardless of the maximum timestamp
  12175. difference between the buffered packets.
  12176. </p>
  12177. </dd>
  12178. <dt>&lsquo;<samp>use_wallclock_as_timestamps <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  12179. <dd><p>Use wallclock as timestamps if set to 1. Default is 0.
  12180. </p>
  12181. </dd>
  12182. <dt>&lsquo;<samp>avoid_negative_ts <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  12183. <dd>
  12184. <p>Possible values:
  12185. </p><dl compact="compact">
  12186. <dt>&lsquo;<samp>make_non_negative</samp>&rsquo;</dt>
  12187. <dd><p>Shift timestamps to make them non-negative.
  12188. Also note that this affects only leading negative timestamps, and not
  12189. non-monotonic negative timestamps.
  12190. </p></dd>
  12191. <dt>&lsquo;<samp>make_zero</samp>&rsquo;</dt>
  12192. <dd><p>Shift timestamps so that the first timestamp is 0.
  12193. </p></dd>
  12194. <dt>&lsquo;<samp>auto (default)</samp>&rsquo;</dt>
  12195. <dd><p>Enables shifting when required by the target format.
  12196. </p></dd>
  12197. <dt>&lsquo;<samp>disabled</samp>&rsquo;</dt>
  12198. <dd><p>Disables shifting of timestamp.
  12199. </p></dd>
  12200. </dl>
  12201. <p>When shifting is enabled, all output timestamps are shifted by the
  12202. same amount. Audio, video, and subtitles desynching and relative
  12203. timestamp differences are preserved compared to how they would have
  12204. been without shifting.
  12205. </p>
  12206. </dd>
  12207. <dt>&lsquo;<samp>skip_initial_bytes <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  12208. <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
  12209. Default is 0.
  12210. </p>
  12211. </dd>
  12212. <dt>&lsquo;<samp>correct_ts_overflow <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  12213. <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
  12214. </p>
  12215. </dd>
  12216. <dt>&lsquo;<samp>flush_packets <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  12217. <dd><p>Flush the underlying I/O stream after each packet. Default is -1 (auto), which
  12218. means that the underlying protocol will decide, 1 enables it, and has the
  12219. effect of reducing the latency, 0 disables it and may increase IO throughput in
  12220. some cases.
  12221. </p>
  12222. </dd>
  12223. <dt>&lsquo;<samp>output_ts_offset <var>offset</var> (<em>output</em>)</samp>&rsquo;</dt>
  12224. <dd><p>Set the output time offset.
  12225. </p>
  12226. <p><var>offset</var> must be a time duration specification,
  12227. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  12228. </p>
  12229. <p>The offset is added by the muxer to the output timestamps.
  12230. </p>
  12231. <p>Specifying a positive offset means that the corresponding streams are
  12232. delayed bt the time duration specified in <var>offset</var>. Default value
  12233. is <code>0</code> (meaning that no offset is applied).
  12234. </p>
  12235. </dd>
  12236. <dt>&lsquo;<samp>format_whitelist <var>list</var> (<em>input</em>)</samp>&rsquo;</dt>
  12237. <dd><p>&quot;,&quot; separated list of allowed demuxers. By default all are allowed.
  12238. </p>
  12239. </dd>
  12240. <dt>&lsquo;<samp>dump_separator <var>string</var> (<em>input</em>)</samp>&rsquo;</dt>
  12241. <dd><p>Separator used to separate the fields printed on the command line about the
  12242. Stream parameters.
  12243. For example, to separate the fields with newlines and indentation:
  12244. </p><div class="example">
  12245. <pre class="example">ffprobe -dump_separator &quot;
  12246. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  12247. </pre></div>
  12248. </dd>
  12249. <dt>&lsquo;<samp>max_streams <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  12250. <dd><p>Specifies the maximum number of streams. This can be used to reject files that
  12251. would require too many resources due to a large number of streams.
  12252. </p>
  12253. </dd>
  12254. <dt>&lsquo;<samp>skip_estimate_duration_from_pts <var>bool</var> (<em>input</em>)</samp>&rsquo;</dt>
  12255. <dd><p>Skip estimation of input duration when calculated using PTS.
  12256. At present, applicable for MPEG-PS and MPEG-TS.
  12257. </p>
  12258. </dd>
  12259. <dt>&lsquo;<samp>strict, f_strict <var>integer</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  12260. <dd><p>Specify how strictly to follow the standards. <code>f_strict</code> is deprecated and
  12261. should be used only via the <code>ffmpeg</code> tool.
  12262. </p>
  12263. <p>Possible values:
  12264. </p><dl compact="compact">
  12265. <dt>&lsquo;<samp>very</samp>&rsquo;</dt>
  12266. <dd><p>strictly conform to an older more strict version of the spec or reference software
  12267. </p></dd>
  12268. <dt>&lsquo;<samp>strict</samp>&rsquo;</dt>
  12269. <dd><p>strictly conform to all the things in the spec no matter what consequences
  12270. </p></dd>
  12271. <dt>&lsquo;<samp>normal</samp>&rsquo;</dt>
  12272. <dt>&lsquo;<samp>unofficial</samp>&rsquo;</dt>
  12273. <dd><p>allow unofficial extensions
  12274. </p></dd>
  12275. <dt>&lsquo;<samp>experimental</samp>&rsquo;</dt>
  12276. <dd><p>allow non standardized experimental things, experimental
  12277. (unfinished/work in progress/not well tested) decoders and encoders.
  12278. Note: experimental decoders can pose a security risk, do not use this for
  12279. decoding untrusted input.
  12280. </p></dd>
  12281. </dl>
  12282. </dd>
  12283. </dl>
  12284. <p><a name="Format-stream-specifiers"></a>
  12285. </p><a name="Format-stream-specifiers-1"></a>
  12286. <h2 class="section"><a href="ffmpeg-all.html#toc-Format-stream-specifiers-1">19.1 Format stream specifiers</a></h2>
  12287. <p>Format stream specifiers allow selection of one or more streams that
  12288. match specific properties.
  12289. </p>
  12290. <p>The exact semantics of stream specifiers is defined by the
  12291. <code>avformat_match_stream_specifier()</code> function declared in the
  12292. &lsquo;<tt>libavformat/avformat.h</tt>&rsquo; header and documented in the
  12293. <a href="ffmpeg.html#Stream-specifiers">(ffmpeg)Stream specifiers section in the ffmpeg(1) manual</a>.
  12294. </p>
  12295. <a name="Demuxers"></a>
  12296. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Demuxers">20 Demuxers</a></h1>
  12297. <p>Demuxers are configured elements in FFmpeg that can read the
  12298. multimedia streams from a particular type of file.
  12299. </p>
  12300. <p>When you configure your FFmpeg build, all the supported demuxers
  12301. are enabled by default. You can list all available ones using the
  12302. configure option <code>--list-demuxers</code>.
  12303. </p>
  12304. <p>You can disable all the demuxers using the configure option
  12305. <code>--disable-demuxers</code>, and selectively enable a single demuxer with
  12306. the option <code>--enable-demuxer=<var>DEMUXER</var></code>, or disable it
  12307. with the option <code>--disable-demuxer=<var>DEMUXER</var></code>.
  12308. </p>
  12309. <p>The option <code>-demuxers</code> of the ff* tools will display the list of
  12310. enabled demuxers. Use <code>-formats</code> to view a combined list of
  12311. enabled demuxers and muxers.
  12312. </p>
  12313. <p>The description of some of the currently available demuxers follows.
  12314. </p>
  12315. <a name="aa"></a>
  12316. <h2 class="section"><a href="ffmpeg-all.html#toc-aa">20.1 aa</a></h2>
  12317. <p>Audible Format 2, 3, and 4 demuxer.
  12318. </p>
  12319. <p>This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
  12320. </p>
  12321. <a name="apng"></a>
  12322. <h2 class="section"><a href="ffmpeg-all.html#toc-apng">20.2 apng</a></h2>
  12323. <p>Animated Portable Network Graphics demuxer.
  12324. </p>
  12325. <p>This demuxer is used to demux APNG files.
  12326. All headers, but the PNG signature, up to (but not including) the first
  12327. fcTL chunk are transmitted as extradata.
  12328. Frames are then split as being all the chunks between two fcTL ones, or
  12329. between the last fcTL and IEND chunks.
  12330. </p>
  12331. <dl compact="compact">
  12332. <dt>&lsquo;<samp>-ignore_loop <var>bool</var></samp>&rsquo;</dt>
  12333. <dd><p>Ignore the loop variable in the file if set.
  12334. </p></dd>
  12335. <dt>&lsquo;<samp>-max_fps <var>int</var></samp>&rsquo;</dt>
  12336. <dd><p>Maximum framerate in frames per second (0 for no limit).
  12337. </p></dd>
  12338. <dt>&lsquo;<samp>-default_fps <var>int</var></samp>&rsquo;</dt>
  12339. <dd><p>Default framerate in frames per second when none is specified in the file
  12340. (0 meaning as fast as possible).
  12341. </p></dd>
  12342. </dl>
  12343. <a name="asf-2"></a>
  12344. <h2 class="section"><a href="ffmpeg-all.html#toc-asf-2">20.3 asf</a></h2>
  12345. <p>Advanced Systems Format demuxer.
  12346. </p>
  12347. <p>This demuxer is used to demux ASF files and MMS network streams.
  12348. </p>
  12349. <dl compact="compact">
  12350. <dt>&lsquo;<samp>-no_resync_search <var>bool</var></samp>&rsquo;</dt>
  12351. <dd><p>Do not try to resynchronize by looking for a certain optional start code.
  12352. </p></dd>
  12353. </dl>
  12354. <p><a name="concat"></a>
  12355. </p><a name="concat-3"></a>
  12356. <h2 class="section"><a href="ffmpeg-all.html#toc-concat-3">20.4 concat</a></h2>
  12357. <p>Virtual concatenation script demuxer.
  12358. </p>
  12359. <p>This demuxer reads a list of files and other directives from a text file and
  12360. demuxes them one after the other, as if all their packets had been muxed
  12361. together.
  12362. </p>
  12363. <p>The timestamps in the files are adjusted so that the first file starts at 0
  12364. and each next file starts where the previous one finishes. Note that it is
  12365. done globally and may cause gaps if all streams do not have exactly the same
  12366. length.
  12367. </p>
  12368. <p>All files must have the same streams (same codecs, same time base, etc.).
  12369. </p>
  12370. <p>The duration of each file is used to adjust the timestamps of the next file:
  12371. if the duration is incorrect (because it was computed using the bit-rate or
  12372. because the file is truncated, for example), it can cause artifacts. The
  12373. <code>duration</code> directive can be used to override the duration stored in
  12374. each file.
  12375. </p>
  12376. <a name="Syntax-1"></a>
  12377. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Syntax-1">20.4.1 Syntax</a></h3>
  12378. <p>The script is a text file in extended-ASCII, with one directive per line.
  12379. Empty lines, leading spaces and lines starting with &rsquo;#&rsquo; are ignored. The
  12380. following directive is recognized:
  12381. </p>
  12382. <dl compact="compact">
  12383. <dt>&lsquo;<samp><code>file <var>path</var></code></samp>&rsquo;</dt>
  12384. <dd><p>Path to a file to read; special characters and spaces must be escaped with
  12385. backslash or single quotes.
  12386. </p>
  12387. <p>All subsequent file-related directives apply to that file.
  12388. </p>
  12389. </dd>
  12390. <dt>&lsquo;<samp><code>ffconcat version 1.0</code></samp>&rsquo;</dt>
  12391. <dd><p>Identify the script type and version. It also sets the &lsquo;<samp>safe</samp>&rsquo; option
  12392. to 1 if it was -1.
  12393. </p>
  12394. <p>To make FFmpeg recognize the format automatically, this directive must
  12395. appear exactly as is (no extra space or byte-order-mark) on the very first
  12396. line of the script.
  12397. </p>
  12398. </dd>
  12399. <dt>&lsquo;<samp><code>duration <var>dur</var></code></samp>&rsquo;</dt>
  12400. <dd><p>Duration of the file. This information can be specified from the file;
  12401. specifying it here may be more efficient or help if the information from the
  12402. file is not available or accurate.
  12403. </p>
  12404. <p>If the duration is set for all files, then it is possible to seek in the
  12405. whole concatenated video.
  12406. </p>
  12407. </dd>
  12408. <dt>&lsquo;<samp><code>inpoint <var>timestamp</var></code></samp>&rsquo;</dt>
  12409. <dd><p>In point of the file. When the demuxer opens the file it instantly seeks to the
  12410. specified timestamp. Seeking is done so that all streams can be presented
  12411. successfully at In point.
  12412. </p>
  12413. <p>This directive works best with intra frame codecs, because for non-intra frame
  12414. ones you will usually get extra packets before the actual In point and the
  12415. decoded content will most likely contain frames before In point too.
  12416. </p>
  12417. <p>For each file, packets before the file In point will have timestamps less than
  12418. the calculated start timestamp of the file (negative in case of the first
  12419. file), and the duration of the files (if not specified by the <code>duration</code>
  12420. directive) will be reduced based on their specified In point.
  12421. </p>
  12422. <p>Because of potential packets before the specified In point, packet timestamps
  12423. may overlap between two concatenated files.
  12424. </p>
  12425. </dd>
  12426. <dt>&lsquo;<samp><code>outpoint <var>timestamp</var></code></samp>&rsquo;</dt>
  12427. <dd><p>Out point of the file. When the demuxer reaches the specified decoding
  12428. timestamp in any of the streams, it handles it as an end of file condition and
  12429. skips the current and all the remaining packets from all streams.
  12430. </p>
  12431. <p>Out point is exclusive, which means that the demuxer will not output packets
  12432. with a decoding timestamp greater or equal to Out point.
  12433. </p>
  12434. <p>This directive works best with intra frame codecs and formats where all streams
  12435. are tightly interleaved. For non-intra frame codecs you will usually get
  12436. additional packets with presentation timestamp after Out point therefore the
  12437. decoded content will most likely contain frames after Out point too. If your
  12438. streams are not tightly interleaved you may not get all the packets from all
  12439. streams before Out point and you may only will be able to decode the earliest
  12440. stream until Out point.
  12441. </p>
  12442. <p>The duration of the files (if not specified by the <code>duration</code>
  12443. directive) will be reduced based on their specified Out point.
  12444. </p>
  12445. </dd>
  12446. <dt>&lsquo;<samp><code>file_packet_metadata <var>key=value</var></code></samp>&rsquo;</dt>
  12447. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  12448. each file packet. You can specify this directive multiple times to add multiple
  12449. metadata entries.
  12450. </p>
  12451. </dd>
  12452. <dt>&lsquo;<samp><code>stream</code></samp>&rsquo;</dt>
  12453. <dd><p>Introduce a stream in the virtual file.
  12454. All subsequent stream-related directives apply to the last introduced
  12455. stream.
  12456. Some streams properties must be set in order to allow identifying the
  12457. matching streams in the subfiles.
  12458. If no streams are defined in the script, the streams from the first file are
  12459. copied.
  12460. </p>
  12461. </dd>
  12462. <dt>&lsquo;<samp><code>exact_stream_id <var>id</var></code></samp>&rsquo;</dt>
  12463. <dd><p>Set the id of the stream.
  12464. If this directive is given, the string with the corresponding id in the
  12465. subfiles will be used.
  12466. This is especially useful for MPEG-PS (VOB) files, where the order of the
  12467. streams is not reliable.
  12468. </p>
  12469. </dd>
  12470. </dl>
  12471. <a name="Options-85"></a>
  12472. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-85">20.4.2 Options</a></h3>
  12473. <p>This demuxer accepts the following option:
  12474. </p>
  12475. <dl compact="compact">
  12476. <dt>&lsquo;<samp>safe</samp>&rsquo;</dt>
  12477. <dd><p>If set to 1, reject unsafe file paths. A file path is considered safe if it
  12478. does not contain a protocol specification and is relative and all components
  12479. only contain characters from the portable character set (letters, digits,
  12480. period, underscore and hyphen) and have no period at the beginning of a
  12481. component.
  12482. </p>
  12483. <p>If set to 0, any file name is accepted.
  12484. </p>
  12485. <p>The default is 1.
  12486. </p>
  12487. <p>-1 is equivalent to 1 if the format was automatically
  12488. probed and 0 otherwise.
  12489. </p>
  12490. </dd>
  12491. <dt>&lsquo;<samp>auto_convert</samp>&rsquo;</dt>
  12492. <dd><p>If set to 1, try to perform automatic conversions on packet data to make the
  12493. streams concatenable.
  12494. The default is 1.
  12495. </p>
  12496. <p>Currently, the only conversion is adding the h264_mp4toannexb bitstream
  12497. filter to H.264 streams in MP4 format. This is necessary in particular if
  12498. there are resolution changes.
  12499. </p>
  12500. </dd>
  12501. <dt>&lsquo;<samp>segment_time_metadata</samp>&rsquo;</dt>
  12502. <dd><p>If set to 1, every packet will contain the <var>lavf.concat.start_time</var> and the
  12503. <var>lavf.concat.duration</var> packet metadata values which are the start_time and
  12504. the duration of the respective file segments in the concatenated output
  12505. expressed in microseconds. The duration metadata is only set if it is known
  12506. based on the concat file.
  12507. The default is 0.
  12508. </p>
  12509. </dd>
  12510. </dl>
  12511. <a name="Examples-184"></a>
  12512. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-184">20.4.3 Examples</a></h3>
  12513. <ul>
  12514. <li>
  12515. Use absolute filenames and include some comments:
  12516. <div class="example">
  12517. <pre class="example"># my first filename
  12518. file /mnt/share/file-1.wav
  12519. # my second filename including whitespace
  12520. file '/mnt/share/file 2.wav'
  12521. # my third filename including whitespace plus single quote
  12522. file '/mnt/share/file 3'\''.wav'
  12523. </pre></div>
  12524. </li><li>
  12525. Allow for input format auto-probing, use safe filenames and set the duration of
  12526. the first file:
  12527. <div class="example">
  12528. <pre class="example">ffconcat version 1.0
  12529. file file-1.wav
  12530. duration 20.0
  12531. file subdir/file-2.wav
  12532. </pre></div>
  12533. </li></ul>
  12534. <a name="dash-1"></a>
  12535. <h2 class="section"><a href="ffmpeg-all.html#toc-dash-1">20.5 dash</a></h2>
  12536. <p>Dynamic Adaptive Streaming over HTTP demuxer.
  12537. </p>
  12538. <p>This demuxer presents all AVStreams found in the manifest.
  12539. By setting the discard flags on AVStreams the caller can decide
  12540. which streams to actually receive.
  12541. Each stream mirrors the <code>id</code> and <code>bandwidth</code> properties from the
  12542. <code>&lt;Representation&gt;</code> as metadata keys named &quot;id&quot; and &quot;variant_bitrate&quot; respectively.
  12543. </p>
  12544. <a name="flv_002c-live_005fflv"></a>
  12545. <h2 class="section"><a href="ffmpeg-all.html#toc-flv_002c-live_005fflv">20.6 flv, live_flv</a></h2>
  12546. <p>Adobe Flash Video Format demuxer.
  12547. </p>
  12548. <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.
  12549. </p>
  12550. <div class="example">
  12551. <pre class="example">ffmpeg -f flv -i myfile.flv ...
  12552. ffmpeg -f live_flv -i rtmp://&lt;any.server&gt;/anything/key ....
  12553. </pre></div>
  12554. <dl compact="compact">
  12555. <dt>&lsquo;<samp>-flv_metadata <var>bool</var></samp>&rsquo;</dt>
  12556. <dd><p>Allocate the streams according to the onMetaData array content.
  12557. </p>
  12558. </dd>
  12559. <dt>&lsquo;<samp>-flv_ignore_prevtag <var>bool</var></samp>&rsquo;</dt>
  12560. <dd><p>Ignore the size of previous tag value.
  12561. </p>
  12562. </dd>
  12563. <dt>&lsquo;<samp>-flv_full_metadata <var>bool</var></samp>&rsquo;</dt>
  12564. <dd><p>Output all context of the onMetadata.
  12565. </p></dd>
  12566. </dl>
  12567. <a name="gif-2"></a>
  12568. <h2 class="section"><a href="ffmpeg-all.html#toc-gif-2">20.7 gif</a></h2>
  12569. <p>Animated GIF demuxer.
  12570. </p>
  12571. <p>It accepts the following options:
  12572. </p>
  12573. <dl compact="compact">
  12574. <dt>&lsquo;<samp>min_delay</samp>&rsquo;</dt>
  12575. <dd><p>Set the minimum valid delay between frames in hundredths of seconds.
  12576. Range is 0 to 6000. Default value is 2.
  12577. </p>
  12578. </dd>
  12579. <dt>&lsquo;<samp>max_gif_delay</samp>&rsquo;</dt>
  12580. <dd><p>Set the maximum valid delay between frames in hundredth of seconds.
  12581. Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
  12582. the maximum value allowed by the specification.
  12583. </p>
  12584. </dd>
  12585. <dt>&lsquo;<samp>default_delay</samp>&rsquo;</dt>
  12586. <dd><p>Set the default delay between frames in hundredths of seconds.
  12587. Range is 0 to 6000. Default value is 10.
  12588. </p>
  12589. </dd>
  12590. <dt>&lsquo;<samp>ignore_loop</samp>&rsquo;</dt>
  12591. <dd><p>GIF files can contain information to loop a certain number of times (or
  12592. infinitely). If &lsquo;<samp>ignore_loop</samp>&rsquo; is set to 1, then the loop setting
  12593. from the input will be ignored and looping will not occur. If set to 0,
  12594. then looping will occur and will cycle the number of times according to
  12595. the GIF. Default value is 1.
  12596. </p></dd>
  12597. </dl>
  12598. <p>For example, with the overlay filter, place an infinitely looping GIF
  12599. over another video:
  12600. </p><div class="example">
  12601. <pre class="example">ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
  12602. </pre></div>
  12603. <p>Note that in the above example the shortest option for overlay filter is
  12604. used to end the output video at the length of the shortest input file,
  12605. which in this case is &lsquo;<tt>input.mp4</tt>&rsquo; as the GIF in this example loops
  12606. infinitely.
  12607. </p>
  12608. <a name="hls-1"></a>
  12609. <h2 class="section"><a href="ffmpeg-all.html#toc-hls-1">20.8 hls</a></h2>
  12610. <p>HLS demuxer
  12611. </p>
  12612. <p>Apple HTTP Live Streaming demuxer.
  12613. </p>
  12614. <p>This demuxer presents all AVStreams from all variant streams.
  12615. The id field is set to the bitrate variant index number. By setting
  12616. the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
  12617. the caller can decide which variant streams to actually receive.
  12618. The total bitrate of the variant that the stream belongs to is
  12619. available in a metadata key named &quot;variant_bitrate&quot;.
  12620. </p>
  12621. <p>It accepts the following options:
  12622. </p>
  12623. <dl compact="compact">
  12624. <dt>&lsquo;<samp>live_start_index</samp>&rsquo;</dt>
  12625. <dd><p>segment index to start live streams at (negative values are from the end).
  12626. </p>
  12627. </dd>
  12628. <dt>&lsquo;<samp>allowed_extensions</samp>&rsquo;</dt>
  12629. <dd><p>&rsquo;,&rsquo; separated list of file extensions that hls is allowed to access.
  12630. </p>
  12631. </dd>
  12632. <dt>&lsquo;<samp>max_reload</samp>&rsquo;</dt>
  12633. <dd><p>Maximum number of times a insufficient list is attempted to be reloaded.
  12634. Default value is 1000.
  12635. </p>
  12636. </dd>
  12637. <dt>&lsquo;<samp>m3u8_hold_counters</samp>&rsquo;</dt>
  12638. <dd><p>The maximum number of times to load m3u8 when it refreshes without new segments.
  12639. Default value is 1000.
  12640. </p>
  12641. </dd>
  12642. <dt>&lsquo;<samp>http_persistent</samp>&rsquo;</dt>
  12643. <dd><p>Use persistent HTTP connections. Applicable only for HTTP streams.
  12644. Enabled by default.
  12645. </p>
  12646. </dd>
  12647. <dt>&lsquo;<samp>http_multiple</samp>&rsquo;</dt>
  12648. <dd><p>Use multiple HTTP connections for downloading HTTP segments.
  12649. Enabled by default for HTTP/1.1 servers.
  12650. </p>
  12651. </dd>
  12652. <dt>&lsquo;<samp>http_seekable</samp>&rsquo;</dt>
  12653. <dd><p>Use HTTP partial requests for downloading HTTP segments.
  12654. 0 = disable, 1 = enable, -1 = auto, Default is auto.
  12655. </p></dd>
  12656. </dl>
  12657. <a name="image2-1"></a>
  12658. <h2 class="section"><a href="ffmpeg-all.html#toc-image2-1">20.9 image2</a></h2>
  12659. <p>Image file demuxer.
  12660. </p>
  12661. <p>This demuxer reads from a list of image files specified by a pattern.
  12662. The syntax and meaning of the pattern is specified by the
  12663. option <var>pattern_type</var>.
  12664. </p>
  12665. <p>The pattern may contain a suffix which is used to automatically
  12666. determine the format of the images contained in the files.
  12667. </p>
  12668. <p>The size, the pixel format, and the format of each image must be the
  12669. same for all the files in the sequence.
  12670. </p>
  12671. <p>This demuxer accepts the following options:
  12672. </p><dl compact="compact">
  12673. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  12674. <dd><p>Set the frame rate for the video stream. It defaults to 25.
  12675. </p></dd>
  12676. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  12677. <dd><p>If set to 1, loop over the input. Default value is 0.
  12678. </p></dd>
  12679. <dt>&lsquo;<samp>pattern_type</samp>&rsquo;</dt>
  12680. <dd><p>Select the pattern type used to interpret the provided filename.
  12681. </p>
  12682. <p><var>pattern_type</var> accepts one of the following values.
  12683. </p><dl compact="compact">
  12684. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  12685. <dd><p>Disable pattern matching, therefore the video will only contain the specified
  12686. image. You should use this option if you do not want to create sequences from
  12687. multiple images and your filenames may contain special pattern characters.
  12688. </p></dd>
  12689. <dt>&lsquo;<samp>sequence</samp>&rsquo;</dt>
  12690. <dd><p>Select a sequence pattern type, used to specify a sequence of files
  12691. indexed by sequential numbers.
  12692. </p>
  12693. <p>A sequence pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, which
  12694. specifies the position of the characters representing a sequential
  12695. number in each filename matched by the pattern. If the form
  12696. &quot;%d0<var>N</var>d&quot; is used, the string representing the number in each
  12697. filename is 0-padded and <var>N</var> is the total number of 0-padded
  12698. digits representing the number. The literal character &rsquo;%&rsquo; can be
  12699. specified in the pattern with the string &quot;%%&quot;.
  12700. </p>
  12701. <p>If the sequence pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
  12702. the file list specified by the pattern must contain a number
  12703. inclusively contained between <var>start_number</var> and
  12704. <var>start_number</var>+<var>start_number_range</var>-1, and all the following
  12705. numbers must be sequential.
  12706. </p>
  12707. <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
  12708. filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
  12709. &lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
  12710. sequence of filenames of the form &lsquo;<tt>i%m%g-1.jpg</tt>&rsquo;,
  12711. &lsquo;<tt>i%m%g-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>i%m%g-10.jpg</tt>&rsquo;, etc.
  12712. </p>
  12713. <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
  12714. &quot;%0<var>N</var>d&quot;, for example to convert a single image file
  12715. &lsquo;<tt>img.jpeg</tt>&rsquo; you can employ the command:
  12716. </p><div class="example">
  12717. <pre class="example">ffmpeg -i img.jpeg img.png
  12718. </pre></div>
  12719. </dd>
  12720. <dt>&lsquo;<samp>glob</samp>&rsquo;</dt>
  12721. <dd><p>Select a glob wildcard pattern type.
  12722. </p>
  12723. <p>The pattern is interpreted like a <code>glob()</code> pattern. This is only
  12724. selectable if libavformat was compiled with globbing support.
  12725. </p>
  12726. </dd>
  12727. <dt>&lsquo;<samp>glob_sequence <em>(deprecated, will be removed)</em></samp>&rsquo;</dt>
  12728. <dd><p>Select a mixed glob wildcard/sequence pattern.
  12729. </p>
  12730. <p>If your version of libavformat was compiled with globbing support, and
  12731. the provided pattern contains at least one glob meta character among
  12732. <code>%*?[]{}</code> that is preceded by an unescaped &quot;%&quot;, the pattern is
  12733. interpreted like a <code>glob()</code> pattern, otherwise it is interpreted
  12734. like a sequence pattern.
  12735. </p>
  12736. <p>All glob special characters <code>%*?[]{}</code> must be prefixed
  12737. with &quot;%&quot;. To escape a literal &quot;%&quot; you shall use &quot;%%&quot;.
  12738. </p>
  12739. <p>For example the pattern <code>foo-%*.jpeg</code> will match all the
  12740. filenames prefixed by &quot;foo-&quot; and terminating with &quot;.jpeg&quot;, and
  12741. <code>foo-%?%?%?.jpeg</code> will match all the filenames prefixed with
  12742. &quot;foo-&quot;, followed by a sequence of three characters, and terminating
  12743. with &quot;.jpeg&quot;.
  12744. </p>
  12745. <p>This pattern type is deprecated in favor of <var>glob</var> and
  12746. <var>sequence</var>.
  12747. </p></dd>
  12748. </dl>
  12749. <p>Default value is <var>glob_sequence</var>.
  12750. </p></dd>
  12751. <dt>&lsquo;<samp>pixel_format</samp>&rsquo;</dt>
  12752. <dd><p>Set the pixel format of the images to read. If not specified the pixel
  12753. format is guessed from the first image file in the sequence.
  12754. </p></dd>
  12755. <dt>&lsquo;<samp>start_number</samp>&rsquo;</dt>
  12756. <dd><p>Set the index of the file matched by the image file pattern to start
  12757. to read from. Default value is 0.
  12758. </p></dd>
  12759. <dt>&lsquo;<samp>start_number_range</samp>&rsquo;</dt>
  12760. <dd><p>Set the index interval range to check when looking for the first image
  12761. file in the sequence, starting from <var>start_number</var>. Default value
  12762. is 5.
  12763. </p></dd>
  12764. <dt>&lsquo;<samp>ts_from_file</samp>&rsquo;</dt>
  12765. <dd><p>If set to 1, will set frame timestamp to modification time of image file. Note
  12766. that monotonity of timestamps is not provided: images go in the same order as
  12767. without this option. Default value is 0.
  12768. If set to 2, will set frame timestamp to the modification time of the image file in
  12769. nanosecond precision.
  12770. </p></dd>
  12771. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  12772. <dd><p>Set the video size of the images to read. If not specified the video
  12773. size is guessed from the first image file in the sequence.
  12774. </p></dd>
  12775. <dt>&lsquo;<samp>export_path_metadata</samp>&rsquo;</dt>
  12776. <dd><p>If set to 1, will add two extra fields to the metadata found in input, making them
  12777. also available for other filters (see <var>drawtext</var> filter for examples). Default
  12778. value is 0. The extra fields are described below:
  12779. </p><dl compact="compact">
  12780. <dt>&lsquo;<samp>lavf.image2dec.source_path</samp>&rsquo;</dt>
  12781. <dd><p>Corresponds to the full path to the input file being read.
  12782. </p></dd>
  12783. <dt>&lsquo;<samp>lavf.image2dec.source_basename</samp>&rsquo;</dt>
  12784. <dd><p>Corresponds to the name of the file being read.
  12785. </p></dd>
  12786. </dl>
  12787. </dd>
  12788. </dl>
  12789. <a name="Examples-105"></a>
  12790. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-105">20.9.1 Examples</a></h3>
  12791. <ul>
  12792. <li>
  12793. Use <code>ffmpeg</code> for creating a video from the images in the file
  12794. sequence &lsquo;<tt>img-001.jpeg</tt>&rsquo;, &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ..., assuming an
  12795. input frame rate of 10 frames per second:
  12796. <div class="example">
  12797. <pre class="example">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
  12798. </pre></div>
  12799. </li><li>
  12800. As above, but start by reading from a file with index 100 in the sequence:
  12801. <div class="example">
  12802. <pre class="example">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
  12803. </pre></div>
  12804. </li><li>
  12805. Read images matching the &quot;*.png&quot; glob pattern , that is all the files
  12806. terminating with the &quot;.png&quot; suffix:
  12807. <div class="example">
  12808. <pre class="example">ffmpeg -framerate 10 -pattern_type glob -i &quot;*.png&quot; out.mkv
  12809. </pre></div>
  12810. </li></ul>
  12811. <a name="libgme"></a>
  12812. <h2 class="section"><a href="ffmpeg-all.html#toc-libgme">20.10 libgme</a></h2>
  12813. <p>The Game Music Emu library is a collection of video game music file emulators.
  12814. </p>
  12815. <p>See <a href="https://bitbucket.org/mpyne/game-music-emu/overview">https://bitbucket.org/mpyne/game-music-emu/overview</a> for more information.
  12816. </p>
  12817. <p>It accepts the following options:
  12818. </p>
  12819. <dl compact="compact">
  12820. <dt>&lsquo;<samp>track_index</samp>&rsquo;</dt>
  12821. <dd><p>Set the index of which track to demux. The demuxer can only export one track.
  12822. Track indexes start at 0. Default is to pick the first track. Number of tracks
  12823. is exported as <var>tracks</var> metadata entry.
  12824. </p>
  12825. </dd>
  12826. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  12827. <dd><p>Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100.
  12828. </p>
  12829. </dd>
  12830. <dt>&lsquo;<samp>max_size <em>(bytes)</em></samp>&rsquo;</dt>
  12831. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  12832. which in turn, acts as a ceiling for the size of files that can be read.
  12833. Default is 50 MiB.
  12834. </p>
  12835. </dd>
  12836. </dl>
  12837. <a name="libmodplug"></a>
  12838. <h2 class="section"><a href="ffmpeg-all.html#toc-libmodplug">20.11 libmodplug</a></h2>
  12839. <p>ModPlug based module demuxer
  12840. </p>
  12841. <p>See <a href="https://github.com/Konstanty/libmodplug">https://github.com/Konstanty/libmodplug</a>
  12842. </p>
  12843. <p>It will export one 2-channel 16-bit 44.1 kHz audio stream.
  12844. Optionally, a <code>pal8</code> 16-color video stream can be exported with or without printed metadata.
  12845. </p>
  12846. <p>It accepts the following options:
  12847. </p>
  12848. <dl compact="compact">
  12849. <dt>&lsquo;<samp>noise_reduction</samp>&rsquo;</dt>
  12850. <dd><p>Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0.
  12851. </p>
  12852. </dd>
  12853. <dt>&lsquo;<samp>reverb_depth</samp>&rsquo;</dt>
  12854. <dd><p>Set amount of reverb. Range 0-100. Default is 0.
  12855. </p>
  12856. </dd>
  12857. <dt>&lsquo;<samp>reverb_delay</samp>&rsquo;</dt>
  12858. <dd><p>Set delay in ms, clamped to 40-250 ms. Default is 0.
  12859. </p>
  12860. </dd>
  12861. <dt>&lsquo;<samp>bass_amount</samp>&rsquo;</dt>
  12862. <dd><p>Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0.
  12863. </p>
  12864. </dd>
  12865. <dt>&lsquo;<samp>bass_range</samp>&rsquo;</dt>
  12866. <dd><p>Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100 Hz. Default is 0.
  12867. </p>
  12868. </dd>
  12869. <dt>&lsquo;<samp>surround_depth</samp>&rsquo;</dt>
  12870. <dd><p>Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0.
  12871. </p>
  12872. </dd>
  12873. <dt>&lsquo;<samp>surround_delay</samp>&rsquo;</dt>
  12874. <dd><p>Set surround delay in ms, clamped to 5-40 ms. Default is 0.
  12875. </p>
  12876. </dd>
  12877. <dt>&lsquo;<samp>max_size</samp>&rsquo;</dt>
  12878. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  12879. which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB.
  12880. 0 removes buffer size limit (not recommended). Default is 5 MiB.
  12881. </p>
  12882. </dd>
  12883. <dt>&lsquo;<samp>video_stream_expr</samp>&rsquo;</dt>
  12884. <dd><p>String which is evaluated using the eval API to assign colors to the generated video stream.
  12885. Variables which can be used are <code>x</code>, <code>y</code>, <code>w</code>, <code>h</code>, <code>t</code>, <code>speed</code>,
  12886. <code>tempo</code>, <code>order</code>, <code>pattern</code> and <code>row</code>.
  12887. </p>
  12888. </dd>
  12889. <dt>&lsquo;<samp>video_stream</samp>&rsquo;</dt>
  12890. <dd><p>Generate video stream. Can be 1 (on) or 0 (off). Default is 0.
  12891. </p>
  12892. </dd>
  12893. <dt>&lsquo;<samp>video_stream_w</samp>&rsquo;</dt>
  12894. <dd><p>Set video frame width in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  12895. </p>
  12896. </dd>
  12897. <dt>&lsquo;<samp>video_stream_h</samp>&rsquo;</dt>
  12898. <dd><p>Set video frame height in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  12899. </p>
  12900. </dd>
  12901. <dt>&lsquo;<samp>video_stream_ptxt</samp>&rsquo;</dt>
  12902. <dd><p>Print metadata on video stream. Includes <code>speed</code>, <code>tempo</code>, <code>order</code>, <code>pattern</code>,
  12903. <code>row</code> and <code>ts</code> (time in ms). Can be 1 (on) or 0 (off). Default is 1.
  12904. </p>
  12905. </dd>
  12906. </dl>
  12907. <a name="libopenmpt"></a>
  12908. <h2 class="section"><a href="ffmpeg-all.html#toc-libopenmpt">20.12 libopenmpt</a></h2>
  12909. <p>libopenmpt based module demuxer
  12910. </p>
  12911. <p>See <a href="https://lib.openmpt.org/libopenmpt/">https://lib.openmpt.org/libopenmpt/</a> for more information.
  12912. </p>
  12913. <p>Some files have multiple subsongs (tracks) this can be set with the &lsquo;<samp>subsong</samp>&rsquo;
  12914. option.
  12915. </p>
  12916. <p>It accepts the following options:
  12917. </p>
  12918. <dl compact="compact">
  12919. <dt>&lsquo;<samp>subsong</samp>&rsquo;</dt>
  12920. <dd><p>Set the subsong index. This can be either &rsquo;all&rsquo;, &rsquo;auto&rsquo;, or the index of the
  12921. subsong. Subsong indexes start at 0. The default is &rsquo;auto&rsquo;.
  12922. </p>
  12923. <p>The default value is to let libopenmpt choose.
  12924. </p>
  12925. </dd>
  12926. <dt>&lsquo;<samp>layout</samp>&rsquo;</dt>
  12927. <dd><p>Set the channel layout. Valid values are 1, 2, and 4 channel layouts.
  12928. The default value is STEREO.
  12929. </p>
  12930. </dd>
  12931. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  12932. <dd><p>Set the sample rate for libopenmpt to output.
  12933. Range is from 1000 to INT_MAX. The value default is 48000.
  12934. </p></dd>
  12935. </dl>
  12936. <a name="mov_002fmp4_002f3gp"></a>
  12937. <h2 class="section"><a href="ffmpeg-all.html#toc-mov_002fmp4_002f3gp">20.13 mov/mp4/3gp</a></h2>
  12938. <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).
  12939. </p>
  12940. <p>Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v
  12941. </p>
  12942. <a name="Options-8"></a>
  12943. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-8">20.13.1 Options</a></h3>
  12944. <p>This demuxer accepts the following options:
  12945. </p><dl compact="compact">
  12946. <dt>&lsquo;<samp>enable_drefs</samp>&rsquo;</dt>
  12947. <dd><p>Enable loading of external tracks, disabled by default.
  12948. Enabling this can theoretically leak information in some use cases.
  12949. </p>
  12950. </dd>
  12951. <dt>&lsquo;<samp>use_absolute_path</samp>&rsquo;</dt>
  12952. <dd><p>Allows loading of external tracks via absolute paths, disabled by default.
  12953. Enabling this poses a security risk. It should only be enabled if the source
  12954. is known to be non-malicious.
  12955. </p>
  12956. </dd>
  12957. <dt>&lsquo;<samp>seek_streams_individually</samp>&rsquo;</dt>
  12958. <dd><p>When seeking, identify the closest point in each stream individually and demux packets in
  12959. that stream from identified point. This can lead to a different sequence of packets compared
  12960. to demuxing linearly from the beginning. Default is true.
  12961. </p>
  12962. </dd>
  12963. <dt>&lsquo;<samp>ignore_editlist</samp>&rsquo;</dt>
  12964. <dd><p>Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the
  12965. timeline described by the edit list. Default is false.
  12966. </p>
  12967. </dd>
  12968. <dt>&lsquo;<samp>advanced_editlist</samp>&rsquo;</dt>
  12969. <dd><p>Modify the stream index to reflect the timeline described by the edit list. <code>ignore_editlist</code>
  12970. must be set to false for this option to be effective.
  12971. If both <code>ignore_editlist</code> and this option are set to false, then only the
  12972. start of the stream index is modified to reflect initial dwell time or starting timestamp
  12973. described by the edit list. Default is true.
  12974. </p>
  12975. </dd>
  12976. <dt>&lsquo;<samp>ignore_chapters</samp>&rsquo;</dt>
  12977. <dd><p>Don&rsquo;t parse chapters. This includes GoPro &rsquo;HiLight&rsquo; tags/moments. Note that chapters are
  12978. only parsed when input is seekable. Default is false.
  12979. </p>
  12980. </dd>
  12981. <dt>&lsquo;<samp>use_mfra_for</samp>&rsquo;</dt>
  12982. <dd><p>For seekable fragmented input, set fragment&rsquo;s starting timestamp from media fragment random access box, if present.
  12983. </p>
  12984. <p>Following options are available:
  12985. </p><dl compact="compact">
  12986. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  12987. <dd><p>Auto-detect whether to set mfra timestamps as PTS or DTS <em>(default)</em>
  12988. </p>
  12989. </dd>
  12990. <dt>&lsquo;<samp>dts</samp>&rsquo;</dt>
  12991. <dd><p>Set mfra timestamps as DTS
  12992. </p>
  12993. </dd>
  12994. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  12995. <dd><p>Set mfra timestamps as PTS
  12996. </p>
  12997. </dd>
  12998. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  12999. <dd><p>Don&rsquo;t use mfra box to set timestamps
  13000. </p></dd>
  13001. </dl>
  13002. </dd>
  13003. <dt>&lsquo;<samp>export_all</samp>&rsquo;</dt>
  13004. <dd><p>Export unrecognized boxes within the <var>udta</var> box as metadata entries. The first four
  13005. characters of the box type are set as the key. Default is false.
  13006. </p>
  13007. </dd>
  13008. <dt>&lsquo;<samp>export_xmp</samp>&rsquo;</dt>
  13009. <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
  13010. if <code>export_all</code> is set and this option isn&rsquo;t, the contents of <var>XMP_</var> box are still exported
  13011. but with key <code>XMP_</code>. Default is false.
  13012. </p>
  13013. </dd>
  13014. <dt>&lsquo;<samp>activation_bytes</samp>&rsquo;</dt>
  13015. <dd><p>4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below.
  13016. </p>
  13017. </dd>
  13018. <dt>&lsquo;<samp>audible_fixed_key</samp>&rsquo;</dt>
  13019. <dd><p>Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to
  13020. specify.
  13021. </p>
  13022. </dd>
  13023. <dt>&lsquo;<samp>decryption_key</samp>&rsquo;</dt>
  13024. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  13025. </p></dd>
  13026. </dl>
  13027. <a name="Audible-AAX"></a>
  13028. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Audible-AAX">20.13.2 Audible AAX</a></h3>
  13029. <p>Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
  13030. </p><div class="example">
  13031. <pre class="example">ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
  13032. </pre></div>
  13033. <a name="mpegts-1"></a>
  13034. <h2 class="section"><a href="ffmpeg-all.html#toc-mpegts-1">20.14 mpegts</a></h2>
  13035. <p>MPEG-2 transport stream demuxer.
  13036. </p>
  13037. <p>This demuxer accepts the following options:
  13038. </p><dl compact="compact">
  13039. <dt>&lsquo;<samp>resync_size</samp>&rsquo;</dt>
  13040. <dd><p>Set size limit for looking up a new synchronization. Default value is
  13041. 65536.
  13042. </p>
  13043. </dd>
  13044. <dt>&lsquo;<samp>skip_unknown_pmt</samp>&rsquo;</dt>
  13045. <dd><p>Skip PMTs for programs not defined in the PAT. Default value is 0.
  13046. </p>
  13047. </dd>
  13048. <dt>&lsquo;<samp>fix_teletext_pts</samp>&rsquo;</dt>
  13049. <dd><p>Override teletext packet PTS and DTS values with the timestamps calculated
  13050. from the PCR of the first program which the teletext stream is part of and is
  13051. not discarded. Default value is 1, set this option to 0 if you want your
  13052. teletext packet PTS and DTS values untouched.
  13053. </p>
  13054. </dd>
  13055. <dt>&lsquo;<samp>ts_packetsize</samp>&rsquo;</dt>
  13056. <dd><p>Output option carrying the raw packet size in bytes.
  13057. Show the detected raw packet size, cannot be set by the user.
  13058. </p>
  13059. </dd>
  13060. <dt>&lsquo;<samp>scan_all_pmts</samp>&rsquo;</dt>
  13061. <dd><p>Scan and combine all PMTs. The value is an integer with value from -1
  13062. to 1 (-1 means automatic setting, 1 means enabled, 0 means
  13063. disabled). Default value is -1.
  13064. </p>
  13065. </dd>
  13066. <dt>&lsquo;<samp>merge_pmt_versions</samp>&rsquo;</dt>
  13067. <dd><p>Re-use existing streams when a PMT&rsquo;s version is updated and elementary
  13068. streams move to different PIDs. Default value is 0.
  13069. </p></dd>
  13070. </dl>
  13071. <a name="mpjpeg"></a>
  13072. <h2 class="section"><a href="ffmpeg-all.html#toc-mpjpeg">20.15 mpjpeg</a></h2>
  13073. <p>MJPEG encapsulated in multi-part MIME demuxer.
  13074. </p>
  13075. <p>This demuxer allows reading of MJPEG, where each frame is represented as a part of
  13076. multipart/x-mixed-replace stream.
  13077. </p><dl compact="compact">
  13078. <dt>&lsquo;<samp>strict_mime_boundary</samp>&rsquo;</dt>
  13079. <dd><p>Default implementation applies a relaxed standard to multi-part MIME boundary detection,
  13080. to prevent regression with numerous existing endpoints not generating a proper MIME
  13081. MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check
  13082. of the boundary value.
  13083. </p></dd>
  13084. </dl>
  13085. <a name="rawvideo-1"></a>
  13086. <h2 class="section"><a href="ffmpeg-all.html#toc-rawvideo-1">20.16 rawvideo</a></h2>
  13087. <p>Raw video demuxer.
  13088. </p>
  13089. <p>This demuxer allows one to read raw video data. Since there is no header
  13090. specifying the assumed video parameters, the user must specify them
  13091. in order to be able to decode the data correctly.
  13092. </p>
  13093. <p>This demuxer accepts the following options:
  13094. </p><dl compact="compact">
  13095. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  13096. <dd><p>Set input video frame rate. Default value is 25.
  13097. </p>
  13098. </dd>
  13099. <dt>&lsquo;<samp>pixel_format</samp>&rsquo;</dt>
  13100. <dd><p>Set the input video pixel format. Default value is <code>yuv420p</code>.
  13101. </p>
  13102. </dd>
  13103. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  13104. <dd><p>Set the input video size. This value must be specified explicitly.
  13105. </p></dd>
  13106. </dl>
  13107. <p>For example to read a rawvideo file &lsquo;<tt>input.raw</tt>&rsquo; with
  13108. <code>ffplay</code>, assuming a pixel format of <code>rgb24</code>, a video
  13109. size of <code>320x240</code>, and a frame rate of 10 images per second, use
  13110. the command:
  13111. </p><div class="example">
  13112. <pre class="example">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
  13113. </pre></div>
  13114. <a name="sbg"></a>
  13115. <h2 class="section"><a href="ffmpeg-all.html#toc-sbg">20.17 sbg</a></h2>
  13116. <p>SBaGen script demuxer.
  13117. </p>
  13118. <p>This demuxer reads the script language used by SBaGen
  13119. <a href="http://uazu.net/sbagen/">http://uazu.net/sbagen/</a> to generate binaural beats sessions. A SBG
  13120. script looks like that:
  13121. </p><div class="example">
  13122. <pre class="example">-SE
  13123. a: 300-2.5/3 440+4.5/0
  13124. b: 300-2.5/0 440+4.5/3
  13125. off: -
  13126. NOW == a
  13127. +0:07:00 == b
  13128. +0:14:00 == a
  13129. +0:21:00 == b
  13130. +0:30:00 off
  13131. </pre></div>
  13132. <p>A SBG script can mix absolute and relative timestamps. If the script uses
  13133. either only absolute timestamps (including the script start time) or only
  13134. relative ones, then its layout is fixed, and the conversion is
  13135. straightforward. On the other hand, if the script mixes both kind of
  13136. timestamps, then the <var>NOW</var> reference for relative timestamps will be
  13137. taken from the current time of day at the time the script is read, and the
  13138. script layout will be frozen according to that reference. That means that if
  13139. the script is directly played, the actual times will match the absolute
  13140. timestamps up to the sound controller&rsquo;s clock accuracy, but if the user
  13141. somehow pauses the playback or seeks, all times will be shifted accordingly.
  13142. </p>
  13143. <a name="tedcaptions"></a>
  13144. <h2 class="section"><a href="ffmpeg-all.html#toc-tedcaptions">20.18 tedcaptions</a></h2>
  13145. <p>JSON captions used for <a href="http://www.ted.com/">TED Talks</a>.
  13146. </p>
  13147. <p>TED does not provide links to the captions, but they can be guessed from the
  13148. page. The file &lsquo;<tt>tools/bookmarklets.html</tt>&rsquo; from the FFmpeg source tree
  13149. contains a bookmarklet to expose them.
  13150. </p>
  13151. <p>This demuxer accepts the following option:
  13152. </p><dl compact="compact">
  13153. <dt>&lsquo;<samp>start_time</samp>&rsquo;</dt>
  13154. <dd><p>Set the start time of the TED talk, in milliseconds. The default is 15000
  13155. (15s). It is used to sync the captions with the downloadable videos, because
  13156. they include a 15s intro.
  13157. </p></dd>
  13158. </dl>
  13159. <p>Example: convert the captions to a format most players understand:
  13160. </p><div class="example">
  13161. <pre class="example">ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
  13162. </pre></div>
  13163. <a name="vapoursynth"></a>
  13164. <h2 class="section"><a href="ffmpeg-all.html#toc-vapoursynth">20.19 vapoursynth</a></h2>
  13165. <p>Vapoursynth wrapper.
  13166. </p>
  13167. <p>Due to security concerns, Vapoursynth scripts will not
  13168. be autodetected so the input format has to be forced. For ff* CLI tools,
  13169. add <code>-f vapoursynth</code> before the input <code>-i yourscript.vpy</code>.
  13170. </p>
  13171. <p>This demuxer accepts the following option:
  13172. </p><dl compact="compact">
  13173. <dt>&lsquo;<samp>max_script_size</samp>&rsquo;</dt>
  13174. <dd><p>The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size,
  13175. which in turn, acts as a ceiling for the size of scripts that can be read.
  13176. Default is 1 MiB.
  13177. </p></dd>
  13178. </dl>
  13179. <a name="Muxers"></a>
  13180. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Muxers">21 Muxers</a></h1>
  13181. <p>Muxers are configured elements in FFmpeg which allow writing
  13182. multimedia streams to a particular type of file.
  13183. </p>
  13184. <p>When you configure your FFmpeg build, all the supported muxers
  13185. are enabled by default. You can list all available muxers using the
  13186. configure option <code>--list-muxers</code>.
  13187. </p>
  13188. <p>You can disable all the muxers with the configure option
  13189. <code>--disable-muxers</code> and selectively enable / disable single muxers
  13190. with the options <code>--enable-muxer=<var>MUXER</var></code> /
  13191. <code>--disable-muxer=<var>MUXER</var></code>.
  13192. </p>
  13193. <p>The option <code>-muxers</code> of the ff* tools will display the list of
  13194. enabled muxers. Use <code>-formats</code> to view a combined list of
  13195. enabled demuxers and muxers.
  13196. </p>
  13197. <p>A description of some of the currently available muxers follows.
  13198. </p>
  13199. <p><a name="aiff"></a>
  13200. </p><a name="aiff-1"></a>
  13201. <h2 class="section"><a href="ffmpeg-all.html#toc-aiff-1">21.1 aiff</a></h2>
  13202. <p>Audio Interchange File Format muxer.
  13203. </p>
  13204. <a name="Options-67"></a>
  13205. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-67">21.1.1 Options</a></h3>
  13206. <p>It accepts the following options:
  13207. </p>
  13208. <dl compact="compact">
  13209. <dt>&lsquo;<samp>write_id3v2</samp>&rsquo;</dt>
  13210. <dd><p>Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
  13211. </p>
  13212. </dd>
  13213. <dt>&lsquo;<samp>id3v2_version</samp>&rsquo;</dt>
  13214. <dd><p>Select ID3v2 version to write. Currently only version 3 and 4 (aka.
  13215. ID3v2.3 and ID3v2.4) are supported. The default is version 4.
  13216. </p>
  13217. </dd>
  13218. </dl>
  13219. <p><a name="asf"></a>
  13220. </p><a name="asf-1"></a>
  13221. <h2 class="section"><a href="ffmpeg-all.html#toc-asf-1">21.2 asf</a></h2>
  13222. <p>Advanced Systems Format muxer.
  13223. </p>
  13224. <p>Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this
  13225. muxer too.
  13226. </p>
  13227. <a name="Options-38"></a>
  13228. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-38">21.2.1 Options</a></h3>
  13229. <p>It accepts the following options:
  13230. </p>
  13231. <dl compact="compact">
  13232. <dt>&lsquo;<samp>packet_size</samp>&rsquo;</dt>
  13233. <dd><p>Set the muxer packet size. By tuning this setting you may reduce data
  13234. fragmentation or muxer overhead depending on your source. Default value is
  13235. 3200, minimum is 100, maximum is 64k.
  13236. </p>
  13237. </dd>
  13238. </dl>
  13239. <p><a name="avi"></a>
  13240. </p><a name="avi-1"></a>
  13241. <h2 class="section"><a href="ffmpeg-all.html#toc-avi-1">21.3 avi</a></h2>
  13242. <p>Audio Video Interleaved muxer.
  13243. </p>
  13244. <a name="Options-14"></a>
  13245. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-14">21.3.1 Options</a></h3>
  13246. <p>It accepts the following options:
  13247. </p>
  13248. <dl compact="compact">
  13249. <dt>&lsquo;<samp>reserve_index_space</samp>&rsquo;</dt>
  13250. <dd><p>Reserve the specified amount of bytes for the OpenDML master index of each
  13251. stream within the file header. By default additional master indexes are
  13252. embedded within the data packets if there is no space left in the first master
  13253. index and are linked together as a chain of indexes. This index structure can
  13254. cause problems for some use cases, e.g. third-party software strictly relying
  13255. on the OpenDML index specification or when file seeking is slow. Reserving
  13256. enough index space in the file header avoids these problems.
  13257. </p>
  13258. <p>The required index space depends on the output file size and should be about 16
  13259. bytes per gigabyte. When this option is omitted or set to zero the necessary
  13260. index space is guessed.
  13261. </p>
  13262. </dd>
  13263. <dt>&lsquo;<samp>write_channel_mask</samp>&rsquo;</dt>
  13264. <dd><p>Write the channel layout mask into the audio stream header.
  13265. </p>
  13266. <p>This option is enabled by default. Disabling the channel mask can be useful in
  13267. specific scenarios, e.g. when merging multiple audio streams into one for
  13268. compatibility with software that only supports a single audio stream in AVI
  13269. (see <a href="ffmpeg-filters.html#amerge">(ffmpeg-filters)the &quot;amerge&quot; section in the ffmpeg-filters manual</a>).
  13270. </p>
  13271. </dd>
  13272. </dl>
  13273. <p><a name="chromaprint"></a>
  13274. </p><a name="chromaprint-1"></a>
  13275. <h2 class="section"><a href="ffmpeg-all.html#toc-chromaprint-1">21.4 chromaprint</a></h2>
  13276. <p>Chromaprint fingerprinter.
  13277. </p>
  13278. <p>This muxer feeds audio data to the Chromaprint library,
  13279. which generates a fingerprint for the provided audio data. See <a href="https://acoustid.org/chromaprint">https://acoustid.org/chromaprint</a>
  13280. </p>
  13281. <p>It takes a single signed native-endian 16-bit raw audio stream of at most 2 channels.
  13282. </p>
  13283. <a name="Options-53"></a>
  13284. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-53">21.4.1 Options</a></h3>
  13285. <dl compact="compact">
  13286. <dt>&lsquo;<samp>silence_threshold</samp>&rsquo;</dt>
  13287. <dd><p>Threshold for detecting silence. Range is from -1 to 32767, where -1 disables
  13288. silence detection. Silence detection can only be used with version 3 of the
  13289. algorithm.
  13290. Silence detection must be disabled for use with the AcoustID service. Default is -1.
  13291. </p>
  13292. </dd>
  13293. <dt>&lsquo;<samp>algorithm</samp>&rsquo;</dt>
  13294. <dd><p>Version of algorithm to fingerprint with. Range is 0 to 4.
  13295. Version 3 enables silence detection. Default is 1.
  13296. </p>
  13297. </dd>
  13298. <dt>&lsquo;<samp>fp_format</samp>&rsquo;</dt>
  13299. <dd><p>Format to output the fingerprint as. Accepts the following options:
  13300. </p><dl compact="compact">
  13301. <dt>&lsquo;<samp>raw</samp>&rsquo;</dt>
  13302. <dd><p>Binary raw fingerprint
  13303. </p>
  13304. </dd>
  13305. <dt>&lsquo;<samp>compressed</samp>&rsquo;</dt>
  13306. <dd><p>Binary compressed fingerprint
  13307. </p>
  13308. </dd>
  13309. <dt>&lsquo;<samp>base64</samp>&rsquo;</dt>
  13310. <dd><p>Base64 compressed fingerprint <em>(default)</em>
  13311. </p>
  13312. </dd>
  13313. </dl>
  13314. </dd>
  13315. </dl>
  13316. <p><a name="crc"></a>
  13317. </p><a name="crc-1"></a>
  13318. <h2 class="section"><a href="ffmpeg-all.html#toc-crc-1">21.5 crc</a></h2>
  13319. <p>CRC (Cyclic Redundancy Check) testing format.
  13320. </p>
  13321. <p>This muxer computes and prints the Adler-32 CRC of all the input audio
  13322. and video frames. By default audio frames are converted to signed
  13323. 16-bit raw audio and video frames to raw video before computing the
  13324. CRC.
  13325. </p>
  13326. <p>The output of the muxer consists of a single line of the form:
  13327. CRC=0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal number 0-padded to
  13328. 8 digits containing the CRC for all the decoded input frames.
  13329. </p>
  13330. <p>See also the <a href="#framecrc">framecrc</a> muxer.
  13331. </p>
  13332. <a name="Examples-85"></a>
  13333. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-85">21.5.1 Examples</a></h3>
  13334. <p>For example to compute the CRC of the input, and store it in the file
  13335. &lsquo;<tt>out.crc</tt>&rsquo;:
  13336. </p><div class="example">
  13337. <pre class="example">ffmpeg -i INPUT -f crc out.crc
  13338. </pre></div>
  13339. <p>You can print the CRC to stdout with the command:
  13340. </p><div class="example">
  13341. <pre class="example">ffmpeg -i INPUT -f crc -
  13342. </pre></div>
  13343. <p>You can select the output format of each frame with <code>ffmpeg</code> by
  13344. specifying the audio and video codec and format. For example to
  13345. compute the CRC of the input audio converted to PCM unsigned 8-bit
  13346. and the input video converted to MPEG-2 video, use the command:
  13347. </p><div class="example">
  13348. <pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
  13349. </pre></div>
  13350. <a name="flv"></a>
  13351. <h2 class="section"><a href="ffmpeg-all.html#toc-flv">21.6 flv</a></h2>
  13352. <p>Adobe Flash Video Format muxer.
  13353. </p>
  13354. <p>This muxer accepts the following options:
  13355. </p>
  13356. <dl compact="compact">
  13357. <dt>&lsquo;<samp>flvflags <var>flags</var></samp>&rsquo;</dt>
  13358. <dd><p>Possible values:
  13359. </p>
  13360. <dl compact="compact">
  13361. <dt>&lsquo;<samp>aac_seq_header_detect</samp>&rsquo;</dt>
  13362. <dd><p>Place AAC sequence header based on audio stream data.
  13363. </p>
  13364. </dd>
  13365. <dt>&lsquo;<samp>no_sequence_end</samp>&rsquo;</dt>
  13366. <dd><p>Disable sequence end tag.
  13367. </p>
  13368. </dd>
  13369. <dt>&lsquo;<samp>no_metadata</samp>&rsquo;</dt>
  13370. <dd><p>Disable metadata tag.
  13371. </p>
  13372. </dd>
  13373. <dt>&lsquo;<samp>no_duration_filesize</samp>&rsquo;</dt>
  13374. <dd><p>Disable duration and filesize in metadata when they are equal to zero
  13375. at the end of stream. (Be used to non-seekable living stream).
  13376. </p>
  13377. </dd>
  13378. <dt>&lsquo;<samp>add_keyframe_index</samp>&rsquo;</dt>
  13379. <dd><p>Used to facilitate seeking; particularly for HTTP pseudo streaming.
  13380. </p></dd>
  13381. </dl>
  13382. </dd>
  13383. </dl>
  13384. <p><a name="dash"></a>
  13385. </p><a name="dash-2"></a>
  13386. <h2 class="section"><a href="ffmpeg-all.html#toc-dash-2">21.7 dash</a></h2>
  13387. <p>Dynamic Adaptive Streaming over HTTP (DASH) muxer that creates segments
  13388. and manifest files according to the MPEG-DASH standard ISO/IEC 23009-1:2014.
  13389. </p>
  13390. <p>For more information see:
  13391. </p>
  13392. <ul>
  13393. <li>
  13394. 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>
  13395. </li><li>
  13396. 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>
  13397. </li></ul>
  13398. <p>It creates a MPD manifest file and segment files for each stream.
  13399. </p>
  13400. <p>The segment filename might contain pre-defined identifiers used with SegmentTemplate
  13401. as defined in section 5.3.9.4.4 of the standard. Available identifiers are &quot;$RepresentationID$&quot;,
  13402. &quot;$Number$&quot;, &quot;$Bandwidth$&quot; and &quot;$Time$&quot;.
  13403. In addition to the standard identifiers, an ffmpeg-specific &quot;$ext$&quot; identifier is also supported.
  13404. When specified ffmpeg will replace $ext$ in the file name with muxing format&rsquo;s extensions such as mp4, webm etc.,
  13405. </p>
  13406. <div class="example">
  13407. <pre class="example">ffmpeg -re -i &lt;input&gt; -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \
  13408. -b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline \
  13409. -profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 \
  13410. -b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 \
  13411. -window_size 5 -adaptation_sets &quot;id=0,streams=v id=1,streams=a&quot; \
  13412. -f dash /path/to/out.mpd
  13413. </pre></div>
  13414. <dl compact="compact">
  13415. <dt>&lsquo;<samp>min_seg_duration <var>microseconds</var></samp>&rsquo;</dt>
  13416. <dd><p>This is a deprecated option to set the segment length in microseconds, use <var>seg_duration</var> instead.
  13417. </p></dd>
  13418. <dt>&lsquo;<samp>seg_duration <var>duration</var></samp>&rsquo;</dt>
  13419. <dd><p>Set the segment length in seconds (fractional value can be set). The value is
  13420. treated as average segment duration when <var>use_template</var> is enabled and
  13421. </p></dd>
  13422. <dt>&lsquo;<samp>frag_duration <var>duration</var></samp>&rsquo;</dt>
  13423. <dd><p>Set the length in seconds of fragments within segments (fractional value can be set).
  13424. </p></dd>
  13425. <dt>&lsquo;<samp>frag_type <var>type</var></samp>&rsquo;</dt>
  13426. <dd><p>Set the type of interval for fragmentation.
  13427. </p></dd>
  13428. <dt>&lsquo;<samp>window_size <var>size</var></samp>&rsquo;</dt>
  13429. <dd><p>Set the maximum number of segments kept in the manifest.
  13430. </p></dd>
  13431. <dt>&lsquo;<samp>extra_window_size <var>size</var></samp>&rsquo;</dt>
  13432. <dd><p>Set the maximum number of segments kept outside of the manifest before removing from disk.
  13433. </p></dd>
  13434. <dt>&lsquo;<samp>remove_at_exit <var>remove</var></samp>&rsquo;</dt>
  13435. <dd><p>Enable (1) or disable (0) removal of all segments when finished.
  13436. </p></dd>
  13437. <dt>&lsquo;<samp>use_template <var>template</var></samp>&rsquo;</dt>
  13438. <dd><p>Enable (1) or disable (0) use of SegmentTemplate instead of SegmentList.
  13439. </p></dd>
  13440. <dt>&lsquo;<samp>use_timeline <var>timeline</var></samp>&rsquo;</dt>
  13441. <dd><p>Enable (1) or disable (0) use of SegmentTimeline in SegmentTemplate.
  13442. </p></dd>
  13443. <dt>&lsquo;<samp>single_file <var>single_file</var></samp>&rsquo;</dt>
  13444. <dd><p>Enable (1) or disable (0) storing all segments in one file, accessed using byte ranges.
  13445. </p></dd>
  13446. <dt>&lsquo;<samp>single_file_name <var>file_name</var></samp>&rsquo;</dt>
  13447. <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.
  13448. </p></dd>
  13449. <dt>&lsquo;<samp>init_seg_name <var>init_name</var></samp>&rsquo;</dt>
  13450. <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.
  13451. </p></dd>
  13452. <dt>&lsquo;<samp>media_seg_name <var>segment_name</var></samp>&rsquo;</dt>
  13453. <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.
  13454. </p></dd>
  13455. <dt>&lsquo;<samp>utc_timing_url <var>utc_url</var></samp>&rsquo;</dt>
  13456. <dd><p>URL of the page that will return the UTC timestamp in ISO format. Example: &quot;https://time.akamai.com/?iso&quot;
  13457. </p></dd>
  13458. <dt>&lsquo;<samp>method <var>method</var></samp>&rsquo;</dt>
  13459. <dd><p>Use the given HTTP method to create output files. Generally set to PUT or POST.
  13460. </p></dd>
  13461. <dt>&lsquo;<samp>http_user_agent <var>user_agent</var></samp>&rsquo;</dt>
  13462. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP output.
  13463. </p></dd>
  13464. <dt>&lsquo;<samp>http_persistent <var>http_persistent</var></samp>&rsquo;</dt>
  13465. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  13466. </p></dd>
  13467. <dt>&lsquo;<samp>hls_playlist <var>hls_playlist</var></samp>&rsquo;</dt>
  13468. <dd><p>Generate HLS playlist files as well. The master playlist is generated with the filename master.m3u8.
  13469. One media playlist file is generated for each stream with filenames media_0.m3u8, media_1.m3u8, etc.
  13470. </p></dd>
  13471. <dt>&lsquo;<samp>streaming <var>streaming</var></samp>&rsquo;</dt>
  13472. <dd><p>Enable (1) or disable (0) chunk streaming mode of output. In chunk streaming
  13473. mode, each frame will be a moof fragment which forms a chunk.
  13474. </p></dd>
  13475. <dt>&lsquo;<samp>adaptation_sets <var>adaptation_sets</var></samp>&rsquo;</dt>
  13476. <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
  13477. of the adaptation sets and a,b,c,d and e are the indices of the mapped streams.
  13478. </p>
  13479. <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.
  13480. </p>
  13481. <p>When no assignment is defined, this defaults to an AdaptationSet for each stream.
  13482. </p>
  13483. <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,
  13484. descriptor is useful to the scheme defined by ISO/IEC 23009-1:2014/Amd.2:2015.
  13485. 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;.
  13486. Please note that descriptor string should be a self-closing xml tag.
  13487. seg_duration, frag_duration and frag_type override the global option values for each adaptation set.
  13488. 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;
  13489. type_id marks an adaptation set as containing streams meant to be used for Trick Mode for the referenced adaptation set.
  13490. 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;
  13491. </p></dd>
  13492. <dt>&lsquo;<samp>timeout <var>timeout</var></samp>&rsquo;</dt>
  13493. <dd><p>Set timeout for socket I/O operations. Applicable only for HTTP output.
  13494. </p></dd>
  13495. <dt>&lsquo;<samp>index_correction <var>index_correction</var></samp>&rsquo;</dt>
  13496. <dd><p>Enable (1) or Disable (0) segment index correction logic. Applicable only when
  13497. <var>use_template</var> is enabled and <var>use_timeline</var> is disabled.
  13498. </p>
  13499. <p>When enabled, the logic monitors the flow of segment indexes. If a streams&rsquo;s
  13500. segment index value is not at the expected real time position, then the logic
  13501. corrects that index value.
  13502. </p>
  13503. <p>Typically this logic is needed in live streaming use cases. The network bandwidth
  13504. fluctuations are common during long run streaming. Each fluctuation can cause
  13505. the segment indexes fall behind the expected real time position.
  13506. </p></dd>
  13507. <dt>&lsquo;<samp>format_options <var>options_list</var></samp>&rsquo;</dt>
  13508. <dd><p>Set container format (mp4/webm) options using a <code>:</code> separated list of
  13509. key=value parameters. Values containing <code>:</code> special characters must be
  13510. escaped.
  13511. </p>
  13512. </dd>
  13513. <dt>&lsquo;<samp>global_sidx <var>global_sidx</var></samp>&rsquo;</dt>
  13514. <dd><p>Write global SIDX atom. Applicable only for single file, mp4 output, non-streaming mode.
  13515. </p>
  13516. </dd>
  13517. <dt>&lsquo;<samp>dash_segment_type <var>dash_segment_type</var></samp>&rsquo;</dt>
  13518. <dd><p>Possible values:
  13519. </p><dl compact="compact">
  13520. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  13521. <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.
  13522. </p>
  13523. </dd>
  13524. <dt>&lsquo;<samp>mp4</samp>&rsquo;</dt>
  13525. <dd><p>If this flag is set, the dash segment files will be in in ISOBMFF format.
  13526. </p>
  13527. </dd>
  13528. <dt>&lsquo;<samp>webm</samp>&rsquo;</dt>
  13529. <dd><p>If this flag is set, the dash segment files will be in in WebM format.
  13530. </p></dd>
  13531. </dl>
  13532. </dd>
  13533. <dt>&lsquo;<samp>ignore_io_errors <var>ignore_io_errors</var></samp>&rsquo;</dt>
  13534. <dd><p>Ignore IO errors during open and write. Useful for long-duration runs with network output.
  13535. </p>
  13536. </dd>
  13537. <dt>&lsquo;<samp>lhls <var>lhls</var></samp>&rsquo;</dt>
  13538. <dd><p>Enable Low-latency HLS(LHLS). Adds #EXT-X-PREFETCH tag with current segment&rsquo;s URI.
  13539. Apple doesn&rsquo;t have an official spec for LHLS. Meanwhile hls.js player folks are
  13540. 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
  13541. This option will also try to comply with the above open spec, till Apple&rsquo;s spec officially supports it.
  13542. Applicable only when <var>streaming</var> and <var>hls_playlist</var> options are enabled.
  13543. This is an experimental feature.
  13544. </p>
  13545. </dd>
  13546. <dt>&lsquo;<samp>ldash <var>ldash</var></samp>&rsquo;</dt>
  13547. <dd><p>Enable Low-latency Dash by constraining the presence and values of some elements.
  13548. </p>
  13549. </dd>
  13550. <dt>&lsquo;<samp>master_m3u8_publish_rate <var>master_m3u8_publish_rate</var></samp>&rsquo;</dt>
  13551. <dd><p>Publish master playlist repeatedly every after specified number of segment intervals.
  13552. </p>
  13553. </dd>
  13554. <dt>&lsquo;<samp>write_prft <var>write_prft</var></samp>&rsquo;</dt>
  13555. <dd><p>Write Producer Reference Time elements on supported streams. This also enables writing
  13556. prft boxes in the underlying muxer. Applicable only when the <var>utc_url</var> option is enabled.
  13557. It&rsquo;s set to auto by default, in which case the muxer will attempt to enable it only in modes
  13558. that require it.
  13559. </p>
  13560. </dd>
  13561. <dt>&lsquo;<samp>mpd_profile <var>mpd_profile</var></samp>&rsquo;</dt>
  13562. <dd><p>Set one or more manifest profiles.
  13563. </p>
  13564. </dd>
  13565. <dt>&lsquo;<samp>http_opts <var>http_opts</var></samp>&rsquo;</dt>
  13566. <dd><p>A :-separated list of key=value options to pass to the underlying HTTP
  13567. protocol. Applicable only for HTTP output.
  13568. </p>
  13569. </dd>
  13570. <dt>&lsquo;<samp>target_latency <var>target_latency</var></samp>&rsquo;</dt>
  13571. <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.
  13572. This is an informative fields clients can use to measure the latency of the service.
  13573. </p>
  13574. </dd>
  13575. <dt>&lsquo;<samp>min_playback_rate <var>min_playback_rate</var></samp>&rsquo;</dt>
  13576. <dd><p>Set the minimum playback rate indicated as appropriate for the purposes of automatically
  13577. adjusting playback latency and buffer occupancy during normal playback by clients.
  13578. </p>
  13579. </dd>
  13580. <dt>&lsquo;<samp>max_playback_rate <var>max_playback_rate</var></samp>&rsquo;</dt>
  13581. <dd><p>Set the maximum playback rate indicated as appropriate for the purposes of automatically
  13582. adjusting playback latency and buffer occupancy during normal playback by clients.
  13583. </p>
  13584. </dd>
  13585. </dl>
  13586. <p><a name="framecrc"></a>
  13587. </p><a name="framecrc-1"></a>
  13588. <h2 class="section"><a href="ffmpeg-all.html#toc-framecrc-1">21.8 framecrc</a></h2>
  13589. <p>Per-packet CRC (Cyclic Redundancy Check) testing format.
  13590. </p>
  13591. <p>This muxer computes and prints the Adler-32 CRC for each audio
  13592. and video packet. By default audio frames are converted to signed
  13593. 16-bit raw audio and video frames to raw video before computing the
  13594. CRC.
  13595. </p>
  13596. <p>The output of the muxer consists of a line for each audio and video
  13597. packet of the form:
  13598. </p><div class="example">
  13599. <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>
  13600. </pre></div>
  13601. <p><var>CRC</var> is a hexadecimal number 0-padded to 8 digits containing the
  13602. CRC of the packet.
  13603. </p>
  13604. <a name="Examples-55"></a>
  13605. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-55">21.8.1 Examples</a></h3>
  13606. <p>For example to compute the CRC of the audio and video frames in
  13607. &lsquo;<tt>INPUT</tt>&rsquo;, converted to raw audio and video packets, and store it
  13608. in the file &lsquo;<tt>out.crc</tt>&rsquo;:
  13609. </p><div class="example">
  13610. <pre class="example">ffmpeg -i INPUT -f framecrc out.crc
  13611. </pre></div>
  13612. <p>To print the information to stdout, use the command:
  13613. </p><div class="example">
  13614. <pre class="example">ffmpeg -i INPUT -f framecrc -
  13615. </pre></div>
  13616. <p>With <code>ffmpeg</code>, you can select the output format to which the
  13617. audio and video frames are encoded before computing the CRC for each
  13618. packet by specifying the audio and video codec. For example, to
  13619. compute the CRC of each decoded input audio frame converted to PCM
  13620. unsigned 8-bit and of each decoded input video frame converted to
  13621. MPEG-2 video, use the command:
  13622. </p><div class="example">
  13623. <pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
  13624. </pre></div>
  13625. <p>See also the <a href="#crc">crc</a> muxer.
  13626. </p>
  13627. <p><a name="framehash"></a>
  13628. </p><a name="framehash-1"></a>
  13629. <h2 class="section"><a href="ffmpeg-all.html#toc-framehash-1">21.9 framehash</a></h2>
  13630. <p>Per-packet hash testing format.
  13631. </p>
  13632. <p>This muxer computes and prints a cryptographic hash for each audio
  13633. and video packet. This can be used for packet-by-packet equality
  13634. checks without having to individually do a binary comparison on each.
  13635. </p>
  13636. <p>By default audio frames are converted to signed 16-bit raw audio and
  13637. video frames to raw video before computing the hash, but the output
  13638. of explicit conversions to other codecs can also be used. It uses the
  13639. SHA-256 cryptographic hash function by default, but supports several
  13640. other algorithms.
  13641. </p>
  13642. <p>The output of the muxer consists of a line for each audio and video
  13643. packet of the form:
  13644. </p><div class="example">
  13645. <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>
  13646. </pre></div>
  13647. <p><var>hash</var> is a hexadecimal number representing the computed hash
  13648. for the packet.
  13649. </p>
  13650. <dl compact="compact">
  13651. <dt>&lsquo;<samp>hash <var>algorithm</var></samp>&rsquo;</dt>
  13652. <dd><p>Use the cryptographic hash function specified by the string <var>algorithm</var>.
  13653. Supported values include <code>MD5</code>, <code>murmur3</code>, <code>RIPEMD128</code>,
  13654. <code>RIPEMD160</code>, <code>RIPEMD256</code>, <code>RIPEMD320</code>, <code>SHA160</code>,
  13655. <code>SHA224</code>, <code>SHA256</code> (default), <code>SHA512/224</code>, <code>SHA512/256</code>,
  13656. <code>SHA384</code>, <code>SHA512</code>, <code>CRC32</code> and <code>adler32</code>.
  13657. </p>
  13658. </dd>
  13659. </dl>
  13660. <a name="Examples-177"></a>
  13661. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-177">21.9.1 Examples</a></h3>
  13662. <p>To compute the SHA-256 hash of the audio and video frames in &lsquo;<tt>INPUT</tt>&rsquo;,
  13663. converted to raw audio and video packets, and store it in the file
  13664. &lsquo;<tt>out.sha256</tt>&rsquo;:
  13665. </p><div class="example">
  13666. <pre class="example">ffmpeg -i INPUT -f framehash out.sha256
  13667. </pre></div>
  13668. <p>To print the information to stdout, using the MD5 hash function, use
  13669. the command:
  13670. </p><div class="example">
  13671. <pre class="example">ffmpeg -i INPUT -f framehash -hash md5 -
  13672. </pre></div>
  13673. <p>See also the <a href="#hash">hash</a> muxer.
  13674. </p>
  13675. <p><a name="framemd5"></a>
  13676. </p><a name="framemd5-1"></a>
  13677. <h2 class="section"><a href="ffmpeg-all.html#toc-framemd5-1">21.10 framemd5</a></h2>
  13678. <p>Per-packet MD5 testing format.
  13679. </p>
  13680. <p>This is a variant of the <a href="#framehash">framehash</a> muxer. Unlike that muxer,
  13681. it defaults to using the MD5 hash function.
  13682. </p>
  13683. <a name="Examples-25"></a>
  13684. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-25">21.10.1 Examples</a></h3>
  13685. <p>To compute the MD5 hash of the audio and video frames in &lsquo;<tt>INPUT</tt>&rsquo;,
  13686. converted to raw audio and video packets, and store it in the file
  13687. &lsquo;<tt>out.md5</tt>&rsquo;:
  13688. </p><div class="example">
  13689. <pre class="example">ffmpeg -i INPUT -f framemd5 out.md5
  13690. </pre></div>
  13691. <p>To print the information to stdout, use the command:
  13692. </p><div class="example">
  13693. <pre class="example">ffmpeg -i INPUT -f framemd5 -
  13694. </pre></div>
  13695. <p>See also the <a href="#framehash">framehash</a> and <a href="#md5">md5</a> muxers.
  13696. </p>
  13697. <p><a name="gif"></a>
  13698. </p><a name="gif-1"></a>
  13699. <h2 class="section"><a href="ffmpeg-all.html#toc-gif-1">21.11 gif</a></h2>
  13700. <p>Animated GIF muxer.
  13701. </p>
  13702. <p>It accepts the following options:
  13703. </p>
  13704. <dl compact="compact">
  13705. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  13706. <dd><p>Set the number of times to loop the output. Use <code>-1</code> for no loop, <code>0</code>
  13707. for looping indefinitely (default).
  13708. </p>
  13709. </dd>
  13710. <dt>&lsquo;<samp>final_delay</samp>&rsquo;</dt>
  13711. <dd><p>Force the delay (expressed in centiseconds) after the last frame. Each frame
  13712. ends with a delay until the next frame. The default is <code>-1</code>, which is a
  13713. special value to tell the muxer to re-use the previous delay. In case of a
  13714. loop, you might want to customize this value to mark a pause for instance.
  13715. </p></dd>
  13716. </dl>
  13717. <p>For example, to encode a gif looping 10 times, with a 5 seconds delay between
  13718. the loops:
  13719. </p><div class="example">
  13720. <pre class="example">ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
  13721. </pre></div>
  13722. <p>Note 1: if you wish to extract the frames into separate GIF files, you need to
  13723. force the <a href="#image2">image2</a> muxer:
  13724. </p><div class="example">
  13725. <pre class="example">ffmpeg -i INPUT -c:v gif -f image2 &quot;out%d.gif&quot;
  13726. </pre></div>
  13727. <p>Note 2: the GIF format has a very large time base: the delay between two frames
  13728. can therefore not be smaller than one centi second.
  13729. </p>
  13730. <p><a name="hash"></a>
  13731. </p><a name="hash-1"></a>
  13732. <h2 class="section"><a href="ffmpeg-all.html#toc-hash-1">21.12 hash</a></h2>
  13733. <p>Hash testing format.
  13734. </p>
  13735. <p>This muxer computes and prints a cryptographic hash of all the input
  13736. audio and video frames. This can be used for equality checks without
  13737. having to do a complete binary comparison.
  13738. </p>
  13739. <p>By default audio frames are converted to signed 16-bit raw audio and
  13740. video frames to raw video before computing the hash, but the output
  13741. of explicit conversions to other codecs can also be used. Timestamps
  13742. are ignored. It uses the SHA-256 cryptographic hash function by default,
  13743. but supports several other algorithms.
  13744. </p>
  13745. <p>The output of the muxer consists of a single line of the form:
  13746. <var>algo</var>=<var>hash</var>, where <var>algo</var> is a short string representing
  13747. the hash function used, and <var>hash</var> is a hexadecimal number
  13748. representing the computed hash.
  13749. </p>
  13750. <dl compact="compact">
  13751. <dt>&lsquo;<samp>hash <var>algorithm</var></samp>&rsquo;</dt>
  13752. <dd><p>Use the cryptographic hash function specified by the string <var>algorithm</var>.
  13753. Supported values include <code>MD5</code>, <code>murmur3</code>, <code>RIPEMD128</code>,
  13754. <code>RIPEMD160</code>, <code>RIPEMD256</code>, <code>RIPEMD320</code>, <code>SHA160</code>,
  13755. <code>SHA224</code>, <code>SHA256</code> (default), <code>SHA512/224</code>, <code>SHA512/256</code>,
  13756. <code>SHA384</code>, <code>SHA512</code>, <code>CRC32</code> and <code>adler32</code>.
  13757. </p>
  13758. </dd>
  13759. </dl>
  13760. <a name="Examples-138"></a>
  13761. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-138">21.12.1 Examples</a></h3>
  13762. <p>To compute the SHA-256 hash of the input converted to raw audio and
  13763. video, and store it in the file &lsquo;<tt>out.sha256</tt>&rsquo;:
  13764. </p><div class="example">
  13765. <pre class="example">ffmpeg -i INPUT -f hash out.sha256
  13766. </pre></div>
  13767. <p>To print an MD5 hash to stdout use the command:
  13768. </p><div class="example">
  13769. <pre class="example">ffmpeg -i INPUT -f hash -hash md5 -
  13770. </pre></div>
  13771. <p>See also the <a href="#framehash">framehash</a> muxer.
  13772. </p>
  13773. <p><a name="hls"></a>
  13774. </p><a name="hls-2"></a>
  13775. <h2 class="section"><a href="ffmpeg-all.html#toc-hls-2">21.13 hls</a></h2>
  13776. <p>Apple HTTP Live Streaming muxer that segments MPEG-TS according to
  13777. the HTTP Live Streaming (HLS) specification.
  13778. </p>
  13779. <p>It creates a playlist file, and one or more segment files. The output filename
  13780. specifies the playlist filename.
  13781. </p>
  13782. <p>By default, the muxer creates a file for each segment produced. These files
  13783. have the same name as the playlist, followed by a sequential number and a
  13784. .ts extension.
  13785. </p>
  13786. <p>Make sure to require a closed GOP when encoding and to set the GOP
  13787. size to fit your segment time constraint.
  13788. </p>
  13789. <p>For example, to convert an input file with <code>ffmpeg</code>:
  13790. </p><div class="example">
  13791. <pre class="example">ffmpeg -i in.mkv -c:v h264 -flags +cgop -g 30 -hls_time 1 out.m3u8
  13792. </pre></div>
  13793. <p>This example will produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  13794. &lsquo;<tt>out0.ts</tt>&rsquo;, &lsquo;<tt>out1.ts</tt>&rsquo;, &lsquo;<tt>out2.ts</tt>&rsquo;, etc.
  13795. </p>
  13796. <p>See also the <a href="#segment">segment</a> muxer, which provides a more generic and
  13797. flexible implementation of a segmenter, and can be used to perform HLS
  13798. segmentation.
  13799. </p>
  13800. <a name="Options-40"></a>
  13801. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-40">21.13.1 Options</a></h3>
  13802. <p>This muxer supports the following options:
  13803. </p>
  13804. <dl compact="compact">
  13805. <dt>&lsquo;<samp>hls_init_time <var>seconds</var></samp>&rsquo;</dt>
  13806. <dd><p>Set the initial target segment length in seconds. Default value is <var>0</var>.
  13807. Segment will be cut on the next key frame after this time has passed on the first m3u8 list.
  13808. After the initial playlist is filled <code>ffmpeg</code> will cut segments
  13809. at duration equal to <code>hls_time</code>
  13810. </p>
  13811. </dd>
  13812. <dt>&lsquo;<samp>hls_time <var>seconds</var></samp>&rsquo;</dt>
  13813. <dd><p>Set the target segment length in seconds. Default value is 2.
  13814. Segment will be cut on the next key frame after this time has passed.
  13815. </p>
  13816. </dd>
  13817. <dt>&lsquo;<samp>hls_list_size <var>size</var></samp>&rsquo;</dt>
  13818. <dd><p>Set the maximum number of playlist entries. If set to 0 the list file
  13819. will contain all the segments. Default value is 5.
  13820. </p>
  13821. </dd>
  13822. <dt>&lsquo;<samp>hls_delete_threshold <var>size</var></samp>&rsquo;</dt>
  13823. <dd><p>Set the number of unreferenced segments to keep on disk before <code>hls_flags delete_segments</code>
  13824. deletes them. Increase this to allow continue clients to download segments which
  13825. were recently referenced in the playlist. Default value is 1, meaning segments older than
  13826. <code>hls_list_size+1</code> will be deleted.
  13827. </p>
  13828. </dd>
  13829. <dt>&lsquo;<samp>hls_ts_options <var>options_list</var></samp>&rsquo;</dt>
  13830. <dd><p>Set output format options using a :-separated list of key=value
  13831. parameters. Values containing <code>:</code> special characters must be
  13832. escaped.
  13833. </p>
  13834. </dd>
  13835. <dt>&lsquo;<samp>hls_wrap <var>wrap</var></samp>&rsquo;</dt>
  13836. <dd><p>This is a deprecated option, you can use <code>hls_list_size</code>
  13837. and <code>hls_flags delete_segments</code> instead it
  13838. </p>
  13839. <p>This option is useful to avoid to fill the disk with many segment
  13840. files, and limits the maximum number of segment files written to disk
  13841. to <var>wrap</var>.
  13842. </p>
  13843. </dd>
  13844. <dt>&lsquo;<samp>hls_start_number_source</samp>&rsquo;</dt>
  13845. <dd><p>Start the playlist sequence number (<code>#EXT-X-MEDIA-SEQUENCE</code>) according to the specified source.
  13846. Unless <code>hls_flags single_file</code> is set, it also specifies source of starting sequence numbers of
  13847. segment and subtitle filenames. In any case, if <code>hls_flags append_list</code>
  13848. is set and read playlist sequence number is greater than the specified start sequence number,
  13849. then that value will be used as start value.
  13850. </p>
  13851. <p>It accepts the following values:
  13852. </p>
  13853. <dl compact="compact">
  13854. <dt>&lsquo;<samp>generic (default)</samp>&rsquo;</dt>
  13855. <dd><p>Set the starting sequence numbers according to <var>start_number</var> option value.
  13856. </p>
  13857. </dd>
  13858. <dt>&lsquo;<samp>epoch</samp>&rsquo;</dt>
  13859. <dd><p>The start number will be the seconds since epoch (1970-01-01 00:00:00)
  13860. </p>
  13861. </dd>
  13862. <dt>&lsquo;<samp>epoch_us</samp>&rsquo;</dt>
  13863. <dd><p>The start number will be the microseconds since epoch (1970-01-01 00:00:00)
  13864. </p>
  13865. </dd>
  13866. <dt>&lsquo;<samp>datetime</samp>&rsquo;</dt>
  13867. <dd><p>The start number will be based on the current date/time as YYYYmmddHHMMSS. e.g. 20161231235759.
  13868. </p>
  13869. </dd>
  13870. </dl>
  13871. </dd>
  13872. <dt>&lsquo;<samp>start_number <var>number</var></samp>&rsquo;</dt>
  13873. <dd><p>Start the playlist sequence number (<code>#EXT-X-MEDIA-SEQUENCE</code>) from the specified <var>number</var>
  13874. when <var>hls_start_number_source</var> value is <var>generic</var>. (This is the default case.)
  13875. Unless <code>hls_flags single_file</code> is set, it also specifies starting sequence numbers of segment and subtitle filenames.
  13876. Default value is 0.
  13877. </p>
  13878. </dd>
  13879. <dt>&lsquo;<samp>hls_allow_cache <var>allowcache</var></samp>&rsquo;</dt>
  13880. <dd><p>Explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments.
  13881. </p>
  13882. </dd>
  13883. <dt>&lsquo;<samp>hls_base_url <var>baseurl</var></samp>&rsquo;</dt>
  13884. <dd><p>Append <var>baseurl</var> to every entry in the playlist.
  13885. Useful to generate playlists with absolute paths.
  13886. </p>
  13887. <p>Note that the playlist sequence number must be unique for each segment
  13888. and it is not to be confused with the segment filename sequence number
  13889. which can be cyclic, for example if the &lsquo;<samp>wrap</samp>&rsquo; option is
  13890. specified.
  13891. </p>
  13892. </dd>
  13893. <dt>&lsquo;<samp>hls_segment_filename <var>filename</var></samp>&rsquo;</dt>
  13894. <dd><p>Set the segment filename. Unless <code>hls_flags single_file</code> is set,
  13895. <var>filename</var> is used as a string format with the segment number:
  13896. </p><div class="example">
  13897. <pre class="example">ffmpeg -i in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
  13898. </pre></div>
  13899. <p>This example will produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  13900. &lsquo;<tt>file000.ts</tt>&rsquo;, &lsquo;<tt>file001.ts</tt>&rsquo;, &lsquo;<tt>file002.ts</tt>&rsquo;, etc.
  13901. </p>
  13902. <p><var>filename</var> may contain full path or relative path specification,
  13903. but only the file name part without any path info will be contained in the m3u8 segment list.
  13904. Should a relative path be specified, the path of the created segment
  13905. files will be relative to the current working directory.
  13906. When strftime_mkdir is set, the whole expanded value of <var>filename</var> will be written into the m3u8 segment list.
  13907. </p>
  13908. <p>When <code>var_stream_map</code> is set with two or more variant streams, the
  13909. <var>filename</var> pattern must contain the string &quot;%v&quot;, this string specifies
  13910. the position of variant stream index in the generated segment file names.
  13911. </p><div class="example">
  13912. <pre class="example">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  13913. -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; \
  13914. -hls_segment_filename 'file_%v_%03d.ts' out_%v.m3u8
  13915. </pre></div>
  13916. <p>This example will produce the playlists segment file sets:
  13917. &lsquo;<tt>file_0_000.ts</tt>&rsquo;, &lsquo;<tt>file_0_001.ts</tt>&rsquo;, &lsquo;<tt>file_0_002.ts</tt>&rsquo;, etc. and
  13918. &lsquo;<tt>file_1_000.ts</tt>&rsquo;, &lsquo;<tt>file_1_001.ts</tt>&rsquo;, &lsquo;<tt>file_1_002.ts</tt>&rsquo;, etc.
  13919. </p>
  13920. <p>The string &quot;%v&quot; may be present in the filename or in the last directory name
  13921. containing the file, but only in one of them. (Additionally, %v may appear multiple times in the last
  13922. sub-directory or filename.) If the string %v is present in the directory name, then
  13923. sub-directories are created after expanding the directory name pattern. This
  13924. enables creation of segments corresponding to different variant streams in
  13925. subdirectories.
  13926. </p><div class="example">
  13927. <pre class="example">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  13928. -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; \
  13929. -hls_segment_filename 'vs%v/file_%03d.ts' vs%v/out.m3u8
  13930. </pre></div>
  13931. <p>This example will produce the playlists segment file sets:
  13932. &lsquo;<tt>vs0/file_000.ts</tt>&rsquo;, &lsquo;<tt>vs0/file_001.ts</tt>&rsquo;, &lsquo;<tt>vs0/file_002.ts</tt>&rsquo;, etc. and
  13933. &lsquo;<tt>vs1/file_000.ts</tt>&rsquo;, &lsquo;<tt>vs1/file_001.ts</tt>&rsquo;, &lsquo;<tt>vs1/file_002.ts</tt>&rsquo;, etc.
  13934. </p>
  13935. </dd>
  13936. <dt>&lsquo;<samp>use_localtime</samp>&rsquo;</dt>
  13937. <dd><p>Same as strftime option, will be deprecated.
  13938. </p>
  13939. </dd>
  13940. <dt>&lsquo;<samp>strftime</samp>&rsquo;</dt>
  13941. <dd><p>Use strftime() on <var>filename</var> to expand the segment filename with localtime.
  13942. The segment number is also available in this mode, but to use it, you need to specify second_level_segment_index
  13943. hls_flag and %%d will be the specifier.
  13944. </p><div class="example">
  13945. <pre class="example">ffmpeg -i in.nut -strftime 1 -hls_segment_filename 'file-%Y%m%d-%s.ts' out.m3u8
  13946. </pre></div>
  13947. <p>This example will produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  13948. &lsquo;<tt>file-20160215-1455569023.ts</tt>&rsquo;, &lsquo;<tt>file-20160215-1455569024.ts</tt>&rsquo;, etc.
  13949. Note: On some systems/environments, the <code>%s</code> specifier is not available. See
  13950. <code>strftime()</code> documentation.
  13951. </p><div class="example">
  13952. <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
  13953. </pre></div>
  13954. <p>This example will produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  13955. &lsquo;<tt>file-20160215-0001.ts</tt>&rsquo;, &lsquo;<tt>file-20160215-0002.ts</tt>&rsquo;, etc.
  13956. </p>
  13957. </dd>
  13958. <dt>&lsquo;<samp>use_localtime_mkdir</samp>&rsquo;</dt>
  13959. <dd><p>Same as strftime_mkdir option, will be deprecated .
  13960. </p>
  13961. </dd>
  13962. <dt>&lsquo;<samp>strftime_mkdir</samp>&rsquo;</dt>
  13963. <dd><p>Used together with -strftime_mkdir, it will create all subdirectories which
  13964. is expanded in <var>filename</var>.
  13965. </p><div class="example">
  13966. <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
  13967. </pre></div>
  13968. <p>This example will create a directory 201560215 (if it does not exist), and then
  13969. produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  13970. &lsquo;<tt>20160215/file-20160215-1455569023.ts</tt>&rsquo;, &lsquo;<tt>20160215/file-20160215-1455569024.ts</tt>&rsquo;, etc.
  13971. </p>
  13972. <div class="example">
  13973. <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
  13974. </pre></div>
  13975. <p>This example will create a directory hierarchy 2016/02/15 (if any of them do not exist), and then
  13976. produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  13977. &lsquo;<tt>2016/02/15/file-20160215-1455569023.ts</tt>&rsquo;, &lsquo;<tt>2016/02/15/file-20160215-1455569024.ts</tt>&rsquo;, etc.
  13978. </p>
  13979. </dd>
  13980. <dt>&lsquo;<samp>hls_key_info_file <var>key_info_file</var></samp>&rsquo;</dt>
  13981. <dd><p>Use the information in <var>key_info_file</var> for segment encryption. The first
  13982. line of <var>key_info_file</var> specifies the key URI written to the playlist. The
  13983. key URL is used to access the encryption key during playback. The second line
  13984. specifies the path to the key file used to obtain the key during the encryption
  13985. process. The key file is read as a single packed array of 16 octets in binary
  13986. format. The optional third line specifies the initialization vector (IV) as a
  13987. hexadecimal string to be used instead of the segment sequence number (default)
  13988. for encryption. Changes to <var>key_info_file</var> will result in segment
  13989. encryption with the new key/IV and an entry in the playlist for the new key
  13990. URI/IV if <code>hls_flags periodic_rekey</code> is enabled.
  13991. </p>
  13992. <p>Key info file format:
  13993. </p><div class="example">
  13994. <pre class="example"><var>key URI</var>
  13995. <var>key file path</var>
  13996. <var>IV</var> (optional)
  13997. </pre></div>
  13998. <p>Example key URIs:
  13999. </p><div class="example">
  14000. <pre class="example">http://server/file.key
  14001. /path/to/file.key
  14002. file.key
  14003. </pre></div>
  14004. <p>Example key file paths:
  14005. </p><div class="example">
  14006. <pre class="example">file.key
  14007. /path/to/file.key
  14008. </pre></div>
  14009. <p>Example IV:
  14010. </p><div class="example">
  14011. <pre class="example">0123456789ABCDEF0123456789ABCDEF
  14012. </pre></div>
  14013. <p>Key info file example:
  14014. </p><div class="example">
  14015. <pre class="example">http://server/file.key
  14016. /path/to/file.key
  14017. 0123456789ABCDEF0123456789ABCDEF
  14018. </pre></div>
  14019. <p>Example shell script:
  14020. </p><div class="example">
  14021. <pre class="example">#!/bin/sh
  14022. BASE_URL=${1:-'.'}
  14023. openssl rand 16 &gt; file.key
  14024. echo $BASE_URL/file.key &gt; file.keyinfo
  14025. echo file.key &gt;&gt; file.keyinfo
  14026. echo $(openssl rand -hex 16) &gt;&gt; file.keyinfo
  14027. ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
  14028. -hls_key_info_file file.keyinfo out.m3u8
  14029. </pre></div>
  14030. </dd>
  14031. <dt>&lsquo;<samp>-hls_enc <var>enc</var></samp>&rsquo;</dt>
  14032. <dd><p>Enable (1) or disable (0) the AES128 encryption.
  14033. When enabled every segment generated is encrypted and the encryption key
  14034. is saved as <var>playlist name</var>.key.
  14035. </p>
  14036. </dd>
  14037. <dt>&lsquo;<samp>-hls_enc_key <var>key</var></samp>&rsquo;</dt>
  14038. <dd><p>Hex-coded 16byte key to encrypt the segments, by default it
  14039. is randomly generated.
  14040. </p>
  14041. </dd>
  14042. <dt>&lsquo;<samp>-hls_enc_key_url <var>keyurl</var></samp>&rsquo;</dt>
  14043. <dd><p>If set, <var>keyurl</var> is prepended instead of <var>baseurl</var> to the key filename
  14044. in the playlist.
  14045. </p>
  14046. </dd>
  14047. <dt>&lsquo;<samp>-hls_enc_iv <var>iv</var></samp>&rsquo;</dt>
  14048. <dd><p>Hex-coded 16byte initialization vector for every segment instead
  14049. of the autogenerated ones.
  14050. </p>
  14051. </dd>
  14052. <dt>&lsquo;<samp>hls_segment_type <var>flags</var></samp>&rsquo;</dt>
  14053. <dd><p>Possible values:
  14054. </p>
  14055. <dl compact="compact">
  14056. <dt>&lsquo;<samp>mpegts</samp>&rsquo;</dt>
  14057. <dd><p>Output segment files in MPEG-2 Transport Stream format. This is
  14058. compatible with all HLS versions.
  14059. </p>
  14060. </dd>
  14061. <dt>&lsquo;<samp>fmp4</samp>&rsquo;</dt>
  14062. <dd><p>Output segment files in fragmented MP4 format, similar to MPEG-DASH.
  14063. fmp4 files may be used in HLS version 7 and above.
  14064. </p>
  14065. </dd>
  14066. </dl>
  14067. </dd>
  14068. <dt>&lsquo;<samp>hls_fmp4_init_filename <var>filename</var></samp>&rsquo;</dt>
  14069. <dd><p>Set filename to the fragment files header file, default filename is &lsquo;<tt>init.mp4</tt>&rsquo;.
  14070. </p>
  14071. </dd>
  14072. <dt>&lsquo;<samp>hls_fmp4_init_resend</samp>&rsquo;</dt>
  14073. <dd><p>Resend init file after m3u8 file refresh every time, default is <var>0</var>.
  14074. </p>
  14075. <p>When <code>var_stream_map</code> is set with two or more variant streams, the
  14076. <var>filename</var> pattern must contain the string &quot;%v&quot;, this string specifies
  14077. the position of variant stream index in the generated init file names.
  14078. The string &quot;%v&quot; may be present in the filename or in the last directory name
  14079. containing the file. If the string is present in the directory name, then
  14080. sub-directories are created after expanding the directory name pattern. This
  14081. enables creation of init files corresponding to different variant streams in
  14082. subdirectories.
  14083. </p>
  14084. </dd>
  14085. <dt>&lsquo;<samp>hls_flags <var>flags</var></samp>&rsquo;</dt>
  14086. <dd><p>Possible values:
  14087. </p>
  14088. <dl compact="compact">
  14089. <dt>&lsquo;<samp>single_file</samp>&rsquo;</dt>
  14090. <dd><p>If this flag is set, the muxer will store all segments in a single MPEG-TS
  14091. file, and will use byte ranges in the playlist. HLS playlists generated with
  14092. this way will have the version number 4.
  14093. For example:
  14094. </p><div class="example">
  14095. <pre class="example">ffmpeg -i in.nut -hls_flags single_file out.m3u8
  14096. </pre></div>
  14097. <p>Will produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and a single segment file,
  14098. &lsquo;<tt>out.ts</tt>&rsquo;.
  14099. </p>
  14100. </dd>
  14101. <dt>&lsquo;<samp>delete_segments</samp>&rsquo;</dt>
  14102. <dd><p>Segment files removed from the playlist are deleted after a period of time
  14103. equal to the duration of the segment plus the duration of the playlist.
  14104. </p>
  14105. </dd>
  14106. <dt>&lsquo;<samp>append_list</samp>&rsquo;</dt>
  14107. <dd><p>Append new segments into the end of old segment list,
  14108. and remove the <code>#EXT-X-ENDLIST</code> from the old segment list.
  14109. </p>
  14110. </dd>
  14111. <dt>&lsquo;<samp>round_durations</samp>&rsquo;</dt>
  14112. <dd><p>Round the duration info in the playlist file segment info to integer
  14113. values, instead of using floating point.
  14114. </p>
  14115. </dd>
  14116. <dt>&lsquo;<samp>discont_start</samp>&rsquo;</dt>
  14117. <dd><p>Add the <code>#EXT-X-DISCONTINUITY</code> tag to the playlist, before the
  14118. first segment&rsquo;s information.
  14119. </p>
  14120. </dd>
  14121. <dt>&lsquo;<samp>omit_endlist</samp>&rsquo;</dt>
  14122. <dd><p>Do not append the <code>EXT-X-ENDLIST</code> tag at the end of the playlist.
  14123. </p>
  14124. </dd>
  14125. <dt>&lsquo;<samp>periodic_rekey</samp>&rsquo;</dt>
  14126. <dd><p>The file specified by <code>hls_key_info_file</code> will be checked periodically and
  14127. detect updates to the encryption info. Be sure to replace this file atomically,
  14128. including the file containing the AES encryption key.
  14129. </p>
  14130. </dd>
  14131. <dt>&lsquo;<samp>independent_segments</samp>&rsquo;</dt>
  14132. <dd><p>Add the <code>#EXT-X-INDEPENDENT-SEGMENTS</code> to playlists that has video segments
  14133. and when all the segments of that playlist are guaranteed to start with a Key frame.
  14134. </p>
  14135. </dd>
  14136. <dt>&lsquo;<samp>iframes_only</samp>&rsquo;</dt>
  14137. <dd><p>Add the <code>#EXT-X-I-FRAMES-ONLY</code> to playlists that has video segments
  14138. and can play only I-frames in the <code>#EXT-X-BYTERANGE</code> mode.
  14139. </p>
  14140. </dd>
  14141. <dt>&lsquo;<samp>split_by_time</samp>&rsquo;</dt>
  14142. <dd><p>Allow segments to start on frames other than keyframes. This improves
  14143. behavior on some players when the time between keyframes is inconsistent,
  14144. but may make things worse on others, and can cause some oddities during
  14145. seeking. This flag should be used with the <code>hls_time</code> option.
  14146. </p>
  14147. </dd>
  14148. <dt>&lsquo;<samp>program_date_time</samp>&rsquo;</dt>
  14149. <dd><p>Generate <code>EXT-X-PROGRAM-DATE-TIME</code> tags.
  14150. </p>
  14151. </dd>
  14152. <dt>&lsquo;<samp>second_level_segment_index</samp>&rsquo;</dt>
  14153. <dd><p>Makes it possible to use segment indexes as %%d in hls_segment_filename expression
  14154. besides date/time values when strftime is on.
  14155. To get fixed width numbers with trailing zeroes, %%0xd format is available where x is the required width.
  14156. </p>
  14157. </dd>
  14158. <dt>&lsquo;<samp>second_level_segment_size</samp>&rsquo;</dt>
  14159. <dd><p>Makes it possible to use segment sizes (counted in bytes) as %%s in hls_segment_filename
  14160. expression besides date/time values when strftime is on.
  14161. To get fixed width numbers with trailing zeroes, %%0xs format is available where x is the required width.
  14162. </p>
  14163. </dd>
  14164. <dt>&lsquo;<samp>second_level_segment_duration</samp>&rsquo;</dt>
  14165. <dd><p>Makes it possible to use segment duration (calculated in microseconds) as %%t in hls_segment_filename
  14166. expression besides date/time values when strftime is on.
  14167. To get fixed width numbers with trailing zeroes, %%0xt format is available where x is the required width.
  14168. </p>
  14169. <div class="example">
  14170. <pre class="example">ffmpeg -i sample.mpeg \
  14171. -f hls -hls_time 3 -hls_list_size 5 \
  14172. -hls_flags second_level_segment_index+second_level_segment_size+second_level_segment_duration \
  14173. -strftime 1 -strftime_mkdir 1 -hls_segment_filename &quot;segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts&quot; stream.m3u8
  14174. </pre></div>
  14175. <p>This will produce segments like this:
  14176. &lsquo;<tt>segment_20170102194334_0003_00122200_0000003000000.ts</tt>&rsquo;, &lsquo;<tt>segment_20170102194334_0004_00120072_0000003000000.ts</tt>&rsquo; etc.
  14177. </p>
  14178. </dd>
  14179. <dt>&lsquo;<samp>temp_file</samp>&rsquo;</dt>
  14180. <dd><p>Write segment data to filename.tmp and rename to filename only once the segment is complete. A webserver
  14181. serving up segments can be configured to reject requests to *.tmp to prevent access to in-progress segments
  14182. before they have been added to the m3u8 playlist. This flag also affects how m3u8 playlist files are created.
  14183. If this flag is set, all playlist files will written into temporary file and renamed after they are complete, similarly as segments are handled.
  14184. But playlists with <code>file</code> protocol and with type (<code>hls_playlist_type</code>) other than <code>vod</code>
  14185. 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,
  14186. are always written into temporary file regardless of this flag if <code>master_pl_publish_rate</code> value is other than zero.
  14187. </p>
  14188. </dd>
  14189. </dl>
  14190. </dd>
  14191. <dt>&lsquo;<samp>hls_playlist_type event</samp>&rsquo;</dt>
  14192. <dd><p>Emit <code>#EXT-X-PLAYLIST-TYPE:EVENT</code> in the m3u8 header. Forces
  14193. &lsquo;<samp>hls_list_size</samp>&rsquo; to 0; the playlist can only be appended to.
  14194. </p>
  14195. </dd>
  14196. <dt>&lsquo;<samp>hls_playlist_type vod</samp>&rsquo;</dt>
  14197. <dd><p>Emit <code>#EXT-X-PLAYLIST-TYPE:VOD</code> in the m3u8 header. Forces
  14198. &lsquo;<samp>hls_list_size</samp>&rsquo; to 0; the playlist must not change.
  14199. </p>
  14200. </dd>
  14201. <dt>&lsquo;<samp>method</samp>&rsquo;</dt>
  14202. <dd><p>Use the given HTTP method to create the hls files.
  14203. </p><div class="example">
  14204. <pre class="example">ffmpeg -re -i in.ts -f hls -method PUT http://example.com/live/out.m3u8
  14205. </pre></div>
  14206. <p>This example will upload all the mpegts segment files to the HTTP
  14207. server using the HTTP PUT method, and update the m3u8 files every
  14208. <code>refresh</code> times using the same method.
  14209. Note that the HTTP server must support the given method for uploading
  14210. files.
  14211. </p>
  14212. </dd>
  14213. <dt>&lsquo;<samp>http_user_agent</samp>&rsquo;</dt>
  14214. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP output.
  14215. </p>
  14216. </dd>
  14217. <dt>&lsquo;<samp>var_stream_map</samp>&rsquo;</dt>
  14218. <dd><p>Map string which specifies how to group the audio, video and subtitle streams
  14219. into different variant streams. The variant stream groups are separated
  14220. by space.
  14221. Expected string format is like this &quot;a:0,v:0 a:1,v:1 ....&quot;. Here a:, v:, s: are
  14222. the keys to specify audio, video and subtitle streams respectively.
  14223. Allowed values are 0 to 9 (limited just based on practical usage).
  14224. </p>
  14225. <p>When there are two or more variant streams, the output filename pattern must
  14226. contain the string &quot;%v&quot;, this string specifies the position of variant stream
  14227. index in the output media playlist filenames. The string &quot;%v&quot; may be present in
  14228. the filename or in the last directory name containing the file. If the string is
  14229. present in the directory name, then sub-directories are created after expanding
  14230. the directory name pattern. This enables creation of variant streams in
  14231. subdirectories.
  14232. </p>
  14233. <div class="example">
  14234. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  14235. -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; \
  14236. http://example.com/live/out_%v.m3u8
  14237. </pre></div>
  14238. <p>This example creates two hls variant streams. The first variant stream will
  14239. contain video stream of bitrate 1000k and audio stream of bitrate 64k and the
  14240. second variant stream will contain video stream of bitrate 256k and audio
  14241. stream of bitrate 32k. Here, two media playlist with file names out_0.m3u8 and
  14242. out_1.m3u8 will be created. If you want something meaningful text instead of indexes
  14243. in result names, you may specify names for each or some of the variants
  14244. as in the following example.
  14245. </p>
  14246. <div class="example">
  14247. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  14248. -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; \
  14249. http://example.com/live/out_%v.m3u8
  14250. </pre></div>
  14251. <p>This example creates two hls variant streams as in the previous one.
  14252. But here, the two media playlist with file names out_my_hd.m3u8 and
  14253. out_my_sd.m3u8 will be created.
  14254. </p>
  14255. <div class="example">
  14256. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k \
  14257. -map 0:v -map 0:a -map 0:v -f hls -var_stream_map &quot;v:0 a:0 v:1&quot; \
  14258. http://example.com/live/out_%v.m3u8
  14259. </pre></div>
  14260. <p>This example creates three hls variant streams. The first variant stream will
  14261. be a video only stream with video bitrate 1000k, the second variant stream will
  14262. be an audio only stream with bitrate 64k and the third variant stream will be a
  14263. video only stream with bitrate 256k. Here, three media playlist with file names
  14264. out_0.m3u8, out_1.m3u8 and out_2.m3u8 will be created.
  14265. </p><div class="example">
  14266. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  14267. -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; \
  14268. http://example.com/live/vs_%v/out.m3u8
  14269. </pre></div>
  14270. <p>This example creates the variant streams in subdirectories. Here, the first
  14271. media playlist is created at &lsquo;<tt>http://example.com/live/vs_0/out.m3u8</tt>&rsquo; and
  14272. the second one at &lsquo;<tt>http://example.com/live/vs_1/out.m3u8</tt>&rsquo;.
  14273. </p><div class="example">
  14274. <pre class="example">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k -b:v:1 3000k \
  14275. -map 0:a -map 0:a -map 0:v -map 0:v -f hls \
  14276. -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; \
  14277. -master_pl_name master.m3u8 \
  14278. http://example.com/live/out_%v.m3u8
  14279. </pre></div>
  14280. <p>This example creates two audio only and two video only variant streams. In
  14281. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  14282. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  14283. and they are mapped to the two video only variant streams with audio group names
  14284. &rsquo;aud_low&rsquo; and &rsquo;aud_high&rsquo;.
  14285. </p>
  14286. <p>By default, a single hls variant containing all the encoded streams is created.
  14287. </p>
  14288. <div class="example">
  14289. <pre class="example">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  14290. -map 0:a -map 0:a -map 0:v -f hls \
  14291. -var_stream_map &quot;a:0,agroup:aud_low,default:yes a:1,agroup:aud_low v:0,agroup:aud_low&quot; \
  14292. -master_pl_name master.m3u8 \
  14293. http://example.com/live/out_%v.m3u8
  14294. </pre></div>
  14295. <p>This example creates two audio only and one video only variant streams. In
  14296. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  14297. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  14298. and they are mapped to the one video only variant streams with audio group name
  14299. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES.
  14300. </p>
  14301. <p>By default, a single hls variant containing all the encoded streams is created.
  14302. </p>
  14303. <div class="example">
  14304. <pre class="example">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  14305. -map 0:a -map 0:a -map 0:v -f hls \
  14306. -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; \
  14307. -master_pl_name master.m3u8 \
  14308. http://example.com/live/out_%v.m3u8
  14309. </pre></div>
  14310. <p>This example creates two audio only and one video only variant streams. In
  14311. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  14312. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  14313. and they are mapped to the one video only variant streams with audio group name
  14314. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES, and one audio
  14315. have and language is named ENG, the other audio language is named CHN.
  14316. </p>
  14317. <p>By default, a single hls variant containing all the encoded streams is created.
  14318. </p>
  14319. <div class="example">
  14320. <pre class="example">ffmpeg -y -i input_with_subtitle.mkv \
  14321. -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
  14322. -b:a:0 256k \
  14323. -c:s webvtt -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0 -map 0:s:0 \
  14324. -f hls -var_stream_map &quot;v:0,a:0,s:0,sgroup:subtitle&quot; \
  14325. -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \
  14326. 10 -master_pl_publish_rate 10 -hls_flags \
  14327. delete_segments+discont_start+split_by_time ./tmp/video.m3u8
  14328. </pre></div>
  14329. <p>This example adds <code>#EXT-X-MEDIA</code> tag with <code>TYPE=SUBTITLES</code> in
  14330. the master playlist with webvtt subtitle group name &rsquo;subtitle&rsquo;. Please make sure
  14331. the input file has one text subtitle stream at least.
  14332. </p>
  14333. </dd>
  14334. <dt>&lsquo;<samp>cc_stream_map</samp>&rsquo;</dt>
  14335. <dd><p>Map string which specifies different closed captions groups and their
  14336. attributes. The closed captions stream groups are separated by space.
  14337. Expected string format is like this
  14338. &quot;ccgroup:&lt;group name&gt;,instreamid:&lt;INSTREAM-ID&gt;,language:&lt;language code&gt; ....&quot;.
  14339. &rsquo;ccgroup&rsquo; and &rsquo;instreamid&rsquo; are mandatory attributes. &rsquo;language&rsquo; is an optional
  14340. attribute.
  14341. The closed captions groups configured using this option are mapped to different
  14342. variant streams by providing the same &rsquo;ccgroup&rsquo; name in the
  14343. <code>var_stream_map</code> string. If <code>var_stream_map</code> is not set, then the
  14344. first available ccgroup in <code>cc_stream_map</code> is mapped to the output variant
  14345. stream. The examples for these two use cases are given below.
  14346. </p>
  14347. <div class="example">
  14348. <pre class="example">ffmpeg -re -i in.ts -b:v 1000k -b:a 64k -a53cc 1 -f hls \
  14349. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en&quot; \
  14350. -master_pl_name master.m3u8 \
  14351. http://example.com/live/out.m3u8
  14352. </pre></div>
  14353. <p>This example adds <code>#EXT-X-MEDIA</code> tag with <code>TYPE=CLOSED-CAPTIONS</code> in
  14354. the master playlist with group name &rsquo;cc&rsquo;, language &rsquo;en&rsquo; (english) and
  14355. INSTREAM-ID &rsquo;CC1&rsquo;. Also, it adds <code>CLOSED-CAPTIONS</code> attribute with group
  14356. name &rsquo;cc&rsquo; for the output variant stream.
  14357. </p><div class="example">
  14358. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  14359. -a53cc:0 1 -a53cc:1 1\
  14360. -map 0:v -map 0:a -map 0:v -map 0:a -f hls \
  14361. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en ccgroup:cc,instreamid:CC2,language:sp&quot; \
  14362. -var_stream_map &quot;v:0,a:0,ccgroup:cc v:1,a:1,ccgroup:cc&quot; \
  14363. -master_pl_name master.m3u8 \
  14364. http://example.com/live/out_%v.m3u8
  14365. </pre></div>
  14366. <p>This example adds two <code>#EXT-X-MEDIA</code> tags with <code>TYPE=CLOSED-CAPTIONS</code> in
  14367. the master playlist for the INSTREAM-IDs &rsquo;CC1&rsquo; and &rsquo;CC2&rsquo;. Also, it adds
  14368. <code>CLOSED-CAPTIONS</code> attribute with group name &rsquo;cc&rsquo; for the two output variant
  14369. streams.
  14370. </p>
  14371. </dd>
  14372. <dt>&lsquo;<samp>master_pl_name</samp>&rsquo;</dt>
  14373. <dd><p>Create HLS master playlist with the given name.
  14374. </p>
  14375. <div class="example">
  14376. <pre class="example">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 http://example.com/live/out.m3u8
  14377. </pre></div>
  14378. <p>This example creates HLS master playlist with name master.m3u8 and it is
  14379. published at http://example.com/live/
  14380. </p>
  14381. </dd>
  14382. <dt>&lsquo;<samp>master_pl_publish_rate</samp>&rsquo;</dt>
  14383. <dd><p>Publish master play list repeatedly every after specified number of segment intervals.
  14384. </p>
  14385. <div class="example">
  14386. <pre class="example">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 \
  14387. -hls_time 2 -master_pl_publish_rate 30 http://example.com/live/out.m3u8
  14388. </pre></div>
  14389. <p>This example creates HLS master playlist with name master.m3u8 and keep
  14390. publishing it repeatedly every after 30 segments i.e. every after 60s.
  14391. </p>
  14392. </dd>
  14393. <dt>&lsquo;<samp>http_persistent</samp>&rsquo;</dt>
  14394. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  14395. </p>
  14396. </dd>
  14397. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  14398. <dd><p>Set timeout for socket I/O operations. Applicable only for HTTP output.
  14399. </p>
  14400. </dd>
  14401. <dt>&lsquo;<samp>-ignore_io_errors</samp>&rsquo;</dt>
  14402. <dd><p>Ignore IO errors during open, write and delete. Useful for long-duration runs with network output.
  14403. </p>
  14404. </dd>
  14405. <dt>&lsquo;<samp>headers</samp>&rsquo;</dt>
  14406. <dd><p>Set custom HTTP headers, can override built in default headers. Applicable only for HTTP output.
  14407. </p>
  14408. </dd>
  14409. </dl>
  14410. <p><a name="ico"></a>
  14411. </p><a name="ico-1"></a>
  14412. <h2 class="section"><a href="ffmpeg-all.html#toc-ico-1">21.14 ico</a></h2>
  14413. <p>ICO file muxer.
  14414. </p>
  14415. <p>Microsoft&rsquo;s icon file format (ICO) has some strict limitations that should be noted:
  14416. </p>
  14417. <ul>
  14418. <li>
  14419. Size cannot exceed 256 pixels in any dimension
  14420. </li><li>
  14421. Only BMP and PNG images can be stored
  14422. </li><li>
  14423. If a BMP image is used, it must be one of the following pixel formats:
  14424. <div class="example">
  14425. <pre class="example">BMP Bit Depth FFmpeg Pixel Format
  14426. 1bit pal8
  14427. 4bit pal8
  14428. 8bit pal8
  14429. 16bit rgb555le
  14430. 24bit bgr24
  14431. 32bit bgra
  14432. </pre></div>
  14433. </li><li>
  14434. If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
  14435. </li><li>
  14436. If a PNG image is used, it must use the rgba pixel format
  14437. </li></ul>
  14438. <p><a name="image2"></a>
  14439. </p><a name="image2-2"></a>
  14440. <h2 class="section"><a href="ffmpeg-all.html#toc-image2-2">21.15 image2</a></h2>
  14441. <p>Image file muxer.
  14442. </p>
  14443. <p>The image file muxer writes video frames to image files.
  14444. </p>
  14445. <p>The output filenames are specified by a pattern, which can be used to
  14446. produce sequentially numbered series of files.
  14447. The pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, this string
  14448. specifies the position of the characters representing a numbering in
  14449. the filenames. If the form &quot;%0<var>N</var>d&quot; is used, the string
  14450. representing the number in each filename is 0-padded to <var>N</var>
  14451. digits. The literal character &rsquo;%&rsquo; can be specified in the pattern with
  14452. the string &quot;%%&quot;.
  14453. </p>
  14454. <p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
  14455. the file list specified will contain the number 1, all the following
  14456. numbers will be sequential.
  14457. </p>
  14458. <p>The pattern may contain a suffix which is used to automatically
  14459. determine the format of the image files to write.
  14460. </p>
  14461. <p>For example the pattern &quot;img-%03d.bmp&quot; will specify a sequence of
  14462. filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
  14463. &lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.
  14464. The pattern &quot;img%%-%d.jpg&quot; will specify a sequence of filenames of the
  14465. form &lsquo;<tt>img%-1.jpg</tt>&rsquo;, &lsquo;<tt>img%-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>img%-10.jpg</tt>&rsquo;,
  14466. etc.
  14467. </p>
  14468. <p>The image muxer supports the .Y.U.V image file format. This format is
  14469. special in that that each image frame consists of three files, for
  14470. each of the YUV420P components. To read or write this image file format,
  14471. specify the name of the &rsquo;.Y&rsquo; file. The muxer will automatically open the
  14472. &rsquo;.U&rsquo; and &rsquo;.V&rsquo; files as required.
  14473. </p>
  14474. <a name="Options-43"></a>
  14475. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-43">21.15.1 Options</a></h3>
  14476. <dl compact="compact">
  14477. <dt>&lsquo;<samp>frame_pts</samp>&rsquo;</dt>
  14478. <dd><p>If set to 1, expand the filename with pts from pkt-&gt;pts.
  14479. Default value is 0.
  14480. </p>
  14481. </dd>
  14482. <dt>&lsquo;<samp>start_number</samp>&rsquo;</dt>
  14483. <dd><p>Start the sequence from the specified number. Default value is 1.
  14484. </p>
  14485. </dd>
  14486. <dt>&lsquo;<samp>update</samp>&rsquo;</dt>
  14487. <dd><p>If set to 1, the filename will always be interpreted as just a
  14488. filename, not a pattern, and the corresponding file will be continuously
  14489. overwritten with new images. Default value is 0.
  14490. </p>
  14491. </dd>
  14492. <dt>&lsquo;<samp>strftime</samp>&rsquo;</dt>
  14493. <dd><p>If set to 1, expand the filename with date and time information from
  14494. <code>strftime()</code>. Default value is 0.
  14495. </p>
  14496. </dd>
  14497. <dt>&lsquo;<samp>protocol_opts <var>options_list</var></samp>&rsquo;</dt>
  14498. <dd><p>Set protocol options as a :-separated list of key=value parameters. Values
  14499. containing the <code>:</code> special character must be escaped.
  14500. </p>
  14501. </dd>
  14502. </dl>
  14503. <a name="Examples-5"></a>
  14504. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-5">21.15.2 Examples</a></h3>
  14505. <p>The following example shows how to use <code>ffmpeg</code> for creating a
  14506. sequence of files &lsquo;<tt>img-001.jpeg</tt>&rsquo;, &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ...,
  14507. taking one image every second from the input video:
  14508. </p><div class="example">
  14509. <pre class="example">ffmpeg -i in.avi -vsync cfr -r 1 -f image2 'img-%03d.jpeg'
  14510. </pre></div>
  14511. <p>Note that with <code>ffmpeg</code>, if the format is not specified with the
  14512. <code>-f</code> option and the output filename specifies an image file
  14513. format, the image2 muxer is automatically selected, so the previous
  14514. command can be written as:
  14515. </p><div class="example">
  14516. <pre class="example">ffmpeg -i in.avi -vsync cfr -r 1 'img-%03d.jpeg'
  14517. </pre></div>
  14518. <p>Note also that the pattern must not necessarily contain &quot;%d&quot; or
  14519. &quot;%0<var>N</var>d&quot;, for example to create a single image file
  14520. &lsquo;<tt>img.jpeg</tt>&rsquo; from the start of the input video you can employ the command:
  14521. </p><div class="example">
  14522. <pre class="example">ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
  14523. </pre></div>
  14524. <p>The &lsquo;<samp>strftime</samp>&rsquo; option allows you to expand the filename with
  14525. date and time information. Check the documentation of
  14526. the <code>strftime()</code> function for the syntax.
  14527. </p>
  14528. <p>For example to generate image files from the <code>strftime()</code>
  14529. &quot;%Y-%m-%d_%H-%M-%S&quot; pattern, the following <code>ffmpeg</code> command
  14530. can be used:
  14531. </p><div class="example">
  14532. <pre class="example">ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 &quot;%Y-%m-%d_%H-%M-%S.jpg&quot;
  14533. </pre></div>
  14534. <p>You can set the file name with current frame&rsquo;s PTS:
  14535. </p><div class="example">
  14536. <pre class="example">ffmpeg -f v4l2 -r 1 -i /dev/video0 -copyts -f image2 -frame_pts true %d.jpg&quot;
  14537. </pre></div>
  14538. <p>A more complex example is to publish contents of your desktop directly to a
  14539. WebDAV server every second:
  14540. </p><div class="example">
  14541. <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
  14542. </pre></div>
  14543. <a name="matroska"></a>
  14544. <h2 class="section"><a href="ffmpeg-all.html#toc-matroska">21.16 matroska</a></h2>
  14545. <p>Matroska container muxer.
  14546. </p>
  14547. <p>This muxer implements the matroska and webm container specs.
  14548. </p>
  14549. <a name="Metadata"></a>
  14550. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Metadata">21.16.1 Metadata</a></h3>
  14551. <p>The recognized metadata settings in this muxer are:
  14552. </p>
  14553. <dl compact="compact">
  14554. <dt>&lsquo;<samp>title</samp>&rsquo;</dt>
  14555. <dd><p>Set title name provided to a single track. This gets mapped to
  14556. the FileDescription element for a stream written as attachment.
  14557. </p>
  14558. </dd>
  14559. <dt>&lsquo;<samp>language</samp>&rsquo;</dt>
  14560. <dd><p>Specify the language of the track in the Matroska languages form.
  14561. </p>
  14562. <p>The language can be either the 3 letters bibliographic ISO-639-2 (ISO
  14563. 639-2/B) form (like &quot;fre&quot; for French), or a language code mixed with a
  14564. country code for specialities in languages (like &quot;fre-ca&quot; for Canadian
  14565. French).
  14566. </p>
  14567. </dd>
  14568. <dt>&lsquo;<samp>stereo_mode</samp>&rsquo;</dt>
  14569. <dd><p>Set stereo 3D video layout of two views in a single video track.
  14570. </p>
  14571. <p>The following values are recognized:
  14572. </p><dl compact="compact">
  14573. <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
  14574. <dd><p>video is not stereo
  14575. </p></dd>
  14576. <dt>&lsquo;<samp>left_right</samp>&rsquo;</dt>
  14577. <dd><p>Both views are arranged side by side, Left-eye view is on the left
  14578. </p></dd>
  14579. <dt>&lsquo;<samp>bottom_top</samp>&rsquo;</dt>
  14580. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
  14581. </p></dd>
  14582. <dt>&lsquo;<samp>top_bottom</samp>&rsquo;</dt>
  14583. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
  14584. </p></dd>
  14585. <dt>&lsquo;<samp>checkerboard_rl</samp>&rsquo;</dt>
  14586. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
  14587. </p></dd>
  14588. <dt>&lsquo;<samp>checkerboard_lr</samp>&rsquo;</dt>
  14589. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
  14590. </p></dd>
  14591. <dt>&lsquo;<samp>row_interleaved_rl</samp>&rsquo;</dt>
  14592. <dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
  14593. </p></dd>
  14594. <dt>&lsquo;<samp>row_interleaved_lr</samp>&rsquo;</dt>
  14595. <dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
  14596. </p></dd>
  14597. <dt>&lsquo;<samp>col_interleaved_rl</samp>&rsquo;</dt>
  14598. <dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
  14599. </p></dd>
  14600. <dt>&lsquo;<samp>col_interleaved_lr</samp>&rsquo;</dt>
  14601. <dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
  14602. </p></dd>
  14603. <dt>&lsquo;<samp>anaglyph_cyan_red</samp>&rsquo;</dt>
  14604. <dd><p>All frames are in anaglyph format viewable through red-cyan filters
  14605. </p></dd>
  14606. <dt>&lsquo;<samp>right_left</samp>&rsquo;</dt>
  14607. <dd><p>Both views are arranged side by side, Right-eye view is on the left
  14608. </p></dd>
  14609. <dt>&lsquo;<samp>anaglyph_green_magenta</samp>&rsquo;</dt>
  14610. <dd><p>All frames are in anaglyph format viewable through green-magenta filters
  14611. </p></dd>
  14612. <dt>&lsquo;<samp>block_lr</samp>&rsquo;</dt>
  14613. <dd><p>Both eyes laced in one Block, Left-eye view is first
  14614. </p></dd>
  14615. <dt>&lsquo;<samp>block_rl</samp>&rsquo;</dt>
  14616. <dd><p>Both eyes laced in one Block, Right-eye view is first
  14617. </p></dd>
  14618. </dl>
  14619. </dd>
  14620. </dl>
  14621. <p>For example a 3D WebM clip can be created using the following command line:
  14622. </p><div class="example">
  14623. <pre class="example">ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
  14624. </pre></div>
  14625. <a name="Options-57"></a>
  14626. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-57">21.16.2 Options</a></h3>
  14627. <p>This muxer supports the following options:
  14628. </p>
  14629. <dl compact="compact">
  14630. <dt>&lsquo;<samp>reserve_index_space</samp>&rsquo;</dt>
  14631. <dd><p>By default, this muxer writes the index for seeking (called cues in Matroska
  14632. terms) at the end of the file, because it cannot know in advance how much space
  14633. to leave for the index at the beginning of the file. However for some use cases
  14634. &ndash; e.g. streaming where seeking is possible but slow &ndash; it is useful to put the
  14635. index at the beginning of the file.
  14636. </p>
  14637. <p>If this option is set to a non-zero value, the muxer will reserve a given amount
  14638. of space in the file header and then try to write the cues there when the muxing
  14639. finishes. If the reserved space does not suffice, no Cues will be written, the
  14640. file will be finalized and writing the trailer will return an error.
  14641. A safe size for most use cases should be about 50kB per hour of video.
  14642. </p>
  14643. <p>Note that cues are only written if the output is seekable and this option will
  14644. have no effect if it is not.
  14645. </p></dd>
  14646. <dt>&lsquo;<samp>default_mode</samp>&rsquo;</dt>
  14647. <dd><p>This option controls how the FlagDefault of the output tracks will be set.
  14648. It influences which tracks players should play by default. The default mode
  14649. is &lsquo;<samp>infer</samp>&rsquo;.
  14650. </p><dl compact="compact">
  14651. <dt>&lsquo;<samp>infer</samp>&rsquo;</dt>
  14652. <dd><p>In this mode, for each type of track (audio, video or subtitle), if there is
  14653. a track with disposition default of this type, then the first such track
  14654. (i.e. the one with the lowest index) will be marked as default; if no such
  14655. track exists, the first track of this type will be marked as default instead
  14656. (if existing). This ensures that the default flag is set in a sensible way even
  14657. if the input originated from containers that lack the concept of default tracks.
  14658. </p></dd>
  14659. <dt>&lsquo;<samp>infer_no_subs</samp>&rsquo;</dt>
  14660. <dd><p>This mode is the same as infer except that if no subtitle track with
  14661. disposition default exists, no subtitle track will be marked as default.
  14662. </p></dd>
  14663. <dt>&lsquo;<samp>passthrough</samp>&rsquo;</dt>
  14664. <dd><p>In this mode the FlagDefault is set if and only if the AV_DISPOSITION_DEFAULT
  14665. flag is set in the disposition of the corresponding stream.
  14666. </p></dd>
  14667. </dl>
  14668. </dd>
  14669. </dl>
  14670. <p><a name="md5"></a>
  14671. </p><a name="md5-2"></a>
  14672. <h2 class="section"><a href="ffmpeg-all.html#toc-md5-2">21.17 md5</a></h2>
  14673. <p>MD5 testing format.
  14674. </p>
  14675. <p>This is a variant of the <a href="#hash">hash</a> muxer. Unlike that muxer, it
  14676. defaults to using the MD5 hash function.
  14677. </p>
  14678. <a name="Examples-107"></a>
  14679. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-107">21.17.1 Examples</a></h3>
  14680. <p>To compute the MD5 hash of the input converted to raw
  14681. audio and video, and store it in the file &lsquo;<tt>out.md5</tt>&rsquo;:
  14682. </p><div class="example">
  14683. <pre class="example">ffmpeg -i INPUT -f md5 out.md5
  14684. </pre></div>
  14685. <p>You can print the MD5 to stdout with the command:
  14686. </p><div class="example">
  14687. <pre class="example">ffmpeg -i INPUT -f md5 -
  14688. </pre></div>
  14689. <p>See also the <a href="#hash">hash</a> and <a href="#framemd5">framemd5</a> muxers.
  14690. </p>
  14691. <a name="mov_002c-mp4_002c-ismv"></a>
  14692. <h2 class="section"><a href="ffmpeg-all.html#toc-mov_002c-mp4_002c-ismv">21.18 mov, mp4, ismv</a></h2>
  14693. <p>MOV/MP4/ISMV (Smooth Streaming) muxer.
  14694. </p>
  14695. <p>The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4
  14696. file has all the metadata about all packets stored in one location
  14697. (written at the end of the file, it can be moved to the start for
  14698. better playback by adding <var>faststart</var> to the <var>movflags</var>, or
  14699. using the <code>qt-faststart</code> tool). A fragmented
  14700. file consists of a number of fragments, where packets and metadata
  14701. about these packets are stored together. Writing a fragmented
  14702. file has the advantage that the file is decodable even if the
  14703. writing is interrupted (while a normal MOV/MP4 is undecodable if
  14704. it is not properly finished), and it requires less memory when writing
  14705. very long files (since writing normal MOV/MP4 files stores info about
  14706. every single packet in memory until the file is closed). The downside
  14707. is that it is less compatible with other applications.
  14708. </p>
  14709. <a name="Options-81"></a>
  14710. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-81">21.18.1 Options</a></h3>
  14711. <p>Fragmentation is enabled by setting one of the AVOptions that define
  14712. how to cut the file into fragments:
  14713. </p>
  14714. <dl compact="compact">
  14715. <dt>&lsquo;<samp>-moov_size <var>bytes</var></samp>&rsquo;</dt>
  14716. <dd><p>Reserves space for the moov atom at the beginning of the file instead of placing the
  14717. moov atom at the end. If the space reserved is insufficient, muxing will fail.
  14718. </p></dd>
  14719. <dt>&lsquo;<samp>-movflags frag_keyframe</samp>&rsquo;</dt>
  14720. <dd><p>Start a new fragment at each video keyframe.
  14721. </p></dd>
  14722. <dt>&lsquo;<samp>-frag_duration <var>duration</var></samp>&rsquo;</dt>
  14723. <dd><p>Create fragments that are <var>duration</var> microseconds long.
  14724. </p></dd>
  14725. <dt>&lsquo;<samp>-frag_size <var>size</var></samp>&rsquo;</dt>
  14726. <dd><p>Create fragments that contain up to <var>size</var> bytes of payload data.
  14727. </p></dd>
  14728. <dt>&lsquo;<samp>-movflags frag_custom</samp>&rsquo;</dt>
  14729. <dd><p>Allow the caller to manually choose when to cut fragments, by
  14730. calling <code>av_write_frame(ctx, NULL)</code> to write a fragment with
  14731. the packets written so far. (This is only useful with other
  14732. applications integrating libavformat, not from <code>ffmpeg</code>.)
  14733. </p></dd>
  14734. <dt>&lsquo;<samp>-min_frag_duration <var>duration</var></samp>&rsquo;</dt>
  14735. <dd><p>Don&rsquo;t create fragments that are shorter than <var>duration</var> microseconds long.
  14736. </p></dd>
  14737. </dl>
  14738. <p>If more than one condition is specified, fragments are cut when
  14739. one of the specified conditions is fulfilled. The exception to this is
  14740. <code>-min_frag_duration</code>, which has to be fulfilled for any of the other
  14741. conditions to apply.
  14742. </p>
  14743. <p>Additionally, the way the output file is written can be adjusted
  14744. through a few other options:
  14745. </p>
  14746. <dl compact="compact">
  14747. <dt>&lsquo;<samp>-movflags empty_moov</samp>&rsquo;</dt>
  14748. <dd><p>Write an initial moov atom directly at the start of the file, without
  14749. describing any samples in it. Generally, an mdat/moov pair is written
  14750. at the start of the file, as a normal MOV/MP4 file, containing only
  14751. a short portion of the file. With this option set, there is no initial
  14752. mdat atom, and the moov atom only describes the tracks but has
  14753. a zero duration.
  14754. </p>
  14755. <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
  14756. </p></dd>
  14757. <dt>&lsquo;<samp>-movflags separate_moof</samp>&rsquo;</dt>
  14758. <dd><p>Write a separate moof (movie fragment) atom for each track. Normally,
  14759. packets for all tracks are written in a moof atom (which is slightly
  14760. more efficient), but with this option set, the muxer writes one moof/mdat
  14761. pair for each track, making it easier to separate tracks.
  14762. </p>
  14763. <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
  14764. </p></dd>
  14765. <dt>&lsquo;<samp>-movflags skip_sidx</samp>&rsquo;</dt>
  14766. <dd><p>Skip writing of sidx atom. When bitrate overhead due to sidx atom is high,
  14767. this option could be used for cases where sidx atom is not mandatory.
  14768. When global_sidx flag is enabled, this option will be ignored.
  14769. </p></dd>
  14770. <dt>&lsquo;<samp>-movflags faststart</samp>&rsquo;</dt>
  14771. <dd><p>Run a second pass moving the index (moov atom) to the beginning of the file.
  14772. This operation can take a while, and will not work in various situations such
  14773. as fragmented output, thus it is not enabled by default.
  14774. </p></dd>
  14775. <dt>&lsquo;<samp>-movflags rtphint</samp>&rsquo;</dt>
  14776. <dd><p>Add RTP hinting tracks to the output file.
  14777. </p></dd>
  14778. <dt>&lsquo;<samp>-movflags disable_chpl</samp>&rsquo;</dt>
  14779. <dd><p>Disable Nero chapter markers (chpl atom). Normally, both Nero chapters
  14780. and a QuickTime chapter track are written to the file. With this option
  14781. set, only the QuickTime chapter track will be written. Nero chapters can
  14782. cause failures when the file is reprocessed with certain tagging programs, like
  14783. mp3Tag 2.61a and iTunes 11.3, most likely other versions are affected as well.
  14784. </p></dd>
  14785. <dt>&lsquo;<samp>-movflags omit_tfhd_offset</samp>&rsquo;</dt>
  14786. <dd><p>Do not write any absolute base_data_offset in tfhd atoms. This avoids
  14787. tying fragments to absolute byte positions in the file/streams.
  14788. </p></dd>
  14789. <dt>&lsquo;<samp>-movflags default_base_moof</samp>&rsquo;</dt>
  14790. <dd><p>Similarly to the omit_tfhd_offset, this flag avoids writing the
  14791. absolute base_data_offset field in tfhd atoms, but does so by using
  14792. the new default-base-is-moof flag instead. This flag is new from
  14793. 14496-12:2012. This may make the fragments easier to parse in certain
  14794. circumstances (avoiding basing track fragment location calculations
  14795. on the implicit end of the previous track fragment).
  14796. </p></dd>
  14797. <dt>&lsquo;<samp>-write_tmcd</samp>&rsquo;</dt>
  14798. <dd><p>Specify <code>on</code> to force writing a timecode track, <code>off</code> to disable it
  14799. and <code>auto</code> to write a timecode track only for mov and mp4 output (default).
  14800. </p></dd>
  14801. <dt>&lsquo;<samp>-movflags negative_cts_offsets</samp>&rsquo;</dt>
  14802. <dd><p>Enables utilization of version 1 of the CTTS box, in which the CTS offsets can
  14803. be negative. This enables the initial sample to have DTS/CTS of zero, and
  14804. reduces the need for edit lists for some cases such as video tracks with
  14805. B-frames. Additionally, eases conformance with the DASH-IF interoperability
  14806. guidelines.
  14807. </p>
  14808. <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
  14809. </p></dd>
  14810. <dt>&lsquo;<samp>-write_prft</samp>&rsquo;</dt>
  14811. <dd><p>Write producer time reference box (PRFT) with a specified time source for the
  14812. NTP field in the PRFT box. Set value as &lsquo;<samp>wallclock</samp>&rsquo; to specify timesource
  14813. as wallclock time and &lsquo;<samp>pts</samp>&rsquo; to specify timesource as input packets&rsquo; PTS
  14814. values.
  14815. </p>
  14816. <p>Setting value to &lsquo;<samp>pts</samp>&rsquo; is applicable only for a live encoding use case,
  14817. where PTS values are set as as wallclock time at the source. For example, an
  14818. encoding use case with decklink capture source where &lsquo;<samp>video_pts</samp>&rsquo; and
  14819. &lsquo;<samp>audio_pts</samp>&rsquo; are set to &lsquo;<samp>abs_wallclock</samp>&rsquo;.
  14820. </p></dd>
  14821. </dl>
  14822. <a name="Example-1"></a>
  14823. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-1">21.18.2 Example</a></h3>
  14824. <p>Smooth Streaming content can be pushed in real time to a publishing
  14825. point on IIS with this muxer. Example:
  14826. </p><div class="example">
  14827. <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)
  14828. </pre></div>
  14829. <a name="mp3"></a>
  14830. <h2 class="section"><a href="ffmpeg-all.html#toc-mp3">21.19 mp3</a></h2>
  14831. <p>The MP3 muxer writes a raw MP3 stream with the following optional features:
  14832. </p><ul>
  14833. <li>
  14834. An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and
  14835. 2.4 are supported, the <code>id3v2_version</code> private option controls which one is
  14836. used (3 or 4). Setting <code>id3v2_version</code> to 0 disables the ID3v2 header
  14837. completely.
  14838. <p>The muxer supports writing attached pictures (APIC frames) to the ID3v2 header.
  14839. The pictures are supplied to the muxer in form of a video stream with a single
  14840. packet. There can be any number of those streams, each will correspond to a
  14841. single APIC frame. The stream metadata tags <var>title</var> and <var>comment</var> map
  14842. to APIC <var>description</var> and <var>picture type</var> respectively. See
  14843. <a href="http://id3.org/id3v2.4.0-frames">http://id3.org/id3v2.4.0-frames</a> for allowed picture types.
  14844. </p>
  14845. <p>Note that the APIC frames must be written at the beginning, so the muxer will
  14846. buffer the audio frames until it gets all the pictures. It is therefore advised
  14847. to provide the pictures as soon as possible to avoid excessive buffering.
  14848. </p>
  14849. </li><li>
  14850. A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by
  14851. default, but will be written only if the output is seekable. The
  14852. <code>write_xing</code> private option can be used to disable it. The frame contains
  14853. various information that may be useful to the decoder, like the audio duration
  14854. or encoder delay.
  14855. </li><li>
  14856. A legacy ID3v1 tag at the end of the file (disabled by default). It may be
  14857. enabled with the <code>write_id3v1</code> private option, but as its capabilities are
  14858. very limited, its usage is not recommended.
  14859. </li></ul>
  14860. <p>Examples:
  14861. </p>
  14862. <p>Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
  14863. </p><div class="example">
  14864. <pre class="example">ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
  14865. </pre></div>
  14866. <p>To attach a picture to an mp3 file select both the audio and the picture stream
  14867. with <code>map</code>:
  14868. </p><div class="example">
  14869. <pre class="example">ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
  14870. -metadata:s:v title=&quot;Album cover&quot; -metadata:s:v comment=&quot;Cover (Front)&quot; out.mp3
  14871. </pre></div>
  14872. <p>Write a &quot;clean&quot; MP3 without any extra features:
  14873. </p><div class="example">
  14874. <pre class="example">ffmpeg -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
  14875. </pre></div>
  14876. <a name="mpegts"></a>
  14877. <h2 class="section"><a href="ffmpeg-all.html#toc-mpegts">21.20 mpegts</a></h2>
  14878. <p>MPEG transport stream muxer.
  14879. </p>
  14880. <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
  14881. </p>
  14882. <p>The recognized metadata settings in mpegts muxer are <code>service_provider</code>
  14883. and <code>service_name</code>. If they are not set the default for
  14884. <code>service_provider</code> is &lsquo;<samp>FFmpeg</samp>&rsquo; and the default for
  14885. <code>service_name</code> is &lsquo;<samp>Service01</samp>&rsquo;.
  14886. </p>
  14887. <a name="Options-69"></a>
  14888. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-69">21.20.1 Options</a></h3>
  14889. <p>The muxer options are:
  14890. </p>
  14891. <dl compact="compact">
  14892. <dt>&lsquo;<samp>mpegts_transport_stream_id <var>integer</var></samp>&rsquo;</dt>
  14893. <dd><p>Set the &lsquo;<samp>transport_stream_id</samp>&rsquo;. This identifies a transponder in DVB.
  14894. Default is <code>0x0001</code>.
  14895. </p>
  14896. </dd>
  14897. <dt>&lsquo;<samp>mpegts_original_network_id <var>integer</var></samp>&rsquo;</dt>
  14898. <dd><p>Set the &lsquo;<samp>original_network_id</samp>&rsquo;. This is unique identifier of a
  14899. network in DVB. Its main use is in the unique identification of a service
  14900. through the path &lsquo;<samp>Original_Network_ID, Transport_Stream_ID</samp>&rsquo;. Default
  14901. is <code>0x0001</code>.
  14902. </p>
  14903. </dd>
  14904. <dt>&lsquo;<samp>mpegts_service_id <var>integer</var></samp>&rsquo;</dt>
  14905. <dd><p>Set the &lsquo;<samp>service_id</samp>&rsquo;, also known as program in DVB. Default is
  14906. <code>0x0001</code>.
  14907. </p>
  14908. </dd>
  14909. <dt>&lsquo;<samp>mpegts_service_type <var>integer</var></samp>&rsquo;</dt>
  14910. <dd><p>Set the program &lsquo;<samp>service_type</samp>&rsquo;. Default is <code>digital_tv</code>.
  14911. Accepts the following options:
  14912. </p><dl compact="compact">
  14913. <dt>&lsquo;<samp>hex_value</samp>&rsquo;</dt>
  14914. <dd><p>Any hexadecimal value between <code>0x01</code> and <code>0xff</code> as defined in
  14915. ETSI 300 468.
  14916. </p></dd>
  14917. <dt>&lsquo;<samp>digital_tv</samp>&rsquo;</dt>
  14918. <dd><p>Digital TV service.
  14919. </p></dd>
  14920. <dt>&lsquo;<samp>digital_radio</samp>&rsquo;</dt>
  14921. <dd><p>Digital Radio service.
  14922. </p></dd>
  14923. <dt>&lsquo;<samp>teletext</samp>&rsquo;</dt>
  14924. <dd><p>Teletext service.
  14925. </p></dd>
  14926. <dt>&lsquo;<samp>advanced_codec_digital_radio</samp>&rsquo;</dt>
  14927. <dd><p>Advanced Codec Digital Radio service.
  14928. </p></dd>
  14929. <dt>&lsquo;<samp>mpeg2_digital_hdtv</samp>&rsquo;</dt>
  14930. <dd><p>MPEG2 Digital HDTV service.
  14931. </p></dd>
  14932. <dt>&lsquo;<samp>advanced_codec_digital_sdtv</samp>&rsquo;</dt>
  14933. <dd><p>Advanced Codec Digital SDTV service.
  14934. </p></dd>
  14935. <dt>&lsquo;<samp>advanced_codec_digital_hdtv</samp>&rsquo;</dt>
  14936. <dd><p>Advanced Codec Digital HDTV service.
  14937. </p></dd>
  14938. </dl>
  14939. </dd>
  14940. <dt>&lsquo;<samp>mpegts_pmt_start_pid <var>integer</var></samp>&rsquo;</dt>
  14941. <dd><p>Set the first PID for PMTs. Default is <code>0x1000</code>, minimum is <code>0x0020</code>,
  14942. maximum is <code>0x1ffa</code>. This option has no effect in m2ts mode where the PMT
  14943. PID is fixed <code>0x0100</code>.
  14944. </p>
  14945. </dd>
  14946. <dt>&lsquo;<samp>mpegts_start_pid <var>integer</var></samp>&rsquo;</dt>
  14947. <dd><p>Set the first PID for elementary streams. Default is <code>0x0100</code>, minimum is
  14948. <code>0x0020</code>, maximum is <code>0x1ffa</code>. This option has no effect in m2ts mode
  14949. where the elementary stream PIDs are fixed.
  14950. </p>
  14951. </dd>
  14952. <dt>&lsquo;<samp>mpegts_m2ts_mode <var>boolean</var></samp>&rsquo;</dt>
  14953. <dd><p>Enable m2ts mode if set to <code>1</code>. Default value is <code>-1</code> which
  14954. disables m2ts mode.
  14955. </p>
  14956. </dd>
  14957. <dt>&lsquo;<samp>muxrate <var>integer</var></samp>&rsquo;</dt>
  14958. <dd><p>Set a constant muxrate. Default is VBR.
  14959. </p>
  14960. </dd>
  14961. <dt>&lsquo;<samp>pes_payload_size <var>integer</var></samp>&rsquo;</dt>
  14962. <dd><p>Set minimum PES packet payload in bytes. Default is <code>2930</code>.
  14963. </p>
  14964. </dd>
  14965. <dt>&lsquo;<samp>mpegts_flags <var>flags</var></samp>&rsquo;</dt>
  14966. <dd><p>Set mpegts flags. Accepts the following options:
  14967. </p><dl compact="compact">
  14968. <dt>&lsquo;<samp>resend_headers</samp>&rsquo;</dt>
  14969. <dd><p>Reemit PAT/PMT before writing the next packet.
  14970. </p></dd>
  14971. <dt>&lsquo;<samp>latm</samp>&rsquo;</dt>
  14972. <dd><p>Use LATM packetization for AAC.
  14973. </p></dd>
  14974. <dt>&lsquo;<samp>pat_pmt_at_frames</samp>&rsquo;</dt>
  14975. <dd><p>Reemit PAT and PMT at each video frame.
  14976. </p></dd>
  14977. <dt>&lsquo;<samp>system_b</samp>&rsquo;</dt>
  14978. <dd><p>Conform to System B (DVB) instead of System A (ATSC).
  14979. </p></dd>
  14980. <dt>&lsquo;<samp>initial_discontinuity</samp>&rsquo;</dt>
  14981. <dd><p>Mark the initial packet of each stream as discontinuity.
  14982. </p></dd>
  14983. </dl>
  14984. </dd>
  14985. <dt>&lsquo;<samp>mpegts_copyts <var>boolean</var></samp>&rsquo;</dt>
  14986. <dd><p>Preserve original timestamps, if value is set to <code>1</code>. Default value
  14987. is <code>-1</code>, which results in shifting timestamps so that they start from 0.
  14988. </p>
  14989. </dd>
  14990. <dt>&lsquo;<samp>omit_video_pes_length <var>boolean</var></samp>&rsquo;</dt>
  14991. <dd><p>Omit the PES packet length for video packets. Default is <code>1</code> (true).
  14992. </p>
  14993. </dd>
  14994. <dt>&lsquo;<samp>pcr_period <var>integer</var></samp>&rsquo;</dt>
  14995. <dd><p>Override the default PCR retransmission time in milliseconds. Default is
  14996. <code>-1</code> which means that the PCR interval will be determined automatically:
  14997. 20 ms is used for CBR streams, the highest multiple of the frame duration which
  14998. is less than 100 ms is used for VBR streams.
  14999. </p>
  15000. </dd>
  15001. <dt>&lsquo;<samp>pat_period <var>duration</var></samp>&rsquo;</dt>
  15002. <dd><p>Maximum time in seconds between PAT/PMT tables. Default is <code>0.1</code>.
  15003. </p>
  15004. </dd>
  15005. <dt>&lsquo;<samp>sdt_period <var>duration</var></samp>&rsquo;</dt>
  15006. <dd><p>Maximum time in seconds between SDT tables. Default is <code>0.5</code>.
  15007. </p>
  15008. </dd>
  15009. <dt>&lsquo;<samp>tables_version <var>integer</var></samp>&rsquo;</dt>
  15010. <dd><p>Set PAT, PMT and SDT version (default <code>0</code>, valid values are from 0 to 31, inclusively).
  15011. This option allows updating stream structure so that standard consumer may
  15012. detect the change. To do so, reopen output <code>AVFormatContext</code> (in case of API
  15013. usage) or restart <code>ffmpeg</code> instance, cyclically changing
  15014. &lsquo;<samp>tables_version</samp>&rsquo; value:
  15015. </p>
  15016. <div class="example">
  15017. <pre class="example">ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  15018. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  15019. ...
  15020. ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
  15021. ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  15022. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  15023. ...
  15024. </pre></div>
  15025. </dd>
  15026. </dl>
  15027. <a name="Example-9"></a>
  15028. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-9">21.20.2 Example</a></h3>
  15029. <div class="example">
  15030. <pre class="example">ffmpeg -i file.mpg -c copy \
  15031. -mpegts_original_network_id 0x1122 \
  15032. -mpegts_transport_stream_id 0x3344 \
  15033. -mpegts_service_id 0x5566 \
  15034. -mpegts_pmt_start_pid 0x1500 \
  15035. -mpegts_start_pid 0x150 \
  15036. -metadata service_provider=&quot;Some provider&quot; \
  15037. -metadata service_name=&quot;Some Channel&quot; \
  15038. out.ts
  15039. </pre></div>
  15040. <a name="mxf_002c-mxf_005fd10_002c-mxf_005fopatom"></a>
  15041. <h2 class="section"><a href="ffmpeg-all.html#toc-mxf_002c-mxf_005fd10_002c-mxf_005fopatom">21.21 mxf, mxf_d10, mxf_opatom</a></h2>
  15042. <p>MXF muxer.
  15043. </p>
  15044. <a name="Options-73"></a>
  15045. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-73">21.21.1 Options</a></h3>
  15046. <p>The muxer options are:
  15047. </p>
  15048. <dl compact="compact">
  15049. <dt>&lsquo;<samp>store_user_comments <var>bool</var></samp>&rsquo;</dt>
  15050. <dd><p>Set if user comments should be stored if available or never.
  15051. IRT D-10 does not allow user comments. The default is thus to write them for
  15052. mxf and mxf_opatom but not for mxf_d10
  15053. </p></dd>
  15054. </dl>
  15055. <a name="null-1"></a>
  15056. <h2 class="section"><a href="ffmpeg-all.html#toc-null-1">21.22 null</a></h2>
  15057. <p>Null muxer.
  15058. </p>
  15059. <p>This muxer does not generate any output file, it is mainly useful for
  15060. testing or benchmarking purposes.
  15061. </p>
  15062. <p>For example to benchmark decoding with <code>ffmpeg</code> you can use the
  15063. command:
  15064. </p><div class="example">
  15065. <pre class="example">ffmpeg -benchmark -i INPUT -f null out.null
  15066. </pre></div>
  15067. <p>Note that the above command does not read or write the &lsquo;<tt>out.null</tt>&rsquo;
  15068. file, but specifying the output file is required by the <code>ffmpeg</code>
  15069. syntax.
  15070. </p>
  15071. <p>Alternatively you can write the command as:
  15072. </p><div class="example">
  15073. <pre class="example">ffmpeg -benchmark -i INPUT -f null -
  15074. </pre></div>
  15075. <a name="nut"></a>
  15076. <h2 class="section"><a href="ffmpeg-all.html#toc-nut">21.23 nut</a></h2>
  15077. <dl compact="compact">
  15078. <dt>&lsquo;<samp>-syncpoints <var>flags</var></samp>&rsquo;</dt>
  15079. <dd><p>Change the syncpoint usage in nut:
  15080. </p><dl compact="compact">
  15081. <dt>&lsquo;<samp><var>default</var> use the normal low-overhead seeking aids.</samp>&rsquo;</dt>
  15082. <dt>&lsquo;<samp><var>none</var> do not use the syncpoints at all, reducing the overhead but making the stream non-seekable;</samp>&rsquo;</dt>
  15083. <dd><p> Use of this option is not recommended, as the resulting files are very damage
  15084. sensitive and seeking is not possible. Also in general the overhead from
  15085. syncpoints is negligible. Note, -<code>write_index</code> 0 can be used to disable
  15086. all growing data tables, allowing to mux endless streams with limited memory
  15087. and without these disadvantages.
  15088. </p></dd>
  15089. <dt>&lsquo;<samp><var>timestamped</var> extend the syncpoint with a wallclock field.</samp>&rsquo;</dt>
  15090. </dl>
  15091. <p>The <var>none</var> and <var>timestamped</var> flags are experimental.
  15092. </p></dd>
  15093. <dt>&lsquo;<samp>-write_index <var>bool</var></samp>&rsquo;</dt>
  15094. <dd><p>Write index at the end, the default is to write an index.
  15095. </p></dd>
  15096. </dl>
  15097. <div class="example">
  15098. <pre class="example">ffmpeg -i INPUT -f_strict experimental -syncpoints none - | processor
  15099. </pre></div>
  15100. <a name="ogg"></a>
  15101. <h2 class="section"><a href="ffmpeg-all.html#toc-ogg">21.24 ogg</a></h2>
  15102. <p>Ogg container muxer.
  15103. </p>
  15104. <dl compact="compact">
  15105. <dt>&lsquo;<samp>-page_duration <var>duration</var></samp>&rsquo;</dt>
  15106. <dd><p>Preferred page duration, in microseconds. The muxer will attempt to create
  15107. pages that are approximately <var>duration</var> microseconds long. This allows the
  15108. user to compromise between seek granularity and container overhead. The default
  15109. is 1 second. A value of 0 will fill all segments, making pages as large as
  15110. possible. A value of 1 will effectively use 1 packet-per-page in most
  15111. situations, giving a small seek granularity at the cost of additional container
  15112. overhead.
  15113. </p></dd>
  15114. <dt>&lsquo;<samp>-serial_offset <var>value</var></samp>&rsquo;</dt>
  15115. <dd><p>Serial value from which to set the streams serial number.
  15116. Setting it to different and sufficiently large values ensures that the produced
  15117. ogg files can be safely chained.
  15118. </p>
  15119. </dd>
  15120. </dl>
  15121. <p><a name="segment"></a>
  15122. </p><a name="segment_002c-stream_005fsegment_002c-ssegment"></a>
  15123. <h2 class="section"><a href="ffmpeg-all.html#toc-segment_002c-stream_005fsegment_002c-ssegment">21.25 segment, stream_segment, ssegment</a></h2>
  15124. <p>Basic stream segmenter.
  15125. </p>
  15126. <p>This muxer outputs streams to a number of separate files of nearly
  15127. fixed duration. Output filename pattern can be set in a fashion
  15128. similar to <a href="#image2">image2</a>, or by using a <code>strftime</code> template if
  15129. the &lsquo;<samp>strftime</samp>&rsquo; option is enabled.
  15130. </p>
  15131. <p><code>stream_segment</code> is a variant of the muxer used to write to
  15132. streaming output formats, i.e. which do not require global headers,
  15133. and is recommended for outputting e.g. to MPEG transport stream segments.
  15134. <code>ssegment</code> is a shorter alias for <code>stream_segment</code>.
  15135. </p>
  15136. <p>Every segment starts with a keyframe of the selected reference stream,
  15137. which is set through the &lsquo;<samp>reference_stream</samp>&rsquo; option.
  15138. </p>
  15139. <p>Note that if you want accurate splitting for a video file, you need to
  15140. make the input key frames correspond to the exact splitting times
  15141. expected by the segmenter, or the segment muxer will start the new
  15142. segment with the key frame found next after the specified start
  15143. time.
  15144. </p>
  15145. <p>The segment muxer works best with a single constant frame rate video.
  15146. </p>
  15147. <p>Optionally it can generate a list of the created segments, by setting
  15148. the option <var>segment_list</var>. The list type is specified by the
  15149. <var>segment_list_type</var> option. The entry filenames in the segment
  15150. list are set by default to the basename of the corresponding segment
  15151. files.
  15152. </p>
  15153. <p>See also the <a href="#hls">hls</a> muxer, which provides a more specific
  15154. implementation for HLS segmentation.
  15155. </p>
  15156. <a name="Options-36"></a>
  15157. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-36">21.25.1 Options</a></h3>
  15158. <p>The segment muxer supports the following options:
  15159. </p>
  15160. <dl compact="compact">
  15161. <dt>&lsquo;<samp>increment_tc <var>1|0</var></samp>&rsquo;</dt>
  15162. <dd><p>if set to <code>1</code>, increment timecode between each segment
  15163. If this is selected, the input need to have
  15164. a timecode in the first video stream. Default value is
  15165. <code>0</code>.
  15166. </p>
  15167. </dd>
  15168. <dt>&lsquo;<samp>reference_stream <var>specifier</var></samp>&rsquo;</dt>
  15169. <dd><p>Set the reference stream, as specified by the string <var>specifier</var>.
  15170. If <var>specifier</var> is set to <code>auto</code>, the reference is chosen
  15171. automatically. Otherwise it must be a stream specifier (see the &ldquo;Stream
  15172. specifiers&rdquo; chapter in the ffmpeg manual) which specifies the
  15173. reference stream. The default value is <code>auto</code>.
  15174. </p>
  15175. </dd>
  15176. <dt>&lsquo;<samp>segment_format <var>format</var></samp>&rsquo;</dt>
  15177. <dd><p>Override the inner container format, by default it is guessed by the filename
  15178. extension.
  15179. </p>
  15180. </dd>
  15181. <dt>&lsquo;<samp>segment_format_options <var>options_list</var></samp>&rsquo;</dt>
  15182. <dd><p>Set output format options using a :-separated list of key=value
  15183. parameters. Values containing the <code>:</code> special character must be
  15184. escaped.
  15185. </p>
  15186. </dd>
  15187. <dt>&lsquo;<samp>segment_list <var>name</var></samp>&rsquo;</dt>
  15188. <dd><p>Generate also a listfile named <var>name</var>. If not specified no
  15189. listfile is generated.
  15190. </p>
  15191. </dd>
  15192. <dt>&lsquo;<samp>segment_list_flags <var>flags</var></samp>&rsquo;</dt>
  15193. <dd><p>Set flags affecting the segment list generation.
  15194. </p>
  15195. <p>It currently supports the following flags:
  15196. </p><dl compact="compact">
  15197. <dt>&lsquo;<samp>cache</samp>&rsquo;</dt>
  15198. <dd><p>Allow caching (only affects M3U8 list files).
  15199. </p>
  15200. </dd>
  15201. <dt>&lsquo;<samp>live</samp>&rsquo;</dt>
  15202. <dd><p>Allow live-friendly file generation.
  15203. </p></dd>
  15204. </dl>
  15205. </dd>
  15206. <dt>&lsquo;<samp>segment_list_size <var>size</var></samp>&rsquo;</dt>
  15207. <dd><p>Update the list file so that it contains at most <var>size</var>
  15208. segments. If 0 the list file will contain all the segments. Default
  15209. value is 0.
  15210. </p>
  15211. </dd>
  15212. <dt>&lsquo;<samp>segment_list_entry_prefix <var>prefix</var></samp>&rsquo;</dt>
  15213. <dd><p>Prepend <var>prefix</var> to each entry. Useful to generate absolute paths.
  15214. By default no prefix is applied.
  15215. </p>
  15216. </dd>
  15217. <dt>&lsquo;<samp>segment_list_type <var>type</var></samp>&rsquo;</dt>
  15218. <dd><p>Select the listing format.
  15219. </p>
  15220. <p>The following values are recognized:
  15221. </p><dl compact="compact">
  15222. <dt>&lsquo;<samp>flat</samp>&rsquo;</dt>
  15223. <dd><p>Generate a flat list for the created segments, one segment per line.
  15224. </p>
  15225. </dd>
  15226. <dt>&lsquo;<samp>csv, ext</samp>&rsquo;</dt>
  15227. <dd><p>Generate a list for the created segments, one segment per line,
  15228. each line matching the format (comma-separated values):
  15229. </p><div class="example">
  15230. <pre class="example"><var>segment_filename</var>,<var>segment_start_time</var>,<var>segment_end_time</var>
  15231. </pre></div>
  15232. <p><var>segment_filename</var> is the name of the output file generated by the
  15233. muxer according to the provided pattern. CSV escaping (according to
  15234. RFC4180) is applied if required.
  15235. </p>
  15236. <p><var>segment_start_time</var> and <var>segment_end_time</var> specify
  15237. the segment start and end time expressed in seconds.
  15238. </p>
  15239. <p>A list file with the suffix <code>&quot;.csv&quot;</code> or <code>&quot;.ext&quot;</code> will
  15240. auto-select this format.
  15241. </p>
  15242. <p>&lsquo;<samp>ext</samp>&rsquo; is deprecated in favor or &lsquo;<samp>csv</samp>&rsquo;.
  15243. </p>
  15244. </dd>
  15245. <dt>&lsquo;<samp>ffconcat</samp>&rsquo;</dt>
  15246. <dd><p>Generate an ffconcat file for the created segments. The resulting file
  15247. can be read using the FFmpeg <a href="#concat">concat</a> demuxer.
  15248. </p>
  15249. <p>A list file with the suffix <code>&quot;.ffcat&quot;</code> or <code>&quot;.ffconcat&quot;</code> will
  15250. auto-select this format.
  15251. </p>
  15252. </dd>
  15253. <dt>&lsquo;<samp>m3u8</samp>&rsquo;</dt>
  15254. <dd><p>Generate an extended M3U8 file, version 3, compliant with
  15255. <a href="http://tools.ietf.org/id/draft-pantos-http-live-streaming">http://tools.ietf.org/id/draft-pantos-http-live-streaming</a>.
  15256. </p>
  15257. <p>A list file with the suffix <code>&quot;.m3u8&quot;</code> will auto-select this format.
  15258. </p></dd>
  15259. </dl>
  15260. <p>If not specified the type is guessed from the list file name suffix.
  15261. </p>
  15262. </dd>
  15263. <dt>&lsquo;<samp>segment_time <var>time</var></samp>&rsquo;</dt>
  15264. <dd><p>Set segment duration to <var>time</var>, the value must be a duration
  15265. specification. Default value is &quot;2&quot;. See also the
  15266. &lsquo;<samp>segment_times</samp>&rsquo; option.
  15267. </p>
  15268. <p>Note that splitting may not be accurate, unless you force the
  15269. reference stream key-frames at the given time. See the introductory
  15270. notice and the examples below.
  15271. </p>
  15272. </dd>
  15273. <dt>&lsquo;<samp>segment_atclocktime <var>1|0</var></samp>&rsquo;</dt>
  15274. <dd><p>If set to &quot;1&quot; split at regular clock time intervals starting from 00:00
  15275. o&rsquo;clock. The <var>time</var> value specified in &lsquo;<samp>segment_time</samp>&rsquo; is
  15276. used for setting the length of the splitting interval.
  15277. </p>
  15278. <p>For example with &lsquo;<samp>segment_time</samp>&rsquo; set to &quot;900&quot; this makes it possible
  15279. to create files at 12:00 o&rsquo;clock, 12:15, 12:30, etc.
  15280. </p>
  15281. <p>Default value is &quot;0&quot;.
  15282. </p>
  15283. </dd>
  15284. <dt>&lsquo;<samp>segment_clocktime_offset <var>duration</var></samp>&rsquo;</dt>
  15285. <dd><p>Delay the segment splitting times with the specified duration when using
  15286. &lsquo;<samp>segment_atclocktime</samp>&rsquo;.
  15287. </p>
  15288. <p>For example with &lsquo;<samp>segment_time</samp>&rsquo; set to &quot;900&quot; and
  15289. &lsquo;<samp>segment_clocktime_offset</samp>&rsquo; set to &quot;300&quot; this makes it possible to
  15290. create files at 12:05, 12:20, 12:35, etc.
  15291. </p>
  15292. <p>Default value is &quot;0&quot;.
  15293. </p>
  15294. </dd>
  15295. <dt>&lsquo;<samp>segment_clocktime_wrap_duration <var>duration</var></samp>&rsquo;</dt>
  15296. <dd><p>Force the segmenter to only start a new segment if a packet reaches the muxer
  15297. within the specified duration after the segmenting clock time. This way you
  15298. can make the segmenter more resilient to backward local time jumps, such as
  15299. leap seconds or transition to standard time from daylight savings time.
  15300. </p>
  15301. <p>Default is the maximum possible duration which means starting a new segment
  15302. regardless of the elapsed time since the last clock time.
  15303. </p>
  15304. </dd>
  15305. <dt>&lsquo;<samp>segment_time_delta <var>delta</var></samp>&rsquo;</dt>
  15306. <dd><p>Specify the accuracy time when selecting the start time for a
  15307. segment, expressed as a duration specification. Default value is &quot;0&quot;.
  15308. </p>
  15309. <p>When delta is specified a key-frame will start a new segment if its
  15310. PTS satisfies the relation:
  15311. </p><div class="example">
  15312. <pre class="example">PTS &gt;= start_time - time_delta
  15313. </pre></div>
  15314. <p>This option is useful when splitting video content, which is always
  15315. split at GOP boundaries, in case a key frame is found just before the
  15316. specified split time.
  15317. </p>
  15318. <p>In particular may be used in combination with the &lsquo;<tt>ffmpeg</tt>&rsquo; option
  15319. <var>force_key_frames</var>. The key frame times specified by
  15320. <var>force_key_frames</var> may not be set accurately because of rounding
  15321. issues, with the consequence that a key frame time may result set just
  15322. before the specified time. For constant frame rate videos a value of
  15323. 1/(2*<var>frame_rate</var>) should address the worst case mismatch between
  15324. the specified time and the time set by <var>force_key_frames</var>.
  15325. </p>
  15326. </dd>
  15327. <dt>&lsquo;<samp>segment_times <var>times</var></samp>&rsquo;</dt>
  15328. <dd><p>Specify a list of split points. <var>times</var> contains a list of comma
  15329. separated duration specifications, in increasing order. See also
  15330. the &lsquo;<samp>segment_time</samp>&rsquo; option.
  15331. </p>
  15332. </dd>
  15333. <dt>&lsquo;<samp>segment_frames <var>frames</var></samp>&rsquo;</dt>
  15334. <dd><p>Specify a list of split video frame numbers. <var>frames</var> contains a
  15335. list of comma separated integer numbers, in increasing order.
  15336. </p>
  15337. <p>This option specifies to start a new segment whenever a reference
  15338. stream key frame is found and the sequential number (starting from 0)
  15339. of the frame is greater or equal to the next value in the list.
  15340. </p>
  15341. </dd>
  15342. <dt>&lsquo;<samp>segment_wrap <var>limit</var></samp>&rsquo;</dt>
  15343. <dd><p>Wrap around segment index once it reaches <var>limit</var>.
  15344. </p>
  15345. </dd>
  15346. <dt>&lsquo;<samp>segment_start_number <var>number</var></samp>&rsquo;</dt>
  15347. <dd><p>Set the sequence number of the first segment. Defaults to <code>0</code>.
  15348. </p>
  15349. </dd>
  15350. <dt>&lsquo;<samp>strftime <var>1|0</var></samp>&rsquo;</dt>
  15351. <dd><p>Use the <code>strftime</code> function to define the name of the new
  15352. segments to write. If this is selected, the output segment name must
  15353. contain a <code>strftime</code> function template. Default value is
  15354. <code>0</code>.
  15355. </p>
  15356. </dd>
  15357. <dt>&lsquo;<samp>break_non_keyframes <var>1|0</var></samp>&rsquo;</dt>
  15358. <dd><p>If enabled, allow segments to start on frames other than keyframes. This
  15359. improves behavior on some players when the time between keyframes is
  15360. inconsistent, but may make things worse on others, and can cause some oddities
  15361. during seeking. Defaults to <code>0</code>.
  15362. </p>
  15363. </dd>
  15364. <dt>&lsquo;<samp>reset_timestamps <var>1|0</var></samp>&rsquo;</dt>
  15365. <dd><p>Reset timestamps at the beginning of each segment, so that each segment
  15366. will start with near-zero timestamps. It is meant to ease the playback
  15367. of the generated segments. May not work with some combinations of
  15368. muxers/codecs. It is set to <code>0</code> by default.
  15369. </p>
  15370. </dd>
  15371. <dt>&lsquo;<samp>initial_offset <var>offset</var></samp>&rsquo;</dt>
  15372. <dd><p>Specify timestamp offset to apply to the output packet timestamps. The
  15373. argument must be a time duration specification, and defaults to 0.
  15374. </p>
  15375. </dd>
  15376. <dt>&lsquo;<samp>write_empty_segments <var>1|0</var></samp>&rsquo;</dt>
  15377. <dd><p>If enabled, write an empty segment if there are no packets during the period a
  15378. segment would usually span. Otherwise, the segment will be filled with the next
  15379. packet written. Defaults to <code>0</code>.
  15380. </p></dd>
  15381. </dl>
  15382. <p>Make sure to require a closed GOP when encoding and to set the GOP
  15383. size to fit your segment time constraint.
  15384. </p>
  15385. <a name="Examples-75"></a>
  15386. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-75">21.25.2 Examples</a></h3>
  15387. <ul>
  15388. <li>
  15389. Remux the content of file &lsquo;<tt>in.mkv</tt>&rsquo; to a list of segments
  15390. &lsquo;<tt>out-000.nut</tt>&rsquo;, &lsquo;<tt>out-001.nut</tt>&rsquo;, etc., and write the list of
  15391. generated segments to &lsquo;<tt>out.list</tt>&rsquo;:
  15392. <div class="example">
  15393. <pre class="example">ffmpeg -i in.mkv -codec hevc -flags +cgop -g 60 -map 0 -f segment -segment_list out.list out%03d.nut
  15394. </pre></div>
  15395. </li><li>
  15396. Segment input and set output format options for the output segments:
  15397. <div class="example">
  15398. <pre class="example">ffmpeg -i in.mkv -f segment -segment_time 10 -segment_format_options movflags=+faststart out%03d.mp4
  15399. </pre></div>
  15400. </li><li>
  15401. Segment the input file according to the split points specified by the
  15402. <var>segment_times</var> option:
  15403. <div class="example">
  15404. <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
  15405. </pre></div>
  15406. </li><li>
  15407. Use the <code>ffmpeg</code> &lsquo;<samp>force_key_frames</samp>&rsquo;
  15408. option to force key frames in the input at the specified location, together
  15409. with the segment option &lsquo;<samp>segment_time_delta</samp>&rsquo; to account for
  15410. possible roundings operated when setting key frame times.
  15411. <div class="example">
  15412. <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 \
  15413. -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
  15414. </pre></div>
  15415. <p>In order to force key frames on the input file, transcoding is
  15416. required.
  15417. </p>
  15418. </li><li>
  15419. Segment the input file by splitting the input file according to the
  15420. frame numbers sequence specified with the &lsquo;<samp>segment_frames</samp>&rsquo; option:
  15421. <div class="example">
  15422. <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
  15423. </pre></div>
  15424. </li><li>
  15425. Convert the &lsquo;<tt>in.mkv</tt>&rsquo; to TS segments using the <code>libx264</code>
  15426. and <code>aac</code> encoders:
  15427. <div class="example">
  15428. <pre class="example">ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a aac -f ssegment -segment_list out.list out%03d.ts
  15429. </pre></div>
  15430. </li><li>
  15431. Segment the input file, and create an M3U8 live playlist (can be used
  15432. as live HLS source):
  15433. <div class="example">
  15434. <pre class="example">ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
  15435. -segment_list_flags +live -segment_time 10 out%03d.mkv
  15436. </pre></div>
  15437. </li></ul>
  15438. <a name="smoothstreaming"></a>
  15439. <h2 class="section"><a href="ffmpeg-all.html#toc-smoothstreaming">21.26 smoothstreaming</a></h2>
  15440. <p>Smooth Streaming muxer generates a set of files (Manifest, chunks) suitable for serving with conventional web server.
  15441. </p>
  15442. <dl compact="compact">
  15443. <dt>&lsquo;<samp>window_size</samp>&rsquo;</dt>
  15444. <dd><p>Specify the number of fragments kept in the manifest. Default 0 (keep all).
  15445. </p>
  15446. </dd>
  15447. <dt>&lsquo;<samp>extra_window_size</samp>&rsquo;</dt>
  15448. <dd><p>Specify the number of fragments kept outside of the manifest before removing from disk. Default 5.
  15449. </p>
  15450. </dd>
  15451. <dt>&lsquo;<samp>lookahead_count</samp>&rsquo;</dt>
  15452. <dd><p>Specify the number of lookahead fragments. Default 2.
  15453. </p>
  15454. </dd>
  15455. <dt>&lsquo;<samp>min_frag_duration</samp>&rsquo;</dt>
  15456. <dd><p>Specify the minimum fragment duration (in microseconds). Default 5000000.
  15457. </p>
  15458. </dd>
  15459. <dt>&lsquo;<samp>remove_at_exit</samp>&rsquo;</dt>
  15460. <dd><p>Specify whether to remove all fragments when finished. Default 0 (do not remove).
  15461. </p>
  15462. </dd>
  15463. </dl>
  15464. <p><a name="streamhash"></a>
  15465. </p><a name="streamhash-1"></a>
  15466. <h2 class="section"><a href="ffmpeg-all.html#toc-streamhash-1">21.27 streamhash</a></h2>
  15467. <p>Per stream hash testing format.
  15468. </p>
  15469. <p>This muxer computes and prints a cryptographic hash of all the input frames,
  15470. on a per-stream basis. This can be used for equality checks without having
  15471. to do a complete binary comparison.
  15472. </p>
  15473. <p>By default audio frames are converted to signed 16-bit raw audio and
  15474. video frames to raw video before computing the hash, but the output
  15475. of explicit conversions to other codecs can also be used. Timestamps
  15476. are ignored. It uses the SHA-256 cryptographic hash function by default,
  15477. but supports several other algorithms.
  15478. </p>
  15479. <p>The output of the muxer consists of one line per stream of the form:
  15480. <var>streamindex</var>,<var>streamtype</var>,<var>algo</var>=<var>hash</var>, where
  15481. <var>streamindex</var> is the index of the mapped stream, <var>streamtype</var> is a
  15482. single character indicating the type of stream, <var>algo</var> is a short string
  15483. representing the hash function used, and <var>hash</var> is a hexadecimal number
  15484. representing the computed hash.
  15485. </p>
  15486. <dl compact="compact">
  15487. <dt>&lsquo;<samp>hash <var>algorithm</var></samp>&rsquo;</dt>
  15488. <dd><p>Use the cryptographic hash function specified by the string <var>algorithm</var>.
  15489. Supported values include <code>MD5</code>, <code>murmur3</code>, <code>RIPEMD128</code>,
  15490. <code>RIPEMD160</code>, <code>RIPEMD256</code>, <code>RIPEMD320</code>, <code>SHA160</code>,
  15491. <code>SHA224</code>, <code>SHA256</code> (default), <code>SHA512/224</code>, <code>SHA512/256</code>,
  15492. <code>SHA384</code>, <code>SHA512</code>, <code>CRC32</code> and <code>adler32</code>.
  15493. </p>
  15494. </dd>
  15495. </dl>
  15496. <a name="Examples-132"></a>
  15497. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-132">21.27.1 Examples</a></h3>
  15498. <p>To compute the SHA-256 hash of the input converted to raw audio and
  15499. video, and store it in the file &lsquo;<tt>out.sha256</tt>&rsquo;:
  15500. </p><div class="example">
  15501. <pre class="example">ffmpeg -i INPUT -f streamhash out.sha256
  15502. </pre></div>
  15503. <p>To print an MD5 hash to stdout use the command:
  15504. </p><div class="example">
  15505. <pre class="example">ffmpeg -i INPUT -f streamhash -hash md5 -
  15506. </pre></div>
  15507. <p>See also the <a href="#hash">hash</a> and <a href="#framehash">framehash</a> muxers.
  15508. </p>
  15509. <p><a name="fifo"></a>
  15510. </p><a name="fifo-1"></a>
  15511. <h2 class="section"><a href="ffmpeg-all.html#toc-fifo-1">21.28 fifo</a></h2>
  15512. <p>The fifo pseudo-muxer allows the separation of encoding and muxing by using
  15513. first-in-first-out queue and running the actual muxer in a separate thread. This
  15514. is especially useful in combination with the <a href="#tee">tee</a> muxer and can be used to
  15515. send data to several destinations with different reliability/writing speed/latency.
  15516. </p>
  15517. <p>API users should be aware that callback functions (interrupt_callback,
  15518. io_open and io_close) used within its AVFormatContext must be thread-safe.
  15519. </p>
  15520. <p>The behavior of the fifo muxer if the queue fills up or if the output fails is
  15521. selectable,
  15522. </p>
  15523. <ul>
  15524. <li>
  15525. output can be transparently restarted with configurable delay between retries
  15526. based on real time or time of the processed stream.
  15527. </li><li>
  15528. encoding can be blocked during temporary failure, or continue transparently
  15529. dropping packets in case fifo queue fills up.
  15530. </li></ul>
  15531. <dl compact="compact">
  15532. <dt>&lsquo;<samp>fifo_format</samp>&rsquo;</dt>
  15533. <dd><p>Specify the format name. Useful if it cannot be guessed from the
  15534. output name suffix.
  15535. </p>
  15536. </dd>
  15537. <dt>&lsquo;<samp>queue_size</samp>&rsquo;</dt>
  15538. <dd><p>Specify size of the queue (number of packets). Default value is 60.
  15539. </p>
  15540. </dd>
  15541. <dt>&lsquo;<samp>format_opts</samp>&rsquo;</dt>
  15542. <dd><p>Specify format options for the underlying muxer. Muxer options can be specified
  15543. as a list of <var>key</var>=<var>value</var> pairs separated by &rsquo;:&rsquo;.
  15544. </p>
  15545. </dd>
  15546. <dt>&lsquo;<samp>drop_pkts_on_overflow <var>bool</var></samp>&rsquo;</dt>
  15547. <dd><p>If set to 1 (true), in case the fifo queue fills up, packets will be dropped
  15548. rather than blocking the encoder. This makes it possible to continue streaming without
  15549. delaying the input, at the cost of omitting part of the stream. By default
  15550. this option is set to 0 (false), so in such cases the encoder will be blocked
  15551. until the muxer processes some of the packets and none of them is lost.
  15552. </p>
  15553. </dd>
  15554. <dt>&lsquo;<samp>attempt_recovery <var>bool</var></samp>&rsquo;</dt>
  15555. <dd><p>If failure occurs, attempt to recover the output. This is especially useful
  15556. when used with network output, since it makes it possible to restart streaming transparently.
  15557. By default this option is set to 0 (false).
  15558. </p>
  15559. </dd>
  15560. <dt>&lsquo;<samp>max_recovery_attempts</samp>&rsquo;</dt>
  15561. <dd><p>Sets maximum number of successive unsuccessful recovery attempts after which
  15562. the output fails permanently. By default this option is set to 0 (unlimited).
  15563. </p>
  15564. </dd>
  15565. <dt>&lsquo;<samp>recovery_wait_time <var>duration</var></samp>&rsquo;</dt>
  15566. <dd><p>Waiting time before the next recovery attempt after previous unsuccessful
  15567. recovery attempt. Default value is 5 seconds.
  15568. </p>
  15569. </dd>
  15570. <dt>&lsquo;<samp>recovery_wait_streamtime <var>bool</var></samp>&rsquo;</dt>
  15571. <dd><p>If set to 0 (false), the real time is used when waiting for the recovery
  15572. attempt (i.e. the recovery will be attempted after at least
  15573. recovery_wait_time seconds).
  15574. If set to 1 (true), the time of the processed stream is taken into account
  15575. instead (i.e. the recovery will be attempted after at least <var>recovery_wait_time</var>
  15576. seconds of the stream is omitted).
  15577. By default, this option is set to 0 (false).
  15578. </p>
  15579. </dd>
  15580. <dt>&lsquo;<samp>recover_any_error <var>bool</var></samp>&rsquo;</dt>
  15581. <dd><p>If set to 1 (true), recovery will be attempted regardless of type of the error
  15582. causing the failure. By default this option is set to 0 (false) and in case of
  15583. certain (usually permanent) errors the recovery is not attempted even when
  15584. <var>attempt_recovery</var> is set to 1.
  15585. </p>
  15586. </dd>
  15587. <dt>&lsquo;<samp>restart_with_keyframe <var>bool</var></samp>&rsquo;</dt>
  15588. <dd><p>Specify whether to wait for the keyframe after recovering from
  15589. queue overflow or failure. This option is set to 0 (false) by default.
  15590. </p>
  15591. </dd>
  15592. </dl>
  15593. <a name="Examples-9"></a>
  15594. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-9">21.28.1 Examples</a></h3>
  15595. <ul>
  15596. <li>
  15597. Stream something to rtmp server, continue processing the stream at real-time
  15598. rate even in case of temporary failure (network outage) and attempt to recover
  15599. streaming every second indefinitely.
  15600. <div class="example">
  15601. <pre class="example">ffmpeg -re -i ... -c:v libx264 -c:a aac -f fifo -fifo_format flv -map 0:v -map 0:a
  15602. -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 1 rtmp://example.com/live/stream_name
  15603. </pre></div>
  15604. </li></ul>
  15605. <p><a name="tee"></a>
  15606. </p><a name="tee-2"></a>
  15607. <h2 class="section"><a href="ffmpeg-all.html#toc-tee-2">21.29 tee</a></h2>
  15608. <p>The tee muxer can be used to write the same data to several outputs, such as files or streams.
  15609. It can be used, for example, to stream a video over a network and save it to disk at the same time.
  15610. </p>
  15611. <p>It is different from specifying several outputs to the <code>ffmpeg</code>
  15612. command-line tool. With the tee muxer, the audio and video data will be encoded only once.
  15613. With conventional multiple outputs, multiple encoding operations in parallel are initiated,
  15614. which can be a very expensive process. The tee muxer is not useful when using the libavformat API
  15615. directly because it is then possible to feed the same packets to several muxers directly.
  15616. </p>
  15617. <p>Since the tee muxer does not represent any particular output format, ffmpeg cannot auto-select
  15618. output streams. So all streams intended for output must be specified using <code>-map</code>. See
  15619. the examples below.
  15620. </p>
  15621. <p>Some encoders may need different options depending on the output format;
  15622. the auto-detection of this can not work with the tee muxer, so they need to be explicitly specified.
  15623. The main example is the &lsquo;<samp>global_header</samp>&rsquo; flag.
  15624. </p>
  15625. <p>The slave outputs are specified in the file name given to the muxer,
  15626. separated by &rsquo;|&rsquo;. If any of the slave name contains the &rsquo;|&rsquo; separator,
  15627. leading or trailing spaces or any special character, those must be
  15628. escaped (see <a href="ffmpeg-utils.html#quoting_005fand_005fescaping">(ffmpeg-utils)the &quot;Quoting and escaping&quot; section in the ffmpeg-utils(1) manual</a>).
  15629. </p>
  15630. <a name="Options-2"></a>
  15631. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-2">21.29.1 Options</a></h3>
  15632. <dl compact="compact">
  15633. <dt>&lsquo;<samp>use_fifo <var>bool</var></samp>&rsquo;</dt>
  15634. <dd><p>If set to 1, slave outputs will be processed in separate threads using the <a href="#fifo">fifo</a>
  15635. muxer. This allows to compensate for different speed/latency/reliability of
  15636. outputs and setup transparent recovery. By default this feature is turned off.
  15637. </p>
  15638. </dd>
  15639. <dt>&lsquo;<samp>fifo_options</samp>&rsquo;</dt>
  15640. <dd><p>Options to pass to fifo pseudo-muxer instances. See <a href="#fifo">fifo</a>.
  15641. </p>
  15642. </dd>
  15643. </dl>
  15644. <p>Muxer options can be specified for each slave by prepending them as a list of
  15645. <var>key</var>=<var>value</var> pairs separated by &rsquo;:&rsquo;, between square brackets. If
  15646. the options values contain a special character or the &rsquo;:&rsquo; separator, they
  15647. must be escaped; note that this is a second level escaping.
  15648. </p>
  15649. <p>The following special options are also recognized:
  15650. </p><dl compact="compact">
  15651. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  15652. <dd><p>Specify the format name. Required if it cannot be guessed from the
  15653. output URL.
  15654. </p>
  15655. </dd>
  15656. <dt>&lsquo;<samp>bsfs[/<var>spec</var>]</samp>&rsquo;</dt>
  15657. <dd><p>Specify a list of bitstream filters to apply to the specified
  15658. output.
  15659. </p>
  15660. <p>It is possible to specify to which streams a given bitstream filter
  15661. applies, by appending a stream specifier to the option separated by
  15662. <code>/</code>. <var>spec</var> must be a stream specifier (see <a href="#Format-stream-specifiers">Format stream specifiers</a>).
  15663. </p>
  15664. <p>If the stream specifier is not specified, the bitstream filters will be
  15665. applied to all streams in the output. This will cause that output operation
  15666. to fail if the output contains streams to which the bitstream filter cannot
  15667. be applied e.g. <code>h264_mp4toannexb</code> being applied to an output containing an audio stream.
  15668. </p>
  15669. <p>Options for a bitstream filter must be specified in the form of <code>opt=value</code>.
  15670. </p>
  15671. <p>Several bitstream filters can be specified, separated by &quot;,&quot;.
  15672. </p>
  15673. </dd>
  15674. <dt>&lsquo;<samp>use_fifo <var>bool</var></samp>&rsquo;</dt>
  15675. <dd><p>This allows to override tee muxer use_fifo option for individual slave muxer.
  15676. </p>
  15677. </dd>
  15678. <dt>&lsquo;<samp>fifo_options</samp>&rsquo;</dt>
  15679. <dd><p>This allows to override tee muxer fifo_options for individual slave muxer.
  15680. See <a href="#fifo">fifo</a>.
  15681. </p>
  15682. </dd>
  15683. <dt>&lsquo;<samp>select</samp>&rsquo;</dt>
  15684. <dd><p>Select the streams that should be mapped to the slave output,
  15685. specified by a stream specifier. If not specified, this defaults to
  15686. all the mapped streams. This will cause that output operation to fail
  15687. if the output format does not accept all mapped streams.
  15688. </p>
  15689. <p>You may use multiple stream specifiers separated by commas (<code>,</code>) e.g.: <code>a:0,v</code>
  15690. </p>
  15691. </dd>
  15692. <dt>&lsquo;<samp>onfail</samp>&rsquo;</dt>
  15693. <dd><p>Specify behaviour on output failure. This can be set to either <code>abort</code> (which is
  15694. default) or <code>ignore</code>. <code>abort</code> will cause whole process to fail in case of failure
  15695. on this slave output. <code>ignore</code> will ignore failure on this output, so other outputs
  15696. will continue without being affected.
  15697. </p></dd>
  15698. </dl>
  15699. <a name="Examples-170"></a>
  15700. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-170">21.29.2 Examples</a></h3>
  15701. <ul>
  15702. <li>
  15703. Encode something and both archive it in a WebM file and stream it
  15704. as MPEG-TS over UDP:
  15705. <div class="example">
  15706. <pre class="example">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  15707. &quot;archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  15708. </pre></div>
  15709. </li><li>
  15710. As above, but continue streaming even if output to local file fails
  15711. (for example local drive fills up):
  15712. <div class="example">
  15713. <pre class="example">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  15714. &quot;[onfail=ignore]archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  15715. </pre></div>
  15716. </li><li>
  15717. Use <code>ffmpeg</code> to encode the input, and send the output
  15718. to three different destinations. The <code>dump_extra</code> bitstream
  15719. filter is used to add extradata information to all the output video
  15720. keyframes packets, as requested by the MPEG-TS format. The select
  15721. option is applied to &lsquo;<tt>out.aac</tt>&rsquo; in order to make it contain only
  15722. audio packets.
  15723. <div class="example">
  15724. <pre class="example">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  15725. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac&quot;
  15726. </pre></div>
  15727. </li><li>
  15728. As above, but select only stream <code>a:1</code> for the audio output. Note
  15729. that a second level escaping must be performed, as &quot;:&quot; is a special
  15730. character used to separate options.
  15731. <div class="example">
  15732. <pre class="example">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  15733. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=\'a:1\']out.aac&quot;
  15734. </pre></div>
  15735. </li></ul>
  15736. <a name="webm_005fdash_005fmanifest"></a>
  15737. <h2 class="section"><a href="ffmpeg-all.html#toc-webm_005fdash_005fmanifest">21.30 webm_dash_manifest</a></h2>
  15738. <p>WebM DASH Manifest muxer.
  15739. </p>
  15740. <p>This muxer implements the WebM DASH Manifest specification to generate the DASH
  15741. manifest XML. It also supports manifest generation for DASH live streams.
  15742. </p>
  15743. <p>For more information see:
  15744. </p>
  15745. <ul>
  15746. <li>
  15747. 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>
  15748. </li><li>
  15749. 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>
  15750. </li></ul>
  15751. <a name="Options-47"></a>
  15752. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-47">21.30.1 Options</a></h3>
  15753. <p>This muxer supports the following options:
  15754. </p>
  15755. <dl compact="compact">
  15756. <dt>&lsquo;<samp>adaptation_sets</samp>&rsquo;</dt>
  15757. <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
  15758. unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding
  15759. audio and video streams. Any number of adaptation sets can be added using this option.
  15760. </p>
  15761. </dd>
  15762. <dt>&lsquo;<samp>live</samp>&rsquo;</dt>
  15763. <dd><p>Set this to 1 to create a live stream DASH Manifest. Default: 0.
  15764. </p>
  15765. </dd>
  15766. <dt>&lsquo;<samp>chunk_start_index</samp>&rsquo;</dt>
  15767. <dd><p>Start index of the first chunk. This will go in the &lsquo;<samp>startNumber</samp>&rsquo; attribute
  15768. of the &lsquo;<samp>SegmentTemplate</samp>&rsquo; element in the manifest. Default: 0.
  15769. </p>
  15770. </dd>
  15771. <dt>&lsquo;<samp>chunk_duration_ms</samp>&rsquo;</dt>
  15772. <dd><p>Duration of each chunk in milliseconds. This will go in the &lsquo;<samp>duration</samp>&rsquo;
  15773. attribute of the &lsquo;<samp>SegmentTemplate</samp>&rsquo; element in the manifest. Default: 1000.
  15774. </p>
  15775. </dd>
  15776. <dt>&lsquo;<samp>utc_timing_url</samp>&rsquo;</dt>
  15777. <dd><p>URL of the page that will return the UTC timestamp in ISO format. This will go
  15778. in the &lsquo;<samp>value</samp>&rsquo; attribute of the &lsquo;<samp>UTCTiming</samp>&rsquo; element in the manifest.
  15779. Default: None.
  15780. </p>
  15781. </dd>
  15782. <dt>&lsquo;<samp>time_shift_buffer_depth</samp>&rsquo;</dt>
  15783. <dd><p>Smallest time (in seconds) shifting buffer for which any Representation is
  15784. guaranteed to be available. This will go in the &lsquo;<samp>timeShiftBufferDepth</samp>&rsquo;
  15785. attribute of the &lsquo;<samp>MPD</samp>&rsquo; element. Default: 60.
  15786. </p>
  15787. </dd>
  15788. <dt>&lsquo;<samp>minimum_update_period</samp>&rsquo;</dt>
  15789. <dd><p>Minimum update period (in seconds) of the manifest. This will go in the
  15790. &lsquo;<samp>minimumUpdatePeriod</samp>&rsquo; attribute of the &lsquo;<samp>MPD</samp>&rsquo; element. Default: 0.
  15791. </p>
  15792. </dd>
  15793. </dl>
  15794. <a name="Example"></a>
  15795. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example">21.30.2 Example</a></h3>
  15796. <div class="example">
  15797. <pre class="example">ffmpeg -f webm_dash_manifest -i video1.webm \
  15798. -f webm_dash_manifest -i video2.webm \
  15799. -f webm_dash_manifest -i audio1.webm \
  15800. -f webm_dash_manifest -i audio2.webm \
  15801. -map 0 -map 1 -map 2 -map 3 \
  15802. -c copy \
  15803. -f webm_dash_manifest \
  15804. -adaptation_sets &quot;id=0,streams=0,1 id=1,streams=2,3&quot; \
  15805. manifest.xml
  15806. </pre></div>
  15807. <a name="webm_005fchunk"></a>
  15808. <h2 class="section"><a href="ffmpeg-all.html#toc-webm_005fchunk">21.31 webm_chunk</a></h2>
  15809. <p>WebM Live Chunk Muxer.
  15810. </p>
  15811. <p>This muxer writes out WebM headers and chunks as separate files which can be
  15812. consumed by clients that support WebM Live streams via DASH.
  15813. </p>
  15814. <a name="Options-46"></a>
  15815. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-46">21.31.1 Options</a></h3>
  15816. <p>This muxer supports the following options:
  15817. </p>
  15818. <dl compact="compact">
  15819. <dt>&lsquo;<samp>chunk_start_index</samp>&rsquo;</dt>
  15820. <dd><p>Index of the first chunk (defaults to 0).
  15821. </p>
  15822. </dd>
  15823. <dt>&lsquo;<samp>header</samp>&rsquo;</dt>
  15824. <dd><p>Filename of the header where the initialization data will be written.
  15825. </p>
  15826. </dd>
  15827. <dt>&lsquo;<samp>audio_chunk_duration</samp>&rsquo;</dt>
  15828. <dd><p>Duration of each audio chunk in milliseconds (defaults to 5000).
  15829. </p></dd>
  15830. </dl>
  15831. <a name="Example-5"></a>
  15832. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-5">21.31.2 Example</a></h3>
  15833. <div class="example">
  15834. <pre class="example">ffmpeg -f v4l2 -i /dev/video0 \
  15835. -f alsa -i hw:0 \
  15836. -map 0:0 \
  15837. -c:v libvpx-vp9 \
  15838. -s 640x360 -keyint_min 30 -g 30 \
  15839. -f webm_chunk \
  15840. -header webm_live_video_360.hdr \
  15841. -chunk_start_index 1 \
  15842. webm_live_video_360_%d.chk \
  15843. -map 1:0 \
  15844. -c:a libvorbis \
  15845. -b:a 128k \
  15846. -f webm_chunk \
  15847. -header webm_live_audio_128.hdr \
  15848. -chunk_start_index 1 \
  15849. -audio_chunk_duration 1000 \
  15850. webm_live_audio_128_%d.chk
  15851. </pre></div>
  15852. <a name="Metadata-1"></a>
  15853. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Metadata-1">22 Metadata</a></h1>
  15854. <p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
  15855. INI-like text file and then load it back using the metadata muxer/demuxer.
  15856. </p>
  15857. <p>The file format is as follows:
  15858. </p><ol>
  15859. <li>
  15860. A file consists of a header and a number of metadata tags divided into sections,
  15861. each on its own line.
  15862. </li><li>
  15863. The header is a &lsquo;<samp>;FFMETADATA</samp>&rsquo; string, followed by a version number (now 1).
  15864. </li><li>
  15865. Metadata tags are of the form &lsquo;<samp>key=value</samp>&rsquo;
  15866. </li><li>
  15867. Immediately after header follows global metadata
  15868. </li><li>
  15869. After global metadata there may be sections with per-stream/per-chapter
  15870. metadata.
  15871. </li><li>
  15872. A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
  15873. brackets (&lsquo;<samp>[</samp>&rsquo;, &lsquo;<samp>]</samp>&rsquo;) and ends with next section or end of file.
  15874. </li><li>
  15875. At the beginning of a chapter section there may be an optional timebase to be
  15876. used for start/end values. It must be in form
  15877. &lsquo;<samp>TIMEBASE=<var>num</var>/<var>den</var></samp>&rsquo;, where <var>num</var> and <var>den</var> are
  15878. integers. If the timebase is missing then start/end times are assumed to
  15879. be in nanoseconds.
  15880. <p>Next a chapter section must contain chapter start and end times in form
  15881. &lsquo;<samp>START=<var>num</var></samp>&rsquo;, &lsquo;<samp>END=<var>num</var></samp>&rsquo;, where <var>num</var> is a positive
  15882. integer.
  15883. </p>
  15884. </li><li>
  15885. Empty lines and lines starting with &lsquo;<samp>;</samp>&rsquo; or &lsquo;<samp>#</samp>&rsquo; are ignored.
  15886. </li><li>
  15887. Metadata keys or values containing special characters (&lsquo;<samp>=</samp>&rsquo;, &lsquo;<samp>;</samp>&rsquo;,
  15888. &lsquo;<samp>#</samp>&rsquo;, &lsquo;<samp>\</samp>&rsquo; and a newline) must be escaped with a backslash &lsquo;<samp>\</samp>&rsquo;.
  15889. </li><li>
  15890. Note that whitespace in metadata (e.g. &lsquo;<samp>foo = bar</samp>&rsquo;) is considered to be
  15891. a part of the tag (in the example above key is &lsquo;<samp>foo </samp>&rsquo;, value is
  15892. &lsquo;<samp> bar</samp>&rsquo;).
  15893. </li></ol>
  15894. <p>A ffmetadata file might look like this:
  15895. </p><div class="example">
  15896. <pre class="example">;FFMETADATA1
  15897. title=bike\\shed
  15898. ;this is a comment
  15899. artist=FFmpeg troll team
  15900. [CHAPTER]
  15901. TIMEBASE=1/1000
  15902. START=0
  15903. #chapter ends at 0:01:00
  15904. END=60000
  15905. title=chapter \#1
  15906. [STREAM]
  15907. title=multi\
  15908. line
  15909. </pre></div>
  15910. <p>By using the ffmetadata muxer and demuxer it is possible to extract
  15911. metadata from an input file to an ffmetadata file, and then transcode
  15912. the file into an output file with the edited ffmetadata file.
  15913. </p>
  15914. <p>Extracting an ffmetadata file with &lsquo;<tt>ffmpeg</tt>&rsquo; goes as follows:
  15915. </p><div class="example">
  15916. <pre class="example">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
  15917. </pre></div>
  15918. <p>Reinserting edited metadata information from the FFMETADATAFILE file can
  15919. be done as:
  15920. </p><div class="example">
  15921. <pre class="example">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
  15922. </pre></div>
  15923. <a name="Protocol-Options"></a>
  15924. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Protocol-Options">23 Protocol Options</a></h1>
  15925. <p>The libavformat library provides some generic global options, which
  15926. can be set on all the protocols. In addition each protocol may support
  15927. so-called private options, which are specific for that component.
  15928. </p>
  15929. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  15930. FFmpeg tools, or by setting the value explicitly in the
  15931. <code>AVFormatContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
  15932. for programmatic use.
  15933. </p>
  15934. <p>The list of supported options follows:
  15935. </p>
  15936. <dl compact="compact">
  15937. <dt>&lsquo;<samp>protocol_whitelist <var>list</var> (<em>input</em>)</samp>&rsquo;</dt>
  15938. <dd><p>Set a &quot;,&quot;-separated list of allowed protocols. &quot;ALL&quot; matches all protocols. Protocols
  15939. prefixed by &quot;-&quot; are disabled.
  15940. All protocols are allowed by default but protocols used by an another
  15941. protocol (nested protocols) are restricted to a per protocol subset.
  15942. </p></dd>
  15943. </dl>
  15944. <a name="Protocols"></a>
  15945. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Protocols">24 Protocols</a></h1>
  15946. <p>Protocols are configured elements in FFmpeg that enable access to
  15947. resources that require specific protocols.
  15948. </p>
  15949. <p>When you configure your FFmpeg build, all the supported protocols are
  15950. enabled by default. You can list all available ones using the
  15951. configure option &quot;&ndash;list-protocols&quot;.
  15952. </p>
  15953. <p>You can disable all the protocols using the configure option
  15954. &quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
  15955. option &quot;&ndash;enable-protocol=<var>PROTOCOL</var>&quot;, or you can disable a
  15956. particular protocol using the option
  15957. &quot;&ndash;disable-protocol=<var>PROTOCOL</var>&quot;.
  15958. </p>
  15959. <p>The option &quot;-protocols&quot; of the ff* tools will display the list of
  15960. supported protocols.
  15961. </p>
  15962. <p>All protocols accept the following options:
  15963. </p>
  15964. <dl compact="compact">
  15965. <dt>&lsquo;<samp>rw_timeout</samp>&rsquo;</dt>
  15966. <dd><p>Maximum time to wait for (network) read/write operations to complete,
  15967. in microseconds.
  15968. </p></dd>
  15969. </dl>
  15970. <p>A description of the currently available protocols follows.
  15971. </p>
  15972. <a name="amqp"></a>
  15973. <h2 class="section"><a href="ffmpeg-all.html#toc-amqp">24.1 amqp</a></h2>
  15974. <p>Advanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker based
  15975. publish-subscribe communication protocol.
  15976. </p>
  15977. <p>FFmpeg must be compiled with &ndash;enable-librabbitmq to support AMQP. A separate
  15978. AMQP broker must also be run. An example open-source AMQP broker is RabbitMQ.
  15979. </p>
  15980. <p>After starting the broker, an FFmpeg client may stream data to the broker using
  15981. the command:
  15982. </p>
  15983. <div class="example">
  15984. <pre class="example">ffmpeg -re -i input -f mpegts amqp://[[user]:[password]@]hostname[:port]
  15985. </pre></div>
  15986. <p>Where hostname and port (default is 5672) is the address of the broker. The
  15987. client may also set a user/password for authentication. The default for both
  15988. fields is &quot;guest&quot;.
  15989. </p>
  15990. <p>Muliple subscribers may stream from the broker using the command:
  15991. </p><div class="example">
  15992. <pre class="example">ffplay amqp://[[user]:[password]@]hostname[:port]
  15993. </pre></div>
  15994. <p>In RabbitMQ all data published to the broker flows through a specific exchange,
  15995. and each subscribing client has an assigned queue/buffer. When a packet arrives
  15996. at an exchange, it may be copied to a client&rsquo;s queue depending on the exchange
  15997. and routing_key fields.
  15998. </p>
  15999. <p>The following options are supported:
  16000. </p>
  16001. <dl compact="compact">
  16002. <dt>&lsquo;<samp>exchange</samp>&rsquo;</dt>
  16003. <dd><p>Sets the exchange to use on the broker. RabbitMQ has several predefined
  16004. exchanges: &quot;amq.direct&quot; is the default exchange, where the publisher and
  16005. subscriber must have a matching routing_key; &quot;amq.fanout&quot; is the same as a
  16006. broadcast operation (i.e. the data is forwarded to all queues on the fanout
  16007. exchange independent of the routing_key); and &quot;amq.topic&quot; is similar to
  16008. &quot;amq.direct&quot;, but allows for more complex pattern matching (refer to the RabbitMQ
  16009. documentation).
  16010. </p>
  16011. </dd>
  16012. <dt>&lsquo;<samp>routing_key</samp>&rsquo;</dt>
  16013. <dd><p>Sets the routing key. The default value is &quot;amqp&quot;. The routing key is used on
  16014. the &quot;amq.direct&quot; and &quot;amq.topic&quot; exchanges to decide whether packets are written
  16015. to the queue of a subscriber.
  16016. </p>
  16017. </dd>
  16018. <dt>&lsquo;<samp>pkt_size</samp>&rsquo;</dt>
  16019. <dd><p>Maximum size of each packet sent/received to the broker. Default is 131072.
  16020. Minimum is 4096 and max is any large value (representable by an int). When
  16021. receiving packets, this sets an internal buffer size in FFmpeg. It should be
  16022. equal to or greater than the size of the published packets to the broker. Otherwise
  16023. the received message may be truncated causing decoding errors.
  16024. </p>
  16025. </dd>
  16026. <dt>&lsquo;<samp>connection_timeout</samp>&rsquo;</dt>
  16027. <dd><p>The timeout in seconds during the initial connection to the broker. The
  16028. default value is rw_timeout, or 5 seconds if rw_timeout is not set.
  16029. </p>
  16030. </dd>
  16031. </dl>
  16032. <a name="async"></a>
  16033. <h2 class="section"><a href="ffmpeg-all.html#toc-async">24.2 async</a></h2>
  16034. <p>Asynchronous data filling wrapper for input stream.
  16035. </p>
  16036. <p>Fill data in a background thread, to decouple I/O operation from demux thread.
  16037. </p>
  16038. <div class="example">
  16039. <pre class="example">async:<var>URL</var>
  16040. async:http://host/resource
  16041. async:cache:http://host/resource
  16042. </pre></div>
  16043. <a name="bluray"></a>
  16044. <h2 class="section"><a href="ffmpeg-all.html#toc-bluray">24.3 bluray</a></h2>
  16045. <p>Read BluRay playlist.
  16046. </p>
  16047. <p>The accepted options are:
  16048. </p><dl compact="compact">
  16049. <dt>&lsquo;<samp>angle</samp>&rsquo;</dt>
  16050. <dd><p>BluRay angle
  16051. </p>
  16052. </dd>
  16053. <dt>&lsquo;<samp>chapter</samp>&rsquo;</dt>
  16054. <dd><p>Start chapter (1...N)
  16055. </p>
  16056. </dd>
  16057. <dt>&lsquo;<samp>playlist</samp>&rsquo;</dt>
  16058. <dd><p>Playlist to read (BDMV/PLAYLIST/?????.mpls)
  16059. </p>
  16060. </dd>
  16061. </dl>
  16062. <p>Examples:
  16063. </p>
  16064. <p>Read longest playlist from BluRay mounted to /mnt/bluray:
  16065. </p><div class="example">
  16066. <pre class="example">bluray:/mnt/bluray
  16067. </pre></div>
  16068. <p>Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
  16069. </p><div class="example">
  16070. <pre class="example">-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
  16071. </pre></div>
  16072. <a name="cache"></a>
  16073. <h2 class="section"><a href="ffmpeg-all.html#toc-cache">24.4 cache</a></h2>
  16074. <p>Caching wrapper for input stream.
  16075. </p>
  16076. <p>Cache the input stream to temporary file. It brings seeking capability to live streams.
  16077. </p>
  16078. <div class="example">
  16079. <pre class="example">cache:<var>URL</var>
  16080. </pre></div>
  16081. <a name="concat-1"></a>
  16082. <h2 class="section"><a href="ffmpeg-all.html#toc-concat-1">24.5 concat</a></h2>
  16083. <p>Physical concatenation protocol.
  16084. </p>
  16085. <p>Read and seek from many resources in sequence as if they were
  16086. a unique resource.
  16087. </p>
  16088. <p>A URL accepted by this protocol has the syntax:
  16089. </p><div class="example">
  16090. <pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
  16091. </pre></div>
  16092. <p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
  16093. resource to be concatenated, each one possibly specifying a distinct
  16094. protocol.
  16095. </p>
  16096. <p>For example to read a sequence of files &lsquo;<tt>split1.mpeg</tt>&rsquo;,
  16097. &lsquo;<tt>split2.mpeg</tt>&rsquo;, &lsquo;<tt>split3.mpeg</tt>&rsquo; with <code>ffplay</code> use the
  16098. command:
  16099. </p><div class="example">
  16100. <pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
  16101. </pre></div>
  16102. <p>Note that you may need to escape the character &quot;|&quot; which is special for
  16103. many shells.
  16104. </p>
  16105. <a name="crypto"></a>
  16106. <h2 class="section"><a href="ffmpeg-all.html#toc-crypto">24.6 crypto</a></h2>
  16107. <p>AES-encrypted stream reading protocol.
  16108. </p>
  16109. <p>The accepted options are:
  16110. </p><dl compact="compact">
  16111. <dt>&lsquo;<samp>key</samp>&rsquo;</dt>
  16112. <dd><p>Set the AES decryption key binary block from given hexadecimal representation.
  16113. </p>
  16114. </dd>
  16115. <dt>&lsquo;<samp>iv</samp>&rsquo;</dt>
  16116. <dd><p>Set the AES decryption initialization vector binary block from given hexadecimal representation.
  16117. </p></dd>
  16118. </dl>
  16119. <p>Accepted URL formats:
  16120. </p><div class="example">
  16121. <pre class="example">crypto:<var>URL</var>
  16122. crypto+<var>URL</var>
  16123. </pre></div>
  16124. <a name="data"></a>
  16125. <h2 class="section"><a href="ffmpeg-all.html#toc-data">24.7 data</a></h2>
  16126. <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>.
  16127. </p>
  16128. <p>For example, to convert a GIF file given inline with <code>ffmpeg</code>:
  16129. </p><div class="example">
  16130. <pre class="example">ffmpeg -i &quot;data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=&quot; smiley.png
  16131. </pre></div>
  16132. <a name="file"></a>
  16133. <h2 class="section"><a href="ffmpeg-all.html#toc-file">24.8 file</a></h2>
  16134. <p>File access protocol.
  16135. </p>
  16136. <p>Read from or write to a file.
  16137. </p>
  16138. <p>A file URL can have the form:
  16139. </p><div class="example">
  16140. <pre class="example">file:<var>filename</var>
  16141. </pre></div>
  16142. <p>where <var>filename</var> is the path of the file to read.
  16143. </p>
  16144. <p>An URL that does not have a protocol prefix will be assumed to be a
  16145. file URL. Depending on the build, an URL that looks like a Windows
  16146. path with the drive letter at the beginning will also be assumed to be
  16147. a file URL (usually not the case in builds for unix-like systems).
  16148. </p>
  16149. <p>For example to read from a file &lsquo;<tt>input.mpeg</tt>&rsquo; with <code>ffmpeg</code>
  16150. use the command:
  16151. </p><div class="example">
  16152. <pre class="example">ffmpeg -i file:input.mpeg output.mpeg
  16153. </pre></div>
  16154. <p>This protocol accepts the following options:
  16155. </p>
  16156. <dl compact="compact">
  16157. <dt>&lsquo;<samp>truncate</samp>&rsquo;</dt>
  16158. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  16159. truncating. Default value is 1.
  16160. </p>
  16161. </dd>
  16162. <dt>&lsquo;<samp>blocksize</samp>&rsquo;</dt>
  16163. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  16164. <code>INT_MAX</code>, which results in not limiting the requested block size.
  16165. Setting this value reasonably low improves user termination request reaction
  16166. time, which is valuable for files on slow medium.
  16167. </p>
  16168. </dd>
  16169. <dt>&lsquo;<samp>follow</samp>&rsquo;</dt>
  16170. <dd><p>If set to 1, the protocol will retry reading at the end of the file, allowing
  16171. reading files that still are being written. In order for this to terminate,
  16172. you either need to use the rw_timeout option, or use the interrupt callback
  16173. (for API users).
  16174. </p>
  16175. </dd>
  16176. <dt>&lsquo;<samp>seekable</samp>&rsquo;</dt>
  16177. <dd><p>Controls if seekability is advertised on the file. 0 means non-seekable, -1
  16178. means auto (seekable for normal files, non-seekable for named pipes).
  16179. </p>
  16180. <p>Many demuxers handle seekable and non-seekable resources differently,
  16181. overriding this might speed up opening certain files at the cost of losing some
  16182. features (e.g. accurate seeking).
  16183. </p></dd>
  16184. </dl>
  16185. <a name="ftp"></a>
  16186. <h2 class="section"><a href="ffmpeg-all.html#toc-ftp">24.9 ftp</a></h2>
  16187. <p>FTP (File Transfer Protocol).
  16188. </p>
  16189. <p>Read from or write to remote resources using FTP protocol.
  16190. </p>
  16191. <p>Following syntax is required.
  16192. </p><div class="example">
  16193. <pre class="example">ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  16194. </pre></div>
  16195. <p>This protocol accepts the following options.
  16196. </p>
  16197. <dl compact="compact">
  16198. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  16199. <dd><p>Set timeout in microseconds of socket I/O operations used by the underlying low level
  16200. operation. By default it is set to -1, which means that the timeout is
  16201. not specified.
  16202. </p>
  16203. </dd>
  16204. <dt>&lsquo;<samp>ftp-user</samp>&rsquo;</dt>
  16205. <dd><p>Set a user to be used for authenticating to the FTP server. This is overridden by the
  16206. user in the FTP URL.
  16207. </p>
  16208. </dd>
  16209. <dt>&lsquo;<samp>ftp-password</samp>&rsquo;</dt>
  16210. <dd><p>Set a password to be used for authenticating to the FTP server. This is overridden by
  16211. the password in the FTP URL, or by &lsquo;<samp>ftp-anonymous-password</samp>&rsquo; if no user is set.
  16212. </p>
  16213. </dd>
  16214. <dt>&lsquo;<samp>ftp-anonymous-password</samp>&rsquo;</dt>
  16215. <dd><p>Password used when login as anonymous user. Typically an e-mail address
  16216. should be used.
  16217. </p>
  16218. </dd>
  16219. <dt>&lsquo;<samp>ftp-write-seekable</samp>&rsquo;</dt>
  16220. <dd><p>Control seekability of connection during encoding. If set to 1 the
  16221. resource is supposed to be seekable, if set to 0 it is assumed not
  16222. to be seekable. Default value is 0.
  16223. </p></dd>
  16224. </dl>
  16225. <p>NOTE: Protocol can be used as output, but it is recommended to not do
  16226. it, unless special care is taken (tests, customized server configuration
  16227. etc.). Different FTP servers behave in different way during seek
  16228. operation. ff* tools may produce incomplete content due to server limitations.
  16229. </p>
  16230. <a name="gopher"></a>
  16231. <h2 class="section"><a href="ffmpeg-all.html#toc-gopher">24.10 gopher</a></h2>
  16232. <p>Gopher protocol.
  16233. </p>
  16234. <a name="hls-3"></a>
  16235. <h2 class="section"><a href="ffmpeg-all.html#toc-hls-3">24.11 hls</a></h2>
  16236. <p>Read Apple HTTP Live Streaming compliant segmented stream as
  16237. a uniform one. The M3U8 playlists describing the segments can be
  16238. remote HTTP resources or local files, accessed using the standard
  16239. file protocol.
  16240. The nested protocol is declared by specifying
  16241. &quot;+<var>proto</var>&quot; after the hls URI scheme name, where <var>proto</var>
  16242. is either &quot;file&quot; or &quot;http&quot;.
  16243. </p>
  16244. <div class="example">
  16245. <pre class="example">hls+http://host/path/to/remote/resource.m3u8
  16246. hls+file://path/to/local/resource.m3u8
  16247. </pre></div>
  16248. <p>Using this protocol is discouraged - the hls demuxer should work
  16249. just as well (if not, please report the issues) and is more complete.
  16250. To use the hls demuxer instead, simply use the direct URLs to the
  16251. m3u8 files.
  16252. </p>
  16253. <a name="http"></a>
  16254. <h2 class="section"><a href="ffmpeg-all.html#toc-http">24.12 http</a></h2>
  16255. <p>HTTP (Hyper Text Transfer Protocol).
  16256. </p>
  16257. <p>This protocol accepts the following options:
  16258. </p>
  16259. <dl compact="compact">
  16260. <dt>&lsquo;<samp>seekable</samp>&rsquo;</dt>
  16261. <dd><p>Control seekability of connection. If set to 1 the resource is
  16262. supposed to be seekable, if set to 0 it is assumed not to be seekable,
  16263. if set to -1 it will try to autodetect if it is seekable. Default
  16264. value is -1.
  16265. </p>
  16266. </dd>
  16267. <dt>&lsquo;<samp>chunked_post</samp>&rsquo;</dt>
  16268. <dd><p>If set to 1 use chunked Transfer-Encoding for posts, default is 1.
  16269. </p>
  16270. </dd>
  16271. <dt>&lsquo;<samp>content_type</samp>&rsquo;</dt>
  16272. <dd><p>Set a specific content type for the POST messages or for listen mode.
  16273. </p>
  16274. </dd>
  16275. <dt>&lsquo;<samp>http_proxy</samp>&rsquo;</dt>
  16276. <dd><p>set HTTP proxy to tunnel through e.g. http://example.com:1234
  16277. </p>
  16278. </dd>
  16279. <dt>&lsquo;<samp>headers</samp>&rsquo;</dt>
  16280. <dd><p>Set custom HTTP headers, can override built in default headers. The
  16281. value must be a string encoding the headers.
  16282. </p>
  16283. </dd>
  16284. <dt>&lsquo;<samp>multiple_requests</samp>&rsquo;</dt>
  16285. <dd><p>Use persistent connections if set to 1, default is 0.
  16286. </p>
  16287. </dd>
  16288. <dt>&lsquo;<samp>post_data</samp>&rsquo;</dt>
  16289. <dd><p>Set custom HTTP post data.
  16290. </p>
  16291. </dd>
  16292. <dt>&lsquo;<samp>referer</samp>&rsquo;</dt>
  16293. <dd><p>Set the Referer header. Include &rsquo;Referer: URL&rsquo; header in HTTP request.
  16294. </p>
  16295. </dd>
  16296. <dt>&lsquo;<samp>user_agent</samp>&rsquo;</dt>
  16297. <dd><p>Override the User-Agent header. If not specified the protocol will use a
  16298. string describing the libavformat build. (&quot;Lavf/&lt;version&gt;&quot;)
  16299. </p>
  16300. </dd>
  16301. <dt>&lsquo;<samp>user-agent</samp>&rsquo;</dt>
  16302. <dd><p>This is a deprecated option, you can use user_agent instead it.
  16303. </p>
  16304. </dd>
  16305. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  16306. <dd><p>Set timeout in microseconds of socket I/O operations used by the underlying low level
  16307. operation. By default it is set to -1, which means that the timeout is
  16308. not specified.
  16309. </p>
  16310. </dd>
  16311. <dt>&lsquo;<samp>reconnect_at_eof</samp>&rsquo;</dt>
  16312. <dd><p>If set then eof is treated like an error and causes reconnection, this is useful
  16313. for live / endless streams.
  16314. </p>
  16315. </dd>
  16316. <dt>&lsquo;<samp>reconnect_streamed</samp>&rsquo;</dt>
  16317. <dd><p>If set then even streamed/non seekable streams will be reconnected on errors.
  16318. </p>
  16319. </dd>
  16320. <dt>&lsquo;<samp>reconnect_delay_max</samp>&rsquo;</dt>
  16321. <dd><p>Sets the maximum delay in seconds after which to give up reconnecting
  16322. </p>
  16323. </dd>
  16324. <dt>&lsquo;<samp>mime_type</samp>&rsquo;</dt>
  16325. <dd><p>Export the MIME type.
  16326. </p>
  16327. </dd>
  16328. <dt>&lsquo;<samp>http_version</samp>&rsquo;</dt>
  16329. <dd><p>Exports the HTTP response version number. Usually &quot;1.0&quot; or &quot;1.1&quot;.
  16330. </p>
  16331. </dd>
  16332. <dt>&lsquo;<samp>icy</samp>&rsquo;</dt>
  16333. <dd><p>If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
  16334. supports this, the metadata has to be retrieved by the application by reading
  16335. the &lsquo;<samp>icy_metadata_headers</samp>&rsquo; and &lsquo;<samp>icy_metadata_packet</samp>&rsquo; options.
  16336. The default is 1.
  16337. </p>
  16338. </dd>
  16339. <dt>&lsquo;<samp>icy_metadata_headers</samp>&rsquo;</dt>
  16340. <dd><p>If the server supports ICY metadata, this contains the ICY-specific HTTP reply
  16341. headers, separated by newline characters.
  16342. </p>
  16343. </dd>
  16344. <dt>&lsquo;<samp>icy_metadata_packet</samp>&rsquo;</dt>
  16345. <dd><p>If the server supports ICY metadata, and &lsquo;<samp>icy</samp>&rsquo; was set to 1, this
  16346. contains the last non-empty metadata packet sent by the server. It should be
  16347. polled in regular intervals by applications interested in mid-stream metadata
  16348. updates.
  16349. </p>
  16350. </dd>
  16351. <dt>&lsquo;<samp>cookies</samp>&rsquo;</dt>
  16352. <dd><p>Set the cookies to be sent in future requests. The format of each cookie is the
  16353. same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
  16354. delimited by a newline character.
  16355. </p>
  16356. </dd>
  16357. <dt>&lsquo;<samp>offset</samp>&rsquo;</dt>
  16358. <dd><p>Set initial byte offset.
  16359. </p>
  16360. </dd>
  16361. <dt>&lsquo;<samp>end_offset</samp>&rsquo;</dt>
  16362. <dd><p>Try to limit the request to bytes preceding this offset.
  16363. </p>
  16364. </dd>
  16365. <dt>&lsquo;<samp>method</samp>&rsquo;</dt>
  16366. <dd><p>When used as a client option it sets the HTTP method for the request.
  16367. </p>
  16368. <p>When used as a server option it sets the HTTP method that is going to be
  16369. expected from the client(s).
  16370. If the expected and the received HTTP method do not match the client will
  16371. be given a Bad Request response.
  16372. When unset the HTTP method is not checked for now. This will be replaced by
  16373. autodetection in the future.
  16374. </p>
  16375. </dd>
  16376. <dt>&lsquo;<samp>listen</samp>&rsquo;</dt>
  16377. <dd><p>If set to 1 enables experimental HTTP server. This can be used to send data when
  16378. used as an output option, or read data from a client with HTTP POST when used as
  16379. an input option.
  16380. If set to 2 enables experimental multi-client HTTP server. This is not yet implemented
  16381. in ffmpeg.c and thus must not be used as a command line option.
  16382. </p><div class="example">
  16383. <pre class="example"># Server side (sending):
  16384. ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://<var>server</var>:<var>port</var>
  16385. # Client side (receiving):
  16386. ffmpeg -i http://<var>server</var>:<var>port</var> -c copy somefile.ogg
  16387. # Client can also be done with wget:
  16388. wget http://<var>server</var>:<var>port</var> -O somefile.ogg
  16389. # Server side (receiving):
  16390. ffmpeg -listen 1 -i http://<var>server</var>:<var>port</var> -c copy somefile.ogg
  16391. # Client side (sending):
  16392. ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://<var>server</var>:<var>port</var>
  16393. # Client can also be done with wget:
  16394. wget --post-file=somefile.ogg http://<var>server</var>:<var>port</var>
  16395. </pre></div>
  16396. </dd>
  16397. <dt>&lsquo;<samp>send_expect_100</samp>&rsquo;</dt>
  16398. <dd><p>Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
  16399. to 0 it won&rsquo;t, if set to -1 it will try to send if it is applicable. Default
  16400. value is -1.
  16401. </p>
  16402. </dd>
  16403. </dl>
  16404. <a name="HTTP-Cookies"></a>
  16405. <h3 class="subsection"><a href="ffmpeg-all.html#toc-HTTP-Cookies">24.12.1 HTTP Cookies</a></h3>
  16406. <p>Some HTTP requests will be denied unless cookie values are passed in with the
  16407. request. The &lsquo;<samp>cookies</samp>&rsquo; option allows these cookies to be specified. At
  16408. the very least, each cookie must specify a value along with a path and domain.
  16409. HTTP requests that match both the domain and path will automatically include the
  16410. cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
  16411. by a newline.
  16412. </p>
  16413. <p>The required syntax to play a stream specifying a cookie is:
  16414. </p><div class="example">
  16415. <pre class="example">ffplay -cookies &quot;nlqptid=nltid=tsn; path=/; domain=somedomain.com;&quot; http://somedomain.com/somestream.m3u8
  16416. </pre></div>
  16417. <a name="Icecast"></a>
  16418. <h2 class="section"><a href="ffmpeg-all.html#toc-Icecast">24.13 Icecast</a></h2>
  16419. <p>Icecast protocol (stream to Icecast servers)
  16420. </p>
  16421. <p>This protocol accepts the following options:
  16422. </p>
  16423. <dl compact="compact">
  16424. <dt>&lsquo;<samp>ice_genre</samp>&rsquo;</dt>
  16425. <dd><p>Set the stream genre.
  16426. </p>
  16427. </dd>
  16428. <dt>&lsquo;<samp>ice_name</samp>&rsquo;</dt>
  16429. <dd><p>Set the stream name.
  16430. </p>
  16431. </dd>
  16432. <dt>&lsquo;<samp>ice_description</samp>&rsquo;</dt>
  16433. <dd><p>Set the stream description.
  16434. </p>
  16435. </dd>
  16436. <dt>&lsquo;<samp>ice_url</samp>&rsquo;</dt>
  16437. <dd><p>Set the stream website URL.
  16438. </p>
  16439. </dd>
  16440. <dt>&lsquo;<samp>ice_public</samp>&rsquo;</dt>
  16441. <dd><p>Set if the stream should be public.
  16442. The default is 0 (not public).
  16443. </p>
  16444. </dd>
  16445. <dt>&lsquo;<samp>user_agent</samp>&rsquo;</dt>
  16446. <dd><p>Override the User-Agent header. If not specified a string of the form
  16447. &quot;Lavf/&lt;version&gt;&quot; will be used.
  16448. </p>
  16449. </dd>
  16450. <dt>&lsquo;<samp>password</samp>&rsquo;</dt>
  16451. <dd><p>Set the Icecast mountpoint password.
  16452. </p>
  16453. </dd>
  16454. <dt>&lsquo;<samp>content_type</samp>&rsquo;</dt>
  16455. <dd><p>Set the stream content type. This must be set if it is different from
  16456. audio/mpeg.
  16457. </p>
  16458. </dd>
  16459. <dt>&lsquo;<samp>legacy_icecast</samp>&rsquo;</dt>
  16460. <dd><p>This enables support for Icecast versions &lt; 2.4.0, that do not support the
  16461. HTTP PUT method but the SOURCE method.
  16462. </p>
  16463. </dd>
  16464. </dl>
  16465. <div class="example">
  16466. <pre class="example">icecast://[<var>username</var>[:<var>password</var>]@]<var>server</var>:<var>port</var>/<var>mountpoint</var>
  16467. </pre></div>
  16468. <a name="mmst"></a>
  16469. <h2 class="section"><a href="ffmpeg-all.html#toc-mmst">24.14 mmst</a></h2>
  16470. <p>MMS (Microsoft Media Server) protocol over TCP.
  16471. </p>
  16472. <a name="mmsh"></a>
  16473. <h2 class="section"><a href="ffmpeg-all.html#toc-mmsh">24.15 mmsh</a></h2>
  16474. <p>MMS (Microsoft Media Server) protocol over HTTP.
  16475. </p>
  16476. <p>The required syntax is:
  16477. </p><div class="example">
  16478. <pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
  16479. </pre></div>
  16480. <a name="md5-1"></a>
  16481. <h2 class="section"><a href="ffmpeg-all.html#toc-md5-1">24.16 md5</a></h2>
  16482. <p>MD5 output protocol.
  16483. </p>
  16484. <p>Computes the MD5 hash of the data to be written, and on close writes
  16485. this to the designated output or stdout if none is specified. It can
  16486. be used to test muxers without writing an actual file.
  16487. </p>
  16488. <p>Some examples follow.
  16489. </p><div class="example">
  16490. <pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
  16491. ffmpeg -i input.flv -f avi -y md5:output.avi.md5
  16492. # Write the MD5 hash of the encoded AVI file to stdout.
  16493. ffmpeg -i input.flv -f avi -y md5:
  16494. </pre></div>
  16495. <p>Note that some formats (typically MOV) require the output protocol to
  16496. be seekable, so they will fail with the MD5 output protocol.
  16497. </p>
  16498. <a name="pipe"></a>
  16499. <h2 class="section"><a href="ffmpeg-all.html#toc-pipe">24.17 pipe</a></h2>
  16500. <p>UNIX pipe access protocol.
  16501. </p>
  16502. <p>Read and write from UNIX pipes.
  16503. </p>
  16504. <p>The accepted syntax is:
  16505. </p><div class="example">
  16506. <pre class="example">pipe:[<var>number</var>]
  16507. </pre></div>
  16508. <p><var>number</var> is the number corresponding to the file descriptor of the
  16509. pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If <var>number</var>
  16510. is not specified, by default the stdout file descriptor will be used
  16511. for writing, stdin for reading.
  16512. </p>
  16513. <p>For example to read from stdin with <code>ffmpeg</code>:
  16514. </p><div class="example">
  16515. <pre class="example">cat test.wav | ffmpeg -i pipe:0
  16516. # ...this is the same as...
  16517. cat test.wav | ffmpeg -i pipe:
  16518. </pre></div>
  16519. <p>For writing to stdout with <code>ffmpeg</code>:
  16520. </p><div class="example">
  16521. <pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
  16522. # ...this is the same as...
  16523. ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
  16524. </pre></div>
  16525. <p>This protocol accepts the following options:
  16526. </p>
  16527. <dl compact="compact">
  16528. <dt>&lsquo;<samp>blocksize</samp>&rsquo;</dt>
  16529. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  16530. <code>INT_MAX</code>, which results in not limiting the requested block size.
  16531. Setting this value reasonably low improves user termination request reaction
  16532. time, which is valuable if data transmission is slow.
  16533. </p></dd>
  16534. </dl>
  16535. <p>Note that some formats (typically MOV), require the output protocol to
  16536. be seekable, so they will fail with the pipe output protocol.
  16537. </p>
  16538. <a name="prompeg"></a>
  16539. <h2 class="section"><a href="ffmpeg-all.html#toc-prompeg">24.18 prompeg</a></h2>
  16540. <p>Pro-MPEG Code of Practice #3 Release 2 FEC protocol.
  16541. </p>
  16542. <p>The Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction mechanism
  16543. for MPEG-2 Transport Streams sent over RTP.
  16544. </p>
  16545. <p>This protocol must be used in conjunction with the <code>rtp_mpegts</code> muxer and
  16546. the <code>rtp</code> protocol.
  16547. </p>
  16548. <p>The required syntax is:
  16549. </p><div class="example">
  16550. <pre class="example">-f rtp_mpegts -fec prompeg=<var>option</var>=<var>val</var>... rtp://<var>hostname</var>:<var>port</var>
  16551. </pre></div>
  16552. <p>The destination UDP ports are <code>port + 2</code> for the column FEC stream
  16553. and <code>port + 4</code> for the row FEC stream.
  16554. </p>
  16555. <p>This protocol accepts the following options:
  16556. </p><dl compact="compact">
  16557. <dt>&lsquo;<samp>l=<var>n</var></samp>&rsquo;</dt>
  16558. <dd><p>The number of columns (4-20, LxD &lt;= 100)
  16559. </p>
  16560. </dd>
  16561. <dt>&lsquo;<samp>d=<var>n</var></samp>&rsquo;</dt>
  16562. <dd><p>The number of rows (4-20, LxD &lt;= 100)
  16563. </p>
  16564. </dd>
  16565. </dl>
  16566. <p>Example usage:
  16567. </p>
  16568. <div class="example">
  16569. <pre class="example">-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://<var>hostname</var>:<var>port</var>
  16570. </pre></div>
  16571. <a name="rtmp"></a>
  16572. <h2 class="section"><a href="ffmpeg-all.html#toc-rtmp">24.19 rtmp</a></h2>
  16573. <p>Real-Time Messaging Protocol.
  16574. </p>
  16575. <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
  16576. content across a TCP/IP network.
  16577. </p>
  16578. <p>The required syntax is:
  16579. </p><div class="example">
  16580. <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>]
  16581. </pre></div>
  16582. <p>The accepted parameters are:
  16583. </p><dl compact="compact">
  16584. <dt>&lsquo;<samp>username</samp>&rsquo;</dt>
  16585. <dd><p>An optional username (mostly for publishing).
  16586. </p>
  16587. </dd>
  16588. <dt>&lsquo;<samp>password</samp>&rsquo;</dt>
  16589. <dd><p>An optional password (mostly for publishing).
  16590. </p>
  16591. </dd>
  16592. <dt>&lsquo;<samp>server</samp>&rsquo;</dt>
  16593. <dd><p>The address of the RTMP server.
  16594. </p>
  16595. </dd>
  16596. <dt>&lsquo;<samp>port</samp>&rsquo;</dt>
  16597. <dd><p>The number of the TCP port to use (by default is 1935).
  16598. </p>
  16599. </dd>
  16600. <dt>&lsquo;<samp>app</samp>&rsquo;</dt>
  16601. <dd><p>It is the name of the application to access. It usually corresponds to
  16602. the path where the application is installed on the RTMP server
  16603. (e.g. &lsquo;<tt>/ondemand/</tt>&rsquo;, &lsquo;<tt>/flash/live/</tt>&rsquo;, etc.). You can override
  16604. the value parsed from the URI through the <code>rtmp_app</code> option, too.
  16605. </p>
  16606. </dd>
  16607. <dt>&lsquo;<samp>playpath</samp>&rsquo;</dt>
  16608. <dd><p>It is the path or name of the resource to play with reference to the
  16609. application specified in <var>app</var>, may be prefixed by &quot;mp4:&quot;. You
  16610. can override the value parsed from the URI through the <code>rtmp_playpath</code>
  16611. option, too.
  16612. </p>
  16613. </dd>
  16614. <dt>&lsquo;<samp>listen</samp>&rsquo;</dt>
  16615. <dd><p>Act as a server, listening for an incoming connection.
  16616. </p>
  16617. </dd>
  16618. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  16619. <dd><p>Maximum time to wait for the incoming connection. Implies listen.
  16620. </p></dd>
  16621. </dl>
  16622. <p>Additionally, the following parameters can be set via command line options
  16623. (or in code via <code>AVOption</code>s):
  16624. </p><dl compact="compact">
  16625. <dt>&lsquo;<samp>rtmp_app</samp>&rsquo;</dt>
  16626. <dd><p>Name of application to connect on the RTMP server. This option
  16627. overrides the parameter specified in the URI.
  16628. </p>
  16629. </dd>
  16630. <dt>&lsquo;<samp>rtmp_buffer</samp>&rsquo;</dt>
  16631. <dd><p>Set the client buffer time in milliseconds. The default is 3000.
  16632. </p>
  16633. </dd>
  16634. <dt>&lsquo;<samp>rtmp_conn</samp>&rsquo;</dt>
  16635. <dd><p>Extra arbitrary AMF connection parameters, parsed from a string,
  16636. e.g. like <code>B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0</code>.
  16637. Each value is prefixed by a single character denoting the type,
  16638. B for Boolean, N for number, S for string, O for object, or Z for null,
  16639. followed by a colon. For Booleans the data must be either 0 or 1 for
  16640. FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or
  16641. 1 to end or begin an object, respectively. Data items in subobjects may
  16642. be named, by prefixing the type with &rsquo;N&rsquo; and specifying the name before
  16643. the value (i.e. <code>NB:myFlag:1</code>). This option may be used multiple
  16644. times to construct arbitrary AMF sequences.
  16645. </p>
  16646. </dd>
  16647. <dt>&lsquo;<samp>rtmp_flashver</samp>&rsquo;</dt>
  16648. <dd><p>Version of the Flash plugin used to run the SWF player. The default
  16649. is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
  16650. &lt;libavformat version&gt;).)
  16651. </p>
  16652. </dd>
  16653. <dt>&lsquo;<samp>rtmp_flush_interval</samp>&rsquo;</dt>
  16654. <dd><p>Number of packets flushed in the same request (RTMPT only). The default
  16655. is 10.
  16656. </p>
  16657. </dd>
  16658. <dt>&lsquo;<samp>rtmp_live</samp>&rsquo;</dt>
  16659. <dd><p>Specify that the media is a live stream. No resuming or seeking in
  16660. live streams is possible. The default value is <code>any</code>, which means the
  16661. subscriber first tries to play the live stream specified in the
  16662. playpath. If a live stream of that name is not found, it plays the
  16663. recorded stream. The other possible values are <code>live</code> and
  16664. <code>recorded</code>.
  16665. </p>
  16666. </dd>
  16667. <dt>&lsquo;<samp>rtmp_pageurl</samp>&rsquo;</dt>
  16668. <dd><p>URL of the web page in which the media was embedded. By default no
  16669. value will be sent.
  16670. </p>
  16671. </dd>
  16672. <dt>&lsquo;<samp>rtmp_playpath</samp>&rsquo;</dt>
  16673. <dd><p>Stream identifier to play or to publish. This option overrides the
  16674. parameter specified in the URI.
  16675. </p>
  16676. </dd>
  16677. <dt>&lsquo;<samp>rtmp_subscribe</samp>&rsquo;</dt>
  16678. <dd><p>Name of live stream to subscribe to. By default no value will be sent.
  16679. It is only sent if the option is specified or if rtmp_live
  16680. is set to live.
  16681. </p>
  16682. </dd>
  16683. <dt>&lsquo;<samp>rtmp_swfhash</samp>&rsquo;</dt>
  16684. <dd><p>SHA256 hash of the decompressed SWF file (32 bytes).
  16685. </p>
  16686. </dd>
  16687. <dt>&lsquo;<samp>rtmp_swfsize</samp>&rsquo;</dt>
  16688. <dd><p>Size of the decompressed SWF file, required for SWFVerification.
  16689. </p>
  16690. </dd>
  16691. <dt>&lsquo;<samp>rtmp_swfurl</samp>&rsquo;</dt>
  16692. <dd><p>URL of the SWF player for the media. By default no value will be sent.
  16693. </p>
  16694. </dd>
  16695. <dt>&lsquo;<samp>rtmp_swfverify</samp>&rsquo;</dt>
  16696. <dd><p>URL to player swf file, compute hash/size automatically.
  16697. </p>
  16698. </dd>
  16699. <dt>&lsquo;<samp>rtmp_tcurl</samp>&rsquo;</dt>
  16700. <dd><p>URL of the target stream. Defaults to proto://host[:port]/app.
  16701. </p>
  16702. </dd>
  16703. </dl>
  16704. <p>For example to read with <code>ffplay</code> a multimedia resource named
  16705. &quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
  16706. </p><div class="example">
  16707. <pre class="example">ffplay rtmp://myserver/vod/sample
  16708. </pre></div>
  16709. <p>To publish to a password protected server, passing the playpath and
  16710. app names separately:
  16711. </p><div class="example">
  16712. <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/
  16713. </pre></div>
  16714. <a name="rtmpe"></a>
  16715. <h2 class="section"><a href="ffmpeg-all.html#toc-rtmpe">24.20 rtmpe</a></h2>
  16716. <p>Encrypted Real-Time Messaging Protocol.
  16717. </p>
  16718. <p>The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
  16719. streaming multimedia content within standard cryptographic primitives,
  16720. consisting of Diffie-Hellman key exchange and HMACSHA256, generating
  16721. a pair of RC4 keys.
  16722. </p>
  16723. <a name="rtmps"></a>
  16724. <h2 class="section"><a href="ffmpeg-all.html#toc-rtmps">24.21 rtmps</a></h2>
  16725. <p>Real-Time Messaging Protocol over a secure SSL connection.
  16726. </p>
  16727. <p>The Real-Time Messaging Protocol (RTMPS) is used for streaming
  16728. multimedia content across an encrypted connection.
  16729. </p>
  16730. <a name="rtmpt"></a>
  16731. <h2 class="section"><a href="ffmpeg-all.html#toc-rtmpt">24.22 rtmpt</a></h2>
  16732. <p>Real-Time Messaging Protocol tunneled through HTTP.
  16733. </p>
  16734. <p>The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
  16735. for streaming multimedia content within HTTP requests to traverse
  16736. firewalls.
  16737. </p>
  16738. <a name="rtmpte"></a>
  16739. <h2 class="section"><a href="ffmpeg-all.html#toc-rtmpte">24.23 rtmpte</a></h2>
  16740. <p>Encrypted Real-Time Messaging Protocol tunneled through HTTP.
  16741. </p>
  16742. <p>The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
  16743. is used for streaming multimedia content within HTTP requests to traverse
  16744. firewalls.
  16745. </p>
  16746. <a name="rtmpts"></a>
  16747. <h2 class="section"><a href="ffmpeg-all.html#toc-rtmpts">24.24 rtmpts</a></h2>
  16748. <p>Real-Time Messaging Protocol tunneled through HTTPS.
  16749. </p>
  16750. <p>The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
  16751. for streaming multimedia content within HTTPS requests to traverse
  16752. firewalls.
  16753. </p>
  16754. <a name="libsmbclient"></a>
  16755. <h2 class="section"><a href="ffmpeg-all.html#toc-libsmbclient">24.25 libsmbclient</a></h2>
  16756. <p>libsmbclient permits one to manipulate CIFS/SMB network resources.
  16757. </p>
  16758. <p>Following syntax is required.
  16759. </p>
  16760. <div class="example">
  16761. <pre class="example">smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
  16762. </pre></div>
  16763. <p>This protocol accepts the following options.
  16764. </p>
  16765. <dl compact="compact">
  16766. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  16767. <dd><p>Set timeout in milliseconds of socket I/O operations used by the underlying
  16768. low level operation. By default it is set to -1, which means that the timeout
  16769. is not specified.
  16770. </p>
  16771. </dd>
  16772. <dt>&lsquo;<samp>truncate</samp>&rsquo;</dt>
  16773. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  16774. truncating. Default value is 1.
  16775. </p>
  16776. </dd>
  16777. <dt>&lsquo;<samp>workgroup</samp>&rsquo;</dt>
  16778. <dd><p>Set the workgroup used for making connections. By default workgroup is not specified.
  16779. </p>
  16780. </dd>
  16781. </dl>
  16782. <p>For more information see: <a href="http://www.samba.org/">http://www.samba.org/</a>.
  16783. </p>
  16784. <a name="libssh"></a>
  16785. <h2 class="section"><a href="ffmpeg-all.html#toc-libssh">24.26 libssh</a></h2>
  16786. <p>Secure File Transfer Protocol via libssh
  16787. </p>
  16788. <p>Read from or write to remote resources using SFTP protocol.
  16789. </p>
  16790. <p>Following syntax is required.
  16791. </p>
  16792. <div class="example">
  16793. <pre class="example">sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  16794. </pre></div>
  16795. <p>This protocol accepts the following options.
  16796. </p>
  16797. <dl compact="compact">
  16798. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  16799. <dd><p>Set timeout of socket I/O operations used by the underlying low level
  16800. operation. By default it is set to -1, which means that the timeout
  16801. is not specified.
  16802. </p>
  16803. </dd>
  16804. <dt>&lsquo;<samp>truncate</samp>&rsquo;</dt>
  16805. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  16806. truncating. Default value is 1.
  16807. </p>
  16808. </dd>
  16809. <dt>&lsquo;<samp>private_key</samp>&rsquo;</dt>
  16810. <dd><p>Specify the path of the file containing private key to use during authorization.
  16811. By default libssh searches for keys in the &lsquo;<tt>~/.ssh/</tt>&rsquo; directory.
  16812. </p>
  16813. </dd>
  16814. </dl>
  16815. <p>Example: Play a file stored on remote server.
  16816. </p>
  16817. <div class="example">
  16818. <pre class="example">ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
  16819. </pre></div>
  16820. <a name="librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
  16821. <h2 class="section"><a href="ffmpeg-all.html#toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">24.27 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></h2>
  16822. <p>Real-Time Messaging Protocol and its variants supported through
  16823. librtmp.
  16824. </p>
  16825. <p>Requires the presence of the librtmp headers and library during
  16826. configuration. You need to explicitly configure the build with
  16827. &quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
  16828. protocol.
  16829. </p>
  16830. <p>This protocol provides most client functions and a few server
  16831. functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
  16832. encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
  16833. variants of these encrypted types (RTMPTE, RTMPTS).
  16834. </p>
  16835. <p>The required syntax is:
  16836. </p><div class="example">
  16837. <pre class="example"><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
  16838. </pre></div>
  16839. <p>where <var>rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
  16840. &quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
  16841. <var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
  16842. meaning as specified for the RTMP native protocol.
  16843. <var>options</var> contains a list of space-separated options of the form
  16844. <var>key</var>=<var>val</var>.
  16845. </p>
  16846. <p>See the librtmp manual page (man 3 librtmp) for more information.
  16847. </p>
  16848. <p>For example, to stream a file in real-time to an RTMP server using
  16849. <code>ffmpeg</code>:
  16850. </p><div class="example">
  16851. <pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
  16852. </pre></div>
  16853. <p>To play the same stream using <code>ffplay</code>:
  16854. </p><div class="example">
  16855. <pre class="example">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
  16856. </pre></div>
  16857. <a name="rtp"></a>
  16858. <h2 class="section"><a href="ffmpeg-all.html#toc-rtp">24.28 rtp</a></h2>
  16859. <p>Real-time Transport Protocol.
  16860. </p>
  16861. <p>The required syntax for an RTP URL is:
  16862. rtp://<var>hostname</var>[:<var>port</var>][?<var>option</var>=<var>val</var>...]
  16863. </p>
  16864. <p><var>port</var> specifies the RTP port to use.
  16865. </p>
  16866. <p>The following URL options are supported:
  16867. </p>
  16868. <dl compact="compact">
  16869. <dt>&lsquo;<samp>ttl=<var>n</var></samp>&rsquo;</dt>
  16870. <dd><p>Set the TTL (Time-To-Live) value (for multicast only).
  16871. </p>
  16872. </dd>
  16873. <dt>&lsquo;<samp>rtcpport=<var>n</var></samp>&rsquo;</dt>
  16874. <dd><p>Set the remote RTCP port to <var>n</var>.
  16875. </p>
  16876. </dd>
  16877. <dt>&lsquo;<samp>localrtpport=<var>n</var></samp>&rsquo;</dt>
  16878. <dd><p>Set the local RTP port to <var>n</var>.
  16879. </p>
  16880. </dd>
  16881. <dt>&lsquo;<samp>localrtcpport=<var>n</var>'</samp>&rsquo;</dt>
  16882. <dd><p>Set the local RTCP port to <var>n</var>.
  16883. </p>
  16884. </dd>
  16885. <dt>&lsquo;<samp>pkt_size=<var>n</var></samp>&rsquo;</dt>
  16886. <dd><p>Set max packet size (in bytes) to <var>n</var>.
  16887. </p>
  16888. </dd>
  16889. <dt>&lsquo;<samp>connect=0|1</samp>&rsquo;</dt>
  16890. <dd><p>Do a <code>connect()</code> on the UDP socket (if set to 1) or not (if set
  16891. to 0).
  16892. </p>
  16893. </dd>
  16894. <dt>&lsquo;<samp>sources=<var>ip</var>[,<var>ip</var>]</samp>&rsquo;</dt>
  16895. <dd><p>List allowed source IP addresses.
  16896. </p>
  16897. </dd>
  16898. <dt>&lsquo;<samp>block=<var>ip</var>[,<var>ip</var>]</samp>&rsquo;</dt>
  16899. <dd><p>List disallowed (blocked) source IP addresses.
  16900. </p>
  16901. </dd>
  16902. <dt>&lsquo;<samp>write_to_source=0|1</samp>&rsquo;</dt>
  16903. <dd><p>Send packets to the source address of the latest received packet (if
  16904. set to 1) or to a default remote address (if set to 0).
  16905. </p>
  16906. </dd>
  16907. <dt>&lsquo;<samp>localport=<var>n</var></samp>&rsquo;</dt>
  16908. <dd><p>Set the local RTP port to <var>n</var>.
  16909. </p>
  16910. <p>This is a deprecated option. Instead, &lsquo;<samp>localrtpport</samp>&rsquo; should be
  16911. used.
  16912. </p>
  16913. </dd>
  16914. </dl>
  16915. <p>Important notes:
  16916. </p>
  16917. <ol>
  16918. <li>
  16919. If &lsquo;<samp>rtcpport</samp>&rsquo; is not set the RTCP port will be set to the RTP
  16920. port value plus 1.
  16921. </li><li>
  16922. If &lsquo;<samp>localrtpport</samp>&rsquo; (the local RTP port) is not set any available
  16923. port will be used for the local RTP and RTCP ports.
  16924. </li><li>
  16925. If &lsquo;<samp>localrtcpport</samp>&rsquo; (the local RTCP port) is not set it will be
  16926. set to the local RTP port value plus 1.
  16927. </li></ol>
  16928. <a name="rtsp"></a>
  16929. <h2 class="section"><a href="ffmpeg-all.html#toc-rtsp">24.29 rtsp</a></h2>
  16930. <p>Real-Time Streaming Protocol.
  16931. </p>
  16932. <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
  16933. and muxer. The demuxer supports both normal RTSP (with data transferred
  16934. over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
  16935. data transferred over RDT).
  16936. </p>
  16937. <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
  16938. supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
  16939. <a href="https://github.com/revmischa/rtsp-server">RTSP server</a>).
  16940. </p>
  16941. <p>The required syntax for a RTSP url is:
  16942. </p><div class="example">
  16943. <pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>
  16944. </pre></div>
  16945. <p>Options can be set on the <code>ffmpeg</code>/<code>ffplay</code> command
  16946. line, or set in code via <code>AVOption</code>s or in
  16947. <code>avformat_open_input</code>.
  16948. </p>
  16949. <p>The following options are supported.
  16950. </p>
  16951. <dl compact="compact">
  16952. <dt>&lsquo;<samp>initial_pause</samp>&rsquo;</dt>
  16953. <dd><p>Do not start playing the stream immediately if set to 1. Default value
  16954. is 0.
  16955. </p>
  16956. </dd>
  16957. <dt>&lsquo;<samp>rtsp_transport</samp>&rsquo;</dt>
  16958. <dd><p>Set RTSP transport protocols.
  16959. </p>
  16960. <p>It accepts the following values:
  16961. </p><dl compact="compact">
  16962. <dt>&lsquo;<samp>udp</samp>&rsquo;</dt>
  16963. <dd><p>Use UDP as lower transport protocol.
  16964. </p>
  16965. </dd>
  16966. <dt>&lsquo;<samp>tcp</samp>&rsquo;</dt>
  16967. <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
  16968. transport protocol.
  16969. </p>
  16970. </dd>
  16971. <dt>&lsquo;<samp>udp_multicast</samp>&rsquo;</dt>
  16972. <dd><p>Use UDP multicast as lower transport protocol.
  16973. </p>
  16974. </dd>
  16975. <dt>&lsquo;<samp>http</samp>&rsquo;</dt>
  16976. <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
  16977. passing proxies.
  16978. </p></dd>
  16979. </dl>
  16980. <p>Multiple lower transport protocols may be specified, in that case they are
  16981. tried one at a time (if the setup of one fails, the next one is tried).
  16982. For the muxer, only the &lsquo;<samp>tcp</samp>&rsquo; and &lsquo;<samp>udp</samp>&rsquo; options are supported.
  16983. </p>
  16984. </dd>
  16985. <dt>&lsquo;<samp>rtsp_flags</samp>&rsquo;</dt>
  16986. <dd><p>Set RTSP flags.
  16987. </p>
  16988. <p>The following values are accepted:
  16989. </p><dl compact="compact">
  16990. <dt>&lsquo;<samp>filter_src</samp>&rsquo;</dt>
  16991. <dd><p>Accept packets only from negotiated peer address and port.
  16992. </p></dd>
  16993. <dt>&lsquo;<samp>listen</samp>&rsquo;</dt>
  16994. <dd><p>Act as a server, listening for an incoming connection.
  16995. </p></dd>
  16996. <dt>&lsquo;<samp>prefer_tcp</samp>&rsquo;</dt>
  16997. <dd><p>Try TCP for RTP transport first, if TCP is available as RTSP RTP transport.
  16998. </p></dd>
  16999. </dl>
  17000. <p>Default value is &lsquo;<samp>none</samp>&rsquo;.
  17001. </p>
  17002. </dd>
  17003. <dt>&lsquo;<samp>allowed_media_types</samp>&rsquo;</dt>
  17004. <dd><p>Set media types to accept from the server.
  17005. </p>
  17006. <p>The following flags are accepted:
  17007. </p><dl compact="compact">
  17008. <dt>&lsquo;<samp>video</samp>&rsquo;</dt>
  17009. <dt>&lsquo;<samp>audio</samp>&rsquo;</dt>
  17010. <dt>&lsquo;<samp>data</samp>&rsquo;</dt>
  17011. </dl>
  17012. <p>By default it accepts all media types.
  17013. </p>
  17014. </dd>
  17015. <dt>&lsquo;<samp>min_port</samp>&rsquo;</dt>
  17016. <dd><p>Set minimum local UDP port. Default value is 5000.
  17017. </p>
  17018. </dd>
  17019. <dt>&lsquo;<samp>max_port</samp>&rsquo;</dt>
  17020. <dd><p>Set maximum local UDP port. Default value is 65000.
  17021. </p>
  17022. </dd>
  17023. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  17024. <dd><p>Set maximum timeout (in seconds) to wait for incoming connections.
  17025. </p>
  17026. <p>A value of -1 means infinite (default). This option implies the
  17027. &lsquo;<samp>rtsp_flags</samp>&rsquo; set to &lsquo;<samp>listen</samp>&rsquo;.
  17028. </p>
  17029. </dd>
  17030. <dt>&lsquo;<samp>reorder_queue_size</samp>&rsquo;</dt>
  17031. <dd><p>Set number of packets to buffer for handling of reordered packets.
  17032. </p>
  17033. </dd>
  17034. <dt>&lsquo;<samp>stimeout</samp>&rsquo;</dt>
  17035. <dd><p>Set socket TCP I/O timeout in microseconds.
  17036. </p>
  17037. </dd>
  17038. <dt>&lsquo;<samp>user-agent</samp>&rsquo;</dt>
  17039. <dd><p>Override User-Agent header. If not specified, it defaults to the
  17040. libavformat identifier string.
  17041. </p></dd>
  17042. </dl>
  17043. <p>When receiving data over UDP, the demuxer tries to reorder received packets
  17044. (since they may arrive out of order, or packets may get lost totally). This
  17045. can be disabled by setting the maximum demuxing delay to zero (via
  17046. the <code>max_delay</code> field of AVFormatContext).
  17047. </p>
  17048. <p>When watching multi-bitrate Real-RTSP streams with <code>ffplay</code>, the
  17049. streams to display can be chosen with <code>-vst</code> <var>n</var> and
  17050. <code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
  17051. on the fly by pressing <code>v</code> and <code>a</code>.
  17052. </p>
  17053. <a name="Examples-80"></a>
  17054. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-80">24.29.1 Examples</a></h3>
  17055. <p>The following examples all make use of the <code>ffplay</code> and
  17056. <code>ffmpeg</code> tools.
  17057. </p>
  17058. <ul>
  17059. <li>
  17060. Watch a stream over UDP, with a max reordering delay of 0.5 seconds:
  17061. <div class="example">
  17062. <pre class="example">ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
  17063. </pre></div>
  17064. </li><li>
  17065. Watch a stream tunneled over HTTP:
  17066. <div class="example">
  17067. <pre class="example">ffplay -rtsp_transport http rtsp://server/video.mp4
  17068. </pre></div>
  17069. </li><li>
  17070. Send a stream in realtime to a RTSP server, for others to watch:
  17071. <div class="example">
  17072. <pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
  17073. </pre></div>
  17074. </li><li>
  17075. Receive a stream in realtime:
  17076. <div class="example">
  17077. <pre class="example">ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <var>output</var>
  17078. </pre></div>
  17079. </li></ul>
  17080. <a name="sap"></a>
  17081. <h2 class="section"><a href="ffmpeg-all.html#toc-sap">24.30 sap</a></h2>
  17082. <p>Session Announcement Protocol (RFC 2974). This is not technically a
  17083. protocol handler in libavformat, it is a muxer and demuxer.
  17084. It is used for signalling of RTP streams, by announcing the SDP for the
  17085. streams regularly on a separate port.
  17086. </p>
  17087. <a name="Muxer"></a>
  17088. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Muxer">24.30.1 Muxer</a></h3>
  17089. <p>The syntax for a SAP url given to the muxer is:
  17090. </p><div class="example">
  17091. <pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
  17092. </pre></div>
  17093. <p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
  17094. or to port 5004 if no port is specified.
  17095. <var>options</var> is a <code>&amp;</code>-separated list. The following options
  17096. are supported:
  17097. </p>
  17098. <dl compact="compact">
  17099. <dt>&lsquo;<samp>announce_addr=<var>address</var></samp>&rsquo;</dt>
  17100. <dd><p>Specify the destination IP address for sending the announcements to.
  17101. If omitted, the announcements are sent to the commonly used SAP
  17102. announcement multicast address 224.2.127.254 (sap.mcast.net), or
  17103. ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
  17104. </p>
  17105. </dd>
  17106. <dt>&lsquo;<samp>announce_port=<var>port</var></samp>&rsquo;</dt>
  17107. <dd><p>Specify the port to send the announcements on, defaults to
  17108. 9875 if not specified.
  17109. </p>
  17110. </dd>
  17111. <dt>&lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
  17112. <dd><p>Specify the time to live value for the announcements and RTP packets,
  17113. defaults to 255.
  17114. </p>
  17115. </dd>
  17116. <dt>&lsquo;<samp>same_port=<var>0|1</var></samp>&rsquo;</dt>
  17117. <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
  17118. default), all streams are sent on unique ports, with each stream on a
  17119. port 2 numbers higher than the previous.
  17120. VLC/Live555 requires this to be set to 1, to be able to receive the stream.
  17121. The RTP stack in libavformat for receiving requires all streams to be sent
  17122. on unique ports.
  17123. </p></dd>
  17124. </dl>
  17125. <p>Example command lines follow.
  17126. </p>
  17127. <p>To broadcast a stream on the local subnet, for watching in VLC:
  17128. </p>
  17129. <div class="example">
  17130. <pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
  17131. </pre></div>
  17132. <p>Similarly, for watching in <code>ffplay</code>:
  17133. </p>
  17134. <div class="example">
  17135. <pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
  17136. </pre></div>
  17137. <p>And for watching in <code>ffplay</code>, over IPv6:
  17138. </p>
  17139. <div class="example">
  17140. <pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
  17141. </pre></div>
  17142. <a name="Demuxer"></a>
  17143. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Demuxer">24.30.2 Demuxer</a></h3>
  17144. <p>The syntax for a SAP url given to the demuxer is:
  17145. </p><div class="example">
  17146. <pre class="example">sap://[<var>address</var>][:<var>port</var>]
  17147. </pre></div>
  17148. <p><var>address</var> is the multicast address to listen for announcements on,
  17149. if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
  17150. is the port that is listened on, 9875 if omitted.
  17151. </p>
  17152. <p>The demuxers listens for announcements on the given address and port.
  17153. Once an announcement is received, it tries to receive that particular stream.
  17154. </p>
  17155. <p>Example command lines follow.
  17156. </p>
  17157. <p>To play back the first stream announced on the normal SAP multicast address:
  17158. </p>
  17159. <div class="example">
  17160. <pre class="example">ffplay sap://
  17161. </pre></div>
  17162. <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
  17163. </p>
  17164. <div class="example">
  17165. <pre class="example">ffplay sap://[ff0e::2:7ffe]
  17166. </pre></div>
  17167. <a name="sctp"></a>
  17168. <h2 class="section"><a href="ffmpeg-all.html#toc-sctp">24.31 sctp</a></h2>
  17169. <p>Stream Control Transmission Protocol.
  17170. </p>
  17171. <p>The accepted URL syntax is:
  17172. </p><div class="example">
  17173. <pre class="example">sctp://<var>host</var>:<var>port</var>[?<var>options</var>]
  17174. </pre></div>
  17175. <p>The protocol accepts the following options:
  17176. </p><dl compact="compact">
  17177. <dt>&lsquo;<samp>listen</samp>&rsquo;</dt>
  17178. <dd><p>If set to any value, listen for an incoming connection. Outgoing connection is done by default.
  17179. </p>
  17180. </dd>
  17181. <dt>&lsquo;<samp>max_streams</samp>&rsquo;</dt>
  17182. <dd><p>Set the maximum number of streams. By default no limit is set.
  17183. </p></dd>
  17184. </dl>
  17185. <a name="srt"></a>
  17186. <h2 class="section"><a href="ffmpeg-all.html#toc-srt">24.32 srt</a></h2>
  17187. <p>Haivision Secure Reliable Transport Protocol via libsrt.
  17188. </p>
  17189. <p>The supported syntax for a SRT URL is:
  17190. </p><div class="example">
  17191. <pre class="example">srt://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  17192. </pre></div>
  17193. <p><var>options</var> contains a list of &amp;-separated options of the form
  17194. <var>key</var>=<var>val</var>.
  17195. </p>
  17196. <p>or
  17197. </p>
  17198. <div class="example">
  17199. <pre class="example"><var>options</var> srt://<var>hostname</var>:<var>port</var>
  17200. </pre></div>
  17201. <p><var>options</var> contains a list of &rsquo;-<var>key</var> <var>val</var>&rsquo;
  17202. options.
  17203. </p>
  17204. <p>This protocol accepts the following options.
  17205. </p>
  17206. <dl compact="compact">
  17207. <dt>&lsquo;<samp>connect_timeout=<var>milliseconds</var></samp>&rsquo;</dt>
  17208. <dd><p>Connection timeout; SRT cannot connect for RTT &gt; 1500 msec
  17209. (2 handshake exchanges) with the default connect timeout of
  17210. 3 seconds. This option applies to the caller and rendezvous
  17211. connection modes. The connect timeout is 10 times the value
  17212. set for the rendezvous mode (which can be used as a
  17213. workaround for this connection problem with earlier versions).
  17214. </p>
  17215. </dd>
  17216. <dt>&lsquo;<samp>ffs=<var>bytes</var></samp>&rsquo;</dt>
  17217. <dd><p>Flight Flag Size (Window Size), in bytes. FFS is actually an
  17218. internal parameter and you should set it to not less than
  17219. &lsquo;<samp>recv_buffer_size</samp>&rsquo; and &lsquo;<samp>mss</samp>&rsquo;. The default value
  17220. is relatively large, therefore unless you set a very large receiver buffer,
  17221. you do not need to change this option. Default value is 25600.
  17222. </p>
  17223. </dd>
  17224. <dt>&lsquo;<samp>inputbw=<var>bytes/seconds</var></samp>&rsquo;</dt>
  17225. <dd><p>Sender nominal input rate, in bytes per seconds. Used along with
  17226. &lsquo;<samp>oheadbw</samp>&rsquo;, when &lsquo;<samp>maxbw</samp>&rsquo; is set to relative (0), to
  17227. calculate maximum sending rate when recovery packets are sent
  17228. along with the main media stream:
  17229. &lsquo;<samp>inputbw</samp>&rsquo; * (100 + &lsquo;<samp>oheadbw</samp>&rsquo;) / 100
  17230. if &lsquo;<samp>inputbw</samp>&rsquo; is not set while &lsquo;<samp>maxbw</samp>&rsquo; is set to
  17231. relative (0), the actual input rate is evaluated inside
  17232. the library. Default value is 0.
  17233. </p>
  17234. </dd>
  17235. <dt>&lsquo;<samp>iptos=<var>tos</var></samp>&rsquo;</dt>
  17236. <dd><p>IP Type of Service. Applies to sender only. Default value is 0xB8.
  17237. </p>
  17238. </dd>
  17239. <dt>&lsquo;<samp>ipttl=<var>ttl</var></samp>&rsquo;</dt>
  17240. <dd><p>IP Time To Live. Applies to sender only. Default value is 64.
  17241. </p>
  17242. </dd>
  17243. <dt>&lsquo;<samp>latency=<var>microseconds</var></samp>&rsquo;</dt>
  17244. <dd><p>Timestamp-based Packet Delivery Delay.
  17245. Used to absorb bursts of missed packet retransmissions.
  17246. This flag sets both &lsquo;<samp>rcvlatency</samp>&rsquo; and &lsquo;<samp>peerlatency</samp>&rsquo;
  17247. to the same value. Note that prior to version 1.3.0
  17248. this is the only flag to set the latency, however
  17249. this is effectively equivalent to setting &lsquo;<samp>peerlatency</samp>&rsquo;,
  17250. when side is sender and &lsquo;<samp>rcvlatency</samp>&rsquo;
  17251. when side is receiver, and the bidirectional stream
  17252. sending is not supported.
  17253. </p>
  17254. </dd>
  17255. <dt>&lsquo;<samp>listen_timeout=<var>microseconds</var></samp>&rsquo;</dt>
  17256. <dd><p>Set socket listen timeout.
  17257. </p>
  17258. </dd>
  17259. <dt>&lsquo;<samp>maxbw=<var>bytes/seconds</var></samp>&rsquo;</dt>
  17260. <dd><p>Maximum sending bandwidth, in bytes per seconds.
  17261. -1 infinite (CSRTCC limit is 30mbps)
  17262. 0 relative to input rate (see &lsquo;<samp>inputbw</samp>&rsquo;)
  17263. &gt;0 absolute limit value
  17264. Default value is 0 (relative)
  17265. </p>
  17266. </dd>
  17267. <dt>&lsquo;<samp>mode=<var>caller|listener|rendezvous</var></samp>&rsquo;</dt>
  17268. <dd><p>Connection mode.
  17269. &lsquo;<samp>caller</samp>&rsquo; opens client connection.
  17270. &lsquo;<samp>listener</samp>&rsquo; starts server to listen for incoming connections.
  17271. &lsquo;<samp>rendezvous</samp>&rsquo; use Rendez-Vous connection mode.
  17272. Default value is caller.
  17273. </p>
  17274. </dd>
  17275. <dt>&lsquo;<samp>mss=<var>bytes</var></samp>&rsquo;</dt>
  17276. <dd><p>Maximum Segment Size, in bytes. Used for buffer allocation
  17277. and rate calculation using a packet counter assuming fully
  17278. filled packets. The smallest MSS between the peers is
  17279. used. This is 1500 by default in the overall internet.
  17280. This is the maximum size of the UDP packet and can be
  17281. only decreased, unless you have some unusual dedicated
  17282. network settings. Default value is 1500.
  17283. </p>
  17284. </dd>
  17285. <dt>&lsquo;<samp>nakreport=<var>1|0</var></samp>&rsquo;</dt>
  17286. <dd><p>If set to 1, Receiver will send &lsquo;UMSG_LOSSREPORT&lsquo; messages
  17287. periodically until a lost packet is retransmitted or
  17288. intentionally dropped. Default value is 1.
  17289. </p>
  17290. </dd>
  17291. <dt>&lsquo;<samp>oheadbw=<var>percents</var></samp>&rsquo;</dt>
  17292. <dd><p>Recovery bandwidth overhead above input rate, in percents.
  17293. See &lsquo;<samp>inputbw</samp>&rsquo;. Default value is 25%.
  17294. </p>
  17295. </dd>
  17296. <dt>&lsquo;<samp>passphrase=<var>string</var></samp>&rsquo;</dt>
  17297. <dd><p>HaiCrypt Encryption/Decryption Passphrase string, length
  17298. from 10 to 79 characters. The passphrase is the shared
  17299. secret between the sender and the receiver. It is used
  17300. to generate the Key Encrypting Key using PBKDF2
  17301. (Password-Based Key Derivation Function). It is used
  17302. only if &lsquo;<samp>pbkeylen</samp>&rsquo; is non-zero. It is used on
  17303. the receiver only if the received data is encrypted.
  17304. The configured passphrase cannot be recovered (write-only).
  17305. </p>
  17306. </dd>
  17307. <dt>&lsquo;<samp>enforced_encryption=<var>1|0</var></samp>&rsquo;</dt>
  17308. <dd><p>If true, both connection parties must have the same password
  17309. set (including empty, that is, with no encryption). If the
  17310. password doesn&rsquo;t match or only one side is unencrypted,
  17311. the connection is rejected. Default is true.
  17312. </p>
  17313. </dd>
  17314. <dt>&lsquo;<samp>kmrefreshrate=<var>packets</var></samp>&rsquo;</dt>
  17315. <dd><p>The number of packets to be transmitted after which the
  17316. encryption key is switched to a new key. Default is -1.
  17317. -1 means auto (0x1000000 in srt library). The range for
  17318. this option is integers in the 0 - <code>INT_MAX</code>.
  17319. </p>
  17320. </dd>
  17321. <dt>&lsquo;<samp>kmpreannounce=<var>packets</var></samp>&rsquo;</dt>
  17322. <dd><p>The interval between when a new encryption key is sent and
  17323. when switchover occurs. This value also applies to the
  17324. subsequent interval between when switchover occurs and
  17325. when the old encryption key is decommissioned. Default is -1.
  17326. -1 means auto (0x1000 in srt library). The range for
  17327. this option is integers in the 0 - <code>INT_MAX</code>.
  17328. </p>
  17329. </dd>
  17330. <dt>&lsquo;<samp>payload_size=<var>bytes</var></samp>&rsquo;</dt>
  17331. <dd><p>Sets the maximum declared size of a packet transferred
  17332. during the single call to the sending function in Live
  17333. mode. Use 0 if this value isn&rsquo;t used (which is default in
  17334. file mode).
  17335. Default is -1 (automatic), which typically means MPEG-TS;
  17336. if you are going to use SRT
  17337. to send any different kind of payload, such as, for example,
  17338. wrapping a live stream in very small frames, then you can
  17339. use a bigger maximum frame size, though not greater than
  17340. 1456 bytes.
  17341. </p>
  17342. </dd>
  17343. <dt>&lsquo;<samp>pkt_size=<var>bytes</var></samp>&rsquo;</dt>
  17344. <dd><p>Alias for &lsquo;<samp>payload_size</samp>&rsquo;.
  17345. </p>
  17346. </dd>
  17347. <dt>&lsquo;<samp>peerlatency=<var>microseconds</var></samp>&rsquo;</dt>
  17348. <dd><p>The latency value (as described in &lsquo;<samp>rcvlatency</samp>&rsquo;) that is
  17349. set by the sender side as a minimum value for the receiver.
  17350. </p>
  17351. </dd>
  17352. <dt>&lsquo;<samp>pbkeylen=<var>bytes</var></samp>&rsquo;</dt>
  17353. <dd><p>Sender encryption key length, in bytes.
  17354. Only can be set to 0, 16, 24 and 32.
  17355. Enable sender encryption if not 0.
  17356. Not required on receiver (set to 0),
  17357. key size obtained from sender in HaiCrypt handshake.
  17358. Default value is 0.
  17359. </p>
  17360. </dd>
  17361. <dt>&lsquo;<samp>rcvlatency=<var>microseconds</var></samp>&rsquo;</dt>
  17362. <dd><p>The time that should elapse since the moment when the
  17363. packet was sent and the moment when it&rsquo;s delivered to
  17364. the receiver application in the receiving function.
  17365. This time should be a buffer time large enough to cover
  17366. the time spent for sending, unexpectedly extended RTT
  17367. time, and the time needed to retransmit the lost UDP
  17368. packet. The effective latency value will be the maximum
  17369. of this options&rsquo; value and the value of &lsquo;<samp>peerlatency</samp>&rsquo;
  17370. set by the peer side. Before version 1.3.0 this option
  17371. is only available as &lsquo;<samp>latency</samp>&rsquo;.
  17372. </p>
  17373. </dd>
  17374. <dt>&lsquo;<samp>recv_buffer_size=<var>bytes</var></samp>&rsquo;</dt>
  17375. <dd><p>Set UDP receive buffer size, expressed in bytes.
  17376. </p>
  17377. </dd>
  17378. <dt>&lsquo;<samp>send_buffer_size=<var>bytes</var></samp>&rsquo;</dt>
  17379. <dd><p>Set UDP send buffer size, expressed in bytes.
  17380. </p>
  17381. </dd>
  17382. <dt>&lsquo;<samp>timeout=<var>microseconds</var></samp>&rsquo;</dt>
  17383. <dd><p>Set raise error timeouts for read, write and connect operations. Note that the
  17384. SRT library has internal timeouts which can be controlled separately, the
  17385. value set here is only a cap on those.
  17386. </p>
  17387. </dd>
  17388. <dt>&lsquo;<samp>tlpktdrop=<var>1|0</var></samp>&rsquo;</dt>
  17389. <dd><p>Too-late Packet Drop. When enabled on receiver, it skips
  17390. missing packets that have not been delivered in time and
  17391. delivers the following packets to the application when
  17392. their time-to-play has come. It also sends a fake ACK to
  17393. the sender. When enabled on sender and enabled on the
  17394. receiving peer, the sender drops the older packets that
  17395. have no chance of being delivered in time. It was
  17396. automatically enabled in the sender if the receiver
  17397. supports it.
  17398. </p>
  17399. </dd>
  17400. <dt>&lsquo;<samp>sndbuf=<var>bytes</var></samp>&rsquo;</dt>
  17401. <dd><p>Set send buffer size, expressed in bytes.
  17402. </p>
  17403. </dd>
  17404. <dt>&lsquo;<samp>rcvbuf=<var>bytes</var></samp>&rsquo;</dt>
  17405. <dd><p>Set receive buffer size, expressed in bytes.
  17406. </p>
  17407. <p>Receive buffer must not be greater than &lsquo;<samp>ffs</samp>&rsquo;.
  17408. </p>
  17409. </dd>
  17410. <dt>&lsquo;<samp>lossmaxttl=<var>packets</var></samp>&rsquo;</dt>
  17411. <dd><p>The value up to which the Reorder Tolerance may grow. When
  17412. Reorder Tolerance is &gt; 0, then packet loss report is delayed
  17413. until that number of packets come in. Reorder Tolerance
  17414. increases every time a &quot;belated&quot; packet has come, but it
  17415. wasn&rsquo;t due to retransmission (that is, when UDP packets tend
  17416. to come out of order), with the difference between the latest
  17417. sequence and this packet&rsquo;s sequence, and not more than the
  17418. value of this option. By default it&rsquo;s 0, which means that this
  17419. mechanism is turned off, and the loss report is always sent
  17420. immediately upon experiencing a &quot;gap&quot; in sequences.
  17421. </p>
  17422. </dd>
  17423. <dt>&lsquo;<samp>minversion</samp>&rsquo;</dt>
  17424. <dd><p>The minimum SRT version that is required from the peer. A connection
  17425. to a peer that does not satisfy the minimum version requirement
  17426. will be rejected.
  17427. </p>
  17428. <p>The version format in hex is 0xXXYYZZ for x.y.z in human readable
  17429. form.
  17430. </p>
  17431. </dd>
  17432. <dt>&lsquo;<samp>streamid=<var>string</var></samp>&rsquo;</dt>
  17433. <dd><p>A string limited to 512 characters that can be set on the socket prior
  17434. to connecting. This stream ID will be able to be retrieved by the
  17435. listener side from the socket that is returned from srt_accept and
  17436. was connected by a socket with that set stream ID. SRT does not enforce
  17437. any special interpretation of the contents of this string.
  17438. This option doesn’t make sense in Rendezvous connection; the result
  17439. might be that simply one side will override the value from the other
  17440. side and it’s the matter of luck which one would win
  17441. </p>
  17442. </dd>
  17443. <dt>&lsquo;<samp>smoother=<var>live|file</var></samp>&rsquo;</dt>
  17444. <dd><p>The type of Smoother used for the transmission for that socket, which
  17445. is responsible for the transmission and congestion control. The Smoother
  17446. type must be exactly the same on both connecting parties, otherwise
  17447. the connection is rejected.
  17448. </p>
  17449. </dd>
  17450. <dt>&lsquo;<samp>messageapi=<var>1|0</var></samp>&rsquo;</dt>
  17451. <dd><p>When set, this socket uses the Message API, otherwise it uses Buffer
  17452. API. Note that in live mode (see &lsquo;<samp>transtype</samp>&rsquo;) there’s only
  17453. message API available. In File mode you can chose to use one of two modes:
  17454. </p>
  17455. <p>Stream API (default, when this option is false). In this mode you may
  17456. send as many data as you wish with one sending instruction, or even use
  17457. dedicated functions that read directly from a file. The internal facility
  17458. will take care of any speed and congestion control. When receiving, you
  17459. can also receive as many data as desired, the data not extracted will be
  17460. waiting for the next call. There is no boundary between data portions in
  17461. the Stream mode.
  17462. </p>
  17463. <p>Message API. In this mode your single sending instruction passes exactly
  17464. one piece of data that has boundaries (a message). Contrary to Live mode,
  17465. this message may span across multiple UDP packets and the only size
  17466. limitation is that it shall fit as a whole in the sending buffer. The
  17467. receiver shall use as large buffer as necessary to receive the message,
  17468. otherwise the message will not be given up. When the message is not
  17469. complete (not all packets received or there was a packet loss) it will
  17470. not be given up.
  17471. </p>
  17472. </dd>
  17473. <dt>&lsquo;<samp>transtype=<var>live|file</var></samp>&rsquo;</dt>
  17474. <dd><p>Sets the transmission type for the socket, in particular, setting this
  17475. option sets multiple other parameters to their default values as required
  17476. for a particular transmission type.
  17477. </p>
  17478. <p>live: Set options as for live transmission. In this mode, you should
  17479. send by one sending instruction only so many data that fit in one UDP packet,
  17480. and limited to the value defined first in &lsquo;<samp>payload_size</samp>&rsquo; (1316 is
  17481. default in this mode). There is no speed control in this mode, only the
  17482. bandwidth control, if configured, in order to not exceed the bandwidth with
  17483. the overhead transmission (retransmitted and control packets).
  17484. </p>
  17485. <p>file: Set options as for non-live transmission. See &lsquo;<samp>messageapi</samp>&rsquo;
  17486. for further explanations
  17487. </p>
  17488. </dd>
  17489. <dt>&lsquo;<samp>linger=<var>seconds</var></samp>&rsquo;</dt>
  17490. <dd><p>The number of seconds that the socket waits for unsent data when closing.
  17491. Default is -1. -1 means auto (off with 0 seconds in live mode, on with 180
  17492. seconds in file mode). The range for this option is integers in the
  17493. 0 - <code>INT_MAX</code>.
  17494. </p>
  17495. </dd>
  17496. </dl>
  17497. <p>For more information see: <a href="https://github.com/Haivision/srt">https://github.com/Haivision/srt</a>.
  17498. </p>
  17499. <a name="srtp"></a>
  17500. <h2 class="section"><a href="ffmpeg-all.html#toc-srtp">24.33 srtp</a></h2>
  17501. <p>Secure Real-time Transport Protocol.
  17502. </p>
  17503. <p>The accepted options are:
  17504. </p><dl compact="compact">
  17505. <dt>&lsquo;<samp>srtp_in_suite</samp>&rsquo;</dt>
  17506. <dt>&lsquo;<samp>srtp_out_suite</samp>&rsquo;</dt>
  17507. <dd><p>Select input and output encoding suites.
  17508. </p>
  17509. <p>Supported values:
  17510. </p><dl compact="compact">
  17511. <dt>&lsquo;<samp>AES_CM_128_HMAC_SHA1_80</samp>&rsquo;</dt>
  17512. <dt>&lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_80</samp>&rsquo;</dt>
  17513. <dt>&lsquo;<samp>AES_CM_128_HMAC_SHA1_32</samp>&rsquo;</dt>
  17514. <dt>&lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_32</samp>&rsquo;</dt>
  17515. </dl>
  17516. </dd>
  17517. <dt>&lsquo;<samp>srtp_in_params</samp>&rsquo;</dt>
  17518. <dt>&lsquo;<samp>srtp_out_params</samp>&rsquo;</dt>
  17519. <dd><p>Set input and output encoding parameters, which are expressed by a
  17520. base64-encoded representation of a binary block. The first 16 bytes of
  17521. this binary block are used as master key, the following 14 bytes are
  17522. used as master salt.
  17523. </p></dd>
  17524. </dl>
  17525. <a name="subfile"></a>
  17526. <h2 class="section"><a href="ffmpeg-all.html#toc-subfile">24.34 subfile</a></h2>
  17527. <p>Virtually extract a segment of a file or another stream.
  17528. The underlying stream must be seekable.
  17529. </p>
  17530. <p>Accepted options:
  17531. </p><dl compact="compact">
  17532. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  17533. <dd><p>Start offset of the extracted segment, in bytes.
  17534. </p></dd>
  17535. <dt>&lsquo;<samp>end</samp>&rsquo;</dt>
  17536. <dd><p>End offset of the extracted segment, in bytes.
  17537. If set to 0, extract till end of file.
  17538. </p></dd>
  17539. </dl>
  17540. <p>Examples:
  17541. </p>
  17542. <p>Extract a chapter from a DVD VOB file (start and end sectors obtained
  17543. externally and multiplied by 2048):
  17544. </p><div class="example">
  17545. <pre class="example">subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
  17546. </pre></div>
  17547. <p>Play an AVI file directly from a TAR archive:
  17548. </p><div class="example">
  17549. <pre class="example">subfile,,start,183241728,end,366490624,,:archive.tar
  17550. </pre></div>
  17551. <p>Play a MPEG-TS file from start offset till end:
  17552. </p><div class="example">
  17553. <pre class="example">subfile,,start,32815239,end,0,,:video.ts
  17554. </pre></div>
  17555. <a name="tee-1"></a>
  17556. <h2 class="section"><a href="ffmpeg-all.html#toc-tee-1">24.35 tee</a></h2>
  17557. <p>Writes the output to multiple protocols. The individual outputs are separated
  17558. by |
  17559. </p>
  17560. <div class="example">
  17561. <pre class="example">tee:file://path/to/local/this.avi|file://path/to/local/that.avi
  17562. </pre></div>
  17563. <a name="tcp"></a>
  17564. <h2 class="section"><a href="ffmpeg-all.html#toc-tcp">24.36 tcp</a></h2>
  17565. <p>Transmission Control Protocol.
  17566. </p>
  17567. <p>The required syntax for a TCP url is:
  17568. </p><div class="example">
  17569. <pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  17570. </pre></div>
  17571. <p><var>options</var> contains a list of &amp;-separated options of the form
  17572. <var>key</var>=<var>val</var>.
  17573. </p>
  17574. <p>The list of supported options follows.
  17575. </p>
  17576. <dl compact="compact">
  17577. <dt>&lsquo;<samp>listen=<var>1|0</var></samp>&rsquo;</dt>
  17578. <dd><p>Listen for an incoming connection. Default value is 0.
  17579. </p>
  17580. </dd>
  17581. <dt>&lsquo;<samp>timeout=<var>microseconds</var></samp>&rsquo;</dt>
  17582. <dd><p>Set raise error timeout, expressed in microseconds.
  17583. </p>
  17584. <p>This option is only relevant in read mode: if no data arrived in more
  17585. than this time interval, raise error.
  17586. </p>
  17587. </dd>
  17588. <dt>&lsquo;<samp>listen_timeout=<var>milliseconds</var></samp>&rsquo;</dt>
  17589. <dd><p>Set listen timeout, expressed in milliseconds.
  17590. </p>
  17591. </dd>
  17592. <dt>&lsquo;<samp>recv_buffer_size=<var>bytes</var></samp>&rsquo;</dt>
  17593. <dd><p>Set receive buffer size, expressed bytes.
  17594. </p>
  17595. </dd>
  17596. <dt>&lsquo;<samp>send_buffer_size=<var>bytes</var></samp>&rsquo;</dt>
  17597. <dd><p>Set send buffer size, expressed bytes.
  17598. </p>
  17599. </dd>
  17600. <dt>&lsquo;<samp>tcp_nodelay=<var>1|0</var></samp>&rsquo;</dt>
  17601. <dd><p>Set TCP_NODELAY to disable Nagle&rsquo;s algorithm. Default value is 0.
  17602. </p>
  17603. </dd>
  17604. <dt>&lsquo;<samp>tcp_mss=<var>bytes</var></samp>&rsquo;</dt>
  17605. <dd><p>Set maximum segment size for outgoing TCP packets, expressed in bytes.
  17606. </p></dd>
  17607. </dl>
  17608. <p>The following example shows how to setup a listening TCP connection
  17609. with <code>ffmpeg</code>, which is then accessed with <code>ffplay</code>:
  17610. </p><div class="example">
  17611. <pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tcp://<var>hostname</var>:<var>port</var>?listen
  17612. ffplay tcp://<var>hostname</var>:<var>port</var>
  17613. </pre></div>
  17614. <a name="tls"></a>
  17615. <h2 class="section"><a href="ffmpeg-all.html#toc-tls">24.37 tls</a></h2>
  17616. <p>Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
  17617. </p>
  17618. <p>The required syntax for a TLS/SSL url is:
  17619. </p><div class="example">
  17620. <pre class="example">tls://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  17621. </pre></div>
  17622. <p>The following parameters can be set via command line options
  17623. (or in code via <code>AVOption</code>s):
  17624. </p>
  17625. <dl compact="compact">
  17626. <dt>&lsquo;<samp>ca_file, cafile=<var>filename</var></samp>&rsquo;</dt>
  17627. <dd><p>A file containing certificate authority (CA) root certificates to treat
  17628. as trusted. If the linked TLS library contains a default this might not
  17629. need to be specified for verification to work, but not all libraries and
  17630. setups have defaults built in.
  17631. The file must be in OpenSSL PEM format.
  17632. </p>
  17633. </dd>
  17634. <dt>&lsquo;<samp>tls_verify=<var>1|0</var></samp>&rsquo;</dt>
  17635. <dd><p>If enabled, try to verify the peer that we are communicating with.
  17636. Note, if using OpenSSL, this currently only makes sure that the
  17637. peer certificate is signed by one of the root certificates in the CA
  17638. database, but it does not validate that the certificate actually
  17639. matches the host name we are trying to connect to. (With other backends,
  17640. the host name is validated as well.)
  17641. </p>
  17642. <p>This is disabled by default since it requires a CA database to be
  17643. provided by the caller in many cases.
  17644. </p>
  17645. </dd>
  17646. <dt>&lsquo;<samp>cert_file, cert=<var>filename</var></samp>&rsquo;</dt>
  17647. <dd><p>A file containing a certificate to use in the handshake with the peer.
  17648. (When operating as server, in listen mode, this is more often required
  17649. by the peer, while client certificates only are mandated in certain
  17650. setups.)
  17651. </p>
  17652. </dd>
  17653. <dt>&lsquo;<samp>key_file, key=<var>filename</var></samp>&rsquo;</dt>
  17654. <dd><p>A file containing the private key for the certificate.
  17655. </p>
  17656. </dd>
  17657. <dt>&lsquo;<samp>listen=<var>1|0</var></samp>&rsquo;</dt>
  17658. <dd><p>If enabled, listen for connections on the provided port, and assume
  17659. the server role in the handshake instead of the client role.
  17660. </p>
  17661. </dd>
  17662. </dl>
  17663. <p>Example command lines:
  17664. </p>
  17665. <p>To create a TLS/SSL server that serves an input stream.
  17666. </p>
  17667. <div class="example">
  17668. <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>
  17669. </pre></div>
  17670. <p>To play back a stream from the TLS/SSL server using <code>ffplay</code>:
  17671. </p>
  17672. <div class="example">
  17673. <pre class="example">ffplay tls://<var>hostname</var>:<var>port</var>
  17674. </pre></div>
  17675. <a name="udp"></a>
  17676. <h2 class="section"><a href="ffmpeg-all.html#toc-udp">24.38 udp</a></h2>
  17677. <p>User Datagram Protocol.
  17678. </p>
  17679. <p>The required syntax for an UDP URL is:
  17680. </p><div class="example">
  17681. <pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  17682. </pre></div>
  17683. <p><var>options</var> contains a list of &amp;-separated options of the form <var>key</var>=<var>val</var>.
  17684. </p>
  17685. <p>In case threading is enabled on the system, a circular buffer is used
  17686. to store the incoming data, which allows one to reduce loss of data due to
  17687. UDP socket buffer overruns. The <var>fifo_size</var> and
  17688. <var>overrun_nonfatal</var> options are related to this buffer.
  17689. </p>
  17690. <p>The list of supported options follows.
  17691. </p>
  17692. <dl compact="compact">
  17693. <dt>&lsquo;<samp>buffer_size=<var>size</var></samp>&rsquo;</dt>
  17694. <dd><p>Set the UDP maximum socket buffer size in bytes. This is used to set either
  17695. the receive or send buffer size, depending on what the socket is used for.
  17696. Default is 32 KB for output, 384 KB for input. See also <var>fifo_size</var>.
  17697. </p>
  17698. </dd>
  17699. <dt>&lsquo;<samp>bitrate=<var>bitrate</var></samp>&rsquo;</dt>
  17700. <dd><p>If set to nonzero, the output will have the specified constant bitrate if the
  17701. input has enough packets to sustain it.
  17702. </p>
  17703. </dd>
  17704. <dt>&lsquo;<samp>burst_bits=<var>bits</var></samp>&rsquo;</dt>
  17705. <dd><p>When using <var>bitrate</var> this specifies the maximum number of bits in
  17706. packet bursts.
  17707. </p>
  17708. </dd>
  17709. <dt>&lsquo;<samp>localport=<var>port</var></samp>&rsquo;</dt>
  17710. <dd><p>Override the local UDP port to bind with.
  17711. </p>
  17712. </dd>
  17713. <dt>&lsquo;<samp>localaddr=<var>addr</var></samp>&rsquo;</dt>
  17714. <dd><p>Local IP address of a network interface used for sending packets or joining
  17715. multicast groups.
  17716. </p>
  17717. </dd>
  17718. <dt>&lsquo;<samp>pkt_size=<var>size</var></samp>&rsquo;</dt>
  17719. <dd><p>Set the size in bytes of UDP packets.
  17720. </p>
  17721. </dd>
  17722. <dt>&lsquo;<samp>reuse=<var>1|0</var></samp>&rsquo;</dt>
  17723. <dd><p>Explicitly allow or disallow reusing UDP sockets.
  17724. </p>
  17725. </dd>
  17726. <dt>&lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
  17727. <dd><p>Set the time to live value (for multicast only).
  17728. </p>
  17729. </dd>
  17730. <dt>&lsquo;<samp>connect=<var>1|0</var></samp>&rsquo;</dt>
  17731. <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
  17732. destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
  17733. If the destination address isn&rsquo;t known at the start, this option can
  17734. be specified in ff_udp_set_remote_url, too.
  17735. This allows finding out the source address for the packets with getsockname,
  17736. and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
  17737. unreachable&quot; is received.
  17738. For receiving, this gives the benefit of only receiving packets from
  17739. the specified peer address/port.
  17740. </p>
  17741. </dd>
  17742. <dt>&lsquo;<samp>sources=<var>address</var>[,<var>address</var>]</samp>&rsquo;</dt>
  17743. <dd><p>Only receive packets sent from the specified addresses. In case of multicast,
  17744. also subscribe to multicast traffic coming from these addresses only.
  17745. </p>
  17746. </dd>
  17747. <dt>&lsquo;<samp>block=<var>address</var>[,<var>address</var>]</samp>&rsquo;</dt>
  17748. <dd><p>Ignore packets sent from the specified addresses. In case of multicast, also
  17749. exclude the source addresses in the multicast subscription.
  17750. </p>
  17751. </dd>
  17752. <dt>&lsquo;<samp>fifo_size=<var>units</var></samp>&rsquo;</dt>
  17753. <dd><p>Set the UDP receiving circular buffer size, expressed as a number of
  17754. packets with size of 188 bytes. If not specified defaults to 7*4096.
  17755. </p>
  17756. </dd>
  17757. <dt>&lsquo;<samp>overrun_nonfatal=<var>1|0</var></samp>&rsquo;</dt>
  17758. <dd><p>Survive in case of UDP receiving circular buffer overrun. Default
  17759. value is 0.
  17760. </p>
  17761. </dd>
  17762. <dt>&lsquo;<samp>timeout=<var>microseconds</var></samp>&rsquo;</dt>
  17763. <dd><p>Set raise error timeout, expressed in microseconds.
  17764. </p>
  17765. <p>This option is only relevant in read mode: if no data arrived in more
  17766. than this time interval, raise error.
  17767. </p>
  17768. </dd>
  17769. <dt>&lsquo;<samp>broadcast=<var>1|0</var></samp>&rsquo;</dt>
  17770. <dd><p>Explicitly allow or disallow UDP broadcasting.
  17771. </p>
  17772. <p>Note that broadcasting may not work properly on networks having
  17773. a broadcast storm protection.
  17774. </p></dd>
  17775. </dl>
  17776. <a name="Examples-100"></a>
  17777. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-100">24.38.1 Examples</a></h3>
  17778. <ul>
  17779. <li>
  17780. Use <code>ffmpeg</code> to stream over UDP to a remote endpoint:
  17781. <div class="example">
  17782. <pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> udp://<var>hostname</var>:<var>port</var>
  17783. </pre></div>
  17784. </li><li>
  17785. Use <code>ffmpeg</code> to stream in mpegts format over UDP using 188
  17786. sized UDP packets, using a large input buffer:
  17787. <div class="example">
  17788. <pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&amp;buffer_size=65535
  17789. </pre></div>
  17790. </li><li>
  17791. Use <code>ffmpeg</code> to receive over UDP from a remote endpoint:
  17792. <div class="example">
  17793. <pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var> ...
  17794. </pre></div>
  17795. </li></ul>
  17796. <a name="unix"></a>
  17797. <h2 class="section"><a href="ffmpeg-all.html#toc-unix">24.39 unix</a></h2>
  17798. <p>Unix local socket
  17799. </p>
  17800. <p>The required syntax for a Unix socket URL is:
  17801. </p>
  17802. <div class="example">
  17803. <pre class="example">unix://<var>filepath</var>
  17804. </pre></div>
  17805. <p>The following parameters can be set via command line options
  17806. (or in code via <code>AVOption</code>s):
  17807. </p>
  17808. <dl compact="compact">
  17809. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  17810. <dd><p>Timeout in ms.
  17811. </p></dd>
  17812. <dt>&lsquo;<samp>listen</samp>&rsquo;</dt>
  17813. <dd><p>Create the Unix socket in listening mode.
  17814. </p></dd>
  17815. </dl>
  17816. <a name="zmq"></a>
  17817. <h2 class="section"><a href="ffmpeg-all.html#toc-zmq">24.40 zmq</a></h2>
  17818. <p>ZeroMQ asynchronous messaging using the libzmq library.
  17819. </p>
  17820. <p>This library supports unicast streaming to multiple clients without relying on
  17821. an external server.
  17822. </p>
  17823. <p>The required syntax for streaming or connecting to a stream is:
  17824. </p><div class="example">
  17825. <pre class="example">zmq:tcp://ip-address:port
  17826. </pre></div>
  17827. <p>Example:
  17828. Create a localhost stream on port 5555:
  17829. </p><div class="example">
  17830. <pre class="example">ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
  17831. </pre></div>
  17832. <p>Multiple clients may connect to the stream using:
  17833. </p><div class="example">
  17834. <pre class="example">ffplay zmq:tcp://127.0.0.1:5555
  17835. </pre></div>
  17836. <p>Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub pattern.
  17837. The server side binds to a port and publishes data. Clients connect to the
  17838. server (via IP address/port) and subscribe to the stream. The order in which
  17839. the server and client start generally does not matter.
  17840. </p>
  17841. <p>ffmpeg must be compiled with the &ndash;enable-libzmq option to support
  17842. this protocol.
  17843. </p>
  17844. <p>Options can be set on the <code>ffmpeg</code>/<code>ffplay</code> command
  17845. line. The following options are supported:
  17846. </p>
  17847. <dl compact="compact">
  17848. <dt>&lsquo;<samp>pkt_size</samp>&rsquo;</dt>
  17849. <dd><p>Forces the maximum packet size for sending/receiving data. The default value is
  17850. 131,072 bytes. On the server side, this sets the maximum size of sent packets
  17851. via ZeroMQ. On the clients, it sets an internal buffer size for receiving
  17852. packets. Note that pkt_size on the clients should be equal to or greater than
  17853. pkt_size on the server. Otherwise the received message may be truncated causing
  17854. decoding errors.
  17855. </p>
  17856. </dd>
  17857. </dl>
  17858. <a name="Device-Options"></a>
  17859. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Device-Options">25 Device Options</a></h1>
  17860. <p>The libavdevice library provides the same interface as
  17861. libavformat. Namely, an input device is considered like a demuxer, and
  17862. an output device like a muxer, and the interface and generic device
  17863. options are the same provided by libavformat (see the ffmpeg-formats
  17864. manual).
  17865. </p>
  17866. <p>In addition each input or output device may support so-called private
  17867. options, which are specific for that component.
  17868. </p>
  17869. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  17870. FFmpeg tools, or by setting the value explicitly in the device
  17871. <code>AVFormatContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
  17872. for programmatic use.
  17873. </p>
  17874. <a name="Input-Devices"></a>
  17875. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Input-Devices">26 Input Devices</a></h1>
  17876. <p>Input devices are configured elements in FFmpeg which enable accessing
  17877. the data coming from a multimedia device attached to your system.
  17878. </p>
  17879. <p>When you configure your FFmpeg build, all the supported input devices
  17880. are enabled by default. You can list all available ones using the
  17881. configure option &quot;&ndash;list-indevs&quot;.
  17882. </p>
  17883. <p>You can disable all the input devices using the configure option
  17884. &quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
  17885. option &quot;&ndash;enable-indev=<var>INDEV</var>&quot;, or you can disable a particular
  17886. input device using the option &quot;&ndash;disable-indev=<var>INDEV</var>&quot;.
  17887. </p>
  17888. <p>The option &quot;-devices&quot; of the ff* tools will display the list of
  17889. supported input devices.
  17890. </p>
  17891. <p>A description of the currently available input devices follows.
  17892. </p>
  17893. <a name="alsa-1"></a>
  17894. <h2 class="section"><a href="ffmpeg-all.html#toc-alsa-1">26.1 alsa</a></h2>
  17895. <p>ALSA (Advanced Linux Sound Architecture) input device.
  17896. </p>
  17897. <p>To enable this input device during configuration you need libasound
  17898. installed on your system.
  17899. </p>
  17900. <p>This device allows capturing from an ALSA device. The name of the
  17901. device to capture has to be an ALSA card identifier.
  17902. </p>
  17903. <p>An ALSA identifier has the syntax:
  17904. </p><div class="example">
  17905. <pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
  17906. </pre></div>
  17907. <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
  17908. </p>
  17909. <p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
  17910. specify card number or identifier, device number and subdevice number
  17911. (-1 means any).
  17912. </p>
  17913. <p>To see the list of cards currently recognized by your system check the
  17914. files &lsquo;<tt>/proc/asound/cards</tt>&rsquo; and &lsquo;<tt>/proc/asound/devices</tt>&rsquo;.
  17915. </p>
  17916. <p>For example to capture with <code>ffmpeg</code> from an ALSA device with
  17917. card id 0, you may run the command:
  17918. </p><div class="example">
  17919. <pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
  17920. </pre></div>
  17921. <p>For more information see:
  17922. <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>
  17923. </p>
  17924. <a name="Options-34"></a>
  17925. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-34">26.1.1 Options</a></h3>
  17926. <dl compact="compact">
  17927. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  17928. <dd><p>Set the sample rate in Hz. Default is 48000.
  17929. </p>
  17930. </dd>
  17931. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  17932. <dd><p>Set the number of channels. Default is 2.
  17933. </p>
  17934. </dd>
  17935. </dl>
  17936. <a name="android_005fcamera"></a>
  17937. <h2 class="section"><a href="ffmpeg-all.html#toc-android_005fcamera">26.2 android_camera</a></h2>
  17938. <p>Android camera input device.
  17939. </p>
  17940. <p>This input devices uses the Android Camera2 NDK API which is
  17941. available on devices with API level 24+. The availability of
  17942. android_camera is autodetected during configuration.
  17943. </p>
  17944. <p>This device allows capturing from all cameras on an Android device,
  17945. which are integrated into the Camera2 NDK API.
  17946. </p>
  17947. <p>The available cameras are enumerated internally and can be selected
  17948. with the <var>camera_index</var> parameter. The input file string is
  17949. discarded.
  17950. </p>
  17951. <p>Generally the back facing camera has index 0 while the front facing
  17952. camera has index 1.
  17953. </p>
  17954. <a name="Options-28"></a>
  17955. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-28">26.2.1 Options</a></h3>
  17956. <dl compact="compact">
  17957. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  17958. <dd><p>Set the video size given as a string such as 640x480 or hd720.
  17959. Falls back to the first available configuration reported by
  17960. Android if requested video size is not available or by default.
  17961. </p>
  17962. </dd>
  17963. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  17964. <dd><p>Set the video framerate.
  17965. Falls back to the first available configuration reported by
  17966. Android if requested framerate is not available or by default (-1).
  17967. </p>
  17968. </dd>
  17969. <dt>&lsquo;<samp>camera_index</samp>&rsquo;</dt>
  17970. <dd><p>Set the index of the camera to use. Default is 0.
  17971. </p>
  17972. </dd>
  17973. <dt>&lsquo;<samp>input_queue_size</samp>&rsquo;</dt>
  17974. <dd><p>Set the maximum number of frames to buffer. Default is 5.
  17975. </p>
  17976. </dd>
  17977. </dl>
  17978. <a name="avfoundation"></a>
  17979. <h2 class="section"><a href="ffmpeg-all.html#toc-avfoundation">26.3 avfoundation</a></h2>
  17980. <p>AVFoundation input device.
  17981. </p>
  17982. <p>AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX &gt;= 10.7 as well as on iOS.
  17983. </p>
  17984. <p>The input filename has to be given in the following syntax:
  17985. </p><div class="example">
  17986. <pre class="example">-i &quot;[[VIDEO]:[AUDIO]]&quot;
  17987. </pre></div>
  17988. <p>The first entry selects the video input while the latter selects the audio input.
  17989. The stream has to be specified by the device name or the device index as shown by the device list.
  17990. Alternatively, the video and/or audio input device can be chosen by index using the
  17991. &lsquo;<samp>
  17992. -video_device_index &lt;INDEX&gt;
  17993. </samp>&rsquo;
  17994. and/or
  17995. &lsquo;<samp>
  17996. -audio_device_index &lt;INDEX&gt;
  17997. </samp>&rsquo;
  17998. , overriding any
  17999. device name or index given in the input filename.
  18000. </p>
  18001. <p>All available devices can be enumerated by using &lsquo;<samp>-list_devices true</samp>&rsquo;, listing
  18002. all device names and corresponding indices.
  18003. </p>
  18004. <p>There are two device name aliases:
  18005. </p><dl compact="compact">
  18006. <dt><code>default</code></dt>
  18007. <dd><p>Select the AVFoundation default device of the corresponding type.
  18008. </p>
  18009. </dd>
  18010. <dt><code>none</code></dt>
  18011. <dd><p>Do not record the corresponding media type.
  18012. This is equivalent to specifying an empty device name or index.
  18013. </p>
  18014. </dd>
  18015. </dl>
  18016. <a name="Options-27"></a>
  18017. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-27">26.3.1 Options</a></h3>
  18018. <p>AVFoundation supports the following options:
  18019. </p>
  18020. <dl compact="compact">
  18021. <dt>&lsquo;<samp>-list_devices &lt;TRUE|FALSE&gt;</samp>&rsquo;</dt>
  18022. <dd><p>If set to true, a list of all available input devices is given showing all
  18023. device names and indices.
  18024. </p>
  18025. </dd>
  18026. <dt>&lsquo;<samp>-video_device_index &lt;INDEX&gt;</samp>&rsquo;</dt>
  18027. <dd><p>Specify the video device by its index. Overrides anything given in the input filename.
  18028. </p>
  18029. </dd>
  18030. <dt>&lsquo;<samp>-audio_device_index &lt;INDEX&gt;</samp>&rsquo;</dt>
  18031. <dd><p>Specify the audio device by its index. Overrides anything given in the input filename.
  18032. </p>
  18033. </dd>
  18034. <dt>&lsquo;<samp>-pixel_format &lt;FORMAT&gt;</samp>&rsquo;</dt>
  18035. <dd><p>Request the video device to use a specific pixel format.
  18036. If the specified format is not supported, a list of available formats is given
  18037. and the first one in this list is used instead. Available pixel formats are:
  18038. <code>monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
  18039. bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
  18040. yuv420p, nv12, yuyv422, gray</code>
  18041. </p>
  18042. </dd>
  18043. <dt>&lsquo;<samp>-framerate</samp>&rsquo;</dt>
  18044. <dd><p>Set the grabbing frame rate. Default is <code>ntsc</code>, corresponding to a
  18045. frame rate of <code>30000/1001</code>.
  18046. </p>
  18047. </dd>
  18048. <dt>&lsquo;<samp>-video_size</samp>&rsquo;</dt>
  18049. <dd><p>Set the video frame size.
  18050. </p>
  18051. </dd>
  18052. <dt>&lsquo;<samp>-capture_cursor</samp>&rsquo;</dt>
  18053. <dd><p>Capture the mouse pointer. Default is 0.
  18054. </p>
  18055. </dd>
  18056. <dt>&lsquo;<samp>-capture_mouse_clicks</samp>&rsquo;</dt>
  18057. <dd><p>Capture the screen mouse clicks. Default is 0.
  18058. </p>
  18059. </dd>
  18060. <dt>&lsquo;<samp>-capture_raw_data</samp>&rsquo;</dt>
  18061. <dd><p>Capture the raw device data. Default is 0.
  18062. 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.
  18063. </p></dd>
  18064. </dl>
  18065. <a name="Examples-180"></a>
  18066. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-180">26.3.2 Examples</a></h3>
  18067. <ul>
  18068. <li>
  18069. Print the list of AVFoundation supported devices and exit:
  18070. <div class="example">
  18071. <pre class="example">$ ffmpeg -f avfoundation -list_devices true -i &quot;&quot;
  18072. </pre></div>
  18073. </li><li>
  18074. Record video from video device 0 and audio from audio device 0 into out.avi:
  18075. <div class="example">
  18076. <pre class="example">$ ffmpeg -f avfoundation -i &quot;0:0&quot; out.avi
  18077. </pre></div>
  18078. </li><li>
  18079. Record video from video device 2 and audio from audio device 1 into out.avi:
  18080. <div class="example">
  18081. <pre class="example">$ ffmpeg -f avfoundation -video_device_index 2 -i &quot;:1&quot; out.avi
  18082. </pre></div>
  18083. </li><li>
  18084. Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi:
  18085. <div class="example">
  18086. <pre class="example">$ ffmpeg -f avfoundation -pixel_format bgr0 -i &quot;default:none&quot; out.avi
  18087. </pre></div>
  18088. </li><li>
  18089. Record raw DV data from a suitable input device and write the output into out.dv:
  18090. <div class="example">
  18091. <pre class="example">$ ffmpeg -f avfoundation -capture_raw_data true -i &quot;zr100:none&quot; out.dv
  18092. </pre></div>
  18093. </li></ul>
  18094. <a name="bktr"></a>
  18095. <h2 class="section"><a href="ffmpeg-all.html#toc-bktr">26.4 bktr</a></h2>
  18096. <p>BSD video input device.
  18097. </p>
  18098. <a name="Options-13"></a>
  18099. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-13">26.4.1 Options</a></h3>
  18100. <dl compact="compact">
  18101. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  18102. <dd><p>Set the frame rate.
  18103. </p>
  18104. </dd>
  18105. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  18106. <dd><p>Set the video frame size. Default is <code>vga</code>.
  18107. </p>
  18108. </dd>
  18109. <dt>&lsquo;<samp>standard</samp>&rsquo;</dt>
  18110. <dd>
  18111. <p>Available values are:
  18112. </p><dl compact="compact">
  18113. <dt>&lsquo;<samp>pal</samp>&rsquo;</dt>
  18114. <dt>&lsquo;<samp>ntsc</samp>&rsquo;</dt>
  18115. <dt>&lsquo;<samp>secam</samp>&rsquo;</dt>
  18116. <dt>&lsquo;<samp>paln</samp>&rsquo;</dt>
  18117. <dt>&lsquo;<samp>palm</samp>&rsquo;</dt>
  18118. <dt>&lsquo;<samp>ntscj</samp>&rsquo;</dt>
  18119. </dl>
  18120. </dd>
  18121. </dl>
  18122. <a name="decklink"></a>
  18123. <h2 class="section"><a href="ffmpeg-all.html#toc-decklink">26.5 decklink</a></h2>
  18124. <p>The decklink input device provides capture capabilities for Blackmagic
  18125. DeckLink devices.
  18126. </p>
  18127. <p>To enable this input device, you need the Blackmagic DeckLink SDK and you
  18128. need to configure with the appropriate <code>--extra-cflags</code>
  18129. and <code>--extra-ldflags</code>.
  18130. On Windows, you need to run the IDL files through <code>widl</code>.
  18131. </p>
  18132. <p>DeckLink is very picky about the formats it supports. Pixel format of the
  18133. input can be set with &lsquo;<samp>raw_format</samp>&rsquo;.
  18134. Framerate and video size must be determined for your device with
  18135. <code>-list_formats 1</code>. Audio sample rate is always 48 kHz and the number
  18136. of channels can be 2, 8 or 16. Note that all audio channels are bundled in one single
  18137. audio track.
  18138. </p>
  18139. <a name="Options-77"></a>
  18140. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-77">26.5.1 Options</a></h3>
  18141. <dl compact="compact">
  18142. <dt>&lsquo;<samp>list_devices</samp>&rsquo;</dt>
  18143. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of devices and exit.
  18144. Defaults to &lsquo;<samp>false</samp>&rsquo;. This option is deprecated, please use the
  18145. <code>-sources</code> option of ffmpeg to list the available input devices.
  18146. </p>
  18147. </dd>
  18148. <dt>&lsquo;<samp>list_formats</samp>&rsquo;</dt>
  18149. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of supported formats and exit.
  18150. Defaults to &lsquo;<samp>false</samp>&rsquo;.
  18151. </p>
  18152. </dd>
  18153. <dt>&lsquo;<samp>format_code &lt;FourCC&gt;</samp>&rsquo;</dt>
  18154. <dd><p>This sets the input video format to the format given by the FourCC. To see
  18155. the supported values of your device(s) use &lsquo;<samp>list_formats</samp>&rsquo;.
  18156. Note that there is a FourCC &lsquo;<samp>'pal '</samp>&rsquo; that can also be used
  18157. as &lsquo;<samp>pal</samp>&rsquo; (3 letters).
  18158. Default behavior is autodetection of the input video format, if the hardware
  18159. supports it.
  18160. </p>
  18161. </dd>
  18162. <dt>&lsquo;<samp>raw_format</samp>&rsquo;</dt>
  18163. <dd><p>Set the pixel format of the captured video.
  18164. Available values are:
  18165. </p><dl compact="compact">
  18166. <dt>&lsquo;<samp>uyvy422</samp>&rsquo;</dt>
  18167. <dt>&lsquo;<samp>yuv422p10</samp>&rsquo;</dt>
  18168. <dt>&lsquo;<samp>argb</samp>&rsquo;</dt>
  18169. <dt>&lsquo;<samp>bgra</samp>&rsquo;</dt>
  18170. <dt>&lsquo;<samp>rgb10</samp>&rsquo;</dt>
  18171. </dl>
  18172. </dd>
  18173. <dt>&lsquo;<samp>teletext_lines</samp>&rsquo;</dt>
  18174. <dd><p>If set to nonzero, an additional teletext stream will be captured from the
  18175. vertical ancillary data. Both SD PAL (576i) and HD (1080i or 1080p)
  18176. sources are supported. In case of HD sources, OP47 packets are decoded.
  18177. </p>
  18178. <p>This option is a bitmask of the SD PAL VBI lines captured, specifically lines 6
  18179. to 22, and lines 318 to 335. Line 6 is the LSB in the mask. Selected lines
  18180. which do not contain teletext information will be ignored. You can use the
  18181. special &lsquo;<samp>all</samp>&rsquo; constant to select all possible lines, or
  18182. &lsquo;<samp>standard</samp>&rsquo; to skip lines 6, 318 and 319, which are not compatible with
  18183. all receivers.
  18184. </p>
  18185. <p>For SD sources, ffmpeg needs to be compiled with <code>--enable-libzvbi</code>. For
  18186. HD sources, on older (pre-4K) DeckLink card models you have to capture in 10
  18187. bit mode.
  18188. </p>
  18189. </dd>
  18190. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  18191. <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;.
  18192. Defaults to &lsquo;<samp>2</samp>&rsquo;.
  18193. </p>
  18194. </dd>
  18195. <dt>&lsquo;<samp>duplex_mode</samp>&rsquo;</dt>
  18196. <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;.
  18197. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  18198. </p>
  18199. </dd>
  18200. <dt>&lsquo;<samp>timecode_format</samp>&rsquo;</dt>
  18201. <dd><p>Timecode type to include in the frame and video stream metadata. Must be
  18202. &lsquo;<samp>none</samp>&rsquo;, &lsquo;<samp>rp188vitc</samp>&rsquo;, &lsquo;<samp>rp188vitc2</samp>&rsquo;, &lsquo;<samp>rp188ltc</samp>&rsquo;,
  18203. &lsquo;<samp>rp188any</samp>&rsquo;, &lsquo;<samp>vitc</samp>&rsquo;, &lsquo;<samp>vitc2</samp>&rsquo;, or &lsquo;<samp>serial</samp>&rsquo;. Defaults to
  18204. &lsquo;<samp>none</samp>&rsquo; (not included).
  18205. </p>
  18206. </dd>
  18207. <dt>&lsquo;<samp>video_input</samp>&rsquo;</dt>
  18208. <dd><p>Sets the video input source. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>sdi</samp>&rsquo;, &lsquo;<samp>hdmi</samp>&rsquo;,
  18209. &lsquo;<samp>optical_sdi</samp>&rsquo;, &lsquo;<samp>component</samp>&rsquo;, &lsquo;<samp>composite</samp>&rsquo; or &lsquo;<samp>s_video</samp>&rsquo;.
  18210. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  18211. </p>
  18212. </dd>
  18213. <dt>&lsquo;<samp>audio_input</samp>&rsquo;</dt>
  18214. <dd><p>Sets the audio input source. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>embedded</samp>&rsquo;,
  18215. &lsquo;<samp>aes_ebu</samp>&rsquo;, &lsquo;<samp>analog</samp>&rsquo;, &lsquo;<samp>analog_xlr</samp>&rsquo;, &lsquo;<samp>analog_rca</samp>&rsquo; or
  18216. &lsquo;<samp>microphone</samp>&rsquo;. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  18217. </p>
  18218. </dd>
  18219. <dt>&lsquo;<samp>video_pts</samp>&rsquo;</dt>
  18220. <dd><p>Sets the video packet timestamp source. Must be &lsquo;<samp>video</samp>&rsquo;, &lsquo;<samp>audio</samp>&rsquo;,
  18221. &lsquo;<samp>reference</samp>&rsquo;, &lsquo;<samp>wallclock</samp>&rsquo; or &lsquo;<samp>abs_wallclock</samp>&rsquo;.
  18222. Defaults to &lsquo;<samp>video</samp>&rsquo;.
  18223. </p>
  18224. </dd>
  18225. <dt>&lsquo;<samp>audio_pts</samp>&rsquo;</dt>
  18226. <dd><p>Sets the audio packet timestamp source. Must be &lsquo;<samp>video</samp>&rsquo;, &lsquo;<samp>audio</samp>&rsquo;,
  18227. &lsquo;<samp>reference</samp>&rsquo;, &lsquo;<samp>wallclock</samp>&rsquo; or &lsquo;<samp>abs_wallclock</samp>&rsquo;.
  18228. Defaults to &lsquo;<samp>audio</samp>&rsquo;.
  18229. </p>
  18230. </dd>
  18231. <dt>&lsquo;<samp>draw_bars</samp>&rsquo;</dt>
  18232. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, color bars are drawn in the event of a signal loss.
  18233. Defaults to &lsquo;<samp>true</samp>&rsquo;.
  18234. </p>
  18235. </dd>
  18236. <dt>&lsquo;<samp>queue_size</samp>&rsquo;</dt>
  18237. <dd><p>Sets maximum input buffer size in bytes. If the buffering reaches this value,
  18238. incoming frames will be dropped.
  18239. Defaults to &lsquo;<samp>1073741824</samp>&rsquo;.
  18240. </p>
  18241. </dd>
  18242. <dt>&lsquo;<samp>audio_depth</samp>&rsquo;</dt>
  18243. <dd><p>Sets the audio sample bit depth. Must be &lsquo;<samp>16</samp>&rsquo; or &lsquo;<samp>32</samp>&rsquo;.
  18244. Defaults to &lsquo;<samp>16</samp>&rsquo;.
  18245. </p>
  18246. </dd>
  18247. <dt>&lsquo;<samp>decklink_copyts</samp>&rsquo;</dt>
  18248. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, timestamps are forwarded as they are without removing
  18249. the initial offset.
  18250. Defaults to &lsquo;<samp>false</samp>&rsquo;.
  18251. </p>
  18252. </dd>
  18253. <dt>&lsquo;<samp>timestamp_align</samp>&rsquo;</dt>
  18254. <dd><p>Capture start time alignment in seconds. If set to nonzero, input frames are
  18255. dropped till the system timestamp aligns with configured value.
  18256. Alignment difference of up to one frame duration is tolerated.
  18257. This is useful for maintaining input synchronization across N different
  18258. hardware devices deployed for &rsquo;N-way&rsquo; redundancy. The system time of different
  18259. hardware devices should be synchronized with protocols such as NTP or PTP,
  18260. before using this option.
  18261. Note that this method is not foolproof. In some border cases input
  18262. synchronization may not happen due to thread scheduling jitters in the OS.
  18263. Either sync could go wrong by 1 frame or in a rarer case
  18264. &lsquo;<samp>timestamp_align</samp>&rsquo; seconds.
  18265. Defaults to &lsquo;<samp>0</samp>&rsquo;.
  18266. </p>
  18267. </dd>
  18268. <dt>&lsquo;<samp>wait_for_tc (<em>bool</em>)</samp>&rsquo;</dt>
  18269. <dd><p>Drop frames till a frame with timecode is received. Sometimes serial timecode
  18270. isn&rsquo;t received with the first input frame. If that happens, the stored stream
  18271. timecode will be inaccurate. If this option is set to &lsquo;<samp>true</samp>&rsquo;, input frames
  18272. are dropped till a frame with timecode is received.
  18273. Option <var>timecode_format</var> must be specified.
  18274. Defaults to &lsquo;<samp>false</samp>&rsquo;.
  18275. </p>
  18276. </dd>
  18277. </dl>
  18278. <a name="Examples-62"></a>
  18279. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-62">26.5.2 Examples</a></h3>
  18280. <ul>
  18281. <li>
  18282. List input devices:
  18283. <div class="example">
  18284. <pre class="example">ffmpeg -sources decklink
  18285. </pre></div>
  18286. </li><li>
  18287. List supported formats:
  18288. <div class="example">
  18289. <pre class="example">ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
  18290. </pre></div>
  18291. </li><li>
  18292. Capture video clip at 1080i50:
  18293. <div class="example">
  18294. <pre class="example">ffmpeg -format_code Hi50 -f decklink -i 'Intensity Pro' -c:a copy -c:v copy output.avi
  18295. </pre></div>
  18296. </li><li>
  18297. Capture video clip at 1080i50 10 bit:
  18298. <div class="example">
  18299. <pre class="example">ffmpeg -raw_format yuv422p10 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
  18300. </pre></div>
  18301. </li><li>
  18302. Capture video clip at 1080i50 with 16 audio channels:
  18303. <div class="example">
  18304. <pre class="example">ffmpeg -channels 16 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
  18305. </pre></div>
  18306. </li></ul>
  18307. <a name="dshow"></a>
  18308. <h2 class="section"><a href="ffmpeg-all.html#toc-dshow">26.6 dshow</a></h2>
  18309. <p>Windows DirectShow input device.
  18310. </p>
  18311. <p>DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
  18312. Currently only audio and video devices are supported.
  18313. </p>
  18314. <p>Multiple devices may be opened as separate inputs, but they may also be
  18315. opened on the same input, which should improve synchronism between them.
  18316. </p>
  18317. <p>The input name should be in the format:
  18318. </p>
  18319. <div class="example">
  18320. <pre class="example"><var>TYPE</var>=<var>NAME</var>[:<var>TYPE</var>=<var>NAME</var>]
  18321. </pre></div>
  18322. <p>where <var>TYPE</var> can be either <var>audio</var> or <var>video</var>,
  18323. and <var>NAME</var> is the device&rsquo;s name or alternative name..
  18324. </p>
  18325. <a name="Options-84"></a>
  18326. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-84">26.6.1 Options</a></h3>
  18327. <p>If no options are specified, the device&rsquo;s defaults are used.
  18328. If the device does not support the requested options, it will
  18329. fail to open.
  18330. </p>
  18331. <dl compact="compact">
  18332. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  18333. <dd><p>Set the video size in the captured video.
  18334. </p>
  18335. </dd>
  18336. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  18337. <dd><p>Set the frame rate in the captured video.
  18338. </p>
  18339. </dd>
  18340. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  18341. <dd><p>Set the sample rate (in Hz) of the captured audio.
  18342. </p>
  18343. </dd>
  18344. <dt>&lsquo;<samp>sample_size</samp>&rsquo;</dt>
  18345. <dd><p>Set the sample size (in bits) of the captured audio.
  18346. </p>
  18347. </dd>
  18348. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  18349. <dd><p>Set the number of channels in the captured audio.
  18350. </p>
  18351. </dd>
  18352. <dt>&lsquo;<samp>list_devices</samp>&rsquo;</dt>
  18353. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of devices and exit.
  18354. </p>
  18355. </dd>
  18356. <dt>&lsquo;<samp>list_options</samp>&rsquo;</dt>
  18357. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of selected device&rsquo;s options
  18358. and exit.
  18359. </p>
  18360. </dd>
  18361. <dt>&lsquo;<samp>video_device_number</samp>&rsquo;</dt>
  18362. <dd><p>Set video device number for devices with the same name (starts at 0,
  18363. defaults to 0).
  18364. </p>
  18365. </dd>
  18366. <dt>&lsquo;<samp>audio_device_number</samp>&rsquo;</dt>
  18367. <dd><p>Set audio device number for devices with the same name (starts at 0,
  18368. defaults to 0).
  18369. </p>
  18370. </dd>
  18371. <dt>&lsquo;<samp>pixel_format</samp>&rsquo;</dt>
  18372. <dd><p>Select pixel format to be used by DirectShow. This may only be set when
  18373. the video codec is not set or set to rawvideo.
  18374. </p>
  18375. </dd>
  18376. <dt>&lsquo;<samp>audio_buffer_size</samp>&rsquo;</dt>
  18377. <dd><p>Set audio device buffer size in milliseconds (which can directly
  18378. impact latency, depending on the device).
  18379. Defaults to using the audio device&rsquo;s
  18380. default buffer size (typically some multiple of 500ms).
  18381. Setting this value too low can degrade performance.
  18382. See also
  18383. <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>
  18384. </p>
  18385. </dd>
  18386. <dt>&lsquo;<samp>video_pin_name</samp>&rsquo;</dt>
  18387. <dd><p>Select video capture pin to use by name or alternative name.
  18388. </p>
  18389. </dd>
  18390. <dt>&lsquo;<samp>audio_pin_name</samp>&rsquo;</dt>
  18391. <dd><p>Select audio capture pin to use by name or alternative name.
  18392. </p>
  18393. </dd>
  18394. <dt>&lsquo;<samp>crossbar_video_input_pin_number</samp>&rsquo;</dt>
  18395. <dd><p>Select video input pin number for crossbar device. This will be
  18396. routed to the crossbar device&rsquo;s Video Decoder output pin.
  18397. Note that changing this value can affect future invocations
  18398. (sets a new default) until system reboot occurs.
  18399. </p>
  18400. </dd>
  18401. <dt>&lsquo;<samp>crossbar_audio_input_pin_number</samp>&rsquo;</dt>
  18402. <dd><p>Select audio input pin number for crossbar device. This will be
  18403. routed to the crossbar device&rsquo;s Audio Decoder output pin.
  18404. Note that changing this value can affect future invocations
  18405. (sets a new default) until system reboot occurs.
  18406. </p>
  18407. </dd>
  18408. <dt>&lsquo;<samp>show_video_device_dialog</samp>&rsquo;</dt>
  18409. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, before capture starts, popup a display dialog
  18410. to the end user, allowing them to change video filter properties
  18411. and configurations manually.
  18412. Note that for crossbar devices, adjusting values in this dialog
  18413. may be needed at times to toggle between PAL (25 fps) and NTSC (29.97)
  18414. input frame rates, sizes, interlacing, etc. Changing these values can
  18415. enable different scan rates/frame rates and avoiding green bars at
  18416. the bottom, flickering scan lines, etc.
  18417. Note that with some devices, changing these properties can also affect future
  18418. invocations (sets new defaults) until system reboot occurs.
  18419. </p>
  18420. </dd>
  18421. <dt>&lsquo;<samp>show_audio_device_dialog</samp>&rsquo;</dt>
  18422. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, before capture starts, popup a display dialog
  18423. to the end user, allowing them to change audio filter properties
  18424. and configurations manually.
  18425. </p>
  18426. </dd>
  18427. <dt>&lsquo;<samp>show_video_crossbar_connection_dialog</samp>&rsquo;</dt>
  18428. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, before capture starts, popup a display
  18429. dialog to the end user, allowing them to manually
  18430. modify crossbar pin routings, when it opens a video device.
  18431. </p>
  18432. </dd>
  18433. <dt>&lsquo;<samp>show_audio_crossbar_connection_dialog</samp>&rsquo;</dt>
  18434. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, before capture starts, popup a display
  18435. dialog to the end user, allowing them to manually
  18436. modify crossbar pin routings, when it opens an audio device.
  18437. </p>
  18438. </dd>
  18439. <dt>&lsquo;<samp>show_analog_tv_tuner_dialog</samp>&rsquo;</dt>
  18440. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, before capture starts, popup a display
  18441. dialog to the end user, allowing them to manually
  18442. modify TV channels and frequencies.
  18443. </p>
  18444. </dd>
  18445. <dt>&lsquo;<samp>show_analog_tv_tuner_audio_dialog</samp>&rsquo;</dt>
  18446. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, before capture starts, popup a display
  18447. dialog to the end user, allowing them to manually
  18448. modify TV audio (like mono vs. stereo, Language A,B or C).
  18449. </p>
  18450. </dd>
  18451. <dt>&lsquo;<samp>audio_device_load</samp>&rsquo;</dt>
  18452. <dd><p>Load an audio capture filter device from file instead of searching
  18453. it by name. It may load additional parameters too, if the filter
  18454. supports the serialization of its properties to.
  18455. To use this an audio capture source has to be specified, but it can
  18456. be anything even fake one.
  18457. </p>
  18458. </dd>
  18459. <dt>&lsquo;<samp>audio_device_save</samp>&rsquo;</dt>
  18460. <dd><p>Save the currently used audio capture filter device and its
  18461. parameters (if the filter supports it) to a file.
  18462. If a file with the same name exists it will be overwritten.
  18463. </p>
  18464. </dd>
  18465. <dt>&lsquo;<samp>video_device_load</samp>&rsquo;</dt>
  18466. <dd><p>Load a video capture filter device from file instead of searching
  18467. it by name. It may load additional parameters too, if the filter
  18468. supports the serialization of its properties to.
  18469. To use this a video capture source has to be specified, but it can
  18470. be anything even fake one.
  18471. </p>
  18472. </dd>
  18473. <dt>&lsquo;<samp>video_device_save</samp>&rsquo;</dt>
  18474. <dd><p>Save the currently used video capture filter device and its
  18475. parameters (if the filter supports it) to a file.
  18476. If a file with the same name exists it will be overwritten.
  18477. </p>
  18478. </dd>
  18479. </dl>
  18480. <a name="Examples-51"></a>
  18481. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-51">26.6.2 Examples</a></h3>
  18482. <ul>
  18483. <li>
  18484. Print the list of DirectShow supported devices and exit:
  18485. <div class="example">
  18486. <pre class="example">$ ffmpeg -list_devices true -f dshow -i dummy
  18487. </pre></div>
  18488. </li><li>
  18489. Open video device <var>Camera</var>:
  18490. <div class="example">
  18491. <pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;
  18492. </pre></div>
  18493. </li><li>
  18494. Open second video device with name <var>Camera</var>:
  18495. <div class="example">
  18496. <pre class="example">$ ffmpeg -f dshow -video_device_number 1 -i video=&quot;Camera&quot;
  18497. </pre></div>
  18498. </li><li>
  18499. Open video device <var>Camera</var> and audio device <var>Microphone</var>:
  18500. <div class="example">
  18501. <pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;:audio=&quot;Microphone&quot;
  18502. </pre></div>
  18503. </li><li>
  18504. Print the list of supported options in selected device and exit:
  18505. <div class="example">
  18506. <pre class="example">$ ffmpeg -list_options true -f dshow -i video=&quot;Camera&quot;
  18507. </pre></div>
  18508. </li><li>
  18509. Specify pin names to capture by name or alternative name, specify alternative device name:
  18510. <div class="example">
  18511. <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;
  18512. </pre></div>
  18513. </li><li>
  18514. Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup:
  18515. <div class="example">
  18516. <pre class="example">$ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
  18517. -crossbar_audio_input_pin_number 3 -i video=&quot;AVerMedia BDA Analog Capture&quot;:audio=&quot;AVerMedia BDA Analog Capture&quot;
  18518. </pre></div>
  18519. </li></ul>
  18520. <a name="fbdev"></a>
  18521. <h2 class="section"><a href="ffmpeg-all.html#toc-fbdev">26.7 fbdev</a></h2>
  18522. <p>Linux framebuffer input device.
  18523. </p>
  18524. <p>The Linux framebuffer is a graphic hardware-independent abstraction
  18525. layer to show graphics on a computer monitor, typically on the
  18526. console. It is accessed through a file device node, usually
  18527. &lsquo;<tt>/dev/fb0</tt>&rsquo;.
  18528. </p>
  18529. <p>For more detailed information read the file
  18530. Documentation/fb/framebuffer.txt included in the Linux source tree.
  18531. </p>
  18532. <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
  18533. </p>
  18534. <p>To record from the framebuffer device &lsquo;<tt>/dev/fb0</tt>&rsquo; with
  18535. <code>ffmpeg</code>:
  18536. </p><div class="example">
  18537. <pre class="example">ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
  18538. </pre></div>
  18539. <p>You can take a single screenshot image with the command:
  18540. </p><div class="example">
  18541. <pre class="example">ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
  18542. </pre></div>
  18543. <a name="Options-7"></a>
  18544. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-7">26.7.1 Options</a></h3>
  18545. <dl compact="compact">
  18546. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  18547. <dd><p>Set the frame rate. Default is 25.
  18548. </p>
  18549. </dd>
  18550. </dl>
  18551. <a name="gdigrab"></a>
  18552. <h2 class="section"><a href="ffmpeg-all.html#toc-gdigrab">26.8 gdigrab</a></h2>
  18553. <p>Win32 GDI-based screen capture device.
  18554. </p>
  18555. <p>This device allows you to capture a region of the display on Windows.
  18556. </p>
  18557. <p>There are two options for the input filename:
  18558. </p><div class="example">
  18559. <pre class="example">desktop
  18560. </pre></div>
  18561. <p>or
  18562. </p><div class="example">
  18563. <pre class="example">title=<var>window_title</var>
  18564. </pre></div>
  18565. <p>The first option will capture the entire desktop, or a fixed region of the
  18566. desktop. The second option will instead capture the contents of a single
  18567. window, regardless of its position on the screen.
  18568. </p>
  18569. <p>For example, to grab the entire desktop using <code>ffmpeg</code>:
  18570. </p><div class="example">
  18571. <pre class="example">ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
  18572. </pre></div>
  18573. <p>Grab a 640x480 region at position <code>10,20</code>:
  18574. </p><div class="example">
  18575. <pre class="example">ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
  18576. </pre></div>
  18577. <p>Grab the contents of the window named &quot;Calculator&quot;
  18578. </p><div class="example">
  18579. <pre class="example">ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
  18580. </pre></div>
  18581. <a name="Options-49"></a>
  18582. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-49">26.8.1 Options</a></h3>
  18583. <dl compact="compact">
  18584. <dt>&lsquo;<samp>draw_mouse</samp>&rsquo;</dt>
  18585. <dd><p>Specify whether to draw the mouse pointer. Use the value <code>0</code> to
  18586. not draw the pointer. Default value is <code>1</code>.
  18587. </p>
  18588. </dd>
  18589. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  18590. <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
  18591. corresponding to a frame rate of <code>30000/1001</code>.
  18592. </p>
  18593. </dd>
  18594. <dt>&lsquo;<samp>show_region</samp>&rsquo;</dt>
  18595. <dd><p>Show grabbed region on screen.
  18596. </p>
  18597. <p>If <var>show_region</var> is specified with <code>1</code>, then the grabbing
  18598. region will be indicated on screen. With this option, it is easy to
  18599. know what is being grabbed if only a portion of the screen is grabbed.
  18600. </p>
  18601. <p>Note that <var>show_region</var> is incompatible with grabbing the contents
  18602. of a single window.
  18603. </p>
  18604. <p>For example:
  18605. </p><div class="example">
  18606. <pre class="example">ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
  18607. </pre></div>
  18608. </dd>
  18609. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  18610. <dd><p>Set the video frame size. The default is to capture the full screen if &lsquo;<tt>desktop</tt>&rsquo; is selected, or the full window size if &lsquo;<tt>title=<var>window_title</var></tt>&rsquo; is selected.
  18611. </p>
  18612. </dd>
  18613. <dt>&lsquo;<samp>offset_x</samp>&rsquo;</dt>
  18614. <dd><p>When capturing a region with <var>video_size</var>, set the distance from the left edge of the screen or desktop.
  18615. </p>
  18616. <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.
  18617. </p>
  18618. </dd>
  18619. <dt>&lsquo;<samp>offset_y</samp>&rsquo;</dt>
  18620. <dd><p>When capturing a region with <var>video_size</var>, set the distance from the top edge of the screen or desktop.
  18621. </p>
  18622. <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.
  18623. </p>
  18624. </dd>
  18625. </dl>
  18626. <a name="iec61883"></a>
  18627. <h2 class="section"><a href="ffmpeg-all.html#toc-iec61883">26.9 iec61883</a></h2>
  18628. <p>FireWire DV/HDV input device using libiec61883.
  18629. </p>
  18630. <p>To enable this input device, you need libiec61883, libraw1394 and
  18631. libavc1394 installed on your system. Use the configure option
  18632. <code>--enable-libiec61883</code> to compile with the device enabled.
  18633. </p>
  18634. <p>The iec61883 capture device supports capturing from a video device
  18635. connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
  18636. FireWire stack (juju). This is the default DV/HDV input method in Linux
  18637. Kernel 2.6.37 and later, since the old FireWire stack was removed.
  18638. </p>
  18639. <p>Specify the FireWire port to be used as input file, or &quot;auto&quot;
  18640. to choose the first port connected.
  18641. </p>
  18642. <a name="Options-12"></a>
  18643. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-12">26.9.1 Options</a></h3>
  18644. <dl compact="compact">
  18645. <dt>&lsquo;<samp>dvtype</samp>&rsquo;</dt>
  18646. <dd><p>Override autodetection of DV/HDV. This should only be used if auto
  18647. detection does not work, or if usage of a different device type
  18648. should be prohibited. Treating a DV device as HDV (or vice versa) will
  18649. not work and result in undefined behavior.
  18650. The values &lsquo;<samp>auto</samp>&rsquo;, &lsquo;<samp>dv</samp>&rsquo; and &lsquo;<samp>hdv</samp>&rsquo; are supported.
  18651. </p>
  18652. </dd>
  18653. <dt>&lsquo;<samp>dvbuffer</samp>&rsquo;</dt>
  18654. <dd><p>Set maximum size of buffer for incoming data, in frames. For DV, this
  18655. is an exact value. For HDV, it is not frame exact, since HDV does
  18656. not have a fixed frame size.
  18657. </p>
  18658. </dd>
  18659. <dt>&lsquo;<samp>dvguid</samp>&rsquo;</dt>
  18660. <dd><p>Select the capture device by specifying its GUID. Capturing will only
  18661. be performed from the specified device and fails if no device with the
  18662. given GUID is found. This is useful to select the input if multiple
  18663. devices are connected at the same time.
  18664. Look at /sys/bus/firewire/devices to find out the GUIDs.
  18665. </p>
  18666. </dd>
  18667. </dl>
  18668. <a name="Examples-127"></a>
  18669. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-127">26.9.2 Examples</a></h3>
  18670. <ul>
  18671. <li>
  18672. Grab and show the input of a FireWire DV/HDV device.
  18673. <div class="example">
  18674. <pre class="example">ffplay -f iec61883 -i auto
  18675. </pre></div>
  18676. </li><li>
  18677. Grab and record the input of a FireWire DV/HDV device,
  18678. using a packet buffer of 100000 packets if the source is HDV.
  18679. <div class="example">
  18680. <pre class="example">ffmpeg -f iec61883 -i auto -dvbuffer 100000 out.mpg
  18681. </pre></div>
  18682. </li></ul>
  18683. <a name="jack"></a>
  18684. <h2 class="section"><a href="ffmpeg-all.html#toc-jack">26.10 jack</a></h2>
  18685. <p>JACK input device.
  18686. </p>
  18687. <p>To enable this input device during configuration you need libjack
  18688. installed on your system.
  18689. </p>
  18690. <p>A JACK input device creates one or more JACK writable clients, one for
  18691. each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
  18692. <var>client_name</var> is the name provided by the application, and <var>N</var>
  18693. is a number which identifies the channel.
  18694. Each writable client will send the acquired data to the FFmpeg input
  18695. device.
  18696. </p>
  18697. <p>Once you have created one or more JACK readable clients, you need to
  18698. connect them to one or more JACK writable clients.
  18699. </p>
  18700. <p>To connect or disconnect JACK clients you can use the <code>jack_connect</code>
  18701. and <code>jack_disconnect</code> programs, or do it through a graphical interface,
  18702. for example with <code>qjackctl</code>.
  18703. </p>
  18704. <p>To list the JACK clients and their properties you can invoke the command
  18705. <code>jack_lsp</code>.
  18706. </p>
  18707. <p>Follows an example which shows how to capture a JACK readable client
  18708. with <code>ffmpeg</code>.
  18709. </p><div class="example">
  18710. <pre class="example"># Create a JACK writable client with name &quot;ffmpeg&quot;.
  18711. $ ffmpeg -f jack -i ffmpeg -y out.wav
  18712. # Start the sample jack_metro readable client.
  18713. $ jack_metro -b 120 -d 0.2 -f 4000
  18714. # List the current JACK clients.
  18715. $ jack_lsp -c
  18716. system:capture_1
  18717. system:capture_2
  18718. system:playback_1
  18719. system:playback_2
  18720. ffmpeg:input_1
  18721. metro:120_bpm
  18722. # Connect metro to the ffmpeg writable client.
  18723. $ jack_connect metro:120_bpm ffmpeg:input_1
  18724. </pre></div>
  18725. <p>For more information read:
  18726. <a href="http://jackaudio.org/">http://jackaudio.org/</a>
  18727. </p>
  18728. <a name="Options-6"></a>
  18729. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-6">26.10.1 Options</a></h3>
  18730. <dl compact="compact">
  18731. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  18732. <dd><p>Set the number of channels. Default is 2.
  18733. </p>
  18734. </dd>
  18735. </dl>
  18736. <a name="kmsgrab"></a>
  18737. <h2 class="section"><a href="ffmpeg-all.html#toc-kmsgrab">26.11 kmsgrab</a></h2>
  18738. <p>KMS video input device.
  18739. </p>
  18740. <p>Captures the KMS scanout framebuffer associated with a specified CRTC or plane as a
  18741. DRM object that can be passed to other hardware functions.
  18742. </p>
  18743. <p>Requires either DRM master or CAP_SYS_ADMIN to run.
  18744. </p>
  18745. <p>If you don&rsquo;t understand what all of that means, you probably don&rsquo;t want this. Look at
  18746. &lsquo;<samp>x11grab</samp>&rsquo; instead.
  18747. </p>
  18748. <a name="Options-65"></a>
  18749. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-65">26.11.1 Options</a></h3>
  18750. <dl compact="compact">
  18751. <dt>&lsquo;<samp>device</samp>&rsquo;</dt>
  18752. <dd><p>DRM device to capture on. Defaults to &lsquo;<samp>/dev/dri/card0</samp>&rsquo;.
  18753. </p>
  18754. </dd>
  18755. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  18756. <dd><p>Pixel format of the framebuffer. Defaults to &lsquo;<samp>bgr0</samp>&rsquo;.
  18757. </p>
  18758. </dd>
  18759. <dt>&lsquo;<samp>format_modifier</samp>&rsquo;</dt>
  18760. <dd><p>Format modifier to signal on output frames. This is necessary to import correctly into
  18761. some APIs, but can&rsquo;t be autodetected. See the libdrm documentation for possible values.
  18762. </p>
  18763. </dd>
  18764. <dt>&lsquo;<samp>crtc_id</samp>&rsquo;</dt>
  18765. <dd><p>KMS CRTC ID to define the capture source. The first active plane on the given CRTC
  18766. will be used.
  18767. </p>
  18768. </dd>
  18769. <dt>&lsquo;<samp>plane_id</samp>&rsquo;</dt>
  18770. <dd><p>KMS plane ID to define the capture source. Defaults to the first active plane found if
  18771. neither &lsquo;<samp>crtc_id</samp>&rsquo; nor &lsquo;<samp>plane_id</samp>&rsquo; are specified.
  18772. </p>
  18773. </dd>
  18774. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  18775. <dd><p>Framerate to capture at. This is not synchronised to any page flipping or framebuffer
  18776. changes - it just defines the interval at which the framebuffer is sampled. Sampling
  18777. faster than the framebuffer update rate will generate independent frames with the same
  18778. content. Defaults to <code>30</code>.
  18779. </p>
  18780. </dd>
  18781. </dl>
  18782. <a name="Examples-34"></a>
  18783. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-34">26.11.2 Examples</a></h3>
  18784. <ul>
  18785. <li>
  18786. Capture from the first active plane, download the result to normal frames and encode.
  18787. This will only work if the framebuffer is both linear and mappable - if not, the result
  18788. may be scrambled or fail to download.
  18789. <div class="example">
  18790. <pre class="example">ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4
  18791. </pre></div>
  18792. </li><li>
  18793. Capture from CRTC ID 42 at 60fps, map the result to VAAPI, convert to NV12 and encode as H.264.
  18794. <div class="example">
  18795. <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
  18796. </pre></div>
  18797. </li><li>
  18798. To capture only part of a plane the output can be cropped - this can be used to capture
  18799. a single window, as long as it has a known absolute position and size. For example, to
  18800. capture and encode the middle quarter of a 1920x1080 plane:
  18801. <div class="example">
  18802. <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
  18803. </pre></div>
  18804. </li></ul>
  18805. <a name="lavfi"></a>
  18806. <h2 class="section"><a href="ffmpeg-all.html#toc-lavfi">26.12 lavfi</a></h2>
  18807. <p>Libavfilter input virtual device.
  18808. </p>
  18809. <p>This input device reads data from the open output pads of a libavfilter
  18810. filtergraph.
  18811. </p>
  18812. <p>For each filtergraph open output, the input device will create a
  18813. corresponding stream which is mapped to the generated output. Currently
  18814. only video data is supported. The filtergraph is specified through the
  18815. option &lsquo;<samp>graph</samp>&rsquo;.
  18816. </p>
  18817. <a name="Options-21"></a>
  18818. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-21">26.12.1 Options</a></h3>
  18819. <dl compact="compact">
  18820. <dt>&lsquo;<samp>graph</samp>&rsquo;</dt>
  18821. <dd><p>Specify the filtergraph to use as input. Each video open output must be
  18822. labelled by a unique string of the form &quot;out<var>N</var>&quot;, where <var>N</var> is a
  18823. number starting from 0 corresponding to the mapped input stream
  18824. generated by the device.
  18825. The first unlabelled output is automatically assigned to the &quot;out0&quot;
  18826. label, but all the others need to be specified explicitly.
  18827. </p>
  18828. <p>The suffix &quot;+subcc&quot; can be appended to the output label to create an extra
  18829. stream with the closed captions packets attached to that output
  18830. (experimental; only for EIA-608 / CEA-708 for now).
  18831. The subcc streams are created after all the normal streams, in the order of
  18832. the corresponding stream.
  18833. For example, if there is &quot;out19+subcc&quot;, &quot;out7+subcc&quot; and up to &quot;out42&quot;, the
  18834. stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19.
  18835. </p>
  18836. <p>If not specified defaults to the filename specified for the input
  18837. device.
  18838. </p>
  18839. </dd>
  18840. <dt>&lsquo;<samp>graph_file</samp>&rsquo;</dt>
  18841. <dd><p>Set the filename of the filtergraph to be read and sent to the other
  18842. filters. Syntax of the filtergraph is the same as the one specified by
  18843. the option <var>graph</var>.
  18844. </p>
  18845. </dd>
  18846. <dt>&lsquo;<samp>dumpgraph</samp>&rsquo;</dt>
  18847. <dd><p>Dump graph to stderr.
  18848. </p>
  18849. </dd>
  18850. </dl>
  18851. <a name="Examples-40"></a>
  18852. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-40">26.12.2 Examples</a></h3>
  18853. <ul>
  18854. <li>
  18855. Create a color video stream and play it back with <code>ffplay</code>:
  18856. <div class="example">
  18857. <pre class="example">ffplay -f lavfi -graph &quot;color=c=pink [out0]&quot; dummy
  18858. </pre></div>
  18859. </li><li>
  18860. As the previous example, but use filename for specifying the graph
  18861. description, and omit the &quot;out0&quot; label:
  18862. <div class="example">
  18863. <pre class="example">ffplay -f lavfi color=c=pink
  18864. </pre></div>
  18865. </li><li>
  18866. Create three different video test filtered sources and play them:
  18867. <div class="example">
  18868. <pre class="example">ffplay -f lavfi -graph &quot;testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]&quot; test3
  18869. </pre></div>
  18870. </li><li>
  18871. Read an audio stream from a file using the amovie source and play it
  18872. back with <code>ffplay</code>:
  18873. <div class="example">
  18874. <pre class="example">ffplay -f lavfi &quot;amovie=test.wav&quot;
  18875. </pre></div>
  18876. </li><li>
  18877. Read an audio stream and a video stream and play it back with
  18878. <code>ffplay</code>:
  18879. <div class="example">
  18880. <pre class="example">ffplay -f lavfi &quot;movie=test.avi[out0];amovie=test.wav[out1]&quot;
  18881. </pre></div>
  18882. </li><li>
  18883. Dump decoded frames to images and closed captions to a file (experimental):
  18884. <div class="example">
  18885. <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
  18886. </pre></div>
  18887. </li></ul>
  18888. <a name="libcdio"></a>
  18889. <h2 class="section"><a href="ffmpeg-all.html#toc-libcdio">26.13 libcdio</a></h2>
  18890. <p>Audio-CD input device based on libcdio.
  18891. </p>
  18892. <p>To enable this input device during configuration you need libcdio
  18893. installed on your system. It requires the configure option
  18894. <code>--enable-libcdio</code>.
  18895. </p>
  18896. <p>This device allows playing and grabbing from an Audio-CD.
  18897. </p>
  18898. <p>For example to copy with <code>ffmpeg</code> the entire Audio-CD in &lsquo;<tt>/dev/sr0</tt>&rsquo;,
  18899. you may run the command:
  18900. </p><div class="example">
  18901. <pre class="example">ffmpeg -f libcdio -i /dev/sr0 cd.wav
  18902. </pre></div>
  18903. <a name="Options-78"></a>
  18904. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-78">26.13.1 Options</a></h3>
  18905. <dl compact="compact">
  18906. <dt>&lsquo;<samp>speed</samp>&rsquo;</dt>
  18907. <dd><p>Set drive reading speed. Default value is 0.
  18908. </p>
  18909. <p>The speed is specified CD-ROM speed units. The speed is set through
  18910. the libcdio <code>cdio_cddap_speed_set</code> function. On many CD-ROM
  18911. drives, specifying a value too large will result in using the fastest
  18912. speed.
  18913. </p>
  18914. </dd>
  18915. <dt>&lsquo;<samp>paranoia_mode</samp>&rsquo;</dt>
  18916. <dd><p>Set paranoia recovery mode flags. It accepts one of the following values:
  18917. </p>
  18918. <dl compact="compact">
  18919. <dt>&lsquo;<samp>disable</samp>&rsquo;</dt>
  18920. <dt>&lsquo;<samp>verify</samp>&rsquo;</dt>
  18921. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  18922. <dt>&lsquo;<samp>neverskip</samp>&rsquo;</dt>
  18923. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  18924. </dl>
  18925. <p>Default value is &lsquo;<samp>disable</samp>&rsquo;.
  18926. </p>
  18927. <p>For more information about the available recovery modes, consult the
  18928. paranoia project documentation.
  18929. </p></dd>
  18930. </dl>
  18931. <a name="libdc1394"></a>
  18932. <h2 class="section"><a href="ffmpeg-all.html#toc-libdc1394">26.14 libdc1394</a></h2>
  18933. <p>IIDC1394 input device, based on libdc1394 and libraw1394.
  18934. </p>
  18935. <p>Requires the configure option <code>--enable-libdc1394</code>.
  18936. </p>
  18937. <a name="Options-70"></a>
  18938. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-70">26.14.1 Options</a></h3>
  18939. <dl compact="compact">
  18940. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  18941. <dd><p>Set the frame rate. Default is <code>ntsc</code>, corresponding to a frame
  18942. rate of <code>30000/1001</code>.
  18943. </p>
  18944. </dd>
  18945. <dt>&lsquo;<samp>pixel_format</samp>&rsquo;</dt>
  18946. <dd><p>Select the pixel format. Default is <code>uyvy422</code>.
  18947. </p>
  18948. </dd>
  18949. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  18950. <dd><p>Set the video size given as a string such as <code>640x480</code> or <code>hd720</code>.
  18951. Default is <code>qvga</code>.
  18952. </p></dd>
  18953. </dl>
  18954. <a name="openal"></a>
  18955. <h2 class="section"><a href="ffmpeg-all.html#toc-openal">26.15 openal</a></h2>
  18956. <p>The OpenAL input device provides audio capture on all systems with a
  18957. working OpenAL 1.1 implementation.
  18958. </p>
  18959. <p>To enable this input device during configuration, you need OpenAL
  18960. headers and libraries installed on your system, and need to configure
  18961. FFmpeg with <code>--enable-openal</code>.
  18962. </p>
  18963. <p>OpenAL headers and libraries should be provided as part of your OpenAL
  18964. implementation, or as an additional download (an SDK). Depending on your
  18965. installation you may need to specify additional flags via the
  18966. <code>--extra-cflags</code> and <code>--extra-ldflags</code> for allowing the build
  18967. system to locate the OpenAL headers and libraries.
  18968. </p>
  18969. <p>An incomplete list of OpenAL implementations follows:
  18970. </p>
  18971. <dl compact="compact">
  18972. <dt><strong>Creative</strong></dt>
  18973. <dd><p>The official Windows implementation, providing hardware acceleration
  18974. with supported devices and software fallback.
  18975. See <a href="http://openal.org/">http://openal.org/</a>.
  18976. </p></dd>
  18977. <dt><strong>OpenAL Soft</strong></dt>
  18978. <dd><p>Portable, open source (LGPL) software implementation. Includes
  18979. backends for the most common sound APIs on the Windows, Linux,
  18980. Solaris, and BSD operating systems.
  18981. See <a href="http://kcat.strangesoft.net/openal.html">http://kcat.strangesoft.net/openal.html</a>.
  18982. </p></dd>
  18983. <dt><strong>Apple</strong></dt>
  18984. <dd><p>OpenAL is part of Core Audio, the official Mac OS X Audio interface.
  18985. See <a href="http://developer.apple.com/technologies/mac/audio-and-video.html">http://developer.apple.com/technologies/mac/audio-and-video.html</a>
  18986. </p></dd>
  18987. </dl>
  18988. <p>This device allows one to capture from an audio input device handled
  18989. through OpenAL.
  18990. </p>
  18991. <p>You need to specify the name of the device to capture in the provided
  18992. filename. If the empty string is provided, the device will
  18993. automatically select the default device. You can get the list of the
  18994. supported devices by using the option <var>list_devices</var>.
  18995. </p>
  18996. <a name="Options-52"></a>
  18997. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-52">26.15.1 Options</a></h3>
  18998. <dl compact="compact">
  18999. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  19000. <dd><p>Set the number of channels in the captured audio. Only the values
  19001. &lsquo;<samp>1</samp>&rsquo; (monaural) and &lsquo;<samp>2</samp>&rsquo; (stereo) are currently supported.
  19002. Defaults to &lsquo;<samp>2</samp>&rsquo;.
  19003. </p>
  19004. </dd>
  19005. <dt>&lsquo;<samp>sample_size</samp>&rsquo;</dt>
  19006. <dd><p>Set the sample size (in bits) of the captured audio. Only the values
  19007. &lsquo;<samp>8</samp>&rsquo; and &lsquo;<samp>16</samp>&rsquo; are currently supported. Defaults to
  19008. &lsquo;<samp>16</samp>&rsquo;.
  19009. </p>
  19010. </dd>
  19011. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  19012. <dd><p>Set the sample rate (in Hz) of the captured audio.
  19013. Defaults to &lsquo;<samp>44.1k</samp>&rsquo;.
  19014. </p>
  19015. </dd>
  19016. <dt>&lsquo;<samp>list_devices</samp>&rsquo;</dt>
  19017. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of devices and exit.
  19018. Defaults to &lsquo;<samp>false</samp>&rsquo;.
  19019. </p>
  19020. </dd>
  19021. </dl>
  19022. <a name="Examples-157"></a>
  19023. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-157">26.15.2 Examples</a></h3>
  19024. <p>Print the list of OpenAL supported devices and exit:
  19025. </p><div class="example">
  19026. <pre class="example">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
  19027. </pre></div>
  19028. <p>Capture from the OpenAL device &lsquo;<tt>DR-BT101 via PulseAudio</tt>&rsquo;:
  19029. </p><div class="example">
  19030. <pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
  19031. </pre></div>
  19032. <p>Capture from the default device (note the empty string &rdquo; as filename):
  19033. </p><div class="example">
  19034. <pre class="example">$ ffmpeg -f openal -i '' out.ogg
  19035. </pre></div>
  19036. <p>Capture from two devices simultaneously, writing to two different files,
  19037. within the same <code>ffmpeg</code> command:
  19038. </p><div class="example">
  19039. <pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
  19040. </pre></div>
  19041. <p>Note: not all OpenAL implementations support multiple simultaneous capture -
  19042. try the latest OpenAL Soft if the above does not work.
  19043. </p>
  19044. <a name="oss-1"></a>
  19045. <h2 class="section"><a href="ffmpeg-all.html#toc-oss-1">26.16 oss</a></h2>
  19046. <p>Open Sound System input device.
  19047. </p>
  19048. <p>The filename to provide to the input device is the device node
  19049. representing the OSS input device, and is usually set to
  19050. &lsquo;<tt>/dev/dsp</tt>&rsquo;.
  19051. </p>
  19052. <p>For example to grab from &lsquo;<tt>/dev/dsp</tt>&rsquo; using <code>ffmpeg</code> use the
  19053. command:
  19054. </p><div class="example">
  19055. <pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
  19056. </pre></div>
  19057. <p>For more information about OSS see:
  19058. <a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
  19059. </p>
  19060. <a name="Options-29"></a>
  19061. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-29">26.16.1 Options</a></h3>
  19062. <dl compact="compact">
  19063. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  19064. <dd><p>Set the sample rate in Hz. Default is 48000.
  19065. </p>
  19066. </dd>
  19067. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  19068. <dd><p>Set the number of channels. Default is 2.
  19069. </p>
  19070. </dd>
  19071. </dl>
  19072. <a name="pulse"></a>
  19073. <h2 class="section"><a href="ffmpeg-all.html#toc-pulse">26.17 pulse</a></h2>
  19074. <p>PulseAudio input device.
  19075. </p>
  19076. <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
  19077. </p>
  19078. <p>The filename to provide to the input device is a source device or the
  19079. string &quot;default&quot;
  19080. </p>
  19081. <p>To list the PulseAudio source devices and their properties you can invoke
  19082. the command <code>pactl list sources</code>.
  19083. </p>
  19084. <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>.
  19085. </p>
  19086. <a name="Options-23"></a>
  19087. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-23">26.17.1 Options</a></h3>
  19088. <dl compact="compact">
  19089. <dt>&lsquo;<samp>server</samp>&rsquo;</dt>
  19090. <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
  19091. Default server is used when not provided.
  19092. </p>
  19093. </dd>
  19094. <dt>&lsquo;<samp>name</samp>&rsquo;</dt>
  19095. <dd><p>Specify the application name PulseAudio will use when showing active clients,
  19096. by default it is the <code>LIBAVFORMAT_IDENT</code> string.
  19097. </p>
  19098. </dd>
  19099. <dt>&lsquo;<samp>stream_name</samp>&rsquo;</dt>
  19100. <dd><p>Specify the stream name PulseAudio will use when showing active streams,
  19101. by default it is &quot;record&quot;.
  19102. </p>
  19103. </dd>
  19104. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  19105. <dd><p>Specify the samplerate in Hz, by default 48kHz is used.
  19106. </p>
  19107. </dd>
  19108. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  19109. <dd><p>Specify the channels in use, by default 2 (stereo) is set.
  19110. </p>
  19111. </dd>
  19112. <dt>&lsquo;<samp>frame_size</samp>&rsquo;</dt>
  19113. <dd><p>Specify the number of bytes per frame, by default it is set to 1024.
  19114. </p>
  19115. </dd>
  19116. <dt>&lsquo;<samp>fragment_size</samp>&rsquo;</dt>
  19117. <dd><p>Specify the minimal buffering fragment in PulseAudio, it will affect the
  19118. audio latency. By default it is unset.
  19119. </p>
  19120. </dd>
  19121. <dt>&lsquo;<samp>wallclock</samp>&rsquo;</dt>
  19122. <dd><p>Set the initial PTS using the current time. Default is 1.
  19123. </p>
  19124. </dd>
  19125. </dl>
  19126. <a name="Examples-71"></a>
  19127. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-71">26.17.2 Examples</a></h3>
  19128. <p>Record a stream from default device:
  19129. </p><div class="example">
  19130. <pre class="example">ffmpeg -f pulse -i default /tmp/pulse.wav
  19131. </pre></div>
  19132. <a name="sndio-1"></a>
  19133. <h2 class="section"><a href="ffmpeg-all.html#toc-sndio-1">26.18 sndio</a></h2>
  19134. <p>sndio input device.
  19135. </p>
  19136. <p>To enable this input device during configuration you need libsndio
  19137. installed on your system.
  19138. </p>
  19139. <p>The filename to provide to the input device is the device node
  19140. representing the sndio input device, and is usually set to
  19141. &lsquo;<tt>/dev/audio0</tt>&rsquo;.
  19142. </p>
  19143. <p>For example to grab from &lsquo;<tt>/dev/audio0</tt>&rsquo; using <code>ffmpeg</code> use the
  19144. command:
  19145. </p><div class="example">
  19146. <pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
  19147. </pre></div>
  19148. <a name="Options-9"></a>
  19149. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-9">26.18.1 Options</a></h3>
  19150. <dl compact="compact">
  19151. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  19152. <dd><p>Set the sample rate in Hz. Default is 48000.
  19153. </p>
  19154. </dd>
  19155. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  19156. <dd><p>Set the number of channels. Default is 2.
  19157. </p>
  19158. </dd>
  19159. </dl>
  19160. <a name="video4linux2_002c-v4l2"></a>
  19161. <h2 class="section"><a href="ffmpeg-all.html#toc-video4linux2_002c-v4l2">26.19 video4linux2, v4l2</a></h2>
  19162. <p>Video4Linux2 input video device.
  19163. </p>
  19164. <p>&quot;v4l2&quot; can be used as alias for &quot;video4linux2&quot;.
  19165. </p>
  19166. <p>If FFmpeg is built with v4l-utils support (by using the
  19167. <code>--enable-libv4l2</code> configure option), it is possible to use it with the
  19168. <code>-use_libv4l2</code> input device option.
  19169. </p>
  19170. <p>The name of the device to grab is a file device node, usually Linux
  19171. systems tend to automatically create such nodes when the device
  19172. (e.g. an USB webcam) is plugged into the system, and has a name of the
  19173. kind &lsquo;<tt>/dev/video<var>N</var></tt>&rsquo;, where <var>N</var> is a number associated to
  19174. the device.
  19175. </p>
  19176. <p>Video4Linux2 devices usually support a limited set of
  19177. <var>width</var>x<var>height</var> sizes and frame rates. You can check which are
  19178. supported using <code>-list_formats all</code> for Video4Linux2 devices.
  19179. Some devices, like TV cards, support one or more standards. It is possible
  19180. to list all the supported standards using <code>-list_standards all</code>.
  19181. </p>
  19182. <p>The time base for the timestamps is 1 microsecond. Depending on the kernel
  19183. version and configuration, the timestamps may be derived from the real time
  19184. clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
  19185. boot time, unaffected by NTP or manual changes to the clock). The
  19186. &lsquo;<samp>-timestamps abs</samp>&rsquo; or &lsquo;<samp>-ts abs</samp>&rsquo; option can be used to force
  19187. conversion into the real time clock.
  19188. </p>
  19189. <p>Some usage examples of the video4linux2 device with <code>ffmpeg</code>
  19190. and <code>ffplay</code>:
  19191. </p><ul>
  19192. <li>
  19193. List supported formats for a video4linux2 device:
  19194. <div class="example">
  19195. <pre class="example">ffplay -f video4linux2 -list_formats all /dev/video0
  19196. </pre></div>
  19197. </li><li>
  19198. Grab and show the input of a video4linux2 device:
  19199. <div class="example">
  19200. <pre class="example">ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
  19201. </pre></div>
  19202. </li><li>
  19203. Grab and record the input of a video4linux2 device, leave the
  19204. frame rate and size as previously set:
  19205. <div class="example">
  19206. <pre class="example">ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
  19207. </pre></div>
  19208. </li></ul>
  19209. <p>For more information about Video4Linux, check <a href="http://linuxtv.org/">http://linuxtv.org/</a>.
  19210. </p>
  19211. <a name="Options-59"></a>
  19212. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-59">26.19.1 Options</a></h3>
  19213. <dl compact="compact">
  19214. <dt>&lsquo;<samp>standard</samp>&rsquo;</dt>
  19215. <dd><p>Set the standard. Must be the name of a supported standard. To get a
  19216. list of the supported standards, use the &lsquo;<samp>list_standards</samp>&rsquo;
  19217. option.
  19218. </p>
  19219. </dd>
  19220. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  19221. <dd><p>Set the input channel number. Default to -1, which means using the
  19222. previously selected channel.
  19223. </p>
  19224. </dd>
  19225. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  19226. <dd><p>Set the video frame size. The argument must be a string in the form
  19227. <var>WIDTH</var>x<var>HEIGHT</var> or a valid size abbreviation.
  19228. </p>
  19229. </dd>
  19230. <dt>&lsquo;<samp>pixel_format</samp>&rsquo;</dt>
  19231. <dd><p>Select the pixel format (only valid for raw video input).
  19232. </p>
  19233. </dd>
  19234. <dt>&lsquo;<samp>input_format</samp>&rsquo;</dt>
  19235. <dd><p>Set the preferred pixel format (for raw video) or a codec name.
  19236. This option allows one to select the input format, when several are
  19237. available.
  19238. </p>
  19239. </dd>
  19240. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  19241. <dd><p>Set the preferred video frame rate.
  19242. </p>
  19243. </dd>
  19244. <dt>&lsquo;<samp>list_formats</samp>&rsquo;</dt>
  19245. <dd><p>List available formats (supported pixel formats, codecs, and frame
  19246. sizes) and exit.
  19247. </p>
  19248. <p>Available values are:
  19249. </p><dl compact="compact">
  19250. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  19251. <dd><p>Show all available (compressed and non-compressed) formats.
  19252. </p>
  19253. </dd>
  19254. <dt>&lsquo;<samp>raw</samp>&rsquo;</dt>
  19255. <dd><p>Show only raw video (non-compressed) formats.
  19256. </p>
  19257. </dd>
  19258. <dt>&lsquo;<samp>compressed</samp>&rsquo;</dt>
  19259. <dd><p>Show only compressed formats.
  19260. </p></dd>
  19261. </dl>
  19262. </dd>
  19263. <dt>&lsquo;<samp>list_standards</samp>&rsquo;</dt>
  19264. <dd><p>List supported standards and exit.
  19265. </p>
  19266. <p>Available values are:
  19267. </p><dl compact="compact">
  19268. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  19269. <dd><p>Show all supported standards.
  19270. </p></dd>
  19271. </dl>
  19272. </dd>
  19273. <dt>&lsquo;<samp>timestamps, ts</samp>&rsquo;</dt>
  19274. <dd><p>Set type of timestamps for grabbed frames.
  19275. </p>
  19276. <p>Available values are:
  19277. </p><dl compact="compact">
  19278. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  19279. <dd><p>Use timestamps from the kernel.
  19280. </p>
  19281. </dd>
  19282. <dt>&lsquo;<samp>abs</samp>&rsquo;</dt>
  19283. <dd><p>Use absolute timestamps (wall clock).
  19284. </p>
  19285. </dd>
  19286. <dt>&lsquo;<samp>mono2abs</samp>&rsquo;</dt>
  19287. <dd><p>Force conversion from monotonic to absolute timestamps.
  19288. </p></dd>
  19289. </dl>
  19290. <p>Default value is <code>default</code>.
  19291. </p>
  19292. </dd>
  19293. <dt>&lsquo;<samp>use_libv4l2</samp>&rsquo;</dt>
  19294. <dd><p>Use libv4l2 (v4l-utils) conversion functions. Default is 0.
  19295. </p>
  19296. </dd>
  19297. </dl>
  19298. <a name="vfwcap"></a>
  19299. <h2 class="section"><a href="ffmpeg-all.html#toc-vfwcap">26.20 vfwcap</a></h2>
  19300. <p>VfW (Video for Windows) capture input device.
  19301. </p>
  19302. <p>The filename passed as input is the capture driver number, ranging from
  19303. 0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
  19304. other filename will be interpreted as device number 0.
  19305. </p>
  19306. <a name="Options-16"></a>
  19307. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-16">26.20.1 Options</a></h3>
  19308. <dl compact="compact">
  19309. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  19310. <dd><p>Set the video frame size.
  19311. </p>
  19312. </dd>
  19313. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  19314. <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
  19315. corresponding to a frame rate of <code>30000/1001</code>.
  19316. </p>
  19317. </dd>
  19318. </dl>
  19319. <a name="x11grab"></a>
  19320. <h2 class="section"><a href="ffmpeg-all.html#toc-x11grab">26.21 x11grab</a></h2>
  19321. <p>X11 video input device.
  19322. </p>
  19323. <p>To enable this input device during configuration you need libxcb
  19324. installed on your system. It will be automatically detected during
  19325. configuration.
  19326. </p>
  19327. <p>This device allows one to capture a region of an X11 display.
  19328. </p>
  19329. <p>The filename passed as input has the syntax:
  19330. </p><div class="example">
  19331. <pre class="example">[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
  19332. </pre></div>
  19333. <p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
  19334. X11 display name of the screen to grab from. <var>hostname</var> can be
  19335. omitted, and defaults to &quot;localhost&quot;. The environment variable
  19336. <code>DISPLAY</code> contains the default display name.
  19337. </p>
  19338. <p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
  19339. area with respect to the top-left border of the X11 screen. They
  19340. default to 0.
  19341. </p>
  19342. <p>Check the X11 documentation (e.g. <code>man X</code>) for more detailed
  19343. information.
  19344. </p>
  19345. <p>Use the <code>xdpyinfo</code> program for getting basic information about
  19346. the properties of your X11 display (e.g. grep for &quot;name&quot; or
  19347. &quot;dimensions&quot;).
  19348. </p>
  19349. <p>For example to grab from &lsquo;<tt>:0.0</tt>&rsquo; using <code>ffmpeg</code>:
  19350. </p><div class="example">
  19351. <pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
  19352. </pre></div>
  19353. <p>Grab at position <code>10,20</code>:
  19354. </p><div class="example">
  19355. <pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  19356. </pre></div>
  19357. <a name="Options-10"></a>
  19358. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-10">26.21.1 Options</a></h3>
  19359. <dl compact="compact">
  19360. <dt>&lsquo;<samp>draw_mouse</samp>&rsquo;</dt>
  19361. <dd><p>Specify whether to draw the mouse pointer. A value of <code>0</code> specifies
  19362. not to draw the pointer. Default value is <code>1</code>.
  19363. </p>
  19364. </dd>
  19365. <dt>&lsquo;<samp>follow_mouse</samp>&rsquo;</dt>
  19366. <dd><p>Make the grabbed area follow the mouse. The argument can be
  19367. <code>centered</code> or a number of pixels <var>PIXELS</var>.
  19368. </p>
  19369. <p>When it is specified with &quot;centered&quot;, the grabbing region follows the mouse
  19370. pointer and keeps the pointer at the center of region; otherwise, the region
  19371. follows only when the mouse pointer reaches within <var>PIXELS</var> (greater than
  19372. zero) to the edge of region.
  19373. </p>
  19374. <p>For example:
  19375. </p><div class="example">
  19376. <pre class="example">ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
  19377. </pre></div>
  19378. <p>To follow only when the mouse pointer reaches within 100 pixels to edge:
  19379. </p><div class="example">
  19380. <pre class="example">ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
  19381. </pre></div>
  19382. </dd>
  19383. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  19384. <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
  19385. corresponding to a frame rate of <code>30000/1001</code>.
  19386. </p>
  19387. </dd>
  19388. <dt>&lsquo;<samp>show_region</samp>&rsquo;</dt>
  19389. <dd><p>Show grabbed region on screen.
  19390. </p>
  19391. <p>If <var>show_region</var> is specified with <code>1</code>, then the grabbing
  19392. region will be indicated on screen. With this option, it is easy to
  19393. know what is being grabbed if only a portion of the screen is grabbed.
  19394. </p>
  19395. </dd>
  19396. <dt>&lsquo;<samp>region_border</samp>&rsquo;</dt>
  19397. <dd><p>Set the region border thickness if &lsquo;<samp>-show_region 1</samp>&rsquo; is used.
  19398. Range is 1 to 128 and default is 3 (XCB-based x11grab only).
  19399. </p>
  19400. <p>For example:
  19401. </p><div class="example">
  19402. <pre class="example">ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  19403. </pre></div>
  19404. <p>With <var>follow_mouse</var>:
  19405. </p><div class="example">
  19406. <pre class="example">ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
  19407. </pre></div>
  19408. </dd>
  19409. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  19410. <dd><p>Set the video frame size. Default is the full desktop.
  19411. </p>
  19412. </dd>
  19413. <dt>&lsquo;<samp>grab_x</samp>&rsquo;</dt>
  19414. <dt>&lsquo;<samp>grab_y</samp>&rsquo;</dt>
  19415. <dd><p>Set the grabbing region coordinates. They are expressed as offset from
  19416. the top left corner of the X11 window and correspond to the
  19417. <var>x_offset</var> and <var>y_offset</var> parameters in the device name. The
  19418. default value for both options is 0.
  19419. </p></dd>
  19420. </dl>
  19421. <a name="Output-Devices"></a>
  19422. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Output-Devices">27 Output Devices</a></h1>
  19423. <p>Output devices are configured elements in FFmpeg that can write
  19424. multimedia data to an output device attached to your system.
  19425. </p>
  19426. <p>When you configure your FFmpeg build, all the supported output devices
  19427. are enabled by default. You can list all available ones using the
  19428. configure option &quot;&ndash;list-outdevs&quot;.
  19429. </p>
  19430. <p>You can disable all the output devices using the configure option
  19431. &quot;&ndash;disable-outdevs&quot;, and selectively enable an output device using the
  19432. option &quot;&ndash;enable-outdev=<var>OUTDEV</var>&quot;, or you can disable a particular
  19433. input device using the option &quot;&ndash;disable-outdev=<var>OUTDEV</var>&quot;.
  19434. </p>
  19435. <p>The option &quot;-devices&quot; of the ff* tools will display the list of
  19436. enabled output devices.
  19437. </p>
  19438. <p>A description of the currently available output devices follows.
  19439. </p>
  19440. <a name="alsa"></a>
  19441. <h2 class="section"><a href="ffmpeg-all.html#toc-alsa">27.1 alsa</a></h2>
  19442. <p>ALSA (Advanced Linux Sound Architecture) output device.
  19443. </p>
  19444. <a name="Examples-164"></a>
  19445. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-164">27.1.1 Examples</a></h3>
  19446. <ul>
  19447. <li>
  19448. Play a file on default ALSA device:
  19449. <div class="example">
  19450. <pre class="example">ffmpeg -i INPUT -f alsa default
  19451. </pre></div>
  19452. </li><li>
  19453. Play a file on soundcard 1, audio device 7:
  19454. <div class="example">
  19455. <pre class="example">ffmpeg -i INPUT -f alsa hw:1,7
  19456. </pre></div>
  19457. </li></ul>
  19458. <a name="caca"></a>
  19459. <h2 class="section"><a href="ffmpeg-all.html#toc-caca">27.2 caca</a></h2>
  19460. <p>CACA output device.
  19461. </p>
  19462. <p>This output device allows one to show a video stream in CACA window.
  19463. Only one CACA window is allowed per application, so you can
  19464. have only one instance of this output device in an application.
  19465. </p>
  19466. <p>To enable this output device you need to configure FFmpeg with
  19467. <code>--enable-libcaca</code>.
  19468. libcaca is a graphics library that outputs text instead of pixels.
  19469. </p>
  19470. <p>For more information about libcaca, check:
  19471. <a href="http://caca.zoy.org/wiki/libcaca">http://caca.zoy.org/wiki/libcaca</a>
  19472. </p>
  19473. <a name="Options-5"></a>
  19474. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-5">27.2.1 Options</a></h3>
  19475. <dl compact="compact">
  19476. <dt>&lsquo;<samp>window_title</samp>&rsquo;</dt>
  19477. <dd><p>Set the CACA window title, if not specified default to the filename
  19478. specified for the output device.
  19479. </p>
  19480. </dd>
  19481. <dt>&lsquo;<samp>window_size</samp>&rsquo;</dt>
  19482. <dd><p>Set the CACA window size, can be a string of the form
  19483. <var>width</var>x<var>height</var> or a video size abbreviation.
  19484. If not specified it defaults to the size of the input video.
  19485. </p>
  19486. </dd>
  19487. <dt>&lsquo;<samp>driver</samp>&rsquo;</dt>
  19488. <dd><p>Set display driver.
  19489. </p>
  19490. </dd>
  19491. <dt>&lsquo;<samp>algorithm</samp>&rsquo;</dt>
  19492. <dd><p>Set dithering algorithm. Dithering is necessary
  19493. because the picture being rendered has usually far more colours than
  19494. the available palette.
  19495. The accepted values are listed with <code>-list_dither algorithms</code>.
  19496. </p>
  19497. </dd>
  19498. <dt>&lsquo;<samp>antialias</samp>&rsquo;</dt>
  19499. <dd><p>Set antialias method. Antialiasing smoothens the rendered
  19500. image and avoids the commonly seen staircase effect.
  19501. The accepted values are listed with <code>-list_dither antialiases</code>.
  19502. </p>
  19503. </dd>
  19504. <dt>&lsquo;<samp>charset</samp>&rsquo;</dt>
  19505. <dd><p>Set which characters are going to be used when rendering text.
  19506. The accepted values are listed with <code>-list_dither charsets</code>.
  19507. </p>
  19508. </dd>
  19509. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  19510. <dd><p>Set color to be used when rendering text.
  19511. The accepted values are listed with <code>-list_dither colors</code>.
  19512. </p>
  19513. </dd>
  19514. <dt>&lsquo;<samp>list_drivers</samp>&rsquo;</dt>
  19515. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of available drivers and exit.
  19516. </p>
  19517. </dd>
  19518. <dt>&lsquo;<samp>list_dither</samp>&rsquo;</dt>
  19519. <dd><p>List available dither options related to the argument.
  19520. The argument must be one of <code>algorithms</code>, <code>antialiases</code>,
  19521. <code>charsets</code>, <code>colors</code>.
  19522. </p></dd>
  19523. </dl>
  19524. <a name="Examples-35"></a>
  19525. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-35">27.2.2 Examples</a></h3>
  19526. <ul>
  19527. <li>
  19528. The following command shows the <code>ffmpeg</code> output is an
  19529. CACA window, forcing its size to 80x25:
  19530. <div class="example">
  19531. <pre class="example">ffmpeg -i INPUT -c:v rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
  19532. </pre></div>
  19533. </li><li>
  19534. Show the list of available drivers and exit:
  19535. <div class="example">
  19536. <pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
  19537. </pre></div>
  19538. </li><li>
  19539. Show the list of available dither colors and exit:
  19540. <div class="example">
  19541. <pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
  19542. </pre></div>
  19543. </li></ul>
  19544. <a name="decklink-1"></a>
  19545. <h2 class="section"><a href="ffmpeg-all.html#toc-decklink-1">27.3 decklink</a></h2>
  19546. <p>The decklink output device provides playback capabilities for Blackmagic
  19547. DeckLink devices.
  19548. </p>
  19549. <p>To enable this output device, you need the Blackmagic DeckLink SDK and you
  19550. need to configure with the appropriate <code>--extra-cflags</code>
  19551. and <code>--extra-ldflags</code>.
  19552. On Windows, you need to run the IDL files through <code>widl</code>.
  19553. </p>
  19554. <p>DeckLink is very picky about the formats it supports. Pixel format is always
  19555. uyvy422, framerate, field order and video size must be determined for your
  19556. device with <code>-list_formats 1</code>. Audio sample rate is always 48 kHz.
  19557. </p>
  19558. <a name="Options-72"></a>
  19559. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-72">27.3.1 Options</a></h3>
  19560. <dl compact="compact">
  19561. <dt>&lsquo;<samp>list_devices</samp>&rsquo;</dt>
  19562. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of devices and exit.
  19563. Defaults to &lsquo;<samp>false</samp>&rsquo;. This option is deprecated, please use the
  19564. <code>-sinks</code> option of ffmpeg to list the available output devices.
  19565. </p>
  19566. </dd>
  19567. <dt>&lsquo;<samp>list_formats</samp>&rsquo;</dt>
  19568. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of supported formats and exit.
  19569. Defaults to &lsquo;<samp>false</samp>&rsquo;.
  19570. </p>
  19571. </dd>
  19572. <dt>&lsquo;<samp>preroll</samp>&rsquo;</dt>
  19573. <dd><p>Amount of time to preroll video in seconds.
  19574. Defaults to &lsquo;<samp>0.5</samp>&rsquo;.
  19575. </p>
  19576. </dd>
  19577. <dt>&lsquo;<samp>duplex_mode</samp>&rsquo;</dt>
  19578. <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;.
  19579. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  19580. </p>
  19581. </dd>
  19582. <dt>&lsquo;<samp>timing_offset</samp>&rsquo;</dt>
  19583. <dd><p>Sets the genlock timing pixel offset on the used output.
  19584. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  19585. </p>
  19586. </dd>
  19587. </dl>
  19588. <a name="Examples-7"></a>
  19589. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-7">27.3.2 Examples</a></h3>
  19590. <ul>
  19591. <li>
  19592. List output devices:
  19593. <div class="example">
  19594. <pre class="example">ffmpeg -sinks decklink
  19595. </pre></div>
  19596. </li><li>
  19597. List supported formats:
  19598. <div class="example">
  19599. <pre class="example">ffmpeg -i test.avi -f decklink -list_formats 1 'DeckLink Mini Monitor'
  19600. </pre></div>
  19601. </li><li>
  19602. Play video clip:
  19603. <div class="example">
  19604. <pre class="example">ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 'DeckLink Mini Monitor'
  19605. </pre></div>
  19606. </li><li>
  19607. Play video clip with non-standard framerate or video size:
  19608. <div class="example">
  19609. <pre class="example">ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 -s 720x486 -r 24000/1001 'DeckLink Mini Monitor'
  19610. </pre></div>
  19611. </li></ul>
  19612. <a name="fbdev-1"></a>
  19613. <h2 class="section"><a href="ffmpeg-all.html#toc-fbdev-1">27.4 fbdev</a></h2>
  19614. <p>Linux framebuffer output device.
  19615. </p>
  19616. <p>The Linux framebuffer is a graphic hardware-independent abstraction
  19617. layer to show graphics on a computer monitor, typically on the
  19618. console. It is accessed through a file device node, usually
  19619. &lsquo;<tt>/dev/fb0</tt>&rsquo;.
  19620. </p>
  19621. <p>For more detailed information read the file
  19622. &lsquo;<tt>Documentation/fb/framebuffer.txt</tt>&rsquo; included in the Linux source tree.
  19623. </p>
  19624. <a name="Options-68"></a>
  19625. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-68">27.4.1 Options</a></h3>
  19626. <dl compact="compact">
  19627. <dt>&lsquo;<samp>xoffset</samp>&rsquo;</dt>
  19628. <dt>&lsquo;<samp>yoffset</samp>&rsquo;</dt>
  19629. <dd><p>Set x/y coordinate of top left corner. Default is 0.
  19630. </p></dd>
  19631. </dl>
  19632. <a name="Examples-151"></a>
  19633. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-151">27.4.2 Examples</a></h3>
  19634. <p>Play a file on framebuffer device &lsquo;<tt>/dev/fb0</tt>&rsquo;.
  19635. Required pixel format depends on current framebuffer settings.
  19636. </p><div class="example">
  19637. <pre class="example">ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0
  19638. </pre></div>
  19639. <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
  19640. </p>
  19641. <a name="opengl"></a>
  19642. <h2 class="section"><a href="ffmpeg-all.html#toc-opengl">27.5 opengl</a></h2>
  19643. <p>OpenGL output device.
  19644. </p>
  19645. <p>To enable this output device you need to configure FFmpeg with <code>--enable-opengl</code>.
  19646. </p>
  19647. <p>This output device allows one to render to OpenGL context.
  19648. Context may be provided by application or default SDL window is created.
  19649. </p>
  19650. <p>When device renders to external context, application must implement handlers for following messages:
  19651. <code>AV_DEV_TO_APP_CREATE_WINDOW_BUFFER</code> - create OpenGL context on current thread.
  19652. <code>AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER</code> - make OpenGL context current.
  19653. <code>AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER</code> - swap buffers.
  19654. <code>AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER</code> - destroy OpenGL context.
  19655. Application is also required to inform a device about current resolution by sending <code>AV_APP_TO_DEV_WINDOW_SIZE</code> message.
  19656. </p>
  19657. <a name="Options-41"></a>
  19658. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-41">27.5.1 Options</a></h3>
  19659. <dl compact="compact">
  19660. <dt>&lsquo;<samp>background</samp>&rsquo;</dt>
  19661. <dd><p>Set background color. Black is a default.
  19662. </p></dd>
  19663. <dt>&lsquo;<samp>no_window</samp>&rsquo;</dt>
  19664. <dd><p>Disables default SDL window when set to non-zero value.
  19665. Application must provide OpenGL context and both <code>window_size_cb</code> and <code>window_swap_buffers_cb</code> callbacks when set.
  19666. </p></dd>
  19667. <dt>&lsquo;<samp>window_title</samp>&rsquo;</dt>
  19668. <dd><p>Set the SDL window title, if not specified default to the filename specified for the output device.
  19669. Ignored when &lsquo;<samp>no_window</samp>&rsquo; is set.
  19670. </p></dd>
  19671. <dt>&lsquo;<samp>window_size</samp>&rsquo;</dt>
  19672. <dd><p>Set preferred window size, can be a string of the form widthxheight or a video size abbreviation.
  19673. If not specified it defaults to the size of the input video, downscaled according to the aspect ratio.
  19674. Mostly usable when &lsquo;<samp>no_window</samp>&rsquo; is not set.
  19675. </p>
  19676. </dd>
  19677. </dl>
  19678. <a name="Examples-96"></a>
  19679. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-96">27.5.2 Examples</a></h3>
  19680. <p>Play a file on SDL window using OpenGL rendering:
  19681. </p><div class="example">
  19682. <pre class="example">ffmpeg -i INPUT -f opengl &quot;window title&quot;
  19683. </pre></div>
  19684. <a name="oss"></a>
  19685. <h2 class="section"><a href="ffmpeg-all.html#toc-oss">27.6 oss</a></h2>
  19686. <p>OSS (Open Sound System) output device.
  19687. </p>
  19688. <a name="pulse-1"></a>
  19689. <h2 class="section"><a href="ffmpeg-all.html#toc-pulse-1">27.7 pulse</a></h2>
  19690. <p>PulseAudio output device.
  19691. </p>
  19692. <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
  19693. </p>
  19694. <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>
  19695. </p>
  19696. <a name="Options-71"></a>
  19697. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-71">27.7.1 Options</a></h3>
  19698. <dl compact="compact">
  19699. <dt>&lsquo;<samp>server</samp>&rsquo;</dt>
  19700. <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
  19701. Default server is used when not provided.
  19702. </p>
  19703. </dd>
  19704. <dt>&lsquo;<samp>name</samp>&rsquo;</dt>
  19705. <dd><p>Specify the application name PulseAudio will use when showing active clients,
  19706. by default it is the <code>LIBAVFORMAT_IDENT</code> string.
  19707. </p>
  19708. </dd>
  19709. <dt>&lsquo;<samp>stream_name</samp>&rsquo;</dt>
  19710. <dd><p>Specify the stream name PulseAudio will use when showing active streams,
  19711. by default it is set to the specified output name.
  19712. </p>
  19713. </dd>
  19714. <dt>&lsquo;<samp>device</samp>&rsquo;</dt>
  19715. <dd><p>Specify the device to use. Default device is used when not provided.
  19716. List of output devices can be obtained with command <code>pactl list sinks</code>.
  19717. </p>
  19718. </dd>
  19719. <dt>&lsquo;<samp>buffer_size</samp>&rsquo;</dt>
  19720. <dt>&lsquo;<samp>buffer_duration</samp>&rsquo;</dt>
  19721. <dd><p>Control the size and duration of the PulseAudio buffer. A small buffer
  19722. gives more control, but requires more frequent updates.
  19723. </p>
  19724. <p>&lsquo;<samp>buffer_size</samp>&rsquo; specifies size in bytes while
  19725. &lsquo;<samp>buffer_duration</samp>&rsquo; specifies duration in milliseconds.
  19726. </p>
  19727. <p>When both options are provided then the highest value is used
  19728. (duration is recalculated to bytes using stream parameters). If they
  19729. are set to 0 (which is default), the device will use the default
  19730. PulseAudio duration value. By default PulseAudio set buffer duration
  19731. to around 2 seconds.
  19732. </p>
  19733. </dd>
  19734. <dt>&lsquo;<samp>prebuf</samp>&rsquo;</dt>
  19735. <dd><p>Specify pre-buffering size in bytes. The server does not start with
  19736. playback before at least &lsquo;<samp>prebuf</samp>&rsquo; bytes are available in the
  19737. buffer. By default this option is initialized to the same value as
  19738. &lsquo;<samp>buffer_size</samp>&rsquo; or &lsquo;<samp>buffer_duration</samp>&rsquo; (whichever is bigger).
  19739. </p>
  19740. </dd>
  19741. <dt>&lsquo;<samp>minreq</samp>&rsquo;</dt>
  19742. <dd><p>Specify minimum request size in bytes. The server does not request less
  19743. than &lsquo;<samp>minreq</samp>&rsquo; bytes from the client, instead waits until the buffer
  19744. is free enough to request more bytes at once. It is recommended to not set
  19745. this option, which will initialize this to a value that is deemed sensible
  19746. by the server.
  19747. </p>
  19748. </dd>
  19749. </dl>
  19750. <a name="Examples-10"></a>
  19751. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-10">27.7.2 Examples</a></h3>
  19752. <p>Play a file on default device on default server:
  19753. </p><div class="example">
  19754. <pre class="example">ffmpeg -i INPUT -f pulse &quot;stream name&quot;
  19755. </pre></div>
  19756. <a name="sdl"></a>
  19757. <h2 class="section"><a href="ffmpeg-all.html#toc-sdl">27.8 sdl</a></h2>
  19758. <p>SDL (Simple DirectMedia Layer) output device.
  19759. </p>
  19760. <p>&quot;sdl2&quot; can be used as alias for &quot;sdl&quot;.
  19761. </p>
  19762. <p>This output device allows one to show a video stream in an SDL
  19763. window. Only one SDL window is allowed per application, so you can
  19764. have only one instance of this output device in an application.
  19765. </p>
  19766. <p>To enable this output device you need libsdl installed on your system
  19767. when configuring your build.
  19768. </p>
  19769. <p>For more information about SDL, check:
  19770. <a href="http://www.libsdl.org/">http://www.libsdl.org/</a>
  19771. </p>
  19772. <a name="Options-11"></a>
  19773. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-11">27.8.1 Options</a></h3>
  19774. <dl compact="compact">
  19775. <dt>&lsquo;<samp>window_title</samp>&rsquo;</dt>
  19776. <dd><p>Set the SDL window title, if not specified default to the filename
  19777. specified for the output device.
  19778. </p>
  19779. </dd>
  19780. <dt>&lsquo;<samp>icon_title</samp>&rsquo;</dt>
  19781. <dd><p>Set the name of the iconified SDL window, if not specified it is set
  19782. to the same value of <var>window_title</var>.
  19783. </p>
  19784. </dd>
  19785. <dt>&lsquo;<samp>window_size</samp>&rsquo;</dt>
  19786. <dd><p>Set the SDL window size, can be a string of the form
  19787. <var>width</var>x<var>height</var> or a video size abbreviation.
  19788. If not specified it defaults to the size of the input video,
  19789. downscaled according to the aspect ratio.
  19790. </p>
  19791. </dd>
  19792. <dt>&lsquo;<samp>window_x</samp>&rsquo;</dt>
  19793. <dt>&lsquo;<samp>window_y</samp>&rsquo;</dt>
  19794. <dd><p>Set the position of the window on the screen.
  19795. </p>
  19796. </dd>
  19797. <dt>&lsquo;<samp>window_fullscreen</samp>&rsquo;</dt>
  19798. <dd><p>Set fullscreen mode when non-zero value is provided.
  19799. Default value is zero.
  19800. </p>
  19801. </dd>
  19802. <dt>&lsquo;<samp>window_enable_quit</samp>&rsquo;</dt>
  19803. <dd><p>Enable quit action (using window button or keyboard key)
  19804. when non-zero value is provided.
  19805. Default value is 1 (enable quit action)
  19806. </p></dd>
  19807. </dl>
  19808. <a name="Interactive-commands"></a>
  19809. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Interactive-commands">27.8.2 Interactive commands</a></h3>
  19810. <p>The window created by the device can be controlled through the
  19811. following interactive commands.
  19812. </p>
  19813. <dl compact="compact">
  19814. <dt>&lt;q, ESC&gt;</dt>
  19815. <dd><p>Quit the device immediately.
  19816. </p></dd>
  19817. </dl>
  19818. <a name="Examples-64"></a>
  19819. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-64">27.8.3 Examples</a></h3>
  19820. <p>The following command shows the <code>ffmpeg</code> output is an
  19821. SDL window, forcing its size to the qcif format:
  19822. </p><div class="example">
  19823. <pre class="example">ffmpeg -i INPUT -c:v rawvideo -pix_fmt yuv420p -window_size qcif -f sdl &quot;SDL output&quot;
  19824. </pre></div>
  19825. <a name="sndio"></a>
  19826. <h2 class="section"><a href="ffmpeg-all.html#toc-sndio">27.9 sndio</a></h2>
  19827. <p>sndio audio output device.
  19828. </p>
  19829. <a name="v4l2"></a>
  19830. <h2 class="section"><a href="ffmpeg-all.html#toc-v4l2">27.10 v4l2</a></h2>
  19831. <p>Video4Linux2 output device.
  19832. </p>
  19833. <a name="xv"></a>
  19834. <h2 class="section"><a href="ffmpeg-all.html#toc-xv">27.11 xv</a></h2>
  19835. <p>XV (XVideo) output device.
  19836. </p>
  19837. <p>This output device allows one to show a video stream in a X Window System
  19838. window.
  19839. </p>
  19840. <a name="Options-33"></a>
  19841. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-33">27.11.1 Options</a></h3>
  19842. <dl compact="compact">
  19843. <dt>&lsquo;<samp>display_name</samp>&rsquo;</dt>
  19844. <dd><p>Specify the hardware display name, which determines the display and
  19845. communications domain to be used.
  19846. </p>
  19847. <p>The display name or DISPLAY environment variable can be a string in
  19848. the format <var>hostname</var>[:<var>number</var>[.<var>screen_number</var>]].
  19849. </p>
  19850. <p><var>hostname</var> specifies the name of the host machine on which the
  19851. display is physically attached. <var>number</var> specifies the number of
  19852. the display server on that host machine. <var>screen_number</var> specifies
  19853. the screen to be used on that server.
  19854. </p>
  19855. <p>If unspecified, it defaults to the value of the DISPLAY environment
  19856. variable.
  19857. </p>
  19858. <p>For example, <code>dual-headed:0.1</code> would specify screen 1 of display
  19859. 0 on the machine named &ldquo;dual-headed&rdquo;.
  19860. </p>
  19861. <p>Check the X11 specification for more detailed information about the
  19862. display name format.
  19863. </p>
  19864. </dd>
  19865. <dt>&lsquo;<samp>window_id</samp>&rsquo;</dt>
  19866. <dd><p>When set to non-zero value then device doesn&rsquo;t create new window,
  19867. but uses existing one with provided <var>window_id</var>. By default
  19868. this options is set to zero and device creates its own window.
  19869. </p>
  19870. </dd>
  19871. <dt>&lsquo;<samp>window_size</samp>&rsquo;</dt>
  19872. <dd><p>Set the created window size, can be a string of the form
  19873. <var>width</var>x<var>height</var> or a video size abbreviation. If not
  19874. specified it defaults to the size of the input video.
  19875. Ignored when <var>window_id</var> is set.
  19876. </p>
  19877. </dd>
  19878. <dt>&lsquo;<samp>window_x</samp>&rsquo;</dt>
  19879. <dt>&lsquo;<samp>window_y</samp>&rsquo;</dt>
  19880. <dd><p>Set the X and Y window offsets for the created window. They are both
  19881. set to 0 by default. The values may be ignored by the window manager.
  19882. Ignored when <var>window_id</var> is set.
  19883. </p>
  19884. </dd>
  19885. <dt>&lsquo;<samp>window_title</samp>&rsquo;</dt>
  19886. <dd><p>Set the window title, if not specified default to the filename
  19887. specified for the output device. Ignored when <var>window_id</var> is set.
  19888. </p></dd>
  19889. </dl>
  19890. <p>For more information about XVideo see <a href="http://www.x.org/">http://www.x.org/</a>.
  19891. </p>
  19892. <a name="Examples-11"></a>
  19893. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-11">27.11.2 Examples</a></h3>
  19894. <ul>
  19895. <li>
  19896. Decode, display and encode video input with <code>ffmpeg</code> at the
  19897. same time:
  19898. <div class="example">
  19899. <pre class="example">ffmpeg -i INPUT OUTPUT -f xv display
  19900. </pre></div>
  19901. </li><li>
  19902. Decode and display the input video to multiple X11 windows:
  19903. <div class="example">
  19904. <pre class="example">ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
  19905. </pre></div>
  19906. </li></ul>
  19907. <a name="Resampler-Options"></a>
  19908. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Resampler-Options">28 Resampler Options</a></h1>
  19909. <p>The audio resampler supports the following named options.
  19910. </p>
  19911. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  19912. FFmpeg tools, <var>option</var>=<var>value</var> for the aresample filter,
  19913. by setting the value explicitly in the
  19914. <code>SwrContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API for
  19915. programmatic use.
  19916. </p>
  19917. <dl compact="compact">
  19918. <dt>&lsquo;<samp>ich, in_channel_count</samp>&rsquo;</dt>
  19919. <dd><p>Set the number of input channels. Default value is 0. Setting this
  19920. value is not mandatory if the corresponding channel layout
  19921. &lsquo;<samp>in_channel_layout</samp>&rsquo; is set.
  19922. </p>
  19923. </dd>
  19924. <dt>&lsquo;<samp>och, out_channel_count</samp>&rsquo;</dt>
  19925. <dd><p>Set the number of output channels. Default value is 0. Setting this
  19926. value is not mandatory if the corresponding channel layout
  19927. &lsquo;<samp>out_channel_layout</samp>&rsquo; is set.
  19928. </p>
  19929. </dd>
  19930. <dt>&lsquo;<samp>uch, used_channel_count</samp>&rsquo;</dt>
  19931. <dd><p>Set the number of used input channels. Default value is 0. This option is
  19932. only used for special remapping.
  19933. </p>
  19934. </dd>
  19935. <dt>&lsquo;<samp>isr, in_sample_rate</samp>&rsquo;</dt>
  19936. <dd><p>Set the input sample rate. Default value is 0.
  19937. </p>
  19938. </dd>
  19939. <dt>&lsquo;<samp>osr, out_sample_rate</samp>&rsquo;</dt>
  19940. <dd><p>Set the output sample rate. Default value is 0.
  19941. </p>
  19942. </dd>
  19943. <dt>&lsquo;<samp>isf, in_sample_fmt</samp>&rsquo;</dt>
  19944. <dd><p>Specify the input sample format. It is set by default to <code>none</code>.
  19945. </p>
  19946. </dd>
  19947. <dt>&lsquo;<samp>osf, out_sample_fmt</samp>&rsquo;</dt>
  19948. <dd><p>Specify the output sample format. It is set by default to <code>none</code>.
  19949. </p>
  19950. </dd>
  19951. <dt>&lsquo;<samp>tsf, internal_sample_fmt</samp>&rsquo;</dt>
  19952. <dd><p>Set the internal sample format. Default value is <code>none</code>.
  19953. This will automatically be chosen when it is not explicitly set.
  19954. </p>
  19955. </dd>
  19956. <dt>&lsquo;<samp>icl, in_channel_layout</samp>&rsquo;</dt>
  19957. <dt>&lsquo;<samp>ocl, out_channel_layout</samp>&rsquo;</dt>
  19958. <dd><p>Set the input/output channel layout.
  19959. </p>
  19960. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  19961. for the required syntax.
  19962. </p>
  19963. </dd>
  19964. <dt>&lsquo;<samp>clev, center_mix_level</samp>&rsquo;</dt>
  19965. <dd><p>Set the center mix level. It is a value expressed in deciBel, and must be
  19966. in the interval [-32,32].
  19967. </p>
  19968. </dd>
  19969. <dt>&lsquo;<samp>slev, surround_mix_level</samp>&rsquo;</dt>
  19970. <dd><p>Set the surround mix level. It is a value expressed in deciBel, and must
  19971. be in the interval [-32,32].
  19972. </p>
  19973. </dd>
  19974. <dt>&lsquo;<samp>lfe_mix_level</samp>&rsquo;</dt>
  19975. <dd><p>Set LFE mix into non LFE level. It is used when there is a LFE input but no
  19976. LFE output. It is a value expressed in deciBel, and must
  19977. be in the interval [-32,32].
  19978. </p>
  19979. </dd>
  19980. <dt>&lsquo;<samp>rmvol, rematrix_volume</samp>&rsquo;</dt>
  19981. <dd><p>Set rematrix volume. Default value is 1.0.
  19982. </p>
  19983. </dd>
  19984. <dt>&lsquo;<samp>rematrix_maxval</samp>&rsquo;</dt>
  19985. <dd><p>Set maximum output value for rematrixing.
  19986. This can be used to prevent clipping vs. preventing volume reduction.
  19987. A value of 1.0 prevents clipping.
  19988. </p>
  19989. </dd>
  19990. <dt>&lsquo;<samp>flags, swr_flags</samp>&rsquo;</dt>
  19991. <dd><p>Set flags used by the converter. Default value is 0.
  19992. </p>
  19993. <p>It supports the following individual flags:
  19994. </p><dl compact="compact">
  19995. <dt>&lsquo;<samp>res</samp>&rsquo;</dt>
  19996. <dd><p>force resampling, this flag forces resampling to be used even when the
  19997. input and output sample rates match.
  19998. </p></dd>
  19999. </dl>
  20000. </dd>
  20001. <dt>&lsquo;<samp>dither_scale</samp>&rsquo;</dt>
  20002. <dd><p>Set the dither scale. Default value is 1.
  20003. </p>
  20004. </dd>
  20005. <dt>&lsquo;<samp>dither_method</samp>&rsquo;</dt>
  20006. <dd><p>Set dither method. Default value is 0.
  20007. </p>
  20008. <p>Supported values:
  20009. </p><dl compact="compact">
  20010. <dt>&lsquo;<samp>rectangular</samp>&rsquo;</dt>
  20011. <dd><p>select rectangular dither
  20012. </p></dd>
  20013. <dt>&lsquo;<samp>triangular</samp>&rsquo;</dt>
  20014. <dd><p>select triangular dither
  20015. </p></dd>
  20016. <dt>&lsquo;<samp>triangular_hp</samp>&rsquo;</dt>
  20017. <dd><p>select triangular dither with high pass
  20018. </p></dd>
  20019. <dt>&lsquo;<samp>lipshitz</samp>&rsquo;</dt>
  20020. <dd><p>select Lipshitz noise shaping dither.
  20021. </p></dd>
  20022. <dt>&lsquo;<samp>shibata</samp>&rsquo;</dt>
  20023. <dd><p>select Shibata noise shaping dither.
  20024. </p></dd>
  20025. <dt>&lsquo;<samp>low_shibata</samp>&rsquo;</dt>
  20026. <dd><p>select low Shibata noise shaping dither.
  20027. </p></dd>
  20028. <dt>&lsquo;<samp>high_shibata</samp>&rsquo;</dt>
  20029. <dd><p>select high Shibata noise shaping dither.
  20030. </p></dd>
  20031. <dt>&lsquo;<samp>f_weighted</samp>&rsquo;</dt>
  20032. <dd><p>select f-weighted noise shaping dither
  20033. </p></dd>
  20034. <dt>&lsquo;<samp>modified_e_weighted</samp>&rsquo;</dt>
  20035. <dd><p>select modified-e-weighted noise shaping dither
  20036. </p></dd>
  20037. <dt>&lsquo;<samp>improved_e_weighted</samp>&rsquo;</dt>
  20038. <dd><p>select improved-e-weighted noise shaping dither
  20039. </p>
  20040. </dd>
  20041. </dl>
  20042. </dd>
  20043. <dt>&lsquo;<samp>resampler</samp>&rsquo;</dt>
  20044. <dd><p>Set resampling engine. Default value is swr.
  20045. </p>
  20046. <p>Supported values:
  20047. </p><dl compact="compact">
  20048. <dt>&lsquo;<samp>swr</samp>&rsquo;</dt>
  20049. <dd><p>select the native SW Resampler; filter options precision and cheby are not
  20050. applicable in this case.
  20051. </p></dd>
  20052. <dt>&lsquo;<samp>soxr</samp>&rsquo;</dt>
  20053. <dd><p>select the SoX Resampler (where available); compensation, and filter options
  20054. filter_size, phase_shift, exact_rational, filter_type &amp; kaiser_beta, are not
  20055. applicable in this case.
  20056. </p></dd>
  20057. </dl>
  20058. </dd>
  20059. <dt>&lsquo;<samp>filter_size</samp>&rsquo;</dt>
  20060. <dd><p>For swr only, set resampling filter size, default value is 32.
  20061. </p>
  20062. </dd>
  20063. <dt>&lsquo;<samp>phase_shift</samp>&rsquo;</dt>
  20064. <dd><p>For swr only, set resampling phase shift, default value is 10, and must be in
  20065. the interval [0,30].
  20066. </p>
  20067. </dd>
  20068. <dt>&lsquo;<samp>linear_interp</samp>&rsquo;</dt>
  20069. <dd><p>Use linear interpolation when enabled (the default). Disable it if you want
  20070. to preserve speed instead of quality when exact_rational fails.
  20071. </p>
  20072. </dd>
  20073. <dt>&lsquo;<samp>exact_rational</samp>&rsquo;</dt>
  20074. <dd><p>For swr only, when enabled, try to use exact phase_count based on input and
  20075. output sample rate. However, if it is larger than <code>1 &lt;&lt; phase_shift</code>,
  20076. the phase_count will be <code>1 &lt;&lt; phase_shift</code> as fallback. Default is enabled.
  20077. </p>
  20078. </dd>
  20079. <dt>&lsquo;<samp>cutoff</samp>&rsquo;</dt>
  20080. <dd><p>Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
  20081. value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
  20082. (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
  20083. </p>
  20084. </dd>
  20085. <dt>&lsquo;<samp>precision</samp>&rsquo;</dt>
  20086. <dd><p>For soxr only, the precision in bits to which the resampled signal will be
  20087. calculated. The default value of 20 (which, with suitable dithering, is
  20088. appropriate for a destination bit-depth of 16) gives SoX&rsquo;s &rsquo;High Quality&rsquo;; a
  20089. value of 28 gives SoX&rsquo;s &rsquo;Very High Quality&rsquo;.
  20090. </p>
  20091. </dd>
  20092. <dt>&lsquo;<samp>cheby</samp>&rsquo;</dt>
  20093. <dd><p>For soxr only, selects passband rolloff none (Chebyshev) &amp; higher-precision
  20094. approximation for &rsquo;irrational&rsquo; ratios. Default value is 0.
  20095. </p>
  20096. </dd>
  20097. <dt>&lsquo;<samp>async</samp>&rsquo;</dt>
  20098. <dd><p>For swr only, simple 1 parameter audio sync to timestamps using stretching,
  20099. squeezing, filling and trimming. Setting this to 1 will enable filling and
  20100. trimming, larger values represent the maximum amount in samples that the data
  20101. may be stretched or squeezed for each second.
  20102. Default value is 0, thus no compensation is applied to make the samples match
  20103. the audio timestamps.
  20104. </p>
  20105. </dd>
  20106. <dt>&lsquo;<samp>first_pts</samp>&rsquo;</dt>
  20107. <dd><p>For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
  20108. This allows for padding/trimming at the start of stream. By default, no
  20109. assumption is made about the first frame&rsquo;s expected pts, so no padding or
  20110. trimming is done. For example, this could be set to 0 to pad the beginning with
  20111. silence if an audio stream starts after the video stream or to trim any samples
  20112. with a negative pts due to encoder delay.
  20113. </p>
  20114. </dd>
  20115. <dt>&lsquo;<samp>min_comp</samp>&rsquo;</dt>
  20116. <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
  20117. seconds) to trigger stretching/squeezing/filling or trimming of the
  20118. data to make it match the timestamps. The default is that
  20119. stretching/squeezing/filling and trimming is disabled
  20120. (&lsquo;<samp>min_comp</samp>&rsquo; = <code>FLT_MAX</code>).
  20121. </p>
  20122. </dd>
  20123. <dt>&lsquo;<samp>min_hard_comp</samp>&rsquo;</dt>
  20124. <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
  20125. seconds) to trigger adding/dropping samples to make it match the
  20126. timestamps. This option effectively is a threshold to select between
  20127. hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
  20128. all compensation is by default disabled through &lsquo;<samp>min_comp</samp>&rsquo;.
  20129. The default is 0.1.
  20130. </p>
  20131. </dd>
  20132. <dt>&lsquo;<samp>comp_duration</samp>&rsquo;</dt>
  20133. <dd><p>For swr only, set duration (in seconds) over which data is stretched/squeezed
  20134. to make it match the timestamps. Must be a non-negative double float value,
  20135. default value is 1.0.
  20136. </p>
  20137. </dd>
  20138. <dt>&lsquo;<samp>max_soft_comp</samp>&rsquo;</dt>
  20139. <dd><p>For swr only, set maximum factor by which data is stretched/squeezed to make it
  20140. match the timestamps. Must be a non-negative double float value, default value
  20141. is 0.
  20142. </p>
  20143. </dd>
  20144. <dt>&lsquo;<samp>matrix_encoding</samp>&rsquo;</dt>
  20145. <dd><p>Select matrixed stereo encoding.
  20146. </p>
  20147. <p>It accepts the following values:
  20148. </p><dl compact="compact">
  20149. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  20150. <dd><p>select none
  20151. </p></dd>
  20152. <dt>&lsquo;<samp>dolby</samp>&rsquo;</dt>
  20153. <dd><p>select Dolby
  20154. </p></dd>
  20155. <dt>&lsquo;<samp>dplii</samp>&rsquo;</dt>
  20156. <dd><p>select Dolby Pro Logic II
  20157. </p></dd>
  20158. </dl>
  20159. <p>Default value is <code>none</code>.
  20160. </p>
  20161. </dd>
  20162. <dt>&lsquo;<samp>filter_type</samp>&rsquo;</dt>
  20163. <dd><p>For swr only, select resampling filter type. This only affects resampling
  20164. operations.
  20165. </p>
  20166. <p>It accepts the following values:
  20167. </p><dl compact="compact">
  20168. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  20169. <dd><p>select cubic
  20170. </p></dd>
  20171. <dt>&lsquo;<samp>blackman_nuttall</samp>&rsquo;</dt>
  20172. <dd><p>select Blackman Nuttall windowed sinc
  20173. </p></dd>
  20174. <dt>&lsquo;<samp>kaiser</samp>&rsquo;</dt>
  20175. <dd><p>select Kaiser windowed sinc
  20176. </p></dd>
  20177. </dl>
  20178. </dd>
  20179. <dt>&lsquo;<samp>kaiser_beta</samp>&rsquo;</dt>
  20180. <dd><p>For swr only, set Kaiser window beta value. Must be a double float value in the
  20181. interval [2,16], default value is 9.
  20182. </p>
  20183. </dd>
  20184. <dt>&lsquo;<samp>output_sample_bits</samp>&rsquo;</dt>
  20185. <dd><p>For swr only, set number of used output sample bits for dithering. Must be an integer in the
  20186. interval [0,64], default value is 0, which means it&rsquo;s not used.
  20187. </p>
  20188. </dd>
  20189. </dl>
  20190. <p><a name="scaler_005foptions"></a>
  20191. </p><a name="Scaler-Options"></a>
  20192. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Scaler-Options">29 Scaler Options</a></h1>
  20193. <p>The video scaler supports the following named options.
  20194. </p>
  20195. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  20196. FFmpeg tools, with a few API-only exceptions noted below.
  20197. For programmatic use, they can be set explicitly in the
  20198. <code>SwsContext</code> options or through the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API.
  20199. </p>
  20200. <dl compact="compact">
  20201. <dd>
  20202. <p><a name="sws_005fflags"></a>
  20203. </p></dd>
  20204. <dt>&lsquo;<samp>sws_flags</samp>&rsquo;</dt>
  20205. <dd><p>Set the scaler flags. This is also used to set the scaling
  20206. algorithm. Only a single algorithm should be selected. Default
  20207. value is &lsquo;<samp>bicubic</samp>&rsquo;.
  20208. </p>
  20209. <p>It accepts the following values:
  20210. </p><dl compact="compact">
  20211. <dt>&lsquo;<samp>fast_bilinear</samp>&rsquo;</dt>
  20212. <dd><p>Select fast bilinear scaling algorithm.
  20213. </p>
  20214. </dd>
  20215. <dt>&lsquo;<samp>bilinear</samp>&rsquo;</dt>
  20216. <dd><p>Select bilinear scaling algorithm.
  20217. </p>
  20218. </dd>
  20219. <dt>&lsquo;<samp>bicubic</samp>&rsquo;</dt>
  20220. <dd><p>Select bicubic scaling algorithm.
  20221. </p>
  20222. </dd>
  20223. <dt>&lsquo;<samp>experimental</samp>&rsquo;</dt>
  20224. <dd><p>Select experimental scaling algorithm.
  20225. </p>
  20226. </dd>
  20227. <dt>&lsquo;<samp>neighbor</samp>&rsquo;</dt>
  20228. <dd><p>Select nearest neighbor rescaling algorithm.
  20229. </p>
  20230. </dd>
  20231. <dt>&lsquo;<samp>area</samp>&rsquo;</dt>
  20232. <dd><p>Select averaging area rescaling algorithm.
  20233. </p>
  20234. </dd>
  20235. <dt>&lsquo;<samp>bicublin</samp>&rsquo;</dt>
  20236. <dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
  20237. chroma components.
  20238. </p>
  20239. </dd>
  20240. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  20241. <dd><p>Select Gaussian rescaling algorithm.
  20242. </p>
  20243. </dd>
  20244. <dt>&lsquo;<samp>sinc</samp>&rsquo;</dt>
  20245. <dd><p>Select sinc rescaling algorithm.
  20246. </p>
  20247. </dd>
  20248. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  20249. <dd><p>Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be
  20250. changed by setting <code>param0</code>.
  20251. </p>
  20252. </dd>
  20253. <dt>&lsquo;<samp>spline</samp>&rsquo;</dt>
  20254. <dd><p>Select natural bicubic spline rescaling algorithm.
  20255. </p>
  20256. </dd>
  20257. <dt>&lsquo;<samp>print_info</samp>&rsquo;</dt>
  20258. <dd><p>Enable printing/debug logging.
  20259. </p>
  20260. </dd>
  20261. <dt>&lsquo;<samp>accurate_rnd</samp>&rsquo;</dt>
  20262. <dd><p>Enable accurate rounding.
  20263. </p>
  20264. </dd>
  20265. <dt>&lsquo;<samp>full_chroma_int</samp>&rsquo;</dt>
  20266. <dd><p>Enable full chroma interpolation.
  20267. </p>
  20268. </dd>
  20269. <dt>&lsquo;<samp>full_chroma_inp</samp>&rsquo;</dt>
  20270. <dd><p>Select full chroma input.
  20271. </p>
  20272. </dd>
  20273. <dt>&lsquo;<samp>bitexact</samp>&rsquo;</dt>
  20274. <dd><p>Enable bitexact output.
  20275. </p></dd>
  20276. </dl>
  20277. </dd>
  20278. <dt>&lsquo;<samp>srcw <var>(API only)</var></samp>&rsquo;</dt>
  20279. <dd><p>Set source width.
  20280. </p>
  20281. </dd>
  20282. <dt>&lsquo;<samp>srch <var>(API only)</var></samp>&rsquo;</dt>
  20283. <dd><p>Set source height.
  20284. </p>
  20285. </dd>
  20286. <dt>&lsquo;<samp>dstw <var>(API only)</var></samp>&rsquo;</dt>
  20287. <dd><p>Set destination width.
  20288. </p>
  20289. </dd>
  20290. <dt>&lsquo;<samp>dsth <var>(API only)</var></samp>&rsquo;</dt>
  20291. <dd><p>Set destination height.
  20292. </p>
  20293. </dd>
  20294. <dt>&lsquo;<samp>src_format <var>(API only)</var></samp>&rsquo;</dt>
  20295. <dd><p>Set source pixel format (must be expressed as an integer).
  20296. </p>
  20297. </dd>
  20298. <dt>&lsquo;<samp>dst_format <var>(API only)</var></samp>&rsquo;</dt>
  20299. <dd><p>Set destination pixel format (must be expressed as an integer).
  20300. </p>
  20301. </dd>
  20302. <dt>&lsquo;<samp>src_range <var>(boolean)</var></samp>&rsquo;</dt>
  20303. <dd><p>If value is set to <code>1</code>, indicates source is full range. Default value is
  20304. <code>0</code>, which indicates source is limited range.
  20305. </p>
  20306. </dd>
  20307. <dt>&lsquo;<samp>dst_range <var>(boolean)</var></samp>&rsquo;</dt>
  20308. <dd><p>If value is set to <code>1</code>, enable full range for destination. Default value
  20309. is <code>0</code>, which enables limited range.
  20310. </p>
  20311. <p><a name="sws_005fparams"></a>
  20312. </p></dd>
  20313. <dt>&lsquo;<samp>param0, param1</samp>&rsquo;</dt>
  20314. <dd><p>Set scaling algorithm parameters. The specified values are specific of
  20315. some scaling algorithms and ignored by others. The specified values
  20316. are floating point number values.
  20317. </p>
  20318. </dd>
  20319. <dt>&lsquo;<samp>sws_dither</samp>&rsquo;</dt>
  20320. <dd><p>Set the dithering algorithm. Accepts one of the following
  20321. values. Default value is &lsquo;<samp>auto</samp>&rsquo;.
  20322. </p>
  20323. <dl compact="compact">
  20324. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  20325. <dd><p>automatic choice
  20326. </p>
  20327. </dd>
  20328. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  20329. <dd><p>no dithering
  20330. </p>
  20331. </dd>
  20332. <dt>&lsquo;<samp>bayer</samp>&rsquo;</dt>
  20333. <dd><p>bayer dither
  20334. </p>
  20335. </dd>
  20336. <dt>&lsquo;<samp>ed</samp>&rsquo;</dt>
  20337. <dd><p>error diffusion dither
  20338. </p>
  20339. </dd>
  20340. <dt>&lsquo;<samp>a_dither</samp>&rsquo;</dt>
  20341. <dd><p>arithmetic dither, based using addition
  20342. </p>
  20343. </dd>
  20344. <dt>&lsquo;<samp>x_dither</samp>&rsquo;</dt>
  20345. <dd><p>arithmetic dither, based using xor (more random/less apparent patterning that
  20346. a_dither).
  20347. </p>
  20348. </dd>
  20349. </dl>
  20350. </dd>
  20351. <dt>&lsquo;<samp>alphablend</samp>&rsquo;</dt>
  20352. <dd><p>Set the alpha blending to use when the input has alpha but the output does not.
  20353. Default value is &lsquo;<samp>none</samp>&rsquo;.
  20354. </p>
  20355. <dl compact="compact">
  20356. <dt>&lsquo;<samp>uniform_color</samp>&rsquo;</dt>
  20357. <dd><p>Blend onto a uniform background color
  20358. </p>
  20359. </dd>
  20360. <dt>&lsquo;<samp>checkerboard</samp>&rsquo;</dt>
  20361. <dd><p>Blend onto a checkerboard
  20362. </p>
  20363. </dd>
  20364. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  20365. <dd><p>No blending
  20366. </p>
  20367. </dd>
  20368. </dl>
  20369. </dd>
  20370. </dl>
  20371. <a name="Filtering-Introduction"></a>
  20372. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Filtering-Introduction">30 Filtering Introduction</a></h1>
  20373. <p>Filtering in FFmpeg is enabled through the libavfilter library.
  20374. </p>
  20375. <p>In libavfilter, a filter can have multiple inputs and multiple
  20376. outputs.
  20377. To illustrate the sorts of things that are possible, we consider the
  20378. following filtergraph.
  20379. </p>
  20380. <pre class="verbatim"> [main]
  20381. input --&gt; split ---------------------&gt; overlay --&gt; output
  20382. | ^
  20383. |[tmp] [flip]|
  20384. +-----&gt; crop --&gt; vflip -------+
  20385. </pre>
  20386. <p>This filtergraph splits the input stream in two streams, then sends one
  20387. stream through the crop filter and the vflip filter, before merging it
  20388. back with the other stream by overlaying it on top. You can use the
  20389. following command to achieve this:
  20390. </p>
  20391. <div class="example">
  20392. <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
  20393. </pre></div>
  20394. <p>The result will be that the top half of the video is mirrored
  20395. onto the bottom half of the output video.
  20396. </p>
  20397. <p>Filters in the same linear chain are separated by commas, and distinct
  20398. linear chains of filters are separated by semicolons. In our example,
  20399. <var>crop,vflip</var> are in one linear chain, <var>split</var> and
  20400. <var>overlay</var> are separately in another. The points where the linear
  20401. chains join are labelled by names enclosed in square brackets. In the
  20402. example, the split filter generates two outputs that are associated to
  20403. the labels <var>[main]</var> and <var>[tmp]</var>.
  20404. </p>
  20405. <p>The stream sent to the second output of <var>split</var>, labelled as
  20406. <var>[tmp]</var>, is processed through the <var>crop</var> filter, which crops
  20407. away the lower half part of the video, and then vertically flipped. The
  20408. <var>overlay</var> filter takes in input the first unchanged output of the
  20409. split filter (which was labelled as <var>[main]</var>), and overlay on its
  20410. lower half the output generated by the <var>crop,vflip</var> filterchain.
  20411. </p>
  20412. <p>Some filters take in input a list of parameters: they are specified
  20413. after the filter name and an equal sign, and are separated from each other
  20414. by a colon.
  20415. </p>
  20416. <p>There exist so-called <var>source filters</var> that do not have an
  20417. audio/video input, and <var>sink filters</var> that will not have audio/video
  20418. output.
  20419. </p>
  20420. <a name="graph2dot"></a>
  20421. <h1 class="chapter"><a href="ffmpeg-all.html#toc-graph2dot">31 graph2dot</a></h1>
  20422. <p>The &lsquo;<tt>graph2dot</tt>&rsquo; program included in the FFmpeg &lsquo;<tt>tools</tt>&rsquo;
  20423. directory can be used to parse a filtergraph description and issue a
  20424. corresponding textual representation in the dot language.
  20425. </p>
  20426. <p>Invoke the command:
  20427. </p><div class="example">
  20428. <pre class="example">graph2dot -h
  20429. </pre></div>
  20430. <p>to see how to use &lsquo;<tt>graph2dot</tt>&rsquo;.
  20431. </p>
  20432. <p>You can then pass the dot description to the &lsquo;<tt>dot</tt>&rsquo; program (from
  20433. the graphviz suite of programs) and obtain a graphical representation
  20434. of the filtergraph.
  20435. </p>
  20436. <p>For example the sequence of commands:
  20437. </p><div class="example">
  20438. <pre class="example">echo <var>GRAPH_DESCRIPTION</var> | \
  20439. tools/graph2dot -o graph.tmp &amp;&amp; \
  20440. dot -Tpng graph.tmp -o graph.png &amp;&amp; \
  20441. display graph.png
  20442. </pre></div>
  20443. <p>can be used to create and display an image representing the graph
  20444. described by the <var>GRAPH_DESCRIPTION</var> string. Note that this string must be
  20445. a complete self-contained graph, with its inputs and outputs explicitly defined.
  20446. For example if your command line is of the form:
  20447. </p><div class="example">
  20448. <pre class="example">ffmpeg -i infile -vf scale=640:360 outfile
  20449. </pre></div>
  20450. <p>your <var>GRAPH_DESCRIPTION</var> string will need to be of the form:
  20451. </p><div class="example">
  20452. <pre class="example">nullsrc,scale=640:360,nullsink
  20453. </pre></div>
  20454. <p>you may also need to set the <var>nullsrc</var> parameters and add a <var>format</var>
  20455. filter in order to simulate a specific input file.
  20456. </p>
  20457. <a name="Filtergraph-description"></a>
  20458. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Filtergraph-description">32 Filtergraph description</a></h1>
  20459. <p>A filtergraph is a directed graph of connected filters. It can contain
  20460. cycles, and there can be multiple links between a pair of
  20461. filters. Each link has one input pad on one side connecting it to one
  20462. filter from which it takes its input, and one output pad on the other
  20463. side connecting it to one filter accepting its output.
  20464. </p>
  20465. <p>Each filter in a filtergraph is an instance of a filter class
  20466. registered in the application, which defines the features and the
  20467. number of input and output pads of the filter.
  20468. </p>
  20469. <p>A filter with no input pads is called a &quot;source&quot;, and a filter with no
  20470. output pads is called a &quot;sink&quot;.
  20471. </p>
  20472. <p><a name="Filtergraph-syntax"></a>
  20473. </p><a name="Filtergraph-syntax-1"></a>
  20474. <h2 class="section"><a href="ffmpeg-all.html#toc-Filtergraph-syntax-1">32.1 Filtergraph syntax</a></h2>
  20475. <p>A filtergraph has a textual representation, which is recognized by the
  20476. &lsquo;<samp>-filter</samp>&rsquo;/&lsquo;<samp>-vf</samp>&rsquo;/&lsquo;<samp>-af</samp>&rsquo; and
  20477. &lsquo;<samp>-filter_complex</samp>&rsquo; options in <code>ffmpeg</code> and
  20478. &lsquo;<samp>-vf</samp>&rsquo;/&lsquo;<samp>-af</samp>&rsquo; in <code>ffplay</code>, and by the
  20479. <code>avfilter_graph_parse_ptr()</code> function defined in
  20480. &lsquo;<tt>libavfilter/avfilter.h</tt>&rsquo;.
  20481. </p>
  20482. <p>A filterchain consists of a sequence of connected filters, each one
  20483. connected to the previous one in the sequence. A filterchain is
  20484. represented by a list of &quot;,&quot;-separated filter descriptions.
  20485. </p>
  20486. <p>A filtergraph consists of a sequence of filterchains. A sequence of
  20487. filterchains is represented by a list of &quot;;&quot;-separated filterchain
  20488. descriptions.
  20489. </p>
  20490. <p>A filter is represented by a string of the form:
  20491. [<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>]
  20492. </p>
  20493. <p><var>filter_name</var> is the name of the filter class of which the
  20494. described filter is an instance of, and has to be the name of one of
  20495. the filter classes registered in the program optionally followed by &quot;@<var>id</var>&quot;.
  20496. The name of the filter class is optionally followed by a string
  20497. &quot;=<var>arguments</var>&quot;.
  20498. </p>
  20499. <p><var>arguments</var> is a string which contains the parameters used to
  20500. initialize the filter instance. It may have one of two forms:
  20501. </p><ul>
  20502. <li>
  20503. A &rsquo;:&rsquo;-separated list of <var>key=value</var> pairs.
  20504. </li><li>
  20505. A &rsquo;:&rsquo;-separated list of <var>value</var>. In this case, the keys are assumed to be
  20506. the option names in the order they are declared. E.g. the <code>fade</code> filter
  20507. declares three options in this order &ndash; &lsquo;<samp>type</samp>&rsquo;, &lsquo;<samp>start_frame</samp>&rsquo; and
  20508. &lsquo;<samp>nb_frames</samp>&rsquo;. Then the parameter list <var>in:0:30</var> means that the value
  20509. <var>in</var> is assigned to the option &lsquo;<samp>type</samp>&rsquo;, <var>0</var> to
  20510. &lsquo;<samp>start_frame</samp>&rsquo; and <var>30</var> to &lsquo;<samp>nb_frames</samp>&rsquo;.
  20511. </li><li>
  20512. A &rsquo;:&rsquo;-separated list of mixed direct <var>value</var> and long <var>key=value</var>
  20513. pairs. The direct <var>value</var> must precede the <var>key=value</var> pairs, and
  20514. follow the same constraints order of the previous point. The following
  20515. <var>key=value</var> pairs can be set in any preferred order.
  20516. </li></ul>
  20517. <p>If the option value itself is a list of items (e.g. the <code>format</code> filter
  20518. takes a list of pixel formats), the items in the list are usually separated by
  20519. &lsquo;<samp>|</samp>&rsquo;.
  20520. </p>
  20521. <p>The list of arguments can be quoted using the character &lsquo;<samp>'</samp>&rsquo; as initial
  20522. and ending mark, and the character &lsquo;<samp>\</samp>&rsquo; for escaping the characters
  20523. within the quoted text; otherwise the argument string is considered
  20524. terminated when the next special character (belonging to the set
  20525. &lsquo;<samp>[]=;,</samp>&rsquo;) is encountered.
  20526. </p>
  20527. <p>The name and arguments of the filter are optionally preceded and
  20528. followed by a list of link labels.
  20529. A link label allows one to name a link and associate it to a filter output
  20530. or input pad. The preceding labels <var>in_link_1</var>
  20531. ... <var>in_link_N</var>, are associated to the filter input pads,
  20532. the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
  20533. associated to the output pads.
  20534. </p>
  20535. <p>When two link labels with the same name are found in the
  20536. filtergraph, a link between the corresponding input and output pad is
  20537. created.
  20538. </p>
  20539. <p>If an output pad is not labelled, it is linked by default to the first
  20540. unlabelled input pad of the next filter in the filterchain.
  20541. For example in the filterchain
  20542. </p><div class="example">
  20543. <pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
  20544. </pre></div>
  20545. <p>the split filter instance has two output pads, and the overlay filter
  20546. instance two input pads. The first output pad of split is labelled
  20547. &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
  20548. output pad of split is linked to the second input pad of overlay,
  20549. which are both unlabelled.
  20550. </p>
  20551. <p>In a filter description, if the input label of the first filter is not
  20552. specified, &quot;in&quot; is assumed; if the output label of the last filter is not
  20553. specified, &quot;out&quot; is assumed.
  20554. </p>
  20555. <p>In a complete filterchain all the unlabelled filter input and output
  20556. pads must be connected. A filtergraph is considered valid if all the
  20557. filter input and output pads of all the filterchains are connected.
  20558. </p>
  20559. <p>Libavfilter will automatically insert <a href="#scale">scale</a> filters where format
  20560. conversion is required. It is possible to specify swscale flags
  20561. for those automatically inserted scalers by prepending
  20562. <code>sws_flags=<var>flags</var>;</code>
  20563. to the filtergraph description.
  20564. </p>
  20565. <p>Here is a BNF description of the filtergraph syntax:
  20566. </p><div class="example">
  20567. <pre class="example"><var>NAME</var> ::= sequence of alphanumeric characters and '_'
  20568. <var>FILTER_NAME</var> ::= <var>NAME</var>[&quot;@&quot;<var>NAME</var>]
  20569. <var>LINKLABEL</var> ::= &quot;[&quot; <var>NAME</var> &quot;]&quot;
  20570. <var>LINKLABELS</var> ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
  20571. <var>FILTER_ARGUMENTS</var> ::= sequence of chars (possibly quoted)
  20572. <var>FILTER</var> ::= [<var>LINKLABELS</var>] <var>FILTER_NAME</var> [&quot;=&quot; <var>FILTER_ARGUMENTS</var>] [<var>LINKLABELS</var>]
  20573. <var>FILTERCHAIN</var> ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
  20574. <var>FILTERGRAPH</var> ::= [sws_flags=<var>flags</var>;] <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
  20575. </pre></div>
  20576. <p><a name="filtergraph-escaping"></a>
  20577. </p><a name="Notes-on-filtergraph-escaping"></a>
  20578. <h2 class="section"><a href="ffmpeg-all.html#toc-Notes-on-filtergraph-escaping">32.2 Notes on filtergraph escaping</a></h2>
  20579. <p>Filtergraph description composition entails several levels of
  20580. escaping. See <a href="ffmpeg-utils.html#quoting_005fand_005fescaping">(ffmpeg-utils)the &quot;Quoting and escaping&quot; section in the ffmpeg-utils(1) manual</a> for more
  20581. information about the employed escaping procedure.
  20582. </p>
  20583. <p>A first level escaping affects the content of each filter option
  20584. value, which may contain the special character <code>:</code> used to
  20585. separate values, or one of the escaping characters <code>\'</code>.
  20586. </p>
  20587. <p>A second level escaping affects the whole filter description, which
  20588. may contain the escaping characters <code>\'</code> or the special
  20589. characters <code>[],;</code> used by the filtergraph description.
  20590. </p>
  20591. <p>Finally, when you specify a filtergraph on a shell commandline, you
  20592. need to perform a third level escaping for the shell special
  20593. characters contained within it.
  20594. </p>
  20595. <p>For example, consider the following string to be embedded in
  20596. the <a href="#drawtext">drawtext</a> filter description &lsquo;<samp>text</samp>&rsquo; value:
  20597. </p><div class="example">
  20598. <pre class="example">this is a 'string': may contain one, or more, special characters
  20599. </pre></div>
  20600. <p>This string contains the <code>'</code> special escaping character, and the
  20601. <code>:</code> special character, so it needs to be escaped in this way:
  20602. </p><div class="example">
  20603. <pre class="example">text=this is a \'string\'\: may contain one, or more, special characters
  20604. </pre></div>
  20605. <p>A second level of escaping is required when embedding the filter
  20606. description in a filtergraph description, in order to escape all the
  20607. filtergraph special characters. Thus the example above becomes:
  20608. </p><div class="example">
  20609. <pre class="example">drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
  20610. </pre></div>
  20611. <p>(note that in addition to the <code>\'</code> escaping special characters,
  20612. also <code>,</code> needs to be escaped).
  20613. </p>
  20614. <p>Finally an additional level of escaping is needed when writing the
  20615. filtergraph description in a shell command, which depends on the
  20616. escaping rules of the adopted shell. For example, assuming that
  20617. <code>\</code> is special and needs to be escaped with another <code>\</code>, the
  20618. previous string will finally result in:
  20619. </p><div class="example">
  20620. <pre class="example">-vf &quot;drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters&quot;
  20621. </pre></div>
  20622. <a name="Timeline-editing"></a>
  20623. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Timeline-editing">33 Timeline editing</a></h1>
  20624. <p>Some filters support a generic &lsquo;<samp>enable</samp>&rsquo; option. For the filters
  20625. supporting timeline editing, this option can be set to an expression which is
  20626. evaluated before sending a frame to the filter. If the evaluation is non-zero,
  20627. the filter will be enabled, otherwise the frame will be sent unchanged to the
  20628. next filter in the filtergraph.
  20629. </p>
  20630. <p>The expression accepts the following values:
  20631. </p><dl compact="compact">
  20632. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  20633. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  20634. </p>
  20635. </dd>
  20636. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  20637. <dd><p>sequential number of the input frame, starting from 0
  20638. </p>
  20639. </dd>
  20640. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  20641. <dd><p>the position in the file of the input frame, NAN if unknown
  20642. </p>
  20643. </dd>
  20644. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  20645. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  20646. <dd><p>width and height of the input frame if video
  20647. </p></dd>
  20648. </dl>
  20649. <p>Additionally, these filters support an &lsquo;<samp>enable</samp>&rsquo; command that can be used
  20650. to re-define the expression.
  20651. </p>
  20652. <p>Like any other filtering option, the &lsquo;<samp>enable</samp>&rsquo; option follows the same
  20653. rules.
  20654. </p>
  20655. <p>For example, to enable a blur filter (<a href="#smartblur">smartblur</a>) from 10 seconds to 3
  20656. minutes, and a <a href="#curves">curves</a> filter starting at 3 seconds:
  20657. </p><div class="example">
  20658. <pre class="example">smartblur = enable='between(t,10,3*60)',
  20659. curves = enable='gte(t,3)' : preset=cross_process
  20660. </pre></div>
  20661. <p>See <code>ffmpeg -filters</code> to view which filters have timeline support.
  20662. </p>
  20663. <p><a name="commands"></a>
  20664. </p><a name="Changing-options-at-runtime-with-a-command"></a>
  20665. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Changing-options-at-runtime-with-a-command">34 Changing options at runtime with a command</a></h1>
  20666. <p>Some options can be changed during the operation of the filter using
  20667. a command. These options are marked &rsquo;T&rsquo; on the output of
  20668. <code>ffmpeg</code> &lsquo;<samp>-h filter=&lt;name of filter&gt;</samp>&rsquo;.
  20669. The name of the command is the name of the option and the argument is
  20670. the new value.
  20671. </p>
  20672. <p><a name="framesync"></a>
  20673. </p><a name="Options-for-filters-with-several-inputs-_0028framesync_0029"></a>
  20674. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Options-for-filters-with-several-inputs-_0028framesync_0029">35 Options for filters with several inputs (framesync)</a></h1>
  20675. <p>Some filters with several inputs support a common set of options.
  20676. These options can only be set by name, not with the short notation.
  20677. </p>
  20678. <dl compact="compact">
  20679. <dt>&lsquo;<samp>eof_action</samp>&rsquo;</dt>
  20680. <dd><p>The action to take when EOF is encountered on the secondary input; it accepts
  20681. one of the following values:
  20682. </p>
  20683. <dl compact="compact">
  20684. <dt>&lsquo;<samp>repeat</samp>&rsquo;</dt>
  20685. <dd><p>Repeat the last frame (the default).
  20686. </p></dd>
  20687. <dt>&lsquo;<samp>endall</samp>&rsquo;</dt>
  20688. <dd><p>End both streams.
  20689. </p></dd>
  20690. <dt>&lsquo;<samp>pass</samp>&rsquo;</dt>
  20691. <dd><p>Pass the main input through.
  20692. </p></dd>
  20693. </dl>
  20694. </dd>
  20695. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  20696. <dd><p>If set to 1, force the output to terminate when the shortest input
  20697. terminates. Default value is 0.
  20698. </p>
  20699. </dd>
  20700. <dt>&lsquo;<samp>repeatlast</samp>&rsquo;</dt>
  20701. <dd><p>If set to 1, force the filter to extend the last frame of secondary streams
  20702. until the end of the primary stream. A value of 0 disables this behavior.
  20703. Default value is 1.
  20704. </p></dd>
  20705. </dl>
  20706. <a name="Audio-Filters"></a>
  20707. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Audio-Filters">36 Audio Filters</a></h1>
  20708. <p>When you configure your FFmpeg build, you can disable any of the
  20709. existing filters using <code>--disable-filters</code>.
  20710. The configure output will show the audio filters included in your
  20711. build.
  20712. </p>
  20713. <p>Below is a description of the currently available audio filters.
  20714. </p>
  20715. <a name="acompressor"></a>
  20716. <h2 class="section"><a href="ffmpeg-all.html#toc-acompressor">36.1 acompressor</a></h2>
  20717. <p>A compressor is mainly used to reduce the dynamic range of a signal.
  20718. Especially modern music is mostly compressed at a high ratio to
  20719. improve the overall loudness. It&rsquo;s done to get the highest attention
  20720. of a listener, &quot;fatten&quot; the sound and bring more &quot;power&quot; to the track.
  20721. If a signal is compressed too much it may sound dull or &quot;dead&quot;
  20722. afterwards or it may start to &quot;pump&quot; (which could be a powerful effect
  20723. but can also destroy a track completely).
  20724. The right compression is the key to reach a professional sound and is
  20725. the high art of mixing and mastering. Because of its complex settings
  20726. it may take a long time to get the right feeling for this kind of effect.
  20727. </p>
  20728. <p>Compression is done by detecting the volume above a chosen level
  20729. <code>threshold</code> and dividing it by the factor set with <code>ratio</code>.
  20730. So if you set the threshold to -12dB and your signal reaches -6dB a ratio
  20731. of 2:1 will result in a signal at -9dB. Because an exact manipulation of
  20732. the signal would cause distortion of the waveform the reduction can be
  20733. levelled over the time. This is done by setting &quot;Attack&quot; and &quot;Release&quot;.
  20734. <code>attack</code> determines how long the signal has to rise above the threshold
  20735. before any reduction will occur and <code>release</code> sets the time the signal
  20736. has to fall below the threshold to reduce the reduction again. Shorter signals
  20737. than the chosen attack time will be left untouched.
  20738. The overall reduction of the signal can be made up afterwards with the
  20739. <code>makeup</code> setting. So compressing the peaks of a signal about 6dB and
  20740. raising the makeup to this level results in a signal twice as loud than the
  20741. source. To gain a softer entry in the compression the <code>knee</code> flattens the
  20742. hard edge at the threshold in the range of the chosen decibels.
  20743. </p>
  20744. <p>The filter accepts the following options:
  20745. </p>
  20746. <dl compact="compact">
  20747. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  20748. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  20749. </p>
  20750. </dd>
  20751. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  20752. <dd><p>Set mode of compressor operation. Can be <code>upward</code> or <code>downward</code>.
  20753. Default is <code>downward</code>.
  20754. </p>
  20755. </dd>
  20756. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  20757. <dd><p>If a signal of stream rises above this level it will affect the gain
  20758. reduction.
  20759. By default it is 0.125. Range is between 0.00097563 and 1.
  20760. </p>
  20761. </dd>
  20762. <dt>&lsquo;<samp>ratio</samp>&rsquo;</dt>
  20763. <dd><p>Set a ratio by which the signal is reduced. 1:2 means that if the level
  20764. rose 4dB above the threshold, it will be only 2dB above after the reduction.
  20765. Default is 2. Range is between 1 and 20.
  20766. </p>
  20767. </dd>
  20768. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  20769. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  20770. reduction starts. Default is 20. Range is between 0.01 and 2000.
  20771. </p>
  20772. </dd>
  20773. <dt>&lsquo;<samp>release</samp>&rsquo;</dt>
  20774. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  20775. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  20776. </p>
  20777. </dd>
  20778. <dt>&lsquo;<samp>makeup</samp>&rsquo;</dt>
  20779. <dd><p>Set the amount by how much signal will be amplified after processing.
  20780. Default is 1. Range is from 1 to 64.
  20781. </p>
  20782. </dd>
  20783. <dt>&lsquo;<samp>knee</samp>&rsquo;</dt>
  20784. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  20785. Default is 2.82843. Range is between 1 and 8.
  20786. </p>
  20787. </dd>
  20788. <dt>&lsquo;<samp>link</samp>&rsquo;</dt>
  20789. <dd><p>Choose if the <code>average</code> level between all channels of input stream
  20790. or the louder(<code>maximum</code>) channel of input stream affects the
  20791. reduction. Default is <code>average</code>.
  20792. </p>
  20793. </dd>
  20794. <dt>&lsquo;<samp>detection</samp>&rsquo;</dt>
  20795. <dd><p>Should the exact signal be taken in case of <code>peak</code> or an RMS one in case
  20796. of <code>rms</code>. Default is <code>rms</code> which is mostly smoother.
  20797. </p>
  20798. </dd>
  20799. <dt>&lsquo;<samp>mix</samp>&rsquo;</dt>
  20800. <dd><p>How much to use compressed signal in output. Default is 1.
  20801. Range is between 0 and 1.
  20802. </p></dd>
  20803. </dl>
  20804. <a name="Commands-62"></a>
  20805. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-62">36.1.1 Commands</a></h3>
  20806. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  20807. </p>
  20808. <a name="acontrast"></a>
  20809. <h2 class="section"><a href="ffmpeg-all.html#toc-acontrast">36.2 acontrast</a></h2>
  20810. <p>Simple audio dynamic range compression/expansion filter.
  20811. </p>
  20812. <p>The filter accepts the following options:
  20813. </p>
  20814. <dl compact="compact">
  20815. <dt>&lsquo;<samp>contrast</samp>&rsquo;</dt>
  20816. <dd><p>Set contrast. Default is 33. Allowed range is between 0 and 100.
  20817. </p></dd>
  20818. </dl>
  20819. <a name="acopy"></a>
  20820. <h2 class="section"><a href="ffmpeg-all.html#toc-acopy">36.3 acopy</a></h2>
  20821. <p>Copy the input audio source unchanged to the output. This is mainly useful for
  20822. testing purposes.
  20823. </p>
  20824. <a name="acrossfade"></a>
  20825. <h2 class="section"><a href="ffmpeg-all.html#toc-acrossfade">36.4 acrossfade</a></h2>
  20826. <p>Apply cross fade from one input audio stream to another input audio stream.
  20827. The cross fade is applied for specified duration near the end of first stream.
  20828. </p>
  20829. <p>The filter accepts the following options:
  20830. </p>
  20831. <dl compact="compact">
  20832. <dt>&lsquo;<samp>nb_samples, ns</samp>&rsquo;</dt>
  20833. <dd><p>Specify the number of samples for which the cross fade effect has to last.
  20834. At the end of the cross fade effect the first input audio will be completely
  20835. silent. Default is 44100.
  20836. </p>
  20837. </dd>
  20838. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  20839. <dd><p>Specify the duration of the cross fade effect. See
  20840. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  20841. for the accepted syntax.
  20842. By default the duration is determined by <var>nb_samples</var>.
  20843. If set this option is used instead of <var>nb_samples</var>.
  20844. </p>
  20845. </dd>
  20846. <dt>&lsquo;<samp>overlap, o</samp>&rsquo;</dt>
  20847. <dd><p>Should first stream end overlap with second stream start. Default is enabled.
  20848. </p>
  20849. </dd>
  20850. <dt>&lsquo;<samp>curve1</samp>&rsquo;</dt>
  20851. <dd><p>Set curve for cross fade transition for first stream.
  20852. </p>
  20853. </dd>
  20854. <dt>&lsquo;<samp>curve2</samp>&rsquo;</dt>
  20855. <dd><p>Set curve for cross fade transition for second stream.
  20856. </p>
  20857. <p>For description of available curve types see <a href="#afade">afade</a> filter description.
  20858. </p></dd>
  20859. </dl>
  20860. <a name="Examples-185"></a>
  20861. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-185">36.4.1 Examples</a></h3>
  20862. <ul>
  20863. <li>
  20864. Cross fade from one input to another:
  20865. <div class="example">
  20866. <pre class="example">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
  20867. </pre></div>
  20868. </li><li>
  20869. Cross fade from one input to another but without overlapping:
  20870. <div class="example">
  20871. <pre class="example">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
  20872. </pre></div>
  20873. </li></ul>
  20874. <a name="acrossover"></a>
  20875. <h2 class="section"><a href="ffmpeg-all.html#toc-acrossover">36.5 acrossover</a></h2>
  20876. <p>Split audio stream into several bands.
  20877. </p>
  20878. <p>This filter splits audio stream into two or more frequency ranges.
  20879. Summing all streams back will give flat output.
  20880. </p>
  20881. <p>The filter accepts the following options:
  20882. </p>
  20883. <dl compact="compact">
  20884. <dt>&lsquo;<samp>split</samp>&rsquo;</dt>
  20885. <dd><p>Set split frequencies. Those must be positive and increasing.
  20886. </p>
  20887. </dd>
  20888. <dt>&lsquo;<samp>order</samp>&rsquo;</dt>
  20889. <dd><p>Set filter order, can be <var>2nd</var>, <var>4th</var> or <var>8th</var>.
  20890. Default is <var>4th</var>.
  20891. </p></dd>
  20892. </dl>
  20893. <a name="acrusher"></a>
  20894. <h2 class="section"><a href="ffmpeg-all.html#toc-acrusher">36.6 acrusher</a></h2>
  20895. <p>Reduce audio bit resolution.
  20896. </p>
  20897. <p>This filter is bit crusher with enhanced functionality. A bit crusher
  20898. is used to audibly reduce number of bits an audio signal is sampled
  20899. with. This doesn&rsquo;t change the bit depth at all, it just produces the
  20900. effect. Material reduced in bit depth sounds more harsh and &quot;digital&quot;.
  20901. This filter is able to even round to continuous values instead of discrete
  20902. bit depths.
  20903. Additionally it has a D/C offset which results in different crushing of
  20904. the lower and the upper half of the signal.
  20905. An Anti-Aliasing setting is able to produce &quot;softer&quot; crushing sounds.
  20906. </p>
  20907. <p>Another feature of this filter is the logarithmic mode.
  20908. This setting switches from linear distances between bits to logarithmic ones.
  20909. The result is a much more &quot;natural&quot; sounding crusher which doesn&rsquo;t gate low
  20910. signals for example. The human ear has a logarithmic perception,
  20911. so this kind of crushing is much more pleasant.
  20912. Logarithmic crushing is also able to get anti-aliased.
  20913. </p>
  20914. <p>The filter accepts the following options:
  20915. </p>
  20916. <dl compact="compact">
  20917. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  20918. <dd><p>Set level in.
  20919. </p>
  20920. </dd>
  20921. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  20922. <dd><p>Set level out.
  20923. </p>
  20924. </dd>
  20925. <dt>&lsquo;<samp>bits</samp>&rsquo;</dt>
  20926. <dd><p>Set bit reduction.
  20927. </p>
  20928. </dd>
  20929. <dt>&lsquo;<samp>mix</samp>&rsquo;</dt>
  20930. <dd><p>Set mixing amount.
  20931. </p>
  20932. </dd>
  20933. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  20934. <dd><p>Can be linear: <code>lin</code> or logarithmic: <code>log</code>.
  20935. </p>
  20936. </dd>
  20937. <dt>&lsquo;<samp>dc</samp>&rsquo;</dt>
  20938. <dd><p>Set DC.
  20939. </p>
  20940. </dd>
  20941. <dt>&lsquo;<samp>aa</samp>&rsquo;</dt>
  20942. <dd><p>Set anti-aliasing.
  20943. </p>
  20944. </dd>
  20945. <dt>&lsquo;<samp>samples</samp>&rsquo;</dt>
  20946. <dd><p>Set sample reduction.
  20947. </p>
  20948. </dd>
  20949. <dt>&lsquo;<samp>lfo</samp>&rsquo;</dt>
  20950. <dd><p>Enable LFO. By default disabled.
  20951. </p>
  20952. </dd>
  20953. <dt>&lsquo;<samp>lforange</samp>&rsquo;</dt>
  20954. <dd><p>Set LFO range.
  20955. </p>
  20956. </dd>
  20957. <dt>&lsquo;<samp>lforate</samp>&rsquo;</dt>
  20958. <dd><p>Set LFO rate.
  20959. </p></dd>
  20960. </dl>
  20961. <a name="acue"></a>
  20962. <h2 class="section"><a href="ffmpeg-all.html#toc-acue">36.7 acue</a></h2>
  20963. <p>Delay audio filtering until a given wallclock timestamp. See the <a href="#cue">cue</a>
  20964. filter.
  20965. </p>
  20966. <a name="adeclick"></a>
  20967. <h2 class="section"><a href="ffmpeg-all.html#toc-adeclick">36.8 adeclick</a></h2>
  20968. <p>Remove impulsive noise from input audio.
  20969. </p>
  20970. <p>Samples detected as impulsive noise are replaced by interpolated samples using
  20971. autoregressive modelling.
  20972. </p>
  20973. <dl compact="compact">
  20974. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  20975. <dd><p>Set window size, in milliseconds. Allowed range is from <code>10</code> to
  20976. <code>100</code>. Default value is <code>55</code> milliseconds.
  20977. This sets size of window which will be processed at once.
  20978. </p>
  20979. </dd>
  20980. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  20981. <dd><p>Set window overlap, in percentage of window size. Allowed range is from
  20982. <code>50</code> to <code>95</code>. Default value is <code>75</code> percent.
  20983. Setting this to a very high value increases impulsive noise removal but makes
  20984. whole process much slower.
  20985. </p>
  20986. </dd>
  20987. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  20988. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  20989. <code>0</code> to <code>25</code>. Default value is <code>2</code> percent. This option also
  20990. controls quality of interpolated samples using neighbour good samples.
  20991. </p>
  20992. </dd>
  20993. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  20994. <dd><p>Set threshold value. Allowed range is from <code>1</code> to <code>100</code>.
  20995. Default value is <code>2</code>.
  20996. This controls the strength of impulsive noise which is going to be removed.
  20997. The lower value, the more samples will be detected as impulsive noise.
  20998. </p>
  20999. </dd>
  21000. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  21001. <dd><p>Set burst fusion, in percentage of window size. Allowed range is <code>0</code> to
  21002. <code>10</code>. Default value is <code>2</code>.
  21003. If any two samples detected as noise are spaced less than this value then any
  21004. sample between those two samples will be also detected as noise.
  21005. </p>
  21006. </dd>
  21007. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  21008. <dd><p>Set overlap method.
  21009. </p>
  21010. <p>It accepts the following values:
  21011. </p><dl compact="compact">
  21012. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  21013. <dd><p>Select overlap-add method. Even not interpolated samples are slightly
  21014. changed with this method.
  21015. </p>
  21016. </dd>
  21017. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  21018. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  21019. </p></dd>
  21020. </dl>
  21021. <p>Default value is <code>a</code>.
  21022. </p></dd>
  21023. </dl>
  21024. <a name="adeclip"></a>
  21025. <h2 class="section"><a href="ffmpeg-all.html#toc-adeclip">36.9 adeclip</a></h2>
  21026. <p>Remove clipped samples from input audio.
  21027. </p>
  21028. <p>Samples detected as clipped are replaced by interpolated samples using
  21029. autoregressive modelling.
  21030. </p>
  21031. <dl compact="compact">
  21032. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  21033. <dd><p>Set window size, in milliseconds. Allowed range is from <code>10</code> to <code>100</code>.
  21034. Default value is <code>55</code> milliseconds.
  21035. This sets size of window which will be processed at once.
  21036. </p>
  21037. </dd>
  21038. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  21039. <dd><p>Set window overlap, in percentage of window size. Allowed range is from <code>50</code>
  21040. to <code>95</code>. Default value is <code>75</code> percent.
  21041. </p>
  21042. </dd>
  21043. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  21044. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  21045. <code>0</code> to <code>25</code>. Default value is <code>8</code> percent. This option also controls
  21046. quality of interpolated samples using neighbour good samples.
  21047. </p>
  21048. </dd>
  21049. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  21050. <dd><p>Set threshold value. Allowed range is from <code>1</code> to <code>100</code>.
  21051. Default value is <code>10</code>. Higher values make clip detection less aggressive.
  21052. </p>
  21053. </dd>
  21054. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  21055. <dd><p>Set size of histogram used to detect clips. Allowed range is from <code>100</code> to <code>9999</code>.
  21056. Default value is <code>1000</code>. Higher values make clip detection less aggressive.
  21057. </p>
  21058. </dd>
  21059. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  21060. <dd><p>Set overlap method.
  21061. </p>
  21062. <p>It accepts the following values:
  21063. </p><dl compact="compact">
  21064. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  21065. <dd><p>Select overlap-add method. Even not interpolated samples are slightly changed
  21066. with this method.
  21067. </p>
  21068. </dd>
  21069. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  21070. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  21071. </p></dd>
  21072. </dl>
  21073. <p>Default value is <code>a</code>.
  21074. </p></dd>
  21075. </dl>
  21076. <a name="adelay"></a>
  21077. <h2 class="section"><a href="ffmpeg-all.html#toc-adelay">36.10 adelay</a></h2>
  21078. <p>Delay one or more audio channels.
  21079. </p>
  21080. <p>Samples in delayed channel are filled with silence.
  21081. </p>
  21082. <p>The filter accepts the following option:
  21083. </p>
  21084. <dl compact="compact">
  21085. <dt>&lsquo;<samp>delays</samp>&rsquo;</dt>
  21086. <dd><p>Set list of delays in milliseconds for each channel separated by &rsquo;|&rsquo;.
  21087. Unused delays will be silently ignored. If number of given delays is
  21088. smaller than number of channels all remaining channels will not be delayed.
  21089. If you want to delay exact number of samples, append &rsquo;S&rsquo; to number.
  21090. If you want instead to delay in seconds, append &rsquo;s&rsquo; to number.
  21091. </p>
  21092. </dd>
  21093. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  21094. <dd><p>Use last set delay for all remaining channels. By default is disabled.
  21095. This option if enabled changes how option <code>delays</code> is interpreted.
  21096. </p></dd>
  21097. </dl>
  21098. <a name="Examples-16"></a>
  21099. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-16">36.10.1 Examples</a></h3>
  21100. <ul>
  21101. <li>
  21102. Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
  21103. the second channel (and any other channels that may be present) unchanged.
  21104. <div class="example">
  21105. <pre class="example">adelay=1500|0|500
  21106. </pre></div>
  21107. </li><li>
  21108. Delay second channel by 500 samples, the third channel by 700 samples and leave
  21109. the first channel (and any other channels that may be present) unchanged.
  21110. <div class="example">
  21111. <pre class="example">adelay=0|500S|700S
  21112. </pre></div>
  21113. </li><li>
  21114. Delay all channels by same number of samples:
  21115. <div class="example">
  21116. <pre class="example">adelay=delays=64S:all=1
  21117. </pre></div>
  21118. </li></ul>
  21119. <a name="aderivative_002c-aintegral"></a>
  21120. <h2 class="section"><a href="ffmpeg-all.html#toc-aderivative_002c-aintegral">36.11 aderivative, aintegral</a></h2>
  21121. <p>Compute derivative/integral of audio stream.
  21122. </p>
  21123. <p>Applying both filters one after another produces original audio.
  21124. </p>
  21125. <a name="aecho"></a>
  21126. <h2 class="section"><a href="ffmpeg-all.html#toc-aecho">36.12 aecho</a></h2>
  21127. <p>Apply echoing to the input audio.
  21128. </p>
  21129. <p>Echoes are reflected sound and can occur naturally amongst mountains
  21130. (and sometimes large buildings) when talking or shouting; digital echo
  21131. effects emulate this behaviour and are often used to help fill out the
  21132. sound of a single instrument or vocal. The time difference between the
  21133. original signal and the reflection is the <code>delay</code>, and the
  21134. loudness of the reflected signal is the <code>decay</code>.
  21135. Multiple echoes can have different delays and decays.
  21136. </p>
  21137. <p>A description of the accepted parameters follows.
  21138. </p>
  21139. <dl compact="compact">
  21140. <dt>&lsquo;<samp>in_gain</samp>&rsquo;</dt>
  21141. <dd><p>Set input gain of reflected signal. Default is <code>0.6</code>.
  21142. </p>
  21143. </dd>
  21144. <dt>&lsquo;<samp>out_gain</samp>&rsquo;</dt>
  21145. <dd><p>Set output gain of reflected signal. Default is <code>0.3</code>.
  21146. </p>
  21147. </dd>
  21148. <dt>&lsquo;<samp>delays</samp>&rsquo;</dt>
  21149. <dd><p>Set list of time intervals in milliseconds between original signal and reflections
  21150. separated by &rsquo;|&rsquo;. Allowed range for each <code>delay</code> is <code>(0 - 90000.0]</code>.
  21151. Default is <code>1000</code>.
  21152. </p>
  21153. </dd>
  21154. <dt>&lsquo;<samp>decays</samp>&rsquo;</dt>
  21155. <dd><p>Set list of loudness of reflected signals separated by &rsquo;|&rsquo;.
  21156. Allowed range for each <code>decay</code> is <code>(0 - 1.0]</code>.
  21157. Default is <code>0.5</code>.
  21158. </p></dd>
  21159. </dl>
  21160. <a name="Examples-160"></a>
  21161. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-160">36.12.1 Examples</a></h3>
  21162. <ul>
  21163. <li>
  21164. Make it sound as if there are twice as many instruments as are actually playing:
  21165. <div class="example">
  21166. <pre class="example">aecho=0.8:0.88:60:0.4
  21167. </pre></div>
  21168. </li><li>
  21169. If delay is very short, then it sounds like a (metallic) robot playing music:
  21170. <div class="example">
  21171. <pre class="example">aecho=0.8:0.88:6:0.4
  21172. </pre></div>
  21173. </li><li>
  21174. A longer delay will sound like an open air concert in the mountains:
  21175. <div class="example">
  21176. <pre class="example">aecho=0.8:0.9:1000:0.3
  21177. </pre></div>
  21178. </li><li>
  21179. Same as above but with one more mountain:
  21180. <div class="example">
  21181. <pre class="example">aecho=0.8:0.9:1000|1800:0.3|0.25
  21182. </pre></div>
  21183. </li></ul>
  21184. <a name="aemphasis"></a>
  21185. <h2 class="section"><a href="ffmpeg-all.html#toc-aemphasis">36.13 aemphasis</a></h2>
  21186. <p>Audio emphasis filter creates or restores material directly taken from LPs or
  21187. emphased CDs with different filter curves. E.g. to store music on vinyl the
  21188. signal has to be altered by a filter first to even out the disadvantages of
  21189. this recording medium.
  21190. Once the material is played back the inverse filter has to be applied to
  21191. restore the distortion of the frequency response.
  21192. </p>
  21193. <p>The filter accepts the following options:
  21194. </p>
  21195. <dl compact="compact">
  21196. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  21197. <dd><p>Set input gain.
  21198. </p>
  21199. </dd>
  21200. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  21201. <dd><p>Set output gain.
  21202. </p>
  21203. </dd>
  21204. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  21205. <dd><p>Set filter mode. For restoring material use <code>reproduction</code> mode, otherwise
  21206. use <code>production</code> mode. Default is <code>reproduction</code> mode.
  21207. </p>
  21208. </dd>
  21209. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  21210. <dd><p>Set filter type. Selects medium. Can be one of the following:
  21211. </p>
  21212. <dl compact="compact">
  21213. <dt>&lsquo;<samp>col</samp>&rsquo;</dt>
  21214. <dd><p>select Columbia.
  21215. </p></dd>
  21216. <dt>&lsquo;<samp>emi</samp>&rsquo;</dt>
  21217. <dd><p>select EMI.
  21218. </p></dd>
  21219. <dt>&lsquo;<samp>bsi</samp>&rsquo;</dt>
  21220. <dd><p>select BSI (78RPM).
  21221. </p></dd>
  21222. <dt>&lsquo;<samp>riaa</samp>&rsquo;</dt>
  21223. <dd><p>select RIAA.
  21224. </p></dd>
  21225. <dt>&lsquo;<samp>cd</samp>&rsquo;</dt>
  21226. <dd><p>select Compact Disc (CD).
  21227. </p></dd>
  21228. <dt>&lsquo;<samp>50fm</samp>&rsquo;</dt>
  21229. <dd><p>select 50µs (FM).
  21230. </p></dd>
  21231. <dt>&lsquo;<samp>75fm</samp>&rsquo;</dt>
  21232. <dd><p>select 75µs (FM).
  21233. </p></dd>
  21234. <dt>&lsquo;<samp>50kf</samp>&rsquo;</dt>
  21235. <dd><p>select 50µs (FM-KF).
  21236. </p></dd>
  21237. <dt>&lsquo;<samp>75kf</samp>&rsquo;</dt>
  21238. <dd><p>select 75µs (FM-KF).
  21239. </p></dd>
  21240. </dl>
  21241. </dd>
  21242. </dl>
  21243. <a name="aeval"></a>
  21244. <h2 class="section"><a href="ffmpeg-all.html#toc-aeval">36.14 aeval</a></h2>
  21245. <p>Modify an audio signal according to the specified expressions.
  21246. </p>
  21247. <p>This filter accepts one or more expressions (one for each channel),
  21248. which are evaluated and used to modify a corresponding audio signal.
  21249. </p>
  21250. <p>It accepts the following parameters:
  21251. </p>
  21252. <dl compact="compact">
  21253. <dt>&lsquo;<samp>exprs</samp>&rsquo;</dt>
  21254. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. If
  21255. the number of input channels is greater than the number of
  21256. expressions, the last specified expression is used for the remaining
  21257. output channels.
  21258. </p>
  21259. </dd>
  21260. <dt>&lsquo;<samp>channel_layout, c</samp>&rsquo;</dt>
  21261. <dd><p>Set output channel layout. If not specified, the channel layout is
  21262. specified by the number of expressions. If set to &lsquo;<samp>same</samp>&rsquo;, it will
  21263. use by default the same input channel layout.
  21264. </p></dd>
  21265. </dl>
  21266. <p>Each expression in <var>exprs</var> can contain the following constants and functions:
  21267. </p>
  21268. <dl compact="compact">
  21269. <dt>&lsquo;<samp>ch</samp>&rsquo;</dt>
  21270. <dd><p>channel number of the current expression
  21271. </p>
  21272. </dd>
  21273. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  21274. <dd><p>number of the evaluated sample, starting from 0
  21275. </p>
  21276. </dd>
  21277. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  21278. <dd><p>sample rate
  21279. </p>
  21280. </dd>
  21281. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  21282. <dd><p>time of the evaluated sample expressed in seconds
  21283. </p>
  21284. </dd>
  21285. <dt>&lsquo;<samp>nb_in_channels</samp>&rsquo;</dt>
  21286. <dt>&lsquo;<samp>nb_out_channels</samp>&rsquo;</dt>
  21287. <dd><p>input and output number of channels
  21288. </p>
  21289. </dd>
  21290. <dt>&lsquo;<samp>val(CH)</samp>&rsquo;</dt>
  21291. <dd><p>the value of input channel with number <var>CH</var>
  21292. </p></dd>
  21293. </dl>
  21294. <p>Note: this filter is slow. For faster processing you should use a
  21295. dedicated filter.
  21296. </p>
  21297. <a name="Examples-173"></a>
  21298. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-173">36.14.1 Examples</a></h3>
  21299. <ul>
  21300. <li>
  21301. Half volume:
  21302. <div class="example">
  21303. <pre class="example">aeval=val(ch)/2:c=same
  21304. </pre></div>
  21305. </li><li>
  21306. Invert phase of the second channel:
  21307. <div class="example">
  21308. <pre class="example">aeval=val(0)|-val(1)
  21309. </pre></div>
  21310. </li></ul>
  21311. <p><a name="afade"></a>
  21312. </p><a name="afade-1"></a>
  21313. <h2 class="section"><a href="ffmpeg-all.html#toc-afade-1">36.15 afade</a></h2>
  21314. <p>Apply fade-in/out effect to input audio.
  21315. </p>
  21316. <p>A description of the accepted parameters follows.
  21317. </p>
  21318. <dl compact="compact">
  21319. <dt>&lsquo;<samp>type, t</samp>&rsquo;</dt>
  21320. <dd><p>Specify the effect type, can be either <code>in</code> for fade-in, or
  21321. <code>out</code> for a fade-out effect. Default is <code>in</code>.
  21322. </p>
  21323. </dd>
  21324. <dt>&lsquo;<samp>start_sample, ss</samp>&rsquo;</dt>
  21325. <dd><p>Specify the number of the start sample for starting to apply the fade
  21326. effect. Default is 0.
  21327. </p>
  21328. </dd>
  21329. <dt>&lsquo;<samp>nb_samples, ns</samp>&rsquo;</dt>
  21330. <dd><p>Specify the number of samples for which the fade effect has to last. At
  21331. the end of the fade-in effect the output audio will have the same
  21332. volume as the input audio, at the end of the fade-out transition
  21333. the output audio will be silence. Default is 44100.
  21334. </p>
  21335. </dd>
  21336. <dt>&lsquo;<samp>start_time, st</samp>&rsquo;</dt>
  21337. <dd><p>Specify the start time of the fade effect. Default is 0.
  21338. The value must be specified as a time duration; see
  21339. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  21340. for the accepted syntax.
  21341. If set this option is used instead of <var>start_sample</var>.
  21342. </p>
  21343. </dd>
  21344. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  21345. <dd><p>Specify the duration of the fade effect. See
  21346. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  21347. for the accepted syntax.
  21348. At the end of the fade-in effect the output audio will have the same
  21349. volume as the input audio, at the end of the fade-out transition
  21350. the output audio will be silence.
  21351. By default the duration is determined by <var>nb_samples</var>.
  21352. If set this option is used instead of <var>nb_samples</var>.
  21353. </p>
  21354. </dd>
  21355. <dt>&lsquo;<samp>curve</samp>&rsquo;</dt>
  21356. <dd><p>Set curve for fade transition.
  21357. </p>
  21358. <p>It accepts the following values:
  21359. </p><dl compact="compact">
  21360. <dt>&lsquo;<samp>tri</samp>&rsquo;</dt>
  21361. <dd><p>select triangular, linear slope (default)
  21362. </p></dd>
  21363. <dt>&lsquo;<samp>qsin</samp>&rsquo;</dt>
  21364. <dd><p>select quarter of sine wave
  21365. </p></dd>
  21366. <dt>&lsquo;<samp>hsin</samp>&rsquo;</dt>
  21367. <dd><p>select half of sine wave
  21368. </p></dd>
  21369. <dt>&lsquo;<samp>esin</samp>&rsquo;</dt>
  21370. <dd><p>select exponential sine wave
  21371. </p></dd>
  21372. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  21373. <dd><p>select logarithmic
  21374. </p></dd>
  21375. <dt>&lsquo;<samp>ipar</samp>&rsquo;</dt>
  21376. <dd><p>select inverted parabola
  21377. </p></dd>
  21378. <dt>&lsquo;<samp>qua</samp>&rsquo;</dt>
  21379. <dd><p>select quadratic
  21380. </p></dd>
  21381. <dt>&lsquo;<samp>cub</samp>&rsquo;</dt>
  21382. <dd><p>select cubic
  21383. </p></dd>
  21384. <dt>&lsquo;<samp>squ</samp>&rsquo;</dt>
  21385. <dd><p>select square root
  21386. </p></dd>
  21387. <dt>&lsquo;<samp>cbr</samp>&rsquo;</dt>
  21388. <dd><p>select cubic root
  21389. </p></dd>
  21390. <dt>&lsquo;<samp>par</samp>&rsquo;</dt>
  21391. <dd><p>select parabola
  21392. </p></dd>
  21393. <dt>&lsquo;<samp>exp</samp>&rsquo;</dt>
  21394. <dd><p>select exponential
  21395. </p></dd>
  21396. <dt>&lsquo;<samp>iqsin</samp>&rsquo;</dt>
  21397. <dd><p>select inverted quarter of sine wave
  21398. </p></dd>
  21399. <dt>&lsquo;<samp>ihsin</samp>&rsquo;</dt>
  21400. <dd><p>select inverted half of sine wave
  21401. </p></dd>
  21402. <dt>&lsquo;<samp>dese</samp>&rsquo;</dt>
  21403. <dd><p>select double-exponential seat
  21404. </p></dd>
  21405. <dt>&lsquo;<samp>desi</samp>&rsquo;</dt>
  21406. <dd><p>select double-exponential sigmoid
  21407. </p></dd>
  21408. <dt>&lsquo;<samp>losi</samp>&rsquo;</dt>
  21409. <dd><p>select logistic sigmoid
  21410. </p></dd>
  21411. <dt>&lsquo;<samp>nofade</samp>&rsquo;</dt>
  21412. <dd><p>no fade applied
  21413. </p></dd>
  21414. </dl>
  21415. </dd>
  21416. </dl>
  21417. <a name="Examples-178"></a>
  21418. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-178">36.15.1 Examples</a></h3>
  21419. <ul>
  21420. <li>
  21421. Fade in first 15 seconds of audio:
  21422. <div class="example">
  21423. <pre class="example">afade=t=in:ss=0:d=15
  21424. </pre></div>
  21425. </li><li>
  21426. Fade out last 25 seconds of a 900 seconds audio:
  21427. <div class="example">
  21428. <pre class="example">afade=t=out:st=875:d=25
  21429. </pre></div>
  21430. </li></ul>
  21431. <a name="afftdn"></a>
  21432. <h2 class="section"><a href="ffmpeg-all.html#toc-afftdn">36.16 afftdn</a></h2>
  21433. <p>Denoise audio samples with FFT.
  21434. </p>
  21435. <p>A description of the accepted parameters follows.
  21436. </p>
  21437. <dl compact="compact">
  21438. <dt>&lsquo;<samp>nr</samp>&rsquo;</dt>
  21439. <dd><p>Set the noise reduction in dB, allowed range is 0.01 to 97.
  21440. Default value is 12 dB.
  21441. </p>
  21442. </dd>
  21443. <dt>&lsquo;<samp>nf</samp>&rsquo;</dt>
  21444. <dd><p>Set the noise floor in dB, allowed range is -80 to -20.
  21445. Default value is -50 dB.
  21446. </p>
  21447. </dd>
  21448. <dt>&lsquo;<samp>nt</samp>&rsquo;</dt>
  21449. <dd><p>Set the noise type.
  21450. </p>
  21451. <p>It accepts the following values:
  21452. </p><dl compact="compact">
  21453. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  21454. <dd><p>Select white noise.
  21455. </p>
  21456. </dd>
  21457. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  21458. <dd><p>Select vinyl noise.
  21459. </p>
  21460. </dd>
  21461. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  21462. <dd><p>Select shellac noise.
  21463. </p>
  21464. </dd>
  21465. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  21466. <dd><p>Select custom noise, defined in <code>bn</code> option.
  21467. </p>
  21468. <p>Default value is white noise.
  21469. </p></dd>
  21470. </dl>
  21471. </dd>
  21472. <dt>&lsquo;<samp>bn</samp>&rsquo;</dt>
  21473. <dd><p>Set custom band noise for every one of 15 bands.
  21474. Bands are separated by &rsquo; &rsquo; or &rsquo;|&rsquo;.
  21475. </p>
  21476. </dd>
  21477. <dt>&lsquo;<samp>rf</samp>&rsquo;</dt>
  21478. <dd><p>Set the residual floor in dB, allowed range is -80 to -20.
  21479. Default value is -38 dB.
  21480. </p>
  21481. </dd>
  21482. <dt>&lsquo;<samp>tn</samp>&rsquo;</dt>
  21483. <dd><p>Enable noise tracking. By default is disabled.
  21484. With this enabled, noise floor is automatically adjusted.
  21485. </p>
  21486. </dd>
  21487. <dt>&lsquo;<samp>tr</samp>&rsquo;</dt>
  21488. <dd><p>Enable residual tracking. By default is disabled.
  21489. </p>
  21490. </dd>
  21491. <dt>&lsquo;<samp>om</samp>&rsquo;</dt>
  21492. <dd><p>Set the output mode.
  21493. </p>
  21494. <p>It accepts the following values:
  21495. </p><dl compact="compact">
  21496. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  21497. <dd><p>Pass input unchanged.
  21498. </p>
  21499. </dd>
  21500. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  21501. <dd><p>Pass noise filtered out.
  21502. </p>
  21503. </dd>
  21504. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  21505. <dd><p>Pass only noise.
  21506. </p>
  21507. <p>Default value is <var>o</var>.
  21508. </p></dd>
  21509. </dl>
  21510. </dd>
  21511. </dl>
  21512. <a name="Commands-68"></a>
  21513. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-68">36.16.1 Commands</a></h3>
  21514. <p>This filter supports the following commands:
  21515. </p><dl compact="compact">
  21516. <dt>&lsquo;<samp>sample_noise, sn</samp>&rsquo;</dt>
  21517. <dd><p>Start or stop measuring noise profile.
  21518. Syntax for the command is : &quot;start&quot; or &quot;stop&quot; string.
  21519. After measuring noise profile is stopped it will be
  21520. automatically applied in filtering.
  21521. </p>
  21522. </dd>
  21523. <dt>&lsquo;<samp>noise_reduction, nr</samp>&rsquo;</dt>
  21524. <dd><p>Change noise reduction. Argument is single float number.
  21525. Syntax for the command is : &quot;<var>noise_reduction</var>&quot;
  21526. </p>
  21527. </dd>
  21528. <dt>&lsquo;<samp>noise_floor, nf</samp>&rsquo;</dt>
  21529. <dd><p>Change noise floor. Argument is single float number.
  21530. Syntax for the command is : &quot;<var>noise_floor</var>&quot;
  21531. </p>
  21532. </dd>
  21533. <dt>&lsquo;<samp>output_mode, om</samp>&rsquo;</dt>
  21534. <dd><p>Change output mode operation.
  21535. Syntax for the command is : &quot;i&quot;, &quot;o&quot; or &quot;n&quot; string.
  21536. </p></dd>
  21537. </dl>
  21538. <a name="afftfilt"></a>
  21539. <h2 class="section"><a href="ffmpeg-all.html#toc-afftfilt">36.17 afftfilt</a></h2>
  21540. <p>Apply arbitrary expressions to samples in frequency domain.
  21541. </p>
  21542. <dl compact="compact">
  21543. <dt>&lsquo;<samp>real</samp>&rsquo;</dt>
  21544. <dd><p>Set frequency domain real expression for each separate channel separated
  21545. by &rsquo;|&rsquo;. Default is &quot;re&quot;.
  21546. If the number of input channels is greater than the number of
  21547. expressions, the last specified expression is used for the remaining
  21548. output channels.
  21549. </p>
  21550. </dd>
  21551. <dt>&lsquo;<samp>imag</samp>&rsquo;</dt>
  21552. <dd><p>Set frequency domain imaginary expression for each separate channel
  21553. separated by &rsquo;|&rsquo;. Default is &quot;im&quot;.
  21554. </p>
  21555. <p>Each expression in <var>real</var> and <var>imag</var> can contain the following
  21556. constants and functions:
  21557. </p>
  21558. <dl compact="compact">
  21559. <dt>&lsquo;<samp>sr</samp>&rsquo;</dt>
  21560. <dd><p>sample rate
  21561. </p>
  21562. </dd>
  21563. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  21564. <dd><p>current frequency bin number
  21565. </p>
  21566. </dd>
  21567. <dt>&lsquo;<samp>nb</samp>&rsquo;</dt>
  21568. <dd><p>number of available bins
  21569. </p>
  21570. </dd>
  21571. <dt>&lsquo;<samp>ch</samp>&rsquo;</dt>
  21572. <dd><p>channel number of the current expression
  21573. </p>
  21574. </dd>
  21575. <dt>&lsquo;<samp>chs</samp>&rsquo;</dt>
  21576. <dd><p>number of channels
  21577. </p>
  21578. </dd>
  21579. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  21580. <dd><p>current frame pts
  21581. </p>
  21582. </dd>
  21583. <dt>&lsquo;<samp>re</samp>&rsquo;</dt>
  21584. <dd><p>current real part of frequency bin of current channel
  21585. </p>
  21586. </dd>
  21587. <dt>&lsquo;<samp>im</samp>&rsquo;</dt>
  21588. <dd><p>current imaginary part of frequency bin of current channel
  21589. </p>
  21590. </dd>
  21591. <dt>&lsquo;<samp>real(b, ch)</samp>&rsquo;</dt>
  21592. <dd><p>Return the value of real part of frequency bin at location (<var>bin</var>,<var>channel</var>)
  21593. </p>
  21594. </dd>
  21595. <dt>&lsquo;<samp>imag(b, ch)</samp>&rsquo;</dt>
  21596. <dd><p>Return the value of imaginary part of frequency bin at location (<var>bin</var>,<var>channel</var>)
  21597. </p></dd>
  21598. </dl>
  21599. </dd>
  21600. <dt>&lsquo;<samp>win_size</samp>&rsquo;</dt>
  21601. <dd><p>Set window size. Allowed range is from 16 to 131072.
  21602. Default is <code>4096</code>
  21603. </p>
  21604. </dd>
  21605. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  21606. <dd><p>Set window function. Default is <code>hann</code>.
  21607. </p>
  21608. </dd>
  21609. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  21610. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  21611. window function will be picked. Default is <code>0.75</code>.
  21612. </p></dd>
  21613. </dl>
  21614. <a name="Examples-46"></a>
  21615. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-46">36.17.1 Examples</a></h3>
  21616. <ul>
  21617. <li>
  21618. Leave almost only low frequencies in audio:
  21619. <div class="example">
  21620. <pre class="example">afftfilt=&quot;'real=re * (1-clip((b/nb)*b,0,1))':imag='im * (1-clip((b/nb)*b,0,1))'&quot;
  21621. </pre></div>
  21622. </li><li>
  21623. Apply robotize effect:
  21624. <div class="example">
  21625. <pre class="example">afftfilt=&quot;real='hypot(re,im)*sin(0)':imag='hypot(re,im)*cos(0)':win_size=512:overlap=0.75&quot;
  21626. </pre></div>
  21627. </li><li>
  21628. Apply whisper effect:
  21629. <div class="example">
  21630. <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;
  21631. </pre></div>
  21632. </li></ul>
  21633. <p><a name="afir"></a>
  21634. </p><a name="afir-1"></a>
  21635. <h2 class="section"><a href="ffmpeg-all.html#toc-afir-1">36.18 afir</a></h2>
  21636. <p>Apply an arbitrary Finite Impulse Response filter.
  21637. </p>
  21638. <p>This filter is designed for applying long FIR filters,
  21639. up to 60 seconds long.
  21640. </p>
  21641. <p>It can be used as component for digital crossover filters,
  21642. room equalization, cross talk cancellation, wavefield synthesis,
  21643. auralization, ambiophonics, ambisonics and spatialization.
  21644. </p>
  21645. <p>This filter uses the streams higher than first one as FIR coefficients.
  21646. If the non-first stream holds a single channel, it will be used
  21647. for all input channels in the first stream, otherwise
  21648. the number of channels in the non-first stream must be same as
  21649. the number of channels in the first stream.
  21650. </p>
  21651. <p>It accepts the following parameters:
  21652. </p>
  21653. <dl compact="compact">
  21654. <dt>&lsquo;<samp>dry</samp>&rsquo;</dt>
  21655. <dd><p>Set dry gain. This sets input gain.
  21656. </p>
  21657. </dd>
  21658. <dt>&lsquo;<samp>wet</samp>&rsquo;</dt>
  21659. <dd><p>Set wet gain. This sets final output gain.
  21660. </p>
  21661. </dd>
  21662. <dt>&lsquo;<samp>length</samp>&rsquo;</dt>
  21663. <dd><p>Set Impulse Response filter length. Default is 1, which means whole IR is processed.
  21664. </p>
  21665. </dd>
  21666. <dt>&lsquo;<samp>gtype</samp>&rsquo;</dt>
  21667. <dd><p>Enable applying gain measured from power of IR.
  21668. </p>
  21669. <p>Set which approach to use for auto gain measurement.
  21670. </p>
  21671. <dl compact="compact">
  21672. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  21673. <dd><p>Do not apply any gain.
  21674. </p>
  21675. </dd>
  21676. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  21677. <dd><p>select peak gain, very conservative approach. This is default value.
  21678. </p>
  21679. </dd>
  21680. <dt>&lsquo;<samp>dc</samp>&rsquo;</dt>
  21681. <dd><p>select DC gain, limited application.
  21682. </p>
  21683. </dd>
  21684. <dt>&lsquo;<samp>gn</samp>&rsquo;</dt>
  21685. <dd><p>select gain to noise approach, this is most popular one.
  21686. </p></dd>
  21687. </dl>
  21688. </dd>
  21689. <dt>&lsquo;<samp>irgain</samp>&rsquo;</dt>
  21690. <dd><p>Set gain to be applied to IR coefficients before filtering.
  21691. Allowed range is 0 to 1. This gain is applied after any gain applied with <var>gtype</var> option.
  21692. </p>
  21693. </dd>
  21694. <dt>&lsquo;<samp>irfmt</samp>&rsquo;</dt>
  21695. <dd><p>Set format of IR stream. Can be <code>mono</code> or <code>input</code>.
  21696. Default is <code>input</code>.
  21697. </p>
  21698. </dd>
  21699. <dt>&lsquo;<samp>maxir</samp>&rsquo;</dt>
  21700. <dd><p>Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds.
  21701. Allowed range is 0.1 to 60 seconds.
  21702. </p>
  21703. </dd>
  21704. <dt>&lsquo;<samp>response</samp>&rsquo;</dt>
  21705. <dd><p>Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream.
  21706. By default it is disabled.
  21707. </p>
  21708. </dd>
  21709. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  21710. <dd><p>Set for which IR channel to display frequency response. By default is first channel
  21711. displayed. This option is used only when <var>response</var> is enabled.
  21712. </p>
  21713. </dd>
  21714. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  21715. <dd><p>Set video stream size. This option is used only when <var>response</var> is enabled.
  21716. </p>
  21717. </dd>
  21718. <dt>&lsquo;<samp>rate</samp>&rsquo;</dt>
  21719. <dd><p>Set video stream frame rate. This option is used only when <var>response</var> is enabled.
  21720. </p>
  21721. </dd>
  21722. <dt>&lsquo;<samp>minp</samp>&rsquo;</dt>
  21723. <dd><p>Set minimal partition size used for convolution. Default is <var>8192</var>.
  21724. Allowed range is from <var>1</var> to <var>32768</var>.
  21725. Lower values decreases latency at cost of higher CPU usage.
  21726. </p>
  21727. </dd>
  21728. <dt>&lsquo;<samp>maxp</samp>&rsquo;</dt>
  21729. <dd><p>Set maximal partition size used for convolution. Default is <var>8192</var>.
  21730. Allowed range is from <var>8</var> to <var>32768</var>.
  21731. Lower values may increase CPU usage.
  21732. </p>
  21733. </dd>
  21734. <dt>&lsquo;<samp>nbirs</samp>&rsquo;</dt>
  21735. <dd><p>Set number of input impulse responses streams which will be switchable at runtime.
  21736. Allowed range is from <var>1</var> to <var>32</var>. Default is <var>1</var>.
  21737. </p>
  21738. </dd>
  21739. <dt>&lsquo;<samp>ir</samp>&rsquo;</dt>
  21740. <dd><p>Set IR stream which will be used for convolution, starting from <var>0</var>, should always be
  21741. lower than supplied value by <code>nbirs</code> option. Default is <var>0</var>.
  21742. This option can be changed at runtime via <a href="#commands">commands</a>.
  21743. </p></dd>
  21744. </dl>
  21745. <a name="Examples-21"></a>
  21746. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-21">36.18.1 Examples</a></h3>
  21747. <ul>
  21748. <li>
  21749. Apply reverb to stream using mono IR file as second input, complete command using ffmpeg:
  21750. <div class="example">
  21751. <pre class="example">ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
  21752. </pre></div>
  21753. </li></ul>
  21754. <p><a name="aformat"></a>
  21755. </p><a name="aformat-1"></a>
  21756. <h2 class="section"><a href="ffmpeg-all.html#toc-aformat-1">36.19 aformat</a></h2>
  21757. <p>Set output format constraints for the input audio. The framework will
  21758. negotiate the most appropriate format to minimize conversions.
  21759. </p>
  21760. <p>It accepts the following parameters:
  21761. </p><dl compact="compact">
  21762. <dt>&lsquo;<samp>sample_fmts, f</samp>&rsquo;</dt>
  21763. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample formats.
  21764. </p>
  21765. </dd>
  21766. <dt>&lsquo;<samp>sample_rates, r</samp>&rsquo;</dt>
  21767. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample rates.
  21768. </p>
  21769. </dd>
  21770. <dt>&lsquo;<samp>channel_layouts, cl</samp>&rsquo;</dt>
  21771. <dd><p>A &rsquo;|&rsquo;-separated list of requested channel layouts.
  21772. </p>
  21773. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  21774. for the required syntax.
  21775. </p></dd>
  21776. </dl>
  21777. <p>If a parameter is omitted, all values are allowed.
  21778. </p>
  21779. <p>Force the output to either unsigned 8-bit or signed 16-bit stereo
  21780. </p><div class="example">
  21781. <pre class="example">aformat=sample_fmts=u8|s16:channel_layouts=stereo
  21782. </pre></div>
  21783. <a name="agate"></a>
  21784. <h2 class="section"><a href="ffmpeg-all.html#toc-agate">36.20 agate</a></h2>
  21785. <p>A gate is mainly used to reduce lower parts of a signal. This kind of signal
  21786. processing reduces disturbing noise between useful signals.
  21787. </p>
  21788. <p>Gating is done by detecting the volume below a chosen level <var>threshold</var>
  21789. and dividing it by the factor set with <var>ratio</var>. The bottom of the noise
  21790. floor is set via <var>range</var>. Because an exact manipulation of the signal
  21791. would cause distortion of the waveform the reduction can be levelled over
  21792. time. This is done by setting <var>attack</var> and <var>release</var>.
  21793. </p>
  21794. <p><var>attack</var> determines how long the signal has to fall below the threshold
  21795. before any reduction will occur and <var>release</var> sets the time the signal
  21796. has to rise above the threshold to reduce the reduction again.
  21797. Shorter signals than the chosen attack time will be left untouched.
  21798. </p>
  21799. <dl compact="compact">
  21800. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  21801. <dd><p>Set input level before filtering.
  21802. Default is 1. Allowed range is from 0.015625 to 64.
  21803. </p>
  21804. </dd>
  21805. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  21806. <dd><p>Set the mode of operation. Can be <code>upward</code> or <code>downward</code>.
  21807. Default is <code>downward</code>. If set to <code>upward</code> mode, higher parts of signal
  21808. will be amplified, expanding dynamic range in upward direction.
  21809. Otherwise, in case of <code>downward</code> lower parts of signal will be reduced.
  21810. </p>
  21811. </dd>
  21812. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  21813. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  21814. Default is 0.06125. Allowed range is from 0 to 1.
  21815. Setting this to 0 disables reduction and then filter behaves like expander.
  21816. </p>
  21817. </dd>
  21818. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  21819. <dd><p>If a signal rises above this level the gain reduction is released.
  21820. Default is 0.125. Allowed range is from 0 to 1.
  21821. </p>
  21822. </dd>
  21823. <dt>&lsquo;<samp>ratio</samp>&rsquo;</dt>
  21824. <dd><p>Set a ratio by which the signal is reduced.
  21825. Default is 2. Allowed range is from 1 to 9000.
  21826. </p>
  21827. </dd>
  21828. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  21829. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  21830. reduction stops.
  21831. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  21832. </p>
  21833. </dd>
  21834. <dt>&lsquo;<samp>release</samp>&rsquo;</dt>
  21835. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  21836. reduction is increased again. Default is 250 milliseconds.
  21837. Allowed range is from 0.01 to 9000.
  21838. </p>
  21839. </dd>
  21840. <dt>&lsquo;<samp>makeup</samp>&rsquo;</dt>
  21841. <dd><p>Set amount of amplification of signal after processing.
  21842. Default is 1. Allowed range is from 1 to 64.
  21843. </p>
  21844. </dd>
  21845. <dt>&lsquo;<samp>knee</samp>&rsquo;</dt>
  21846. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  21847. Default is 2.828427125. Allowed range is from 1 to 8.
  21848. </p>
  21849. </dd>
  21850. <dt>&lsquo;<samp>detection</samp>&rsquo;</dt>
  21851. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  21852. Default is <code>rms</code>. Can be <code>peak</code> or <code>rms</code>.
  21853. </p>
  21854. </dd>
  21855. <dt>&lsquo;<samp>link</samp>&rsquo;</dt>
  21856. <dd><p>Choose if the average level between all channels or the louder channel affects
  21857. the reduction.
  21858. Default is <code>average</code>. Can be <code>average</code> or <code>maximum</code>.
  21859. </p></dd>
  21860. </dl>
  21861. <a name="aiir"></a>
  21862. <h2 class="section"><a href="ffmpeg-all.html#toc-aiir">36.21 aiir</a></h2>
  21863. <p>Apply an arbitrary Infinite Impulse Response filter.
  21864. </p>
  21865. <p>It accepts the following parameters:
  21866. </p>
  21867. <dl compact="compact">
  21868. <dt>&lsquo;<samp>zeros, z</samp>&rsquo;</dt>
  21869. <dd><p>Set numerator/zeros coefficients.
  21870. </p>
  21871. </dd>
  21872. <dt>&lsquo;<samp>poles, p</samp>&rsquo;</dt>
  21873. <dd><p>Set denominator/poles coefficients.
  21874. </p>
  21875. </dd>
  21876. <dt>&lsquo;<samp>gains, k</samp>&rsquo;</dt>
  21877. <dd><p>Set channels gains.
  21878. </p>
  21879. </dd>
  21880. <dt>&lsquo;<samp>dry_gain</samp>&rsquo;</dt>
  21881. <dd><p>Set input gain.
  21882. </p>
  21883. </dd>
  21884. <dt>&lsquo;<samp>wet_gain</samp>&rsquo;</dt>
  21885. <dd><p>Set output gain.
  21886. </p>
  21887. </dd>
  21888. <dt>&lsquo;<samp>format, f</samp>&rsquo;</dt>
  21889. <dd><p>Set coefficients format.
  21890. </p>
  21891. <dl compact="compact">
  21892. <dt>&lsquo;<samp>tf</samp>&rsquo;</dt>
  21893. <dd><p>digital transfer function
  21894. </p></dd>
  21895. <dt>&lsquo;<samp>zp</samp>&rsquo;</dt>
  21896. <dd><p>Z-plane zeros/poles, cartesian (default)
  21897. </p></dd>
  21898. <dt>&lsquo;<samp>pr</samp>&rsquo;</dt>
  21899. <dd><p>Z-plane zeros/poles, polar radians
  21900. </p></dd>
  21901. <dt>&lsquo;<samp>pd</samp>&rsquo;</dt>
  21902. <dd><p>Z-plane zeros/poles, polar degrees
  21903. </p></dd>
  21904. <dt>&lsquo;<samp>sp</samp>&rsquo;</dt>
  21905. <dd><p>S-plane zeros/poles
  21906. </p></dd>
  21907. </dl>
  21908. </dd>
  21909. <dt>&lsquo;<samp>process, r</samp>&rsquo;</dt>
  21910. <dd><p>Set kind of processing.
  21911. Can be <code>d</code> - direct or <code>s</code> - serial cascading. Default is <code>s</code>.
  21912. </p>
  21913. </dd>
  21914. <dt>&lsquo;<samp>precision, e</samp>&rsquo;</dt>
  21915. <dd><p>Set filtering precision.
  21916. </p>
  21917. <dl compact="compact">
  21918. <dt>&lsquo;<samp>dbl</samp>&rsquo;</dt>
  21919. <dd><p>double-precision floating-point (default)
  21920. </p></dd>
  21921. <dt>&lsquo;<samp>flt</samp>&rsquo;</dt>
  21922. <dd><p>single-precision floating-point
  21923. </p></dd>
  21924. <dt>&lsquo;<samp>i32</samp>&rsquo;</dt>
  21925. <dd><p>32-bit integers
  21926. </p></dd>
  21927. <dt>&lsquo;<samp>i16</samp>&rsquo;</dt>
  21928. <dd><p>16-bit integers
  21929. </p></dd>
  21930. </dl>
  21931. </dd>
  21932. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  21933. <dd><p>Normalize filter coefficients, by default is enabled.
  21934. Enabling it will normalize magnitude response at DC to 0dB.
  21935. </p>
  21936. </dd>
  21937. <dt>&lsquo;<samp>mix</samp>&rsquo;</dt>
  21938. <dd><p>How much to use filtered signal in output. Default is 1.
  21939. Range is between 0 and 1.
  21940. </p>
  21941. </dd>
  21942. <dt>&lsquo;<samp>response</samp>&rsquo;</dt>
  21943. <dd><p>Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream.
  21944. By default it is disabled.
  21945. </p>
  21946. </dd>
  21947. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  21948. <dd><p>Set for which IR channel to display frequency response. By default is first channel
  21949. displayed. This option is used only when <var>response</var> is enabled.
  21950. </p>
  21951. </dd>
  21952. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  21953. <dd><p>Set video stream size. This option is used only when <var>response</var> is enabled.
  21954. </p></dd>
  21955. </dl>
  21956. <p>Coefficients in <code>tf</code> format are separated by spaces and are in ascending
  21957. order.
  21958. </p>
  21959. <p>Coefficients in <code>zp</code> format are separated by spaces and order of coefficients
  21960. doesn&rsquo;t matter. Coefficients in <code>zp</code> format are complex numbers with <var>i</var>
  21961. imaginary unit.
  21962. </p>
  21963. <p>Different coefficients and gains can be provided for every channel, in such case
  21964. use &rsquo;|&rsquo; to separate coefficients or gains. Last provided coefficients will be
  21965. used for all remaining channels.
  21966. </p>
  21967. <a name="Examples-22"></a>
  21968. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-22">36.21.1 Examples</a></h3>
  21969. <ul>
  21970. <li>
  21971. Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate:
  21972. <div class="example">
  21973. <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
  21974. </pre></div>
  21975. </li><li>
  21976. Same as above but in <code>zp</code> format:
  21977. <div class="example">
  21978. <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
  21979. </pre></div>
  21980. </li></ul>
  21981. <a name="alimiter"></a>
  21982. <h2 class="section"><a href="ffmpeg-all.html#toc-alimiter">36.22 alimiter</a></h2>
  21983. <p>The limiter prevents an input signal from rising over a desired threshold.
  21984. This limiter uses lookahead technology to prevent your signal from distorting.
  21985. It means that there is a small delay after the signal is processed. Keep in mind
  21986. that the delay it produces is the attack time you set.
  21987. </p>
  21988. <p>The filter accepts the following options:
  21989. </p>
  21990. <dl compact="compact">
  21991. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  21992. <dd><p>Set input gain. Default is 1.
  21993. </p>
  21994. </dd>
  21995. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  21996. <dd><p>Set output gain. Default is 1.
  21997. </p>
  21998. </dd>
  21999. <dt>&lsquo;<samp>limit</samp>&rsquo;</dt>
  22000. <dd><p>Don&rsquo;t let signals above this level pass the limiter. Default is 1.
  22001. </p>
  22002. </dd>
  22003. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  22004. <dd><p>The limiter will reach its attenuation level in this amount of time in
  22005. milliseconds. Default is 5 milliseconds.
  22006. </p>
  22007. </dd>
  22008. <dt>&lsquo;<samp>release</samp>&rsquo;</dt>
  22009. <dd><p>Come back from limiting to attenuation 1.0 in this amount of milliseconds.
  22010. Default is 50 milliseconds.
  22011. </p>
  22012. </dd>
  22013. <dt>&lsquo;<samp>asc</samp>&rsquo;</dt>
  22014. <dd><p>When gain reduction is always needed ASC takes care of releasing to an
  22015. average reduction level rather than reaching a reduction of 0 in the release
  22016. time.
  22017. </p>
  22018. </dd>
  22019. <dt>&lsquo;<samp>asc_level</samp>&rsquo;</dt>
  22020. <dd><p>Select how much the release time is affected by ASC, 0 means nearly no changes
  22021. in release time while 1 produces higher release times.
  22022. </p>
  22023. </dd>
  22024. <dt>&lsquo;<samp>level</samp>&rsquo;</dt>
  22025. <dd><p>Auto level output signal. Default is enabled.
  22026. This normalizes audio back to 0dB if enabled.
  22027. </p></dd>
  22028. </dl>
  22029. <p>Depending on picked setting it is recommended to upsample input 2x or 4x times
  22030. with <a href="#aresample">aresample</a> before applying this filter.
  22031. </p>
  22032. <a name="allpass"></a>
  22033. <h2 class="section"><a href="ffmpeg-all.html#toc-allpass">36.23 allpass</a></h2>
  22034. <p>Apply a two-pole all-pass filter with central frequency (in Hz)
  22035. <var>frequency</var>, and filter-width <var>width</var>.
  22036. An all-pass filter changes the audio&rsquo;s frequency to phase relationship
  22037. without changing its frequency to amplitude relationship.
  22038. </p>
  22039. <p>The filter accepts the following options:
  22040. </p>
  22041. <dl compact="compact">
  22042. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  22043. <dd><p>Set frequency in Hz.
  22044. </p>
  22045. </dd>
  22046. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  22047. <dd><p>Set method to specify band-width of filter.
  22048. </p><dl compact="compact">
  22049. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  22050. <dd><p>Hz
  22051. </p></dd>
  22052. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  22053. <dd><p>Q-Factor
  22054. </p></dd>
  22055. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  22056. <dd><p>octave
  22057. </p></dd>
  22058. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  22059. <dd><p>slope
  22060. </p></dd>
  22061. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  22062. <dd><p>kHz
  22063. </p></dd>
  22064. </dl>
  22065. </dd>
  22066. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  22067. <dd><p>Specify the band-width of a filter in width_type units.
  22068. </p>
  22069. </dd>
  22070. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  22071. <dd><p>How much to use filtered signal in output. Default is 1.
  22072. Range is between 0 and 1.
  22073. </p>
  22074. </dd>
  22075. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  22076. <dd><p>Specify which channels to filter, by default all available are filtered.
  22077. </p>
  22078. </dd>
  22079. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  22080. <dd><p>Normalize biquad coefficients, by default is disabled.
  22081. Enabling it will normalize magnitude response at DC to 0dB.
  22082. </p>
  22083. </dd>
  22084. <dt>&lsquo;<samp>order, o</samp>&rsquo;</dt>
  22085. <dd><p>Set the filter order, can be 1 or 2. Default is 2.
  22086. </p></dd>
  22087. </dl>
  22088. <a name="Commands-1"></a>
  22089. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-1">36.23.1 Commands</a></h3>
  22090. <p>This filter supports the following commands:
  22091. </p><dl compact="compact">
  22092. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  22093. <dd><p>Change allpass frequency.
  22094. Syntax for the command is : &quot;<var>frequency</var>&quot;
  22095. </p>
  22096. </dd>
  22097. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  22098. <dd><p>Change allpass width_type.
  22099. Syntax for the command is : &quot;<var>width_type</var>&quot;
  22100. </p>
  22101. </dd>
  22102. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  22103. <dd><p>Change allpass width.
  22104. Syntax for the command is : &quot;<var>width</var>&quot;
  22105. </p>
  22106. </dd>
  22107. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  22108. <dd><p>Change allpass mix.
  22109. Syntax for the command is : &quot;<var>mix</var>&quot;
  22110. </p></dd>
  22111. </dl>
  22112. <a name="aloop"></a>
  22113. <h2 class="section"><a href="ffmpeg-all.html#toc-aloop">36.24 aloop</a></h2>
  22114. <p>Loop audio samples.
  22115. </p>
  22116. <p>The filter accepts the following options:
  22117. </p>
  22118. <dl compact="compact">
  22119. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  22120. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  22121. Default is 0.
  22122. </p>
  22123. </dd>
  22124. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  22125. <dd><p>Set maximal number of samples. Default is 0.
  22126. </p>
  22127. </dd>
  22128. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  22129. <dd><p>Set first sample of loop. Default is 0.
  22130. </p></dd>
  22131. </dl>
  22132. <p><a name="amerge"></a>
  22133. </p><a name="amerge-1"></a>
  22134. <h2 class="section"><a href="ffmpeg-all.html#toc-amerge-1">36.25 amerge</a></h2>
  22135. <p>Merge two or more audio streams into a single multi-channel stream.
  22136. </p>
  22137. <p>The filter accepts the following options:
  22138. </p>
  22139. <dl compact="compact">
  22140. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  22141. <dd><p>Set the number of inputs. Default is 2.
  22142. </p>
  22143. </dd>
  22144. </dl>
  22145. <p>If the channel layouts of the inputs are disjoint, and therefore compatible,
  22146. the channel layout of the output will be set accordingly and the channels
  22147. will be reordered as necessary. If the channel layouts of the inputs are not
  22148. disjoint, the output will have all the channels of the first input then all
  22149. the channels of the second input, in that order, and the channel layout of
  22150. the output will be the default value corresponding to the total number of
  22151. channels.
  22152. </p>
  22153. <p>For example, if the first input is in 2.1 (FL+FR+LF) and the second input
  22154. is FC+BL+BR, then the output will be in 5.1, with the channels in the
  22155. following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
  22156. first input, b1 is the first channel of the second input).
  22157. </p>
  22158. <p>On the other hand, if both input are in stereo, the output channels will be
  22159. in the default order: a1, a2, b1, b2, and the channel layout will be
  22160. arbitrarily set to 4.0, which may or may not be the expected value.
  22161. </p>
  22162. <p>All inputs must have the same sample rate, and format.
  22163. </p>
  22164. <p>If inputs do not have the same duration, the output will stop with the
  22165. shortest.
  22166. </p>
  22167. <a name="Examples-140"></a>
  22168. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-140">36.25.1 Examples</a></h3>
  22169. <ul>
  22170. <li>
  22171. Merge two mono files into a stereo stream:
  22172. <div class="example">
  22173. <pre class="example">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
  22174. </pre></div>
  22175. </li><li>
  22176. Multiple merges assuming 1 video stream and 6 audio streams in &lsquo;<tt>input.mkv</tt>&rsquo;:
  22177. <div class="example">
  22178. <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
  22179. </pre></div>
  22180. </li></ul>
  22181. <a name="amix"></a>
  22182. <h2 class="section"><a href="ffmpeg-all.html#toc-amix">36.26 amix</a></h2>
  22183. <p>Mixes multiple audio inputs into a single output.
  22184. </p>
  22185. <p>Note that this filter only supports float samples (the <var>amerge</var>
  22186. and <var>pan</var> audio filters support many formats). If the <var>amix</var>
  22187. input has integer samples then <a href="#aresample">aresample</a> will be automatically
  22188. inserted to perform the conversion to float samples.
  22189. </p>
  22190. <p>For example
  22191. </p><div class="example">
  22192. <pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
  22193. </pre></div>
  22194. <p>will mix 3 input audio streams to a single output with the same duration as the
  22195. first input and a dropout transition time of 3 seconds.
  22196. </p>
  22197. <p>It accepts the following parameters:
  22198. </p><dl compact="compact">
  22199. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  22200. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  22201. </p>
  22202. </dd>
  22203. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  22204. <dd><p>How to determine the end-of-stream.
  22205. </p><dl compact="compact">
  22206. <dt>&lsquo;<samp>longest</samp>&rsquo;</dt>
  22207. <dd><p>The duration of the longest input. (default)
  22208. </p>
  22209. </dd>
  22210. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  22211. <dd><p>The duration of the shortest input.
  22212. </p>
  22213. </dd>
  22214. <dt>&lsquo;<samp>first</samp>&rsquo;</dt>
  22215. <dd><p>The duration of the first input.
  22216. </p>
  22217. </dd>
  22218. </dl>
  22219. </dd>
  22220. <dt>&lsquo;<samp>dropout_transition</samp>&rsquo;</dt>
  22221. <dd><p>The transition time, in seconds, for volume renormalization when an input
  22222. stream ends. The default value is 2 seconds.
  22223. </p>
  22224. </dd>
  22225. <dt>&lsquo;<samp>weights</samp>&rsquo;</dt>
  22226. <dd><p>Specify weight of each input audio stream as sequence.
  22227. Each weight is separated by space. By default all inputs have same weight.
  22228. </p></dd>
  22229. </dl>
  22230. <a name="Commands-36"></a>
  22231. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-36">36.26.1 Commands</a></h3>
  22232. <p>This filter supports the following commands:
  22233. </p><dl compact="compact">
  22234. <dt>&lsquo;<samp>weights</samp>&rsquo;</dt>
  22235. <dd><p>Syntax is same as option with same name.
  22236. </p></dd>
  22237. </dl>
  22238. <a name="amultiply"></a>
  22239. <h2 class="section"><a href="ffmpeg-all.html#toc-amultiply">36.27 amultiply</a></h2>
  22240. <p>Multiply first audio stream with second audio stream and store result
  22241. in output audio stream. Multiplication is done by multiplying each
  22242. sample from first stream with sample at same position from second stream.
  22243. </p>
  22244. <p>With this element-wise multiplication one can create amplitude fades and
  22245. amplitude modulations.
  22246. </p>
  22247. <a name="anequalizer"></a>
  22248. <h2 class="section"><a href="ffmpeg-all.html#toc-anequalizer">36.28 anequalizer</a></h2>
  22249. <p>High-order parametric multiband equalizer for each channel.
  22250. </p>
  22251. <p>It accepts the following parameters:
  22252. </p><dl compact="compact">
  22253. <dt>&lsquo;<samp>params</samp>&rsquo;</dt>
  22254. <dd>
  22255. <p>This option string is in format:
  22256. &quot;c<var>chn</var> f=<var>cf</var> w=<var>w</var> g=<var>g</var> t=<var>f</var> | ...&quot;
  22257. Each equalizer band is separated by &rsquo;|&rsquo;.
  22258. </p>
  22259. <dl compact="compact">
  22260. <dt>&lsquo;<samp>chn</samp>&rsquo;</dt>
  22261. <dd><p>Set channel number to which equalization will be applied.
  22262. If input doesn&rsquo;t have that channel the entry is ignored.
  22263. </p>
  22264. </dd>
  22265. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  22266. <dd><p>Set central frequency for band.
  22267. If input doesn&rsquo;t have that frequency the entry is ignored.
  22268. </p>
  22269. </dd>
  22270. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  22271. <dd><p>Set band width in hertz.
  22272. </p>
  22273. </dd>
  22274. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  22275. <dd><p>Set band gain in dB.
  22276. </p>
  22277. </dd>
  22278. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  22279. <dd><p>Set filter type for band, optional, can be:
  22280. </p>
  22281. <dl compact="compact">
  22282. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  22283. <dd><p>Butterworth, this is default.
  22284. </p>
  22285. </dd>
  22286. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  22287. <dd><p>Chebyshev type 1.
  22288. </p>
  22289. </dd>
  22290. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  22291. <dd><p>Chebyshev type 2.
  22292. </p></dd>
  22293. </dl>
  22294. </dd>
  22295. </dl>
  22296. </dd>
  22297. <dt>&lsquo;<samp>curves</samp>&rsquo;</dt>
  22298. <dd><p>With this option activated frequency response of anequalizer is displayed
  22299. in video stream.
  22300. </p>
  22301. </dd>
  22302. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  22303. <dd><p>Set video stream size. Only useful if curves option is activated.
  22304. </p>
  22305. </dd>
  22306. <dt>&lsquo;<samp>mgain</samp>&rsquo;</dt>
  22307. <dd><p>Set max gain that will be displayed. Only useful if curves option is activated.
  22308. Setting this to a reasonable value makes it possible to display gain which is derived from
  22309. neighbour bands which are too close to each other and thus produce higher gain
  22310. when both are activated.
  22311. </p>
  22312. </dd>
  22313. <dt>&lsquo;<samp>fscale</samp>&rsquo;</dt>
  22314. <dd><p>Set frequency scale used to draw frequency response in video output.
  22315. Can be linear or logarithmic. Default is logarithmic.
  22316. </p>
  22317. </dd>
  22318. <dt>&lsquo;<samp>colors</samp>&rsquo;</dt>
  22319. <dd><p>Set color for each channel curve which is going to be displayed in video stream.
  22320. This is list of color names separated by space or by &rsquo;|&rsquo;.
  22321. Unrecognised or missing colors will be replaced by white color.
  22322. </p></dd>
  22323. </dl>
  22324. <a name="Examples-101"></a>
  22325. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-101">36.28.1 Examples</a></h3>
  22326. <ul>
  22327. <li>
  22328. Lower gain by 10 of central frequency 200Hz and width 100 Hz
  22329. for first 2 channels using Chebyshev type 1 filter:
  22330. <div class="example">
  22331. <pre class="example">anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
  22332. </pre></div>
  22333. </li></ul>
  22334. <a name="Commands-30"></a>
  22335. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-30">36.28.2 Commands</a></h3>
  22336. <p>This filter supports the following commands:
  22337. </p><dl compact="compact">
  22338. <dt>&lsquo;<samp>change</samp>&rsquo;</dt>
  22339. <dd><p>Alter existing filter parameters.
  22340. Syntax for the commands is : &quot;<var>fN</var>|f=<var>freq</var>|w=<var>width</var>|g=<var>gain</var>&quot;
  22341. </p>
  22342. <p><var>fN</var> is existing filter number, starting from 0, if no such filter is available
  22343. error is returned.
  22344. <var>freq</var> set new frequency parameter.
  22345. <var>width</var> set new width parameter in herz.
  22346. <var>gain</var> set new gain parameter in dB.
  22347. </p>
  22348. <p>Full filter invocation with asendcmd may look like this:
  22349. asendcmd=c=&rsquo;4.0 anequalizer change 0|f=200|w=50|g=1&rsquo;,anequalizer=...
  22350. </p></dd>
  22351. </dl>
  22352. <a name="anlmdn"></a>
  22353. <h2 class="section"><a href="ffmpeg-all.html#toc-anlmdn">36.29 anlmdn</a></h2>
  22354. <p>Reduce broadband noise in audio samples using Non-Local Means algorithm.
  22355. </p>
  22356. <p>Each sample is adjusted by looking for other samples with similar contexts. This
  22357. context similarity is defined by comparing their surrounding patches of size
  22358. &lsquo;<samp>p</samp>&rsquo;. Patches are searched in an area of &lsquo;<samp>r</samp>&rsquo; around the sample.
  22359. </p>
  22360. <p>The filter accepts the following options:
  22361. </p>
  22362. <dl compact="compact">
  22363. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  22364. <dd><p>Set denoising strength. Allowed range is from 0.00001 to 10. Default value is 0.00001.
  22365. </p>
  22366. </dd>
  22367. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  22368. <dd><p>Set patch radius duration. Allowed range is from 1 to 100 milliseconds.
  22369. Default value is 2 milliseconds.
  22370. </p>
  22371. </dd>
  22372. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  22373. <dd><p>Set research radius duration. Allowed range is from 2 to 300 milliseconds.
  22374. Default value is 6 milliseconds.
  22375. </p>
  22376. </dd>
  22377. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  22378. <dd><p>Set the output mode.
  22379. </p>
  22380. <p>It accepts the following values:
  22381. </p><dl compact="compact">
  22382. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  22383. <dd><p>Pass input unchanged.
  22384. </p>
  22385. </dd>
  22386. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  22387. <dd><p>Pass noise filtered out.
  22388. </p>
  22389. </dd>
  22390. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  22391. <dd><p>Pass only noise.
  22392. </p>
  22393. <p>Default value is <var>o</var>.
  22394. </p></dd>
  22395. </dl>
  22396. </dd>
  22397. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  22398. <dd><p>Set smooth factor. Default value is <var>11</var>. Allowed range is from <var>1</var> to <var>15</var>.
  22399. </p></dd>
  22400. </dl>
  22401. <a name="Commands-15"></a>
  22402. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-15">36.29.1 Commands</a></h3>
  22403. <p>This filter supports the following commands:
  22404. </p><dl compact="compact">
  22405. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  22406. <dd><p>Change denoise strength. Argument is single float number.
  22407. Syntax for the command is : &quot;<var>s</var>&quot;
  22408. </p>
  22409. </dd>
  22410. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  22411. <dd><p>Change output mode.
  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="anlms"></a>
  22416. <h2 class="section"><a href="ffmpeg-all.html#toc-anlms">36.30 anlms</a></h2>
  22417. <p>Apply Normalized Least-Mean-Squares algorithm to the first audio stream using the second audio stream.
  22418. </p>
  22419. <p>This adaptive filter is used to mimic a desired filter by finding the filter coefficients that
  22420. relate to producing the least mean square of the error signal (difference between the desired,
  22421. 2nd input audio stream and the actual signal, the 1st input audio stream).
  22422. </p>
  22423. <p>A description of the accepted options follows.
  22424. </p>
  22425. <dl compact="compact">
  22426. <dt>&lsquo;<samp>order</samp>&rsquo;</dt>
  22427. <dd><p>Set filter order.
  22428. </p>
  22429. </dd>
  22430. <dt>&lsquo;<samp>mu</samp>&rsquo;</dt>
  22431. <dd><p>Set filter mu.
  22432. </p>
  22433. </dd>
  22434. <dt>&lsquo;<samp>eps</samp>&rsquo;</dt>
  22435. <dd><p>Set the filter eps.
  22436. </p>
  22437. </dd>
  22438. <dt>&lsquo;<samp>leakage</samp>&rsquo;</dt>
  22439. <dd><p>Set the filter leakage.
  22440. </p>
  22441. </dd>
  22442. <dt>&lsquo;<samp>out_mode</samp>&rsquo;</dt>
  22443. <dd><p>It accepts the following values:
  22444. </p><dl compact="compact">
  22445. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  22446. <dd><p>Pass the 1st input.
  22447. </p>
  22448. </dd>
  22449. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  22450. <dd><p>Pass the 2nd input.
  22451. </p>
  22452. </dd>
  22453. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  22454. <dd><p>Pass filtered samples.
  22455. </p>
  22456. </dd>
  22457. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  22458. <dd><p>Pass difference between desired and filtered samples.
  22459. </p>
  22460. <p>Default value is <var>o</var>.
  22461. </p></dd>
  22462. </dl>
  22463. </dd>
  22464. </dl>
  22465. <a name="Examples-13"></a>
  22466. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-13">36.30.1 Examples</a></h3>
  22467. <ul>
  22468. <li>
  22469. One of many usages of this filter is noise reduction, input audio is filtered
  22470. with same samples that are delayed by fixed amount, one such example for stereo audio is:
  22471. <div class="example">
  22472. <pre class="example">asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o
  22473. </pre></div>
  22474. </li></ul>
  22475. <a name="Commands-44"></a>
  22476. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-44">36.30.2 Commands</a></h3>
  22477. <p>This filter supports the same commands as options, excluding option <code>order</code>.
  22478. </p>
  22479. <a name="anull"></a>
  22480. <h2 class="section"><a href="ffmpeg-all.html#toc-anull">36.31 anull</a></h2>
  22481. <p>Pass the audio source unchanged to the output.
  22482. </p>
  22483. <a name="apad"></a>
  22484. <h2 class="section"><a href="ffmpeg-all.html#toc-apad">36.32 apad</a></h2>
  22485. <p>Pad the end of an audio stream with silence.
  22486. </p>
  22487. <p>This can be used together with <code>ffmpeg</code> &lsquo;<samp>-shortest</samp>&rsquo; to
  22488. extend audio streams to the same length as the video stream.
  22489. </p>
  22490. <p>A description of the accepted options follows.
  22491. </p>
  22492. <dl compact="compact">
  22493. <dt>&lsquo;<samp>packet_size</samp>&rsquo;</dt>
  22494. <dd><p>Set silence packet size. Default value is 4096.
  22495. </p>
  22496. </dd>
  22497. <dt>&lsquo;<samp>pad_len</samp>&rsquo;</dt>
  22498. <dd><p>Set the number of samples of silence to add to the end. After the
  22499. value is reached, the stream is terminated. This option is mutually
  22500. exclusive with &lsquo;<samp>whole_len</samp>&rsquo;.
  22501. </p>
  22502. </dd>
  22503. <dt>&lsquo;<samp>whole_len</samp>&rsquo;</dt>
  22504. <dd><p>Set the minimum total number of samples in the output audio stream. If
  22505. the value is longer than the input audio length, silence is added to
  22506. the end, until the value is reached. This option is mutually exclusive
  22507. with &lsquo;<samp>pad_len</samp>&rsquo;.
  22508. </p>
  22509. </dd>
  22510. <dt>&lsquo;<samp>pad_dur</samp>&rsquo;</dt>
  22511. <dd><p>Specify the duration of samples of silence to add. See
  22512. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  22513. for the accepted syntax. Used only if set to non-zero value.
  22514. </p>
  22515. </dd>
  22516. <dt>&lsquo;<samp>whole_dur</samp>&rsquo;</dt>
  22517. <dd><p>Specify the minimum total duration in the output audio stream. See
  22518. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  22519. for the accepted syntax. Used only if set to non-zero value. If the value is longer than
  22520. the input audio length, silence is added to the end, until the value is reached.
  22521. This option is mutually exclusive with &lsquo;<samp>pad_dur</samp>&rsquo;
  22522. </p></dd>
  22523. </dl>
  22524. <p>If neither the &lsquo;<samp>pad_len</samp>&rsquo; nor the &lsquo;<samp>whole_len</samp>&rsquo; nor &lsquo;<samp>pad_dur</samp>&rsquo;
  22525. nor &lsquo;<samp>whole_dur</samp>&rsquo; option is set, the filter will add silence to the end of
  22526. the input stream indefinitely.
  22527. </p>
  22528. <a name="Examples-14"></a>
  22529. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-14">36.32.1 Examples</a></h3>
  22530. <ul>
  22531. <li>
  22532. Add 1024 samples of silence to the end of the input:
  22533. <div class="example">
  22534. <pre class="example">apad=pad_len=1024
  22535. </pre></div>
  22536. </li><li>
  22537. Make sure the audio output will contain at least 10000 samples, pad
  22538. the input with silence if required:
  22539. <div class="example">
  22540. <pre class="example">apad=whole_len=10000
  22541. </pre></div>
  22542. </li><li>
  22543. Use <code>ffmpeg</code> to pad the audio input with silence, so that the
  22544. video stream will always result the shortest and will be converted
  22545. until the end in the output file when using the &lsquo;<samp>shortest</samp>&rsquo;
  22546. option:
  22547. <div class="example">
  22548. <pre class="example">ffmpeg -i VIDEO -i AUDIO -filter_complex &quot;[1:0]apad&quot; -shortest OUTPUT
  22549. </pre></div>
  22550. </li></ul>
  22551. <a name="aphaser"></a>
  22552. <h2 class="section"><a href="ffmpeg-all.html#toc-aphaser">36.33 aphaser</a></h2>
  22553. <p>Add a phasing effect to the input audio.
  22554. </p>
  22555. <p>A phaser filter creates series of peaks and troughs in the frequency spectrum.
  22556. The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
  22557. </p>
  22558. <p>A description of the accepted parameters follows.
  22559. </p>
  22560. <dl compact="compact">
  22561. <dt>&lsquo;<samp>in_gain</samp>&rsquo;</dt>
  22562. <dd><p>Set input gain. Default is 0.4.
  22563. </p>
  22564. </dd>
  22565. <dt>&lsquo;<samp>out_gain</samp>&rsquo;</dt>
  22566. <dd><p>Set output gain. Default is 0.74
  22567. </p>
  22568. </dd>
  22569. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  22570. <dd><p>Set delay in milliseconds. Default is 3.0.
  22571. </p>
  22572. </dd>
  22573. <dt>&lsquo;<samp>decay</samp>&rsquo;</dt>
  22574. <dd><p>Set decay. Default is 0.4.
  22575. </p>
  22576. </dd>
  22577. <dt>&lsquo;<samp>speed</samp>&rsquo;</dt>
  22578. <dd><p>Set modulation speed in Hz. Default is 0.5.
  22579. </p>
  22580. </dd>
  22581. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  22582. <dd><p>Set modulation type. Default is triangular.
  22583. </p>
  22584. <p>It accepts the following values:
  22585. </p><dl compact="compact">
  22586. <dt>&lsquo;<samp>triangular, t</samp>&rsquo;</dt>
  22587. <dt>&lsquo;<samp>sinusoidal, s</samp>&rsquo;</dt>
  22588. </dl>
  22589. </dd>
  22590. </dl>
  22591. <a name="apulsator"></a>
  22592. <h2 class="section"><a href="ffmpeg-all.html#toc-apulsator">36.34 apulsator</a></h2>
  22593. <p>Audio pulsator is something between an autopanner and a tremolo.
  22594. But it can produce funny stereo effects as well. Pulsator changes the volume
  22595. of the left and right channel based on a LFO (low frequency oscillator) with
  22596. different waveforms and shifted phases.
  22597. This filter have the ability to define an offset between left and right
  22598. channel. An offset of 0 means that both LFO shapes match each other.
  22599. The left and right channel are altered equally - a conventional tremolo.
  22600. An offset of 50% means that the shape of the right channel is exactly shifted
  22601. in phase (or moved backwards about half of the frequency) - pulsator acts as
  22602. an autopanner. At 1 both curves match again. Every setting in between moves the
  22603. phase shift gapless between all stages and produces some &quot;bypassing&quot; sounds with
  22604. sine and triangle waveforms. The more you set the offset near 1 (starting from
  22605. the 0.5) the faster the signal passes from the left to the right speaker.
  22606. </p>
  22607. <p>The filter accepts the following options:
  22608. </p>
  22609. <dl compact="compact">
  22610. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  22611. <dd><p>Set input gain. By default it is 1. Range is [0.015625 - 64].
  22612. </p>
  22613. </dd>
  22614. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  22615. <dd><p>Set output gain. By default it is 1. Range is [0.015625 - 64].
  22616. </p>
  22617. </dd>
  22618. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  22619. <dd><p>Set waveform shape the LFO will use. Can be one of: sine, triangle, square,
  22620. sawup or sawdown. Default is sine.
  22621. </p>
  22622. </dd>
  22623. <dt>&lsquo;<samp>amount</samp>&rsquo;</dt>
  22624. <dd><p>Set modulation. Define how much of original signal is affected by the LFO.
  22625. </p>
  22626. </dd>
  22627. <dt>&lsquo;<samp>offset_l</samp>&rsquo;</dt>
  22628. <dd><p>Set left channel offset. Default is 0. Allowed range is [0 - 1].
  22629. </p>
  22630. </dd>
  22631. <dt>&lsquo;<samp>offset_r</samp>&rsquo;</dt>
  22632. <dd><p>Set right channel offset. Default is 0.5. Allowed range is [0 - 1].
  22633. </p>
  22634. </dd>
  22635. <dt>&lsquo;<samp>width</samp>&rsquo;</dt>
  22636. <dd><p>Set pulse width. Default is 1. Allowed range is [0 - 2].
  22637. </p>
  22638. </dd>
  22639. <dt>&lsquo;<samp>timing</samp>&rsquo;</dt>
  22640. <dd><p>Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz.
  22641. </p>
  22642. </dd>
  22643. <dt>&lsquo;<samp>bpm</samp>&rsquo;</dt>
  22644. <dd><p>Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing
  22645. is set to bpm.
  22646. </p>
  22647. </dd>
  22648. <dt>&lsquo;<samp>ms</samp>&rsquo;</dt>
  22649. <dd><p>Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing
  22650. is set to ms.
  22651. </p>
  22652. </dd>
  22653. <dt>&lsquo;<samp>hz</samp>&rsquo;</dt>
  22654. <dd><p>Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used
  22655. if timing is set to hz.
  22656. </p></dd>
  22657. </dl>
  22658. <p><a name="aresample"></a>
  22659. </p><a name="aresample-1"></a>
  22660. <h2 class="section"><a href="ffmpeg-all.html#toc-aresample-1">36.35 aresample</a></h2>
  22661. <p>Resample the input audio to the specified parameters, using the
  22662. libswresample library. If none are specified then the filter will
  22663. automatically convert between its input and output.
  22664. </p>
  22665. <p>This filter is also able to stretch/squeeze the audio data to make it match
  22666. the timestamps or to inject silence / cut out audio to make it match the
  22667. timestamps, do a combination of both or do neither.
  22668. </p>
  22669. <p>The filter accepts the syntax
  22670. [<var>sample_rate</var>:]<var>resampler_options</var>, where <var>sample_rate</var>
  22671. expresses a sample rate and <var>resampler_options</var> is a list of
  22672. <var>key</var>=<var>value</var> pairs, separated by &quot;:&quot;. See the
  22673. <a href="ffmpeg-resampler.html#Resampler-Options">(ffmpeg-resampler)&quot;Resampler Options&quot; section in the ffmpeg-resampler(1) manual</a>
  22674. for the complete list of supported options.
  22675. </p>
  22676. <a name="Examples-92"></a>
  22677. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-92">36.35.1 Examples</a></h3>
  22678. <ul>
  22679. <li>
  22680. Resample the input audio to 44100Hz:
  22681. <div class="example">
  22682. <pre class="example">aresample=44100
  22683. </pre></div>
  22684. </li><li>
  22685. Stretch/squeeze samples to the given timestamps, with a maximum of 1000
  22686. samples per second compensation:
  22687. <div class="example">
  22688. <pre class="example">aresample=async=1000
  22689. </pre></div>
  22690. </li></ul>
  22691. <a name="areverse"></a>
  22692. <h2 class="section"><a href="ffmpeg-all.html#toc-areverse">36.36 areverse</a></h2>
  22693. <p>Reverse an audio clip.
  22694. </p>
  22695. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  22696. is suggested.
  22697. </p>
  22698. <a name="Examples-148"></a>
  22699. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-148">36.36.1 Examples</a></h3>
  22700. <ul>
  22701. <li>
  22702. Take the first 5 seconds of a clip, and reverse it.
  22703. <div class="example">
  22704. <pre class="example">atrim=end=5,areverse
  22705. </pre></div>
  22706. </li></ul>
  22707. <a name="arnndn"></a>
  22708. <h2 class="section"><a href="ffmpeg-all.html#toc-arnndn">36.37 arnndn</a></h2>
  22709. <p>Reduce noise from speech using Recurrent Neural Networks.
  22710. </p>
  22711. <p>This filter accepts the following options:
  22712. </p>
  22713. <dl compact="compact">
  22714. <dt>&lsquo;<samp>model, m</samp>&rsquo;</dt>
  22715. <dd><p>Set train model file to load. This option is always required.
  22716. </p></dd>
  22717. </dl>
  22718. <a name="asetnsamples"></a>
  22719. <h2 class="section"><a href="ffmpeg-all.html#toc-asetnsamples">36.38 asetnsamples</a></h2>
  22720. <p>Set the number of samples per each output audio frame.
  22721. </p>
  22722. <p>The last output packet may contain a different number of samples, as
  22723. the filter will flush all the remaining samples when the input audio
  22724. signals its end.
  22725. </p>
  22726. <p>The filter accepts the following options:
  22727. </p>
  22728. <dl compact="compact">
  22729. <dt>&lsquo;<samp>nb_out_samples, n</samp>&rsquo;</dt>
  22730. <dd><p>Set the number of frames per each output audio frame. The number is
  22731. intended as the number of samples <em>per each channel</em>.
  22732. Default value is 1024.
  22733. </p>
  22734. </dd>
  22735. <dt>&lsquo;<samp>pad, p</samp>&rsquo;</dt>
  22736. <dd><p>If set to 1, the filter will pad the last audio frame with zeroes, so
  22737. that the last frame will contain the same number of samples as the
  22738. previous ones. Default value is 1.
  22739. </p></dd>
  22740. </dl>
  22741. <p>For example, to set the number of per-frame samples to 1234 and
  22742. disable padding for the last frame, use:
  22743. </p><div class="example">
  22744. <pre class="example">asetnsamples=n=1234:p=0
  22745. </pre></div>
  22746. <a name="asetrate"></a>
  22747. <h2 class="section"><a href="ffmpeg-all.html#toc-asetrate">36.39 asetrate</a></h2>
  22748. <p>Set the sample rate without altering the PCM data.
  22749. This will result in a change of speed and pitch.
  22750. </p>
  22751. <p>The filter accepts the following options:
  22752. </p>
  22753. <dl compact="compact">
  22754. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  22755. <dd><p>Set the output sample rate. Default is 44100 Hz.
  22756. </p></dd>
  22757. </dl>
  22758. <a name="ashowinfo"></a>
  22759. <h2 class="section"><a href="ffmpeg-all.html#toc-ashowinfo">36.40 ashowinfo</a></h2>
  22760. <p>Show a line containing various information for each input audio frame.
  22761. The input audio is not modified.
  22762. </p>
  22763. <p>The shown line contains a sequence of key/value pairs of the form
  22764. <var>key</var>:<var>value</var>.
  22765. </p>
  22766. <p>The following values are shown in the output:
  22767. </p>
  22768. <dl compact="compact">
  22769. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  22770. <dd><p>The (sequential) number of the input frame, starting from 0.
  22771. </p>
  22772. </dd>
  22773. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  22774. <dd><p>The presentation timestamp of the input frame, in time base units; the time base
  22775. depends on the filter input pad, and is usually 1/<var>sample_rate</var>.
  22776. </p>
  22777. </dd>
  22778. <dt>&lsquo;<samp>pts_time</samp>&rsquo;</dt>
  22779. <dd><p>The presentation timestamp of the input frame in seconds.
  22780. </p>
  22781. </dd>
  22782. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  22783. <dd><p>position of the frame in the input stream, -1 if this information in
  22784. unavailable and/or meaningless (for example in case of synthetic audio)
  22785. </p>
  22786. </dd>
  22787. <dt>&lsquo;<samp>fmt</samp>&rsquo;</dt>
  22788. <dd><p>The sample format.
  22789. </p>
  22790. </dd>
  22791. <dt>&lsquo;<samp>chlayout</samp>&rsquo;</dt>
  22792. <dd><p>The channel layout.
  22793. </p>
  22794. </dd>
  22795. <dt>&lsquo;<samp>rate</samp>&rsquo;</dt>
  22796. <dd><p>The sample rate for the audio frame.
  22797. </p>
  22798. </dd>
  22799. <dt>&lsquo;<samp>nb_samples</samp>&rsquo;</dt>
  22800. <dd><p>The number of samples (per channel) in the frame.
  22801. </p>
  22802. </dd>
  22803. <dt>&lsquo;<samp>checksum</samp>&rsquo;</dt>
  22804. <dd><p>The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
  22805. audio, the data is treated as if all the planes were concatenated.
  22806. </p>
  22807. </dd>
  22808. <dt>&lsquo;<samp>plane_checksums</samp>&rsquo;</dt>
  22809. <dd><p>A list of Adler-32 checksums for each data plane.
  22810. </p></dd>
  22811. </dl>
  22812. <a name="asoftclip"></a>
  22813. <h2 class="section"><a href="ffmpeg-all.html#toc-asoftclip">36.41 asoftclip</a></h2>
  22814. <p>Apply audio soft clipping.
  22815. </p>
  22816. <p>Soft clipping is a type of distortion effect where the amplitude of a signal is saturated
  22817. along a smooth curve, rather than the abrupt shape of hard-clipping.
  22818. </p>
  22819. <p>This filter accepts the following options:
  22820. </p>
  22821. <dl compact="compact">
  22822. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  22823. <dd><p>Set type of soft-clipping.
  22824. </p>
  22825. <p>It accepts the following values:
  22826. </p><dl compact="compact">
  22827. <dt>&lsquo;<samp>tanh</samp>&rsquo;</dt>
  22828. <dt>&lsquo;<samp>atan</samp>&rsquo;</dt>
  22829. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  22830. <dt>&lsquo;<samp>exp</samp>&rsquo;</dt>
  22831. <dt>&lsquo;<samp>alg</samp>&rsquo;</dt>
  22832. <dt>&lsquo;<samp>quintic</samp>&rsquo;</dt>
  22833. <dt>&lsquo;<samp>sin</samp>&rsquo;</dt>
  22834. </dl>
  22835. </dd>
  22836. <dt>&lsquo;<samp>param</samp>&rsquo;</dt>
  22837. <dd><p>Set additional parameter which controls sigmoid function.
  22838. </p></dd>
  22839. </dl>
  22840. <a name="Commands-45"></a>
  22841. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-45">36.41.1 Commands</a></h3>
  22842. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  22843. </p>
  22844. <a name="asr"></a>
  22845. <h2 class="section"><a href="ffmpeg-all.html#toc-asr">36.42 asr</a></h2>
  22846. <p>Automatic Speech Recognition
  22847. </p>
  22848. <p>This filter uses PocketSphinx for speech recognition. To enable
  22849. compilation of this filter, you need to configure FFmpeg with
  22850. <code>--enable-pocketsphinx</code>.
  22851. </p>
  22852. <p>It accepts the following options:
  22853. </p>
  22854. <dl compact="compact">
  22855. <dt>&lsquo;<samp>rate</samp>&rsquo;</dt>
  22856. <dd><p>Set sampling rate of input audio. Defaults is <code>16000</code>.
  22857. This need to match speech models, otherwise one will get poor results.
  22858. </p>
  22859. </dd>
  22860. <dt>&lsquo;<samp>hmm</samp>&rsquo;</dt>
  22861. <dd><p>Set dictionary containing acoustic model files.
  22862. </p>
  22863. </dd>
  22864. <dt>&lsquo;<samp>dict</samp>&rsquo;</dt>
  22865. <dd><p>Set pronunciation dictionary.
  22866. </p>
  22867. </dd>
  22868. <dt>&lsquo;<samp>lm</samp>&rsquo;</dt>
  22869. <dd><p>Set language model file.
  22870. </p>
  22871. </dd>
  22872. <dt>&lsquo;<samp>lmctl</samp>&rsquo;</dt>
  22873. <dd><p>Set language model set.
  22874. </p>
  22875. </dd>
  22876. <dt>&lsquo;<samp>lmname</samp>&rsquo;</dt>
  22877. <dd><p>Set which language model to use.
  22878. </p>
  22879. </dd>
  22880. <dt>&lsquo;<samp>logfn</samp>&rsquo;</dt>
  22881. <dd><p>Set output for log messages.
  22882. </p></dd>
  22883. </dl>
  22884. <p>The filter exports recognized speech as the frame metadata <code>lavfi.asr.text</code>.
  22885. </p>
  22886. <p><a name="astats"></a>
  22887. </p><a name="astats-1"></a>
  22888. <h2 class="section"><a href="ffmpeg-all.html#toc-astats-1">36.43 astats</a></h2>
  22889. <p>Display time domain statistical information about the audio channels.
  22890. Statistics are calculated and displayed for each audio channel and,
  22891. where applicable, an overall figure is also given.
  22892. </p>
  22893. <p>It accepts the following option:
  22894. </p><dl compact="compact">
  22895. <dt>&lsquo;<samp>length</samp>&rsquo;</dt>
  22896. <dd><p>Short window length in seconds, used for peak and trough RMS measurement.
  22897. Default is <code>0.05</code> (50 milliseconds). Allowed range is <code>[0.01 - 10]</code>.
  22898. </p>
  22899. </dd>
  22900. <dt>&lsquo;<samp>metadata</samp>&rsquo;</dt>
  22901. <dd>
  22902. <p>Set metadata injection. All the metadata keys are prefixed with <code>lavfi.astats.X</code>,
  22903. where <code>X</code> is channel number starting from 1 or string <code>Overall</code>. Default is
  22904. disabled.
  22905. </p>
  22906. <p>Available keys for each channel are:
  22907. DC_offset
  22908. Min_level
  22909. Max_level
  22910. Min_difference
  22911. Max_difference
  22912. Mean_difference
  22913. RMS_difference
  22914. Peak_level
  22915. RMS_peak
  22916. RMS_trough
  22917. Crest_factor
  22918. Flat_factor
  22919. Peak_count
  22920. Noise_floor
  22921. Noise_floor_count
  22922. Bit_depth
  22923. Dynamic_range
  22924. Zero_crossings
  22925. Zero_crossings_rate
  22926. Number_of_NaNs
  22927. Number_of_Infs
  22928. Number_of_denormals
  22929. </p>
  22930. <p>and for Overall:
  22931. DC_offset
  22932. Min_level
  22933. Max_level
  22934. Min_difference
  22935. Max_difference
  22936. Mean_difference
  22937. RMS_difference
  22938. Peak_level
  22939. RMS_level
  22940. RMS_peak
  22941. RMS_trough
  22942. Flat_factor
  22943. Peak_count
  22944. Noise_floor
  22945. Noise_floor_count
  22946. Bit_depth
  22947. Number_of_samples
  22948. Number_of_NaNs
  22949. Number_of_Infs
  22950. Number_of_denormals
  22951. </p>
  22952. <p>For example full key look like this <code>lavfi.astats.1.DC_offset</code> or
  22953. this <code>lavfi.astats.Overall.Peak_count</code>.
  22954. </p>
  22955. <p>For description what each key means read below.
  22956. </p>
  22957. </dd>
  22958. <dt>&lsquo;<samp>reset</samp>&rsquo;</dt>
  22959. <dd><p>Set number of frame after which stats are going to be recalculated.
  22960. Default is disabled.
  22961. </p>
  22962. </dd>
  22963. <dt>&lsquo;<samp>measure_perchannel</samp>&rsquo;</dt>
  22964. <dd><p>Select the entries which need to be measured per channel. The metadata keys can
  22965. be used as flags, default is &lsquo;<samp>all</samp>&rsquo; which measures everything.
  22966. &lsquo;<samp>none</samp>&rsquo; disables all per channel measurement.
  22967. </p>
  22968. </dd>
  22969. <dt>&lsquo;<samp>measure_overall</samp>&rsquo;</dt>
  22970. <dd><p>Select the entries which need to be measured overall. The metadata keys can
  22971. be used as flags, default is &lsquo;<samp>all</samp>&rsquo; which measures everything.
  22972. &lsquo;<samp>none</samp>&rsquo; disables all overall measurement.
  22973. </p>
  22974. </dd>
  22975. </dl>
  22976. <p>A description of each shown parameter follows:
  22977. </p>
  22978. <dl compact="compact">
  22979. <dt>&lsquo;<samp>DC offset</samp>&rsquo;</dt>
  22980. <dd><p>Mean amplitude displacement from zero.
  22981. </p>
  22982. </dd>
  22983. <dt>&lsquo;<samp>Min level</samp>&rsquo;</dt>
  22984. <dd><p>Minimal sample level.
  22985. </p>
  22986. </dd>
  22987. <dt>&lsquo;<samp>Max level</samp>&rsquo;</dt>
  22988. <dd><p>Maximal sample level.
  22989. </p>
  22990. </dd>
  22991. <dt>&lsquo;<samp>Min difference</samp>&rsquo;</dt>
  22992. <dd><p>Minimal difference between two consecutive samples.
  22993. </p>
  22994. </dd>
  22995. <dt>&lsquo;<samp>Max difference</samp>&rsquo;</dt>
  22996. <dd><p>Maximal difference between two consecutive samples.
  22997. </p>
  22998. </dd>
  22999. <dt>&lsquo;<samp>Mean difference</samp>&rsquo;</dt>
  23000. <dd><p>Mean difference between two consecutive samples.
  23001. The average of each difference between two consecutive samples.
  23002. </p>
  23003. </dd>
  23004. <dt>&lsquo;<samp>RMS difference</samp>&rsquo;</dt>
  23005. <dd><p>Root Mean Square difference between two consecutive samples.
  23006. </p>
  23007. </dd>
  23008. <dt>&lsquo;<samp>Peak level dB</samp>&rsquo;</dt>
  23009. <dt>&lsquo;<samp>RMS level dB</samp>&rsquo;</dt>
  23010. <dd><p>Standard peak and RMS level measured in dBFS.
  23011. </p>
  23012. </dd>
  23013. <dt>&lsquo;<samp>RMS peak dB</samp>&rsquo;</dt>
  23014. <dt>&lsquo;<samp>RMS trough dB</samp>&rsquo;</dt>
  23015. <dd><p>Peak and trough values for RMS level measured over a short window.
  23016. </p>
  23017. </dd>
  23018. <dt>&lsquo;<samp>Crest factor</samp>&rsquo;</dt>
  23019. <dd><p>Standard ratio of peak to RMS level (note: not in dB).
  23020. </p>
  23021. </dd>
  23022. <dt>&lsquo;<samp>Flat factor</samp>&rsquo;</dt>
  23023. <dd><p>Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
  23024. (i.e. either <var>Min level</var> or <var>Max level</var>).
  23025. </p>
  23026. </dd>
  23027. <dt>&lsquo;<samp>Peak count</samp>&rsquo;</dt>
  23028. <dd><p>Number of occasions (not the number of samples) that the signal attained either
  23029. <var>Min level</var> or <var>Max level</var>.
  23030. </p>
  23031. </dd>
  23032. <dt>&lsquo;<samp>Noise floor dB</samp>&rsquo;</dt>
  23033. <dd><p>Minimum local peak measured in dBFS over a short window.
  23034. </p>
  23035. </dd>
  23036. <dt>&lsquo;<samp>Noise floor count</samp>&rsquo;</dt>
  23037. <dd><p>Number of occasions (not the number of samples) that the signal attained
  23038. <var>Noise floor</var>.
  23039. </p>
  23040. </dd>
  23041. <dt>&lsquo;<samp>Bit depth</samp>&rsquo;</dt>
  23042. <dd><p>Overall bit depth of audio. Number of bits used for each sample.
  23043. </p>
  23044. </dd>
  23045. <dt>&lsquo;<samp>Dynamic range</samp>&rsquo;</dt>
  23046. <dd><p>Measured dynamic range of audio in dB.
  23047. </p>
  23048. </dd>
  23049. <dt>&lsquo;<samp>Zero crossings</samp>&rsquo;</dt>
  23050. <dd><p>Number of points where the waveform crosses the zero level axis.
  23051. </p>
  23052. </dd>
  23053. <dt>&lsquo;<samp>Zero crossings rate</samp>&rsquo;</dt>
  23054. <dd><p>Rate of Zero crossings and number of audio samples.
  23055. </p></dd>
  23056. </dl>
  23057. <a name="asubboost"></a>
  23058. <h2 class="section"><a href="ffmpeg-all.html#toc-asubboost">36.44 asubboost</a></h2>
  23059. <p>Boost subwoofer frequencies.
  23060. </p>
  23061. <p>The filter accepts the following options:
  23062. </p>
  23063. <dl compact="compact">
  23064. <dt>&lsquo;<samp>dry</samp>&rsquo;</dt>
  23065. <dd><p>Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1.
  23066. Default value is 0.5.
  23067. </p>
  23068. </dd>
  23069. <dt>&lsquo;<samp>wet</samp>&rsquo;</dt>
  23070. <dd><p>Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1.
  23071. Default value is 0.8.
  23072. </p>
  23073. </dd>
  23074. <dt>&lsquo;<samp>decay</samp>&rsquo;</dt>
  23075. <dd><p>Set delay line decay gain value. Allowed range is from 0 to 1.
  23076. Default value is 0.7.
  23077. </p>
  23078. </dd>
  23079. <dt>&lsquo;<samp>feedback</samp>&rsquo;</dt>
  23080. <dd><p>Set delay line feedback gain value. Allowed range is from 0 to 1.
  23081. Default value is 0.5.
  23082. </p>
  23083. </dd>
  23084. <dt>&lsquo;<samp>cutoff</samp>&rsquo;</dt>
  23085. <dd><p>Set cutoff frequency in herz. Allowed range is 50 to 900.
  23086. Default value is 100.
  23087. </p>
  23088. </dd>
  23089. <dt>&lsquo;<samp>slope</samp>&rsquo;</dt>
  23090. <dd><p>Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1.
  23091. Default value is 0.5.
  23092. </p>
  23093. </dd>
  23094. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  23095. <dd><p>Set delay. Allowed range is from 1 to 100.
  23096. Default value is 20.
  23097. </p></dd>
  23098. </dl>
  23099. <a name="Commands-4"></a>
  23100. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-4">36.44.1 Commands</a></h3>
  23101. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  23102. </p>
  23103. <a name="atempo"></a>
  23104. <h2 class="section"><a href="ffmpeg-all.html#toc-atempo">36.45 atempo</a></h2>
  23105. <p>Adjust audio tempo.
  23106. </p>
  23107. <p>The filter accepts exactly one parameter, the audio tempo. If not
  23108. specified then the filter will assume nominal 1.0 tempo. Tempo must
  23109. be in the [0.5, 100.0] range.
  23110. </p>
  23111. <p>Note that tempo greater than 2 will skip some samples rather than
  23112. blend them in. If for any reason this is a concern it is always
  23113. possible to daisy-chain several instances of atempo to achieve the
  23114. desired product tempo.
  23115. </p>
  23116. <a name="Examples-82"></a>
  23117. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-82">36.45.1 Examples</a></h3>
  23118. <ul>
  23119. <li>
  23120. Slow down audio to 80% tempo:
  23121. <div class="example">
  23122. <pre class="example">atempo=0.8
  23123. </pre></div>
  23124. </li><li>
  23125. To speed up audio to 300% tempo:
  23126. <div class="example">
  23127. <pre class="example">atempo=3
  23128. </pre></div>
  23129. </li><li>
  23130. To speed up audio to 300% tempo by daisy-chaining two atempo instances:
  23131. <div class="example">
  23132. <pre class="example">atempo=sqrt(3),atempo=sqrt(3)
  23133. </pre></div>
  23134. </li></ul>
  23135. <a name="Commands-14"></a>
  23136. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-14">36.45.2 Commands</a></h3>
  23137. <p>This filter supports the following commands:
  23138. </p><dl compact="compact">
  23139. <dt>&lsquo;<samp>tempo</samp>&rsquo;</dt>
  23140. <dd><p>Change filter tempo scale factor.
  23141. Syntax for the command is : &quot;<var>tempo</var>&quot;
  23142. </p></dd>
  23143. </dl>
  23144. <a name="atrim"></a>
  23145. <h2 class="section"><a href="ffmpeg-all.html#toc-atrim">36.46 atrim</a></h2>
  23146. <p>Trim the input so that the output contains one continuous subpart of the input.
  23147. </p>
  23148. <p>It accepts the following parameters:
  23149. </p><dl compact="compact">
  23150. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  23151. <dd><p>Timestamp (in seconds) of the start of the section to keep. I.e. the audio
  23152. sample with the timestamp <var>start</var> will be the first sample in the output.
  23153. </p>
  23154. </dd>
  23155. <dt>&lsquo;<samp>end</samp>&rsquo;</dt>
  23156. <dd><p>Specify time of the first audio sample that will be dropped, i.e. the
  23157. audio sample immediately preceding the one with the timestamp <var>end</var> will be
  23158. the last sample in the output.
  23159. </p>
  23160. </dd>
  23161. <dt>&lsquo;<samp>start_pts</samp>&rsquo;</dt>
  23162. <dd><p>Same as <var>start</var>, except this option sets the start timestamp in samples
  23163. instead of seconds.
  23164. </p>
  23165. </dd>
  23166. <dt>&lsquo;<samp>end_pts</samp>&rsquo;</dt>
  23167. <dd><p>Same as <var>end</var>, except this option sets the end timestamp in samples instead
  23168. of seconds.
  23169. </p>
  23170. </dd>
  23171. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  23172. <dd><p>The maximum duration of the output in seconds.
  23173. </p>
  23174. </dd>
  23175. <dt>&lsquo;<samp>start_sample</samp>&rsquo;</dt>
  23176. <dd><p>The number of the first sample that should be output.
  23177. </p>
  23178. </dd>
  23179. <dt>&lsquo;<samp>end_sample</samp>&rsquo;</dt>
  23180. <dd><p>The number of the first sample that should be dropped.
  23181. </p></dd>
  23182. </dl>
  23183. <p>&lsquo;<samp>start</samp>&rsquo;, &lsquo;<samp>end</samp>&rsquo;, and &lsquo;<samp>duration</samp>&rsquo; are expressed as time
  23184. duration specifications; see
  23185. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  23186. </p>
  23187. <p>Note that the first two sets of the start/end options and the &lsquo;<samp>duration</samp>&rsquo;
  23188. option look at the frame timestamp, while the _sample options simply count the
  23189. samples that pass through the filter. So start/end_pts and start/end_sample will
  23190. give different results when the timestamps are wrong, inexact or do not start at
  23191. zero. Also note that this filter does not modify the timestamps. If you wish
  23192. to have the output timestamps start at zero, insert the asetpts filter after the
  23193. atrim filter.
  23194. </p>
  23195. <p>If multiple start or end options are set, this filter tries to be greedy and
  23196. keep all samples that match at least one of the specified constraints. To keep
  23197. only the part that matches all the constraints at once, chain multiple atrim
  23198. filters.
  23199. </p>
  23200. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  23201. just the end values to keep everything before the specified time.
  23202. </p>
  23203. <p>Examples:
  23204. </p><ul>
  23205. <li>
  23206. Drop everything except the second minute of input:
  23207. <div class="example">
  23208. <pre class="example">ffmpeg -i INPUT -af atrim=60:120
  23209. </pre></div>
  23210. </li><li>
  23211. Keep only the first 1000 samples:
  23212. <div class="example">
  23213. <pre class="example">ffmpeg -i INPUT -af atrim=end_sample=1000
  23214. </pre></div>
  23215. </li></ul>
  23216. <a name="axcorrelate"></a>
  23217. <h2 class="section"><a href="ffmpeg-all.html#toc-axcorrelate">36.47 axcorrelate</a></h2>
  23218. <p>Calculate normalized cross-correlation between two input audio streams.
  23219. </p>
  23220. <p>Resulted samples are always between -1 and 1 inclusive.
  23221. If result is 1 it means two input samples are highly correlated in that selected segment.
  23222. Result 0 means they are not correlated at all.
  23223. If result is -1 it means two input samples are out of phase, which means they cancel each
  23224. other.
  23225. </p>
  23226. <p>The filter accepts the following options:
  23227. </p>
  23228. <dl compact="compact">
  23229. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  23230. <dd><p>Set size of segment over which cross-correlation is calculated.
  23231. Default is 256. Allowed range is from 2 to 131072.
  23232. </p>
  23233. </dd>
  23234. <dt>&lsquo;<samp>algo</samp>&rsquo;</dt>
  23235. <dd><p>Set algorithm for cross-correlation. Can be <code>slow</code> or <code>fast</code>.
  23236. Default is <code>slow</code>. Fast algorithm assumes mean values over any given segment
  23237. are always zero and thus need much less calculations to make.
  23238. This is generally not true, but is valid for typical audio streams.
  23239. </p></dd>
  23240. </dl>
  23241. <a name="Examples-79"></a>
  23242. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-79">36.47.1 Examples</a></h3>
  23243. <ul>
  23244. <li>
  23245. Calculate correlation between channels in stereo audio stream:
  23246. <div class="example">
  23247. <pre class="example">ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
  23248. </pre></div>
  23249. </li></ul>
  23250. <a name="bandpass"></a>
  23251. <h2 class="section"><a href="ffmpeg-all.html#toc-bandpass">36.48 bandpass</a></h2>
  23252. <p>Apply a two-pole Butterworth band-pass filter with central
  23253. frequency <var>frequency</var>, and (3dB-point) band-width width.
  23254. The <var>csg</var> option selects a constant skirt gain (peak gain = Q)
  23255. instead of the default: constant 0dB peak gain.
  23256. The filter roll off at 6dB per octave (20dB per decade).
  23257. </p>
  23258. <p>The filter accepts the following options:
  23259. </p>
  23260. <dl compact="compact">
  23261. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  23262. <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
  23263. </p>
  23264. </dd>
  23265. <dt>&lsquo;<samp>csg</samp>&rsquo;</dt>
  23266. <dd><p>Constant skirt gain if set to 1. Defaults to 0.
  23267. </p>
  23268. </dd>
  23269. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  23270. <dd><p>Set method to specify band-width of filter.
  23271. </p><dl compact="compact">
  23272. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  23273. <dd><p>Hz
  23274. </p></dd>
  23275. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  23276. <dd><p>Q-Factor
  23277. </p></dd>
  23278. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  23279. <dd><p>octave
  23280. </p></dd>
  23281. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  23282. <dd><p>slope
  23283. </p></dd>
  23284. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  23285. <dd><p>kHz
  23286. </p></dd>
  23287. </dl>
  23288. </dd>
  23289. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  23290. <dd><p>Specify the band-width of a filter in width_type units.
  23291. </p>
  23292. </dd>
  23293. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  23294. <dd><p>How much to use filtered signal in output. Default is 1.
  23295. Range is between 0 and 1.
  23296. </p>
  23297. </dd>
  23298. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  23299. <dd><p>Specify which channels to filter, by default all available are filtered.
  23300. </p>
  23301. </dd>
  23302. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  23303. <dd><p>Normalize biquad coefficients, by default is disabled.
  23304. Enabling it will normalize magnitude response at DC to 0dB.
  23305. </p></dd>
  23306. </dl>
  23307. <a name="Commands-40"></a>
  23308. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-40">36.48.1 Commands</a></h3>
  23309. <p>This filter supports the following commands:
  23310. </p><dl compact="compact">
  23311. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  23312. <dd><p>Change bandpass frequency.
  23313. Syntax for the command is : &quot;<var>frequency</var>&quot;
  23314. </p>
  23315. </dd>
  23316. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  23317. <dd><p>Change bandpass width_type.
  23318. Syntax for the command is : &quot;<var>width_type</var>&quot;
  23319. </p>
  23320. </dd>
  23321. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  23322. <dd><p>Change bandpass width.
  23323. Syntax for the command is : &quot;<var>width</var>&quot;
  23324. </p>
  23325. </dd>
  23326. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  23327. <dd><p>Change bandpass mix.
  23328. Syntax for the command is : &quot;<var>mix</var>&quot;
  23329. </p></dd>
  23330. </dl>
  23331. <a name="bandreject"></a>
  23332. <h2 class="section"><a href="ffmpeg-all.html#toc-bandreject">36.49 bandreject</a></h2>
  23333. <p>Apply a two-pole Butterworth band-reject filter with central
  23334. frequency <var>frequency</var>, and (3dB-point) band-width <var>width</var>.
  23335. The filter roll off at 6dB per octave (20dB per decade).
  23336. </p>
  23337. <p>The filter accepts the following options:
  23338. </p>
  23339. <dl compact="compact">
  23340. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  23341. <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
  23342. </p>
  23343. </dd>
  23344. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  23345. <dd><p>Set method to specify band-width of filter.
  23346. </p><dl compact="compact">
  23347. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  23348. <dd><p>Hz
  23349. </p></dd>
  23350. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  23351. <dd><p>Q-Factor
  23352. </p></dd>
  23353. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  23354. <dd><p>octave
  23355. </p></dd>
  23356. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  23357. <dd><p>slope
  23358. </p></dd>
  23359. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  23360. <dd><p>kHz
  23361. </p></dd>
  23362. </dl>
  23363. </dd>
  23364. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  23365. <dd><p>Specify the band-width of a filter in width_type units.
  23366. </p>
  23367. </dd>
  23368. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  23369. <dd><p>How much to use filtered signal in output. Default is 1.
  23370. Range is between 0 and 1.
  23371. </p>
  23372. </dd>
  23373. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  23374. <dd><p>Specify which channels to filter, by default all available are filtered.
  23375. </p>
  23376. </dd>
  23377. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  23378. <dd><p>Normalize biquad coefficients, by default is disabled.
  23379. Enabling it will normalize magnitude response at DC to 0dB.
  23380. </p></dd>
  23381. </dl>
  23382. <a name="Commands-52"></a>
  23383. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-52">36.49.1 Commands</a></h3>
  23384. <p>This filter supports the following commands:
  23385. </p><dl compact="compact">
  23386. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  23387. <dd><p>Change bandreject frequency.
  23388. Syntax for the command is : &quot;<var>frequency</var>&quot;
  23389. </p>
  23390. </dd>
  23391. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  23392. <dd><p>Change bandreject width_type.
  23393. Syntax for the command is : &quot;<var>width_type</var>&quot;
  23394. </p>
  23395. </dd>
  23396. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  23397. <dd><p>Change bandreject width.
  23398. Syntax for the command is : &quot;<var>width</var>&quot;
  23399. </p>
  23400. </dd>
  23401. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  23402. <dd><p>Change bandreject mix.
  23403. Syntax for the command is : &quot;<var>mix</var>&quot;
  23404. </p></dd>
  23405. </dl>
  23406. <a name="bass_002c-lowshelf"></a>
  23407. <h2 class="section"><a href="ffmpeg-all.html#toc-bass_002c-lowshelf">36.50 bass, lowshelf</a></h2>
  23408. <p>Boost or cut the bass (lower) frequencies of the audio using a two-pole
  23409. shelving filter with a response similar to that of a standard
  23410. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  23411. </p>
  23412. <p>The filter accepts the following options:
  23413. </p>
  23414. <dl compact="compact">
  23415. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  23416. <dd><p>Give the gain at 0 Hz. Its useful range is about -20
  23417. (for a large cut) to +20 (for a large boost).
  23418. Beware of clipping when using a positive gain.
  23419. </p>
  23420. </dd>
  23421. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  23422. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  23423. to extend or reduce the frequency range to be boosted or cut.
  23424. The default value is <code>100</code> Hz.
  23425. </p>
  23426. </dd>
  23427. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  23428. <dd><p>Set method to specify band-width of filter.
  23429. </p><dl compact="compact">
  23430. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  23431. <dd><p>Hz
  23432. </p></dd>
  23433. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  23434. <dd><p>Q-Factor
  23435. </p></dd>
  23436. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  23437. <dd><p>octave
  23438. </p></dd>
  23439. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  23440. <dd><p>slope
  23441. </p></dd>
  23442. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  23443. <dd><p>kHz
  23444. </p></dd>
  23445. </dl>
  23446. </dd>
  23447. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  23448. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  23449. </p>
  23450. </dd>
  23451. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  23452. <dd><p>How much to use filtered signal in output. Default is 1.
  23453. Range is between 0 and 1.
  23454. </p>
  23455. </dd>
  23456. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  23457. <dd><p>Specify which channels to filter, by default all available are filtered.
  23458. </p>
  23459. </dd>
  23460. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  23461. <dd><p>Normalize biquad coefficients, by default is disabled.
  23462. Enabling it will normalize magnitude response at DC to 0dB.
  23463. </p></dd>
  23464. </dl>
  23465. <a name="Commands-58"></a>
  23466. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-58">36.50.1 Commands</a></h3>
  23467. <p>This filter supports the following commands:
  23468. </p><dl compact="compact">
  23469. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  23470. <dd><p>Change bass frequency.
  23471. Syntax for the command is : &quot;<var>frequency</var>&quot;
  23472. </p>
  23473. </dd>
  23474. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  23475. <dd><p>Change bass width_type.
  23476. Syntax for the command is : &quot;<var>width_type</var>&quot;
  23477. </p>
  23478. </dd>
  23479. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  23480. <dd><p>Change bass width.
  23481. Syntax for the command is : &quot;<var>width</var>&quot;
  23482. </p>
  23483. </dd>
  23484. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  23485. <dd><p>Change bass gain.
  23486. Syntax for the command is : &quot;<var>gain</var>&quot;
  23487. </p>
  23488. </dd>
  23489. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  23490. <dd><p>Change bass mix.
  23491. Syntax for the command is : &quot;<var>mix</var>&quot;
  23492. </p></dd>
  23493. </dl>
  23494. <a name="biquad"></a>
  23495. <h2 class="section"><a href="ffmpeg-all.html#toc-biquad">36.51 biquad</a></h2>
  23496. <p>Apply a biquad IIR filter with the given coefficients.
  23497. Where <var>b0</var>, <var>b1</var>, <var>b2</var> and <var>a0</var>, <var>a1</var>, <var>a2</var>
  23498. are the numerator and denominator coefficients respectively.
  23499. and <var>channels</var>, <var>c</var> specify which channels to filter, by default all
  23500. available are filtered.
  23501. </p>
  23502. <a name="Commands-43"></a>
  23503. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-43">36.51.1 Commands</a></h3>
  23504. <p>This filter supports the following commands:
  23505. </p><dl compact="compact">
  23506. <dt>&lsquo;<samp>a0</samp>&rsquo;</dt>
  23507. <dt>&lsquo;<samp>a1</samp>&rsquo;</dt>
  23508. <dt>&lsquo;<samp>a2</samp>&rsquo;</dt>
  23509. <dt>&lsquo;<samp>b0</samp>&rsquo;</dt>
  23510. <dt>&lsquo;<samp>b1</samp>&rsquo;</dt>
  23511. <dt>&lsquo;<samp>b2</samp>&rsquo;</dt>
  23512. <dd><p>Change biquad parameter.
  23513. Syntax for the command is : &quot;<var>value</var>&quot;
  23514. </p>
  23515. </dd>
  23516. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  23517. <dd><p>How much to use filtered signal in output. Default is 1.
  23518. Range is between 0 and 1.
  23519. </p>
  23520. </dd>
  23521. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  23522. <dd><p>Specify which channels to filter, by default all available are filtered.
  23523. </p>
  23524. </dd>
  23525. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  23526. <dd><p>Normalize biquad coefficients, by default is disabled.
  23527. Enabling it will normalize magnitude response at DC to 0dB.
  23528. </p></dd>
  23529. </dl>
  23530. <a name="bs2b"></a>
  23531. <h2 class="section"><a href="ffmpeg-all.html#toc-bs2b">36.52 bs2b</a></h2>
  23532. <p>Bauer stereo to binaural transformation, which improves headphone listening of
  23533. stereo audio records.
  23534. </p>
  23535. <p>To enable compilation of this filter you need to configure FFmpeg with
  23536. <code>--enable-libbs2b</code>.
  23537. </p>
  23538. <p>It accepts the following parameters:
  23539. </p><dl compact="compact">
  23540. <dt>&lsquo;<samp>profile</samp>&rsquo;</dt>
  23541. <dd><p>Pre-defined crossfeed level.
  23542. </p><dl compact="compact">
  23543. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  23544. <dd><p>Default level (fcut=700, feed=50).
  23545. </p>
  23546. </dd>
  23547. <dt>&lsquo;<samp>cmoy</samp>&rsquo;</dt>
  23548. <dd><p>Chu Moy circuit (fcut=700, feed=60).
  23549. </p>
  23550. </dd>
  23551. <dt>&lsquo;<samp>jmeier</samp>&rsquo;</dt>
  23552. <dd><p>Jan Meier circuit (fcut=650, feed=95).
  23553. </p>
  23554. </dd>
  23555. </dl>
  23556. </dd>
  23557. <dt>&lsquo;<samp>fcut</samp>&rsquo;</dt>
  23558. <dd><p>Cut frequency (in Hz).
  23559. </p>
  23560. </dd>
  23561. <dt>&lsquo;<samp>feed</samp>&rsquo;</dt>
  23562. <dd><p>Feed level (in Hz).
  23563. </p>
  23564. </dd>
  23565. </dl>
  23566. <a name="channelmap"></a>
  23567. <h2 class="section"><a href="ffmpeg-all.html#toc-channelmap">36.53 channelmap</a></h2>
  23568. <p>Remap input channels to new locations.
  23569. </p>
  23570. <p>It accepts the following parameters:
  23571. </p><dl compact="compact">
  23572. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  23573. <dd><p>Map channels from input to output. The argument is a &rsquo;|&rsquo;-separated list of
  23574. mappings, each in the <code><var>in_channel</var>-<var>out_channel</var></code> or
  23575. <var>in_channel</var> form. <var>in_channel</var> can be either the name of the input
  23576. channel (e.g. FL for front left) or its index in the input channel layout.
  23577. <var>out_channel</var> is the name of the output channel or its index in the output
  23578. channel layout. If <var>out_channel</var> is not given then it is implicitly an
  23579. index, starting with zero and increasing by one for each mapping.
  23580. </p>
  23581. </dd>
  23582. <dt>&lsquo;<samp>channel_layout</samp>&rsquo;</dt>
  23583. <dd><p>The channel layout of the output stream.
  23584. </p></dd>
  23585. </dl>
  23586. <p>If no mapping is present, the filter will implicitly map input channels to
  23587. output channels, preserving indices.
  23588. </p>
  23589. <a name="Examples-169"></a>
  23590. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-169">36.53.1 Examples</a></h3>
  23591. <ul>
  23592. <li>
  23593. For example, assuming a 5.1+downmix input MOV file,
  23594. <div class="example">
  23595. <pre class="example">ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
  23596. </pre></div>
  23597. <p>will create an output WAV file tagged as stereo from the downmix channels of
  23598. the input.
  23599. </p>
  23600. </li><li>
  23601. To fix a 5.1 WAV improperly encoded in AAC&rsquo;s native channel order
  23602. <div class="example">
  23603. <pre class="example">ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
  23604. </pre></div>
  23605. </li></ul>
  23606. <a name="channelsplit"></a>
  23607. <h2 class="section"><a href="ffmpeg-all.html#toc-channelsplit">36.54 channelsplit</a></h2>
  23608. <p>Split each channel from an input audio stream into a separate output stream.
  23609. </p>
  23610. <p>It accepts the following parameters:
  23611. </p><dl compact="compact">
  23612. <dt>&lsquo;<samp>channel_layout</samp>&rsquo;</dt>
  23613. <dd><p>The channel layout of the input stream. The default is &quot;stereo&quot;.
  23614. </p></dd>
  23615. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  23616. <dd><p>A channel layout describing the channels to be extracted as separate output streams
  23617. or &quot;all&quot; to extract each input channel as a separate stream. The default is &quot;all&quot;.
  23618. </p>
  23619. <p>Choosing channels not present in channel layout in the input will result in an error.
  23620. </p></dd>
  23621. </dl>
  23622. <a name="Examples-182"></a>
  23623. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-182">36.54.1 Examples</a></h3>
  23624. <ul>
  23625. <li>
  23626. For example, assuming a stereo input MP3 file,
  23627. <div class="example">
  23628. <pre class="example">ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
  23629. </pre></div>
  23630. <p>will create an output Matroska file with two audio streams, one containing only
  23631. the left channel and the other the right channel.
  23632. </p>
  23633. </li><li>
  23634. Split a 5.1 WAV file into per-channel files:
  23635. <div class="example">
  23636. <pre class="example">ffmpeg -i in.wav -filter_complex
  23637. 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
  23638. -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
  23639. front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
  23640. side_right.wav
  23641. </pre></div>
  23642. </li><li>
  23643. Extract only LFE from a 5.1 WAV file:
  23644. <div class="example">
  23645. <pre class="example">ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
  23646. -map '[LFE]' lfe.wav
  23647. </pre></div>
  23648. </li></ul>
  23649. <a name="chorus"></a>
  23650. <h2 class="section"><a href="ffmpeg-all.html#toc-chorus">36.55 chorus</a></h2>
  23651. <p>Add a chorus effect to the audio.
  23652. </p>
  23653. <p>Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
  23654. </p>
  23655. <p>Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
  23656. constant, with chorus, it is varied using using sinusoidal or triangular modulation.
  23657. The modulation depth defines the range the modulated delay is played before or after
  23658. the delay. Hence the delayed sound will sound slower or faster, that is the delayed
  23659. sound tuned around the original one, like in a chorus where some vocals are slightly
  23660. off key.
  23661. </p>
  23662. <p>It accepts the following parameters:
  23663. </p><dl compact="compact">
  23664. <dt>&lsquo;<samp>in_gain</samp>&rsquo;</dt>
  23665. <dd><p>Set input gain. Default is 0.4.
  23666. </p>
  23667. </dd>
  23668. <dt>&lsquo;<samp>out_gain</samp>&rsquo;</dt>
  23669. <dd><p>Set output gain. Default is 0.4.
  23670. </p>
  23671. </dd>
  23672. <dt>&lsquo;<samp>delays</samp>&rsquo;</dt>
  23673. <dd><p>Set delays. A typical delay is around 40ms to 60ms.
  23674. </p>
  23675. </dd>
  23676. <dt>&lsquo;<samp>decays</samp>&rsquo;</dt>
  23677. <dd><p>Set decays.
  23678. </p>
  23679. </dd>
  23680. <dt>&lsquo;<samp>speeds</samp>&rsquo;</dt>
  23681. <dd><p>Set speeds.
  23682. </p>
  23683. </dd>
  23684. <dt>&lsquo;<samp>depths</samp>&rsquo;</dt>
  23685. <dd><p>Set depths.
  23686. </p></dd>
  23687. </dl>
  23688. <a name="Examples-189"></a>
  23689. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-189">36.55.1 Examples</a></h3>
  23690. <ul>
  23691. <li>
  23692. A single delay:
  23693. <div class="example">
  23694. <pre class="example">chorus=0.7:0.9:55:0.4:0.25:2
  23695. </pre></div>
  23696. </li><li>
  23697. Two delays:
  23698. <div class="example">
  23699. <pre class="example">chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
  23700. </pre></div>
  23701. </li><li>
  23702. Fuller sounding chorus with three delays:
  23703. <div class="example">
  23704. <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
  23705. </pre></div>
  23706. </li></ul>
  23707. <a name="compand"></a>
  23708. <h2 class="section"><a href="ffmpeg-all.html#toc-compand">36.56 compand</a></h2>
  23709. <p>Compress or expand the audio&rsquo;s dynamic range.
  23710. </p>
  23711. <p>It accepts the following parameters:
  23712. </p>
  23713. <dl compact="compact">
  23714. <dt>&lsquo;<samp>attacks</samp>&rsquo;</dt>
  23715. <dt>&lsquo;<samp>decays</samp>&rsquo;</dt>
  23716. <dd><p>A list of times in seconds for each channel over which the instantaneous level
  23717. of the input signal is averaged to determine its volume. <var>attacks</var> refers to
  23718. increase of volume and <var>decays</var> refers to decrease of volume. For most
  23719. situations, the attack time (response to the audio getting louder) should be
  23720. shorter than the decay time, because the human ear is more sensitive to sudden
  23721. loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
  23722. a typical value for decay is 0.8 seconds.
  23723. If specified number of attacks &amp; decays is lower than number of channels, the last
  23724. set attack/decay will be used for all remaining channels.
  23725. </p>
  23726. </dd>
  23727. <dt>&lsquo;<samp>points</samp>&rsquo;</dt>
  23728. <dd><p>A list of points for the transfer function, specified in dB relative to the
  23729. maximum possible signal amplitude. Each key points list must be defined using
  23730. the following syntax: <code>x0/y0|x1/y1|x2/y2|....</code> or
  23731. <code>x0/y0 x1/y1 x2/y2 ....</code>
  23732. </p>
  23733. <p>The input values must be in strictly increasing order but the transfer function
  23734. does not have to be monotonically rising. The point <code>0/0</code> is assumed but
  23735. may be overridden (by <code>0/out-dBn</code>). Typical values for the transfer
  23736. function are <code>-70/-70|-60/-20|1/0</code>.
  23737. </p>
  23738. </dd>
  23739. <dt>&lsquo;<samp>soft-knee</samp>&rsquo;</dt>
  23740. <dd><p>Set the curve radius in dB for all joints. It defaults to 0.01.
  23741. </p>
  23742. </dd>
  23743. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  23744. <dd><p>Set the additional gain in dB to be applied at all points on the transfer
  23745. function. This allows for easy adjustment of the overall gain.
  23746. It defaults to 0.
  23747. </p>
  23748. </dd>
  23749. <dt>&lsquo;<samp>volume</samp>&rsquo;</dt>
  23750. <dd><p>Set an initial volume, in dB, to be assumed for each channel when filtering
  23751. starts. This permits the user to supply a nominal level initially, so that, for
  23752. example, a very large gain is not applied to initial signal levels before the
  23753. companding has begun to operate. A typical value for audio which is initially
  23754. quiet is -90 dB. It defaults to 0.
  23755. </p>
  23756. </dd>
  23757. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  23758. <dd><p>Set a delay, in seconds. The input audio is analyzed immediately, but audio is
  23759. delayed before being fed to the volume adjuster. Specifying a delay
  23760. approximately equal to the attack/decay times allows the filter to effectively
  23761. operate in predictive rather than reactive mode. It defaults to 0.
  23762. </p>
  23763. </dd>
  23764. </dl>
  23765. <a name="Examples-23"></a>
  23766. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-23">36.56.1 Examples</a></h3>
  23767. <ul>
  23768. <li>
  23769. Make music with both quiet and loud passages suitable for listening to in a
  23770. noisy environment:
  23771. <div class="example">
  23772. <pre class="example">compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
  23773. </pre></div>
  23774. <p>Another example for audio with whisper and explosion parts:
  23775. </p><div class="example">
  23776. <pre class="example">compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
  23777. </pre></div>
  23778. </li><li>
  23779. A noise gate for when the noise is at a lower level than the signal:
  23780. <div class="example">
  23781. <pre class="example">compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
  23782. </pre></div>
  23783. </li><li>
  23784. Here is another noise gate, this time for when the noise is at a higher level
  23785. than the signal (making it, in some ways, similar to squelch):
  23786. <div class="example">
  23787. <pre class="example">compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
  23788. </pre></div>
  23789. </li><li>
  23790. 2:1 compression starting at -6dB:
  23791. <div class="example">
  23792. <pre class="example">compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
  23793. </pre></div>
  23794. </li><li>
  23795. 2:1 compression starting at -9dB:
  23796. <div class="example">
  23797. <pre class="example">compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
  23798. </pre></div>
  23799. </li><li>
  23800. 2:1 compression starting at -12dB:
  23801. <div class="example">
  23802. <pre class="example">compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
  23803. </pre></div>
  23804. </li><li>
  23805. 2:1 compression starting at -18dB:
  23806. <div class="example">
  23807. <pre class="example">compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
  23808. </pre></div>
  23809. </li><li>
  23810. 3:1 compression starting at -15dB:
  23811. <div class="example">
  23812. <pre class="example">compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
  23813. </pre></div>
  23814. </li><li>
  23815. Compressor/Gate:
  23816. <div class="example">
  23817. <pre class="example">compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
  23818. </pre></div>
  23819. </li><li>
  23820. Expander:
  23821. <div class="example">
  23822. <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
  23823. </pre></div>
  23824. </li><li>
  23825. Hard limiter at -6dB:
  23826. <div class="example">
  23827. <pre class="example">compand=attacks=0:points=-80/-80|-6/-6|20/-6
  23828. </pre></div>
  23829. </li><li>
  23830. Hard limiter at -12dB:
  23831. <div class="example">
  23832. <pre class="example">compand=attacks=0:points=-80/-80|-12/-12|20/-12
  23833. </pre></div>
  23834. </li><li>
  23835. Hard noise gate at -35 dB:
  23836. <div class="example">
  23837. <pre class="example">compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
  23838. </pre></div>
  23839. </li><li>
  23840. Soft limiter:
  23841. <div class="example">
  23842. <pre class="example">compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
  23843. </pre></div>
  23844. </li></ul>
  23845. <a name="compensationdelay"></a>
  23846. <h2 class="section"><a href="ffmpeg-all.html#toc-compensationdelay">36.57 compensationdelay</a></h2>
  23847. <p>Compensation Delay Line is a metric based delay to compensate differing
  23848. positions of microphones or speakers.
  23849. </p>
  23850. <p>For example, you have recorded guitar with two microphones placed in
  23851. different locations. Because the front of sound wave has fixed speed in
  23852. normal conditions, the phasing of microphones can vary and depends on
  23853. their location and interposition. The best sound mix can be achieved when
  23854. these microphones are in phase (synchronized). Note that a distance of
  23855. ~30 cm between microphones makes one microphone capture the signal in
  23856. antiphase to the other microphone. That makes the final mix sound moody.
  23857. This filter helps to solve phasing problems by adding different delays
  23858. to each microphone track and make them synchronized.
  23859. </p>
  23860. <p>The best result can be reached when you take one track as base and
  23861. synchronize other tracks one by one with it.
  23862. Remember that synchronization/delay tolerance depends on sample rate, too.
  23863. Higher sample rates will give more tolerance.
  23864. </p>
  23865. <p>The filter accepts the following parameters:
  23866. </p>
  23867. <dl compact="compact">
  23868. <dt>&lsquo;<samp>mm</samp>&rsquo;</dt>
  23869. <dd><p>Set millimeters distance. This is compensation distance for fine tuning.
  23870. Default is 0.
  23871. </p>
  23872. </dd>
  23873. <dt>&lsquo;<samp>cm</samp>&rsquo;</dt>
  23874. <dd><p>Set cm distance. This is compensation distance for tightening distance setup.
  23875. Default is 0.
  23876. </p>
  23877. </dd>
  23878. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  23879. <dd><p>Set meters distance. This is compensation distance for hard distance setup.
  23880. Default is 0.
  23881. </p>
  23882. </dd>
  23883. <dt>&lsquo;<samp>dry</samp>&rsquo;</dt>
  23884. <dd><p>Set dry amount. Amount of unprocessed (dry) signal.
  23885. Default is 0.
  23886. </p>
  23887. </dd>
  23888. <dt>&lsquo;<samp>wet</samp>&rsquo;</dt>
  23889. <dd><p>Set wet amount. Amount of processed (wet) signal.
  23890. Default is 1.
  23891. </p>
  23892. </dd>
  23893. <dt>&lsquo;<samp>temp</samp>&rsquo;</dt>
  23894. <dd><p>Set temperature in degrees Celsius. This is the temperature of the environment.
  23895. Default is 20.
  23896. </p></dd>
  23897. </dl>
  23898. <a name="crossfeed"></a>
  23899. <h2 class="section"><a href="ffmpeg-all.html#toc-crossfeed">36.58 crossfeed</a></h2>
  23900. <p>Apply headphone crossfeed filter.
  23901. </p>
  23902. <p>Crossfeed is the process of blending the left and right channels of stereo
  23903. audio recording.
  23904. It is mainly used to reduce extreme stereo separation of low frequencies.
  23905. </p>
  23906. <p>The intent is to produce more speaker like sound to the listener.
  23907. </p>
  23908. <p>The filter accepts the following options:
  23909. </p>
  23910. <dl compact="compact">
  23911. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  23912. <dd><p>Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1.
  23913. This sets gain of low shelf filter for side part of stereo image.
  23914. Default is -6dB. Max allowed is -30db when strength is set to 1.
  23915. </p>
  23916. </dd>
  23917. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  23918. <dd><p>Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1.
  23919. This sets cut off frequency of low shelf filter. Default is cut off near
  23920. 1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz.
  23921. </p>
  23922. </dd>
  23923. <dt>&lsquo;<samp>slope</samp>&rsquo;</dt>
  23924. <dd><p>Set curve slope of low shelf filter. Default is 0.5.
  23925. Allowed range is from 0.01 to 1.
  23926. </p>
  23927. </dd>
  23928. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  23929. <dd><p>Set input gain. Default is 0.9.
  23930. </p>
  23931. </dd>
  23932. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  23933. <dd><p>Set output gain. Default is 1.
  23934. </p></dd>
  23935. </dl>
  23936. <a name="Commands-51"></a>
  23937. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-51">36.58.1 Commands</a></h3>
  23938. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  23939. </p>
  23940. <a name="crystalizer"></a>
  23941. <h2 class="section"><a href="ffmpeg-all.html#toc-crystalizer">36.59 crystalizer</a></h2>
  23942. <p>Simple algorithm to expand audio dynamic range.
  23943. </p>
  23944. <p>The filter accepts the following options:
  23945. </p>
  23946. <dl compact="compact">
  23947. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  23948. <dd><p>Sets the intensity of effect (default: 2.0). Must be in range between 0.0
  23949. (unchanged sound) to 10.0 (maximum effect).
  23950. </p>
  23951. </dd>
  23952. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  23953. <dd><p>Enable clipping. By default is enabled.
  23954. </p></dd>
  23955. </dl>
  23956. <a name="Commands-53"></a>
  23957. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-53">36.59.1 Commands</a></h3>
  23958. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  23959. </p>
  23960. <a name="dcshift"></a>
  23961. <h2 class="section"><a href="ffmpeg-all.html#toc-dcshift">36.60 dcshift</a></h2>
  23962. <p>Apply a DC shift to the audio.
  23963. </p>
  23964. <p>This can be useful to remove a DC offset (caused perhaps by a hardware problem
  23965. in the recording chain) from the audio. The effect of a DC offset is reduced
  23966. headroom and hence volume. The <a href="#astats">astats</a> filter can be used to determine if
  23967. a signal has a DC offset.
  23968. </p>
  23969. <dl compact="compact">
  23970. <dt>&lsquo;<samp>shift</samp>&rsquo;</dt>
  23971. <dd><p>Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift
  23972. the audio.
  23973. </p>
  23974. </dd>
  23975. <dt>&lsquo;<samp>limitergain</samp>&rsquo;</dt>
  23976. <dd><p>Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
  23977. used to prevent clipping.
  23978. </p></dd>
  23979. </dl>
  23980. <a name="deesser"></a>
  23981. <h2 class="section"><a href="ffmpeg-all.html#toc-deesser">36.61 deesser</a></h2>
  23982. <p>Apply de-essing to the audio samples.
  23983. </p>
  23984. <dl compact="compact">
  23985. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  23986. <dd><p>Set intensity for triggering de-essing. Allowed range is from 0 to 1.
  23987. Default is 0.
  23988. </p>
  23989. </dd>
  23990. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  23991. <dd><p>Set amount of ducking on treble part of sound. Allowed range is from 0 to 1.
  23992. Default is 0.5.
  23993. </p>
  23994. </dd>
  23995. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  23996. <dd><p>How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1.
  23997. Default is 0.5.
  23998. </p>
  23999. </dd>
  24000. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  24001. <dd><p>Set the output mode.
  24002. </p>
  24003. <p>It accepts the following values:
  24004. </p><dl compact="compact">
  24005. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  24006. <dd><p>Pass input unchanged.
  24007. </p>
  24008. </dd>
  24009. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  24010. <dd><p>Pass ess filtered out.
  24011. </p>
  24012. </dd>
  24013. <dt>&lsquo;<samp>e</samp>&rsquo;</dt>
  24014. <dd><p>Pass only ess.
  24015. </p>
  24016. <p>Default value is <var>o</var>.
  24017. </p></dd>
  24018. </dl>
  24019. </dd>
  24020. </dl>
  24021. <a name="drmeter"></a>
  24022. <h2 class="section"><a href="ffmpeg-all.html#toc-drmeter">36.62 drmeter</a></h2>
  24023. <p>Measure audio dynamic range.
  24024. </p>
  24025. <p>DR values of 14 and higher is found in very dynamic material. DR of 8 to 13
  24026. is found in transition material. And anything less that 8 have very poor dynamics
  24027. and is very compressed.
  24028. </p>
  24029. <p>The filter accepts the following options:
  24030. </p>
  24031. <dl compact="compact">
  24032. <dt>&lsquo;<samp>length</samp>&rsquo;</dt>
  24033. <dd><p>Set window length in seconds used to split audio into segments of equal length.
  24034. Default is 3 seconds.
  24035. </p></dd>
  24036. </dl>
  24037. <a name="dynaudnorm"></a>
  24038. <h2 class="section"><a href="ffmpeg-all.html#toc-dynaudnorm">36.63 dynaudnorm</a></h2>
  24039. <p>Dynamic Audio Normalizer.
  24040. </p>
  24041. <p>This filter applies a certain amount of gain to the input audio in order
  24042. to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in
  24043. contrast to more &quot;simple&quot; normalization algorithms, the Dynamic Audio
  24044. Normalizer *dynamically* re-adjusts the gain factor to the input audio.
  24045. This allows for applying extra gain to the &quot;quiet&quot; sections of the audio
  24046. while avoiding distortions or clipping the &quot;loud&quot; sections. In other words:
  24047. The Dynamic Audio Normalizer will &quot;even out&quot; the volume of quiet and loud
  24048. sections, in the sense that the volume of each section is brought to the
  24049. same target level. Note, however, that the Dynamic Audio Normalizer achieves
  24050. this goal *without* applying &quot;dynamic range compressing&quot;. It will retain 100%
  24051. of the dynamic range *within* each section of the audio file.
  24052. </p>
  24053. <dl compact="compact">
  24054. <dt>&lsquo;<samp>framelen, f</samp>&rsquo;</dt>
  24055. <dd><p>Set the frame length in milliseconds. In range from 10 to 8000 milliseconds.
  24056. Default is 500 milliseconds.
  24057. The Dynamic Audio Normalizer processes the input audio in small chunks,
  24058. referred to as frames. This is required, because a peak magnitude has no
  24059. meaning for just a single sample value. Instead, we need to determine the
  24060. peak magnitude for a contiguous sequence of sample values. While a &quot;standard&quot;
  24061. normalizer would simply use the peak magnitude of the complete file, the
  24062. Dynamic Audio Normalizer determines the peak magnitude individually for each
  24063. frame. The length of a frame is specified in milliseconds. By default, the
  24064. Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has
  24065. been found to give good results with most files.
  24066. Note that the exact frame length, in number of samples, will be determined
  24067. automatically, based on the sampling rate of the individual input audio file.
  24068. </p>
  24069. </dd>
  24070. <dt>&lsquo;<samp>gausssize, g</samp>&rsquo;</dt>
  24071. <dd><p>Set the Gaussian filter window size. In range from 3 to 301, must be odd
  24072. number. Default is 31.
  24073. Probably the most important parameter of the Dynamic Audio Normalizer is the
  24074. <code>window size</code> of the Gaussian smoothing filter. The filter&rsquo;s window size
  24075. is specified in frames, centered around the current frame. For the sake of
  24076. simplicity, this must be an odd number. Consequently, the default value of 31
  24077. takes into account the current frame, as well as the 15 preceding frames and
  24078. the 15 subsequent frames. Using a larger window results in a stronger
  24079. smoothing effect and thus in less gain variation, i.e. slower gain
  24080. adaptation. Conversely, using a smaller window results in a weaker smoothing
  24081. effect and thus in more gain variation, i.e. faster gain adaptation.
  24082. In other words, the more you increase this value, the more the Dynamic Audio
  24083. Normalizer will behave like a &quot;traditional&quot; normalization filter. On the
  24084. contrary, the more you decrease this value, the more the Dynamic Audio
  24085. Normalizer will behave like a dynamic range compressor.
  24086. </p>
  24087. </dd>
  24088. <dt>&lsquo;<samp>peak, p</samp>&rsquo;</dt>
  24089. <dd><p>Set the target peak value. This specifies the highest permissible magnitude
  24090. level for the normalized audio input. This filter will try to approach the
  24091. target peak magnitude as closely as possible, but at the same time it also
  24092. makes sure that the normalized signal will never exceed the peak magnitude.
  24093. A frame&rsquo;s maximum local gain factor is imposed directly by the target peak
  24094. magnitude. The default value is 0.95 and thus leaves a headroom of 5%*.
  24095. It is not recommended to go above this value.
  24096. </p>
  24097. </dd>
  24098. <dt>&lsquo;<samp>maxgain, m</samp>&rsquo;</dt>
  24099. <dd><p>Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0.
  24100. The Dynamic Audio Normalizer determines the maximum possible (local) gain
  24101. factor for each input frame, i.e. the maximum gain factor that does not
  24102. result in clipping or distortion. The maximum gain factor is determined by
  24103. the frame&rsquo;s highest magnitude sample. However, the Dynamic Audio Normalizer
  24104. additionally bounds the frame&rsquo;s maximum gain factor by a predetermined
  24105. (global) maximum gain factor. This is done in order to avoid excessive gain
  24106. factors in &quot;silent&quot; or almost silent frames. By default, the maximum gain
  24107. factor is 10.0, For most inputs the default value should be sufficient and
  24108. it usually is not recommended to increase this value. Though, for input
  24109. with an extremely low overall volume level, it may be necessary to allow even
  24110. higher gain factors. Note, however, that the Dynamic Audio Normalizer does
  24111. not simply apply a &quot;hard&quot; threshold (i.e. cut off values above the threshold).
  24112. Instead, a &quot;sigmoid&quot; threshold function will be applied. This way, the
  24113. gain factors will smoothly approach the threshold value, but never exceed that
  24114. value.
  24115. </p>
  24116. </dd>
  24117. <dt>&lsquo;<samp>targetrms, r</samp>&rsquo;</dt>
  24118. <dd><p>Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled.
  24119. By default, the Dynamic Audio Normalizer performs &quot;peak&quot; normalization.
  24120. This means that the maximum local gain factor for each frame is defined
  24121. (only) by the frame&rsquo;s highest magnitude sample. This way, the samples can
  24122. be amplified as much as possible without exceeding the maximum signal
  24123. level, i.e. without clipping. Optionally, however, the Dynamic Audio
  24124. Normalizer can also take into account the frame&rsquo;s root mean square,
  24125. abbreviated RMS. In electrical engineering, the RMS is commonly used to
  24126. determine the power of a time-varying signal. It is therefore considered
  24127. that the RMS is a better approximation of the &quot;perceived loudness&quot; than
  24128. just looking at the signal&rsquo;s peak magnitude. Consequently, by adjusting all
  24129. frames to a constant RMS value, a uniform &quot;perceived loudness&quot; can be
  24130. established. If a target RMS value has been specified, a frame&rsquo;s local gain
  24131. factor is defined as the factor that would result in exactly that RMS value.
  24132. Note, however, that the maximum local gain factor is still restricted by the
  24133. frame&rsquo;s highest magnitude sample, in order to prevent clipping.
  24134. </p>
  24135. </dd>
  24136. <dt>&lsquo;<samp>coupling, n</samp>&rsquo;</dt>
  24137. <dd><p>Enable channels coupling. By default is enabled.
  24138. By default, the Dynamic Audio Normalizer will amplify all channels by the same
  24139. amount. This means the same gain factor will be applied to all channels, i.e.
  24140. the maximum possible gain factor is determined by the &quot;loudest&quot; channel.
  24141. However, in some recordings, it may happen that the volume of the different
  24142. channels is uneven, e.g. one channel may be &quot;quieter&quot; than the other one(s).
  24143. In this case, this option can be used to disable the channel coupling. This way,
  24144. the gain factor will be determined independently for each channel, depending
  24145. only on the individual channel&rsquo;s highest magnitude sample. This allows for
  24146. harmonizing the volume of the different channels.
  24147. </p>
  24148. </dd>
  24149. <dt>&lsquo;<samp>correctdc, c</samp>&rsquo;</dt>
  24150. <dd><p>Enable DC bias correction. By default is disabled.
  24151. An audio signal (in the time domain) is a sequence of sample values.
  24152. In the Dynamic Audio Normalizer these sample values are represented in the
  24153. -1.0 to 1.0 range, regardless of the original input format. Normally, the
  24154. audio signal, or &quot;waveform&quot;, should be centered around the zero point.
  24155. That means if we calculate the mean value of all samples in a file, or in a
  24156. single frame, then the result should be 0.0 or at least very close to that
  24157. value. If, however, there is a significant deviation of the mean value from
  24158. 0.0, in either positive or negative direction, this is referred to as a
  24159. DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic
  24160. Audio Normalizer provides optional DC bias correction.
  24161. With DC bias correction enabled, the Dynamic Audio Normalizer will determine
  24162. the mean value, or &quot;DC correction&quot; offset, of each input frame and subtract
  24163. that value from all of the frame&rsquo;s sample values which ensures those samples
  24164. are centered around 0.0 again. Also, in order to avoid &quot;gaps&quot; at the frame
  24165. boundaries, the DC correction offset values will be interpolated smoothly
  24166. between neighbouring frames.
  24167. </p>
  24168. </dd>
  24169. <dt>&lsquo;<samp>altboundary, b</samp>&rsquo;</dt>
  24170. <dd><p>Enable alternative boundary mode. By default is disabled.
  24171. The Dynamic Audio Normalizer takes into account a certain neighbourhood
  24172. around each frame. This includes the preceding frames as well as the
  24173. subsequent frames. However, for the &quot;boundary&quot; frames, located at the very
  24174. beginning and at the very end of the audio file, not all neighbouring
  24175. frames are available. In particular, for the first few frames in the audio
  24176. file, the preceding frames are not known. And, similarly, for the last few
  24177. frames in the audio file, the subsequent frames are not known. Thus, the
  24178. question arises which gain factors should be assumed for the missing frames
  24179. in the &quot;boundary&quot; region. The Dynamic Audio Normalizer implements two modes
  24180. to deal with this situation. The default boundary mode assumes a gain factor
  24181. of exactly 1.0 for the missing frames, resulting in a smooth &quot;fade in&quot; and
  24182. &quot;fade out&quot; at the beginning and at the end of the input, respectively.
  24183. </p>
  24184. </dd>
  24185. <dt>&lsquo;<samp>compress, s</samp>&rsquo;</dt>
  24186. <dd><p>Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
  24187. By default, the Dynamic Audio Normalizer does not apply &quot;traditional&quot;
  24188. compression. This means that signal peaks will not be pruned and thus the
  24189. full dynamic range will be retained within each local neighbourhood. However,
  24190. in some cases it may be desirable to combine the Dynamic Audio Normalizer&rsquo;s
  24191. normalization algorithm with a more &quot;traditional&quot; compression.
  24192. For this purpose, the Dynamic Audio Normalizer provides an optional compression
  24193. (thresholding) function. If (and only if) the compression feature is enabled,
  24194. all input frames will be processed by a soft knee thresholding function prior
  24195. to the actual normalization process. Put simply, the thresholding function is
  24196. going to prune all samples whose magnitude exceeds a certain threshold value.
  24197. However, the Dynamic Audio Normalizer does not simply apply a fixed threshold
  24198. value. Instead, the threshold value will be adjusted for each individual
  24199. frame.
  24200. In general, smaller parameters result in stronger compression, and vice versa.
  24201. Values below 3.0 are not recommended, because audible distortion may appear.
  24202. </p>
  24203. </dd>
  24204. <dt>&lsquo;<samp>threshold, t</samp>&rsquo;</dt>
  24205. <dd><p>Set the target threshold value. This specifies the lowest permissible
  24206. magnitude level for the audio input which will be normalized.
  24207. If input frame volume is above this value frame will be normalized.
  24208. Otherwise frame may not be normalized at all. The default value is set
  24209. to 0, which means all input frames will be normalized.
  24210. This option is mostly useful if digital noise is not wanted to be amplified.
  24211. </p></dd>
  24212. </dl>
  24213. <a name="Commands-67"></a>
  24214. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-67">36.63.1 Commands</a></h3>
  24215. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  24216. </p>
  24217. <a name="earwax"></a>
  24218. <h2 class="section"><a href="ffmpeg-all.html#toc-earwax">36.64 earwax</a></h2>
  24219. <p>Make audio easier to listen to on headphones.
  24220. </p>
  24221. <p>This filter adds &lsquo;cues&rsquo; to 44.1kHz stereo (i.e. audio CD format) audio
  24222. so that when listened to on headphones the stereo image is moved from
  24223. inside your head (standard for headphones) to outside and in front of
  24224. the listener (standard for speakers).
  24225. </p>
  24226. <p>Ported from SoX.
  24227. </p>
  24228. <a name="equalizer"></a>
  24229. <h2 class="section"><a href="ffmpeg-all.html#toc-equalizer">36.65 equalizer</a></h2>
  24230. <p>Apply a two-pole peaking equalisation (EQ) filter. With this
  24231. filter, the signal-level at and around a selected frequency can
  24232. be increased or decreased, whilst (unlike bandpass and bandreject
  24233. filters) that at all other frequencies is unchanged.
  24234. </p>
  24235. <p>In order to produce complex equalisation curves, this filter can
  24236. be given several times, each with a different central frequency.
  24237. </p>
  24238. <p>The filter accepts the following options:
  24239. </p>
  24240. <dl compact="compact">
  24241. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  24242. <dd><p>Set the filter&rsquo;s central frequency in Hz.
  24243. </p>
  24244. </dd>
  24245. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  24246. <dd><p>Set method to specify band-width of filter.
  24247. </p><dl compact="compact">
  24248. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  24249. <dd><p>Hz
  24250. </p></dd>
  24251. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  24252. <dd><p>Q-Factor
  24253. </p></dd>
  24254. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  24255. <dd><p>octave
  24256. </p></dd>
  24257. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  24258. <dd><p>slope
  24259. </p></dd>
  24260. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  24261. <dd><p>kHz
  24262. </p></dd>
  24263. </dl>
  24264. </dd>
  24265. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  24266. <dd><p>Specify the band-width of a filter in width_type units.
  24267. </p>
  24268. </dd>
  24269. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  24270. <dd><p>Set the required gain or attenuation in dB.
  24271. Beware of clipping when using a positive gain.
  24272. </p>
  24273. </dd>
  24274. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  24275. <dd><p>How much to use filtered signal in output. Default is 1.
  24276. Range is between 0 and 1.
  24277. </p>
  24278. </dd>
  24279. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  24280. <dd><p>Specify which channels to filter, by default all available are filtered.
  24281. </p>
  24282. </dd>
  24283. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  24284. <dd><p>Normalize biquad coefficients, by default is disabled.
  24285. Enabling it will normalize magnitude response at DC to 0dB.
  24286. </p></dd>
  24287. </dl>
  24288. <a name="Examples-152"></a>
  24289. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-152">36.65.1 Examples</a></h3>
  24290. <ul>
  24291. <li>
  24292. Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
  24293. <div class="example">
  24294. <pre class="example">equalizer=f=1000:t=h:width=200:g=-10
  24295. </pre></div>
  24296. </li><li>
  24297. Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
  24298. <div class="example">
  24299. <pre class="example">equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
  24300. </pre></div>
  24301. </li></ul>
  24302. <a name="Commands-39"></a>
  24303. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-39">36.65.2 Commands</a></h3>
  24304. <p>This filter supports the following commands:
  24305. </p><dl compact="compact">
  24306. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  24307. <dd><p>Change equalizer frequency.
  24308. Syntax for the command is : &quot;<var>frequency</var>&quot;
  24309. </p>
  24310. </dd>
  24311. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  24312. <dd><p>Change equalizer width_type.
  24313. Syntax for the command is : &quot;<var>width_type</var>&quot;
  24314. </p>
  24315. </dd>
  24316. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  24317. <dd><p>Change equalizer width.
  24318. Syntax for the command is : &quot;<var>width</var>&quot;
  24319. </p>
  24320. </dd>
  24321. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  24322. <dd><p>Change equalizer gain.
  24323. Syntax for the command is : &quot;<var>gain</var>&quot;
  24324. </p>
  24325. </dd>
  24326. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  24327. <dd><p>Change equalizer mix.
  24328. Syntax for the command is : &quot;<var>mix</var>&quot;
  24329. </p></dd>
  24330. </dl>
  24331. <a name="extrastereo"></a>
  24332. <h2 class="section"><a href="ffmpeg-all.html#toc-extrastereo">36.66 extrastereo</a></h2>
  24333. <p>Linearly increases the difference between left and right channels which
  24334. adds some sort of &quot;live&quot; effect to playback.
  24335. </p>
  24336. <p>The filter accepts the following options:
  24337. </p>
  24338. <dl compact="compact">
  24339. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  24340. <dd><p>Sets the difference coefficient (default: 2.5). 0.0 means mono sound
  24341. (average of both channels), with 1.0 sound will be unchanged, with
  24342. -1.0 left and right channels will be swapped.
  24343. </p>
  24344. </dd>
  24345. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  24346. <dd><p>Enable clipping. By default is enabled.
  24347. </p></dd>
  24348. </dl>
  24349. <a name="Commands-31"></a>
  24350. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-31">36.66.1 Commands</a></h3>
  24351. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  24352. </p>
  24353. <a name="firequalizer"></a>
  24354. <h2 class="section"><a href="ffmpeg-all.html#toc-firequalizer">36.67 firequalizer</a></h2>
  24355. <p>Apply FIR Equalization using arbitrary frequency response.
  24356. </p>
  24357. <p>The filter accepts the following option:
  24358. </p>
  24359. <dl compact="compact">
  24360. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  24361. <dd><p>Set gain curve equation (in dB). The expression can contain variables:
  24362. </p><dl compact="compact">
  24363. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  24364. <dd><p>the evaluated frequency
  24365. </p></dd>
  24366. <dt>&lsquo;<samp>sr</samp>&rsquo;</dt>
  24367. <dd><p>sample rate
  24368. </p></dd>
  24369. <dt>&lsquo;<samp>ch</samp>&rsquo;</dt>
  24370. <dd><p>channel number, set to 0 when multichannels evaluation is disabled
  24371. </p></dd>
  24372. <dt>&lsquo;<samp>chid</samp>&rsquo;</dt>
  24373. <dd><p>channel id, see libavutil/channel_layout.h, set to the first channel id when
  24374. multichannels evaluation is disabled
  24375. </p></dd>
  24376. <dt>&lsquo;<samp>chs</samp>&rsquo;</dt>
  24377. <dd><p>number of channels
  24378. </p></dd>
  24379. <dt>&lsquo;<samp>chlayout</samp>&rsquo;</dt>
  24380. <dd><p>channel_layout, see libavutil/channel_layout.h
  24381. </p>
  24382. </dd>
  24383. </dl>
  24384. <p>and functions:
  24385. </p><dl compact="compact">
  24386. <dt>&lsquo;<samp>gain_interpolate(f)</samp>&rsquo;</dt>
  24387. <dd><p>interpolate gain on frequency f based on gain_entry
  24388. </p></dd>
  24389. <dt>&lsquo;<samp>cubic_interpolate(f)</samp>&rsquo;</dt>
  24390. <dd><p>same as gain_interpolate, but smoother
  24391. </p></dd>
  24392. </dl>
  24393. <p>This option is also available as command. Default is <code>gain_interpolate(f)</code>.
  24394. </p>
  24395. </dd>
  24396. <dt>&lsquo;<samp>gain_entry</samp>&rsquo;</dt>
  24397. <dd><p>Set gain entry for gain_interpolate function. The expression can
  24398. contain functions:
  24399. </p><dl compact="compact">
  24400. <dt>&lsquo;<samp>entry(f, g)</samp>&rsquo;</dt>
  24401. <dd><p>store gain entry at frequency f with value g
  24402. </p></dd>
  24403. </dl>
  24404. <p>This option is also available as command.
  24405. </p>
  24406. </dd>
  24407. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  24408. <dd><p>Set filter delay in seconds. Higher value means more accurate.
  24409. Default is <code>0.01</code>.
  24410. </p>
  24411. </dd>
  24412. <dt>&lsquo;<samp>accuracy</samp>&rsquo;</dt>
  24413. <dd><p>Set filter accuracy in Hz. Lower value means more accurate.
  24414. Default is <code>5</code>.
  24415. </p>
  24416. </dd>
  24417. <dt>&lsquo;<samp>wfunc</samp>&rsquo;</dt>
  24418. <dd><p>Set window function. Acceptable values are:
  24419. </p><dl compact="compact">
  24420. <dt>&lsquo;<samp>rectangular</samp>&rsquo;</dt>
  24421. <dd><p>rectangular window, useful when gain curve is already smooth
  24422. </p></dd>
  24423. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  24424. <dd><p>hann window (default)
  24425. </p></dd>
  24426. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  24427. <dd><p>hamming window
  24428. </p></dd>
  24429. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  24430. <dd><p>blackman window
  24431. </p></dd>
  24432. <dt>&lsquo;<samp>nuttall3</samp>&rsquo;</dt>
  24433. <dd><p>3-terms continuous 1st derivative nuttall window
  24434. </p></dd>
  24435. <dt>&lsquo;<samp>mnuttall3</samp>&rsquo;</dt>
  24436. <dd><p>minimum 3-terms discontinuous nuttall window
  24437. </p></dd>
  24438. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  24439. <dd><p>4-terms continuous 1st derivative nuttall window
  24440. </p></dd>
  24441. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  24442. <dd><p>minimum 4-terms discontinuous nuttall (blackman-nuttall) window
  24443. </p></dd>
  24444. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  24445. <dd><p>blackman-harris window
  24446. </p></dd>
  24447. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  24448. <dd><p>tukey window
  24449. </p></dd>
  24450. </dl>
  24451. </dd>
  24452. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  24453. <dd><p>If enabled, use fixed number of audio samples. This improves speed when
  24454. filtering with large delay. Default is disabled.
  24455. </p>
  24456. </dd>
  24457. <dt>&lsquo;<samp>multi</samp>&rsquo;</dt>
  24458. <dd><p>Enable multichannels evaluation on gain. Default is disabled.
  24459. </p>
  24460. </dd>
  24461. <dt>&lsquo;<samp>zero_phase</samp>&rsquo;</dt>
  24462. <dd><p>Enable zero phase mode by subtracting timestamp to compensate delay.
  24463. Default is disabled.
  24464. </p>
  24465. </dd>
  24466. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  24467. <dd><p>Set scale used by gain. Acceptable values are:
  24468. </p><dl compact="compact">
  24469. <dt>&lsquo;<samp>linlin</samp>&rsquo;</dt>
  24470. <dd><p>linear frequency, linear gain
  24471. </p></dd>
  24472. <dt>&lsquo;<samp>linlog</samp>&rsquo;</dt>
  24473. <dd><p>linear frequency, logarithmic (in dB) gain (default)
  24474. </p></dd>
  24475. <dt>&lsquo;<samp>loglin</samp>&rsquo;</dt>
  24476. <dd><p>logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain
  24477. </p></dd>
  24478. <dt>&lsquo;<samp>loglog</samp>&rsquo;</dt>
  24479. <dd><p>logarithmic frequency, logarithmic gain
  24480. </p></dd>
  24481. </dl>
  24482. </dd>
  24483. <dt>&lsquo;<samp>dumpfile</samp>&rsquo;</dt>
  24484. <dd><p>Set file for dumping, suitable for gnuplot.
  24485. </p>
  24486. </dd>
  24487. <dt>&lsquo;<samp>dumpscale</samp>&rsquo;</dt>
  24488. <dd><p>Set scale for dumpfile. Acceptable values are same with scale option.
  24489. Default is linlog.
  24490. </p>
  24491. </dd>
  24492. <dt>&lsquo;<samp>fft2</samp>&rsquo;</dt>
  24493. <dd><p>Enable 2-channel convolution using complex FFT. This improves speed significantly.
  24494. Default is disabled.
  24495. </p>
  24496. </dd>
  24497. <dt>&lsquo;<samp>min_phase</samp>&rsquo;</dt>
  24498. <dd><p>Enable minimum phase impulse response. Default is disabled.
  24499. </p></dd>
  24500. </dl>
  24501. <a name="Examples-115"></a>
  24502. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-115">36.67.1 Examples</a></h3>
  24503. <ul>
  24504. <li>
  24505. lowpass at 1000 Hz:
  24506. <div class="example">
  24507. <pre class="example">firequalizer=gain='if(lt(f,1000), 0, -INF)'
  24508. </pre></div>
  24509. </li><li>
  24510. lowpass at 1000 Hz with gain_entry:
  24511. <div class="example">
  24512. <pre class="example">firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
  24513. </pre></div>
  24514. </li><li>
  24515. custom equalization:
  24516. <div class="example">
  24517. <pre class="example">firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
  24518. </pre></div>
  24519. </li><li>
  24520. higher delay with zero phase to compensate delay:
  24521. <div class="example">
  24522. <pre class="example">firequalizer=delay=0.1:fixed=on:zero_phase=on
  24523. </pre></div>
  24524. </li><li>
  24525. lowpass on left channel, highpass on right channel:
  24526. <div class="example">
  24527. <pre class="example">firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
  24528. :gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
  24529. </pre></div>
  24530. </li></ul>
  24531. <a name="flanger"></a>
  24532. <h2 class="section"><a href="ffmpeg-all.html#toc-flanger">36.68 flanger</a></h2>
  24533. <p>Apply a flanging effect to the audio.
  24534. </p>
  24535. <p>The filter accepts the following options:
  24536. </p>
  24537. <dl compact="compact">
  24538. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  24539. <dd><p>Set base delay in milliseconds. Range from 0 to 30. Default value is 0.
  24540. </p>
  24541. </dd>
  24542. <dt>&lsquo;<samp>depth</samp>&rsquo;</dt>
  24543. <dd><p>Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2.
  24544. </p>
  24545. </dd>
  24546. <dt>&lsquo;<samp>regen</samp>&rsquo;</dt>
  24547. <dd><p>Set percentage regeneration (delayed signal feedback). Range from -95 to 95.
  24548. Default value is 0.
  24549. </p>
  24550. </dd>
  24551. <dt>&lsquo;<samp>width</samp>&rsquo;</dt>
  24552. <dd><p>Set percentage of delayed signal mixed with original. Range from 0 to 100.
  24553. Default value is 71.
  24554. </p>
  24555. </dd>
  24556. <dt>&lsquo;<samp>speed</samp>&rsquo;</dt>
  24557. <dd><p>Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5.
  24558. </p>
  24559. </dd>
  24560. <dt>&lsquo;<samp>shape</samp>&rsquo;</dt>
  24561. <dd><p>Set swept wave shape, can be <var>triangular</var> or <var>sinusoidal</var>.
  24562. Default value is <var>sinusoidal</var>.
  24563. </p>
  24564. </dd>
  24565. <dt>&lsquo;<samp>phase</samp>&rsquo;</dt>
  24566. <dd><p>Set swept wave percentage-shift for multi channel. Range from 0 to 100.
  24567. Default value is 25.
  24568. </p>
  24569. </dd>
  24570. <dt>&lsquo;<samp>interp</samp>&rsquo;</dt>
  24571. <dd><p>Set delay-line interpolation, <var>linear</var> or <var>quadratic</var>.
  24572. Default is <var>linear</var>.
  24573. </p></dd>
  24574. </dl>
  24575. <a name="haas"></a>
  24576. <h2 class="section"><a href="ffmpeg-all.html#toc-haas">36.69 haas</a></h2>
  24577. <p>Apply Haas effect to audio.
  24578. </p>
  24579. <p>Note that this makes most sense to apply on mono signals.
  24580. With this filter applied to mono signals it give some directionality and
  24581. stretches its stereo image.
  24582. </p>
  24583. <p>The filter accepts the following options:
  24584. </p>
  24585. <dl compact="compact">
  24586. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  24587. <dd><p>Set input level. By default is <var>1</var>, or 0dB
  24588. </p>
  24589. </dd>
  24590. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  24591. <dd><p>Set output level. By default is <var>1</var>, or 0dB.
  24592. </p>
  24593. </dd>
  24594. <dt>&lsquo;<samp>side_gain</samp>&rsquo;</dt>
  24595. <dd><p>Set gain applied to side part of signal. By default is <var>1</var>.
  24596. </p>
  24597. </dd>
  24598. <dt>&lsquo;<samp>middle_source</samp>&rsquo;</dt>
  24599. <dd><p>Set kind of middle source. Can be one of the following:
  24600. </p>
  24601. <dl compact="compact">
  24602. <dt>&lsquo;<samp>left</samp>&rsquo;</dt>
  24603. <dd><p>Pick left channel.
  24604. </p>
  24605. </dd>
  24606. <dt>&lsquo;<samp>right</samp>&rsquo;</dt>
  24607. <dd><p>Pick right channel.
  24608. </p>
  24609. </dd>
  24610. <dt>&lsquo;<samp>mid</samp>&rsquo;</dt>
  24611. <dd><p>Pick middle part signal of stereo image.
  24612. </p>
  24613. </dd>
  24614. <dt>&lsquo;<samp>side</samp>&rsquo;</dt>
  24615. <dd><p>Pick side part signal of stereo image.
  24616. </p></dd>
  24617. </dl>
  24618. </dd>
  24619. <dt>&lsquo;<samp>middle_phase</samp>&rsquo;</dt>
  24620. <dd><p>Change middle phase. By default is disabled.
  24621. </p>
  24622. </dd>
  24623. <dt>&lsquo;<samp>left_delay</samp>&rsquo;</dt>
  24624. <dd><p>Set left channel delay. By default is <var>2.05</var> milliseconds.
  24625. </p>
  24626. </dd>
  24627. <dt>&lsquo;<samp>left_balance</samp>&rsquo;</dt>
  24628. <dd><p>Set left channel balance. By default is <var>-1</var>.
  24629. </p>
  24630. </dd>
  24631. <dt>&lsquo;<samp>left_gain</samp>&rsquo;</dt>
  24632. <dd><p>Set left channel gain. By default is <var>1</var>.
  24633. </p>
  24634. </dd>
  24635. <dt>&lsquo;<samp>left_phase</samp>&rsquo;</dt>
  24636. <dd><p>Change left phase. By default is disabled.
  24637. </p>
  24638. </dd>
  24639. <dt>&lsquo;<samp>right_delay</samp>&rsquo;</dt>
  24640. <dd><p>Set right channel delay. By defaults is <var>2.12</var> milliseconds.
  24641. </p>
  24642. </dd>
  24643. <dt>&lsquo;<samp>right_balance</samp>&rsquo;</dt>
  24644. <dd><p>Set right channel balance. By default is <var>1</var>.
  24645. </p>
  24646. </dd>
  24647. <dt>&lsquo;<samp>right_gain</samp>&rsquo;</dt>
  24648. <dd><p>Set right channel gain. By default is <var>1</var>.
  24649. </p>
  24650. </dd>
  24651. <dt>&lsquo;<samp>right_phase</samp>&rsquo;</dt>
  24652. <dd><p>Change right phase. By default is enabled.
  24653. </p></dd>
  24654. </dl>
  24655. <a name="hdcd"></a>
  24656. <h2 class="section"><a href="ffmpeg-all.html#toc-hdcd">36.70 hdcd</a></h2>
  24657. <p>Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with
  24658. embedded HDCD codes is expanded into a 20-bit PCM stream.
  24659. </p>
  24660. <p>The filter supports the Peak Extend and Low-level Gain Adjustment features
  24661. of HDCD, and detects the Transient Filter flag.
  24662. </p>
  24663. <div class="example">
  24664. <pre class="example">ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
  24665. </pre></div>
  24666. <p>When using the filter with wav, note the default encoding for wav is 16-bit,
  24667. so the resulting 20-bit stream will be truncated back to 16-bit. Use something
  24668. like <code>-acodec pcm_s24le</code> after the filter to get 24-bit PCM output.
  24669. </p><div class="example">
  24670. <pre class="example">ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
  24671. ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
  24672. </pre></div>
  24673. <p>The filter accepts the following options:
  24674. </p>
  24675. <dl compact="compact">
  24676. <dt>&lsquo;<samp>disable_autoconvert</samp>&rsquo;</dt>
  24677. <dd><p>Disable any automatic format conversion or resampling in the filter graph.
  24678. </p>
  24679. </dd>
  24680. <dt>&lsquo;<samp>process_stereo</samp>&rsquo;</dt>
  24681. <dd><p>Process the stereo channels together. If target_gain does not match between
  24682. channels, consider it invalid and use the last valid target_gain.
  24683. </p>
  24684. </dd>
  24685. <dt>&lsquo;<samp>cdt_ms</samp>&rsquo;</dt>
  24686. <dd><p>Set the code detect timer period in ms.
  24687. </p>
  24688. </dd>
  24689. <dt>&lsquo;<samp>force_pe</samp>&rsquo;</dt>
  24690. <dd><p>Always extend peaks above -3dBFS even if PE isn&rsquo;t signaled.
  24691. </p>
  24692. </dd>
  24693. <dt>&lsquo;<samp>analyze_mode</samp>&rsquo;</dt>
  24694. <dd><p>Replace audio with a solid tone and adjust the amplitude to signal some
  24695. specific aspect of the decoding process. The output file can be loaded in
  24696. an audio editor alongside the original to aid analysis.
  24697. </p>
  24698. <p><code>analyze_mode=pe:force_pe=true</code> can be used to see all samples above the PE level.
  24699. </p>
  24700. <p>Modes are:
  24701. </p><dl compact="compact">
  24702. <dt>&lsquo;<samp>0, off</samp>&rsquo;</dt>
  24703. <dd><p>Disabled
  24704. </p></dd>
  24705. <dt>&lsquo;<samp>1, lle</samp>&rsquo;</dt>
  24706. <dd><p>Gain adjustment level at each sample
  24707. </p></dd>
  24708. <dt>&lsquo;<samp>2, pe</samp>&rsquo;</dt>
  24709. <dd><p>Samples where peak extend occurs
  24710. </p></dd>
  24711. <dt>&lsquo;<samp>3, cdt</samp>&rsquo;</dt>
  24712. <dd><p>Samples where the code detect timer is active
  24713. </p></dd>
  24714. <dt>&lsquo;<samp>4, tgm</samp>&rsquo;</dt>
  24715. <dd><p>Samples where the target gain does not match between channels
  24716. </p></dd>
  24717. </dl>
  24718. </dd>
  24719. </dl>
  24720. <a name="headphone"></a>
  24721. <h2 class="section"><a href="ffmpeg-all.html#toc-headphone">36.71 headphone</a></h2>
  24722. <p>Apply head-related transfer functions (HRTFs) to create virtual
  24723. loudspeakers around the user for binaural listening via headphones.
  24724. The HRIRs are provided via additional streams, for each channel
  24725. one stereo input stream is needed.
  24726. </p>
  24727. <p>The filter accepts the following options:
  24728. </p>
  24729. <dl compact="compact">
  24730. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  24731. <dd><p>Set mapping of input streams for convolution.
  24732. The argument is a &rsquo;|&rsquo;-separated list of channel names in order as they
  24733. are given as additional stream inputs for filter.
  24734. This also specify number of input streams. Number of input streams
  24735. must be not less than number of channels in first stream plus one.
  24736. </p>
  24737. </dd>
  24738. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  24739. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  24740. </p>
  24741. </dd>
  24742. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  24743. <dd><p>Set processing type. Can be <var>time</var> or <var>freq</var>. <var>time</var> is
  24744. processing audio in time domain which is slow.
  24745. <var>freq</var> is processing audio in frequency domain which is fast.
  24746. Default is <var>freq</var>.
  24747. </p>
  24748. </dd>
  24749. <dt>&lsquo;<samp>lfe</samp>&rsquo;</dt>
  24750. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  24751. </p>
  24752. </dd>
  24753. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  24754. <dd><p>Set size of frame in number of samples which will be processed at once.
  24755. Default value is <var>1024</var>. Allowed range is from 1024 to 96000.
  24756. </p>
  24757. </dd>
  24758. <dt>&lsquo;<samp>hrir</samp>&rsquo;</dt>
  24759. <dd><p>Set format of hrir stream.
  24760. Default value is <var>stereo</var>. Alternative value is <var>multich</var>.
  24761. If value is set to <var>stereo</var>, number of additional streams should
  24762. be greater or equal to number of input channels in first input stream.
  24763. Also each additional stream should have stereo number of channels.
  24764. If value is set to <var>multich</var>, number of additional streams should
  24765. be exactly one. Also number of input channels of additional stream
  24766. should be equal or greater than twice number of channels of first input
  24767. stream.
  24768. </p></dd>
  24769. </dl>
  24770. <a name="Examples-111"></a>
  24771. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-111">36.71.1 Examples</a></h3>
  24772. <ul>
  24773. <li>
  24774. Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  24775. each amovie filter use stereo file with IR coefficients as input.
  24776. The files give coefficients for each position of virtual loudspeaker:
  24777. <div class="example">
  24778. <pre class="example">ffmpeg -i input.wav
  24779. -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;
  24780. output.wav
  24781. </pre></div>
  24782. </li><li>
  24783. Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  24784. but now in <var>multich</var> <var>hrir</var> format.
  24785. <div class="example">
  24786. <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;
  24787. output.wav
  24788. </pre></div>
  24789. </li></ul>
  24790. <a name="highpass"></a>
  24791. <h2 class="section"><a href="ffmpeg-all.html#toc-highpass">36.72 highpass</a></h2>
  24792. <p>Apply a high-pass filter with 3dB point frequency.
  24793. The filter can be either single-pole, or double-pole (the default).
  24794. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  24795. </p>
  24796. <p>The filter accepts the following options:
  24797. </p>
  24798. <dl compact="compact">
  24799. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  24800. <dd><p>Set frequency in Hz. Default is 3000.
  24801. </p>
  24802. </dd>
  24803. <dt>&lsquo;<samp>poles, p</samp>&rsquo;</dt>
  24804. <dd><p>Set number of poles. Default is 2.
  24805. </p>
  24806. </dd>
  24807. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  24808. <dd><p>Set method to specify band-width of filter.
  24809. </p><dl compact="compact">
  24810. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  24811. <dd><p>Hz
  24812. </p></dd>
  24813. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  24814. <dd><p>Q-Factor
  24815. </p></dd>
  24816. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  24817. <dd><p>octave
  24818. </p></dd>
  24819. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  24820. <dd><p>slope
  24821. </p></dd>
  24822. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  24823. <dd><p>kHz
  24824. </p></dd>
  24825. </dl>
  24826. </dd>
  24827. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  24828. <dd><p>Specify the band-width of a filter in width_type units.
  24829. Applies only to double-pole filter.
  24830. The default is 0.707q and gives a Butterworth response.
  24831. </p>
  24832. </dd>
  24833. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  24834. <dd><p>How much to use filtered signal in output. Default is 1.
  24835. Range is between 0 and 1.
  24836. </p>
  24837. </dd>
  24838. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  24839. <dd><p>Specify which channels to filter, by default all available are filtered.
  24840. </p>
  24841. </dd>
  24842. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  24843. <dd><p>Normalize biquad coefficients, by default is disabled.
  24844. Enabling it will normalize magnitude response at DC to 0dB.
  24845. </p></dd>
  24846. </dl>
  24847. <a name="Commands-2"></a>
  24848. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-2">36.72.1 Commands</a></h3>
  24849. <p>This filter supports the following commands:
  24850. </p><dl compact="compact">
  24851. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  24852. <dd><p>Change highpass frequency.
  24853. Syntax for the command is : &quot;<var>frequency</var>&quot;
  24854. </p>
  24855. </dd>
  24856. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  24857. <dd><p>Change highpass width_type.
  24858. Syntax for the command is : &quot;<var>width_type</var>&quot;
  24859. </p>
  24860. </dd>
  24861. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  24862. <dd><p>Change highpass width.
  24863. Syntax for the command is : &quot;<var>width</var>&quot;
  24864. </p>
  24865. </dd>
  24866. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  24867. <dd><p>Change highpass mix.
  24868. Syntax for the command is : &quot;<var>mix</var>&quot;
  24869. </p></dd>
  24870. </dl>
  24871. <a name="join"></a>
  24872. <h2 class="section"><a href="ffmpeg-all.html#toc-join">36.73 join</a></h2>
  24873. <p>Join multiple input streams into one multi-channel stream.
  24874. </p>
  24875. <p>It accepts the following parameters:
  24876. </p><dl compact="compact">
  24877. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  24878. <dd><p>The number of input streams. It defaults to 2.
  24879. </p>
  24880. </dd>
  24881. <dt>&lsquo;<samp>channel_layout</samp>&rsquo;</dt>
  24882. <dd><p>The desired output channel layout. It defaults to stereo.
  24883. </p>
  24884. </dd>
  24885. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  24886. <dd><p>Map channels from inputs to output. The argument is a &rsquo;|&rsquo;-separated list of
  24887. mappings, each in the <code><var>input_idx</var>.<var>in_channel</var>-<var>out_channel</var></code>
  24888. form. <var>input_idx</var> is the 0-based index of the input stream. <var>in_channel</var>
  24889. can be either the name of the input channel (e.g. FL for front left) or its
  24890. index in the specified input stream. <var>out_channel</var> is the name of the output
  24891. channel.
  24892. </p></dd>
  24893. </dl>
  24894. <p>The filter will attempt to guess the mappings when they are not specified
  24895. explicitly. It does so by first trying to find an unused matching input channel
  24896. and if that fails it picks the first unused input channel.
  24897. </p>
  24898. <p>Join 3 inputs (with properly set channel layouts):
  24899. </p><div class="example">
  24900. <pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
  24901. </pre></div>
  24902. <p>Build a 5.1 output from 6 single-channel streams:
  24903. </p><div class="example">
  24904. <pre class="example">ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
  24905. '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'
  24906. out
  24907. </pre></div>
  24908. <a name="ladspa"></a>
  24909. <h2 class="section"><a href="ffmpeg-all.html#toc-ladspa">36.74 ladspa</a></h2>
  24910. <p>Load a LADSPA (Linux Audio Developer&rsquo;s Simple Plugin API) plugin.
  24911. </p>
  24912. <p>To enable compilation of this filter you need to configure FFmpeg with
  24913. <code>--enable-ladspa</code>.
  24914. </p>
  24915. <dl compact="compact">
  24916. <dt>&lsquo;<samp>file, f</samp>&rsquo;</dt>
  24917. <dd><p>Specifies the name of LADSPA plugin library to load. If the environment
  24918. variable <code>LADSPA_PATH</code> is defined, the LADSPA plugin is searched in
  24919. each one of the directories specified by the colon separated list in
  24920. <code>LADSPA_PATH</code>, otherwise in the standard LADSPA paths, which are in
  24921. this order: &lsquo;<tt>HOME/.ladspa/lib/</tt>&rsquo;, &lsquo;<tt>/usr/local/lib/ladspa/</tt>&rsquo;,
  24922. &lsquo;<tt>/usr/lib/ladspa/</tt>&rsquo;.
  24923. </p>
  24924. </dd>
  24925. <dt>&lsquo;<samp>plugin, p</samp>&rsquo;</dt>
  24926. <dd><p>Specifies the plugin within the library. Some libraries contain only
  24927. one plugin, but others contain many of them. If this is not set filter
  24928. will list all available plugins within the specified library.
  24929. </p>
  24930. </dd>
  24931. <dt>&lsquo;<samp>controls, c</samp>&rsquo;</dt>
  24932. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  24933. values that determine the behavior of the loaded plugin (for example delay,
  24934. threshold or gain).
  24935. Controls need to be defined using the following syntax:
  24936. c0=<var>value0</var>|c1=<var>value1</var>|c2=<var>value2</var>|..., where
  24937. <var>valuei</var> is the value set on the <var>i</var>-th control.
  24938. Alternatively they can be also defined using the following syntax:
  24939. <var>value0</var>|<var>value1</var>|<var>value2</var>|..., where
  24940. <var>valuei</var> is the value set on the <var>i</var>-th control.
  24941. If &lsquo;<samp>controls</samp>&rsquo; is set to <code>help</code>, all available controls and
  24942. their valid ranges are printed.
  24943. </p>
  24944. </dd>
  24945. <dt>&lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
  24946. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  24947. zero inputs.
  24948. </p>
  24949. </dd>
  24950. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  24951. <dd><p>Set the number of samples per channel per each output frame, default
  24952. is 1024. Only used if plugin have zero inputs.
  24953. </p>
  24954. </dd>
  24955. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  24956. <dd><p>Set the minimum duration of the sourced audio. See
  24957. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  24958. for the accepted syntax.
  24959. Note that the resulting duration may be greater than the specified duration,
  24960. as the generated audio is always cut at the end of a complete frame.
  24961. If not specified, or the expressed duration is negative, the audio is
  24962. supposed to be generated forever.
  24963. Only used if plugin have zero inputs.
  24964. </p>
  24965. </dd>
  24966. </dl>
  24967. <a name="Examples-161"></a>
  24968. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-161">36.74.1 Examples</a></h3>
  24969. <ul>
  24970. <li>
  24971. List all available plugins within amp (LADSPA example plugin) library:
  24972. <div class="example">
  24973. <pre class="example">ladspa=file=amp
  24974. </pre></div>
  24975. </li><li>
  24976. List all available controls and their valid ranges for <code>vcf_notch</code>
  24977. plugin from <code>VCF</code> library:
  24978. <div class="example">
  24979. <pre class="example">ladspa=f=vcf:p=vcf_notch:c=help
  24980. </pre></div>
  24981. </li><li>
  24982. Simulate low quality audio equipment using <code>Computer Music Toolkit</code> (CMT)
  24983. plugin library:
  24984. <div class="example">
  24985. <pre class="example">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
  24986. </pre></div>
  24987. </li><li>
  24988. Add reverberation to the audio using TAP-plugins
  24989. (Tom&rsquo;s Audio Processing plugins):
  24990. <div class="example">
  24991. <pre class="example">ladspa=file=tap_reverb:tap_reverb
  24992. </pre></div>
  24993. </li><li>
  24994. Generate white noise, with 0.2 amplitude:
  24995. <div class="example">
  24996. <pre class="example">ladspa=file=cmt:noise_source_white:c=c0=.2
  24997. </pre></div>
  24998. </li><li>
  24999. Generate 20 bpm clicks using plugin <code>C* Click - Metronome</code> from the
  25000. <code>C* Audio Plugin Suite</code> (CAPS) library:
  25001. <div class="example">
  25002. <pre class="example">ladspa=file=caps:Click:c=c1=20'
  25003. </pre></div>
  25004. </li><li>
  25005. Apply <code>C* Eq10X2 - Stereo 10-band equaliser</code> effect:
  25006. <div class="example">
  25007. <pre class="example">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
  25008. </pre></div>
  25009. </li><li>
  25010. Increase volume by 20dB using fast lookahead limiter from Steve Harris
  25011. <code>SWH Plugins</code> collection:
  25012. <div class="example">
  25013. <pre class="example">ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
  25014. </pre></div>
  25015. </li><li>
  25016. Attenuate low frequencies using Multiband EQ from Steve Harris
  25017. <code>SWH Plugins</code> collection:
  25018. <div class="example">
  25019. <pre class="example">ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
  25020. </pre></div>
  25021. </li><li>
  25022. Reduce stereo image using <code>Narrower</code> from the <code>C* Audio Plugin Suite</code>
  25023. (CAPS) library:
  25024. <div class="example">
  25025. <pre class="example">ladspa=caps:Narrower
  25026. </pre></div>
  25027. </li><li>
  25028. Another white noise, now using <code>C* Audio Plugin Suite</code> (CAPS) library:
  25029. <div class="example">
  25030. <pre class="example">ladspa=caps:White:.2
  25031. </pre></div>
  25032. </li><li>
  25033. Some fractal noise, using <code>C* Audio Plugin Suite</code> (CAPS) library:
  25034. <div class="example">
  25035. <pre class="example">ladspa=caps:Fractal:c=c1=1
  25036. </pre></div>
  25037. </li><li>
  25038. Dynamic volume normalization using <code>VLevel</code> plugin:
  25039. <div class="example">
  25040. <pre class="example">ladspa=vlevel-ladspa:vlevel_mono
  25041. </pre></div>
  25042. </li></ul>
  25043. <a name="Commands-61"></a>
  25044. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-61">36.74.2 Commands</a></h3>
  25045. <p>This filter supports the following commands:
  25046. </p><dl compact="compact">
  25047. <dt>&lsquo;<samp>cN</samp>&rsquo;</dt>
  25048. <dd><p>Modify the <var>N</var>-th control value.
  25049. </p>
  25050. <p>If the specified value is not valid, it is ignored and prior one is kept.
  25051. </p></dd>
  25052. </dl>
  25053. <a name="loudnorm"></a>
  25054. <h2 class="section"><a href="ffmpeg-all.html#toc-loudnorm">36.75 loudnorm</a></h2>
  25055. <p>EBU R128 loudness normalization. Includes both dynamic and linear normalization modes.
  25056. Support for both single pass (livestreams, files) and double pass (files) modes.
  25057. This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately
  25058. detect true peaks, the audio stream will be upsampled to 192 kHz.
  25059. Use the <code>-ar</code> option or <code>aresample</code> filter to explicitly set an output sample rate.
  25060. </p>
  25061. <p>The filter accepts the following options:
  25062. </p>
  25063. <dl compact="compact">
  25064. <dt>&lsquo;<samp>I, i</samp>&rsquo;</dt>
  25065. <dd><p>Set integrated loudness target.
  25066. Range is -70.0 - -5.0. Default value is -24.0.
  25067. </p>
  25068. </dd>
  25069. <dt>&lsquo;<samp>LRA, lra</samp>&rsquo;</dt>
  25070. <dd><p>Set loudness range target.
  25071. Range is 1.0 - 20.0. Default value is 7.0.
  25072. </p>
  25073. </dd>
  25074. <dt>&lsquo;<samp>TP, tp</samp>&rsquo;</dt>
  25075. <dd><p>Set maximum true peak.
  25076. Range is -9.0 - +0.0. Default value is -2.0.
  25077. </p>
  25078. </dd>
  25079. <dt>&lsquo;<samp>measured_I, measured_i</samp>&rsquo;</dt>
  25080. <dd><p>Measured IL of input file.
  25081. Range is -99.0 - +0.0.
  25082. </p>
  25083. </dd>
  25084. <dt>&lsquo;<samp>measured_LRA, measured_lra</samp>&rsquo;</dt>
  25085. <dd><p>Measured LRA of input file.
  25086. Range is 0.0 - 99.0.
  25087. </p>
  25088. </dd>
  25089. <dt>&lsquo;<samp>measured_TP, measured_tp</samp>&rsquo;</dt>
  25090. <dd><p>Measured true peak of input file.
  25091. Range is -99.0 - +99.0.
  25092. </p>
  25093. </dd>
  25094. <dt>&lsquo;<samp>measured_thresh</samp>&rsquo;</dt>
  25095. <dd><p>Measured threshold of input file.
  25096. Range is -99.0 - +0.0.
  25097. </p>
  25098. </dd>
  25099. <dt>&lsquo;<samp>offset</samp>&rsquo;</dt>
  25100. <dd><p>Set offset gain. Gain is applied before the true-peak limiter.
  25101. Range is -99.0 - +99.0. Default is +0.0.
  25102. </p>
  25103. </dd>
  25104. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  25105. <dd><p>Normalize by linearly scaling the source audio.
  25106. <code>measured_I</code>, <code>measured_LRA</code>, <code>measured_TP</code>,
  25107. and <code>measured_thresh</code> must all be specified. Target LRA shouldn&rsquo;t
  25108. be lower than source LRA and the change in integrated loudness shouldn&rsquo;t
  25109. result in a true peak which exceeds the target TP. If any of these
  25110. conditions aren&rsquo;t met, normalization mode will revert to <var>dynamic</var>.
  25111. Options are <code>true</code> or <code>false</code>. Default is <code>true</code>.
  25112. </p>
  25113. </dd>
  25114. <dt>&lsquo;<samp>dual_mono</samp>&rsquo;</dt>
  25115. <dd><p>Treat mono input files as &quot;dual-mono&quot;. If a mono file is intended for playback
  25116. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  25117. If set to <code>true</code>, this option will compensate for this effect.
  25118. Multi-channel input files are not affected by this option.
  25119. Options are true or false. Default is false.
  25120. </p>
  25121. </dd>
  25122. <dt>&lsquo;<samp>print_format</samp>&rsquo;</dt>
  25123. <dd><p>Set print format for stats. Options are summary, json, or none.
  25124. Default value is none.
  25125. </p></dd>
  25126. </dl>
  25127. <a name="lowpass"></a>
  25128. <h2 class="section"><a href="ffmpeg-all.html#toc-lowpass">36.76 lowpass</a></h2>
  25129. <p>Apply a low-pass filter with 3dB point frequency.
  25130. The filter can be either single-pole or double-pole (the default).
  25131. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  25132. </p>
  25133. <p>The filter accepts the following options:
  25134. </p>
  25135. <dl compact="compact">
  25136. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  25137. <dd><p>Set frequency in Hz. Default is 500.
  25138. </p>
  25139. </dd>
  25140. <dt>&lsquo;<samp>poles, p</samp>&rsquo;</dt>
  25141. <dd><p>Set number of poles. Default is 2.
  25142. </p>
  25143. </dd>
  25144. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  25145. <dd><p>Set method to specify band-width of filter.
  25146. </p><dl compact="compact">
  25147. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  25148. <dd><p>Hz
  25149. </p></dd>
  25150. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  25151. <dd><p>Q-Factor
  25152. </p></dd>
  25153. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  25154. <dd><p>octave
  25155. </p></dd>
  25156. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  25157. <dd><p>slope
  25158. </p></dd>
  25159. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  25160. <dd><p>kHz
  25161. </p></dd>
  25162. </dl>
  25163. </dd>
  25164. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  25165. <dd><p>Specify the band-width of a filter in width_type units.
  25166. Applies only to double-pole filter.
  25167. The default is 0.707q and gives a Butterworth response.
  25168. </p>
  25169. </dd>
  25170. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  25171. <dd><p>How much to use filtered signal in output. Default is 1.
  25172. Range is between 0 and 1.
  25173. </p>
  25174. </dd>
  25175. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  25176. <dd><p>Specify which channels to filter, by default all available are filtered.
  25177. </p>
  25178. </dd>
  25179. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  25180. <dd><p>Normalize biquad coefficients, by default is disabled.
  25181. Enabling it will normalize magnitude response at DC to 0dB.
  25182. </p></dd>
  25183. </dl>
  25184. <a name="Examples-15"></a>
  25185. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-15">36.76.1 Examples</a></h3>
  25186. <ul>
  25187. <li>
  25188. Lowpass only LFE channel, it LFE is not present it does nothing:
  25189. <div class="example">
  25190. <pre class="example">lowpass=c=LFE
  25191. </pre></div>
  25192. </li></ul>
  25193. <a name="Commands-35"></a>
  25194. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-35">36.76.2 Commands</a></h3>
  25195. <p>This filter supports the following commands:
  25196. </p><dl compact="compact">
  25197. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  25198. <dd><p>Change lowpass frequency.
  25199. Syntax for the command is : &quot;<var>frequency</var>&quot;
  25200. </p>
  25201. </dd>
  25202. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  25203. <dd><p>Change lowpass width_type.
  25204. Syntax for the command is : &quot;<var>width_type</var>&quot;
  25205. </p>
  25206. </dd>
  25207. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  25208. <dd><p>Change lowpass width.
  25209. Syntax for the command is : &quot;<var>width</var>&quot;
  25210. </p>
  25211. </dd>
  25212. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  25213. <dd><p>Change lowpass mix.
  25214. Syntax for the command is : &quot;<var>mix</var>&quot;
  25215. </p></dd>
  25216. </dl>
  25217. <a name="lv2"></a>
  25218. <h2 class="section"><a href="ffmpeg-all.html#toc-lv2">36.77 lv2</a></h2>
  25219. <p>Load a LV2 (LADSPA Version 2) plugin.
  25220. </p>
  25221. <p>To enable compilation of this filter you need to configure FFmpeg with
  25222. <code>--enable-lv2</code>.
  25223. </p>
  25224. <dl compact="compact">
  25225. <dt>&lsquo;<samp>plugin, p</samp>&rsquo;</dt>
  25226. <dd><p>Specifies the plugin URI. You may need to escape &rsquo;:&rsquo;.
  25227. </p>
  25228. </dd>
  25229. <dt>&lsquo;<samp>controls, c</samp>&rsquo;</dt>
  25230. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  25231. values that determine the behavior of the loaded plugin (for example delay,
  25232. threshold or gain).
  25233. If &lsquo;<samp>controls</samp>&rsquo; is set to <code>help</code>, all available controls and
  25234. their valid ranges are printed.
  25235. </p>
  25236. </dd>
  25237. <dt>&lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
  25238. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  25239. zero inputs.
  25240. </p>
  25241. </dd>
  25242. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  25243. <dd><p>Set the number of samples per channel per each output frame, default
  25244. is 1024. Only used if plugin have zero inputs.
  25245. </p>
  25246. </dd>
  25247. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  25248. <dd><p>Set the minimum duration of the sourced audio. See
  25249. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  25250. for the accepted syntax.
  25251. Note that the resulting duration may be greater than the specified duration,
  25252. as the generated audio is always cut at the end of a complete frame.
  25253. If not specified, or the expressed duration is negative, the audio is
  25254. supposed to be generated forever.
  25255. Only used if plugin have zero inputs.
  25256. </p></dd>
  25257. </dl>
  25258. <a name="Examples-150"></a>
  25259. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-150">36.77.1 Examples</a></h3>
  25260. <ul>
  25261. <li>
  25262. Apply bass enhancer plugin from Calf:
  25263. <div class="example">
  25264. <pre class="example">lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
  25265. </pre></div>
  25266. </li><li>
  25267. Apply vinyl plugin from Calf:
  25268. <div class="example">
  25269. <pre class="example">lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
  25270. </pre></div>
  25271. </li><li>
  25272. Apply bit crusher plugin from ArtyFX:
  25273. <div class="example">
  25274. <pre class="example">lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
  25275. </pre></div>
  25276. </li></ul>
  25277. <a name="mcompand"></a>
  25278. <h2 class="section"><a href="ffmpeg-all.html#toc-mcompand">36.78 mcompand</a></h2>
  25279. <p>Multiband Compress or expand the audio&rsquo;s dynamic range.
  25280. </p>
  25281. <p>The input audio is divided into bands using 4th order Linkwitz-Riley IIRs.
  25282. This is akin to the crossover of a loudspeaker, and results in flat frequency
  25283. response when absent compander action.
  25284. </p>
  25285. <p>It accepts the following parameters:
  25286. </p>
  25287. <dl compact="compact">
  25288. <dt>&lsquo;<samp>args</samp>&rsquo;</dt>
  25289. <dd><p>This option syntax is:
  25290. attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ...
  25291. For explanation of each item refer to compand filter documentation.
  25292. </p></dd>
  25293. </dl>
  25294. <p><a name="pan"></a>
  25295. </p><a name="pan-1"></a>
  25296. <h2 class="section"><a href="ffmpeg-all.html#toc-pan-1">36.79 pan</a></h2>
  25297. <p>Mix channels with specific gain levels. The filter accepts the output
  25298. channel layout followed by a set of channels definitions.
  25299. </p>
  25300. <p>This filter is also designed to efficiently remap the channels of an audio
  25301. stream.
  25302. </p>
  25303. <p>The filter accepts parameters of the form:
  25304. &quot;<var>l</var>|<var>outdef</var>|<var>outdef</var>|...&quot;
  25305. </p>
  25306. <dl compact="compact">
  25307. <dt>&lsquo;<samp>l</samp>&rsquo;</dt>
  25308. <dd><p>output channel layout or number of channels
  25309. </p>
  25310. </dd>
  25311. <dt>&lsquo;<samp>outdef</samp>&rsquo;</dt>
  25312. <dd><p>output channel specification, of the form:
  25313. &quot;<var>out_name</var>=[<var>gain</var>*]<var>in_name</var>[(+-)[<var>gain</var>*]<var>in_name</var>...]&quot;
  25314. </p>
  25315. </dd>
  25316. <dt>&lsquo;<samp>out_name</samp>&rsquo;</dt>
  25317. <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
  25318. number (c0, c1, etc.)
  25319. </p>
  25320. </dd>
  25321. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  25322. <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
  25323. </p>
  25324. </dd>
  25325. <dt>&lsquo;<samp>in_name</samp>&rsquo;</dt>
  25326. <dd><p>input channel to use, see out_name for details; it is not possible to mix
  25327. named and numbered input channels
  25328. </p></dd>
  25329. </dl>
  25330. <p>If the &lsquo;=&rsquo; in a channel specification is replaced by &lsquo;&lt;&rsquo;, then the gains for
  25331. that specification will be renormalized so that the total is 1, thus
  25332. avoiding clipping noise.
  25333. </p>
  25334. <a name="Mixing-examples"></a>
  25335. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Mixing-examples">36.79.1 Mixing examples</a></h3>
  25336. <p>For example, if you want to down-mix from stereo to mono, but with a bigger
  25337. factor for the left channel:
  25338. </p><div class="example">
  25339. <pre class="example">pan=1c|c0=0.9*c0+0.1*c1
  25340. </pre></div>
  25341. <p>A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
  25342. 7-channels surround:
  25343. </p><div class="example">
  25344. <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
  25345. </pre></div>
  25346. <p>Note that <code>ffmpeg</code> integrates a default down-mix (and up-mix) system
  25347. that should be preferred (see &quot;-ac&quot; option) unless you have very specific
  25348. needs.
  25349. </p>
  25350. <a name="Remapping-examples"></a>
  25351. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Remapping-examples">36.79.2 Remapping examples</a></h3>
  25352. <p>The channel remapping will be effective if, and only if:
  25353. </p>
  25354. <ul>
  25355. <li> gain coefficients are zeroes or ones,
  25356. </li><li> only one input per channel output,
  25357. </li></ul>
  25358. <p>If all these conditions are satisfied, the filter will notify the user (&quot;Pure
  25359. channel mapping detected&quot;), and use an optimized and lossless method to do the
  25360. remapping.
  25361. </p>
  25362. <p>For example, if you have a 5.1 source and want a stereo audio stream by
  25363. dropping the extra channels:
  25364. </p><div class="example">
  25365. <pre class="example">pan=&quot;stereo| c0=FL | c1=FR&quot;
  25366. </pre></div>
  25367. <p>Given the same source, you can also switch front left and front right channels
  25368. and keep the input channel layout:
  25369. </p><div class="example">
  25370. <pre class="example">pan=&quot;5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5&quot;
  25371. </pre></div>
  25372. <p>If the input is a stereo audio stream, you can mute the front left channel (and
  25373. still keep the stereo channel layout) with:
  25374. </p><div class="example">
  25375. <pre class="example">pan=&quot;stereo|c1=c1&quot;
  25376. </pre></div>
  25377. <p>Still with a stereo audio stream input, you can copy the right channel in both
  25378. front left and right:
  25379. </p><div class="example">
  25380. <pre class="example">pan=&quot;stereo| c0=FR | c1=FR&quot;
  25381. </pre></div>
  25382. <a name="replaygain"></a>
  25383. <h2 class="section"><a href="ffmpeg-all.html#toc-replaygain">36.80 replaygain</a></h2>
  25384. <p>ReplayGain scanner filter. This filter takes an audio stream as an input and
  25385. outputs it unchanged.
  25386. At end of filtering it displays <code>track_gain</code> and <code>track_peak</code>.
  25387. </p>
  25388. <a name="resample"></a>
  25389. <h2 class="section"><a href="ffmpeg-all.html#toc-resample">36.81 resample</a></h2>
  25390. <p>Convert the audio sample format, sample rate and channel layout. It is
  25391. not meant to be used directly.
  25392. </p>
  25393. <a name="rubberband"></a>
  25394. <h2 class="section"><a href="ffmpeg-all.html#toc-rubberband">36.82 rubberband</a></h2>
  25395. <p>Apply time-stretching and pitch-shifting with librubberband.
  25396. </p>
  25397. <p>To enable compilation of this filter, you need to configure FFmpeg with
  25398. <code>--enable-librubberband</code>.
  25399. </p>
  25400. <p>The filter accepts the following options:
  25401. </p>
  25402. <dl compact="compact">
  25403. <dt>&lsquo;<samp>tempo</samp>&rsquo;</dt>
  25404. <dd><p>Set tempo scale factor.
  25405. </p>
  25406. </dd>
  25407. <dt>&lsquo;<samp>pitch</samp>&rsquo;</dt>
  25408. <dd><p>Set pitch scale factor.
  25409. </p>
  25410. </dd>
  25411. <dt>&lsquo;<samp>transients</samp>&rsquo;</dt>
  25412. <dd><p>Set transients detector.
  25413. Possible values are:
  25414. </p><dl compact="compact">
  25415. <dt><var>crisp</var></dt>
  25416. <dt><var>mixed</var></dt>
  25417. <dt><var>smooth</var></dt>
  25418. </dl>
  25419. </dd>
  25420. <dt>&lsquo;<samp>detector</samp>&rsquo;</dt>
  25421. <dd><p>Set detector.
  25422. Possible values are:
  25423. </p><dl compact="compact">
  25424. <dt><var>compound</var></dt>
  25425. <dt><var>percussive</var></dt>
  25426. <dt><var>soft</var></dt>
  25427. </dl>
  25428. </dd>
  25429. <dt>&lsquo;<samp>phase</samp>&rsquo;</dt>
  25430. <dd><p>Set phase.
  25431. Possible values are:
  25432. </p><dl compact="compact">
  25433. <dt><var>laminar</var></dt>
  25434. <dt><var>independent</var></dt>
  25435. </dl>
  25436. </dd>
  25437. <dt>&lsquo;<samp>window</samp>&rsquo;</dt>
  25438. <dd><p>Set processing window size.
  25439. Possible values are:
  25440. </p><dl compact="compact">
  25441. <dt><var>standard</var></dt>
  25442. <dt><var>short</var></dt>
  25443. <dt><var>long</var></dt>
  25444. </dl>
  25445. </dd>
  25446. <dt>&lsquo;<samp>smoothing</samp>&rsquo;</dt>
  25447. <dd><p>Set smoothing.
  25448. Possible values are:
  25449. </p><dl compact="compact">
  25450. <dt><var>off</var></dt>
  25451. <dt><var>on</var></dt>
  25452. </dl>
  25453. </dd>
  25454. <dt>&lsquo;<samp>formant</samp>&rsquo;</dt>
  25455. <dd><p>Enable formant preservation when shift pitching.
  25456. Possible values are:
  25457. </p><dl compact="compact">
  25458. <dt><var>shifted</var></dt>
  25459. <dt><var>preserved</var></dt>
  25460. </dl>
  25461. </dd>
  25462. <dt>&lsquo;<samp>pitchq</samp>&rsquo;</dt>
  25463. <dd><p>Set pitch quality.
  25464. Possible values are:
  25465. </p><dl compact="compact">
  25466. <dt><var>quality</var></dt>
  25467. <dt><var>speed</var></dt>
  25468. <dt><var>consistency</var></dt>
  25469. </dl>
  25470. </dd>
  25471. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  25472. <dd><p>Set channels.
  25473. Possible values are:
  25474. </p><dl compact="compact">
  25475. <dt><var>apart</var></dt>
  25476. <dt><var>together</var></dt>
  25477. </dl>
  25478. </dd>
  25479. </dl>
  25480. <a name="Commands-63"></a>
  25481. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-63">36.82.1 Commands</a></h3>
  25482. <p>This filter supports the following commands:
  25483. </p><dl compact="compact">
  25484. <dt>&lsquo;<samp>tempo</samp>&rsquo;</dt>
  25485. <dd><p>Change filter tempo scale factor.
  25486. Syntax for the command is : &quot;<var>tempo</var>&quot;
  25487. </p>
  25488. </dd>
  25489. <dt>&lsquo;<samp>pitch</samp>&rsquo;</dt>
  25490. <dd><p>Change filter pitch scale factor.
  25491. Syntax for the command is : &quot;<var>pitch</var>&quot;
  25492. </p></dd>
  25493. </dl>
  25494. <a name="sidechaincompress"></a>
  25495. <h2 class="section"><a href="ffmpeg-all.html#toc-sidechaincompress">36.83 sidechaincompress</a></h2>
  25496. <p>This filter acts like normal compressor but has the ability to compress
  25497. detected signal using second input signal.
  25498. It needs two input streams and returns one output stream.
  25499. First input stream will be processed depending on second stream signal.
  25500. The filtered signal then can be filtered with other filters in later stages of
  25501. processing. See <a href="#pan">pan</a> and <a href="#amerge">amerge</a> filter.
  25502. </p>
  25503. <p>The filter accepts the following options:
  25504. </p>
  25505. <dl compact="compact">
  25506. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  25507. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  25508. </p>
  25509. </dd>
  25510. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  25511. <dd><p>Set mode of compressor operation. Can be <code>upward</code> or <code>downward</code>.
  25512. Default is <code>downward</code>.
  25513. </p>
  25514. </dd>
  25515. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  25516. <dd><p>If a signal of second stream raises above this level it will affect the gain
  25517. reduction of first stream.
  25518. By default is 0.125. Range is between 0.00097563 and 1.
  25519. </p>
  25520. </dd>
  25521. <dt>&lsquo;<samp>ratio</samp>&rsquo;</dt>
  25522. <dd><p>Set a ratio about which the signal is reduced. 1:2 means that if the level
  25523. raised 4dB above the threshold, it will be only 2dB above after the reduction.
  25524. Default is 2. Range is between 1 and 20.
  25525. </p>
  25526. </dd>
  25527. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  25528. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  25529. reduction starts. Default is 20. Range is between 0.01 and 2000.
  25530. </p>
  25531. </dd>
  25532. <dt>&lsquo;<samp>release</samp>&rsquo;</dt>
  25533. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  25534. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  25535. </p>
  25536. </dd>
  25537. <dt>&lsquo;<samp>makeup</samp>&rsquo;</dt>
  25538. <dd><p>Set the amount by how much signal will be amplified after processing.
  25539. Default is 1. Range is from 1 to 64.
  25540. </p>
  25541. </dd>
  25542. <dt>&lsquo;<samp>knee</samp>&rsquo;</dt>
  25543. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  25544. Default is 2.82843. Range is between 1 and 8.
  25545. </p>
  25546. </dd>
  25547. <dt>&lsquo;<samp>link</samp>&rsquo;</dt>
  25548. <dd><p>Choose if the <code>average</code> level between all channels of side-chain stream
  25549. or the louder(<code>maximum</code>) channel of side-chain stream affects the
  25550. reduction. Default is <code>average</code>.
  25551. </p>
  25552. </dd>
  25553. <dt>&lsquo;<samp>detection</samp>&rsquo;</dt>
  25554. <dd><p>Should the exact signal be taken in case of <code>peak</code> or an RMS one in case
  25555. of <code>rms</code>. Default is <code>rms</code> which is mainly smoother.
  25556. </p>
  25557. </dd>
  25558. <dt>&lsquo;<samp>level_sc</samp>&rsquo;</dt>
  25559. <dd><p>Set sidechain gain. Default is 1. Range is between 0.015625 and 64.
  25560. </p>
  25561. </dd>
  25562. <dt>&lsquo;<samp>mix</samp>&rsquo;</dt>
  25563. <dd><p>How much to use compressed signal in output. Default is 1.
  25564. Range is between 0 and 1.
  25565. </p></dd>
  25566. </dl>
  25567. <a name="Commands-3"></a>
  25568. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-3">36.83.1 Commands</a></h3>
  25569. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  25570. </p>
  25571. <a name="Examples-12"></a>
  25572. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-12">36.83.2 Examples</a></h3>
  25573. <ul>
  25574. <li>
  25575. Full ffmpeg example taking 2 audio inputs, 1st input to be compressed
  25576. depending on the signal of 2nd input and later compressed signal to be
  25577. merged with 2nd input:
  25578. <div class="example">
  25579. <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;
  25580. </pre></div>
  25581. </li></ul>
  25582. <a name="sidechaingate"></a>
  25583. <h2 class="section"><a href="ffmpeg-all.html#toc-sidechaingate">36.84 sidechaingate</a></h2>
  25584. <p>A sidechain gate acts like a normal (wideband) gate but has the ability to
  25585. filter the detected signal before sending it to the gain reduction stage.
  25586. Normally a gate uses the full range signal to detect a level above the
  25587. threshold.
  25588. For example: If you cut all lower frequencies from your sidechain signal
  25589. the gate will decrease the volume of your track only if not enough highs
  25590. appear. With this technique you are able to reduce the resonation of a
  25591. natural drum or remove &quot;rumbling&quot; of muted strokes from a heavily distorted
  25592. guitar.
  25593. It needs two input streams and returns one output stream.
  25594. First input stream will be processed depending on second stream signal.
  25595. </p>
  25596. <p>The filter accepts the following options:
  25597. </p>
  25598. <dl compact="compact">
  25599. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  25600. <dd><p>Set input level before filtering.
  25601. Default is 1. Allowed range is from 0.015625 to 64.
  25602. </p>
  25603. </dd>
  25604. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  25605. <dd><p>Set the mode of operation. Can be <code>upward</code> or <code>downward</code>.
  25606. Default is <code>downward</code>. If set to <code>upward</code> mode, higher parts of signal
  25607. will be amplified, expanding dynamic range in upward direction.
  25608. Otherwise, in case of <code>downward</code> lower parts of signal will be reduced.
  25609. </p>
  25610. </dd>
  25611. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  25612. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  25613. Default is 0.06125. Allowed range is from 0 to 1.
  25614. Setting this to 0 disables reduction and then filter behaves like expander.
  25615. </p>
  25616. </dd>
  25617. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  25618. <dd><p>If a signal rises above this level the gain reduction is released.
  25619. Default is 0.125. Allowed range is from 0 to 1.
  25620. </p>
  25621. </dd>
  25622. <dt>&lsquo;<samp>ratio</samp>&rsquo;</dt>
  25623. <dd><p>Set a ratio about which the signal is reduced.
  25624. Default is 2. Allowed range is from 1 to 9000.
  25625. </p>
  25626. </dd>
  25627. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  25628. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  25629. reduction stops.
  25630. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  25631. </p>
  25632. </dd>
  25633. <dt>&lsquo;<samp>release</samp>&rsquo;</dt>
  25634. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  25635. reduction is increased again. Default is 250 milliseconds.
  25636. Allowed range is from 0.01 to 9000.
  25637. </p>
  25638. </dd>
  25639. <dt>&lsquo;<samp>makeup</samp>&rsquo;</dt>
  25640. <dd><p>Set amount of amplification of signal after processing.
  25641. Default is 1. Allowed range is from 1 to 64.
  25642. </p>
  25643. </dd>
  25644. <dt>&lsquo;<samp>knee</samp>&rsquo;</dt>
  25645. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  25646. Default is 2.828427125. Allowed range is from 1 to 8.
  25647. </p>
  25648. </dd>
  25649. <dt>&lsquo;<samp>detection</samp>&rsquo;</dt>
  25650. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  25651. Default is rms. Can be peak or rms.
  25652. </p>
  25653. </dd>
  25654. <dt>&lsquo;<samp>link</samp>&rsquo;</dt>
  25655. <dd><p>Choose if the average level between all channels or the louder channel affects
  25656. the reduction.
  25657. Default is average. Can be average or maximum.
  25658. </p>
  25659. </dd>
  25660. <dt>&lsquo;<samp>level_sc</samp>&rsquo;</dt>
  25661. <dd><p>Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
  25662. </p></dd>
  25663. </dl>
  25664. <a name="silencedetect"></a>
  25665. <h2 class="section"><a href="ffmpeg-all.html#toc-silencedetect">36.85 silencedetect</a></h2>
  25666. <p>Detect silence in an audio stream.
  25667. </p>
  25668. <p>This filter logs a message when it detects that the input audio volume is less
  25669. or equal to a noise tolerance value for a duration greater or equal to the
  25670. minimum detected noise duration.
  25671. </p>
  25672. <p>The printed times and duration are expressed in seconds. The
  25673. <code>lavfi.silence_start</code> or <code>lavfi.silence_start.X</code> metadata key
  25674. is set on the first frame whose timestamp equals or exceeds the detection
  25675. duration and it contains the timestamp of the first frame of the silence.
  25676. </p>
  25677. <p>The <code>lavfi.silence_duration</code> or <code>lavfi.silence_duration.X</code>
  25678. and <code>lavfi.silence_end</code> or <code>lavfi.silence_end.X</code> metadata
  25679. keys are set on the first frame after the silence. If &lsquo;<samp>mono</samp>&rsquo; is
  25680. enabled, and each channel is evaluated separately, the <code>.X</code>
  25681. suffixed keys are used, and <code>X</code> corresponds to the channel number.
  25682. </p>
  25683. <p>The filter accepts the following options:
  25684. </p>
  25685. <dl compact="compact">
  25686. <dt>&lsquo;<samp>noise, n</samp>&rsquo;</dt>
  25687. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  25688. specified value) or amplitude ratio. Default is -60dB, or 0.001.
  25689. </p>
  25690. </dd>
  25691. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  25692. <dd><p>Set silence duration until notification (default is 2 seconds). See
  25693. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  25694. for the accepted syntax.
  25695. </p>
  25696. </dd>
  25697. <dt>&lsquo;<samp>mono, m</samp>&rsquo;</dt>
  25698. <dd><p>Process each channel separately, instead of combined. By default is disabled.
  25699. </p></dd>
  25700. </dl>
  25701. <a name="Examples-156"></a>
  25702. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-156">36.85.1 Examples</a></h3>
  25703. <ul>
  25704. <li>
  25705. Detect 5 seconds of silence with -50dB noise tolerance:
  25706. <div class="example">
  25707. <pre class="example">silencedetect=n=-50dB:d=5
  25708. </pre></div>
  25709. </li><li>
  25710. Complete example with <code>ffmpeg</code> to detect silence with 0.0001 noise
  25711. tolerance in &lsquo;<tt>silence.mp3</tt>&rsquo;:
  25712. <div class="example">
  25713. <pre class="example">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
  25714. </pre></div>
  25715. </li></ul>
  25716. <a name="silenceremove"></a>
  25717. <h2 class="section"><a href="ffmpeg-all.html#toc-silenceremove">36.86 silenceremove</a></h2>
  25718. <p>Remove silence from the beginning, middle or end of the audio.
  25719. </p>
  25720. <p>The filter accepts the following options:
  25721. </p>
  25722. <dl compact="compact">
  25723. <dt>&lsquo;<samp>start_periods</samp>&rsquo;</dt>
  25724. <dd><p>This value is used to indicate if audio should be trimmed at beginning of
  25725. the audio. A value of zero indicates no silence should be trimmed from the
  25726. beginning. When specifying a non-zero value, it trims audio up until it
  25727. finds non-silence. Normally, when trimming silence from beginning of audio
  25728. the <var>start_periods</var> will be <code>1</code> but it can be increased to higher
  25729. values to trim all audio up to specific count of non-silence periods.
  25730. Default value is <code>0</code>.
  25731. </p>
  25732. </dd>
  25733. <dt>&lsquo;<samp>start_duration</samp>&rsquo;</dt>
  25734. <dd><p>Specify the amount of time that non-silence must be detected before it stops
  25735. trimming audio. By increasing the duration, bursts of noises can be treated
  25736. as silence and trimmed off. Default value is <code>0</code>.
  25737. </p>
  25738. </dd>
  25739. <dt>&lsquo;<samp>start_threshold</samp>&rsquo;</dt>
  25740. <dd><p>This indicates what sample value should be treated as silence. For digital
  25741. audio, a value of <code>0</code> may be fine but for audio recorded from analog,
  25742. you may wish to increase the value to account for background noise.
  25743. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  25744. or amplitude ratio. Default value is <code>0</code>.
  25745. </p>
  25746. </dd>
  25747. <dt>&lsquo;<samp>start_silence</samp>&rsquo;</dt>
  25748. <dd><p>Specify max duration of silence at beginning that will be kept after
  25749. trimming. Default is 0, which is equal to trimming all samples detected
  25750. as silence.
  25751. </p>
  25752. </dd>
  25753. <dt>&lsquo;<samp>start_mode</samp>&rsquo;</dt>
  25754. <dd><p>Specify mode of detection of silence end in start of multi-channel audio.
  25755. Can be <var>any</var> or <var>all</var>. Default is <var>any</var>.
  25756. With <var>any</var>, any sample that is detected as non-silence will cause
  25757. stopped trimming of silence.
  25758. With <var>all</var>, only if all channels are detected as non-silence will cause
  25759. stopped trimming of silence.
  25760. </p>
  25761. </dd>
  25762. <dt>&lsquo;<samp>stop_periods</samp>&rsquo;</dt>
  25763. <dd><p>Set the count for trimming silence from the end of audio.
  25764. To remove silence from the middle of a file, specify a <var>stop_periods</var>
  25765. that is negative. This value is then treated as a positive value and is
  25766. used to indicate the effect should restart processing as specified by
  25767. <var>start_periods</var>, making it suitable for removing periods of silence
  25768. in the middle of the audio.
  25769. Default value is <code>0</code>.
  25770. </p>
  25771. </dd>
  25772. <dt>&lsquo;<samp>stop_duration</samp>&rsquo;</dt>
  25773. <dd><p>Specify a duration of silence that must exist before audio is not copied any
  25774. more. By specifying a higher duration, silence that is wanted can be left in
  25775. the audio.
  25776. Default value is <code>0</code>.
  25777. </p>
  25778. </dd>
  25779. <dt>&lsquo;<samp>stop_threshold</samp>&rsquo;</dt>
  25780. <dd><p>This is the same as &lsquo;<samp>start_threshold</samp>&rsquo; but for trimming silence from
  25781. the end of audio.
  25782. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  25783. or amplitude ratio. Default value is <code>0</code>.
  25784. </p>
  25785. </dd>
  25786. <dt>&lsquo;<samp>stop_silence</samp>&rsquo;</dt>
  25787. <dd><p>Specify max duration of silence at end that will be kept after
  25788. trimming. Default is 0, which is equal to trimming all samples detected
  25789. as silence.
  25790. </p>
  25791. </dd>
  25792. <dt>&lsquo;<samp>stop_mode</samp>&rsquo;</dt>
  25793. <dd><p>Specify mode of detection of silence start in end of multi-channel audio.
  25794. Can be <var>any</var> or <var>all</var>. Default is <var>any</var>.
  25795. With <var>any</var>, any sample that is detected as non-silence will cause
  25796. stopped trimming of silence.
  25797. With <var>all</var>, only if all channels are detected as non-silence will cause
  25798. stopped trimming of silence.
  25799. </p>
  25800. </dd>
  25801. <dt>&lsquo;<samp>detection</samp>&rsquo;</dt>
  25802. <dd><p>Set how is silence detected. Can be <code>rms</code> or <code>peak</code>. Second is faster
  25803. and works better with digital silence which is exactly 0.
  25804. Default value is <code>rms</code>.
  25805. </p>
  25806. </dd>
  25807. <dt>&lsquo;<samp>window</samp>&rsquo;</dt>
  25808. <dd><p>Set duration in number of seconds used to calculate size of window in number
  25809. of samples for detecting silence.
  25810. Default value is <code>0.02</code>. Allowed range is from <code>0</code> to <code>10</code>.
  25811. </p></dd>
  25812. </dl>
  25813. <a name="Examples-146"></a>
  25814. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-146">36.86.1 Examples</a></h3>
  25815. <ul>
  25816. <li>
  25817. The following example shows how this filter can be used to start a recording
  25818. that does not contain the delay at the start which usually occurs between
  25819. pressing the record button and the start of the performance:
  25820. <div class="example">
  25821. <pre class="example">silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
  25822. </pre></div>
  25823. </li><li>
  25824. Trim all silence encountered from beginning to end where there is more than 1
  25825. second of silence in audio:
  25826. <div class="example">
  25827. <pre class="example">silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
  25828. </pre></div>
  25829. </li><li>
  25830. Trim all digital silence samples, using peak detection, from beginning to end
  25831. where there is more than 0 samples of digital silence in audio and digital
  25832. silence is detected in all channels at same positions in stream:
  25833. <div class="example">
  25834. <pre class="example">silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0
  25835. </pre></div>
  25836. </li></ul>
  25837. <a name="sofalizer"></a>
  25838. <h2 class="section"><a href="ffmpeg-all.html#toc-sofalizer">36.87 sofalizer</a></h2>
  25839. <p>SOFAlizer uses head-related transfer functions (HRTFs) to create virtual
  25840. loudspeakers around the user for binaural listening via headphones (audio
  25841. formats up to 9 channels supported).
  25842. The HRTFs are stored in SOFA files (see <a href="http://www.sofacoustics.org/">http://www.sofacoustics.org/</a> for a database).
  25843. SOFAlizer is developed at the Acoustics Research Institute (ARI) of the
  25844. Austrian Academy of Sciences.
  25845. </p>
  25846. <p>To enable compilation of this filter you need to configure FFmpeg with
  25847. <code>--enable-libmysofa</code>.
  25848. </p>
  25849. <p>The filter accepts the following options:
  25850. </p>
  25851. <dl compact="compact">
  25852. <dt>&lsquo;<samp>sofa</samp>&rsquo;</dt>
  25853. <dd><p>Set the SOFA file used for rendering.
  25854. </p>
  25855. </dd>
  25856. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  25857. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  25858. </p>
  25859. </dd>
  25860. <dt>&lsquo;<samp>rotation</samp>&rsquo;</dt>
  25861. <dd><p>Set rotation of virtual loudspeakers in deg. Default is 0.
  25862. </p>
  25863. </dd>
  25864. <dt>&lsquo;<samp>elevation</samp>&rsquo;</dt>
  25865. <dd><p>Set elevation of virtual speakers in deg. Default is 0.
  25866. </p>
  25867. </dd>
  25868. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  25869. <dd><p>Set distance in meters between loudspeakers and the listener with near-field
  25870. HRTFs. Default is 1.
  25871. </p>
  25872. </dd>
  25873. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  25874. <dd><p>Set processing type. Can be <var>time</var> or <var>freq</var>. <var>time</var> is
  25875. processing audio in time domain which is slow.
  25876. <var>freq</var> is processing audio in frequency domain which is fast.
  25877. Default is <var>freq</var>.
  25878. </p>
  25879. </dd>
  25880. <dt>&lsquo;<samp>speakers</samp>&rsquo;</dt>
  25881. <dd><p>Set custom positions of virtual loudspeakers. Syntax for this option is:
  25882. &lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;[|&lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;|...].
  25883. Each virtual loudspeaker is described with short channel name following with
  25884. azimuth and elevation in degrees.
  25885. Each virtual loudspeaker description is separated by &rsquo;|&rsquo;.
  25886. For example to override front left and front right channel positions use:
  25887. &rsquo;speakers=FL 45 15|FR 345 15&rsquo;.
  25888. Descriptions with unrecognised channel names are ignored.
  25889. </p>
  25890. </dd>
  25891. <dt>&lsquo;<samp>lfegain</samp>&rsquo;</dt>
  25892. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  25893. </p>
  25894. </dd>
  25895. <dt>&lsquo;<samp>framesize</samp>&rsquo;</dt>
  25896. <dd><p>Set custom frame size in number of samples. Default is 1024.
  25897. Allowed range is from 1024 to 96000. Only used if option &lsquo;<samp>type</samp>&rsquo;
  25898. is set to <var>freq</var>.
  25899. </p>
  25900. </dd>
  25901. <dt>&lsquo;<samp>normalize</samp>&rsquo;</dt>
  25902. <dd><p>Should all IRs be normalized upon importing SOFA file.
  25903. By default is enabled.
  25904. </p>
  25905. </dd>
  25906. <dt>&lsquo;<samp>interpolate</samp>&rsquo;</dt>
  25907. <dd><p>Should nearest IRs be interpolated with neighbor IRs if exact position
  25908. does not match. By default is disabled.
  25909. </p>
  25910. </dd>
  25911. <dt>&lsquo;<samp>minphase</samp>&rsquo;</dt>
  25912. <dd><p>Minphase all IRs upon loading of SOFA file. By default is disabled.
  25913. </p>
  25914. </dd>
  25915. <dt>&lsquo;<samp>anglestep</samp>&rsquo;</dt>
  25916. <dd><p>Set neighbor search angle step. Only used if option <var>interpolate</var> is enabled.
  25917. </p>
  25918. </dd>
  25919. <dt>&lsquo;<samp>radstep</samp>&rsquo;</dt>
  25920. <dd><p>Set neighbor search radius step. Only used if option <var>interpolate</var> is enabled.
  25921. </p></dd>
  25922. </dl>
  25923. <a name="Examples-126"></a>
  25924. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-126">36.87.1 Examples</a></h3>
  25925. <ul>
  25926. <li>
  25927. Using ClubFritz6 sofa file:
  25928. <div class="example">
  25929. <pre class="example">sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
  25930. </pre></div>
  25931. </li><li>
  25932. Using ClubFritz12 sofa file and bigger radius with small rotation:
  25933. <div class="example">
  25934. <pre class="example">sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
  25935. </pre></div>
  25936. </li><li>
  25937. Similar as above but with custom speaker positions for front left, front right, back left and back right
  25938. and also with custom gain:
  25939. <div class="example">
  25940. <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;
  25941. </pre></div>
  25942. </li></ul>
  25943. <a name="stereotools"></a>
  25944. <h2 class="section"><a href="ffmpeg-all.html#toc-stereotools">36.88 stereotools</a></h2>
  25945. <p>This filter has some handy utilities to manage stereo signals, for converting
  25946. M/S stereo recordings to L/R signal while having control over the parameters
  25947. or spreading the stereo image of master track.
  25948. </p>
  25949. <p>The filter accepts the following options:
  25950. </p>
  25951. <dl compact="compact">
  25952. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  25953. <dd><p>Set input level before filtering for both channels. Defaults is 1.
  25954. Allowed range is from 0.015625 to 64.
  25955. </p>
  25956. </dd>
  25957. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  25958. <dd><p>Set output level after filtering for both channels. Defaults is 1.
  25959. Allowed range is from 0.015625 to 64.
  25960. </p>
  25961. </dd>
  25962. <dt>&lsquo;<samp>balance_in</samp>&rsquo;</dt>
  25963. <dd><p>Set input balance between both channels. Default is 0.
  25964. Allowed range is from -1 to 1.
  25965. </p>
  25966. </dd>
  25967. <dt>&lsquo;<samp>balance_out</samp>&rsquo;</dt>
  25968. <dd><p>Set output balance between both channels. Default is 0.
  25969. Allowed range is from -1 to 1.
  25970. </p>
  25971. </dd>
  25972. <dt>&lsquo;<samp>softclip</samp>&rsquo;</dt>
  25973. <dd><p>Enable softclipping. Results in analog distortion instead of harsh digital 0dB
  25974. clipping. Disabled by default.
  25975. </p>
  25976. </dd>
  25977. <dt>&lsquo;<samp>mutel</samp>&rsquo;</dt>
  25978. <dd><p>Mute the left channel. Disabled by default.
  25979. </p>
  25980. </dd>
  25981. <dt>&lsquo;<samp>muter</samp>&rsquo;</dt>
  25982. <dd><p>Mute the right channel. Disabled by default.
  25983. </p>
  25984. </dd>
  25985. <dt>&lsquo;<samp>phasel</samp>&rsquo;</dt>
  25986. <dd><p>Change the phase of the left channel. Disabled by default.
  25987. </p>
  25988. </dd>
  25989. <dt>&lsquo;<samp>phaser</samp>&rsquo;</dt>
  25990. <dd><p>Change the phase of the right channel. Disabled by default.
  25991. </p>
  25992. </dd>
  25993. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  25994. <dd><p>Set stereo mode. Available values are:
  25995. </p>
  25996. <dl compact="compact">
  25997. <dt>&lsquo;<samp>lr&gt;lr</samp>&rsquo;</dt>
  25998. <dd><p>Left/Right to Left/Right, this is default.
  25999. </p>
  26000. </dd>
  26001. <dt>&lsquo;<samp>lr&gt;ms</samp>&rsquo;</dt>
  26002. <dd><p>Left/Right to Mid/Side.
  26003. </p>
  26004. </dd>
  26005. <dt>&lsquo;<samp>ms&gt;lr</samp>&rsquo;</dt>
  26006. <dd><p>Mid/Side to Left/Right.
  26007. </p>
  26008. </dd>
  26009. <dt>&lsquo;<samp>lr&gt;ll</samp>&rsquo;</dt>
  26010. <dd><p>Left/Right to Left/Left.
  26011. </p>
  26012. </dd>
  26013. <dt>&lsquo;<samp>lr&gt;rr</samp>&rsquo;</dt>
  26014. <dd><p>Left/Right to Right/Right.
  26015. </p>
  26016. </dd>
  26017. <dt>&lsquo;<samp>lr&gt;l+r</samp>&rsquo;</dt>
  26018. <dd><p>Left/Right to Left + Right.
  26019. </p>
  26020. </dd>
  26021. <dt>&lsquo;<samp>lr&gt;rl</samp>&rsquo;</dt>
  26022. <dd><p>Left/Right to Right/Left.
  26023. </p>
  26024. </dd>
  26025. <dt>&lsquo;<samp>ms&gt;ll</samp>&rsquo;</dt>
  26026. <dd><p>Mid/Side to Left/Left.
  26027. </p>
  26028. </dd>
  26029. <dt>&lsquo;<samp>ms&gt;rr</samp>&rsquo;</dt>
  26030. <dd><p>Mid/Side to Right/Right.
  26031. </p></dd>
  26032. </dl>
  26033. </dd>
  26034. <dt>&lsquo;<samp>slev</samp>&rsquo;</dt>
  26035. <dd><p>Set level of side signal. Default is 1.
  26036. Allowed range is from 0.015625 to 64.
  26037. </p>
  26038. </dd>
  26039. <dt>&lsquo;<samp>sbal</samp>&rsquo;</dt>
  26040. <dd><p>Set balance of side signal. Default is 0.
  26041. Allowed range is from -1 to 1.
  26042. </p>
  26043. </dd>
  26044. <dt>&lsquo;<samp>mlev</samp>&rsquo;</dt>
  26045. <dd><p>Set level of the middle signal. Default is 1.
  26046. Allowed range is from 0.015625 to 64.
  26047. </p>
  26048. </dd>
  26049. <dt>&lsquo;<samp>mpan</samp>&rsquo;</dt>
  26050. <dd><p>Set middle signal pan. Default is 0. Allowed range is from -1 to 1.
  26051. </p>
  26052. </dd>
  26053. <dt>&lsquo;<samp>base</samp>&rsquo;</dt>
  26054. <dd><p>Set stereo base between mono and inversed channels. Default is 0.
  26055. Allowed range is from -1 to 1.
  26056. </p>
  26057. </dd>
  26058. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  26059. <dd><p>Set delay in milliseconds how much to delay left from right channel and
  26060. vice versa. Default is 0. Allowed range is from -20 to 20.
  26061. </p>
  26062. </dd>
  26063. <dt>&lsquo;<samp>sclevel</samp>&rsquo;</dt>
  26064. <dd><p>Set S/C level. Default is 1. Allowed range is from 1 to 100.
  26065. </p>
  26066. </dd>
  26067. <dt>&lsquo;<samp>phase</samp>&rsquo;</dt>
  26068. <dd><p>Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360.
  26069. </p>
  26070. </dd>
  26071. <dt>&lsquo;<samp>bmode_in, bmode_out</samp>&rsquo;</dt>
  26072. <dd><p>Set balance mode for balance_in/balance_out option.
  26073. </p>
  26074. <p>Can be one of the following:
  26075. </p>
  26076. <dl compact="compact">
  26077. <dt>&lsquo;<samp>balance</samp>&rsquo;</dt>
  26078. <dd><p>Classic balance mode. Attenuate one channel at time.
  26079. Gain is raised up to 1.
  26080. </p>
  26081. </dd>
  26082. <dt>&lsquo;<samp>amplitude</samp>&rsquo;</dt>
  26083. <dd><p>Similar as classic mode above but gain is raised up to 2.
  26084. </p>
  26085. </dd>
  26086. <dt>&lsquo;<samp>power</samp>&rsquo;</dt>
  26087. <dd><p>Equal power distribution, from -6dB to +6dB range.
  26088. </p></dd>
  26089. </dl>
  26090. </dd>
  26091. </dl>
  26092. <a name="Examples-114"></a>
  26093. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-114">36.88.1 Examples</a></h3>
  26094. <ul>
  26095. <li>
  26096. Apply karaoke like effect:
  26097. <div class="example">
  26098. <pre class="example">stereotools=mlev=0.015625
  26099. </pre></div>
  26100. </li><li>
  26101. Convert M/S signal to L/R:
  26102. <div class="example">
  26103. <pre class="example">&quot;stereotools=mode=ms&gt;lr&quot;
  26104. </pre></div>
  26105. </li></ul>
  26106. <a name="stereowiden"></a>
  26107. <h2 class="section"><a href="ffmpeg-all.html#toc-stereowiden">36.89 stereowiden</a></h2>
  26108. <p>This filter enhance the stereo effect by suppressing signal common to both
  26109. channels and by delaying the signal of left into right and vice versa,
  26110. thereby widening the stereo effect.
  26111. </p>
  26112. <p>The filter accepts the following options:
  26113. </p>
  26114. <dl compact="compact">
  26115. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  26116. <dd><p>Time in milliseconds of the delay of left signal into right and vice versa.
  26117. Default is 20 milliseconds.
  26118. </p>
  26119. </dd>
  26120. <dt>&lsquo;<samp>feedback</samp>&rsquo;</dt>
  26121. <dd><p>Amount of gain in delayed signal into right and vice versa. Gives a delay
  26122. effect of left signal in right output and vice versa which gives widening
  26123. effect. Default is 0.3.
  26124. </p>
  26125. </dd>
  26126. <dt>&lsquo;<samp>crossfeed</samp>&rsquo;</dt>
  26127. <dd><p>Cross feed of left into right with inverted phase. This helps in suppressing
  26128. the mono. If the value is 1 it will cancel all the signal common to both
  26129. channels. Default is 0.3.
  26130. </p>
  26131. </dd>
  26132. <dt>&lsquo;<samp>drymix</samp>&rsquo;</dt>
  26133. <dd><p>Set level of input signal of original channel. Default is 0.8.
  26134. </p></dd>
  26135. </dl>
  26136. <a name="Commands-19"></a>
  26137. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-19">36.89.1 Commands</a></h3>
  26138. <p>This filter supports the all above options except <code>delay</code> as <a href="#commands">commands</a>.
  26139. </p>
  26140. <a name="superequalizer"></a>
  26141. <h2 class="section"><a href="ffmpeg-all.html#toc-superequalizer">36.90 superequalizer</a></h2>
  26142. <p>Apply 18 band equalizer.
  26143. </p>
  26144. <p>The filter accepts the following options:
  26145. </p><dl compact="compact">
  26146. <dt>&lsquo;<samp>1b</samp>&rsquo;</dt>
  26147. <dd><p>Set 65Hz band gain.
  26148. </p></dd>
  26149. <dt>&lsquo;<samp>2b</samp>&rsquo;</dt>
  26150. <dd><p>Set 92Hz band gain.
  26151. </p></dd>
  26152. <dt>&lsquo;<samp>3b</samp>&rsquo;</dt>
  26153. <dd><p>Set 131Hz band gain.
  26154. </p></dd>
  26155. <dt>&lsquo;<samp>4b</samp>&rsquo;</dt>
  26156. <dd><p>Set 185Hz band gain.
  26157. </p></dd>
  26158. <dt>&lsquo;<samp>5b</samp>&rsquo;</dt>
  26159. <dd><p>Set 262Hz band gain.
  26160. </p></dd>
  26161. <dt>&lsquo;<samp>6b</samp>&rsquo;</dt>
  26162. <dd><p>Set 370Hz band gain.
  26163. </p></dd>
  26164. <dt>&lsquo;<samp>7b</samp>&rsquo;</dt>
  26165. <dd><p>Set 523Hz band gain.
  26166. </p></dd>
  26167. <dt>&lsquo;<samp>8b</samp>&rsquo;</dt>
  26168. <dd><p>Set 740Hz band gain.
  26169. </p></dd>
  26170. <dt>&lsquo;<samp>9b</samp>&rsquo;</dt>
  26171. <dd><p>Set 1047Hz band gain.
  26172. </p></dd>
  26173. <dt>&lsquo;<samp>10b</samp>&rsquo;</dt>
  26174. <dd><p>Set 1480Hz band gain.
  26175. </p></dd>
  26176. <dt>&lsquo;<samp>11b</samp>&rsquo;</dt>
  26177. <dd><p>Set 2093Hz band gain.
  26178. </p></dd>
  26179. <dt>&lsquo;<samp>12b</samp>&rsquo;</dt>
  26180. <dd><p>Set 2960Hz band gain.
  26181. </p></dd>
  26182. <dt>&lsquo;<samp>13b</samp>&rsquo;</dt>
  26183. <dd><p>Set 4186Hz band gain.
  26184. </p></dd>
  26185. <dt>&lsquo;<samp>14b</samp>&rsquo;</dt>
  26186. <dd><p>Set 5920Hz band gain.
  26187. </p></dd>
  26188. <dt>&lsquo;<samp>15b</samp>&rsquo;</dt>
  26189. <dd><p>Set 8372Hz band gain.
  26190. </p></dd>
  26191. <dt>&lsquo;<samp>16b</samp>&rsquo;</dt>
  26192. <dd><p>Set 11840Hz band gain.
  26193. </p></dd>
  26194. <dt>&lsquo;<samp>17b</samp>&rsquo;</dt>
  26195. <dd><p>Set 16744Hz band gain.
  26196. </p></dd>
  26197. <dt>&lsquo;<samp>18b</samp>&rsquo;</dt>
  26198. <dd><p>Set 20000Hz band gain.
  26199. </p></dd>
  26200. </dl>
  26201. <a name="surround"></a>
  26202. <h2 class="section"><a href="ffmpeg-all.html#toc-surround">36.91 surround</a></h2>
  26203. <p>Apply audio surround upmix filter.
  26204. </p>
  26205. <p>This filter allows to produce multichannel output from audio stream.
  26206. </p>
  26207. <p>The filter accepts the following options:
  26208. </p>
  26209. <dl compact="compact">
  26210. <dt>&lsquo;<samp>chl_out</samp>&rsquo;</dt>
  26211. <dd><p>Set output channel layout. By default, this is <var>5.1</var>.
  26212. </p>
  26213. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  26214. for the required syntax.
  26215. </p>
  26216. </dd>
  26217. <dt>&lsquo;<samp>chl_in</samp>&rsquo;</dt>
  26218. <dd><p>Set input channel layout. By default, this is <var>stereo</var>.
  26219. </p>
  26220. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  26221. for the required syntax.
  26222. </p>
  26223. </dd>
  26224. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  26225. <dd><p>Set input volume level. By default, this is <var>1</var>.
  26226. </p>
  26227. </dd>
  26228. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  26229. <dd><p>Set output volume level. By default, this is <var>1</var>.
  26230. </p>
  26231. </dd>
  26232. <dt>&lsquo;<samp>lfe</samp>&rsquo;</dt>
  26233. <dd><p>Enable LFE channel output if output channel layout has it. By default, this is enabled.
  26234. </p>
  26235. </dd>
  26236. <dt>&lsquo;<samp>lfe_low</samp>&rsquo;</dt>
  26237. <dd><p>Set LFE low cut off frequency. By default, this is <var>128</var> Hz.
  26238. </p>
  26239. </dd>
  26240. <dt>&lsquo;<samp>lfe_high</samp>&rsquo;</dt>
  26241. <dd><p>Set LFE high cut off frequency. By default, this is <var>256</var> Hz.
  26242. </p>
  26243. </dd>
  26244. <dt>&lsquo;<samp>lfe_mode</samp>&rsquo;</dt>
  26245. <dd><p>Set LFE mode, can be <var>add</var> or <var>sub</var>. Default is <var>add</var>.
  26246. In <var>add</var> mode, LFE channel is created from input audio and added to output.
  26247. In <var>sub</var> mode, LFE channel is created from input audio and added to output but
  26248. also all non-LFE output channels are subtracted with output LFE channel.
  26249. </p>
  26250. </dd>
  26251. <dt>&lsquo;<samp>angle</samp>&rsquo;</dt>
  26252. <dd><p>Set angle of stereo surround transform, Allowed range is from <var>0</var> to <var>360</var>.
  26253. Default is <var>90</var>.
  26254. </p>
  26255. </dd>
  26256. <dt>&lsquo;<samp>fc_in</samp>&rsquo;</dt>
  26257. <dd><p>Set front center input volume. By default, this is <var>1</var>.
  26258. </p>
  26259. </dd>
  26260. <dt>&lsquo;<samp>fc_out</samp>&rsquo;</dt>
  26261. <dd><p>Set front center output volume. By default, this is <var>1</var>.
  26262. </p>
  26263. </dd>
  26264. <dt>&lsquo;<samp>fl_in</samp>&rsquo;</dt>
  26265. <dd><p>Set front left input volume. By default, this is <var>1</var>.
  26266. </p>
  26267. </dd>
  26268. <dt>&lsquo;<samp>fl_out</samp>&rsquo;</dt>
  26269. <dd><p>Set front left output volume. By default, this is <var>1</var>.
  26270. </p>
  26271. </dd>
  26272. <dt>&lsquo;<samp>fr_in</samp>&rsquo;</dt>
  26273. <dd><p>Set front right input volume. By default, this is <var>1</var>.
  26274. </p>
  26275. </dd>
  26276. <dt>&lsquo;<samp>fr_out</samp>&rsquo;</dt>
  26277. <dd><p>Set front right output volume. By default, this is <var>1</var>.
  26278. </p>
  26279. </dd>
  26280. <dt>&lsquo;<samp>sl_in</samp>&rsquo;</dt>
  26281. <dd><p>Set side left input volume. By default, this is <var>1</var>.
  26282. </p>
  26283. </dd>
  26284. <dt>&lsquo;<samp>sl_out</samp>&rsquo;</dt>
  26285. <dd><p>Set side left output volume. By default, this is <var>1</var>.
  26286. </p>
  26287. </dd>
  26288. <dt>&lsquo;<samp>sr_in</samp>&rsquo;</dt>
  26289. <dd><p>Set side right input volume. By default, this is <var>1</var>.
  26290. </p>
  26291. </dd>
  26292. <dt>&lsquo;<samp>sr_out</samp>&rsquo;</dt>
  26293. <dd><p>Set side right output volume. By default, this is <var>1</var>.
  26294. </p>
  26295. </dd>
  26296. <dt>&lsquo;<samp>bl_in</samp>&rsquo;</dt>
  26297. <dd><p>Set back left input volume. By default, this is <var>1</var>.
  26298. </p>
  26299. </dd>
  26300. <dt>&lsquo;<samp>bl_out</samp>&rsquo;</dt>
  26301. <dd><p>Set back left output volume. By default, this is <var>1</var>.
  26302. </p>
  26303. </dd>
  26304. <dt>&lsquo;<samp>br_in</samp>&rsquo;</dt>
  26305. <dd><p>Set back right input volume. By default, this is <var>1</var>.
  26306. </p>
  26307. </dd>
  26308. <dt>&lsquo;<samp>br_out</samp>&rsquo;</dt>
  26309. <dd><p>Set back right output volume. By default, this is <var>1</var>.
  26310. </p>
  26311. </dd>
  26312. <dt>&lsquo;<samp>bc_in</samp>&rsquo;</dt>
  26313. <dd><p>Set back center input volume. By default, this is <var>1</var>.
  26314. </p>
  26315. </dd>
  26316. <dt>&lsquo;<samp>bc_out</samp>&rsquo;</dt>
  26317. <dd><p>Set back center output volume. By default, this is <var>1</var>.
  26318. </p>
  26319. </dd>
  26320. <dt>&lsquo;<samp>lfe_in</samp>&rsquo;</dt>
  26321. <dd><p>Set LFE input volume. By default, this is <var>1</var>.
  26322. </p>
  26323. </dd>
  26324. <dt>&lsquo;<samp>lfe_out</samp>&rsquo;</dt>
  26325. <dd><p>Set LFE output volume. By default, this is <var>1</var>.
  26326. </p>
  26327. </dd>
  26328. <dt>&lsquo;<samp>allx</samp>&rsquo;</dt>
  26329. <dd><p>Set spread usage of stereo image across X axis for all channels.
  26330. </p>
  26331. </dd>
  26332. <dt>&lsquo;<samp>ally</samp>&rsquo;</dt>
  26333. <dd><p>Set spread usage of stereo image across Y axis for all channels.
  26334. </p>
  26335. </dd>
  26336. <dt>&lsquo;<samp>fcx, flx, frx, blx, brx, slx, srx, bcx</samp>&rsquo;</dt>
  26337. <dd><p>Set spread usage of stereo image across X axis for each channel.
  26338. </p>
  26339. </dd>
  26340. <dt>&lsquo;<samp>fcy, fly, fry, bly, bry, sly, sry, bcy</samp>&rsquo;</dt>
  26341. <dd><p>Set spread usage of stereo image across Y axis for each channel.
  26342. </p>
  26343. </dd>
  26344. <dt>&lsquo;<samp>win_size</samp>&rsquo;</dt>
  26345. <dd><p>Set window size. Allowed range is from <var>1024</var> to <var>65536</var>. Default size is <var>4096</var>.
  26346. </p>
  26347. </dd>
  26348. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  26349. <dd><p>Set window function.
  26350. </p>
  26351. <p>It accepts the following values:
  26352. </p><dl compact="compact">
  26353. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  26354. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  26355. <dt>&lsquo;<samp>hann, hanning</samp>&rsquo;</dt>
  26356. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  26357. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  26358. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  26359. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  26360. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  26361. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  26362. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  26363. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  26364. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  26365. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  26366. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  26367. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  26368. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  26369. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  26370. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  26371. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  26372. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  26373. </dl>
  26374. <p>Default is <code>hann</code>.
  26375. </p>
  26376. </dd>
  26377. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  26378. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  26379. window function will be picked. Default is <code>0.5</code>.
  26380. </p></dd>
  26381. </dl>
  26382. <a name="treble_002c-highshelf"></a>
  26383. <h2 class="section"><a href="ffmpeg-all.html#toc-treble_002c-highshelf">36.92 treble, highshelf</a></h2>
  26384. <p>Boost or cut treble (upper) frequencies of the audio using a two-pole
  26385. shelving filter with a response similar to that of a standard
  26386. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  26387. </p>
  26388. <p>The filter accepts the following options:
  26389. </p>
  26390. <dl compact="compact">
  26391. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  26392. <dd><p>Give the gain at whichever is the lower of ~22 kHz and the
  26393. Nyquist frequency. Its useful range is about -20 (for a large cut)
  26394. to +20 (for a large boost). Beware of clipping when using a positive gain.
  26395. </p>
  26396. </dd>
  26397. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  26398. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  26399. to extend or reduce the frequency range to be boosted or cut.
  26400. The default value is <code>3000</code> Hz.
  26401. </p>
  26402. </dd>
  26403. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  26404. <dd><p>Set method to specify band-width of filter.
  26405. </p><dl compact="compact">
  26406. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  26407. <dd><p>Hz
  26408. </p></dd>
  26409. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  26410. <dd><p>Q-Factor
  26411. </p></dd>
  26412. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  26413. <dd><p>octave
  26414. </p></dd>
  26415. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  26416. <dd><p>slope
  26417. </p></dd>
  26418. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  26419. <dd><p>kHz
  26420. </p></dd>
  26421. </dl>
  26422. </dd>
  26423. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  26424. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  26425. </p>
  26426. </dd>
  26427. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  26428. <dd><p>How much to use filtered signal in output. Default is 1.
  26429. Range is between 0 and 1.
  26430. </p>
  26431. </dd>
  26432. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  26433. <dd><p>Specify which channels to filter, by default all available are filtered.
  26434. </p>
  26435. </dd>
  26436. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  26437. <dd><p>Normalize biquad coefficients, by default is disabled.
  26438. Enabling it will normalize magnitude response at DC to 0dB.
  26439. </p></dd>
  26440. </dl>
  26441. <a name="Commands-12"></a>
  26442. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-12">36.92.1 Commands</a></h3>
  26443. <p>This filter supports the following commands:
  26444. </p><dl compact="compact">
  26445. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  26446. <dd><p>Change treble frequency.
  26447. Syntax for the command is : &quot;<var>frequency</var>&quot;
  26448. </p>
  26449. </dd>
  26450. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  26451. <dd><p>Change treble width_type.
  26452. Syntax for the command is : &quot;<var>width_type</var>&quot;
  26453. </p>
  26454. </dd>
  26455. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  26456. <dd><p>Change treble width.
  26457. Syntax for the command is : &quot;<var>width</var>&quot;
  26458. </p>
  26459. </dd>
  26460. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  26461. <dd><p>Change treble gain.
  26462. Syntax for the command is : &quot;<var>gain</var>&quot;
  26463. </p>
  26464. </dd>
  26465. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  26466. <dd><p>Change treble mix.
  26467. Syntax for the command is : &quot;<var>mix</var>&quot;
  26468. </p></dd>
  26469. </dl>
  26470. <a name="tremolo"></a>
  26471. <h2 class="section"><a href="ffmpeg-all.html#toc-tremolo">36.93 tremolo</a></h2>
  26472. <p>Sinusoidal amplitude modulation.
  26473. </p>
  26474. <p>The filter accepts the following options:
  26475. </p>
  26476. <dl compact="compact">
  26477. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  26478. <dd><p>Modulation frequency in Hertz. Modulation frequencies in the subharmonic range
  26479. (20 Hz or lower) will result in a tremolo effect.
  26480. This filter may also be used as a ring modulator by specifying
  26481. a modulation frequency higher than 20 Hz.
  26482. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  26483. </p>
  26484. </dd>
  26485. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  26486. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  26487. Default value is 0.5.
  26488. </p></dd>
  26489. </dl>
  26490. <a name="vibrato"></a>
  26491. <h2 class="section"><a href="ffmpeg-all.html#toc-vibrato">36.94 vibrato</a></h2>
  26492. <p>Sinusoidal phase modulation.
  26493. </p>
  26494. <p>The filter accepts the following options:
  26495. </p>
  26496. <dl compact="compact">
  26497. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  26498. <dd><p>Modulation frequency in Hertz.
  26499. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  26500. </p>
  26501. </dd>
  26502. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  26503. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  26504. Default value is 0.5.
  26505. </p></dd>
  26506. </dl>
  26507. <a name="volume"></a>
  26508. <h2 class="section"><a href="ffmpeg-all.html#toc-volume">36.95 volume</a></h2>
  26509. <p>Adjust the input audio volume.
  26510. </p>
  26511. <p>It accepts the following parameters:
  26512. </p><dl compact="compact">
  26513. <dt>&lsquo;<samp>volume</samp>&rsquo;</dt>
  26514. <dd><p>Set audio volume expression.
  26515. </p>
  26516. <p>Output values are clipped to the maximum value.
  26517. </p>
  26518. <p>The output audio volume is given by the relation:
  26519. </p><div class="example">
  26520. <pre class="example"><var>output_volume</var> = <var>volume</var> * <var>input_volume</var>
  26521. </pre></div>
  26522. <p>The default value for <var>volume</var> is &quot;1.0&quot;.
  26523. </p>
  26524. </dd>
  26525. <dt>&lsquo;<samp>precision</samp>&rsquo;</dt>
  26526. <dd><p>This parameter represents the mathematical precision.
  26527. </p>
  26528. <p>It determines which input sample formats will be allowed, which affects the
  26529. precision of the volume scaling.
  26530. </p>
  26531. <dl compact="compact">
  26532. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  26533. <dd><p>8-bit fixed-point; this limits input sample format to U8, S16, and S32.
  26534. </p></dd>
  26535. <dt>&lsquo;<samp>float</samp>&rsquo;</dt>
  26536. <dd><p>32-bit floating-point; this limits input sample format to FLT. (default)
  26537. </p></dd>
  26538. <dt>&lsquo;<samp>double</samp>&rsquo;</dt>
  26539. <dd><p>64-bit floating-point; this limits input sample format to DBL.
  26540. </p></dd>
  26541. </dl>
  26542. </dd>
  26543. <dt>&lsquo;<samp>replaygain</samp>&rsquo;</dt>
  26544. <dd><p>Choose the behaviour on encountering ReplayGain side data in input frames.
  26545. </p>
  26546. <dl compact="compact">
  26547. <dt>&lsquo;<samp>drop</samp>&rsquo;</dt>
  26548. <dd><p>Remove ReplayGain side data, ignoring its contents (the default).
  26549. </p>
  26550. </dd>
  26551. <dt>&lsquo;<samp>ignore</samp>&rsquo;</dt>
  26552. <dd><p>Ignore ReplayGain side data, but leave it in the frame.
  26553. </p>
  26554. </dd>
  26555. <dt>&lsquo;<samp>track</samp>&rsquo;</dt>
  26556. <dd><p>Prefer the track gain, if present.
  26557. </p>
  26558. </dd>
  26559. <dt>&lsquo;<samp>album</samp>&rsquo;</dt>
  26560. <dd><p>Prefer the album gain, if present.
  26561. </p></dd>
  26562. </dl>
  26563. </dd>
  26564. <dt>&lsquo;<samp>replaygain_preamp</samp>&rsquo;</dt>
  26565. <dd><p>Pre-amplification gain in dB to apply to the selected replaygain gain.
  26566. </p>
  26567. <p>Default value for <var>replaygain_preamp</var> is 0.0.
  26568. </p>
  26569. </dd>
  26570. <dt>&lsquo;<samp>replaygain_noclip</samp>&rsquo;</dt>
  26571. <dd><p>Prevent clipping by limiting the gain applied.
  26572. </p>
  26573. <p>Default value for <var>replaygain_noclip</var> is 1.
  26574. </p>
  26575. </dd>
  26576. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  26577. <dd><p>Set when the volume expression is evaluated.
  26578. </p>
  26579. <p>It accepts the following values:
  26580. </p><dl compact="compact">
  26581. <dt>&lsquo;<samp>once</samp>&rsquo;</dt>
  26582. <dd><p>only evaluate expression once during the filter initialization, or
  26583. when the &lsquo;<samp>volume</samp>&rsquo; command is sent
  26584. </p>
  26585. </dd>
  26586. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  26587. <dd><p>evaluate expression for each incoming frame
  26588. </p></dd>
  26589. </dl>
  26590. <p>Default value is &lsquo;<samp>once</samp>&rsquo;.
  26591. </p></dd>
  26592. </dl>
  26593. <p>The volume expression can contain the following parameters.
  26594. </p>
  26595. <dl compact="compact">
  26596. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  26597. <dd><p>frame number (starting at zero)
  26598. </p></dd>
  26599. <dt>&lsquo;<samp>nb_channels</samp>&rsquo;</dt>
  26600. <dd><p>number of channels
  26601. </p></dd>
  26602. <dt>&lsquo;<samp>nb_consumed_samples</samp>&rsquo;</dt>
  26603. <dd><p>number of samples consumed by the filter
  26604. </p></dd>
  26605. <dt>&lsquo;<samp>nb_samples</samp>&rsquo;</dt>
  26606. <dd><p>number of samples in the current frame
  26607. </p></dd>
  26608. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  26609. <dd><p>original frame position in the file
  26610. </p></dd>
  26611. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  26612. <dd><p>frame PTS
  26613. </p></dd>
  26614. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  26615. <dd><p>sample rate
  26616. </p></dd>
  26617. <dt>&lsquo;<samp>startpts</samp>&rsquo;</dt>
  26618. <dd><p>PTS at start of stream
  26619. </p></dd>
  26620. <dt>&lsquo;<samp>startt</samp>&rsquo;</dt>
  26621. <dd><p>time at start of stream
  26622. </p></dd>
  26623. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  26624. <dd><p>frame time
  26625. </p></dd>
  26626. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  26627. <dd><p>timestamp timebase
  26628. </p></dd>
  26629. <dt>&lsquo;<samp>volume</samp>&rsquo;</dt>
  26630. <dd><p>last set volume value
  26631. </p></dd>
  26632. </dl>
  26633. <p>Note that when &lsquo;<samp>eval</samp>&rsquo; is set to &lsquo;<samp>once</samp>&rsquo; only the
  26634. <var>sample_rate</var> and <var>tb</var> variables are available, all other
  26635. variables will evaluate to NAN.
  26636. </p>
  26637. <a name="Commands-10"></a>
  26638. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-10">36.95.1 Commands</a></h3>
  26639. <p>This filter supports the following commands:
  26640. </p><dl compact="compact">
  26641. <dt>&lsquo;<samp>volume</samp>&rsquo;</dt>
  26642. <dd><p>Modify the volume expression.
  26643. The command accepts the same syntax of the corresponding option.
  26644. </p>
  26645. <p>If the specified expression is not valid, it is kept at its current
  26646. value.
  26647. </p></dd>
  26648. </dl>
  26649. <a name="Examples-70"></a>
  26650. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-70">36.95.2 Examples</a></h3>
  26651. <ul>
  26652. <li>
  26653. Halve the input audio volume:
  26654. <div class="example">
  26655. <pre class="example">volume=volume=0.5
  26656. volume=volume=1/2
  26657. volume=volume=-6.0206dB
  26658. </pre></div>
  26659. <p>In all the above example the named key for &lsquo;<samp>volume</samp>&rsquo; can be
  26660. omitted, for example like in:
  26661. </p><div class="example">
  26662. <pre class="example">volume=0.5
  26663. </pre></div>
  26664. </li><li>
  26665. Increase input audio power by 6 decibels using fixed-point precision:
  26666. <div class="example">
  26667. <pre class="example">volume=volume=6dB:precision=fixed
  26668. </pre></div>
  26669. </li><li>
  26670. Fade volume after time 10 with an annihilation period of 5 seconds:
  26671. <div class="example">
  26672. <pre class="example">volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
  26673. </pre></div>
  26674. </li></ul>
  26675. <a name="volumedetect"></a>
  26676. <h2 class="section"><a href="ffmpeg-all.html#toc-volumedetect">36.96 volumedetect</a></h2>
  26677. <p>Detect the volume of the input video.
  26678. </p>
  26679. <p>The filter has no parameters. The input is not modified. Statistics about
  26680. the volume will be printed in the log when the input stream end is reached.
  26681. </p>
  26682. <p>In particular it will show the mean volume (root mean square), maximum
  26683. volume (on a per-sample basis), and the beginning of a histogram of the
  26684. registered volume values (from the maximum value to a cumulated 1/1000 of
  26685. the samples).
  26686. </p>
  26687. <p>All volumes are in decibels relative to the maximum PCM value.
  26688. </p>
  26689. <a name="Examples-99"></a>
  26690. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-99">36.96.1 Examples</a></h3>
  26691. <p>Here is an excerpt of the output:
  26692. </p><div class="example">
  26693. <pre class="example">[Parsed_volumedetect_0 &nbsp;0xa23120] mean_volume: -27 dB
  26694. [Parsed_volumedetect_0 &nbsp;0xa23120] max_volume: -4 dB
  26695. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_4db: 6
  26696. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_5db: 62
  26697. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_6db: 286
  26698. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_7db: 1042
  26699. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_8db: 2551
  26700. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_9db: 4609
  26701. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_10db: 8409
  26702. </pre></div>
  26703. <p>It means that:
  26704. </p><ul>
  26705. <li>
  26706. The mean square energy is approximately -27 dB, or 10^-2.7.
  26707. </li><li>
  26708. The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
  26709. </li><li>
  26710. There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
  26711. </li></ul>
  26712. <p>In other words, raising the volume by +4 dB does not cause any clipping,
  26713. raising it by +5 dB causes clipping for 6 samples, etc.
  26714. </p>
  26715. <a name="Audio-Sources"></a>
  26716. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Audio-Sources">37 Audio Sources</a></h1>
  26717. <p>Below is a description of the currently available audio sources.
  26718. </p>
  26719. <a name="abuffer"></a>
  26720. <h2 class="section"><a href="ffmpeg-all.html#toc-abuffer">37.1 abuffer</a></h2>
  26721. <p>Buffer audio frames, and make them available to the filter chain.
  26722. </p>
  26723. <p>This source is mainly intended for a programmatic use, in particular
  26724. through the interface defined in &lsquo;<tt>libavfilter/asrc_abuffer.h</tt>&rsquo;.
  26725. </p>
  26726. <p>It accepts the following parameters:
  26727. </p><dl compact="compact">
  26728. <dt>&lsquo;<samp>time_base</samp>&rsquo;</dt>
  26729. <dd><p>The timebase which will be used for timestamps of submitted frames. It must be
  26730. either a floating-point number or in <var>numerator</var>/<var>denominator</var> form.
  26731. </p>
  26732. </dd>
  26733. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  26734. <dd><p>The sample rate of the incoming audio buffers.
  26735. </p>
  26736. </dd>
  26737. <dt>&lsquo;<samp>sample_fmt</samp>&rsquo;</dt>
  26738. <dd><p>The sample format of the incoming audio buffers.
  26739. Either a sample format name or its corresponding integer representation from
  26740. the enum AVSampleFormat in &lsquo;<tt>libavutil/samplefmt.h</tt>&rsquo;
  26741. </p>
  26742. </dd>
  26743. <dt>&lsquo;<samp>channel_layout</samp>&rsquo;</dt>
  26744. <dd><p>The channel layout of the incoming audio buffers.
  26745. Either a channel layout name from channel_layout_map in
  26746. &lsquo;<tt>libavutil/channel_layout.c</tt>&rsquo; or its corresponding integer representation
  26747. from the AV_CH_LAYOUT_* macros in &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;
  26748. </p>
  26749. </dd>
  26750. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  26751. <dd><p>The number of channels of the incoming audio buffers.
  26752. If both <var>channels</var> and <var>channel_layout</var> are specified, then they
  26753. must be consistent.
  26754. </p>
  26755. </dd>
  26756. </dl>
  26757. <a name="Examples-113"></a>
  26758. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-113">37.1.1 Examples</a></h3>
  26759. <div class="example">
  26760. <pre class="example">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
  26761. </pre></div>
  26762. <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
  26763. Since the sample format with name &quot;s16p&quot; corresponds to the number
  26764. 6 and the &quot;stereo&quot; channel layout corresponds to the value 0x3, this is
  26765. equivalent to:
  26766. </p><div class="example">
  26767. <pre class="example">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
  26768. </pre></div>
  26769. <a name="aevalsrc"></a>
  26770. <h2 class="section"><a href="ffmpeg-all.html#toc-aevalsrc">37.2 aevalsrc</a></h2>
  26771. <p>Generate an audio signal specified by an expression.
  26772. </p>
  26773. <p>This source accepts in input one or more expressions (one for each
  26774. channel), which are evaluated and used to generate a corresponding
  26775. audio signal.
  26776. </p>
  26777. <p>This source accepts the following options:
  26778. </p>
  26779. <dl compact="compact">
  26780. <dt>&lsquo;<samp>exprs</samp>&rsquo;</dt>
  26781. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. In case the
  26782. &lsquo;<samp>channel_layout</samp>&rsquo; option is not specified, the selected channel layout
  26783. depends on the number of provided expressions. Otherwise the last
  26784. specified expression is applied to the remaining output channels.
  26785. </p>
  26786. </dd>
  26787. <dt>&lsquo;<samp>channel_layout, c</samp>&rsquo;</dt>
  26788. <dd><p>Set the channel layout. The number of channels in the specified layout
  26789. must be equal to the number of specified expressions.
  26790. </p>
  26791. </dd>
  26792. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  26793. <dd><p>Set the minimum duration of the sourced audio. See
  26794. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  26795. for the accepted syntax.
  26796. Note that the resulting duration may be greater than the specified
  26797. duration, as the generated audio is always cut at the end of a
  26798. complete frame.
  26799. </p>
  26800. <p>If not specified, or the expressed duration is negative, the audio is
  26801. supposed to be generated forever.
  26802. </p>
  26803. </dd>
  26804. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  26805. <dd><p>Set the number of samples per channel per each output frame,
  26806. default to 1024.
  26807. </p>
  26808. </dd>
  26809. <dt>&lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
  26810. <dd><p>Specify the sample rate, default to 44100.
  26811. </p></dd>
  26812. </dl>
  26813. <p>Each expression in <var>exprs</var> can contain the following constants:
  26814. </p>
  26815. <dl compact="compact">
  26816. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  26817. <dd><p>number of the evaluated sample, starting from 0
  26818. </p>
  26819. </dd>
  26820. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  26821. <dd><p>time of the evaluated sample expressed in seconds, starting from 0
  26822. </p>
  26823. </dd>
  26824. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  26825. <dd><p>sample rate
  26826. </p>
  26827. </dd>
  26828. </dl>
  26829. <a name="Examples-77"></a>
  26830. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-77">37.2.1 Examples</a></h3>
  26831. <ul>
  26832. <li>
  26833. Generate silence:
  26834. <div class="example">
  26835. <pre class="example">aevalsrc=0
  26836. </pre></div>
  26837. </li><li>
  26838. Generate a sin signal with frequency of 440 Hz, set sample rate to
  26839. 8000 Hz:
  26840. <div class="example">
  26841. <pre class="example">aevalsrc=&quot;sin(440*2*PI*t):s=8000&quot;
  26842. </pre></div>
  26843. </li><li>
  26844. Generate a two channels signal, specify the channel layout (Front
  26845. Center + Back Center) explicitly:
  26846. <div class="example">
  26847. <pre class="example">aevalsrc=&quot;sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC&quot;
  26848. </pre></div>
  26849. </li><li>
  26850. Generate white noise:
  26851. <div class="example">
  26852. <pre class="example">aevalsrc=&quot;-2+random(0)&quot;
  26853. </pre></div>
  26854. </li><li>
  26855. Generate an amplitude modulated signal:
  26856. <div class="example">
  26857. <pre class="example">aevalsrc=&quot;sin(10*2*PI*t)*sin(880*2*PI*t)&quot;
  26858. </pre></div>
  26859. </li><li>
  26860. Generate 2.5 Hz binaural beats on a 360 Hz carrier:
  26861. <div class="example">
  26862. <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;
  26863. </pre></div>
  26864. </li></ul>
  26865. <a name="afirsrc"></a>
  26866. <h2 class="section"><a href="ffmpeg-all.html#toc-afirsrc">37.3 afirsrc</a></h2>
  26867. <p>Generate a FIR coefficients using frequency sampling method.
  26868. </p>
  26869. <p>The resulting stream can be used with <a href="#afir">afir</a> filter for filtering the audio signal.
  26870. </p>
  26871. <p>The filter accepts the following options:
  26872. </p>
  26873. <dl compact="compact">
  26874. <dt>&lsquo;<samp>taps, t</samp>&rsquo;</dt>
  26875. <dd><p>Set number of filter coefficents in output audio stream.
  26876. Default value is 1025.
  26877. </p>
  26878. </dd>
  26879. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  26880. <dd><p>Set frequency points from where magnitude and phase are set.
  26881. This must be in non decreasing order, and first element must be 0, while last element
  26882. must be 1. Elements are separated by white spaces.
  26883. </p>
  26884. </dd>
  26885. <dt>&lsquo;<samp>magnitude, m</samp>&rsquo;</dt>
  26886. <dd><p>Set magnitude value for every frequency point set by &lsquo;<samp>frequency</samp>&rsquo;.
  26887. Number of values must be same as number of frequency points.
  26888. Values are separated by white spaces.
  26889. </p>
  26890. </dd>
  26891. <dt>&lsquo;<samp>phase, p</samp>&rsquo;</dt>
  26892. <dd><p>Set phase value for every frequency point set by &lsquo;<samp>frequency</samp>&rsquo;.
  26893. Number of values must be same as number of frequency points.
  26894. Values are separated by white spaces.
  26895. </p>
  26896. </dd>
  26897. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  26898. <dd><p>Set sample rate, default is 44100.
  26899. </p>
  26900. </dd>
  26901. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  26902. <dd><p>Set number of samples per each frame. Default is 1024.
  26903. </p>
  26904. </dd>
  26905. <dt>&lsquo;<samp>win_func, w</samp>&rsquo;</dt>
  26906. <dd><p>Set window function. Default is blackman.
  26907. </p></dd>
  26908. </dl>
  26909. <a name="anullsrc"></a>
  26910. <h2 class="section"><a href="ffmpeg-all.html#toc-anullsrc">37.4 anullsrc</a></h2>
  26911. <p>The null audio source, return unprocessed audio frames. It is mainly useful
  26912. as a template and to be employed in analysis / debugging tools, or as
  26913. the source for filters which ignore the input data (for example the sox
  26914. synth filter).
  26915. </p>
  26916. <p>This source accepts the following options:
  26917. </p>
  26918. <dl compact="compact">
  26919. <dt>&lsquo;<samp>channel_layout, cl</samp>&rsquo;</dt>
  26920. <dd>
  26921. <p>Specifies the channel layout, and can be either an integer or a string
  26922. representing a channel layout. The default value of <var>channel_layout</var>
  26923. is &quot;stereo&quot;.
  26924. </p>
  26925. <p>Check the channel_layout_map definition in
  26926. &lsquo;<tt>libavutil/channel_layout.c</tt>&rsquo; for the mapping between strings and
  26927. channel layout values.
  26928. </p>
  26929. </dd>
  26930. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  26931. <dd><p>Specifies the sample rate, and defaults to 44100.
  26932. </p>
  26933. </dd>
  26934. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  26935. <dd><p>Set the number of samples per requested frames.
  26936. </p>
  26937. </dd>
  26938. </dl>
  26939. <a name="Examples-90"></a>
  26940. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-90">37.4.1 Examples</a></h3>
  26941. <ul>
  26942. <li>
  26943. Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
  26944. <div class="example">
  26945. <pre class="example">anullsrc=r=48000:cl=4
  26946. </pre></div>
  26947. </li><li>
  26948. Do the same operation with a more obvious syntax:
  26949. <div class="example">
  26950. <pre class="example">anullsrc=r=48000:cl=mono
  26951. </pre></div>
  26952. </li></ul>
  26953. <p>All the parameters need to be explicitly defined.
  26954. </p>
  26955. <a name="flite"></a>
  26956. <h2 class="section"><a href="ffmpeg-all.html#toc-flite">37.5 flite</a></h2>
  26957. <p>Synthesize a voice utterance using the libflite library.
  26958. </p>
  26959. <p>To enable compilation of this filter you need to configure FFmpeg with
  26960. <code>--enable-libflite</code>.
  26961. </p>
  26962. <p>Note that versions of the flite library prior to 2.0 are not thread-safe.
  26963. </p>
  26964. <p>The filter accepts the following options:
  26965. </p>
  26966. <dl compact="compact">
  26967. <dt>&lsquo;<samp>list_voices</samp>&rsquo;</dt>
  26968. <dd><p>If set to 1, list the names of the available voices and exit
  26969. immediately. Default value is 0.
  26970. </p>
  26971. </dd>
  26972. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  26973. <dd><p>Set the maximum number of samples per frame. Default value is 512.
  26974. </p>
  26975. </dd>
  26976. <dt>&lsquo;<samp>textfile</samp>&rsquo;</dt>
  26977. <dd><p>Set the filename containing the text to speak.
  26978. </p>
  26979. </dd>
  26980. <dt>&lsquo;<samp>text</samp>&rsquo;</dt>
  26981. <dd><p>Set the text to speak.
  26982. </p>
  26983. </dd>
  26984. <dt>&lsquo;<samp>voice, v</samp>&rsquo;</dt>
  26985. <dd><p>Set the voice to use for the speech synthesis. Default value is
  26986. <code>kal</code>. See also the <var>list_voices</var> option.
  26987. </p></dd>
  26988. </dl>
  26989. <a name="Examples-187"></a>
  26990. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-187">37.5.1 Examples</a></h3>
  26991. <ul>
  26992. <li>
  26993. Read from file &lsquo;<tt>speech.txt</tt>&rsquo;, and synthesize the text using the
  26994. standard flite voice:
  26995. <div class="example">
  26996. <pre class="example">flite=textfile=speech.txt
  26997. </pre></div>
  26998. </li><li>
  26999. Read the specified text selecting the <code>slt</code> voice:
  27000. <div class="example">
  27001. <pre class="example">flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
  27002. </pre></div>
  27003. </li><li>
  27004. Input text to ffmpeg:
  27005. <div class="example">
  27006. <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
  27007. </pre></div>
  27008. </li><li>
  27009. Make &lsquo;<tt>ffplay</tt>&rsquo; speak the specified text, using <code>flite</code> and
  27010. the <code>lavfi</code> device:
  27011. <div class="example">
  27012. <pre class="example">ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
  27013. </pre></div>
  27014. </li></ul>
  27015. <p>For more information about libflite, check:
  27016. <a href="http://www.festvox.org/flite/">http://www.festvox.org/flite/</a>
  27017. </p>
  27018. <a name="anoisesrc"></a>
  27019. <h2 class="section"><a href="ffmpeg-all.html#toc-anoisesrc">37.6 anoisesrc</a></h2>
  27020. <p>Generate a noise audio signal.
  27021. </p>
  27022. <p>The filter accepts the following options:
  27023. </p>
  27024. <dl compact="compact">
  27025. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  27026. <dd><p>Specify the sample rate. Default value is 48000 Hz.
  27027. </p>
  27028. </dd>
  27029. <dt>&lsquo;<samp>amplitude, a</samp>&rsquo;</dt>
  27030. <dd><p>Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value
  27031. is 1.0.
  27032. </p>
  27033. </dd>
  27034. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  27035. <dd><p>Specify the duration of the generated audio stream. Not specifying this option
  27036. results in noise with an infinite length.
  27037. </p>
  27038. </dd>
  27039. <dt>&lsquo;<samp>color, colour, c</samp>&rsquo;</dt>
  27040. <dd><p>Specify the color of noise. Available noise colors are white, pink, brown,
  27041. blue, violet and velvet. Default color is white.
  27042. </p>
  27043. </dd>
  27044. <dt>&lsquo;<samp>seed, s</samp>&rsquo;</dt>
  27045. <dd><p>Specify a value used to seed the PRNG.
  27046. </p>
  27047. </dd>
  27048. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  27049. <dd><p>Set the number of samples per each output frame, default is 1024.
  27050. </p></dd>
  27051. </dl>
  27052. <a name="Examples-73"></a>
  27053. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-73">37.6.1 Examples</a></h3>
  27054. <ul>
  27055. <li>
  27056. Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5:
  27057. <div class="example">
  27058. <pre class="example">anoisesrc=d=60:c=pink:r=44100:a=0.5
  27059. </pre></div>
  27060. </li></ul>
  27061. <a name="hilbert"></a>
  27062. <h2 class="section"><a href="ffmpeg-all.html#toc-hilbert">37.7 hilbert</a></h2>
  27063. <p>Generate odd-tap Hilbert transform FIR coefficients.
  27064. </p>
  27065. <p>The resulting stream can be used with <a href="#afir">afir</a> filter for phase-shifting
  27066. the signal by 90 degrees.
  27067. </p>
  27068. <p>This is used in many matrix coding schemes and for analytic signal generation.
  27069. The process is often written as a multiplication by i (or j), the imaginary unit.
  27070. </p>
  27071. <p>The filter accepts the following options:
  27072. </p>
  27073. <dl compact="compact">
  27074. <dt>&lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
  27075. <dd><p>Set sample rate, default is 44100.
  27076. </p>
  27077. </dd>
  27078. <dt>&lsquo;<samp>taps, t</samp>&rsquo;</dt>
  27079. <dd><p>Set length of FIR filter, default is 22051.
  27080. </p>
  27081. </dd>
  27082. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  27083. <dd><p>Set number of samples per each frame.
  27084. </p>
  27085. </dd>
  27086. <dt>&lsquo;<samp>win_func, w</samp>&rsquo;</dt>
  27087. <dd><p>Set window function to be used when generating FIR coefficients.
  27088. </p></dd>
  27089. </dl>
  27090. <a name="sinc"></a>
  27091. <h2 class="section"><a href="ffmpeg-all.html#toc-sinc">37.8 sinc</a></h2>
  27092. <p>Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients.
  27093. </p>
  27094. <p>The resulting stream can be used with <a href="#afir">afir</a> filter for filtering the audio signal.
  27095. </p>
  27096. <p>The filter accepts the following options:
  27097. </p>
  27098. <dl compact="compact">
  27099. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  27100. <dd><p>Set sample rate, default is 44100.
  27101. </p>
  27102. </dd>
  27103. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  27104. <dd><p>Set number of samples per each frame. Default is 1024.
  27105. </p>
  27106. </dd>
  27107. <dt>&lsquo;<samp>hp</samp>&rsquo;</dt>
  27108. <dd><p>Set high-pass frequency. Default is 0.
  27109. </p>
  27110. </dd>
  27111. <dt>&lsquo;<samp>lp</samp>&rsquo;</dt>
  27112. <dd><p>Set low-pass frequency. Default is 0.
  27113. If high-pass frequency is lower than low-pass frequency and low-pass frequency
  27114. is higher than 0 then filter will create band-pass filter coefficients,
  27115. otherwise band-reject filter coefficients.
  27116. </p>
  27117. </dd>
  27118. <dt>&lsquo;<samp>phase</samp>&rsquo;</dt>
  27119. <dd><p>Set filter phase response. Default is 50. Allowed range is from 0 to 100.
  27120. </p>
  27121. </dd>
  27122. <dt>&lsquo;<samp>beta</samp>&rsquo;</dt>
  27123. <dd><p>Set Kaiser window beta.
  27124. </p>
  27125. </dd>
  27126. <dt>&lsquo;<samp>att</samp>&rsquo;</dt>
  27127. <dd><p>Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 dB.
  27128. </p>
  27129. </dd>
  27130. <dt>&lsquo;<samp>round</samp>&rsquo;</dt>
  27131. <dd><p>Enable rounding, by default is disabled.
  27132. </p>
  27133. </dd>
  27134. <dt>&lsquo;<samp>hptaps</samp>&rsquo;</dt>
  27135. <dd><p>Set number of taps for high-pass filter.
  27136. </p>
  27137. </dd>
  27138. <dt>&lsquo;<samp>lptaps</samp>&rsquo;</dt>
  27139. <dd><p>Set number of taps for low-pass filter.
  27140. </p></dd>
  27141. </dl>
  27142. <a name="sine"></a>
  27143. <h2 class="section"><a href="ffmpeg-all.html#toc-sine">37.9 sine</a></h2>
  27144. <p>Generate an audio signal made of a sine wave with amplitude 1/8.
  27145. </p>
  27146. <p>The audio signal is bit-exact.
  27147. </p>
  27148. <p>The filter accepts the following options:
  27149. </p>
  27150. <dl compact="compact">
  27151. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  27152. <dd><p>Set the carrier frequency. Default is 440 Hz.
  27153. </p>
  27154. </dd>
  27155. <dt>&lsquo;<samp>beep_factor, b</samp>&rsquo;</dt>
  27156. <dd><p>Enable a periodic beep every second with frequency <var>beep_factor</var> times
  27157. the carrier frequency. Default is 0, meaning the beep is disabled.
  27158. </p>
  27159. </dd>
  27160. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  27161. <dd><p>Specify the sample rate, default is 44100.
  27162. </p>
  27163. </dd>
  27164. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  27165. <dd><p>Specify the duration of the generated audio stream.
  27166. </p>
  27167. </dd>
  27168. <dt>&lsquo;<samp>samples_per_frame</samp>&rsquo;</dt>
  27169. <dd><p>Set the number of samples per output frame.
  27170. </p>
  27171. <p>The expression can contain the following constants:
  27172. </p>
  27173. <dl compact="compact">
  27174. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  27175. <dd><p>The (sequential) number of the output audio frame, starting from 0.
  27176. </p>
  27177. </dd>
  27178. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  27179. <dd><p>The PTS (Presentation TimeStamp) of the output audio frame,
  27180. expressed in <var>TB</var> units.
  27181. </p>
  27182. </dd>
  27183. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  27184. <dd><p>The PTS of the output audio frame, expressed in seconds.
  27185. </p>
  27186. </dd>
  27187. <dt>&lsquo;<samp>TB</samp>&rsquo;</dt>
  27188. <dd><p>The timebase of the output audio frames.
  27189. </p></dd>
  27190. </dl>
  27191. <p>Default is <code>1024</code>.
  27192. </p></dd>
  27193. </dl>
  27194. <a name="Examples-65"></a>
  27195. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-65">37.9.1 Examples</a></h3>
  27196. <ul>
  27197. <li>
  27198. Generate a simple 440 Hz sine wave:
  27199. <div class="example">
  27200. <pre class="example">sine
  27201. </pre></div>
  27202. </li><li>
  27203. Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
  27204. <div class="example">
  27205. <pre class="example">sine=220:4:d=5
  27206. sine=f=220:b=4:d=5
  27207. sine=frequency=220:beep_factor=4:duration=5
  27208. </pre></div>
  27209. </li><li>
  27210. Generate a 1 kHz sine wave following <code>1602,1601,1602,1601,1602</code> NTSC
  27211. pattern:
  27212. <div class="example">
  27213. <pre class="example">sine=1000:samples_per_frame='st(0,mod(n,5)); 1602-not(not(eq(ld(0),1)+eq(ld(0),3)))'
  27214. </pre></div>
  27215. </li></ul>
  27216. <a name="Audio-Sinks"></a>
  27217. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Audio-Sinks">38 Audio Sinks</a></h1>
  27218. <p>Below is a description of the currently available audio sinks.
  27219. </p>
  27220. <a name="abuffersink"></a>
  27221. <h2 class="section"><a href="ffmpeg-all.html#toc-abuffersink">38.1 abuffersink</a></h2>
  27222. <p>Buffer audio frames, and make them available to the end of filter chain.
  27223. </p>
  27224. <p>This sink is mainly intended for programmatic use, in particular
  27225. through the interface defined in &lsquo;<tt>libavfilter/buffersink.h</tt>&rsquo;
  27226. or the options system.
  27227. </p>
  27228. <p>It accepts a pointer to an AVABufferSinkContext structure, which
  27229. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  27230. parameter to <code>avfilter_init_filter</code> for initialization.
  27231. </p><a name="anullsink"></a>
  27232. <h2 class="section"><a href="ffmpeg-all.html#toc-anullsink">38.2 anullsink</a></h2>
  27233. <p>Null audio sink; do absolutely nothing with the input audio. It is
  27234. mainly useful as a template and for use in analysis / debugging
  27235. tools.
  27236. </p>
  27237. <a name="Video-Filters"></a>
  27238. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Video-Filters">39 Video Filters</a></h1>
  27239. <p>When you configure your FFmpeg build, you can disable any of the
  27240. existing filters using <code>--disable-filters</code>.
  27241. The configure output will show the video filters included in your
  27242. build.
  27243. </p>
  27244. <p>Below is a description of the currently available video filters.
  27245. </p>
  27246. <a name="addroi"></a>
  27247. <h2 class="section"><a href="ffmpeg-all.html#toc-addroi">39.1 addroi</a></h2>
  27248. <p>Mark a region of interest in a video frame.
  27249. </p>
  27250. <p>The frame data is passed through unchanged, but metadata is attached
  27251. to the frame indicating regions of interest which can affect the
  27252. behaviour of later encoding. Multiple regions can be marked by
  27253. applying the filter multiple times.
  27254. </p>
  27255. <dl compact="compact">
  27256. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  27257. <dd><p>Region distance in pixels from the left edge of the frame.
  27258. </p></dd>
  27259. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  27260. <dd><p>Region distance in pixels from the top edge of the frame.
  27261. </p></dd>
  27262. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  27263. <dd><p>Region width in pixels.
  27264. </p></dd>
  27265. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  27266. <dd><p>Region height in pixels.
  27267. </p>
  27268. <p>The parameters <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> are expressions,
  27269. and may contain the following variables:
  27270. </p><dl compact="compact">
  27271. <dt>&lsquo;<samp>iw</samp>&rsquo;</dt>
  27272. <dd><p>Width of the input frame.
  27273. </p></dd>
  27274. <dt>&lsquo;<samp>ih</samp>&rsquo;</dt>
  27275. <dd><p>Height of the input frame.
  27276. </p></dd>
  27277. </dl>
  27278. </dd>
  27279. <dt>&lsquo;<samp>qoffset</samp>&rsquo;</dt>
  27280. <dd><p>Quantisation offset to apply within the region.
  27281. </p>
  27282. <p>This must be a real value in the range -1 to +1. A value of zero
  27283. indicates no quality change. A negative value asks for better quality
  27284. (less quantisation), while a positive value asks for worse quality
  27285. (greater quantisation).
  27286. </p>
  27287. <p>The range is calibrated so that the extreme values indicate the
  27288. largest possible offset - if the rest of the frame is encoded with the
  27289. worst possible quality, an offset of -1 indicates that this region
  27290. should be encoded with the best possible quality anyway. Intermediate
  27291. values are then interpolated in some codec-dependent way.
  27292. </p>
  27293. <p>For example, in 10-bit H.264 the quantisation parameter varies between
  27294. -12 and 51. A typical qoffset value of -1/10 therefore indicates that
  27295. this region should be encoded with a QP around one-tenth of the full
  27296. range better than the rest of the frame. So, if most of the frame
  27297. were to be encoded with a QP of around 30, this region would get a QP
  27298. of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3).
  27299. An extreme value of -1 would indicate that this region should be
  27300. encoded with the best possible quality regardless of the treatment of
  27301. the rest of the frame - that is, should be encoded at a QP of -12.
  27302. </p></dd>
  27303. <dt>&lsquo;<samp>clear</samp>&rsquo;</dt>
  27304. <dd><p>If set to true, remove any existing regions of interest marked on the
  27305. frame before adding the new one.
  27306. </p></dd>
  27307. </dl>
  27308. <a name="Examples-142"></a>
  27309. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-142">39.1.1 Examples</a></h3>
  27310. <ul>
  27311. <li>
  27312. Mark the centre quarter of the frame as interesting.
  27313. <div class="example">
  27314. <pre class="example">addroi=iw/4:ih/4:iw/2:ih/2:-1/10
  27315. </pre></div>
  27316. </li><li>
  27317. Mark the 100-pixel-wide region on the left edge of the frame as very
  27318. uninteresting (to be encoded at much lower quality than the rest of
  27319. the frame).
  27320. <div class="example">
  27321. <pre class="example">addroi=0:0:100:ih:+1/5
  27322. </pre></div>
  27323. </li></ul>
  27324. <a name="alphaextract"></a>
  27325. <h2 class="section"><a href="ffmpeg-all.html#toc-alphaextract">39.2 alphaextract</a></h2>
  27326. <p>Extract the alpha component from the input as a grayscale video. This
  27327. is especially useful with the <var>alphamerge</var> filter.
  27328. </p>
  27329. <a name="alphamerge"></a>
  27330. <h2 class="section"><a href="ffmpeg-all.html#toc-alphamerge">39.3 alphamerge</a></h2>
  27331. <p>Add or replace the alpha component of the primary input with the
  27332. grayscale value of a second input. This is intended for use with
  27333. <var>alphaextract</var> to allow the transmission or storage of frame
  27334. sequences that have alpha in a format that doesn&rsquo;t support an alpha
  27335. channel.
  27336. </p>
  27337. <p>For example, to reconstruct full frames from a normal YUV-encoded video
  27338. and a separate video created with <var>alphaextract</var>, you might use:
  27339. </p><div class="example">
  27340. <pre class="example">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
  27341. </pre></div>
  27342. <p>Since this filter is designed for reconstruction, it operates on frame
  27343. sequences without considering timestamps, and terminates when either
  27344. input reaches end of stream. This will cause problems if your encoding
  27345. pipeline drops frames. If you&rsquo;re trying to apply an image as an
  27346. overlay to a video stream, consider the <var>overlay</var> filter instead.
  27347. </p>
  27348. <a name="amplify"></a>
  27349. <h2 class="section"><a href="ffmpeg-all.html#toc-amplify">39.4 amplify</a></h2>
  27350. <p>Amplify differences between current pixel and pixels of adjacent frames in
  27351. same pixel location.
  27352. </p>
  27353. <p>This filter accepts the following options:
  27354. </p>
  27355. <dl compact="compact">
  27356. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  27357. <dd><p>Set frame radius. Default is 2. Allowed range is from 1 to 63.
  27358. For example radius of 3 will instruct filter to calculate average of 7 frames.
  27359. </p>
  27360. </dd>
  27361. <dt>&lsquo;<samp>factor</samp>&rsquo;</dt>
  27362. <dd><p>Set factor to amplify difference. Default is 2. Allowed range is from 0 to 65535.
  27363. </p>
  27364. </dd>
  27365. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  27366. <dd><p>Set threshold for difference amplification. Any difference greater or equal to
  27367. this value will not alter source pixel. Default is 10.
  27368. Allowed range is from 0 to 65535.
  27369. </p>
  27370. </dd>
  27371. <dt>&lsquo;<samp>tolerance</samp>&rsquo;</dt>
  27372. <dd><p>Set tolerance for difference amplification. Any difference lower to
  27373. this value will not alter source pixel. Default is 0.
  27374. Allowed range is from 0 to 65535.
  27375. </p>
  27376. </dd>
  27377. <dt>&lsquo;<samp>low</samp>&rsquo;</dt>
  27378. <dd><p>Set lower limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  27379. This option controls maximum possible value that will decrease source pixel value.
  27380. </p>
  27381. </dd>
  27382. <dt>&lsquo;<samp>high</samp>&rsquo;</dt>
  27383. <dd><p>Set high limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  27384. This option controls maximum possible value that will increase source pixel value.
  27385. </p>
  27386. </dd>
  27387. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  27388. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  27389. </p></dd>
  27390. </dl>
  27391. <a name="Commands-9"></a>
  27392. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-9">39.4.1 Commands</a></h3>
  27393. <p>This filter supports the following <a href="#commands">commands</a> that corresponds to option of same name:
  27394. </p><dl compact="compact">
  27395. <dt>&lsquo;<samp>factor</samp>&rsquo;</dt>
  27396. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  27397. <dt>&lsquo;<samp>tolerance</samp>&rsquo;</dt>
  27398. <dt>&lsquo;<samp>low</samp>&rsquo;</dt>
  27399. <dt>&lsquo;<samp>high</samp>&rsquo;</dt>
  27400. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  27401. </dl>
  27402. <a name="ass"></a>
  27403. <h2 class="section"><a href="ffmpeg-all.html#toc-ass">39.5 ass</a></h2>
  27404. <p>Same as the <a href="#subtitles">subtitles</a> filter, except that it doesn&rsquo;t require libavcodec
  27405. and libavformat to work. On the other hand, it is limited to ASS (Advanced
  27406. Substation Alpha) subtitles files.
  27407. </p>
  27408. <p>This filter accepts the following option in addition to the common options from
  27409. the <a href="#subtitles">subtitles</a> filter:
  27410. </p>
  27411. <dl compact="compact">
  27412. <dt>&lsquo;<samp>shaping</samp>&rsquo;</dt>
  27413. <dd><p>Set the shaping engine
  27414. </p>
  27415. <p>Available values are:
  27416. </p><dl compact="compact">
  27417. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  27418. <dd><p>The default libass shaping engine, which is the best available.
  27419. </p></dd>
  27420. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  27421. <dd><p>Fast, font-agnostic shaper that can do only substitutions
  27422. </p></dd>
  27423. <dt>&lsquo;<samp>complex</samp>&rsquo;</dt>
  27424. <dd><p>Slower shaper using OpenType for substitutions and positioning
  27425. </p></dd>
  27426. </dl>
  27427. <p>The default is <code>auto</code>.
  27428. </p></dd>
  27429. </dl>
  27430. <a name="atadenoise"></a>
  27431. <h2 class="section"><a href="ffmpeg-all.html#toc-atadenoise">39.6 atadenoise</a></h2>
  27432. <p>Apply an Adaptive Temporal Averaging Denoiser to the video input.
  27433. </p>
  27434. <p>The filter accepts the following options:
  27435. </p>
  27436. <dl compact="compact">
  27437. <dt>&lsquo;<samp>0a</samp>&rsquo;</dt>
  27438. <dd><p>Set threshold A for 1st plane. Default is 0.02.
  27439. Valid range is 0 to 0.3.
  27440. </p>
  27441. </dd>
  27442. <dt>&lsquo;<samp>0b</samp>&rsquo;</dt>
  27443. <dd><p>Set threshold B for 1st plane. Default is 0.04.
  27444. Valid range is 0 to 5.
  27445. </p>
  27446. </dd>
  27447. <dt>&lsquo;<samp>1a</samp>&rsquo;</dt>
  27448. <dd><p>Set threshold A for 2nd plane. Default is 0.02.
  27449. Valid range is 0 to 0.3.
  27450. </p>
  27451. </dd>
  27452. <dt>&lsquo;<samp>1b</samp>&rsquo;</dt>
  27453. <dd><p>Set threshold B for 2nd plane. Default is 0.04.
  27454. Valid range is 0 to 5.
  27455. </p>
  27456. </dd>
  27457. <dt>&lsquo;<samp>2a</samp>&rsquo;</dt>
  27458. <dd><p>Set threshold A for 3rd plane. Default is 0.02.
  27459. Valid range is 0 to 0.3.
  27460. </p>
  27461. </dd>
  27462. <dt>&lsquo;<samp>2b</samp>&rsquo;</dt>
  27463. <dd><p>Set threshold B for 3rd plane. Default is 0.04.
  27464. Valid range is 0 to 5.
  27465. </p>
  27466. <p>Threshold A is designed to react on abrupt changes in the input signal and
  27467. threshold B is designed to react on continuous changes in the input signal.
  27468. </p>
  27469. </dd>
  27470. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  27471. <dd><p>Set number of frames filter will use for averaging. Default is 9. Must be odd
  27472. number in range [5, 129].
  27473. </p>
  27474. </dd>
  27475. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  27476. <dd><p>Set what planes of frame filter will use for averaging. Default is all.
  27477. </p>
  27478. </dd>
  27479. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  27480. <dd><p>Set what variant of algorithm filter will use for averaging. Default is <code>p</code> parallel.
  27481. Alternatively can be set to <code>s</code> serial.
  27482. </p>
  27483. <p>Parallel can be faster then serial, while other way around is never true.
  27484. Parallel will abort early on first change being greater then thresholds, while serial
  27485. will continue processing other side of frames if they are equal or bellow thresholds.
  27486. </p></dd>
  27487. </dl>
  27488. <a name="Commands-38"></a>
  27489. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-38">39.6.1 Commands</a></h3>
  27490. <p>This filter supports same <a href="#commands">commands</a> as options except option <code>s</code>.
  27491. The command accepts the same syntax of the corresponding option.
  27492. </p>
  27493. <a name="avgblur"></a>
  27494. <h2 class="section"><a href="ffmpeg-all.html#toc-avgblur">39.7 avgblur</a></h2>
  27495. <p>Apply average blur filter.
  27496. </p>
  27497. <p>The filter accepts the following options:
  27498. </p>
  27499. <dl compact="compact">
  27500. <dt>&lsquo;<samp>sizeX</samp>&rsquo;</dt>
  27501. <dd><p>Set horizontal radius size.
  27502. </p>
  27503. </dd>
  27504. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  27505. <dd><p>Set which planes to filter. By default all planes are filtered.
  27506. </p>
  27507. </dd>
  27508. <dt>&lsquo;<samp>sizeY</samp>&rsquo;</dt>
  27509. <dd><p>Set vertical radius size, if zero it will be same as <code>sizeX</code>.
  27510. Default is <code>0</code>.
  27511. </p></dd>
  27512. </dl>
  27513. <a name="Commands-50"></a>
  27514. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-50">39.7.1 Commands</a></h3>
  27515. <p>This filter supports same commands as options.
  27516. The command accepts the same syntax of the corresponding option.
  27517. </p>
  27518. <p>If the specified expression is not valid, it is kept at its current
  27519. value.
  27520. </p>
  27521. <a name="bbox"></a>
  27522. <h2 class="section"><a href="ffmpeg-all.html#toc-bbox">39.8 bbox</a></h2>
  27523. <p>Compute the bounding box for the non-black pixels in the input frame
  27524. luminance plane.
  27525. </p>
  27526. <p>This filter computes the bounding box containing all the pixels with a
  27527. luminance value greater than the minimum allowed value.
  27528. The parameters describing the bounding box are printed on the filter
  27529. log.
  27530. </p>
  27531. <p>The filter accepts the following option:
  27532. </p>
  27533. <dl compact="compact">
  27534. <dt>&lsquo;<samp>min_val</samp>&rsquo;</dt>
  27535. <dd><p>Set the minimal luminance value. Default is <code>16</code>.
  27536. </p></dd>
  27537. </dl>
  27538. <a name="bilateral"></a>
  27539. <h2 class="section"><a href="ffmpeg-all.html#toc-bilateral">39.9 bilateral</a></h2>
  27540. <p>Apply bilateral filter, spatial smoothing while preserving edges.
  27541. </p>
  27542. <p>The filter accepts the following options:
  27543. </p><dl compact="compact">
  27544. <dt>&lsquo;<samp>sigmaS</samp>&rsquo;</dt>
  27545. <dd><p>Set sigma of gaussian function to calculate spatial weight.
  27546. Allowed range is 0 to 10. Default is 0.1.
  27547. </p>
  27548. </dd>
  27549. <dt>&lsquo;<samp>sigmaR</samp>&rsquo;</dt>
  27550. <dd><p>Set sigma of gaussian function to calculate range weight.
  27551. Allowed range is 0 to 1. Default is 0.1.
  27552. </p>
  27553. </dd>
  27554. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  27555. <dd><p>Set planes to filter. Default is first only.
  27556. </p></dd>
  27557. </dl>
  27558. <a name="bitplanenoise"></a>
  27559. <h2 class="section"><a href="ffmpeg-all.html#toc-bitplanenoise">39.10 bitplanenoise</a></h2>
  27560. <p>Show and measure bit plane noise.
  27561. </p>
  27562. <p>The filter accepts the following options:
  27563. </p>
  27564. <dl compact="compact">
  27565. <dt>&lsquo;<samp>bitplane</samp>&rsquo;</dt>
  27566. <dd><p>Set which plane to analyze. Default is <code>1</code>.
  27567. </p>
  27568. </dd>
  27569. <dt>&lsquo;<samp>filter</samp>&rsquo;</dt>
  27570. <dd><p>Filter out noisy pixels from <code>bitplane</code> set above.
  27571. Default is disabled.
  27572. </p></dd>
  27573. </dl>
  27574. <a name="blackdetect"></a>
  27575. <h2 class="section"><a href="ffmpeg-all.html#toc-blackdetect">39.11 blackdetect</a></h2>
  27576. <p>Detect video intervals that are (almost) completely black. Can be
  27577. useful to detect chapter transitions, commercials, or invalid
  27578. recordings.
  27579. </p>
  27580. <p>The filter outputs its detection analysis to both the log as well as
  27581. frame metadata. If a black segment of at least the specified minimum
  27582. duration is found, a line with the start and end timestamps as well
  27583. as duration is printed to the log with level <code>info</code>. In addition,
  27584. a log line with level <code>debug</code> is printed per frame showing the
  27585. black amount detected for that frame.
  27586. </p>
  27587. <p>The filter also attaches metadata to the first frame of a black
  27588. segment with key <code>lavfi.black_start</code> and to the first frame
  27589. after the black segment ends with key <code>lavfi.black_end</code>. The
  27590. value is the frame&rsquo;s timestamp. This metadata is added regardless
  27591. of the minimum duration specified.
  27592. </p>
  27593. <p>The filter accepts the following options:
  27594. </p>
  27595. <dl compact="compact">
  27596. <dt>&lsquo;<samp>black_min_duration, d</samp>&rsquo;</dt>
  27597. <dd><p>Set the minimum detected black duration expressed in seconds. It must
  27598. be a non-negative floating point number.
  27599. </p>
  27600. <p>Default value is 2.0.
  27601. </p>
  27602. </dd>
  27603. <dt>&lsquo;<samp>picture_black_ratio_th, pic_th</samp>&rsquo;</dt>
  27604. <dd><p>Set the threshold for considering a picture &quot;black&quot;.
  27605. Express the minimum value for the ratio:
  27606. </p><div class="example">
  27607. <pre class="example"><var>nb_black_pixels</var> / <var>nb_pixels</var>
  27608. </pre></div>
  27609. <p>for which a picture is considered black.
  27610. Default value is 0.98.
  27611. </p>
  27612. </dd>
  27613. <dt>&lsquo;<samp>pixel_black_th, pix_th</samp>&rsquo;</dt>
  27614. <dd><p>Set the threshold for considering a pixel &quot;black&quot;.
  27615. </p>
  27616. <p>The threshold expresses the maximum pixel luminance value for which a
  27617. pixel is considered &quot;black&quot;. The provided value is scaled according to
  27618. the following equation:
  27619. </p><div class="example">
  27620. <pre class="example"><var>absolute_threshold</var> = <var>luminance_minimum_value</var> + <var>pixel_black_th</var> * <var>luminance_range_size</var>
  27621. </pre></div>
  27622. <p><var>luminance_range_size</var> and <var>luminance_minimum_value</var> depend on
  27623. the input video format, the range is [0-255] for YUV full-range
  27624. formats and [16-235] for YUV non full-range formats.
  27625. </p>
  27626. <p>Default value is 0.10.
  27627. </p></dd>
  27628. </dl>
  27629. <p>The following example sets the maximum pixel threshold to the minimum
  27630. value, and detects only black intervals of 2 or more seconds:
  27631. </p><div class="example">
  27632. <pre class="example">blackdetect=d=2:pix_th=0.00
  27633. </pre></div>
  27634. <a name="blackframe"></a>
  27635. <h2 class="section"><a href="ffmpeg-all.html#toc-blackframe">39.12 blackframe</a></h2>
  27636. <p>Detect frames that are (almost) completely black. Can be useful to
  27637. detect chapter transitions or commercials. Output lines consist of
  27638. the frame number of the detected frame, the percentage of blackness,
  27639. the position in the file if known or -1 and the timestamp in seconds.
  27640. </p>
  27641. <p>In order to display the output lines, you need to set the loglevel at
  27642. least to the AV_LOG_INFO value.
  27643. </p>
  27644. <p>This filter exports frame metadata <code>lavfi.blackframe.pblack</code>.
  27645. The value represents the percentage of pixels in the picture that
  27646. are below the threshold value.
  27647. </p>
  27648. <p>It accepts the following parameters:
  27649. </p>
  27650. <dl compact="compact">
  27651. <dt>&lsquo;<samp>amount</samp>&rsquo;</dt>
  27652. <dd><p>The percentage of the pixels that have to be below the threshold; it defaults to
  27653. <code>98</code>.
  27654. </p>
  27655. </dd>
  27656. <dt>&lsquo;<samp>threshold, thresh</samp>&rsquo;</dt>
  27657. <dd><p>The threshold below which a pixel value is considered black; it defaults to
  27658. <code>32</code>.
  27659. </p>
  27660. </dd>
  27661. </dl>
  27662. <p><a name="blend"></a>
  27663. </p><a name="blend-1"></a>
  27664. <h2 class="section"><a href="ffmpeg-all.html#toc-blend-1">39.13 blend</a></h2>
  27665. <p>Blend two video frames into each other.
  27666. </p>
  27667. <p>The <code>blend</code> filter takes two input streams and outputs one
  27668. stream, the first input is the &quot;top&quot; layer and second input is
  27669. &quot;bottom&quot; layer. By default, the output terminates when the longest input terminates.
  27670. </p>
  27671. <p>The <code>tblend</code> (time blend) filter takes two consecutive frames
  27672. from one single stream, and outputs the result obtained by blending
  27673. the new frame on top of the old frame.
  27674. </p>
  27675. <p>A description of the accepted options follows.
  27676. </p>
  27677. <dl compact="compact">
  27678. <dt>&lsquo;<samp>c0_mode</samp>&rsquo;</dt>
  27679. <dt>&lsquo;<samp>c1_mode</samp>&rsquo;</dt>
  27680. <dt>&lsquo;<samp>c2_mode</samp>&rsquo;</dt>
  27681. <dt>&lsquo;<samp>c3_mode</samp>&rsquo;</dt>
  27682. <dt>&lsquo;<samp>all_mode</samp>&rsquo;</dt>
  27683. <dd><p>Set blend mode for specific pixel component or all pixel components in case
  27684. of <var>all_mode</var>. Default value is <code>normal</code>.
  27685. </p>
  27686. <p>Available values for component modes are:
  27687. </p><dl compact="compact">
  27688. <dt>&lsquo;<samp>addition</samp>&rsquo;</dt>
  27689. <dt>&lsquo;<samp>grainmerge</samp>&rsquo;</dt>
  27690. <dt>&lsquo;<samp>and</samp>&rsquo;</dt>
  27691. <dt>&lsquo;<samp>average</samp>&rsquo;</dt>
  27692. <dt>&lsquo;<samp>burn</samp>&rsquo;</dt>
  27693. <dt>&lsquo;<samp>darken</samp>&rsquo;</dt>
  27694. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  27695. <dt>&lsquo;<samp>grainextract</samp>&rsquo;</dt>
  27696. <dt>&lsquo;<samp>divide</samp>&rsquo;</dt>
  27697. <dt>&lsquo;<samp>dodge</samp>&rsquo;</dt>
  27698. <dt>&lsquo;<samp>freeze</samp>&rsquo;</dt>
  27699. <dt>&lsquo;<samp>exclusion</samp>&rsquo;</dt>
  27700. <dt>&lsquo;<samp>extremity</samp>&rsquo;</dt>
  27701. <dt>&lsquo;<samp>glow</samp>&rsquo;</dt>
  27702. <dt>&lsquo;<samp>hardlight</samp>&rsquo;</dt>
  27703. <dt>&lsquo;<samp>hardmix</samp>&rsquo;</dt>
  27704. <dt>&lsquo;<samp>heat</samp>&rsquo;</dt>
  27705. <dt>&lsquo;<samp>lighten</samp>&rsquo;</dt>
  27706. <dt>&lsquo;<samp>linearlight</samp>&rsquo;</dt>
  27707. <dt>&lsquo;<samp>multiply</samp>&rsquo;</dt>
  27708. <dt>&lsquo;<samp>multiply128</samp>&rsquo;</dt>
  27709. <dt>&lsquo;<samp>negation</samp>&rsquo;</dt>
  27710. <dt>&lsquo;<samp>normal</samp>&rsquo;</dt>
  27711. <dt>&lsquo;<samp>or</samp>&rsquo;</dt>
  27712. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  27713. <dt>&lsquo;<samp>phoenix</samp>&rsquo;</dt>
  27714. <dt>&lsquo;<samp>pinlight</samp>&rsquo;</dt>
  27715. <dt>&lsquo;<samp>reflect</samp>&rsquo;</dt>
  27716. <dt>&lsquo;<samp>screen</samp>&rsquo;</dt>
  27717. <dt>&lsquo;<samp>softlight</samp>&rsquo;</dt>
  27718. <dt>&lsquo;<samp>subtract</samp>&rsquo;</dt>
  27719. <dt>&lsquo;<samp>vividlight</samp>&rsquo;</dt>
  27720. <dt>&lsquo;<samp>xor</samp>&rsquo;</dt>
  27721. </dl>
  27722. </dd>
  27723. <dt>&lsquo;<samp>c0_opacity</samp>&rsquo;</dt>
  27724. <dt>&lsquo;<samp>c1_opacity</samp>&rsquo;</dt>
  27725. <dt>&lsquo;<samp>c2_opacity</samp>&rsquo;</dt>
  27726. <dt>&lsquo;<samp>c3_opacity</samp>&rsquo;</dt>
  27727. <dt>&lsquo;<samp>all_opacity</samp>&rsquo;</dt>
  27728. <dd><p>Set blend opacity for specific pixel component or all pixel components in case
  27729. of <var>all_opacity</var>. Only used in combination with pixel component blend modes.
  27730. </p>
  27731. </dd>
  27732. <dt>&lsquo;<samp>c0_expr</samp>&rsquo;</dt>
  27733. <dt>&lsquo;<samp>c1_expr</samp>&rsquo;</dt>
  27734. <dt>&lsquo;<samp>c2_expr</samp>&rsquo;</dt>
  27735. <dt>&lsquo;<samp>c3_expr</samp>&rsquo;</dt>
  27736. <dt>&lsquo;<samp>all_expr</samp>&rsquo;</dt>
  27737. <dd><p>Set blend expression for specific pixel component or all pixel components in case
  27738. of <var>all_expr</var>. Note that related mode options will be ignored if those are set.
  27739. </p>
  27740. <p>The expressions can use the following variables:
  27741. </p>
  27742. <dl compact="compact">
  27743. <dt>&lsquo;<samp>N</samp>&rsquo;</dt>
  27744. <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
  27745. </p>
  27746. </dd>
  27747. <dt>&lsquo;<samp>X</samp>&rsquo;</dt>
  27748. <dt>&lsquo;<samp>Y</samp>&rsquo;</dt>
  27749. <dd><p>the coordinates of the current sample
  27750. </p>
  27751. </dd>
  27752. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  27753. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  27754. <dd><p>the width and height of currently filtered plane
  27755. </p>
  27756. </dd>
  27757. <dt>&lsquo;<samp>SW</samp>&rsquo;</dt>
  27758. <dt>&lsquo;<samp>SH</samp>&rsquo;</dt>
  27759. <dd><p>Width and height scale for the plane being filtered. It is the
  27760. ratio between the dimensions of the current plane to the luma plane,
  27761. e.g. for a <code>yuv420p</code> frame, the values are <code>1,1</code> for
  27762. the luma plane and <code>0.5,0.5</code> for the chroma planes.
  27763. </p>
  27764. </dd>
  27765. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  27766. <dd><p>Time of the current frame, expressed in seconds.
  27767. </p>
  27768. </dd>
  27769. <dt>&lsquo;<samp>TOP, A</samp>&rsquo;</dt>
  27770. <dd><p>Value of pixel component at current location for first video frame (top layer).
  27771. </p>
  27772. </dd>
  27773. <dt>&lsquo;<samp>BOTTOM, B</samp>&rsquo;</dt>
  27774. <dd><p>Value of pixel component at current location for second video frame (bottom layer).
  27775. </p></dd>
  27776. </dl>
  27777. </dd>
  27778. </dl>
  27779. <p>The <code>blend</code> filter also supports the <a href="#framesync">framesync</a> options.
  27780. </p>
  27781. <a name="Examples-2"></a>
  27782. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-2">39.13.1 Examples</a></h3>
  27783. <ul>
  27784. <li>
  27785. Apply transition from bottom layer to top layer in first 10 seconds:
  27786. <div class="example">
  27787. <pre class="example">blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
  27788. </pre></div>
  27789. </li><li>
  27790. Apply linear horizontal transition from top layer to bottom layer:
  27791. <div class="example">
  27792. <pre class="example">blend=all_expr='A*(X/W)+B*(1-X/W)'
  27793. </pre></div>
  27794. </li><li>
  27795. Apply 1x1 checkerboard effect:
  27796. <div class="example">
  27797. <pre class="example">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
  27798. </pre></div>
  27799. </li><li>
  27800. Apply uncover left effect:
  27801. <div class="example">
  27802. <pre class="example">blend=all_expr='if(gte(N*SW+X,W),A,B)'
  27803. </pre></div>
  27804. </li><li>
  27805. Apply uncover down effect:
  27806. <div class="example">
  27807. <pre class="example">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
  27808. </pre></div>
  27809. </li><li>
  27810. Apply uncover up-left effect:
  27811. <div class="example">
  27812. <pre class="example">blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
  27813. </pre></div>
  27814. </li><li>
  27815. Split diagonally video and shows top and bottom layer on each side:
  27816. <div class="example">
  27817. <pre class="example">blend=all_expr='if(gt(X,Y*(W/H)),A,B)'
  27818. </pre></div>
  27819. </li><li>
  27820. Display differences between the current and the previous frame:
  27821. <div class="example">
  27822. <pre class="example">tblend=all_mode=grainextract
  27823. </pre></div>
  27824. </li></ul>
  27825. <a name="bm3d"></a>
  27826. <h2 class="section"><a href="ffmpeg-all.html#toc-bm3d">39.14 bm3d</a></h2>
  27827. <p>Denoise frames using Block-Matching 3D algorithm.
  27828. </p>
  27829. <p>The filter accepts the following options.
  27830. </p>
  27831. <dl compact="compact">
  27832. <dt>&lsquo;<samp>sigma</samp>&rsquo;</dt>
  27833. <dd><p>Set denoising strength. Default value is 1.
  27834. Allowed range is from 0 to 999.9.
  27835. The denoising algorithm is very sensitive to sigma, so adjust it
  27836. according to the source.
  27837. </p>
  27838. </dd>
  27839. <dt>&lsquo;<samp>block</samp>&rsquo;</dt>
  27840. <dd><p>Set local patch size. This sets dimensions in 2D.
  27841. </p>
  27842. </dd>
  27843. <dt>&lsquo;<samp>bstep</samp>&rsquo;</dt>
  27844. <dd><p>Set sliding step for processing blocks. Default value is 4.
  27845. Allowed range is from 1 to 64.
  27846. Smaller values allows processing more reference blocks and is slower.
  27847. </p>
  27848. </dd>
  27849. <dt>&lsquo;<samp>group</samp>&rsquo;</dt>
  27850. <dd><p>Set maximal number of similar blocks for 3rd dimension. Default value is 1.
  27851. When set to 1, no block matching is done. Larger values allows more blocks
  27852. in single group.
  27853. Allowed range is from 1 to 256.
  27854. </p>
  27855. </dd>
  27856. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  27857. <dd><p>Set radius for search block matching. Default is 9.
  27858. Allowed range is from 1 to INT32_MAX.
  27859. </p>
  27860. </dd>
  27861. <dt>&lsquo;<samp>mstep</samp>&rsquo;</dt>
  27862. <dd><p>Set step between two search locations for block matching. Default is 1.
  27863. Allowed range is from 1 to 64. Smaller is slower.
  27864. </p>
  27865. </dd>
  27866. <dt>&lsquo;<samp>thmse</samp>&rsquo;</dt>
  27867. <dd><p>Set threshold of mean square error for block matching. Valid range is 0 to
  27868. INT32_MAX.
  27869. </p>
  27870. </dd>
  27871. <dt>&lsquo;<samp>hdthr</samp>&rsquo;</dt>
  27872. <dd><p>Set thresholding parameter for hard thresholding in 3D transformed domain.
  27873. Larger values results in stronger hard-thresholding filtering in frequency
  27874. domain.
  27875. </p>
  27876. </dd>
  27877. <dt>&lsquo;<samp>estim</samp>&rsquo;</dt>
  27878. <dd><p>Set filtering estimation mode. Can be <code>basic</code> or <code>final</code>.
  27879. Default is <code>basic</code>.
  27880. </p>
  27881. </dd>
  27882. <dt>&lsquo;<samp>ref</samp>&rsquo;</dt>
  27883. <dd><p>If enabled, filter will use 2nd stream for block matching.
  27884. Default is disabled for <code>basic</code> value of <var>estim</var> option,
  27885. and always enabled if value of <var>estim</var> is <code>final</code>.
  27886. </p>
  27887. </dd>
  27888. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  27889. <dd><p>Set planes to filter. Default is all available except alpha.
  27890. </p></dd>
  27891. </dl>
  27892. <a name="Examples-135"></a>
  27893. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-135">39.14.1 Examples</a></h3>
  27894. <ul>
  27895. <li>
  27896. Basic filtering with bm3d:
  27897. <div class="example">
  27898. <pre class="example">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic
  27899. </pre></div>
  27900. </li><li>
  27901. Same as above, but filtering only luma:
  27902. <div class="example">
  27903. <pre class="example">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1
  27904. </pre></div>
  27905. </li><li>
  27906. Same as above, but with both estimation modes:
  27907. <div class="example">
  27908. <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
  27909. </pre></div>
  27910. </li><li>
  27911. Same as above, but prefilter with <a href="#nlmeans">nlmeans</a> filter instead:
  27912. <div class="example">
  27913. <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
  27914. </pre></div>
  27915. </li></ul>
  27916. <a name="boxblur"></a>
  27917. <h2 class="section"><a href="ffmpeg-all.html#toc-boxblur">39.15 boxblur</a></h2>
  27918. <p>Apply a boxblur algorithm to the input video.
  27919. </p>
  27920. <p>It accepts the following parameters:
  27921. </p>
  27922. <dl compact="compact">
  27923. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  27924. <dt>&lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
  27925. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  27926. <dt>&lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
  27927. <dt>&lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
  27928. <dt>&lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
  27929. </dl>
  27930. <p>A description of the accepted options follows.
  27931. </p>
  27932. <dl compact="compact">
  27933. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  27934. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  27935. <dt>&lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
  27936. <dd><p>Set an expression for the box radius in pixels used for blurring the
  27937. corresponding input plane.
  27938. </p>
  27939. <p>The radius value must be a non-negative number, and must not be
  27940. greater than the value of the expression <code>min(w,h)/2</code> for the
  27941. luma and alpha planes, and of <code>min(cw,ch)/2</code> for the chroma
  27942. planes.
  27943. </p>
  27944. <p>Default value for &lsquo;<samp>luma_radius</samp>&rsquo; is &quot;2&quot;. If not specified,
  27945. &lsquo;<samp>chroma_radius</samp>&rsquo; and &lsquo;<samp>alpha_radius</samp>&rsquo; default to the
  27946. corresponding value set for &lsquo;<samp>luma_radius</samp>&rsquo;.
  27947. </p>
  27948. <p>The expressions can contain the following constants:
  27949. </p><dl compact="compact">
  27950. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  27951. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  27952. <dd><p>The input width and height in pixels.
  27953. </p>
  27954. </dd>
  27955. <dt>&lsquo;<samp>cw</samp>&rsquo;</dt>
  27956. <dt>&lsquo;<samp>ch</samp>&rsquo;</dt>
  27957. <dd><p>The input chroma image width and height in pixels.
  27958. </p>
  27959. </dd>
  27960. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  27961. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  27962. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  27963. pixel format &quot;yuv422p&quot;, <var>hsub</var> is 2 and <var>vsub</var> is 1.
  27964. </p></dd>
  27965. </dl>
  27966. </dd>
  27967. <dt>&lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
  27968. <dt>&lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
  27969. <dt>&lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
  27970. <dd><p>Specify how many times the boxblur filter is applied to the
  27971. corresponding plane.
  27972. </p>
  27973. <p>Default value for &lsquo;<samp>luma_power</samp>&rsquo; is 2. If not specified,
  27974. &lsquo;<samp>chroma_power</samp>&rsquo; and &lsquo;<samp>alpha_power</samp>&rsquo; default to the
  27975. corresponding value set for &lsquo;<samp>luma_power</samp>&rsquo;.
  27976. </p>
  27977. <p>A value of 0 will disable the effect.
  27978. </p></dd>
  27979. </dl>
  27980. <a name="Examples-59"></a>
  27981. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-59">39.15.1 Examples</a></h3>
  27982. <ul>
  27983. <li>
  27984. Apply a boxblur filter with the luma, chroma, and alpha radii
  27985. set to 2:
  27986. <div class="example">
  27987. <pre class="example">boxblur=luma_radius=2:luma_power=1
  27988. boxblur=2:1
  27989. </pre></div>
  27990. </li><li>
  27991. Set the luma radius to 2, and alpha and chroma radius to 0:
  27992. <div class="example">
  27993. <pre class="example">boxblur=2:1:cr=0:ar=0
  27994. </pre></div>
  27995. </li><li>
  27996. Set the luma and chroma radii to a fraction of the video dimension:
  27997. <div class="example">
  27998. <pre class="example">boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
  27999. </pre></div>
  28000. </li></ul>
  28001. <a name="bwdif"></a>
  28002. <h2 class="section"><a href="ffmpeg-all.html#toc-bwdif">39.16 bwdif</a></h2>
  28003. <p>Deinterlace the input video (&quot;bwdif&quot; stands for &quot;Bob Weaver
  28004. Deinterlacing Filter&quot;).
  28005. </p>
  28006. <p>Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic
  28007. interpolation algorithms.
  28008. It accepts the following parameters:
  28009. </p>
  28010. <dl compact="compact">
  28011. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  28012. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  28013. </p>
  28014. <dl compact="compact">
  28015. <dt>&lsquo;<samp>0, send_frame</samp>&rsquo;</dt>
  28016. <dd><p>Output one frame for each frame.
  28017. </p></dd>
  28018. <dt>&lsquo;<samp>1, send_field</samp>&rsquo;</dt>
  28019. <dd><p>Output one frame for each field.
  28020. </p></dd>
  28021. </dl>
  28022. <p>The default value is <code>send_field</code>.
  28023. </p>
  28024. </dd>
  28025. <dt>&lsquo;<samp>parity</samp>&rsquo;</dt>
  28026. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  28027. of the following values:
  28028. </p>
  28029. <dl compact="compact">
  28030. <dt>&lsquo;<samp>0, tff</samp>&rsquo;</dt>
  28031. <dd><p>Assume the top field is first.
  28032. </p></dd>
  28033. <dt>&lsquo;<samp>1, bff</samp>&rsquo;</dt>
  28034. <dd><p>Assume the bottom field is first.
  28035. </p></dd>
  28036. <dt>&lsquo;<samp>-1, auto</samp>&rsquo;</dt>
  28037. <dd><p>Enable automatic detection of field parity.
  28038. </p></dd>
  28039. </dl>
  28040. <p>The default value is <code>auto</code>.
  28041. If the interlacing is unknown or the decoder does not export this information,
  28042. top field first will be assumed.
  28043. </p>
  28044. </dd>
  28045. <dt>&lsquo;<samp>deint</samp>&rsquo;</dt>
  28046. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  28047. values:
  28048. </p>
  28049. <dl compact="compact">
  28050. <dt>&lsquo;<samp>0, all</samp>&rsquo;</dt>
  28051. <dd><p>Deinterlace all frames.
  28052. </p></dd>
  28053. <dt>&lsquo;<samp>1, interlaced</samp>&rsquo;</dt>
  28054. <dd><p>Only deinterlace frames marked as interlaced.
  28055. </p></dd>
  28056. </dl>
  28057. <p>The default value is <code>all</code>.
  28058. </p></dd>
  28059. </dl>
  28060. <a name="cas"></a>
  28061. <h2 class="section"><a href="ffmpeg-all.html#toc-cas">39.17 cas</a></h2>
  28062. <p>Apply Contrast Adaptive Sharpen filter to video stream.
  28063. </p>
  28064. <p>The filter accepts the following options:
  28065. </p>
  28066. <dl compact="compact">
  28067. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  28068. <dd><p>Set the sharpening strength. Default value is 0.
  28069. </p>
  28070. </dd>
  28071. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  28072. <dd><p>Set planes to filter. Default value is to filter all
  28073. planes except alpha plane.
  28074. </p></dd>
  28075. </dl>
  28076. <a name="chromahold"></a>
  28077. <h2 class="section"><a href="ffmpeg-all.html#toc-chromahold">39.18 chromahold</a></h2>
  28078. <p>Remove all color information for all colors except for certain one.
  28079. </p>
  28080. <p>The filter accepts the following options:
  28081. </p>
  28082. <dl compact="compact">
  28083. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  28084. <dd><p>The color which will not be replaced with neutral chroma.
  28085. </p>
  28086. </dd>
  28087. <dt>&lsquo;<samp>similarity</samp>&rsquo;</dt>
  28088. <dd><p>Similarity percentage with the above color.
  28089. 0.01 matches only the exact key color, while 1.0 matches everything.
  28090. </p>
  28091. </dd>
  28092. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  28093. <dd><p>Blend percentage.
  28094. 0.0 makes pixels either fully gray, or not gray at all.
  28095. Higher values result in more preserved color.
  28096. </p>
  28097. </dd>
  28098. <dt>&lsquo;<samp>yuv</samp>&rsquo;</dt>
  28099. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  28100. </p>
  28101. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  28102. This can be used to pass exact YUV values as hexadecimal numbers.
  28103. </p></dd>
  28104. </dl>
  28105. <a name="Commands-54"></a>
  28106. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-54">39.18.1 Commands</a></h3>
  28107. <p>This filter supports same <a href="#commands">commands</a> as options.
  28108. The command accepts the same syntax of the corresponding option.
  28109. </p>
  28110. <p>If the specified expression is not valid, it is kept at its current
  28111. value.
  28112. </p>
  28113. <a name="chromakey"></a>
  28114. <h2 class="section"><a href="ffmpeg-all.html#toc-chromakey">39.19 chromakey</a></h2>
  28115. <p>YUV colorspace color/chroma keying.
  28116. </p>
  28117. <p>The filter accepts the following options:
  28118. </p>
  28119. <dl compact="compact">
  28120. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  28121. <dd><p>The color which will be replaced with transparency.
  28122. </p>
  28123. </dd>
  28124. <dt>&lsquo;<samp>similarity</samp>&rsquo;</dt>
  28125. <dd><p>Similarity percentage with the key color.
  28126. </p>
  28127. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  28128. </p>
  28129. </dd>
  28130. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  28131. <dd><p>Blend percentage.
  28132. </p>
  28133. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  28134. </p>
  28135. <p>Higher values result in semi-transparent pixels, with a higher transparency
  28136. the more similar the pixels color is to the key color.
  28137. </p>
  28138. </dd>
  28139. <dt>&lsquo;<samp>yuv</samp>&rsquo;</dt>
  28140. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  28141. </p>
  28142. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  28143. This can be used to pass exact YUV values as hexadecimal numbers.
  28144. </p></dd>
  28145. </dl>
  28146. <a name="Commands-66"></a>
  28147. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-66">39.19.1 Commands</a></h3>
  28148. <p>This filter supports same <a href="#commands">commands</a> as options.
  28149. The command accepts the same syntax of the corresponding option.
  28150. </p>
  28151. <p>If the specified expression is not valid, it is kept at its current
  28152. value.
  28153. </p>
  28154. <a name="Examples-68"></a>
  28155. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-68">39.19.2 Examples</a></h3>
  28156. <ul>
  28157. <li>
  28158. Make every green pixel in the input image transparent:
  28159. <div class="example">
  28160. <pre class="example">ffmpeg -i input.png -vf chromakey=green out.png
  28161. </pre></div>
  28162. </li><li>
  28163. Overlay a greenscreen-video on top of a static black background.
  28164. <div class="example">
  28165. <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
  28166. </pre></div>
  28167. </li></ul>
  28168. <a name="chromashift"></a>
  28169. <h2 class="section"><a href="ffmpeg-all.html#toc-chromashift">39.20 chromashift</a></h2>
  28170. <p>Shift chroma pixels horizontally and/or vertically.
  28171. </p>
  28172. <p>The filter accepts the following options:
  28173. </p><dl compact="compact">
  28174. <dt>&lsquo;<samp>cbh</samp>&rsquo;</dt>
  28175. <dd><p>Set amount to shift chroma-blue horizontally.
  28176. </p></dd>
  28177. <dt>&lsquo;<samp>cbv</samp>&rsquo;</dt>
  28178. <dd><p>Set amount to shift chroma-blue vertically.
  28179. </p></dd>
  28180. <dt>&lsquo;<samp>crh</samp>&rsquo;</dt>
  28181. <dd><p>Set amount to shift chroma-red horizontally.
  28182. </p></dd>
  28183. <dt>&lsquo;<samp>crv</samp>&rsquo;</dt>
  28184. <dd><p>Set amount to shift chroma-red vertically.
  28185. </p></dd>
  28186. <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
  28187. <dd><p>Set edge mode, can be <var>smear</var>, default, or <var>warp</var>.
  28188. </p></dd>
  28189. </dl>
  28190. <a name="Commands-60"></a>
  28191. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-60">39.20.1 Commands</a></h3>
  28192. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  28193. </p>
  28194. <a name="ciescope"></a>
  28195. <h2 class="section"><a href="ffmpeg-all.html#toc-ciescope">39.21 ciescope</a></h2>
  28196. <p>Display CIE color diagram with pixels overlaid onto it.
  28197. </p>
  28198. <p>The filter accepts the following options:
  28199. </p>
  28200. <dl compact="compact">
  28201. <dt>&lsquo;<samp>system</samp>&rsquo;</dt>
  28202. <dd><p>Set color system.
  28203. </p>
  28204. <dl compact="compact">
  28205. <dt>&lsquo;<samp>ntsc, 470m</samp>&rsquo;</dt>
  28206. <dt>&lsquo;<samp>ebu, 470bg</samp>&rsquo;</dt>
  28207. <dt>&lsquo;<samp>smpte</samp>&rsquo;</dt>
  28208. <dt>&lsquo;<samp>240m</samp>&rsquo;</dt>
  28209. <dt>&lsquo;<samp>apple</samp>&rsquo;</dt>
  28210. <dt>&lsquo;<samp>widergb</samp>&rsquo;</dt>
  28211. <dt>&lsquo;<samp>cie1931</samp>&rsquo;</dt>
  28212. <dt>&lsquo;<samp>rec709, hdtv</samp>&rsquo;</dt>
  28213. <dt>&lsquo;<samp>uhdtv, rec2020</samp>&rsquo;</dt>
  28214. <dt>&lsquo;<samp>dcip3</samp>&rsquo;</dt>
  28215. </dl>
  28216. </dd>
  28217. <dt>&lsquo;<samp>cie</samp>&rsquo;</dt>
  28218. <dd><p>Set CIE system.
  28219. </p>
  28220. <dl compact="compact">
  28221. <dt>&lsquo;<samp>xyy</samp>&rsquo;</dt>
  28222. <dt>&lsquo;<samp>ucs</samp>&rsquo;</dt>
  28223. <dt>&lsquo;<samp>luv</samp>&rsquo;</dt>
  28224. </dl>
  28225. </dd>
  28226. <dt>&lsquo;<samp>gamuts</samp>&rsquo;</dt>
  28227. <dd><p>Set what gamuts to draw.
  28228. </p>
  28229. <p>See <code>system</code> option for available values.
  28230. </p>
  28231. </dd>
  28232. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  28233. <dd><p>Set ciescope size, by default set to 512.
  28234. </p>
  28235. </dd>
  28236. <dt>&lsquo;<samp>intensity, i</samp>&rsquo;</dt>
  28237. <dd><p>Set intensity used to map input pixel values to CIE diagram.
  28238. </p>
  28239. </dd>
  28240. <dt>&lsquo;<samp>contrast</samp>&rsquo;</dt>
  28241. <dd><p>Set contrast used to draw tongue colors that are out of active color system gamut.
  28242. </p>
  28243. </dd>
  28244. <dt>&lsquo;<samp>corrgamma</samp>&rsquo;</dt>
  28245. <dd><p>Correct gamma displayed on scope, by default enabled.
  28246. </p>
  28247. </dd>
  28248. <dt>&lsquo;<samp>showwhite</samp>&rsquo;</dt>
  28249. <dd><p>Show white point on CIE diagram, by default disabled.
  28250. </p>
  28251. </dd>
  28252. <dt>&lsquo;<samp>gamma</samp>&rsquo;</dt>
  28253. <dd><p>Set input gamma. Used only with XYZ input color space.
  28254. </p></dd>
  28255. </dl>
  28256. <a name="codecview"></a>
  28257. <h2 class="section"><a href="ffmpeg-all.html#toc-codecview">39.22 codecview</a></h2>
  28258. <p>Visualize information exported by some codecs.
  28259. </p>
  28260. <p>Some codecs can export information through frames using side-data or other
  28261. means. For example, some MPEG based codecs export motion vectors through the
  28262. <var>export_mvs</var> flag in the codec &lsquo;<samp>flags2</samp>&rsquo; option.
  28263. </p>
  28264. <p>The filter accepts the following option:
  28265. </p>
  28266. <dl compact="compact">
  28267. <dt>&lsquo;<samp>mv</samp>&rsquo;</dt>
  28268. <dd><p>Set motion vectors to visualize.
  28269. </p>
  28270. <p>Available flags for <var>mv</var> are:
  28271. </p>
  28272. <dl compact="compact">
  28273. <dt>&lsquo;<samp>pf</samp>&rsquo;</dt>
  28274. <dd><p>forward predicted MVs of P-frames
  28275. </p></dd>
  28276. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  28277. <dd><p>forward predicted MVs of B-frames
  28278. </p></dd>
  28279. <dt>&lsquo;<samp>bb</samp>&rsquo;</dt>
  28280. <dd><p>backward predicted MVs of B-frames
  28281. </p></dd>
  28282. </dl>
  28283. </dd>
  28284. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  28285. <dd><p>Display quantization parameters using the chroma planes.
  28286. </p>
  28287. </dd>
  28288. <dt>&lsquo;<samp>mv_type, mvt</samp>&rsquo;</dt>
  28289. <dd><p>Set motion vectors type to visualize. Includes MVs from all frames unless specified by <var>frame_type</var> option.
  28290. </p>
  28291. <p>Available flags for <var>mv_type</var> are:
  28292. </p>
  28293. <dl compact="compact">
  28294. <dt>&lsquo;<samp>fp</samp>&rsquo;</dt>
  28295. <dd><p>forward predicted MVs
  28296. </p></dd>
  28297. <dt>&lsquo;<samp>bp</samp>&rsquo;</dt>
  28298. <dd><p>backward predicted MVs
  28299. </p></dd>
  28300. </dl>
  28301. </dd>
  28302. <dt>&lsquo;<samp>frame_type, ft</samp>&rsquo;</dt>
  28303. <dd><p>Set frame type to visualize motion vectors of.
  28304. </p>
  28305. <p>Available flags for <var>frame_type</var> are:
  28306. </p>
  28307. <dl compact="compact">
  28308. <dt>&lsquo;<samp>if</samp>&rsquo;</dt>
  28309. <dd><p>intra-coded frames (I-frames)
  28310. </p></dd>
  28311. <dt>&lsquo;<samp>pf</samp>&rsquo;</dt>
  28312. <dd><p>predicted frames (P-frames)
  28313. </p></dd>
  28314. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  28315. <dd><p>bi-directionally predicted frames (B-frames)
  28316. </p></dd>
  28317. </dl>
  28318. </dd>
  28319. </dl>
  28320. <a name="Examples-50"></a>
  28321. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-50">39.22.1 Examples</a></h3>
  28322. <ul>
  28323. <li>
  28324. Visualize forward predicted MVs of all frames using <code>ffplay</code>:
  28325. <div class="example">
  28326. <pre class="example">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp
  28327. </pre></div>
  28328. </li><li>
  28329. Visualize multi-directionals MVs of P and B-Frames using <code>ffplay</code>:
  28330. <div class="example">
  28331. <pre class="example">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
  28332. </pre></div>
  28333. </li></ul>
  28334. <a name="colorbalance"></a>
  28335. <h2 class="section"><a href="ffmpeg-all.html#toc-colorbalance">39.23 colorbalance</a></h2>
  28336. <p>Modify intensity of primary colors (red, green and blue) of input frames.
  28337. </p>
  28338. <p>The filter allows an input frame to be adjusted in the shadows, midtones or highlights
  28339. regions for the red-cyan, green-magenta or blue-yellow balance.
  28340. </p>
  28341. <p>A positive adjustment value shifts the balance towards the primary color, a negative
  28342. value towards the complementary color.
  28343. </p>
  28344. <p>The filter accepts the following options:
  28345. </p>
  28346. <dl compact="compact">
  28347. <dt>&lsquo;<samp>rs</samp>&rsquo;</dt>
  28348. <dt>&lsquo;<samp>gs</samp>&rsquo;</dt>
  28349. <dt>&lsquo;<samp>bs</samp>&rsquo;</dt>
  28350. <dd><p>Adjust red, green and blue shadows (darkest pixels).
  28351. </p>
  28352. </dd>
  28353. <dt>&lsquo;<samp>rm</samp>&rsquo;</dt>
  28354. <dt>&lsquo;<samp>gm</samp>&rsquo;</dt>
  28355. <dt>&lsquo;<samp>bm</samp>&rsquo;</dt>
  28356. <dd><p>Adjust red, green and blue midtones (medium pixels).
  28357. </p>
  28358. </dd>
  28359. <dt>&lsquo;<samp>rh</samp>&rsquo;</dt>
  28360. <dt>&lsquo;<samp>gh</samp>&rsquo;</dt>
  28361. <dt>&lsquo;<samp>bh</samp>&rsquo;</dt>
  28362. <dd><p>Adjust red, green and blue highlights (brightest pixels).
  28363. </p>
  28364. <p>Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
  28365. </p>
  28366. </dd>
  28367. <dt>&lsquo;<samp>pl</samp>&rsquo;</dt>
  28368. <dd><p>Preserve lightness when changing color balance. Default is disabled.
  28369. </p></dd>
  28370. </dl>
  28371. <a name="Examples-28"></a>
  28372. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-28">39.23.1 Examples</a></h3>
  28373. <ul>
  28374. <li>
  28375. Add red color cast to shadows:
  28376. <div class="example">
  28377. <pre class="example">colorbalance=rs=.3
  28378. </pre></div>
  28379. </li></ul>
  28380. <a name="Commands-55"></a>
  28381. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-55">39.23.2 Commands</a></h3>
  28382. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  28383. </p>
  28384. <a name="colorchannelmixer"></a>
  28385. <h2 class="section"><a href="ffmpeg-all.html#toc-colorchannelmixer">39.24 colorchannelmixer</a></h2>
  28386. <p>Adjust video input frames by re-mixing color channels.
  28387. </p>
  28388. <p>This filter modifies a color channel by adding the values associated to
  28389. the other channels of the same pixels. For example if the value to
  28390. modify is red, the output value will be:
  28391. </p><div class="example">
  28392. <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>
  28393. </pre></div>
  28394. <p>The filter accepts the following options:
  28395. </p>
  28396. <dl compact="compact">
  28397. <dt>&lsquo;<samp>rr</samp>&rsquo;</dt>
  28398. <dt>&lsquo;<samp>rg</samp>&rsquo;</dt>
  28399. <dt>&lsquo;<samp>rb</samp>&rsquo;</dt>
  28400. <dt>&lsquo;<samp>ra</samp>&rsquo;</dt>
  28401. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output red channel.
  28402. Default is <code>1</code> for <var>rr</var>, and <code>0</code> for <var>rg</var>, <var>rb</var> and <var>ra</var>.
  28403. </p>
  28404. </dd>
  28405. <dt>&lsquo;<samp>gr</samp>&rsquo;</dt>
  28406. <dt>&lsquo;<samp>gg</samp>&rsquo;</dt>
  28407. <dt>&lsquo;<samp>gb</samp>&rsquo;</dt>
  28408. <dt>&lsquo;<samp>ga</samp>&rsquo;</dt>
  28409. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output green channel.
  28410. Default is <code>1</code> for <var>gg</var>, and <code>0</code> for <var>gr</var>, <var>gb</var> and <var>ga</var>.
  28411. </p>
  28412. </dd>
  28413. <dt>&lsquo;<samp>br</samp>&rsquo;</dt>
  28414. <dt>&lsquo;<samp>bg</samp>&rsquo;</dt>
  28415. <dt>&lsquo;<samp>bb</samp>&rsquo;</dt>
  28416. <dt>&lsquo;<samp>ba</samp>&rsquo;</dt>
  28417. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output blue channel.
  28418. Default is <code>1</code> for <var>bb</var>, and <code>0</code> for <var>br</var>, <var>bg</var> and <var>ba</var>.
  28419. </p>
  28420. </dd>
  28421. <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
  28422. <dt>&lsquo;<samp>ag</samp>&rsquo;</dt>
  28423. <dt>&lsquo;<samp>ab</samp>&rsquo;</dt>
  28424. <dt>&lsquo;<samp>aa</samp>&rsquo;</dt>
  28425. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
  28426. Default is <code>1</code> for <var>aa</var>, and <code>0</code> for <var>ar</var>, <var>ag</var> and <var>ab</var>.
  28427. </p>
  28428. <p>Allowed ranges for options are <code>[-2.0, 2.0]</code>.
  28429. </p></dd>
  28430. </dl>
  28431. <a name="Examples-121"></a>
  28432. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-121">39.24.1 Examples</a></h3>
  28433. <ul>
  28434. <li>
  28435. Convert source to grayscale:
  28436. <div class="example">
  28437. <pre class="example">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
  28438. </pre></div>
  28439. </li><li>
  28440. Simulate sepia tones:
  28441. <div class="example">
  28442. <pre class="example">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
  28443. </pre></div>
  28444. </li></ul>
  28445. <a name="Commands-25"></a>
  28446. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-25">39.24.2 Commands</a></h3>
  28447. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  28448. </p>
  28449. <a name="colorkey"></a>
  28450. <h2 class="section"><a href="ffmpeg-all.html#toc-colorkey">39.25 colorkey</a></h2>
  28451. <p>RGB colorspace color keying.
  28452. </p>
  28453. <p>The filter accepts the following options:
  28454. </p>
  28455. <dl compact="compact">
  28456. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  28457. <dd><p>The color which will be replaced with transparency.
  28458. </p>
  28459. </dd>
  28460. <dt>&lsquo;<samp>similarity</samp>&rsquo;</dt>
  28461. <dd><p>Similarity percentage with the key color.
  28462. </p>
  28463. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  28464. </p>
  28465. </dd>
  28466. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  28467. <dd><p>Blend percentage.
  28468. </p>
  28469. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  28470. </p>
  28471. <p>Higher values result in semi-transparent pixels, with a higher transparency
  28472. the more similar the pixels color is to the key color.
  28473. </p></dd>
  28474. </dl>
  28475. <a name="Examples-143"></a>
  28476. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-143">39.25.1 Examples</a></h3>
  28477. <ul>
  28478. <li>
  28479. Make every green pixel in the input image transparent:
  28480. <div class="example">
  28481. <pre class="example">ffmpeg -i input.png -vf colorkey=green out.png
  28482. </pre></div>
  28483. </li><li>
  28484. Overlay a greenscreen-video on top of a static background image.
  28485. <div class="example">
  28486. <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
  28487. </pre></div>
  28488. </li></ul>
  28489. <a name="Commands-27"></a>
  28490. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-27">39.25.2 Commands</a></h3>
  28491. <p>This filter supports same <a href="#commands">commands</a> as options.
  28492. The command accepts the same syntax of the corresponding option.
  28493. </p>
  28494. <p>If the specified expression is not valid, it is kept at its current
  28495. value.
  28496. </p>
  28497. <a name="colorhold"></a>
  28498. <h2 class="section"><a href="ffmpeg-all.html#toc-colorhold">39.26 colorhold</a></h2>
  28499. <p>Remove all color information for all RGB colors except for certain one.
  28500. </p>
  28501. <p>The filter accepts the following options:
  28502. </p>
  28503. <dl compact="compact">
  28504. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  28505. <dd><p>The color which will not be replaced with neutral gray.
  28506. </p>
  28507. </dd>
  28508. <dt>&lsquo;<samp>similarity</samp>&rsquo;</dt>
  28509. <dd><p>Similarity percentage with the above color.
  28510. 0.01 matches only the exact key color, while 1.0 matches everything.
  28511. </p>
  28512. </dd>
  28513. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  28514. <dd><p>Blend percentage. 0.0 makes pixels fully gray.
  28515. Higher values result in more preserved color.
  28516. </p></dd>
  28517. </dl>
  28518. <a name="Commands-13"></a>
  28519. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-13">39.26.1 Commands</a></h3>
  28520. <p>This filter supports same <a href="#commands">commands</a> as options.
  28521. The command accepts the same syntax of the corresponding option.
  28522. </p>
  28523. <p>If the specified expression is not valid, it is kept at its current
  28524. value.
  28525. </p>
  28526. <a name="colorlevels"></a>
  28527. <h2 class="section"><a href="ffmpeg-all.html#toc-colorlevels">39.27 colorlevels</a></h2>
  28528. <p>Adjust video input frames using levels.
  28529. </p>
  28530. <p>The filter accepts the following options:
  28531. </p>
  28532. <dl compact="compact">
  28533. <dt>&lsquo;<samp>rimin</samp>&rsquo;</dt>
  28534. <dt>&lsquo;<samp>gimin</samp>&rsquo;</dt>
  28535. <dt>&lsquo;<samp>bimin</samp>&rsquo;</dt>
  28536. <dt>&lsquo;<samp>aimin</samp>&rsquo;</dt>
  28537. <dd><p>Adjust red, green, blue and alpha input black point.
  28538. Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
  28539. </p>
  28540. </dd>
  28541. <dt>&lsquo;<samp>rimax</samp>&rsquo;</dt>
  28542. <dt>&lsquo;<samp>gimax</samp>&rsquo;</dt>
  28543. <dt>&lsquo;<samp>bimax</samp>&rsquo;</dt>
  28544. <dt>&lsquo;<samp>aimax</samp>&rsquo;</dt>
  28545. <dd><p>Adjust red, green, blue and alpha input white point.
  28546. Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>1</code>.
  28547. </p>
  28548. <p>Input levels are used to lighten highlights (bright tones), darken shadows
  28549. (dark tones), change the balance of bright and dark tones.
  28550. </p>
  28551. </dd>
  28552. <dt>&lsquo;<samp>romin</samp>&rsquo;</dt>
  28553. <dt>&lsquo;<samp>gomin</samp>&rsquo;</dt>
  28554. <dt>&lsquo;<samp>bomin</samp>&rsquo;</dt>
  28555. <dt>&lsquo;<samp>aomin</samp>&rsquo;</dt>
  28556. <dd><p>Adjust red, green, blue and alpha output black point.
  28557. Allowed ranges for options are <code>[0, 1.0]</code>. Defaults are <code>0</code>.
  28558. </p>
  28559. </dd>
  28560. <dt>&lsquo;<samp>romax</samp>&rsquo;</dt>
  28561. <dt>&lsquo;<samp>gomax</samp>&rsquo;</dt>
  28562. <dt>&lsquo;<samp>bomax</samp>&rsquo;</dt>
  28563. <dt>&lsquo;<samp>aomax</samp>&rsquo;</dt>
  28564. <dd><p>Adjust red, green, blue and alpha output white point.
  28565. Allowed ranges for options are <code>[0, 1.0]</code>. Defaults are <code>1</code>.
  28566. </p>
  28567. <p>Output levels allows manual selection of a constrained output level range.
  28568. </p></dd>
  28569. </dl>
  28570. <a name="Examples-61"></a>
  28571. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-61">39.27.1 Examples</a></h3>
  28572. <ul>
  28573. <li>
  28574. Make video output darker:
  28575. <div class="example">
  28576. <pre class="example">colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
  28577. </pre></div>
  28578. </li><li>
  28579. Increase contrast:
  28580. <div class="example">
  28581. <pre class="example">colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
  28582. </pre></div>
  28583. </li><li>
  28584. Make video output lighter:
  28585. <div class="example">
  28586. <pre class="example">colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
  28587. </pre></div>
  28588. </li><li>
  28589. Increase brightness:
  28590. <div class="example">
  28591. <pre class="example">colorlevels=romin=0.5:gomin=0.5:bomin=0.5
  28592. </pre></div>
  28593. </li></ul>
  28594. <a name="Commands-6"></a>
  28595. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-6">39.27.2 Commands</a></h3>
  28596. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  28597. </p>
  28598. <a name="colormatrix"></a>
  28599. <h2 class="section"><a href="ffmpeg-all.html#toc-colormatrix">39.28 colormatrix</a></h2>
  28600. <p>Convert color matrix.
  28601. </p>
  28602. <p>The filter accepts the following options:
  28603. </p>
  28604. <dl compact="compact">
  28605. <dt>&lsquo;<samp>src</samp>&rsquo;</dt>
  28606. <dt>&lsquo;<samp>dst</samp>&rsquo;</dt>
  28607. <dd><p>Specify the source and destination color matrix. Both values must be
  28608. specified.
  28609. </p>
  28610. <p>The accepted values are:
  28611. </p><dl compact="compact">
  28612. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  28613. <dd><p>BT.709
  28614. </p>
  28615. </dd>
  28616. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  28617. <dd><p>FCC
  28618. </p>
  28619. </dd>
  28620. <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
  28621. <dd><p>BT.601
  28622. </p>
  28623. </dd>
  28624. <dt>&lsquo;<samp>bt470</samp>&rsquo;</dt>
  28625. <dd><p>BT.470
  28626. </p>
  28627. </dd>
  28628. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  28629. <dd><p>BT.470BG
  28630. </p>
  28631. </dd>
  28632. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  28633. <dd><p>SMPTE-170M
  28634. </p>
  28635. </dd>
  28636. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  28637. <dd><p>SMPTE-240M
  28638. </p>
  28639. </dd>
  28640. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  28641. <dd><p>BT.2020
  28642. </p></dd>
  28643. </dl>
  28644. </dd>
  28645. </dl>
  28646. <p>For example to convert from BT.601 to SMPTE-240M, use the command:
  28647. </p><div class="example">
  28648. <pre class="example">colormatrix=bt601:smpte240m
  28649. </pre></div>
  28650. <a name="colorspace"></a>
  28651. <h2 class="section"><a href="ffmpeg-all.html#toc-colorspace">39.29 colorspace</a></h2>
  28652. <p>Convert colorspace, transfer characteristics or color primaries.
  28653. Input video needs to have an even size.
  28654. </p>
  28655. <p>The filter accepts the following options:
  28656. </p>
  28657. <dl compact="compact">
  28658. <dd><p><a name="all"></a>
  28659. </p></dd>
  28660. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  28661. <dd><p>Specify all color properties at once.
  28662. </p>
  28663. <p>The accepted values are:
  28664. </p><dl compact="compact">
  28665. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  28666. <dd><p>BT.470M
  28667. </p>
  28668. </dd>
  28669. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  28670. <dd><p>BT.470BG
  28671. </p>
  28672. </dd>
  28673. <dt>&lsquo;<samp>bt601-6-525</samp>&rsquo;</dt>
  28674. <dd><p>BT.601-6 525
  28675. </p>
  28676. </dd>
  28677. <dt>&lsquo;<samp>bt601-6-625</samp>&rsquo;</dt>
  28678. <dd><p>BT.601-6 625
  28679. </p>
  28680. </dd>
  28681. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  28682. <dd><p>BT.709
  28683. </p>
  28684. </dd>
  28685. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  28686. <dd><p>SMPTE-170M
  28687. </p>
  28688. </dd>
  28689. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  28690. <dd><p>SMPTE-240M
  28691. </p>
  28692. </dd>
  28693. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  28694. <dd><p>BT.2020
  28695. </p>
  28696. </dd>
  28697. </dl>
  28698. <p><a name="space"></a>
  28699. </p></dd>
  28700. <dt>&lsquo;<samp>space</samp>&rsquo;</dt>
  28701. <dd><p>Specify output colorspace.
  28702. </p>
  28703. <p>The accepted values are:
  28704. </p><dl compact="compact">
  28705. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  28706. <dd><p>BT.709
  28707. </p>
  28708. </dd>
  28709. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  28710. <dd><p>FCC
  28711. </p>
  28712. </dd>
  28713. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  28714. <dd><p>BT.470BG or BT.601-6 625
  28715. </p>
  28716. </dd>
  28717. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  28718. <dd><p>SMPTE-170M or BT.601-6 525
  28719. </p>
  28720. </dd>
  28721. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  28722. <dd><p>SMPTE-240M
  28723. </p>
  28724. </dd>
  28725. <dt>&lsquo;<samp>ycgco</samp>&rsquo;</dt>
  28726. <dd><p>YCgCo
  28727. </p>
  28728. </dd>
  28729. <dt>&lsquo;<samp>bt2020ncl</samp>&rsquo;</dt>
  28730. <dd><p>BT.2020 with non-constant luminance
  28731. </p>
  28732. </dd>
  28733. </dl>
  28734. <p><a name="trc"></a>
  28735. </p></dd>
  28736. <dt>&lsquo;<samp>trc</samp>&rsquo;</dt>
  28737. <dd><p>Specify output transfer characteristics.
  28738. </p>
  28739. <p>The accepted values are:
  28740. </p><dl compact="compact">
  28741. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  28742. <dd><p>BT.709
  28743. </p>
  28744. </dd>
  28745. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  28746. <dd><p>BT.470M
  28747. </p>
  28748. </dd>
  28749. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  28750. <dd><p>BT.470BG
  28751. </p>
  28752. </dd>
  28753. <dt>&lsquo;<samp>gamma22</samp>&rsquo;</dt>
  28754. <dd><p>Constant gamma of 2.2
  28755. </p>
  28756. </dd>
  28757. <dt>&lsquo;<samp>gamma28</samp>&rsquo;</dt>
  28758. <dd><p>Constant gamma of 2.8
  28759. </p>
  28760. </dd>
  28761. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  28762. <dd><p>SMPTE-170M, BT.601-6 625 or BT.601-6 525
  28763. </p>
  28764. </dd>
  28765. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  28766. <dd><p>SMPTE-240M
  28767. </p>
  28768. </dd>
  28769. <dt>&lsquo;<samp>srgb</samp>&rsquo;</dt>
  28770. <dd><p>SRGB
  28771. </p>
  28772. </dd>
  28773. <dt>&lsquo;<samp>iec61966-2-1</samp>&rsquo;</dt>
  28774. <dd><p>iec61966-2-1
  28775. </p>
  28776. </dd>
  28777. <dt>&lsquo;<samp>iec61966-2-4</samp>&rsquo;</dt>
  28778. <dd><p>iec61966-2-4
  28779. </p>
  28780. </dd>
  28781. <dt>&lsquo;<samp>xvycc</samp>&rsquo;</dt>
  28782. <dd><p>xvycc
  28783. </p>
  28784. </dd>
  28785. <dt>&lsquo;<samp>bt2020-10</samp>&rsquo;</dt>
  28786. <dd><p>BT.2020 for 10-bits content
  28787. </p>
  28788. </dd>
  28789. <dt>&lsquo;<samp>bt2020-12</samp>&rsquo;</dt>
  28790. <dd><p>BT.2020 for 12-bits content
  28791. </p>
  28792. </dd>
  28793. </dl>
  28794. <p><a name="primaries"></a>
  28795. </p></dd>
  28796. <dt>&lsquo;<samp>primaries</samp>&rsquo;</dt>
  28797. <dd><p>Specify output color primaries.
  28798. </p>
  28799. <p>The accepted values are:
  28800. </p><dl compact="compact">
  28801. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  28802. <dd><p>BT.709
  28803. </p>
  28804. </dd>
  28805. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  28806. <dd><p>BT.470M
  28807. </p>
  28808. </dd>
  28809. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  28810. <dd><p>BT.470BG or BT.601-6 625
  28811. </p>
  28812. </dd>
  28813. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  28814. <dd><p>SMPTE-170M or BT.601-6 525
  28815. </p>
  28816. </dd>
  28817. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  28818. <dd><p>SMPTE-240M
  28819. </p>
  28820. </dd>
  28821. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  28822. <dd><p>film
  28823. </p>
  28824. </dd>
  28825. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  28826. <dd><p>SMPTE-431
  28827. </p>
  28828. </dd>
  28829. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  28830. <dd><p>SMPTE-432
  28831. </p>
  28832. </dd>
  28833. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  28834. <dd><p>BT.2020
  28835. </p>
  28836. </dd>
  28837. <dt>&lsquo;<samp>jedec-p22</samp>&rsquo;</dt>
  28838. <dd><p>JEDEC P22 phosphors
  28839. </p>
  28840. </dd>
  28841. </dl>
  28842. <p><a name="range"></a>
  28843. </p></dd>
  28844. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  28845. <dd><p>Specify output color range.
  28846. </p>
  28847. <p>The accepted values are:
  28848. </p><dl compact="compact">
  28849. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  28850. <dd><p>TV (restricted) range
  28851. </p>
  28852. </dd>
  28853. <dt>&lsquo;<samp>mpeg</samp>&rsquo;</dt>
  28854. <dd><p>MPEG (restricted) range
  28855. </p>
  28856. </dd>
  28857. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  28858. <dd><p>PC (full) range
  28859. </p>
  28860. </dd>
  28861. <dt>&lsquo;<samp>jpeg</samp>&rsquo;</dt>
  28862. <dd><p>JPEG (full) range
  28863. </p>
  28864. </dd>
  28865. </dl>
  28866. </dd>
  28867. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  28868. <dd><p>Specify output color format.
  28869. </p>
  28870. <p>The accepted values are:
  28871. </p><dl compact="compact">
  28872. <dt>&lsquo;<samp>yuv420p</samp>&rsquo;</dt>
  28873. <dd><p>YUV 4:2:0 planar 8-bits
  28874. </p>
  28875. </dd>
  28876. <dt>&lsquo;<samp>yuv420p10</samp>&rsquo;</dt>
  28877. <dd><p>YUV 4:2:0 planar 10-bits
  28878. </p>
  28879. </dd>
  28880. <dt>&lsquo;<samp>yuv420p12</samp>&rsquo;</dt>
  28881. <dd><p>YUV 4:2:0 planar 12-bits
  28882. </p>
  28883. </dd>
  28884. <dt>&lsquo;<samp>yuv422p</samp>&rsquo;</dt>
  28885. <dd><p>YUV 4:2:2 planar 8-bits
  28886. </p>
  28887. </dd>
  28888. <dt>&lsquo;<samp>yuv422p10</samp>&rsquo;</dt>
  28889. <dd><p>YUV 4:2:2 planar 10-bits
  28890. </p>
  28891. </dd>
  28892. <dt>&lsquo;<samp>yuv422p12</samp>&rsquo;</dt>
  28893. <dd><p>YUV 4:2:2 planar 12-bits
  28894. </p>
  28895. </dd>
  28896. <dt>&lsquo;<samp>yuv444p</samp>&rsquo;</dt>
  28897. <dd><p>YUV 4:4:4 planar 8-bits
  28898. </p>
  28899. </dd>
  28900. <dt>&lsquo;<samp>yuv444p10</samp>&rsquo;</dt>
  28901. <dd><p>YUV 4:4:4 planar 10-bits
  28902. </p>
  28903. </dd>
  28904. <dt>&lsquo;<samp>yuv444p12</samp>&rsquo;</dt>
  28905. <dd><p>YUV 4:4:4 planar 12-bits
  28906. </p>
  28907. </dd>
  28908. </dl>
  28909. </dd>
  28910. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  28911. <dd><p>Do a fast conversion, which skips gamma/primary correction. This will take
  28912. significantly less CPU, but will be mathematically incorrect. To get output
  28913. compatible with that produced by the colormatrix filter, use fast=1.
  28914. </p>
  28915. </dd>
  28916. <dt>&lsquo;<samp>dither</samp>&rsquo;</dt>
  28917. <dd><p>Specify dithering mode.
  28918. </p>
  28919. <p>The accepted values are:
  28920. </p><dl compact="compact">
  28921. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  28922. <dd><p>No dithering
  28923. </p>
  28924. </dd>
  28925. <dt>&lsquo;<samp>fsb</samp>&rsquo;</dt>
  28926. <dd><p>Floyd-Steinberg dithering
  28927. </p></dd>
  28928. </dl>
  28929. </dd>
  28930. <dt>&lsquo;<samp>wpadapt</samp>&rsquo;</dt>
  28931. <dd><p>Whitepoint adaptation mode.
  28932. </p>
  28933. <p>The accepted values are:
  28934. </p><dl compact="compact">
  28935. <dt>&lsquo;<samp>bradford</samp>&rsquo;</dt>
  28936. <dd><p>Bradford whitepoint adaptation
  28937. </p>
  28938. </dd>
  28939. <dt>&lsquo;<samp>vonkries</samp>&rsquo;</dt>
  28940. <dd><p>von Kries whitepoint adaptation
  28941. </p>
  28942. </dd>
  28943. <dt>&lsquo;<samp>identity</samp>&rsquo;</dt>
  28944. <dd><p>identity whitepoint adaptation (i.e. no whitepoint adaptation)
  28945. </p></dd>
  28946. </dl>
  28947. </dd>
  28948. <dt>&lsquo;<samp>iall</samp>&rsquo;</dt>
  28949. <dd><p>Override all input properties at once. Same accepted values as <a href="#all">all</a>.
  28950. </p>
  28951. </dd>
  28952. <dt>&lsquo;<samp>ispace</samp>&rsquo;</dt>
  28953. <dd><p>Override input colorspace. Same accepted values as <a href="#space">space</a>.
  28954. </p>
  28955. </dd>
  28956. <dt>&lsquo;<samp>iprimaries</samp>&rsquo;</dt>
  28957. <dd><p>Override input color primaries. Same accepted values as <a href="#primaries">primaries</a>.
  28958. </p>
  28959. </dd>
  28960. <dt>&lsquo;<samp>itrc</samp>&rsquo;</dt>
  28961. <dd><p>Override input transfer characteristics. Same accepted values as <a href="#trc">trc</a>.
  28962. </p>
  28963. </dd>
  28964. <dt>&lsquo;<samp>irange</samp>&rsquo;</dt>
  28965. <dd><p>Override input color range. Same accepted values as <a href="#range">range</a>.
  28966. </p>
  28967. </dd>
  28968. </dl>
  28969. <p>The filter converts the transfer characteristics, color space and color
  28970. primaries to the specified user values. The output value, if not specified,
  28971. is set to a default value based on the &quot;all&quot; property. If that property is
  28972. also not specified, the filter will log an error. The output color range and
  28973. format default to the same value as the input color range and format. The
  28974. input transfer characteristics, color space, color primaries and color range
  28975. should be set on the input data. If any of these are missing, the filter will
  28976. log an error and no conversion will take place.
  28977. </p>
  28978. <p>For example to convert the input to SMPTE-240M, use the command:
  28979. </p><div class="example">
  28980. <pre class="example">colorspace=smpte240m
  28981. </pre></div>
  28982. <a name="convolution"></a>
  28983. <h2 class="section"><a href="ffmpeg-all.html#toc-convolution">39.30 convolution</a></h2>
  28984. <p>Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements.
  28985. </p>
  28986. <p>The filter accepts the following options:
  28987. </p>
  28988. <dl compact="compact">
  28989. <dt>&lsquo;<samp>0m</samp>&rsquo;</dt>
  28990. <dt>&lsquo;<samp>1m</samp>&rsquo;</dt>
  28991. <dt>&lsquo;<samp>2m</samp>&rsquo;</dt>
  28992. <dt>&lsquo;<samp>3m</samp>&rsquo;</dt>
  28993. <dd><p>Set matrix for each plane.
  28994. Matrix is sequence of 9, 25 or 49 signed integers in <var>square</var> mode,
  28995. and from 1 to 49 odd number of signed integers in <var>row</var> mode.
  28996. </p>
  28997. </dd>
  28998. <dt>&lsquo;<samp>0rdiv</samp>&rsquo;</dt>
  28999. <dt>&lsquo;<samp>1rdiv</samp>&rsquo;</dt>
  29000. <dt>&lsquo;<samp>2rdiv</samp>&rsquo;</dt>
  29001. <dt>&lsquo;<samp>3rdiv</samp>&rsquo;</dt>
  29002. <dd><p>Set multiplier for calculated value for each plane.
  29003. If unset or 0, it will be sum of all matrix elements.
  29004. </p>
  29005. </dd>
  29006. <dt>&lsquo;<samp>0bias</samp>&rsquo;</dt>
  29007. <dt>&lsquo;<samp>1bias</samp>&rsquo;</dt>
  29008. <dt>&lsquo;<samp>2bias</samp>&rsquo;</dt>
  29009. <dt>&lsquo;<samp>3bias</samp>&rsquo;</dt>
  29010. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  29011. Useful for making the overall image brighter or darker. Default is 0.0.
  29012. </p>
  29013. </dd>
  29014. <dt>&lsquo;<samp>0mode</samp>&rsquo;</dt>
  29015. <dt>&lsquo;<samp>1mode</samp>&rsquo;</dt>
  29016. <dt>&lsquo;<samp>2mode</samp>&rsquo;</dt>
  29017. <dt>&lsquo;<samp>3mode</samp>&rsquo;</dt>
  29018. <dd><p>Set matrix mode for each plane. Can be <var>square</var>, <var>row</var> or <var>column</var>.
  29019. Default is <var>square</var>.
  29020. </p></dd>
  29021. </dl>
  29022. <a name="Examples-137"></a>
  29023. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-137">39.30.1 Examples</a></h3>
  29024. <ul>
  29025. <li>
  29026. Apply sharpen:
  29027. <div class="example">
  29028. <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;
  29029. </pre></div>
  29030. </li><li>
  29031. Apply blur:
  29032. <div class="example">
  29033. <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;
  29034. </pre></div>
  29035. </li><li>
  29036. Apply edge enhance:
  29037. <div class="example">
  29038. <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;
  29039. </pre></div>
  29040. </li><li>
  29041. Apply edge detect:
  29042. <div class="example">
  29043. <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;
  29044. </pre></div>
  29045. </li><li>
  29046. Apply laplacian edge detector which includes diagonals:
  29047. <div class="example">
  29048. <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;
  29049. </pre></div>
  29050. </li><li>
  29051. Apply emboss:
  29052. <div class="example">
  29053. <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;
  29054. </pre></div>
  29055. </li></ul>
  29056. <a name="convolve"></a>
  29057. <h2 class="section"><a href="ffmpeg-all.html#toc-convolve">39.31 convolve</a></h2>
  29058. <p>Apply 2D convolution of video stream in frequency domain using second stream
  29059. as impulse.
  29060. </p>
  29061. <p>The filter accepts the following options:
  29062. </p>
  29063. <dl compact="compact">
  29064. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  29065. <dd><p>Set which planes to process.
  29066. </p>
  29067. </dd>
  29068. <dt>&lsquo;<samp>impulse</samp>&rsquo;</dt>
  29069. <dd><p>Set which impulse video frames will be processed, can be <var>first</var>
  29070. or <var>all</var>. Default is <var>all</var>.
  29071. </p></dd>
  29072. </dl>
  29073. <p>The <code>convolve</code> filter also supports the <a href="#framesync">framesync</a> options.
  29074. </p>
  29075. <a name="copy"></a>
  29076. <h2 class="section"><a href="ffmpeg-all.html#toc-copy">39.32 copy</a></h2>
  29077. <p>Copy the input video source unchanged to the output. This is mainly useful for
  29078. testing purposes.
  29079. </p>
  29080. <p><a name="coreimage"></a>
  29081. </p><a name="coreimage-1"></a>
  29082. <h2 class="section"><a href="ffmpeg-all.html#toc-coreimage-1">39.33 coreimage</a></h2>
  29083. <p>Video filtering on GPU using Apple&rsquo;s CoreImage API on OSX.
  29084. </p>
  29085. <p>Hardware acceleration is based on an OpenGL context. Usually, this means it is
  29086. processed by video hardware. However, software-based OpenGL implementations
  29087. exist which means there is no guarantee for hardware processing. It depends on
  29088. the respective OSX.
  29089. </p>
  29090. <p>There are many filters and image generators provided by Apple that come with a
  29091. large variety of options. The filter has to be referenced by its name along
  29092. with its options.
  29093. </p>
  29094. <p>The coreimage filter accepts the following options:
  29095. </p><dl compact="compact">
  29096. <dt>&lsquo;<samp>list_filters</samp>&rsquo;</dt>
  29097. <dd><p>List all available filters and generators along with all their respective
  29098. options as well as possible minimum and maximum values along with the default
  29099. values.
  29100. </p><div class="example">
  29101. <pre class="example">list_filters=true
  29102. </pre></div>
  29103. </dd>
  29104. <dt>&lsquo;<samp>filter</samp>&rsquo;</dt>
  29105. <dd><p>Specify all filters by their respective name and options.
  29106. Use <var>list_filters</var> to determine all valid filter names and options.
  29107. Numerical options are specified by a float value and are automatically clamped
  29108. to their respective value range. Vector and color options have to be specified
  29109. by a list of space separated float values. Character escaping has to be done.
  29110. A special option name <code>default</code> is available to use default options for a
  29111. filter.
  29112. </p>
  29113. <p>It is required to specify either <code>default</code> or at least one of the filter options.
  29114. All omitted options are used with their default values.
  29115. The syntax of the filter string is as follows:
  29116. </p><div class="example">
  29117. <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;][@...]][#...]
  29118. </pre></div>
  29119. </dd>
  29120. <dt>&lsquo;<samp>output_rect</samp>&rsquo;</dt>
  29121. <dd><p>Specify a rectangle where the output of the filter chain is copied into the
  29122. input image. It is given by a list of space separated float values:
  29123. </p><div class="example">
  29124. <pre class="example">output_rect=x\ y\ width\ height
  29125. </pre></div>
  29126. <p>If not given, the output rectangle equals the dimensions of the input image.
  29127. The output rectangle is automatically cropped at the borders of the input
  29128. image. Negative values are valid for each component.
  29129. </p><div class="example">
  29130. <pre class="example">output_rect=25\ 25\ 100\ 100
  29131. </pre></div>
  29132. </dd>
  29133. </dl>
  29134. <p>Several filters can be chained for successive processing without GPU-HOST
  29135. transfers allowing for fast processing of complex filter chains.
  29136. Currently, only filters with zero (generators) or exactly one (filters) input
  29137. image and one output image are supported. Also, transition filters are not yet
  29138. usable as intended.
  29139. </p>
  29140. <p>Some filters generate output images with additional padding depending on the
  29141. respective filter kernel. The padding is automatically removed to ensure the
  29142. filter output has the same size as the input image.
  29143. </p>
  29144. <p>For image generators, the size of the output image is determined by the
  29145. previous output image of the filter chain or the input image of the whole
  29146. filterchain, respectively. The generators do not use the pixel information of
  29147. this image to generate their output. However, the generated output is
  29148. blended onto this image, resulting in partial or complete coverage of the
  29149. output image.
  29150. </p>
  29151. <p>The <a href="#coreimagesrc">coreimagesrc</a> video source can be used for generating input images
  29152. which are directly fed into the filter chain. By using it, providing input
  29153. images by another video source or an input video is not required.
  29154. </p>
  29155. <a name="Examples-60"></a>
  29156. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-60">39.33.1 Examples</a></h3>
  29157. <ul>
  29158. <li>
  29159. List all filters available:
  29160. <div class="example">
  29161. <pre class="example">coreimage=list_filters=true
  29162. </pre></div>
  29163. </li><li>
  29164. Use the CIBoxBlur filter with default options to blur an image:
  29165. <div class="example">
  29166. <pre class="example">coreimage=filter=CIBoxBlur@default
  29167. </pre></div>
  29168. </li><li>
  29169. Use a filter chain with CISepiaTone at default values and CIVignetteEffect with
  29170. its center at 100x100 and a radius of 50 pixels:
  29171. <div class="example">
  29172. <pre class="example">coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\ 100@inputRadius=50
  29173. </pre></div>
  29174. </li><li>
  29175. Use nullsrc and CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  29176. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  29177. <div class="example">
  29178. <pre class="example">ffmpeg -f lavfi -i nullsrc=s=100x100,coreimage=filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  29179. </pre></div>
  29180. </li></ul>
  29181. <a name="cover_005frect"></a>
  29182. <h2 class="section"><a href="ffmpeg-all.html#toc-cover_005frect">39.34 cover_rect</a></h2>
  29183. <p>Cover a rectangular object
  29184. </p>
  29185. <p>It accepts the following options:
  29186. </p>
  29187. <dl compact="compact">
  29188. <dt>&lsquo;<samp>cover</samp>&rsquo;</dt>
  29189. <dd><p>Filepath of the optional cover image, needs to be in yuv420.
  29190. </p>
  29191. </dd>
  29192. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  29193. <dd><p>Set covering mode.
  29194. </p>
  29195. <p>It accepts the following values:
  29196. </p><dl compact="compact">
  29197. <dt>&lsquo;<samp>cover</samp>&rsquo;</dt>
  29198. <dd><p>cover it by the supplied image
  29199. </p></dd>
  29200. <dt>&lsquo;<samp>blur</samp>&rsquo;</dt>
  29201. <dd><p>cover it by interpolating the surrounding pixels
  29202. </p></dd>
  29203. </dl>
  29204. <p>Default value is <var>blur</var>.
  29205. </p></dd>
  29206. </dl>
  29207. <a name="Examples-97"></a>
  29208. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-97">39.34.1 Examples</a></h3>
  29209. <ul>
  29210. <li>
  29211. Cover a rectangular object by the supplied image of a given video using <code>ffmpeg</code>:
  29212. <div class="example">
  29213. <pre class="example">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  29214. </pre></div>
  29215. </li></ul>
  29216. <a name="crop"></a>
  29217. <h2 class="section"><a href="ffmpeg-all.html#toc-crop">39.35 crop</a></h2>
  29218. <p>Crop the input video to given dimensions.
  29219. </p>
  29220. <p>It accepts the following parameters:
  29221. </p>
  29222. <dl compact="compact">
  29223. <dt>&lsquo;<samp>w, out_w</samp>&rsquo;</dt>
  29224. <dd><p>The width of the output video. It defaults to <code>iw</code>.
  29225. This expression is evaluated only once during the filter
  29226. configuration, or when the &lsquo;<samp>w</samp>&rsquo; or &lsquo;<samp>out_w</samp>&rsquo; command is sent.
  29227. </p>
  29228. </dd>
  29229. <dt>&lsquo;<samp>h, out_h</samp>&rsquo;</dt>
  29230. <dd><p>The height of the output video. It defaults to <code>ih</code>.
  29231. This expression is evaluated only once during the filter
  29232. configuration, or when the &lsquo;<samp>h</samp>&rsquo; or &lsquo;<samp>out_h</samp>&rsquo; command is sent.
  29233. </p>
  29234. </dd>
  29235. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  29236. <dd><p>The horizontal position, in the input video, of the left edge of the output
  29237. video. It defaults to <code>(in_w-out_w)/2</code>.
  29238. This expression is evaluated per-frame.
  29239. </p>
  29240. </dd>
  29241. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  29242. <dd><p>The vertical position, in the input video, of the top edge of the output video.
  29243. It defaults to <code>(in_h-out_h)/2</code>.
  29244. This expression is evaluated per-frame.
  29245. </p>
  29246. </dd>
  29247. <dt>&lsquo;<samp>keep_aspect</samp>&rsquo;</dt>
  29248. <dd><p>If set to 1 will force the output display aspect ratio
  29249. to be the same of the input, by changing the output sample aspect
  29250. ratio. It defaults to 0.
  29251. </p>
  29252. </dd>
  29253. <dt>&lsquo;<samp>exact</samp>&rsquo;</dt>
  29254. <dd><p>Enable exact cropping. If enabled, subsampled videos will be cropped at exact
  29255. width/height/x/y as specified and will not be rounded to nearest smaller value.
  29256. It defaults to 0.
  29257. </p></dd>
  29258. </dl>
  29259. <p>The <var>out_w</var>, <var>out_h</var>, <var>x</var>, <var>y</var> parameters are
  29260. expressions containing the following constants:
  29261. </p>
  29262. <dl compact="compact">
  29263. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  29264. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  29265. <dd><p>The computed values for <var>x</var> and <var>y</var>. They are evaluated for
  29266. each new frame.
  29267. </p>
  29268. </dd>
  29269. <dt>&lsquo;<samp>in_w</samp>&rsquo;</dt>
  29270. <dt>&lsquo;<samp>in_h</samp>&rsquo;</dt>
  29271. <dd><p>The input width and height.
  29272. </p>
  29273. </dd>
  29274. <dt>&lsquo;<samp>iw</samp>&rsquo;</dt>
  29275. <dt>&lsquo;<samp>ih</samp>&rsquo;</dt>
  29276. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  29277. </p>
  29278. </dd>
  29279. <dt>&lsquo;<samp>out_w</samp>&rsquo;</dt>
  29280. <dt>&lsquo;<samp>out_h</samp>&rsquo;</dt>
  29281. <dd><p>The output (cropped) width and height.
  29282. </p>
  29283. </dd>
  29284. <dt>&lsquo;<samp>ow</samp>&rsquo;</dt>
  29285. <dt>&lsquo;<samp>oh</samp>&rsquo;</dt>
  29286. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
  29287. </p>
  29288. </dd>
  29289. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  29290. <dd><p>same as <var>iw</var> / <var>ih</var>
  29291. </p>
  29292. </dd>
  29293. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  29294. <dd><p>input sample aspect ratio
  29295. </p>
  29296. </dd>
  29297. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  29298. <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
  29299. </p>
  29300. </dd>
  29301. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  29302. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  29303. <dd><p>horizontal and vertical chroma subsample values. For example for the
  29304. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  29305. </p>
  29306. </dd>
  29307. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  29308. <dd><p>The number of the input frame, starting from 0.
  29309. </p>
  29310. </dd>
  29311. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  29312. <dd><p>the position in the file of the input frame, NAN if unknown
  29313. </p>
  29314. </dd>
  29315. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  29316. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  29317. </p>
  29318. </dd>
  29319. </dl>
  29320. <p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
  29321. and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
  29322. cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
  29323. evaluated after <var>out_w</var> and <var>out_h</var>.
  29324. </p>
  29325. <p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
  29326. position of the top-left corner of the output (non-cropped) area. They
  29327. are evaluated for each frame. If the evaluated value is not valid, it
  29328. is approximated to the nearest valid value.
  29329. </p>
  29330. <p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
  29331. for <var>y</var> may depend on <var>x</var>.
  29332. </p>
  29333. <a name="Examples-84"></a>
  29334. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-84">39.35.1 Examples</a></h3>
  29335. <ul>
  29336. <li>
  29337. Crop area with size 100x100 at position (12,34).
  29338. <div class="example">
  29339. <pre class="example">crop=100:100:12:34
  29340. </pre></div>
  29341. <p>Using named options, the example above becomes:
  29342. </p><div class="example">
  29343. <pre class="example">crop=w=100:h=100:x=12:y=34
  29344. </pre></div>
  29345. </li><li>
  29346. Crop the central input area with size 100x100:
  29347. <div class="example">
  29348. <pre class="example">crop=100:100
  29349. </pre></div>
  29350. </li><li>
  29351. Crop the central input area with size 2/3 of the input video:
  29352. <div class="example">
  29353. <pre class="example">crop=2/3*in_w:2/3*in_h
  29354. </pre></div>
  29355. </li><li>
  29356. Crop the input video central square:
  29357. <div class="example">
  29358. <pre class="example">crop=out_w=in_h
  29359. crop=in_h
  29360. </pre></div>
  29361. </li><li>
  29362. Delimit the rectangle with the top-left corner placed at position
  29363. 100:100 and the right-bottom corner corresponding to the right-bottom
  29364. corner of the input image.
  29365. <div class="example">
  29366. <pre class="example">crop=in_w-100:in_h-100:100:100
  29367. </pre></div>
  29368. </li><li>
  29369. Crop 10 pixels from the left and right borders, and 20 pixels from
  29370. the top and bottom borders
  29371. <div class="example">
  29372. <pre class="example">crop=in_w-2*10:in_h-2*20
  29373. </pre></div>
  29374. </li><li>
  29375. Keep only the bottom right quarter of the input image:
  29376. <div class="example">
  29377. <pre class="example">crop=in_w/2:in_h/2:in_w/2:in_h/2
  29378. </pre></div>
  29379. </li><li>
  29380. Crop height for getting Greek harmony:
  29381. <div class="example">
  29382. <pre class="example">crop=in_w:1/PHI*in_w
  29383. </pre></div>
  29384. </li><li>
  29385. Apply trembling effect:
  29386. <div class="example">
  29387. <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)
  29388. </pre></div>
  29389. </li><li>
  29390. Apply erratic camera effect depending on timestamp:
  29391. <div class="example">
  29392. <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;
  29393. </pre></div>
  29394. </li><li>
  29395. Set x depending on the value of y:
  29396. <div class="example">
  29397. <pre class="example">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
  29398. </pre></div>
  29399. </li></ul>
  29400. <a name="Commands-32"></a>
  29401. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-32">39.35.2 Commands</a></h3>
  29402. <p>This filter supports the following commands:
  29403. </p><dl compact="compact">
  29404. <dt>&lsquo;<samp>w, out_w</samp>&rsquo;</dt>
  29405. <dt>&lsquo;<samp>h, out_h</samp>&rsquo;</dt>
  29406. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  29407. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  29408. <dd><p>Set width/height of the output video and the horizontal/vertical position
  29409. in the input video.
  29410. The command accepts the same syntax of the corresponding option.
  29411. </p>
  29412. <p>If the specified expression is not valid, it is kept at its current
  29413. value.
  29414. </p></dd>
  29415. </dl>
  29416. <a name="cropdetect"></a>
  29417. <h2 class="section"><a href="ffmpeg-all.html#toc-cropdetect">39.36 cropdetect</a></h2>
  29418. <p>Auto-detect the crop size.
  29419. </p>
  29420. <p>It calculates the necessary cropping parameters and prints the
  29421. recommended parameters via the logging system. The detected dimensions
  29422. correspond to the non-black area of the input video.
  29423. </p>
  29424. <p>It accepts the following parameters:
  29425. </p>
  29426. <dl compact="compact">
  29427. <dt>&lsquo;<samp>limit</samp>&rsquo;</dt>
  29428. <dd><p>Set higher black value threshold, which can be optionally specified
  29429. from nothing (0) to everything (255 for 8-bit based formats). An intensity
  29430. value greater to the set value is considered non-black. It defaults to 24.
  29431. You can also specify a value between 0.0 and 1.0 which will be scaled depending
  29432. on the bitdepth of the pixel format.
  29433. </p>
  29434. </dd>
  29435. <dt>&lsquo;<samp>round</samp>&rsquo;</dt>
  29436. <dd><p>The value which the width/height should be divisible by. It defaults to
  29437. 16. The offset is automatically adjusted to center the video. Use 2 to
  29438. get only even dimensions (needed for 4:2:2 video). 16 is best when
  29439. encoding to most video codecs.
  29440. </p>
  29441. </dd>
  29442. <dt>&lsquo;<samp>reset_count, reset</samp>&rsquo;</dt>
  29443. <dd><p>Set the counter that determines after how many frames cropdetect will
  29444. reset the previously detected largest video area and start over to
  29445. detect the current optimal crop area. Default value is 0.
  29446. </p>
  29447. <p>This can be useful when channel logos distort the video area. 0
  29448. indicates &rsquo;never reset&rsquo;, and returns the largest area encountered during
  29449. playback.
  29450. </p></dd>
  29451. </dl>
  29452. <p><a name="cue"></a>
  29453. </p><a name="cue-1"></a>
  29454. <h2 class="section"><a href="ffmpeg-all.html#toc-cue-1">39.37 cue</a></h2>
  29455. <p>Delay video filtering until a given wallclock timestamp. The filter first
  29456. passes on &lsquo;<samp>preroll</samp>&rsquo; amount of frames, then it buffers at most
  29457. &lsquo;<samp>buffer</samp>&rsquo; amount of frames and waits for the cue. After reaching the cue
  29458. it forwards the buffered frames and also any subsequent frames coming in its
  29459. input.
  29460. </p>
  29461. <p>The filter can be used synchronize the output of multiple ffmpeg processes for
  29462. realtime output devices like decklink. By putting the delay in the filtering
  29463. chain and pre-buffering frames the process can pass on data to output almost
  29464. immediately after the target wallclock timestamp is reached.
  29465. </p>
  29466. <p>Perfect frame accuracy cannot be guaranteed, but the result is good enough for
  29467. some use cases.
  29468. </p>
  29469. <dl compact="compact">
  29470. <dt>&lsquo;<samp>cue</samp>&rsquo;</dt>
  29471. <dd><p>The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0.
  29472. </p>
  29473. </dd>
  29474. <dt>&lsquo;<samp>preroll</samp>&rsquo;</dt>
  29475. <dd><p>The duration of content to pass on as preroll expressed in seconds. Default is 0.
  29476. </p>
  29477. </dd>
  29478. <dt>&lsquo;<samp>buffer</samp>&rsquo;</dt>
  29479. <dd><p>The maximum duration of content to buffer before waiting for the cue expressed
  29480. in seconds. Default is 0.
  29481. </p>
  29482. </dd>
  29483. </dl>
  29484. <p><a name="curves"></a>
  29485. </p><a name="curves-1"></a>
  29486. <h2 class="section"><a href="ffmpeg-all.html#toc-curves-1">39.38 curves</a></h2>
  29487. <p>Apply color adjustments using curves.
  29488. </p>
  29489. <p>This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
  29490. component (red, green and blue) has its values defined by <var>N</var> key points
  29491. tied from each other using a smooth curve. The x-axis represents the pixel
  29492. values from the input frame, and the y-axis the new pixel values to be set for
  29493. the output frame.
  29494. </p>
  29495. <p>By default, a component curve is defined by the two points <var>(0;0)</var> and
  29496. <var>(1;1)</var>. This creates a straight line where each original pixel value is
  29497. &quot;adjusted&quot; to its own value, which means no change to the image.
  29498. </p>
  29499. <p>The filter allows you to redefine these two points and add some more. A new
  29500. curve (using a natural cubic spline interpolation) will be define to pass
  29501. smoothly through all these new coordinates. The new defined points needs to be
  29502. strictly increasing over the x-axis, and their <var>x</var> and <var>y</var> values must
  29503. be in the <var>[0;1]</var> interval. If the computed curves happened to go outside
  29504. the vector spaces, the values will be clipped accordingly.
  29505. </p>
  29506. <p>The filter accepts the following options:
  29507. </p>
  29508. <dl compact="compact">
  29509. <dt>&lsquo;<samp>preset</samp>&rsquo;</dt>
  29510. <dd><p>Select one of the available color presets. This option can be used in addition
  29511. to the &lsquo;<samp>r</samp>&rsquo;, &lsquo;<samp>g</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; parameters; in this case, the later
  29512. options takes priority on the preset values.
  29513. Available presets are:
  29514. </p><dl compact="compact">
  29515. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  29516. <dt>&lsquo;<samp>color_negative</samp>&rsquo;</dt>
  29517. <dt>&lsquo;<samp>cross_process</samp>&rsquo;</dt>
  29518. <dt>&lsquo;<samp>darker</samp>&rsquo;</dt>
  29519. <dt>&lsquo;<samp>increase_contrast</samp>&rsquo;</dt>
  29520. <dt>&lsquo;<samp>lighter</samp>&rsquo;</dt>
  29521. <dt>&lsquo;<samp>linear_contrast</samp>&rsquo;</dt>
  29522. <dt>&lsquo;<samp>medium_contrast</samp>&rsquo;</dt>
  29523. <dt>&lsquo;<samp>negative</samp>&rsquo;</dt>
  29524. <dt>&lsquo;<samp>strong_contrast</samp>&rsquo;</dt>
  29525. <dt>&lsquo;<samp>vintage</samp>&rsquo;</dt>
  29526. </dl>
  29527. <p>Default is <code>none</code>.
  29528. </p></dd>
  29529. <dt>&lsquo;<samp>master, m</samp>&rsquo;</dt>
  29530. <dd><p>Set the master key points. These points will define a second pass mapping. It
  29531. is sometimes called a &quot;luminance&quot; or &quot;value&quot; mapping. It can be used with
  29532. &lsquo;<samp>r</samp>&rsquo;, &lsquo;<samp>g</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; or &lsquo;<samp>all</samp>&rsquo; since it acts like a
  29533. post-processing LUT.
  29534. </p></dd>
  29535. <dt>&lsquo;<samp>red, r</samp>&rsquo;</dt>
  29536. <dd><p>Set the key points for the red component.
  29537. </p></dd>
  29538. <dt>&lsquo;<samp>green, g</samp>&rsquo;</dt>
  29539. <dd><p>Set the key points for the green component.
  29540. </p></dd>
  29541. <dt>&lsquo;<samp>blue, b</samp>&rsquo;</dt>
  29542. <dd><p>Set the key points for the blue component.
  29543. </p></dd>
  29544. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  29545. <dd><p>Set the key points for all components (not including master).
  29546. Can be used in addition to the other key points component
  29547. options. In this case, the unset component(s) will fallback on this
  29548. &lsquo;<samp>all</samp>&rsquo; setting.
  29549. </p></dd>
  29550. <dt>&lsquo;<samp>psfile</samp>&rsquo;</dt>
  29551. <dd><p>Specify a Photoshop curves file (<code>.acv</code>) to import the settings from.
  29552. </p></dd>
  29553. <dt>&lsquo;<samp>plot</samp>&rsquo;</dt>
  29554. <dd><p>Save Gnuplot script of the curves in specified file.
  29555. </p></dd>
  29556. </dl>
  29557. <p>To avoid some filtergraph syntax conflicts, each key points list need to be
  29558. defined using the following syntax: <code>x0/y0 x1/y1 x2/y2 ...</code>.
  29559. </p>
  29560. <a name="Examples-163"></a>
  29561. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-163">39.38.1 Examples</a></h3>
  29562. <ul>
  29563. <li>
  29564. Increase slightly the middle level of blue:
  29565. <div class="example">
  29566. <pre class="example">curves=blue='0/0 0.5/0.58 1/1'
  29567. </pre></div>
  29568. </li><li>
  29569. Vintage effect:
  29570. <div class="example">
  29571. <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'
  29572. </pre></div>
  29573. <p>Here we obtain the following coordinates for each components:
  29574. </p><dl compact="compact">
  29575. <dt><var>red</var></dt>
  29576. <dd><p><code>(0;0.11) (0.42;0.51) (1;0.95)</code>
  29577. </p></dd>
  29578. <dt><var>green</var></dt>
  29579. <dd><p><code>(0;0) (0.50;0.48) (1;1)</code>
  29580. </p></dd>
  29581. <dt><var>blue</var></dt>
  29582. <dd><p><code>(0;0.22) (0.49;0.44) (1;0.80)</code>
  29583. </p></dd>
  29584. </dl>
  29585. </li><li>
  29586. The previous example can also be achieved with the associated built-in preset:
  29587. <div class="example">
  29588. <pre class="example">curves=preset=vintage
  29589. </pre></div>
  29590. </li><li>
  29591. Or simply:
  29592. <div class="example">
  29593. <pre class="example">curves=vintage
  29594. </pre></div>
  29595. </li><li>
  29596. Use a Photoshop preset and redefine the points of the green component:
  29597. <div class="example">
  29598. <pre class="example">curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1'
  29599. </pre></div>
  29600. </li><li>
  29601. Check out the curves of the <code>cross_process</code> profile using <code>ffmpeg</code>
  29602. and <code>gnuplot</code>:
  29603. <div class="example">
  29604. <pre class="example">ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null -
  29605. gnuplot -p /tmp/curves.plt
  29606. </pre></div>
  29607. </li></ul>
  29608. <a name="datascope"></a>
  29609. <h2 class="section"><a href="ffmpeg-all.html#toc-datascope">39.39 datascope</a></h2>
  29610. <p>Video data analysis filter.
  29611. </p>
  29612. <p>This filter shows hexadecimal pixel values of part of video.
  29613. </p>
  29614. <p>The filter accepts the following options:
  29615. </p>
  29616. <dl compact="compact">
  29617. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  29618. <dd><p>Set output video size.
  29619. </p>
  29620. </dd>
  29621. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  29622. <dd><p>Set x offset from where to pick pixels.
  29623. </p>
  29624. </dd>
  29625. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  29626. <dd><p>Set y offset from where to pick pixels.
  29627. </p>
  29628. </dd>
  29629. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  29630. <dd><p>Set scope mode, can be one of the following:
  29631. </p><dl compact="compact">
  29632. <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
  29633. <dd><p>Draw hexadecimal pixel values with white color on black background.
  29634. </p>
  29635. </dd>
  29636. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  29637. <dd><p>Draw hexadecimal pixel values with input video pixel color on black
  29638. background.
  29639. </p>
  29640. </dd>
  29641. <dt>&lsquo;<samp>color2</samp>&rsquo;</dt>
  29642. <dd><p>Draw hexadecimal pixel values on color background picked from input video,
  29643. the text color is picked in such way so its always visible.
  29644. </p></dd>
  29645. </dl>
  29646. </dd>
  29647. <dt>&lsquo;<samp>axis</samp>&rsquo;</dt>
  29648. <dd><p>Draw rows and columns numbers on left and top of video.
  29649. </p>
  29650. </dd>
  29651. <dt>&lsquo;<samp>opacity</samp>&rsquo;</dt>
  29652. <dd><p>Set background opacity.
  29653. </p>
  29654. </dd>
  29655. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  29656. <dd><p>Set display number format. Can be <code>hex</code>, or <code>dec</code>. Default is <code>hex</code>.
  29657. </p></dd>
  29658. </dl>
  29659. <a name="dblur"></a>
  29660. <h2 class="section"><a href="ffmpeg-all.html#toc-dblur">39.40 dblur</a></h2>
  29661. <p>Apply Directional blur filter.
  29662. </p>
  29663. <p>The filter accepts the following options:
  29664. </p>
  29665. <dl compact="compact">
  29666. <dt>&lsquo;<samp>angle</samp>&rsquo;</dt>
  29667. <dd><p>Set angle of directional blur. Default is <code>45</code>.
  29668. </p>
  29669. </dd>
  29670. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  29671. <dd><p>Set radius of directional blur. Default is <code>5</code>.
  29672. </p>
  29673. </dd>
  29674. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  29675. <dd><p>Set which planes to filter. By default all planes are filtered.
  29676. </p></dd>
  29677. </dl>
  29678. <a name="Commands-34"></a>
  29679. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-34">39.40.1 Commands</a></h3>
  29680. <p>This filter supports same <a href="#commands">commands</a> as options.
  29681. The command accepts the same syntax of the corresponding option.
  29682. </p>
  29683. <p>If the specified expression is not valid, it is kept at its current
  29684. value.
  29685. </p>
  29686. <a name="dctdnoiz"></a>
  29687. <h2 class="section"><a href="ffmpeg-all.html#toc-dctdnoiz">39.41 dctdnoiz</a></h2>
  29688. <p>Denoise frames using 2D DCT (frequency domain filtering).
  29689. </p>
  29690. <p>This filter is not designed for real time.
  29691. </p>
  29692. <p>The filter accepts the following options:
  29693. </p>
  29694. <dl compact="compact">
  29695. <dt>&lsquo;<samp>sigma, s</samp>&rsquo;</dt>
  29696. <dd><p>Set the noise sigma constant.
  29697. </p>
  29698. <p>This <var>sigma</var> defines a hard threshold of <code>3 * sigma</code>; every DCT
  29699. coefficient (absolute value) below this threshold with be dropped.
  29700. </p>
  29701. <p>If you need a more advanced filtering, see &lsquo;<samp>expr</samp>&rsquo;.
  29702. </p>
  29703. <p>Default is <code>0</code>.
  29704. </p>
  29705. </dd>
  29706. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  29707. <dd><p>Set number overlapping pixels for each block. Since the filter can be slow, you
  29708. may want to reduce this value, at the cost of a less effective filter and the
  29709. risk of various artefacts.
  29710. </p>
  29711. <p>If the overlapping value doesn&rsquo;t permit processing the whole input width or
  29712. height, a warning will be displayed and according borders won&rsquo;t be denoised.
  29713. </p>
  29714. <p>Default value is <var>blocksize</var>-1, which is the best possible setting.
  29715. </p>
  29716. </dd>
  29717. <dt>&lsquo;<samp>expr, e</samp>&rsquo;</dt>
  29718. <dd><p>Set the coefficient factor expression.
  29719. </p>
  29720. <p>For each coefficient of a DCT block, this expression will be evaluated as a
  29721. multiplier value for the coefficient.
  29722. </p>
  29723. <p>If this is option is set, the &lsquo;<samp>sigma</samp>&rsquo; option will be ignored.
  29724. </p>
  29725. <p>The absolute value of the coefficient can be accessed through the <var>c</var>
  29726. variable.
  29727. </p>
  29728. </dd>
  29729. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  29730. <dd><p>Set the <var>blocksize</var> using the number of bits. <code>1&lt;&lt;<var>n</var></code> defines the
  29731. <var>blocksize</var>, which is the width and height of the processed blocks.
  29732. </p>
  29733. <p>The default value is <var>3</var> (8x8) and can be raised to <var>4</var> for a
  29734. <var>blocksize</var> of 16x16. Note that changing this setting has huge consequences
  29735. on the speed processing. Also, a larger block size does not necessarily means a
  29736. better de-noising.
  29737. </p></dd>
  29738. </dl>
  29739. <a name="Examples-183"></a>
  29740. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-183">39.41.1 Examples</a></h3>
  29741. <p>Apply a denoise with a &lsquo;<samp>sigma</samp>&rsquo; of <code>4.5</code>:
  29742. </p><div class="example">
  29743. <pre class="example">dctdnoiz=4.5
  29744. </pre></div>
  29745. <p>The same operation can be achieved using the expression system:
  29746. </p><div class="example">
  29747. <pre class="example">dctdnoiz=e='gte(c, 4.5*3)'
  29748. </pre></div>
  29749. <p>Violent denoise using a block size of <code>16x16</code>:
  29750. </p><div class="example">
  29751. <pre class="example">dctdnoiz=15:n=4
  29752. </pre></div>
  29753. <a name="deband"></a>
  29754. <h2 class="section"><a href="ffmpeg-all.html#toc-deband">39.42 deband</a></h2>
  29755. <p>Remove banding artifacts from input video.
  29756. It works by replacing banded pixels with average value of referenced pixels.
  29757. </p>
  29758. <p>The filter accepts the following options:
  29759. </p>
  29760. <dl compact="compact">
  29761. <dt>&lsquo;<samp>1thr</samp>&rsquo;</dt>
  29762. <dt>&lsquo;<samp>2thr</samp>&rsquo;</dt>
  29763. <dt>&lsquo;<samp>3thr</samp>&rsquo;</dt>
  29764. <dt>&lsquo;<samp>4thr</samp>&rsquo;</dt>
  29765. <dd><p>Set banding detection threshold for each plane. Default is 0.02.
  29766. Valid range is 0.00003 to 0.5.
  29767. If difference between current pixel and reference pixel is less than threshold,
  29768. it will be considered as banded.
  29769. </p>
  29770. </dd>
  29771. <dt>&lsquo;<samp>range, r</samp>&rsquo;</dt>
  29772. <dd><p>Banding detection range in pixels. Default is 16. If positive, random number
  29773. in range 0 to set value will be used. If negative, exact absolute value
  29774. will be used.
  29775. The range defines square of four pixels around current pixel.
  29776. </p>
  29777. </dd>
  29778. <dt>&lsquo;<samp>direction, d</samp>&rsquo;</dt>
  29779. <dd><p>Set direction in radians from which four pixel will be compared. If positive,
  29780. random direction from 0 to set direction will be picked. If negative, exact of
  29781. absolute value will be picked. For example direction 0, -PI or -2*PI radians
  29782. will pick only pixels on same row and -PI/2 will pick only pixels on same
  29783. column.
  29784. </p>
  29785. </dd>
  29786. <dt>&lsquo;<samp>blur, b</samp>&rsquo;</dt>
  29787. <dd><p>If enabled, current pixel is compared with average value of all four
  29788. surrounding pixels. The default is enabled. If disabled current pixel is
  29789. compared with all four surrounding pixels. The pixel is considered banded
  29790. if only all four differences with surrounding pixels are less than threshold.
  29791. </p>
  29792. </dd>
  29793. <dt>&lsquo;<samp>coupling, c</samp>&rsquo;</dt>
  29794. <dd><p>If enabled, current pixel is changed if and only if all pixel components are banded,
  29795. e.g. banding detection threshold is triggered for all color components.
  29796. The default is disabled.
  29797. </p></dd>
  29798. </dl>
  29799. <a name="deblock"></a>
  29800. <h2 class="section"><a href="ffmpeg-all.html#toc-deblock">39.43 deblock</a></h2>
  29801. <p>Remove blocking artifacts from input video.
  29802. </p>
  29803. <p>The filter accepts the following options:
  29804. </p>
  29805. <dl compact="compact">
  29806. <dt>&lsquo;<samp>filter</samp>&rsquo;</dt>
  29807. <dd><p>Set filter type, can be <var>weak</var> or <var>strong</var>. Default is <var>strong</var>.
  29808. This controls what kind of deblocking is applied.
  29809. </p>
  29810. </dd>
  29811. <dt>&lsquo;<samp>block</samp>&rsquo;</dt>
  29812. <dd><p>Set size of block, allowed range is from 4 to 512. Default is <var>8</var>.
  29813. </p>
  29814. </dd>
  29815. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  29816. <dt>&lsquo;<samp>beta</samp>&rsquo;</dt>
  29817. <dt>&lsquo;<samp>gamma</samp>&rsquo;</dt>
  29818. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  29819. <dd><p>Set blocking detection thresholds. Allowed range is 0 to 1.
  29820. Defaults are: <var>0.098</var> for <var>alpha</var> and <var>0.05</var> for the rest.
  29821. Using higher threshold gives more deblocking strength.
  29822. Setting <var>alpha</var> controls threshold detection at exact edge of block.
  29823. Remaining options controls threshold detection near the edge. Each one for
  29824. below/above or left/right. Setting any of those to <var>0</var> disables
  29825. deblocking.
  29826. </p>
  29827. </dd>
  29828. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  29829. <dd><p>Set planes to filter. Default is to filter all available planes.
  29830. </p></dd>
  29831. </dl>
  29832. <a name="Examples-42"></a>
  29833. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-42">39.43.1 Examples</a></h3>
  29834. <ul>
  29835. <li>
  29836. Deblock using weak filter and block size of 4 pixels.
  29837. <div class="example">
  29838. <pre class="example">deblock=filter=weak:block=4
  29839. </pre></div>
  29840. </li><li>
  29841. Deblock using strong filter, block size of 4 pixels and custom thresholds for
  29842. deblocking more edges.
  29843. <div class="example">
  29844. <pre class="example">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05
  29845. </pre></div>
  29846. </li><li>
  29847. Similar as above, but filter only first plane.
  29848. <div class="example">
  29849. <pre class="example">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1
  29850. </pre></div>
  29851. </li><li>
  29852. Similar as above, but filter only second and third plane.
  29853. <div class="example">
  29854. <pre class="example">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6
  29855. </pre></div>
  29856. </li></ul>
  29857. <p><a name="decimate"></a>
  29858. </p><a name="decimate-1"></a>
  29859. <h2 class="section"><a href="ffmpeg-all.html#toc-decimate-1">39.44 decimate</a></h2>
  29860. <p>Drop duplicated frames at regular intervals.
  29861. </p>
  29862. <p>The filter accepts the following options:
  29863. </p>
  29864. <dl compact="compact">
  29865. <dt>&lsquo;<samp>cycle</samp>&rsquo;</dt>
  29866. <dd><p>Set the number of frames from which one will be dropped. Setting this to
  29867. <var>N</var> means one frame in every batch of <var>N</var> frames will be dropped.
  29868. Default is <code>5</code>.
  29869. </p>
  29870. </dd>
  29871. <dt>&lsquo;<samp>dupthresh</samp>&rsquo;</dt>
  29872. <dd><p>Set the threshold for duplicate detection. If the difference metric for a frame
  29873. is less than or equal to this value, then it is declared as duplicate. Default
  29874. is <code>1.1</code>
  29875. </p>
  29876. </dd>
  29877. <dt>&lsquo;<samp>scthresh</samp>&rsquo;</dt>
  29878. <dd><p>Set scene change threshold. Default is <code>15</code>.
  29879. </p>
  29880. </dd>
  29881. <dt>&lsquo;<samp>blockx</samp>&rsquo;</dt>
  29882. <dt>&lsquo;<samp>blocky</samp>&rsquo;</dt>
  29883. <dd><p>Set the size of the x and y-axis blocks used during metric calculations.
  29884. Larger blocks give better noise suppression, but also give worse detection of
  29885. small movements. Must be a power of two. Default is <code>32</code>.
  29886. </p>
  29887. </dd>
  29888. <dt>&lsquo;<samp>ppsrc</samp>&rsquo;</dt>
  29889. <dd><p>Mark main input as a pre-processed input and activate clean source input
  29890. stream. This allows the input to be pre-processed with various filters to help
  29891. the metrics calculation while keeping the frame selection lossless. When set to
  29892. <code>1</code>, the first stream is for the pre-processed input, and the second
  29893. stream is the clean source from where the kept frames are chosen. Default is
  29894. <code>0</code>.
  29895. </p>
  29896. </dd>
  29897. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  29898. <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
  29899. <code>1</code>.
  29900. </p></dd>
  29901. </dl>
  29902. <a name="deconvolve"></a>
  29903. <h2 class="section"><a href="ffmpeg-all.html#toc-deconvolve">39.45 deconvolve</a></h2>
  29904. <p>Apply 2D deconvolution of video stream in frequency domain using second stream
  29905. as impulse.
  29906. </p>
  29907. <p>The filter accepts the following options:
  29908. </p>
  29909. <dl compact="compact">
  29910. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  29911. <dd><p>Set which planes to process.
  29912. </p>
  29913. </dd>
  29914. <dt>&lsquo;<samp>impulse</samp>&rsquo;</dt>
  29915. <dd><p>Set which impulse video frames will be processed, can be <var>first</var>
  29916. or <var>all</var>. Default is <var>all</var>.
  29917. </p>
  29918. </dd>
  29919. <dt>&lsquo;<samp>noise</samp>&rsquo;</dt>
  29920. <dd><p>Set noise when doing divisions. Default is <var>0.0000001</var>. Useful when width
  29921. and height are not same and not power of 2 or if stream prior to convolving
  29922. had noise.
  29923. </p></dd>
  29924. </dl>
  29925. <p>The <code>deconvolve</code> filter also supports the <a href="#framesync">framesync</a> options.
  29926. </p>
  29927. <a name="dedot"></a>
  29928. <h2 class="section"><a href="ffmpeg-all.html#toc-dedot">39.46 dedot</a></h2>
  29929. <p>Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video.
  29930. </p>
  29931. <p>It accepts the following options:
  29932. </p>
  29933. <dl compact="compact">
  29934. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  29935. <dd><p>Set mode of operation. Can be combination of <var>dotcrawl</var> for cross-luminance reduction and/or
  29936. <var>rainbows</var> for cross-color reduction.
  29937. </p>
  29938. </dd>
  29939. <dt>&lsquo;<samp>lt</samp>&rsquo;</dt>
  29940. <dd><p>Set spatial luma threshold. Lower values increases reduction of cross-luminance.
  29941. </p>
  29942. </dd>
  29943. <dt>&lsquo;<samp>tl</samp>&rsquo;</dt>
  29944. <dd><p>Set tolerance for temporal luma. Higher values increases reduction of cross-luminance.
  29945. </p>
  29946. </dd>
  29947. <dt>&lsquo;<samp>tc</samp>&rsquo;</dt>
  29948. <dd><p>Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color.
  29949. </p>
  29950. </dd>
  29951. <dt>&lsquo;<samp>ct</samp>&rsquo;</dt>
  29952. <dd><p>Set temporal chroma threshold. Lower values increases reduction of cross-color.
  29953. </p></dd>
  29954. </dl>
  29955. <a name="deflate"></a>
  29956. <h2 class="section"><a href="ffmpeg-all.html#toc-deflate">39.47 deflate</a></h2>
  29957. <p>Apply deflate effect to the video.
  29958. </p>
  29959. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  29960. only values lower than the pixel.
  29961. </p>
  29962. <p>It accepts the following options:
  29963. </p>
  29964. <dl compact="compact">
  29965. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  29966. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  29967. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  29968. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  29969. <dd><p>Limit the maximum change for each plane, default is 65535.
  29970. If 0, plane will remain unchanged.
  29971. </p></dd>
  29972. </dl>
  29973. <a name="Commands-69"></a>
  29974. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-69">39.47.1 Commands</a></h3>
  29975. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  29976. </p>
  29977. <a name="deflicker"></a>
  29978. <h2 class="section"><a href="ffmpeg-all.html#toc-deflicker">39.48 deflicker</a></h2>
  29979. <p>Remove temporal frame luminance variations.
  29980. </p>
  29981. <p>It accepts the following options:
  29982. </p>
  29983. <dl compact="compact">
  29984. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  29985. <dd><p>Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129.
  29986. </p>
  29987. </dd>
  29988. <dt>&lsquo;<samp>mode, m</samp>&rsquo;</dt>
  29989. <dd><p>Set averaging mode to smooth temporal luminance variations.
  29990. </p>
  29991. <p>Available values are:
  29992. </p><dl compact="compact">
  29993. <dt>&lsquo;<samp>am</samp>&rsquo;</dt>
  29994. <dd><p>Arithmetic mean
  29995. </p>
  29996. </dd>
  29997. <dt>&lsquo;<samp>gm</samp>&rsquo;</dt>
  29998. <dd><p>Geometric mean
  29999. </p>
  30000. </dd>
  30001. <dt>&lsquo;<samp>hm</samp>&rsquo;</dt>
  30002. <dd><p>Harmonic mean
  30003. </p>
  30004. </dd>
  30005. <dt>&lsquo;<samp>qm</samp>&rsquo;</dt>
  30006. <dd><p>Quadratic mean
  30007. </p>
  30008. </dd>
  30009. <dt>&lsquo;<samp>cm</samp>&rsquo;</dt>
  30010. <dd><p>Cubic mean
  30011. </p>
  30012. </dd>
  30013. <dt>&lsquo;<samp>pm</samp>&rsquo;</dt>
  30014. <dd><p>Power mean
  30015. </p>
  30016. </dd>
  30017. <dt>&lsquo;<samp>median</samp>&rsquo;</dt>
  30018. <dd><p>Median
  30019. </p></dd>
  30020. </dl>
  30021. </dd>
  30022. <dt>&lsquo;<samp>bypass</samp>&rsquo;</dt>
  30023. <dd><p>Do not actually modify frame. Useful when one only wants metadata.
  30024. </p></dd>
  30025. </dl>
  30026. <a name="dejudder"></a>
  30027. <h2 class="section"><a href="ffmpeg-all.html#toc-dejudder">39.49 dejudder</a></h2>
  30028. <p>Remove judder produced by partially interlaced telecined content.
  30029. </p>
  30030. <p>Judder can be introduced, for instance, by <a href="#pullup">pullup</a> filter. If the original
  30031. source was partially telecined content then the output of <code>pullup,dejudder</code>
  30032. will have a variable frame rate. May change the recorded frame rate of the
  30033. container. Aside from that change, this filter will not affect constant frame
  30034. rate video.
  30035. </p>
  30036. <p>The option available in this filter is:
  30037. </p><dl compact="compact">
  30038. <dt>&lsquo;<samp>cycle</samp>&rsquo;</dt>
  30039. <dd><p>Specify the length of the window over which the judder repeats.
  30040. </p>
  30041. <p>Accepts any integer greater than 1. Useful values are:
  30042. </p><dl compact="compact">
  30043. <dt>&lsquo;<samp>4</samp>&rsquo;</dt>
  30044. <dd><p>If the original was telecined from 24 to 30 fps (Film to NTSC).
  30045. </p>
  30046. </dd>
  30047. <dt>&lsquo;<samp>5</samp>&rsquo;</dt>
  30048. <dd><p>If the original was telecined from 25 to 30 fps (PAL to NTSC).
  30049. </p>
  30050. </dd>
  30051. <dt>&lsquo;<samp>20</samp>&rsquo;</dt>
  30052. <dd><p>If a mixture of the two.
  30053. </p></dd>
  30054. </dl>
  30055. <p>The default is &lsquo;<samp>4</samp>&rsquo;.
  30056. </p></dd>
  30057. </dl>
  30058. <a name="delogo"></a>
  30059. <h2 class="section"><a href="ffmpeg-all.html#toc-delogo">39.50 delogo</a></h2>
  30060. <p>Suppress a TV station logo by a simple interpolation of the surrounding
  30061. pixels. Just set a rectangle covering the logo and watch it disappear
  30062. (and sometimes something even uglier appear - your mileage may vary).
  30063. </p>
  30064. <p>It accepts the following parameters:
  30065. </p><dl compact="compact">
  30066. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  30067. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  30068. <dd><p>Specify the top left corner coordinates of the logo. They must be
  30069. specified.
  30070. </p>
  30071. </dd>
  30072. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  30073. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  30074. <dd><p>Specify the width and height of the logo to clear. They must be
  30075. specified.
  30076. </p>
  30077. </dd>
  30078. <dt>&lsquo;<samp>band, t</samp>&rsquo;</dt>
  30079. <dd><p>Specify the thickness of the fuzzy edge of the rectangle (added to
  30080. <var>w</var> and <var>h</var>). The default value is 1. This option is
  30081. deprecated, setting higher values should no longer be necessary and
  30082. is not recommended.
  30083. </p>
  30084. </dd>
  30085. <dt>&lsquo;<samp>show</samp>&rsquo;</dt>
  30086. <dd><p>When set to 1, a green rectangle is drawn on the screen to simplify
  30087. finding the right <var>x</var>, <var>y</var>, <var>w</var>, and <var>h</var> parameters.
  30088. The default value is 0.
  30089. </p>
  30090. <p>The rectangle is drawn on the outermost pixels which will be (partly)
  30091. replaced with interpolated values. The values of the next pixels
  30092. immediately outside this rectangle in each direction will be used to
  30093. compute the interpolated pixel values inside the rectangle.
  30094. </p>
  30095. </dd>
  30096. </dl>
  30097. <a name="Examples-69"></a>
  30098. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-69">39.50.1 Examples</a></h3>
  30099. <ul>
  30100. <li>
  30101. Set a rectangle covering the area with top left corner coordinates 0,0
  30102. and size 100x77, and a band of size 10:
  30103. <div class="example">
  30104. <pre class="example">delogo=x=0:y=0:w=100:h=77:band=10
  30105. </pre></div>
  30106. </li></ul>
  30107. <p><a name="derain"></a>
  30108. </p><a name="derain-1"></a>
  30109. <h2 class="section"><a href="ffmpeg-all.html#toc-derain-1">39.51 derain</a></h2>
  30110. <p>Remove the rain in the input image/video by applying the derain methods based on
  30111. convolutional neural networks. Supported models:
  30112. </p>
  30113. <ul>
  30114. <li>
  30115. Recurrent Squeeze-and-Excitation Context Aggregation Net (RESCAN).
  30116. 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>.
  30117. </li></ul>
  30118. <p>Training as well as model generation scripts are provided in
  30119. the repository at <a href="https://github.com/XueweiMeng/derain_filter.git">https://github.com/XueweiMeng/derain_filter.git</a>.
  30120. </p>
  30121. <p>Native model files (.model) can be generated from TensorFlow model
  30122. files (.pb) by using tools/python/convert.py
  30123. </p>
  30124. <p>The filter accepts the following options:
  30125. </p>
  30126. <dl compact="compact">
  30127. <dt>&lsquo;<samp>filter_type</samp>&rsquo;</dt>
  30128. <dd><p>Specify which filter to use. This option accepts the following values:
  30129. </p>
  30130. <dl compact="compact">
  30131. <dt>&lsquo;<samp>derain</samp>&rsquo;</dt>
  30132. <dd><p>Derain filter. To conduct derain filter, you need to use a derain model.
  30133. </p>
  30134. </dd>
  30135. <dt>&lsquo;<samp>dehaze</samp>&rsquo;</dt>
  30136. <dd><p>Dehaze filter. To conduct dehaze filter, you need to use a dehaze model.
  30137. </p></dd>
  30138. </dl>
  30139. <p>Default value is &lsquo;<samp>derain</samp>&rsquo;.
  30140. </p>
  30141. </dd>
  30142. <dt>&lsquo;<samp>dnn_backend</samp>&rsquo;</dt>
  30143. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  30144. the following values:
  30145. </p>
  30146. <dl compact="compact">
  30147. <dt>&lsquo;<samp>native</samp>&rsquo;</dt>
  30148. <dd><p>Native implementation of DNN loading and execution.
  30149. </p>
  30150. </dd>
  30151. <dt>&lsquo;<samp>tensorflow</samp>&rsquo;</dt>
  30152. <dd><p>TensorFlow backend. To enable this backend you
  30153. need to install the TensorFlow for C library (see
  30154. <a href="https://www.tensorflow.org/install/install_c">https://www.tensorflow.org/install/install_c</a>) and configure FFmpeg with
  30155. <code>--enable-libtensorflow</code>
  30156. </p></dd>
  30157. </dl>
  30158. <p>Default value is &lsquo;<samp>native</samp>&rsquo;.
  30159. </p>
  30160. </dd>
  30161. <dt>&lsquo;<samp>model</samp>&rsquo;</dt>
  30162. <dd><p>Set path to model file specifying network architecture and its parameters.
  30163. Note that different backends use different file formats. TensorFlow and native
  30164. backend can load files for only its format.
  30165. </p></dd>
  30166. </dl>
  30167. <p>It can also be finished with <a href="#dnn_005fprocessing">dnn_processing</a> filter.
  30168. </p>
  30169. <a name="deshake"></a>
  30170. <h2 class="section"><a href="ffmpeg-all.html#toc-deshake">39.52 deshake</a></h2>
  30171. <p>Attempt to fix small changes in horizontal and/or vertical shift. This
  30172. filter helps remove camera shake from hand-holding a camera, bumping a
  30173. tripod, moving on a vehicle, etc.
  30174. </p>
  30175. <p>The filter accepts the following options:
  30176. </p>
  30177. <dl compact="compact">
  30178. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  30179. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  30180. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  30181. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  30182. <dd><p>Specify a rectangular area where to limit the search for motion
  30183. vectors.
  30184. If desired the search for motion vectors can be limited to a
  30185. rectangular area of the frame defined by its top left corner, width
  30186. and height. These parameters have the same meaning as the drawbox
  30187. filter which can be used to visualise the position of the bounding
  30188. box.
  30189. </p>
  30190. <p>This is useful when simultaneous movement of subjects within the frame
  30191. might be confused for camera motion by the motion vector search.
  30192. </p>
  30193. <p>If any or all of <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> are set to -1
  30194. then the full frame is used. This allows later options to be set
  30195. without specifying the bounding box for the motion vector search.
  30196. </p>
  30197. <p>Default - search the whole frame.
  30198. </p>
  30199. </dd>
  30200. <dt>&lsquo;<samp>rx</samp>&rsquo;</dt>
  30201. <dt>&lsquo;<samp>ry</samp>&rsquo;</dt>
  30202. <dd><p>Specify the maximum extent of movement in x and y directions in the
  30203. range 0-64 pixels. Default 16.
  30204. </p>
  30205. </dd>
  30206. <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
  30207. <dd><p>Specify how to generate pixels to fill blanks at the edge of the
  30208. frame. Available values are:
  30209. </p><dl compact="compact">
  30210. <dt>&lsquo;<samp>blank, 0</samp>&rsquo;</dt>
  30211. <dd><p>Fill zeroes at blank locations
  30212. </p></dd>
  30213. <dt>&lsquo;<samp>original, 1</samp>&rsquo;</dt>
  30214. <dd><p>Original image at blank locations
  30215. </p></dd>
  30216. <dt>&lsquo;<samp>clamp, 2</samp>&rsquo;</dt>
  30217. <dd><p>Extruded edge value at blank locations
  30218. </p></dd>
  30219. <dt>&lsquo;<samp>mirror, 3</samp>&rsquo;</dt>
  30220. <dd><p>Mirrored edge at blank locations
  30221. </p></dd>
  30222. </dl>
  30223. <p>Default value is &lsquo;<samp>mirror</samp>&rsquo;.
  30224. </p>
  30225. </dd>
  30226. <dt>&lsquo;<samp>blocksize</samp>&rsquo;</dt>
  30227. <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
  30228. default 8.
  30229. </p>
  30230. </dd>
  30231. <dt>&lsquo;<samp>contrast</samp>&rsquo;</dt>
  30232. <dd><p>Specify the contrast threshold for blocks. Only blocks with more than
  30233. the specified contrast (difference between darkest and lightest
  30234. pixels) will be considered. Range 1-255, default 125.
  30235. </p>
  30236. </dd>
  30237. <dt>&lsquo;<samp>search</samp>&rsquo;</dt>
  30238. <dd><p>Specify the search strategy. Available values are:
  30239. </p><dl compact="compact">
  30240. <dt>&lsquo;<samp>exhaustive, 0</samp>&rsquo;</dt>
  30241. <dd><p>Set exhaustive search
  30242. </p></dd>
  30243. <dt>&lsquo;<samp>less, 1</samp>&rsquo;</dt>
  30244. <dd><p>Set less exhaustive search.
  30245. </p></dd>
  30246. </dl>
  30247. <p>Default value is &lsquo;<samp>exhaustive</samp>&rsquo;.
  30248. </p>
  30249. </dd>
  30250. <dt>&lsquo;<samp>filename</samp>&rsquo;</dt>
  30251. <dd><p>If set then a detailed log of the motion search is written to the
  30252. specified file.
  30253. </p>
  30254. </dd>
  30255. </dl>
  30256. <a name="despill"></a>
  30257. <h2 class="section"><a href="ffmpeg-all.html#toc-despill">39.53 despill</a></h2>
  30258. <p>Remove unwanted contamination of foreground colors, caused by reflected color of
  30259. greenscreen or bluescreen.
  30260. </p>
  30261. <p>This filter accepts the following options:
  30262. </p>
  30263. <dl compact="compact">
  30264. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  30265. <dd><p>Set what type of despill to use.
  30266. </p>
  30267. </dd>
  30268. <dt>&lsquo;<samp>mix</samp>&rsquo;</dt>
  30269. <dd><p>Set how spillmap will be generated.
  30270. </p>
  30271. </dd>
  30272. <dt>&lsquo;<samp>expand</samp>&rsquo;</dt>
  30273. <dd><p>Set how much to get rid of still remaining spill.
  30274. </p>
  30275. </dd>
  30276. <dt>&lsquo;<samp>red</samp>&rsquo;</dt>
  30277. <dd><p>Controls amount of red in spill area.
  30278. </p>
  30279. </dd>
  30280. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  30281. <dd><p>Controls amount of green in spill area.
  30282. Should be -1 for greenscreen.
  30283. </p>
  30284. </dd>
  30285. <dt>&lsquo;<samp>blue</samp>&rsquo;</dt>
  30286. <dd><p>Controls amount of blue in spill area.
  30287. Should be -1 for bluescreen.
  30288. </p>
  30289. </dd>
  30290. <dt>&lsquo;<samp>brightness</samp>&rsquo;</dt>
  30291. <dd><p>Controls brightness of spill area, preserving colors.
  30292. </p>
  30293. </dd>
  30294. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  30295. <dd><p>Modify alpha from generated spillmap.
  30296. </p></dd>
  30297. </dl>
  30298. <a name="detelecine"></a>
  30299. <h2 class="section"><a href="ffmpeg-all.html#toc-detelecine">39.54 detelecine</a></h2>
  30300. <p>Apply an exact inverse of the telecine operation. It requires a predefined
  30301. pattern specified using the pattern option which must be the same as that passed
  30302. to the telecine filter.
  30303. </p>
  30304. <p>This filter accepts the following options:
  30305. </p>
  30306. <dl compact="compact">
  30307. <dt>&lsquo;<samp>first_field</samp>&rsquo;</dt>
  30308. <dd><dl compact="compact">
  30309. <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
  30310. <dd><p>top field first
  30311. </p></dd>
  30312. <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
  30313. <dd><p>bottom field first
  30314. The default value is <code>top</code>.
  30315. </p></dd>
  30316. </dl>
  30317. </dd>
  30318. <dt>&lsquo;<samp>pattern</samp>&rsquo;</dt>
  30319. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  30320. The default value is <code>23</code>.
  30321. </p>
  30322. </dd>
  30323. <dt>&lsquo;<samp>start_frame</samp>&rsquo;</dt>
  30324. <dd><p>A number representing position of the first frame with respect to the telecine
  30325. pattern. This is to be used if the stream is cut. The default value is <code>0</code>.
  30326. </p></dd>
  30327. </dl>
  30328. <a name="dilation"></a>
  30329. <h2 class="section"><a href="ffmpeg-all.html#toc-dilation">39.55 dilation</a></h2>
  30330. <p>Apply dilation effect to the video.
  30331. </p>
  30332. <p>This filter replaces the pixel by the local(3x3) maximum.
  30333. </p>
  30334. <p>It accepts the following options:
  30335. </p>
  30336. <dl compact="compact">
  30337. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  30338. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  30339. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  30340. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  30341. <dd><p>Limit the maximum change for each plane, default is 65535.
  30342. If 0, plane will remain unchanged.
  30343. </p>
  30344. </dd>
  30345. <dt>&lsquo;<samp>coordinates</samp>&rsquo;</dt>
  30346. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  30347. pixels are used.
  30348. </p>
  30349. <p>Flags to local 3x3 coordinates maps like this:
  30350. </p>
  30351. <p> 1 2 3
  30352. 4 5
  30353. 6 7 8
  30354. </p></dd>
  30355. </dl>
  30356. <a name="Commands-18"></a>
  30357. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-18">39.55.1 Commands</a></h3>
  30358. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  30359. </p>
  30360. <a name="displace"></a>
  30361. <h2 class="section"><a href="ffmpeg-all.html#toc-displace">39.56 displace</a></h2>
  30362. <p>Displace pixels as indicated by second and third input stream.
  30363. </p>
  30364. <p>It takes three input streams and outputs one stream, the first input is the
  30365. source, and second and third input are displacement maps.
  30366. </p>
  30367. <p>The second input specifies how much to displace pixels along the
  30368. x-axis, while the third input specifies how much to displace pixels
  30369. along the y-axis.
  30370. If one of displacement map streams terminates, last frame from that
  30371. displacement map will be used.
  30372. </p>
  30373. <p>Note that once generated, displacements maps can be reused over and over again.
  30374. </p>
  30375. <p>A description of the accepted options follows.
  30376. </p>
  30377. <dl compact="compact">
  30378. <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
  30379. <dd><p>Set displace behavior for pixels that are out of range.
  30380. </p>
  30381. <p>Available values are:
  30382. </p><dl compact="compact">
  30383. <dt>&lsquo;<samp>blank</samp>&rsquo;</dt>
  30384. <dd><p>Missing pixels are replaced by black pixels.
  30385. </p>
  30386. </dd>
  30387. <dt>&lsquo;<samp>smear</samp>&rsquo;</dt>
  30388. <dd><p>Adjacent pixels will spread out to replace missing pixels.
  30389. </p>
  30390. </dd>
  30391. <dt>&lsquo;<samp>wrap</samp>&rsquo;</dt>
  30392. <dd><p>Out of range pixels are wrapped so they point to pixels of other side.
  30393. </p>
  30394. </dd>
  30395. <dt>&lsquo;<samp>mirror</samp>&rsquo;</dt>
  30396. <dd><p>Out of range pixels will be replaced with mirrored pixels.
  30397. </p></dd>
  30398. </dl>
  30399. <p>Default is &lsquo;<samp>smear</samp>&rsquo;.
  30400. </p>
  30401. </dd>
  30402. </dl>
  30403. <a name="Examples-43"></a>
  30404. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-43">39.56.1 Examples</a></h3>
  30405. <ul>
  30406. <li>
  30407. Add ripple effect to rgb input of video size hd720:
  30408. <div class="example">
  30409. <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
  30410. </pre></div>
  30411. </li><li>
  30412. Add wave effect to rgb input of video size hd720:
  30413. <div class="example">
  30414. <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
  30415. </pre></div>
  30416. </li></ul>
  30417. <p><a name="dnn_005fprocessing"></a>
  30418. </p><a name="dnn_005fprocessing-1"></a>
  30419. <h2 class="section"><a href="ffmpeg-all.html#toc-dnn_005fprocessing-1">39.57 dnn_processing</a></h2>
  30420. <p>Do image processing with deep neural networks. It works together with another filter
  30421. which converts the pixel format of the Frame to what the dnn network requires.
  30422. </p>
  30423. <p>The filter accepts the following options:
  30424. </p>
  30425. <dl compact="compact">
  30426. <dt>&lsquo;<samp>dnn_backend</samp>&rsquo;</dt>
  30427. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  30428. the following values:
  30429. </p>
  30430. <dl compact="compact">
  30431. <dt>&lsquo;<samp>native</samp>&rsquo;</dt>
  30432. <dd><p>Native implementation of DNN loading and execution.
  30433. </p>
  30434. </dd>
  30435. <dt>&lsquo;<samp>tensorflow</samp>&rsquo;</dt>
  30436. <dd><p>TensorFlow backend. To enable this backend you
  30437. need to install the TensorFlow for C library (see
  30438. <a href="https://www.tensorflow.org/install/install_c">https://www.tensorflow.org/install/install_c</a>) and configure FFmpeg with
  30439. <code>--enable-libtensorflow</code>
  30440. </p></dd>
  30441. </dl>
  30442. <p>Default value is &lsquo;<samp>native</samp>&rsquo;.
  30443. </p>
  30444. </dd>
  30445. <dt>&lsquo;<samp>model</samp>&rsquo;</dt>
  30446. <dd><p>Set path to model file specifying network architecture and its parameters.
  30447. Note that different backends use different file formats. TensorFlow and native
  30448. backend can load files for only its format.
  30449. </p>
  30450. <p>Native model file (.model) can be generated from TensorFlow model file (.pb) by using tools/python/convert.py
  30451. </p>
  30452. </dd>
  30453. <dt>&lsquo;<samp>input</samp>&rsquo;</dt>
  30454. <dd><p>Set the input name of the dnn network.
  30455. </p>
  30456. </dd>
  30457. <dt>&lsquo;<samp>output</samp>&rsquo;</dt>
  30458. <dd><p>Set the output name of the dnn network.
  30459. </p>
  30460. </dd>
  30461. </dl>
  30462. <a name="Examples-112"></a>
  30463. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-112">39.57.1 Examples</a></h3>
  30464. <ul>
  30465. <li>
  30466. Remove rain in rgb24 frame with can.pb (see <a href="#derain">derain</a> filter):
  30467. <div class="example">
  30468. <pre class="example">./ffmpeg -i rain.jpg -vf format=rgb24,dnn_processing=dnn_backend=tensorflow:model=can.pb:input=x:output=y derain.jpg
  30469. </pre></div>
  30470. </li><li>
  30471. Halve the pixel value of the frame with format gray32f:
  30472. <div class="example">
  30473. <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
  30474. </pre></div>
  30475. </li><li>
  30476. Handle the Y channel with srcnn.pb (see <a href="#sr">sr</a> filter) for frame with yuv420p (planar YUV formats supported):
  30477. <div class="example">
  30478. <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
  30479. </pre></div>
  30480. </li><li>
  30481. 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):
  30482. <div class="example">
  30483. <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
  30484. </pre></div>
  30485. </li></ul>
  30486. <a name="drawbox"></a>
  30487. <h2 class="section"><a href="ffmpeg-all.html#toc-drawbox">39.58 drawbox</a></h2>
  30488. <p>Draw a colored box on the input image.
  30489. </p>
  30490. <p>It accepts the following parameters:
  30491. </p>
  30492. <dl compact="compact">
  30493. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  30494. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  30495. <dd><p>The expressions which specify the top left corner coordinates of the box. It defaults to 0.
  30496. </p>
  30497. </dd>
  30498. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  30499. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  30500. <dd><p>The expressions which specify the width and height of the box; if 0 they are interpreted as
  30501. the input width and height. It defaults to 0.
  30502. </p>
  30503. </dd>
  30504. <dt>&lsquo;<samp>color, c</samp>&rsquo;</dt>
  30505. <dd><p>Specify the color of the box to write. For the general syntax of this option,
  30506. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>. If the special
  30507. value <code>invert</code> is used, the box edge color is the same as the
  30508. video with inverted luma.
  30509. </p>
  30510. </dd>
  30511. <dt>&lsquo;<samp>thickness, t</samp>&rsquo;</dt>
  30512. <dd><p>The expression which sets the thickness of the box edge.
  30513. A value of <code>fill</code> will create a filled box. Default value is <code>3</code>.
  30514. </p>
  30515. <p>See below for the list of accepted constants.
  30516. </p>
  30517. </dd>
  30518. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  30519. <dd><p>Applicable if the input has alpha. With value <code>1</code>, the pixels of the painted box
  30520. will overwrite the video&rsquo;s color and alpha pixels.
  30521. Default is <code>0</code>, which composites the box onto the input, leaving the video&rsquo;s alpha intact.
  30522. </p></dd>
  30523. </dl>
  30524. <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
  30525. following constants:
  30526. </p>
  30527. <dl compact="compact">
  30528. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  30529. <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
  30530. </p>
  30531. </dd>
  30532. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  30533. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  30534. <dd><p>horizontal and vertical chroma subsample values. For example for the
  30535. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  30536. </p>
  30537. </dd>
  30538. <dt>&lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
  30539. <dt>&lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
  30540. <dd><p>The input width and height.
  30541. </p>
  30542. </dd>
  30543. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  30544. <dd><p>The input sample aspect ratio.
  30545. </p>
  30546. </dd>
  30547. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  30548. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  30549. <dd><p>The x and y offset coordinates where the box is drawn.
  30550. </p>
  30551. </dd>
  30552. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  30553. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  30554. <dd><p>The width and height of the drawn box.
  30555. </p>
  30556. </dd>
  30557. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  30558. <dd><p>The thickness of the drawn box.
  30559. </p>
  30560. <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
  30561. each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
  30562. </p>
  30563. </dd>
  30564. </dl>
  30565. <a name="Examples-153"></a>
  30566. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-153">39.58.1 Examples</a></h3>
  30567. <ul>
  30568. <li>
  30569. Draw a black box around the edge of the input image:
  30570. <div class="example">
  30571. <pre class="example">drawbox
  30572. </pre></div>
  30573. </li><li>
  30574. Draw a box with color red and an opacity of 50%:
  30575. <div class="example">
  30576. <pre class="example">drawbox=10:20:200:60:red@0.5
  30577. </pre></div>
  30578. <p>The previous example can be specified as:
  30579. </p><div class="example">
  30580. <pre class="example">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
  30581. </pre></div>
  30582. </li><li>
  30583. Fill the box with pink color:
  30584. <div class="example">
  30585. <pre class="example">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
  30586. </pre></div>
  30587. </li><li>
  30588. Draw a 2-pixel red 2.40:1 mask:
  30589. <div class="example">
  30590. <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
  30591. </pre></div>
  30592. </li></ul>
  30593. <a name="Commands-33"></a>
  30594. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-33">39.58.2 Commands</a></h3>
  30595. <p>This filter supports same commands as options.
  30596. The command accepts the same syntax of the corresponding option.
  30597. </p>
  30598. <p>If the specified expression is not valid, it is kept at its current
  30599. value.
  30600. </p>
  30601. <p><a name="drawgraph"></a>
  30602. </p><a name="drawgraph-1"></a>
  30603. <h2 class="section"><a href="ffmpeg-all.html#toc-drawgraph-1">39.59 drawgraph</a></h2>
  30604. <p>Draw a graph using input video metadata.
  30605. </p>
  30606. <p>It accepts the following parameters:
  30607. </p>
  30608. <dl compact="compact">
  30609. <dt>&lsquo;<samp>m1</samp>&rsquo;</dt>
  30610. <dd><p>Set 1st frame metadata key from which metadata values will be used to draw a graph.
  30611. </p>
  30612. </dd>
  30613. <dt>&lsquo;<samp>fg1</samp>&rsquo;</dt>
  30614. <dd><p>Set 1st foreground color expression.
  30615. </p>
  30616. </dd>
  30617. <dt>&lsquo;<samp>m2</samp>&rsquo;</dt>
  30618. <dd><p>Set 2nd frame metadata key from which metadata values will be used to draw a graph.
  30619. </p>
  30620. </dd>
  30621. <dt>&lsquo;<samp>fg2</samp>&rsquo;</dt>
  30622. <dd><p>Set 2nd foreground color expression.
  30623. </p>
  30624. </dd>
  30625. <dt>&lsquo;<samp>m3</samp>&rsquo;</dt>
  30626. <dd><p>Set 3rd frame metadata key from which metadata values will be used to draw a graph.
  30627. </p>
  30628. </dd>
  30629. <dt>&lsquo;<samp>fg3</samp>&rsquo;</dt>
  30630. <dd><p>Set 3rd foreground color expression.
  30631. </p>
  30632. </dd>
  30633. <dt>&lsquo;<samp>m4</samp>&rsquo;</dt>
  30634. <dd><p>Set 4th frame metadata key from which metadata values will be used to draw a graph.
  30635. </p>
  30636. </dd>
  30637. <dt>&lsquo;<samp>fg4</samp>&rsquo;</dt>
  30638. <dd><p>Set 4th foreground color expression.
  30639. </p>
  30640. </dd>
  30641. <dt>&lsquo;<samp>min</samp>&rsquo;</dt>
  30642. <dd><p>Set minimal value of metadata value.
  30643. </p>
  30644. </dd>
  30645. <dt>&lsquo;<samp>max</samp>&rsquo;</dt>
  30646. <dd><p>Set maximal value of metadata value.
  30647. </p>
  30648. </dd>
  30649. <dt>&lsquo;<samp>bg</samp>&rsquo;</dt>
  30650. <dd><p>Set graph background color. Default is white.
  30651. </p>
  30652. </dd>
  30653. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  30654. <dd><p>Set graph mode.
  30655. </p>
  30656. <p>Available values for mode is:
  30657. </p><dl compact="compact">
  30658. <dt>&lsquo;<samp>bar</samp>&rsquo;</dt>
  30659. <dt>&lsquo;<samp>dot</samp>&rsquo;</dt>
  30660. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  30661. </dl>
  30662. <p>Default is <code>line</code>.
  30663. </p>
  30664. </dd>
  30665. <dt>&lsquo;<samp>slide</samp>&rsquo;</dt>
  30666. <dd><p>Set slide mode.
  30667. </p>
  30668. <p>Available values for slide is:
  30669. </p><dl compact="compact">
  30670. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  30671. <dd><p>Draw new frame when right border is reached.
  30672. </p>
  30673. </dd>
  30674. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  30675. <dd><p>Replace old columns with new ones.
  30676. </p>
  30677. </dd>
  30678. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  30679. <dd><p>Scroll from right to left.
  30680. </p>
  30681. </dd>
  30682. <dt>&lsquo;<samp>rscroll</samp>&rsquo;</dt>
  30683. <dd><p>Scroll from left to right.
  30684. </p>
  30685. </dd>
  30686. <dt>&lsquo;<samp>picture</samp>&rsquo;</dt>
  30687. <dd><p>Draw single picture.
  30688. </p></dd>
  30689. </dl>
  30690. <p>Default is <code>frame</code>.
  30691. </p>
  30692. </dd>
  30693. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  30694. <dd><p>Set size of graph video. For the syntax of this option, check the
  30695. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  30696. The default value is <code>900x256</code>.
  30697. </p>
  30698. </dd>
  30699. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  30700. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  30701. </p>
  30702. <p>The foreground color expressions can use the following variables:
  30703. </p><dl compact="compact">
  30704. <dt>&lsquo;<samp>MIN</samp>&rsquo;</dt>
  30705. <dd><p>Minimal value of metadata value.
  30706. </p>
  30707. </dd>
  30708. <dt>&lsquo;<samp>MAX</samp>&rsquo;</dt>
  30709. <dd><p>Maximal value of metadata value.
  30710. </p>
  30711. </dd>
  30712. <dt>&lsquo;<samp>VAL</samp>&rsquo;</dt>
  30713. <dd><p>Current metadata key value.
  30714. </p></dd>
  30715. </dl>
  30716. <p>The color is defined as 0xAABBGGRR.
  30717. </p></dd>
  30718. </dl>
  30719. <p>Example using metadata from <a href="#signalstats">signalstats</a> filter:
  30720. </p><div class="example">
  30721. <pre class="example">signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
  30722. </pre></div>
  30723. <p>Example using metadata from <a href="#ebur128">ebur128</a> filter:
  30724. </p><div class="example">
  30725. <pre class="example">ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
  30726. </pre></div>
  30727. <a name="drawgrid"></a>
  30728. <h2 class="section"><a href="ffmpeg-all.html#toc-drawgrid">39.60 drawgrid</a></h2>
  30729. <p>Draw a grid on the input image.
  30730. </p>
  30731. <p>It accepts the following parameters:
  30732. </p>
  30733. <dl compact="compact">
  30734. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  30735. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  30736. <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
  30737. </p>
  30738. </dd>
  30739. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  30740. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  30741. <dd><p>The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
  30742. input width and height, respectively, minus <code>thickness</code>, so image gets
  30743. framed. Default to 0.
  30744. </p>
  30745. </dd>
  30746. <dt>&lsquo;<samp>color, c</samp>&rsquo;</dt>
  30747. <dd><p>Specify the color of the grid. For the general syntax of this option,
  30748. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>. If the special
  30749. value <code>invert</code> is used, the grid color is the same as the
  30750. video with inverted luma.
  30751. </p>
  30752. </dd>
  30753. <dt>&lsquo;<samp>thickness, t</samp>&rsquo;</dt>
  30754. <dd><p>The expression which sets the thickness of the grid line. Default value is <code>1</code>.
  30755. </p>
  30756. <p>See below for the list of accepted constants.
  30757. </p>
  30758. </dd>
  30759. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  30760. <dd><p>Applicable if the input has alpha. With <code>1</code> the pixels of the painted grid
  30761. will overwrite the video&rsquo;s color and alpha pixels.
  30762. Default is <code>0</code>, which composites the grid onto the input, leaving the video&rsquo;s alpha intact.
  30763. </p></dd>
  30764. </dl>
  30765. <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
  30766. following constants:
  30767. </p>
  30768. <dl compact="compact">
  30769. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  30770. <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
  30771. </p>
  30772. </dd>
  30773. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  30774. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  30775. <dd><p>horizontal and vertical chroma subsample values. For example for the
  30776. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  30777. </p>
  30778. </dd>
  30779. <dt>&lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
  30780. <dt>&lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
  30781. <dd><p>The input grid cell width and height.
  30782. </p>
  30783. </dd>
  30784. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  30785. <dd><p>The input sample aspect ratio.
  30786. </p>
  30787. </dd>
  30788. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  30789. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  30790. <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
  30791. </p>
  30792. </dd>
  30793. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  30794. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  30795. <dd><p>The width and height of the drawn cell.
  30796. </p>
  30797. </dd>
  30798. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  30799. <dd><p>The thickness of the drawn cell.
  30800. </p>
  30801. <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
  30802. each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
  30803. </p>
  30804. </dd>
  30805. </dl>
  30806. <a name="Examples-128"></a>
  30807. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-128">39.60.1 Examples</a></h3>
  30808. <ul>
  30809. <li>
  30810. Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
  30811. <div class="example">
  30812. <pre class="example">drawgrid=width=100:height=100:thickness=2:color=red@0.5
  30813. </pre></div>
  30814. </li><li>
  30815. Draw a white 3x3 grid with an opacity of 50%:
  30816. <div class="example">
  30817. <pre class="example">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
  30818. </pre></div>
  30819. </li></ul>
  30820. <a name="Commands-20"></a>
  30821. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-20">39.60.2 Commands</a></h3>
  30822. <p>This filter supports same commands as options.
  30823. The command accepts the same syntax of the corresponding option.
  30824. </p>
  30825. <p>If the specified expression is not valid, it is kept at its current
  30826. value.
  30827. </p>
  30828. <p><a name="drawtext"></a>
  30829. </p><a name="drawtext-1"></a>
  30830. <h2 class="section"><a href="ffmpeg-all.html#toc-drawtext-1">39.61 drawtext</a></h2>
  30831. <p>Draw a text string or text from a specified file on top of a video, using the
  30832. libfreetype library.
  30833. </p>
  30834. <p>To enable compilation of this filter, you need to configure FFmpeg with
  30835. <code>--enable-libfreetype</code>.
  30836. To enable default font fallback and the <var>font</var> option you need to
  30837. configure FFmpeg with <code>--enable-libfontconfig</code>.
  30838. To enable the <var>text_shaping</var> option, you need to configure FFmpeg with
  30839. <code>--enable-libfribidi</code>.
  30840. </p>
  30841. <a name="Syntax"></a>
  30842. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Syntax">39.61.1 Syntax</a></h3>
  30843. <p>It accepts the following parameters:
  30844. </p>
  30845. <dl compact="compact">
  30846. <dt>&lsquo;<samp>box</samp>&rsquo;</dt>
  30847. <dd><p>Used to draw a box around text using the background color.
  30848. The value must be either 1 (enable) or 0 (disable).
  30849. The default value of <var>box</var> is 0.
  30850. </p>
  30851. </dd>
  30852. <dt>&lsquo;<samp>boxborderw</samp>&rsquo;</dt>
  30853. <dd><p>Set the width of the border to be drawn around the box using <var>boxcolor</var>.
  30854. The default value of <var>boxborderw</var> is 0.
  30855. </p>
  30856. </dd>
  30857. <dt>&lsquo;<samp>boxcolor</samp>&rsquo;</dt>
  30858. <dd><p>The color to be used for drawing box around text. For the syntax of this
  30859. option, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  30860. </p>
  30861. <p>The default value of <var>boxcolor</var> is &quot;white&quot;.
  30862. </p>
  30863. </dd>
  30864. <dt>&lsquo;<samp>line_spacing</samp>&rsquo;</dt>
  30865. <dd><p>Set the line spacing in pixels of the border to be drawn around the box using <var>box</var>.
  30866. The default value of <var>line_spacing</var> is 0.
  30867. </p>
  30868. </dd>
  30869. <dt>&lsquo;<samp>borderw</samp>&rsquo;</dt>
  30870. <dd><p>Set the width of the border to be drawn around the text using <var>bordercolor</var>.
  30871. The default value of <var>borderw</var> is 0.
  30872. </p>
  30873. </dd>
  30874. <dt>&lsquo;<samp>bordercolor</samp>&rsquo;</dt>
  30875. <dd><p>Set the color to be used for drawing border around text. For the syntax of this
  30876. option, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  30877. </p>
  30878. <p>The default value of <var>bordercolor</var> is &quot;black&quot;.
  30879. </p>
  30880. </dd>
  30881. <dt>&lsquo;<samp>expansion</samp>&rsquo;</dt>
  30882. <dd><p>Select how the <var>text</var> is expanded. Can be either <code>none</code>,
  30883. <code>strftime</code> (deprecated) or
  30884. <code>normal</code> (default). See the <a href="#drawtext_005fexpansion">Text expansion</a> section
  30885. below for details.
  30886. </p>
  30887. </dd>
  30888. <dt>&lsquo;<samp>basetime</samp>&rsquo;</dt>
  30889. <dd><p>Set a start time for the count. Value is in microseconds. Only applied
  30890. in the deprecated strftime expansion mode. To emulate in normal expansion
  30891. mode use the <code>pts</code> function, supplying the start time (in seconds)
  30892. as the second argument.
  30893. </p>
  30894. </dd>
  30895. <dt>&lsquo;<samp>fix_bounds</samp>&rsquo;</dt>
  30896. <dd><p>If true, check and fix text coords to avoid clipping.
  30897. </p>
  30898. </dd>
  30899. <dt>&lsquo;<samp>fontcolor</samp>&rsquo;</dt>
  30900. <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
  30901. the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  30902. </p>
  30903. <p>The default value of <var>fontcolor</var> is &quot;black&quot;.
  30904. </p>
  30905. </dd>
  30906. <dt>&lsquo;<samp>fontcolor_expr</samp>&rsquo;</dt>
  30907. <dd><p>String which is expanded the same way as <var>text</var> to obtain dynamic
  30908. <var>fontcolor</var> value. By default this option has empty value and is not
  30909. processed. When this option is set, it overrides <var>fontcolor</var> option.
  30910. </p>
  30911. </dd>
  30912. <dt>&lsquo;<samp>font</samp>&rsquo;</dt>
  30913. <dd><p>The font family to be used for drawing text. By default Sans.
  30914. </p>
  30915. </dd>
  30916. <dt>&lsquo;<samp>fontfile</samp>&rsquo;</dt>
  30917. <dd><p>The font file to be used for drawing text. The path must be included.
  30918. This parameter is mandatory if the fontconfig support is disabled.
  30919. </p>
  30920. </dd>
  30921. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  30922. <dd><p>Draw the text applying alpha blending. The value can
  30923. be a number between 0.0 and 1.0.
  30924. The expression accepts the same variables <var>x, y</var> as well.
  30925. The default value is 1.
  30926. Please see <var>fontcolor_expr</var>.
  30927. </p>
  30928. </dd>
  30929. <dt>&lsquo;<samp>fontsize</samp>&rsquo;</dt>
  30930. <dd><p>The font size to be used for drawing text.
  30931. The default value of <var>fontsize</var> is 16.
  30932. </p>
  30933. </dd>
  30934. <dt>&lsquo;<samp>text_shaping</samp>&rsquo;</dt>
  30935. <dd><p>If set to 1, attempt to shape the text (for example, reverse the order of
  30936. right-to-left text and join Arabic characters) before drawing it.
  30937. Otherwise, just draw the text exactly as given.
  30938. By default 1 (if supported).
  30939. </p>
  30940. </dd>
  30941. <dt>&lsquo;<samp>ft_load_flags</samp>&rsquo;</dt>
  30942. <dd><p>The flags to be used for loading the fonts.
  30943. </p>
  30944. <p>The flags map the corresponding flags supported by libfreetype, and are
  30945. a combination of the following values:
  30946. </p><dl compact="compact">
  30947. <dt><var>default</var></dt>
  30948. <dt><var>no_scale</var></dt>
  30949. <dt><var>no_hinting</var></dt>
  30950. <dt><var>render</var></dt>
  30951. <dt><var>no_bitmap</var></dt>
  30952. <dt><var>vertical_layout</var></dt>
  30953. <dt><var>force_autohint</var></dt>
  30954. <dt><var>crop_bitmap</var></dt>
  30955. <dt><var>pedantic</var></dt>
  30956. <dt><var>ignore_global_advance_width</var></dt>
  30957. <dt><var>no_recurse</var></dt>
  30958. <dt><var>ignore_transform</var></dt>
  30959. <dt><var>monochrome</var></dt>
  30960. <dt><var>linear_design</var></dt>
  30961. <dt><var>no_autohint</var></dt>
  30962. </dl>
  30963. <p>Default value is &quot;default&quot;.
  30964. </p>
  30965. <p>For more information consult the documentation for the FT_LOAD_*
  30966. libfreetype flags.
  30967. </p>
  30968. </dd>
  30969. <dt>&lsquo;<samp>shadowcolor</samp>&rsquo;</dt>
  30970. <dd><p>The color to be used for drawing a shadow behind the drawn text. For the
  30971. syntax of this option, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  30972. </p>
  30973. <p>The default value of <var>shadowcolor</var> is &quot;black&quot;.
  30974. </p>
  30975. </dd>
  30976. <dt>&lsquo;<samp>shadowx</samp>&rsquo;</dt>
  30977. <dt>&lsquo;<samp>shadowy</samp>&rsquo;</dt>
  30978. <dd><p>The x and y offsets for the text shadow position with respect to the
  30979. position of the text. They can be either positive or negative
  30980. values. The default value for both is &quot;0&quot;.
  30981. </p>
  30982. </dd>
  30983. <dt>&lsquo;<samp>start_number</samp>&rsquo;</dt>
  30984. <dd><p>The starting frame number for the n/frame_num variable. The default value
  30985. is &quot;0&quot;.
  30986. </p>
  30987. </dd>
  30988. <dt>&lsquo;<samp>tabsize</samp>&rsquo;</dt>
  30989. <dd><p>The size in number of spaces to use for rendering the tab.
  30990. Default value is 4.
  30991. </p>
  30992. </dd>
  30993. <dt>&lsquo;<samp>timecode</samp>&rsquo;</dt>
  30994. <dd><p>Set the initial timecode representation in &quot;hh:mm:ss[:;.]ff&quot;
  30995. format. It can be used with or without text parameter. <var>timecode_rate</var>
  30996. option must be specified.
  30997. </p>
  30998. </dd>
  30999. <dt>&lsquo;<samp>timecode_rate, rate, r</samp>&rsquo;</dt>
  31000. <dd><p>Set the timecode frame rate (timecode only). Value will be rounded to nearest
  31001. integer. Minimum value is &quot;1&quot;.
  31002. Drop-frame timecode is supported for frame rates 30 &amp; 60.
  31003. </p>
  31004. </dd>
  31005. <dt>&lsquo;<samp>tc24hmax</samp>&rsquo;</dt>
  31006. <dd><p>If set to 1, the output of the timecode option will wrap around at 24 hours.
  31007. Default is 0 (disabled).
  31008. </p>
  31009. </dd>
  31010. <dt>&lsquo;<samp>text</samp>&rsquo;</dt>
  31011. <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
  31012. encoded characters.
  31013. This parameter is mandatory if no file is specified with the parameter
  31014. <var>textfile</var>.
  31015. </p>
  31016. </dd>
  31017. <dt>&lsquo;<samp>textfile</samp>&rsquo;</dt>
  31018. <dd><p>A text file containing text to be drawn. The text must be a sequence
  31019. of UTF-8 encoded characters.
  31020. </p>
  31021. <p>This parameter is mandatory if no text string is specified with the
  31022. parameter <var>text</var>.
  31023. </p>
  31024. <p>If both <var>text</var> and <var>textfile</var> are specified, an error is thrown.
  31025. </p>
  31026. </dd>
  31027. <dt>&lsquo;<samp>reload</samp>&rsquo;</dt>
  31028. <dd><p>If set to 1, the <var>textfile</var> will be reloaded before each frame.
  31029. Be sure to update it atomically, or it may be read partially, or even fail.
  31030. </p>
  31031. </dd>
  31032. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  31033. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  31034. <dd><p>The expressions which specify the offsets where text will be drawn
  31035. within the video frame. They are relative to the top/left border of the
  31036. output image.
  31037. </p>
  31038. <p>The default value of <var>x</var> and <var>y</var> is &quot;0&quot;.
  31039. </p>
  31040. <p>See below for the list of accepted constants and functions.
  31041. </p></dd>
  31042. </dl>
  31043. <p>The parameters for <var>x</var> and <var>y</var> are expressions containing the
  31044. following constants and functions:
  31045. </p>
  31046. <dl compact="compact">
  31047. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  31048. <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
  31049. </p>
  31050. </dd>
  31051. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  31052. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  31053. <dd><p>horizontal and vertical chroma subsample values. For example for the
  31054. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  31055. </p>
  31056. </dd>
  31057. <dt>&lsquo;<samp>line_h, lh</samp>&rsquo;</dt>
  31058. <dd><p>the height of each text line
  31059. </p>
  31060. </dd>
  31061. <dt>&lsquo;<samp>main_h, h, H</samp>&rsquo;</dt>
  31062. <dd><p>the input height
  31063. </p>
  31064. </dd>
  31065. <dt>&lsquo;<samp>main_w, w, W</samp>&rsquo;</dt>
  31066. <dd><p>the input width
  31067. </p>
  31068. </dd>
  31069. <dt>&lsquo;<samp>max_glyph_a, ascent</samp>&rsquo;</dt>
  31070. <dd><p>the maximum distance from the baseline to the highest/upper grid
  31071. coordinate used to place a glyph outline point, for all the rendered
  31072. glyphs.
  31073. It is a positive value, due to the grid&rsquo;s orientation with the Y axis
  31074. upwards.
  31075. </p>
  31076. </dd>
  31077. <dt>&lsquo;<samp>max_glyph_d, descent</samp>&rsquo;</dt>
  31078. <dd><p>the maximum distance from the baseline to the lowest grid coordinate
  31079. used to place a glyph outline point, for all the rendered glyphs.
  31080. This is a negative value, due to the grid&rsquo;s orientation, with the Y axis
  31081. upwards.
  31082. </p>
  31083. </dd>
  31084. <dt>&lsquo;<samp>max_glyph_h</samp>&rsquo;</dt>
  31085. <dd><p>maximum glyph height, that is the maximum height for all the glyphs
  31086. contained in the rendered text, it is equivalent to <var>ascent</var> -
  31087. <var>descent</var>.
  31088. </p>
  31089. </dd>
  31090. <dt>&lsquo;<samp>max_glyph_w</samp>&rsquo;</dt>
  31091. <dd><p>maximum glyph width, that is the maximum width for all the glyphs
  31092. contained in the rendered text
  31093. </p>
  31094. </dd>
  31095. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  31096. <dd><p>the number of input frame, starting from 0
  31097. </p>
  31098. </dd>
  31099. <dt>&lsquo;<samp>rand(min, max)</samp>&rsquo;</dt>
  31100. <dd><p>return a random number included between <var>min</var> and <var>max</var>
  31101. </p>
  31102. </dd>
  31103. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  31104. <dd><p>The input sample aspect ratio.
  31105. </p>
  31106. </dd>
  31107. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  31108. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  31109. </p>
  31110. </dd>
  31111. <dt>&lsquo;<samp>text_h, th</samp>&rsquo;</dt>
  31112. <dd><p>the height of the rendered text
  31113. </p>
  31114. </dd>
  31115. <dt>&lsquo;<samp>text_w, tw</samp>&rsquo;</dt>
  31116. <dd><p>the width of the rendered text
  31117. </p>
  31118. </dd>
  31119. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  31120. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  31121. <dd><p>the x and y offset coordinates where the text is drawn.
  31122. </p>
  31123. <p>These parameters allow the <var>x</var> and <var>y</var> expressions to refer
  31124. to each other, so you can for example specify <code>y=x/dar</code>.
  31125. </p>
  31126. </dd>
  31127. <dt>&lsquo;<samp>pict_type</samp>&rsquo;</dt>
  31128. <dd><p>A one character description of the current frame&rsquo;s picture type.
  31129. </p>
  31130. </dd>
  31131. <dt>&lsquo;<samp>pkt_pos</samp>&rsquo;</dt>
  31132. <dd><p>The current packet&rsquo;s position in the input file or stream
  31133. (in bytes, from the start of the input). A value of -1 indicates
  31134. this info is not available.
  31135. </p>
  31136. </dd>
  31137. <dt>&lsquo;<samp>pkt_duration</samp>&rsquo;</dt>
  31138. <dd><p>The current packet&rsquo;s duration, in seconds.
  31139. </p>
  31140. </dd>
  31141. <dt>&lsquo;<samp>pkt_size</samp>&rsquo;</dt>
  31142. <dd><p>The current packet&rsquo;s size (in bytes).
  31143. </p></dd>
  31144. </dl>
  31145. <p><a name="drawtext_005fexpansion"></a>
  31146. </p><a name="Text-expansion"></a>
  31147. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Text-expansion">39.61.2 Text expansion</a></h3>
  31148. <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>strftime</code>,
  31149. the filter recognizes strftime() sequences in the provided text and
  31150. expands them accordingly. Check the documentation of strftime(). This
  31151. feature is deprecated.
  31152. </p>
  31153. <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>none</code>, the text is printed verbatim.
  31154. </p>
  31155. <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>normal</code> (which is the default),
  31156. the following expansion mechanism is used.
  31157. </p>
  31158. <p>The backslash character &lsquo;<samp>\</samp>&rsquo;, followed by any character, always expands to
  31159. the second character.
  31160. </p>
  31161. <p>Sequences of the form <code>%{...}</code> are expanded. The text between the
  31162. braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
  31163. If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
  31164. they should be escaped.
  31165. </p>
  31166. <p>Note that they probably must also be escaped as the value for the
  31167. &lsquo;<samp>text</samp>&rsquo; option in the filter argument string and as the filter
  31168. argument in the filtergraph description, and possibly also for the shell,
  31169. that makes up to four levels of escaping; using a text file avoids these
  31170. problems.
  31171. </p>
  31172. <p>The following functions are available:
  31173. </p>
  31174. <dl compact="compact">
  31175. <dt><code>expr, e</code></dt>
  31176. <dd><p>The expression evaluation result.
  31177. </p>
  31178. <p>It must take one argument specifying the expression to be evaluated,
  31179. which accepts the same constants and functions as the <var>x</var> and
  31180. <var>y</var> values. Note that not all constants should be used, for
  31181. example the text size is not known when evaluating the expression, so
  31182. the constants <var>text_w</var> and <var>text_h</var> will have an undefined
  31183. value.
  31184. </p>
  31185. </dd>
  31186. <dt><code>expr_int_format, eif</code></dt>
  31187. <dd><p>Evaluate the expression&rsquo;s value and output as formatted integer.
  31188. </p>
  31189. <p>The first argument is the expression to be evaluated, just as for the <var>expr</var> function.
  31190. The second argument specifies the output format. Allowed values are &lsquo;<samp>x</samp>&rsquo;,
  31191. &lsquo;<samp>X</samp>&rsquo;, &lsquo;<samp>d</samp>&rsquo; and &lsquo;<samp>u</samp>&rsquo;. They are treated exactly as in the
  31192. <code>printf</code> function.
  31193. The third parameter is optional and sets the number of positions taken by the output.
  31194. It can be used to add padding with zeros from the left.
  31195. </p>
  31196. </dd>
  31197. <dt><code>gmtime</code></dt>
  31198. <dd><p>The time at which the filter is running, expressed in UTC.
  31199. It can accept an argument: a strftime() format string.
  31200. </p>
  31201. </dd>
  31202. <dt><code>localtime</code></dt>
  31203. <dd><p>The time at which the filter is running, expressed in the local time zone.
  31204. It can accept an argument: a strftime() format string.
  31205. </p>
  31206. </dd>
  31207. <dt><code>metadata</code></dt>
  31208. <dd><p>Frame metadata. Takes one or two arguments.
  31209. </p>
  31210. <p>The first argument is mandatory and specifies the metadata key.
  31211. </p>
  31212. <p>The second argument is optional and specifies a default value, used when the
  31213. metadata key is not found or empty.
  31214. </p>
  31215. <p>Available metadata can be identified by inspecting entries
  31216. starting with TAG included within each frame section
  31217. printed by running <code>ffprobe -show_frames</code>.
  31218. </p>
  31219. <p>String metadata generated in filters leading to
  31220. the drawtext filter are also available.
  31221. </p>
  31222. </dd>
  31223. <dt><code>n, frame_num</code></dt>
  31224. <dd><p>The frame number, starting from 0.
  31225. </p>
  31226. </dd>
  31227. <dt><code>pict_type</code></dt>
  31228. <dd><p>A one character description of the current picture type.
  31229. </p>
  31230. </dd>
  31231. <dt><code>pts</code></dt>
  31232. <dd><p>The timestamp of the current frame.
  31233. It can take up to three arguments.
  31234. </p>
  31235. <p>The first argument is the format of the timestamp; it defaults to <code>flt</code>
  31236. for seconds as a decimal number with microsecond accuracy; <code>hms</code> stands
  31237. for a formatted <var>[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
  31238. <code>gmtime</code> stands for the timestamp of the frame formatted as UTC time;
  31239. <code>localtime</code> stands for the timestamp of the frame formatted as
  31240. local time zone time.
  31241. </p>
  31242. <p>The second argument is an offset added to the timestamp.
  31243. </p>
  31244. <p>If the format is set to <code>hms</code>, a third argument <code>24HH</code> may be
  31245. supplied to present the hour part of the formatted timestamp in 24h format
  31246. (00-23).
  31247. </p>
  31248. <p>If the format is set to <code>localtime</code> or <code>gmtime</code>,
  31249. a third argument may be supplied: a strftime() format string.
  31250. By default, <var>YYYY-MM-DD HH:MM:SS</var> format will be used.
  31251. </p></dd>
  31252. </dl>
  31253. <a name="Commands-57"></a>
  31254. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-57">39.61.3 Commands</a></h3>
  31255. <p>This filter supports altering parameters via commands:
  31256. </p><dl compact="compact">
  31257. <dt>&lsquo;<samp>reinit</samp>&rsquo;</dt>
  31258. <dd><p>Alter existing filter parameters.
  31259. </p>
  31260. <p>Syntax for the argument is the same as for filter invocation, e.g.
  31261. </p>
  31262. <div class="example">
  31263. <pre class="example">fontsize=56:fontcolor=green:text='Hello World'
  31264. </pre></div>
  31265. <p>Full filter invocation with sendcmd would look like this:
  31266. </p>
  31267. <div class="example">
  31268. <pre class="example">sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
  31269. </pre></div>
  31270. </dd>
  31271. </dl>
  31272. <p>If the entire argument can&rsquo;t be parsed or applied as valid values then the filter will
  31273. continue with its existing parameters.
  31274. </p>
  31275. <a name="Examples-88"></a>
  31276. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-88">39.61.4 Examples</a></h3>
  31277. <ul>
  31278. <li>
  31279. Draw &quot;Test Text&quot; with font FreeSerif, using the default values for the
  31280. optional parameters.
  31281. <div class="example">
  31282. <pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
  31283. </pre></div>
  31284. </li><li>
  31285. Draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
  31286. and y=50 (counting from the top-left corner of the screen), text is
  31287. yellow with a red box around it. Both the text and the box have an
  31288. opacity of 20%.
  31289. <div class="example">
  31290. <pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
  31291. x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
  31292. </pre></div>
  31293. <p>Note that the double quotes are not necessary if spaces are not used
  31294. within the parameter list.
  31295. </p>
  31296. </li><li>
  31297. Show the text at the center of the video frame:
  31298. <div class="example">
  31299. <pre class="example">drawtext=&quot;fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2&quot;
  31300. </pre></div>
  31301. </li><li>
  31302. Show the text at a random position, switching to a new position every 30 seconds:
  31303. <div class="example">
  31304. <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;
  31305. </pre></div>
  31306. </li><li>
  31307. Show a text line sliding from right to left in the last row of the video
  31308. frame. The file &lsquo;<tt>LONG_LINE</tt>&rsquo; is assumed to contain a single line
  31309. with no newlines.
  31310. <div class="example">
  31311. <pre class="example">drawtext=&quot;fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t&quot;
  31312. </pre></div>
  31313. </li><li>
  31314. Show the content of file &lsquo;<tt>CREDITS</tt>&rsquo; off the bottom of the frame and scroll up.
  31315. <div class="example">
  31316. <pre class="example">drawtext=&quot;fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t&quot;
  31317. </pre></div>
  31318. </li><li>
  31319. Draw a single green letter &quot;g&quot;, at the center of the input video.
  31320. The glyph baseline is placed at half screen height.
  31321. <div class="example">
  31322. <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;
  31323. </pre></div>
  31324. </li><li>
  31325. Show text for 1 second every 3 seconds:
  31326. <div class="example">
  31327. <pre class="example">drawtext=&quot;fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'&quot;
  31328. </pre></div>
  31329. </li><li>
  31330. Use fontconfig to set the font. Note that the colons need to be escaped.
  31331. <div class="example">
  31332. <pre class="example">drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
  31333. </pre></div>
  31334. </li><li>
  31335. Print the date of a real-time encoding (see strftime(3)):
  31336. <div class="example">
  31337. <pre class="example">drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
  31338. </pre></div>
  31339. </li><li>
  31340. Show text fading in and out (appearing/disappearing):
  31341. <div class="example">
  31342. <pre class="example">#!/bin/sh
  31343. DS=1.0 # display start
  31344. DE=10.0 # display end
  31345. FID=1.5 # fade in duration
  31346. FOD=5 # fade out duration
  31347. 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;
  31348. </pre></div>
  31349. </li><li>
  31350. Horizontally align multiple separate texts. Note that &lsquo;<samp>max_glyph_a</samp>&rsquo;
  31351. and the &lsquo;<samp>fontsize</samp>&rsquo; value are included in the &lsquo;<samp>y</samp>&rsquo; offset.
  31352. <div class="example">
  31353. <pre class="example">drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
  31354. drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
  31355. </pre></div>
  31356. </li><li>
  31357. Plot special <var>lavf.image2dec.source_basename</var> metadata onto each frame if
  31358. such metadata exists. Otherwise, plot the string &quot;NA&quot;. Note that image2 demuxer
  31359. must have option &lsquo;<samp>-export_path_metadata 1</samp>&rsquo; for the special metadata fields
  31360. to be available for filters.
  31361. <div class="example">
  31362. <pre class="example">drawtext=&quot;fontsize=20:fontcolor=white:fontfile=FreeSans.ttf:text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=10:y=10&quot;
  31363. </pre></div>
  31364. </li></ul>
  31365. <p>For more information about libfreetype, check:
  31366. <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
  31367. </p>
  31368. <p>For more information about fontconfig, check:
  31369. <a href="http://freedesktop.org/software/fontconfig/fontconfig-user.html">http://freedesktop.org/software/fontconfig/fontconfig-user.html</a>.
  31370. </p>
  31371. <p>For more information about libfribidi, check:
  31372. <a href="http://fribidi.org/">http://fribidi.org/</a>.
  31373. </p>
  31374. <a name="edgedetect"></a>
  31375. <h2 class="section"><a href="ffmpeg-all.html#toc-edgedetect">39.62 edgedetect</a></h2>
  31376. <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
  31377. </p>
  31378. <p>The filter accepts the following options:
  31379. </p>
  31380. <dl compact="compact">
  31381. <dt>&lsquo;<samp>low</samp>&rsquo;</dt>
  31382. <dt>&lsquo;<samp>high</samp>&rsquo;</dt>
  31383. <dd><p>Set low and high threshold values used by the Canny thresholding
  31384. algorithm.
  31385. </p>
  31386. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  31387. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  31388. by the low threshold.
  31389. </p>
  31390. <p><var>low</var> and <var>high</var> threshold values must be chosen in the range
  31391. [0,1], and <var>low</var> should be lesser or equal to <var>high</var>.
  31392. </p>
  31393. <p>Default value for <var>low</var> is <code>20/255</code>, and default value for <var>high</var>
  31394. is <code>50/255</code>.
  31395. </p>
  31396. </dd>
  31397. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  31398. <dd><p>Define the drawing mode.
  31399. </p>
  31400. <dl compact="compact">
  31401. <dt>&lsquo;<samp>wires</samp>&rsquo;</dt>
  31402. <dd><p>Draw white/gray wires on black background.
  31403. </p>
  31404. </dd>
  31405. <dt>&lsquo;<samp>colormix</samp>&rsquo;</dt>
  31406. <dd><p>Mix the colors to create a paint/cartoon effect.
  31407. </p>
  31408. </dd>
  31409. <dt>&lsquo;<samp>canny</samp>&rsquo;</dt>
  31410. <dd><p>Apply Canny edge detector on all selected planes.
  31411. </p></dd>
  31412. </dl>
  31413. <p>Default value is <var>wires</var>.
  31414. </p>
  31415. </dd>
  31416. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  31417. <dd><p>Select planes for filtering. By default all available planes are filtered.
  31418. </p></dd>
  31419. </dl>
  31420. <a name="Examples-89"></a>
  31421. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-89">39.62.1 Examples</a></h3>
  31422. <ul>
  31423. <li>
  31424. Standard edge detection with custom values for the hysteresis thresholding:
  31425. <div class="example">
  31426. <pre class="example">edgedetect=low=0.1:high=0.4
  31427. </pre></div>
  31428. </li><li>
  31429. Painting effect without thresholding:
  31430. <div class="example">
  31431. <pre class="example">edgedetect=mode=colormix:high=0
  31432. </pre></div>
  31433. </li></ul>
  31434. <a name="elbg"></a>
  31435. <h2 class="section"><a href="ffmpeg-all.html#toc-elbg">39.63 elbg</a></h2>
  31436. <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
  31437. </p>
  31438. <p>For each input image, the filter will compute the optimal mapping from
  31439. the input to the output given the codebook length, that is the number
  31440. of distinct output colors.
  31441. </p>
  31442. <p>This filter accepts the following options.
  31443. </p>
  31444. <dl compact="compact">
  31445. <dt>&lsquo;<samp>codebook_length, l</samp>&rsquo;</dt>
  31446. <dd><p>Set codebook length. The value must be a positive integer, and
  31447. represents the number of distinct output colors. Default value is 256.
  31448. </p>
  31449. </dd>
  31450. <dt>&lsquo;<samp>nb_steps, n</samp>&rsquo;</dt>
  31451. <dd><p>Set the maximum number of iterations to apply for computing the optimal
  31452. mapping. The higher the value the better the result and the higher the
  31453. computation time. Default value is 1.
  31454. </p>
  31455. </dd>
  31456. <dt>&lsquo;<samp>seed, s</samp>&rsquo;</dt>
  31457. <dd><p>Set a random seed, must be an integer included between 0 and
  31458. UINT32_MAX. If not specified, or if explicitly set to -1, the filter
  31459. will try to use a good random seed on a best effort basis.
  31460. </p>
  31461. </dd>
  31462. <dt>&lsquo;<samp>pal8</samp>&rsquo;</dt>
  31463. <dd><p>Set pal8 output pixel format. This option does not work with codebook
  31464. length greater than 256.
  31465. </p></dd>
  31466. </dl>
  31467. <a name="entropy"></a>
  31468. <h2 class="section"><a href="ffmpeg-all.html#toc-entropy">39.64 entropy</a></h2>
  31469. <p>Measure graylevel entropy in histogram of color channels of video frames.
  31470. </p>
  31471. <p>It accepts the following parameters:
  31472. </p>
  31473. <dl compact="compact">
  31474. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  31475. <dd><p>Can be either <var>normal</var> or <var>diff</var>. Default is <var>normal</var>.
  31476. </p>
  31477. <p><var>diff</var> mode measures entropy of histogram delta values, absolute differences
  31478. between neighbour histogram values.
  31479. </p></dd>
  31480. </dl>
  31481. <a name="eq"></a>
  31482. <h2 class="section"><a href="ffmpeg-all.html#toc-eq">39.65 eq</a></h2>
  31483. <p>Set brightness, contrast, saturation and approximate gamma adjustment.
  31484. </p>
  31485. <p>The filter accepts the following options:
  31486. </p>
  31487. <dl compact="compact">
  31488. <dt>&lsquo;<samp>contrast</samp>&rsquo;</dt>
  31489. <dd><p>Set the contrast expression. The value must be a float value in range
  31490. <code>-1000.0</code> to <code>1000.0</code>. The default value is &quot;1&quot;.
  31491. </p>
  31492. </dd>
  31493. <dt>&lsquo;<samp>brightness</samp>&rsquo;</dt>
  31494. <dd><p>Set the brightness expression. The value must be a float value in
  31495. range <code>-1.0</code> to <code>1.0</code>. The default value is &quot;0&quot;.
  31496. </p>
  31497. </dd>
  31498. <dt>&lsquo;<samp>saturation</samp>&rsquo;</dt>
  31499. <dd><p>Set the saturation expression. The value must be a float in
  31500. range <code>0.0</code> to <code>3.0</code>. The default value is &quot;1&quot;.
  31501. </p>
  31502. </dd>
  31503. <dt>&lsquo;<samp>gamma</samp>&rsquo;</dt>
  31504. <dd><p>Set the gamma expression. The value must be a float in range
  31505. <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  31506. </p>
  31507. </dd>
  31508. <dt>&lsquo;<samp>gamma_r</samp>&rsquo;</dt>
  31509. <dd><p>Set the gamma expression for red. The value must be a float in
  31510. range <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  31511. </p>
  31512. </dd>
  31513. <dt>&lsquo;<samp>gamma_g</samp>&rsquo;</dt>
  31514. <dd><p>Set the gamma expression for green. The value must be a float in range
  31515. <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  31516. </p>
  31517. </dd>
  31518. <dt>&lsquo;<samp>gamma_b</samp>&rsquo;</dt>
  31519. <dd><p>Set the gamma expression for blue. The value must be a float in range
  31520. <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  31521. </p>
  31522. </dd>
  31523. <dt>&lsquo;<samp>gamma_weight</samp>&rsquo;</dt>
  31524. <dd><p>Set the gamma weight expression. It can be used to reduce the effect
  31525. of a high gamma value on bright image areas, e.g. keep them from
  31526. getting overamplified and just plain white. The value must be a float
  31527. in range <code>0.0</code> to <code>1.0</code>. A value of <code>0.0</code> turns the
  31528. gamma correction all the way down while <code>1.0</code> leaves it at its
  31529. full strength. Default is &quot;1&quot;.
  31530. </p>
  31531. </dd>
  31532. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  31533. <dd><p>Set when the expressions for brightness, contrast, saturation and
  31534. gamma expressions are evaluated.
  31535. </p>
  31536. <p>It accepts the following values:
  31537. </p><dl compact="compact">
  31538. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  31539. <dd><p>only evaluate expressions once during the filter initialization or
  31540. when a command is processed
  31541. </p>
  31542. </dd>
  31543. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  31544. <dd><p>evaluate expressions for each incoming frame
  31545. </p></dd>
  31546. </dl>
  31547. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  31548. </p></dd>
  31549. </dl>
  31550. <p>The expressions accept the following parameters:
  31551. </p><dl compact="compact">
  31552. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  31553. <dd><p>frame count of the input frame starting from 0
  31554. </p>
  31555. </dd>
  31556. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  31557. <dd><p>byte position of the corresponding packet in the input file, NAN if
  31558. unspecified
  31559. </p>
  31560. </dd>
  31561. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  31562. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  31563. </p>
  31564. </dd>
  31565. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  31566. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  31567. </p></dd>
  31568. </dl>
  31569. <a name="Commands-65"></a>
  31570. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-65">39.65.1 Commands</a></h3>
  31571. <p>The filter supports the following commands:
  31572. </p>
  31573. <dl compact="compact">
  31574. <dt>&lsquo;<samp>contrast</samp>&rsquo;</dt>
  31575. <dd><p>Set the contrast expression.
  31576. </p>
  31577. </dd>
  31578. <dt>&lsquo;<samp>brightness</samp>&rsquo;</dt>
  31579. <dd><p>Set the brightness expression.
  31580. </p>
  31581. </dd>
  31582. <dt>&lsquo;<samp>saturation</samp>&rsquo;</dt>
  31583. <dd><p>Set the saturation expression.
  31584. </p>
  31585. </dd>
  31586. <dt>&lsquo;<samp>gamma</samp>&rsquo;</dt>
  31587. <dd><p>Set the gamma expression.
  31588. </p>
  31589. </dd>
  31590. <dt>&lsquo;<samp>gamma_r</samp>&rsquo;</dt>
  31591. <dd><p>Set the gamma_r expression.
  31592. </p>
  31593. </dd>
  31594. <dt>&lsquo;<samp>gamma_g</samp>&rsquo;</dt>
  31595. <dd><p>Set gamma_g expression.
  31596. </p>
  31597. </dd>
  31598. <dt>&lsquo;<samp>gamma_b</samp>&rsquo;</dt>
  31599. <dd><p>Set gamma_b expression.
  31600. </p>
  31601. </dd>
  31602. <dt>&lsquo;<samp>gamma_weight</samp>&rsquo;</dt>
  31603. <dd><p>Set gamma_weight expression.
  31604. </p>
  31605. <p>The command accepts the same syntax of the corresponding option.
  31606. </p>
  31607. <p>If the specified expression is not valid, it is kept at its current
  31608. value.
  31609. </p>
  31610. </dd>
  31611. </dl>
  31612. <a name="erosion"></a>
  31613. <h2 class="section"><a href="ffmpeg-all.html#toc-erosion">39.66 erosion</a></h2>
  31614. <p>Apply erosion effect to the video.
  31615. </p>
  31616. <p>This filter replaces the pixel by the local(3x3) minimum.
  31617. </p>
  31618. <p>It accepts the following options:
  31619. </p>
  31620. <dl compact="compact">
  31621. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  31622. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  31623. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  31624. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  31625. <dd><p>Limit the maximum change for each plane, default is 65535.
  31626. If 0, plane will remain unchanged.
  31627. </p>
  31628. </dd>
  31629. <dt>&lsquo;<samp>coordinates</samp>&rsquo;</dt>
  31630. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  31631. pixels are used.
  31632. </p>
  31633. <p>Flags to local 3x3 coordinates maps like this:
  31634. </p>
  31635. <p> 1 2 3
  31636. 4 5
  31637. 6 7 8
  31638. </p></dd>
  31639. </dl>
  31640. <a name="Commands-56"></a>
  31641. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-56">39.66.1 Commands</a></h3>
  31642. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  31643. </p>
  31644. <a name="extractplanes"></a>
  31645. <h2 class="section"><a href="ffmpeg-all.html#toc-extractplanes">39.67 extractplanes</a></h2>
  31646. <p>Extract color channel components from input video stream into
  31647. separate grayscale video streams.
  31648. </p>
  31649. <p>The filter accepts the following option:
  31650. </p>
  31651. <dl compact="compact">
  31652. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  31653. <dd><p>Set plane(s) to extract.
  31654. </p>
  31655. <p>Available values for planes are:
  31656. </p><dl compact="compact">
  31657. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  31658. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  31659. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  31660. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  31661. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  31662. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  31663. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  31664. </dl>
  31665. <p>Choosing planes not available in the input will result in an error.
  31666. That means you cannot select <code>r</code>, <code>g</code>, <code>b</code> planes
  31667. with <code>y</code>, <code>u</code>, <code>v</code> planes at same time.
  31668. </p></dd>
  31669. </dl>
  31670. <a name="Examples-110"></a>
  31671. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-110">39.67.1 Examples</a></h3>
  31672. <ul>
  31673. <li>
  31674. Extract luma, u and v color channel component from input video frame
  31675. into 3 grayscale outputs:
  31676. <div class="example">
  31677. <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
  31678. </pre></div>
  31679. </li></ul>
  31680. <a name="fade"></a>
  31681. <h2 class="section"><a href="ffmpeg-all.html#toc-fade">39.68 fade</a></h2>
  31682. <p>Apply a fade-in/out effect to the input video.
  31683. </p>
  31684. <p>It accepts the following parameters:
  31685. </p>
  31686. <dl compact="compact">
  31687. <dt>&lsquo;<samp>type, t</samp>&rsquo;</dt>
  31688. <dd><p>The effect type can be either &quot;in&quot; for a fade-in, or &quot;out&quot; for a fade-out
  31689. effect.
  31690. Default is <code>in</code>.
  31691. </p>
  31692. </dd>
  31693. <dt>&lsquo;<samp>start_frame, s</samp>&rsquo;</dt>
  31694. <dd><p>Specify the number of the frame to start applying the fade
  31695. effect at. Default is 0.
  31696. </p>
  31697. </dd>
  31698. <dt>&lsquo;<samp>nb_frames, n</samp>&rsquo;</dt>
  31699. <dd><p>The number of frames that the fade effect lasts. At the end of the
  31700. fade-in effect, the output video will have the same intensity as the input video.
  31701. At the end of the fade-out transition, the output video will be filled with the
  31702. selected &lsquo;<samp>color</samp>&rsquo;.
  31703. Default is 25.
  31704. </p>
  31705. </dd>
  31706. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  31707. <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
  31708. Default value is 0.
  31709. </p>
  31710. </dd>
  31711. <dt>&lsquo;<samp>start_time, st</samp>&rsquo;</dt>
  31712. <dd><p>Specify the timestamp (in seconds) of the frame to start to apply the fade
  31713. effect. If both start_frame and start_time are specified, the fade will start at
  31714. whichever comes last. Default is 0.
  31715. </p>
  31716. </dd>
  31717. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  31718. <dd><p>The number of seconds for which the fade effect has to last. At the end of the
  31719. fade-in effect the output video will have the same intensity as the input video,
  31720. at the end of the fade-out transition the output video will be filled with the
  31721. selected &lsquo;<samp>color</samp>&rsquo;.
  31722. If both duration and nb_frames are specified, duration is used. Default is 0
  31723. (nb_frames is used by default).
  31724. </p>
  31725. </dd>
  31726. <dt>&lsquo;<samp>color, c</samp>&rsquo;</dt>
  31727. <dd><p>Specify the color of the fade. Default is &quot;black&quot;.
  31728. </p></dd>
  31729. </dl>
  31730. <a name="Examples-144"></a>
  31731. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-144">39.68.1 Examples</a></h3>
  31732. <ul>
  31733. <li>
  31734. Fade in the first 30 frames of video:
  31735. <div class="example">
  31736. <pre class="example">fade=in:0:30
  31737. </pre></div>
  31738. <p>The command above is equivalent to:
  31739. </p><div class="example">
  31740. <pre class="example">fade=t=in:s=0:n=30
  31741. </pre></div>
  31742. </li><li>
  31743. Fade out the last 45 frames of a 200-frame video:
  31744. <div class="example">
  31745. <pre class="example">fade=out:155:45
  31746. fade=type=out:start_frame=155:nb_frames=45
  31747. </pre></div>
  31748. </li><li>
  31749. Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video:
  31750. <div class="example">
  31751. <pre class="example">fade=in:0:25, fade=out:975:25
  31752. </pre></div>
  31753. </li><li>
  31754. Make the first 5 frames yellow, then fade in from frame 5-24:
  31755. <div class="example">
  31756. <pre class="example">fade=in:5:20:color=yellow
  31757. </pre></div>
  31758. </li><li>
  31759. Fade in alpha over first 25 frames of video:
  31760. <div class="example">
  31761. <pre class="example">fade=in:0:25:alpha=1
  31762. </pre></div>
  31763. </li><li>
  31764. Make the first 5.5 seconds black, then fade in for 0.5 seconds:
  31765. <div class="example">
  31766. <pre class="example">fade=t=in:st=5.5:d=0.5
  31767. </pre></div>
  31768. </li></ul>
  31769. <a name="fftdnoiz"></a>
  31770. <h2 class="section"><a href="ffmpeg-all.html#toc-fftdnoiz">39.69 fftdnoiz</a></h2>
  31771. <p>Denoise frames using 3D FFT (frequency domain filtering).
  31772. </p>
  31773. <p>The filter accepts the following options:
  31774. </p>
  31775. <dl compact="compact">
  31776. <dt>&lsquo;<samp>sigma</samp>&rsquo;</dt>
  31777. <dd><p>Set the noise sigma constant. This sets denoising strength.
  31778. Default value is 1. Allowed range is from 0 to 30.
  31779. Using very high sigma with low overlap may give blocking artifacts.
  31780. </p>
  31781. </dd>
  31782. <dt>&lsquo;<samp>amount</samp>&rsquo;</dt>
  31783. <dd><p>Set amount of denoising. By default all detected noise is reduced.
  31784. Default value is 1. Allowed range is from 0 to 1.
  31785. </p>
  31786. </dd>
  31787. <dt>&lsquo;<samp>block</samp>&rsquo;</dt>
  31788. <dd><p>Set size of block, Default is 4, can be 3, 4, 5 or 6.
  31789. Actual size of block in pixels is 2 to power of <var>block</var>, so by default
  31790. block size in pixels is 2^4 which is 16.
  31791. </p>
  31792. </dd>
  31793. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  31794. <dd><p>Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8.
  31795. </p>
  31796. </dd>
  31797. <dt>&lsquo;<samp>prev</samp>&rsquo;</dt>
  31798. <dd><p>Set number of previous frames to use for denoising. By default is set to 0.
  31799. </p>
  31800. </dd>
  31801. <dt>&lsquo;<samp>next</samp>&rsquo;</dt>
  31802. <dd><p>Set number of next frames to to use for denoising. By default is set to 0.
  31803. </p>
  31804. </dd>
  31805. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  31806. <dd><p>Set planes which will be filtered, by default are all available filtered
  31807. except alpha.
  31808. </p></dd>
  31809. </dl>
  31810. <a name="fftfilt"></a>
  31811. <h2 class="section"><a href="ffmpeg-all.html#toc-fftfilt">39.70 fftfilt</a></h2>
  31812. <p>Apply arbitrary expressions to samples in frequency domain
  31813. </p>
  31814. <dl compact="compact">
  31815. <dt>&lsquo;<samp>dc_Y</samp>&rsquo;</dt>
  31816. <dd><p>Adjust the dc value (gain) of the luma plane of the image. The filter
  31817. accepts an integer value in range <code>0</code> to <code>1000</code>. The default
  31818. value is set to <code>0</code>.
  31819. </p>
  31820. </dd>
  31821. <dt>&lsquo;<samp>dc_U</samp>&rsquo;</dt>
  31822. <dd><p>Adjust the dc value (gain) of the 1st chroma plane of the image. The
  31823. filter accepts an integer value in range <code>0</code> to <code>1000</code>. The
  31824. default value is set to <code>0</code>.
  31825. </p>
  31826. </dd>
  31827. <dt>&lsquo;<samp>dc_V</samp>&rsquo;</dt>
  31828. <dd><p>Adjust the dc value (gain) of the 2nd chroma plane of the image. The
  31829. filter accepts an integer value in range <code>0</code> to <code>1000</code>. The
  31830. default value is set to <code>0</code>.
  31831. </p>
  31832. </dd>
  31833. <dt>&lsquo;<samp>weight_Y</samp>&rsquo;</dt>
  31834. <dd><p>Set the frequency domain weight expression for the luma plane.
  31835. </p>
  31836. </dd>
  31837. <dt>&lsquo;<samp>weight_U</samp>&rsquo;</dt>
  31838. <dd><p>Set the frequency domain weight expression for the 1st chroma plane.
  31839. </p>
  31840. </dd>
  31841. <dt>&lsquo;<samp>weight_V</samp>&rsquo;</dt>
  31842. <dd><p>Set the frequency domain weight expression for the 2nd chroma plane.
  31843. </p>
  31844. </dd>
  31845. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  31846. <dd><p>Set when the expressions are evaluated.
  31847. </p>
  31848. <p>It accepts the following values:
  31849. </p><dl compact="compact">
  31850. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  31851. <dd><p>Only evaluate expressions once during the filter initialization.
  31852. </p>
  31853. </dd>
  31854. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  31855. <dd><p>Evaluate expressions for each incoming frame.
  31856. </p></dd>
  31857. </dl>
  31858. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  31859. </p>
  31860. <p>The filter accepts the following variables:
  31861. </p></dd>
  31862. <dt>&lsquo;<samp>X</samp>&rsquo;</dt>
  31863. <dt>&lsquo;<samp>Y</samp>&rsquo;</dt>
  31864. <dd><p>The coordinates of the current sample.
  31865. </p>
  31866. </dd>
  31867. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  31868. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  31869. <dd><p>The width and height of the image.
  31870. </p>
  31871. </dd>
  31872. <dt>&lsquo;<samp>N</samp>&rsquo;</dt>
  31873. <dd><p>The number of input frame, starting from 0.
  31874. </p></dd>
  31875. </dl>
  31876. <a name="Examples-103"></a>
  31877. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-103">39.70.1 Examples</a></h3>
  31878. <ul>
  31879. <li>
  31880. High-pass:
  31881. <div class="example">
  31882. <pre class="example">fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
  31883. </pre></div>
  31884. </li><li>
  31885. Low-pass:
  31886. <div class="example">
  31887. <pre class="example">fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
  31888. </pre></div>
  31889. </li><li>
  31890. Sharpen:
  31891. <div class="example">
  31892. <pre class="example">fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
  31893. </pre></div>
  31894. </li><li>
  31895. Blur:
  31896. <div class="example">
  31897. <pre class="example">fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
  31898. </pre></div>
  31899. </li></ul>
  31900. <a name="field"></a>
  31901. <h2 class="section"><a href="ffmpeg-all.html#toc-field">39.71 field</a></h2>
  31902. <p>Extract a single field from an interlaced image using stride
  31903. arithmetic to avoid wasting CPU time. The output frames are marked as
  31904. non-interlaced.
  31905. </p>
  31906. <p>The filter accepts the following options:
  31907. </p>
  31908. <dl compact="compact">
  31909. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  31910. <dd><p>Specify whether to extract the top (if the value is <code>0</code> or
  31911. <code>top</code>) or the bottom field (if the value is <code>1</code> or
  31912. <code>bottom</code>).
  31913. </p></dd>
  31914. </dl>
  31915. <a name="fieldhint"></a>
  31916. <h2 class="section"><a href="ffmpeg-all.html#toc-fieldhint">39.72 fieldhint</a></h2>
  31917. <p>Create new frames by copying the top and bottom fields from surrounding frames
  31918. supplied as numbers by the hint file.
  31919. </p>
  31920. <dl compact="compact">
  31921. <dt>&lsquo;<samp>hint</samp>&rsquo;</dt>
  31922. <dd><p>Set file containing hints: absolute/relative frame numbers.
  31923. </p>
  31924. <p>There must be one line for each frame in a clip. Each line must contain two
  31925. numbers separated by the comma, optionally followed by <code>-</code> or <code>+</code>.
  31926. Numbers supplied on each line of file can not be out of [N-1,N+1] where N
  31927. is current frame number for <code>absolute</code> mode or out of [-1, 1] range
  31928. for <code>relative</code> mode. First number tells from which frame to pick up top
  31929. field and second number tells from which frame to pick up bottom field.
  31930. </p>
  31931. <p>If optionally followed by <code>+</code> output frame will be marked as interlaced,
  31932. else if followed by <code>-</code> output frame will be marked as progressive, else
  31933. it will be marked same as input frame.
  31934. If optionally followed by <code>t</code> output frame will use only top field, or in
  31935. case of <code>b</code> it will use only bottom field.
  31936. If line starts with <code>#</code> or <code>;</code> that line is skipped.
  31937. </p>
  31938. </dd>
  31939. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  31940. <dd><p>Can be item <code>absolute</code> or <code>relative</code>. Default is <code>absolute</code>.
  31941. </p></dd>
  31942. </dl>
  31943. <p>Example of first several lines of <code>hint</code> file for <code>relative</code> mode:
  31944. </p><div class="example">
  31945. <pre class="example">0,0 - # first frame
  31946. 1,0 - # second frame, use third's frame top field and second's frame bottom field
  31947. 1,0 - # third frame, use fourth's frame top field and third's frame bottom field
  31948. 1,0 -
  31949. 0,0 -
  31950. 0,0 -
  31951. 1,0 -
  31952. 1,0 -
  31953. 1,0 -
  31954. 0,0 -
  31955. 0,0 -
  31956. 1,0 -
  31957. 1,0 -
  31958. 1,0 -
  31959. 0,0 -
  31960. </pre></div>
  31961. <a name="fieldmatch"></a>
  31962. <h2 class="section"><a href="ffmpeg-all.html#toc-fieldmatch">39.73 fieldmatch</a></h2>
  31963. <p>Field matching filter for inverse telecine. It is meant to reconstruct the
  31964. progressive frames from a telecined stream. The filter does not drop duplicated
  31965. frames, so to achieve a complete inverse telecine <code>fieldmatch</code> needs to be
  31966. followed by a decimation filter such as <a href="#decimate">decimate</a> in the filtergraph.
  31967. </p>
  31968. <p>The separation of the field matching and the decimation is notably motivated by
  31969. the possibility of inserting a de-interlacing filter fallback between the two.
  31970. If the source has mixed telecined and real interlaced content,
  31971. <code>fieldmatch</code> will not be able to match fields for the interlaced parts.
  31972. But these remaining combed frames will be marked as interlaced, and thus can be
  31973. de-interlaced by a later filter such as <a href="#yadif">yadif</a> before decimation.
  31974. </p>
  31975. <p>In addition to the various configuration options, <code>fieldmatch</code> can take an
  31976. optional second stream, activated through the &lsquo;<samp>ppsrc</samp>&rsquo; option. If
  31977. enabled, the frames reconstruction will be based on the fields and frames from
  31978. this second stream. This allows the first input to be pre-processed in order to
  31979. help the various algorithms of the filter, while keeping the output lossless
  31980. (assuming the fields are matched properly). Typically, a field-aware denoiser,
  31981. or brightness/contrast adjustments can help.
  31982. </p>
  31983. <p>Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
  31984. and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
  31985. which <code>fieldmatch</code> is based on. While the semantic and usage are very
  31986. close, some behaviour and options names can differ.
  31987. </p>
  31988. <p>The <a href="#decimate">decimate</a> filter currently only works for constant frame rate input.
  31989. If your input has mixed telecined (30fps) and progressive content with a lower
  31990. framerate like 24fps use the following filterchain to produce the necessary cfr
  31991. stream: <code>dejudder,fps=30000/1001,fieldmatch,decimate</code>.
  31992. </p>
  31993. <p>The filter accepts the following options:
  31994. </p>
  31995. <dl compact="compact">
  31996. <dt>&lsquo;<samp>order</samp>&rsquo;</dt>
  31997. <dd><p>Specify the assumed field order of the input stream. Available values are:
  31998. </p>
  31999. <dl compact="compact">
  32000. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  32001. <dd><p>Auto detect parity (use FFmpeg&rsquo;s internal parity value).
  32002. </p></dd>
  32003. <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
  32004. <dd><p>Assume bottom field first.
  32005. </p></dd>
  32006. <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
  32007. <dd><p>Assume top field first.
  32008. </p></dd>
  32009. </dl>
  32010. <p>Note that it is sometimes recommended not to trust the parity announced by the
  32011. stream.
  32012. </p>
  32013. <p>Default value is <var>auto</var>.
  32014. </p>
  32015. </dd>
  32016. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  32017. <dd><p>Set the matching mode or strategy to use. &lsquo;<samp>pc</samp>&rsquo; mode is the safest in the
  32018. sense that it won&rsquo;t risk creating jerkiness due to duplicate frames when
  32019. possible, but if there are bad edits or blended fields it will end up
  32020. outputting combed frames when a good match might actually exist. On the other
  32021. hand, &lsquo;<samp>pcn_ub</samp>&rsquo; mode is the most risky in terms of creating jerkiness,
  32022. but will almost always find a good frame if there is one. The other values are
  32023. all somewhere in between &lsquo;<samp>pc</samp>&rsquo; and &lsquo;<samp>pcn_ub</samp>&rsquo; in terms of risking
  32024. jerkiness and creating duplicate frames versus finding good matches in sections
  32025. with bad edits, orphaned fields, blended fields, etc.
  32026. </p>
  32027. <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.
  32028. </p>
  32029. <p>Available values are:
  32030. </p>
  32031. <dl compact="compact">
  32032. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  32033. <dd><p>2-way matching (p/c)
  32034. </p></dd>
  32035. <dt>&lsquo;<samp>pc_n</samp>&rsquo;</dt>
  32036. <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
  32037. </p></dd>
  32038. <dt>&lsquo;<samp>pc_u</samp>&rsquo;</dt>
  32039. <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
  32040. </p></dd>
  32041. <dt>&lsquo;<samp>pc_n_ub</samp>&rsquo;</dt>
  32042. <dd><p>2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
  32043. still combed (p/c + n + u/b)
  32044. </p></dd>
  32045. <dt>&lsquo;<samp>pcn</samp>&rsquo;</dt>
  32046. <dd><p>3-way matching (p/c/n)
  32047. </p></dd>
  32048. <dt>&lsquo;<samp>pcn_ub</samp>&rsquo;</dt>
  32049. <dd><p>3-way matching, and trying 4th/5th matches if all 3 of the original matches are
  32050. detected as combed (p/c/n + u/b)
  32051. </p></dd>
  32052. </dl>
  32053. <p>The parenthesis at the end indicate the matches that would be used for that
  32054. mode assuming &lsquo;<samp>order</samp>&rsquo;=<var>tff</var> (and &lsquo;<samp>field</samp>&rsquo; on <var>auto</var> or
  32055. <var>top</var>).
  32056. </p>
  32057. <p>In terms of speed &lsquo;<samp>pc</samp>&rsquo; mode is by far the fastest and &lsquo;<samp>pcn_ub</samp>&rsquo; is
  32058. the slowest.
  32059. </p>
  32060. <p>Default value is <var>pc_n</var>.
  32061. </p>
  32062. </dd>
  32063. <dt>&lsquo;<samp>ppsrc</samp>&rsquo;</dt>
  32064. <dd><p>Mark the main input stream as a pre-processed input, and enable the secondary
  32065. input stream as the clean source to pick the fields from. See the filter
  32066. introduction for more details. It is similar to the &lsquo;<samp>clip2</samp>&rsquo; feature from
  32067. VFM/TFM.
  32068. </p>
  32069. <p>Default value is <code>0</code> (disabled).
  32070. </p>
  32071. </dd>
  32072. <dt>&lsquo;<samp>field</samp>&rsquo;</dt>
  32073. <dd><p>Set the field to match from. It is recommended to set this to the same value as
  32074. &lsquo;<samp>order</samp>&rsquo; unless you experience matching failures with that setting. In
  32075. certain circumstances changing the field that is used to match from can have a
  32076. large impact on matching performance. Available values are:
  32077. </p>
  32078. <dl compact="compact">
  32079. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  32080. <dd><p>Automatic (same value as &lsquo;<samp>order</samp>&rsquo;).
  32081. </p></dd>
  32082. <dt>&lsquo;<samp>bottom</samp>&rsquo;</dt>
  32083. <dd><p>Match from the bottom field.
  32084. </p></dd>
  32085. <dt>&lsquo;<samp>top</samp>&rsquo;</dt>
  32086. <dd><p>Match from the top field.
  32087. </p></dd>
  32088. </dl>
  32089. <p>Default value is <var>auto</var>.
  32090. </p>
  32091. </dd>
  32092. <dt>&lsquo;<samp>mchroma</samp>&rsquo;</dt>
  32093. <dd><p>Set whether or not chroma is included during the match comparisons. In most
  32094. cases it is recommended to leave this enabled. You should set this to <code>0</code>
  32095. only if your clip has bad chroma problems such as heavy rainbowing or other
  32096. artifacts. Setting this to <code>0</code> could also be used to speed things up at
  32097. the cost of some accuracy.
  32098. </p>
  32099. <p>Default value is <code>1</code>.
  32100. </p>
  32101. </dd>
  32102. <dt>&lsquo;<samp>y0</samp>&rsquo;</dt>
  32103. <dt>&lsquo;<samp>y1</samp>&rsquo;</dt>
  32104. <dd><p>These define an exclusion band which excludes the lines between &lsquo;<samp>y0</samp>&rsquo; and
  32105. &lsquo;<samp>y1</samp>&rsquo; from being included in the field matching decision. An exclusion
  32106. band can be used to ignore subtitles, a logo, or other things that may
  32107. interfere with the matching. &lsquo;<samp>y0</samp>&rsquo; sets the starting scan line and
  32108. &lsquo;<samp>y1</samp>&rsquo; sets the ending line; all lines in between &lsquo;<samp>y0</samp>&rsquo; and
  32109. &lsquo;<samp>y1</samp>&rsquo; (including &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo;) will be ignored. Setting
  32110. &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo; to the same value will disable the feature.
  32111. &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo; defaults to <code>0</code>.
  32112. </p>
  32113. </dd>
  32114. <dt>&lsquo;<samp>scthresh</samp>&rsquo;</dt>
  32115. <dd><p>Set the scene change detection threshold as a percentage of maximum change on
  32116. the luma plane. Good values are in the <code>[8.0, 14.0]</code> range. Scene change
  32117. detection is only relevant in case &lsquo;<samp>combmatch</samp>&rsquo;=<var>sc</var>. The range for
  32118. &lsquo;<samp>scthresh</samp>&rsquo; is <code>[0.0, 100.0]</code>.
  32119. </p>
  32120. <p>Default value is <code>12.0</code>.
  32121. </p>
  32122. </dd>
  32123. <dt>&lsquo;<samp>combmatch</samp>&rsquo;</dt>
  32124. <dd><p>When &lsquo;<samp>combatch</samp>&rsquo; is not <var>none</var>, <code>fieldmatch</code> will take into
  32125. account the combed scores of matches when deciding what match to use as the
  32126. final match. Available values are:
  32127. </p>
  32128. <dl compact="compact">
  32129. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  32130. <dd><p>No final matching based on combed scores.
  32131. </p></dd>
  32132. <dt>&lsquo;<samp>sc</samp>&rsquo;</dt>
  32133. <dd><p>Combed scores are only used when a scene change is detected.
  32134. </p></dd>
  32135. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  32136. <dd><p>Use combed scores all the time.
  32137. </p></dd>
  32138. </dl>
  32139. <p>Default is <var>sc</var>.
  32140. </p>
  32141. </dd>
  32142. <dt>&lsquo;<samp>combdbg</samp>&rsquo;</dt>
  32143. <dd><p>Force <code>fieldmatch</code> to calculate the combed metrics for certain matches and
  32144. print them. This setting is known as &lsquo;<samp>micout</samp>&rsquo; in TFM/VFM vocabulary.
  32145. Available values are:
  32146. </p>
  32147. <dl compact="compact">
  32148. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  32149. <dd><p>No forced calculation.
  32150. </p></dd>
  32151. <dt>&lsquo;<samp>pcn</samp>&rsquo;</dt>
  32152. <dd><p>Force p/c/n calculations.
  32153. </p></dd>
  32154. <dt>&lsquo;<samp>pcnub</samp>&rsquo;</dt>
  32155. <dd><p>Force p/c/n/u/b calculations.
  32156. </p></dd>
  32157. </dl>
  32158. <p>Default value is <var>none</var>.
  32159. </p>
  32160. </dd>
  32161. <dt>&lsquo;<samp>cthresh</samp>&rsquo;</dt>
  32162. <dd><p>This is the area combing threshold used for combed frame detection. This
  32163. essentially controls how &quot;strong&quot; or &quot;visible&quot; combing must be to be detected.
  32164. Larger values mean combing must be more visible and smaller values mean combing
  32165. can be less visible or strong and still be detected. Valid settings are from
  32166. <code>-1</code> (every pixel will be detected as combed) to <code>255</code> (no pixel will
  32167. be detected as combed). This is basically a pixel difference value. A good
  32168. range is <code>[8, 12]</code>.
  32169. </p>
  32170. <p>Default value is <code>9</code>.
  32171. </p>
  32172. </dd>
  32173. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  32174. <dd><p>Sets whether or not chroma is considered in the combed frame decision. Only
  32175. disable this if your source has chroma problems (rainbowing, etc.) that are
  32176. causing problems for the combed frame detection with chroma enabled. Actually,
  32177. using &lsquo;<samp>chroma</samp>&rsquo;=<var>0</var> is usually more reliable, except for the case
  32178. where there is chroma only combing in the source.
  32179. </p>
  32180. <p>Default value is <code>0</code>.
  32181. </p>
  32182. </dd>
  32183. <dt>&lsquo;<samp>blockx</samp>&rsquo;</dt>
  32184. <dt>&lsquo;<samp>blocky</samp>&rsquo;</dt>
  32185. <dd><p>Respectively set the x-axis and y-axis size of the window used during combed
  32186. frame detection. This has to do with the size of the area in which
  32187. &lsquo;<samp>combpel</samp>&rsquo; pixels are required to be detected as combed for a frame to be
  32188. declared combed. See the &lsquo;<samp>combpel</samp>&rsquo; parameter description for more info.
  32189. Possible values are any number that is a power of 2 starting at 4 and going up
  32190. to 512.
  32191. </p>
  32192. <p>Default value is <code>16</code>.
  32193. </p>
  32194. </dd>
  32195. <dt>&lsquo;<samp>combpel</samp>&rsquo;</dt>
  32196. <dd><p>The number of combed pixels inside any of the &lsquo;<samp>blocky</samp>&rsquo; by
  32197. &lsquo;<samp>blockx</samp>&rsquo; size blocks on the frame for the frame to be detected as
  32198. combed. While &lsquo;<samp>cthresh</samp>&rsquo; controls how &quot;visible&quot; the combing must be, this
  32199. setting controls &quot;how much&quot; combing there must be in any localized area (a
  32200. window defined by the &lsquo;<samp>blockx</samp>&rsquo; and &lsquo;<samp>blocky</samp>&rsquo; settings) on the
  32201. frame. Minimum value is <code>0</code> and maximum is <code>blocky x blockx</code> (at
  32202. which point no frames will ever be detected as combed). This setting is known
  32203. as &lsquo;<samp>MI</samp>&rsquo; in TFM/VFM vocabulary.
  32204. </p>
  32205. <p>Default value is <code>80</code>.
  32206. </p></dd>
  32207. </dl>
  32208. <p><a name="p_002fc_002fn_002fu_002fb-meaning"></a>
  32209. </p><a name="p_002fc_002fn_002fu_002fb-meaning-1"></a>
  32210. <h3 class="subsection"><a href="ffmpeg-all.html#toc-p_002fc_002fn_002fu_002fb-meaning-1">39.73.1 p/c/n/u/b meaning</a></h3>
  32211. <a name="p_002fc_002fn"></a>
  32212. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-p_002fc_002fn">39.73.1.1 p/c/n</a></h4>
  32213. <p>We assume the following telecined stream:
  32214. </p>
  32215. <div class="example">
  32216. <pre class="example">Top fields: 1 2 2 3 4
  32217. Bottom fields: 1 2 3 4 4
  32218. </pre></div>
  32219. <p>The numbers correspond to the progressive frame the fields relate to. Here, the
  32220. first two frames are progressive, the 3rd and 4th are combed, and so on.
  32221. </p>
  32222. <p>When <code>fieldmatch</code> is configured to run a matching from bottom
  32223. (&lsquo;<samp>field</samp>&rsquo;=<var>bottom</var>) this is how this input stream get transformed:
  32224. </p>
  32225. <div class="example">
  32226. <pre class="example">Input stream:
  32227. T 1 2 2 3 4
  32228. B 1 2 3 4 4 &lt;-- matching reference
  32229. Matches: c c n n c
  32230. Output stream:
  32231. T 1 2 3 4 4
  32232. B 1 2 3 4 4
  32233. </pre></div>
  32234. <p>As a result of the field matching, we can see that some frames get duplicated.
  32235. To perform a complete inverse telecine, you need to rely on a decimation filter
  32236. after this operation. See for instance the <a href="#decimate">decimate</a> filter.
  32237. </p>
  32238. <p>The same operation now matching from top fields (&lsquo;<samp>field</samp>&rsquo;=<var>top</var>)
  32239. looks like this:
  32240. </p>
  32241. <div class="example">
  32242. <pre class="example">Input stream:
  32243. T 1 2 2 3 4 &lt;-- matching reference
  32244. B 1 2 3 4 4
  32245. Matches: c c p p c
  32246. Output stream:
  32247. T 1 2 2 3 4
  32248. B 1 2 2 3 4
  32249. </pre></div>
  32250. <p>In these examples, we can see what <var>p</var>, <var>c</var> and <var>n</var> mean;
  32251. basically, they refer to the frame and field of the opposite parity:
  32252. </p>
  32253. <ul>
  32254. <li> <var>p</var> matches the field of the opposite parity in the previous frame
  32255. </li><li> <var>c</var> matches the field of the opposite parity in the current frame
  32256. </li><li> <var>n</var> matches the field of the opposite parity in the next frame
  32257. </li></ul>
  32258. <a name="u_002fb"></a>
  32259. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-u_002fb">39.73.1.2 u/b</a></h4>
  32260. <p>The <var>u</var> and <var>b</var> matching are a bit special in the sense that they match
  32261. from the opposite parity flag. In the following examples, we assume that we are
  32262. currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
  32263. &rsquo;x&rsquo; is placed above and below each matched fields.
  32264. </p>
  32265. <p>With bottom matching (&lsquo;<samp>field</samp>&rsquo;=<var>bottom</var>):
  32266. </p><div class="example">
  32267. <pre class="example">Match: c p n b u
  32268. x x x x x
  32269. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  32270. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  32271. x x x x x
  32272. Output frames:
  32273. 2 1 2 2 2
  32274. 2 2 2 1 3
  32275. </pre></div>
  32276. <p>With top matching (&lsquo;<samp>field</samp>&rsquo;=<var>top</var>):
  32277. </p><div class="example">
  32278. <pre class="example">Match: c p n b u
  32279. x x x x x
  32280. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  32281. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  32282. x x x x x
  32283. Output frames:
  32284. 2 2 2 1 2
  32285. 2 1 3 2 2
  32286. </pre></div>
  32287. <a name="Examples-20"></a>
  32288. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-20">39.73.2 Examples</a></h3>
  32289. <p>Simple IVTC of a top field first telecined stream:
  32290. </p><div class="example">
  32291. <pre class="example">fieldmatch=order=tff:combmatch=none, decimate
  32292. </pre></div>
  32293. <p>Advanced IVTC, with fallback on <a href="#yadif">yadif</a> for still combed frames:
  32294. </p><div class="example">
  32295. <pre class="example">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
  32296. </pre></div>
  32297. <a name="fieldorder"></a>
  32298. <h2 class="section"><a href="ffmpeg-all.html#toc-fieldorder">39.74 fieldorder</a></h2>
  32299. <p>Transform the field order of the input video.
  32300. </p>
  32301. <p>It accepts the following parameters:
  32302. </p>
  32303. <dl compact="compact">
  32304. <dt>&lsquo;<samp>order</samp>&rsquo;</dt>
  32305. <dd><p>The output field order. Valid values are <var>tff</var> for top field first or <var>bff</var>
  32306. for bottom field first.
  32307. </p></dd>
  32308. </dl>
  32309. <p>The default value is &lsquo;<samp>tff</samp>&rsquo;.
  32310. </p>
  32311. <p>The transformation is done by shifting the picture content up or down
  32312. by one line, and filling the remaining line with appropriate picture content.
  32313. This method is consistent with most broadcast field order converters.
  32314. </p>
  32315. <p>If the input video is not flagged as being interlaced, or it is already
  32316. flagged as being of the required output field order, then this filter does
  32317. not alter the incoming video.
  32318. </p>
  32319. <p>It is very useful when converting to or from PAL DV material,
  32320. which is bottom field first.
  32321. </p>
  32322. <p>For example:
  32323. </p><div class="example">
  32324. <pre class="example">ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
  32325. </pre></div>
  32326. <a name="fifo_002c-afifo"></a>
  32327. <h2 class="section"><a href="ffmpeg-all.html#toc-fifo_002c-afifo">39.75 fifo, afifo</a></h2>
  32328. <p>Buffer input images and send them when they are requested.
  32329. </p>
  32330. <p>It is mainly useful when auto-inserted by the libavfilter
  32331. framework.
  32332. </p>
  32333. <p>It does not take parameters.
  32334. </p>
  32335. <a name="fillborders"></a>
  32336. <h2 class="section"><a href="ffmpeg-all.html#toc-fillborders">39.76 fillborders</a></h2>
  32337. <p>Fill borders of the input video, without changing video stream dimensions.
  32338. Sometimes video can have garbage at the four edges and you may not want to
  32339. crop video input to keep size multiple of some number.
  32340. </p>
  32341. <p>This filter accepts the following options:
  32342. </p>
  32343. <dl compact="compact">
  32344. <dt>&lsquo;<samp>left</samp>&rsquo;</dt>
  32345. <dd><p>Number of pixels to fill from left border.
  32346. </p>
  32347. </dd>
  32348. <dt>&lsquo;<samp>right</samp>&rsquo;</dt>
  32349. <dd><p>Number of pixels to fill from right border.
  32350. </p>
  32351. </dd>
  32352. <dt>&lsquo;<samp>top</samp>&rsquo;</dt>
  32353. <dd><p>Number of pixels to fill from top border.
  32354. </p>
  32355. </dd>
  32356. <dt>&lsquo;<samp>bottom</samp>&rsquo;</dt>
  32357. <dd><p>Number of pixels to fill from bottom border.
  32358. </p>
  32359. </dd>
  32360. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  32361. <dd><p>Set fill mode.
  32362. </p>
  32363. <p>It accepts the following values:
  32364. </p><dl compact="compact">
  32365. <dt>&lsquo;<samp>smear</samp>&rsquo;</dt>
  32366. <dd><p>fill pixels using outermost pixels
  32367. </p>
  32368. </dd>
  32369. <dt>&lsquo;<samp>mirror</samp>&rsquo;</dt>
  32370. <dd><p>fill pixels using mirroring
  32371. </p>
  32372. </dd>
  32373. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  32374. <dd><p>fill pixels with constant value
  32375. </p></dd>
  32376. </dl>
  32377. <p>Default is <var>smear</var>.
  32378. </p>
  32379. </dd>
  32380. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  32381. <dd><p>Set color for pixels in fixed mode. Default is <var>black</var>.
  32382. </p></dd>
  32383. </dl>
  32384. <a name="Commands-7"></a>
  32385. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-7">39.76.1 Commands</a></h3>
  32386. <p>This filter supports same <a href="#commands">commands</a> as options.
  32387. The command accepts the same syntax of the corresponding option.
  32388. </p>
  32389. <p>If the specified expression is not valid, it is kept at its current
  32390. value.
  32391. </p>
  32392. <a name="find_005frect"></a>
  32393. <h2 class="section"><a href="ffmpeg-all.html#toc-find_005frect">39.77 find_rect</a></h2>
  32394. <p>Find a rectangular object
  32395. </p>
  32396. <p>It accepts the following options:
  32397. </p>
  32398. <dl compact="compact">
  32399. <dt>&lsquo;<samp>object</samp>&rsquo;</dt>
  32400. <dd><p>Filepath of the object image, needs to be in gray8.
  32401. </p>
  32402. </dd>
  32403. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  32404. <dd><p>Detection threshold, default is 0.5.
  32405. </p>
  32406. </dd>
  32407. <dt>&lsquo;<samp>mipmaps</samp>&rsquo;</dt>
  32408. <dd><p>Number of mipmaps, default is 3.
  32409. </p>
  32410. </dd>
  32411. <dt>&lsquo;<samp>xmin, ymin, xmax, ymax</samp>&rsquo;</dt>
  32412. <dd><p>Specifies the rectangle in which to search.
  32413. </p></dd>
  32414. </dl>
  32415. <a name="Examples-158"></a>
  32416. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-158">39.77.1 Examples</a></h3>
  32417. <ul>
  32418. <li>
  32419. Cover a rectangular object by the supplied image of a given video using <code>ffmpeg</code>:
  32420. <div class="example">
  32421. <pre class="example">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  32422. </pre></div>
  32423. </li></ul>
  32424. <a name="floodfill"></a>
  32425. <h2 class="section"><a href="ffmpeg-all.html#toc-floodfill">39.78 floodfill</a></h2>
  32426. <p>Flood area with values of same pixel components with another values.
  32427. </p>
  32428. <p>It accepts the following options:
  32429. </p><dl compact="compact">
  32430. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  32431. <dd><p>Set pixel x coordinate.
  32432. </p>
  32433. </dd>
  32434. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  32435. <dd><p>Set pixel y coordinate.
  32436. </p>
  32437. </dd>
  32438. <dt>&lsquo;<samp>s0</samp>&rsquo;</dt>
  32439. <dd><p>Set source #0 component value.
  32440. </p>
  32441. </dd>
  32442. <dt>&lsquo;<samp>s1</samp>&rsquo;</dt>
  32443. <dd><p>Set source #1 component value.
  32444. </p>
  32445. </dd>
  32446. <dt>&lsquo;<samp>s2</samp>&rsquo;</dt>
  32447. <dd><p>Set source #2 component value.
  32448. </p>
  32449. </dd>
  32450. <dt>&lsquo;<samp>s3</samp>&rsquo;</dt>
  32451. <dd><p>Set source #3 component value.
  32452. </p>
  32453. </dd>
  32454. <dt>&lsquo;<samp>d0</samp>&rsquo;</dt>
  32455. <dd><p>Set destination #0 component value.
  32456. </p>
  32457. </dd>
  32458. <dt>&lsquo;<samp>d1</samp>&rsquo;</dt>
  32459. <dd><p>Set destination #1 component value.
  32460. </p>
  32461. </dd>
  32462. <dt>&lsquo;<samp>d2</samp>&rsquo;</dt>
  32463. <dd><p>Set destination #2 component value.
  32464. </p>
  32465. </dd>
  32466. <dt>&lsquo;<samp>d3</samp>&rsquo;</dt>
  32467. <dd><p>Set destination #3 component value.
  32468. </p></dd>
  32469. </dl>
  32470. <p><a name="format"></a>
  32471. </p><a name="format-1"></a>
  32472. <h2 class="section"><a href="ffmpeg-all.html#toc-format-1">39.79 format</a></h2>
  32473. <p>Convert the input video to one of the specified pixel formats.
  32474. Libavfilter will try to pick one that is suitable as input to
  32475. the next filter.
  32476. </p>
  32477. <p>It accepts the following parameters:
  32478. </p><dl compact="compact">
  32479. <dt>&lsquo;<samp>pix_fmts</samp>&rsquo;</dt>
  32480. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  32481. &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
  32482. </p>
  32483. </dd>
  32484. </dl>
  32485. <a name="Examples-48"></a>
  32486. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-48">39.79.1 Examples</a></h3>
  32487. <ul>
  32488. <li>
  32489. Convert the input video to the <var>yuv420p</var> format
  32490. <div class="example">
  32491. <pre class="example">format=pix_fmts=yuv420p
  32492. </pre></div>
  32493. <p>Convert the input video to any of the formats in the list
  32494. </p><div class="example">
  32495. <pre class="example">format=pix_fmts=yuv420p|yuv444p|yuv410p
  32496. </pre></div>
  32497. </li></ul>
  32498. <p><a name="fps"></a>
  32499. </p><a name="fps-1"></a>
  32500. <h2 class="section"><a href="ffmpeg-all.html#toc-fps-1">39.80 fps</a></h2>
  32501. <p>Convert the video to specified constant frame rate by duplicating or dropping
  32502. frames as necessary.
  32503. </p>
  32504. <p>It accepts the following parameters:
  32505. </p><dl compact="compact">
  32506. <dt>&lsquo;<samp>fps</samp>&rsquo;</dt>
  32507. <dd><p>The desired output frame rate. The default is <code>25</code>.
  32508. </p>
  32509. </dd>
  32510. <dt>&lsquo;<samp>start_time</samp>&rsquo;</dt>
  32511. <dd><p>Assume the first PTS should be the given value, in seconds. This allows for
  32512. padding/trimming at the start of stream. By default, no assumption is made
  32513. about the first frame&rsquo;s expected PTS, so no padding or trimming is done.
  32514. For example, this could be set to 0 to pad the beginning with duplicates of
  32515. the first frame if a video stream starts after the audio stream or to trim any
  32516. frames with a negative PTS.
  32517. </p>
  32518. </dd>
  32519. <dt>&lsquo;<samp>round</samp>&rsquo;</dt>
  32520. <dd><p>Timestamp (PTS) rounding method.
  32521. </p>
  32522. <p>Possible values are:
  32523. </p><dl compact="compact">
  32524. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  32525. <dd><p>round towards 0
  32526. </p></dd>
  32527. <dt>&lsquo;<samp>inf</samp>&rsquo;</dt>
  32528. <dd><p>round away from 0
  32529. </p></dd>
  32530. <dt>&lsquo;<samp>down</samp>&rsquo;</dt>
  32531. <dd><p>round towards -infinity
  32532. </p></dd>
  32533. <dt>&lsquo;<samp>up</samp>&rsquo;</dt>
  32534. <dd><p>round towards +infinity
  32535. </p></dd>
  32536. <dt>&lsquo;<samp>near</samp>&rsquo;</dt>
  32537. <dd><p>round to nearest
  32538. </p></dd>
  32539. </dl>
  32540. <p>The default is <code>near</code>.
  32541. </p>
  32542. </dd>
  32543. <dt>&lsquo;<samp>eof_action</samp>&rsquo;</dt>
  32544. <dd><p>Action performed when reading the last frame.
  32545. </p>
  32546. <p>Possible values are:
  32547. </p><dl compact="compact">
  32548. <dt>&lsquo;<samp>round</samp>&rsquo;</dt>
  32549. <dd><p>Use same timestamp rounding method as used for other frames.
  32550. </p></dd>
  32551. <dt>&lsquo;<samp>pass</samp>&rsquo;</dt>
  32552. <dd><p>Pass through last frame if input duration has not been reached yet.
  32553. </p></dd>
  32554. </dl>
  32555. <p>The default is <code>round</code>.
  32556. </p>
  32557. </dd>
  32558. </dl>
  32559. <p>Alternatively, the options can be specified as a flat string:
  32560. <var>fps</var>[:<var>start_time</var>[:<var>round</var>]].
  32561. </p>
  32562. <p>See also the <a href="#setpts">setpts</a> filter.
  32563. </p>
  32564. <a name="Examples-145"></a>
  32565. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-145">39.80.1 Examples</a></h3>
  32566. <ul>
  32567. <li>
  32568. A typical usage in order to set the fps to 25:
  32569. <div class="example">
  32570. <pre class="example">fps=fps=25
  32571. </pre></div>
  32572. </li><li>
  32573. Sets the fps to 24, using abbreviation and rounding method to round to nearest:
  32574. <div class="example">
  32575. <pre class="example">fps=fps=film:round=near
  32576. </pre></div>
  32577. </li></ul>
  32578. <a name="framepack"></a>
  32579. <h2 class="section"><a href="ffmpeg-all.html#toc-framepack">39.81 framepack</a></h2>
  32580. <p>Pack two different video streams into a stereoscopic video, setting proper
  32581. metadata on supported codecs. The two views should have the same size and
  32582. framerate and processing will stop when the shorter video ends. Please note
  32583. that you may conveniently adjust view properties with the <a href="#scale">scale</a> and
  32584. <a href="#fps">fps</a> filters.
  32585. </p>
  32586. <p>It accepts the following parameters:
  32587. </p><dl compact="compact">
  32588. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  32589. <dd><p>The desired packing format. Supported values are:
  32590. </p>
  32591. <dl compact="compact">
  32592. <dt>&lsquo;<samp>sbs</samp>&rsquo;</dt>
  32593. <dd><p>The views are next to each other (default).
  32594. </p>
  32595. </dd>
  32596. <dt>&lsquo;<samp>tab</samp>&rsquo;</dt>
  32597. <dd><p>The views are on top of each other.
  32598. </p>
  32599. </dd>
  32600. <dt>&lsquo;<samp>lines</samp>&rsquo;</dt>
  32601. <dd><p>The views are packed by line.
  32602. </p>
  32603. </dd>
  32604. <dt>&lsquo;<samp>columns</samp>&rsquo;</dt>
  32605. <dd><p>The views are packed by column.
  32606. </p>
  32607. </dd>
  32608. <dt>&lsquo;<samp>frameseq</samp>&rsquo;</dt>
  32609. <dd><p>The views are temporally interleaved.
  32610. </p>
  32611. </dd>
  32612. </dl>
  32613. </dd>
  32614. </dl>
  32615. <p>Some examples:
  32616. </p>
  32617. <div class="example">
  32618. <pre class="example"># Convert left and right views into a frame-sequential video
  32619. ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
  32620. # Convert views into a side-by-side video with the same output resolution as the input
  32621. 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
  32622. </pre></div>
  32623. <a name="framerate"></a>
  32624. <h2 class="section"><a href="ffmpeg-all.html#toc-framerate">39.82 framerate</a></h2>
  32625. <p>Change the frame rate by interpolating new video output frames from the source
  32626. frames.
  32627. </p>
  32628. <p>This filter is not designed to function correctly with interlaced media. If
  32629. you wish to change the frame rate of interlaced media then you are required
  32630. to deinterlace before this filter and re-interlace after this filter.
  32631. </p>
  32632. <p>A description of the accepted options follows.
  32633. </p>
  32634. <dl compact="compact">
  32635. <dt>&lsquo;<samp>fps</samp>&rsquo;</dt>
  32636. <dd><p>Specify the output frames per second. This option can also be specified
  32637. as a value alone. The default is <code>50</code>.
  32638. </p>
  32639. </dd>
  32640. <dt>&lsquo;<samp>interp_start</samp>&rsquo;</dt>
  32641. <dd><p>Specify the start of a range where the output frame will be created as a
  32642. linear interpolation of two frames. The range is [<code>0</code>-<code>255</code>],
  32643. the default is <code>15</code>.
  32644. </p>
  32645. </dd>
  32646. <dt>&lsquo;<samp>interp_end</samp>&rsquo;</dt>
  32647. <dd><p>Specify the end of a range where the output frame will be created as a
  32648. linear interpolation of two frames. The range is [<code>0</code>-<code>255</code>],
  32649. the default is <code>240</code>.
  32650. </p>
  32651. </dd>
  32652. <dt>&lsquo;<samp>scene</samp>&rsquo;</dt>
  32653. <dd><p>Specify the level at which a scene change is detected as a value between
  32654. 0 and 100 to indicate a new scene; a low value reflects a low
  32655. probability for the current frame to introduce a new scene, while a higher
  32656. value means the current frame is more likely to be one.
  32657. The default is <code>8.2</code>.
  32658. </p>
  32659. </dd>
  32660. <dt>&lsquo;<samp>flags</samp>&rsquo;</dt>
  32661. <dd><p>Specify flags influencing the filter process.
  32662. </p>
  32663. <p>Available value for <var>flags</var> is:
  32664. </p>
  32665. <dl compact="compact">
  32666. <dt>&lsquo;<samp>scene_change_detect, scd</samp>&rsquo;</dt>
  32667. <dd><p>Enable scene change detection using the value of the option <var>scene</var>.
  32668. This flag is enabled by default.
  32669. </p></dd>
  32670. </dl>
  32671. </dd>
  32672. </dl>
  32673. <a name="framestep"></a>
  32674. <h2 class="section"><a href="ffmpeg-all.html#toc-framestep">39.83 framestep</a></h2>
  32675. <p>Select one frame every N-th frame.
  32676. </p>
  32677. <p>This filter accepts the following option:
  32678. </p><dl compact="compact">
  32679. <dt>&lsquo;<samp>step</samp>&rsquo;</dt>
  32680. <dd><p>Select frame after every <code>step</code> frames.
  32681. Allowed values are positive integers higher than 0. Default value is <code>1</code>.
  32682. </p></dd>
  32683. </dl>
  32684. <a name="freezedetect"></a>
  32685. <h2 class="section"><a href="ffmpeg-all.html#toc-freezedetect">39.84 freezedetect</a></h2>
  32686. <p>Detect frozen video.
  32687. </p>
  32688. <p>This filter logs a message and sets frame metadata when it detects that the
  32689. input video has no significant change in content during a specified duration.
  32690. Video freeze detection calculates the mean average absolute difference of all
  32691. the components of video frames and compares it to a noise floor.
  32692. </p>
  32693. <p>The printed times and duration are expressed in seconds. The
  32694. <code>lavfi.freezedetect.freeze_start</code> metadata key is set on the first frame
  32695. whose timestamp equals or exceeds the detection duration and it contains the
  32696. timestamp of the first frame of the freeze. The
  32697. <code>lavfi.freezedetect.freeze_duration</code> and
  32698. <code>lavfi.freezedetect.freeze_end</code> metadata keys are set on the first frame
  32699. after the freeze.
  32700. </p>
  32701. <p>The filter accepts the following options:
  32702. </p>
  32703. <dl compact="compact">
  32704. <dt>&lsquo;<samp>noise, n</samp>&rsquo;</dt>
  32705. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  32706. specified value) or as a difference ratio between 0 and 1. Default is -60dB, or
  32707. 0.001.
  32708. </p>
  32709. </dd>
  32710. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  32711. <dd><p>Set freeze duration until notification (default is 2 seconds).
  32712. </p></dd>
  32713. </dl>
  32714. <a name="freezeframes"></a>
  32715. <h2 class="section"><a href="ffmpeg-all.html#toc-freezeframes">39.85 freezeframes</a></h2>
  32716. <p>Freeze video frames.
  32717. </p>
  32718. <p>This filter freezes video frames using frame from 2nd input.
  32719. </p>
  32720. <p>The filter accepts the following options:
  32721. </p>
  32722. <dl compact="compact">
  32723. <dt>&lsquo;<samp>first</samp>&rsquo;</dt>
  32724. <dd><p>Set number of first frame from which to start freeze.
  32725. </p>
  32726. </dd>
  32727. <dt>&lsquo;<samp>last</samp>&rsquo;</dt>
  32728. <dd><p>Set number of last frame from which to end freeze.
  32729. </p>
  32730. </dd>
  32731. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  32732. <dd><p>Set number of frame from 2nd input which will be used instead of replaced frames.
  32733. </p></dd>
  32734. </dl>
  32735. <p><a name="frei0r"></a>
  32736. </p><a name="frei0r-1"></a>
  32737. <h2 class="section"><a href="ffmpeg-all.html#toc-frei0r-1">39.86 frei0r</a></h2>
  32738. <p>Apply a frei0r effect to the input video.
  32739. </p>
  32740. <p>To enable the compilation of this filter, you need to install the frei0r
  32741. header and configure FFmpeg with <code>--enable-frei0r</code>.
  32742. </p>
  32743. <p>It accepts the following parameters:
  32744. </p>
  32745. <dl compact="compact">
  32746. <dt>&lsquo;<samp>filter_name</samp>&rsquo;</dt>
  32747. <dd><p>The name of the frei0r effect to load. If the environment variable
  32748. <code>FREI0R_PATH</code> is defined, the frei0r effect is searched for in each of the
  32749. directories specified by the colon-separated list in <code>FREI0R_PATH</code>.
  32750. Otherwise, the standard frei0r paths are searched, in this order:
  32751. &lsquo;<tt>HOME/.frei0r-1/lib/</tt>&rsquo;, &lsquo;<tt>/usr/local/lib/frei0r-1/</tt>&rsquo;,
  32752. &lsquo;<tt>/usr/lib/frei0r-1/</tt>&rsquo;.
  32753. </p>
  32754. </dd>
  32755. <dt>&lsquo;<samp>filter_params</samp>&rsquo;</dt>
  32756. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r effect.
  32757. </p>
  32758. </dd>
  32759. </dl>
  32760. <p>A frei0r effect parameter can be a boolean (its value is either
  32761. &quot;y&quot; or &quot;n&quot;), a double, a color (specified as
  32762. <var>R</var>/<var>G</var>/<var>B</var>, where <var>R</var>, <var>G</var>, and <var>B</var> are floating point
  32763. numbers between 0.0 and 1.0, inclusive) or a color description as specified in the
  32764. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>,
  32765. a position (specified as <var>X</var>/<var>Y</var>, where
  32766. <var>X</var> and <var>Y</var> are floating point numbers) and/or a string.
  32767. </p>
  32768. <p>The number and types of parameters depend on the loaded effect. If an
  32769. effect parameter is not specified, the default value is set.
  32770. </p>
  32771. <a name="Examples-33"></a>
  32772. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-33">39.86.1 Examples</a></h3>
  32773. <ul>
  32774. <li>
  32775. Apply the distort0r effect, setting the first two double parameters:
  32776. <div class="example">
  32777. <pre class="example">frei0r=filter_name=distort0r:filter_params=0.5|0.01
  32778. </pre></div>
  32779. </li><li>
  32780. Apply the colordistance effect, taking a color as the first parameter:
  32781. <div class="example">
  32782. <pre class="example">frei0r=colordistance:0.2/0.3/0.4
  32783. frei0r=colordistance:violet
  32784. frei0r=colordistance:0x112233
  32785. </pre></div>
  32786. </li><li>
  32787. Apply the perspective effect, specifying the top left and top right image
  32788. positions:
  32789. <div class="example">
  32790. <pre class="example">frei0r=perspective:0.2/0.2|0.8/0.2
  32791. </pre></div>
  32792. </li></ul>
  32793. <p>For more information, see
  32794. <a href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
  32795. </p>
  32796. <a name="fspp"></a>
  32797. <h2 class="section"><a href="ffmpeg-all.html#toc-fspp">39.87 fspp</a></h2>
  32798. <p>Apply fast and simple postprocessing. It is a faster version of <a href="#spp">spp</a>.
  32799. </p>
  32800. <p>It splits (I)DCT into horizontal/vertical passes. Unlike the simple post-
  32801. processing filter, one of them is performed once per block, not per pixel.
  32802. This allows for much higher speed.
  32803. </p>
  32804. <p>The filter accepts the following options:
  32805. </p>
  32806. <dl compact="compact">
  32807. <dt>&lsquo;<samp>quality</samp>&rsquo;</dt>
  32808. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  32809. an integer in the range 4-5. Default value is <code>4</code>.
  32810. </p>
  32811. </dd>
  32812. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  32813. <dd><p>Force a constant quantization parameter. It accepts an integer in range 0-63.
  32814. If not set, the filter will use the QP from the video stream (if available).
  32815. </p>
  32816. </dd>
  32817. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  32818. <dd><p>Set filter strength. It accepts an integer in range -15 to 32. Lower values mean
  32819. more details but also more artifacts, while higher values make the image smoother
  32820. but also blurrier. Default value is <code>0</code> − PSNR optimal.
  32821. </p>
  32822. </dd>
  32823. <dt>&lsquo;<samp>use_bframe_qp</samp>&rsquo;</dt>
  32824. <dd><p>Enable the use of the QP from the B-Frames if set to <code>1</code>. Using this
  32825. option may cause flicker since the B-Frames have often larger QP. Default is
  32826. <code>0</code> (not enabled).
  32827. </p>
  32828. </dd>
  32829. </dl>
  32830. <a name="gblur"></a>
  32831. <h2 class="section"><a href="ffmpeg-all.html#toc-gblur">39.88 gblur</a></h2>
  32832. <p>Apply Gaussian blur filter.
  32833. </p>
  32834. <p>The filter accepts the following options:
  32835. </p>
  32836. <dl compact="compact">
  32837. <dt>&lsquo;<samp>sigma</samp>&rsquo;</dt>
  32838. <dd><p>Set horizontal sigma, standard deviation of Gaussian blur. Default is <code>0.5</code>.
  32839. </p>
  32840. </dd>
  32841. <dt>&lsquo;<samp>steps</samp>&rsquo;</dt>
  32842. <dd><p>Set number of steps for Gaussian approximation. Default is <code>1</code>.
  32843. </p>
  32844. </dd>
  32845. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  32846. <dd><p>Set which planes to filter. By default all planes are filtered.
  32847. </p>
  32848. </dd>
  32849. <dt>&lsquo;<samp>sigmaV</samp>&rsquo;</dt>
  32850. <dd><p>Set vertical sigma, if negative it will be same as <code>sigma</code>.
  32851. Default is <code>-1</code>.
  32852. </p></dd>
  32853. </dl>
  32854. <a name="Commands-24"></a>
  32855. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-24">39.88.1 Commands</a></h3>
  32856. <p>This filter supports same commands as options.
  32857. The command accepts the same syntax of the corresponding option.
  32858. </p>
  32859. <p>If the specified expression is not valid, it is kept at its current
  32860. value.
  32861. </p>
  32862. <a name="geq"></a>
  32863. <h2 class="section"><a href="ffmpeg-all.html#toc-geq">39.89 geq</a></h2>
  32864. <p>Apply generic equation to each pixel.
  32865. </p>
  32866. <p>The filter accepts the following options:
  32867. </p>
  32868. <dl compact="compact">
  32869. <dt>&lsquo;<samp>lum_expr, lum</samp>&rsquo;</dt>
  32870. <dd><p>Set the luminance expression.
  32871. </p></dd>
  32872. <dt>&lsquo;<samp>cb_expr, cb</samp>&rsquo;</dt>
  32873. <dd><p>Set the chrominance blue expression.
  32874. </p></dd>
  32875. <dt>&lsquo;<samp>cr_expr, cr</samp>&rsquo;</dt>
  32876. <dd><p>Set the chrominance red expression.
  32877. </p></dd>
  32878. <dt>&lsquo;<samp>alpha_expr, a</samp>&rsquo;</dt>
  32879. <dd><p>Set the alpha expression.
  32880. </p></dd>
  32881. <dt>&lsquo;<samp>red_expr, r</samp>&rsquo;</dt>
  32882. <dd><p>Set the red expression.
  32883. </p></dd>
  32884. <dt>&lsquo;<samp>green_expr, g</samp>&rsquo;</dt>
  32885. <dd><p>Set the green expression.
  32886. </p></dd>
  32887. <dt>&lsquo;<samp>blue_expr, b</samp>&rsquo;</dt>
  32888. <dd><p>Set the blue expression.
  32889. </p></dd>
  32890. </dl>
  32891. <p>The colorspace is selected according to the specified options. If one
  32892. of the &lsquo;<samp>lum_expr</samp>&rsquo;, &lsquo;<samp>cb_expr</samp>&rsquo;, or &lsquo;<samp>cr_expr</samp>&rsquo;
  32893. options is specified, the filter will automatically select a YCbCr
  32894. colorspace. If one of the &lsquo;<samp>red_expr</samp>&rsquo;, &lsquo;<samp>green_expr</samp>&rsquo;, or
  32895. &lsquo;<samp>blue_expr</samp>&rsquo; options is specified, it will select an RGB
  32896. colorspace.
  32897. </p>
  32898. <p>If one of the chrominance expression is not defined, it falls back on the other
  32899. one. If no alpha expression is specified it will evaluate to opaque value.
  32900. If none of chrominance expressions are specified, they will evaluate
  32901. to the luminance expression.
  32902. </p>
  32903. <p>The expressions can use the following variables and functions:
  32904. </p>
  32905. <dl compact="compact">
  32906. <dt>&lsquo;<samp>N</samp>&rsquo;</dt>
  32907. <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
  32908. </p>
  32909. </dd>
  32910. <dt>&lsquo;<samp>X</samp>&rsquo;</dt>
  32911. <dt>&lsquo;<samp>Y</samp>&rsquo;</dt>
  32912. <dd><p>The coordinates of the current sample.
  32913. </p>
  32914. </dd>
  32915. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  32916. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  32917. <dd><p>The width and height of the image.
  32918. </p>
  32919. </dd>
  32920. <dt>&lsquo;<samp>SW</samp>&rsquo;</dt>
  32921. <dt>&lsquo;<samp>SH</samp>&rsquo;</dt>
  32922. <dd><p>Width and height scale depending on the currently filtered plane. It is the
  32923. ratio between the corresponding luma plane number of pixels and the current
  32924. plane ones. E.g. for YUV4:2:0 the values are <code>1,1</code> for the luma plane, and
  32925. <code>0.5,0.5</code> for chroma planes.
  32926. </p>
  32927. </dd>
  32928. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  32929. <dd><p>Time of the current frame, expressed in seconds.
  32930. </p>
  32931. </dd>
  32932. <dt>&lsquo;<samp>p(x, y)</samp>&rsquo;</dt>
  32933. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the current
  32934. plane.
  32935. </p>
  32936. </dd>
  32937. <dt>&lsquo;<samp>lum(x, y)</samp>&rsquo;</dt>
  32938. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the luminance
  32939. plane.
  32940. </p>
  32941. </dd>
  32942. <dt>&lsquo;<samp>cb(x, y)</samp>&rsquo;</dt>
  32943. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  32944. blue-difference chroma plane. Return 0 if there is no such plane.
  32945. </p>
  32946. </dd>
  32947. <dt>&lsquo;<samp>cr(x, y)</samp>&rsquo;</dt>
  32948. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  32949. red-difference chroma plane. Return 0 if there is no such plane.
  32950. </p>
  32951. </dd>
  32952. <dt>&lsquo;<samp>r(x, y)</samp>&rsquo;</dt>
  32953. <dt>&lsquo;<samp>g(x, y)</samp>&rsquo;</dt>
  32954. <dt>&lsquo;<samp>b(x, y)</samp>&rsquo;</dt>
  32955. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  32956. red/green/blue component. Return 0 if there is no such component.
  32957. </p>
  32958. </dd>
  32959. <dt>&lsquo;<samp>alpha(x, y)</samp>&rsquo;</dt>
  32960. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the alpha
  32961. plane. Return 0 if there is no such plane.
  32962. </p>
  32963. </dd>
  32964. <dt>&lsquo;<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>&rsquo;</dt>
  32965. <dd><p>Sum of sample values in the rectangle from (0,0) to (x,y), this allows obtaining
  32966. sums of samples within a rectangle. See the functions without the sum postfix.
  32967. </p>
  32968. </dd>
  32969. <dt>&lsquo;<samp>interpolation</samp>&rsquo;</dt>
  32970. <dd><p>Set one of interpolation methods:
  32971. </p><dl compact="compact">
  32972. <dt>&lsquo;<samp>nearest, n</samp>&rsquo;</dt>
  32973. <dt>&lsquo;<samp>bilinear, b</samp>&rsquo;</dt>
  32974. </dl>
  32975. <p>Default is bilinear.
  32976. </p></dd>
  32977. </dl>
  32978. <p>For functions, if <var>x</var> and <var>y</var> are outside the area, the value will be
  32979. automatically clipped to the closer edge.
  32980. </p>
  32981. <p>Please note that this filter can use multiple threads in which case each slice
  32982. will have its own expression state. If you want to use only a single expression
  32983. state because your expressions depend on previous state then you should limit
  32984. the number of filter threads to 1.
  32985. </p>
  32986. <a name="Examples-6"></a>
  32987. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-6">39.89.1 Examples</a></h3>
  32988. <ul>
  32989. <li>
  32990. Flip the image horizontally:
  32991. <div class="example">
  32992. <pre class="example">geq=p(W-X\,Y)
  32993. </pre></div>
  32994. </li><li>
  32995. Generate a bidimensional sine wave, with angle <code>PI/3</code> and a
  32996. wavelength of 100 pixels:
  32997. <div class="example">
  32998. <pre class="example">geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
  32999. </pre></div>
  33000. </li><li>
  33001. Generate a fancy enigmatic moving light:
  33002. <div class="example">
  33003. <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
  33004. </pre></div>
  33005. </li><li>
  33006. Generate a quick emboss effect:
  33007. <div class="example">
  33008. <pre class="example">format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
  33009. </pre></div>
  33010. </li><li>
  33011. Modify RGB components depending on pixel position:
  33012. <div class="example">
  33013. <pre class="example">geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
  33014. </pre></div>
  33015. </li><li>
  33016. Create a radial gradient that is the same size as the input (also see
  33017. the <a href="#vignette">vignette</a> filter):
  33018. <div class="example">
  33019. <pre class="example">geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray
  33020. </pre></div>
  33021. </li></ul>
  33022. <a name="gradfun"></a>
  33023. <h2 class="section"><a href="ffmpeg-all.html#toc-gradfun">39.90 gradfun</a></h2>
  33024. <p>Fix the banding artifacts that are sometimes introduced into nearly flat
  33025. regions by truncation to 8-bit color depth.
  33026. Interpolate the gradients that should go where the bands are, and
  33027. dither them.
  33028. </p>
  33029. <p>It is designed for playback only. Do not use it prior to
  33030. lossy compression, because compression tends to lose the dither and
  33031. bring back the bands.
  33032. </p>
  33033. <p>It accepts the following parameters:
  33034. </p>
  33035. <dl compact="compact">
  33036. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  33037. <dd><p>The maximum amount by which the filter will change any one pixel. This is also
  33038. the threshold for detecting nearly flat regions. Acceptable values range from
  33039. .51 to 64; the default value is 1.2. Out-of-range values will be clipped to the
  33040. valid range.
  33041. </p>
  33042. </dd>
  33043. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  33044. <dd><p>The neighborhood to fit the gradient to. A larger radius makes for smoother
  33045. gradients, but also prevents the filter from modifying the pixels near detailed
  33046. regions. Acceptable values are 8-32; the default value is 16. Out-of-range
  33047. values will be clipped to the valid range.
  33048. </p>
  33049. </dd>
  33050. </dl>
  33051. <p>Alternatively, the options can be specified as a flat string:
  33052. <var>strength</var>[:<var>radius</var>]
  33053. </p>
  33054. <a name="Examples"></a>
  33055. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples">39.90.1 Examples</a></h3>
  33056. <ul>
  33057. <li>
  33058. Apply the filter with a <code>3.5</code> strength and radius of <code>8</code>:
  33059. <div class="example">
  33060. <pre class="example">gradfun=3.5:8
  33061. </pre></div>
  33062. </li><li>
  33063. Specify radius, omitting the strength (which will fall-back to the default
  33064. value):
  33065. <div class="example">
  33066. <pre class="example">gradfun=radius=8
  33067. </pre></div>
  33068. </li></ul>
  33069. <p><a name="graphmonitor"></a>
  33070. </p><a name="graphmonitor-1"></a>
  33071. <h2 class="section"><a href="ffmpeg-all.html#toc-graphmonitor-1">39.91 graphmonitor</a></h2>
  33072. <p>Show various filtergraph stats.
  33073. </p>
  33074. <p>With this filter one can debug complete filtergraph.
  33075. Especially issues with links filling with queued frames.
  33076. </p>
  33077. <p>The filter accepts the following options:
  33078. </p>
  33079. <dl compact="compact">
  33080. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  33081. <dd><p>Set video output size. Default is <var>hd720</var>.
  33082. </p>
  33083. </dd>
  33084. <dt>&lsquo;<samp>opacity, o</samp>&rsquo;</dt>
  33085. <dd><p>Set video opacity. Default is <var>0.9</var>. Allowed range is from <var>0</var> to <var>1</var>.
  33086. </p>
  33087. </dd>
  33088. <dt>&lsquo;<samp>mode, m</samp>&rsquo;</dt>
  33089. <dd><p>Set output mode, can be <var>fulll</var> or <var>compact</var>.
  33090. In <var>compact</var> mode only filters with some queued frames have displayed stats.
  33091. </p>
  33092. </dd>
  33093. <dt>&lsquo;<samp>flags, f</samp>&rsquo;</dt>
  33094. <dd><p>Set flags which enable which stats are shown in video.
  33095. </p>
  33096. <p>Available values for flags are:
  33097. </p><dl compact="compact">
  33098. <dt>&lsquo;<samp>queue</samp>&rsquo;</dt>
  33099. <dd><p>Display number of queued frames in each link.
  33100. </p>
  33101. </dd>
  33102. <dt>&lsquo;<samp>frame_count_in</samp>&rsquo;</dt>
  33103. <dd><p>Display number of frames taken from filter.
  33104. </p>
  33105. </dd>
  33106. <dt>&lsquo;<samp>frame_count_out</samp>&rsquo;</dt>
  33107. <dd><p>Display number of frames given out from filter.
  33108. </p>
  33109. </dd>
  33110. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  33111. <dd><p>Display current filtered frame pts.
  33112. </p>
  33113. </dd>
  33114. <dt>&lsquo;<samp>time</samp>&rsquo;</dt>
  33115. <dd><p>Display current filtered frame time.
  33116. </p>
  33117. </dd>
  33118. <dt>&lsquo;<samp>timebase</samp>&rsquo;</dt>
  33119. <dd><p>Display time base for filter link.
  33120. </p>
  33121. </dd>
  33122. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  33123. <dd><p>Display used format for filter link.
  33124. </p>
  33125. </dd>
  33126. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  33127. <dd><p>Display video size or number of audio channels in case of audio used by filter link.
  33128. </p>
  33129. </dd>
  33130. <dt>&lsquo;<samp>rate</samp>&rsquo;</dt>
  33131. <dd><p>Display video frame rate or sample rate in case of audio used by filter link.
  33132. </p></dd>
  33133. </dl>
  33134. </dd>
  33135. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  33136. <dd><p>Set upper limit for video rate of output stream, Default value is <var>25</var>.
  33137. This guarantee that output video frame rate will not be higher than this value.
  33138. </p></dd>
  33139. </dl>
  33140. <a name="greyedge"></a>
  33141. <h2 class="section"><a href="ffmpeg-all.html#toc-greyedge">39.92 greyedge</a></h2>
  33142. <p>A color constancy variation filter which estimates scene illumination via grey edge algorithm
  33143. and corrects the scene colors accordingly.
  33144. </p>
  33145. <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>
  33146. </p>
  33147. <p>The filter accepts the following options:
  33148. </p>
  33149. <dl compact="compact">
  33150. <dt>&lsquo;<samp>difford</samp>&rsquo;</dt>
  33151. <dd><p>The order of differentiation to be applied on the scene. Must be chosen in the range
  33152. [0,2] and default value is 1.
  33153. </p>
  33154. </dd>
  33155. <dt>&lsquo;<samp>minknorm</samp>&rsquo;</dt>
  33156. <dd><p>The Minkowski parameter to be used for calculating the Minkowski distance. Must
  33157. be chosen in the range [0,20] and default value is 1. Set to 0 for getting
  33158. max value instead of calculating Minkowski distance.
  33159. </p>
  33160. </dd>
  33161. <dt>&lsquo;<samp>sigma</samp>&rsquo;</dt>
  33162. <dd><p>The standard deviation of Gaussian blur to be applied on the scene. Must be
  33163. chosen in the range [0,1024.0] and default value = 1. floor( <var>sigma</var> * break_off_sigma(3) )
  33164. can&rsquo;t be equal to 0 if <var>difford</var> is greater than 0.
  33165. </p></dd>
  33166. </dl>
  33167. <a name="Examples-147"></a>
  33168. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-147">39.92.1 Examples</a></h3>
  33169. <ul>
  33170. <li>
  33171. Grey Edge:
  33172. <div class="example">
  33173. <pre class="example">greyedge=difford=1:minknorm=5:sigma=2
  33174. </pre></div>
  33175. </li><li>
  33176. Max Edge:
  33177. <div class="example">
  33178. <pre class="example">greyedge=difford=1:minknorm=0:sigma=2
  33179. </pre></div>
  33180. </li></ul>
  33181. <p><a name="haldclut"></a>
  33182. </p><a name="haldclut-1"></a>
  33183. <h2 class="section"><a href="ffmpeg-all.html#toc-haldclut-1">39.93 haldclut</a></h2>
  33184. <p>Apply a Hald CLUT to a video stream.
  33185. </p>
  33186. <p>First input is the video stream to process, and second one is the Hald CLUT.
  33187. The Hald CLUT input can be a simple picture or a complete video stream.
  33188. </p>
  33189. <p>The filter accepts the following options:
  33190. </p>
  33191. <dl compact="compact">
  33192. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  33193. <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
  33194. </p></dd>
  33195. <dt>&lsquo;<samp>repeatlast</samp>&rsquo;</dt>
  33196. <dd><p>Continue applying the last CLUT after the end of the stream. A value of
  33197. <code>0</code> disable the filter after the last frame of the CLUT is reached.
  33198. Default is <code>1</code>.
  33199. </p></dd>
  33200. </dl>
  33201. <p><code>haldclut</code> also has the same interpolation options as <a href="#lut3d">lut3d</a> (both
  33202. filters share the same internals).
  33203. </p>
  33204. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  33205. </p>
  33206. <p>More information about the Hald CLUT can be found on Eskil Steenberg&rsquo;s website
  33207. (Hald CLUT author) at <a href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
  33208. </p>
  33209. <a name="Workflow-examples"></a>
  33210. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Workflow-examples">39.93.1 Workflow examples</a></h3>
  33211. <a name="Hald-CLUT-video-stream"></a>
  33212. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Hald-CLUT-video-stream">39.93.1.1 Hald CLUT video stream</a></h4>
  33213. <p>Generate an identity Hald CLUT stream altered with various effects:
  33214. </p><div class="example">
  33215. <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
  33216. </pre></div>
  33217. <p>Note: make sure you use a lossless codec.
  33218. </p>
  33219. <p>Then use it with <code>haldclut</code> to apply it on some random stream:
  33220. </p><div class="example">
  33221. <pre class="example">ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
  33222. </pre></div>
  33223. <p>The Hald CLUT will be applied to the 10 first seconds (duration of
  33224. &lsquo;<tt>clut.nut</tt>&rsquo;), then the latest picture of that CLUT stream will be applied
  33225. to the remaining frames of the <code>mandelbrot</code> stream.
  33226. </p>
  33227. <a name="Hald-CLUT-with-preview"></a>
  33228. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Hald-CLUT-with-preview">39.93.1.2 Hald CLUT with preview</a></h4>
  33229. <p>A Hald CLUT is supposed to be a squared image of <code>Level*Level*Level</code> by
  33230. <code>Level*Level*Level</code> pixels. For a given Hald CLUT, FFmpeg will select the
  33231. biggest possible square starting at the top left of the picture. The remaining
  33232. padding pixels (bottom or right) will be ignored. This area can be used to add
  33233. a preview of the Hald CLUT.
  33234. </p>
  33235. <p>Typically, the following generated Hald CLUT will be supported by the
  33236. <code>haldclut</code> filter:
  33237. </p>
  33238. <div class="example">
  33239. <pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;
  33240. pad=iw+320 [padded_clut];
  33241. smptebars=s=320x256, split [a][b];
  33242. [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
  33243. [main][b] overlay=W-320&quot; -frames:v 1 clut.png
  33244. </pre></div>
  33245. <p>It contains the original and a preview of the effect of the CLUT: SMPTE color
  33246. bars are displayed on the right-top, and below the same color bars processed by
  33247. the color changes.
  33248. </p>
  33249. <p>Then, the effect of this Hald CLUT can be visualized with:
  33250. </p><div class="example">
  33251. <pre class="example">ffplay input.mkv -vf &quot;movie=clut.png, [in] haldclut&quot;
  33252. </pre></div>
  33253. <a name="hflip"></a>
  33254. <h2 class="section"><a href="ffmpeg-all.html#toc-hflip">39.94 hflip</a></h2>
  33255. <p>Flip the input video horizontally.
  33256. </p>
  33257. <p>For example, to horizontally flip the input video with <code>ffmpeg</code>:
  33258. </p><div class="example">
  33259. <pre class="example">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
  33260. </pre></div>
  33261. <a name="histeq"></a>
  33262. <h2 class="section"><a href="ffmpeg-all.html#toc-histeq">39.95 histeq</a></h2>
  33263. <p>This filter applies a global color histogram equalization on a
  33264. per-frame basis.
  33265. </p>
  33266. <p>It can be used to correct video that has a compressed range of pixel
  33267. intensities. The filter redistributes the pixel intensities to
  33268. equalize their distribution across the intensity range. It may be
  33269. viewed as an &quot;automatically adjusting contrast filter&quot;. This filter is
  33270. useful only for correcting degraded or poorly captured source
  33271. video.
  33272. </p>
  33273. <p>The filter accepts the following options:
  33274. </p>
  33275. <dl compact="compact">
  33276. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  33277. <dd><p>Determine the amount of equalization to be applied. As the strength
  33278. is reduced, the distribution of pixel intensities more-and-more
  33279. approaches that of the input frame. The value must be a float number
  33280. in the range [0,1] and defaults to 0.200.
  33281. </p>
  33282. </dd>
  33283. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  33284. <dd><p>Set the maximum intensity that can generated and scale the output
  33285. values appropriately. The strength should be set as desired and then
  33286. the intensity can be limited if needed to avoid washing-out. The value
  33287. must be a float number in the range [0,1] and defaults to 0.210.
  33288. </p>
  33289. </dd>
  33290. <dt>&lsquo;<samp>antibanding</samp>&rsquo;</dt>
  33291. <dd><p>Set the antibanding level. If enabled the filter will randomly vary
  33292. the luminance of output pixels by a small amount to avoid banding of
  33293. the histogram. Possible values are <code>none</code>, <code>weak</code> or
  33294. <code>strong</code>. It defaults to <code>none</code>.
  33295. </p></dd>
  33296. </dl>
  33297. <p><a name="histogram"></a>
  33298. </p><a name="histogram-1"></a>
  33299. <h2 class="section"><a href="ffmpeg-all.html#toc-histogram-1">39.96 histogram</a></h2>
  33300. <p>Compute and draw a color distribution histogram for the input video.
  33301. </p>
  33302. <p>The computed histogram is a representation of the color component
  33303. distribution in an image.
  33304. </p>
  33305. <p>Standard histogram displays the color components distribution in an image.
  33306. Displays color graph for each color component. Shows distribution of
  33307. the Y, U, V, A or R, G, B components, depending on input format, in the
  33308. current frame. Below each graph a color component scale meter is shown.
  33309. </p>
  33310. <p>The filter accepts the following options:
  33311. </p>
  33312. <dl compact="compact">
  33313. <dt>&lsquo;<samp>level_height</samp>&rsquo;</dt>
  33314. <dd><p>Set height of level. Default value is <code>200</code>.
  33315. Allowed range is [50, 2048].
  33316. </p>
  33317. </dd>
  33318. <dt>&lsquo;<samp>scale_height</samp>&rsquo;</dt>
  33319. <dd><p>Set height of color scale. Default value is <code>12</code>.
  33320. Allowed range is [0, 40].
  33321. </p>
  33322. </dd>
  33323. <dt>&lsquo;<samp>display_mode</samp>&rsquo;</dt>
  33324. <dd><p>Set display mode.
  33325. It accepts the following values:
  33326. </p><dl compact="compact">
  33327. <dt>&lsquo;<samp>stack</samp>&rsquo;</dt>
  33328. <dd><p>Per color component graphs are placed below each other.
  33329. </p>
  33330. </dd>
  33331. <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
  33332. <dd><p>Per color component graphs are placed side by side.
  33333. </p>
  33334. </dd>
  33335. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  33336. <dd><p>Presents information identical to that in the <code>parade</code>, except
  33337. that the graphs representing color components are superimposed directly
  33338. over one another.
  33339. </p></dd>
  33340. </dl>
  33341. <p>Default is <code>stack</code>.
  33342. </p>
  33343. </dd>
  33344. <dt>&lsquo;<samp>levels_mode</samp>&rsquo;</dt>
  33345. <dd><p>Set mode. Can be either <code>linear</code>, or <code>logarithmic</code>.
  33346. Default is <code>linear</code>.
  33347. </p>
  33348. </dd>
  33349. <dt>&lsquo;<samp>components</samp>&rsquo;</dt>
  33350. <dd><p>Set what color components to display.
  33351. Default is <code>7</code>.
  33352. </p>
  33353. </dd>
  33354. <dt>&lsquo;<samp>fgopacity</samp>&rsquo;</dt>
  33355. <dd><p>Set foreground opacity. Default is <code>0.7</code>.
  33356. </p>
  33357. </dd>
  33358. <dt>&lsquo;<samp>bgopacity</samp>&rsquo;</dt>
  33359. <dd><p>Set background opacity. Default is <code>0.5</code>.
  33360. </p></dd>
  33361. </dl>
  33362. <a name="Examples-78"></a>
  33363. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-78">39.96.1 Examples</a></h3>
  33364. <ul>
  33365. <li>
  33366. Calculate and draw histogram:
  33367. <div class="example">
  33368. <pre class="example">ffplay -i input -vf histogram
  33369. </pre></div>
  33370. </li></ul>
  33371. <p><a name="hqdn3d"></a>
  33372. </p><a name="hqdn3d-1"></a>
  33373. <h2 class="section"><a href="ffmpeg-all.html#toc-hqdn3d-1">39.97 hqdn3d</a></h2>
  33374. <p>This is a high precision/quality 3d denoise filter. It aims to reduce
  33375. image noise, producing smooth images and making still images really
  33376. still. It should enhance compressibility.
  33377. </p>
  33378. <p>It accepts the following optional parameters:
  33379. </p>
  33380. <dl compact="compact">
  33381. <dt>&lsquo;<samp>luma_spatial</samp>&rsquo;</dt>
  33382. <dd><p>A non-negative floating point number which specifies spatial luma strength.
  33383. It defaults to 4.0.
  33384. </p>
  33385. </dd>
  33386. <dt>&lsquo;<samp>chroma_spatial</samp>&rsquo;</dt>
  33387. <dd><p>A non-negative floating point number which specifies spatial chroma strength.
  33388. It defaults to 3.0*<var>luma_spatial</var>/4.0.
  33389. </p>
  33390. </dd>
  33391. <dt>&lsquo;<samp>luma_tmp</samp>&rsquo;</dt>
  33392. <dd><p>A floating point number which specifies luma temporal strength. It defaults to
  33393. 6.0*<var>luma_spatial</var>/4.0.
  33394. </p>
  33395. </dd>
  33396. <dt>&lsquo;<samp>chroma_tmp</samp>&rsquo;</dt>
  33397. <dd><p>A floating point number which specifies chroma temporal strength. It defaults to
  33398. <var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>.
  33399. </p></dd>
  33400. </dl>
  33401. <a name="Commands-59"></a>
  33402. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-59">39.97.1 Commands</a></h3>
  33403. <p>This filter supports same <a href="#commands">commands</a> as options.
  33404. The command accepts the same syntax of the corresponding option.
  33405. </p>
  33406. <p>If the specified expression is not valid, it is kept at its current
  33407. value.
  33408. </p>
  33409. <p><a name="hwdownload"></a>
  33410. </p><a name="hwdownload-1"></a>
  33411. <h2 class="section"><a href="ffmpeg-all.html#toc-hwdownload-1">39.98 hwdownload</a></h2>
  33412. <p>Download hardware frames to system memory.
  33413. </p>
  33414. <p>The input must be in hardware frames, and the output a non-hardware format.
  33415. Not all formats will be supported on the output - it may be necessary to insert
  33416. an additional &lsquo;<samp>format</samp>&rsquo; filter immediately following in the graph to get
  33417. the output in a supported format.
  33418. </p>
  33419. <a name="hwmap"></a>
  33420. <h2 class="section"><a href="ffmpeg-all.html#toc-hwmap">39.99 hwmap</a></h2>
  33421. <p>Map hardware frames to system memory or to another device.
  33422. </p>
  33423. <p>This filter has several different modes of operation; which one is used depends
  33424. on the input and output formats:
  33425. </p><ul>
  33426. <li>
  33427. Hardware frame input, normal frame output
  33428. <p>Map the input frames to system memory and pass them to the output. If the
  33429. original hardware frame is later required (for example, after overlaying
  33430. something else on part of it), the &lsquo;<samp>hwmap</samp>&rsquo; filter can be used again
  33431. in the next mode to retrieve it.
  33432. </p></li><li>
  33433. Normal frame input, hardware frame output
  33434. <p>If the input is actually a software-mapped hardware frame, then unmap it -
  33435. that is, return the original hardware frame.
  33436. </p>
  33437. <p>Otherwise, a device must be provided. Create new hardware surfaces on that
  33438. device for the output, then map them back to the software format at the input
  33439. and give those frames to the preceding filter. This will then act like the
  33440. &lsquo;<samp>hwupload</samp>&rsquo; filter, but may be able to avoid an additional copy when
  33441. the input is already in a compatible format.
  33442. </p></li><li>
  33443. Hardware frame input and output
  33444. <p>A device must be supplied for the output, either directly or with the
  33445. &lsquo;<samp>derive_device</samp>&rsquo; option. The input and output devices must be of
  33446. different types and compatible - the exact meaning of this is
  33447. system-dependent, but typically it means that they must refer to the same
  33448. underlying hardware context (for example, refer to the same graphics card).
  33449. </p>
  33450. <p>If the input frames were originally created on the output device, then unmap
  33451. to retrieve the original frames.
  33452. </p>
  33453. <p>Otherwise, map the frames to the output device - create new hardware frames
  33454. on the output corresponding to the frames on the input.
  33455. </p></li></ul>
  33456. <p>The following additional parameters are accepted:
  33457. </p>
  33458. <dl compact="compact">
  33459. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  33460. <dd><p>Set the frame mapping mode. Some combination of:
  33461. </p><dl compact="compact">
  33462. <dt><var>read</var></dt>
  33463. <dd><p>The mapped frame should be readable.
  33464. </p></dd>
  33465. <dt><var>write</var></dt>
  33466. <dd><p>The mapped frame should be writeable.
  33467. </p></dd>
  33468. <dt><var>overwrite</var></dt>
  33469. <dd><p>The mapping will always overwrite the entire frame.
  33470. </p>
  33471. <p>This may improve performance in some cases, as the original contents of the
  33472. frame need not be loaded.
  33473. </p></dd>
  33474. <dt><var>direct</var></dt>
  33475. <dd><p>The mapping must not involve any copying.
  33476. </p>
  33477. <p>Indirect mappings to copies of frames are created in some cases where either
  33478. direct mapping is not possible or it would have unexpected properties.
  33479. Setting this flag ensures that the mapping is direct and will fail if that is
  33480. not possible.
  33481. </p></dd>
  33482. </dl>
  33483. <p>Defaults to <var>read+write</var> if not specified.
  33484. </p>
  33485. </dd>
  33486. <dt>&lsquo;<samp>derive_device <var>type</var></samp>&rsquo;</dt>
  33487. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  33488. device of type <var>type</var> from the device the input frames exist on.
  33489. </p>
  33490. </dd>
  33491. <dt>&lsquo;<samp>reverse</samp>&rsquo;</dt>
  33492. <dd><p>In a hardware to hardware mapping, map in reverse - create frames in the sink
  33493. and map them back to the source. This may be necessary in some cases where
  33494. a mapping in one direction is required but only the opposite direction is
  33495. supported by the devices being used.
  33496. </p>
  33497. <p>This option is dangerous - it may break the preceding filter in undefined
  33498. ways if there are any additional constraints on that filter&rsquo;s output.
  33499. Do not use it without fully understanding the implications of its use.
  33500. </p></dd>
  33501. </dl>
  33502. <p><a name="hwupload"></a>
  33503. </p><a name="hwupload-1"></a>
  33504. <h2 class="section"><a href="ffmpeg-all.html#toc-hwupload-1">39.100 hwupload</a></h2>
  33505. <p>Upload system memory frames to hardware surfaces.
  33506. </p>
  33507. <p>The device to upload to must be supplied when the filter is initialised. If
  33508. using ffmpeg, select the appropriate device with the &lsquo;<samp>-filter_hw_device</samp>&rsquo;
  33509. option or with the &lsquo;<samp>derive_device</samp>&rsquo; option. The input and output devices
  33510. must be of different types and compatible - the exact meaning of this is
  33511. system-dependent, but typically it means that they must refer to the same
  33512. underlying hardware context (for example, refer to the same graphics card).
  33513. </p>
  33514. <p>The following additional parameters are accepted:
  33515. </p>
  33516. <dl compact="compact">
  33517. <dt>&lsquo;<samp>derive_device <var>type</var></samp>&rsquo;</dt>
  33518. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  33519. device of type <var>type</var> from the device the input frames exist on.
  33520. </p></dd>
  33521. </dl>
  33522. <p><a name="hwupload_005fcuda"></a>
  33523. </p><a name="hwupload_005fcuda-1"></a>
  33524. <h2 class="section"><a href="ffmpeg-all.html#toc-hwupload_005fcuda-1">39.101 hwupload_cuda</a></h2>
  33525. <p>Upload system memory frames to a CUDA device.
  33526. </p>
  33527. <p>It accepts the following optional parameters:
  33528. </p>
  33529. <dl compact="compact">
  33530. <dt>&lsquo;<samp>device</samp>&rsquo;</dt>
  33531. <dd><p>The number of the CUDA device to use
  33532. </p></dd>
  33533. </dl>
  33534. <a name="hqx"></a>
  33535. <h2 class="section"><a href="ffmpeg-all.html#toc-hqx">39.102 hqx</a></h2>
  33536. <p>Apply a high-quality magnification filter designed for pixel art. This filter
  33537. was originally created by Maxim Stepin.
  33538. </p>
  33539. <p>It accepts the following option:
  33540. </p>
  33541. <dl compact="compact">
  33542. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  33543. <dd><p>Set the scaling dimension: <code>2</code> for <code>hq2x</code>, <code>3</code> for
  33544. <code>hq3x</code> and <code>4</code> for <code>hq4x</code>.
  33545. Default is <code>3</code>.
  33546. </p></dd>
  33547. </dl>
  33548. <a name="hstack"></a>
  33549. <h2 class="section"><a href="ffmpeg-all.html#toc-hstack">39.103 hstack</a></h2>
  33550. <p>Stack input videos horizontally.
  33551. </p>
  33552. <p>All streams must be of same pixel format and of same height.
  33553. </p>
  33554. <p>Note that this filter is faster than using <a href="#overlay">overlay</a> and <a href="#pad">pad</a> filter
  33555. to create same output.
  33556. </p>
  33557. <p>The filter accepts the following option:
  33558. </p>
  33559. <dl compact="compact">
  33560. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  33561. <dd><p>Set number of input streams. Default is 2.
  33562. </p>
  33563. </dd>
  33564. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  33565. <dd><p>If set to 1, force the output to terminate when the shortest input
  33566. terminates. Default value is 0.
  33567. </p></dd>
  33568. </dl>
  33569. <a name="hue"></a>
  33570. <h2 class="section"><a href="ffmpeg-all.html#toc-hue">39.104 hue</a></h2>
  33571. <p>Modify the hue and/or the saturation of the input.
  33572. </p>
  33573. <p>It accepts the following parameters:
  33574. </p>
  33575. <dl compact="compact">
  33576. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  33577. <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
  33578. and defaults to &quot;0&quot;.
  33579. </p>
  33580. </dd>
  33581. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  33582. <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
  33583. defaults to &quot;1&quot;.
  33584. </p>
  33585. </dd>
  33586. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  33587. <dd><p>Specify the hue angle as a number of radians. It accepts an
  33588. expression, and defaults to &quot;0&quot;.
  33589. </p>
  33590. </dd>
  33591. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  33592. <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
  33593. defaults to &quot;0&quot;.
  33594. </p></dd>
  33595. </dl>
  33596. <p>&lsquo;<samp>h</samp>&rsquo; and &lsquo;<samp>H</samp>&rsquo; are mutually exclusive, and can&rsquo;t be
  33597. specified at the same time.
  33598. </p>
  33599. <p>The &lsquo;<samp>b</samp>&rsquo;, &lsquo;<samp>h</samp>&rsquo;, &lsquo;<samp>H</samp>&rsquo; and &lsquo;<samp>s</samp>&rsquo; option values are
  33600. expressions containing the following constants:
  33601. </p>
  33602. <dl compact="compact">
  33603. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  33604. <dd><p>frame count of the input frame starting from 0
  33605. </p>
  33606. </dd>
  33607. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  33608. <dd><p>presentation timestamp of the input frame expressed in time base units
  33609. </p>
  33610. </dd>
  33611. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  33612. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  33613. </p>
  33614. </dd>
  33615. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  33616. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  33617. </p>
  33618. </dd>
  33619. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  33620. <dd><p>time base of the input video
  33621. </p></dd>
  33622. </dl>
  33623. <a name="Examples-104"></a>
  33624. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-104">39.104.1 Examples</a></h3>
  33625. <ul>
  33626. <li>
  33627. Set the hue to 90 degrees and the saturation to 1.0:
  33628. <div class="example">
  33629. <pre class="example">hue=h=90:s=1
  33630. </pre></div>
  33631. </li><li>
  33632. Same command but expressing the hue in radians:
  33633. <div class="example">
  33634. <pre class="example">hue=H=PI/2:s=1
  33635. </pre></div>
  33636. </li><li>
  33637. Rotate hue and make the saturation swing between 0
  33638. and 2 over a period of 1 second:
  33639. <div class="example">
  33640. <pre class="example">hue=&quot;H=2*PI*t: s=sin(2*PI*t)+1&quot;
  33641. </pre></div>
  33642. </li><li>
  33643. Apply a 3 seconds saturation fade-in effect starting at 0:
  33644. <div class="example">
  33645. <pre class="example">hue=&quot;s=min(t/3\,1)&quot;
  33646. </pre></div>
  33647. <p>The general fade-in expression can be written as:
  33648. </p><div class="example">
  33649. <pre class="example">hue=&quot;s=min(0\, max((t-START)/DURATION\, 1))&quot;
  33650. </pre></div>
  33651. </li><li>
  33652. Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
  33653. <div class="example">
  33654. <pre class="example">hue=&quot;s=max(0\, min(1\, (8-t)/3))&quot;
  33655. </pre></div>
  33656. <p>The general fade-out expression can be written as:
  33657. </p><div class="example">
  33658. <pre class="example">hue=&quot;s=max(0\, min(1\, (START+DURATION-t)/DURATION))&quot;
  33659. </pre></div>
  33660. </li></ul>
  33661. <a name="Commands-28"></a>
  33662. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-28">39.104.2 Commands</a></h3>
  33663. <p>This filter supports the following commands:
  33664. </p><dl compact="compact">
  33665. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  33666. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  33667. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  33668. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  33669. <dd><p>Modify the hue and/or the saturation and/or brightness of the input video.
  33670. The command accepts the same syntax of the corresponding option.
  33671. </p>
  33672. <p>If the specified expression is not valid, it is kept at its current
  33673. value.
  33674. </p></dd>
  33675. </dl>
  33676. <a name="hysteresis"></a>
  33677. <h2 class="section"><a href="ffmpeg-all.html#toc-hysteresis">39.105 hysteresis</a></h2>
  33678. <p>Grow first stream into second stream by connecting components.
  33679. This makes it possible to build more robust edge masks.
  33680. </p>
  33681. <p>This filter accepts the following options:
  33682. </p>
  33683. <dl compact="compact">
  33684. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  33685. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  33686. copied from first stream.
  33687. By default value 0xf, all planes will be processed.
  33688. </p>
  33689. </dd>
  33690. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  33691. <dd><p>Set threshold which is used in filtering. If pixel component value is higher than
  33692. this value filter algorithm for connecting components is activated.
  33693. By default value is 0.
  33694. </p></dd>
  33695. </dl>
  33696. <p>The <code>hysteresis</code> filter also supports the <a href="#framesync">framesync</a> options.
  33697. </p>
  33698. <a name="idet"></a>
  33699. <h2 class="section"><a href="ffmpeg-all.html#toc-idet">39.106 idet</a></h2>
  33700. <p>Detect video interlacing type.
  33701. </p>
  33702. <p>This filter tries to detect if the input frames are interlaced, progressive,
  33703. top or bottom field first. It will also try to detect fields that are
  33704. repeated between adjacent frames (a sign of telecine).
  33705. </p>
  33706. <p>Single frame detection considers only immediately adjacent frames when classifying each frame.
  33707. Multiple frame detection incorporates the classification history of previous frames.
  33708. </p>
  33709. <p>The filter will log these metadata values:
  33710. </p>
  33711. <dl compact="compact">
  33712. <dt>&lsquo;<samp>single.current_frame</samp>&rsquo;</dt>
  33713. <dd><p>Detected type of current frame using single-frame detection. One of:
  33714. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  33715. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  33716. </p>
  33717. </dd>
  33718. <dt>&lsquo;<samp>single.tff</samp>&rsquo;</dt>
  33719. <dd><p>Cumulative number of frames detected as top field first using single-frame detection.
  33720. </p>
  33721. </dd>
  33722. <dt>&lsquo;<samp>multiple.tff</samp>&rsquo;</dt>
  33723. <dd><p>Cumulative number of frames detected as top field first using multiple-frame detection.
  33724. </p>
  33725. </dd>
  33726. <dt>&lsquo;<samp>single.bff</samp>&rsquo;</dt>
  33727. <dd><p>Cumulative number of frames detected as bottom field first using single-frame detection.
  33728. </p>
  33729. </dd>
  33730. <dt>&lsquo;<samp>multiple.current_frame</samp>&rsquo;</dt>
  33731. <dd><p>Detected type of current frame using multiple-frame detection. One of:
  33732. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  33733. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  33734. </p>
  33735. </dd>
  33736. <dt>&lsquo;<samp>multiple.bff</samp>&rsquo;</dt>
  33737. <dd><p>Cumulative number of frames detected as bottom field first using multiple-frame detection.
  33738. </p>
  33739. </dd>
  33740. <dt>&lsquo;<samp>single.progressive</samp>&rsquo;</dt>
  33741. <dd><p>Cumulative number of frames detected as progressive using single-frame detection.
  33742. </p>
  33743. </dd>
  33744. <dt>&lsquo;<samp>multiple.progressive</samp>&rsquo;</dt>
  33745. <dd><p>Cumulative number of frames detected as progressive using multiple-frame detection.
  33746. </p>
  33747. </dd>
  33748. <dt>&lsquo;<samp>single.undetermined</samp>&rsquo;</dt>
  33749. <dd><p>Cumulative number of frames that could not be classified using single-frame detection.
  33750. </p>
  33751. </dd>
  33752. <dt>&lsquo;<samp>multiple.undetermined</samp>&rsquo;</dt>
  33753. <dd><p>Cumulative number of frames that could not be classified using multiple-frame detection.
  33754. </p>
  33755. </dd>
  33756. <dt>&lsquo;<samp>repeated.current_frame</samp>&rsquo;</dt>
  33757. <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;.
  33758. </p>
  33759. </dd>
  33760. <dt>&lsquo;<samp>repeated.neither</samp>&rsquo;</dt>
  33761. <dd><p>Cumulative number of frames with no repeated field.
  33762. </p>
  33763. </dd>
  33764. <dt>&lsquo;<samp>repeated.top</samp>&rsquo;</dt>
  33765. <dd><p>Cumulative number of frames with the top field repeated from the previous frame&rsquo;s top field.
  33766. </p>
  33767. </dd>
  33768. <dt>&lsquo;<samp>repeated.bottom</samp>&rsquo;</dt>
  33769. <dd><p>Cumulative number of frames with the bottom field repeated from the previous frame&rsquo;s bottom field.
  33770. </p></dd>
  33771. </dl>
  33772. <p>The filter accepts the following options:
  33773. </p>
  33774. <dl compact="compact">
  33775. <dt>&lsquo;<samp>intl_thres</samp>&rsquo;</dt>
  33776. <dd><p>Set interlacing threshold.
  33777. </p></dd>
  33778. <dt>&lsquo;<samp>prog_thres</samp>&rsquo;</dt>
  33779. <dd><p>Set progressive threshold.
  33780. </p></dd>
  33781. <dt>&lsquo;<samp>rep_thres</samp>&rsquo;</dt>
  33782. <dd><p>Threshold for repeated field detection.
  33783. </p></dd>
  33784. <dt>&lsquo;<samp>half_life</samp>&rsquo;</dt>
  33785. <dd><p>Number of frames after which a given frame&rsquo;s contribution to the
  33786. statistics is halved (i.e., it contributes only 0.5 to its
  33787. classification). The default of 0 means that all frames seen are given
  33788. full weight of 1.0 forever.
  33789. </p></dd>
  33790. <dt>&lsquo;<samp>analyze_interlaced_flag</samp>&rsquo;</dt>
  33791. <dd><p>When this is not 0 then idet will use the specified number of frames to determine
  33792. if the interlaced flag is accurate, it will not count undetermined frames.
  33793. If the flag is found to be accurate it will be used without any further
  33794. computations, if it is found to be inaccurate it will be cleared without any
  33795. further computations. This allows inserting the idet filter as a low computational
  33796. method to clean up the interlaced flag
  33797. </p></dd>
  33798. </dl>
  33799. <a name="il"></a>
  33800. <h2 class="section"><a href="ffmpeg-all.html#toc-il">39.107 il</a></h2>
  33801. <p>Deinterleave or interleave fields.
  33802. </p>
  33803. <p>This filter allows one to process interlaced images fields without
  33804. deinterlacing them. Deinterleaving splits the input frame into 2
  33805. fields (so called half pictures). Odd lines are moved to the top
  33806. half of the output image, even lines to the bottom half.
  33807. You can process (filter) them independently and then re-interleave them.
  33808. </p>
  33809. <p>The filter accepts the following options:
  33810. </p>
  33811. <dl compact="compact">
  33812. <dt>&lsquo;<samp>luma_mode, l</samp>&rsquo;</dt>
  33813. <dt>&lsquo;<samp>chroma_mode, c</samp>&rsquo;</dt>
  33814. <dt>&lsquo;<samp>alpha_mode, a</samp>&rsquo;</dt>
  33815. <dd><p>Available values for <var>luma_mode</var>, <var>chroma_mode</var> and
  33816. <var>alpha_mode</var> are:
  33817. </p>
  33818. <dl compact="compact">
  33819. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  33820. <dd><p>Do nothing.
  33821. </p>
  33822. </dd>
  33823. <dt>&lsquo;<samp>deinterleave, d</samp>&rsquo;</dt>
  33824. <dd><p>Deinterleave fields, placing one above the other.
  33825. </p>
  33826. </dd>
  33827. <dt>&lsquo;<samp>interleave, i</samp>&rsquo;</dt>
  33828. <dd><p>Interleave fields. Reverse the effect of deinterleaving.
  33829. </p></dd>
  33830. </dl>
  33831. <p>Default value is <code>none</code>.
  33832. </p>
  33833. </dd>
  33834. <dt>&lsquo;<samp>luma_swap, ls</samp>&rsquo;</dt>
  33835. <dt>&lsquo;<samp>chroma_swap, cs</samp>&rsquo;</dt>
  33836. <dt>&lsquo;<samp>alpha_swap, as</samp>&rsquo;</dt>
  33837. <dd><p>Swap luma/chroma/alpha fields. Exchange even &amp; odd lines. Default value is <code>0</code>.
  33838. </p></dd>
  33839. </dl>
  33840. <a name="Commands-49"></a>
  33841. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-49">39.107.1 Commands</a></h3>
  33842. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  33843. </p>
  33844. <a name="inflate"></a>
  33845. <h2 class="section"><a href="ffmpeg-all.html#toc-inflate">39.108 inflate</a></h2>
  33846. <p>Apply inflate effect to the video.
  33847. </p>
  33848. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  33849. only values higher than the pixel.
  33850. </p>
  33851. <p>It accepts the following options:
  33852. </p>
  33853. <dl compact="compact">
  33854. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  33855. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  33856. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  33857. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  33858. <dd><p>Limit the maximum change for each plane, default is 65535.
  33859. If 0, plane will remain unchanged.
  33860. </p></dd>
  33861. </dl>
  33862. <a name="Commands-17"></a>
  33863. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-17">39.108.1 Commands</a></h3>
  33864. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  33865. </p>
  33866. <a name="interlace"></a>
  33867. <h2 class="section"><a href="ffmpeg-all.html#toc-interlace">39.109 interlace</a></h2>
  33868. <p>Simple interlacing filter from progressive contents. This interleaves upper (or
  33869. lower) lines from odd frames with lower (or upper) lines from even frames,
  33870. halving the frame rate and preserving image height.
  33871. </p>
  33872. <div class="example">
  33873. <pre class="example"> Original Original New Frame
  33874. Frame 'j' Frame 'j+1' (tff)
  33875. ========== =========== ==================
  33876. Line 0 --------------------&gt; Frame 'j' Line 0
  33877. Line 1 Line 1 ----&gt; Frame 'j+1' Line 1
  33878. Line 2 ---------------------&gt; Frame 'j' Line 2
  33879. Line 3 Line 3 ----&gt; Frame 'j+1' Line 3
  33880. ... ... ...
  33881. New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
  33882. </pre></div>
  33883. <p>It accepts the following optional parameters:
  33884. </p>
  33885. <dl compact="compact">
  33886. <dt>&lsquo;<samp>scan</samp>&rsquo;</dt>
  33887. <dd><p>This determines whether the interlaced frame is taken from the even
  33888. (tff - default) or odd (bff) lines of the progressive frame.
  33889. </p>
  33890. </dd>
  33891. <dt>&lsquo;<samp>lowpass</samp>&rsquo;</dt>
  33892. <dd><p>Vertical lowpass filter to avoid twitter interlacing and
  33893. reduce moire patterns.
  33894. </p>
  33895. <dl compact="compact">
  33896. <dt>&lsquo;<samp>0, off</samp>&rsquo;</dt>
  33897. <dd><p>Disable vertical lowpass filter
  33898. </p>
  33899. </dd>
  33900. <dt>&lsquo;<samp>1, linear</samp>&rsquo;</dt>
  33901. <dd><p>Enable linear filter (default)
  33902. </p>
  33903. </dd>
  33904. <dt>&lsquo;<samp>2, complex</samp>&rsquo;</dt>
  33905. <dd><p>Enable complex filter. This will slightly less reduce twitter and moire
  33906. but better retain detail and subjective sharpness impression.
  33907. </p>
  33908. </dd>
  33909. </dl>
  33910. </dd>
  33911. </dl>
  33912. <a name="kerndeint"></a>
  33913. <h2 class="section"><a href="ffmpeg-all.html#toc-kerndeint">39.110 kerndeint</a></h2>
  33914. <p>Deinterlace input video by applying Donald Graft&rsquo;s adaptive kernel
  33915. deinterling. Work on interlaced parts of a video to produce
  33916. progressive frames.
  33917. </p>
  33918. <p>The description of the accepted parameters follows.
  33919. </p>
  33920. <dl compact="compact">
  33921. <dt>&lsquo;<samp>thresh</samp>&rsquo;</dt>
  33922. <dd><p>Set the threshold which affects the filter&rsquo;s tolerance when
  33923. determining if a pixel line must be processed. It must be an integer
  33924. in the range [0,255] and defaults to 10. A value of 0 will result in
  33925. applying the process on every pixels.
  33926. </p>
  33927. </dd>
  33928. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  33929. <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
  33930. Default is 0.
  33931. </p>
  33932. </dd>
  33933. <dt>&lsquo;<samp>order</samp>&rsquo;</dt>
  33934. <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
  33935. 0. Default is 0.
  33936. </p>
  33937. </dd>
  33938. <dt>&lsquo;<samp>sharp</samp>&rsquo;</dt>
  33939. <dd><p>Enable additional sharpening if set to 1. Default is 0.
  33940. </p>
  33941. </dd>
  33942. <dt>&lsquo;<samp>twoway</samp>&rsquo;</dt>
  33943. <dd><p>Enable twoway sharpening if set to 1. Default is 0.
  33944. </p></dd>
  33945. </dl>
  33946. <a name="Examples-130"></a>
  33947. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-130">39.110.1 Examples</a></h3>
  33948. <ul>
  33949. <li>
  33950. Apply default values:
  33951. <div class="example">
  33952. <pre class="example">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
  33953. </pre></div>
  33954. </li><li>
  33955. Enable additional sharpening:
  33956. <div class="example">
  33957. <pre class="example">kerndeint=sharp=1
  33958. </pre></div>
  33959. </li><li>
  33960. Paint processed pixels in white:
  33961. <div class="example">
  33962. <pre class="example">kerndeint=map=1
  33963. </pre></div>
  33964. </li></ul>
  33965. <a name="lagfun"></a>
  33966. <h2 class="section"><a href="ffmpeg-all.html#toc-lagfun">39.111 lagfun</a></h2>
  33967. <p>Slowly update darker pixels.
  33968. </p>
  33969. <p>This filter makes short flashes of light appear longer.
  33970. This filter accepts the following options:
  33971. </p>
  33972. <dl compact="compact">
  33973. <dt>&lsquo;<samp>decay</samp>&rsquo;</dt>
  33974. <dd><p>Set factor for decaying. Default is .95. Allowed range is from 0 to 1.
  33975. </p>
  33976. </dd>
  33977. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  33978. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  33979. </p></dd>
  33980. </dl>
  33981. <a name="lenscorrection"></a>
  33982. <h2 class="section"><a href="ffmpeg-all.html#toc-lenscorrection">39.112 lenscorrection</a></h2>
  33983. <p>Correct radial lens distortion
  33984. </p>
  33985. <p>This filter can be used to correct for radial distortion as can result from the use
  33986. of wide angle lenses, and thereby re-rectify the image. To find the right parameters
  33987. one can use tools available for example as part of opencv or simply trial-and-error.
  33988. To use opencv use the calibration sample (under samples/cpp) from the opencv sources
  33989. and extract the k1 and k2 coefficients from the resulting matrix.
  33990. </p>
  33991. <p>Note that effectively the same filter is available in the open-source tools Krita and
  33992. Digikam from the KDE project.
  33993. </p>
  33994. <p>In contrast to the <a href="#vignette">vignette</a> filter, which can also be used to compensate lens errors,
  33995. this filter corrects the distortion of the image, whereas <a href="#vignette">vignette</a> corrects the
  33996. brightness distribution, so you may want to use both filters together in certain
  33997. cases, though you will have to take care of ordering, i.e. whether vignetting should
  33998. be applied before or after lens correction.
  33999. </p>
  34000. <a name="Options-79"></a>
  34001. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-79">39.112.1 Options</a></h3>
  34002. <p>The filter accepts the following options:
  34003. </p>
  34004. <dl compact="compact">
  34005. <dt>&lsquo;<samp>cx</samp>&rsquo;</dt>
  34006. <dd><p>Relative x-coordinate of the focal point of the image, and thereby the center of the
  34007. distortion. This value has a range [0,1] and is expressed as fractions of the image
  34008. width. Default is 0.5.
  34009. </p></dd>
  34010. <dt>&lsquo;<samp>cy</samp>&rsquo;</dt>
  34011. <dd><p>Relative y-coordinate of the focal point of the image, and thereby the center of the
  34012. distortion. This value has a range [0,1] and is expressed as fractions of the image
  34013. height. Default is 0.5.
  34014. </p></dd>
  34015. <dt>&lsquo;<samp>k1</samp>&rsquo;</dt>
  34016. <dd><p>Coefficient of the quadratic correction term. This value has a range [-1,1]. 0 means
  34017. no correction. Default is 0.
  34018. </p></dd>
  34019. <dt>&lsquo;<samp>k2</samp>&rsquo;</dt>
  34020. <dd><p>Coefficient of the double quadratic correction term. This value has a range [-1,1].
  34021. 0 means no correction. Default is 0.
  34022. </p></dd>
  34023. </dl>
  34024. <p>The formula that generates the correction is:
  34025. </p>
  34026. <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)
  34027. </p>
  34028. <p>where <var>r_0</var> is halve of the image diagonal and <var>r_src</var> and <var>r_tgt</var> are the
  34029. distances from the focal point in the source and target images, respectively.
  34030. </p>
  34031. <a name="lensfun"></a>
  34032. <h2 class="section"><a href="ffmpeg-all.html#toc-lensfun">39.113 lensfun</a></h2>
  34033. <p>Apply lens correction via the lensfun library (<a href="http://lensfun.sourceforge.net/">http://lensfun.sourceforge.net/</a>).
  34034. </p>
  34035. <p>The <code>lensfun</code> filter requires the camera make, camera model, and lens model
  34036. to apply the lens correction. The filter will load the lensfun database and
  34037. query it to find the corresponding camera and lens entries in the database. As
  34038. long as these entries can be found with the given options, the filter can
  34039. perform corrections on frames. Note that incomplete strings will result in the
  34040. filter choosing the best match with the given options, and the filter will
  34041. output the chosen camera and lens models (logged with level &quot;info&quot;). You must
  34042. provide the make, camera model, and lens model as they are required.
  34043. </p>
  34044. <p>The filter accepts the following options:
  34045. </p>
  34046. <dl compact="compact">
  34047. <dt>&lsquo;<samp>make</samp>&rsquo;</dt>
  34048. <dd><p>The make of the camera (for example, &quot;Canon&quot;). This option is required.
  34049. </p>
  34050. </dd>
  34051. <dt>&lsquo;<samp>model</samp>&rsquo;</dt>
  34052. <dd><p>The model of the camera (for example, &quot;Canon EOS 100D&quot;). This option is
  34053. required.
  34054. </p>
  34055. </dd>
  34056. <dt>&lsquo;<samp>lens_model</samp>&rsquo;</dt>
  34057. <dd><p>The model of the lens (for example, &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;). This
  34058. option is required.
  34059. </p>
  34060. </dd>
  34061. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  34062. <dd><p>The type of correction to apply. The following values are valid options:
  34063. </p>
  34064. <dl compact="compact">
  34065. <dt>&lsquo;<samp>vignetting</samp>&rsquo;</dt>
  34066. <dd><p>Enables fixing lens vignetting.
  34067. </p>
  34068. </dd>
  34069. <dt>&lsquo;<samp>geometry</samp>&rsquo;</dt>
  34070. <dd><p>Enables fixing lens geometry. This is the default.
  34071. </p>
  34072. </dd>
  34073. <dt>&lsquo;<samp>subpixel</samp>&rsquo;</dt>
  34074. <dd><p>Enables fixing chromatic aberrations.
  34075. </p>
  34076. </dd>
  34077. <dt>&lsquo;<samp>vig_geo</samp>&rsquo;</dt>
  34078. <dd><p>Enables fixing lens vignetting and lens geometry.
  34079. </p>
  34080. </dd>
  34081. <dt>&lsquo;<samp>vig_subpixel</samp>&rsquo;</dt>
  34082. <dd><p>Enables fixing lens vignetting and chromatic aberrations.
  34083. </p>
  34084. </dd>
  34085. <dt>&lsquo;<samp>distortion</samp>&rsquo;</dt>
  34086. <dd><p>Enables fixing both lens geometry and chromatic aberrations.
  34087. </p>
  34088. </dd>
  34089. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  34090. <dd><p>Enables all possible corrections.
  34091. </p>
  34092. </dd>
  34093. </dl>
  34094. </dd>
  34095. <dt>&lsquo;<samp>focal_length</samp>&rsquo;</dt>
  34096. <dd><p>The focal length of the image/video (zoom; expected constant for video). For
  34097. example, a 18&ndash;55mm lens has focal length range of [18&ndash;55], so a value in that
  34098. range should be chosen when using that lens. Default 18.
  34099. </p>
  34100. </dd>
  34101. <dt>&lsquo;<samp>aperture</samp>&rsquo;</dt>
  34102. <dd><p>The aperture of the image/video (expected constant for video). Note that
  34103. aperture is only used for vignetting correction. Default 3.5.
  34104. </p>
  34105. </dd>
  34106. <dt>&lsquo;<samp>focus_distance</samp>&rsquo;</dt>
  34107. <dd><p>The focus distance of the image/video (expected constant for video). Note that
  34108. focus distance is only used for vignetting and only slightly affects the
  34109. vignetting correction process. If unknown, leave it at the default value (which
  34110. is 1000).
  34111. </p>
  34112. </dd>
  34113. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  34114. <dd><p>The scale factor which is applied after transformation. After correction the
  34115. video is no longer necessarily rectangular. This parameter controls how much of
  34116. the resulting image is visible. The value 0 means that a value will be chosen
  34117. automatically such that there is little or no unmapped area in the output
  34118. image. 1.0 means that no additional scaling is done. Lower values may result
  34119. in more of the corrected image being visible, while higher values may avoid
  34120. unmapped areas in the output.
  34121. </p>
  34122. </dd>
  34123. <dt>&lsquo;<samp>target_geometry</samp>&rsquo;</dt>
  34124. <dd><p>The target geometry of the output image/video. The following values are valid
  34125. options:
  34126. </p>
  34127. <dl compact="compact">
  34128. <dt>&lsquo;<samp>rectilinear (default)</samp>&rsquo;</dt>
  34129. <dt>&lsquo;<samp>fisheye</samp>&rsquo;</dt>
  34130. <dt>&lsquo;<samp>panoramic</samp>&rsquo;</dt>
  34131. <dt>&lsquo;<samp>equirectangular</samp>&rsquo;</dt>
  34132. <dt>&lsquo;<samp>fisheye_orthographic</samp>&rsquo;</dt>
  34133. <dt>&lsquo;<samp>fisheye_stereographic</samp>&rsquo;</dt>
  34134. <dt>&lsquo;<samp>fisheye_equisolid</samp>&rsquo;</dt>
  34135. <dt>&lsquo;<samp>fisheye_thoby</samp>&rsquo;</dt>
  34136. </dl>
  34137. </dd>
  34138. <dt>&lsquo;<samp>reverse</samp>&rsquo;</dt>
  34139. <dd><p>Apply the reverse of image correction (instead of correcting distortion, apply
  34140. it).
  34141. </p>
  34142. </dd>
  34143. <dt>&lsquo;<samp>interpolation</samp>&rsquo;</dt>
  34144. <dd><p>The type of interpolation used when correcting distortion. The following values
  34145. are valid options:
  34146. </p>
  34147. <dl compact="compact">
  34148. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  34149. <dt>&lsquo;<samp>linear (default)</samp>&rsquo;</dt>
  34150. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  34151. </dl>
  34152. </dd>
  34153. </dl>
  34154. <a name="Examples-93"></a>
  34155. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-93">39.113.1 Examples</a></h3>
  34156. <ul>
  34157. <li>
  34158. Apply lens correction with make &quot;Canon&quot;, camera model &quot;Canon EOS 100D&quot;, and lens
  34159. model &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot; with focal length of &quot;18&quot; and
  34160. aperture of &quot;8.0&quot;.
  34161. <div class="example">
  34162. <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
  34163. </pre></div>
  34164. </li><li>
  34165. Apply the same as before, but only for the first 5 seconds of video.
  34166. <div class="example">
  34167. <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
  34168. </pre></div>
  34169. </li></ul>
  34170. <a name="libvmaf"></a>
  34171. <h2 class="section"><a href="ffmpeg-all.html#toc-libvmaf">39.114 libvmaf</a></h2>
  34172. <p>Obtain the VMAF (Video Multi-Method Assessment Fusion)
  34173. score between two input videos.
  34174. </p>
  34175. <p>The obtained VMAF score is printed through the logging system.
  34176. </p>
  34177. <p>It requires Netflix&rsquo;s vmaf library (libvmaf) as a pre-requisite.
  34178. After installing the library it can be enabled using:
  34179. <code>./configure --enable-libvmaf --enable-version3</code>.
  34180. If no model path is specified it uses the default model: <code>vmaf_v0.6.1.pkl</code>.
  34181. </p>
  34182. <p>The filter has following options:
  34183. </p>
  34184. <dl compact="compact">
  34185. <dt>&lsquo;<samp>model_path</samp>&rsquo;</dt>
  34186. <dd><p>Set the model path which is to be used for SVM.
  34187. Default value: <code>&quot;/usr/local/share/model/vmaf_v0.6.1.pkl&quot;</code>
  34188. </p>
  34189. </dd>
  34190. <dt>&lsquo;<samp>log_path</samp>&rsquo;</dt>
  34191. <dd><p>Set the file path to be used to store logs.
  34192. </p>
  34193. </dd>
  34194. <dt>&lsquo;<samp>log_fmt</samp>&rsquo;</dt>
  34195. <dd><p>Set the format of the log file (xml or json).
  34196. </p>
  34197. </dd>
  34198. <dt>&lsquo;<samp>enable_transform</samp>&rsquo;</dt>
  34199. <dd><p>This option can enable/disable the <code>score_transform</code> applied to the final predicted VMAF score,
  34200. if you have specified score_transform option in the input parameter file passed to <code>run_vmaf_training.py</code>
  34201. Default value: <code>false</code>
  34202. </p>
  34203. </dd>
  34204. <dt>&lsquo;<samp>phone_model</samp>&rsquo;</dt>
  34205. <dd><p>Invokes the phone model which will generate VMAF scores higher than in the
  34206. regular model, which is more suitable for laptop, TV, etc. viewing conditions.
  34207. Default value: <code>false</code>
  34208. </p>
  34209. </dd>
  34210. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  34211. <dd><p>Enables computing psnr along with vmaf.
  34212. Default value: <code>false</code>
  34213. </p>
  34214. </dd>
  34215. <dt>&lsquo;<samp>ssim</samp>&rsquo;</dt>
  34216. <dd><p>Enables computing ssim along with vmaf.
  34217. Default value: <code>false</code>
  34218. </p>
  34219. </dd>
  34220. <dt>&lsquo;<samp>ms_ssim</samp>&rsquo;</dt>
  34221. <dd><p>Enables computing ms_ssim along with vmaf.
  34222. Default value: <code>false</code>
  34223. </p>
  34224. </dd>
  34225. <dt>&lsquo;<samp>pool</samp>&rsquo;</dt>
  34226. <dd><p>Set the pool method to be used for computing vmaf.
  34227. Options are <code>min</code>, <code>harmonic_mean</code> or <code>mean</code> (default).
  34228. </p>
  34229. </dd>
  34230. <dt>&lsquo;<samp>n_threads</samp>&rsquo;</dt>
  34231. <dd><p>Set number of threads to be used when computing vmaf.
  34232. Default value: <code>0</code>, which makes use of all available logical processors.
  34233. </p>
  34234. </dd>
  34235. <dt>&lsquo;<samp>n_subsample</samp>&rsquo;</dt>
  34236. <dd><p>Set interval for frame subsampling used when computing vmaf.
  34237. Default value: <code>1</code>
  34238. </p>
  34239. </dd>
  34240. <dt>&lsquo;<samp>enable_conf_interval</samp>&rsquo;</dt>
  34241. <dd><p>Enables confidence interval.
  34242. Default value: <code>false</code>
  34243. </p></dd>
  34244. </dl>
  34245. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  34246. </p>
  34247. <a name="Examples-39"></a>
  34248. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-39">39.114.1 Examples</a></h3>
  34249. <ul>
  34250. <li>
  34251. On the below examples the input file &lsquo;<tt>main.mpg</tt>&rsquo; being processed is
  34252. compared with the reference file &lsquo;<tt>ref.mpg</tt>&rsquo;.
  34253. <div class="example">
  34254. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf -f null -
  34255. </pre></div>
  34256. </li><li>
  34257. Example with options:
  34258. <div class="example">
  34259. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf=&quot;psnr=1:log_fmt=json&quot; -f null -
  34260. </pre></div>
  34261. </li><li>
  34262. Example with options and different containers:
  34263. <div class="example">
  34264. <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 -
  34265. </pre></div>
  34266. </li></ul>
  34267. <a name="limiter"></a>
  34268. <h2 class="section"><a href="ffmpeg-all.html#toc-limiter">39.115 limiter</a></h2>
  34269. <p>Limits the pixel components values to the specified range [min, max].
  34270. </p>
  34271. <p>The filter accepts the following options:
  34272. </p>
  34273. <dl compact="compact">
  34274. <dt>&lsquo;<samp>min</samp>&rsquo;</dt>
  34275. <dd><p>Lower bound. Defaults to the lowest allowed value for the input.
  34276. </p>
  34277. </dd>
  34278. <dt>&lsquo;<samp>max</samp>&rsquo;</dt>
  34279. <dd><p>Upper bound. Defaults to the highest allowed value for the input.
  34280. </p>
  34281. </dd>
  34282. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34283. <dd><p>Specify which planes will be processed. Defaults to all available.
  34284. </p></dd>
  34285. </dl>
  34286. <a name="loop"></a>
  34287. <h2 class="section"><a href="ffmpeg-all.html#toc-loop">39.116 loop</a></h2>
  34288. <p>Loop video frames.
  34289. </p>
  34290. <p>The filter accepts the following options:
  34291. </p>
  34292. <dl compact="compact">
  34293. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  34294. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  34295. Default is 0.
  34296. </p>
  34297. </dd>
  34298. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  34299. <dd><p>Set maximal size in number of frames. Default is 0.
  34300. </p>
  34301. </dd>
  34302. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  34303. <dd><p>Set first frame of loop. Default is 0.
  34304. </p></dd>
  34305. </dl>
  34306. <a name="Examples-172"></a>
  34307. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-172">39.116.1 Examples</a></h3>
  34308. <ul>
  34309. <li>
  34310. Loop single first frame infinitely:
  34311. <div class="example">
  34312. <pre class="example">loop=loop=-1:size=1:start=0
  34313. </pre></div>
  34314. </li><li>
  34315. Loop single first frame 10 times:
  34316. <div class="example">
  34317. <pre class="example">loop=loop=10:size=1:start=0
  34318. </pre></div>
  34319. </li><li>
  34320. Loop 10 first frames 5 times:
  34321. <div class="example">
  34322. <pre class="example">loop=loop=5:size=10:start=0
  34323. </pre></div>
  34324. </li></ul>
  34325. <a name="lut1d"></a>
  34326. <h2 class="section"><a href="ffmpeg-all.html#toc-lut1d">39.117 lut1d</a></h2>
  34327. <p>Apply a 1D LUT to an input video.
  34328. </p>
  34329. <p>The filter accepts the following options:
  34330. </p>
  34331. <dl compact="compact">
  34332. <dt>&lsquo;<samp>file</samp>&rsquo;</dt>
  34333. <dd><p>Set the 1D LUT file name.
  34334. </p>
  34335. <p>Currently supported formats:
  34336. </p><dl compact="compact">
  34337. <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
  34338. <dd><p>Iridas
  34339. </p></dd>
  34340. <dt>&lsquo;<samp>csp</samp>&rsquo;</dt>
  34341. <dd><p>cineSpace
  34342. </p></dd>
  34343. </dl>
  34344. </dd>
  34345. <dt>&lsquo;<samp>interp</samp>&rsquo;</dt>
  34346. <dd><p>Select interpolation mode.
  34347. </p>
  34348. <p>Available values are:
  34349. </p>
  34350. <dl compact="compact">
  34351. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  34352. <dd><p>Use values from the nearest defined point.
  34353. </p></dd>
  34354. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  34355. <dd><p>Interpolate values using the linear interpolation.
  34356. </p></dd>
  34357. <dt>&lsquo;<samp>cosine</samp>&rsquo;</dt>
  34358. <dd><p>Interpolate values using the cosine interpolation.
  34359. </p></dd>
  34360. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  34361. <dd><p>Interpolate values using the cubic interpolation.
  34362. </p></dd>
  34363. <dt>&lsquo;<samp>spline</samp>&rsquo;</dt>
  34364. <dd><p>Interpolate values using the spline interpolation.
  34365. </p></dd>
  34366. </dl>
  34367. </dd>
  34368. </dl>
  34369. <p><a name="lut3d"></a>
  34370. </p><a name="lut3d-1"></a>
  34371. <h2 class="section"><a href="ffmpeg-all.html#toc-lut3d-1">39.118 lut3d</a></h2>
  34372. <p>Apply a 3D LUT to an input video.
  34373. </p>
  34374. <p>The filter accepts the following options:
  34375. </p>
  34376. <dl compact="compact">
  34377. <dt>&lsquo;<samp>file</samp>&rsquo;</dt>
  34378. <dd><p>Set the 3D LUT file name.
  34379. </p>
  34380. <p>Currently supported formats:
  34381. </p><dl compact="compact">
  34382. <dt>&lsquo;<samp>3dl</samp>&rsquo;</dt>
  34383. <dd><p>AfterEffects
  34384. </p></dd>
  34385. <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
  34386. <dd><p>Iridas
  34387. </p></dd>
  34388. <dt>&lsquo;<samp>dat</samp>&rsquo;</dt>
  34389. <dd><p>DaVinci
  34390. </p></dd>
  34391. <dt>&lsquo;<samp>m3d</samp>&rsquo;</dt>
  34392. <dd><p>Pandora
  34393. </p></dd>
  34394. <dt>&lsquo;<samp>csp</samp>&rsquo;</dt>
  34395. <dd><p>cineSpace
  34396. </p></dd>
  34397. </dl>
  34398. </dd>
  34399. <dt>&lsquo;<samp>interp</samp>&rsquo;</dt>
  34400. <dd><p>Select interpolation mode.
  34401. </p>
  34402. <p>Available values are:
  34403. </p>
  34404. <dl compact="compact">
  34405. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  34406. <dd><p>Use values from the nearest defined point.
  34407. </p></dd>
  34408. <dt>&lsquo;<samp>trilinear</samp>&rsquo;</dt>
  34409. <dd><p>Interpolate values using the 8 points defining a cube.
  34410. </p></dd>
  34411. <dt>&lsquo;<samp>tetrahedral</samp>&rsquo;</dt>
  34412. <dd><p>Interpolate values using a tetrahedron.
  34413. </p></dd>
  34414. </dl>
  34415. </dd>
  34416. </dl>
  34417. <a name="lumakey"></a>
  34418. <h2 class="section"><a href="ffmpeg-all.html#toc-lumakey">39.119 lumakey</a></h2>
  34419. <p>Turn certain luma values into transparency.
  34420. </p>
  34421. <p>The filter accepts the following options:
  34422. </p>
  34423. <dl compact="compact">
  34424. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  34425. <dd><p>Set the luma which will be used as base for transparency.
  34426. Default value is <code>0</code>.
  34427. </p>
  34428. </dd>
  34429. <dt>&lsquo;<samp>tolerance</samp>&rsquo;</dt>
  34430. <dd><p>Set the range of luma values to be keyed out.
  34431. Default value is <code>0.01</code>.
  34432. </p>
  34433. </dd>
  34434. <dt>&lsquo;<samp>softness</samp>&rsquo;</dt>
  34435. <dd><p>Set the range of softness. Default value is <code>0</code>.
  34436. Use this to control gradual transition from zero to full transparency.
  34437. </p></dd>
  34438. </dl>
  34439. <a name="Commands-64"></a>
  34440. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-64">39.119.1 Commands</a></h3>
  34441. <p>This filter supports same <a href="#commands">commands</a> as options.
  34442. The command accepts the same syntax of the corresponding option.
  34443. </p>
  34444. <p>If the specified expression is not valid, it is kept at its current
  34445. value.
  34446. </p>
  34447. <a name="lut_002c-lutrgb_002c-lutyuv"></a>
  34448. <h2 class="section"><a href="ffmpeg-all.html#toc-lut_002c-lutrgb_002c-lutyuv">39.120 lut, lutrgb, lutyuv</a></h2>
  34449. <p>Compute a look-up table for binding each pixel component input value
  34450. to an output value, and apply it to the input video.
  34451. </p>
  34452. <p><var>lutyuv</var> applies a lookup table to a YUV input video, <var>lutrgb</var>
  34453. to an RGB input video.
  34454. </p>
  34455. <p>These filters accept the following parameters:
  34456. </p><dl compact="compact">
  34457. <dt>&lsquo;<samp>c0</samp>&rsquo;</dt>
  34458. <dd><p>set first pixel component expression
  34459. </p></dd>
  34460. <dt>&lsquo;<samp>c1</samp>&rsquo;</dt>
  34461. <dd><p>set second pixel component expression
  34462. </p></dd>
  34463. <dt>&lsquo;<samp>c2</samp>&rsquo;</dt>
  34464. <dd><p>set third pixel component expression
  34465. </p></dd>
  34466. <dt>&lsquo;<samp>c3</samp>&rsquo;</dt>
  34467. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  34468. </p>
  34469. </dd>
  34470. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  34471. <dd><p>set red component expression
  34472. </p></dd>
  34473. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  34474. <dd><p>set green component expression
  34475. </p></dd>
  34476. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  34477. <dd><p>set blue component expression
  34478. </p></dd>
  34479. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  34480. <dd><p>alpha component expression
  34481. </p>
  34482. </dd>
  34483. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  34484. <dd><p>set Y/luminance component expression
  34485. </p></dd>
  34486. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  34487. <dd><p>set U/Cb component expression
  34488. </p></dd>
  34489. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  34490. <dd><p>set V/Cr component expression
  34491. </p></dd>
  34492. </dl>
  34493. <p>Each of them specifies the expression to use for computing the lookup table for
  34494. the corresponding pixel component values.
  34495. </p>
  34496. <p>The exact component associated to each of the <var>c*</var> options depends on the
  34497. format in input.
  34498. </p>
  34499. <p>The <var>lut</var> filter requires either YUV or RGB pixel formats in input,
  34500. <var>lutrgb</var> requires RGB pixel formats in input, and <var>lutyuv</var> requires YUV.
  34501. </p>
  34502. <p>The expressions can contain the following constants and functions:
  34503. </p>
  34504. <dl compact="compact">
  34505. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  34506. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  34507. <dd><p>The input width and height.
  34508. </p>
  34509. </dd>
  34510. <dt>&lsquo;<samp>val</samp>&rsquo;</dt>
  34511. <dd><p>The input value for the pixel component.
  34512. </p>
  34513. </dd>
  34514. <dt>&lsquo;<samp>clipval</samp>&rsquo;</dt>
  34515. <dd><p>The input value, clipped to the <var>minval</var>-<var>maxval</var> range.
  34516. </p>
  34517. </dd>
  34518. <dt>&lsquo;<samp>maxval</samp>&rsquo;</dt>
  34519. <dd><p>The maximum value for the pixel component.
  34520. </p>
  34521. </dd>
  34522. <dt>&lsquo;<samp>minval</samp>&rsquo;</dt>
  34523. <dd><p>The minimum value for the pixel component.
  34524. </p>
  34525. </dd>
  34526. <dt>&lsquo;<samp>negval</samp>&rsquo;</dt>
  34527. <dd><p>The negated value for the pixel component value, clipped to the
  34528. <var>minval</var>-<var>maxval</var> range; it corresponds to the expression
  34529. &quot;maxval-clipval+minval&quot;.
  34530. </p>
  34531. </dd>
  34532. <dt>&lsquo;<samp>clip(val)</samp>&rsquo;</dt>
  34533. <dd><p>The computed value in <var>val</var>, clipped to the
  34534. <var>minval</var>-<var>maxval</var> range.
  34535. </p>
  34536. </dd>
  34537. <dt>&lsquo;<samp>gammaval(gamma)</samp>&rsquo;</dt>
  34538. <dd><p>The computed gamma correction value of the pixel component value,
  34539. clipped to the <var>minval</var>-<var>maxval</var> range. It corresponds to the
  34540. expression
  34541. &quot;pow((clipval-minval)/(maxval-minval)\,<var>gamma</var>)*(maxval-minval)+minval&quot;
  34542. </p>
  34543. </dd>
  34544. </dl>
  34545. <p>All expressions default to &quot;val&quot;.
  34546. </p>
  34547. <a name="Examples-102"></a>
  34548. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-102">39.120.1 Examples</a></h3>
  34549. <ul>
  34550. <li>
  34551. Negate input video:
  34552. <div class="example">
  34553. <pre class="example">lutrgb=&quot;r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val&quot;
  34554. lutyuv=&quot;y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val&quot;
  34555. </pre></div>
  34556. <p>The above is the same as:
  34557. </p><div class="example">
  34558. <pre class="example">lutrgb=&quot;r=negval:g=negval:b=negval&quot;
  34559. lutyuv=&quot;y=negval:u=negval:v=negval&quot;
  34560. </pre></div>
  34561. </li><li>
  34562. Negate luminance:
  34563. <div class="example">
  34564. <pre class="example">lutyuv=y=negval
  34565. </pre></div>
  34566. </li><li>
  34567. Remove chroma components, turning the video into a graytone image:
  34568. <div class="example">
  34569. <pre class="example">lutyuv=&quot;u=128:v=128&quot;
  34570. </pre></div>
  34571. </li><li>
  34572. Apply a luma burning effect:
  34573. <div class="example">
  34574. <pre class="example">lutyuv=&quot;y=2*val&quot;
  34575. </pre></div>
  34576. </li><li>
  34577. Remove green and blue components:
  34578. <div class="example">
  34579. <pre class="example">lutrgb=&quot;g=0:b=0&quot;
  34580. </pre></div>
  34581. </li><li>
  34582. Set a constant alpha channel value on input:
  34583. <div class="example">
  34584. <pre class="example">format=rgba,lutrgb=a=&quot;maxval-minval/2&quot;
  34585. </pre></div>
  34586. </li><li>
  34587. Correct luminance gamma by a factor of 0.5:
  34588. <div class="example">
  34589. <pre class="example">lutyuv=y=gammaval(0.5)
  34590. </pre></div>
  34591. </li><li>
  34592. Discard least significant bits of luma:
  34593. <div class="example">
  34594. <pre class="example">lutyuv=y='bitand(val, 128+64+32)'
  34595. </pre></div>
  34596. </li><li>
  34597. Technicolor like effect:
  34598. <div class="example">
  34599. <pre class="example">lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/2)*2+maxval/2'
  34600. </pre></div>
  34601. </li></ul>
  34602. <a name="lut2_002c-tlut2"></a>
  34603. <h2 class="section"><a href="ffmpeg-all.html#toc-lut2_002c-tlut2">39.121 lut2, tlut2</a></h2>
  34604. <p>The <code>lut2</code> filter takes two input streams and outputs one
  34605. stream.
  34606. </p>
  34607. <p>The <code>tlut2</code> (time lut2) filter takes two consecutive frames
  34608. from one single stream.
  34609. </p>
  34610. <p>This filter accepts the following parameters:
  34611. </p><dl compact="compact">
  34612. <dt>&lsquo;<samp>c0</samp>&rsquo;</dt>
  34613. <dd><p>set first pixel component expression
  34614. </p></dd>
  34615. <dt>&lsquo;<samp>c1</samp>&rsquo;</dt>
  34616. <dd><p>set second pixel component expression
  34617. </p></dd>
  34618. <dt>&lsquo;<samp>c2</samp>&rsquo;</dt>
  34619. <dd><p>set third pixel component expression
  34620. </p></dd>
  34621. <dt>&lsquo;<samp>c3</samp>&rsquo;</dt>
  34622. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  34623. </p>
  34624. </dd>
  34625. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  34626. <dd><p>set output bit depth, only available for <code>lut2</code> filter. By default is 0,
  34627. which means bit depth is automatically picked from first input format.
  34628. </p></dd>
  34629. </dl>
  34630. <p>The <code>lut2</code> filter also supports the <a href="#framesync">framesync</a> options.
  34631. </p>
  34632. <p>Each of them specifies the expression to use for computing the lookup table for
  34633. the corresponding pixel component values.
  34634. </p>
  34635. <p>The exact component associated to each of the <var>c*</var> options depends on the
  34636. format in inputs.
  34637. </p>
  34638. <p>The expressions can contain the following constants:
  34639. </p>
  34640. <dl compact="compact">
  34641. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  34642. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  34643. <dd><p>The input width and height.
  34644. </p>
  34645. </dd>
  34646. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  34647. <dd><p>The first input value for the pixel component.
  34648. </p>
  34649. </dd>
  34650. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  34651. <dd><p>The second input value for the pixel component.
  34652. </p>
  34653. </dd>
  34654. <dt>&lsquo;<samp>bdx</samp>&rsquo;</dt>
  34655. <dd><p>The first input video bit depth.
  34656. </p>
  34657. </dd>
  34658. <dt>&lsquo;<samp>bdy</samp>&rsquo;</dt>
  34659. <dd><p>The second input video bit depth.
  34660. </p></dd>
  34661. </dl>
  34662. <p>All expressions default to &quot;x&quot;.
  34663. </p>
  34664. <a name="Examples-58"></a>
  34665. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-58">39.121.1 Examples</a></h3>
  34666. <ul>
  34667. <li>
  34668. Highlight differences between two RGB video streams:
  34669. <div class="example">
  34670. <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)'
  34671. </pre></div>
  34672. </li><li>
  34673. Highlight differences between two YUV video streams:
  34674. <div class="example">
  34675. <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)'
  34676. </pre></div>
  34677. </li><li>
  34678. Show max difference between two video streams:
  34679. <div class="example">
  34680. <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)))'
  34681. </pre></div>
  34682. </li></ul>
  34683. <a name="maskedclamp"></a>
  34684. <h2 class="section"><a href="ffmpeg-all.html#toc-maskedclamp">39.122 maskedclamp</a></h2>
  34685. <p>Clamp the first input stream with the second input and third input stream.
  34686. </p>
  34687. <p>Returns the value of first stream to be between second input
  34688. stream - <code>undershoot</code> and third input stream + <code>overshoot</code>.
  34689. </p>
  34690. <p>This filter accepts the following options:
  34691. </p><dl compact="compact">
  34692. <dt>&lsquo;<samp>undershoot</samp>&rsquo;</dt>
  34693. <dd><p>Default value is <code>0</code>.
  34694. </p>
  34695. </dd>
  34696. <dt>&lsquo;<samp>overshoot</samp>&rsquo;</dt>
  34697. <dd><p>Default value is <code>0</code>.
  34698. </p>
  34699. </dd>
  34700. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34701. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  34702. copied from first stream.
  34703. By default value 0xf, all planes will be processed.
  34704. </p></dd>
  34705. </dl>
  34706. <a name="maskedmax"></a>
  34707. <h2 class="section"><a href="ffmpeg-all.html#toc-maskedmax">39.123 maskedmax</a></h2>
  34708. <p>Merge the second and third input stream into output stream using absolute differences
  34709. between second input stream and first input stream and absolute difference between
  34710. third input stream and first input stream. The picked value will be from second input
  34711. stream if second absolute difference is greater than first one or from third input stream
  34712. otherwise.
  34713. </p>
  34714. <p>This filter accepts the following options:
  34715. </p><dl compact="compact">
  34716. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34717. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  34718. copied from first stream.
  34719. By default value 0xf, all planes will be processed.
  34720. </p></dd>
  34721. </dl>
  34722. <a name="maskedmerge"></a>
  34723. <h2 class="section"><a href="ffmpeg-all.html#toc-maskedmerge">39.124 maskedmerge</a></h2>
  34724. <p>Merge the first input stream with the second input stream using per pixel
  34725. weights in the third input stream.
  34726. </p>
  34727. <p>A value of 0 in the third stream pixel component means that pixel component
  34728. from first stream is returned unchanged, while maximum value (eg. 255 for
  34729. 8-bit videos) means that pixel component from second stream is returned
  34730. unchanged. Intermediate values define the amount of merging between both
  34731. input stream&rsquo;s pixel components.
  34732. </p>
  34733. <p>This filter accepts the following options:
  34734. </p><dl compact="compact">
  34735. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34736. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  34737. copied from first stream.
  34738. By default value 0xf, all planes will be processed.
  34739. </p></dd>
  34740. </dl>
  34741. <a name="maskedmin"></a>
  34742. <h2 class="section"><a href="ffmpeg-all.html#toc-maskedmin">39.125 maskedmin</a></h2>
  34743. <p>Merge the second and third input stream into output stream using absolute differences
  34744. between second input stream and first input stream and absolute difference between
  34745. third input stream and first input stream. The picked value will be from second input
  34746. stream if second absolute difference is less than first one or from third input stream
  34747. otherwise.
  34748. </p>
  34749. <p>This filter accepts the following options:
  34750. </p><dl compact="compact">
  34751. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34752. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  34753. copied from first stream.
  34754. By default value 0xf, all planes will be processed.
  34755. </p></dd>
  34756. </dl>
  34757. <a name="maskedthreshold"></a>
  34758. <h2 class="section"><a href="ffmpeg-all.html#toc-maskedthreshold">39.126 maskedthreshold</a></h2>
  34759. <p>Pick pixels comparing absolute difference of two video streams with fixed
  34760. threshold.
  34761. </p>
  34762. <p>If absolute difference between pixel component of first and second video
  34763. stream is equal or lower than user supplied threshold than pixel component
  34764. from first video stream is picked, otherwise pixel component from second
  34765. video stream is picked.
  34766. </p>
  34767. <p>This filter accepts the following options:
  34768. </p><dl compact="compact">
  34769. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  34770. <dd><p>Set threshold used when picking pixels from absolute difference from two input
  34771. video streams.
  34772. </p>
  34773. </dd>
  34774. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34775. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  34776. copied from second stream.
  34777. By default value 0xf, all planes will be processed.
  34778. </p></dd>
  34779. </dl>
  34780. <a name="maskfun"></a>
  34781. <h2 class="section"><a href="ffmpeg-all.html#toc-maskfun">39.127 maskfun</a></h2>
  34782. <p>Create mask from input video.
  34783. </p>
  34784. <p>For example it is useful to create motion masks after <code>tblend</code> filter.
  34785. </p>
  34786. <p>This filter accepts the following options:
  34787. </p>
  34788. <dl compact="compact">
  34789. <dt>&lsquo;<samp>low</samp>&rsquo;</dt>
  34790. <dd><p>Set low threshold. Any pixel component lower or exact than this value will be set to 0.
  34791. </p>
  34792. </dd>
  34793. <dt>&lsquo;<samp>high</samp>&rsquo;</dt>
  34794. <dd><p>Set high threshold. Any pixel component higher than this value will be set to max value
  34795. allowed for current pixel format.
  34796. </p>
  34797. </dd>
  34798. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34799. <dd><p>Set planes to filter, by default all available planes are filtered.
  34800. </p>
  34801. </dd>
  34802. <dt>&lsquo;<samp>fill</samp>&rsquo;</dt>
  34803. <dd><p>Fill all frame pixels with this value.
  34804. </p>
  34805. </dd>
  34806. <dt>&lsquo;<samp>sum</samp>&rsquo;</dt>
  34807. <dd><p>Set max average pixel value for frame. If sum of all pixel components is higher that this
  34808. average, output frame will be completely filled with value set by <var>fill</var> option.
  34809. Typically useful for scene changes when used in combination with <code>tblend</code> filter.
  34810. </p></dd>
  34811. </dl>
  34812. <a name="mcdeint"></a>
  34813. <h2 class="section"><a href="ffmpeg-all.html#toc-mcdeint">39.128 mcdeint</a></h2>
  34814. <p>Apply motion-compensation deinterlacing.
  34815. </p>
  34816. <p>It needs one field per frame as input and must thus be used together
  34817. with yadif=1/3 or equivalent.
  34818. </p>
  34819. <p>This filter accepts the following options:
  34820. </p><dl compact="compact">
  34821. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  34822. <dd><p>Set the deinterlacing mode.
  34823. </p>
  34824. <p>It accepts one of the following values:
  34825. </p><dl compact="compact">
  34826. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  34827. <dt>&lsquo;<samp>medium</samp>&rsquo;</dt>
  34828. <dt>&lsquo;<samp>slow</samp>&rsquo;</dt>
  34829. <dd><p>use iterative motion estimation
  34830. </p></dd>
  34831. <dt>&lsquo;<samp>extra_slow</samp>&rsquo;</dt>
  34832. <dd><p>like &lsquo;<samp>slow</samp>&rsquo;, but use multiple reference frames.
  34833. </p></dd>
  34834. </dl>
  34835. <p>Default value is &lsquo;<samp>fast</samp>&rsquo;.
  34836. </p>
  34837. </dd>
  34838. <dt>&lsquo;<samp>parity</samp>&rsquo;</dt>
  34839. <dd><p>Set the picture field parity assumed for the input video. It must be
  34840. one of the following values:
  34841. </p>
  34842. <dl compact="compact">
  34843. <dt>&lsquo;<samp>0, tff</samp>&rsquo;</dt>
  34844. <dd><p>assume top field first
  34845. </p></dd>
  34846. <dt>&lsquo;<samp>1, bff</samp>&rsquo;</dt>
  34847. <dd><p>assume bottom field first
  34848. </p></dd>
  34849. </dl>
  34850. <p>Default value is &lsquo;<samp>bff</samp>&rsquo;.
  34851. </p>
  34852. </dd>
  34853. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  34854. <dd><p>Set per-block quantization parameter (QP) used by the internal
  34855. encoder.
  34856. </p>
  34857. <p>Higher values should result in a smoother motion vector field but less
  34858. optimal individual vectors. Default value is 1.
  34859. </p></dd>
  34860. </dl>
  34861. <a name="median"></a>
  34862. <h2 class="section"><a href="ffmpeg-all.html#toc-median">39.129 median</a></h2>
  34863. <p>Pick median pixel from certain rectangle defined by radius.
  34864. </p>
  34865. <p>This filter accepts the following options:
  34866. </p>
  34867. <dl compact="compact">
  34868. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  34869. <dd><p>Set horizontal radius size. Default value is <code>1</code>.
  34870. Allowed range is integer from 1 to 127.
  34871. </p>
  34872. </dd>
  34873. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34874. <dd><p>Set which planes to process. Default is <code>15</code>, which is all available planes.
  34875. </p>
  34876. </dd>
  34877. <dt>&lsquo;<samp>radiusV</samp>&rsquo;</dt>
  34878. <dd><p>Set vertical radius size. Default value is <code>0</code>.
  34879. Allowed range is integer from 0 to 127.
  34880. If it is 0, value will be picked from horizontal <code>radius</code> option.
  34881. </p>
  34882. </dd>
  34883. <dt>&lsquo;<samp>percentile</samp>&rsquo;</dt>
  34884. <dd><p>Set median percentile. Default value is <code>0.5</code>.
  34885. Default value of <code>0.5</code> will pick always median values, while <code>0</code> will pick
  34886. minimum values, and <code>1</code> maximum values.
  34887. </p></dd>
  34888. </dl>
  34889. <a name="Commands-5"></a>
  34890. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-5">39.129.1 Commands</a></h3>
  34891. <p>This filter supports same <a href="#commands">commands</a> as options.
  34892. The command accepts the same syntax of the corresponding option.
  34893. </p>
  34894. <p>If the specified expression is not valid, it is kept at its current
  34895. value.
  34896. </p>
  34897. <a name="mergeplanes"></a>
  34898. <h2 class="section"><a href="ffmpeg-all.html#toc-mergeplanes">39.130 mergeplanes</a></h2>
  34899. <p>Merge color channel components from several video streams.
  34900. </p>
  34901. <p>The filter accepts up to 4 input streams, and merge selected input
  34902. planes to the output video.
  34903. </p>
  34904. <p>This filter accepts the following options:
  34905. </p><dl compact="compact">
  34906. <dt>&lsquo;<samp>mapping</samp>&rsquo;</dt>
  34907. <dd><p>Set input to output plane mapping. Default is <code>0</code>.
  34908. </p>
  34909. <p>The mappings is specified as a bitmap. It should be specified as a
  34910. hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. &rsquo;Aa&rsquo; describes the
  34911. mapping for the first plane of the output stream. &rsquo;A&rsquo; sets the number of
  34912. the input stream to use (from 0 to 3), and &rsquo;a&rsquo; the plane number of the
  34913. corresponding input to use (from 0 to 3). The rest of the mappings is
  34914. similar, &rsquo;Bb&rsquo; describes the mapping for the output stream second
  34915. plane, &rsquo;Cc&rsquo; describes the mapping for the output stream third plane and
  34916. &rsquo;Dd&rsquo; describes the mapping for the output stream fourth plane.
  34917. </p>
  34918. </dd>
  34919. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  34920. <dd><p>Set output pixel format. Default is <code>yuva444p</code>.
  34921. </p></dd>
  34922. </dl>
  34923. <a name="Examples-155"></a>
  34924. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-155">39.130.1 Examples</a></h3>
  34925. <ul>
  34926. <li>
  34927. Merge three gray video streams of same width and height into single video stream:
  34928. <div class="example">
  34929. <pre class="example">[a0][a1][a2]mergeplanes=0x001020:yuv444p
  34930. </pre></div>
  34931. </li><li>
  34932. Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
  34933. <div class="example">
  34934. <pre class="example">[a0][a1]mergeplanes=0x00010210:yuva444p
  34935. </pre></div>
  34936. </li><li>
  34937. Swap Y and A plane in yuva444p stream:
  34938. <div class="example">
  34939. <pre class="example">format=yuva444p,mergeplanes=0x03010200:yuva444p
  34940. </pre></div>
  34941. </li><li>
  34942. Swap U and V plane in yuv420p stream:
  34943. <div class="example">
  34944. <pre class="example">format=yuv420p,mergeplanes=0x000201:yuv420p
  34945. </pre></div>
  34946. </li><li>
  34947. Cast a rgb24 clip to yuv444p:
  34948. <div class="example">
  34949. <pre class="example">format=rgb24,mergeplanes=0x000102:yuv444p
  34950. </pre></div>
  34951. </li></ul>
  34952. <a name="mestimate"></a>
  34953. <h2 class="section"><a href="ffmpeg-all.html#toc-mestimate">39.131 mestimate</a></h2>
  34954. <p>Estimate and export motion vectors using block matching algorithms.
  34955. Motion vectors are stored in frame side data to be used by other filters.
  34956. </p>
  34957. <p>This filter accepts the following options:
  34958. </p><dl compact="compact">
  34959. <dt>&lsquo;<samp>method</samp>&rsquo;</dt>
  34960. <dd><p>Specify the motion estimation method. Accepts one of the following values:
  34961. </p>
  34962. <dl compact="compact">
  34963. <dt>&lsquo;<samp>esa</samp>&rsquo;</dt>
  34964. <dd><p>Exhaustive search algorithm.
  34965. </p></dd>
  34966. <dt>&lsquo;<samp>tss</samp>&rsquo;</dt>
  34967. <dd><p>Three step search algorithm.
  34968. </p></dd>
  34969. <dt>&lsquo;<samp>tdls</samp>&rsquo;</dt>
  34970. <dd><p>Two dimensional logarithmic search algorithm.
  34971. </p></dd>
  34972. <dt>&lsquo;<samp>ntss</samp>&rsquo;</dt>
  34973. <dd><p>New three step search algorithm.
  34974. </p></dd>
  34975. <dt>&lsquo;<samp>fss</samp>&rsquo;</dt>
  34976. <dd><p>Four step search algorithm.
  34977. </p></dd>
  34978. <dt>&lsquo;<samp>ds</samp>&rsquo;</dt>
  34979. <dd><p>Diamond search algorithm.
  34980. </p></dd>
  34981. <dt>&lsquo;<samp>hexbs</samp>&rsquo;</dt>
  34982. <dd><p>Hexagon-based search algorithm.
  34983. </p></dd>
  34984. <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
  34985. <dd><p>Enhanced predictive zonal search algorithm.
  34986. </p></dd>
  34987. <dt>&lsquo;<samp>umh</samp>&rsquo;</dt>
  34988. <dd><p>Uneven multi-hexagon search algorithm.
  34989. </p></dd>
  34990. </dl>
  34991. <p>Default value is &lsquo;<samp>esa</samp>&rsquo;.
  34992. </p>
  34993. </dd>
  34994. <dt>&lsquo;<samp>mb_size</samp>&rsquo;</dt>
  34995. <dd><p>Macroblock size. Default <code>16</code>.
  34996. </p>
  34997. </dd>
  34998. <dt>&lsquo;<samp>search_param</samp>&rsquo;</dt>
  34999. <dd><p>Search parameter. Default <code>7</code>.
  35000. </p></dd>
  35001. </dl>
  35002. <a name="midequalizer"></a>
  35003. <h2 class="section"><a href="ffmpeg-all.html#toc-midequalizer">39.132 midequalizer</a></h2>
  35004. <p>Apply Midway Image Equalization effect using two video streams.
  35005. </p>
  35006. <p>Midway Image Equalization adjusts a pair of images to have the same
  35007. histogram, while maintaining their dynamics as much as possible. It&rsquo;s
  35008. useful for e.g. matching exposures from a pair of stereo cameras.
  35009. </p>
  35010. <p>This filter has two inputs and one output, which must be of same pixel format, but
  35011. may be of different sizes. The output of filter is first input adjusted with
  35012. midway histogram of both inputs.
  35013. </p>
  35014. <p>This filter accepts the following option:
  35015. </p>
  35016. <dl compact="compact">
  35017. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  35018. <dd><p>Set which planes to process. Default is <code>15</code>, which is all available planes.
  35019. </p></dd>
  35020. </dl>
  35021. <a name="minterpolate"></a>
  35022. <h2 class="section"><a href="ffmpeg-all.html#toc-minterpolate">39.133 minterpolate</a></h2>
  35023. <p>Convert the video to specified frame rate using motion interpolation.
  35024. </p>
  35025. <p>This filter accepts the following options:
  35026. </p><dl compact="compact">
  35027. <dt>&lsquo;<samp>fps</samp>&rsquo;</dt>
  35028. <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>.
  35029. </p>
  35030. </dd>
  35031. <dt>&lsquo;<samp>mi_mode</samp>&rsquo;</dt>
  35032. <dd><p>Motion interpolation mode. Following values are accepted:
  35033. </p><dl compact="compact">
  35034. <dt>&lsquo;<samp>dup</samp>&rsquo;</dt>
  35035. <dd><p>Duplicate previous or next frame for interpolating new ones.
  35036. </p></dd>
  35037. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  35038. <dd><p>Blend source frames. Interpolated frame is mean of previous and next frames.
  35039. </p></dd>
  35040. <dt>&lsquo;<samp>mci</samp>&rsquo;</dt>
  35041. <dd><p>Motion compensated interpolation. Following options are effective when this mode is selected:
  35042. </p>
  35043. <dl compact="compact">
  35044. <dt>&lsquo;<samp>mc_mode</samp>&rsquo;</dt>
  35045. <dd><p>Motion compensation mode. Following values are accepted:
  35046. </p><dl compact="compact">
  35047. <dt>&lsquo;<samp>obmc</samp>&rsquo;</dt>
  35048. <dd><p>Overlapped block motion compensation.
  35049. </p></dd>
  35050. <dt>&lsquo;<samp>aobmc</samp>&rsquo;</dt>
  35051. <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.
  35052. </p></dd>
  35053. </dl>
  35054. <p>Default mode is &lsquo;<samp>obmc</samp>&rsquo;.
  35055. </p>
  35056. </dd>
  35057. <dt>&lsquo;<samp>me_mode</samp>&rsquo;</dt>
  35058. <dd><p>Motion estimation mode. Following values are accepted:
  35059. </p><dl compact="compact">
  35060. <dt>&lsquo;<samp>bidir</samp>&rsquo;</dt>
  35061. <dd><p>Bidirectional motion estimation. Motion vectors are estimated for each source frame in both forward and backward directions.
  35062. </p></dd>
  35063. <dt>&lsquo;<samp>bilat</samp>&rsquo;</dt>
  35064. <dd><p>Bilateral motion estimation. Motion vectors are estimated directly for interpolated frame.
  35065. </p></dd>
  35066. </dl>
  35067. <p>Default mode is &lsquo;<samp>bilat</samp>&rsquo;.
  35068. </p>
  35069. </dd>
  35070. <dt>&lsquo;<samp>me</samp>&rsquo;</dt>
  35071. <dd><p>The algorithm to be used for motion estimation. Following values are accepted:
  35072. </p><dl compact="compact">
  35073. <dt>&lsquo;<samp>esa</samp>&rsquo;</dt>
  35074. <dd><p>Exhaustive search algorithm.
  35075. </p></dd>
  35076. <dt>&lsquo;<samp>tss</samp>&rsquo;</dt>
  35077. <dd><p>Three step search algorithm.
  35078. </p></dd>
  35079. <dt>&lsquo;<samp>tdls</samp>&rsquo;</dt>
  35080. <dd><p>Two dimensional logarithmic search algorithm.
  35081. </p></dd>
  35082. <dt>&lsquo;<samp>ntss</samp>&rsquo;</dt>
  35083. <dd><p>New three step search algorithm.
  35084. </p></dd>
  35085. <dt>&lsquo;<samp>fss</samp>&rsquo;</dt>
  35086. <dd><p>Four step search algorithm.
  35087. </p></dd>
  35088. <dt>&lsquo;<samp>ds</samp>&rsquo;</dt>
  35089. <dd><p>Diamond search algorithm.
  35090. </p></dd>
  35091. <dt>&lsquo;<samp>hexbs</samp>&rsquo;</dt>
  35092. <dd><p>Hexagon-based search algorithm.
  35093. </p></dd>
  35094. <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
  35095. <dd><p>Enhanced predictive zonal search algorithm.
  35096. </p></dd>
  35097. <dt>&lsquo;<samp>umh</samp>&rsquo;</dt>
  35098. <dd><p>Uneven multi-hexagon search algorithm.
  35099. </p></dd>
  35100. </dl>
  35101. <p>Default algorithm is &lsquo;<samp>epzs</samp>&rsquo;.
  35102. </p>
  35103. </dd>
  35104. <dt>&lsquo;<samp>mb_size</samp>&rsquo;</dt>
  35105. <dd><p>Macroblock size. Default <code>16</code>.
  35106. </p>
  35107. </dd>
  35108. <dt>&lsquo;<samp>search_param</samp>&rsquo;</dt>
  35109. <dd><p>Motion estimation search parameter. Default <code>32</code>.
  35110. </p>
  35111. </dd>
  35112. <dt>&lsquo;<samp>vsbmc</samp>&rsquo;</dt>
  35113. <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).
  35114. </p></dd>
  35115. </dl>
  35116. </dd>
  35117. </dl>
  35118. </dd>
  35119. <dt>&lsquo;<samp>scd</samp>&rsquo;</dt>
  35120. <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:
  35121. </p><dl compact="compact">
  35122. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  35123. <dd><p>Disable scene change detection.
  35124. </p></dd>
  35125. <dt>&lsquo;<samp>fdiff</samp>&rsquo;</dt>
  35126. <dd><p>Frame difference. Corresponding pixel values are compared and if it satisfies <var>scd_threshold</var> scene change is detected.
  35127. </p></dd>
  35128. </dl>
  35129. <p>Default method is &lsquo;<samp>fdiff</samp>&rsquo;.
  35130. </p>
  35131. </dd>
  35132. <dt>&lsquo;<samp>scd_threshold</samp>&rsquo;</dt>
  35133. <dd><p>Scene change detection threshold. Default is <code>10.</code>.
  35134. </p></dd>
  35135. </dl>
  35136. <a name="mix"></a>
  35137. <h2 class="section"><a href="ffmpeg-all.html#toc-mix">39.134 mix</a></h2>
  35138. <p>Mix several video input streams into one video stream.
  35139. </p>
  35140. <p>A description of the accepted options follows.
  35141. </p>
  35142. <dl compact="compact">
  35143. <dt>&lsquo;<samp>nb_inputs</samp>&rsquo;</dt>
  35144. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  35145. </p>
  35146. </dd>
  35147. <dt>&lsquo;<samp>weights</samp>&rsquo;</dt>
  35148. <dd><p>Specify weight of each input video stream as sequence.
  35149. Each weight is separated by space. If number of weights
  35150. is smaller than number of <var>frames</var> last specified
  35151. weight will be used for all remaining unset weights.
  35152. </p>
  35153. </dd>
  35154. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  35155. <dd><p>Specify scale, if it is set it will be multiplied with sum
  35156. of each weight multiplied with pixel values to give final destination
  35157. pixel value. By default <var>scale</var> is auto scaled to sum of weights.
  35158. </p>
  35159. </dd>
  35160. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  35161. <dd><p>Specify how end of stream is determined.
  35162. </p><dl compact="compact">
  35163. <dt>&lsquo;<samp>longest</samp>&rsquo;</dt>
  35164. <dd><p>The duration of the longest input. (default)
  35165. </p>
  35166. </dd>
  35167. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  35168. <dd><p>The duration of the shortest input.
  35169. </p>
  35170. </dd>
  35171. <dt>&lsquo;<samp>first</samp>&rsquo;</dt>
  35172. <dd><p>The duration of the first input.
  35173. </p></dd>
  35174. </dl>
  35175. </dd>
  35176. </dl>
  35177. <a name="mpdecimate"></a>
  35178. <h2 class="section"><a href="ffmpeg-all.html#toc-mpdecimate">39.135 mpdecimate</a></h2>
  35179. <p>Drop frames that do not differ greatly from the previous frame in
  35180. order to reduce frame rate.
  35181. </p>
  35182. <p>The main use of this filter is for very-low-bitrate encoding
  35183. (e.g. streaming over dialup modem), but it could in theory be used for
  35184. fixing movies that were inverse-telecined incorrectly.
  35185. </p>
  35186. <p>A description of the accepted options follows.
  35187. </p>
  35188. <dl compact="compact">
  35189. <dt>&lsquo;<samp>max</samp>&rsquo;</dt>
  35190. <dd><p>Set the maximum number of consecutive frames which can be dropped (if
  35191. positive), or the minimum interval between dropped frames (if
  35192. negative). If the value is 0, the frame is dropped disregarding the
  35193. number of previous sequentially dropped frames.
  35194. </p>
  35195. <p>Default value is 0.
  35196. </p>
  35197. </dd>
  35198. <dt>&lsquo;<samp>hi</samp>&rsquo;</dt>
  35199. <dt>&lsquo;<samp>lo</samp>&rsquo;</dt>
  35200. <dt>&lsquo;<samp>frac</samp>&rsquo;</dt>
  35201. <dd><p>Set the dropping threshold values.
  35202. </p>
  35203. <p>Values for &lsquo;<samp>hi</samp>&rsquo; and &lsquo;<samp>lo</samp>&rsquo; are for 8x8 pixel blocks and
  35204. represent actual pixel value differences, so a threshold of 64
  35205. corresponds to 1 unit of difference for each pixel, or the same spread
  35206. out differently over the block.
  35207. </p>
  35208. <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
  35209. than a threshold of &lsquo;<samp>hi</samp>&rsquo;, and if no more than &lsquo;<samp>frac</samp>&rsquo; blocks (1
  35210. meaning the whole image) differ by more than a threshold of &lsquo;<samp>lo</samp>&rsquo;.
  35211. </p>
  35212. <p>Default value for &lsquo;<samp>hi</samp>&rsquo; is 64*12, default value for &lsquo;<samp>lo</samp>&rsquo; is
  35213. 64*5, and default value for &lsquo;<samp>frac</samp>&rsquo; is 0.33.
  35214. </p></dd>
  35215. </dl>
  35216. <a name="negate"></a>
  35217. <h2 class="section"><a href="ffmpeg-all.html#toc-negate">39.136 negate</a></h2>
  35218. <p>Negate (invert) the input video.
  35219. </p>
  35220. <p>It accepts the following option:
  35221. </p>
  35222. <dl compact="compact">
  35223. <dt>&lsquo;<samp>negate_alpha</samp>&rsquo;</dt>
  35224. <dd><p>With value 1, it negates the alpha component, if present. Default value is 0.
  35225. </p></dd>
  35226. </dl>
  35227. <p><a name="nlmeans"></a>
  35228. </p><a name="nlmeans-1"></a>
  35229. <h2 class="section"><a href="ffmpeg-all.html#toc-nlmeans-1">39.137 nlmeans</a></h2>
  35230. <p>Denoise frames using Non-Local Means algorithm.
  35231. </p>
  35232. <p>Each pixel is adjusted by looking for other pixels with similar contexts. This
  35233. context similarity is defined by comparing their surrounding patches of size
  35234. &lsquo;<samp>p</samp>&rsquo;x&lsquo;<samp>p</samp>&rsquo;. Patches are searched in an area of &lsquo;<samp>r</samp>&rsquo;x&lsquo;<samp>r</samp>&rsquo;
  35235. around the pixel.
  35236. </p>
  35237. <p>Note that the research area defines centers for patches, which means some
  35238. patches will be made of pixels outside that research area.
  35239. </p>
  35240. <p>The filter accepts the following options.
  35241. </p>
  35242. <dl compact="compact">
  35243. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  35244. <dd><p>Set denoising strength. Default is 1.0. Must be in range [1.0, 30.0].
  35245. </p>
  35246. </dd>
  35247. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  35248. <dd><p>Set patch size. Default is 7. Must be odd number in range [0, 99].
  35249. </p>
  35250. </dd>
  35251. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  35252. <dd><p>Same as &lsquo;<samp>p</samp>&rsquo; but for chroma planes.
  35253. </p>
  35254. <p>The default value is <var>0</var> and means automatic.
  35255. </p>
  35256. </dd>
  35257. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  35258. <dd><p>Set research size. Default is 15. Must be odd number in range [0, 99].
  35259. </p>
  35260. </dd>
  35261. <dt>&lsquo;<samp>rc</samp>&rsquo;</dt>
  35262. <dd><p>Same as &lsquo;<samp>r</samp>&rsquo; but for chroma planes.
  35263. </p>
  35264. <p>The default value is <var>0</var> and means automatic.
  35265. </p></dd>
  35266. </dl>
  35267. <a name="nnedi"></a>
  35268. <h2 class="section"><a href="ffmpeg-all.html#toc-nnedi">39.138 nnedi</a></h2>
  35269. <p>Deinterlace video using neural network edge directed interpolation.
  35270. </p>
  35271. <p>This filter accepts the following options:
  35272. </p>
  35273. <dl compact="compact">
  35274. <dt>&lsquo;<samp>weights</samp>&rsquo;</dt>
  35275. <dd><p>Mandatory option, without binary file filter can not work.
  35276. Currently file can be found here:
  35277. https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin
  35278. </p>
  35279. </dd>
  35280. <dt>&lsquo;<samp>deint</samp>&rsquo;</dt>
  35281. <dd><p>Set which frames to deinterlace, by default it is <code>all</code>.
  35282. Can be <code>all</code> or <code>interlaced</code>.
  35283. </p>
  35284. </dd>
  35285. <dt>&lsquo;<samp>field</samp>&rsquo;</dt>
  35286. <dd><p>Set mode of operation.
  35287. </p>
  35288. <p>Can be one of the following:
  35289. </p>
  35290. <dl compact="compact">
  35291. <dt>&lsquo;<samp>af</samp>&rsquo;</dt>
  35292. <dd><p>Use frame flags, both fields.
  35293. </p></dd>
  35294. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  35295. <dd><p>Use frame flags, single field.
  35296. </p></dd>
  35297. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  35298. <dd><p>Use top field only.
  35299. </p></dd>
  35300. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  35301. <dd><p>Use bottom field only.
  35302. </p></dd>
  35303. <dt>&lsquo;<samp>tf</samp>&rsquo;</dt>
  35304. <dd><p>Use both fields, top first.
  35305. </p></dd>
  35306. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  35307. <dd><p>Use both fields, bottom first.
  35308. </p></dd>
  35309. </dl>
  35310. </dd>
  35311. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  35312. <dd><p>Set which planes to process, by default filter process all frames.
  35313. </p>
  35314. </dd>
  35315. <dt>&lsquo;<samp>nsize</samp>&rsquo;</dt>
  35316. <dd><p>Set size of local neighborhood around each pixel, used by the predictor neural
  35317. network.
  35318. </p>
  35319. <p>Can be one of the following:
  35320. </p>
  35321. <dl compact="compact">
  35322. <dt>&lsquo;<samp>s8x6</samp>&rsquo;</dt>
  35323. <dt>&lsquo;<samp>s16x6</samp>&rsquo;</dt>
  35324. <dt>&lsquo;<samp>s32x6</samp>&rsquo;</dt>
  35325. <dt>&lsquo;<samp>s48x6</samp>&rsquo;</dt>
  35326. <dt>&lsquo;<samp>s8x4</samp>&rsquo;</dt>
  35327. <dt>&lsquo;<samp>s16x4</samp>&rsquo;</dt>
  35328. <dt>&lsquo;<samp>s32x4</samp>&rsquo;</dt>
  35329. </dl>
  35330. </dd>
  35331. <dt>&lsquo;<samp>nns</samp>&rsquo;</dt>
  35332. <dd><p>Set the number of neurons in predictor neural network.
  35333. Can be one of the following:
  35334. </p>
  35335. <dl compact="compact">
  35336. <dt>&lsquo;<samp>n16</samp>&rsquo;</dt>
  35337. <dt>&lsquo;<samp>n32</samp>&rsquo;</dt>
  35338. <dt>&lsquo;<samp>n64</samp>&rsquo;</dt>
  35339. <dt>&lsquo;<samp>n128</samp>&rsquo;</dt>
  35340. <dt>&lsquo;<samp>n256</samp>&rsquo;</dt>
  35341. </dl>
  35342. </dd>
  35343. <dt>&lsquo;<samp>qual</samp>&rsquo;</dt>
  35344. <dd><p>Controls the number of different neural network predictions that are blended
  35345. together to compute the final output value. Can be <code>fast</code>, default or
  35346. <code>slow</code>.
  35347. </p>
  35348. </dd>
  35349. <dt>&lsquo;<samp>etype</samp>&rsquo;</dt>
  35350. <dd><p>Set which set of weights to use in the predictor.
  35351. Can be one of the following:
  35352. </p>
  35353. <dl compact="compact">
  35354. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  35355. <dd><p>weights trained to minimize absolute error
  35356. </p></dd>
  35357. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  35358. <dd><p>weights trained to minimize squared error
  35359. </p></dd>
  35360. </dl>
  35361. </dd>
  35362. <dt>&lsquo;<samp>pscrn</samp>&rsquo;</dt>
  35363. <dd><p>Controls whether or not the prescreener neural network is used to decide
  35364. which pixels should be processed by the predictor neural network and which
  35365. can be handled by simple cubic interpolation.
  35366. The prescreener is trained to know whether cubic interpolation will be
  35367. sufficient for a pixel or whether it should be predicted by the predictor nn.
  35368. The computational complexity of the prescreener nn is much less than that of
  35369. the predictor nn. Since most pixels can be handled by cubic interpolation,
  35370. using the prescreener generally results in much faster processing.
  35371. The prescreener is pretty accurate, so the difference between using it and not
  35372. using it is almost always unnoticeable.
  35373. </p>
  35374. <p>Can be one of the following:
  35375. </p>
  35376. <dl compact="compact">
  35377. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  35378. <dt>&lsquo;<samp>original</samp>&rsquo;</dt>
  35379. <dt>&lsquo;<samp>new</samp>&rsquo;</dt>
  35380. </dl>
  35381. <p>Default is <code>new</code>.
  35382. </p>
  35383. </dd>
  35384. <dt>&lsquo;<samp>fapprox</samp>&rsquo;</dt>
  35385. <dd><p>Set various debugging flags.
  35386. </p></dd>
  35387. </dl>
  35388. <a name="noformat"></a>
  35389. <h2 class="section"><a href="ffmpeg-all.html#toc-noformat">39.139 noformat</a></h2>
  35390. <p>Force libavfilter not to use any of the specified pixel formats for the
  35391. input to the next filter.
  35392. </p>
  35393. <p>It accepts the following parameters:
  35394. </p><dl compact="compact">
  35395. <dt>&lsquo;<samp>pix_fmts</samp>&rsquo;</dt>
  35396. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  35397. pix_fmts=yuv420p|monow|rgb24&quot;.
  35398. </p>
  35399. </dd>
  35400. </dl>
  35401. <a name="Examples-54"></a>
  35402. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-54">39.139.1 Examples</a></h3>
  35403. <ul>
  35404. <li>
  35405. Force libavfilter to use a format different from <var>yuv420p</var> for the
  35406. input to the vflip filter:
  35407. <div class="example">
  35408. <pre class="example">noformat=pix_fmts=yuv420p,vflip
  35409. </pre></div>
  35410. </li><li>
  35411. Convert the input video to any of the formats not contained in the list:
  35412. <div class="example">
  35413. <pre class="example">noformat=yuv420p|yuv444p|yuv410p
  35414. </pre></div>
  35415. </li></ul>
  35416. <a name="noise"></a>
  35417. <h2 class="section"><a href="ffmpeg-all.html#toc-noise">39.140 noise</a></h2>
  35418. <p>Add noise on video input frame.
  35419. </p>
  35420. <p>The filter accepts the following options:
  35421. </p>
  35422. <dl compact="compact">
  35423. <dt>&lsquo;<samp>all_seed</samp>&rsquo;</dt>
  35424. <dt>&lsquo;<samp>c0_seed</samp>&rsquo;</dt>
  35425. <dt>&lsquo;<samp>c1_seed</samp>&rsquo;</dt>
  35426. <dt>&lsquo;<samp>c2_seed</samp>&rsquo;</dt>
  35427. <dt>&lsquo;<samp>c3_seed</samp>&rsquo;</dt>
  35428. <dd><p>Set noise seed for specific pixel component or all pixel components in case
  35429. of <var>all_seed</var>. Default value is <code>123457</code>.
  35430. </p>
  35431. </dd>
  35432. <dt>&lsquo;<samp>all_strength, alls</samp>&rsquo;</dt>
  35433. <dt>&lsquo;<samp>c0_strength, c0s</samp>&rsquo;</dt>
  35434. <dt>&lsquo;<samp>c1_strength, c1s</samp>&rsquo;</dt>
  35435. <dt>&lsquo;<samp>c2_strength, c2s</samp>&rsquo;</dt>
  35436. <dt>&lsquo;<samp>c3_strength, c3s</samp>&rsquo;</dt>
  35437. <dd><p>Set noise strength for specific pixel component or all pixel components in case
  35438. <var>all_strength</var>. Default value is <code>0</code>. Allowed range is [0, 100].
  35439. </p>
  35440. </dd>
  35441. <dt>&lsquo;<samp>all_flags, allf</samp>&rsquo;</dt>
  35442. <dt>&lsquo;<samp>c0_flags, c0f</samp>&rsquo;</dt>
  35443. <dt>&lsquo;<samp>c1_flags, c1f</samp>&rsquo;</dt>
  35444. <dt>&lsquo;<samp>c2_flags, c2f</samp>&rsquo;</dt>
  35445. <dt>&lsquo;<samp>c3_flags, c3f</samp>&rsquo;</dt>
  35446. <dd><p>Set pixel component flags or set flags for all components if <var>all_flags</var>.
  35447. Available values for component flags are:
  35448. </p><dl compact="compact">
  35449. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  35450. <dd><p>averaged temporal noise (smoother)
  35451. </p></dd>
  35452. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  35453. <dd><p>mix random noise with a (semi)regular pattern
  35454. </p></dd>
  35455. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  35456. <dd><p>temporal noise (noise pattern changes between frames)
  35457. </p></dd>
  35458. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  35459. <dd><p>uniform noise (gaussian otherwise)
  35460. </p></dd>
  35461. </dl>
  35462. </dd>
  35463. </dl>
  35464. <a name="Examples-47"></a>
  35465. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-47">39.140.1 Examples</a></h3>
  35466. <p>Add temporal and uniform noise to input video:
  35467. </p><div class="example">
  35468. <pre class="example">noise=alls=20:allf=t+u
  35469. </pre></div>
  35470. <a name="normalize"></a>
  35471. <h2 class="section"><a href="ffmpeg-all.html#toc-normalize">39.141 normalize</a></h2>
  35472. <p>Normalize RGB video (aka histogram stretching, contrast stretching).
  35473. See: https://en.wikipedia.org/wiki/Normalization_(image_processing)
  35474. </p>
  35475. <p>For each channel of each frame, the filter computes the input range and maps
  35476. it linearly to the user-specified output range. The output range defaults
  35477. to the full dynamic range from pure black to pure white.
  35478. </p>
  35479. <p>Temporal smoothing can be used on the input range to reduce flickering (rapid
  35480. changes in brightness) caused when small dark or bright objects enter or leave
  35481. the scene. This is similar to the auto-exposure (automatic gain control) on a
  35482. video camera, and, like a video camera, it may cause a period of over- or
  35483. under-exposure of the video.
  35484. </p>
  35485. <p>The R,G,B channels can be normalized independently, which may cause some
  35486. color shifting, or linked together as a single channel, which prevents
  35487. color shifting. Linked normalization preserves hue. Independent normalization
  35488. does not, so it can be used to remove some color casts. Independent and linked
  35489. normalization can be combined in any ratio.
  35490. </p>
  35491. <p>The normalize filter accepts the following options:
  35492. </p>
  35493. <dl compact="compact">
  35494. <dt>&lsquo;<samp>blackpt</samp>&rsquo;</dt>
  35495. <dt>&lsquo;<samp>whitept</samp>&rsquo;</dt>
  35496. <dd><p>Colors which define the output range. The minimum input value is mapped to
  35497. the <var>blackpt</var>. The maximum input value is mapped to the <var>whitept</var>.
  35498. The defaults are black and white respectively. Specifying white for
  35499. <var>blackpt</var> and black for <var>whitept</var> will give color-inverted,
  35500. normalized video. Shades of grey can be used to reduce the dynamic range
  35501. (contrast). Specifying saturated colors here can create some interesting
  35502. effects.
  35503. </p>
  35504. </dd>
  35505. <dt>&lsquo;<samp>smoothing</samp>&rsquo;</dt>
  35506. <dd><p>The number of previous frames to use for temporal smoothing. The input range
  35507. of each channel is smoothed using a rolling average over the current frame
  35508. and the <var>smoothing</var> previous frames. The default is 0 (no temporal
  35509. smoothing).
  35510. </p>
  35511. </dd>
  35512. <dt>&lsquo;<samp>independence</samp>&rsquo;</dt>
  35513. <dd><p>Controls the ratio of independent (color shifting) channel normalization to
  35514. linked (color preserving) normalization. 0.0 is fully linked, 1.0 is fully
  35515. independent. Defaults to 1.0 (fully independent).
  35516. </p>
  35517. </dd>
  35518. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  35519. <dd><p>Overall strength of the filter. 1.0 is full strength. 0.0 is a rather
  35520. expensive no-op. Defaults to 1.0 (full strength).
  35521. </p>
  35522. </dd>
  35523. </dl>
  35524. <a name="Commands-41"></a>
  35525. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-41">39.141.1 Commands</a></h3>
  35526. <p>This filter supports same <a href="#commands">commands</a> as options, excluding <var>smoothing</var> option.
  35527. The command accepts the same syntax of the corresponding option.
  35528. </p>
  35529. <p>If the specified expression is not valid, it is kept at its current
  35530. value.
  35531. </p>
  35532. <a name="Examples-32"></a>
  35533. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-32">39.141.2 Examples</a></h3>
  35534. <p>Stretch video contrast to use the full dynamic range, with no temporal
  35535. smoothing; may flicker depending on the source content:
  35536. </p><div class="example">
  35537. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=0
  35538. </pre></div>
  35539. <p>As above, but with 50 frames of temporal smoothing; flicker should be
  35540. reduced, depending on the source content:
  35541. </p><div class="example">
  35542. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=50
  35543. </pre></div>
  35544. <p>As above, but with hue-preserving linked channel normalization:
  35545. </p><div class="example">
  35546. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=50:independence=0
  35547. </pre></div>
  35548. <p>As above, but with half strength:
  35549. </p><div class="example">
  35550. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=50:independence=0:strength=0.5
  35551. </pre></div>
  35552. <p>Map the darkest input color to red, the brightest input color to cyan:
  35553. </p><div class="example">
  35554. <pre class="example">normalize=blackpt=red:whitept=cyan
  35555. </pre></div>
  35556. <a name="null"></a>
  35557. <h2 class="section"><a href="ffmpeg-all.html#toc-null">39.142 null</a></h2>
  35558. <p>Pass the video source unchanged to the output.
  35559. </p>
  35560. <a name="ocr"></a>
  35561. <h2 class="section"><a href="ffmpeg-all.html#toc-ocr">39.143 ocr</a></h2>
  35562. <p>Optical Character Recognition
  35563. </p>
  35564. <p>This filter uses Tesseract for optical character recognition. To enable
  35565. compilation of this filter, you need to configure FFmpeg with
  35566. <code>--enable-libtesseract</code>.
  35567. </p>
  35568. <p>It accepts the following options:
  35569. </p>
  35570. <dl compact="compact">
  35571. <dt>&lsquo;<samp>datapath</samp>&rsquo;</dt>
  35572. <dd><p>Set datapath to tesseract data. Default is to use whatever was
  35573. set at installation.
  35574. </p>
  35575. </dd>
  35576. <dt>&lsquo;<samp>language</samp>&rsquo;</dt>
  35577. <dd><p>Set language, default is &quot;eng&quot;.
  35578. </p>
  35579. </dd>
  35580. <dt>&lsquo;<samp>whitelist</samp>&rsquo;</dt>
  35581. <dd><p>Set character whitelist.
  35582. </p>
  35583. </dd>
  35584. <dt>&lsquo;<samp>blacklist</samp>&rsquo;</dt>
  35585. <dd><p>Set character blacklist.
  35586. </p></dd>
  35587. </dl>
  35588. <p>The filter exports recognized text as the frame metadata <code>lavfi.ocr.text</code>.
  35589. The filter exports confidence of recognized words as the frame metadata <code>lavfi.ocr.confidence</code>.
  35590. </p>
  35591. <a name="ocv"></a>
  35592. <h2 class="section"><a href="ffmpeg-all.html#toc-ocv">39.144 ocv</a></h2>
  35593. <p>Apply a video transform using libopencv.
  35594. </p>
  35595. <p>To enable this filter, install the libopencv library and headers and
  35596. configure FFmpeg with <code>--enable-libopencv</code>.
  35597. </p>
  35598. <p>It accepts the following parameters:
  35599. </p>
  35600. <dl compact="compact">
  35601. <dt>&lsquo;<samp>filter_name</samp>&rsquo;</dt>
  35602. <dd><p>The name of the libopencv filter to apply.
  35603. </p>
  35604. </dd>
  35605. <dt>&lsquo;<samp>filter_params</samp>&rsquo;</dt>
  35606. <dd><p>The parameters to pass to the libopencv filter. If not specified, the default
  35607. values are assumed.
  35608. </p>
  35609. </dd>
  35610. </dl>
  35611. <p>Refer to the official libopencv documentation for more precise
  35612. information:
  35613. <a href="http://docs.opencv.org/master/modules/imgproc/doc/filtering.html">http://docs.opencv.org/master/modules/imgproc/doc/filtering.html</a>
  35614. </p>
  35615. <p>Several libopencv filters are supported; see the following subsections.
  35616. </p>
  35617. <p><a name="dilate"></a>
  35618. </p><a name="dilate-1"></a>
  35619. <h3 class="subsection"><a href="ffmpeg-all.html#toc-dilate-1">39.144.1 dilate</a></h3>
  35620. <p>Dilate an image by using a specific structuring element.
  35621. It corresponds to the libopencv function <code>cvDilate</code>.
  35622. </p>
  35623. <p>It accepts the parameters: <var>struct_el</var>|<var>nb_iterations</var>.
  35624. </p>
  35625. <p><var>struct_el</var> represents a structuring element, and has the syntax:
  35626. <var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
  35627. </p>
  35628. <p><var>cols</var> and <var>rows</var> represent the number of columns and rows of
  35629. the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
  35630. point, and <var>shape</var> the shape for the structuring element. <var>shape</var>
  35631. must be &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, or &quot;custom&quot;.
  35632. </p>
  35633. <p>If the value for <var>shape</var> is &quot;custom&quot;, it must be followed by a
  35634. string of the form &quot;=<var>filename</var>&quot;. The file with name
  35635. <var>filename</var> is assumed to represent a binary image, with each
  35636. printable character corresponding to a bright pixel. When a custom
  35637. <var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
  35638. or columns and rows of the read file are assumed instead.
  35639. </p>
  35640. <p>The default value for <var>struct_el</var> is &quot;3x3+0x0/rect&quot;.
  35641. </p>
  35642. <p><var>nb_iterations</var> specifies the number of times the transform is
  35643. applied to the image, and defaults to 1.
  35644. </p>
  35645. <p>Some examples:
  35646. </p><div class="example">
  35647. <pre class="example"># Use the default values
  35648. ocv=dilate
  35649. # Dilate using a structuring element with a 5x5 cross, iterating two times
  35650. ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
  35651. # Read the shape from the file diamond.shape, iterating two times.
  35652. # The file diamond.shape may contain a pattern of characters like this
  35653. # *
  35654. # ***
  35655. # *****
  35656. # ***
  35657. # *
  35658. # The specified columns and rows are ignored
  35659. # but the anchor point coordinates are not
  35660. ocv=dilate:0x0+2x2/custom=diamond.shape|2
  35661. </pre></div>
  35662. <a name="erode"></a>
  35663. <h3 class="subsection"><a href="ffmpeg-all.html#toc-erode">39.144.2 erode</a></h3>
  35664. <p>Erode an image by using a specific structuring element.
  35665. It corresponds to the libopencv function <code>cvErode</code>.
  35666. </p>
  35667. <p>It accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
  35668. with the same syntax and semantics as the <a href="#dilate">dilate</a> filter.
  35669. </p>
  35670. <a name="smooth"></a>
  35671. <h3 class="subsection"><a href="ffmpeg-all.html#toc-smooth">39.144.3 smooth</a></h3>
  35672. <p>Smooth the input video.
  35673. </p>
  35674. <p>The filter takes the following parameters:
  35675. <var>type</var>|<var>param1</var>|<var>param2</var>|<var>param3</var>|<var>param4</var>.
  35676. </p>
  35677. <p><var>type</var> is the type of smooth filter to apply, and must be one of
  35678. the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
  35679. or &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
  35680. </p>
  35681. <p>The meaning of <var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var>
  35682. depends on the smooth type. <var>param1</var> and
  35683. <var>param2</var> accept integer positive values or 0. <var>param3</var> and
  35684. <var>param4</var> accept floating point values.
  35685. </p>
  35686. <p>The default value for <var>param1</var> is 3. The default value for the
  35687. other parameters is 0.
  35688. </p>
  35689. <p>These parameters correspond to the parameters assigned to the
  35690. libopencv function <code>cvSmooth</code>.
  35691. </p>
  35692. <a name="oscilloscope"></a>
  35693. <h2 class="section"><a href="ffmpeg-all.html#toc-oscilloscope">39.145 oscilloscope</a></h2>
  35694. <p>2D Video Oscilloscope.
  35695. </p>
  35696. <p>Useful to measure spatial impulse, step responses, chroma delays, etc.
  35697. </p>
  35698. <p>It accepts the following parameters:
  35699. </p>
  35700. <dl compact="compact">
  35701. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  35702. <dd><p>Set scope center x position.
  35703. </p>
  35704. </dd>
  35705. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  35706. <dd><p>Set scope center y position.
  35707. </p>
  35708. </dd>
  35709. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  35710. <dd><p>Set scope size, relative to frame diagonal.
  35711. </p>
  35712. </dd>
  35713. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  35714. <dd><p>Set scope tilt/rotation.
  35715. </p>
  35716. </dd>
  35717. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  35718. <dd><p>Set trace opacity.
  35719. </p>
  35720. </dd>
  35721. <dt>&lsquo;<samp>tx</samp>&rsquo;</dt>
  35722. <dd><p>Set trace center x position.
  35723. </p>
  35724. </dd>
  35725. <dt>&lsquo;<samp>ty</samp>&rsquo;</dt>
  35726. <dd><p>Set trace center y position.
  35727. </p>
  35728. </dd>
  35729. <dt>&lsquo;<samp>tw</samp>&rsquo;</dt>
  35730. <dd><p>Set trace width, relative to width of frame.
  35731. </p>
  35732. </dd>
  35733. <dt>&lsquo;<samp>th</samp>&rsquo;</dt>
  35734. <dd><p>Set trace height, relative to height of frame.
  35735. </p>
  35736. </dd>
  35737. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  35738. <dd><p>Set which components to trace. By default it traces first three components.
  35739. </p>
  35740. </dd>
  35741. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  35742. <dd><p>Draw trace grid. By default is enabled.
  35743. </p>
  35744. </dd>
  35745. <dt>&lsquo;<samp>st</samp>&rsquo;</dt>
  35746. <dd><p>Draw some statistics. By default is enabled.
  35747. </p>
  35748. </dd>
  35749. <dt>&lsquo;<samp>sc</samp>&rsquo;</dt>
  35750. <dd><p>Draw scope. By default is enabled.
  35751. </p></dd>
  35752. </dl>
  35753. <a name="Commands-70"></a>
  35754. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-70">39.145.1 Commands</a></h3>
  35755. <p>This filter supports same <a href="#commands">commands</a> as options.
  35756. The command accepts the same syntax of the corresponding option.
  35757. </p>
  35758. <p>If the specified expression is not valid, it is kept at its current
  35759. value.
  35760. </p>
  35761. <a name="Examples-91"></a>
  35762. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-91">39.145.2 Examples</a></h3>
  35763. <ul>
  35764. <li>
  35765. Inspect full first row of video frame.
  35766. <div class="example">
  35767. <pre class="example">oscilloscope=x=0.5:y=0:s=1
  35768. </pre></div>
  35769. </li><li>
  35770. Inspect full last row of video frame.
  35771. <div class="example">
  35772. <pre class="example">oscilloscope=x=0.5:y=1:s=1
  35773. </pre></div>
  35774. </li><li>
  35775. Inspect full 5th line of video frame of height 1080.
  35776. <div class="example">
  35777. <pre class="example">oscilloscope=x=0.5:y=5/1080:s=1
  35778. </pre></div>
  35779. </li><li>
  35780. Inspect full last column of video frame.
  35781. <div class="example">
  35782. <pre class="example">oscilloscope=x=1:y=0.5:s=1:t=1
  35783. </pre></div>
  35784. </li></ul>
  35785. <p><a name="overlay"></a>
  35786. </p><a name="overlay-1"></a>
  35787. <h2 class="section"><a href="ffmpeg-all.html#toc-overlay-1">39.146 overlay</a></h2>
  35788. <p>Overlay one video on top of another.
  35789. </p>
  35790. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  35791. video on which the second input is overlaid.
  35792. </p>
  35793. <p>It accepts the following parameters:
  35794. </p>
  35795. <p>A description of the accepted options follows.
  35796. </p>
  35797. <dl compact="compact">
  35798. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  35799. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  35800. <dd><p>Set the expression for the x and y coordinates of the overlaid video
  35801. on the main video. Default value is &quot;0&quot; for both expressions. In case
  35802. the expression is invalid, it is set to a huge value (meaning that the
  35803. overlay will not be displayed within the output visible area).
  35804. </p>
  35805. </dd>
  35806. <dt>&lsquo;<samp>eof_action</samp>&rsquo;</dt>
  35807. <dd><p>See <a href="#framesync">framesync</a>.
  35808. </p>
  35809. </dd>
  35810. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  35811. <dd><p>Set when the expressions for &lsquo;<samp>x</samp>&rsquo;, and &lsquo;<samp>y</samp>&rsquo; are evaluated.
  35812. </p>
  35813. <p>It accepts the following values:
  35814. </p><dl compact="compact">
  35815. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  35816. <dd><p>only evaluate expressions once during the filter initialization or
  35817. when a command is processed
  35818. </p>
  35819. </dd>
  35820. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  35821. <dd><p>evaluate expressions for each incoming frame
  35822. </p></dd>
  35823. </dl>
  35824. <p>Default value is &lsquo;<samp>frame</samp>&rsquo;.
  35825. </p>
  35826. </dd>
  35827. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  35828. <dd><p>See <a href="#framesync">framesync</a>.
  35829. </p>
  35830. </dd>
  35831. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  35832. <dd><p>Set the format for the output video.
  35833. </p>
  35834. <p>It accepts the following values:
  35835. </p><dl compact="compact">
  35836. <dt>&lsquo;<samp>yuv420</samp>&rsquo;</dt>
  35837. <dd><p>force YUV420 output
  35838. </p>
  35839. </dd>
  35840. <dt>&lsquo;<samp>yuv422</samp>&rsquo;</dt>
  35841. <dd><p>force YUV422 output
  35842. </p>
  35843. </dd>
  35844. <dt>&lsquo;<samp>yuv444</samp>&rsquo;</dt>
  35845. <dd><p>force YUV444 output
  35846. </p>
  35847. </dd>
  35848. <dt>&lsquo;<samp>rgb</samp>&rsquo;</dt>
  35849. <dd><p>force packed RGB output
  35850. </p>
  35851. </dd>
  35852. <dt>&lsquo;<samp>gbrp</samp>&rsquo;</dt>
  35853. <dd><p>force planar RGB output
  35854. </p>
  35855. </dd>
  35856. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  35857. <dd><p>automatically pick format
  35858. </p></dd>
  35859. </dl>
  35860. <p>Default value is &lsquo;<samp>yuv420</samp>&rsquo;.
  35861. </p>
  35862. </dd>
  35863. <dt>&lsquo;<samp>repeatlast</samp>&rsquo;</dt>
  35864. <dd><p>See <a href="#framesync">framesync</a>.
  35865. </p>
  35866. </dd>
  35867. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  35868. <dd><p>Set format of alpha of the overlaid video, it can be <var>straight</var> or
  35869. <var>premultiplied</var>. Default is <var>straight</var>.
  35870. </p></dd>
  35871. </dl>
  35872. <p>The &lsquo;<samp>x</samp>&rsquo;, and &lsquo;<samp>y</samp>&rsquo; expressions can contain the following
  35873. parameters.
  35874. </p>
  35875. <dl compact="compact">
  35876. <dt>&lsquo;<samp>main_w, W</samp>&rsquo;</dt>
  35877. <dt>&lsquo;<samp>main_h, H</samp>&rsquo;</dt>
  35878. <dd><p>The main input width and height.
  35879. </p>
  35880. </dd>
  35881. <dt>&lsquo;<samp>overlay_w, w</samp>&rsquo;</dt>
  35882. <dt>&lsquo;<samp>overlay_h, h</samp>&rsquo;</dt>
  35883. <dd><p>The overlay input width and height.
  35884. </p>
  35885. </dd>
  35886. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  35887. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  35888. <dd><p>The computed values for <var>x</var> and <var>y</var>. They are evaluated for
  35889. each new frame.
  35890. </p>
  35891. </dd>
  35892. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  35893. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  35894. <dd><p>horizontal and vertical chroma subsample values of the output
  35895. format. For example for the pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and
  35896. <var>vsub</var> is 1.
  35897. </p>
  35898. </dd>
  35899. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  35900. <dd><p>the number of input frame, starting from 0
  35901. </p>
  35902. </dd>
  35903. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  35904. <dd><p>the position in the file of the input frame, NAN if unknown
  35905. </p>
  35906. </dd>
  35907. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  35908. <dd><p>The timestamp, expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  35909. </p>
  35910. </dd>
  35911. </dl>
  35912. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  35913. </p>
  35914. <p>Note that the <var>n</var>, <var>pos</var>, <var>t</var> variables are available only
  35915. when evaluation is done <em>per frame</em>, and will evaluate to NAN
  35916. when &lsquo;<samp>eval</samp>&rsquo; is set to &lsquo;<samp>init</samp>&rsquo;.
  35917. </p>
  35918. <p>Be aware that frames are taken from each input video in timestamp
  35919. order, hence, if their initial timestamps differ, it is a good idea
  35920. to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
  35921. have them begin in the same zero timestamp, as the example for
  35922. the <var>movie</var> filter does.
  35923. </p>
  35924. <p>You can chain together more overlays but you should test the
  35925. efficiency of such approach.
  35926. </p>
  35927. <a name="Commands-21"></a>
  35928. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-21">39.146.1 Commands</a></h3>
  35929. <p>This filter supports the following commands:
  35930. </p><dl compact="compact">
  35931. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  35932. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  35933. <dd><p>Modify the x and y of the overlay input.
  35934. The command accepts the same syntax of the corresponding option.
  35935. </p>
  35936. <p>If the specified expression is not valid, it is kept at its current
  35937. value.
  35938. </p></dd>
  35939. </dl>
  35940. <a name="Examples-53"></a>
  35941. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-53">39.146.2 Examples</a></h3>
  35942. <ul>
  35943. <li>
  35944. Draw the overlay at 10 pixels from the bottom right corner of the main
  35945. video:
  35946. <div class="example">
  35947. <pre class="example">overlay=main_w-overlay_w-10:main_h-overlay_h-10
  35948. </pre></div>
  35949. <p>Using named options the example above becomes:
  35950. </p><div class="example">
  35951. <pre class="example">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
  35952. </pre></div>
  35953. </li><li>
  35954. Insert a transparent PNG logo in the bottom left corner of the input,
  35955. using the <code>ffmpeg</code> tool with the <code>-filter_complex</code> option:
  35956. <div class="example">
  35957. <pre class="example">ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
  35958. </pre></div>
  35959. </li><li>
  35960. Insert 2 different transparent PNG logos (second logo on bottom
  35961. right corner) using the <code>ffmpeg</code> tool:
  35962. <div class="example">
  35963. <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
  35964. </pre></div>
  35965. </li><li>
  35966. Add a transparent color layer on top of the main video; <code>WxH</code>
  35967. must specify the size of the main input to the overlay filter:
  35968. <div class="example">
  35969. <pre class="example">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
  35970. </pre></div>
  35971. </li><li>
  35972. Play an original video and a filtered version (here with the deshake
  35973. filter) side by side using the <code>ffplay</code> tool:
  35974. <div class="example">
  35975. <pre class="example">ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
  35976. </pre></div>
  35977. <p>The above command is the same as:
  35978. </p><div class="example">
  35979. <pre class="example">ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
  35980. </pre></div>
  35981. </li><li>
  35982. Make a sliding overlay appearing from the left to the right top part of the
  35983. screen starting since time 2:
  35984. <div class="example">
  35985. <pre class="example">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
  35986. </pre></div>
  35987. </li><li>
  35988. Compose output by putting two input videos side to side:
  35989. <div class="example">
  35990. <pre class="example">ffmpeg -i left.avi -i right.avi -filter_complex &quot;
  35991. nullsrc=size=200x100 [background];
  35992. [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
  35993. [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
  35994. [background][left] overlay=shortest=1 [background+left];
  35995. [background+left][right] overlay=shortest=1:x=100 [left+right]
  35996. &quot;
  35997. </pre></div>
  35998. </li><li>
  35999. Mask 10-20 seconds of a video by applying the delogo filter to a section
  36000. <div class="example">
  36001. <pre class="example">ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
  36002. -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]'
  36003. masked.avi
  36004. </pre></div>
  36005. </li><li>
  36006. Chain several overlays in cascade:
  36007. <div class="example">
  36008. <pre class="example">nullsrc=s=200x200 [bg];
  36009. testsrc=s=100x100, split=4 [in0][in1][in2][in3];
  36010. [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
  36011. [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
  36012. [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
  36013. [in3] null, [mid2] overlay=100:100 [out0]
  36014. </pre></div>
  36015. </li></ul>
  36016. <p><a name="overlay_005fcuda"></a>
  36017. </p><a name="overlay_005fcuda-1"></a>
  36018. <h2 class="section"><a href="ffmpeg-all.html#toc-overlay_005fcuda-1">39.147 overlay_cuda</a></h2>
  36019. <p>Overlay one video on top of another.
  36020. </p>
  36021. <p>This is the CUDA cariant of the <a href="#overlay">overlay</a> filter.
  36022. It only accepts CUDA frames. The underlying input pixel formats have to match.
  36023. </p>
  36024. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  36025. video on which the second input is overlaid.
  36026. </p>
  36027. <p>It accepts the following parameters:
  36028. </p>
  36029. <dl compact="compact">
  36030. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  36031. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  36032. <dd><p>Set the x and y coordinates of the overlaid video on the main video.
  36033. Default value is &quot;0&quot; for both expressions.
  36034. </p>
  36035. </dd>
  36036. <dt>&lsquo;<samp>eof_action</samp>&rsquo;</dt>
  36037. <dd><p>See <a href="#framesync">framesync</a>.
  36038. </p>
  36039. </dd>
  36040. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  36041. <dd><p>See <a href="#framesync">framesync</a>.
  36042. </p>
  36043. </dd>
  36044. <dt>&lsquo;<samp>repeatlast</samp>&rsquo;</dt>
  36045. <dd><p>See <a href="#framesync">framesync</a>.
  36046. </p>
  36047. </dd>
  36048. </dl>
  36049. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  36050. </p>
  36051. <a name="owdenoise"></a>
  36052. <h2 class="section"><a href="ffmpeg-all.html#toc-owdenoise">39.148 owdenoise</a></h2>
  36053. <p>Apply Overcomplete Wavelet denoiser.
  36054. </p>
  36055. <p>The filter accepts the following options:
  36056. </p>
  36057. <dl compact="compact">
  36058. <dt>&lsquo;<samp>depth</samp>&rsquo;</dt>
  36059. <dd><p>Set depth.
  36060. </p>
  36061. <p>Larger depth values will denoise lower frequency components more, but
  36062. slow down filtering.
  36063. </p>
  36064. <p>Must be an int in the range 8-16, default is <code>8</code>.
  36065. </p>
  36066. </dd>
  36067. <dt>&lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
  36068. <dd><p>Set luma strength.
  36069. </p>
  36070. <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
  36071. </p>
  36072. </dd>
  36073. <dt>&lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
  36074. <dd><p>Set chroma strength.
  36075. </p>
  36076. <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
  36077. </p></dd>
  36078. </dl>
  36079. <p><a name="pad"></a>
  36080. </p><a name="pad-1"></a>
  36081. <h2 class="section"><a href="ffmpeg-all.html#toc-pad-1">39.149 pad</a></h2>
  36082. <p>Add paddings to the input image, and place the original input at the
  36083. provided <var>x</var>, <var>y</var> coordinates.
  36084. </p>
  36085. <p>It accepts the following parameters:
  36086. </p>
  36087. <dl compact="compact">
  36088. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  36089. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  36090. <dd><p>Specify an expression for the size of the output image with the
  36091. paddings added. If the value for <var>width</var> or <var>height</var> is 0, the
  36092. corresponding input size is used for the output.
  36093. </p>
  36094. <p>The <var>width</var> expression can reference the value set by the
  36095. <var>height</var> expression, and vice versa.
  36096. </p>
  36097. <p>The default value of <var>width</var> and <var>height</var> is 0.
  36098. </p>
  36099. </dd>
  36100. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  36101. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  36102. <dd><p>Specify the offsets to place the input image at within the padded area,
  36103. with respect to the top/left border of the output image.
  36104. </p>
  36105. <p>The <var>x</var> expression can reference the value set by the <var>y</var>
  36106. expression, and vice versa.
  36107. </p>
  36108. <p>The default value of <var>x</var> and <var>y</var> is 0.
  36109. </p>
  36110. <p>If <var>x</var> or <var>y</var> evaluate to a negative number, they&rsquo;ll be changed
  36111. so the input image is centered on the padded area.
  36112. </p>
  36113. </dd>
  36114. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  36115. <dd><p>Specify the color of the padded area. For the syntax of this option,
  36116. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  36117. </p>
  36118. <p>The default value of <var>color</var> is &quot;black&quot;.
  36119. </p>
  36120. </dd>
  36121. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  36122. <dd><p>Specify when to evaluate <var>width</var>, <var>height</var>, <var>x</var> and <var>y</var> expression.
  36123. </p>
  36124. <p>It accepts the following values:
  36125. </p>
  36126. <dl compact="compact">
  36127. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  36128. <dd><p>Only evaluate expressions once during the filter initialization or when
  36129. a command is processed.
  36130. </p>
  36131. </dd>
  36132. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  36133. <dd><p>Evaluate expressions for each incoming frame.
  36134. </p>
  36135. </dd>
  36136. </dl>
  36137. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  36138. </p>
  36139. </dd>
  36140. <dt>&lsquo;<samp>aspect</samp>&rsquo;</dt>
  36141. <dd><p>Pad to aspect instead to a resolution.
  36142. </p>
  36143. </dd>
  36144. </dl>
  36145. <p>The value for the <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var>
  36146. options are expressions containing the following constants:
  36147. </p>
  36148. <dl compact="compact">
  36149. <dt>&lsquo;<samp>in_w</samp>&rsquo;</dt>
  36150. <dt>&lsquo;<samp>in_h</samp>&rsquo;</dt>
  36151. <dd><p>The input video width and height.
  36152. </p>
  36153. </dd>
  36154. <dt>&lsquo;<samp>iw</samp>&rsquo;</dt>
  36155. <dt>&lsquo;<samp>ih</samp>&rsquo;</dt>
  36156. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  36157. </p>
  36158. </dd>
  36159. <dt>&lsquo;<samp>out_w</samp>&rsquo;</dt>
  36160. <dt>&lsquo;<samp>out_h</samp>&rsquo;</dt>
  36161. <dd><p>The output width and height (the size of the padded area), as
  36162. specified by the <var>width</var> and <var>height</var> expressions.
  36163. </p>
  36164. </dd>
  36165. <dt>&lsquo;<samp>ow</samp>&rsquo;</dt>
  36166. <dt>&lsquo;<samp>oh</samp>&rsquo;</dt>
  36167. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
  36168. </p>
  36169. </dd>
  36170. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  36171. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  36172. <dd><p>The x and y offsets as specified by the <var>x</var> and <var>y</var>
  36173. expressions, or NAN if not yet specified.
  36174. </p>
  36175. </dd>
  36176. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  36177. <dd><p>same as <var>iw</var> / <var>ih</var>
  36178. </p>
  36179. </dd>
  36180. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  36181. <dd><p>input sample aspect ratio
  36182. </p>
  36183. </dd>
  36184. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  36185. <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
  36186. </p>
  36187. </dd>
  36188. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  36189. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  36190. <dd><p>The horizontal and vertical chroma subsample values. For example for the
  36191. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  36192. </p></dd>
  36193. </dl>
  36194. <a name="Examples-109"></a>
  36195. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-109">39.149.1 Examples</a></h3>
  36196. <ul>
  36197. <li>
  36198. Add paddings with the color &quot;violet&quot; to the input video. The output video
  36199. size is 640x480, and the top-left corner of the input video is placed at
  36200. column 0, row 40
  36201. <div class="example">
  36202. <pre class="example">pad=640:480:0:40:violet
  36203. </pre></div>
  36204. <p>The example above is equivalent to the following command:
  36205. </p><div class="example">
  36206. <pre class="example">pad=width=640:height=480:x=0:y=40:color=violet
  36207. </pre></div>
  36208. </li><li>
  36209. Pad the input to get an output with dimensions increased by 3/2,
  36210. and put the input video at the center of the padded area:
  36211. <div class="example">
  36212. <pre class="example">pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
  36213. </pre></div>
  36214. </li><li>
  36215. Pad the input to get a squared output with size equal to the maximum
  36216. value between the input width and height, and put the input video at
  36217. the center of the padded area:
  36218. <div class="example">
  36219. <pre class="example">pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
  36220. </pre></div>
  36221. </li><li>
  36222. Pad the input to get a final w/h ratio of 16:9:
  36223. <div class="example">
  36224. <pre class="example">pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
  36225. </pre></div>
  36226. </li><li>
  36227. In case of anamorphic video, in order to set the output display aspect
  36228. correctly, it is necessary to use <var>sar</var> in the expression,
  36229. according to the relation:
  36230. <div class="example">
  36231. <pre class="example">(ih * X / ih) * sar = output_dar
  36232. X = output_dar / sar
  36233. </pre></div>
  36234. <p>Thus the previous example needs to be modified to:
  36235. </p><div class="example">
  36236. <pre class="example">pad=&quot;ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2&quot;
  36237. </pre></div>
  36238. </li><li>
  36239. Double the output size and put the input video in the bottom-right
  36240. corner of the output padded area:
  36241. <div class="example">
  36242. <pre class="example">pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
  36243. </pre></div>
  36244. </li></ul>
  36245. <p><a name="palettegen"></a>
  36246. </p><a name="palettegen-1"></a>
  36247. <h2 class="section"><a href="ffmpeg-all.html#toc-palettegen-1">39.150 palettegen</a></h2>
  36248. <p>Generate one palette for a whole video stream.
  36249. </p>
  36250. <p>It accepts the following options:
  36251. </p>
  36252. <dl compact="compact">
  36253. <dt>&lsquo;<samp>max_colors</samp>&rsquo;</dt>
  36254. <dd><p>Set the maximum number of colors to quantize in the palette.
  36255. Note: the palette will still contain 256 colors; the unused palette entries
  36256. will be black.
  36257. </p>
  36258. </dd>
  36259. <dt>&lsquo;<samp>reserve_transparent</samp>&rsquo;</dt>
  36260. <dd><p>Create a palette of 255 colors maximum and reserve the last one for
  36261. transparency. Reserving the transparency color is useful for GIF optimization.
  36262. If not set, the maximum of colors in the palette will be 256. You probably want
  36263. to disable this option for a standalone image.
  36264. Set by default.
  36265. </p>
  36266. </dd>
  36267. <dt>&lsquo;<samp>transparency_color</samp>&rsquo;</dt>
  36268. <dd><p>Set the color that will be used as background for transparency.
  36269. </p>
  36270. </dd>
  36271. <dt>&lsquo;<samp>stats_mode</samp>&rsquo;</dt>
  36272. <dd><p>Set statistics mode.
  36273. </p>
  36274. <p>It accepts the following values:
  36275. </p><dl compact="compact">
  36276. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  36277. <dd><p>Compute full frame histograms.
  36278. </p></dd>
  36279. <dt>&lsquo;<samp>diff</samp>&rsquo;</dt>
  36280. <dd><p>Compute histograms only for the part that differs from previous frame. This
  36281. might be relevant to give more importance to the moving part of your input if
  36282. the background is static.
  36283. </p></dd>
  36284. <dt>&lsquo;<samp>single</samp>&rsquo;</dt>
  36285. <dd><p>Compute new histogram for each frame.
  36286. </p></dd>
  36287. </dl>
  36288. <p>Default value is <var>full</var>.
  36289. </p></dd>
  36290. </dl>
  36291. <p>The filter also exports the frame metadata <code>lavfi.color_quant_ratio</code>
  36292. (<code>nb_color_in / nb_color_out</code>) which you can use to evaluate the degree of
  36293. color quantization of the palette. This information is also visible at
  36294. <var>info</var> logging level.
  36295. </p>
  36296. <a name="Examples-74"></a>
  36297. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-74">39.150.1 Examples</a></h3>
  36298. <ul>
  36299. <li>
  36300. Generate a representative palette of a given video using <code>ffmpeg</code>:
  36301. <div class="example">
  36302. <pre class="example">ffmpeg -i input.mkv -vf palettegen palette.png
  36303. </pre></div>
  36304. </li></ul>
  36305. <a name="paletteuse"></a>
  36306. <h2 class="section"><a href="ffmpeg-all.html#toc-paletteuse">39.151 paletteuse</a></h2>
  36307. <p>Use a palette to downsample an input video stream.
  36308. </p>
  36309. <p>The filter takes two inputs: one video stream and a palette. The palette must
  36310. be a 256 pixels image.
  36311. </p>
  36312. <p>It accepts the following options:
  36313. </p>
  36314. <dl compact="compact">
  36315. <dt>&lsquo;<samp>dither</samp>&rsquo;</dt>
  36316. <dd><p>Select dithering mode. Available algorithms are:
  36317. </p><dl compact="compact">
  36318. <dt>&lsquo;<samp>bayer</samp>&rsquo;</dt>
  36319. <dd><p>Ordered 8x8 bayer dithering (deterministic)
  36320. </p></dd>
  36321. <dt>&lsquo;<samp>heckbert</samp>&rsquo;</dt>
  36322. <dd><p>Dithering as defined by Paul Heckbert in 1982 (simple error diffusion).
  36323. Note: this dithering is sometimes considered &quot;wrong&quot; and is included as a
  36324. reference.
  36325. </p></dd>
  36326. <dt>&lsquo;<samp>floyd_steinberg</samp>&rsquo;</dt>
  36327. <dd><p>Floyd and Steingberg dithering (error diffusion)
  36328. </p></dd>
  36329. <dt>&lsquo;<samp>sierra2</samp>&rsquo;</dt>
  36330. <dd><p>Frankie Sierra dithering v2 (error diffusion)
  36331. </p></dd>
  36332. <dt>&lsquo;<samp>sierra2_4a</samp>&rsquo;</dt>
  36333. <dd><p>Frankie Sierra dithering v2 &quot;Lite&quot; (error diffusion)
  36334. </p></dd>
  36335. </dl>
  36336. <p>Default is <var>sierra2_4a</var>.
  36337. </p>
  36338. </dd>
  36339. <dt>&lsquo;<samp>bayer_scale</samp>&rsquo;</dt>
  36340. <dd><p>When <var>bayer</var> dithering is selected, this option defines the scale of the
  36341. pattern (how much the crosshatch pattern is visible). A low value means more
  36342. visible pattern for less banding, and higher value means less visible pattern
  36343. at the cost of more banding.
  36344. </p>
  36345. <p>The option must be an integer value in the range [0,5]. Default is <var>2</var>.
  36346. </p>
  36347. </dd>
  36348. <dt>&lsquo;<samp>diff_mode</samp>&rsquo;</dt>
  36349. <dd><p>If set, define the zone to process
  36350. </p>
  36351. <dl compact="compact">
  36352. <dt>&lsquo;<samp>rectangle</samp>&rsquo;</dt>
  36353. <dd><p>Only the changing rectangle will be reprocessed. This is similar to GIF
  36354. cropping/offsetting compression mechanism. This option can be useful for speed
  36355. if only a part of the image is changing, and has use cases such as limiting the
  36356. scope of the error diffusal &lsquo;<samp>dither</samp>&rsquo; to the rectangle that bounds the
  36357. moving scene (it leads to more deterministic output if the scene doesn&rsquo;t change
  36358. much, and as a result less moving noise and better GIF compression).
  36359. </p></dd>
  36360. </dl>
  36361. <p>Default is <var>none</var>.
  36362. </p>
  36363. </dd>
  36364. <dt>&lsquo;<samp>new</samp>&rsquo;</dt>
  36365. <dd><p>Take new palette for each output frame.
  36366. </p>
  36367. </dd>
  36368. <dt>&lsquo;<samp>alpha_threshold</samp>&rsquo;</dt>
  36369. <dd><p>Sets the alpha threshold for transparency. Alpha values above this threshold
  36370. will be treated as completely opaque, and values below this threshold will be
  36371. treated as completely transparent.
  36372. </p>
  36373. <p>The option must be an integer value in the range [0,255]. Default is <var>128</var>.
  36374. </p></dd>
  36375. </dl>
  36376. <a name="Examples-87"></a>
  36377. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-87">39.151.1 Examples</a></h3>
  36378. <ul>
  36379. <li>
  36380. Use a palette (generated for example with <a href="#palettegen">palettegen</a>) to encode a GIF
  36381. using <code>ffmpeg</code>:
  36382. <div class="example">
  36383. <pre class="example">ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
  36384. </pre></div>
  36385. </li></ul>
  36386. <a name="perspective"></a>
  36387. <h2 class="section"><a href="ffmpeg-all.html#toc-perspective">39.152 perspective</a></h2>
  36388. <p>Correct perspective of video not recorded perpendicular to the screen.
  36389. </p>
  36390. <p>A description of the accepted parameters follows.
  36391. </p>
  36392. <dl compact="compact">
  36393. <dt>&lsquo;<samp>x0</samp>&rsquo;</dt>
  36394. <dt>&lsquo;<samp>y0</samp>&rsquo;</dt>
  36395. <dt>&lsquo;<samp>x1</samp>&rsquo;</dt>
  36396. <dt>&lsquo;<samp>y1</samp>&rsquo;</dt>
  36397. <dt>&lsquo;<samp>x2</samp>&rsquo;</dt>
  36398. <dt>&lsquo;<samp>y2</samp>&rsquo;</dt>
  36399. <dt>&lsquo;<samp>x3</samp>&rsquo;</dt>
  36400. <dt>&lsquo;<samp>y3</samp>&rsquo;</dt>
  36401. <dd><p>Set coordinates expression for top left, top right, bottom left and bottom right corners.
  36402. Default values are <code>0:0:W:0:0:H:W:H</code> with which perspective will remain unchanged.
  36403. If the <code>sense</code> option is set to <code>source</code>, then the specified points will be sent
  36404. to the corners of the destination. If the <code>sense</code> option is set to <code>destination</code>,
  36405. then the corners of the source will be sent to the specified coordinates.
  36406. </p>
  36407. <p>The expressions can use the following variables:
  36408. </p>
  36409. <dl compact="compact">
  36410. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  36411. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  36412. <dd><p>the width and height of video frame.
  36413. </p></dd>
  36414. <dt>&lsquo;<samp>in</samp>&rsquo;</dt>
  36415. <dd><p>Input frame count.
  36416. </p></dd>
  36417. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  36418. <dd><p>Output frame count.
  36419. </p></dd>
  36420. </dl>
  36421. </dd>
  36422. <dt>&lsquo;<samp>interpolation</samp>&rsquo;</dt>
  36423. <dd><p>Set interpolation for perspective correction.
  36424. </p>
  36425. <p>It accepts the following values:
  36426. </p><dl compact="compact">
  36427. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  36428. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  36429. </dl>
  36430. <p>Default value is &lsquo;<samp>linear</samp>&rsquo;.
  36431. </p>
  36432. </dd>
  36433. <dt>&lsquo;<samp>sense</samp>&rsquo;</dt>
  36434. <dd><p>Set interpretation of coordinate options.
  36435. </p>
  36436. <p>It accepts the following values:
  36437. </p><dl compact="compact">
  36438. <dt>&lsquo;<samp>0, source</samp>&rsquo;</dt>
  36439. <dd>
  36440. <p>Send point in the source specified by the given coordinates to
  36441. the corners of the destination.
  36442. </p>
  36443. </dd>
  36444. <dt>&lsquo;<samp>1, destination</samp>&rsquo;</dt>
  36445. <dd>
  36446. <p>Send the corners of the source to the point in the destination specified
  36447. by the given coordinates.
  36448. </p>
  36449. <p>Default value is &lsquo;<samp>source</samp>&rsquo;.
  36450. </p></dd>
  36451. </dl>
  36452. </dd>
  36453. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  36454. <dd><p>Set when the expressions for coordinates &lsquo;<samp>x0,y0,...x3,y3</samp>&rsquo; are evaluated.
  36455. </p>
  36456. <p>It accepts the following values:
  36457. </p><dl compact="compact">
  36458. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  36459. <dd><p>only evaluate expressions once during the filter initialization or
  36460. when a command is processed
  36461. </p>
  36462. </dd>
  36463. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  36464. <dd><p>evaluate expressions for each incoming frame
  36465. </p></dd>
  36466. </dl>
  36467. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  36468. </p></dd>
  36469. </dl>
  36470. <a name="phase"></a>
  36471. <h2 class="section"><a href="ffmpeg-all.html#toc-phase">39.153 phase</a></h2>
  36472. <p>Delay interlaced video by one field time so that the field order changes.
  36473. </p>
  36474. <p>The intended use is to fix PAL movies that have been captured with the
  36475. opposite field order to the film-to-video transfer.
  36476. </p>
  36477. <p>A description of the accepted parameters follows.
  36478. </p>
  36479. <dl compact="compact">
  36480. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  36481. <dd><p>Set phase mode.
  36482. </p>
  36483. <p>It accepts the following values:
  36484. </p><dl compact="compact">
  36485. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  36486. <dd><p>Capture field order top-first, transfer bottom-first.
  36487. Filter will delay the bottom field.
  36488. </p>
  36489. </dd>
  36490. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  36491. <dd><p>Capture field order bottom-first, transfer top-first.
  36492. Filter will delay the top field.
  36493. </p>
  36494. </dd>
  36495. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  36496. <dd><p>Capture and transfer with the same field order. This mode only exists
  36497. for the documentation of the other options to refer to, but if you
  36498. actually select it, the filter will faithfully do nothing.
  36499. </p>
  36500. </dd>
  36501. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  36502. <dd><p>Capture field order determined automatically by field flags, transfer
  36503. opposite.
  36504. Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; modes on a frame by frame
  36505. basis using field flags. If no field information is available,
  36506. then this works just like &lsquo;<samp>u</samp>&rsquo;.
  36507. </p>
  36508. </dd>
  36509. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  36510. <dd><p>Capture unknown or varying, transfer opposite.
  36511. Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; on a frame by frame basis by
  36512. analyzing the images and selecting the alternative that produces best
  36513. match between the fields.
  36514. </p>
  36515. </dd>
  36516. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  36517. <dd><p>Capture top-first, transfer unknown or varying.
  36518. Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
  36519. </p>
  36520. </dd>
  36521. <dt>&lsquo;<samp>B</samp>&rsquo;</dt>
  36522. <dd><p>Capture bottom-first, transfer unknown or varying.
  36523. Filter selects among &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
  36524. </p>
  36525. </dd>
  36526. <dt>&lsquo;<samp>A</samp>&rsquo;</dt>
  36527. <dd><p>Capture determined by field flags, transfer unknown or varying.
  36528. Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using field flags and
  36529. image analysis. If no field information is available, then this works just
  36530. like &lsquo;<samp>U</samp>&rsquo;. This is the default mode.
  36531. </p>
  36532. </dd>
  36533. <dt>&lsquo;<samp>U</samp>&rsquo;</dt>
  36534. <dd><p>Both capture and transfer unknown or varying.
  36535. Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis only.
  36536. </p></dd>
  36537. </dl>
  36538. </dd>
  36539. </dl>
  36540. <a name="photosensitivity"></a>
  36541. <h2 class="section"><a href="ffmpeg-all.html#toc-photosensitivity">39.154 photosensitivity</a></h2>
  36542. <p>Reduce various flashes in video, so to help users with epilepsy.
  36543. </p>
  36544. <p>It accepts the following options:
  36545. </p><dl compact="compact">
  36546. <dt>&lsquo;<samp>frames, f</samp>&rsquo;</dt>
  36547. <dd><p>Set how many frames to use when filtering. Default is 30.
  36548. </p>
  36549. </dd>
  36550. <dt>&lsquo;<samp>threshold, t</samp>&rsquo;</dt>
  36551. <dd><p>Set detection threshold factor. Default is 1.
  36552. Lower is stricter.
  36553. </p>
  36554. </dd>
  36555. <dt>&lsquo;<samp>skip</samp>&rsquo;</dt>
  36556. <dd><p>Set how many pixels to skip when sampling frames. Default is 1.
  36557. Allowed range is from 1 to 1024.
  36558. </p>
  36559. </dd>
  36560. <dt>&lsquo;<samp>bypass</samp>&rsquo;</dt>
  36561. <dd><p>Leave frames unchanged. Default is disabled.
  36562. </p></dd>
  36563. </dl>
  36564. <a name="pixdesctest"></a>
  36565. <h2 class="section"><a href="ffmpeg-all.html#toc-pixdesctest">39.155 pixdesctest</a></h2>
  36566. <p>Pixel format descriptor test filter, mainly useful for internal
  36567. testing. The output video should be equal to the input video.
  36568. </p>
  36569. <p>For example:
  36570. </p><div class="example">
  36571. <pre class="example">format=monow, pixdesctest
  36572. </pre></div>
  36573. <p>can be used to test the monowhite pixel format descriptor definition.
  36574. </p>
  36575. <a name="pixscope"></a>
  36576. <h2 class="section"><a href="ffmpeg-all.html#toc-pixscope">39.156 pixscope</a></h2>
  36577. <p>Display sample values of color channels. Mainly useful for checking color
  36578. and levels. Minimum supported resolution is 640x480.
  36579. </p>
  36580. <p>The filters accept the following options:
  36581. </p>
  36582. <dl compact="compact">
  36583. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  36584. <dd><p>Set scope X position, relative offset on X axis.
  36585. </p>
  36586. </dd>
  36587. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  36588. <dd><p>Set scope Y position, relative offset on Y axis.
  36589. </p>
  36590. </dd>
  36591. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  36592. <dd><p>Set scope width.
  36593. </p>
  36594. </dd>
  36595. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  36596. <dd><p>Set scope height.
  36597. </p>
  36598. </dd>
  36599. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  36600. <dd><p>Set window opacity. This window also holds statistics about pixel area.
  36601. </p>
  36602. </dd>
  36603. <dt>&lsquo;<samp>wx</samp>&rsquo;</dt>
  36604. <dd><p>Set window X position, relative offset on X axis.
  36605. </p>
  36606. </dd>
  36607. <dt>&lsquo;<samp>wy</samp>&rsquo;</dt>
  36608. <dd><p>Set window Y position, relative offset on Y axis.
  36609. </p></dd>
  36610. </dl>
  36611. <a name="pp"></a>
  36612. <h2 class="section"><a href="ffmpeg-all.html#toc-pp">39.157 pp</a></h2>
  36613. <p>Enable the specified chain of postprocessing subfilters using libpostproc. This
  36614. library should be automatically selected with a GPL build (<code>--enable-gpl</code>).
  36615. Subfilters must be separated by &rsquo;/&rsquo; and can be disabled by prepending a &rsquo;-&rsquo;.
  36616. Each subfilter and some options have a short and a long name that can be used
  36617. interchangeably, i.e. dr/dering are the same.
  36618. </p>
  36619. <p>The filters accept the following options:
  36620. </p>
  36621. <dl compact="compact">
  36622. <dt>&lsquo;<samp>subfilters</samp>&rsquo;</dt>
  36623. <dd><p>Set postprocessing subfilters string.
  36624. </p></dd>
  36625. </dl>
  36626. <p>All subfilters share common options to determine their scope:
  36627. </p>
  36628. <dl compact="compact">
  36629. <dt>&lsquo;<samp>a/autoq</samp>&rsquo;</dt>
  36630. <dd><p>Honor the quality commands for this subfilter.
  36631. </p>
  36632. </dd>
  36633. <dt>&lsquo;<samp>c/chrom</samp>&rsquo;</dt>
  36634. <dd><p>Do chrominance filtering, too (default).
  36635. </p>
  36636. </dd>
  36637. <dt>&lsquo;<samp>y/nochrom</samp>&rsquo;</dt>
  36638. <dd><p>Do luminance filtering only (no chrominance).
  36639. </p>
  36640. </dd>
  36641. <dt>&lsquo;<samp>n/noluma</samp>&rsquo;</dt>
  36642. <dd><p>Do chrominance filtering only (no luminance).
  36643. </p></dd>
  36644. </dl>
  36645. <p>These options can be appended after the subfilter name, separated by a &rsquo;|&rsquo;.
  36646. </p>
  36647. <p>Available subfilters are:
  36648. </p>
  36649. <dl compact="compact">
  36650. <dt>&lsquo;<samp>hb/hdeblock[|difference[|flatness]]</samp>&rsquo;</dt>
  36651. <dd><p>Horizontal deblocking filter
  36652. </p><dl compact="compact">
  36653. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  36654. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  36655. </p></dd>
  36656. <dt>&lsquo;<samp>flatness</samp>&rsquo;</dt>
  36657. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  36658. </p></dd>
  36659. </dl>
  36660. </dd>
  36661. <dt>&lsquo;<samp>vb/vdeblock[|difference[|flatness]]</samp>&rsquo;</dt>
  36662. <dd><p>Vertical deblocking filter
  36663. </p><dl compact="compact">
  36664. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  36665. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  36666. </p></dd>
  36667. <dt>&lsquo;<samp>flatness</samp>&rsquo;</dt>
  36668. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  36669. </p></dd>
  36670. </dl>
  36671. </dd>
  36672. <dt>&lsquo;<samp>ha/hadeblock[|difference[|flatness]]</samp>&rsquo;</dt>
  36673. <dd><p>Accurate horizontal deblocking filter
  36674. </p><dl compact="compact">
  36675. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  36676. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  36677. </p></dd>
  36678. <dt>&lsquo;<samp>flatness</samp>&rsquo;</dt>
  36679. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  36680. </p></dd>
  36681. </dl>
  36682. </dd>
  36683. <dt>&lsquo;<samp>va/vadeblock[|difference[|flatness]]</samp>&rsquo;</dt>
  36684. <dd><p>Accurate vertical deblocking filter
  36685. </p><dl compact="compact">
  36686. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  36687. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  36688. </p></dd>
  36689. <dt>&lsquo;<samp>flatness</samp>&rsquo;</dt>
  36690. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  36691. </p></dd>
  36692. </dl>
  36693. </dd>
  36694. </dl>
  36695. <p>The horizontal and vertical deblocking filters share the difference and
  36696. flatness values so you cannot set different horizontal and vertical
  36697. thresholds.
  36698. </p>
  36699. <dl compact="compact">
  36700. <dt>&lsquo;<samp>h1/x1hdeblock</samp>&rsquo;</dt>
  36701. <dd><p>Experimental horizontal deblocking filter
  36702. </p>
  36703. </dd>
  36704. <dt>&lsquo;<samp>v1/x1vdeblock</samp>&rsquo;</dt>
  36705. <dd><p>Experimental vertical deblocking filter
  36706. </p>
  36707. </dd>
  36708. <dt>&lsquo;<samp>dr/dering</samp>&rsquo;</dt>
  36709. <dd><p>Deringing filter
  36710. </p>
  36711. </dd>
  36712. <dt>&lsquo;<samp>tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer</samp>&rsquo;</dt>
  36713. <dd><dl compact="compact">
  36714. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  36715. <dd><p>larger -&gt; stronger filtering
  36716. </p></dd>
  36717. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  36718. <dd><p>larger -&gt; stronger filtering
  36719. </p></dd>
  36720. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  36721. <dd><p>larger -&gt; stronger filtering
  36722. </p></dd>
  36723. </dl>
  36724. </dd>
  36725. <dt>&lsquo;<samp>al/autolevels[:f/fullyrange], automatic brightness / contrast correction</samp>&rsquo;</dt>
  36726. <dd><dl compact="compact">
  36727. <dt>&lsquo;<samp>f/fullyrange</samp>&rsquo;</dt>
  36728. <dd><p>Stretch luminance to <code>0-255</code>.
  36729. </p></dd>
  36730. </dl>
  36731. </dd>
  36732. <dt>&lsquo;<samp>lb/linblenddeint</samp>&rsquo;</dt>
  36733. <dd><p>Linear blend deinterlacing filter that deinterlaces the given block by
  36734. filtering all lines with a <code>(1 2 1)</code> filter.
  36735. </p>
  36736. </dd>
  36737. <dt>&lsquo;<samp>li/linipoldeint</samp>&rsquo;</dt>
  36738. <dd><p>Linear interpolating deinterlacing filter that deinterlaces the given block by
  36739. linearly interpolating every second line.
  36740. </p>
  36741. </dd>
  36742. <dt>&lsquo;<samp>ci/cubicipoldeint</samp>&rsquo;</dt>
  36743. <dd><p>Cubic interpolating deinterlacing filter deinterlaces the given block by
  36744. cubically interpolating every second line.
  36745. </p>
  36746. </dd>
  36747. <dt>&lsquo;<samp>md/mediandeint</samp>&rsquo;</dt>
  36748. <dd><p>Median deinterlacing filter that deinterlaces the given block by applying a
  36749. median filter to every second line.
  36750. </p>
  36751. </dd>
  36752. <dt>&lsquo;<samp>fd/ffmpegdeint</samp>&rsquo;</dt>
  36753. <dd><p>FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
  36754. second line with a <code>(-1 4 2 4 -1)</code> filter.
  36755. </p>
  36756. </dd>
  36757. <dt>&lsquo;<samp>l5/lowpass5</samp>&rsquo;</dt>
  36758. <dd><p>Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
  36759. block by filtering all lines with a <code>(-1 2 6 2 -1)</code> filter.
  36760. </p>
  36761. </dd>
  36762. <dt>&lsquo;<samp>fq/forceQuant[|quantizer]</samp>&rsquo;</dt>
  36763. <dd><p>Overrides the quantizer table from the input with the constant quantizer you
  36764. specify.
  36765. </p><dl compact="compact">
  36766. <dt>&lsquo;<samp>quantizer</samp>&rsquo;</dt>
  36767. <dd><p>Quantizer to use
  36768. </p></dd>
  36769. </dl>
  36770. </dd>
  36771. <dt>&lsquo;<samp>de/default</samp>&rsquo;</dt>
  36772. <dd><p>Default pp filter combination (<code>hb|a,vb|a,dr|a</code>)
  36773. </p>
  36774. </dd>
  36775. <dt>&lsquo;<samp>fa/fast</samp>&rsquo;</dt>
  36776. <dd><p>Fast pp filter combination (<code>h1|a,v1|a,dr|a</code>)
  36777. </p>
  36778. </dd>
  36779. <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
  36780. <dd><p>High quality pp filter combination (<code>ha|a|128|7,va|a,dr|a</code>)
  36781. </p></dd>
  36782. </dl>
  36783. <a name="Examples-98"></a>
  36784. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-98">39.157.1 Examples</a></h3>
  36785. <ul>
  36786. <li>
  36787. Apply horizontal and vertical deblocking, deringing and automatic
  36788. brightness/contrast:
  36789. <div class="example">
  36790. <pre class="example">pp=hb/vb/dr/al
  36791. </pre></div>
  36792. </li><li>
  36793. Apply default filters without brightness/contrast correction:
  36794. <div class="example">
  36795. <pre class="example">pp=de/-al
  36796. </pre></div>
  36797. </li><li>
  36798. Apply default filters and temporal denoiser:
  36799. <div class="example">
  36800. <pre class="example">pp=default/tmpnoise|1|2|3
  36801. </pre></div>
  36802. </li><li>
  36803. Apply deblocking on luminance only, and switch vertical deblocking on or off
  36804. automatically depending on available CPU time:
  36805. <div class="example">
  36806. <pre class="example">pp=hb|y/vb|a
  36807. </pre></div>
  36808. </li></ul>
  36809. <a name="pp7"></a>
  36810. <h2 class="section"><a href="ffmpeg-all.html#toc-pp7">39.158 pp7</a></h2>
  36811. <p>Apply Postprocessing filter 7. It is variant of the <a href="#spp">spp</a> filter,
  36812. similar to spp = 6 with 7 point DCT, where only the center sample is
  36813. used after IDCT.
  36814. </p>
  36815. <p>The filter accepts the following options:
  36816. </p>
  36817. <dl compact="compact">
  36818. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  36819. <dd><p>Force a constant quantization parameter. It accepts an integer in range
  36820. 0 to 63. If not set, the filter will use the QP from the video stream
  36821. (if available).
  36822. </p>
  36823. </dd>
  36824. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  36825. <dd><p>Set thresholding mode. Available modes are:
  36826. </p>
  36827. <dl compact="compact">
  36828. <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
  36829. <dd><p>Set hard thresholding.
  36830. </p></dd>
  36831. <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
  36832. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  36833. </p></dd>
  36834. <dt>&lsquo;<samp>medium</samp>&rsquo;</dt>
  36835. <dd><p>Set medium thresholding (good results, default).
  36836. </p></dd>
  36837. </dl>
  36838. </dd>
  36839. </dl>
  36840. <a name="premultiply"></a>
  36841. <h2 class="section"><a href="ffmpeg-all.html#toc-premultiply">39.159 premultiply</a></h2>
  36842. <p>Apply alpha premultiply effect to input video stream using first plane
  36843. of second stream as alpha.
  36844. </p>
  36845. <p>Both streams must have same dimensions and same pixel format.
  36846. </p>
  36847. <p>The filter accepts the following option:
  36848. </p>
  36849. <dl compact="compact">
  36850. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  36851. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  36852. By default value 0xf, all planes will be processed.
  36853. </p>
  36854. </dd>
  36855. <dt>&lsquo;<samp>inplace</samp>&rsquo;</dt>
  36856. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  36857. </p></dd>
  36858. </dl>
  36859. <a name="prewitt"></a>
  36860. <h2 class="section"><a href="ffmpeg-all.html#toc-prewitt">39.160 prewitt</a></h2>
  36861. <p>Apply prewitt operator to input video stream.
  36862. </p>
  36863. <p>The filter accepts the following option:
  36864. </p>
  36865. <dl compact="compact">
  36866. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  36867. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  36868. By default value 0xf, all planes will be processed.
  36869. </p>
  36870. </dd>
  36871. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  36872. <dd><p>Set value which will be multiplied with filtered result.
  36873. </p>
  36874. </dd>
  36875. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  36876. <dd><p>Set value which will be added to filtered result.
  36877. </p></dd>
  36878. </dl>
  36879. <a name="pseudocolor"></a>
  36880. <h2 class="section"><a href="ffmpeg-all.html#toc-pseudocolor">39.161 pseudocolor</a></h2>
  36881. <p>Alter frame colors in video with pseudocolors.
  36882. </p>
  36883. <p>This filter accepts the following options:
  36884. </p>
  36885. <dl compact="compact">
  36886. <dt>&lsquo;<samp>c0</samp>&rsquo;</dt>
  36887. <dd><p>set pixel first component expression
  36888. </p>
  36889. </dd>
  36890. <dt>&lsquo;<samp>c1</samp>&rsquo;</dt>
  36891. <dd><p>set pixel second component expression
  36892. </p>
  36893. </dd>
  36894. <dt>&lsquo;<samp>c2</samp>&rsquo;</dt>
  36895. <dd><p>set pixel third component expression
  36896. </p>
  36897. </dd>
  36898. <dt>&lsquo;<samp>c3</samp>&rsquo;</dt>
  36899. <dd><p>set pixel fourth component expression, corresponds to the alpha component
  36900. </p>
  36901. </dd>
  36902. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  36903. <dd><p>set component to use as base for altering colors
  36904. </p></dd>
  36905. </dl>
  36906. <p>Each of them specifies the expression to use for computing the lookup table for
  36907. the corresponding pixel component values.
  36908. </p>
  36909. <p>The expressions can contain the following constants and functions:
  36910. </p>
  36911. <dl compact="compact">
  36912. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  36913. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  36914. <dd><p>The input width and height.
  36915. </p>
  36916. </dd>
  36917. <dt>&lsquo;<samp>val</samp>&rsquo;</dt>
  36918. <dd><p>The input value for the pixel component.
  36919. </p>
  36920. </dd>
  36921. <dt>&lsquo;<samp>ymin, umin, vmin, amin</samp>&rsquo;</dt>
  36922. <dd><p>The minimum allowed component value.
  36923. </p>
  36924. </dd>
  36925. <dt>&lsquo;<samp>ymax, umax, vmax, amax</samp>&rsquo;</dt>
  36926. <dd><p>The maximum allowed component value.
  36927. </p></dd>
  36928. </dl>
  36929. <p>All expressions default to &quot;val&quot;.
  36930. </p>
  36931. <a name="Examples-37"></a>
  36932. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-37">39.161.1 Examples</a></h3>
  36933. <ul>
  36934. <li>
  36935. Change too high luma values to gradient:
  36936. <div class="example">
  36937. <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;
  36938. </pre></div>
  36939. </li></ul>
  36940. <a name="psnr"></a>
  36941. <h2 class="section"><a href="ffmpeg-all.html#toc-psnr">39.162 psnr</a></h2>
  36942. <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
  36943. Ratio) between two input videos.
  36944. </p>
  36945. <p>This filter takes in input two input videos, the first input is
  36946. considered the &quot;main&quot; source and is passed unchanged to the
  36947. output. The second input is used as a &quot;reference&quot; video for computing
  36948. the PSNR.
  36949. </p>
  36950. <p>Both video inputs must have the same resolution and pixel format for
  36951. this filter to work correctly. Also it assumes that both inputs
  36952. have the same number of frames, which are compared one by one.
  36953. </p>
  36954. <p>The obtained average PSNR is printed through the logging system.
  36955. </p>
  36956. <p>The filter stores the accumulated MSE (mean squared error) of each
  36957. frame, and at the end of the processing it is averaged across all frames
  36958. equally, and the following formula is applied to obtain the PSNR:
  36959. </p>
  36960. <div class="example">
  36961. <pre class="example">PSNR = 10*log10(MAX^2/MSE)
  36962. </pre></div>
  36963. <p>Where MAX is the average of the maximum values of each component of the
  36964. image.
  36965. </p>
  36966. <p>The description of the accepted parameters follows.
  36967. </p>
  36968. <dl compact="compact">
  36969. <dt>&lsquo;<samp>stats_file, f</samp>&rsquo;</dt>
  36970. <dd><p>If specified the filter will use the named file to save the PSNR of
  36971. each individual frame. When filename equals &quot;-&quot; the data is sent to
  36972. standard output.
  36973. </p>
  36974. </dd>
  36975. <dt>&lsquo;<samp>stats_version</samp>&rsquo;</dt>
  36976. <dd><p>Specifies which version of the stats file format to use. Details of
  36977. each format are written below.
  36978. Default value is 1.
  36979. </p>
  36980. </dd>
  36981. <dt>&lsquo;<samp>stats_add_max</samp>&rsquo;</dt>
  36982. <dd><p>Determines whether the max value is output to the stats log.
  36983. Default value is 0.
  36984. Requires stats_version &gt;= 2. If this is set and stats_version &lt; 2,
  36985. the filter will return an error.
  36986. </p></dd>
  36987. </dl>
  36988. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  36989. </p>
  36990. <p>The file printed if <var>stats_file</var> is selected, contains a sequence of
  36991. key/value pairs of the form <var>key</var>:<var>value</var> for each compared
  36992. couple of frames.
  36993. </p>
  36994. <p>If a <var>stats_version</var> greater than 1 is specified, a header line precedes
  36995. the list of per-frame-pair stats, with key value pairs following the frame
  36996. format with the following parameters:
  36997. </p>
  36998. <dl compact="compact">
  36999. <dt>&lsquo;<samp>psnr_log_version</samp>&rsquo;</dt>
  37000. <dd><p>The version of the log file format. Will match <var>stats_version</var>.
  37001. </p>
  37002. </dd>
  37003. <dt>&lsquo;<samp>fields</samp>&rsquo;</dt>
  37004. <dd><p>A comma separated list of the per-frame-pair parameters included in
  37005. the log.
  37006. </p></dd>
  37007. </dl>
  37008. <p>A description of each shown per-frame-pair parameter follows:
  37009. </p>
  37010. <dl compact="compact">
  37011. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  37012. <dd><p>sequential number of the input frame, starting from 1
  37013. </p>
  37014. </dd>
  37015. <dt>&lsquo;<samp>mse_avg</samp>&rsquo;</dt>
  37016. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  37017. frames, averaged over all the image components.
  37018. </p>
  37019. </dd>
  37020. <dt>&lsquo;<samp>mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a</samp>&rsquo;</dt>
  37021. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  37022. frames for the component specified by the suffix.
  37023. </p>
  37024. </dd>
  37025. <dt>&lsquo;<samp>psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp>&rsquo;</dt>
  37026. <dd><p>Peak Signal to Noise ratio of the compared frames for the component
  37027. specified by the suffix.
  37028. </p>
  37029. </dd>
  37030. <dt>&lsquo;<samp>max_avg, max_y, max_u, max_v</samp>&rsquo;</dt>
  37031. <dd><p>Maximum allowed value for each channel, and average over all
  37032. channels.
  37033. </p></dd>
  37034. </dl>
  37035. <a name="Examples-139"></a>
  37036. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-139">39.162.1 Examples</a></h3>
  37037. <ul>
  37038. <li>
  37039. For example:
  37040. <div class="example">
  37041. <pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  37042. [main][ref] psnr=&quot;stats_file=stats.log&quot; [out]
  37043. </pre></div>
  37044. <p>On this example the input file being processed is compared with the
  37045. reference file &lsquo;<tt>ref_movie.mpg</tt>&rsquo;. The PSNR of each individual frame
  37046. is stored in &lsquo;<tt>stats.log</tt>&rsquo;.
  37047. </p>
  37048. </li><li>
  37049. Another example with different containers:
  37050. <div class="example">
  37051. <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 -
  37052. </pre></div>
  37053. </li></ul>
  37054. <p><a name="pullup"></a>
  37055. </p><a name="pullup-1"></a>
  37056. <h2 class="section"><a href="ffmpeg-all.html#toc-pullup-1">39.163 pullup</a></h2>
  37057. <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
  37058. hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
  37059. content.
  37060. </p>
  37061. <p>The pullup filter is designed to take advantage of future context in making
  37062. its decisions. This filter is stateless in the sense that it does not lock
  37063. onto a pattern to follow, but it instead looks forward to the following
  37064. fields in order to identify matches and rebuild progressive frames.
  37065. </p>
  37066. <p>To produce content with an even framerate, insert the fps filter after
  37067. pullup, use <code>fps=24000/1001</code> if the input frame rate is 29.97fps,
  37068. <code>fps=24</code> for 30fps and the (rare) telecined 25fps input.
  37069. </p>
  37070. <p>The filter accepts the following options:
  37071. </p>
  37072. <dl compact="compact">
  37073. <dt>&lsquo;<samp>jl</samp>&rsquo;</dt>
  37074. <dt>&lsquo;<samp>jr</samp>&rsquo;</dt>
  37075. <dt>&lsquo;<samp>jt</samp>&rsquo;</dt>
  37076. <dt>&lsquo;<samp>jb</samp>&rsquo;</dt>
  37077. <dd><p>These options set the amount of &quot;junk&quot; to ignore at the left, right, top, and
  37078. bottom of the image, respectively. Left and right are in units of 8 pixels,
  37079. while top and bottom are in units of 2 lines.
  37080. The default is 8 pixels on each side.
  37081. </p>
  37082. </dd>
  37083. <dt>&lsquo;<samp>sb</samp>&rsquo;</dt>
  37084. <dd><p>Set the strict breaks. Setting this option to 1 will reduce the chances of
  37085. filter generating an occasional mismatched frame, but it may also cause an
  37086. excessive number of frames to be dropped during high motion sequences.
  37087. Conversely, setting it to -1 will make filter match fields more easily.
  37088. This may help processing of video where there is slight blurring between
  37089. the fields, but may also cause there to be interlaced frames in the output.
  37090. Default value is <code>0</code>.
  37091. </p>
  37092. </dd>
  37093. <dt>&lsquo;<samp>mp</samp>&rsquo;</dt>
  37094. <dd><p>Set the metric plane to use. It accepts the following values:
  37095. </p><dl compact="compact">
  37096. <dt>&lsquo;<samp>l</samp>&rsquo;</dt>
  37097. <dd><p>Use luma plane.
  37098. </p>
  37099. </dd>
  37100. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  37101. <dd><p>Use chroma blue plane.
  37102. </p>
  37103. </dd>
  37104. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  37105. <dd><p>Use chroma red plane.
  37106. </p></dd>
  37107. </dl>
  37108. <p>This option may be set to use chroma plane instead of the default luma plane
  37109. for doing filter&rsquo;s computations. This may improve accuracy on very clean
  37110. source material, but more likely will decrease accuracy, especially if there
  37111. is chroma noise (rainbow effect) or any grayscale video.
  37112. The main purpose of setting &lsquo;<samp>mp</samp>&rsquo; to a chroma plane is to reduce CPU
  37113. load and make pullup usable in realtime on slow machines.
  37114. </p></dd>
  37115. </dl>
  37116. <p>For best results (without duplicated frames in the output file) it is
  37117. necessary to change the output frame rate. For example, to inverse
  37118. telecine NTSC input:
  37119. </p><div class="example">
  37120. <pre class="example">ffmpeg -i input -vf pullup -r 24000/1001 ...
  37121. </pre></div>
  37122. <a name="qp"></a>
  37123. <h2 class="section"><a href="ffmpeg-all.html#toc-qp">39.164 qp</a></h2>
  37124. <p>Change video quantization parameters (QP).
  37125. </p>
  37126. <p>The filter accepts the following option:
  37127. </p>
  37128. <dl compact="compact">
  37129. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  37130. <dd><p>Set expression for quantization parameter.
  37131. </p></dd>
  37132. </dl>
  37133. <p>The expression is evaluated through the eval API and can contain, among others,
  37134. the following constants:
  37135. </p>
  37136. <dl compact="compact">
  37137. <dt><var>known</var></dt>
  37138. <dd><p>1 if index is not 129, 0 otherwise.
  37139. </p>
  37140. </dd>
  37141. <dt><var>qp</var></dt>
  37142. <dd><p>Sequential index starting from -129 to 128.
  37143. </p></dd>
  37144. </dl>
  37145. <a name="Examples-45"></a>
  37146. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-45">39.164.1 Examples</a></h3>
  37147. <ul>
  37148. <li>
  37149. Some equation like:
  37150. <div class="example">
  37151. <pre class="example">qp=2+2*sin(PI*qp)
  37152. </pre></div>
  37153. </li></ul>
  37154. <a name="random"></a>
  37155. <h2 class="section"><a href="ffmpeg-all.html#toc-random">39.165 random</a></h2>
  37156. <p>Flush video frames from internal cache of frames into a random order.
  37157. No frame is discarded.
  37158. Inspired by <a href="#frei0r">frei0r</a> nervous filter.
  37159. </p>
  37160. <dl compact="compact">
  37161. <dt>&lsquo;<samp>frames</samp>&rsquo;</dt>
  37162. <dd><p>Set size in number of frames of internal cache, in range from <code>2</code> to
  37163. <code>512</code>. Default is <code>30</code>.
  37164. </p>
  37165. </dd>
  37166. <dt>&lsquo;<samp>seed</samp>&rsquo;</dt>
  37167. <dd><p>Set seed for random number generator, must be an integer included between
  37168. <code>0</code> and <code>UINT32_MAX</code>. If not specified, or if explicitly set to
  37169. less than <code>0</code>, the filter will try to use a good random seed on a
  37170. best effort basis.
  37171. </p></dd>
  37172. </dl>
  37173. <a name="readeia608"></a>
  37174. <h2 class="section"><a href="ffmpeg-all.html#toc-readeia608">39.166 readeia608</a></h2>
  37175. <p>Read closed captioning (EIA-608) information from the top lines of a video frame.
  37176. </p>
  37177. <p>This filter adds frame metadata for <code>lavfi.readeia608.X.cc</code> and
  37178. <code>lavfi.readeia608.X.line</code>, where <code>X</code> is the number of the identified line
  37179. with EIA-608 data (starting from 0). A description of each metadata value follows:
  37180. </p>
  37181. <dl compact="compact">
  37182. <dt>&lsquo;<samp>lavfi.readeia608.X.cc</samp>&rsquo;</dt>
  37183. <dd><p>The two bytes stored as EIA-608 data (printed in hexadecimal).
  37184. </p>
  37185. </dd>
  37186. <dt>&lsquo;<samp>lavfi.readeia608.X.line</samp>&rsquo;</dt>
  37187. <dd><p>The number of the line on which the EIA-608 data was identified and read.
  37188. </p></dd>
  37189. </dl>
  37190. <p>This filter accepts the following options:
  37191. </p>
  37192. <dl compact="compact">
  37193. <dt>&lsquo;<samp>scan_min</samp>&rsquo;</dt>
  37194. <dd><p>Set the line to start scanning for EIA-608 data. Default is <code>0</code>.
  37195. </p>
  37196. </dd>
  37197. <dt>&lsquo;<samp>scan_max</samp>&rsquo;</dt>
  37198. <dd><p>Set the line to end scanning for EIA-608 data. Default is <code>29</code>.
  37199. </p>
  37200. </dd>
  37201. <dt>&lsquo;<samp>spw</samp>&rsquo;</dt>
  37202. <dd><p>Set the ratio of width reserved for sync code detection.
  37203. Default is <code>0.27</code>. Allowed range is <code>[0.1 - 0.7]</code>.
  37204. </p>
  37205. </dd>
  37206. <dt>&lsquo;<samp>chp</samp>&rsquo;</dt>
  37207. <dd><p>Enable checking the parity bit. In the event of a parity error, the filter will output
  37208. <code>0x00</code> for that character. Default is false.
  37209. </p>
  37210. </dd>
  37211. <dt>&lsquo;<samp>lp</samp>&rsquo;</dt>
  37212. <dd><p>Lowpass lines prior to further processing. Default is enabled.
  37213. </p></dd>
  37214. </dl>
  37215. <a name="Examples-133"></a>
  37216. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-133">39.166.1 Examples</a></h3>
  37217. <ul>
  37218. <li>
  37219. Output a csv with presentation time and the first two lines of identified EIA-608 captioning data.
  37220. <div class="example">
  37221. <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
  37222. </pre></div>
  37223. </li></ul>
  37224. <a name="readvitc"></a>
  37225. <h2 class="section"><a href="ffmpeg-all.html#toc-readvitc">39.167 readvitc</a></h2>
  37226. <p>Read vertical interval timecode (VITC) information from the top lines of a
  37227. video frame.
  37228. </p>
  37229. <p>The filter adds frame metadata key <code>lavfi.readvitc.tc_str</code> with the
  37230. timecode value, if a valid timecode has been detected. Further metadata key
  37231. <code>lavfi.readvitc.found</code> is set to 0/1 depending on whether
  37232. timecode data has been found or not.
  37233. </p>
  37234. <p>This filter accepts the following options:
  37235. </p>
  37236. <dl compact="compact">
  37237. <dt>&lsquo;<samp>scan_max</samp>&rsquo;</dt>
  37238. <dd><p>Set the maximum number of lines to scan for VITC data. If the value is set to
  37239. <code>-1</code> the full video frame is scanned. Default is <code>45</code>.
  37240. </p>
  37241. </dd>
  37242. <dt>&lsquo;<samp>thr_b</samp>&rsquo;</dt>
  37243. <dd><p>Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0],
  37244. default value is <code>0.2</code>. The value must be equal or less than <code>thr_w</code>.
  37245. </p>
  37246. </dd>
  37247. <dt>&lsquo;<samp>thr_w</samp>&rsquo;</dt>
  37248. <dd><p>Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0],
  37249. default value is <code>0.6</code>. The value must be equal or greater than <code>thr_b</code>.
  37250. </p></dd>
  37251. </dl>
  37252. <a name="Examples-44"></a>
  37253. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-44">39.167.1 Examples</a></h3>
  37254. <ul>
  37255. <li>
  37256. Detect and draw VITC data onto the video frame; if no valid VITC is detected,
  37257. draw <code>--:--:--:--</code> as a placeholder:
  37258. <div class="example">
  37259. <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'
  37260. </pre></div>
  37261. </li></ul>
  37262. <a name="remap"></a>
  37263. <h2 class="section"><a href="ffmpeg-all.html#toc-remap">39.168 remap</a></h2>
  37264. <p>Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
  37265. </p>
  37266. <p>Destination pixel at position (X, Y) will be picked from source (x, y) position
  37267. where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
  37268. value for pixel will be used for destination pixel.
  37269. </p>
  37270. <p>Xmap and Ymap input video streams must be of same dimensions. Output video stream
  37271. will have Xmap/Ymap video stream dimensions.
  37272. Xmap and Ymap input video streams are 16bit depth, single channel.
  37273. </p>
  37274. <dl compact="compact">
  37275. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  37276. <dd><p>Specify pixel format of output from this filter. Can be <code>color</code> or <code>gray</code>.
  37277. Default is <code>color</code>.
  37278. </p>
  37279. </dd>
  37280. <dt>&lsquo;<samp>fill</samp>&rsquo;</dt>
  37281. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  37282. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>. Default color is <code>black</code>.
  37283. </p></dd>
  37284. </dl>
  37285. <a name="removegrain"></a>
  37286. <h2 class="section"><a href="ffmpeg-all.html#toc-removegrain">39.169 removegrain</a></h2>
  37287. <p>The removegrain filter is a spatial denoiser for progressive video.
  37288. </p>
  37289. <dl compact="compact">
  37290. <dt>&lsquo;<samp>m0</samp>&rsquo;</dt>
  37291. <dd><p>Set mode for the first plane.
  37292. </p>
  37293. </dd>
  37294. <dt>&lsquo;<samp>m1</samp>&rsquo;</dt>
  37295. <dd><p>Set mode for the second plane.
  37296. </p>
  37297. </dd>
  37298. <dt>&lsquo;<samp>m2</samp>&rsquo;</dt>
  37299. <dd><p>Set mode for the third plane.
  37300. </p>
  37301. </dd>
  37302. <dt>&lsquo;<samp>m3</samp>&rsquo;</dt>
  37303. <dd><p>Set mode for the fourth plane.
  37304. </p></dd>
  37305. </dl>
  37306. <p>Range of mode is from 0 to 24. Description of each mode follows:
  37307. </p>
  37308. <dl compact="compact">
  37309. <dt><var>0</var></dt>
  37310. <dd><p>Leave input plane unchanged. Default.
  37311. </p>
  37312. </dd>
  37313. <dt><var>1</var></dt>
  37314. <dd><p>Clips the pixel with the minimum and maximum of the 8 neighbour pixels.
  37315. </p>
  37316. </dd>
  37317. <dt><var>2</var></dt>
  37318. <dd><p>Clips the pixel with the second minimum and maximum of the 8 neighbour pixels.
  37319. </p>
  37320. </dd>
  37321. <dt><var>3</var></dt>
  37322. <dd><p>Clips the pixel with the third minimum and maximum of the 8 neighbour pixels.
  37323. </p>
  37324. </dd>
  37325. <dt><var>4</var></dt>
  37326. <dd><p>Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels.
  37327. This is equivalent to a median filter.
  37328. </p>
  37329. </dd>
  37330. <dt><var>5</var></dt>
  37331. <dd><p>Line-sensitive clipping giving the minimal change.
  37332. </p>
  37333. </dd>
  37334. <dt><var>6</var></dt>
  37335. <dd><p>Line-sensitive clipping, intermediate.
  37336. </p>
  37337. </dd>
  37338. <dt><var>7</var></dt>
  37339. <dd><p>Line-sensitive clipping, intermediate.
  37340. </p>
  37341. </dd>
  37342. <dt><var>8</var></dt>
  37343. <dd><p>Line-sensitive clipping, intermediate.
  37344. </p>
  37345. </dd>
  37346. <dt><var>9</var></dt>
  37347. <dd><p>Line-sensitive clipping on a line where the neighbours pixels are the closest.
  37348. </p>
  37349. </dd>
  37350. <dt><var>10</var></dt>
  37351. <dd><p>Replaces the target pixel with the closest neighbour.
  37352. </p>
  37353. </dd>
  37354. <dt><var>11</var></dt>
  37355. <dd><p>[1 2 1] horizontal and vertical kernel blur.
  37356. </p>
  37357. </dd>
  37358. <dt><var>12</var></dt>
  37359. <dd><p>Same as mode 11.
  37360. </p>
  37361. </dd>
  37362. <dt><var>13</var></dt>
  37363. <dd><p>Bob mode, interpolates top field from the line where the neighbours
  37364. pixels are the closest.
  37365. </p>
  37366. </dd>
  37367. <dt><var>14</var></dt>
  37368. <dd><p>Bob mode, interpolates bottom field from the line where the neighbours
  37369. pixels are the closest.
  37370. </p>
  37371. </dd>
  37372. <dt><var>15</var></dt>
  37373. <dd><p>Bob mode, interpolates top field. Same as 13 but with a more complicated
  37374. interpolation formula.
  37375. </p>
  37376. </dd>
  37377. <dt><var>16</var></dt>
  37378. <dd><p>Bob mode, interpolates bottom field. Same as 14 but with a more complicated
  37379. interpolation formula.
  37380. </p>
  37381. </dd>
  37382. <dt><var>17</var></dt>
  37383. <dd><p>Clips the pixel with the minimum and maximum of respectively the maximum and
  37384. minimum of each pair of opposite neighbour pixels.
  37385. </p>
  37386. </dd>
  37387. <dt><var>18</var></dt>
  37388. <dd><p>Line-sensitive clipping using opposite neighbours whose greatest distance from
  37389. the current pixel is minimal.
  37390. </p>
  37391. </dd>
  37392. <dt><var>19</var></dt>
  37393. <dd><p>Replaces the pixel with the average of its 8 neighbours.
  37394. </p>
  37395. </dd>
  37396. <dt><var>20</var></dt>
  37397. <dd><p>Averages the 9 pixels ([1 1 1] horizontal and vertical blur).
  37398. </p>
  37399. </dd>
  37400. <dt><var>21</var></dt>
  37401. <dd><p>Clips pixels using the averages of opposite neighbour.
  37402. </p>
  37403. </dd>
  37404. <dt><var>22</var></dt>
  37405. <dd><p>Same as mode 21 but simpler and faster.
  37406. </p>
  37407. </dd>
  37408. <dt><var>23</var></dt>
  37409. <dd><p>Small edge and halo removal, but reputed useless.
  37410. </p>
  37411. </dd>
  37412. <dt><var>24</var></dt>
  37413. <dd><p>Similar as 23.
  37414. </p></dd>
  37415. </dl>
  37416. <a name="removelogo"></a>
  37417. <h2 class="section"><a href="ffmpeg-all.html#toc-removelogo">39.170 removelogo</a></h2>
  37418. <p>Suppress a TV station logo, using an image file to determine which
  37419. pixels comprise the logo. It works by filling in the pixels that
  37420. comprise the logo with neighboring pixels.
  37421. </p>
  37422. <p>The filter accepts the following options:
  37423. </p>
  37424. <dl compact="compact">
  37425. <dt>&lsquo;<samp>filename, f</samp>&rsquo;</dt>
  37426. <dd><p>Set the filter bitmap file, which can be any image format supported by
  37427. libavformat. The width and height of the image file must match those of the
  37428. video stream being processed.
  37429. </p></dd>
  37430. </dl>
  37431. <p>Pixels in the provided bitmap image with a value of zero are not
  37432. considered part of the logo, non-zero pixels are considered part of
  37433. the logo. If you use white (255) for the logo and black (0) for the
  37434. rest, you will be safe. For making the filter bitmap, it is
  37435. recommended to take a screen capture of a black frame with the logo
  37436. visible, and then using a threshold filter followed by the erode
  37437. filter once or twice.
  37438. </p>
  37439. <p>If needed, little splotches can be fixed manually. Remember that if
  37440. logo pixels are not covered, the filter quality will be much
  37441. reduced. Marking too many pixels as part of the logo does not hurt as
  37442. much, but it will increase the amount of blurring needed to cover over
  37443. the image and will destroy more information than necessary, and extra
  37444. pixels will slow things down on a large logo.
  37445. </p>
  37446. <a name="repeatfields"></a>
  37447. <h2 class="section"><a href="ffmpeg-all.html#toc-repeatfields">39.171 repeatfields</a></h2>
  37448. <p>This filter uses the repeat_field flag from the Video ES headers and hard repeats
  37449. fields based on its value.
  37450. </p>
  37451. <a name="reverse"></a>
  37452. <h2 class="section"><a href="ffmpeg-all.html#toc-reverse">39.172 reverse</a></h2>
  37453. <p>Reverse a video clip.
  37454. </p>
  37455. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  37456. is suggested.
  37457. </p>
  37458. <a name="Examples-168"></a>
  37459. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-168">39.172.1 Examples</a></h3>
  37460. <ul>
  37461. <li>
  37462. Take the first 5 seconds of a clip, and reverse it.
  37463. <div class="example">
  37464. <pre class="example">trim=end=5,reverse
  37465. </pre></div>
  37466. </li></ul>
  37467. <a name="rgbashift"></a>
  37468. <h2 class="section"><a href="ffmpeg-all.html#toc-rgbashift">39.173 rgbashift</a></h2>
  37469. <p>Shift R/G/B/A pixels horizontally and/or vertically.
  37470. </p>
  37471. <p>The filter accepts the following options:
  37472. </p><dl compact="compact">
  37473. <dt>&lsquo;<samp>rh</samp>&rsquo;</dt>
  37474. <dd><p>Set amount to shift red horizontally.
  37475. </p></dd>
  37476. <dt>&lsquo;<samp>rv</samp>&rsquo;</dt>
  37477. <dd><p>Set amount to shift red vertically.
  37478. </p></dd>
  37479. <dt>&lsquo;<samp>gh</samp>&rsquo;</dt>
  37480. <dd><p>Set amount to shift green horizontally.
  37481. </p></dd>
  37482. <dt>&lsquo;<samp>gv</samp>&rsquo;</dt>
  37483. <dd><p>Set amount to shift green vertically.
  37484. </p></dd>
  37485. <dt>&lsquo;<samp>bh</samp>&rsquo;</dt>
  37486. <dd><p>Set amount to shift blue horizontally.
  37487. </p></dd>
  37488. <dt>&lsquo;<samp>bv</samp>&rsquo;</dt>
  37489. <dd><p>Set amount to shift blue vertically.
  37490. </p></dd>
  37491. <dt>&lsquo;<samp>ah</samp>&rsquo;</dt>
  37492. <dd><p>Set amount to shift alpha horizontally.
  37493. </p></dd>
  37494. <dt>&lsquo;<samp>av</samp>&rsquo;</dt>
  37495. <dd><p>Set amount to shift alpha vertically.
  37496. </p></dd>
  37497. <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
  37498. <dd><p>Set edge mode, can be <var>smear</var>, default, or <var>warp</var>.
  37499. </p></dd>
  37500. </dl>
  37501. <a name="Commands-11"></a>
  37502. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-11">39.173.1 Commands</a></h3>
  37503. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  37504. </p>
  37505. <a name="roberts"></a>
  37506. <h2 class="section"><a href="ffmpeg-all.html#toc-roberts">39.174 roberts</a></h2>
  37507. <p>Apply roberts cross operator to input video stream.
  37508. </p>
  37509. <p>The filter accepts the following option:
  37510. </p>
  37511. <dl compact="compact">
  37512. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  37513. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  37514. By default value 0xf, all planes will be processed.
  37515. </p>
  37516. </dd>
  37517. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  37518. <dd><p>Set value which will be multiplied with filtered result.
  37519. </p>
  37520. </dd>
  37521. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  37522. <dd><p>Set value which will be added to filtered result.
  37523. </p></dd>
  37524. </dl>
  37525. <a name="rotate"></a>
  37526. <h2 class="section"><a href="ffmpeg-all.html#toc-rotate">39.175 rotate</a></h2>
  37527. <p>Rotate video by an arbitrary angle expressed in radians.
  37528. </p>
  37529. <p>The filter accepts the following options:
  37530. </p>
  37531. <p>A description of the optional parameters follows.
  37532. </p><dl compact="compact">
  37533. <dt>&lsquo;<samp>angle, a</samp>&rsquo;</dt>
  37534. <dd><p>Set an expression for the angle by which to rotate the input video
  37535. clockwise, expressed as a number of radians. A negative value will
  37536. result in a counter-clockwise rotation. By default it is set to &quot;0&quot;.
  37537. </p>
  37538. <p>This expression is evaluated for each frame.
  37539. </p>
  37540. </dd>
  37541. <dt>&lsquo;<samp>out_w, ow</samp>&rsquo;</dt>
  37542. <dd><p>Set the output width expression, default value is &quot;iw&quot;.
  37543. This expression is evaluated just once during configuration.
  37544. </p>
  37545. </dd>
  37546. <dt>&lsquo;<samp>out_h, oh</samp>&rsquo;</dt>
  37547. <dd><p>Set the output height expression, default value is &quot;ih&quot;.
  37548. This expression is evaluated just once during configuration.
  37549. </p>
  37550. </dd>
  37551. <dt>&lsquo;<samp>bilinear</samp>&rsquo;</dt>
  37552. <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
  37553. it. Default value is 1.
  37554. </p>
  37555. </dd>
  37556. <dt>&lsquo;<samp>fillcolor, c</samp>&rsquo;</dt>
  37557. <dd><p>Set the color used to fill the output area not covered by the rotated
  37558. image. For the general syntax of this option, check the
  37559. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  37560. If the special value &quot;none&quot; is selected then no
  37561. background is printed (useful for example if the background is never shown).
  37562. </p>
  37563. <p>Default value is &quot;black&quot;.
  37564. </p></dd>
  37565. </dl>
  37566. <p>The expressions for the angle and the output size can contain the
  37567. following constants and functions:
  37568. </p>
  37569. <dl compact="compact">
  37570. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  37571. <dd><p>sequential number of the input frame, starting from 0. It is always NAN
  37572. before the first frame is filtered.
  37573. </p>
  37574. </dd>
  37575. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  37576. <dd><p>time in seconds of the input frame, it is set to 0 when the filter is
  37577. configured. It is always NAN before the first frame is filtered.
  37578. </p>
  37579. </dd>
  37580. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  37581. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  37582. <dd><p>horizontal and vertical chroma subsample values. For example for the
  37583. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  37584. </p>
  37585. </dd>
  37586. <dt>&lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
  37587. <dt>&lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
  37588. <dd><p>the input video width and height
  37589. </p>
  37590. </dd>
  37591. <dt>&lsquo;<samp>out_w, ow</samp>&rsquo;</dt>
  37592. <dt>&lsquo;<samp>out_h, oh</samp>&rsquo;</dt>
  37593. <dd><p>the output width and height, that is the size of the padded area as
  37594. specified by the <var>width</var> and <var>height</var> expressions
  37595. </p>
  37596. </dd>
  37597. <dt>&lsquo;<samp>rotw(a)</samp>&rsquo;</dt>
  37598. <dt>&lsquo;<samp>roth(a)</samp>&rsquo;</dt>
  37599. <dd><p>the minimal width/height required for completely containing the input
  37600. video rotated by <var>a</var> radians.
  37601. </p>
  37602. <p>These are only available when computing the &lsquo;<samp>out_w</samp>&rsquo; and
  37603. &lsquo;<samp>out_h</samp>&rsquo; expressions.
  37604. </p></dd>
  37605. </dl>
  37606. <a name="Examples-24"></a>
  37607. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-24">39.175.1 Examples</a></h3>
  37608. <ul>
  37609. <li>
  37610. Rotate the input by PI/6 radians clockwise:
  37611. <div class="example">
  37612. <pre class="example">rotate=PI/6
  37613. </pre></div>
  37614. </li><li>
  37615. Rotate the input by PI/6 radians counter-clockwise:
  37616. <div class="example">
  37617. <pre class="example">rotate=-PI/6
  37618. </pre></div>
  37619. </li><li>
  37620. Rotate the input by 45 degrees clockwise:
  37621. <div class="example">
  37622. <pre class="example">rotate=45*PI/180
  37623. </pre></div>
  37624. </li><li>
  37625. Apply a constant rotation with period T, starting from an angle of PI/3:
  37626. <div class="example">
  37627. <pre class="example">rotate=PI/3+2*PI*t/T
  37628. </pre></div>
  37629. </li><li>
  37630. Make the input video rotation oscillating with a period of T
  37631. seconds and an amplitude of A radians:
  37632. <div class="example">
  37633. <pre class="example">rotate=A*sin(2*PI/T*t)
  37634. </pre></div>
  37635. </li><li>
  37636. Rotate the video, output size is chosen so that the whole rotating
  37637. input video is always completely contained in the output:
  37638. <div class="example">
  37639. <pre class="example">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
  37640. </pre></div>
  37641. </li><li>
  37642. Rotate the video, reduce the output size so that no background is ever
  37643. shown:
  37644. <div class="example">
  37645. <pre class="example">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
  37646. </pre></div>
  37647. </li></ul>
  37648. <a name="Commands-8"></a>
  37649. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-8">39.175.2 Commands</a></h3>
  37650. <p>The filter supports the following commands:
  37651. </p>
  37652. <dl compact="compact">
  37653. <dt>&lsquo;<samp>a, angle</samp>&rsquo;</dt>
  37654. <dd><p>Set the angle expression.
  37655. The command accepts the same syntax of the corresponding option.
  37656. </p>
  37657. <p>If the specified expression is not valid, it is kept at its current
  37658. value.
  37659. </p></dd>
  37660. </dl>
  37661. <a name="sab"></a>
  37662. <h2 class="section"><a href="ffmpeg-all.html#toc-sab">39.176 sab</a></h2>
  37663. <p>Apply Shape Adaptive Blur.
  37664. </p>
  37665. <p>The filter accepts the following options:
  37666. </p>
  37667. <dl compact="compact">
  37668. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  37669. <dd><p>Set luma blur filter strength, must be a value in range 0.1-4.0, default
  37670. value is 1.0. A greater value will result in a more blurred image, and
  37671. in slower processing.
  37672. </p>
  37673. </dd>
  37674. <dt>&lsquo;<samp>luma_pre_filter_radius, lpfr</samp>&rsquo;</dt>
  37675. <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
  37676. value is 1.0.
  37677. </p>
  37678. </dd>
  37679. <dt>&lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
  37680. <dd><p>Set luma maximum difference between pixels to still be considered, must
  37681. be a value in the 0.1-100.0 range, default value is 1.0.
  37682. </p>
  37683. </dd>
  37684. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  37685. <dd><p>Set chroma blur filter strength, must be a value in range -0.9-4.0. A
  37686. greater value will result in a more blurred image, and in slower
  37687. processing.
  37688. </p>
  37689. </dd>
  37690. <dt>&lsquo;<samp>chroma_pre_filter_radius, cpfr</samp>&rsquo;</dt>
  37691. <dd><p>Set chroma pre-filter radius, must be a value in the -0.9-2.0 range.
  37692. </p>
  37693. </dd>
  37694. <dt>&lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
  37695. <dd><p>Set chroma maximum difference between pixels to still be considered,
  37696. must be a value in the -0.9-100.0 range.
  37697. </p></dd>
  37698. </dl>
  37699. <p>Each chroma option value, if not explicitly specified, is set to the
  37700. corresponding luma option value.
  37701. </p>
  37702. <p><a name="scale"></a>
  37703. </p><a name="scale-1"></a>
  37704. <h2 class="section"><a href="ffmpeg-all.html#toc-scale-1">39.177 scale</a></h2>
  37705. <p>Scale (resize) the input video, using the libswscale library.
  37706. </p>
  37707. <p>The scale filter forces the output display aspect ratio to be the same
  37708. of the input, by changing the output sample aspect ratio.
  37709. </p>
  37710. <p>If the input image format is different from the format requested by
  37711. the next filter, the scale filter will convert the input to the
  37712. requested format.
  37713. </p>
  37714. <a name="Options-42"></a>
  37715. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-42">39.177.1 Options</a></h3>
  37716. <p>The filter accepts the following options, or any of the options
  37717. supported by the libswscale scaler.
  37718. </p>
  37719. <p>See <a href="ffmpeg-scaler.html#scaler_005foptions">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for
  37720. the complete list of scaler options.
  37721. </p>
  37722. <dl compact="compact">
  37723. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  37724. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  37725. <dd><p>Set the output video dimension expression. Default value is the input
  37726. dimension.
  37727. </p>
  37728. <p>If the <var>width</var> or <var>w</var> value is 0, the input width is used for
  37729. the output. If the <var>height</var> or <var>h</var> value is 0, the input height
  37730. is used for the output.
  37731. </p>
  37732. <p>If one and only one of the values is -n with n &gt;= 1, the scale filter
  37733. will use a value that maintains the aspect ratio of the input image,
  37734. calculated from the other specified dimension. After that it will,
  37735. however, make sure that the calculated dimension is divisible by n and
  37736. adjust the value if necessary.
  37737. </p>
  37738. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  37739. both values being set to 0 as previously detailed.
  37740. </p>
  37741. <p>See below for the list of accepted constants for use in the dimension
  37742. expression.
  37743. </p>
  37744. </dd>
  37745. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  37746. <dd><p>Specify when to evaluate <var>width</var> and <var>height</var> expression. It accepts the following values:
  37747. </p>
  37748. <dl compact="compact">
  37749. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  37750. <dd><p>Only evaluate expressions once during the filter initialization or when a command is processed.
  37751. </p>
  37752. </dd>
  37753. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  37754. <dd><p>Evaluate expressions for each incoming frame.
  37755. </p>
  37756. </dd>
  37757. </dl>
  37758. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  37759. </p>
  37760. </dd>
  37761. <dt>&lsquo;<samp>interl</samp>&rsquo;</dt>
  37762. <dd><p>Set the interlacing mode. It accepts the following values:
  37763. </p>
  37764. <dl compact="compact">
  37765. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  37766. <dd><p>Force interlaced aware scaling.
  37767. </p>
  37768. </dd>
  37769. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  37770. <dd><p>Do not apply interlaced scaling.
  37771. </p>
  37772. </dd>
  37773. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  37774. <dd><p>Select interlaced aware scaling depending on whether the source frames
  37775. are flagged as interlaced or not.
  37776. </p></dd>
  37777. </dl>
  37778. <p>Default value is &lsquo;<samp>0</samp>&rsquo;.
  37779. </p>
  37780. </dd>
  37781. <dt>&lsquo;<samp>flags</samp>&rsquo;</dt>
  37782. <dd><p>Set libswscale scaling flags. See
  37783. <a href="ffmpeg-scaler.html#sws_005fflags">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for the
  37784. complete list of values. If not explicitly specified the filter applies
  37785. the default flags.
  37786. </p>
  37787. </dd>
  37788. <dt>&lsquo;<samp>param0, param1</samp>&rsquo;</dt>
  37789. <dd><p>Set libswscale input parameters for scaling algorithms that need them. See
  37790. <a href="ffmpeg-scaler.html#sws_005fparams">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for the
  37791. complete documentation. If not explicitly specified the filter applies
  37792. empty parameters.
  37793. </p>
  37794. </dd>
  37795. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  37796. <dd><p>Set the video size. For the syntax of this option, check the
  37797. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  37798. </p>
  37799. </dd>
  37800. <dt>&lsquo;<samp>in_color_matrix</samp>&rsquo;</dt>
  37801. <dt>&lsquo;<samp>out_color_matrix</samp>&rsquo;</dt>
  37802. <dd><p>Set in/output YCbCr color space type.
  37803. </p>
  37804. <p>This allows the autodetected value to be overridden as well as allows forcing
  37805. a specific value used for the output and encoder.
  37806. </p>
  37807. <p>If not specified, the color space type depends on the pixel format.
  37808. </p>
  37809. <p>Possible values:
  37810. </p>
  37811. <dl compact="compact">
  37812. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  37813. <dd><p>Choose automatically.
  37814. </p>
  37815. </dd>
  37816. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  37817. <dd><p>Format conforming to International Telecommunication Union (ITU)
  37818. Recommendation BT.709.
  37819. </p>
  37820. </dd>
  37821. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  37822. <dd><p>Set color space conforming to the United States Federal Communications
  37823. Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a).
  37824. </p>
  37825. </dd>
  37826. <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
  37827. <dt>&lsquo;<samp>bt470</samp>&rsquo;</dt>
  37828. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  37829. <dd><p>Set color space conforming to:
  37830. </p>
  37831. <ul>
  37832. <li>
  37833. ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
  37834. </li><li>
  37835. ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
  37836. </li><li>
  37837. Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
  37838. </li></ul>
  37839. </dd>
  37840. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  37841. <dd><p>Set color space conforming to SMPTE ST 240:1999.
  37842. </p>
  37843. </dd>
  37844. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  37845. <dd><p>Set color space conforming to ITU-R BT.2020 non-constant luminance system.
  37846. </p></dd>
  37847. </dl>
  37848. </dd>
  37849. <dt>&lsquo;<samp>in_range</samp>&rsquo;</dt>
  37850. <dt>&lsquo;<samp>out_range</samp>&rsquo;</dt>
  37851. <dd><p>Set in/output YCbCr sample range.
  37852. </p>
  37853. <p>This allows the autodetected value to be overridden as well as allows forcing
  37854. a specific value used for the output and encoder. If not specified, the
  37855. range depends on the pixel format. Possible values:
  37856. </p>
  37857. <dl compact="compact">
  37858. <dt>&lsquo;<samp>auto/unknown</samp>&rsquo;</dt>
  37859. <dd><p>Choose automatically.
  37860. </p>
  37861. </dd>
  37862. <dt>&lsquo;<samp>jpeg/full/pc</samp>&rsquo;</dt>
  37863. <dd><p>Set full range (0-255 in case of 8-bit luma).
  37864. </p>
  37865. </dd>
  37866. <dt>&lsquo;<samp>mpeg/limited/tv</samp>&rsquo;</dt>
  37867. <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
  37868. </p></dd>
  37869. </dl>
  37870. </dd>
  37871. <dt>&lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;</dt>
  37872. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  37873. keep the original aspect ratio. Possible values:
  37874. </p>
  37875. <dl compact="compact">
  37876. <dt>&lsquo;<samp>disable</samp>&rsquo;</dt>
  37877. <dd><p>Scale the video as specified and disable this feature.
  37878. </p>
  37879. </dd>
  37880. <dt>&lsquo;<samp>decrease</samp>&rsquo;</dt>
  37881. <dd><p>The output video dimensions will automatically be decreased if needed.
  37882. </p>
  37883. </dd>
  37884. <dt>&lsquo;<samp>increase</samp>&rsquo;</dt>
  37885. <dd><p>The output video dimensions will automatically be increased if needed.
  37886. </p>
  37887. </dd>
  37888. </dl>
  37889. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  37890. maximum allowed resolution, you can use this to limit the output video to
  37891. that, while retaining the aspect ratio. For example, device A allows
  37892. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  37893. decrease) and specifying 1280x720 to the command line makes the output
  37894. 1280x533.
  37895. </p>
  37896. <p>Please note that this is a different thing than specifying -1 for &lsquo;<samp>w</samp>&rsquo;
  37897. or &lsquo;<samp>h</samp>&rsquo;, you still need to specify the output resolution for this option
  37898. to work.
  37899. </p>
  37900. </dd>
  37901. <dt>&lsquo;<samp>force_divisible_by</samp>&rsquo;</dt>
  37902. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  37903. given integer when used together with &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;. This
  37904. works similar to using <code>-n</code> in the &lsquo;<samp>w</samp>&rsquo; and &lsquo;<samp>h</samp>&rsquo; options.
  37905. </p>
  37906. <p>This option respects the value set for &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;,
  37907. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  37908. may be slightly modified.
  37909. </p>
  37910. <p>This option can be handy if you need to have a video fit within or exceed
  37911. a defined resolution using &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo; but also have
  37912. encoder restrictions on width or height divisibility.
  37913. </p>
  37914. </dd>
  37915. </dl>
  37916. <p>The values of the &lsquo;<samp>w</samp>&rsquo; and &lsquo;<samp>h</samp>&rsquo; options are expressions
  37917. containing the following constants:
  37918. </p>
  37919. <dl compact="compact">
  37920. <dt><var>in_w</var></dt>
  37921. <dt><var>in_h</var></dt>
  37922. <dd><p>The input width and height
  37923. </p>
  37924. </dd>
  37925. <dt><var>iw</var></dt>
  37926. <dt><var>ih</var></dt>
  37927. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  37928. </p>
  37929. </dd>
  37930. <dt><var>out_w</var></dt>
  37931. <dt><var>out_h</var></dt>
  37932. <dd><p>The output (scaled) width and height
  37933. </p>
  37934. </dd>
  37935. <dt><var>ow</var></dt>
  37936. <dt><var>oh</var></dt>
  37937. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>
  37938. </p>
  37939. </dd>
  37940. <dt><var>a</var></dt>
  37941. <dd><p>The same as <var>iw</var> / <var>ih</var>
  37942. </p>
  37943. </dd>
  37944. <dt><var>sar</var></dt>
  37945. <dd><p>input sample aspect ratio
  37946. </p>
  37947. </dd>
  37948. <dt><var>dar</var></dt>
  37949. <dd><p>The input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
  37950. </p>
  37951. </dd>
  37952. <dt><var>hsub</var></dt>
  37953. <dt><var>vsub</var></dt>
  37954. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  37955. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  37956. </p>
  37957. </dd>
  37958. <dt><var>ohsub</var></dt>
  37959. <dt><var>ovsub</var></dt>
  37960. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  37961. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  37962. </p>
  37963. </dd>
  37964. <dt><var>n</var></dt>
  37965. <dd><p>The (sequential) number of the input frame, starting from 0.
  37966. Only available with <code>eval=frame</code>.
  37967. </p>
  37968. </dd>
  37969. <dt><var>t</var></dt>
  37970. <dd><p>The presentation timestamp of the input frame, expressed as a number of
  37971. seconds. Only available with <code>eval=frame</code>.
  37972. </p>
  37973. </dd>
  37974. <dt><var>pos</var></dt>
  37975. <dd><p>The position (byte offset) of the frame in the input stream, or NaN if
  37976. this information is unavailable and/or meaningless (for example in case of synthetic video).
  37977. Only available with <code>eval=frame</code>.
  37978. </p></dd>
  37979. </dl>
  37980. <a name="Examples-176"></a>
  37981. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-176">39.177.2 Examples</a></h3>
  37982. <ul>
  37983. <li>
  37984. Scale the input video to a size of 200x100
  37985. <div class="example">
  37986. <pre class="example">scale=w=200:h=100
  37987. </pre></div>
  37988. <p>This is equivalent to:
  37989. </p><div class="example">
  37990. <pre class="example">scale=200:100
  37991. </pre></div>
  37992. <p>or:
  37993. </p><div class="example">
  37994. <pre class="example">scale=200x100
  37995. </pre></div>
  37996. </li><li>
  37997. Specify a size abbreviation for the output size:
  37998. <div class="example">
  37999. <pre class="example">scale=qcif
  38000. </pre></div>
  38001. <p>which can also be written as:
  38002. </p><div class="example">
  38003. <pre class="example">scale=size=qcif
  38004. </pre></div>
  38005. </li><li>
  38006. Scale the input to 2x:
  38007. <div class="example">
  38008. <pre class="example">scale=w=2*iw:h=2*ih
  38009. </pre></div>
  38010. </li><li>
  38011. The above is the same as:
  38012. <div class="example">
  38013. <pre class="example">scale=2*in_w:2*in_h
  38014. </pre></div>
  38015. </li><li>
  38016. Scale the input to 2x with forced interlaced scaling:
  38017. <div class="example">
  38018. <pre class="example">scale=2*iw:2*ih:interl=1
  38019. </pre></div>
  38020. </li><li>
  38021. Scale the input to half size:
  38022. <div class="example">
  38023. <pre class="example">scale=w=iw/2:h=ih/2
  38024. </pre></div>
  38025. </li><li>
  38026. Increase the width, and set the height to the same size:
  38027. <div class="example">
  38028. <pre class="example">scale=3/2*iw:ow
  38029. </pre></div>
  38030. </li><li>
  38031. Seek Greek harmony:
  38032. <div class="example">
  38033. <pre class="example">scale=iw:1/PHI*iw
  38034. scale=ih*PHI:ih
  38035. </pre></div>
  38036. </li><li>
  38037. Increase the height, and set the width to 3/2 of the height:
  38038. <div class="example">
  38039. <pre class="example">scale=w=3/2*oh:h=3/5*ih
  38040. </pre></div>
  38041. </li><li>
  38042. Increase the size, making the size a multiple of the chroma
  38043. subsample values:
  38044. <div class="example">
  38045. <pre class="example">scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
  38046. </pre></div>
  38047. </li><li>
  38048. Increase the width to a maximum of 500 pixels,
  38049. keeping the same aspect ratio as the input:
  38050. <div class="example">
  38051. <pre class="example">scale=w='min(500\, iw*3/2):h=-1'
  38052. </pre></div>
  38053. </li><li>
  38054. Make pixels square by combining scale and setsar:
  38055. <div class="example">
  38056. <pre class="example">scale='trunc(ih*dar):ih',setsar=1/1
  38057. </pre></div>
  38058. </li><li>
  38059. Make pixels square by combining scale and setsar,
  38060. making sure the resulting resolution is even (required by some codecs):
  38061. <div class="example">
  38062. <pre class="example">scale='trunc(ih*dar/2)*2:trunc(ih/2)*2',setsar=1/1
  38063. </pre></div>
  38064. </li></ul>
  38065. <a name="Commands-29"></a>
  38066. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-29">39.177.3 Commands</a></h3>
  38067. <p>This filter supports the following commands:
  38068. </p><dl compact="compact">
  38069. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  38070. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  38071. <dd><p>Set the output video dimension expression.
  38072. The command accepts the same syntax of the corresponding option.
  38073. </p>
  38074. <p>If the specified expression is not valid, it is kept at its current
  38075. value.
  38076. </p></dd>
  38077. </dl>
  38078. <a name="scale_005fnpp"></a>
  38079. <h2 class="section"><a href="ffmpeg-all.html#toc-scale_005fnpp">39.178 scale_npp</a></h2>
  38080. <p>Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel
  38081. format conversion on CUDA video frames. Setting the output width and height
  38082. works in the same way as for the <var>scale</var> filter.
  38083. </p>
  38084. <p>The following additional options are accepted:
  38085. </p><dl compact="compact">
  38086. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  38087. <dd><p>The pixel format of the output CUDA frames. If set to the string &quot;same&quot; (the
  38088. default), the input format will be kept. Note that automatic format negotiation
  38089. and conversion is not yet supported for hardware frames
  38090. </p>
  38091. </dd>
  38092. <dt>&lsquo;<samp>interp_algo</samp>&rsquo;</dt>
  38093. <dd><p>The interpolation algorithm used for resizing. One of the following:
  38094. </p><dl compact="compact">
  38095. <dt>&lsquo;<samp>nn</samp>&rsquo;</dt>
  38096. <dd><p>Nearest neighbour.
  38097. </p>
  38098. </dd>
  38099. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  38100. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  38101. <dt>&lsquo;<samp>cubic2p_bspline</samp>&rsquo;</dt>
  38102. <dd><p>2-parameter cubic (B=1, C=0)
  38103. </p>
  38104. </dd>
  38105. <dt>&lsquo;<samp>cubic2p_catmullrom</samp>&rsquo;</dt>
  38106. <dd><p>2-parameter cubic (B=0, C=1/2)
  38107. </p>
  38108. </dd>
  38109. <dt>&lsquo;<samp>cubic2p_b05c03</samp>&rsquo;</dt>
  38110. <dd><p>2-parameter cubic (B=1/2, C=3/10)
  38111. </p>
  38112. </dd>
  38113. <dt>&lsquo;<samp>super</samp>&rsquo;</dt>
  38114. <dd><p>Supersampling
  38115. </p>
  38116. </dd>
  38117. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  38118. </dl>
  38119. </dd>
  38120. <dt>&lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;</dt>
  38121. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  38122. keep the original aspect ratio. Possible values:
  38123. </p>
  38124. <dl compact="compact">
  38125. <dt>&lsquo;<samp>disable</samp>&rsquo;</dt>
  38126. <dd><p>Scale the video as specified and disable this feature.
  38127. </p>
  38128. </dd>
  38129. <dt>&lsquo;<samp>decrease</samp>&rsquo;</dt>
  38130. <dd><p>The output video dimensions will automatically be decreased if needed.
  38131. </p>
  38132. </dd>
  38133. <dt>&lsquo;<samp>increase</samp>&rsquo;</dt>
  38134. <dd><p>The output video dimensions will automatically be increased if needed.
  38135. </p>
  38136. </dd>
  38137. </dl>
  38138. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  38139. maximum allowed resolution, you can use this to limit the output video to
  38140. that, while retaining the aspect ratio. For example, device A allows
  38141. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  38142. decrease) and specifying 1280x720 to the command line makes the output
  38143. 1280x533.
  38144. </p>
  38145. <p>Please note that this is a different thing than specifying -1 for &lsquo;<samp>w</samp>&rsquo;
  38146. or &lsquo;<samp>h</samp>&rsquo;, you still need to specify the output resolution for this option
  38147. to work.
  38148. </p>
  38149. </dd>
  38150. <dt>&lsquo;<samp>force_divisible_by</samp>&rsquo;</dt>
  38151. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  38152. given integer when used together with &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;. This
  38153. works similar to using <code>-n</code> in the &lsquo;<samp>w</samp>&rsquo; and &lsquo;<samp>h</samp>&rsquo; options.
  38154. </p>
  38155. <p>This option respects the value set for &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;,
  38156. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  38157. may be slightly modified.
  38158. </p>
  38159. <p>This option can be handy if you need to have a video fit within or exceed
  38160. a defined resolution using &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo; but also have
  38161. encoder restrictions on width or height divisibility.
  38162. </p>
  38163. </dd>
  38164. </dl>
  38165. <a name="scale2ref"></a>
  38166. <h2 class="section"><a href="ffmpeg-all.html#toc-scale2ref">39.179 scale2ref</a></h2>
  38167. <p>Scale (resize) the input video, based on a reference video.
  38168. </p>
  38169. <p>See the scale filter for available options, scale2ref supports the same but
  38170. uses the reference video instead of the main input as basis. scale2ref also
  38171. supports the following additional constants for the &lsquo;<samp>w</samp>&rsquo; and
  38172. &lsquo;<samp>h</samp>&rsquo; options:
  38173. </p>
  38174. <dl compact="compact">
  38175. <dt><var>main_w</var></dt>
  38176. <dt><var>main_h</var></dt>
  38177. <dd><p>The main input video&rsquo;s width and height
  38178. </p>
  38179. </dd>
  38180. <dt><var>main_a</var></dt>
  38181. <dd><p>The same as <var>main_w</var> / <var>main_h</var>
  38182. </p>
  38183. </dd>
  38184. <dt><var>main_sar</var></dt>
  38185. <dd><p>The main input video&rsquo;s sample aspect ratio
  38186. </p>
  38187. </dd>
  38188. <dt><var>main_dar, mdar</var></dt>
  38189. <dd><p>The main input video&rsquo;s display aspect ratio. Calculated from
  38190. <code>(main_w / main_h) * main_sar</code>.
  38191. </p>
  38192. </dd>
  38193. <dt><var>main_hsub</var></dt>
  38194. <dt><var>main_vsub</var></dt>
  38195. <dd><p>The main input video&rsquo;s horizontal and vertical chroma subsample values.
  38196. For example for the pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var>
  38197. is 1.
  38198. </p>
  38199. </dd>
  38200. <dt><var>main_n</var></dt>
  38201. <dd><p>The (sequential) number of the main input frame, starting from 0.
  38202. Only available with <code>eval=frame</code>.
  38203. </p>
  38204. </dd>
  38205. <dt><var>main_t</var></dt>
  38206. <dd><p>The presentation timestamp of the main input frame, expressed as a number of
  38207. seconds. Only available with <code>eval=frame</code>.
  38208. </p>
  38209. </dd>
  38210. <dt><var>main_pos</var></dt>
  38211. <dd><p>The position (byte offset) of the frame in the main input stream, or NaN if
  38212. this information is unavailable and/or meaningless (for example in case of synthetic video).
  38213. Only available with <code>eval=frame</code>.
  38214. </p></dd>
  38215. </dl>
  38216. <a name="Examples-120"></a>
  38217. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-120">39.179.1 Examples</a></h3>
  38218. <ul>
  38219. <li>
  38220. Scale a subtitle stream (b) to match the main video (a) in size before overlaying
  38221. <div class="example">
  38222. <pre class="example">'scale2ref[b][a];[a][b]overlay'
  38223. </pre></div>
  38224. </li><li>
  38225. Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio.
  38226. <div class="example">
  38227. <pre class="example">[logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out]
  38228. </pre></div>
  38229. </li></ul>
  38230. <a name="Commands-16"></a>
  38231. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-16">39.179.2 Commands</a></h3>
  38232. <p>This filter supports the following commands:
  38233. </p><dl compact="compact">
  38234. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  38235. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  38236. <dd><p>Set the output video dimension expression.
  38237. The command accepts the same syntax of the corresponding option.
  38238. </p>
  38239. <p>If the specified expression is not valid, it is kept at its current
  38240. value.
  38241. </p></dd>
  38242. </dl>
  38243. <a name="scroll"></a>
  38244. <h2 class="section"><a href="ffmpeg-all.html#toc-scroll">39.180 scroll</a></h2>
  38245. <p>Scroll input video horizontally and/or vertically by constant speed.
  38246. </p>
  38247. <p>The filter accepts the following options:
  38248. </p><dl compact="compact">
  38249. <dt>&lsquo;<samp>horizontal, h</samp>&rsquo;</dt>
  38250. <dd><p>Set the horizontal scrolling speed. Default is 0. Allowed range is from -1 to 1.
  38251. Negative values changes scrolling direction.
  38252. </p>
  38253. </dd>
  38254. <dt>&lsquo;<samp>vertical, v</samp>&rsquo;</dt>
  38255. <dd><p>Set the vertical scrolling speed. Default is 0. Allowed range is from -1 to 1.
  38256. Negative values changes scrolling direction.
  38257. </p>
  38258. </dd>
  38259. <dt>&lsquo;<samp>hpos</samp>&rsquo;</dt>
  38260. <dd><p>Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1.
  38261. </p>
  38262. </dd>
  38263. <dt>&lsquo;<samp>vpos</samp>&rsquo;</dt>
  38264. <dd><p>Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1.
  38265. </p></dd>
  38266. </dl>
  38267. <a name="Commands-47"></a>
  38268. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-47">39.180.1 Commands</a></h3>
  38269. <p>This filter supports the following <a href="#commands">commands</a>:
  38270. </p><dl compact="compact">
  38271. <dt>&lsquo;<samp>horizontal, h</samp>&rsquo;</dt>
  38272. <dd><p>Set the horizontal scrolling speed.
  38273. </p></dd>
  38274. <dt>&lsquo;<samp>vertical, v</samp>&rsquo;</dt>
  38275. <dd><p>Set the vertical scrolling speed.
  38276. </p></dd>
  38277. </dl>
  38278. <p><a name="scdet"></a>
  38279. </p><a name="scdet-1"></a>
  38280. <h2 class="section"><a href="ffmpeg-all.html#toc-scdet-1">39.181 scdet</a></h2>
  38281. <p>Detect video scene change.
  38282. </p>
  38283. <p>This filter sets frame metadata with mafd between frame, the scene score, and
  38284. forward the frame to the next filter, so they can use these metadata to detect
  38285. scene change or others.
  38286. </p>
  38287. <p>In addition, this filter logs a message and sets frame metadata when it detects
  38288. a scene change by &lsquo;<samp>threshold</samp>&rsquo;.
  38289. </p>
  38290. <p><code>lavfi.scd.mafd</code> metadata keys are set with mafd for every frame.
  38291. </p>
  38292. <p><code>lavfi.scd.score</code> metadata keys are set with scene change score for every frame
  38293. to detect scene change.
  38294. </p>
  38295. <p><code>lavfi.scd.time</code> metadata keys are set with current filtered frame time which
  38296. detect scene change with &lsquo;<samp>threshold</samp>&rsquo;.
  38297. </p>
  38298. <p>The filter accepts the following options:
  38299. </p>
  38300. <dl compact="compact">
  38301. <dt>&lsquo;<samp>threshold, t</samp>&rsquo;</dt>
  38302. <dd><p>Set the scene change detection threshold as a percentage of maximum change. Good
  38303. values are in the <code>[8.0, 14.0]</code> range. The range for &lsquo;<samp>threshold</samp>&rsquo; is
  38304. <code>[0., 100.]</code>.
  38305. </p>
  38306. <p>Default value is <code>10.</code>.
  38307. </p>
  38308. </dd>
  38309. <dt>&lsquo;<samp>sc_pass, s</samp>&rsquo;</dt>
  38310. <dd><p>Set the flag to pass scene change frames to the next filter. Default value is <code>0</code>
  38311. You can enable it if you want to get snapshot of scene change frames only.
  38312. </p></dd>
  38313. </dl>
  38314. <p><a name="selectivecolor"></a>
  38315. </p><a name="selectivecolor-1"></a>
  38316. <h2 class="section"><a href="ffmpeg-all.html#toc-selectivecolor-1">39.182 selectivecolor</a></h2>
  38317. <p>Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such
  38318. as &quot;reds&quot;, &quot;yellows&quot;, &quot;greens&quot;, &quot;cyans&quot;, ...). The adjustment range is defined
  38319. by the &quot;purity&quot; of the color (that is, how saturated it already is).
  38320. </p>
  38321. <p>This filter is similar to the Adobe Photoshop Selective Color tool.
  38322. </p>
  38323. <p>The filter accepts the following options:
  38324. </p>
  38325. <dl compact="compact">
  38326. <dt>&lsquo;<samp>correction_method</samp>&rsquo;</dt>
  38327. <dd><p>Select color correction method.
  38328. </p>
  38329. <p>Available values are:
  38330. </p><dl compact="compact">
  38331. <dt>&lsquo;<samp>absolute</samp>&rsquo;</dt>
  38332. <dd><p>Specified adjustments are applied &quot;as-is&quot; (added/subtracted to original pixel
  38333. component value).
  38334. </p></dd>
  38335. <dt>&lsquo;<samp>relative</samp>&rsquo;</dt>
  38336. <dd><p>Specified adjustments are relative to the original component value.
  38337. </p></dd>
  38338. </dl>
  38339. <p>Default is <code>absolute</code>.
  38340. </p></dd>
  38341. <dt>&lsquo;<samp>reds</samp>&rsquo;</dt>
  38342. <dd><p>Adjustments for red pixels (pixels where the red component is the maximum)
  38343. </p></dd>
  38344. <dt>&lsquo;<samp>yellows</samp>&rsquo;</dt>
  38345. <dd><p>Adjustments for yellow pixels (pixels where the blue component is the minimum)
  38346. </p></dd>
  38347. <dt>&lsquo;<samp>greens</samp>&rsquo;</dt>
  38348. <dd><p>Adjustments for green pixels (pixels where the green component is the maximum)
  38349. </p></dd>
  38350. <dt>&lsquo;<samp>cyans</samp>&rsquo;</dt>
  38351. <dd><p>Adjustments for cyan pixels (pixels where the red component is the minimum)
  38352. </p></dd>
  38353. <dt>&lsquo;<samp>blues</samp>&rsquo;</dt>
  38354. <dd><p>Adjustments for blue pixels (pixels where the blue component is the maximum)
  38355. </p></dd>
  38356. <dt>&lsquo;<samp>magentas</samp>&rsquo;</dt>
  38357. <dd><p>Adjustments for magenta pixels (pixels where the green component is the minimum)
  38358. </p></dd>
  38359. <dt>&lsquo;<samp>whites</samp>&rsquo;</dt>
  38360. <dd><p>Adjustments for white pixels (pixels where all components are greater than 128)
  38361. </p></dd>
  38362. <dt>&lsquo;<samp>neutrals</samp>&rsquo;</dt>
  38363. <dd><p>Adjustments for all pixels except pure black and pure white
  38364. </p></dd>
  38365. <dt>&lsquo;<samp>blacks</samp>&rsquo;</dt>
  38366. <dd><p>Adjustments for black pixels (pixels where all components are lesser than 128)
  38367. </p></dd>
  38368. <dt>&lsquo;<samp>psfile</samp>&rsquo;</dt>
  38369. <dd><p>Specify a Photoshop selective color file (<code>.asv</code>) to import the settings from.
  38370. </p></dd>
  38371. </dl>
  38372. <p>All the adjustment settings (&lsquo;<samp>reds</samp>&rsquo;, &lsquo;<samp>yellows</samp>&rsquo;, ...) accept up to
  38373. 4 space separated floating point adjustment values in the [-1,1] range,
  38374. respectively to adjust the amount of cyan, magenta, yellow and black for the
  38375. pixels of its range.
  38376. </p>
  38377. <a name="Examples-119"></a>
  38378. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-119">39.182.1 Examples</a></h3>
  38379. <ul>
  38380. <li>
  38381. Increase cyan by 50% and reduce yellow by 33% in every green areas, and
  38382. increase magenta by 27% in blue areas:
  38383. <div class="example">
  38384. <pre class="example">selectivecolor=greens=.5 0 -.33 0:blues=0 .27
  38385. </pre></div>
  38386. </li><li>
  38387. Use a Photoshop selective color preset:
  38388. <div class="example">
  38389. <pre class="example">selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
  38390. </pre></div>
  38391. </li></ul>
  38392. <p><a name="separatefields"></a>
  38393. </p><a name="separatefields-1"></a>
  38394. <h2 class="section"><a href="ffmpeg-all.html#toc-separatefields-1">39.183 separatefields</a></h2>
  38395. <p>The <code>separatefields</code> takes a frame-based video input and splits
  38396. each frame into its components fields, producing a new half height clip
  38397. with twice the frame rate and twice the frame count.
  38398. </p>
  38399. <p>This filter use field-dominance information in frame to decide which
  38400. of each pair of fields to place first in the output.
  38401. If it gets it wrong use <a href="#setfield">setfield</a> filter before <code>separatefields</code> filter.
  38402. </p>
  38403. <a name="setdar_002c-setsar"></a>
  38404. <h2 class="section"><a href="ffmpeg-all.html#toc-setdar_002c-setsar">39.184 setdar, setsar</a></h2>
  38405. <p>The <code>setdar</code> filter sets the Display Aspect Ratio for the filter
  38406. output video.
  38407. </p>
  38408. <p>This is done by changing the specified Sample (aka Pixel) Aspect
  38409. Ratio, according to the following equation:
  38410. </p><div class="example">
  38411. <pre class="example"><var>DAR</var> = <var>HORIZONTAL_RESOLUTION</var> / <var>VERTICAL_RESOLUTION</var> * <var>SAR</var>
  38412. </pre></div>
  38413. <p>Keep in mind that the <code>setdar</code> filter does not modify the pixel
  38414. dimensions of the video frame. Also, the display aspect ratio set by
  38415. this filter may be changed by later filters in the filterchain,
  38416. e.g. in case of scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is
  38417. applied.
  38418. </p>
  38419. <p>The <code>setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
  38420. the filter output video.
  38421. </p>
  38422. <p>Note that as a consequence of the application of this filter, the
  38423. output display aspect ratio will change according to the equation
  38424. above.
  38425. </p>
  38426. <p>Keep in mind that the sample aspect ratio set by the <code>setsar</code>
  38427. filter may be changed by later filters in the filterchain, e.g. if
  38428. another &quot;setsar&quot; or a &quot;setdar&quot; filter is applied.
  38429. </p>
  38430. <p>It accepts the following parameters:
  38431. </p>
  38432. <dl compact="compact">
  38433. <dt>&lsquo;<samp>r, ratio, dar (<code>setdar</code> only), sar (<code>setsar</code> only)</samp>&rsquo;</dt>
  38434. <dd><p>Set the aspect ratio used by the filter.
  38435. </p>
  38436. <p>The parameter can be a floating point number string, an expression, or
  38437. a string of the form <var>num</var>:<var>den</var>, where <var>num</var> and
  38438. <var>den</var> are the numerator and denominator of the aspect ratio. If
  38439. the parameter is not specified, it is assumed the value &quot;0&quot;.
  38440. In case the form &quot;<var>num</var>:<var>den</var>&quot; is used, the <code>:</code> character
  38441. should be escaped.
  38442. </p>
  38443. </dd>
  38444. <dt>&lsquo;<samp>max</samp>&rsquo;</dt>
  38445. <dd><p>Set the maximum integer value to use for expressing numerator and
  38446. denominator when reducing the expressed aspect ratio to a rational.
  38447. Default value is <code>100</code>.
  38448. </p>
  38449. </dd>
  38450. </dl>
  38451. <p>The parameter <var>sar</var> is an expression containing
  38452. the following constants:
  38453. </p>
  38454. <dl compact="compact">
  38455. <dt>&lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
  38456. <dd><p>These are approximated values for the mathematical constants e
  38457. (Euler&rsquo;s number), pi (Greek pi), and phi (the golden ratio).
  38458. </p>
  38459. </dd>
  38460. <dt>&lsquo;<samp>w, h</samp>&rsquo;</dt>
  38461. <dd><p>The input width and height.
  38462. </p>
  38463. </dd>
  38464. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  38465. <dd><p>These are the same as <var>w</var> / <var>h</var>.
  38466. </p>
  38467. </dd>
  38468. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  38469. <dd><p>The input sample aspect ratio.
  38470. </p>
  38471. </dd>
  38472. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  38473. <dd><p>The input display aspect ratio. It is the same as
  38474. (<var>w</var> / <var>h</var>) * <var>sar</var>.
  38475. </p>
  38476. </dd>
  38477. <dt>&lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
  38478. <dd><p>Horizontal and vertical chroma subsample values. For example, for the
  38479. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  38480. </p></dd>
  38481. </dl>
  38482. <a name="Examples-162"></a>
  38483. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-162">39.184.1 Examples</a></h3>
  38484. <ul>
  38485. <li>
  38486. To change the display aspect ratio to 16:9, specify one of the following:
  38487. <div class="example">
  38488. <pre class="example">setdar=dar=1.77777
  38489. setdar=dar=16/9
  38490. </pre></div>
  38491. </li><li>
  38492. To change the sample aspect ratio to 10:11, specify:
  38493. <div class="example">
  38494. <pre class="example">setsar=sar=10/11
  38495. </pre></div>
  38496. </li><li>
  38497. To set a display aspect ratio of 16:9, and specify a maximum integer value of
  38498. 1000 in the aspect ratio reduction, use the command:
  38499. <div class="example">
  38500. <pre class="example">setdar=ratio=16/9:max=1000
  38501. </pre></div>
  38502. </li></ul>
  38503. <p><a name="setfield"></a>
  38504. </p><a name="setfield-1"></a>
  38505. <h2 class="section"><a href="ffmpeg-all.html#toc-setfield-1">39.185 setfield</a></h2>
  38506. <p>Force field for the output video frame.
  38507. </p>
  38508. <p>The <code>setfield</code> filter marks the interlace type field for the
  38509. output frames. It does not change the input frame, but only sets the
  38510. corresponding property, which affects how the frame is treated by
  38511. following filters (e.g. <code>fieldorder</code> or <code>yadif</code>).
  38512. </p>
  38513. <p>The filter accepts the following options:
  38514. </p>
  38515. <dl compact="compact">
  38516. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  38517. <dd><p>Available values are:
  38518. </p>
  38519. <dl compact="compact">
  38520. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  38521. <dd><p>Keep the same field property.
  38522. </p>
  38523. </dd>
  38524. <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
  38525. <dd><p>Mark the frame as bottom-field-first.
  38526. </p>
  38527. </dd>
  38528. <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
  38529. <dd><p>Mark the frame as top-field-first.
  38530. </p>
  38531. </dd>
  38532. <dt>&lsquo;<samp>prog</samp>&rsquo;</dt>
  38533. <dd><p>Mark the frame as progressive.
  38534. </p></dd>
  38535. </dl>
  38536. </dd>
  38537. </dl>
  38538. <p><a name="setparams"></a>
  38539. </p><a name="setparams-1"></a>
  38540. <h2 class="section"><a href="ffmpeg-all.html#toc-setparams-1">39.186 setparams</a></h2>
  38541. <p>Force frame parameter for the output video frame.
  38542. </p>
  38543. <p>The <code>setparams</code> filter marks interlace and color range for the
  38544. output frames. It does not change the input frame, but only sets the
  38545. corresponding property, which affects how the frame is treated by
  38546. filters/encoders.
  38547. </p>
  38548. <dl compact="compact">
  38549. <dt>&lsquo;<samp>field_mode</samp>&rsquo;</dt>
  38550. <dd><p>Available values are:
  38551. </p>
  38552. <dl compact="compact">
  38553. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  38554. <dd><p>Keep the same field property (default).
  38555. </p>
  38556. </dd>
  38557. <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
  38558. <dd><p>Mark the frame as bottom-field-first.
  38559. </p>
  38560. </dd>
  38561. <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
  38562. <dd><p>Mark the frame as top-field-first.
  38563. </p>
  38564. </dd>
  38565. <dt>&lsquo;<samp>prog</samp>&rsquo;</dt>
  38566. <dd><p>Mark the frame as progressive.
  38567. </p></dd>
  38568. </dl>
  38569. </dd>
  38570. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  38571. <dd><p>Available values are:
  38572. </p>
  38573. <dl compact="compact">
  38574. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  38575. <dd><p>Keep the same color range property (default).
  38576. </p>
  38577. </dd>
  38578. <dt>&lsquo;<samp>unspecified, unknown</samp>&rsquo;</dt>
  38579. <dd><p>Mark the frame as unspecified color range.
  38580. </p>
  38581. </dd>
  38582. <dt>&lsquo;<samp>limited, tv, mpeg</samp>&rsquo;</dt>
  38583. <dd><p>Mark the frame as limited range.
  38584. </p>
  38585. </dd>
  38586. <dt>&lsquo;<samp>full, pc, jpeg</samp>&rsquo;</dt>
  38587. <dd><p>Mark the frame as full range.
  38588. </p></dd>
  38589. </dl>
  38590. </dd>
  38591. <dt>&lsquo;<samp>color_primaries</samp>&rsquo;</dt>
  38592. <dd><p>Set the color primaries.
  38593. Available values are:
  38594. </p>
  38595. <dl compact="compact">
  38596. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  38597. <dd><p>Keep the same color primaries property (default).
  38598. </p>
  38599. </dd>
  38600. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  38601. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  38602. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  38603. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  38604. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  38605. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  38606. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  38607. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  38608. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  38609. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  38610. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  38611. <dt>&lsquo;<samp>jedec-p22</samp>&rsquo;</dt>
  38612. </dl>
  38613. </dd>
  38614. <dt>&lsquo;<samp>color_trc</samp>&rsquo;</dt>
  38615. <dd><p>Set the color transfer.
  38616. Available values are:
  38617. </p>
  38618. <dl compact="compact">
  38619. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  38620. <dd><p>Keep the same color trc property (default).
  38621. </p>
  38622. </dd>
  38623. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  38624. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  38625. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  38626. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  38627. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  38628. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  38629. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  38630. <dt>&lsquo;<samp>log100</samp>&rsquo;</dt>
  38631. <dt>&lsquo;<samp>log316</samp>&rsquo;</dt>
  38632. <dt>&lsquo;<samp>iec61966-2-4</samp>&rsquo;</dt>
  38633. <dt>&lsquo;<samp>bt1361e</samp>&rsquo;</dt>
  38634. <dt>&lsquo;<samp>iec61966-2-1</samp>&rsquo;</dt>
  38635. <dt>&lsquo;<samp>bt2020-10</samp>&rsquo;</dt>
  38636. <dt>&lsquo;<samp>bt2020-12</samp>&rsquo;</dt>
  38637. <dt>&lsquo;<samp>smpte2084</samp>&rsquo;</dt>
  38638. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  38639. <dt>&lsquo;<samp>arib-std-b67</samp>&rsquo;</dt>
  38640. </dl>
  38641. </dd>
  38642. <dt>&lsquo;<samp>colorspace</samp>&rsquo;</dt>
  38643. <dd><p>Set the colorspace.
  38644. Available values are:
  38645. </p>
  38646. <dl compact="compact">
  38647. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  38648. <dd><p>Keep the same colorspace property (default).
  38649. </p>
  38650. </dd>
  38651. <dt>&lsquo;<samp>gbr</samp>&rsquo;</dt>
  38652. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  38653. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  38654. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  38655. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  38656. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  38657. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  38658. <dt>&lsquo;<samp>ycgco</samp>&rsquo;</dt>
  38659. <dt>&lsquo;<samp>bt2020nc</samp>&rsquo;</dt>
  38660. <dt>&lsquo;<samp>bt2020c</samp>&rsquo;</dt>
  38661. <dt>&lsquo;<samp>smpte2085</samp>&rsquo;</dt>
  38662. <dt>&lsquo;<samp>chroma-derived-nc</samp>&rsquo;</dt>
  38663. <dt>&lsquo;<samp>chroma-derived-c</samp>&rsquo;</dt>
  38664. <dt>&lsquo;<samp>ictcp</samp>&rsquo;</dt>
  38665. </dl>
  38666. </dd>
  38667. </dl>
  38668. <a name="showinfo"></a>
  38669. <h2 class="section"><a href="ffmpeg-all.html#toc-showinfo">39.187 showinfo</a></h2>
  38670. <p>Show a line containing various information for each input video frame.
  38671. The input video is not modified.
  38672. </p>
  38673. <p>This filter supports the following options:
  38674. </p>
  38675. <dl compact="compact">
  38676. <dt>&lsquo;<samp>checksum</samp>&rsquo;</dt>
  38677. <dd><p>Calculate checksums of each plane. By default enabled.
  38678. </p></dd>
  38679. </dl>
  38680. <p>The shown line contains a sequence of key/value pairs of the form
  38681. <var>key</var>:<var>value</var>.
  38682. </p>
  38683. <p>The following values are shown in the output:
  38684. </p>
  38685. <dl compact="compact">
  38686. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  38687. <dd><p>The (sequential) number of the input frame, starting from 0.
  38688. </p>
  38689. </dd>
  38690. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  38691. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  38692. time base units. The time base unit depends on the filter input pad.
  38693. </p>
  38694. </dd>
  38695. <dt>&lsquo;<samp>pts_time</samp>&rsquo;</dt>
  38696. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  38697. seconds.
  38698. </p>
  38699. </dd>
  38700. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  38701. <dd><p>The position of the frame in the input stream, or -1 if this information is
  38702. unavailable and/or meaningless (for example in case of synthetic video).
  38703. </p>
  38704. </dd>
  38705. <dt>&lsquo;<samp>fmt</samp>&rsquo;</dt>
  38706. <dd><p>The pixel format name.
  38707. </p>
  38708. </dd>
  38709. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  38710. <dd><p>The sample aspect ratio of the input frame, expressed in the form
  38711. <var>num</var>/<var>den</var>.
  38712. </p>
  38713. </dd>
  38714. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  38715. <dd><p>The size of the input frame. For the syntax of this option, check the
  38716. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  38717. </p>
  38718. </dd>
  38719. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  38720. <dd><p>The type of interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
  38721. for bottom field first).
  38722. </p>
  38723. </dd>
  38724. <dt>&lsquo;<samp>iskey</samp>&rsquo;</dt>
  38725. <dd><p>This is 1 if the frame is a key frame, 0 otherwise.
  38726. </p>
  38727. </dd>
  38728. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  38729. <dd><p>The picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
  38730. P-frame, &quot;B&quot; for a B-frame, or &quot;?&quot; for an unknown type).
  38731. Also refer to the documentation of the <code>AVPictureType</code> enum and of
  38732. the <code>av_get_picture_type_char</code> function defined in
  38733. &lsquo;<tt>libavutil/avutil.h</tt>&rsquo;.
  38734. </p>
  38735. </dd>
  38736. <dt>&lsquo;<samp>checksum</samp>&rsquo;</dt>
  38737. <dd><p>The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame.
  38738. </p>
  38739. </dd>
  38740. <dt>&lsquo;<samp>plane_checksum</samp>&rsquo;</dt>
  38741. <dd><p>The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
  38742. expressed in the form &quot;[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]&quot;.
  38743. </p>
  38744. </dd>
  38745. <dt>&lsquo;<samp>mean</samp>&rsquo;</dt>
  38746. <dd><p>The mean value of pixels in each plane of the input frame, expressed in the form
  38747. &quot;[<var>mean0</var> <var>mean1</var> <var>mean2</var> <var>mean3</var>]&quot;.
  38748. </p>
  38749. </dd>
  38750. <dt>&lsquo;<samp>stdev</samp>&rsquo;</dt>
  38751. <dd><p>The standard deviation of pixel values in each plane of the input frame, expressed
  38752. in the form &quot;[<var>stdev0</var> <var>stdev1</var> <var>stdev2</var> <var>stdev3</var>]&quot;.
  38753. </p>
  38754. </dd>
  38755. </dl>
  38756. <a name="showpalette"></a>
  38757. <h2 class="section"><a href="ffmpeg-all.html#toc-showpalette">39.188 showpalette</a></h2>
  38758. <p>Displays the 256 colors palette of each frame. This filter is only relevant for
  38759. <var>pal8</var> pixel format frames.
  38760. </p>
  38761. <p>It accepts the following option:
  38762. </p>
  38763. <dl compact="compact">
  38764. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  38765. <dd><p>Set the size of the box used to represent one palette color entry. Default is
  38766. <code>30</code> (for a <code>30x30</code> pixel box).
  38767. </p></dd>
  38768. </dl>
  38769. <a name="shuffleframes"></a>
  38770. <h2 class="section"><a href="ffmpeg-all.html#toc-shuffleframes">39.189 shuffleframes</a></h2>
  38771. <p>Reorder and/or duplicate and/or drop video frames.
  38772. </p>
  38773. <p>It accepts the following parameters:
  38774. </p>
  38775. <dl compact="compact">
  38776. <dt>&lsquo;<samp>mapping</samp>&rsquo;</dt>
  38777. <dd><p>Set the destination indexes of input frames.
  38778. This is space or &rsquo;|&rsquo; separated list of indexes that maps input frames to output
  38779. frames. Number of indexes also sets maximal value that each index may have.
  38780. &rsquo;-1&rsquo; index have special meaning and that is to drop frame.
  38781. </p></dd>
  38782. </dl>
  38783. <p>The first frame has the index 0. The default is to keep the input unchanged.
  38784. </p>
  38785. <a name="Examples-175"></a>
  38786. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-175">39.189.1 Examples</a></h3>
  38787. <ul>
  38788. <li>
  38789. Swap second and third frame of every three frames of the input:
  38790. <div class="example">
  38791. <pre class="example">ffmpeg -i INPUT -vf &quot;shuffleframes=0 2 1&quot; OUTPUT
  38792. </pre></div>
  38793. </li><li>
  38794. Swap 10th and 1st frame of every ten frames of the input:
  38795. <div class="example">
  38796. <pre class="example">ffmpeg -i INPUT -vf &quot;shuffleframes=9 1 2 3 4 5 6 7 8 0&quot; OUTPUT
  38797. </pre></div>
  38798. </li></ul>
  38799. <a name="shuffleplanes"></a>
  38800. <h2 class="section"><a href="ffmpeg-all.html#toc-shuffleplanes">39.190 shuffleplanes</a></h2>
  38801. <p>Reorder and/or duplicate video planes.
  38802. </p>
  38803. <p>It accepts the following parameters:
  38804. </p>
  38805. <dl compact="compact">
  38806. <dt>&lsquo;<samp>map0</samp>&rsquo;</dt>
  38807. <dd><p>The index of the input plane to be used as the first output plane.
  38808. </p>
  38809. </dd>
  38810. <dt>&lsquo;<samp>map1</samp>&rsquo;</dt>
  38811. <dd><p>The index of the input plane to be used as the second output plane.
  38812. </p>
  38813. </dd>
  38814. <dt>&lsquo;<samp>map2</samp>&rsquo;</dt>
  38815. <dd><p>The index of the input plane to be used as the third output plane.
  38816. </p>
  38817. </dd>
  38818. <dt>&lsquo;<samp>map3</samp>&rsquo;</dt>
  38819. <dd><p>The index of the input plane to be used as the fourth output plane.
  38820. </p>
  38821. </dd>
  38822. </dl>
  38823. <p>The first plane has the index 0. The default is to keep the input unchanged.
  38824. </p>
  38825. <a name="Examples-49"></a>
  38826. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-49">39.190.1 Examples</a></h3>
  38827. <ul>
  38828. <li>
  38829. Swap the second and third planes of the input:
  38830. <div class="example">
  38831. <pre class="example">ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
  38832. </pre></div>
  38833. </li></ul>
  38834. <p><a name="signalstats"></a>
  38835. </p><a name="signalstats-1"></a>
  38836. <h2 class="section"><a href="ffmpeg-all.html#toc-signalstats-1">39.191 signalstats</a></h2>
  38837. <p>Evaluate various visual metrics that assist in determining issues associated
  38838. with the digitization of analog video media.
  38839. </p>
  38840. <p>By default the filter will log these metadata values:
  38841. </p>
  38842. <dl compact="compact">
  38843. <dt>&lsquo;<samp>YMIN</samp>&rsquo;</dt>
  38844. <dd><p>Display the minimal Y value contained within the input frame. Expressed in
  38845. range of [0-255].
  38846. </p>
  38847. </dd>
  38848. <dt>&lsquo;<samp>YLOW</samp>&rsquo;</dt>
  38849. <dd><p>Display the Y value at the 10% percentile within the input frame. Expressed in
  38850. range of [0-255].
  38851. </p>
  38852. </dd>
  38853. <dt>&lsquo;<samp>YAVG</samp>&rsquo;</dt>
  38854. <dd><p>Display the average Y value within the input frame. Expressed in range of
  38855. [0-255].
  38856. </p>
  38857. </dd>
  38858. <dt>&lsquo;<samp>YHIGH</samp>&rsquo;</dt>
  38859. <dd><p>Display the Y value at the 90% percentile within the input frame. Expressed in
  38860. range of [0-255].
  38861. </p>
  38862. </dd>
  38863. <dt>&lsquo;<samp>YMAX</samp>&rsquo;</dt>
  38864. <dd><p>Display the maximum Y value contained within the input frame. Expressed in
  38865. range of [0-255].
  38866. </p>
  38867. </dd>
  38868. <dt>&lsquo;<samp>UMIN</samp>&rsquo;</dt>
  38869. <dd><p>Display the minimal U value contained within the input frame. Expressed in
  38870. range of [0-255].
  38871. </p>
  38872. </dd>
  38873. <dt>&lsquo;<samp>ULOW</samp>&rsquo;</dt>
  38874. <dd><p>Display the U value at the 10% percentile within the input frame. Expressed in
  38875. range of [0-255].
  38876. </p>
  38877. </dd>
  38878. <dt>&lsquo;<samp>UAVG</samp>&rsquo;</dt>
  38879. <dd><p>Display the average U value within the input frame. Expressed in range of
  38880. [0-255].
  38881. </p>
  38882. </dd>
  38883. <dt>&lsquo;<samp>UHIGH</samp>&rsquo;</dt>
  38884. <dd><p>Display the U value at the 90% percentile within the input frame. Expressed in
  38885. range of [0-255].
  38886. </p>
  38887. </dd>
  38888. <dt>&lsquo;<samp>UMAX</samp>&rsquo;</dt>
  38889. <dd><p>Display the maximum U value contained within the input frame. Expressed in
  38890. range of [0-255].
  38891. </p>
  38892. </dd>
  38893. <dt>&lsquo;<samp>VMIN</samp>&rsquo;</dt>
  38894. <dd><p>Display the minimal V value contained within the input frame. Expressed in
  38895. range of [0-255].
  38896. </p>
  38897. </dd>
  38898. <dt>&lsquo;<samp>VLOW</samp>&rsquo;</dt>
  38899. <dd><p>Display the V value at the 10% percentile within the input frame. Expressed in
  38900. range of [0-255].
  38901. </p>
  38902. </dd>
  38903. <dt>&lsquo;<samp>VAVG</samp>&rsquo;</dt>
  38904. <dd><p>Display the average V value within the input frame. Expressed in range of
  38905. [0-255].
  38906. </p>
  38907. </dd>
  38908. <dt>&lsquo;<samp>VHIGH</samp>&rsquo;</dt>
  38909. <dd><p>Display the V value at the 90% percentile within the input frame. Expressed in
  38910. range of [0-255].
  38911. </p>
  38912. </dd>
  38913. <dt>&lsquo;<samp>VMAX</samp>&rsquo;</dt>
  38914. <dd><p>Display the maximum V value contained within the input frame. Expressed in
  38915. range of [0-255].
  38916. </p>
  38917. </dd>
  38918. <dt>&lsquo;<samp>SATMIN</samp>&rsquo;</dt>
  38919. <dd><p>Display the minimal saturation value contained within the input frame.
  38920. Expressed in range of [0-~181.02].
  38921. </p>
  38922. </dd>
  38923. <dt>&lsquo;<samp>SATLOW</samp>&rsquo;</dt>
  38924. <dd><p>Display the saturation value at the 10% percentile within the input frame.
  38925. Expressed in range of [0-~181.02].
  38926. </p>
  38927. </dd>
  38928. <dt>&lsquo;<samp>SATAVG</samp>&rsquo;</dt>
  38929. <dd><p>Display the average saturation value within the input frame. Expressed in range
  38930. of [0-~181.02].
  38931. </p>
  38932. </dd>
  38933. <dt>&lsquo;<samp>SATHIGH</samp>&rsquo;</dt>
  38934. <dd><p>Display the saturation value at the 90% percentile within the input frame.
  38935. Expressed in range of [0-~181.02].
  38936. </p>
  38937. </dd>
  38938. <dt>&lsquo;<samp>SATMAX</samp>&rsquo;</dt>
  38939. <dd><p>Display the maximum saturation value contained within the input frame.
  38940. Expressed in range of [0-~181.02].
  38941. </p>
  38942. </dd>
  38943. <dt>&lsquo;<samp>HUEMED</samp>&rsquo;</dt>
  38944. <dd><p>Display the median value for hue within the input frame. Expressed in range of
  38945. [0-360].
  38946. </p>
  38947. </dd>
  38948. <dt>&lsquo;<samp>HUEAVG</samp>&rsquo;</dt>
  38949. <dd><p>Display the average value for hue within the input frame. Expressed in range of
  38950. [0-360].
  38951. </p>
  38952. </dd>
  38953. <dt>&lsquo;<samp>YDIF</samp>&rsquo;</dt>
  38954. <dd><p>Display the average of sample value difference between all values of the Y
  38955. plane in the current frame and corresponding values of the previous input frame.
  38956. Expressed in range of [0-255].
  38957. </p>
  38958. </dd>
  38959. <dt>&lsquo;<samp>UDIF</samp>&rsquo;</dt>
  38960. <dd><p>Display the average of sample value difference between all values of the U
  38961. plane in the current frame and corresponding values of the previous input frame.
  38962. Expressed in range of [0-255].
  38963. </p>
  38964. </dd>
  38965. <dt>&lsquo;<samp>VDIF</samp>&rsquo;</dt>
  38966. <dd><p>Display the average of sample value difference between all values of the V
  38967. plane in the current frame and corresponding values of the previous input frame.
  38968. Expressed in range of [0-255].
  38969. </p>
  38970. </dd>
  38971. <dt>&lsquo;<samp>YBITDEPTH</samp>&rsquo;</dt>
  38972. <dd><p>Display bit depth of Y plane in current frame.
  38973. Expressed in range of [0-16].
  38974. </p>
  38975. </dd>
  38976. <dt>&lsquo;<samp>UBITDEPTH</samp>&rsquo;</dt>
  38977. <dd><p>Display bit depth of U plane in current frame.
  38978. Expressed in range of [0-16].
  38979. </p>
  38980. </dd>
  38981. <dt>&lsquo;<samp>VBITDEPTH</samp>&rsquo;</dt>
  38982. <dd><p>Display bit depth of V plane in current frame.
  38983. Expressed in range of [0-16].
  38984. </p></dd>
  38985. </dl>
  38986. <p>The filter accepts the following options:
  38987. </p>
  38988. <dl compact="compact">
  38989. <dt>&lsquo;<samp>stat</samp>&rsquo;</dt>
  38990. <dt>&lsquo;<samp>out</samp>&rsquo;</dt>
  38991. <dd>
  38992. <p>&lsquo;<samp>stat</samp>&rsquo; specify an additional form of image analysis.
  38993. &lsquo;<samp>out</samp>&rsquo; output video with the specified type of pixel highlighted.
  38994. </p>
  38995. <p>Both options accept the following values:
  38996. </p>
  38997. <dl compact="compact">
  38998. <dt>&lsquo;<samp>tout</samp>&rsquo;</dt>
  38999. <dd><p>Identify <var>temporal outliers</var> pixels. A <var>temporal outlier</var> is a pixel
  39000. unlike the neighboring pixels of the same field. Examples of temporal outliers
  39001. include the results of video dropouts, head clogs, or tape tracking issues.
  39002. </p>
  39003. </dd>
  39004. <dt>&lsquo;<samp>vrep</samp>&rsquo;</dt>
  39005. <dd><p>Identify <var>vertical line repetition</var>. Vertical line repetition includes
  39006. similar rows of pixels within a frame. In born-digital video vertical line
  39007. repetition is common, but this pattern is uncommon in video digitized from an
  39008. analog source. When it occurs in video that results from the digitization of an
  39009. analog source it can indicate concealment from a dropout compensator.
  39010. </p>
  39011. </dd>
  39012. <dt>&lsquo;<samp>brng</samp>&rsquo;</dt>
  39013. <dd><p>Identify pixels that fall outside of legal broadcast range.
  39014. </p></dd>
  39015. </dl>
  39016. </dd>
  39017. <dt>&lsquo;<samp>color, c</samp>&rsquo;</dt>
  39018. <dd><p>Set the highlight color for the &lsquo;<samp>out</samp>&rsquo; option. The default color is
  39019. yellow.
  39020. </p></dd>
  39021. </dl>
  39022. <a name="Examples-17"></a>
  39023. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-17">39.191.1 Examples</a></h3>
  39024. <ul>
  39025. <li>
  39026. Output data of various video metrics:
  39027. <div class="example">
  39028. <pre class="example">ffprobe -f lavfi movie=example.mov,signalstats=&quot;stat=tout+vrep+brng&quot; -show_frames
  39029. </pre></div>
  39030. </li><li>
  39031. Output specific data about the minimum and maximum values of the Y plane per frame:
  39032. <div class="example">
  39033. <pre class="example">ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
  39034. </pre></div>
  39035. </li><li>
  39036. Playback video while highlighting pixels that are outside of broadcast range in red.
  39037. <div class="example">
  39038. <pre class="example">ffplay example.mov -vf signalstats=&quot;out=brng:color=red&quot;
  39039. </pre></div>
  39040. </li><li>
  39041. Playback video with signalstats metadata drawn over the frame.
  39042. <div class="example">
  39043. <pre class="example">ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
  39044. </pre></div>
  39045. <p>The contents of signalstat_drawtext.txt used in the command are:
  39046. </p><div class="example">
  39047. <pre class="example">time %{pts:hms}
  39048. Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
  39049. U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
  39050. V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
  39051. saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
  39052. </pre></div>
  39053. </li></ul>
  39054. <p><a name="signature"></a>
  39055. </p><a name="signature-1"></a>
  39056. <h2 class="section"><a href="ffmpeg-all.html#toc-signature-1">39.192 signature</a></h2>
  39057. <p>Calculates the MPEG-7 Video Signature. The filter can handle more than one
  39058. input. In this case the matching between the inputs can be calculated additionally.
  39059. The filter always passes through the first input. The signature of each stream can
  39060. be written into a file.
  39061. </p>
  39062. <p>It accepts the following options:
  39063. </p>
  39064. <dl compact="compact">
  39065. <dt>&lsquo;<samp>detectmode</samp>&rsquo;</dt>
  39066. <dd><p>Enable or disable the matching process.
  39067. </p>
  39068. <p>Available values are:
  39069. </p>
  39070. <dl compact="compact">
  39071. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  39072. <dd><p>Disable the calculation of a matching (default).
  39073. </p></dd>
  39074. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  39075. <dd><p>Calculate the matching for the whole video and output whether the whole video
  39076. matches or only parts.
  39077. </p></dd>
  39078. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  39079. <dd><p>Calculate only until a matching is found or the video ends. Should be faster in
  39080. some cases.
  39081. </p></dd>
  39082. </dl>
  39083. </dd>
  39084. <dt>&lsquo;<samp>nb_inputs</samp>&rsquo;</dt>
  39085. <dd><p>Set the number of inputs. The option value must be a non negative integer.
  39086. Default value is 1.
  39087. </p>
  39088. </dd>
  39089. <dt>&lsquo;<samp>filename</samp>&rsquo;</dt>
  39090. <dd><p>Set the path to which the output is written. If there is more than one input,
  39091. the path must be a prototype, i.e. must contain %d or %0nd (where n is a positive
  39092. integer), that will be replaced with the input number. If no filename is
  39093. specified, no output will be written. This is the default.
  39094. </p>
  39095. </dd>
  39096. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  39097. <dd><p>Choose the output format.
  39098. </p>
  39099. <p>Available values are:
  39100. </p>
  39101. <dl compact="compact">
  39102. <dt>&lsquo;<samp>binary</samp>&rsquo;</dt>
  39103. <dd><p>Use the specified binary representation (default).
  39104. </p></dd>
  39105. <dt>&lsquo;<samp>xml</samp>&rsquo;</dt>
  39106. <dd><p>Use the specified xml representation.
  39107. </p></dd>
  39108. </dl>
  39109. </dd>
  39110. <dt>&lsquo;<samp>th_d</samp>&rsquo;</dt>
  39111. <dd><p>Set threshold to detect one word as similar. The option value must be an integer
  39112. greater than zero. The default value is 9000.
  39113. </p>
  39114. </dd>
  39115. <dt>&lsquo;<samp>th_dc</samp>&rsquo;</dt>
  39116. <dd><p>Set threshold to detect all words as similar. The option value must be an integer
  39117. greater than zero. The default value is 60000.
  39118. </p>
  39119. </dd>
  39120. <dt>&lsquo;<samp>th_xh</samp>&rsquo;</dt>
  39121. <dd><p>Set threshold to detect frames as similar. The option value must be an integer
  39122. greater than zero. The default value is 116.
  39123. </p>
  39124. </dd>
  39125. <dt>&lsquo;<samp>th_di</samp>&rsquo;</dt>
  39126. <dd><p>Set the minimum length of a sequence in frames to recognize it as matching
  39127. sequence. The option value must be a non negative integer value.
  39128. The default value is 0.
  39129. </p>
  39130. </dd>
  39131. <dt>&lsquo;<samp>th_it</samp>&rsquo;</dt>
  39132. <dd><p>Set the minimum relation, that matching frames to all frames must have.
  39133. The option value must be a double value between 0 and 1. The default value is 0.5.
  39134. </p></dd>
  39135. </dl>
  39136. <a name="Examples-118"></a>
  39137. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-118">39.192.1 Examples</a></h3>
  39138. <ul>
  39139. <li>
  39140. To calculate the signature of an input video and store it in signature.bin:
  39141. <div class="example">
  39142. <pre class="example">ffmpeg -i input.mkv -vf signature=filename=signature.bin -map 0:v -f null -
  39143. </pre></div>
  39144. </li><li>
  39145. To detect whether two videos match and store the signatures in XML format in
  39146. signature0.xml and signature1.xml:
  39147. <div class="example">
  39148. <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 -
  39149. </pre></div>
  39150. </li></ul>
  39151. <p><a name="smartblur"></a>
  39152. </p><a name="smartblur-1"></a>
  39153. <h2 class="section"><a href="ffmpeg-all.html#toc-smartblur-1">39.193 smartblur</a></h2>
  39154. <p>Blur the input video without impacting the outlines.
  39155. </p>
  39156. <p>It accepts the following options:
  39157. </p>
  39158. <dl compact="compact">
  39159. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  39160. <dd><p>Set the luma radius. The option value must be a float number in
  39161. the range [0.1,5.0] that specifies the variance of the gaussian filter
  39162. used to blur the image (slower if larger). Default value is 1.0.
  39163. </p>
  39164. </dd>
  39165. <dt>&lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
  39166. <dd><p>Set the luma strength. The option value must be a float number
  39167. in the range [-1.0,1.0] that configures the blurring. A value included
  39168. in [0.0,1.0] will blur the image whereas a value included in
  39169. [-1.0,0.0] will sharpen the image. Default value is 1.0.
  39170. </p>
  39171. </dd>
  39172. <dt>&lsquo;<samp>luma_threshold, lt</samp>&rsquo;</dt>
  39173. <dd><p>Set the luma threshold used as a coefficient to determine
  39174. whether a pixel should be blurred or not. The option value must be an
  39175. integer in the range [-30,30]. A value of 0 will filter all the image,
  39176. a value included in [0,30] will filter flat areas and a value included
  39177. in [-30,0] will filter edges. Default value is 0.
  39178. </p>
  39179. </dd>
  39180. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  39181. <dd><p>Set the chroma radius. The option value must be a float number in
  39182. the range [0.1,5.0] that specifies the variance of the gaussian filter
  39183. used to blur the image (slower if larger). Default value is &lsquo;<samp>luma_radius</samp>&rsquo;.
  39184. </p>
  39185. </dd>
  39186. <dt>&lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
  39187. <dd><p>Set the chroma strength. The option value must be a float number
  39188. in the range [-1.0,1.0] that configures the blurring. A value included
  39189. in [0.0,1.0] will blur the image whereas a value included in
  39190. [-1.0,0.0] will sharpen the image. Default value is &lsquo;<samp>luma_strength</samp>&rsquo;.
  39191. </p>
  39192. </dd>
  39193. <dt>&lsquo;<samp>chroma_threshold, ct</samp>&rsquo;</dt>
  39194. <dd><p>Set the chroma threshold used as a coefficient to determine
  39195. whether a pixel should be blurred or not. The option value must be an
  39196. integer in the range [-30,30]. A value of 0 will filter all the image,
  39197. a value included in [0,30] will filter flat areas and a value included
  39198. in [-30,0] will filter edges. Default value is &lsquo;<samp>luma_threshold</samp>&rsquo;.
  39199. </p></dd>
  39200. </dl>
  39201. <p>If a chroma option is not explicitly set, the corresponding luma value
  39202. is set.
  39203. </p>
  39204. <a name="sobel"></a>
  39205. <h2 class="section"><a href="ffmpeg-all.html#toc-sobel">39.194 sobel</a></h2>
  39206. <p>Apply sobel operator to input video stream.
  39207. </p>
  39208. <p>The filter accepts the following option:
  39209. </p>
  39210. <dl compact="compact">
  39211. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  39212. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  39213. By default value 0xf, all planes will be processed.
  39214. </p>
  39215. </dd>
  39216. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  39217. <dd><p>Set value which will be multiplied with filtered result.
  39218. </p>
  39219. </dd>
  39220. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  39221. <dd><p>Set value which will be added to filtered result.
  39222. </p></dd>
  39223. </dl>
  39224. <p><a name="spp"></a>
  39225. </p><a name="spp-1"></a>
  39226. <h2 class="section"><a href="ffmpeg-all.html#toc-spp-1">39.195 spp</a></h2>
  39227. <p>Apply a simple postprocessing filter that compresses and decompresses the image
  39228. at several (or - in the case of &lsquo;<samp>quality</samp>&rsquo; level <code>6</code> - all) shifts
  39229. and average the results.
  39230. </p>
  39231. <p>The filter accepts the following options:
  39232. </p>
  39233. <dl compact="compact">
  39234. <dt>&lsquo;<samp>quality</samp>&rsquo;</dt>
  39235. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  39236. an integer in the range 0-6. If set to <code>0</code>, the filter will have no
  39237. effect. A value of <code>6</code> means the higher quality. For each increment of
  39238. that value the speed drops by a factor of approximately 2. Default value is
  39239. <code>3</code>.
  39240. </p>
  39241. </dd>
  39242. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  39243. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  39244. from the video stream (if available).
  39245. </p>
  39246. </dd>
  39247. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  39248. <dd><p>Set thresholding mode. Available modes are:
  39249. </p>
  39250. <dl compact="compact">
  39251. <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
  39252. <dd><p>Set hard thresholding (default).
  39253. </p></dd>
  39254. <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
  39255. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  39256. </p></dd>
  39257. </dl>
  39258. </dd>
  39259. <dt>&lsquo;<samp>use_bframe_qp</samp>&rsquo;</dt>
  39260. <dd><p>Enable the use of the QP from the B-Frames if set to <code>1</code>. Using this
  39261. option may cause flicker since the B-Frames have often larger QP. Default is
  39262. <code>0</code> (not enabled).
  39263. </p></dd>
  39264. </dl>
  39265. <a name="Commands-48"></a>
  39266. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-48">39.195.1 Commands</a></h3>
  39267. <p>This filter supports the following commands:
  39268. </p><dl compact="compact">
  39269. <dt>&lsquo;<samp>quality, level</samp>&rsquo;</dt>
  39270. <dd><p>Set quality level. The value <code>max</code> can be used to set the maximum level,
  39271. currently <code>6</code>.
  39272. </p></dd>
  39273. </dl>
  39274. <p><a name="sr"></a>
  39275. </p><a name="sr-1"></a>
  39276. <h2 class="section"><a href="ffmpeg-all.html#toc-sr-1">39.196 sr</a></h2>
  39277. <p>Scale the input by applying one of the super-resolution methods based on
  39278. convolutional neural networks. Supported models:
  39279. </p>
  39280. <ul>
  39281. <li>
  39282. Super-Resolution Convolutional Neural Network model (SRCNN).
  39283. See <a href="https://arxiv.org/abs/1501.00092">https://arxiv.org/abs/1501.00092</a>.
  39284. </li><li>
  39285. Efficient Sub-Pixel Convolutional Neural Network model (ESPCN).
  39286. See <a href="https://arxiv.org/abs/1609.05158">https://arxiv.org/abs/1609.05158</a>.
  39287. </li></ul>
  39288. <p>Training scripts as well as scripts for model file (.pb) saving can be found at
  39289. <a href="https://github.com/XueweiMeng/sr/tree/sr_dnn_native">https://github.com/XueweiMeng/sr/tree/sr_dnn_native</a>. Original repository
  39290. is at <a href="https://github.com/HighVoltageRocknRoll/sr.git">https://github.com/HighVoltageRocknRoll/sr.git</a>.
  39291. </p>
  39292. <p>Native model files (.model) can be generated from TensorFlow model
  39293. files (.pb) by using tools/python/convert.py
  39294. </p>
  39295. <p>The filter accepts the following options:
  39296. </p>
  39297. <dl compact="compact">
  39298. <dt>&lsquo;<samp>dnn_backend</samp>&rsquo;</dt>
  39299. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  39300. the following values:
  39301. </p>
  39302. <dl compact="compact">
  39303. <dt>&lsquo;<samp>native</samp>&rsquo;</dt>
  39304. <dd><p>Native implementation of DNN loading and execution.
  39305. </p>
  39306. </dd>
  39307. <dt>&lsquo;<samp>tensorflow</samp>&rsquo;</dt>
  39308. <dd><p>TensorFlow backend. To enable this backend you
  39309. need to install the TensorFlow for C library (see
  39310. <a href="https://www.tensorflow.org/install/install_c">https://www.tensorflow.org/install/install_c</a>) and configure FFmpeg with
  39311. <code>--enable-libtensorflow</code>
  39312. </p></dd>
  39313. </dl>
  39314. <p>Default value is &lsquo;<samp>native</samp>&rsquo;.
  39315. </p>
  39316. </dd>
  39317. <dt>&lsquo;<samp>model</samp>&rsquo;</dt>
  39318. <dd><p>Set path to model file specifying network architecture and its parameters.
  39319. Note that different backends use different file formats. TensorFlow backend
  39320. can load files for both formats, while native backend can load files for only
  39321. its format.
  39322. </p>
  39323. </dd>
  39324. <dt>&lsquo;<samp>scale_factor</samp>&rsquo;</dt>
  39325. <dd><p>Set scale factor for SRCNN model. Allowed values are <code>2</code>, <code>3</code> and <code>4</code>.
  39326. Default value is <code>2</code>. Scale factor is necessary for SRCNN model, because it accepts
  39327. input upscaled using bicubic upscaling with proper scale factor.
  39328. </p></dd>
  39329. </dl>
  39330. <p>This feature can also be finished with <a href="#dnn_005fprocessing">dnn_processing</a> filter.
  39331. </p>
  39332. <a name="ssim"></a>
  39333. <h2 class="section"><a href="ffmpeg-all.html#toc-ssim">39.197 ssim</a></h2>
  39334. <p>Obtain the SSIM (Structural SImilarity Metric) between two input videos.
  39335. </p>
  39336. <p>This filter takes in input two input videos, the first input is
  39337. considered the &quot;main&quot; source and is passed unchanged to the
  39338. output. The second input is used as a &quot;reference&quot; video for computing
  39339. the SSIM.
  39340. </p>
  39341. <p>Both video inputs must have the same resolution and pixel format for
  39342. this filter to work correctly. Also it assumes that both inputs
  39343. have the same number of frames, which are compared one by one.
  39344. </p>
  39345. <p>The filter stores the calculated SSIM of each frame.
  39346. </p>
  39347. <p>The description of the accepted parameters follows.
  39348. </p>
  39349. <dl compact="compact">
  39350. <dt>&lsquo;<samp>stats_file, f</samp>&rsquo;</dt>
  39351. <dd><p>If specified the filter will use the named file to save the SSIM of
  39352. each individual frame. When filename equals &quot;-&quot; the data is sent to
  39353. standard output.
  39354. </p></dd>
  39355. </dl>
  39356. <p>The file printed if <var>stats_file</var> is selected, contains a sequence of
  39357. key/value pairs of the form <var>key</var>:<var>value</var> for each compared
  39358. couple of frames.
  39359. </p>
  39360. <p>A description of each shown parameter follows:
  39361. </p>
  39362. <dl compact="compact">
  39363. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  39364. <dd><p>sequential number of the input frame, starting from 1
  39365. </p>
  39366. </dd>
  39367. <dt>&lsquo;<samp>Y, U, V, R, G, B</samp>&rsquo;</dt>
  39368. <dd><p>SSIM of the compared frames for the component specified by the suffix.
  39369. </p>
  39370. </dd>
  39371. <dt>&lsquo;<samp>All</samp>&rsquo;</dt>
  39372. <dd><p>SSIM of the compared frames for the whole frame.
  39373. </p>
  39374. </dd>
  39375. <dt>&lsquo;<samp>dB</samp>&rsquo;</dt>
  39376. <dd><p>Same as above but in dB representation.
  39377. </p></dd>
  39378. </dl>
  39379. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  39380. </p>
  39381. <a name="Examples-165"></a>
  39382. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-165">39.197.1 Examples</a></h3>
  39383. <ul>
  39384. <li>
  39385. For example:
  39386. <div class="example">
  39387. <pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  39388. [main][ref] ssim=&quot;stats_file=stats.log&quot; [out]
  39389. </pre></div>
  39390. <p>On this example the input file being processed is compared with the
  39391. reference file &lsquo;<tt>ref_movie.mpg</tt>&rsquo;. The SSIM of each individual frame
  39392. is stored in &lsquo;<tt>stats.log</tt>&rsquo;.
  39393. </p>
  39394. </li><li>
  39395. Another example with both psnr and ssim at same time:
  39396. <div class="example">
  39397. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi &quot;ssim;[0:v][1:v]psnr&quot; -f null -
  39398. </pre></div>
  39399. </li><li>
  39400. Another example with different containers:
  39401. <div class="example">
  39402. <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 -
  39403. </pre></div>
  39404. </li></ul>
  39405. <a name="stereo3d"></a>
  39406. <h2 class="section"><a href="ffmpeg-all.html#toc-stereo3d">39.198 stereo3d</a></h2>
  39407. <p>Convert between different stereoscopic image formats.
  39408. </p>
  39409. <p>The filters accept the following options:
  39410. </p>
  39411. <dl compact="compact">
  39412. <dt>&lsquo;<samp>in</samp>&rsquo;</dt>
  39413. <dd><p>Set stereoscopic image format of input.
  39414. </p>
  39415. <p>Available values for input image formats are:
  39416. </p><dl compact="compact">
  39417. <dt>&lsquo;<samp>sbsl</samp>&rsquo;</dt>
  39418. <dd><p>side by side parallel (left eye left, right eye right)
  39419. </p>
  39420. </dd>
  39421. <dt>&lsquo;<samp>sbsr</samp>&rsquo;</dt>
  39422. <dd><p>side by side crosseye (right eye left, left eye right)
  39423. </p>
  39424. </dd>
  39425. <dt>&lsquo;<samp>sbs2l</samp>&rsquo;</dt>
  39426. <dd><p>side by side parallel with half width resolution
  39427. (left eye left, right eye right)
  39428. </p>
  39429. </dd>
  39430. <dt>&lsquo;<samp>sbs2r</samp>&rsquo;</dt>
  39431. <dd><p>side by side crosseye with half width resolution
  39432. (right eye left, left eye right)
  39433. </p>
  39434. </dd>
  39435. <dt>&lsquo;<samp>abl</samp>&rsquo;</dt>
  39436. <dt>&lsquo;<samp>tbl</samp>&rsquo;</dt>
  39437. <dd><p>above-below (left eye above, right eye below)
  39438. </p>
  39439. </dd>
  39440. <dt>&lsquo;<samp>abr</samp>&rsquo;</dt>
  39441. <dt>&lsquo;<samp>tbr</samp>&rsquo;</dt>
  39442. <dd><p>above-below (right eye above, left eye below)
  39443. </p>
  39444. </dd>
  39445. <dt>&lsquo;<samp>ab2l</samp>&rsquo;</dt>
  39446. <dt>&lsquo;<samp>tb2l</samp>&rsquo;</dt>
  39447. <dd><p>above-below with half height resolution
  39448. (left eye above, right eye below)
  39449. </p>
  39450. </dd>
  39451. <dt>&lsquo;<samp>ab2r</samp>&rsquo;</dt>
  39452. <dt>&lsquo;<samp>tb2r</samp>&rsquo;</dt>
  39453. <dd><p>above-below with half height resolution
  39454. (right eye above, left eye below)
  39455. </p>
  39456. </dd>
  39457. <dt>&lsquo;<samp>al</samp>&rsquo;</dt>
  39458. <dd><p>alternating frames (left eye first, right eye second)
  39459. </p>
  39460. </dd>
  39461. <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
  39462. <dd><p>alternating frames (right eye first, left eye second)
  39463. </p>
  39464. </dd>
  39465. <dt>&lsquo;<samp>irl</samp>&rsquo;</dt>
  39466. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  39467. </p>
  39468. </dd>
  39469. <dt>&lsquo;<samp>irr</samp>&rsquo;</dt>
  39470. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  39471. </p>
  39472. </dd>
  39473. <dt>&lsquo;<samp>icl</samp>&rsquo;</dt>
  39474. <dd><p>interleaved columns, left eye first
  39475. </p>
  39476. </dd>
  39477. <dt>&lsquo;<samp>icr</samp>&rsquo;</dt>
  39478. <dd><p>interleaved columns, right eye first
  39479. </p>
  39480. <p>Default value is &lsquo;<samp>sbsl</samp>&rsquo;.
  39481. </p></dd>
  39482. </dl>
  39483. </dd>
  39484. <dt>&lsquo;<samp>out</samp>&rsquo;</dt>
  39485. <dd><p>Set stereoscopic image format of output.
  39486. </p>
  39487. <dl compact="compact">
  39488. <dt>&lsquo;<samp>sbsl</samp>&rsquo;</dt>
  39489. <dd><p>side by side parallel (left eye left, right eye right)
  39490. </p>
  39491. </dd>
  39492. <dt>&lsquo;<samp>sbsr</samp>&rsquo;</dt>
  39493. <dd><p>side by side crosseye (right eye left, left eye right)
  39494. </p>
  39495. </dd>
  39496. <dt>&lsquo;<samp>sbs2l</samp>&rsquo;</dt>
  39497. <dd><p>side by side parallel with half width resolution
  39498. (left eye left, right eye right)
  39499. </p>
  39500. </dd>
  39501. <dt>&lsquo;<samp>sbs2r</samp>&rsquo;</dt>
  39502. <dd><p>side by side crosseye with half width resolution
  39503. (right eye left, left eye right)
  39504. </p>
  39505. </dd>
  39506. <dt>&lsquo;<samp>abl</samp>&rsquo;</dt>
  39507. <dt>&lsquo;<samp>tbl</samp>&rsquo;</dt>
  39508. <dd><p>above-below (left eye above, right eye below)
  39509. </p>
  39510. </dd>
  39511. <dt>&lsquo;<samp>abr</samp>&rsquo;</dt>
  39512. <dt>&lsquo;<samp>tbr</samp>&rsquo;</dt>
  39513. <dd><p>above-below (right eye above, left eye below)
  39514. </p>
  39515. </dd>
  39516. <dt>&lsquo;<samp>ab2l</samp>&rsquo;</dt>
  39517. <dt>&lsquo;<samp>tb2l</samp>&rsquo;</dt>
  39518. <dd><p>above-below with half height resolution
  39519. (left eye above, right eye below)
  39520. </p>
  39521. </dd>
  39522. <dt>&lsquo;<samp>ab2r</samp>&rsquo;</dt>
  39523. <dt>&lsquo;<samp>tb2r</samp>&rsquo;</dt>
  39524. <dd><p>above-below with half height resolution
  39525. (right eye above, left eye below)
  39526. </p>
  39527. </dd>
  39528. <dt>&lsquo;<samp>al</samp>&rsquo;</dt>
  39529. <dd><p>alternating frames (left eye first, right eye second)
  39530. </p>
  39531. </dd>
  39532. <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
  39533. <dd><p>alternating frames (right eye first, left eye second)
  39534. </p>
  39535. </dd>
  39536. <dt>&lsquo;<samp>irl</samp>&rsquo;</dt>
  39537. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  39538. </p>
  39539. </dd>
  39540. <dt>&lsquo;<samp>irr</samp>&rsquo;</dt>
  39541. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  39542. </p>
  39543. </dd>
  39544. <dt>&lsquo;<samp>arbg</samp>&rsquo;</dt>
  39545. <dd><p>anaglyph red/blue gray
  39546. (red filter on left eye, blue filter on right eye)
  39547. </p>
  39548. </dd>
  39549. <dt>&lsquo;<samp>argg</samp>&rsquo;</dt>
  39550. <dd><p>anaglyph red/green gray
  39551. (red filter on left eye, green filter on right eye)
  39552. </p>
  39553. </dd>
  39554. <dt>&lsquo;<samp>arcg</samp>&rsquo;</dt>
  39555. <dd><p>anaglyph red/cyan gray
  39556. (red filter on left eye, cyan filter on right eye)
  39557. </p>
  39558. </dd>
  39559. <dt>&lsquo;<samp>arch</samp>&rsquo;</dt>
  39560. <dd><p>anaglyph red/cyan half colored
  39561. (red filter on left eye, cyan filter on right eye)
  39562. </p>
  39563. </dd>
  39564. <dt>&lsquo;<samp>arcc</samp>&rsquo;</dt>
  39565. <dd><p>anaglyph red/cyan color
  39566. (red filter on left eye, cyan filter on right eye)
  39567. </p>
  39568. </dd>
  39569. <dt>&lsquo;<samp>arcd</samp>&rsquo;</dt>
  39570. <dd><p>anaglyph red/cyan color optimized with the least squares projection of dubois
  39571. (red filter on left eye, cyan filter on right eye)
  39572. </p>
  39573. </dd>
  39574. <dt>&lsquo;<samp>agmg</samp>&rsquo;</dt>
  39575. <dd><p>anaglyph green/magenta gray
  39576. (green filter on left eye, magenta filter on right eye)
  39577. </p>
  39578. </dd>
  39579. <dt>&lsquo;<samp>agmh</samp>&rsquo;</dt>
  39580. <dd><p>anaglyph green/magenta half colored
  39581. (green filter on left eye, magenta filter on right eye)
  39582. </p>
  39583. </dd>
  39584. <dt>&lsquo;<samp>agmc</samp>&rsquo;</dt>
  39585. <dd><p>anaglyph green/magenta colored
  39586. (green filter on left eye, magenta filter on right eye)
  39587. </p>
  39588. </dd>
  39589. <dt>&lsquo;<samp>agmd</samp>&rsquo;</dt>
  39590. <dd><p>anaglyph green/magenta color optimized with the least squares projection of dubois
  39591. (green filter on left eye, magenta filter on right eye)
  39592. </p>
  39593. </dd>
  39594. <dt>&lsquo;<samp>aybg</samp>&rsquo;</dt>
  39595. <dd><p>anaglyph yellow/blue gray
  39596. (yellow filter on left eye, blue filter on right eye)
  39597. </p>
  39598. </dd>
  39599. <dt>&lsquo;<samp>aybh</samp>&rsquo;</dt>
  39600. <dd><p>anaglyph yellow/blue half colored
  39601. (yellow filter on left eye, blue filter on right eye)
  39602. </p>
  39603. </dd>
  39604. <dt>&lsquo;<samp>aybc</samp>&rsquo;</dt>
  39605. <dd><p>anaglyph yellow/blue colored
  39606. (yellow filter on left eye, blue filter on right eye)
  39607. </p>
  39608. </dd>
  39609. <dt>&lsquo;<samp>aybd</samp>&rsquo;</dt>
  39610. <dd><p>anaglyph yellow/blue color optimized with the least squares projection of dubois
  39611. (yellow filter on left eye, blue filter on right eye)
  39612. </p>
  39613. </dd>
  39614. <dt>&lsquo;<samp>ml</samp>&rsquo;</dt>
  39615. <dd><p>mono output (left eye only)
  39616. </p>
  39617. </dd>
  39618. <dt>&lsquo;<samp>mr</samp>&rsquo;</dt>
  39619. <dd><p>mono output (right eye only)
  39620. </p>
  39621. </dd>
  39622. <dt>&lsquo;<samp>chl</samp>&rsquo;</dt>
  39623. <dd><p>checkerboard, left eye first
  39624. </p>
  39625. </dd>
  39626. <dt>&lsquo;<samp>chr</samp>&rsquo;</dt>
  39627. <dd><p>checkerboard, right eye first
  39628. </p>
  39629. </dd>
  39630. <dt>&lsquo;<samp>icl</samp>&rsquo;</dt>
  39631. <dd><p>interleaved columns, left eye first
  39632. </p>
  39633. </dd>
  39634. <dt>&lsquo;<samp>icr</samp>&rsquo;</dt>
  39635. <dd><p>interleaved columns, right eye first
  39636. </p>
  39637. </dd>
  39638. <dt>&lsquo;<samp>hdmi</samp>&rsquo;</dt>
  39639. <dd><p>HDMI frame pack
  39640. </p></dd>
  39641. </dl>
  39642. <p>Default value is &lsquo;<samp>arcd</samp>&rsquo;.
  39643. </p></dd>
  39644. </dl>
  39645. <a name="Examples-174"></a>
  39646. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-174">39.198.1 Examples</a></h3>
  39647. <ul>
  39648. <li>
  39649. Convert input video from side by side parallel to anaglyph yellow/blue dubois:
  39650. <div class="example">
  39651. <pre class="example">stereo3d=sbsl:aybd
  39652. </pre></div>
  39653. </li><li>
  39654. Convert input video from above below (left eye above, right eye below) to side by side crosseye.
  39655. <div class="example">
  39656. <pre class="example">stereo3d=abl:sbsr
  39657. </pre></div>
  39658. </li></ul>
  39659. <a name="streamselect_002c-astreamselect"></a>
  39660. <h2 class="section"><a href="ffmpeg-all.html#toc-streamselect_002c-astreamselect">39.199 streamselect, astreamselect</a></h2>
  39661. <p>Select video or audio streams.
  39662. </p>
  39663. <p>The filter accepts the following options:
  39664. </p>
  39665. <dl compact="compact">
  39666. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  39667. <dd><p>Set number of inputs. Default is 2.
  39668. </p>
  39669. </dd>
  39670. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  39671. <dd><p>Set input indexes to remap to outputs.
  39672. </p></dd>
  39673. </dl>
  39674. <a name="Commands"></a>
  39675. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands">39.199.1 Commands</a></h3>
  39676. <p>The <code>streamselect</code> and <code>astreamselect</code> filter supports the following
  39677. commands:
  39678. </p>
  39679. <dl compact="compact">
  39680. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  39681. <dd><p>Set input indexes to remap to outputs.
  39682. </p></dd>
  39683. </dl>
  39684. <a name="Examples-106"></a>
  39685. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-106">39.199.2 Examples</a></h3>
  39686. <ul>
  39687. <li>
  39688. Select first 5 seconds 1st stream and rest of time 2nd stream:
  39689. <div class="example">
  39690. <pre class="example">sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
  39691. </pre></div>
  39692. </li><li>
  39693. Same as above, but for audio:
  39694. <div class="example">
  39695. <pre class="example">asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
  39696. </pre></div>
  39697. </li></ul>
  39698. <p><a name="subtitles"></a>
  39699. </p><a name="subtitles-1"></a>
  39700. <h2 class="section"><a href="ffmpeg-all.html#toc-subtitles-1">39.200 subtitles</a></h2>
  39701. <p>Draw subtitles on top of input video using the libass library.
  39702. </p>
  39703. <p>To enable compilation of this filter you need to configure FFmpeg with
  39704. <code>--enable-libass</code>. This filter also requires a build with libavcodec and
  39705. libavformat to convert the passed subtitles file to ASS (Advanced Substation
  39706. Alpha) subtitles format.
  39707. </p>
  39708. <p>The filter accepts the following options:
  39709. </p>
  39710. <dl compact="compact">
  39711. <dt>&lsquo;<samp>filename, f</samp>&rsquo;</dt>
  39712. <dd><p>Set the filename of the subtitle file to read. It must be specified.
  39713. </p>
  39714. </dd>
  39715. <dt>&lsquo;<samp>original_size</samp>&rsquo;</dt>
  39716. <dd><p>Specify the size of the original video, the video for which the ASS file
  39717. was composed. For the syntax of this option, check the
  39718. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  39719. Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to
  39720. correctly scale the fonts if the aspect ratio has been changed.
  39721. </p>
  39722. </dd>
  39723. <dt>&lsquo;<samp>fontsdir</samp>&rsquo;</dt>
  39724. <dd><p>Set a directory path containing fonts that can be used by the filter.
  39725. These fonts will be used in addition to whatever the font provider uses.
  39726. </p>
  39727. </dd>
  39728. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  39729. <dd><p>Process alpha channel, by default alpha channel is untouched.
  39730. </p>
  39731. </dd>
  39732. <dt>&lsquo;<samp>charenc</samp>&rsquo;</dt>
  39733. <dd><p>Set subtitles input character encoding. <code>subtitles</code> filter only. Only
  39734. useful if not UTF-8.
  39735. </p>
  39736. </dd>
  39737. <dt>&lsquo;<samp>stream_index, si</samp>&rsquo;</dt>
  39738. <dd><p>Set subtitles stream index. <code>subtitles</code> filter only.
  39739. </p>
  39740. </dd>
  39741. <dt>&lsquo;<samp>force_style</samp>&rsquo;</dt>
  39742. <dd><p>Override default style or script info parameters of the subtitles. It accepts a
  39743. string containing ASS style format <code>KEY=VALUE</code> couples separated by &quot;,&quot;.
  39744. </p></dd>
  39745. </dl>
  39746. <p>If the first key is not specified, it is assumed that the first value
  39747. specifies the &lsquo;<samp>filename</samp>&rsquo;.
  39748. </p>
  39749. <p>For example, to render the file &lsquo;<tt>sub.srt</tt>&rsquo; on top of the input
  39750. video, use the command:
  39751. </p><div class="example">
  39752. <pre class="example">subtitles=sub.srt
  39753. </pre></div>
  39754. <p>which is equivalent to:
  39755. </p><div class="example">
  39756. <pre class="example">subtitles=filename=sub.srt
  39757. </pre></div>
  39758. <p>To render the default subtitles stream from file &lsquo;<tt>video.mkv</tt>&rsquo;, use:
  39759. </p><div class="example">
  39760. <pre class="example">subtitles=video.mkv
  39761. </pre></div>
  39762. <p>To render the second subtitles stream from that file, use:
  39763. </p><div class="example">
  39764. <pre class="example">subtitles=video.mkv:si=1
  39765. </pre></div>
  39766. <p>To make the subtitles stream from &lsquo;<tt>sub.srt</tt>&rsquo; appear in 80% transparent blue
  39767. <code>DejaVu Serif</code>, use:
  39768. </p><div class="example">
  39769. <pre class="example">subtitles=sub.srt:force_style='FontName=DejaVu Serif,PrimaryColour=&amp;HCCFF0000'
  39770. </pre></div>
  39771. <a name="super2xsai"></a>
  39772. <h2 class="section"><a href="ffmpeg-all.html#toc-super2xsai">39.201 super2xsai</a></h2>
  39773. <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
  39774. Interpolate) pixel art scaling algorithm.
  39775. </p>
  39776. <p>Useful for enlarging pixel art images without reducing sharpness.
  39777. </p>
  39778. <a name="swaprect"></a>
  39779. <h2 class="section"><a href="ffmpeg-all.html#toc-swaprect">39.202 swaprect</a></h2>
  39780. <p>Swap two rectangular objects in video.
  39781. </p>
  39782. <p>This filter accepts the following options:
  39783. </p>
  39784. <dl compact="compact">
  39785. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  39786. <dd><p>Set object width.
  39787. </p>
  39788. </dd>
  39789. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  39790. <dd><p>Set object height.
  39791. </p>
  39792. </dd>
  39793. <dt>&lsquo;<samp>x1</samp>&rsquo;</dt>
  39794. <dd><p>Set 1st rect x coordinate.
  39795. </p>
  39796. </dd>
  39797. <dt>&lsquo;<samp>y1</samp>&rsquo;</dt>
  39798. <dd><p>Set 1st rect y coordinate.
  39799. </p>
  39800. </dd>
  39801. <dt>&lsquo;<samp>x2</samp>&rsquo;</dt>
  39802. <dd><p>Set 2nd rect x coordinate.
  39803. </p>
  39804. </dd>
  39805. <dt>&lsquo;<samp>y2</samp>&rsquo;</dt>
  39806. <dd><p>Set 2nd rect y coordinate.
  39807. </p>
  39808. <p>All expressions are evaluated once for each frame.
  39809. </p></dd>
  39810. </dl>
  39811. <p>The all options are expressions containing the following constants:
  39812. </p>
  39813. <dl compact="compact">
  39814. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  39815. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  39816. <dd><p>The input width and height.
  39817. </p>
  39818. </dd>
  39819. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  39820. <dd><p>same as <var>w</var> / <var>h</var>
  39821. </p>
  39822. </dd>
  39823. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  39824. <dd><p>input sample aspect ratio
  39825. </p>
  39826. </dd>
  39827. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  39828. <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
  39829. </p>
  39830. </dd>
  39831. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  39832. <dd><p>The number of the input frame, starting from 0.
  39833. </p>
  39834. </dd>
  39835. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  39836. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  39837. </p>
  39838. </dd>
  39839. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  39840. <dd><p>the position in the file of the input frame, NAN if unknown
  39841. </p></dd>
  39842. </dl>
  39843. <a name="swapuv"></a>
  39844. <h2 class="section"><a href="ffmpeg-all.html#toc-swapuv">39.203 swapuv</a></h2>
  39845. <p>Swap U &amp; V plane.
  39846. </p>
  39847. <a name="tblend"></a>
  39848. <h2 class="section"><a href="ffmpeg-all.html#toc-tblend">39.204 tblend</a></h2>
  39849. <p>Blend successive video frames.
  39850. </p>
  39851. <p>See <a href="#blend">blend</a>
  39852. </p>
  39853. <a name="telecine"></a>
  39854. <h2 class="section"><a href="ffmpeg-all.html#toc-telecine">39.205 telecine</a></h2>
  39855. <p>Apply telecine process to the video.
  39856. </p>
  39857. <p>This filter accepts the following options:
  39858. </p>
  39859. <dl compact="compact">
  39860. <dt>&lsquo;<samp>first_field</samp>&rsquo;</dt>
  39861. <dd><dl compact="compact">
  39862. <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
  39863. <dd><p>top field first
  39864. </p></dd>
  39865. <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
  39866. <dd><p>bottom field first
  39867. The default value is <code>top</code>.
  39868. </p></dd>
  39869. </dl>
  39870. </dd>
  39871. <dt>&lsquo;<samp>pattern</samp>&rsquo;</dt>
  39872. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  39873. The default value is <code>23</code>.
  39874. </p></dd>
  39875. </dl>
  39876. <div class="example">
  39877. <pre class="example">Some typical patterns:
  39878. NTSC output (30i):
  39879. 27.5p: 32222
  39880. 24p: 23 (classic)
  39881. 24p: 2332 (preferred)
  39882. 20p: 33
  39883. 18p: 334
  39884. 16p: 3444
  39885. PAL output (25i):
  39886. 27.5p: 12222
  39887. 24p: 222222222223 (&quot;Euro pulldown&quot;)
  39888. 16.67p: 33
  39889. 16p: 33333334
  39890. </pre></div>
  39891. <a name="thistogram"></a>
  39892. <h2 class="section"><a href="ffmpeg-all.html#toc-thistogram">39.206 thistogram</a></h2>
  39893. <p>Compute and draw a color distribution histogram for the input video across time.
  39894. </p>
  39895. <p>Unlike <a href="#histogram">histogram</a> video filter which only shows histogram of single input frame
  39896. at certain time, this filter shows also past histograms of number of frames defined
  39897. by <code>width</code> option.
  39898. </p>
  39899. <p>The computed histogram is a representation of the color component
  39900. distribution in an image.
  39901. </p>
  39902. <p>The filter accepts the following options:
  39903. </p>
  39904. <dl compact="compact">
  39905. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  39906. <dd><p>Set width of single color component output. Default value is <code>0</code>.
  39907. Value of <code>0</code> means width will be picked from input video.
  39908. This also set number of passed histograms to keep.
  39909. Allowed range is [0, 8192].
  39910. </p>
  39911. </dd>
  39912. <dt>&lsquo;<samp>display_mode, d</samp>&rsquo;</dt>
  39913. <dd><p>Set display mode.
  39914. It accepts the following values:
  39915. </p><dl compact="compact">
  39916. <dt>&lsquo;<samp>stack</samp>&rsquo;</dt>
  39917. <dd><p>Per color component graphs are placed below each other.
  39918. </p>
  39919. </dd>
  39920. <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
  39921. <dd><p>Per color component graphs are placed side by side.
  39922. </p>
  39923. </dd>
  39924. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  39925. <dd><p>Presents information identical to that in the <code>parade</code>, except
  39926. that the graphs representing color components are superimposed directly
  39927. over one another.
  39928. </p></dd>
  39929. </dl>
  39930. <p>Default is <code>stack</code>.
  39931. </p>
  39932. </dd>
  39933. <dt>&lsquo;<samp>levels_mode, m</samp>&rsquo;</dt>
  39934. <dd><p>Set mode. Can be either <code>linear</code>, or <code>logarithmic</code>.
  39935. Default is <code>linear</code>.
  39936. </p>
  39937. </dd>
  39938. <dt>&lsquo;<samp>components, c</samp>&rsquo;</dt>
  39939. <dd><p>Set what color components to display.
  39940. Default is <code>7</code>.
  39941. </p>
  39942. </dd>
  39943. <dt>&lsquo;<samp>bgopacity, b</samp>&rsquo;</dt>
  39944. <dd><p>Set background opacity. Default is <code>0.9</code>.
  39945. </p>
  39946. </dd>
  39947. <dt>&lsquo;<samp>envelope, e</samp>&rsquo;</dt>
  39948. <dd><p>Show envelope. Default is disabled.
  39949. </p>
  39950. </dd>
  39951. <dt>&lsquo;<samp>ecolor, ec</samp>&rsquo;</dt>
  39952. <dd><p>Set envelope color. Default is <code>gold</code>.
  39953. </p></dd>
  39954. </dl>
  39955. <a name="threshold"></a>
  39956. <h2 class="section"><a href="ffmpeg-all.html#toc-threshold">39.207 threshold</a></h2>
  39957. <p>Apply threshold effect to video stream.
  39958. </p>
  39959. <p>This filter needs four video streams to perform thresholding.
  39960. First stream is stream we are filtering.
  39961. Second stream is holding threshold values, third stream is holding min values,
  39962. and last, fourth stream is holding max values.
  39963. </p>
  39964. <p>The filter accepts the following option:
  39965. </p>
  39966. <dl compact="compact">
  39967. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  39968. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  39969. By default value 0xf, all planes will be processed.
  39970. </p></dd>
  39971. </dl>
  39972. <p>For example if first stream pixel&rsquo;s component value is less then threshold value
  39973. of pixel component from 2nd threshold stream, third stream value will picked,
  39974. otherwise fourth stream pixel component value will be picked.
  39975. </p>
  39976. <p>Using color source filter one can perform various types of thresholding:
  39977. </p>
  39978. <a name="Examples-171"></a>
  39979. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-171">39.207.1 Examples</a></h3>
  39980. <ul>
  39981. <li>
  39982. Binary threshold, using gray color as threshold:
  39983. <div class="example">
  39984. <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
  39985. </pre></div>
  39986. </li><li>
  39987. Inverted binary threshold, using gray color as threshold:
  39988. <div class="example">
  39989. <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
  39990. </pre></div>
  39991. </li><li>
  39992. Truncate binary threshold, using gray color as threshold:
  39993. <div class="example">
  39994. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=gray -lavfi threshold output.avi
  39995. </pre></div>
  39996. </li><li>
  39997. Threshold to zero, using gray color as threshold:
  39998. <div class="example">
  39999. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -i 320x240.avi -lavfi threshold output.avi
  40000. </pre></div>
  40001. </li><li>
  40002. Inverted threshold to zero, using gray color as threshold:
  40003. <div class="example">
  40004. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=white -lavfi threshold output.avi
  40005. </pre></div>
  40006. </li></ul>
  40007. <a name="thumbnail"></a>
  40008. <h2 class="section"><a href="ffmpeg-all.html#toc-thumbnail">39.208 thumbnail</a></h2>
  40009. <p>Select the most representative frame in a given sequence of consecutive frames.
  40010. </p>
  40011. <p>The filter accepts the following options:
  40012. </p>
  40013. <dl compact="compact">
  40014. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  40015. <dd><p>Set the frames batch size to analyze; in a set of <var>n</var> frames, the filter
  40016. will pick one of them, and then handle the next batch of <var>n</var> frames until
  40017. the end. Default is <code>100</code>.
  40018. </p></dd>
  40019. </dl>
  40020. <p>Since the filter keeps track of the whole frames sequence, a bigger <var>n</var>
  40021. value will result in a higher memory usage, so a high value is not recommended.
  40022. </p>
  40023. <a name="Examples-154"></a>
  40024. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-154">39.208.1 Examples</a></h3>
  40025. <ul>
  40026. <li>
  40027. Extract one picture each 50 frames:
  40028. <div class="example">
  40029. <pre class="example">thumbnail=50
  40030. </pre></div>
  40031. </li><li>
  40032. Complete example of a thumbnail creation with <code>ffmpeg</code>:
  40033. <div class="example">
  40034. <pre class="example">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
  40035. </pre></div>
  40036. </li></ul>
  40037. <p><a name="tile"></a>
  40038. </p><a name="tile-1"></a>
  40039. <h2 class="section"><a href="ffmpeg-all.html#toc-tile-1">39.209 tile</a></h2>
  40040. <p>Tile several successive frames together.
  40041. </p>
  40042. <p>The <a href="#untile">untile</a> filter can do the reverse.
  40043. </p>
  40044. <p>The filter accepts the following options:
  40045. </p>
  40046. <dl compact="compact">
  40047. <dt>&lsquo;<samp>layout</samp>&rsquo;</dt>
  40048. <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
  40049. this option, check the
  40050. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  40051. </p>
  40052. </dd>
  40053. <dt>&lsquo;<samp>nb_frames</samp>&rsquo;</dt>
  40054. <dd><p>Set the maximum number of frames to render in the given area. It must be less
  40055. than or equal to <var>w</var>x<var>h</var>. The default value is <code>0</code>, meaning all
  40056. the area will be used.
  40057. </p>
  40058. </dd>
  40059. <dt>&lsquo;<samp>margin</samp>&rsquo;</dt>
  40060. <dd><p>Set the outer border margin in pixels.
  40061. </p>
  40062. </dd>
  40063. <dt>&lsquo;<samp>padding</samp>&rsquo;</dt>
  40064. <dd><p>Set the inner border thickness (i.e. the number of pixels between frames). For
  40065. more advanced padding options (such as having different values for the edges),
  40066. refer to the pad video filter.
  40067. </p>
  40068. </dd>
  40069. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  40070. <dd><p>Specify the color of the unused area. For the syntax of this option, check the
  40071. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  40072. The default value of <var>color</var> is &quot;black&quot;.
  40073. </p>
  40074. </dd>
  40075. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  40076. <dd><p>Set the number of frames to overlap when tiling several successive frames together.
  40077. The value must be between <code>0</code> and <var>nb_frames - 1</var>.
  40078. </p>
  40079. </dd>
  40080. <dt>&lsquo;<samp>init_padding</samp>&rsquo;</dt>
  40081. <dd><p>Set the number of frames to initially be empty before displaying first output frame.
  40082. This controls how soon will one get first output frame.
  40083. The value must be between <code>0</code> and <var>nb_frames - 1</var>.
  40084. </p></dd>
  40085. </dl>
  40086. <a name="Examples-27"></a>
  40087. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-27">39.209.1 Examples</a></h3>
  40088. <ul>
  40089. <li>
  40090. Produce 8x8 PNG tiles of all keyframes (&lsquo;<samp>-skip_frame nokey</samp>&rsquo;) in a movie:
  40091. <div class="example">
  40092. <pre class="example">ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
  40093. </pre></div>
  40094. <p>The &lsquo;<samp>-vsync 0</samp>&rsquo; is necessary to prevent <code>ffmpeg</code> from
  40095. duplicating each output frame to accommodate the originally detected frame
  40096. rate.
  40097. </p>
  40098. </li><li>
  40099. Display <code>5</code> pictures in an area of <code>3x2</code> frames,
  40100. with <code>7</code> pixels between them, and <code>2</code> pixels of initial margin, using
  40101. mixed flat and named options:
  40102. <div class="example">
  40103. <pre class="example">tile=3x2:nb_frames=5:padding=7:margin=2
  40104. </pre></div>
  40105. </li></ul>
  40106. <a name="tinterlace"></a>
  40107. <h2 class="section"><a href="ffmpeg-all.html#toc-tinterlace">39.210 tinterlace</a></h2>
  40108. <p>Perform various types of temporal field interlacing.
  40109. </p>
  40110. <p>Frames are counted starting from 1, so the first input frame is
  40111. considered odd.
  40112. </p>
  40113. <p>The filter accepts the following options:
  40114. </p>
  40115. <dl compact="compact">
  40116. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  40117. <dd><p>Specify the mode of the interlacing. This option can also be specified
  40118. as a value alone. See below for a list of values for this option.
  40119. </p>
  40120. <p>Available values are:
  40121. </p>
  40122. <dl compact="compact">
  40123. <dt>&lsquo;<samp>merge, 0</samp>&rsquo;</dt>
  40124. <dd><p>Move odd frames into the upper field, even into the lower field,
  40125. generating a double height frame at half frame rate.
  40126. </p><div class="example">
  40127. <pre class="example"> ------&gt; time
  40128. Input:
  40129. Frame 1 Frame 2 Frame 3 Frame 4
  40130. 11111 22222 33333 44444
  40131. 11111 22222 33333 44444
  40132. 11111 22222 33333 44444
  40133. 11111 22222 33333 44444
  40134. Output:
  40135. 11111 33333
  40136. 22222 44444
  40137. 11111 33333
  40138. 22222 44444
  40139. 11111 33333
  40140. 22222 44444
  40141. 11111 33333
  40142. 22222 44444
  40143. </pre></div>
  40144. </dd>
  40145. <dt>&lsquo;<samp>drop_even, 1</samp>&rsquo;</dt>
  40146. <dd><p>Only output odd frames, even frames are dropped, generating a frame with
  40147. unchanged height at half frame rate.
  40148. </p>
  40149. <div class="example">
  40150. <pre class="example"> ------&gt; time
  40151. Input:
  40152. Frame 1 Frame 2 Frame 3 Frame 4
  40153. 11111 22222 33333 44444
  40154. 11111 22222 33333 44444
  40155. 11111 22222 33333 44444
  40156. 11111 22222 33333 44444
  40157. Output:
  40158. 11111 33333
  40159. 11111 33333
  40160. 11111 33333
  40161. 11111 33333
  40162. </pre></div>
  40163. </dd>
  40164. <dt>&lsquo;<samp>drop_odd, 2</samp>&rsquo;</dt>
  40165. <dd><p>Only output even frames, odd frames are dropped, generating a frame with
  40166. unchanged height at half frame rate.
  40167. </p>
  40168. <div class="example">
  40169. <pre class="example"> ------&gt; time
  40170. Input:
  40171. Frame 1 Frame 2 Frame 3 Frame 4
  40172. 11111 22222 33333 44444
  40173. 11111 22222 33333 44444
  40174. 11111 22222 33333 44444
  40175. 11111 22222 33333 44444
  40176. Output:
  40177. 22222 44444
  40178. 22222 44444
  40179. 22222 44444
  40180. 22222 44444
  40181. </pre></div>
  40182. </dd>
  40183. <dt>&lsquo;<samp>pad, 3</samp>&rsquo;</dt>
  40184. <dd><p>Expand each frame to full height, but pad alternate lines with black,
  40185. generating a frame with double height at the same input frame rate.
  40186. </p>
  40187. <div class="example">
  40188. <pre class="example"> ------&gt; time
  40189. Input:
  40190. Frame 1 Frame 2 Frame 3 Frame 4
  40191. 11111 22222 33333 44444
  40192. 11111 22222 33333 44444
  40193. 11111 22222 33333 44444
  40194. 11111 22222 33333 44444
  40195. Output:
  40196. 11111 ..... 33333 .....
  40197. ..... 22222 ..... 44444
  40198. 11111 ..... 33333 .....
  40199. ..... 22222 ..... 44444
  40200. 11111 ..... 33333 .....
  40201. ..... 22222 ..... 44444
  40202. 11111 ..... 33333 .....
  40203. ..... 22222 ..... 44444
  40204. </pre></div>
  40205. </dd>
  40206. <dt>&lsquo;<samp>interleave_top, 4</samp>&rsquo;</dt>
  40207. <dd><p>Interleave the upper field from odd frames with the lower field from
  40208. even frames, generating a frame with unchanged height at half frame rate.
  40209. </p>
  40210. <div class="example">
  40211. <pre class="example"> ------&gt; time
  40212. Input:
  40213. Frame 1 Frame 2 Frame 3 Frame 4
  40214. 11111&lt;- 22222 33333&lt;- 44444
  40215. 11111 22222&lt;- 33333 44444&lt;-
  40216. 11111&lt;- 22222 33333&lt;- 44444
  40217. 11111 22222&lt;- 33333 44444&lt;-
  40218. Output:
  40219. 11111 33333
  40220. 22222 44444
  40221. 11111 33333
  40222. 22222 44444
  40223. </pre></div>
  40224. </dd>
  40225. <dt>&lsquo;<samp>interleave_bottom, 5</samp>&rsquo;</dt>
  40226. <dd><p>Interleave the lower field from odd frames with the upper field from
  40227. even frames, generating a frame with unchanged height at half frame rate.
  40228. </p>
  40229. <div class="example">
  40230. <pre class="example"> ------&gt; time
  40231. Input:
  40232. Frame 1 Frame 2 Frame 3 Frame 4
  40233. 11111 22222&lt;- 33333 44444&lt;-
  40234. 11111&lt;- 22222 33333&lt;- 44444
  40235. 11111 22222&lt;- 33333 44444&lt;-
  40236. 11111&lt;- 22222 33333&lt;- 44444
  40237. Output:
  40238. 22222 44444
  40239. 11111 33333
  40240. 22222 44444
  40241. 11111 33333
  40242. </pre></div>
  40243. </dd>
  40244. <dt>&lsquo;<samp>interlacex2, 6</samp>&rsquo;</dt>
  40245. <dd><p>Double frame rate with unchanged height. Frames are inserted each
  40246. containing the second temporal field from the previous input frame and
  40247. the first temporal field from the next input frame. This mode relies on
  40248. the top_field_first flag. Useful for interlaced video displays with no
  40249. field synchronisation.
  40250. </p>
  40251. <div class="example">
  40252. <pre class="example"> ------&gt; time
  40253. Input:
  40254. Frame 1 Frame 2 Frame 3 Frame 4
  40255. 11111 22222 33333 44444
  40256. 11111 22222 33333 44444
  40257. 11111 22222 33333 44444
  40258. 11111 22222 33333 44444
  40259. Output:
  40260. 11111 22222 22222 33333 33333 44444 44444
  40261. 11111 11111 22222 22222 33333 33333 44444
  40262. 11111 22222 22222 33333 33333 44444 44444
  40263. 11111 11111 22222 22222 33333 33333 44444
  40264. </pre></div>
  40265. </dd>
  40266. <dt>&lsquo;<samp>mergex2, 7</samp>&rsquo;</dt>
  40267. <dd><p>Move odd frames into the upper field, even into the lower field,
  40268. generating a double height frame at same frame rate.
  40269. </p>
  40270. <div class="example">
  40271. <pre class="example"> ------&gt; time
  40272. Input:
  40273. Frame 1 Frame 2 Frame 3 Frame 4
  40274. 11111 22222 33333 44444
  40275. 11111 22222 33333 44444
  40276. 11111 22222 33333 44444
  40277. 11111 22222 33333 44444
  40278. Output:
  40279. 11111 33333 33333 55555
  40280. 22222 22222 44444 44444
  40281. 11111 33333 33333 55555
  40282. 22222 22222 44444 44444
  40283. 11111 33333 33333 55555
  40284. 22222 22222 44444 44444
  40285. 11111 33333 33333 55555
  40286. 22222 22222 44444 44444
  40287. </pre></div>
  40288. </dd>
  40289. </dl>
  40290. <p>Numeric values are deprecated but are accepted for backward
  40291. compatibility reasons.
  40292. </p>
  40293. <p>Default mode is <code>merge</code>.
  40294. </p>
  40295. </dd>
  40296. <dt>&lsquo;<samp>flags</samp>&rsquo;</dt>
  40297. <dd><p>Specify flags influencing the filter process.
  40298. </p>
  40299. <p>Available value for <var>flags</var> is:
  40300. </p>
  40301. <dl compact="compact">
  40302. <dt>&lsquo;<samp>low_pass_filter, vlpf</samp>&rsquo;</dt>
  40303. <dd><p>Enable linear vertical low-pass filtering in the filter.
  40304. Vertical low-pass filtering is required when creating an interlaced
  40305. destination from a progressive source which contains high-frequency
  40306. vertical detail. Filtering will reduce interlace &rsquo;twitter&rsquo; and Moire
  40307. patterning.
  40308. </p>
  40309. </dd>
  40310. <dt>&lsquo;<samp>complex_filter, cvlpf</samp>&rsquo;</dt>
  40311. <dd><p>Enable complex vertical low-pass filtering.
  40312. This will slightly less reduce interlace &rsquo;twitter&rsquo; and Moire
  40313. patterning but better retain detail and subjective sharpness impression.
  40314. </p>
  40315. </dd>
  40316. <dt>&lsquo;<samp>bypass_il</samp>&rsquo;</dt>
  40317. <dd><p>Bypass already interlaced frames, only adjust the frame rate.
  40318. </p></dd>
  40319. </dl>
  40320. <p>Vertical low-pass filtering and bypassing already interlaced frames can only be
  40321. enabled for &lsquo;<samp>mode</samp>&rsquo; <var>interleave_top</var> and <var>interleave_bottom</var>.
  40322. </p>
  40323. </dd>
  40324. </dl>
  40325. <a name="tmedian"></a>
  40326. <h2 class="section"><a href="ffmpeg-all.html#toc-tmedian">39.211 tmedian</a></h2>
  40327. <p>Pick median pixels from several successive input video frames.
  40328. </p>
  40329. <p>The filter accepts the following options:
  40330. </p>
  40331. <dl compact="compact">
  40332. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  40333. <dd><p>Set radius of median filter.
  40334. Default is 1. Allowed range is from 1 to 127.
  40335. </p>
  40336. </dd>
  40337. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  40338. <dd><p>Set which planes to filter. Default value is <code>15</code>, by which all planes are processed.
  40339. </p>
  40340. </dd>
  40341. <dt>&lsquo;<samp>percentile</samp>&rsquo;</dt>
  40342. <dd><p>Set median percentile. Default value is <code>0.5</code>.
  40343. Default value of <code>0.5</code> will pick always median values, while <code>0</code> will pick
  40344. minimum values, and <code>1</code> maximum values.
  40345. </p></dd>
  40346. </dl>
  40347. <a name="tmix"></a>
  40348. <h2 class="section"><a href="ffmpeg-all.html#toc-tmix">39.212 tmix</a></h2>
  40349. <p>Mix successive video frames.
  40350. </p>
  40351. <p>A description of the accepted options follows.
  40352. </p>
  40353. <dl compact="compact">
  40354. <dt>&lsquo;<samp>frames</samp>&rsquo;</dt>
  40355. <dd><p>The number of successive frames to mix. If unspecified, it defaults to 3.
  40356. </p>
  40357. </dd>
  40358. <dt>&lsquo;<samp>weights</samp>&rsquo;</dt>
  40359. <dd><p>Specify weight of each input video frame.
  40360. Each weight is separated by space. If number of weights is smaller than
  40361. number of <var>frames</var> last specified weight will be used for all remaining
  40362. unset weights.
  40363. </p>
  40364. </dd>
  40365. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  40366. <dd><p>Specify scale, if it is set it will be multiplied with sum
  40367. of each weight multiplied with pixel values to give final destination
  40368. pixel value. By default <var>scale</var> is auto scaled to sum of weights.
  40369. </p></dd>
  40370. </dl>
  40371. <a name="Examples-94"></a>
  40372. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-94">39.212.1 Examples</a></h3>
  40373. <ul>
  40374. <li>
  40375. Average 7 successive frames:
  40376. <div class="example">
  40377. <pre class="example">tmix=frames=7:weights=&quot;1 1 1 1 1 1 1&quot;
  40378. </pre></div>
  40379. </li><li>
  40380. Apply simple temporal convolution:
  40381. <div class="example">
  40382. <pre class="example">tmix=frames=3:weights=&quot;-1 3 -1&quot;
  40383. </pre></div>
  40384. </li><li>
  40385. Similar as above but only showing temporal differences:
  40386. <div class="example">
  40387. <pre class="example">tmix=frames=3:weights=&quot;-1 2 -1&quot;:scale=1
  40388. </pre></div>
  40389. </li></ul>
  40390. <p><a name="tonemap"></a>
  40391. </p><a name="tonemap-1"></a>
  40392. <h2 class="section"><a href="ffmpeg-all.html#toc-tonemap-1">39.213 tonemap</a></h2>
  40393. <p>Tone map colors from different dynamic ranges.
  40394. </p>
  40395. <p>This filter expects data in single precision floating point, as it needs to
  40396. operate on (and can output) out-of-range values. Another filter, such as
  40397. <a href="#zscale">zscale</a>, is needed to convert the resulting frame to a usable format.
  40398. </p>
  40399. <p>The tonemapping algorithms implemented only work on linear light, so input
  40400. data should be linearized beforehand (and possibly correctly tagged).
  40401. </p>
  40402. <div class="example">
  40403. <pre class="example">ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT
  40404. </pre></div>
  40405. <a name="Options-54"></a>
  40406. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-54">39.213.1 Options</a></h3>
  40407. <p>The filter accepts the following options.
  40408. </p>
  40409. <dl compact="compact">
  40410. <dt>&lsquo;<samp>tonemap</samp>&rsquo;</dt>
  40411. <dd><p>Set the tone map algorithm to use.
  40412. </p>
  40413. <p>Possible values are:
  40414. </p><dl compact="compact">
  40415. <dt><var>none</var></dt>
  40416. <dd><p>Do not apply any tone map, only desaturate overbright pixels.
  40417. </p>
  40418. </dd>
  40419. <dt><var>clip</var></dt>
  40420. <dd><p>Hard-clip any out-of-range values. Use it for perfect color accuracy for
  40421. in-range values, while distorting out-of-range values.
  40422. </p>
  40423. </dd>
  40424. <dt><var>linear</var></dt>
  40425. <dd><p>Stretch the entire reference gamut to a linear multiple of the display.
  40426. </p>
  40427. </dd>
  40428. <dt><var>gamma</var></dt>
  40429. <dd><p>Fit a logarithmic transfer between the tone curves.
  40430. </p>
  40431. </dd>
  40432. <dt><var>reinhard</var></dt>
  40433. <dd><p>Preserve overall image brightness with a simple curve, using nonlinear
  40434. contrast, which results in flattening details and degrading color accuracy.
  40435. </p>
  40436. </dd>
  40437. <dt><var>hable</var></dt>
  40438. <dd><p>Preserve both dark and bright details better than <var>reinhard</var>, at the cost
  40439. of slightly darkening everything. Use it when detail preservation is more
  40440. important than color and brightness accuracy.
  40441. </p>
  40442. </dd>
  40443. <dt><var>mobius</var></dt>
  40444. <dd><p>Smoothly map out-of-range values, while retaining contrast and colors for
  40445. in-range material as much as possible. Use it when color accuracy is more
  40446. important than detail preservation.
  40447. </p></dd>
  40448. </dl>
  40449. <p>Default is none.
  40450. </p>
  40451. </dd>
  40452. <dt>&lsquo;<samp>param</samp>&rsquo;</dt>
  40453. <dd><p>Tune the tone mapping algorithm.
  40454. </p>
  40455. <p>This affects the following algorithms:
  40456. </p><dl compact="compact">
  40457. <dt><var>none</var></dt>
  40458. <dd><p>Ignored.
  40459. </p>
  40460. </dd>
  40461. <dt><var>linear</var></dt>
  40462. <dd><p>Specifies the scale factor to use while stretching.
  40463. Default to 1.0.
  40464. </p>
  40465. </dd>
  40466. <dt><var>gamma</var></dt>
  40467. <dd><p>Specifies the exponent of the function.
  40468. Default to 1.8.
  40469. </p>
  40470. </dd>
  40471. <dt><var>clip</var></dt>
  40472. <dd><p>Specify an extra linear coefficient to multiply into the signal before clipping.
  40473. Default to 1.0.
  40474. </p>
  40475. </dd>
  40476. <dt><var>reinhard</var></dt>
  40477. <dd><p>Specify the local contrast coefficient at the display peak.
  40478. Default to 0.5, which means that in-gamut values will be about half as bright
  40479. as when clipping.
  40480. </p>
  40481. </dd>
  40482. <dt><var>hable</var></dt>
  40483. <dd><p>Ignored.
  40484. </p>
  40485. </dd>
  40486. <dt><var>mobius</var></dt>
  40487. <dd><p>Specify the transition point from linear to mobius transform. Every value
  40488. below this point is guaranteed to be mapped 1:1. The higher the value, the
  40489. more accurate the result will be, at the cost of losing bright details.
  40490. Default to 0.3, which due to the steep initial slope still preserves in-range
  40491. colors fairly accurately.
  40492. </p></dd>
  40493. </dl>
  40494. </dd>
  40495. <dt>&lsquo;<samp>desat</samp>&rsquo;</dt>
  40496. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  40497. higher the parameter, the more color information will be preserved. This
  40498. setting helps prevent unnaturally blown-out colors for super-highlights, by
  40499. (smoothly) turning into white instead. This makes images feel more natural,
  40500. at the cost of reducing information about out-of-range colors.
  40501. </p>
  40502. <p>The default of 2.0 is somewhat conservative and will mostly just apply to
  40503. skies or directly sunlit surfaces. A setting of 0.0 disables this option.
  40504. </p>
  40505. <p>This option works only if the input frame has a supported color tag.
  40506. </p>
  40507. </dd>
  40508. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  40509. <dd><p>Override signal/nominal/reference peak with this value. Useful when the
  40510. embedded peak information in display metadata is not reliable or when tone
  40511. mapping from a lower range to a higher range.
  40512. </p></dd>
  40513. </dl>
  40514. <a name="tpad"></a>
  40515. <h2 class="section"><a href="ffmpeg-all.html#toc-tpad">39.214 tpad</a></h2>
  40516. <p>Temporarily pad video frames.
  40517. </p>
  40518. <p>The filter accepts the following options:
  40519. </p>
  40520. <dl compact="compact">
  40521. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  40522. <dd><p>Specify number of delay frames before input video stream. Default is 0.
  40523. </p>
  40524. </dd>
  40525. <dt>&lsquo;<samp>stop</samp>&rsquo;</dt>
  40526. <dd><p>Specify number of padding frames after input video stream.
  40527. Set to -1 to pad indefinitely. Default is 0.
  40528. </p>
  40529. </dd>
  40530. <dt>&lsquo;<samp>start_mode</samp>&rsquo;</dt>
  40531. <dd><p>Set kind of frames added to beginning of stream.
  40532. Can be either <var>add</var> or <var>clone</var>.
  40533. With <var>add</var> frames of solid-color are added.
  40534. With <var>clone</var> frames are clones of first frame.
  40535. Default is <var>add</var>.
  40536. </p>
  40537. </dd>
  40538. <dt>&lsquo;<samp>stop_mode</samp>&rsquo;</dt>
  40539. <dd><p>Set kind of frames added to end of stream.
  40540. Can be either <var>add</var> or <var>clone</var>.
  40541. With <var>add</var> frames of solid-color are added.
  40542. With <var>clone</var> frames are clones of last frame.
  40543. Default is <var>add</var>.
  40544. </p>
  40545. </dd>
  40546. <dt>&lsquo;<samp>start_duration, stop_duration</samp>&rsquo;</dt>
  40547. <dd><p>Specify the duration of the start/stop delay. See
  40548. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  40549. for the accepted syntax.
  40550. These options override <var>start</var> and <var>stop</var>. Default is 0.
  40551. </p>
  40552. </dd>
  40553. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  40554. <dd><p>Specify the color of the padded area. For the syntax of this option,
  40555. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  40556. </p>
  40557. <p>The default value of <var>color</var> is &quot;black&quot;.
  40558. </p></dd>
  40559. </dl>
  40560. <p><a name="transpose"></a>
  40561. </p><a name="transpose-1"></a>
  40562. <h2 class="section"><a href="ffmpeg-all.html#toc-transpose-1">39.215 transpose</a></h2>
  40563. <p>Transpose rows with columns in the input video and optionally flip it.
  40564. </p>
  40565. <p>It accepts the following parameters:
  40566. </p>
  40567. <dl compact="compact">
  40568. <dt>&lsquo;<samp>dir</samp>&rsquo;</dt>
  40569. <dd><p>Specify the transposition direction.
  40570. </p>
  40571. <p>Can assume the following values:
  40572. </p><dl compact="compact">
  40573. <dt>&lsquo;<samp>0, 4, cclock_flip</samp>&rsquo;</dt>
  40574. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
  40575. </p><div class="example">
  40576. <pre class="example">L.R L.l
  40577. . . -&gt; . .
  40578. l.r R.r
  40579. </pre></div>
  40580. </dd>
  40581. <dt>&lsquo;<samp>1, 5, clock</samp>&rsquo;</dt>
  40582. <dd><p>Rotate by 90 degrees clockwise, that is:
  40583. </p><div class="example">
  40584. <pre class="example">L.R l.L
  40585. . . -&gt; . .
  40586. l.r r.R
  40587. </pre></div>
  40588. </dd>
  40589. <dt>&lsquo;<samp>2, 6, cclock</samp>&rsquo;</dt>
  40590. <dd><p>Rotate by 90 degrees counterclockwise, that is:
  40591. </p><div class="example">
  40592. <pre class="example">L.R R.r
  40593. . . -&gt; . .
  40594. l.r L.l
  40595. </pre></div>
  40596. </dd>
  40597. <dt>&lsquo;<samp>3, 7, clock_flip</samp>&rsquo;</dt>
  40598. <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
  40599. </p><div class="example">
  40600. <pre class="example">L.R r.R
  40601. . . -&gt; . .
  40602. l.r l.L
  40603. </pre></div>
  40604. </dd>
  40605. </dl>
  40606. <p>For values between 4-7, the transposition is only done if the input
  40607. video geometry is portrait and not landscape. These values are
  40608. deprecated, the <code>passthrough</code> option should be used instead.
  40609. </p>
  40610. <p>Numerical values are deprecated, and should be dropped in favor of
  40611. symbolic constants.
  40612. </p>
  40613. </dd>
  40614. <dt>&lsquo;<samp>passthrough</samp>&rsquo;</dt>
  40615. <dd><p>Do not apply the transposition if the input geometry matches the one
  40616. specified by the specified value. It accepts the following values:
  40617. </p><dl compact="compact">
  40618. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  40619. <dd><p>Always apply transposition.
  40620. </p></dd>
  40621. <dt>&lsquo;<samp>portrait</samp>&rsquo;</dt>
  40622. <dd><p>Preserve portrait geometry (when <var>height</var> &gt;= <var>width</var>).
  40623. </p></dd>
  40624. <dt>&lsquo;<samp>landscape</samp>&rsquo;</dt>
  40625. <dd><p>Preserve landscape geometry (when <var>width</var> &gt;= <var>height</var>).
  40626. </p></dd>
  40627. </dl>
  40628. <p>Default value is <code>none</code>.
  40629. </p></dd>
  40630. </dl>
  40631. <p>For example to rotate by 90 degrees clockwise and preserve portrait
  40632. layout:
  40633. </p><div class="example">
  40634. <pre class="example">transpose=dir=1:passthrough=portrait
  40635. </pre></div>
  40636. <p>The command above can also be specified as:
  40637. </p><div class="example">
  40638. <pre class="example">transpose=1:portrait
  40639. </pre></div>
  40640. <a name="transpose_005fnpp"></a>
  40641. <h2 class="section"><a href="ffmpeg-all.html#toc-transpose_005fnpp">39.216 transpose_npp</a></h2>
  40642. <p>Transpose rows with columns in the input video and optionally flip it.
  40643. For more in depth examples see the <a href="#transpose">transpose</a> video filter, which shares mostly the same options.
  40644. </p>
  40645. <p>It accepts the following parameters:
  40646. </p>
  40647. <dl compact="compact">
  40648. <dt>&lsquo;<samp>dir</samp>&rsquo;</dt>
  40649. <dd><p>Specify the transposition direction.
  40650. </p>
  40651. <p>Can assume the following values:
  40652. </p><dl compact="compact">
  40653. <dt>&lsquo;<samp>cclock_flip</samp>&rsquo;</dt>
  40654. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  40655. </p>
  40656. </dd>
  40657. <dt>&lsquo;<samp>clock</samp>&rsquo;</dt>
  40658. <dd><p>Rotate by 90 degrees clockwise.
  40659. </p>
  40660. </dd>
  40661. <dt>&lsquo;<samp>cclock</samp>&rsquo;</dt>
  40662. <dd><p>Rotate by 90 degrees counterclockwise.
  40663. </p>
  40664. </dd>
  40665. <dt>&lsquo;<samp>clock_flip</samp>&rsquo;</dt>
  40666. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  40667. </p></dd>
  40668. </dl>
  40669. </dd>
  40670. <dt>&lsquo;<samp>passthrough</samp>&rsquo;</dt>
  40671. <dd><p>Do not apply the transposition if the input geometry matches the one
  40672. specified by the specified value. It accepts the following values:
  40673. </p><dl compact="compact">
  40674. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  40675. <dd><p>Always apply transposition. (default)
  40676. </p></dd>
  40677. <dt>&lsquo;<samp>portrait</samp>&rsquo;</dt>
  40678. <dd><p>Preserve portrait geometry (when <var>height</var> &gt;= <var>width</var>).
  40679. </p></dd>
  40680. <dt>&lsquo;<samp>landscape</samp>&rsquo;</dt>
  40681. <dd><p>Preserve landscape geometry (when <var>width</var> &gt;= <var>height</var>).
  40682. </p></dd>
  40683. </dl>
  40684. </dd>
  40685. </dl>
  40686. <a name="trim"></a>
  40687. <h2 class="section"><a href="ffmpeg-all.html#toc-trim">39.217 trim</a></h2>
  40688. <p>Trim the input so that the output contains one continuous subpart of the input.
  40689. </p>
  40690. <p>It accepts the following parameters:
  40691. </p><dl compact="compact">
  40692. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  40693. <dd><p>Specify the time of the start of the kept section, i.e. the frame with the
  40694. timestamp <var>start</var> will be the first frame in the output.
  40695. </p>
  40696. </dd>
  40697. <dt>&lsquo;<samp>end</samp>&rsquo;</dt>
  40698. <dd><p>Specify the time of the first frame that will be dropped, i.e. the frame
  40699. immediately preceding the one with the timestamp <var>end</var> will be the last
  40700. frame in the output.
  40701. </p>
  40702. </dd>
  40703. <dt>&lsquo;<samp>start_pts</samp>&rsquo;</dt>
  40704. <dd><p>This is the same as <var>start</var>, except this option sets the start timestamp
  40705. in timebase units instead of seconds.
  40706. </p>
  40707. </dd>
  40708. <dt>&lsquo;<samp>end_pts</samp>&rsquo;</dt>
  40709. <dd><p>This is the same as <var>end</var>, except this option sets the end timestamp
  40710. in timebase units instead of seconds.
  40711. </p>
  40712. </dd>
  40713. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  40714. <dd><p>The maximum duration of the output in seconds.
  40715. </p>
  40716. </dd>
  40717. <dt>&lsquo;<samp>start_frame</samp>&rsquo;</dt>
  40718. <dd><p>The number of the first frame that should be passed to the output.
  40719. </p>
  40720. </dd>
  40721. <dt>&lsquo;<samp>end_frame</samp>&rsquo;</dt>
  40722. <dd><p>The number of the first frame that should be dropped.
  40723. </p></dd>
  40724. </dl>
  40725. <p>&lsquo;<samp>start</samp>&rsquo;, &lsquo;<samp>end</samp>&rsquo;, and &lsquo;<samp>duration</samp>&rsquo; are expressed as time
  40726. duration specifications; see
  40727. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  40728. for the accepted syntax.
  40729. </p>
  40730. <p>Note that the first two sets of the start/end options and the &lsquo;<samp>duration</samp>&rsquo;
  40731. option look at the frame timestamp, while the _frame variants simply count the
  40732. frames that pass through the filter. Also note that this filter does not modify
  40733. the timestamps. If you wish for the output timestamps to start at zero, insert a
  40734. setpts filter after the trim filter.
  40735. </p>
  40736. <p>If multiple start or end options are set, this filter tries to be greedy and
  40737. keep all the frames that match at least one of the specified constraints. To keep
  40738. only the part that matches all the constraints at once, chain multiple trim
  40739. filters.
  40740. </p>
  40741. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  40742. just the end values to keep everything before the specified time.
  40743. </p>
  40744. <p>Examples:
  40745. </p><ul>
  40746. <li>
  40747. Drop everything except the second minute of input:
  40748. <div class="example">
  40749. <pre class="example">ffmpeg -i INPUT -vf trim=60:120
  40750. </pre></div>
  40751. </li><li>
  40752. Keep only the first second:
  40753. <div class="example">
  40754. <pre class="example">ffmpeg -i INPUT -vf trim=duration=1
  40755. </pre></div>
  40756. </li></ul>
  40757. <a name="unpremultiply"></a>
  40758. <h2 class="section"><a href="ffmpeg-all.html#toc-unpremultiply">39.218 unpremultiply</a></h2>
  40759. <p>Apply alpha unpremultiply effect to input video stream using first plane
  40760. of second stream as alpha.
  40761. </p>
  40762. <p>Both streams must have same dimensions and same pixel format.
  40763. </p>
  40764. <p>The filter accepts the following option:
  40765. </p>
  40766. <dl compact="compact">
  40767. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  40768. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  40769. By default value 0xf, all planes will be processed.
  40770. </p>
  40771. <p>If the format has 1 or 2 components, then luma is bit 0.
  40772. If the format has 3 or 4 components:
  40773. for RGB formats bit 0 is green, bit 1 is blue and bit 2 is red;
  40774. for YUV formats bit 0 is luma, bit 1 is chroma-U and bit 2 is chroma-V.
  40775. If present, the alpha channel is always the last bit.
  40776. </p>
  40777. </dd>
  40778. <dt>&lsquo;<samp>inplace</samp>&rsquo;</dt>
  40779. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  40780. </p></dd>
  40781. </dl>
  40782. <p><a name="unsharp"></a>
  40783. </p><a name="unsharp-1"></a>
  40784. <h2 class="section"><a href="ffmpeg-all.html#toc-unsharp-1">39.219 unsharp</a></h2>
  40785. <p>Sharpen or blur the input video.
  40786. </p>
  40787. <p>It accepts the following parameters:
  40788. </p>
  40789. <dl compact="compact">
  40790. <dt>&lsquo;<samp>luma_msize_x, lx</samp>&rsquo;</dt>
  40791. <dd><p>Set the luma matrix horizontal size. It must be an odd integer between
  40792. 3 and 23. The default value is 5.
  40793. </p>
  40794. </dd>
  40795. <dt>&lsquo;<samp>luma_msize_y, ly</samp>&rsquo;</dt>
  40796. <dd><p>Set the luma matrix vertical size. It must be an odd integer between 3
  40797. and 23. The default value is 5.
  40798. </p>
  40799. </dd>
  40800. <dt>&lsquo;<samp>luma_amount, la</samp>&rsquo;</dt>
  40801. <dd><p>Set the luma effect strength. It must be a floating point number, reasonable
  40802. values lay between -1.5 and 1.5.
  40803. </p>
  40804. <p>Negative values will blur the input video, while positive values will
  40805. sharpen it, a value of zero will disable the effect.
  40806. </p>
  40807. <p>Default value is 1.0.
  40808. </p>
  40809. </dd>
  40810. <dt>&lsquo;<samp>chroma_msize_x, cx</samp>&rsquo;</dt>
  40811. <dd><p>Set the chroma matrix horizontal size. It must be an odd integer
  40812. between 3 and 23. The default value is 5.
  40813. </p>
  40814. </dd>
  40815. <dt>&lsquo;<samp>chroma_msize_y, cy</samp>&rsquo;</dt>
  40816. <dd><p>Set the chroma matrix vertical size. It must be an odd integer
  40817. between 3 and 23. The default value is 5.
  40818. </p>
  40819. </dd>
  40820. <dt>&lsquo;<samp>chroma_amount, ca</samp>&rsquo;</dt>
  40821. <dd><p>Set the chroma effect strength. It must be a floating point number, reasonable
  40822. values lay between -1.5 and 1.5.
  40823. </p>
  40824. <p>Negative values will blur the input video, while positive values will
  40825. sharpen it, a value of zero will disable the effect.
  40826. </p>
  40827. <p>Default value is 0.0.
  40828. </p>
  40829. </dd>
  40830. </dl>
  40831. <p>All parameters are optional and default to the equivalent of the
  40832. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  40833. </p>
  40834. <a name="Examples-38"></a>
  40835. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-38">39.219.1 Examples</a></h3>
  40836. <ul>
  40837. <li>
  40838. Apply strong luma sharpen effect:
  40839. <div class="example">
  40840. <pre class="example">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
  40841. </pre></div>
  40842. </li><li>
  40843. Apply a strong blur of both luma and chroma parameters:
  40844. <div class="example">
  40845. <pre class="example">unsharp=7:7:-2:7:7:-2
  40846. </pre></div>
  40847. </li></ul>
  40848. <p><a name="untile"></a>
  40849. </p><a name="untile-1"></a>
  40850. <h2 class="section"><a href="ffmpeg-all.html#toc-untile-1">39.220 untile</a></h2>
  40851. <p>Decompose a video made of tiled images into the individual images.
  40852. </p>
  40853. <p>The frame rate of the output video is the frame rate of the input video
  40854. multiplied by the number of tiles.
  40855. </p>
  40856. <p>This filter does the reverse of <a href="#tile">tile</a>.
  40857. </p>
  40858. <p>The filter accepts the following options:
  40859. </p>
  40860. <dl compact="compact">
  40861. <dt>&lsquo;<samp>layout</samp>&rsquo;</dt>
  40862. <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
  40863. this option, check the
  40864. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  40865. </p></dd>
  40866. </dl>
  40867. <a name="Examples-72"></a>
  40868. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-72">39.220.1 Examples</a></h3>
  40869. <ul>
  40870. <li>
  40871. Produce a 1-second video from a still image file made of 25 frames stacked
  40872. vertically, like an analogic film reel:
  40873. <div class="example">
  40874. <pre class="example">ffmpeg -r 1 -i image.jpg -vf untile=1x25 movie.mkv
  40875. </pre></div>
  40876. </li></ul>
  40877. <a name="uspp"></a>
  40878. <h2 class="section"><a href="ffmpeg-all.html#toc-uspp">39.221 uspp</a></h2>
  40879. <p>Apply ultra slow/simple postprocessing filter that compresses and decompresses
  40880. the image at several (or - in the case of &lsquo;<samp>quality</samp>&rsquo; level <code>8</code> - all)
  40881. shifts and average the results.
  40882. </p>
  40883. <p>The way this differs from the behavior of spp is that uspp actually encodes &amp;
  40884. decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8
  40885. DCT similar to MJPEG.
  40886. </p>
  40887. <p>The filter accepts the following options:
  40888. </p>
  40889. <dl compact="compact">
  40890. <dt>&lsquo;<samp>quality</samp>&rsquo;</dt>
  40891. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  40892. an integer in the range 0-8. If set to <code>0</code>, the filter will have no
  40893. effect. A value of <code>8</code> means the higher quality. For each increment of
  40894. that value the speed drops by a factor of approximately 2. Default value is
  40895. <code>3</code>.
  40896. </p>
  40897. </dd>
  40898. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  40899. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  40900. from the video stream (if available).
  40901. </p></dd>
  40902. </dl>
  40903. <a name="v360"></a>
  40904. <h2 class="section"><a href="ffmpeg-all.html#toc-v360">39.222 v360</a></h2>
  40905. <p>Convert 360 videos between various formats.
  40906. </p>
  40907. <p>The filter accepts the following options:
  40908. </p>
  40909. <dl compact="compact">
  40910. <dt>&lsquo;<samp>input</samp>&rsquo;</dt>
  40911. <dt>&lsquo;<samp>output</samp>&rsquo;</dt>
  40912. <dd><p>Set format of the input/output video.
  40913. </p>
  40914. <p>Available formats:
  40915. </p>
  40916. <dl compact="compact">
  40917. <dt>&lsquo;<samp>e</samp>&rsquo;</dt>
  40918. <dt>&lsquo;<samp>equirect</samp>&rsquo;</dt>
  40919. <dd><p>Equirectangular projection.
  40920. </p>
  40921. </dd>
  40922. <dt>&lsquo;<samp>c3x2</samp>&rsquo;</dt>
  40923. <dt>&lsquo;<samp>c6x1</samp>&rsquo;</dt>
  40924. <dt>&lsquo;<samp>c1x6</samp>&rsquo;</dt>
  40925. <dd><p>Cubemap with 3x2/6x1/1x6 layout.
  40926. </p>
  40927. <p>Format specific options:
  40928. </p>
  40929. <dl compact="compact">
  40930. <dt>&lsquo;<samp>in_pad</samp>&rsquo;</dt>
  40931. <dt>&lsquo;<samp>out_pad</samp>&rsquo;</dt>
  40932. <dd><p>Set padding proportion for the input/output cubemap. Values in decimals.
  40933. </p>
  40934. <p>Example values:
  40935. </p><dl compact="compact">
  40936. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  40937. <dd><p>No padding.
  40938. </p></dd>
  40939. <dt>&lsquo;<samp>0.01</samp>&rsquo;</dt>
  40940. <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)
  40941. </p></dd>
  40942. </dl>
  40943. <p>Default value is <b>&lsquo;<samp>0</samp>&rsquo;</b>.
  40944. Maximum value is <b>&lsquo;<samp>0.1</samp>&rsquo;</b>.
  40945. </p>
  40946. </dd>
  40947. <dt>&lsquo;<samp>fin_pad</samp>&rsquo;</dt>
  40948. <dt>&lsquo;<samp>fout_pad</samp>&rsquo;</dt>
  40949. <dd><p>Set fixed padding for the input/output cubemap. Values in pixels.
  40950. </p>
  40951. <p>Default value is <b>&lsquo;<samp>0</samp>&rsquo;</b>. If greater than zero it overrides other padding options.
  40952. </p>
  40953. </dd>
  40954. <dt>&lsquo;<samp>in_forder</samp>&rsquo;</dt>
  40955. <dt>&lsquo;<samp>out_forder</samp>&rsquo;</dt>
  40956. <dd><p>Set order of faces for the input/output cubemap. Choose one direction for each position.
  40957. </p>
  40958. <p>Designation of directions:
  40959. </p><dl compact="compact">
  40960. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  40961. <dd><p>right
  40962. </p></dd>
  40963. <dt>&lsquo;<samp>l</samp>&rsquo;</dt>
  40964. <dd><p>left
  40965. </p></dd>
  40966. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  40967. <dd><p>up
  40968. </p></dd>
  40969. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  40970. <dd><p>down
  40971. </p></dd>
  40972. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  40973. <dd><p>forward
  40974. </p></dd>
  40975. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  40976. <dd><p>back
  40977. </p></dd>
  40978. </dl>
  40979. <p>Default value is <b>&lsquo;<samp>rludfb</samp>&rsquo;</b>.
  40980. </p>
  40981. </dd>
  40982. <dt>&lsquo;<samp>in_frot</samp>&rsquo;</dt>
  40983. <dt>&lsquo;<samp>out_frot</samp>&rsquo;</dt>
  40984. <dd><p>Set rotation of faces for the input/output cubemap. Choose one angle for each position.
  40985. </p>
  40986. <p>Designation of angles:
  40987. </p><dl compact="compact">
  40988. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  40989. <dd><p>0 degrees clockwise
  40990. </p></dd>
  40991. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  40992. <dd><p>90 degrees clockwise
  40993. </p></dd>
  40994. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  40995. <dd><p>180 degrees clockwise
  40996. </p></dd>
  40997. <dt>&lsquo;<samp>3</samp>&rsquo;</dt>
  40998. <dd><p>270 degrees clockwise
  40999. </p></dd>
  41000. </dl>
  41001. <p>Default value is <b>&lsquo;<samp>000000</samp>&rsquo;</b>.
  41002. </p></dd>
  41003. </dl>
  41004. </dd>
  41005. <dt>&lsquo;<samp>eac</samp>&rsquo;</dt>
  41006. <dd><p>Equi-Angular Cubemap.
  41007. </p>
  41008. </dd>
  41009. <dt>&lsquo;<samp>flat</samp>&rsquo;</dt>
  41010. <dt>&lsquo;<samp>gnomonic</samp>&rsquo;</dt>
  41011. <dt>&lsquo;<samp>rectilinear</samp>&rsquo;</dt>
  41012. <dd><p>Regular video.
  41013. </p>
  41014. <p>Format specific options:
  41015. </p><dl compact="compact">
  41016. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  41017. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  41018. <dt>&lsquo;<samp>d_fov</samp>&rsquo;</dt>
  41019. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  41020. </p>
  41021. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41022. </p>
  41023. </dd>
  41024. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  41025. <dt>&lsquo;<samp>iv_fov</samp>&rsquo;</dt>
  41026. <dt>&lsquo;<samp>id_fov</samp>&rsquo;</dt>
  41027. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  41028. </p>
  41029. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41030. </p></dd>
  41031. </dl>
  41032. </dd>
  41033. <dt>&lsquo;<samp>dfisheye</samp>&rsquo;</dt>
  41034. <dd><p>Dual fisheye.
  41035. </p>
  41036. <p>Format specific options:
  41037. </p><dl compact="compact">
  41038. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  41039. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  41040. <dt>&lsquo;<samp>d_fov</samp>&rsquo;</dt>
  41041. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  41042. </p>
  41043. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41044. </p>
  41045. </dd>
  41046. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  41047. <dt>&lsquo;<samp>iv_fov</samp>&rsquo;</dt>
  41048. <dt>&lsquo;<samp>id_fov</samp>&rsquo;</dt>
  41049. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  41050. </p>
  41051. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41052. </p></dd>
  41053. </dl>
  41054. </dd>
  41055. <dt>&lsquo;<samp>barrel</samp>&rsquo;</dt>
  41056. <dt>&lsquo;<samp>fb</samp>&rsquo;</dt>
  41057. <dt>&lsquo;<samp>barrelsplit</samp>&rsquo;</dt>
  41058. <dd><p>Facebook&rsquo;s 360 formats.
  41059. </p>
  41060. </dd>
  41061. <dt>&lsquo;<samp>sg</samp>&rsquo;</dt>
  41062. <dd><p>Stereographic format.
  41063. </p>
  41064. <p>Format specific options:
  41065. </p><dl compact="compact">
  41066. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  41067. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  41068. <dt>&lsquo;<samp>d_fov</samp>&rsquo;</dt>
  41069. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  41070. </p>
  41071. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41072. </p>
  41073. </dd>
  41074. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  41075. <dt>&lsquo;<samp>iv_fov</samp>&rsquo;</dt>
  41076. <dt>&lsquo;<samp>id_fov</samp>&rsquo;</dt>
  41077. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  41078. </p>
  41079. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41080. </p></dd>
  41081. </dl>
  41082. </dd>
  41083. <dt>&lsquo;<samp>mercator</samp>&rsquo;</dt>
  41084. <dd><p>Mercator format.
  41085. </p>
  41086. </dd>
  41087. <dt>&lsquo;<samp>ball</samp>&rsquo;</dt>
  41088. <dd><p>Ball format, gives significant distortion toward the back.
  41089. </p>
  41090. </dd>
  41091. <dt>&lsquo;<samp>hammer</samp>&rsquo;</dt>
  41092. <dd><p>Hammer-Aitoff map projection format.
  41093. </p>
  41094. </dd>
  41095. <dt>&lsquo;<samp>sinusoidal</samp>&rsquo;</dt>
  41096. <dd><p>Sinusoidal map projection format.
  41097. </p>
  41098. </dd>
  41099. <dt>&lsquo;<samp>fisheye</samp>&rsquo;</dt>
  41100. <dd><p>Fisheye projection.
  41101. </p>
  41102. <p>Format specific options:
  41103. </p><dl compact="compact">
  41104. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  41105. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  41106. <dt>&lsquo;<samp>d_fov</samp>&rsquo;</dt>
  41107. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  41108. </p>
  41109. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41110. </p>
  41111. </dd>
  41112. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  41113. <dt>&lsquo;<samp>iv_fov</samp>&rsquo;</dt>
  41114. <dt>&lsquo;<samp>id_fov</samp>&rsquo;</dt>
  41115. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  41116. </p>
  41117. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41118. </p></dd>
  41119. </dl>
  41120. </dd>
  41121. <dt>&lsquo;<samp>pannini</samp>&rsquo;</dt>
  41122. <dd><p>Pannini projection.
  41123. </p>
  41124. <p>Format specific options:
  41125. </p><dl compact="compact">
  41126. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  41127. <dd><p>Set output pannini parameter.
  41128. </p>
  41129. </dd>
  41130. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  41131. <dd><p>Set input pannini parameter.
  41132. </p></dd>
  41133. </dl>
  41134. </dd>
  41135. <dt>&lsquo;<samp>cylindrical</samp>&rsquo;</dt>
  41136. <dd><p>Cylindrical projection.
  41137. </p>
  41138. <p>Format specific options:
  41139. </p><dl compact="compact">
  41140. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  41141. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  41142. <dt>&lsquo;<samp>d_fov</samp>&rsquo;</dt>
  41143. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  41144. </p>
  41145. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41146. </p>
  41147. </dd>
  41148. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  41149. <dt>&lsquo;<samp>iv_fov</samp>&rsquo;</dt>
  41150. <dt>&lsquo;<samp>id_fov</samp>&rsquo;</dt>
  41151. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  41152. </p>
  41153. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  41154. </p></dd>
  41155. </dl>
  41156. </dd>
  41157. <dt>&lsquo;<samp>perspective</samp>&rsquo;</dt>
  41158. <dd><p>Perspective projection. <i>(output only)</i>
  41159. </p>
  41160. <p>Format specific options:
  41161. </p><dl compact="compact">
  41162. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  41163. <dd><p>Set perspective parameter.
  41164. </p></dd>
  41165. </dl>
  41166. </dd>
  41167. <dt>&lsquo;<samp>tetrahedron</samp>&rsquo;</dt>
  41168. <dd><p>Tetrahedron projection.
  41169. </p>
  41170. </dd>
  41171. <dt>&lsquo;<samp>tsp</samp>&rsquo;</dt>
  41172. <dd><p>Truncated square pyramid projection.
  41173. </p>
  41174. </dd>
  41175. <dt>&lsquo;<samp>he</samp>&rsquo;</dt>
  41176. <dt>&lsquo;<samp>hequirect</samp>&rsquo;</dt>
  41177. <dd><p>Half equirectangular projection.
  41178. </p></dd>
  41179. </dl>
  41180. </dd>
  41181. <dt>&lsquo;<samp>interp</samp>&rsquo;</dt>
  41182. <dd><p>Set interpolation method.<br>
  41183. <i>Note: more complex interpolation methods require much more memory to run.</i>
  41184. </p>
  41185. <p>Available methods:
  41186. </p>
  41187. <dl compact="compact">
  41188. <dt>&lsquo;<samp>near</samp>&rsquo;</dt>
  41189. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  41190. <dd><p>Nearest neighbour.
  41191. </p></dd>
  41192. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  41193. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  41194. <dd><p>Bilinear interpolation.
  41195. </p></dd>
  41196. <dt>&lsquo;<samp>lagrange9</samp>&rsquo;</dt>
  41197. <dd><p>Lagrange9 interpolation.
  41198. </p></dd>
  41199. <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
  41200. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  41201. <dd><p>Bicubic interpolation.
  41202. </p></dd>
  41203. <dt>&lsquo;<samp>lanc</samp>&rsquo;</dt>
  41204. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  41205. <dd><p>Lanczos interpolation.
  41206. </p></dd>
  41207. <dt>&lsquo;<samp>sp16</samp>&rsquo;</dt>
  41208. <dt>&lsquo;<samp>spline16</samp>&rsquo;</dt>
  41209. <dd><p>Spline16 interpolation.
  41210. </p></dd>
  41211. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  41212. <dt>&lsquo;<samp>gaussian</samp>&rsquo;</dt>
  41213. <dd><p>Gaussian interpolation.
  41214. </p></dd>
  41215. </dl>
  41216. <p>Default value is <b>&lsquo;<samp>line</samp>&rsquo;</b>.
  41217. </p>
  41218. </dd>
  41219. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  41220. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  41221. <dd><p>Set the output video resolution.
  41222. </p>
  41223. <p>Default resolution depends on formats.
  41224. </p>
  41225. </dd>
  41226. <dt>&lsquo;<samp>in_stereo</samp>&rsquo;</dt>
  41227. <dt>&lsquo;<samp>out_stereo</samp>&rsquo;</dt>
  41228. <dd><p>Set the input/output stereo format.
  41229. </p>
  41230. <dl compact="compact">
  41231. <dt>&lsquo;<samp>2d</samp>&rsquo;</dt>
  41232. <dd><p>2D mono
  41233. </p></dd>
  41234. <dt>&lsquo;<samp>sbs</samp>&rsquo;</dt>
  41235. <dd><p>Side by side
  41236. </p></dd>
  41237. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  41238. <dd><p>Top bottom
  41239. </p></dd>
  41240. </dl>
  41241. <p>Default value is <b>&lsquo;<samp>2d</samp>&rsquo;</b> for input and output format.
  41242. </p>
  41243. </dd>
  41244. <dt>&lsquo;<samp>yaw</samp>&rsquo;</dt>
  41245. <dt>&lsquo;<samp>pitch</samp>&rsquo;</dt>
  41246. <dt>&lsquo;<samp>roll</samp>&rsquo;</dt>
  41247. <dd><p>Set rotation for the output video. Values in degrees.
  41248. </p>
  41249. </dd>
  41250. <dt>&lsquo;<samp>rorder</samp>&rsquo;</dt>
  41251. <dd><p>Set rotation order for the output video. Choose one item for each position.
  41252. </p>
  41253. <dl compact="compact">
  41254. <dt>&lsquo;<samp>y, Y</samp>&rsquo;</dt>
  41255. <dd><p>yaw
  41256. </p></dd>
  41257. <dt>&lsquo;<samp>p, P</samp>&rsquo;</dt>
  41258. <dd><p>pitch
  41259. </p></dd>
  41260. <dt>&lsquo;<samp>r, R</samp>&rsquo;</dt>
  41261. <dd><p>roll
  41262. </p></dd>
  41263. </dl>
  41264. <p>Default value is <b>&lsquo;<samp>ypr</samp>&rsquo;</b>.
  41265. </p>
  41266. </dd>
  41267. <dt>&lsquo;<samp>h_flip</samp>&rsquo;</dt>
  41268. <dt>&lsquo;<samp>v_flip</samp>&rsquo;</dt>
  41269. <dt>&lsquo;<samp>d_flip</samp>&rsquo;</dt>
  41270. <dd><p>Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values.
  41271. </p>
  41272. </dd>
  41273. <dt>&lsquo;<samp>ih_flip</samp>&rsquo;</dt>
  41274. <dt>&lsquo;<samp>iv_flip</samp>&rsquo;</dt>
  41275. <dd><p>Set if input video is flipped horizontally/vertically. Boolean values.
  41276. </p>
  41277. </dd>
  41278. <dt>&lsquo;<samp>in_trans</samp>&rsquo;</dt>
  41279. <dd><p>Set if input video is transposed. Boolean value, by default disabled.
  41280. </p>
  41281. </dd>
  41282. <dt>&lsquo;<samp>out_trans</samp>&rsquo;</dt>
  41283. <dd><p>Set if output video needs to be transposed. Boolean value, by default disabled.
  41284. </p>
  41285. </dd>
  41286. <dt>&lsquo;<samp>alpha_mask</samp>&rsquo;</dt>
  41287. <dd><p>Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled.
  41288. </p></dd>
  41289. </dl>
  41290. <a name="Examples-159"></a>
  41291. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-159">39.222.1 Examples</a></h3>
  41292. <ul>
  41293. <li>
  41294. Convert equirectangular video to cubemap with 3x2 layout and 1% padding using bicubic interpolation:
  41295. <div class="example">
  41296. <pre class="example">ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
  41297. </pre></div>
  41298. </li><li>
  41299. Extract back view of Equi-Angular Cubemap:
  41300. <div class="example">
  41301. <pre class="example">ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
  41302. </pre></div>
  41303. </li><li>
  41304. Convert transposed and horizontally flipped Equi-Angular Cubemap in side-by-side stereo format to equirectangular top-bottom stereo format:
  41305. <div class="example">
  41306. <pre class="example">v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
  41307. </pre></div>
  41308. </li></ul>
  41309. <a name="Commands-71"></a>
  41310. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-71">39.222.2 Commands</a></h3>
  41311. <p>This filter supports subset of above options as <a href="#commands">commands</a>.
  41312. </p>
  41313. <a name="vaguedenoiser"></a>
  41314. <h2 class="section"><a href="ffmpeg-all.html#toc-vaguedenoiser">39.223 vaguedenoiser</a></h2>
  41315. <p>Apply a wavelet based denoiser.
  41316. </p>
  41317. <p>It transforms each frame from the video input into the wavelet domain,
  41318. using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to
  41319. the obtained coefficients. It does an inverse wavelet transform after.
  41320. Due to wavelet properties, it should give a nice smoothed result, and
  41321. reduced noise, without blurring picture features.
  41322. </p>
  41323. <p>This filter accepts the following options:
  41324. </p>
  41325. <dl compact="compact">
  41326. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  41327. <dd><p>The filtering strength. The higher, the more filtered the video will be.
  41328. Hard thresholding can use a higher threshold than soft thresholding
  41329. before the video looks overfiltered. Default value is 2.
  41330. </p>
  41331. </dd>
  41332. <dt>&lsquo;<samp>method</samp>&rsquo;</dt>
  41333. <dd><p>The filtering method the filter will use.
  41334. </p>
  41335. <p>It accepts the following values:
  41336. </p><dl compact="compact">
  41337. <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
  41338. <dd><p>All values under the threshold will be zeroed.
  41339. </p>
  41340. </dd>
  41341. <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
  41342. <dd><p>All values under the threshold will be zeroed. All values above will be
  41343. reduced by the threshold.
  41344. </p>
  41345. </dd>
  41346. <dt>&lsquo;<samp>garrote</samp>&rsquo;</dt>
  41347. <dd><p>Scales or nullifies coefficients - intermediary between (more) soft and
  41348. (less) hard thresholding.
  41349. </p></dd>
  41350. </dl>
  41351. <p>Default is garrote.
  41352. </p>
  41353. </dd>
  41354. <dt>&lsquo;<samp>nsteps</samp>&rsquo;</dt>
  41355. <dd><p>Number of times, the wavelet will decompose the picture. Picture can&rsquo;t
  41356. be decomposed beyond a particular point (typically, 8 for a 640x480
  41357. frame - as 2^9 = 512 &gt; 480). Valid values are integers between 1 and 32. Default value is 6.
  41358. </p>
  41359. </dd>
  41360. <dt>&lsquo;<samp>percent</samp>&rsquo;</dt>
  41361. <dd><p>Partial of full denoising (limited coefficients shrinking), from 0 to 100. Default value is 85.
  41362. </p>
  41363. </dd>
  41364. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  41365. <dd><p>A list of the planes to process. By default all planes are processed.
  41366. </p>
  41367. </dd>
  41368. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  41369. <dd><p>The threshold type the filter will use.
  41370. </p>
  41371. <p>It accepts the following values:
  41372. </p><dl compact="compact">
  41373. <dt>&lsquo;<samp>universal</samp>&rsquo;</dt>
  41374. <dd><p>Threshold used is same for all decompositions.
  41375. </p>
  41376. </dd>
  41377. <dt>&lsquo;<samp>bayes</samp>&rsquo;</dt>
  41378. <dd><p>Threshold used depends also on each decomposition coefficients.
  41379. </p></dd>
  41380. </dl>
  41381. <p>Default is universal.
  41382. </p></dd>
  41383. </dl>
  41384. <a name="vectorscope"></a>
  41385. <h2 class="section"><a href="ffmpeg-all.html#toc-vectorscope">39.224 vectorscope</a></h2>
  41386. <p>Display 2 color component values in the two dimensional graph (which is called
  41387. a vectorscope).
  41388. </p>
  41389. <p>This filter accepts the following options:
  41390. </p>
  41391. <dl compact="compact">
  41392. <dt>&lsquo;<samp>mode, m</samp>&rsquo;</dt>
  41393. <dd><p>Set vectorscope mode.
  41394. </p>
  41395. <p>It accepts the following values:
  41396. </p><dl compact="compact">
  41397. <dt>&lsquo;<samp>gray</samp>&rsquo;</dt>
  41398. <dt>&lsquo;<samp>tint</samp>&rsquo;</dt>
  41399. <dd><p>Gray values are displayed on graph, higher brightness means more pixels have
  41400. same component color value on location in graph. This is the default mode.
  41401. </p>
  41402. </dd>
  41403. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  41404. <dd><p>Gray values are displayed on graph. Surrounding pixels values which are not
  41405. present in video frame are drawn in gradient of 2 color components which are
  41406. set by option <code>x</code> and <code>y</code>. The 3rd color component is static.
  41407. </p>
  41408. </dd>
  41409. <dt>&lsquo;<samp>color2</samp>&rsquo;</dt>
  41410. <dd><p>Actual color components values present in video frame are displayed on graph.
  41411. </p>
  41412. </dd>
  41413. <dt>&lsquo;<samp>color3</samp>&rsquo;</dt>
  41414. <dd><p>Similar as color2 but higher frequency of same values <code>x</code> and <code>y</code>
  41415. on graph increases value of another color component, which is luminance by
  41416. default values of <code>x</code> and <code>y</code>.
  41417. </p>
  41418. </dd>
  41419. <dt>&lsquo;<samp>color4</samp>&rsquo;</dt>
  41420. <dd><p>Actual colors present in video frame are displayed on graph. If two different
  41421. colors map to same position on graph then color with higher value of component
  41422. not present in graph is picked.
  41423. </p>
  41424. </dd>
  41425. <dt>&lsquo;<samp>color5</samp>&rsquo;</dt>
  41426. <dd><p>Gray values are displayed on graph. Similar to <code>color</code> but with 3rd color
  41427. component picked from radial gradient.
  41428. </p></dd>
  41429. </dl>
  41430. </dd>
  41431. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  41432. <dd><p>Set which color component will be represented on X-axis. Default is <code>1</code>.
  41433. </p>
  41434. </dd>
  41435. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  41436. <dd><p>Set which color component will be represented on Y-axis. Default is <code>2</code>.
  41437. </p>
  41438. </dd>
  41439. <dt>&lsquo;<samp>intensity, i</samp>&rsquo;</dt>
  41440. <dd><p>Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness
  41441. of color component which represents frequency of (X, Y) location in graph.
  41442. </p>
  41443. </dd>
  41444. <dt>&lsquo;<samp>envelope, e</samp>&rsquo;</dt>
  41445. <dd><dl compact="compact">
  41446. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  41447. <dd><p>No envelope, this is default.
  41448. </p>
  41449. </dd>
  41450. <dt>&lsquo;<samp>instant</samp>&rsquo;</dt>
  41451. <dd><p>Instant envelope, even darkest single pixel will be clearly highlighted.
  41452. </p>
  41453. </dd>
  41454. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  41455. <dd><p>Hold maximum and minimum values presented in graph over time. This way you
  41456. can still spot out of range values without constantly looking at vectorscope.
  41457. </p>
  41458. </dd>
  41459. <dt>&lsquo;<samp>peak+instant</samp>&rsquo;</dt>
  41460. <dd><p>Peak and instant envelope combined together.
  41461. </p></dd>
  41462. </dl>
  41463. </dd>
  41464. <dt>&lsquo;<samp>graticule, g</samp>&rsquo;</dt>
  41465. <dd><p>Set what kind of graticule to draw.
  41466. </p><dl compact="compact">
  41467. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  41468. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  41469. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  41470. <dt>&lsquo;<samp>invert</samp>&rsquo;</dt>
  41471. </dl>
  41472. </dd>
  41473. <dt>&lsquo;<samp>opacity, o</samp>&rsquo;</dt>
  41474. <dd><p>Set graticule opacity.
  41475. </p>
  41476. </dd>
  41477. <dt>&lsquo;<samp>flags, f</samp>&rsquo;</dt>
  41478. <dd><p>Set graticule flags.
  41479. </p>
  41480. <dl compact="compact">
  41481. <dt>&lsquo;<samp>white</samp>&rsquo;</dt>
  41482. <dd><p>Draw graticule for white point.
  41483. </p>
  41484. </dd>
  41485. <dt>&lsquo;<samp>black</samp>&rsquo;</dt>
  41486. <dd><p>Draw graticule for black point.
  41487. </p>
  41488. </dd>
  41489. <dt>&lsquo;<samp>name</samp>&rsquo;</dt>
  41490. <dd><p>Draw color points short names.
  41491. </p></dd>
  41492. </dl>
  41493. </dd>
  41494. <dt>&lsquo;<samp>bgopacity, b</samp>&rsquo;</dt>
  41495. <dd><p>Set background opacity.
  41496. </p>
  41497. </dd>
  41498. <dt>&lsquo;<samp>lthreshold, l</samp>&rsquo;</dt>
  41499. <dd><p>Set low threshold for color component not represented on X or Y axis.
  41500. Values lower than this value will be ignored. Default is 0.
  41501. Note this value is multiplied with actual max possible value one pixel component
  41502. can have. So for 8-bit input and low threshold value of 0.1 actual threshold
  41503. is 0.1 * 255 = 25.
  41504. </p>
  41505. </dd>
  41506. <dt>&lsquo;<samp>hthreshold, h</samp>&rsquo;</dt>
  41507. <dd><p>Set high threshold for color component not represented on X or Y axis.
  41508. Values higher than this value will be ignored. Default is 1.
  41509. Note this value is multiplied with actual max possible value one pixel component
  41510. can have. So for 8-bit input and high threshold value of 0.9 actual threshold
  41511. is 0.9 * 255 = 230.
  41512. </p>
  41513. </dd>
  41514. <dt>&lsquo;<samp>colorspace, c</samp>&rsquo;</dt>
  41515. <dd><p>Set what kind of colorspace to use when drawing graticule.
  41516. </p><dl compact="compact">
  41517. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  41518. <dt>&lsquo;<samp>601</samp>&rsquo;</dt>
  41519. <dt>&lsquo;<samp>709</samp>&rsquo;</dt>
  41520. </dl>
  41521. <p>Default is auto.
  41522. </p>
  41523. </dd>
  41524. <dt>&lsquo;<samp>tint0, t0</samp>&rsquo;</dt>
  41525. <dt>&lsquo;<samp>tint1, t1</samp>&rsquo;</dt>
  41526. <dd><p>Set color tint for gray/tint vectorscope mode. By default both options are zero.
  41527. This means no tint, and output will remain gray.
  41528. </p></dd>
  41529. </dl>
  41530. <p><a name="vidstabdetect"></a>
  41531. </p><a name="vidstabdetect-1"></a>
  41532. <h2 class="section"><a href="ffmpeg-all.html#toc-vidstabdetect-1">39.225 vidstabdetect</a></h2>
  41533. <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
  41534. <a href="#vidstabtransform">vidstabtransform</a> for pass 2.
  41535. </p>
  41536. <p>This filter generates a file with relative translation and rotation
  41537. transform information about subsequent frames, which is then used by
  41538. the <a href="#vidstabtransform">vidstabtransform</a> filter.
  41539. </p>
  41540. <p>To enable compilation of this filter you need to configure FFmpeg with
  41541. <code>--enable-libvidstab</code>.
  41542. </p>
  41543. <p>This filter accepts the following options:
  41544. </p>
  41545. <dl compact="compact">
  41546. <dt>&lsquo;<samp>result</samp>&rsquo;</dt>
  41547. <dd><p>Set the path to the file used to write the transforms information.
  41548. Default value is &lsquo;<tt>transforms.trf</tt>&rsquo;.
  41549. </p>
  41550. </dd>
  41551. <dt>&lsquo;<samp>shakiness</samp>&rsquo;</dt>
  41552. <dd><p>Set how shaky the video is and how quick the camera is. It accepts an
  41553. integer in the range 1-10, a value of 1 means little shakiness, a
  41554. value of 10 means strong shakiness. Default value is 5.
  41555. </p>
  41556. </dd>
  41557. <dt>&lsquo;<samp>accuracy</samp>&rsquo;</dt>
  41558. <dd><p>Set the accuracy of the detection process. It must be a value in the
  41559. range 1-15. A value of 1 means low accuracy, a value of 15 means high
  41560. accuracy. Default value is 15.
  41561. </p>
  41562. </dd>
  41563. <dt>&lsquo;<samp>stepsize</samp>&rsquo;</dt>
  41564. <dd><p>Set stepsize of the search process. The region around minimum is
  41565. scanned with 1 pixel resolution. Default value is 6.
  41566. </p>
  41567. </dd>
  41568. <dt>&lsquo;<samp>mincontrast</samp>&rsquo;</dt>
  41569. <dd><p>Set minimum contrast. Below this value a local measurement field is
  41570. discarded. Must be a floating point value in the range 0-1. Default
  41571. value is 0.3.
  41572. </p>
  41573. </dd>
  41574. <dt>&lsquo;<samp>tripod</samp>&rsquo;</dt>
  41575. <dd><p>Set reference frame number for tripod mode.
  41576. </p>
  41577. <p>If enabled, the motion of the frames is compared to a reference frame
  41578. in the filtered stream, identified by the specified number. The idea
  41579. is to compensate all movements in a more-or-less static scene and keep
  41580. the camera view absolutely still.
  41581. </p>
  41582. <p>If set to 0, it is disabled. The frames are counted starting from 1.
  41583. </p>
  41584. </dd>
  41585. <dt>&lsquo;<samp>show</samp>&rsquo;</dt>
  41586. <dd><p>Show fields and transforms in the resulting frames. It accepts an
  41587. integer in the range 0-2. Default value is 0, which disables any
  41588. visualization.
  41589. </p></dd>
  41590. </dl>
  41591. <a name="Examples-131"></a>
  41592. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-131">39.225.1 Examples</a></h3>
  41593. <ul>
  41594. <li>
  41595. Use default values:
  41596. <div class="example">
  41597. <pre class="example">vidstabdetect
  41598. </pre></div>
  41599. </li><li>
  41600. Analyze strongly shaky movie and put the results in file
  41601. &lsquo;<tt>mytransforms.trf</tt>&rsquo;:
  41602. <div class="example">
  41603. <pre class="example">vidstabdetect=shakiness=10:accuracy=15:result=&quot;mytransforms.trf&quot;
  41604. </pre></div>
  41605. </li><li>
  41606. Visualize the result of internal transformations in the resulting
  41607. video:
  41608. <div class="example">
  41609. <pre class="example">vidstabdetect=show=1
  41610. </pre></div>
  41611. </li><li>
  41612. Analyze a video with medium shakiness using <code>ffmpeg</code>:
  41613. <div class="example">
  41614. <pre class="example">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
  41615. </pre></div>
  41616. </li></ul>
  41617. <p><a name="vidstabtransform"></a>
  41618. </p><a name="vidstabtransform-1"></a>
  41619. <h2 class="section"><a href="ffmpeg-all.html#toc-vidstabtransform-1">39.226 vidstabtransform</a></h2>
  41620. <p>Video stabilization/deshaking: pass 2 of 2,
  41621. see <a href="#vidstabdetect">vidstabdetect</a> for pass 1.
  41622. </p>
  41623. <p>Read a file with transform information for each frame and
  41624. apply/compensate them. Together with the <a href="#vidstabdetect">vidstabdetect</a>
  41625. filter this can be used to deshake videos. See also
  41626. <a href="http://public.hronopik.de/vid.stab">http://public.hronopik.de/vid.stab</a>. It is important to also use
  41627. the <a href="#unsharp">unsharp</a> filter, see below.
  41628. </p>
  41629. <p>To enable compilation of this filter you need to configure FFmpeg with
  41630. <code>--enable-libvidstab</code>.
  41631. </p>
  41632. <a name="Options-76"></a>
  41633. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-76">39.226.1 Options</a></h3>
  41634. <dl compact="compact">
  41635. <dt>&lsquo;<samp>input</samp>&rsquo;</dt>
  41636. <dd><p>Set path to the file used to read the transforms. Default value is
  41637. &lsquo;<tt>transforms.trf</tt>&rsquo;.
  41638. </p>
  41639. </dd>
  41640. <dt>&lsquo;<samp>smoothing</samp>&rsquo;</dt>
  41641. <dd><p>Set the number of frames (value*2 + 1) used for lowpass filtering the
  41642. camera movements. Default value is 10.
  41643. </p>
  41644. <p>For example a number of 10 means that 21 frames are used (10 in the
  41645. past and 10 in the future) to smoothen the motion in the video. A
  41646. larger value leads to a smoother video, but limits the acceleration of
  41647. the camera (pan/tilt movements). 0 is a special case where a static
  41648. camera is simulated.
  41649. </p>
  41650. </dd>
  41651. <dt>&lsquo;<samp>optalgo</samp>&rsquo;</dt>
  41652. <dd><p>Set the camera path optimization algorithm.
  41653. </p>
  41654. <p>Accepted values are:
  41655. </p><dl compact="compact">
  41656. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  41657. <dd><p>gaussian kernel low-pass filter on camera motion (default)
  41658. </p></dd>
  41659. <dt>&lsquo;<samp>avg</samp>&rsquo;</dt>
  41660. <dd><p>averaging on transformations
  41661. </p></dd>
  41662. </dl>
  41663. </dd>
  41664. <dt>&lsquo;<samp>maxshift</samp>&rsquo;</dt>
  41665. <dd><p>Set maximal number of pixels to translate frames. Default value is -1,
  41666. meaning no limit.
  41667. </p>
  41668. </dd>
  41669. <dt>&lsquo;<samp>maxangle</samp>&rsquo;</dt>
  41670. <dd><p>Set maximal angle in radians (degree*PI/180) to rotate frames. Default
  41671. value is -1, meaning no limit.
  41672. </p>
  41673. </dd>
  41674. <dt>&lsquo;<samp>crop</samp>&rsquo;</dt>
  41675. <dd><p>Specify how to deal with borders that may be visible due to movement
  41676. compensation.
  41677. </p>
  41678. <p>Available values are:
  41679. </p><dl compact="compact">
  41680. <dt>&lsquo;<samp>keep</samp>&rsquo;</dt>
  41681. <dd><p>keep image information from previous frame (default)
  41682. </p></dd>
  41683. <dt>&lsquo;<samp>black</samp>&rsquo;</dt>
  41684. <dd><p>fill the border black
  41685. </p></dd>
  41686. </dl>
  41687. </dd>
  41688. <dt>&lsquo;<samp>invert</samp>&rsquo;</dt>
  41689. <dd><p>Invert transforms if set to 1. Default value is 0.
  41690. </p>
  41691. </dd>
  41692. <dt>&lsquo;<samp>relative</samp>&rsquo;</dt>
  41693. <dd><p>Consider transforms as relative to previous frame if set to 1,
  41694. absolute if set to 0. Default value is 0.
  41695. </p>
  41696. </dd>
  41697. <dt>&lsquo;<samp>zoom</samp>&rsquo;</dt>
  41698. <dd><p>Set percentage to zoom. A positive value will result in a zoom-in
  41699. effect, a negative value in a zoom-out effect. Default value is 0 (no
  41700. zoom).
  41701. </p>
  41702. </dd>
  41703. <dt>&lsquo;<samp>optzoom</samp>&rsquo;</dt>
  41704. <dd><p>Set optimal zooming to avoid borders.
  41705. </p>
  41706. <p>Accepted values are:
  41707. </p><dl compact="compact">
  41708. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  41709. <dd><p>disabled
  41710. </p></dd>
  41711. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  41712. <dd><p>optimal static zoom value is determined (only very strong movements
  41713. will lead to visible borders) (default)
  41714. </p></dd>
  41715. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  41716. <dd><p>optimal adaptive zoom value is determined (no borders will be
  41717. visible), see &lsquo;<samp>zoomspeed</samp>&rsquo;
  41718. </p></dd>
  41719. </dl>
  41720. <p>Note that the value given at zoom is added to the one calculated here.
  41721. </p>
  41722. </dd>
  41723. <dt>&lsquo;<samp>zoomspeed</samp>&rsquo;</dt>
  41724. <dd><p>Set percent to zoom maximally each frame (enabled when
  41725. &lsquo;<samp>optzoom</samp>&rsquo; is set to 2). Range is from 0 to 5, default value is
  41726. 0.25.
  41727. </p>
  41728. </dd>
  41729. <dt>&lsquo;<samp>interpol</samp>&rsquo;</dt>
  41730. <dd><p>Specify type of interpolation.
  41731. </p>
  41732. <p>Available values are:
  41733. </p><dl compact="compact">
  41734. <dt>&lsquo;<samp>no</samp>&rsquo;</dt>
  41735. <dd><p>no interpolation
  41736. </p></dd>
  41737. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  41738. <dd><p>linear only horizontal
  41739. </p></dd>
  41740. <dt>&lsquo;<samp>bilinear</samp>&rsquo;</dt>
  41741. <dd><p>linear in both directions (default)
  41742. </p></dd>
  41743. <dt>&lsquo;<samp>bicubic</samp>&rsquo;</dt>
  41744. <dd><p>cubic in both directions (slow)
  41745. </p></dd>
  41746. </dl>
  41747. </dd>
  41748. <dt>&lsquo;<samp>tripod</samp>&rsquo;</dt>
  41749. <dd><p>Enable virtual tripod mode if set to 1, which is equivalent to
  41750. <code>relative=0:smoothing=0</code>. Default value is 0.
  41751. </p>
  41752. <p>Use also <code>tripod</code> option of <a href="#vidstabdetect">vidstabdetect</a>.
  41753. </p>
  41754. </dd>
  41755. <dt>&lsquo;<samp>debug</samp>&rsquo;</dt>
  41756. <dd><p>Increase log verbosity if set to 1. Also the detected global motions
  41757. are written to the temporary file &lsquo;<tt>global_motions.trf</tt>&rsquo;. Default
  41758. value is 0.
  41759. </p></dd>
  41760. </dl>
  41761. <a name="Examples-18"></a>
  41762. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-18">39.226.2 Examples</a></h3>
  41763. <ul>
  41764. <li>
  41765. Use <code>ffmpeg</code> for a typical stabilization with default values:
  41766. <div class="example">
  41767. <pre class="example">ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
  41768. </pre></div>
  41769. <p>Note the use of the <a href="#unsharp">unsharp</a> filter which is always recommended.
  41770. </p>
  41771. </li><li>
  41772. Zoom in a bit more and load transform data from a given file:
  41773. <div class="example">
  41774. <pre class="example">vidstabtransform=zoom=5:input=&quot;mytransforms.trf&quot;
  41775. </pre></div>
  41776. </li><li>
  41777. Smoothen the video even more:
  41778. <div class="example">
  41779. <pre class="example">vidstabtransform=smoothing=30
  41780. </pre></div>
  41781. </li></ul>
  41782. <a name="vflip"></a>
  41783. <h2 class="section"><a href="ffmpeg-all.html#toc-vflip">39.227 vflip</a></h2>
  41784. <p>Flip the input video vertically.
  41785. </p>
  41786. <p>For example, to vertically flip a video with <code>ffmpeg</code>:
  41787. </p><div class="example">
  41788. <pre class="example">ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
  41789. </pre></div>
  41790. <a name="vfrdet"></a>
  41791. <h2 class="section"><a href="ffmpeg-all.html#toc-vfrdet">39.228 vfrdet</a></h2>
  41792. <p>Detect variable frame rate video.
  41793. </p>
  41794. <p>This filter tries to detect if the input is variable or constant frame rate.
  41795. </p>
  41796. <p>At end it will output number of frames detected as having variable delta pts,
  41797. and ones with constant delta pts.
  41798. If there was frames with variable delta, than it will also show min, max and
  41799. average delta encountered.
  41800. </p>
  41801. <a name="vibrance"></a>
  41802. <h2 class="section"><a href="ffmpeg-all.html#toc-vibrance">39.229 vibrance</a></h2>
  41803. <p>Boost or alter saturation.
  41804. </p>
  41805. <p>The filter accepts the following options:
  41806. </p><dl compact="compact">
  41807. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  41808. <dd><p>Set strength of boost if positive value or strength of alter if negative value.
  41809. Default is 0. Allowed range is from -2 to 2.
  41810. </p>
  41811. </dd>
  41812. <dt>&lsquo;<samp>rbal</samp>&rsquo;</dt>
  41813. <dd><p>Set the red balance. Default is 1. Allowed range is from -10 to 10.
  41814. </p>
  41815. </dd>
  41816. <dt>&lsquo;<samp>gbal</samp>&rsquo;</dt>
  41817. <dd><p>Set the green balance. Default is 1. Allowed range is from -10 to 10.
  41818. </p>
  41819. </dd>
  41820. <dt>&lsquo;<samp>bbal</samp>&rsquo;</dt>
  41821. <dd><p>Set the blue balance. Default is 1. Allowed range is from -10 to 10.
  41822. </p>
  41823. </dd>
  41824. <dt>&lsquo;<samp>rlum</samp>&rsquo;</dt>
  41825. <dd><p>Set the red luma coefficient.
  41826. </p>
  41827. </dd>
  41828. <dt>&lsquo;<samp>glum</samp>&rsquo;</dt>
  41829. <dd><p>Set the green luma coefficient.
  41830. </p>
  41831. </dd>
  41832. <dt>&lsquo;<samp>blum</samp>&rsquo;</dt>
  41833. <dd><p>Set the blue luma coefficient.
  41834. </p>
  41835. </dd>
  41836. <dt>&lsquo;<samp>alternate</samp>&rsquo;</dt>
  41837. <dd><p>If <code>intensity</code> is negative and this is set to 1, colors will change,
  41838. otherwise colors will be less saturated, more towards gray.
  41839. </p></dd>
  41840. </dl>
  41841. <a name="Commands-26"></a>
  41842. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-26">39.229.1 Commands</a></h3>
  41843. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  41844. </p>
  41845. <p><a name="vignette"></a>
  41846. </p><a name="vignette-1"></a>
  41847. <h2 class="section"><a href="ffmpeg-all.html#toc-vignette-1">39.230 vignette</a></h2>
  41848. <p>Make or reverse a natural vignetting effect.
  41849. </p>
  41850. <p>The filter accepts the following options:
  41851. </p>
  41852. <dl compact="compact">
  41853. <dt>&lsquo;<samp>angle, a</samp>&rsquo;</dt>
  41854. <dd><p>Set lens angle expression as a number of radians.
  41855. </p>
  41856. <p>The value is clipped in the <code>[0,PI/2]</code> range.
  41857. </p>
  41858. <p>Default value: <code>&quot;PI/5&quot;</code>
  41859. </p>
  41860. </dd>
  41861. <dt>&lsquo;<samp>x0</samp>&rsquo;</dt>
  41862. <dt>&lsquo;<samp>y0</samp>&rsquo;</dt>
  41863. <dd><p>Set center coordinates expressions. Respectively <code>&quot;w/2&quot;</code> and <code>&quot;h/2&quot;</code>
  41864. by default.
  41865. </p>
  41866. </dd>
  41867. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  41868. <dd><p>Set forward/backward mode.
  41869. </p>
  41870. <p>Available modes are:
  41871. </p><dl compact="compact">
  41872. <dt>&lsquo;<samp>forward</samp>&rsquo;</dt>
  41873. <dd><p>The larger the distance from the central point, the darker the image becomes.
  41874. </p>
  41875. </dd>
  41876. <dt>&lsquo;<samp>backward</samp>&rsquo;</dt>
  41877. <dd><p>The larger the distance from the central point, the brighter the image becomes.
  41878. This can be used to reverse a vignette effect, though there is no automatic
  41879. detection to extract the lens &lsquo;<samp>angle</samp>&rsquo; and other settings (yet). It can
  41880. also be used to create a burning effect.
  41881. </p></dd>
  41882. </dl>
  41883. <p>Default value is &lsquo;<samp>forward</samp>&rsquo;.
  41884. </p>
  41885. </dd>
  41886. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  41887. <dd><p>Set evaluation mode for the expressions (&lsquo;<samp>angle</samp>&rsquo;, &lsquo;<samp>x0</samp>&rsquo;, &lsquo;<samp>y0</samp>&rsquo;).
  41888. </p>
  41889. <p>It accepts the following values:
  41890. </p><dl compact="compact">
  41891. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  41892. <dd><p>Evaluate expressions only once during the filter initialization.
  41893. </p>
  41894. </dd>
  41895. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  41896. <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
  41897. &lsquo;<samp>init</samp>&rsquo; mode since it requires all the scalers to be re-computed, but it
  41898. allows advanced dynamic expressions.
  41899. </p></dd>
  41900. </dl>
  41901. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  41902. </p>
  41903. </dd>
  41904. <dt>&lsquo;<samp>dither</samp>&rsquo;</dt>
  41905. <dd><p>Set dithering to reduce the circular banding effects. Default is <code>1</code>
  41906. (enabled).
  41907. </p>
  41908. </dd>
  41909. <dt>&lsquo;<samp>aspect</samp>&rsquo;</dt>
  41910. <dd><p>Set vignette aspect. This setting allows one to adjust the shape of the vignette.
  41911. Setting this value to the SAR of the input will make a rectangular vignetting
  41912. following the dimensions of the video.
  41913. </p>
  41914. <p>Default is <code>1/1</code>.
  41915. </p></dd>
  41916. </dl>
  41917. <a name="Expressions"></a>
  41918. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Expressions">39.230.1 Expressions</a></h3>
  41919. <p>The &lsquo;<samp>alpha</samp>&rsquo;, &lsquo;<samp>x0</samp>&rsquo; and &lsquo;<samp>y0</samp>&rsquo; expressions can contain the
  41920. following parameters.
  41921. </p>
  41922. <dl compact="compact">
  41923. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  41924. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  41925. <dd><p>input width and height
  41926. </p>
  41927. </dd>
  41928. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  41929. <dd><p>the number of input frame, starting from 0
  41930. </p>
  41931. </dd>
  41932. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  41933. <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
  41934. <var>TB</var> units, NAN if undefined
  41935. </p>
  41936. </dd>
  41937. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  41938. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  41939. </p>
  41940. </dd>
  41941. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  41942. <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
  41943. expressed in seconds, NAN if undefined
  41944. </p>
  41945. </dd>
  41946. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  41947. <dd><p>time base of the input video
  41948. </p></dd>
  41949. </dl>
  41950. <a name="Examples-30"></a>
  41951. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-30">39.230.2 Examples</a></h3>
  41952. <ul>
  41953. <li>
  41954. Apply simple strong vignetting effect:
  41955. <div class="example">
  41956. <pre class="example">vignette=PI/4
  41957. </pre></div>
  41958. </li><li>
  41959. Make a flickering vignetting:
  41960. <div class="example">
  41961. <pre class="example">vignette='PI/4+random(1)*PI/50':eval=frame
  41962. </pre></div>
  41963. </li></ul>
  41964. <a name="vmafmotion"></a>
  41965. <h2 class="section"><a href="ffmpeg-all.html#toc-vmafmotion">39.231 vmafmotion</a></h2>
  41966. <p>Obtain the average VMAF motion score of a video.
  41967. It is one of the component metrics of VMAF.
  41968. </p>
  41969. <p>The obtained average motion score is printed through the logging system.
  41970. </p>
  41971. <p>The filter accepts the following options:
  41972. </p>
  41973. <dl compact="compact">
  41974. <dt>&lsquo;<samp>stats_file</samp>&rsquo;</dt>
  41975. <dd><p>If specified, the filter will use the named file to save the motion score of
  41976. each frame with respect to the previous frame.
  41977. When filename equals &quot;-&quot; the data is sent to standard output.
  41978. </p></dd>
  41979. </dl>
  41980. <p>Example:
  41981. </p><div class="example">
  41982. <pre class="example">ffmpeg -i ref.mpg -vf vmafmotion -f null -
  41983. </pre></div>
  41984. <a name="vstack"></a>
  41985. <h2 class="section"><a href="ffmpeg-all.html#toc-vstack">39.232 vstack</a></h2>
  41986. <p>Stack input videos vertically.
  41987. </p>
  41988. <p>All streams must be of same pixel format and of same width.
  41989. </p>
  41990. <p>Note that this filter is faster than using <a href="#overlay">overlay</a> and <a href="#pad">pad</a> filter
  41991. to create same output.
  41992. </p>
  41993. <p>The filter accepts the following options:
  41994. </p>
  41995. <dl compact="compact">
  41996. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  41997. <dd><p>Set number of input streams. Default is 2.
  41998. </p>
  41999. </dd>
  42000. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  42001. <dd><p>If set to 1, force the output to terminate when the shortest input
  42002. terminates. Default value is 0.
  42003. </p></dd>
  42004. </dl>
  42005. <a name="w3fdif"></a>
  42006. <h2 class="section"><a href="ffmpeg-all.html#toc-w3fdif">39.233 w3fdif</a></h2>
  42007. <p>Deinterlace the input video (&quot;w3fdif&quot; stands for &quot;Weston 3 Field
  42008. Deinterlacing Filter&quot;).
  42009. </p>
  42010. <p>Based on the process described by Martin Weston for BBC R&amp;D, and
  42011. implemented based on the de-interlace algorithm written by Jim
  42012. Easterbrook for BBC R&amp;D, the Weston 3 field deinterlacing filter
  42013. uses filter coefficients calculated by BBC R&amp;D.
  42014. </p>
  42015. <p>This filter uses field-dominance information in frame to decide which
  42016. of each pair of fields to place first in the output.
  42017. If it gets it wrong use <a href="#setfield">setfield</a> filter before <code>w3fdif</code> filter.
  42018. </p>
  42019. <p>There are two sets of filter coefficients, so called &quot;simple&quot;
  42020. and &quot;complex&quot;. Which set of filter coefficients is used can
  42021. be set by passing an optional parameter:
  42022. </p>
  42023. <dl compact="compact">
  42024. <dt>&lsquo;<samp>filter</samp>&rsquo;</dt>
  42025. <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
  42026. </p>
  42027. <dl compact="compact">
  42028. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  42029. <dd><p>Simple filter coefficient set.
  42030. </p></dd>
  42031. <dt>&lsquo;<samp>complex</samp>&rsquo;</dt>
  42032. <dd><p>More-complex filter coefficient set.
  42033. </p></dd>
  42034. </dl>
  42035. <p>Default value is &lsquo;<samp>complex</samp>&rsquo;.
  42036. </p>
  42037. </dd>
  42038. <dt>&lsquo;<samp>deint</samp>&rsquo;</dt>
  42039. <dd><p>Specify which frames to deinterlace. Accepts one of the following values:
  42040. </p>
  42041. <dl compact="compact">
  42042. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  42043. <dd><p>Deinterlace all frames,
  42044. </p></dd>
  42045. <dt>&lsquo;<samp>interlaced</samp>&rsquo;</dt>
  42046. <dd><p>Only deinterlace frames marked as interlaced.
  42047. </p></dd>
  42048. </dl>
  42049. <p>Default value is &lsquo;<samp>all</samp>&rsquo;.
  42050. </p></dd>
  42051. </dl>
  42052. <a name="waveform"></a>
  42053. <h2 class="section"><a href="ffmpeg-all.html#toc-waveform">39.234 waveform</a></h2>
  42054. <p>Video waveform monitor.
  42055. </p>
  42056. <p>The waveform monitor plots color component intensity. By default luminance
  42057. only. Each column of the waveform corresponds to a column of pixels in the
  42058. source video.
  42059. </p>
  42060. <p>It accepts the following options:
  42061. </p>
  42062. <dl compact="compact">
  42063. <dt>&lsquo;<samp>mode, m</samp>&rsquo;</dt>
  42064. <dd><p>Can be either <code>row</code>, or <code>column</code>. Default is <code>column</code>.
  42065. In row mode, the graph on the left side represents color component value 0 and
  42066. the right side represents value = 255. In column mode, the top side represents
  42067. color component value = 0 and bottom side represents value = 255.
  42068. </p>
  42069. </dd>
  42070. <dt>&lsquo;<samp>intensity, i</samp>&rsquo;</dt>
  42071. <dd><p>Set intensity. Smaller values are useful to find out how many values of the same
  42072. luminance are distributed across input rows/columns.
  42073. Default value is <code>0.04</code>. Allowed range is [0, 1].
  42074. </p>
  42075. </dd>
  42076. <dt>&lsquo;<samp>mirror, r</samp>&rsquo;</dt>
  42077. <dd><p>Set mirroring mode. <code>0</code> means unmirrored, <code>1</code> means mirrored.
  42078. In mirrored mode, higher values will be represented on the left
  42079. side for <code>row</code> mode and at the top for <code>column</code> mode. Default is
  42080. <code>1</code> (mirrored).
  42081. </p>
  42082. </dd>
  42083. <dt>&lsquo;<samp>display, d</samp>&rsquo;</dt>
  42084. <dd><p>Set display mode.
  42085. It accepts the following values:
  42086. </p><dl compact="compact">
  42087. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  42088. <dd><p>Presents information identical to that in the <code>parade</code>, except
  42089. that the graphs representing color components are superimposed directly
  42090. over one another.
  42091. </p>
  42092. <p>This display mode makes it easier to spot relative differences or similarities
  42093. in overlapping areas of the color components that are supposed to be identical,
  42094. such as neutral whites, grays, or blacks.
  42095. </p>
  42096. </dd>
  42097. <dt>&lsquo;<samp>stack</samp>&rsquo;</dt>
  42098. <dd><p>Display separate graph for the color components side by side in
  42099. <code>row</code> mode or one below the other in <code>column</code> mode.
  42100. </p>
  42101. </dd>
  42102. <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
  42103. <dd><p>Display separate graph for the color components side by side in
  42104. <code>column</code> mode or one below the other in <code>row</code> mode.
  42105. </p>
  42106. <p>Using this display mode makes it easy to spot color casts in the highlights
  42107. and shadows of an image, by comparing the contours of the top and the bottom
  42108. graphs of each waveform. Since whites, grays, and blacks are characterized
  42109. by exactly equal amounts of red, green, and blue, neutral areas of the picture
  42110. should display three waveforms of roughly equal width/height. If not, the
  42111. correction is easy to perform by making level adjustments the three waveforms.
  42112. </p></dd>
  42113. </dl>
  42114. <p>Default is <code>stack</code>.
  42115. </p>
  42116. </dd>
  42117. <dt>&lsquo;<samp>components, c</samp>&rsquo;</dt>
  42118. <dd><p>Set which color components to display. Default is 1, which means only luminance
  42119. or red color component if input is in RGB colorspace. If is set for example to
  42120. 7 it will display all 3 (if) available color components.
  42121. </p>
  42122. </dd>
  42123. <dt>&lsquo;<samp>envelope, e</samp>&rsquo;</dt>
  42124. <dd><dl compact="compact">
  42125. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  42126. <dd><p>No envelope, this is default.
  42127. </p>
  42128. </dd>
  42129. <dt>&lsquo;<samp>instant</samp>&rsquo;</dt>
  42130. <dd><p>Instant envelope, minimum and maximum values presented in graph will be easily
  42131. visible even with small <code>step</code> value.
  42132. </p>
  42133. </dd>
  42134. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  42135. <dd><p>Hold minimum and maximum values presented in graph across time. This way you
  42136. can still spot out of range values without constantly looking at waveforms.
  42137. </p>
  42138. </dd>
  42139. <dt>&lsquo;<samp>peak+instant</samp>&rsquo;</dt>
  42140. <dd><p>Peak and instant envelope combined together.
  42141. </p></dd>
  42142. </dl>
  42143. </dd>
  42144. <dt>&lsquo;<samp>filter, f</samp>&rsquo;</dt>
  42145. <dd><dl compact="compact">
  42146. <dt>&lsquo;<samp>lowpass</samp>&rsquo;</dt>
  42147. <dd><p>No filtering, this is default.
  42148. </p>
  42149. </dd>
  42150. <dt>&lsquo;<samp>flat</samp>&rsquo;</dt>
  42151. <dd><p>Luma and chroma combined together.
  42152. </p>
  42153. </dd>
  42154. <dt>&lsquo;<samp>aflat</samp>&rsquo;</dt>
  42155. <dd><p>Similar as above, but shows difference between blue and red chroma.
  42156. </p>
  42157. </dd>
  42158. <dt>&lsquo;<samp>xflat</samp>&rsquo;</dt>
  42159. <dd><p>Similar as above, but use different colors.
  42160. </p>
  42161. </dd>
  42162. <dt>&lsquo;<samp>yflat</samp>&rsquo;</dt>
  42163. <dd><p>Similar as above, but again with different colors.
  42164. </p>
  42165. </dd>
  42166. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  42167. <dd><p>Displays only chroma.
  42168. </p>
  42169. </dd>
  42170. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  42171. <dd><p>Displays actual color value on waveform.
  42172. </p>
  42173. </dd>
  42174. <dt>&lsquo;<samp>acolor</samp>&rsquo;</dt>
  42175. <dd><p>Similar as above, but with luma showing frequency of chroma values.
  42176. </p></dd>
  42177. </dl>
  42178. </dd>
  42179. <dt>&lsquo;<samp>graticule, g</samp>&rsquo;</dt>
  42180. <dd><p>Set which graticule to display.
  42181. </p>
  42182. <dl compact="compact">
  42183. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  42184. <dd><p>Do not display graticule.
  42185. </p>
  42186. </dd>
  42187. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  42188. <dd><p>Display green graticule showing legal broadcast ranges.
  42189. </p>
  42190. </dd>
  42191. <dt>&lsquo;<samp>orange</samp>&rsquo;</dt>
  42192. <dd><p>Display orange graticule showing legal broadcast ranges.
  42193. </p>
  42194. </dd>
  42195. <dt>&lsquo;<samp>invert</samp>&rsquo;</dt>
  42196. <dd><p>Display invert graticule showing legal broadcast ranges.
  42197. </p></dd>
  42198. </dl>
  42199. </dd>
  42200. <dt>&lsquo;<samp>opacity, o</samp>&rsquo;</dt>
  42201. <dd><p>Set graticule opacity.
  42202. </p>
  42203. </dd>
  42204. <dt>&lsquo;<samp>flags, fl</samp>&rsquo;</dt>
  42205. <dd><p>Set graticule flags.
  42206. </p>
  42207. <dl compact="compact">
  42208. <dt>&lsquo;<samp>numbers</samp>&rsquo;</dt>
  42209. <dd><p>Draw numbers above lines. By default enabled.
  42210. </p>
  42211. </dd>
  42212. <dt>&lsquo;<samp>dots</samp>&rsquo;</dt>
  42213. <dd><p>Draw dots instead of lines.
  42214. </p></dd>
  42215. </dl>
  42216. </dd>
  42217. <dt>&lsquo;<samp>scale, s</samp>&rsquo;</dt>
  42218. <dd><p>Set scale used for displaying graticule.
  42219. </p>
  42220. <dl compact="compact">
  42221. <dt>&lsquo;<samp>digital</samp>&rsquo;</dt>
  42222. <dt>&lsquo;<samp>millivolts</samp>&rsquo;</dt>
  42223. <dt>&lsquo;<samp>ire</samp>&rsquo;</dt>
  42224. </dl>
  42225. <p>Default is digital.
  42226. </p>
  42227. </dd>
  42228. <dt>&lsquo;<samp>bgopacity, b</samp>&rsquo;</dt>
  42229. <dd><p>Set background opacity.
  42230. </p>
  42231. </dd>
  42232. <dt>&lsquo;<samp>tint0, t0</samp>&rsquo;</dt>
  42233. <dt>&lsquo;<samp>tint1, t1</samp>&rsquo;</dt>
  42234. <dd><p>Set tint for output.
  42235. Only used with lowpass filter and when display is not overlay and input
  42236. pixel formats are not RGB.
  42237. </p></dd>
  42238. </dl>
  42239. <a name="weave_002c-doubleweave"></a>
  42240. <h2 class="section"><a href="ffmpeg-all.html#toc-weave_002c-doubleweave">39.235 weave, doubleweave</a></h2>
  42241. <p>The <code>weave</code> takes a field-based video input and join
  42242. each two sequential fields into single frame, producing a new double
  42243. height clip with half the frame rate and half the frame count.
  42244. </p>
  42245. <p>The <code>doubleweave</code> works same as <code>weave</code> but without
  42246. halving frame rate and frame count.
  42247. </p>
  42248. <p>It accepts the following option:
  42249. </p>
  42250. <dl compact="compact">
  42251. <dt>&lsquo;<samp>first_field</samp>&rsquo;</dt>
  42252. <dd><p>Set first field. Available values are:
  42253. </p>
  42254. <dl compact="compact">
  42255. <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
  42256. <dd><p>Set the frame as top-field-first.
  42257. </p>
  42258. </dd>
  42259. <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
  42260. <dd><p>Set the frame as bottom-field-first.
  42261. </p></dd>
  42262. </dl>
  42263. </dd>
  42264. </dl>
  42265. <a name="Examples-19"></a>
  42266. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-19">39.235.1 Examples</a></h3>
  42267. <ul>
  42268. <li>
  42269. Interlace video using <a href="#select">select</a> and <a href="#separatefields">separatefields</a> filter:
  42270. <div class="example">
  42271. <pre class="example">separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
  42272. </pre></div>
  42273. </li></ul>
  42274. <a name="xbr"></a>
  42275. <h2 class="section"><a href="ffmpeg-all.html#toc-xbr">39.236 xbr</a></h2>
  42276. <p>Apply the xBR high-quality magnification filter which is designed for pixel
  42277. art. It follows a set of edge-detection rules, see
  42278. <a href="https://forums.libretro.com/t/xbr-algorithm-tutorial/123">https://forums.libretro.com/t/xbr-algorithm-tutorial/123</a>.
  42279. </p>
  42280. <p>It accepts the following option:
  42281. </p>
  42282. <dl compact="compact">
  42283. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  42284. <dd><p>Set the scaling dimension: <code>2</code> for <code>2xBR</code>, <code>3</code> for
  42285. <code>3xBR</code> and <code>4</code> for <code>4xBR</code>.
  42286. Default is <code>3</code>.
  42287. </p></dd>
  42288. </dl>
  42289. <a name="xfade"></a>
  42290. <h2 class="section"><a href="ffmpeg-all.html#toc-xfade">39.237 xfade</a></h2>
  42291. <p>Apply cross fade from one input video stream to another input video stream.
  42292. The cross fade is applied for specified duration.
  42293. </p>
  42294. <p>The filter accepts the following options:
  42295. </p>
  42296. <dl compact="compact">
  42297. <dt>&lsquo;<samp>transition</samp>&rsquo;</dt>
  42298. <dd><p>Set one of available transition effects:
  42299. </p>
  42300. <dl compact="compact">
  42301. <dt>&lsquo;<samp>custom</samp>&rsquo;</dt>
  42302. <dt>&lsquo;<samp>fade</samp>&rsquo;</dt>
  42303. <dt>&lsquo;<samp>wipeleft</samp>&rsquo;</dt>
  42304. <dt>&lsquo;<samp>wiperight</samp>&rsquo;</dt>
  42305. <dt>&lsquo;<samp>wipeup</samp>&rsquo;</dt>
  42306. <dt>&lsquo;<samp>wipedown</samp>&rsquo;</dt>
  42307. <dt>&lsquo;<samp>slideleft</samp>&rsquo;</dt>
  42308. <dt>&lsquo;<samp>slideright</samp>&rsquo;</dt>
  42309. <dt>&lsquo;<samp>slideup</samp>&rsquo;</dt>
  42310. <dt>&lsquo;<samp>slidedown</samp>&rsquo;</dt>
  42311. <dt>&lsquo;<samp>circlecrop</samp>&rsquo;</dt>
  42312. <dt>&lsquo;<samp>rectcrop</samp>&rsquo;</dt>
  42313. <dt>&lsquo;<samp>distance</samp>&rsquo;</dt>
  42314. <dt>&lsquo;<samp>fadeblack</samp>&rsquo;</dt>
  42315. <dt>&lsquo;<samp>fadewhite</samp>&rsquo;</dt>
  42316. <dt>&lsquo;<samp>radial</samp>&rsquo;</dt>
  42317. <dt>&lsquo;<samp>smoothleft</samp>&rsquo;</dt>
  42318. <dt>&lsquo;<samp>smoothright</samp>&rsquo;</dt>
  42319. <dt>&lsquo;<samp>smoothup</samp>&rsquo;</dt>
  42320. <dt>&lsquo;<samp>smoothdown</samp>&rsquo;</dt>
  42321. <dt>&lsquo;<samp>circleopen</samp>&rsquo;</dt>
  42322. <dt>&lsquo;<samp>circleclose</samp>&rsquo;</dt>
  42323. <dt>&lsquo;<samp>vertopen</samp>&rsquo;</dt>
  42324. <dt>&lsquo;<samp>vertclose</samp>&rsquo;</dt>
  42325. <dt>&lsquo;<samp>horzopen</samp>&rsquo;</dt>
  42326. <dt>&lsquo;<samp>horzclose</samp>&rsquo;</dt>
  42327. <dt>&lsquo;<samp>dissolve</samp>&rsquo;</dt>
  42328. <dt>&lsquo;<samp>pixelize</samp>&rsquo;</dt>
  42329. <dt>&lsquo;<samp>diagtl</samp>&rsquo;</dt>
  42330. <dt>&lsquo;<samp>diagtr</samp>&rsquo;</dt>
  42331. <dt>&lsquo;<samp>diagbl</samp>&rsquo;</dt>
  42332. <dt>&lsquo;<samp>diagbr</samp>&rsquo;</dt>
  42333. <dt>&lsquo;<samp>hlslice</samp>&rsquo;</dt>
  42334. <dt>&lsquo;<samp>hrslice</samp>&rsquo;</dt>
  42335. <dt>&lsquo;<samp>vuslice</samp>&rsquo;</dt>
  42336. <dt>&lsquo;<samp>vdslice</samp>&rsquo;</dt>
  42337. </dl>
  42338. <p>Default transition effect is fade.
  42339. </p>
  42340. </dd>
  42341. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  42342. <dd><p>Set cross fade duration in seconds.
  42343. Default duration is 1 second.
  42344. </p>
  42345. </dd>
  42346. <dt>&lsquo;<samp>offset</samp>&rsquo;</dt>
  42347. <dd><p>Set cross fade start relative to first input stream in seconds.
  42348. Default offset is 0.
  42349. </p>
  42350. </dd>
  42351. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  42352. <dd><p>Set expression for custom transition effect.
  42353. </p>
  42354. <p>The expressions can use the following variables and functions:
  42355. </p>
  42356. <dl compact="compact">
  42357. <dt>&lsquo;<samp>X</samp>&rsquo;</dt>
  42358. <dt>&lsquo;<samp>Y</samp>&rsquo;</dt>
  42359. <dd><p>The coordinates of the current sample.
  42360. </p>
  42361. </dd>
  42362. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  42363. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  42364. <dd><p>The width and height of the image.
  42365. </p>
  42366. </dd>
  42367. <dt>&lsquo;<samp>P</samp>&rsquo;</dt>
  42368. <dd><p>Progress of transition effect.
  42369. </p>
  42370. </dd>
  42371. <dt>&lsquo;<samp>PLANE</samp>&rsquo;</dt>
  42372. <dd><p>Currently processed plane.
  42373. </p>
  42374. </dd>
  42375. <dt>&lsquo;<samp>A</samp>&rsquo;</dt>
  42376. <dd><p>Return value of first input at current location and plane.
  42377. </p>
  42378. </dd>
  42379. <dt>&lsquo;<samp>B</samp>&rsquo;</dt>
  42380. <dd><p>Return value of second input at current location and plane.
  42381. </p>
  42382. </dd>
  42383. <dt>&lsquo;<samp>a0(x, y)</samp>&rsquo;</dt>
  42384. <dt>&lsquo;<samp>a1(x, y)</samp>&rsquo;</dt>
  42385. <dt>&lsquo;<samp>a2(x, y)</samp>&rsquo;</dt>
  42386. <dt>&lsquo;<samp>a3(x, y)</samp>&rsquo;</dt>
  42387. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  42388. first/second/third/fourth component of first input.
  42389. </p>
  42390. </dd>
  42391. <dt>&lsquo;<samp>b0(x, y)</samp>&rsquo;</dt>
  42392. <dt>&lsquo;<samp>b1(x, y)</samp>&rsquo;</dt>
  42393. <dt>&lsquo;<samp>b2(x, y)</samp>&rsquo;</dt>
  42394. <dt>&lsquo;<samp>b3(x, y)</samp>&rsquo;</dt>
  42395. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  42396. first/second/third/fourth component of second input.
  42397. </p></dd>
  42398. </dl>
  42399. </dd>
  42400. </dl>
  42401. <a name="Examples-41"></a>
  42402. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-41">39.237.1 Examples</a></h3>
  42403. <ul>
  42404. <li>
  42405. Cross fade from one input video to another input video, with fade transition and duration of transition
  42406. of 2 seconds starting at offset of 5 seconds:
  42407. <div class="example">
  42408. <pre class="example">ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
  42409. </pre></div>
  42410. </li></ul>
  42411. <a name="xmedian"></a>
  42412. <h2 class="section"><a href="ffmpeg-all.html#toc-xmedian">39.238 xmedian</a></h2>
  42413. <p>Pick median pixels from several input videos.
  42414. </p>
  42415. <p>The filter accepts the following options:
  42416. </p>
  42417. <dl compact="compact">
  42418. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  42419. <dd><p>Set number of inputs.
  42420. Default is 3. Allowed range is from 3 to 255.
  42421. If number of inputs is even number, than result will be mean value between two median values.
  42422. </p>
  42423. </dd>
  42424. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  42425. <dd><p>Set which planes to filter. Default value is <code>15</code>, by which all planes are processed.
  42426. </p>
  42427. </dd>
  42428. <dt>&lsquo;<samp>percentile</samp>&rsquo;</dt>
  42429. <dd><p>Set median percentile. Default value is <code>0.5</code>.
  42430. Default value of <code>0.5</code> will pick always median values, while <code>0</code> will pick
  42431. minimum values, and <code>1</code> maximum values.
  42432. </p></dd>
  42433. </dl>
  42434. <a name="xstack"></a>
  42435. <h2 class="section"><a href="ffmpeg-all.html#toc-xstack">39.239 xstack</a></h2>
  42436. <p>Stack video inputs into custom layout.
  42437. </p>
  42438. <p>All streams must be of same pixel format.
  42439. </p>
  42440. <p>The filter accepts the following options:
  42441. </p>
  42442. <dl compact="compact">
  42443. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  42444. <dd><p>Set number of input streams. Default is 2.
  42445. </p>
  42446. </dd>
  42447. <dt>&lsquo;<samp>layout</samp>&rsquo;</dt>
  42448. <dd><p>Specify layout of inputs.
  42449. This option requires the desired layout configuration to be explicitly set by the user.
  42450. This sets position of each video input in output. Each input
  42451. is separated by &rsquo;|&rsquo;.
  42452. The first number represents the column, and the second number represents the row.
  42453. Numbers start at 0 and are separated by &rsquo;_&rsquo;. Optionally one can use wX and hX,
  42454. where X is video input from which to take width or height.
  42455. Multiple values can be used when separated by &rsquo;+&rsquo;. In such
  42456. case values are summed together.
  42457. </p>
  42458. <p>Note that if inputs are of different sizes gaps may appear, as not all of
  42459. the output video frame will be filled. Similarly, videos can overlap each
  42460. other if their position doesn&rsquo;t leave enough space for the full frame of
  42461. adjoining videos.
  42462. </p>
  42463. <p>For 2 inputs, a default layout of <code>0_0|w0_0</code> is set. In all other cases,
  42464. a layout must be set by the user.
  42465. </p>
  42466. </dd>
  42467. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  42468. <dd><p>If set to 1, force the output to terminate when the shortest input
  42469. terminates. Default value is 0.
  42470. </p>
  42471. </dd>
  42472. <dt>&lsquo;<samp>fill</samp>&rsquo;</dt>
  42473. <dd><p>If set to valid color, all unused pixels will be filled with that color.
  42474. By default fill is set to none, so it is disabled.
  42475. </p></dd>
  42476. </dl>
  42477. <a name="Examples-81"></a>
  42478. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-81">39.239.1 Examples</a></h3>
  42479. <ul>
  42480. <li>
  42481. Display 4 inputs into 2x2 grid.
  42482. <p>Layout:
  42483. </p><div class="example">
  42484. <pre class="example">input1(0, 0) | input3(w0, 0)
  42485. input2(0, h0) | input4(w0, h0)
  42486. </pre></div>
  42487. <div class="example">
  42488. <pre class="example">xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0
  42489. </pre></div>
  42490. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  42491. </p>
  42492. </li><li>
  42493. Display 4 inputs into 1x4 grid.
  42494. <p>Layout:
  42495. </p><div class="example">
  42496. <pre class="example">input1(0, 0)
  42497. input2(0, h0)
  42498. input3(0, h0+h1)
  42499. input4(0, h0+h1+h2)
  42500. </pre></div>
  42501. <div class="example">
  42502. <pre class="example">xstack=inputs=4:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2
  42503. </pre></div>
  42504. <p>Note that if inputs are of different widths, unused space will appear.
  42505. </p>
  42506. </li><li>
  42507. Display 9 inputs into 3x3 grid.
  42508. <p>Layout:
  42509. </p><div class="example">
  42510. <pre class="example">input1(0, 0) | input4(w0, 0) | input7(w0+w3, 0)
  42511. input2(0, h0) | input5(w0, h0) | input8(w0+w3, h0)
  42512. input3(0, h0+h1) | input6(w0, h0+h1) | input9(w0+w3, h0+h1)
  42513. </pre></div>
  42514. <div class="example">
  42515. <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
  42516. </pre></div>
  42517. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  42518. </p>
  42519. </li><li>
  42520. Display 16 inputs into 4x4 grid.
  42521. <p>Layout:
  42522. </p><div class="example">
  42523. <pre class="example">input1(0, 0) | input5(w0, 0) | input9 (w0+w4, 0) | input13(w0+w4+w8, 0)
  42524. input2(0, h0) | input6(w0, h0) | input10(w0+w4, h0) | input14(w0+w4+w8, h0)
  42525. input3(0, h0+h1) | input7(w0, h0+h1) | input11(w0+w4, h0+h1) | input15(w0+w4+w8, h0+h1)
  42526. input4(0, h0+h1+h2)| input8(w0, h0+h1+h2)| input12(w0+w4, h0+h1+h2)| input16(w0+w4+w8, h0+h1+h2)
  42527. </pre></div>
  42528. <div class="example">
  42529. <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|
  42530. 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
  42531. </pre></div>
  42532. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  42533. </p>
  42534. </li></ul>
  42535. <p><a name="yadif"></a>
  42536. </p><a name="yadif-1"></a>
  42537. <h2 class="section"><a href="ffmpeg-all.html#toc-yadif-1">39.240 yadif</a></h2>
  42538. <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
  42539. filter&quot;).
  42540. </p>
  42541. <p>It accepts the following parameters:
  42542. </p>
  42543. <dl compact="compact">
  42544. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  42545. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  42546. </p>
  42547. <dl compact="compact">
  42548. <dt>&lsquo;<samp>0, send_frame</samp>&rsquo;</dt>
  42549. <dd><p>Output one frame for each frame.
  42550. </p></dd>
  42551. <dt>&lsquo;<samp>1, send_field</samp>&rsquo;</dt>
  42552. <dd><p>Output one frame for each field.
  42553. </p></dd>
  42554. <dt>&lsquo;<samp>2, send_frame_nospatial</samp>&rsquo;</dt>
  42555. <dd><p>Like <code>send_frame</code>, but it skips the spatial interlacing check.
  42556. </p></dd>
  42557. <dt>&lsquo;<samp>3, send_field_nospatial</samp>&rsquo;</dt>
  42558. <dd><p>Like <code>send_field</code>, but it skips the spatial interlacing check.
  42559. </p></dd>
  42560. </dl>
  42561. <p>The default value is <code>send_frame</code>.
  42562. </p>
  42563. </dd>
  42564. <dt>&lsquo;<samp>parity</samp>&rsquo;</dt>
  42565. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  42566. of the following values:
  42567. </p>
  42568. <dl compact="compact">
  42569. <dt>&lsquo;<samp>0, tff</samp>&rsquo;</dt>
  42570. <dd><p>Assume the top field is first.
  42571. </p></dd>
  42572. <dt>&lsquo;<samp>1, bff</samp>&rsquo;</dt>
  42573. <dd><p>Assume the bottom field is first.
  42574. </p></dd>
  42575. <dt>&lsquo;<samp>-1, auto</samp>&rsquo;</dt>
  42576. <dd><p>Enable automatic detection of field parity.
  42577. </p></dd>
  42578. </dl>
  42579. <p>The default value is <code>auto</code>.
  42580. If the interlacing is unknown or the decoder does not export this information,
  42581. top field first will be assumed.
  42582. </p>
  42583. </dd>
  42584. <dt>&lsquo;<samp>deint</samp>&rsquo;</dt>
  42585. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  42586. values:
  42587. </p>
  42588. <dl compact="compact">
  42589. <dt>&lsquo;<samp>0, all</samp>&rsquo;</dt>
  42590. <dd><p>Deinterlace all frames.
  42591. </p></dd>
  42592. <dt>&lsquo;<samp>1, interlaced</samp>&rsquo;</dt>
  42593. <dd><p>Only deinterlace frames marked as interlaced.
  42594. </p></dd>
  42595. </dl>
  42596. <p>The default value is <code>all</code>.
  42597. </p></dd>
  42598. </dl>
  42599. <a name="yadif_005fcuda"></a>
  42600. <h2 class="section"><a href="ffmpeg-all.html#toc-yadif_005fcuda">39.241 yadif_cuda</a></h2>
  42601. <p>Deinterlace the input video using the <a href="#yadif">yadif</a> algorithm, but implemented
  42602. in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec
  42603. and/or nvenc.
  42604. </p>
  42605. <p>It accepts the following parameters:
  42606. </p>
  42607. <dl compact="compact">
  42608. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  42609. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  42610. </p>
  42611. <dl compact="compact">
  42612. <dt>&lsquo;<samp>0, send_frame</samp>&rsquo;</dt>
  42613. <dd><p>Output one frame for each frame.
  42614. </p></dd>
  42615. <dt>&lsquo;<samp>1, send_field</samp>&rsquo;</dt>
  42616. <dd><p>Output one frame for each field.
  42617. </p></dd>
  42618. <dt>&lsquo;<samp>2, send_frame_nospatial</samp>&rsquo;</dt>
  42619. <dd><p>Like <code>send_frame</code>, but it skips the spatial interlacing check.
  42620. </p></dd>
  42621. <dt>&lsquo;<samp>3, send_field_nospatial</samp>&rsquo;</dt>
  42622. <dd><p>Like <code>send_field</code>, but it skips the spatial interlacing check.
  42623. </p></dd>
  42624. </dl>
  42625. <p>The default value is <code>send_frame</code>.
  42626. </p>
  42627. </dd>
  42628. <dt>&lsquo;<samp>parity</samp>&rsquo;</dt>
  42629. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  42630. of the following values:
  42631. </p>
  42632. <dl compact="compact">
  42633. <dt>&lsquo;<samp>0, tff</samp>&rsquo;</dt>
  42634. <dd><p>Assume the top field is first.
  42635. </p></dd>
  42636. <dt>&lsquo;<samp>1, bff</samp>&rsquo;</dt>
  42637. <dd><p>Assume the bottom field is first.
  42638. </p></dd>
  42639. <dt>&lsquo;<samp>-1, auto</samp>&rsquo;</dt>
  42640. <dd><p>Enable automatic detection of field parity.
  42641. </p></dd>
  42642. </dl>
  42643. <p>The default value is <code>auto</code>.
  42644. If the interlacing is unknown or the decoder does not export this information,
  42645. top field first will be assumed.
  42646. </p>
  42647. </dd>
  42648. <dt>&lsquo;<samp>deint</samp>&rsquo;</dt>
  42649. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  42650. values:
  42651. </p>
  42652. <dl compact="compact">
  42653. <dt>&lsquo;<samp>0, all</samp>&rsquo;</dt>
  42654. <dd><p>Deinterlace all frames.
  42655. </p></dd>
  42656. <dt>&lsquo;<samp>1, interlaced</samp>&rsquo;</dt>
  42657. <dd><p>Only deinterlace frames marked as interlaced.
  42658. </p></dd>
  42659. </dl>
  42660. <p>The default value is <code>all</code>.
  42661. </p></dd>
  42662. </dl>
  42663. <a name="yaepblur"></a>
  42664. <h2 class="section"><a href="ffmpeg-all.html#toc-yaepblur">39.242 yaepblur</a></h2>
  42665. <p>Apply blur filter while preserving edges (&quot;yaepblur&quot; means &quot;yet another edge preserving blur filter&quot;).
  42666. The algorithm is described in
  42667. &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;
  42668. </p>
  42669. <p>It accepts the following parameters:
  42670. </p>
  42671. <dl compact="compact">
  42672. <dt>&lsquo;<samp>radius, r</samp>&rsquo;</dt>
  42673. <dd><p>Set the window radius. Default value is 3.
  42674. </p>
  42675. </dd>
  42676. <dt>&lsquo;<samp>planes, p</samp>&rsquo;</dt>
  42677. <dd><p>Set which planes to filter. Default is only the first plane.
  42678. </p>
  42679. </dd>
  42680. <dt>&lsquo;<samp>sigma, s</samp>&rsquo;</dt>
  42681. <dd><p>Set blur strength. Default value is 128.
  42682. </p></dd>
  42683. </dl>
  42684. <a name="Commands-46"></a>
  42685. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-46">39.242.1 Commands</a></h3>
  42686. <p>This filter supports same <a href="#commands">commands</a> as options.
  42687. </p>
  42688. <a name="zoompan"></a>
  42689. <h2 class="section"><a href="ffmpeg-all.html#toc-zoompan">39.243 zoompan</a></h2>
  42690. <p>Apply Zoom &amp; Pan effect.
  42691. </p>
  42692. <p>This filter accepts the following options:
  42693. </p>
  42694. <dl compact="compact">
  42695. <dt>&lsquo;<samp>zoom, z</samp>&rsquo;</dt>
  42696. <dd><p>Set the zoom expression. Range is 1-10. Default is 1.
  42697. </p>
  42698. </dd>
  42699. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  42700. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  42701. <dd><p>Set the x and y expression. Default is 0.
  42702. </p>
  42703. </dd>
  42704. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  42705. <dd><p>Set the duration expression in number of frames.
  42706. This sets for how many number of frames effect will last for
  42707. single input image.
  42708. </p>
  42709. </dd>
  42710. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  42711. <dd><p>Set the output image size, default is &rsquo;hd720&rsquo;.
  42712. </p>
  42713. </dd>
  42714. <dt>&lsquo;<samp>fps</samp>&rsquo;</dt>
  42715. <dd><p>Set the output frame rate, default is &rsquo;25&rsquo;.
  42716. </p></dd>
  42717. </dl>
  42718. <p>Each expression can contain the following constants:
  42719. </p>
  42720. <dl compact="compact">
  42721. <dt>&lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
  42722. <dd><p>Input width.
  42723. </p>
  42724. </dd>
  42725. <dt>&lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
  42726. <dd><p>Input height.
  42727. </p>
  42728. </dd>
  42729. <dt>&lsquo;<samp>out_w, ow</samp>&rsquo;</dt>
  42730. <dd><p>Output width.
  42731. </p>
  42732. </dd>
  42733. <dt>&lsquo;<samp>out_h, oh</samp>&rsquo;</dt>
  42734. <dd><p>Output height.
  42735. </p>
  42736. </dd>
  42737. <dt>&lsquo;<samp>in</samp>&rsquo;</dt>
  42738. <dd><p>Input frame count.
  42739. </p>
  42740. </dd>
  42741. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  42742. <dd><p>Output frame count.
  42743. </p>
  42744. </dd>
  42745. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  42746. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  42747. <dd><p>Last calculated &rsquo;x&rsquo; and &rsquo;y&rsquo; position from &rsquo;x&rsquo; and &rsquo;y&rsquo; expression
  42748. for current input frame.
  42749. </p>
  42750. </dd>
  42751. <dt>&lsquo;<samp>px</samp>&rsquo;</dt>
  42752. <dt>&lsquo;<samp>py</samp>&rsquo;</dt>
  42753. <dd><p>&rsquo;x&rsquo; and &rsquo;y&rsquo; of last output frame of previous input frame or 0 when there was
  42754. not yet such frame (first input frame).
  42755. </p>
  42756. </dd>
  42757. <dt>&lsquo;<samp>zoom</samp>&rsquo;</dt>
  42758. <dd><p>Last calculated zoom from &rsquo;z&rsquo; expression for current input frame.
  42759. </p>
  42760. </dd>
  42761. <dt>&lsquo;<samp>pzoom</samp>&rsquo;</dt>
  42762. <dd><p>Last calculated zoom of last output frame of previous input frame.
  42763. </p>
  42764. </dd>
  42765. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  42766. <dd><p>Number of output frames for current input frame. Calculated from &rsquo;d&rsquo; expression
  42767. for each input frame.
  42768. </p>
  42769. </dd>
  42770. <dt>&lsquo;<samp>pduration</samp>&rsquo;</dt>
  42771. <dd><p>number of output frames created for previous input frame
  42772. </p>
  42773. </dd>
  42774. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  42775. <dd><p>Rational number: input width / input height
  42776. </p>
  42777. </dd>
  42778. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  42779. <dd><p>sample aspect ratio
  42780. </p>
  42781. </dd>
  42782. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  42783. <dd><p>display aspect ratio
  42784. </p>
  42785. </dd>
  42786. </dl>
  42787. <a name="Examples-1"></a>
  42788. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-1">39.243.1 Examples</a></h3>
  42789. <ul>
  42790. <li>
  42791. Zoom-in up to 1.5 and pan at same time to some spot near center of picture:
  42792. <div class="example">
  42793. <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
  42794. </pre></div>
  42795. </li><li>
  42796. Zoom-in up to 1.5 and pan always at center of picture:
  42797. <div class="example">
  42798. <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)'
  42799. </pre></div>
  42800. </li><li>
  42801. Same as above but without pausing:
  42802. <div class="example">
  42803. <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)'
  42804. </pre></div>
  42805. </li></ul>
  42806. <p><a name="zscale"></a>
  42807. </p><a name="zscale-1"></a>
  42808. <h2 class="section"><a href="ffmpeg-all.html#toc-zscale-1">39.244 zscale</a></h2>
  42809. <p>Scale (resize) the input video, using the z.lib library:
  42810. <a href="https://github.com/sekrit-twc/zimg">https://github.com/sekrit-twc/zimg</a>. To enable compilation of this
  42811. filter, you need to configure FFmpeg with <code>--enable-libzimg</code>.
  42812. </p>
  42813. <p>The zscale filter forces the output display aspect ratio to be the same
  42814. as the input, by changing the output sample aspect ratio.
  42815. </p>
  42816. <p>If the input image format is different from the format requested by
  42817. the next filter, the zscale filter will convert the input to the
  42818. requested format.
  42819. </p>
  42820. <a name="Options-83"></a>
  42821. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-83">39.244.1 Options</a></h3>
  42822. <p>The filter accepts the following options.
  42823. </p>
  42824. <dl compact="compact">
  42825. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  42826. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  42827. <dd><p>Set the output video dimension expression. Default value is the input
  42828. dimension.
  42829. </p>
  42830. <p>If the <var>width</var> or <var>w</var> value is 0, the input width is used for
  42831. the output. If the <var>height</var> or <var>h</var> value is 0, the input height
  42832. is used for the output.
  42833. </p>
  42834. <p>If one and only one of the values is -n with n &gt;= 1, the zscale filter
  42835. will use a value that maintains the aspect ratio of the input image,
  42836. calculated from the other specified dimension. After that it will,
  42837. however, make sure that the calculated dimension is divisible by n and
  42838. adjust the value if necessary.
  42839. </p>
  42840. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  42841. both values being set to 0 as previously detailed.
  42842. </p>
  42843. <p>See below for the list of accepted constants for use in the dimension
  42844. expression.
  42845. </p>
  42846. </dd>
  42847. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  42848. <dd><p>Set the video size. For the syntax of this option, check the
  42849. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  42850. </p>
  42851. </dd>
  42852. <dt>&lsquo;<samp>dither, d</samp>&rsquo;</dt>
  42853. <dd><p>Set the dither type.
  42854. </p>
  42855. <p>Possible values are:
  42856. </p><dl compact="compact">
  42857. <dt><var>none</var></dt>
  42858. <dt><var>ordered</var></dt>
  42859. <dt><var>random</var></dt>
  42860. <dt><var>error_diffusion</var></dt>
  42861. </dl>
  42862. <p>Default is none.
  42863. </p>
  42864. </dd>
  42865. <dt>&lsquo;<samp>filter, f</samp>&rsquo;</dt>
  42866. <dd><p>Set the resize filter type.
  42867. </p>
  42868. <p>Possible values are:
  42869. </p><dl compact="compact">
  42870. <dt><var>point</var></dt>
  42871. <dt><var>bilinear</var></dt>
  42872. <dt><var>bicubic</var></dt>
  42873. <dt><var>spline16</var></dt>
  42874. <dt><var>spline36</var></dt>
  42875. <dt><var>lanczos</var></dt>
  42876. </dl>
  42877. <p>Default is bilinear.
  42878. </p>
  42879. </dd>
  42880. <dt>&lsquo;<samp>range, r</samp>&rsquo;</dt>
  42881. <dd><p>Set the color range.
  42882. </p>
  42883. <p>Possible values are:
  42884. </p><dl compact="compact">
  42885. <dt><var>input</var></dt>
  42886. <dt><var>limited</var></dt>
  42887. <dt><var>full</var></dt>
  42888. </dl>
  42889. <p>Default is same as input.
  42890. </p>
  42891. </dd>
  42892. <dt>&lsquo;<samp>primaries, p</samp>&rsquo;</dt>
  42893. <dd><p>Set the color primaries.
  42894. </p>
  42895. <p>Possible values are:
  42896. </p><dl compact="compact">
  42897. <dt><var>input</var></dt>
  42898. <dt><var>709</var></dt>
  42899. <dt><var>unspecified</var></dt>
  42900. <dt><var>170m</var></dt>
  42901. <dt><var>240m</var></dt>
  42902. <dt><var>2020</var></dt>
  42903. </dl>
  42904. <p>Default is same as input.
  42905. </p>
  42906. </dd>
  42907. <dt>&lsquo;<samp>transfer, t</samp>&rsquo;</dt>
  42908. <dd><p>Set the transfer characteristics.
  42909. </p>
  42910. <p>Possible values are:
  42911. </p><dl compact="compact">
  42912. <dt><var>input</var></dt>
  42913. <dt><var>709</var></dt>
  42914. <dt><var>unspecified</var></dt>
  42915. <dt><var>601</var></dt>
  42916. <dt><var>linear</var></dt>
  42917. <dt><var>2020_10</var></dt>
  42918. <dt><var>2020_12</var></dt>
  42919. <dt><var>smpte2084</var></dt>
  42920. <dt><var>iec61966-2-1</var></dt>
  42921. <dt><var>arib-std-b67</var></dt>
  42922. </dl>
  42923. <p>Default is same as input.
  42924. </p>
  42925. </dd>
  42926. <dt>&lsquo;<samp>matrix, m</samp>&rsquo;</dt>
  42927. <dd><p>Set the colorspace matrix.
  42928. </p>
  42929. <p>Possible value are:
  42930. </p><dl compact="compact">
  42931. <dt><var>input</var></dt>
  42932. <dt><var>709</var></dt>
  42933. <dt><var>unspecified</var></dt>
  42934. <dt><var>470bg</var></dt>
  42935. <dt><var>170m</var></dt>
  42936. <dt><var>2020_ncl</var></dt>
  42937. <dt><var>2020_cl</var></dt>
  42938. </dl>
  42939. <p>Default is same as input.
  42940. </p>
  42941. </dd>
  42942. <dt>&lsquo;<samp>rangein, rin</samp>&rsquo;</dt>
  42943. <dd><p>Set the input color range.
  42944. </p>
  42945. <p>Possible values are:
  42946. </p><dl compact="compact">
  42947. <dt><var>input</var></dt>
  42948. <dt><var>limited</var></dt>
  42949. <dt><var>full</var></dt>
  42950. </dl>
  42951. <p>Default is same as input.
  42952. </p>
  42953. </dd>
  42954. <dt>&lsquo;<samp>primariesin, pin</samp>&rsquo;</dt>
  42955. <dd><p>Set the input color primaries.
  42956. </p>
  42957. <p>Possible values are:
  42958. </p><dl compact="compact">
  42959. <dt><var>input</var></dt>
  42960. <dt><var>709</var></dt>
  42961. <dt><var>unspecified</var></dt>
  42962. <dt><var>170m</var></dt>
  42963. <dt><var>240m</var></dt>
  42964. <dt><var>2020</var></dt>
  42965. </dl>
  42966. <p>Default is same as input.
  42967. </p>
  42968. </dd>
  42969. <dt>&lsquo;<samp>transferin, tin</samp>&rsquo;</dt>
  42970. <dd><p>Set the input transfer characteristics.
  42971. </p>
  42972. <p>Possible values are:
  42973. </p><dl compact="compact">
  42974. <dt><var>input</var></dt>
  42975. <dt><var>709</var></dt>
  42976. <dt><var>unspecified</var></dt>
  42977. <dt><var>601</var></dt>
  42978. <dt><var>linear</var></dt>
  42979. <dt><var>2020_10</var></dt>
  42980. <dt><var>2020_12</var></dt>
  42981. </dl>
  42982. <p>Default is same as input.
  42983. </p>
  42984. </dd>
  42985. <dt>&lsquo;<samp>matrixin, min</samp>&rsquo;</dt>
  42986. <dd><p>Set the input colorspace matrix.
  42987. </p>
  42988. <p>Possible value are:
  42989. </p><dl compact="compact">
  42990. <dt><var>input</var></dt>
  42991. <dt><var>709</var></dt>
  42992. <dt><var>unspecified</var></dt>
  42993. <dt><var>470bg</var></dt>
  42994. <dt><var>170m</var></dt>
  42995. <dt><var>2020_ncl</var></dt>
  42996. <dt><var>2020_cl</var></dt>
  42997. </dl>
  42998. </dd>
  42999. <dt>&lsquo;<samp>chromal, c</samp>&rsquo;</dt>
  43000. <dd><p>Set the output chroma location.
  43001. </p>
  43002. <p>Possible values are:
  43003. </p><dl compact="compact">
  43004. <dt><var>input</var></dt>
  43005. <dt><var>left</var></dt>
  43006. <dt><var>center</var></dt>
  43007. <dt><var>topleft</var></dt>
  43008. <dt><var>top</var></dt>
  43009. <dt><var>bottomleft</var></dt>
  43010. <dt><var>bottom</var></dt>
  43011. </dl>
  43012. </dd>
  43013. <dt>&lsquo;<samp>chromalin, cin</samp>&rsquo;</dt>
  43014. <dd><p>Set the input chroma location.
  43015. </p>
  43016. <p>Possible values are:
  43017. </p><dl compact="compact">
  43018. <dt><var>input</var></dt>
  43019. <dt><var>left</var></dt>
  43020. <dt><var>center</var></dt>
  43021. <dt><var>topleft</var></dt>
  43022. <dt><var>top</var></dt>
  43023. <dt><var>bottomleft</var></dt>
  43024. <dt><var>bottom</var></dt>
  43025. </dl>
  43026. </dd>
  43027. <dt>&lsquo;<samp>npl</samp>&rsquo;</dt>
  43028. <dd><p>Set the nominal peak luminance.
  43029. </p></dd>
  43030. </dl>
  43031. <p>The values of the &lsquo;<samp>w</samp>&rsquo; and &lsquo;<samp>h</samp>&rsquo; options are expressions
  43032. containing the following constants:
  43033. </p>
  43034. <dl compact="compact">
  43035. <dt><var>in_w</var></dt>
  43036. <dt><var>in_h</var></dt>
  43037. <dd><p>The input width and height
  43038. </p>
  43039. </dd>
  43040. <dt><var>iw</var></dt>
  43041. <dt><var>ih</var></dt>
  43042. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  43043. </p>
  43044. </dd>
  43045. <dt><var>out_w</var></dt>
  43046. <dt><var>out_h</var></dt>
  43047. <dd><p>The output (scaled) width and height
  43048. </p>
  43049. </dd>
  43050. <dt><var>ow</var></dt>
  43051. <dt><var>oh</var></dt>
  43052. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>
  43053. </p>
  43054. </dd>
  43055. <dt><var>a</var></dt>
  43056. <dd><p>The same as <var>iw</var> / <var>ih</var>
  43057. </p>
  43058. </dd>
  43059. <dt><var>sar</var></dt>
  43060. <dd><p>input sample aspect ratio
  43061. </p>
  43062. </dd>
  43063. <dt><var>dar</var></dt>
  43064. <dd><p>The input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
  43065. </p>
  43066. </dd>
  43067. <dt><var>hsub</var></dt>
  43068. <dt><var>vsub</var></dt>
  43069. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  43070. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  43071. </p>
  43072. </dd>
  43073. <dt><var>ohsub</var></dt>
  43074. <dt><var>ovsub</var></dt>
  43075. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  43076. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  43077. </p></dd>
  43078. </dl>
  43079. <a name="Commands-37"></a>
  43080. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-37">39.244.2 Commands</a></h3>
  43081. <p>This filter supports the following commands:
  43082. </p><dl compact="compact">
  43083. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  43084. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  43085. <dd><p>Set the output video dimension expression.
  43086. The command accepts the same syntax of the corresponding option.
  43087. </p>
  43088. <p>If the specified expression is not valid, it is kept at its current
  43089. value.
  43090. </p></dd>
  43091. </dl>
  43092. <a name="OpenCL-Video-Filters"></a>
  43093. <h1 class="chapter"><a href="ffmpeg-all.html#toc-OpenCL-Video-Filters">40 OpenCL Video Filters</a></h1>
  43094. <p>Below is a description of the currently available OpenCL video filters.
  43095. </p>
  43096. <p>To enable compilation of these filters you need to configure FFmpeg with
  43097. <code>--enable-opencl</code>.
  43098. </p>
  43099. <p>Running OpenCL filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  43100. </p><dl compact="compact">
  43101. <dt>&lsquo;<samp>-init_hw_device opencl[=<var>name</var>][:<var>device</var>[,<var>key=value</var>...]]</samp>&rsquo;</dt>
  43102. <dd><p>Initialise a new hardware device of type <var>opencl</var> called <var>name</var>, using the
  43103. given device parameters.
  43104. </p>
  43105. </dd>
  43106. <dt>&lsquo;<samp>-filter_hw_device <var>name</var></samp>&rsquo;</dt>
  43107. <dd><p>Pass the hardware device called <var>name</var> to all filters in any filter graph.
  43108. </p>
  43109. </dd>
  43110. </dl>
  43111. <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>
  43112. </p>
  43113. <ul>
  43114. <li>
  43115. Example of choosing the first device on the second platform and running avgblur_opencl filter with default parameters on it.
  43116. <div class="example">
  43117. <pre class="example">-init_hw_device opencl=gpu:1.0 -filter_hw_device gpu -i INPUT -vf &quot;hwupload, avgblur_opencl, hwdownload&quot; OUTPUT
  43118. </pre></div>
  43119. </li></ul>
  43120. <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.
  43121. </p>
  43122. <a name="avgblur_005fopencl"></a>
  43123. <h2 class="section"><a href="ffmpeg-all.html#toc-avgblur_005fopencl">40.1 avgblur_opencl</a></h2>
  43124. <p>Apply average blur filter.
  43125. </p>
  43126. <p>The filter accepts the following options:
  43127. </p>
  43128. <dl compact="compact">
  43129. <dt>&lsquo;<samp>sizeX</samp>&rsquo;</dt>
  43130. <dd><p>Set horizontal radius size.
  43131. Range is <code>[1, 1024]</code> and default value is <code>1</code>.
  43132. </p>
  43133. </dd>
  43134. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  43135. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  43136. </p>
  43137. </dd>
  43138. <dt>&lsquo;<samp>sizeY</samp>&rsquo;</dt>
  43139. <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.
  43140. </p></dd>
  43141. </dl>
  43142. <a name="Example-4"></a>
  43143. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-4">40.1.1 Example</a></h3>
  43144. <ul>
  43145. <li>
  43146. 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.
  43147. <div class="example">
  43148. <pre class="example">-i INPUT -vf &quot;hwupload, avgblur_opencl=3, hwdownload&quot; OUTPUT
  43149. </pre></div>
  43150. </li></ul>
  43151. <a name="boxblur_005fopencl"></a>
  43152. <h2 class="section"><a href="ffmpeg-all.html#toc-boxblur_005fopencl">40.2 boxblur_opencl</a></h2>
  43153. <p>Apply a boxblur algorithm to the input video.
  43154. </p>
  43155. <p>It accepts the following parameters:
  43156. </p>
  43157. <dl compact="compact">
  43158. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  43159. <dt>&lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
  43160. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  43161. <dt>&lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
  43162. <dt>&lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
  43163. <dt>&lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
  43164. </dl>
  43165. <p>A description of the accepted options follows.
  43166. </p>
  43167. <dl compact="compact">
  43168. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  43169. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  43170. <dt>&lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
  43171. <dd><p>Set an expression for the box radius in pixels used for blurring the
  43172. corresponding input plane.
  43173. </p>
  43174. <p>The radius value must be a non-negative number, and must not be
  43175. greater than the value of the expression <code>min(w,h)/2</code> for the
  43176. luma and alpha planes, and of <code>min(cw,ch)/2</code> for the chroma
  43177. planes.
  43178. </p>
  43179. <p>Default value for &lsquo;<samp>luma_radius</samp>&rsquo; is &quot;2&quot;. If not specified,
  43180. &lsquo;<samp>chroma_radius</samp>&rsquo; and &lsquo;<samp>alpha_radius</samp>&rsquo; default to the
  43181. corresponding value set for &lsquo;<samp>luma_radius</samp>&rsquo;.
  43182. </p>
  43183. <p>The expressions can contain the following constants:
  43184. </p><dl compact="compact">
  43185. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  43186. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  43187. <dd><p>The input width and height in pixels.
  43188. </p>
  43189. </dd>
  43190. <dt>&lsquo;<samp>cw</samp>&rsquo;</dt>
  43191. <dt>&lsquo;<samp>ch</samp>&rsquo;</dt>
  43192. <dd><p>The input chroma image width and height in pixels.
  43193. </p>
  43194. </dd>
  43195. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  43196. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  43197. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  43198. pixel format &quot;yuv422p&quot;, <var>hsub</var> is 2 and <var>vsub</var> is 1.
  43199. </p></dd>
  43200. </dl>
  43201. </dd>
  43202. <dt>&lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
  43203. <dt>&lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
  43204. <dt>&lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
  43205. <dd><p>Specify how many times the boxblur filter is applied to the
  43206. corresponding plane.
  43207. </p>
  43208. <p>Default value for &lsquo;<samp>luma_power</samp>&rsquo; is 2. If not specified,
  43209. &lsquo;<samp>chroma_power</samp>&rsquo; and &lsquo;<samp>alpha_power</samp>&rsquo; default to the
  43210. corresponding value set for &lsquo;<samp>luma_power</samp>&rsquo;.
  43211. </p>
  43212. <p>A value of 0 will disable the effect.
  43213. </p></dd>
  43214. </dl>
  43215. <a name="Examples-4"></a>
  43216. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-4">40.2.1 Examples</a></h3>
  43217. <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.
  43218. </p>
  43219. <ul>
  43220. <li>
  43221. Apply a boxblur filter with the luma, chroma, and alpha radius
  43222. 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.
  43223. <div class="example">
  43224. <pre class="example">-i INPUT -vf &quot;hwupload, boxblur_opencl=luma_radius=2:luma_power=3, hwdownload&quot; OUTPUT
  43225. -i INPUT -vf &quot;hwupload, boxblur_opencl=2:3, hwdownload&quot; OUTPUT
  43226. </pre></div>
  43227. </li><li>
  43228. 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.
  43229. <p>For the luma plane, a 2x2 box radius will be run once.
  43230. </p>
  43231. <p>For the chroma plane, a 4x4 box radius will be run 5 times.
  43232. </p>
  43233. <p>For the alpha plane, a 3x3 box radius will be run 7 times.
  43234. </p><div class="example">
  43235. <pre class="example">-i INPUT -vf &quot;hwupload, boxblur_opencl=2:1:4:5:3:7, hwdownload&quot; OUTPUT
  43236. </pre></div>
  43237. </li></ul>
  43238. <a name="colorkey_005fopencl"></a>
  43239. <h2 class="section"><a href="ffmpeg-all.html#toc-colorkey_005fopencl">40.3 colorkey_opencl</a></h2>
  43240. <p>RGB colorspace color keying.
  43241. </p>
  43242. <p>The filter accepts the following options:
  43243. </p>
  43244. <dl compact="compact">
  43245. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  43246. <dd><p>The color which will be replaced with transparency.
  43247. </p>
  43248. </dd>
  43249. <dt>&lsquo;<samp>similarity</samp>&rsquo;</dt>
  43250. <dd><p>Similarity percentage with the key color.
  43251. </p>
  43252. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  43253. </p>
  43254. </dd>
  43255. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  43256. <dd><p>Blend percentage.
  43257. </p>
  43258. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  43259. </p>
  43260. <p>Higher values result in semi-transparent pixels, with a higher transparency
  43261. the more similar the pixels color is to the key color.
  43262. </p></dd>
  43263. </dl>
  43264. <a name="Examples-95"></a>
  43265. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-95">40.3.1 Examples</a></h3>
  43266. <ul>
  43267. <li>
  43268. Make every semi-green pixel in the input transparent with some slight blending:
  43269. <div class="example">
  43270. <pre class="example">-i INPUT -vf &quot;hwupload, colorkey_opencl=green:0.3:0.1, hwdownload&quot; OUTPUT
  43271. </pre></div>
  43272. </li></ul>
  43273. <a name="convolution_005fopencl"></a>
  43274. <h2 class="section"><a href="ffmpeg-all.html#toc-convolution_005fopencl">40.4 convolution_opencl</a></h2>
  43275. <p>Apply convolution of 3x3, 5x5, 7x7 matrix.
  43276. </p>
  43277. <p>The filter accepts the following options:
  43278. </p>
  43279. <dl compact="compact">
  43280. <dt>&lsquo;<samp>0m</samp>&rsquo;</dt>
  43281. <dt>&lsquo;<samp>1m</samp>&rsquo;</dt>
  43282. <dt>&lsquo;<samp>2m</samp>&rsquo;</dt>
  43283. <dt>&lsquo;<samp>3m</samp>&rsquo;</dt>
  43284. <dd><p>Set matrix for each plane.
  43285. Matrix is sequence of 9, 25 or 49 signed numbers.
  43286. Default value for each plane is <code>0 0 0 0 1 0 0 0 0</code>.
  43287. </p>
  43288. </dd>
  43289. <dt>&lsquo;<samp>0rdiv</samp>&rsquo;</dt>
  43290. <dt>&lsquo;<samp>1rdiv</samp>&rsquo;</dt>
  43291. <dt>&lsquo;<samp>2rdiv</samp>&rsquo;</dt>
  43292. <dt>&lsquo;<samp>3rdiv</samp>&rsquo;</dt>
  43293. <dd><p>Set multiplier for calculated value for each plane.
  43294. If unset or 0, it will be sum of all matrix elements.
  43295. The option value must be a float number greater or equal to <code>0.0</code>. Default value is <code>1.0</code>.
  43296. </p>
  43297. </dd>
  43298. <dt>&lsquo;<samp>0bias</samp>&rsquo;</dt>
  43299. <dt>&lsquo;<samp>1bias</samp>&rsquo;</dt>
  43300. <dt>&lsquo;<samp>2bias</samp>&rsquo;</dt>
  43301. <dt>&lsquo;<samp>3bias</samp>&rsquo;</dt>
  43302. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  43303. Useful for making the overall image brighter or darker.
  43304. The option value must be a float number greater or equal to <code>0.0</code>. Default value is <code>0.0</code>.
  43305. </p>
  43306. </dd>
  43307. </dl>
  43308. <a name="Examples-116"></a>
  43309. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-116">40.4.1 Examples</a></h3>
  43310. <ul>
  43311. <li>
  43312. Apply sharpen:
  43313. <div class="example">
  43314. <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
  43315. </pre></div>
  43316. </li><li>
  43317. Apply blur:
  43318. <div class="example">
  43319. <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
  43320. </pre></div>
  43321. </li><li>
  43322. Apply edge enhance:
  43323. <div class="example">
  43324. <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
  43325. </pre></div>
  43326. </li><li>
  43327. Apply edge detect:
  43328. <div class="example">
  43329. <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
  43330. </pre></div>
  43331. </li><li>
  43332. Apply laplacian edge detector which includes diagonals:
  43333. <div class="example">
  43334. <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
  43335. </pre></div>
  43336. </li><li>
  43337. Apply emboss:
  43338. <div class="example">
  43339. <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
  43340. </pre></div>
  43341. </li></ul>
  43342. <a name="erosion_005fopencl"></a>
  43343. <h2 class="section"><a href="ffmpeg-all.html#toc-erosion_005fopencl">40.5 erosion_opencl</a></h2>
  43344. <p>Apply erosion effect to the video.
  43345. </p>
  43346. <p>This filter replaces the pixel by the local(3x3) minimum.
  43347. </p>
  43348. <p>It accepts the following options:
  43349. </p>
  43350. <dl compact="compact">
  43351. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  43352. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  43353. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  43354. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  43355. <dd><p>Limit the maximum change for each plane. Range is <code>[0, 65535]</code> and default value is <code>65535</code>.
  43356. If <code>0</code>, plane will remain unchanged.
  43357. </p>
  43358. </dd>
  43359. <dt>&lsquo;<samp>coordinates</samp>&rsquo;</dt>
  43360. <dd><p>Flag which specifies the pixel to refer to.
  43361. Range is <code>[0, 255]</code> and default value is <code>255</code>, i.e. all eight pixels are used.
  43362. </p>
  43363. <p>Flags to local 3x3 coordinates region centered on <code>x</code>:
  43364. </p>
  43365. <p> 1 2 3
  43366. </p>
  43367. <p> 4 x 5
  43368. </p>
  43369. <p> 6 7 8
  43370. </p></dd>
  43371. </dl>
  43372. <a name="Example-7"></a>
  43373. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-7">40.5.1 Example</a></h3>
  43374. <ul>
  43375. <li>
  43376. 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.
  43377. <div class="example">
  43378. <pre class="example">-i INPUT -vf &quot;hwupload, erosion_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  43379. </pre></div>
  43380. </li></ul>
  43381. <a name="deshake_005fopencl"></a>
  43382. <h2 class="section"><a href="ffmpeg-all.html#toc-deshake_005fopencl">40.6 deshake_opencl</a></h2>
  43383. <p>Feature-point based video stabilization filter.
  43384. </p>
  43385. <p>The filter accepts the following options:
  43386. </p>
  43387. <dl compact="compact">
  43388. <dt>&lsquo;<samp>tripod</samp>&rsquo;</dt>
  43389. <dd><p>Simulates a tripod by preventing any camera movement whatsoever from the original frame. Defaults to <code>0</code>.
  43390. </p>
  43391. </dd>
  43392. <dt>&lsquo;<samp>debug</samp>&rsquo;</dt>
  43393. <dd><p>Whether or not additional debug info should be displayed, both in the processed output and in the console.
  43394. </p>
  43395. <p>Note that in order to see console debug output you will also need to pass <code>-v verbose</code> to ffmpeg.
  43396. </p>
  43397. <p>Viewing point matches in the output video is only supported for RGB input.
  43398. </p>
  43399. <p>Defaults to <code>0</code>.
  43400. </p>
  43401. </dd>
  43402. <dt>&lsquo;<samp>adaptive_crop</samp>&rsquo;</dt>
  43403. <dd><p>Whether or not to do a tiny bit of cropping at the borders to cut down on the amount of mirrored pixels.
  43404. </p>
  43405. <p>Defaults to <code>1</code>.
  43406. </p>
  43407. </dd>
  43408. <dt>&lsquo;<samp>refine_features</samp>&rsquo;</dt>
  43409. <dd><p>Whether or not feature points should be refined at a sub-pixel level.
  43410. </p>
  43411. <p>This can be turned off for a slight performance gain at the cost of precision.
  43412. </p>
  43413. <p>Defaults to <code>1</code>.
  43414. </p>
  43415. </dd>
  43416. <dt>&lsquo;<samp>smooth_strength</samp>&rsquo;</dt>
  43417. <dd><p>The strength of the smoothing applied to the camera path from <code>0.0</code> to <code>1.0</code>.
  43418. </p>
  43419. <p><code>1.0</code> is the maximum smoothing strength while values less than that result in less smoothing.
  43420. </p>
  43421. <p><code>0.0</code> causes the filter to adaptively choose a smoothing strength on a per-frame basis.
  43422. </p>
  43423. <p>Defaults to <code>0.0</code>.
  43424. </p>
  43425. </dd>
  43426. <dt>&lsquo;<samp>smooth_window_multiplier</samp>&rsquo;</dt>
  43427. <dd><p>Controls the size of the smoothing window (the number of frames buffered to determine motion information from).
  43428. </p>
  43429. <p>The size of the smoothing window is determined by multiplying the framerate of the video by this number.
  43430. </p>
  43431. <p>Acceptable values range from <code>0.1</code> to <code>10.0</code>.
  43432. </p>
  43433. <p>Larger values increase the amount of motion data available for determining how to smooth the camera path,
  43434. potentially improving smoothness, but also increase latency and memory usage.
  43435. </p>
  43436. <p>Defaults to <code>2.0</code>.
  43437. </p>
  43438. </dd>
  43439. </dl>
  43440. <a name="Examples-83"></a>
  43441. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-83">40.6.1 Examples</a></h3>
  43442. <ul>
  43443. <li>
  43444. Stabilize a video with a fixed, medium smoothing strength:
  43445. <div class="example">
  43446. <pre class="example">-i INPUT -vf &quot;hwupload, deshake_opencl=smooth_strength=0.5, hwdownload&quot; OUTPUT
  43447. </pre></div>
  43448. </li><li>
  43449. Stabilize a video with debugging (both in console and in rendered video):
  43450. <div class="example">
  43451. <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
  43452. </pre></div>
  43453. </li></ul>
  43454. <a name="dilation_005fopencl"></a>
  43455. <h2 class="section"><a href="ffmpeg-all.html#toc-dilation_005fopencl">40.7 dilation_opencl</a></h2>
  43456. <p>Apply dilation effect to the video.
  43457. </p>
  43458. <p>This filter replaces the pixel by the local(3x3) maximum.
  43459. </p>
  43460. <p>It accepts the following options:
  43461. </p>
  43462. <dl compact="compact">
  43463. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  43464. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  43465. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  43466. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  43467. <dd><p>Limit the maximum change for each plane. Range is <code>[0, 65535]</code> and default value is <code>65535</code>.
  43468. If <code>0</code>, plane will remain unchanged.
  43469. </p>
  43470. </dd>
  43471. <dt>&lsquo;<samp>coordinates</samp>&rsquo;</dt>
  43472. <dd><p>Flag which specifies the pixel to refer to.
  43473. Range is <code>[0, 255]</code> and default value is <code>255</code>, i.e. all eight pixels are used.
  43474. </p>
  43475. <p>Flags to local 3x3 coordinates region centered on <code>x</code>:
  43476. </p>
  43477. <p> 1 2 3
  43478. </p>
  43479. <p> 4 x 5
  43480. </p>
  43481. <p> 6 7 8
  43482. </p></dd>
  43483. </dl>
  43484. <a name="Example-10"></a>
  43485. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-10">40.7.1 Example</a></h3>
  43486. <ul>
  43487. <li>
  43488. 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.
  43489. <div class="example">
  43490. <pre class="example">-i INPUT -vf &quot;hwupload, dilation_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  43491. </pre></div>
  43492. </li></ul>
  43493. <a name="nlmeans_005fopencl"></a>
  43494. <h2 class="section"><a href="ffmpeg-all.html#toc-nlmeans_005fopencl">40.8 nlmeans_opencl</a></h2>
  43495. <p>Non-local Means denoise filter through OpenCL, this filter accepts same options as <a href="#nlmeans">nlmeans</a>.
  43496. </p>
  43497. <a name="overlay_005fopencl"></a>
  43498. <h2 class="section"><a href="ffmpeg-all.html#toc-overlay_005fopencl">40.9 overlay_opencl</a></h2>
  43499. <p>Overlay one video on top of another.
  43500. </p>
  43501. <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.
  43502. This filter requires same memory layout for all the inputs. So, format conversion may be needed.
  43503. </p>
  43504. <p>The filter accepts the following options:
  43505. </p>
  43506. <dl compact="compact">
  43507. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  43508. <dd><p>Set the x coordinate of the overlaid video on the main video.
  43509. Default value is <code>0</code>.
  43510. </p>
  43511. </dd>
  43512. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  43513. <dd><p>Set the y coordinate of the overlaid video on the main video.
  43514. Default value is <code>0</code>.
  43515. </p>
  43516. </dd>
  43517. </dl>
  43518. <a name="Examples-166"></a>
  43519. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-166">40.9.1 Examples</a></h3>
  43520. <ul>
  43521. <li>
  43522. Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs are yuv420p format.
  43523. <div class="example">
  43524. <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
  43525. </pre></div>
  43526. </li><li>
  43527. The inputs have same memory layout for color channels , the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p.
  43528. <div class="example">
  43529. <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
  43530. </pre></div>
  43531. </li></ul>
  43532. <a name="pad_005fopencl"></a>
  43533. <h2 class="section"><a href="ffmpeg-all.html#toc-pad_005fopencl">40.10 pad_opencl</a></h2>
  43534. <p>Add paddings to the input image, and place the original input at the
  43535. provided <var>x</var>, <var>y</var> coordinates.
  43536. </p>
  43537. <p>It accepts the following options:
  43538. </p>
  43539. <dl compact="compact">
  43540. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  43541. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  43542. <dd><p>Specify an expression for the size of the output image with the
  43543. paddings added. If the value for <var>width</var> or <var>height</var> is 0, the
  43544. corresponding input size is used for the output.
  43545. </p>
  43546. <p>The <var>width</var> expression can reference the value set by the
  43547. <var>height</var> expression, and vice versa.
  43548. </p>
  43549. <p>The default value of <var>width</var> and <var>height</var> is 0.
  43550. </p>
  43551. </dd>
  43552. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  43553. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  43554. <dd><p>Specify the offsets to place the input image at within the padded area,
  43555. with respect to the top/left border of the output image.
  43556. </p>
  43557. <p>The <var>x</var> expression can reference the value set by the <var>y</var>
  43558. expression, and vice versa.
  43559. </p>
  43560. <p>The default value of <var>x</var> and <var>y</var> is 0.
  43561. </p>
  43562. <p>If <var>x</var> or <var>y</var> evaluate to a negative number, they&rsquo;ll be changed
  43563. so the input image is centered on the padded area.
  43564. </p>
  43565. </dd>
  43566. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  43567. <dd><p>Specify the color of the padded area. For the syntax of this option,
  43568. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  43569. </p>
  43570. </dd>
  43571. <dt>&lsquo;<samp>aspect</samp>&rsquo;</dt>
  43572. <dd><p>Pad to an aspect instead to a resolution.
  43573. </p></dd>
  43574. </dl>
  43575. <p>The value for the <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var>
  43576. options are expressions containing the following constants:
  43577. </p>
  43578. <dl compact="compact">
  43579. <dt>&lsquo;<samp>in_w</samp>&rsquo;</dt>
  43580. <dt>&lsquo;<samp>in_h</samp>&rsquo;</dt>
  43581. <dd><p>The input video width and height.
  43582. </p>
  43583. </dd>
  43584. <dt>&lsquo;<samp>iw</samp>&rsquo;</dt>
  43585. <dt>&lsquo;<samp>ih</samp>&rsquo;</dt>
  43586. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  43587. </p>
  43588. </dd>
  43589. <dt>&lsquo;<samp>out_w</samp>&rsquo;</dt>
  43590. <dt>&lsquo;<samp>out_h</samp>&rsquo;</dt>
  43591. <dd><p>The output width and height (the size of the padded area), as
  43592. specified by the <var>width</var> and <var>height</var> expressions.
  43593. </p>
  43594. </dd>
  43595. <dt>&lsquo;<samp>ow</samp>&rsquo;</dt>
  43596. <dt>&lsquo;<samp>oh</samp>&rsquo;</dt>
  43597. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
  43598. </p>
  43599. </dd>
  43600. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  43601. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  43602. <dd><p>The x and y offsets as specified by the <var>x</var> and <var>y</var>
  43603. expressions, or NAN if not yet specified.
  43604. </p>
  43605. </dd>
  43606. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  43607. <dd><p>same as <var>iw</var> / <var>ih</var>
  43608. </p>
  43609. </dd>
  43610. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  43611. <dd><p>input sample aspect ratio
  43612. </p>
  43613. </dd>
  43614. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  43615. <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
  43616. </p></dd>
  43617. </dl>
  43618. <a name="prewitt_005fopencl"></a>
  43619. <h2 class="section"><a href="ffmpeg-all.html#toc-prewitt_005fopencl">40.11 prewitt_opencl</a></h2>
  43620. <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.
  43621. </p>
  43622. <p>The filter accepts the following option:
  43623. </p>
  43624. <dl compact="compact">
  43625. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  43626. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  43627. </p>
  43628. </dd>
  43629. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  43630. <dd><p>Set value which will be multiplied with filtered result.
  43631. Range is <code>[0.0, 65535]</code> and default value is <code>1.0</code>.
  43632. </p>
  43633. </dd>
  43634. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  43635. <dd><p>Set value which will be added to filtered result.
  43636. Range is <code>[-65535, 65535]</code> and default value is <code>0.0</code>.
  43637. </p></dd>
  43638. </dl>
  43639. <a name="Example-6"></a>
  43640. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-6">40.11.1 Example</a></h3>
  43641. <ul>
  43642. <li>
  43643. Apply the Prewitt operator with scale set to 2 and delta set to 10.
  43644. <div class="example">
  43645. <pre class="example">-i INPUT -vf &quot;hwupload, prewitt_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  43646. </pre></div>
  43647. </li></ul>
  43648. <p><a name="program_005fopencl"></a>
  43649. </p><a name="program_005fopencl-1"></a>
  43650. <h2 class="section"><a href="ffmpeg-all.html#toc-program_005fopencl-1">40.12 program_opencl</a></h2>
  43651. <p>Filter video using an OpenCL program.
  43652. </p>
  43653. <dl compact="compact">
  43654. <dt>&lsquo;<samp>source</samp>&rsquo;</dt>
  43655. <dd><p>OpenCL program source file.
  43656. </p>
  43657. </dd>
  43658. <dt>&lsquo;<samp>kernel</samp>&rsquo;</dt>
  43659. <dd><p>Kernel name in program.
  43660. </p>
  43661. </dd>
  43662. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  43663. <dd><p>Number of inputs to the filter. Defaults to 1.
  43664. </p>
  43665. </dd>
  43666. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  43667. <dd><p>Size of output frames. Defaults to the same as the first input.
  43668. </p>
  43669. </dd>
  43670. </dl>
  43671. <p>The <code>program_opencl</code> filter also supports the <a href="#framesync">framesync</a> options.
  43672. </p>
  43673. <p>The program source file must contain a kernel function with the given name,
  43674. which will be run once for each plane of the output. Each run on a plane
  43675. gets enqueued as a separate 2D global NDRange with one work-item for each
  43676. pixel to be generated. The global ID offset for each work-item is therefore
  43677. the coordinates of a pixel in the destination image.
  43678. </p>
  43679. <p>The kernel function needs to take the following arguments:
  43680. </p><ul>
  43681. <li>
  43682. Destination image, <var>__write_only image2d_t</var>.
  43683. <p>This image will become the output; the kernel should write all of it.
  43684. </p></li><li>
  43685. Frame index, <var>unsigned int</var>.
  43686. <p>This is a counter starting from zero and increasing by one for each frame.
  43687. </p></li><li>
  43688. Source images, <var>__read_only image2d_t</var>.
  43689. <p>These are the most recent images on each input. The kernel may read from
  43690. them to generate the output, but they can&rsquo;t be written to.
  43691. </p></li></ul>
  43692. <p>Example programs:
  43693. </p>
  43694. <ul>
  43695. <li>
  43696. Copy the input to the output (output must be the same size as the input).
  43697. <pre class="verbatim">__kernel void copy(__write_only image2d_t destination,
  43698. unsigned int index,
  43699. __read_only image2d_t source)
  43700. {
  43701. const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE;
  43702. int2 location = (int2)(get_global_id(0), get_global_id(1));
  43703. float4 value = read_imagef(source, sampler, location);
  43704. write_imagef(destination, location, value);
  43705. }
  43706. </pre>
  43707. </li><li>
  43708. Apply a simple transformation, rotating the input by an amount increasing
  43709. with the index counter. Pixel values are linearly interpolated by the
  43710. sampler, and the output need not have the same dimensions as the input.
  43711. <pre class="verbatim">__kernel void rotate_image(__write_only image2d_t dst,
  43712. unsigned int index,
  43713. __read_only image2d_t src)
  43714. {
  43715. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  43716. CLK_FILTER_LINEAR);
  43717. float angle = (float)index / 100.0f;
  43718. float2 dst_dim = convert_float2(get_image_dim(dst));
  43719. float2 src_dim = convert_float2(get_image_dim(src));
  43720. float2 dst_cen = dst_dim / 2.0f;
  43721. float2 src_cen = src_dim / 2.0f;
  43722. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  43723. float2 dst_pos = convert_float2(dst_loc) - dst_cen;
  43724. float2 src_pos = {
  43725. cos(angle) * dst_pos.x - sin(angle) * dst_pos.y,
  43726. sin(angle) * dst_pos.x + cos(angle) * dst_pos.y
  43727. };
  43728. src_pos = src_pos * src_dim / dst_dim;
  43729. float2 src_loc = src_pos + src_cen;
  43730. if (src_loc.x &lt; 0.0f || src_loc.y &lt; 0.0f ||
  43731. src_loc.x &gt; src_dim.x || src_loc.y &gt; src_dim.y)
  43732. write_imagef(dst, dst_loc, 0.5f);
  43733. else
  43734. write_imagef(dst, dst_loc, read_imagef(src, sampler, src_loc));
  43735. }
  43736. </pre>
  43737. </li><li>
  43738. Blend two inputs together, with the amount of each input used varying
  43739. with the index counter.
  43740. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  43741. unsigned int index,
  43742. __read_only image2d_t src1,
  43743. __read_only image2d_t src2)
  43744. {
  43745. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  43746. CLK_FILTER_LINEAR);
  43747. float blend = (cos((float)index / 50.0f) + 1.0f) / 2.0f;
  43748. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  43749. int2 src1_loc = dst_loc * get_image_dim(src1) / get_image_dim(dst);
  43750. int2 src2_loc = dst_loc * get_image_dim(src2) / get_image_dim(dst);
  43751. float4 val1 = read_imagef(src1, sampler, src1_loc);
  43752. float4 val2 = read_imagef(src2, sampler, src2_loc);
  43753. write_imagef(dst, dst_loc, val1 * blend + val2 * (1.0f - blend));
  43754. }
  43755. </pre>
  43756. </li></ul>
  43757. <a name="roberts_005fopencl"></a>
  43758. <h2 class="section"><a href="ffmpeg-all.html#toc-roberts_005fopencl">40.13 roberts_opencl</a></h2>
  43759. <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.
  43760. </p>
  43761. <p>The filter accepts the following option:
  43762. </p>
  43763. <dl compact="compact">
  43764. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  43765. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  43766. </p>
  43767. </dd>
  43768. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  43769. <dd><p>Set value which will be multiplied with filtered result.
  43770. Range is <code>[0.0, 65535]</code> and default value is <code>1.0</code>.
  43771. </p>
  43772. </dd>
  43773. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  43774. <dd><p>Set value which will be added to filtered result.
  43775. Range is <code>[-65535, 65535]</code> and default value is <code>0.0</code>.
  43776. </p></dd>
  43777. </dl>
  43778. <a name="Example-11"></a>
  43779. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-11">40.13.1 Example</a></h3>
  43780. <ul>
  43781. <li>
  43782. Apply the Roberts cross operator with scale set to 2 and delta set to 10
  43783. <div class="example">
  43784. <pre class="example">-i INPUT -vf &quot;hwupload, roberts_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  43785. </pre></div>
  43786. </li></ul>
  43787. <a name="sobel_005fopencl"></a>
  43788. <h2 class="section"><a href="ffmpeg-all.html#toc-sobel_005fopencl">40.14 sobel_opencl</a></h2>
  43789. <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.
  43790. </p>
  43791. <p>The filter accepts the following option:
  43792. </p>
  43793. <dl compact="compact">
  43794. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  43795. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  43796. </p>
  43797. </dd>
  43798. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  43799. <dd><p>Set value which will be multiplied with filtered result.
  43800. Range is <code>[0.0, 65535]</code> and default value is <code>1.0</code>.
  43801. </p>
  43802. </dd>
  43803. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  43804. <dd><p>Set value which will be added to filtered result.
  43805. Range is <code>[-65535, 65535]</code> and default value is <code>0.0</code>.
  43806. </p></dd>
  43807. </dl>
  43808. <a name="Example-2"></a>
  43809. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-2">40.14.1 Example</a></h3>
  43810. <ul>
  43811. <li>
  43812. Apply sobel operator with scale set to 2 and delta set to 10
  43813. <div class="example">
  43814. <pre class="example">-i INPUT -vf &quot;hwupload, sobel_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  43815. </pre></div>
  43816. </li></ul>
  43817. <a name="tonemap_005fopencl"></a>
  43818. <h2 class="section"><a href="ffmpeg-all.html#toc-tonemap_005fopencl">40.15 tonemap_opencl</a></h2>
  43819. <p>Perform HDR(PQ/HLG) to SDR conversion with tone-mapping.
  43820. </p>
  43821. <p>It accepts the following parameters:
  43822. </p>
  43823. <dl compact="compact">
  43824. <dt>&lsquo;<samp>tonemap</samp>&rsquo;</dt>
  43825. <dd><p>Specify the tone-mapping operator to be used. Same as tonemap option in <a href="#tonemap">tonemap</a>.
  43826. </p>
  43827. </dd>
  43828. <dt>&lsquo;<samp>param</samp>&rsquo;</dt>
  43829. <dd><p>Tune the tone mapping algorithm. same as param option in <a href="#tonemap">tonemap</a>.
  43830. </p>
  43831. </dd>
  43832. <dt>&lsquo;<samp>desat</samp>&rsquo;</dt>
  43833. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  43834. higher the parameter, the more color information will be preserved. This
  43835. setting helps prevent unnaturally blown-out colors for super-highlights, by
  43836. (smoothly) turning into white instead. This makes images feel more natural,
  43837. at the cost of reducing information about out-of-range colors.
  43838. </p>
  43839. <p>The default value is 0.5, and the algorithm here is a little different from
  43840. the cpu version tonemap currently. A setting of 0.0 disables this option.
  43841. </p>
  43842. </dd>
  43843. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  43844. <dd><p>The tonemapping algorithm parameters is fine-tuned per each scene. And a threshold
  43845. is used to detect whether the scene has changed or not. If the distance between
  43846. the current frame average brightness and the current running average exceeds
  43847. a threshold value, we would re-calculate scene average and peak brightness.
  43848. The default value is 0.2.
  43849. </p>
  43850. </dd>
  43851. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  43852. <dd><p>Specify the output pixel format.
  43853. </p>
  43854. <p>Currently supported formats are:
  43855. </p><dl compact="compact">
  43856. <dt><var>p010</var></dt>
  43857. <dt><var>nv12</var></dt>
  43858. </dl>
  43859. </dd>
  43860. <dt>&lsquo;<samp>range, r</samp>&rsquo;</dt>
  43861. <dd><p>Set the output color range.
  43862. </p>
  43863. <p>Possible values are:
  43864. </p><dl compact="compact">
  43865. <dt><var>tv/mpeg</var></dt>
  43866. <dt><var>pc/jpeg</var></dt>
  43867. </dl>
  43868. <p>Default is same as input.
  43869. </p>
  43870. </dd>
  43871. <dt>&lsquo;<samp>primaries, p</samp>&rsquo;</dt>
  43872. <dd><p>Set the output color primaries.
  43873. </p>
  43874. <p>Possible values are:
  43875. </p><dl compact="compact">
  43876. <dt><var>bt709</var></dt>
  43877. <dt><var>bt2020</var></dt>
  43878. </dl>
  43879. <p>Default is same as input.
  43880. </p>
  43881. </dd>
  43882. <dt>&lsquo;<samp>transfer, t</samp>&rsquo;</dt>
  43883. <dd><p>Set the output transfer characteristics.
  43884. </p>
  43885. <p>Possible values are:
  43886. </p><dl compact="compact">
  43887. <dt><var>bt709</var></dt>
  43888. <dt><var>bt2020</var></dt>
  43889. </dl>
  43890. <p>Default is bt709.
  43891. </p>
  43892. </dd>
  43893. <dt>&lsquo;<samp>matrix, m</samp>&rsquo;</dt>
  43894. <dd><p>Set the output colorspace matrix.
  43895. </p>
  43896. <p>Possible value are:
  43897. </p><dl compact="compact">
  43898. <dt><var>bt709</var></dt>
  43899. <dt><var>bt2020</var></dt>
  43900. </dl>
  43901. <p>Default is same as input.
  43902. </p>
  43903. </dd>
  43904. </dl>
  43905. <a name="Example-8"></a>
  43906. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-8">40.15.1 Example</a></h3>
  43907. <ul>
  43908. <li>
  43909. Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010 format using linear operator.
  43910. <div class="example">
  43911. <pre class="example">-i INPUT -vf &quot;format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010&quot; OUTPUT
  43912. </pre></div>
  43913. </li></ul>
  43914. <a name="unsharp_005fopencl"></a>
  43915. <h2 class="section"><a href="ffmpeg-all.html#toc-unsharp_005fopencl">40.16 unsharp_opencl</a></h2>
  43916. <p>Sharpen or blur the input video.
  43917. </p>
  43918. <p>It accepts the following parameters:
  43919. </p>
  43920. <dl compact="compact">
  43921. <dt>&lsquo;<samp>luma_msize_x, lx</samp>&rsquo;</dt>
  43922. <dd><p>Set the luma matrix horizontal size.
  43923. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  43924. </p>
  43925. </dd>
  43926. <dt>&lsquo;<samp>luma_msize_y, ly</samp>&rsquo;</dt>
  43927. <dd><p>Set the luma matrix vertical size.
  43928. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  43929. </p>
  43930. </dd>
  43931. <dt>&lsquo;<samp>luma_amount, la</samp>&rsquo;</dt>
  43932. <dd><p>Set the luma effect strength.
  43933. Range is <code>[-10, 10]</code> and default value is <code>1.0</code>.
  43934. </p>
  43935. <p>Negative values will blur the input video, while positive values will
  43936. sharpen it, a value of zero will disable the effect.
  43937. </p>
  43938. </dd>
  43939. <dt>&lsquo;<samp>chroma_msize_x, cx</samp>&rsquo;</dt>
  43940. <dd><p>Set the chroma matrix horizontal size.
  43941. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  43942. </p>
  43943. </dd>
  43944. <dt>&lsquo;<samp>chroma_msize_y, cy</samp>&rsquo;</dt>
  43945. <dd><p>Set the chroma matrix vertical size.
  43946. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  43947. </p>
  43948. </dd>
  43949. <dt>&lsquo;<samp>chroma_amount, ca</samp>&rsquo;</dt>
  43950. <dd><p>Set the chroma effect strength.
  43951. Range is <code>[-10, 10]</code> and default value is <code>0.0</code>.
  43952. </p>
  43953. <p>Negative values will blur the input video, while positive values will
  43954. sharpen it, a value of zero will disable the effect.
  43955. </p>
  43956. </dd>
  43957. </dl>
  43958. <p>All parameters are optional and default to the equivalent of the
  43959. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  43960. </p>
  43961. <a name="Examples-52"></a>
  43962. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-52">40.16.1 Examples</a></h3>
  43963. <ul>
  43964. <li>
  43965. Apply strong luma sharpen effect:
  43966. <div class="example">
  43967. <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
  43968. </pre></div>
  43969. </li><li>
  43970. Apply a strong blur of both luma and chroma parameters:
  43971. <div class="example">
  43972. <pre class="example">-i INPUT -vf &quot;hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload&quot; OUTPUT
  43973. </pre></div>
  43974. </li></ul>
  43975. <a name="xfade_005fopencl"></a>
  43976. <h2 class="section"><a href="ffmpeg-all.html#toc-xfade_005fopencl">40.17 xfade_opencl</a></h2>
  43977. <p>Cross fade two videos with custom transition effect by using OpenCL.
  43978. </p>
  43979. <p>It accepts the following options:
  43980. </p>
  43981. <dl compact="compact">
  43982. <dt>&lsquo;<samp>transition</samp>&rsquo;</dt>
  43983. <dd><p>Set one of possible transition effects.
  43984. </p>
  43985. <dl compact="compact">
  43986. <dt>&lsquo;<samp>custom</samp>&rsquo;</dt>
  43987. <dd><p>Select custom transition effect, the actual transition description
  43988. will be picked from source and kernel options.
  43989. </p>
  43990. </dd>
  43991. <dt>&lsquo;<samp>fade</samp>&rsquo;</dt>
  43992. <dt>&lsquo;<samp>wipeleft</samp>&rsquo;</dt>
  43993. <dt>&lsquo;<samp>wiperight</samp>&rsquo;</dt>
  43994. <dt>&lsquo;<samp>wipeup</samp>&rsquo;</dt>
  43995. <dt>&lsquo;<samp>wipedown</samp>&rsquo;</dt>
  43996. <dt>&lsquo;<samp>slideleft</samp>&rsquo;</dt>
  43997. <dt>&lsquo;<samp>slideright</samp>&rsquo;</dt>
  43998. <dt>&lsquo;<samp>slideup</samp>&rsquo;</dt>
  43999. <dt>&lsquo;<samp>slidedown</samp>&rsquo;</dt>
  44000. <dd>
  44001. <p>Default transition is fade.
  44002. </p></dd>
  44003. </dl>
  44004. </dd>
  44005. <dt>&lsquo;<samp>source</samp>&rsquo;</dt>
  44006. <dd><p>OpenCL program source file for custom transition.
  44007. </p>
  44008. </dd>
  44009. <dt>&lsquo;<samp>kernel</samp>&rsquo;</dt>
  44010. <dd><p>Set name of kernel to use for custom transition from program source file.
  44011. </p>
  44012. </dd>
  44013. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  44014. <dd><p>Set duration of video transition.
  44015. </p>
  44016. </dd>
  44017. <dt>&lsquo;<samp>offset</samp>&rsquo;</dt>
  44018. <dd><p>Set time of start of transition relative to first video.
  44019. </p></dd>
  44020. </dl>
  44021. <p>The program source file must contain a kernel function with the given name,
  44022. which will be run once for each plane of the output. Each run on a plane
  44023. gets enqueued as a separate 2D global NDRange with one work-item for each
  44024. pixel to be generated. The global ID offset for each work-item is therefore
  44025. the coordinates of a pixel in the destination image.
  44026. </p>
  44027. <p>The kernel function needs to take the following arguments:
  44028. </p><ul>
  44029. <li>
  44030. Destination image, <var>__write_only image2d_t</var>.
  44031. <p>This image will become the output; the kernel should write all of it.
  44032. </p>
  44033. </li><li>
  44034. First Source image, <var>__read_only image2d_t</var>.
  44035. Second Source image, <var>__read_only image2d_t</var>.
  44036. <p>These are the most recent images on each input. The kernel may read from
  44037. them to generate the output, but they can&rsquo;t be written to.
  44038. </p>
  44039. </li><li>
  44040. Transition progress, <var>float</var>. This value is always between 0 and 1 inclusive.
  44041. </li></ul>
  44042. <p>Example programs:
  44043. </p>
  44044. <ul>
  44045. <li>
  44046. Apply dots curtain transition effect:
  44047. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  44048. __read_only image2d_t src1,
  44049. __read_only image2d_t src2,
  44050. float progress)
  44051. {
  44052. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  44053. CLK_FILTER_LINEAR);
  44054. int2 p = (int2)(get_global_id(0), get_global_id(1));
  44055. float2 rp = (float2)(get_global_id(0), get_global_id(1));
  44056. float2 dim = (float2)(get_image_dim(src1).x, get_image_dim(src1).y);
  44057. rp = rp / dim;
  44058. float2 dots = (float2)(20.0, 20.0);
  44059. float2 center = (float2)(0,0);
  44060. float2 unused;
  44061. float4 val1 = read_imagef(src1, sampler, p);
  44062. float4 val2 = read_imagef(src2, sampler, p);
  44063. bool next = distance(fract(rp * dots, &amp;unused), (float2)(0.5, 0.5)) &lt; (progress / distance(rp, center));
  44064. write_imagef(dst, p, next ? val1 : val2);
  44065. }
  44066. </pre>
  44067. </li></ul>
  44068. <a name="VAAPI-Video-Filters"></a>
  44069. <h1 class="chapter"><a href="ffmpeg-all.html#toc-VAAPI-Video-Filters">41 VAAPI Video Filters</a></h1>
  44070. <p>VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters.
  44071. </p>
  44072. <p>To enable compilation of these filters you need to configure FFmpeg with
  44073. <code>--enable-vaapi</code>.
  44074. </p>
  44075. <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>
  44076. </p>
  44077. <a name="tonemap_005fvaapi"></a>
  44078. <h2 class="section"><a href="ffmpeg-all.html#toc-tonemap_005fvaapi">41.1 tonemap_vaapi</a></h2>
  44079. <p>Perform HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion with tone-mapping.
  44080. It maps the dynamic range of HDR10 content to the SDR content.
  44081. It currently only accepts HDR10 as input.
  44082. </p>
  44083. <p>It accepts the following parameters:
  44084. </p>
  44085. <dl compact="compact">
  44086. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  44087. <dd><p>Specify the output pixel format.
  44088. </p>
  44089. <p>Currently supported formats are:
  44090. </p><dl compact="compact">
  44091. <dt><var>p010</var></dt>
  44092. <dt><var>nv12</var></dt>
  44093. </dl>
  44094. <p>Default is nv12.
  44095. </p>
  44096. </dd>
  44097. <dt>&lsquo;<samp>primaries, p</samp>&rsquo;</dt>
  44098. <dd><p>Set the output color primaries.
  44099. </p>
  44100. <p>Default is same as input.
  44101. </p>
  44102. </dd>
  44103. <dt>&lsquo;<samp>transfer, t</samp>&rsquo;</dt>
  44104. <dd><p>Set the output transfer characteristics.
  44105. </p>
  44106. <p>Default is bt709.
  44107. </p>
  44108. </dd>
  44109. <dt>&lsquo;<samp>matrix, m</samp>&rsquo;</dt>
  44110. <dd><p>Set the output colorspace matrix.
  44111. </p>
  44112. <p>Default is same as input.
  44113. </p>
  44114. </dd>
  44115. </dl>
  44116. <a name="Example-3"></a>
  44117. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-3">41.1.1 Example</a></h3>
  44118. <ul>
  44119. <li>
  44120. Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format
  44121. <div class="example">
  44122. <pre class="example">tonemap_vaapi=format=p010:t=bt2020-10
  44123. </pre></div>
  44124. </li></ul>
  44125. <a name="Video-Sources"></a>
  44126. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Video-Sources">42 Video Sources</a></h1>
  44127. <p>Below is a description of the currently available video sources.
  44128. </p>
  44129. <a name="buffer"></a>
  44130. <h2 class="section"><a href="ffmpeg-all.html#toc-buffer">42.1 buffer</a></h2>
  44131. <p>Buffer video frames, and make them available to the filter chain.
  44132. </p>
  44133. <p>This source is mainly intended for a programmatic use, in particular
  44134. through the interface defined in &lsquo;<tt>libavfilter/vsrc_buffer.h</tt>&rsquo;.
  44135. </p>
  44136. <p>It accepts the following parameters:
  44137. </p>
  44138. <dl compact="compact">
  44139. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  44140. <dd><p>Specify the size (width and height) of the buffered video frames. For the
  44141. syntax of this option, check the
  44142. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  44143. </p>
  44144. </dd>
  44145. <dt>&lsquo;<samp>width</samp>&rsquo;</dt>
  44146. <dd><p>The input video width.
  44147. </p>
  44148. </dd>
  44149. <dt>&lsquo;<samp>height</samp>&rsquo;</dt>
  44150. <dd><p>The input video height.
  44151. </p>
  44152. </dd>
  44153. <dt>&lsquo;<samp>pix_fmt</samp>&rsquo;</dt>
  44154. <dd><p>A string representing the pixel format of the buffered video frames.
  44155. It may be a number corresponding to a pixel format, or a pixel format
  44156. name.
  44157. </p>
  44158. </dd>
  44159. <dt>&lsquo;<samp>time_base</samp>&rsquo;</dt>
  44160. <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
  44161. </p>
  44162. </dd>
  44163. <dt>&lsquo;<samp>frame_rate</samp>&rsquo;</dt>
  44164. <dd><p>Specify the frame rate expected for the video stream.
  44165. </p>
  44166. </dd>
  44167. <dt>&lsquo;<samp>pixel_aspect, sar</samp>&rsquo;</dt>
  44168. <dd><p>The sample (pixel) aspect ratio of the input video.
  44169. </p>
  44170. </dd>
  44171. <dt>&lsquo;<samp>sws_param</samp>&rsquo;</dt>
  44172. <dd><p>This option is deprecated and ignored. Prepend <code>sws_flags=<var>flags</var>;</code>
  44173. to the filtergraph description to specify swscale flags for automatically
  44174. inserted scalers. See <a href="#Filtergraph-syntax">Filtergraph syntax</a>.
  44175. </p>
  44176. </dd>
  44177. <dt>&lsquo;<samp>hw_frames_ctx</samp>&rsquo;</dt>
  44178. <dd><p>When using a hardware pixel format, this should be a reference to an
  44179. AVHWFramesContext describing input frames.
  44180. </p></dd>
  44181. </dl>
  44182. <p>For example:
  44183. </p><div class="example">
  44184. <pre class="example">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
  44185. </pre></div>
  44186. <p>will instruct the source to accept video frames with size 320x240 and
  44187. with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
  44188. square pixels (1:1 sample aspect ratio).
  44189. Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
  44190. (check the enum AVPixelFormat definition in &lsquo;<tt>libavutil/pixfmt.h</tt>&rsquo;),
  44191. this example corresponds to:
  44192. </p><div class="example">
  44193. <pre class="example">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
  44194. </pre></div>
  44195. <p>Alternatively, the options can be specified as a flat string, but this
  44196. syntax is deprecated:
  44197. </p>
  44198. <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>
  44199. </p>
  44200. <a name="cellauto"></a>
  44201. <h2 class="section"><a href="ffmpeg-all.html#toc-cellauto">42.2 cellauto</a></h2>
  44202. <p>Create a pattern generated by an elementary cellular automaton.
  44203. </p>
  44204. <p>The initial state of the cellular automaton can be defined through the
  44205. &lsquo;<samp>filename</samp>&rsquo; and &lsquo;<samp>pattern</samp>&rsquo; options. If such options are
  44206. not specified an initial state is created randomly.
  44207. </p>
  44208. <p>At each new frame a new row in the video is filled with the result of
  44209. the cellular automaton next generation. The behavior when the whole
  44210. frame is filled is defined by the &lsquo;<samp>scroll</samp>&rsquo; option.
  44211. </p>
  44212. <p>This source accepts the following options:
  44213. </p>
  44214. <dl compact="compact">
  44215. <dt>&lsquo;<samp>filename, f</samp>&rsquo;</dt>
  44216. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  44217. the specified file.
  44218. In the file, each non-whitespace character is considered an alive
  44219. cell, a newline will terminate the row, and further characters in the
  44220. file will be ignored.
  44221. </p>
  44222. </dd>
  44223. <dt>&lsquo;<samp>pattern, p</samp>&rsquo;</dt>
  44224. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  44225. the specified string.
  44226. </p>
  44227. <p>Each non-whitespace character in the string is considered an alive
  44228. cell, a newline will terminate the row, and further characters in the
  44229. string will be ignored.
  44230. </p>
  44231. </dd>
  44232. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44233. <dd><p>Set the video rate, that is the number of frames generated per second.
  44234. Default is 25.
  44235. </p>
  44236. </dd>
  44237. <dt>&lsquo;<samp>random_fill_ratio, ratio</samp>&rsquo;</dt>
  44238. <dd><p>Set the random fill ratio for the initial cellular automaton row. It
  44239. is a floating point number value ranging from 0 to 1, defaults to
  44240. 1/PHI.
  44241. </p>
  44242. <p>This option is ignored when a file or a pattern is specified.
  44243. </p>
  44244. </dd>
  44245. <dt>&lsquo;<samp>random_seed, seed</samp>&rsquo;</dt>
  44246. <dd><p>Set the seed for filling randomly the initial row, must be an integer
  44247. included between 0 and UINT32_MAX. If not specified, or if explicitly
  44248. set to -1, the filter will try to use a good random seed on a best
  44249. effort basis.
  44250. </p>
  44251. </dd>
  44252. <dt>&lsquo;<samp>rule</samp>&rsquo;</dt>
  44253. <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
  44254. Default value is 110.
  44255. </p>
  44256. </dd>
  44257. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44258. <dd><p>Set the size of the output video. For the syntax of this option, check the
  44259. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  44260. </p>
  44261. <p>If &lsquo;<samp>filename</samp>&rsquo; or &lsquo;<samp>pattern</samp>&rsquo; is specified, the size is set
  44262. by default to the width of the specified initial state row, and the
  44263. height is set to <var>width</var> * PHI.
  44264. </p>
  44265. <p>If &lsquo;<samp>size</samp>&rsquo; is set, it must contain the width of the specified
  44266. pattern string, and the specified pattern will be centered in the
  44267. larger row.
  44268. </p>
  44269. <p>If a filename or a pattern string is not specified, the size value
  44270. defaults to &quot;320x518&quot; (used for a randomly generated initial state).
  44271. </p>
  44272. </dd>
  44273. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  44274. <dd><p>If set to 1, scroll the output upward when all the rows in the output
  44275. have been already filled. If set to 0, the new generated row will be
  44276. written over the top row just after the bottom row is filled.
  44277. Defaults to 1.
  44278. </p>
  44279. </dd>
  44280. <dt>&lsquo;<samp>start_full, full</samp>&rsquo;</dt>
  44281. <dd><p>If set to 1, completely fill the output with generated rows before
  44282. outputting the first frame.
  44283. This is the default behavior, for disabling set the value to 0.
  44284. </p>
  44285. </dd>
  44286. <dt>&lsquo;<samp>stitch</samp>&rsquo;</dt>
  44287. <dd><p>If set to 1, stitch the left and right row edges together.
  44288. This is the default behavior, for disabling set the value to 0.
  44289. </p></dd>
  44290. </dl>
  44291. <a name="Examples-122"></a>
  44292. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-122">42.2.1 Examples</a></h3>
  44293. <ul>
  44294. <li>
  44295. Read the initial state from &lsquo;<tt>pattern</tt>&rsquo;, and specify an output of
  44296. size 200x400.
  44297. <div class="example">
  44298. <pre class="example">cellauto=f=pattern:s=200x400
  44299. </pre></div>
  44300. </li><li>
  44301. Generate a random initial row with a width of 200 cells, with a fill
  44302. ratio of 2/3:
  44303. <div class="example">
  44304. <pre class="example">cellauto=ratio=2/3:s=200x200
  44305. </pre></div>
  44306. </li><li>
  44307. Create a pattern generated by rule 18 starting by a single alive cell
  44308. centered on an initial row with width 100:
  44309. <div class="example">
  44310. <pre class="example">cellauto=p=@:s=100x400:full=0:rule=18
  44311. </pre></div>
  44312. </li><li>
  44313. Specify a more elaborated initial pattern:
  44314. <div class="example">
  44315. <pre class="example">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
  44316. </pre></div>
  44317. </li></ul>
  44318. <p><a name="coreimagesrc"></a>
  44319. </p><a name="coreimagesrc-1"></a>
  44320. <h2 class="section"><a href="ffmpeg-all.html#toc-coreimagesrc-1">42.3 coreimagesrc</a></h2>
  44321. <p>Video source generated on GPU using Apple&rsquo;s CoreImage API on OSX.
  44322. </p>
  44323. <p>This video source is a specialized version of the <a href="#coreimage">coreimage</a> video filter.
  44324. Use a core image generator at the beginning of the applied filterchain to
  44325. generate the content.
  44326. </p>
  44327. <p>The coreimagesrc video source accepts the following options:
  44328. </p><dl compact="compact">
  44329. <dt>&lsquo;<samp>list_generators</samp>&rsquo;</dt>
  44330. <dd><p>List all available generators along with all their respective options as well as
  44331. possible minimum and maximum values along with the default values.
  44332. </p><div class="example">
  44333. <pre class="example">list_generators=true
  44334. </pre></div>
  44335. </dd>
  44336. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44337. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  44338. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  44339. The default value is <code>320x240</code>.
  44340. </p>
  44341. </dd>
  44342. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44343. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  44344. generated per second. It has to be a string in the format
  44345. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
  44346. number or a valid video frame rate abbreviation. The default value is
  44347. &quot;25&quot;.
  44348. </p>
  44349. </dd>
  44350. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  44351. <dd><p>Set the sample aspect ratio of the sourced video.
  44352. </p>
  44353. </dd>
  44354. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  44355. <dd><p>Set the duration of the sourced video. See
  44356. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  44357. for the accepted syntax.
  44358. </p>
  44359. <p>If not specified, or the expressed duration is negative, the video is
  44360. supposed to be generated forever.
  44361. </p></dd>
  44362. </dl>
  44363. <p>Additionally, all options of the <a href="#coreimage">coreimage</a> video filter are accepted.
  44364. A complete filterchain can be used for further processing of the
  44365. generated input without CPU-HOST transfer. See <a href="#coreimage">coreimage</a> documentation
  44366. and examples for details.
  44367. </p>
  44368. <a name="Examples-167"></a>
  44369. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-167">42.3.1 Examples</a></h3>
  44370. <ul>
  44371. <li>
  44372. Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  44373. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  44374. <div class="example">
  44375. <pre class="example">ffmpeg -f lavfi -i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  44376. </pre></div>
  44377. <p>This example is equivalent to the QRCode example of <a href="#coreimage">coreimage</a> without the
  44378. need for a nullsrc video source.
  44379. </p></li></ul>
  44380. <a name="gradients"></a>
  44381. <h2 class="section"><a href="ffmpeg-all.html#toc-gradients">42.4 gradients</a></h2>
  44382. <p>Generate several gradients.
  44383. </p>
  44384. <dl compact="compact">
  44385. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44386. <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 size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  44387. </p>
  44388. </dd>
  44389. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44390. <dd><p>Set frame rate, expressed as number of frames per second. Default
  44391. value is &quot;25&quot;.
  44392. </p>
  44393. </dd>
  44394. <dt>&lsquo;<samp>c0, c1, c2, c3, c4, c5, c6, c7</samp>&rsquo;</dt>
  44395. <dd><p>Set 8 colors. Default values for colors is to pick random one.
  44396. </p>
  44397. </dd>
  44398. <dt>&lsquo;<samp>x0, y0, y0, y1</samp>&rsquo;</dt>
  44399. <dd><p>Set gradient line source and destination points. If negative or out of range, random ones
  44400. are picked.
  44401. </p>
  44402. </dd>
  44403. <dt>&lsquo;<samp>nb_colors, n</samp>&rsquo;</dt>
  44404. <dd><p>Set number of colors to use at once. Allowed range is from 2 to 8. Default value is 2.
  44405. </p>
  44406. </dd>
  44407. <dt>&lsquo;<samp>seed</samp>&rsquo;</dt>
  44408. <dd><p>Set seed for picking gradient line points.
  44409. </p></dd>
  44410. </dl>
  44411. <a name="mandelbrot"></a>
  44412. <h2 class="section"><a href="ffmpeg-all.html#toc-mandelbrot">42.5 mandelbrot</a></h2>
  44413. <p>Generate a Mandelbrot set fractal, and progressively zoom towards the
  44414. point specified with <var>start_x</var> and <var>start_y</var>.
  44415. </p>
  44416. <p>This source accepts the following options:
  44417. </p>
  44418. <dl compact="compact">
  44419. <dt>&lsquo;<samp>end_pts</samp>&rsquo;</dt>
  44420. <dd><p>Set the terminal pts value. Default value is 400.
  44421. </p>
  44422. </dd>
  44423. <dt>&lsquo;<samp>end_scale</samp>&rsquo;</dt>
  44424. <dd><p>Set the terminal scale value.
  44425. Must be a floating point value. Default value is 0.3.
  44426. </p>
  44427. </dd>
  44428. <dt>&lsquo;<samp>inner</samp>&rsquo;</dt>
  44429. <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
  44430. Mandelbrot fractal internal region.
  44431. </p>
  44432. <p>It shall assume one of the following values:
  44433. </p><dl compact="compact">
  44434. <dt>&lsquo;<samp>black</samp>&rsquo;</dt>
  44435. <dd><p>Set black mode.
  44436. </p></dd>
  44437. <dt>&lsquo;<samp>convergence</samp>&rsquo;</dt>
  44438. <dd><p>Show time until convergence.
  44439. </p></dd>
  44440. <dt>&lsquo;<samp>mincol</samp>&rsquo;</dt>
  44441. <dd><p>Set color based on point closest to the origin of the iterations.
  44442. </p></dd>
  44443. <dt>&lsquo;<samp>period</samp>&rsquo;</dt>
  44444. <dd><p>Set period mode.
  44445. </p></dd>
  44446. </dl>
  44447. <p>Default value is <var>mincol</var>.
  44448. </p>
  44449. </dd>
  44450. <dt>&lsquo;<samp>bailout</samp>&rsquo;</dt>
  44451. <dd><p>Set the bailout value. Default value is 10.0.
  44452. </p>
  44453. </dd>
  44454. <dt>&lsquo;<samp>maxiter</samp>&rsquo;</dt>
  44455. <dd><p>Set the maximum of iterations performed by the rendering
  44456. algorithm. Default value is 7189.
  44457. </p>
  44458. </dd>
  44459. <dt>&lsquo;<samp>outer</samp>&rsquo;</dt>
  44460. <dd><p>Set outer coloring mode.
  44461. It shall assume one of following values:
  44462. </p><dl compact="compact">
  44463. <dt>&lsquo;<samp>iteration_count</samp>&rsquo;</dt>
  44464. <dd><p>Set iteration count mode.
  44465. </p></dd>
  44466. <dt>&lsquo;<samp>normalized_iteration_count</samp>&rsquo;</dt>
  44467. <dd><p>set normalized iteration count mode.
  44468. </p></dd>
  44469. </dl>
  44470. <p>Default value is <var>normalized_iteration_count</var>.
  44471. </p>
  44472. </dd>
  44473. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44474. <dd><p>Set frame rate, expressed as number of frames per second. Default
  44475. value is &quot;25&quot;.
  44476. </p>
  44477. </dd>
  44478. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44479. <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 size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  44480. </p>
  44481. </dd>
  44482. <dt>&lsquo;<samp>start_scale</samp>&rsquo;</dt>
  44483. <dd><p>Set the initial scale value. Default value is 3.0.
  44484. </p>
  44485. </dd>
  44486. <dt>&lsquo;<samp>start_x</samp>&rsquo;</dt>
  44487. <dd><p>Set the initial x position. Must be a floating point value between
  44488. -100 and 100. Default value is -0.743643887037158704752191506114774.
  44489. </p>
  44490. </dd>
  44491. <dt>&lsquo;<samp>start_y</samp>&rsquo;</dt>
  44492. <dd><p>Set the initial y position. Must be a floating point value between
  44493. -100 and 100. Default value is -0.131825904205311970493132056385139.
  44494. </p></dd>
  44495. </dl>
  44496. <a name="mptestsrc"></a>
  44497. <h2 class="section"><a href="ffmpeg-all.html#toc-mptestsrc">42.6 mptestsrc</a></h2>
  44498. <p>Generate various test patterns, as generated by the MPlayer test filter.
  44499. </p>
  44500. <p>The size of the generated video is fixed, and is 256x256.
  44501. This source is useful in particular for testing encoding features.
  44502. </p>
  44503. <p>This source accepts the following options:
  44504. </p>
  44505. <dl compact="compact">
  44506. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44507. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  44508. generated per second. It has to be a string in the format
  44509. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
  44510. number or a valid video frame rate abbreviation. The default value is
  44511. &quot;25&quot;.
  44512. </p>
  44513. </dd>
  44514. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  44515. <dd><p>Set the duration of the sourced video. See
  44516. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  44517. for the accepted syntax.
  44518. </p>
  44519. <p>If not specified, or the expressed duration is negative, the video is
  44520. supposed to be generated forever.
  44521. </p>
  44522. </dd>
  44523. <dt>&lsquo;<samp>test, t</samp>&rsquo;</dt>
  44524. <dd>
  44525. <p>Set the number or the name of the test to perform. Supported tests are:
  44526. </p><dl compact="compact">
  44527. <dt>&lsquo;<samp>dc_luma</samp>&rsquo;</dt>
  44528. <dt>&lsquo;<samp>dc_chroma</samp>&rsquo;</dt>
  44529. <dt>&lsquo;<samp>freq_luma</samp>&rsquo;</dt>
  44530. <dt>&lsquo;<samp>freq_chroma</samp>&rsquo;</dt>
  44531. <dt>&lsquo;<samp>amp_luma</samp>&rsquo;</dt>
  44532. <dt>&lsquo;<samp>amp_chroma</samp>&rsquo;</dt>
  44533. <dt>&lsquo;<samp>cbp</samp>&rsquo;</dt>
  44534. <dt>&lsquo;<samp>mv</samp>&rsquo;</dt>
  44535. <dt>&lsquo;<samp>ring1</samp>&rsquo;</dt>
  44536. <dt>&lsquo;<samp>ring2</samp>&rsquo;</dt>
  44537. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  44538. <dt>&lsquo;<samp>max_frames, m</samp>&rsquo;</dt>
  44539. <dd><p>Set the maximum number of frames generated for each test, default value is 30.
  44540. </p>
  44541. </dd>
  44542. </dl>
  44543. <p>Default value is &quot;all&quot;, which will cycle through the list of all tests.
  44544. </p></dd>
  44545. </dl>
  44546. <p>Some examples:
  44547. </p><div class="example">
  44548. <pre class="example">mptestsrc=t=dc_luma
  44549. </pre></div>
  44550. <p>will generate a &quot;dc_luma&quot; test pattern.
  44551. </p>
  44552. <a name="frei0r_005fsrc"></a>
  44553. <h2 class="section"><a href="ffmpeg-all.html#toc-frei0r_005fsrc">42.7 frei0r_src</a></h2>
  44554. <p>Provide a frei0r source.
  44555. </p>
  44556. <p>To enable compilation of this filter you need to install the frei0r
  44557. header and configure FFmpeg with <code>--enable-frei0r</code>.
  44558. </p>
  44559. <p>This source accepts the following parameters:
  44560. </p>
  44561. <dl compact="compact">
  44562. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  44563. <dd><p>The size of the video to generate. For the syntax of this option, check the
  44564. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  44565. </p>
  44566. </dd>
  44567. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  44568. <dd><p>The framerate of the generated video. It may be a string of the form
  44569. <var>num</var>/<var>den</var> or a frame rate abbreviation.
  44570. </p>
  44571. </dd>
  44572. <dt>&lsquo;<samp>filter_name</samp>&rsquo;</dt>
  44573. <dd><p>The name to the frei0r source to load. For more information regarding frei0r and
  44574. how to set the parameters, read the <a href="#frei0r">frei0r</a> section in the video filters
  44575. documentation.
  44576. </p>
  44577. </dd>
  44578. <dt>&lsquo;<samp>filter_params</samp>&rsquo;</dt>
  44579. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r source.
  44580. </p>
  44581. </dd>
  44582. </dl>
  44583. <p>For example, to generate a frei0r partik0l source with size 200x200
  44584. and frame rate 10 which is overlaid on the overlay filter main input:
  44585. </p><div class="example">
  44586. <pre class="example">frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
  44587. </pre></div>
  44588. <a name="life"></a>
  44589. <h2 class="section"><a href="ffmpeg-all.html#toc-life">42.8 life</a></h2>
  44590. <p>Generate a life pattern.
  44591. </p>
  44592. <p>This source is based on a generalization of John Conway&rsquo;s life game.
  44593. </p>
  44594. <p>The sourced input represents a life grid, each pixel represents a cell
  44595. which can be in one of two possible states, alive or dead. Every cell
  44596. interacts with its eight neighbours, which are the cells that are
  44597. horizontally, vertically, or diagonally adjacent.
  44598. </p>
  44599. <p>At each interaction the grid evolves according to the adopted rule,
  44600. which specifies the number of neighbor alive cells which will make a
  44601. cell stay alive or born. The &lsquo;<samp>rule</samp>&rsquo; option allows one to specify
  44602. the rule to adopt.
  44603. </p>
  44604. <p>This source accepts the following options:
  44605. </p>
  44606. <dl compact="compact">
  44607. <dt>&lsquo;<samp>filename, f</samp>&rsquo;</dt>
  44608. <dd><p>Set the file from which to read the initial grid state. In the file,
  44609. each non-whitespace character is considered an alive cell, and newline
  44610. is used to delimit the end of each row.
  44611. </p>
  44612. <p>If this option is not specified, the initial grid is generated
  44613. randomly.
  44614. </p>
  44615. </dd>
  44616. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44617. <dd><p>Set the video rate, that is the number of frames generated per second.
  44618. Default is 25.
  44619. </p>
  44620. </dd>
  44621. <dt>&lsquo;<samp>random_fill_ratio, ratio</samp>&rsquo;</dt>
  44622. <dd><p>Set the random fill ratio for the initial random grid. It is a
  44623. floating point number value ranging from 0 to 1, defaults to 1/PHI.
  44624. It is ignored when a file is specified.
  44625. </p>
  44626. </dd>
  44627. <dt>&lsquo;<samp>random_seed, seed</samp>&rsquo;</dt>
  44628. <dd><p>Set the seed for filling the initial random grid, must be an integer
  44629. included between 0 and UINT32_MAX. If not specified, or if explicitly
  44630. set to -1, the filter will try to use a good random seed on a best
  44631. effort basis.
  44632. </p>
  44633. </dd>
  44634. <dt>&lsquo;<samp>rule</samp>&rsquo;</dt>
  44635. <dd><p>Set the life rule.
  44636. </p>
  44637. <p>A rule can be specified with a code of the kind &quot;S<var>NS</var>/B<var>NB</var>&quot;,
  44638. where <var>NS</var> and <var>NB</var> are sequences of numbers in the range 0-8,
  44639. <var>NS</var> specifies the number of alive neighbor cells which make a
  44640. live cell stay alive, and <var>NB</var> the number of alive neighbor cells
  44641. which make a dead cell to become alive (i.e. to &quot;born&quot;).
  44642. &quot;s&quot; and &quot;b&quot; can be used in place of &quot;S&quot; and &quot;B&quot;, respectively.
  44643. </p>
  44644. <p>Alternatively a rule can be specified by an 18-bits integer. The 9
  44645. high order bits are used to encode the next cell state if it is alive
  44646. for each number of neighbor alive cells, the low order bits specify
  44647. the rule for &quot;borning&quot; new cells. Higher order bits encode for an
  44648. higher number of neighbor cells.
  44649. For example the number 6153 = <code>(12&lt;&lt;9)+9</code> specifies a stay alive
  44650. rule of 12 and a born rule of 9, which corresponds to &quot;S23/B03&quot;.
  44651. </p>
  44652. <p>Default value is &quot;S23/B3&quot;, which is the original Conway&rsquo;s game of life
  44653. rule, and will keep a cell alive if it has 2 or 3 neighbor alive
  44654. cells, and will born a new cell if there are three alive cells around
  44655. a dead cell.
  44656. </p>
  44657. </dd>
  44658. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44659. <dd><p>Set the size of the output video. For the syntax of this option, check the
  44660. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  44661. </p>
  44662. <p>If &lsquo;<samp>filename</samp>&rsquo; is specified, the size is set by default to the
  44663. same size of the input file. If &lsquo;<samp>size</samp>&rsquo; is set, it must contain
  44664. the size specified in the input file, and the initial grid defined in
  44665. that file is centered in the larger resulting area.
  44666. </p>
  44667. <p>If a filename is not specified, the size value defaults to &quot;320x240&quot;
  44668. (used for a randomly generated initial grid).
  44669. </p>
  44670. </dd>
  44671. <dt>&lsquo;<samp>stitch</samp>&rsquo;</dt>
  44672. <dd><p>If set to 1, stitch the left and right grid edges together, and the
  44673. top and bottom edges also. Defaults to 1.
  44674. </p>
  44675. </dd>
  44676. <dt>&lsquo;<samp>mold</samp>&rsquo;</dt>
  44677. <dd><p>Set cell mold speed. If set, a dead cell will go from &lsquo;<samp>death_color</samp>&rsquo; to
  44678. &lsquo;<samp>mold_color</samp>&rsquo; with a step of &lsquo;<samp>mold</samp>&rsquo;. &lsquo;<samp>mold</samp>&rsquo; can have a
  44679. value from 0 to 255.
  44680. </p>
  44681. </dd>
  44682. <dt>&lsquo;<samp>life_color</samp>&rsquo;</dt>
  44683. <dd><p>Set the color of living (or new born) cells.
  44684. </p>
  44685. </dd>
  44686. <dt>&lsquo;<samp>death_color</samp>&rsquo;</dt>
  44687. <dd><p>Set the color of dead cells. If &lsquo;<samp>mold</samp>&rsquo; is set, this is the first color
  44688. used to represent a dead cell.
  44689. </p>
  44690. </dd>
  44691. <dt>&lsquo;<samp>mold_color</samp>&rsquo;</dt>
  44692. <dd><p>Set mold color, for definitely dead and moldy cells.
  44693. </p>
  44694. <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 ffmpeg-utils manual</a>.
  44695. </p></dd>
  44696. </dl>
  44697. <a name="Examples-31"></a>
  44698. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-31">42.8.1 Examples</a></h3>
  44699. <ul>
  44700. <li>
  44701. Read a grid from &lsquo;<tt>pattern</tt>&rsquo;, and center it on a grid of size
  44702. 300x300 pixels:
  44703. <div class="example">
  44704. <pre class="example">life=f=pattern:s=300x300
  44705. </pre></div>
  44706. </li><li>
  44707. Generate a random grid of size 200x200, with a fill ratio of 2/3:
  44708. <div class="example">
  44709. <pre class="example">life=ratio=2/3:s=200x200
  44710. </pre></div>
  44711. </li><li>
  44712. Specify a custom rule for evolving a randomly generated grid:
  44713. <div class="example">
  44714. <pre class="example">life=rule=S14/B34
  44715. </pre></div>
  44716. </li><li>
  44717. Full example with slow death effect (mold) using <code>ffplay</code>:
  44718. <div class="example">
  44719. <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
  44720. </pre></div>
  44721. </li></ul>
  44722. <p><a name="allrgb"></a>
  44723. <a name="allyuv"></a>
  44724. <a name="color"></a>
  44725. <a name="haldclutsrc"></a>
  44726. <a name="nullsrc"></a>
  44727. <a name="pal75bars"></a>
  44728. <a name="pal100bars"></a>
  44729. <a name="rgbtestsrc"></a>
  44730. <a name="smptebars"></a>
  44731. <a name="smptehdbars"></a>
  44732. <a name="testsrc"></a>
  44733. <a name="testsrc2"></a>
  44734. <a name="yuvtestsrc"></a>
  44735. </p><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>
  44736. <h2 class="section"><a href="ffmpeg-all.html#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">42.9 allrgb, allyuv, color, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc</a></h2>
  44737. <p>The <code>allrgb</code> source returns frames of size 4096x4096 of all rgb colors.
  44738. </p>
  44739. <p>The <code>allyuv</code> source returns frames of size 4096x4096 of all yuv colors.
  44740. </p>
  44741. <p>The <code>color</code> source provides an uniformly colored input.
  44742. </p>
  44743. <p>The <code>haldclutsrc</code> source provides an identity Hald CLUT. See also
  44744. <a href="#haldclut">haldclut</a> filter.
  44745. </p>
  44746. <p>The <code>nullsrc</code> source returns unprocessed video frames. It is
  44747. mainly useful to be employed in analysis / debugging tools, or as the
  44748. source for filters which ignore the input data.
  44749. </p>
  44750. <p>The <code>pal75bars</code> source generates a color bars pattern, based on
  44751. EBU PAL recommendations with 75% color levels.
  44752. </p>
  44753. <p>The <code>pal100bars</code> source generates a color bars pattern, based on
  44754. EBU PAL recommendations with 100% color levels.
  44755. </p>
  44756. <p>The <code>rgbtestsrc</code> source generates an RGB test pattern useful for
  44757. detecting RGB vs BGR issues. You should see a red, green and blue
  44758. stripe from top to bottom.
  44759. </p>
  44760. <p>The <code>smptebars</code> source generates a color bars pattern, based on
  44761. the SMPTE Engineering Guideline EG 1-1990.
  44762. </p>
  44763. <p>The <code>smptehdbars</code> source generates a color bars pattern, based on
  44764. the SMPTE RP 219-2002.
  44765. </p>
  44766. <p>The <code>testsrc</code> source generates a test video pattern, showing a
  44767. color pattern, a scrolling gradient and a timestamp. This is mainly
  44768. intended for testing purposes.
  44769. </p>
  44770. <p>The <code>testsrc2</code> source is similar to testsrc, but supports more
  44771. pixel formats instead of just <code>rgb24</code>. This allows using it as an
  44772. input for other tests without requiring a format conversion.
  44773. </p>
  44774. <p>The <code>yuvtestsrc</code> source generates an YUV test pattern. You should
  44775. see a y, cb and cr stripe from top to bottom.
  44776. </p>
  44777. <p>The sources accept the following parameters:
  44778. </p>
  44779. <dl compact="compact">
  44780. <dt>&lsquo;<samp>level</samp>&rsquo;</dt>
  44781. <dd><p>Specify the level of the Hald CLUT, only available in the <code>haldclutsrc</code>
  44782. source. A level of <code>N</code> generates a picture of <code>N*N*N</code> by <code>N*N*N</code>
  44783. pixels to be used as identity matrix for 3D lookup tables. Each component is
  44784. coded on a <code>1/(N*N)</code> scale.
  44785. </p>
  44786. </dd>
  44787. <dt>&lsquo;<samp>color, c</samp>&rsquo;</dt>
  44788. <dd><p>Specify the color of the source, only available in the <code>color</code>
  44789. source. For the syntax of this option, check the
  44790. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  44791. </p>
  44792. </dd>
  44793. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44794. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  44795. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  44796. The default value is <code>320x240</code>.
  44797. </p>
  44798. <p>This option is not available with the <code>allrgb</code>, <code>allyuv</code>, and
  44799. <code>haldclutsrc</code> filters.
  44800. </p>
  44801. </dd>
  44802. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44803. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  44804. generated per second. It has to be a string in the format
  44805. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
  44806. number or a valid video frame rate abbreviation. The default value is
  44807. &quot;25&quot;.
  44808. </p>
  44809. </dd>
  44810. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  44811. <dd><p>Set the duration of the sourced video. See
  44812. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  44813. for the accepted syntax.
  44814. </p>
  44815. <p>If not specified, or the expressed duration is negative, the video is
  44816. supposed to be generated forever.
  44817. </p>
  44818. </dd>
  44819. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  44820. <dd><p>Set the sample aspect ratio of the sourced video.
  44821. </p>
  44822. </dd>
  44823. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  44824. <dd><p>Specify the alpha (opacity) of the background, only available in the
  44825. <code>testsrc2</code> source. The value must be between 0 (fully transparent) and
  44826. 255 (fully opaque, the default).
  44827. </p>
  44828. </dd>
  44829. <dt>&lsquo;<samp>decimals, n</samp>&rsquo;</dt>
  44830. <dd><p>Set the number of decimals to show in the timestamp, only available in the
  44831. <code>testsrc</code> source.
  44832. </p>
  44833. <p>The displayed timestamp value will correspond to the original
  44834. timestamp value multiplied by the power of 10 of the specified
  44835. value. Default value is 0.
  44836. </p></dd>
  44837. </dl>
  44838. <a name="Examples-63"></a>
  44839. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-63">42.9.1 Examples</a></h3>
  44840. <ul>
  44841. <li>
  44842. Generate a video with a duration of 5.3 seconds, with size
  44843. 176x144 and a frame rate of 10 frames per second:
  44844. <div class="example">
  44845. <pre class="example">testsrc=duration=5.3:size=qcif:rate=10
  44846. </pre></div>
  44847. </li><li>
  44848. The following graph description will generate a red source
  44849. with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
  44850. frames per second:
  44851. <div class="example">
  44852. <pre class="example">color=c=red@0.2:s=qcif:r=10
  44853. </pre></div>
  44854. </li><li>
  44855. If the input content is to be ignored, <code>nullsrc</code> can be used. The
  44856. following command generates noise in the luminance plane by employing
  44857. the <code>geq</code> filter:
  44858. <div class="example">
  44859. <pre class="example">nullsrc=s=256x256, geq=random(1)*255:128:128
  44860. </pre></div>
  44861. </li></ul>
  44862. <a name="Commands-22"></a>
  44863. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-22">42.9.2 Commands</a></h3>
  44864. <p>The <code>color</code> source supports the following commands:
  44865. </p>
  44866. <dl compact="compact">
  44867. <dt>&lsquo;<samp>c, color</samp>&rsquo;</dt>
  44868. <dd><p>Set the color of the created image. Accepts the same syntax of the
  44869. corresponding &lsquo;<samp>color</samp>&rsquo; option.
  44870. </p></dd>
  44871. </dl>
  44872. <a name="openclsrc"></a>
  44873. <h2 class="section"><a href="ffmpeg-all.html#toc-openclsrc">42.10 openclsrc</a></h2>
  44874. <p>Generate video using an OpenCL program.
  44875. </p>
  44876. <dl compact="compact">
  44877. <dt>&lsquo;<samp>source</samp>&rsquo;</dt>
  44878. <dd><p>OpenCL program source file.
  44879. </p>
  44880. </dd>
  44881. <dt>&lsquo;<samp>kernel</samp>&rsquo;</dt>
  44882. <dd><p>Kernel name in program.
  44883. </p>
  44884. </dd>
  44885. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44886. <dd><p>Size of frames to generate. This must be set.
  44887. </p>
  44888. </dd>
  44889. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  44890. <dd><p>Pixel format to use for the generated frames. This must be set.
  44891. </p>
  44892. </dd>
  44893. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44894. <dd><p>Number of frames generated every second. Default value is &rsquo;25&rsquo;.
  44895. </p>
  44896. </dd>
  44897. </dl>
  44898. <p>For details of how the program loading works, see the <a href="#program_005fopencl">program_opencl</a>
  44899. filter.
  44900. </p>
  44901. <p>Example programs:
  44902. </p>
  44903. <ul>
  44904. <li>
  44905. Generate a colour ramp by setting pixel values from the position of the pixel
  44906. in the output image. (Note that this will work with all pixel formats, but
  44907. the generated output will not be the same.)
  44908. <pre class="verbatim">__kernel void ramp(__write_only image2d_t dst,
  44909. unsigned int index)
  44910. {
  44911. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  44912. float4 val;
  44913. val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));
  44914. write_imagef(dst, loc, val);
  44915. }
  44916. </pre>
  44917. </li><li>
  44918. Generate a Sierpinski carpet pattern, panning by a single pixel each frame.
  44919. <pre class="verbatim">__kernel void sierpinski_carpet(__write_only image2d_t dst,
  44920. unsigned int index)
  44921. {
  44922. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  44923. float4 value = 0.0f;
  44924. int x = loc.x + index;
  44925. int y = loc.y + index;
  44926. while (x &gt; 0 || y &gt; 0) {
  44927. if (x % 3 == 1 &amp;&amp; y % 3 == 1) {
  44928. value = 1.0f;
  44929. break;
  44930. }
  44931. x /= 3;
  44932. y /= 3;
  44933. }
  44934. write_imagef(dst, loc, value);
  44935. }
  44936. </pre>
  44937. </li></ul>
  44938. <a name="sierpinski"></a>
  44939. <h2 class="section"><a href="ffmpeg-all.html#toc-sierpinski">42.11 sierpinski</a></h2>
  44940. <p>Generate a Sierpinski carpet/triangle fractal, and randomly pan around.
  44941. </p>
  44942. <p>This source accepts the following options:
  44943. </p>
  44944. <dl compact="compact">
  44945. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44946. <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 size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  44947. </p>
  44948. </dd>
  44949. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44950. <dd><p>Set frame rate, expressed as number of frames per second. Default
  44951. value is &quot;25&quot;.
  44952. </p>
  44953. </dd>
  44954. <dt>&lsquo;<samp>seed</samp>&rsquo;</dt>
  44955. <dd><p>Set seed which is used for random panning.
  44956. </p>
  44957. </dd>
  44958. <dt>&lsquo;<samp>jump</samp>&rsquo;</dt>
  44959. <dd><p>Set max jump for single pan destination. Allowed range is from 1 to 10000.
  44960. </p>
  44961. </dd>
  44962. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  44963. <dd><p>Set fractal type, can be default <code>carpet</code> or <code>triangle</code>.
  44964. </p></dd>
  44965. </dl>
  44966. <a name="Video-Sinks"></a>
  44967. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Video-Sinks">43 Video Sinks</a></h1>
  44968. <p>Below is a description of the currently available video sinks.
  44969. </p>
  44970. <a name="buffersink"></a>
  44971. <h2 class="section"><a href="ffmpeg-all.html#toc-buffersink">43.1 buffersink</a></h2>
  44972. <p>Buffer video frames, and make them available to the end of the filter
  44973. graph.
  44974. </p>
  44975. <p>This sink is mainly intended for programmatic use, in particular
  44976. through the interface defined in &lsquo;<tt>libavfilter/buffersink.h</tt>&rsquo;
  44977. or the options system.
  44978. </p>
  44979. <p>It accepts a pointer to an AVBufferSinkContext structure, which
  44980. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  44981. parameter to <code>avfilter_init_filter</code> for initialization.
  44982. </p>
  44983. <a name="nullsink"></a>
  44984. <h2 class="section"><a href="ffmpeg-all.html#toc-nullsink">43.2 nullsink</a></h2>
  44985. <p>Null video sink: do absolutely nothing with the input video. It is
  44986. mainly useful as a template and for use in analysis / debugging
  44987. tools.
  44988. </p>
  44989. <a name="Multimedia-Filters"></a>
  44990. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Multimedia-Filters">44 Multimedia Filters</a></h1>
  44991. <p>Below is a description of the currently available multimedia filters.
  44992. </p>
  44993. <a name="abitscope"></a>
  44994. <h2 class="section"><a href="ffmpeg-all.html#toc-abitscope">44.1 abitscope</a></h2>
  44995. <p>Convert input audio to a video output, displaying the audio bit scope.
  44996. </p>
  44997. <p>The filter accepts the following options:
  44998. </p>
  44999. <dl compact="compact">
  45000. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  45001. <dd><p>Set frame rate, expressed as number of frames per second. Default
  45002. value is &quot;25&quot;.
  45003. </p>
  45004. </dd>
  45005. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  45006. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  45007. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  45008. Default value is <code>1024x256</code>.
  45009. </p>
  45010. </dd>
  45011. <dt>&lsquo;<samp>colors</samp>&rsquo;</dt>
  45012. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  45013. draw channels. Unrecognized or missing colors will be replaced
  45014. by white color.
  45015. </p></dd>
  45016. </dl>
  45017. <a name="adrawgraph"></a>
  45018. <h2 class="section"><a href="ffmpeg-all.html#toc-adrawgraph">44.2 adrawgraph</a></h2>
  45019. <p>Draw a graph using input audio metadata.
  45020. </p>
  45021. <p>See <a href="#drawgraph">drawgraph</a>
  45022. </p>
  45023. <a name="agraphmonitor"></a>
  45024. <h2 class="section"><a href="ffmpeg-all.html#toc-agraphmonitor">44.3 agraphmonitor</a></h2>
  45025. <p>See <a href="#graphmonitor">graphmonitor</a>.
  45026. </p>
  45027. <a name="ahistogram"></a>
  45028. <h2 class="section"><a href="ffmpeg-all.html#toc-ahistogram">44.4 ahistogram</a></h2>
  45029. <p>Convert input audio to a video output, displaying the volume histogram.
  45030. </p>
  45031. <p>The filter accepts the following options:
  45032. </p>
  45033. <dl compact="compact">
  45034. <dt>&lsquo;<samp>dmode</samp>&rsquo;</dt>
  45035. <dd><p>Specify how histogram is calculated.
  45036. </p>
  45037. <p>It accepts the following values:
  45038. </p><dl compact="compact">
  45039. <dt>&lsquo;<samp>single</samp>&rsquo;</dt>
  45040. <dd><p>Use single histogram for all channels.
  45041. </p></dd>
  45042. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  45043. <dd><p>Use separate histogram for each channel.
  45044. </p></dd>
  45045. </dl>
  45046. <p>Default is <code>single</code>.
  45047. </p>
  45048. </dd>
  45049. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  45050. <dd><p>Set frame rate, expressed as number of frames per second. Default
  45051. value is &quot;25&quot;.
  45052. </p>
  45053. </dd>
  45054. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  45055. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  45056. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  45057. Default value is <code>hd720</code>.
  45058. </p>
  45059. </dd>
  45060. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  45061. <dd><p>Set display scale.
  45062. </p>
  45063. <p>It accepts the following values:
  45064. </p><dl compact="compact">
  45065. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  45066. <dd><p>logarithmic
  45067. </p></dd>
  45068. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  45069. <dd><p>square root
  45070. </p></dd>
  45071. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  45072. <dd><p>cubic root
  45073. </p></dd>
  45074. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  45075. <dd><p>linear
  45076. </p></dd>
  45077. <dt>&lsquo;<samp>rlog</samp>&rsquo;</dt>
  45078. <dd><p>reverse logarithmic
  45079. </p></dd>
  45080. </dl>
  45081. <p>Default is <code>log</code>.
  45082. </p>
  45083. </dd>
  45084. <dt>&lsquo;<samp>ascale</samp>&rsquo;</dt>
  45085. <dd><p>Set amplitude scale.
  45086. </p>
  45087. <p>It accepts the following values:
  45088. </p><dl compact="compact">
  45089. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  45090. <dd><p>logarithmic
  45091. </p></dd>
  45092. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  45093. <dd><p>linear
  45094. </p></dd>
  45095. </dl>
  45096. <p>Default is <code>log</code>.
  45097. </p>
  45098. </dd>
  45099. <dt>&lsquo;<samp>acount</samp>&rsquo;</dt>
  45100. <dd><p>Set how much frames to accumulate in histogram.
  45101. Default is 1. Setting this to -1 accumulates all frames.
  45102. </p>
  45103. </dd>
  45104. <dt>&lsquo;<samp>rheight</samp>&rsquo;</dt>
  45105. <dd><p>Set histogram ratio of window height.
  45106. </p>
  45107. </dd>
  45108. <dt>&lsquo;<samp>slide</samp>&rsquo;</dt>
  45109. <dd><p>Set sonogram sliding.
  45110. </p>
  45111. <p>It accepts the following values:
  45112. </p><dl compact="compact">
  45113. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  45114. <dd><p>replace old rows with new ones.
  45115. </p></dd>
  45116. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  45117. <dd><p>scroll from top to bottom.
  45118. </p></dd>
  45119. </dl>
  45120. <p>Default is <code>replace</code>.
  45121. </p></dd>
  45122. </dl>
  45123. <a name="aphasemeter"></a>
  45124. <h2 class="section"><a href="ffmpeg-all.html#toc-aphasemeter">44.5 aphasemeter</a></h2>
  45125. <p>Measures phase of input audio, which is exported as metadata <code>lavfi.aphasemeter.phase</code>,
  45126. representing mean phase of current audio frame. A video output can also be produced and is
  45127. enabled by default. The audio is passed through as first output.
  45128. </p>
  45129. <p>Audio will be rematrixed to stereo if it has a different channel layout. Phase value is in
  45130. range <code>[-1, 1]</code> where <code>-1</code> means left and right channels are completely out of phase
  45131. and <code>1</code> means channels are in phase.
  45132. </p>
  45133. <p>The filter accepts the following options, all related to its video output:
  45134. </p>
  45135. <dl compact="compact">
  45136. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  45137. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  45138. </p>
  45139. </dd>
  45140. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  45141. <dd><p>Set the video size for the output. For the syntax of this option, check the
  45142. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  45143. Default value is <code>800x400</code>.
  45144. </p>
  45145. </dd>
  45146. <dt>&lsquo;<samp>rc</samp>&rsquo;</dt>
  45147. <dt>&lsquo;<samp>gc</samp>&rsquo;</dt>
  45148. <dt>&lsquo;<samp>bc</samp>&rsquo;</dt>
  45149. <dd><p>Specify the red, green, blue contrast. Default values are <code>2</code>,
  45150. <code>7</code> and <code>1</code>.
  45151. Allowed range is <code>[0, 255]</code>.
  45152. </p>
  45153. </dd>
  45154. <dt>&lsquo;<samp>mpc</samp>&rsquo;</dt>
  45155. <dd><p>Set color which will be used for drawing median phase. If color is
  45156. <code>none</code> which is default, no median phase value will be drawn.
  45157. </p>
  45158. </dd>
  45159. <dt>&lsquo;<samp>video</samp>&rsquo;</dt>
  45160. <dd><p>Enable video output. Default is enabled.
  45161. </p></dd>
  45162. </dl>
  45163. <a name="avectorscope"></a>
  45164. <h2 class="section"><a href="ffmpeg-all.html#toc-avectorscope">44.6 avectorscope</a></h2>
  45165. <p>Convert input audio to a video output, representing the audio vector
  45166. scope.
  45167. </p>
  45168. <p>The filter is used to measure the difference between channels of stereo
  45169. audio stream. A monaural signal, consisting of identical left and right
  45170. signal, results in straight vertical line. Any stereo separation is visible
  45171. as a deviation from this line, creating a Lissajous figure.
  45172. If the straight (or deviation from it) but horizontal line appears this
  45173. indicates that the left and right channels are out of phase.
  45174. </p>
  45175. <p>The filter accepts the following options:
  45176. </p>
  45177. <dl compact="compact">
  45178. <dt>&lsquo;<samp>mode, m</samp>&rsquo;</dt>
  45179. <dd><p>Set the vectorscope mode.
  45180. </p>
  45181. <p>Available values are:
  45182. </p><dl compact="compact">
  45183. <dt>&lsquo;<samp>lissajous</samp>&rsquo;</dt>
  45184. <dd><p>Lissajous rotated by 45 degrees.
  45185. </p>
  45186. </dd>
  45187. <dt>&lsquo;<samp>lissajous_xy</samp>&rsquo;</dt>
  45188. <dd><p>Same as above but not rotated.
  45189. </p>
  45190. </dd>
  45191. <dt>&lsquo;<samp>polar</samp>&rsquo;</dt>
  45192. <dd><p>Shape resembling half of circle.
  45193. </p></dd>
  45194. </dl>
  45195. <p>Default value is &lsquo;<samp>lissajous</samp>&rsquo;.
  45196. </p>
  45197. </dd>
  45198. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  45199. <dd><p>Set the video size for the output. For the syntax of this option, check the
  45200. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  45201. Default value is <code>400x400</code>.
  45202. </p>
  45203. </dd>
  45204. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  45205. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  45206. </p>
  45207. </dd>
  45208. <dt>&lsquo;<samp>rc</samp>&rsquo;</dt>
  45209. <dt>&lsquo;<samp>gc</samp>&rsquo;</dt>
  45210. <dt>&lsquo;<samp>bc</samp>&rsquo;</dt>
  45211. <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
  45212. <dd><p>Specify the red, green, blue and alpha contrast. Default values are <code>40</code>,
  45213. <code>160</code>, <code>80</code> and <code>255</code>.
  45214. Allowed range is <code>[0, 255]</code>.
  45215. </p>
  45216. </dd>
  45217. <dt>&lsquo;<samp>rf</samp>&rsquo;</dt>
  45218. <dt>&lsquo;<samp>gf</samp>&rsquo;</dt>
  45219. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  45220. <dt>&lsquo;<samp>af</samp>&rsquo;</dt>
  45221. <dd><p>Specify the red, green, blue and alpha fade. Default values are <code>15</code>,
  45222. <code>10</code>, <code>5</code> and <code>5</code>.
  45223. Allowed range is <code>[0, 255]</code>.
  45224. </p>
  45225. </dd>
  45226. <dt>&lsquo;<samp>zoom</samp>&rsquo;</dt>
  45227. <dd><p>Set the zoom factor. Default value is <code>1</code>. Allowed range is <code>[0, 10]</code>.
  45228. Values lower than <var>1</var> will auto adjust zoom factor to maximal possible value.
  45229. </p>
  45230. </dd>
  45231. <dt>&lsquo;<samp>draw</samp>&rsquo;</dt>
  45232. <dd><p>Set the vectorscope drawing mode.
  45233. </p>
  45234. <p>Available values are:
  45235. </p><dl compact="compact">
  45236. <dt>&lsquo;<samp>dot</samp>&rsquo;</dt>
  45237. <dd><p>Draw dot for each sample.
  45238. </p>
  45239. </dd>
  45240. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  45241. <dd><p>Draw line between previous and current sample.
  45242. </p></dd>
  45243. </dl>
  45244. <p>Default value is &lsquo;<samp>dot</samp>&rsquo;.
  45245. </p>
  45246. </dd>
  45247. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  45248. <dd><p>Specify amplitude scale of audio samples.
  45249. </p>
  45250. <p>Available values are:
  45251. </p><dl compact="compact">
  45252. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  45253. <dd><p>Linear.
  45254. </p>
  45255. </dd>
  45256. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  45257. <dd><p>Square root.
  45258. </p>
  45259. </dd>
  45260. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  45261. <dd><p>Cubic root.
  45262. </p>
  45263. </dd>
  45264. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  45265. <dd><p>Logarithmic.
  45266. </p></dd>
  45267. </dl>
  45268. </dd>
  45269. <dt>&lsquo;<samp>swap</samp>&rsquo;</dt>
  45270. <dd><p>Swap left channel axis with right channel axis.
  45271. </p>
  45272. </dd>
  45273. <dt>&lsquo;<samp>mirror</samp>&rsquo;</dt>
  45274. <dd><p>Mirror axis.
  45275. </p>
  45276. <dl compact="compact">
  45277. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  45278. <dd><p>No mirror.
  45279. </p>
  45280. </dd>
  45281. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  45282. <dd><p>Mirror only x axis.
  45283. </p>
  45284. </dd>
  45285. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  45286. <dd><p>Mirror only y axis.
  45287. </p>
  45288. </dd>
  45289. <dt>&lsquo;<samp>xy</samp>&rsquo;</dt>
  45290. <dd><p>Mirror both axis.
  45291. </p></dd>
  45292. </dl>
  45293. </dd>
  45294. </dl>
  45295. <a name="Examples-8"></a>
  45296. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-8">44.6.1 Examples</a></h3>
  45297. <ul>
  45298. <li>
  45299. Complete example using <code>ffplay</code>:
  45300. <div class="example">
  45301. <pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  45302. [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
  45303. </pre></div>
  45304. </li></ul>
  45305. <a name="bench_002c-abench"></a>
  45306. <h2 class="section"><a href="ffmpeg-all.html#toc-bench_002c-abench">44.7 bench, abench</a></h2>
  45307. <p>Benchmark part of a filtergraph.
  45308. </p>
  45309. <p>The filter accepts the following options:
  45310. </p>
  45311. <dl compact="compact">
  45312. <dt>&lsquo;<samp>action</samp>&rsquo;</dt>
  45313. <dd><p>Start or stop a timer.
  45314. </p>
  45315. <p>Available values are:
  45316. </p><dl compact="compact">
  45317. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  45318. <dd><p>Get the current time, set it as frame metadata (using the key
  45319. <code>lavfi.bench.start_time</code>), and forward the frame to the next filter.
  45320. </p>
  45321. </dd>
  45322. <dt>&lsquo;<samp>stop</samp>&rsquo;</dt>
  45323. <dd><p>Get the current time and fetch the <code>lavfi.bench.start_time</code> metadata from
  45324. the input frame metadata to get the time difference. Time difference, average,
  45325. maximum and minimum time (respectively <code>t</code>, <code>avg</code>, <code>max</code> and
  45326. <code>min</code>) are then printed. The timestamps are expressed in seconds.
  45327. </p></dd>
  45328. </dl>
  45329. </dd>
  45330. </dl>
  45331. <a name="Examples-141"></a>
  45332. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-141">44.7.1 Examples</a></h3>
  45333. <ul>
  45334. <li>
  45335. Benchmark <a href="#selectivecolor">selectivecolor</a> filter:
  45336. <div class="example">
  45337. <pre class="example">bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
  45338. </pre></div>
  45339. </li></ul>
  45340. <a name="concat-2"></a>
  45341. <h2 class="section"><a href="ffmpeg-all.html#toc-concat-2">44.8 concat</a></h2>
  45342. <p>Concatenate audio and video streams, joining them together one after the
  45343. other.
  45344. </p>
  45345. <p>The filter works on segments of synchronized video and audio streams. All
  45346. segments must have the same number of streams of each type, and that will
  45347. also be the number of streams at output.
  45348. </p>
  45349. <p>The filter accepts the following options:
  45350. </p>
  45351. <dl compact="compact">
  45352. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  45353. <dd><p>Set the number of segments. Default is 2.
  45354. </p>
  45355. </dd>
  45356. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  45357. <dd><p>Set the number of output video streams, that is also the number of video
  45358. streams in each segment. Default is 1.
  45359. </p>
  45360. </dd>
  45361. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  45362. <dd><p>Set the number of output audio streams, that is also the number of audio
  45363. streams in each segment. Default is 0.
  45364. </p>
  45365. </dd>
  45366. <dt>&lsquo;<samp>unsafe</samp>&rsquo;</dt>
  45367. <dd><p>Activate unsafe mode: do not fail if segments have a different format.
  45368. </p>
  45369. </dd>
  45370. </dl>
  45371. <p>The filter has <var>v</var>+<var>a</var> outputs: first <var>v</var> video outputs, then
  45372. <var>a</var> audio outputs.
  45373. </p>
  45374. <p>There are <var>n</var>x(<var>v</var>+<var>a</var>) inputs: first the inputs for the first
  45375. segment, in the same order as the outputs, then the inputs for the second
  45376. segment, etc.
  45377. </p>
  45378. <p>Related streams do not always have exactly the same duration, for various
  45379. reasons including codec frame size or sloppy authoring. For that reason,
  45380. related synchronized streams (e.g. a video and its audio track) should be
  45381. concatenated at once. The concat filter will use the duration of the longest
  45382. stream in each segment (except the last one), and if necessary pad shorter
  45383. audio streams with silence.
  45384. </p>
  45385. <p>For this filter to work correctly, all segments must start at timestamp 0.
  45386. </p>
  45387. <p>All corresponding streams must have the same parameters in all segments; the
  45388. filtering system will automatically select a common pixel format for video
  45389. streams, and a common sample format, sample rate and channel layout for
  45390. audio streams, but other settings, such as resolution, must be converted
  45391. explicitly by the user.
  45392. </p>
  45393. <p>Different frame rates are acceptable but will result in variable frame rate
  45394. at output; be sure to configure the output file to handle it.
  45395. </p>
  45396. <a name="Examples-66"></a>
  45397. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-66">44.8.1 Examples</a></h3>
  45398. <ul>
  45399. <li>
  45400. Concatenate an opening, an episode and an ending, all in bilingual version
  45401. (video in stream 0, audio in streams 1 and 2):
  45402. <div class="example">
  45403. <pre class="example">ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
  45404. '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
  45405. concat=n=3:v=1:a=2 [v] [a1] [a2]' \
  45406. -map '[v]' -map '[a1]' -map '[a2]' output.mkv
  45407. </pre></div>
  45408. </li><li>
  45409. Concatenate two parts, handling audio and video separately, using the
  45410. (a)movie sources, and adjusting the resolution:
  45411. <div class="example">
  45412. <pre class="example">movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
  45413. movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
  45414. [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
  45415. </pre></div>
  45416. <p>Note that a desync will happen at the stitch if the audio and video streams
  45417. do not have exactly the same duration in the first file.
  45418. </p>
  45419. </li></ul>
  45420. <a name="Commands-23"></a>
  45421. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-23">44.8.2 Commands</a></h3>
  45422. <p>This filter supports the following commands:
  45423. </p><dl compact="compact">
  45424. <dt>&lsquo;<samp>next</samp>&rsquo;</dt>
  45425. <dd><p>Close the current segment and step to the next one
  45426. </p></dd>
  45427. </dl>
  45428. <p><a name="ebur128"></a>
  45429. </p><a name="ebur128-1"></a>
  45430. <h2 class="section"><a href="ffmpeg-all.html#toc-ebur128-1">44.9 ebur128</a></h2>
  45431. <p>EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness
  45432. level. By default, it logs a message at a frequency of 10Hz with the
  45433. Momentary loudness (identified by <code>M</code>), Short-term loudness (<code>S</code>),
  45434. Integrated loudness (<code>I</code>) and Loudness Range (<code>LRA</code>).
  45435. </p>
  45436. <p>The filter can only analyze streams which have a sampling rate of 48000 Hz and whose
  45437. sample format is double-precision floating point. The input stream will be converted to
  45438. this specification, if needed. Users may need to insert aformat and/or aresample filters
  45439. after this filter to obtain the original parameters.
  45440. </p>
  45441. <p>The filter also has a video output (see the <var>video</var> option) with a real
  45442. time graph to observe the loudness evolution. The graphic contains the logged
  45443. message mentioned above, so it is not printed anymore when this option is set,
  45444. unless the verbose logging is set. The main graphing area contains the
  45445. short-term loudness (3 seconds of analysis), and the gauge on the right is for
  45446. the momentary loudness (400 milliseconds), but can optionally be configured
  45447. to instead display short-term loudness (see <var>gauge</var>).
  45448. </p>
  45449. <p>The green area marks a +/- 1LU target range around the target loudness
  45450. (-23LUFS by default, unless modified through <var>target</var>).
  45451. </p>
  45452. <p>More information about the Loudness Recommendation EBU R128 on
  45453. <a href="http://tech.ebu.ch/loudness">http://tech.ebu.ch/loudness</a>.
  45454. </p>
  45455. <p>The filter accepts the following options:
  45456. </p>
  45457. <dl compact="compact">
  45458. <dt>&lsquo;<samp>video</samp>&rsquo;</dt>
  45459. <dd><p>Activate the video output. The audio stream is passed unchanged whether this
  45460. option is set or no. The video stream will be the first output stream if
  45461. activated. Default is <code>0</code>.
  45462. </p>
  45463. </dd>
  45464. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  45465. <dd><p>Set the video size. This option is for video only. For the syntax of this
  45466. option, check the
  45467. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  45468. Default and minimum resolution is <code>640x480</code>.
  45469. </p>
  45470. </dd>
  45471. <dt>&lsquo;<samp>meter</samp>&rsquo;</dt>
  45472. <dd><p>Set the EBU scale meter. Default is <code>9</code>. Common values are <code>9</code> and
  45473. <code>18</code>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
  45474. other integer value between this range is allowed.
  45475. </p>
  45476. </dd>
  45477. <dt>&lsquo;<samp>metadata</samp>&rsquo;</dt>
  45478. <dd><p>Set metadata injection. If set to <code>1</code>, the audio input will be segmented
  45479. into 100ms output frames, each of them containing various loudness information
  45480. in metadata. All the metadata keys are prefixed with <code>lavfi.r128.</code>.
  45481. </p>
  45482. <p>Default is <code>0</code>.
  45483. </p>
  45484. </dd>
  45485. <dt>&lsquo;<samp>framelog</samp>&rsquo;</dt>
  45486. <dd><p>Force the frame logging level.
  45487. </p>
  45488. <p>Available values are:
  45489. </p><dl compact="compact">
  45490. <dt>&lsquo;<samp>info</samp>&rsquo;</dt>
  45491. <dd><p>information logging level
  45492. </p></dd>
  45493. <dt>&lsquo;<samp>verbose</samp>&rsquo;</dt>
  45494. <dd><p>verbose logging level
  45495. </p></dd>
  45496. </dl>
  45497. <p>By default, the logging level is set to <var>info</var>. If the &lsquo;<samp>video</samp>&rsquo; or
  45498. the &lsquo;<samp>metadata</samp>&rsquo; options are set, it switches to <var>verbose</var>.
  45499. </p>
  45500. </dd>
  45501. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  45502. <dd><p>Set peak mode(s).
  45503. </p>
  45504. <p>Available modes can be cumulated (the option is a <code>flag</code> type). Possible
  45505. values are:
  45506. </p><dl compact="compact">
  45507. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  45508. <dd><p>Disable any peak mode (default).
  45509. </p></dd>
  45510. <dt>&lsquo;<samp>sample</samp>&rsquo;</dt>
  45511. <dd><p>Enable sample-peak mode.
  45512. </p>
  45513. <p>Simple peak mode looking for the higher sample value. It logs a message
  45514. for sample-peak (identified by <code>SPK</code>).
  45515. </p></dd>
  45516. <dt>&lsquo;<samp>true</samp>&rsquo;</dt>
  45517. <dd><p>Enable true-peak mode.
  45518. </p>
  45519. <p>If enabled, the peak lookup is done on an over-sampled version of the input
  45520. stream for better peak accuracy. It logs a message for true-peak.
  45521. (identified by <code>TPK</code>) and true-peak per frame (identified by <code>FTPK</code>).
  45522. This mode requires a build with <code>libswresample</code>.
  45523. </p></dd>
  45524. </dl>
  45525. </dd>
  45526. <dt>&lsquo;<samp>dualmono</samp>&rsquo;</dt>
  45527. <dd><p>Treat mono input files as &quot;dual mono&quot;. If a mono file is intended for playback
  45528. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  45529. If set to <code>true</code>, this option will compensate for this effect.
  45530. Multi-channel input files are not affected by this option.
  45531. </p>
  45532. </dd>
  45533. <dt>&lsquo;<samp>panlaw</samp>&rsquo;</dt>
  45534. <dd><p>Set a specific pan law to be used for the measurement of dual mono files.
  45535. This parameter is optional, and has a default value of -3.01dB.
  45536. </p>
  45537. </dd>
  45538. <dt>&lsquo;<samp>target</samp>&rsquo;</dt>
  45539. <dd><p>Set a specific target level (in LUFS) used as relative zero in the visualization.
  45540. This parameter is optional and has a default value of -23LUFS as specified
  45541. by EBU R128. However, material published online may prefer a level of -16LUFS
  45542. (e.g. for use with podcasts or video platforms).
  45543. </p>
  45544. </dd>
  45545. <dt>&lsquo;<samp>gauge</samp>&rsquo;</dt>
  45546. <dd><p>Set the value displayed by the gauge. Valid values are <code>momentary</code> and s
  45547. <code>shortterm</code>. By default the momentary value will be used, but in certain
  45548. scenarios it may be more useful to observe the short term value instead (e.g.
  45549. live mixing).
  45550. </p>
  45551. </dd>
  45552. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  45553. <dd><p>Sets the display scale for the loudness. Valid parameters are <code>absolute</code>
  45554. (in LUFS) or <code>relative</code> (LU) relative to the target. This only affects the
  45555. video output, not the summary or continuous log output.
  45556. </p></dd>
  45557. </dl>
  45558. <a name="Examples-134"></a>
  45559. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-134">44.9.1 Examples</a></h3>
  45560. <ul>
  45561. <li>
  45562. Real-time graph using <code>ffplay</code>, with a EBU scale meter +18:
  45563. <div class="example">
  45564. <pre class="example">ffplay -f lavfi -i &quot;amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]&quot;
  45565. </pre></div>
  45566. </li><li>
  45567. Run an analysis with <code>ffmpeg</code>:
  45568. <div class="example">
  45569. <pre class="example">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
  45570. </pre></div>
  45571. </li></ul>
  45572. <a name="interleave_002c-ainterleave"></a>
  45573. <h2 class="section"><a href="ffmpeg-all.html#toc-interleave_002c-ainterleave">44.10 interleave, ainterleave</a></h2>
  45574. <p>Temporally interleave frames from several inputs.
  45575. </p>
  45576. <p><code>interleave</code> works with video inputs, <code>ainterleave</code> with audio.
  45577. </p>
  45578. <p>These filters read frames from several inputs and send the oldest
  45579. queued frame to the output.
  45580. </p>
  45581. <p>Input streams must have well defined, monotonically increasing frame
  45582. timestamp values.
  45583. </p>
  45584. <p>In order to submit one frame to output, these filters need to enqueue
  45585. at least one frame for each input, so they cannot work in case one
  45586. input is not yet terminated and will not receive incoming frames.
  45587. </p>
  45588. <p>For example consider the case when one input is a <code>select</code> filter
  45589. which always drops input frames. The <code>interleave</code> filter will keep
  45590. reading from that input, but it will never be able to send new frames
  45591. to output until the input sends an end-of-stream signal.
  45592. </p>
  45593. <p>Also, depending on inputs synchronization, the filters will drop
  45594. frames in case one input receives more frames than the other ones, and
  45595. the queue is already filled.
  45596. </p>
  45597. <p>These filters accept the following options:
  45598. </p>
  45599. <dl compact="compact">
  45600. <dt>&lsquo;<samp>nb_inputs, n</samp>&rsquo;</dt>
  45601. <dd><p>Set the number of different inputs, it is 2 by default.
  45602. </p>
  45603. </dd>
  45604. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  45605. <dd><p>How to determine the end-of-stream.
  45606. </p>
  45607. <dl compact="compact">
  45608. <dt>&lsquo;<samp>longest</samp>&rsquo;</dt>
  45609. <dd><p>The duration of the longest input. (default)
  45610. </p>
  45611. </dd>
  45612. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  45613. <dd><p>The duration of the shortest input.
  45614. </p>
  45615. </dd>
  45616. <dt>&lsquo;<samp>first</samp>&rsquo;</dt>
  45617. <dd><p>The duration of the first input.
  45618. </p></dd>
  45619. </dl>
  45620. </dd>
  45621. </dl>
  45622. <a name="Examples-125"></a>
  45623. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-125">44.10.1 Examples</a></h3>
  45624. <ul>
  45625. <li>
  45626. Interleave frames belonging to different streams using <code>ffmpeg</code>:
  45627. <div class="example">
  45628. <pre class="example">ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex &quot;[0:v][1:v] interleave&quot; out.avi
  45629. </pre></div>
  45630. </li><li>
  45631. Add flickering blur effect:
  45632. <div class="example">
  45633. <pre class="example">select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
  45634. </pre></div>
  45635. </li></ul>
  45636. <a name="metadata_002c-ametadata"></a>
  45637. <h2 class="section"><a href="ffmpeg-all.html#toc-metadata_002c-ametadata">44.11 metadata, ametadata</a></h2>
  45638. <p>Manipulate frame metadata.
  45639. </p>
  45640. <p>This filter accepts the following options:
  45641. </p>
  45642. <dl compact="compact">
  45643. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  45644. <dd><p>Set mode of operation of the filter.
  45645. </p>
  45646. <p>Can be one of the following:
  45647. </p>
  45648. <dl compact="compact">
  45649. <dt>&lsquo;<samp>select</samp>&rsquo;</dt>
  45650. <dd><p>If both <code>value</code> and <code>key</code> is set, select frames
  45651. which have such metadata. If only <code>key</code> is set, select
  45652. every frame that has such key in metadata.
  45653. </p>
  45654. </dd>
  45655. <dt>&lsquo;<samp>add</samp>&rsquo;</dt>
  45656. <dd><p>Add new metadata <code>key</code> and <code>value</code>. If key is already available
  45657. do nothing.
  45658. </p>
  45659. </dd>
  45660. <dt>&lsquo;<samp>modify</samp>&rsquo;</dt>
  45661. <dd><p>Modify value of already present key.
  45662. </p>
  45663. </dd>
  45664. <dt>&lsquo;<samp>delete</samp>&rsquo;</dt>
  45665. <dd><p>If <code>value</code> is set, delete only keys that have such value.
  45666. Otherwise, delete key. If <code>key</code> is not set, delete all metadata values in
  45667. the frame.
  45668. </p>
  45669. </dd>
  45670. <dt>&lsquo;<samp>print</samp>&rsquo;</dt>
  45671. <dd><p>Print key and its value if metadata was found. If <code>key</code> is not set print all
  45672. metadata values available in frame.
  45673. </p></dd>
  45674. </dl>
  45675. </dd>
  45676. <dt>&lsquo;<samp>key</samp>&rsquo;</dt>
  45677. <dd><p>Set key used with all modes. Must be set for all modes except <code>print</code> and <code>delete</code>.
  45678. </p>
  45679. </dd>
  45680. <dt>&lsquo;<samp>value</samp>&rsquo;</dt>
  45681. <dd><p>Set metadata value which will be used. This option is mandatory for
  45682. <code>modify</code> and <code>add</code> mode.
  45683. </p>
  45684. </dd>
  45685. <dt>&lsquo;<samp>function</samp>&rsquo;</dt>
  45686. <dd><p>Which function to use when comparing metadata value and <code>value</code>.
  45687. </p>
  45688. <p>Can be one of following:
  45689. </p>
  45690. <dl compact="compact">
  45691. <dt>&lsquo;<samp>same_str</samp>&rsquo;</dt>
  45692. <dd><p>Values are interpreted as strings, returns true if metadata value is same as <code>value</code>.
  45693. </p>
  45694. </dd>
  45695. <dt>&lsquo;<samp>starts_with</samp>&rsquo;</dt>
  45696. <dd><p>Values are interpreted as strings, returns true if metadata value starts with
  45697. the <code>value</code> option string.
  45698. </p>
  45699. </dd>
  45700. <dt>&lsquo;<samp>less</samp>&rsquo;</dt>
  45701. <dd><p>Values are interpreted as floats, returns true if metadata value is less than <code>value</code>.
  45702. </p>
  45703. </dd>
  45704. <dt>&lsquo;<samp>equal</samp>&rsquo;</dt>
  45705. <dd><p>Values are interpreted as floats, returns true if <code>value</code> is equal with metadata value.
  45706. </p>
  45707. </dd>
  45708. <dt>&lsquo;<samp>greater</samp>&rsquo;</dt>
  45709. <dd><p>Values are interpreted as floats, returns true if metadata value is greater than <code>value</code>.
  45710. </p>
  45711. </dd>
  45712. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  45713. <dd><p>Values are interpreted as floats, returns true if expression from option <code>expr</code>
  45714. evaluates to true.
  45715. </p>
  45716. </dd>
  45717. <dt>&lsquo;<samp>ends_with</samp>&rsquo;</dt>
  45718. <dd><p>Values are interpreted as strings, returns true if metadata value ends with
  45719. the <code>value</code> option string.
  45720. </p></dd>
  45721. </dl>
  45722. </dd>
  45723. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  45724. <dd><p>Set expression which is used when <code>function</code> is set to <code>expr</code>.
  45725. The expression is evaluated through the eval API and can contain the following
  45726. constants:
  45727. </p>
  45728. <dl compact="compact">
  45729. <dt>&lsquo;<samp>VALUE1</samp>&rsquo;</dt>
  45730. <dd><p>Float representation of <code>value</code> from metadata key.
  45731. </p>
  45732. </dd>
  45733. <dt>&lsquo;<samp>VALUE2</samp>&rsquo;</dt>
  45734. <dd><p>Float representation of <code>value</code> as supplied by user in <code>value</code> option.
  45735. </p></dd>
  45736. </dl>
  45737. </dd>
  45738. <dt>&lsquo;<samp>file</samp>&rsquo;</dt>
  45739. <dd><p>If specified in <code>print</code> mode, output is written to the named file. Instead of
  45740. plain filename any writable url can be specified. Filename &ldquo;-&rdquo; is a shorthand
  45741. for standard output. If <code>file</code> option is not set, output is written to the log
  45742. with AV_LOG_INFO loglevel.
  45743. </p>
  45744. </dd>
  45745. <dt>&lsquo;<samp>direct</samp>&rsquo;</dt>
  45746. <dd><p>Reduces buffering in print mode when output is written to a URL set using <var>file</var>.
  45747. </p>
  45748. </dd>
  45749. </dl>
  45750. <a name="Examples-186"></a>
  45751. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-186">44.11.1 Examples</a></h3>
  45752. <ul>
  45753. <li>
  45754. Print all metadata values for frames with key <code>lavfi.signalstats.YDIF</code> with values
  45755. between 0 and 1.
  45756. <div class="example">
  45757. <pre class="example">signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
  45758. </pre></div>
  45759. </li><li>
  45760. Print silencedetect output to file &lsquo;<tt>metadata.txt</tt>&rsquo;.
  45761. <div class="example">
  45762. <pre class="example">silencedetect,ametadata=mode=print:file=metadata.txt
  45763. </pre></div>
  45764. </li><li>
  45765. Direct all metadata to a pipe with file descriptor 4.
  45766. <div class="example">
  45767. <pre class="example">metadata=mode=print:file='pipe\:4'
  45768. </pre></div>
  45769. </li></ul>
  45770. <a name="perms_002c-aperms"></a>
  45771. <h2 class="section"><a href="ffmpeg-all.html#toc-perms_002c-aperms">44.12 perms, aperms</a></h2>
  45772. <p>Set read/write permissions for the output frames.
  45773. </p>
  45774. <p>These filters are mainly aimed at developers to test direct path in the
  45775. following filter in the filtergraph.
  45776. </p>
  45777. <p>The filters accept the following options:
  45778. </p>
  45779. <dl compact="compact">
  45780. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  45781. <dd><p>Select the permissions mode.
  45782. </p>
  45783. <p>It accepts the following values:
  45784. </p><dl compact="compact">
  45785. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  45786. <dd><p>Do nothing. This is the default.
  45787. </p></dd>
  45788. <dt>&lsquo;<samp>ro</samp>&rsquo;</dt>
  45789. <dd><p>Set all the output frames read-only.
  45790. </p></dd>
  45791. <dt>&lsquo;<samp>rw</samp>&rsquo;</dt>
  45792. <dd><p>Set all the output frames directly writable.
  45793. </p></dd>
  45794. <dt>&lsquo;<samp>toggle</samp>&rsquo;</dt>
  45795. <dd><p>Make the frame read-only if writable, and writable if read-only.
  45796. </p></dd>
  45797. <dt>&lsquo;<samp>random</samp>&rsquo;</dt>
  45798. <dd><p>Set each output frame read-only or writable randomly.
  45799. </p></dd>
  45800. </dl>
  45801. </dd>
  45802. <dt>&lsquo;<samp>seed</samp>&rsquo;</dt>
  45803. <dd><p>Set the seed for the <var>random</var> mode, must be an integer included between
  45804. <code>0</code> and <code>UINT32_MAX</code>. If not specified, or if explicitly set to
  45805. <code>-1</code>, the filter will try to use a good random seed on a best effort
  45806. basis.
  45807. </p></dd>
  45808. </dl>
  45809. <p>Note: in case of auto-inserted filter between the permission filter and the
  45810. following one, the permission might not be received as expected in that
  45811. following filter. Inserting a <a href="#format">format</a> or <a href="#aformat">aformat</a> filter before the
  45812. perms/aperms filter can avoid this problem.
  45813. </p>
  45814. <a name="realtime_002c-arealtime"></a>
  45815. <h2 class="section"><a href="ffmpeg-all.html#toc-realtime_002c-arealtime">44.13 realtime, arealtime</a></h2>
  45816. <p>Slow down filtering to match real time approximately.
  45817. </p>
  45818. <p>These filters will pause the filtering for a variable amount of time to
  45819. match the output rate with the input timestamps.
  45820. They are similar to the &lsquo;<samp>re</samp>&rsquo; option to <code>ffmpeg</code>.
  45821. </p>
  45822. <p>They accept the following options:
  45823. </p>
  45824. <dl compact="compact">
  45825. <dt>&lsquo;<samp>limit</samp>&rsquo;</dt>
  45826. <dd><p>Time limit for the pauses. Any pause longer than that will be considered
  45827. a timestamp discontinuity and reset the timer. Default is 2 seconds.
  45828. </p></dd>
  45829. <dt>&lsquo;<samp>speed</samp>&rsquo;</dt>
  45830. <dd><p>Speed factor for processing. The value must be a float larger than zero.
  45831. Values larger than 1.0 will result in faster than realtime processing,
  45832. smaller will slow processing down. The <var>limit</var> is automatically adapted
  45833. accordingly. Default is 1.0.
  45834. </p>
  45835. <p>A processing speed faster than what is possible without these filters cannot
  45836. be achieved.
  45837. </p></dd>
  45838. </dl>
  45839. <p><a name="select"></a>
  45840. </p><a name="select_002c-aselect"></a>
  45841. <h2 class="section"><a href="ffmpeg-all.html#toc-select_002c-aselect">44.14 select, aselect</a></h2>
  45842. <p>Select frames to pass in output.
  45843. </p>
  45844. <p>This filter accepts the following options:
  45845. </p>
  45846. <dl compact="compact">
  45847. <dt>&lsquo;<samp>expr, e</samp>&rsquo;</dt>
  45848. <dd><p>Set expression, which is evaluated for each input frame.
  45849. </p>
  45850. <p>If the expression is evaluated to zero, the frame is discarded.
  45851. </p>
  45852. <p>If the evaluation result is negative or NaN, the frame is sent to the
  45853. first output; otherwise it is sent to the output with index
  45854. <code>ceil(val)-1</code>, assuming that the input index starts from 0.
  45855. </p>
  45856. <p>For example a value of <code>1.2</code> corresponds to the output with index
  45857. <code>ceil(1.2)-1 = 2-1 = 1</code>, that is the second output.
  45858. </p>
  45859. </dd>
  45860. <dt>&lsquo;<samp>outputs, n</samp>&rsquo;</dt>
  45861. <dd><p>Set the number of outputs. The output to which to send the selected
  45862. frame is based on the result of the evaluation. Default value is 1.
  45863. </p></dd>
  45864. </dl>
  45865. <p>The expression can contain the following constants:
  45866. </p>
  45867. <dl compact="compact">
  45868. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  45869. <dd><p>The (sequential) number of the filtered frame, starting from 0.
  45870. </p>
  45871. </dd>
  45872. <dt>&lsquo;<samp>selected_n</samp>&rsquo;</dt>
  45873. <dd><p>The (sequential) number of the selected frame, starting from 0.
  45874. </p>
  45875. </dd>
  45876. <dt>&lsquo;<samp>prev_selected_n</samp>&rsquo;</dt>
  45877. <dd><p>The sequential number of the last selected frame. It&rsquo;s NAN if undefined.
  45878. </p>
  45879. </dd>
  45880. <dt>&lsquo;<samp>TB</samp>&rsquo;</dt>
  45881. <dd><p>The timebase of the input timestamps.
  45882. </p>
  45883. </dd>
  45884. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  45885. <dd><p>The PTS (Presentation TimeStamp) of the filtered video frame,
  45886. expressed in <var>TB</var> units. It&rsquo;s NAN if undefined.
  45887. </p>
  45888. </dd>
  45889. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  45890. <dd><p>The PTS of the filtered video frame,
  45891. expressed in seconds. It&rsquo;s NAN if undefined.
  45892. </p>
  45893. </dd>
  45894. <dt>&lsquo;<samp>prev_pts</samp>&rsquo;</dt>
  45895. <dd><p>The PTS of the previously filtered video frame. It&rsquo;s NAN if undefined.
  45896. </p>
  45897. </dd>
  45898. <dt>&lsquo;<samp>prev_selected_pts</samp>&rsquo;</dt>
  45899. <dd><p>The PTS of the last previously filtered video frame. It&rsquo;s NAN if undefined.
  45900. </p>
  45901. </dd>
  45902. <dt>&lsquo;<samp>prev_selected_t</samp>&rsquo;</dt>
  45903. <dd><p>The PTS of the last previously selected video frame, expressed in seconds. It&rsquo;s NAN if undefined.
  45904. </p>
  45905. </dd>
  45906. <dt>&lsquo;<samp>start_pts</samp>&rsquo;</dt>
  45907. <dd><p>The PTS of the first video frame in the video. It&rsquo;s NAN if undefined.
  45908. </p>
  45909. </dd>
  45910. <dt>&lsquo;<samp>start_t</samp>&rsquo;</dt>
  45911. <dd><p>The time of the first video frame in the video. It&rsquo;s NAN if undefined.
  45912. </p>
  45913. </dd>
  45914. <dt>&lsquo;<samp>pict_type <em>(video only)</em></samp>&rsquo;</dt>
  45915. <dd><p>The type of the filtered frame. It can assume one of the following
  45916. values:
  45917. </p><dl compact="compact">
  45918. <dt>&lsquo;<samp>I</samp>&rsquo;</dt>
  45919. <dt>&lsquo;<samp>P</samp>&rsquo;</dt>
  45920. <dt>&lsquo;<samp>B</samp>&rsquo;</dt>
  45921. <dt>&lsquo;<samp>S</samp>&rsquo;</dt>
  45922. <dt>&lsquo;<samp>SI</samp>&rsquo;</dt>
  45923. <dt>&lsquo;<samp>SP</samp>&rsquo;</dt>
  45924. <dt>&lsquo;<samp>BI</samp>&rsquo;</dt>
  45925. </dl>
  45926. </dd>
  45927. <dt>&lsquo;<samp>interlace_type <em>(video only)</em></samp>&rsquo;</dt>
  45928. <dd><p>The frame interlace type. It can assume one of the following values:
  45929. </p><dl compact="compact">
  45930. <dt>&lsquo;<samp>PROGRESSIVE</samp>&rsquo;</dt>
  45931. <dd><p>The frame is progressive (not interlaced).
  45932. </p></dd>
  45933. <dt>&lsquo;<samp>TOPFIRST</samp>&rsquo;</dt>
  45934. <dd><p>The frame is top-field-first.
  45935. </p></dd>
  45936. <dt>&lsquo;<samp>BOTTOMFIRST</samp>&rsquo;</dt>
  45937. <dd><p>The frame is bottom-field-first.
  45938. </p></dd>
  45939. </dl>
  45940. </dd>
  45941. <dt>&lsquo;<samp>consumed_sample_n <em>(audio only)</em></samp>&rsquo;</dt>
  45942. <dd><p>the number of selected samples before the current frame
  45943. </p>
  45944. </dd>
  45945. <dt>&lsquo;<samp>samples_n <em>(audio only)</em></samp>&rsquo;</dt>
  45946. <dd><p>the number of samples in the current frame
  45947. </p>
  45948. </dd>
  45949. <dt>&lsquo;<samp>sample_rate <em>(audio only)</em></samp>&rsquo;</dt>
  45950. <dd><p>the input sample rate
  45951. </p>
  45952. </dd>
  45953. <dt>&lsquo;<samp>key</samp>&rsquo;</dt>
  45954. <dd><p>This is 1 if the filtered frame is a key-frame, 0 otherwise.
  45955. </p>
  45956. </dd>
  45957. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  45958. <dd><p>the position in the file of the filtered frame, -1 if the information
  45959. is not available (e.g. for synthetic video)
  45960. </p>
  45961. </dd>
  45962. <dt>&lsquo;<samp>scene <em>(video only)</em></samp>&rsquo;</dt>
  45963. <dd><p>value between 0 and 1 to indicate a new scene; a low value reflects a low
  45964. probability for the current frame to introduce a new scene, while a higher
  45965. value means the current frame is more likely to be one (see the example below)
  45966. </p>
  45967. </dd>
  45968. <dt>&lsquo;<samp>concatdec_select</samp>&rsquo;</dt>
  45969. <dd><p>The concat demuxer can select only part of a concat input file by setting an
  45970. inpoint and an outpoint, but the output packets may not be entirely contained
  45971. in the selected interval. By using this variable, it is possible to skip frames
  45972. generated by the concat demuxer which are not exactly contained in the selected
  45973. interval.
  45974. </p>
  45975. <p>This works by comparing the frame pts against the <var>lavf.concat.start_time</var>
  45976. and the <var>lavf.concat.duration</var> packet metadata values which are also
  45977. present in the decoded frames.
  45978. </p>
  45979. <p>The <var>concatdec_select</var> variable is -1 if the frame pts is at least
  45980. start_time and either the duration metadata is missing or the frame pts is less
  45981. than start_time + duration, 0 otherwise, and NaN if the start_time metadata is
  45982. missing.
  45983. </p>
  45984. <p>That basically means that an input frame is selected if its pts is within the
  45985. interval set by the concat demuxer.
  45986. </p>
  45987. </dd>
  45988. </dl>
  45989. <p>The default value of the select expression is &quot;1&quot;.
  45990. </p>
  45991. <a name="Examples-86"></a>
  45992. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-86">44.14.1 Examples</a></h3>
  45993. <ul>
  45994. <li>
  45995. Select all frames in input:
  45996. <div class="example">
  45997. <pre class="example">select
  45998. </pre></div>
  45999. <p>The example above is the same as:
  46000. </p><div class="example">
  46001. <pre class="example">select=1
  46002. </pre></div>
  46003. </li><li>
  46004. Skip all frames:
  46005. <div class="example">
  46006. <pre class="example">select=0
  46007. </pre></div>
  46008. </li><li>
  46009. Select only I-frames:
  46010. <div class="example">
  46011. <pre class="example">select='eq(pict_type\,I)'
  46012. </pre></div>
  46013. </li><li>
  46014. Select one frame every 100:
  46015. <div class="example">
  46016. <pre class="example">select='not(mod(n\,100))'
  46017. </pre></div>
  46018. </li><li>
  46019. Select only frames contained in the 10-20 time interval:
  46020. <div class="example">
  46021. <pre class="example">select=between(t\,10\,20)
  46022. </pre></div>
  46023. </li><li>
  46024. Select only I-frames contained in the 10-20 time interval:
  46025. <div class="example">
  46026. <pre class="example">select=between(t\,10\,20)*eq(pict_type\,I)
  46027. </pre></div>
  46028. </li><li>
  46029. Select frames with a minimum distance of 10 seconds:
  46030. <div class="example">
  46031. <pre class="example">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
  46032. </pre></div>
  46033. </li><li>
  46034. Use aselect to select only audio frames with samples number &gt; 100:
  46035. <div class="example">
  46036. <pre class="example">aselect='gt(samples_n\,100)'
  46037. </pre></div>
  46038. </li><li>
  46039. Create a mosaic of the first scenes:
  46040. <div class="example">
  46041. <pre class="example">ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
  46042. </pre></div>
  46043. <p>Comparing <var>scene</var> against a value between 0.3 and 0.5 is generally a sane
  46044. choice.
  46045. </p>
  46046. </li><li>
  46047. Send even and odd frames to separate outputs, and compose them:
  46048. <div class="example">
  46049. <pre class="example">select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
  46050. </pre></div>
  46051. </li><li>
  46052. Select useful frames from an ffconcat file which is using inpoints and
  46053. outpoints but where the source files are not intra frame only.
  46054. <div class="example">
  46055. <pre class="example">ffmpeg -copyts -vsync 0 -segment_time_metadata 1 -i input.ffconcat -vf select=concatdec_select -af aselect=concatdec_select output.avi
  46056. </pre></div>
  46057. </li></ul>
  46058. <a name="sendcmd_002c-asendcmd"></a>
  46059. <h2 class="section"><a href="ffmpeg-all.html#toc-sendcmd_002c-asendcmd">44.15 sendcmd, asendcmd</a></h2>
  46060. <p>Send commands to filters in the filtergraph.
  46061. </p>
  46062. <p>These filters read commands to be sent to other filters in the
  46063. filtergraph.
  46064. </p>
  46065. <p><code>sendcmd</code> must be inserted between two video filters,
  46066. <code>asendcmd</code> must be inserted between two audio filters, but apart
  46067. from that they act the same way.
  46068. </p>
  46069. <p>The specification of commands can be provided in the filter arguments
  46070. with the <var>commands</var> option, or in a file specified by the
  46071. <var>filename</var> option.
  46072. </p>
  46073. <p>These filters accept the following options:
  46074. </p><dl compact="compact">
  46075. <dt>&lsquo;<samp>commands, c</samp>&rsquo;</dt>
  46076. <dd><p>Set the commands to be read and sent to the other filters.
  46077. </p></dd>
  46078. <dt>&lsquo;<samp>filename, f</samp>&rsquo;</dt>
  46079. <dd><p>Set the filename of the commands to be read and sent to the other
  46080. filters.
  46081. </p></dd>
  46082. </dl>
  46083. <a name="Commands-syntax"></a>
  46084. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-syntax">44.15.1 Commands syntax</a></h3>
  46085. <p>A commands description consists of a sequence of interval
  46086. specifications, comprising a list of commands to be executed when a
  46087. particular event related to that interval occurs. The occurring event
  46088. is typically the current frame time entering or leaving a given time
  46089. interval.
  46090. </p>
  46091. <p>An interval is specified by the following syntax:
  46092. </p><div class="example">
  46093. <pre class="example"><var>START</var>[-<var>END</var>] <var>COMMANDS</var>;
  46094. </pre></div>
  46095. <p>The time interval is specified by the <var>START</var> and <var>END</var> times.
  46096. <var>END</var> is optional and defaults to the maximum time.
  46097. </p>
  46098. <p>The current frame time is considered within the specified interval if
  46099. it is included in the interval [<var>START</var>, <var>END</var>), that is when
  46100. the time is greater or equal to <var>START</var> and is lesser than
  46101. <var>END</var>.
  46102. </p>
  46103. <p><var>COMMANDS</var> consists of a sequence of one or more command
  46104. specifications, separated by &quot;,&quot;, relating to that interval. The
  46105. syntax of a command specification is given by:
  46106. </p><div class="example">
  46107. <pre class="example">[<var>FLAGS</var>] <var>TARGET</var> <var>COMMAND</var> <var>ARG</var>
  46108. </pre></div>
  46109. <p><var>FLAGS</var> is optional and specifies the type of events relating to
  46110. the time interval which enable sending the specified command, and must
  46111. be a non-null sequence of identifier flags separated by &quot;+&quot; or &quot;|&quot; and
  46112. enclosed between &quot;[&quot; and &quot;]&quot;.
  46113. </p>
  46114. <p>The following flags are recognized:
  46115. </p><dl compact="compact">
  46116. <dt>&lsquo;<samp>enter</samp>&rsquo;</dt>
  46117. <dd><p>The command is sent when the current frame timestamp enters the
  46118. specified interval. In other words, the command is sent when the
  46119. previous frame timestamp was not in the given interval, and the
  46120. current is.
  46121. </p>
  46122. </dd>
  46123. <dt>&lsquo;<samp>leave</samp>&rsquo;</dt>
  46124. <dd><p>The command is sent when the current frame timestamp leaves the
  46125. specified interval. In other words, the command is sent when the
  46126. previous frame timestamp was in the given interval, and the
  46127. current is not.
  46128. </p>
  46129. </dd>
  46130. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  46131. <dd><p>The command <var>ARG</var> is interpreted as expression and result of
  46132. expression is passed as <var>ARG</var>.
  46133. </p>
  46134. <p>The expression is evaluated through the eval API and can contain the following
  46135. constants:
  46136. </p>
  46137. <dl compact="compact">
  46138. <dt>&lsquo;<samp>POS</samp>&rsquo;</dt>
  46139. <dd><p>Original position in the file of the frame, or undefined if undefined
  46140. for the current frame.
  46141. </p>
  46142. </dd>
  46143. <dt>&lsquo;<samp>PTS</samp>&rsquo;</dt>
  46144. <dd><p>The presentation timestamp in input.
  46145. </p>
  46146. </dd>
  46147. <dt>&lsquo;<samp>N</samp>&rsquo;</dt>
  46148. <dd><p>The count of the input frame for video or audio, starting from 0.
  46149. </p>
  46150. </dd>
  46151. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  46152. <dd><p>The time in seconds of the current frame.
  46153. </p>
  46154. </dd>
  46155. <dt>&lsquo;<samp>TS</samp>&rsquo;</dt>
  46156. <dd><p>The start time in seconds of the current command interval.
  46157. </p>
  46158. </dd>
  46159. <dt>&lsquo;<samp>TE</samp>&rsquo;</dt>
  46160. <dd><p>The end time in seconds of the current command interval.
  46161. </p>
  46162. </dd>
  46163. <dt>&lsquo;<samp>TI</samp>&rsquo;</dt>
  46164. <dd><p>The interpolated time of the current command interval, TI = (T - TS) / (TE - TS).
  46165. </p></dd>
  46166. </dl>
  46167. </dd>
  46168. </dl>
  46169. <p>If <var>FLAGS</var> is not specified, a default value of <code>[enter]</code> is
  46170. assumed.
  46171. </p>
  46172. <p><var>TARGET</var> specifies the target of the command, usually the name of
  46173. the filter class or a specific filter instance name.
  46174. </p>
  46175. <p><var>COMMAND</var> specifies the name of the command for the target filter.
  46176. </p>
  46177. <p><var>ARG</var> is optional and specifies the optional list of argument for
  46178. the given <var>COMMAND</var>.
  46179. </p>
  46180. <p>Between one interval specification and another, whitespaces, or
  46181. sequences of characters starting with <code>#</code> until the end of line,
  46182. are ignored and can be used to annotate comments.
  46183. </p>
  46184. <p>A simplified BNF description of the commands specification syntax
  46185. follows:
  46186. </p><div class="example">
  46187. <pre class="example"><var>COMMAND_FLAG</var> ::= &quot;enter&quot; | &quot;leave&quot;
  46188. <var>COMMAND_FLAGS</var> ::= <var>COMMAND_FLAG</var> [(+|&quot;|&quot;)<var>COMMAND_FLAG</var>]
  46189. <var>COMMAND</var> ::= [&quot;[&quot; <var>COMMAND_FLAGS</var> &quot;]&quot;] <var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
  46190. <var>COMMANDS</var> ::= <var>COMMAND</var> [,<var>COMMANDS</var>]
  46191. <var>INTERVAL</var> ::= <var>START</var>[-<var>END</var>] <var>COMMANDS</var>
  46192. <var>INTERVALS</var> ::= <var>INTERVAL</var>[;<var>INTERVALS</var>]
  46193. </pre></div>
  46194. <a name="Examples-26"></a>
  46195. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-26">44.15.2 Examples</a></h3>
  46196. <ul>
  46197. <li>
  46198. Specify audio tempo change at second 4:
  46199. <div class="example">
  46200. <pre class="example">asendcmd=c='4.0 atempo tempo 1.5',atempo
  46201. </pre></div>
  46202. </li><li>
  46203. Target a specific filter instance:
  46204. <div class="example">
  46205. <pre class="example">asendcmd=c='4.0 atempo@my tempo 1.5',atempo@my
  46206. </pre></div>
  46207. </li><li>
  46208. Specify a list of drawtext and hue commands in a file.
  46209. <div class="example">
  46210. <pre class="example"># show text in the interval 5-10
  46211. 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
  46212. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
  46213. # desaturate the image in the interval 15-20
  46214. 15.0-20.0 [enter] hue s 0,
  46215. [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
  46216. [leave] hue s 1,
  46217. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
  46218. # apply an exponential saturation fade-out effect, starting from time 25
  46219. 25 [enter] hue s exp(25-t)
  46220. </pre></div>
  46221. <p>A filtergraph allowing to read and process the above command list
  46222. stored in a file &lsquo;<tt>test.cmd</tt>&rsquo;, can be specified with:
  46223. </p><div class="example">
  46224. <pre class="example">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
  46225. </pre></div>
  46226. </li></ul>
  46227. <p><a name="setpts"></a>
  46228. </p><a name="setpts_002c-asetpts"></a>
  46229. <h2 class="section"><a href="ffmpeg-all.html#toc-setpts_002c-asetpts">44.16 setpts, asetpts</a></h2>
  46230. <p>Change the PTS (presentation timestamp) of the input frames.
  46231. </p>
  46232. <p><code>setpts</code> works on video frames, <code>asetpts</code> on audio frames.
  46233. </p>
  46234. <p>This filter accepts the following options:
  46235. </p>
  46236. <dl compact="compact">
  46237. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  46238. <dd><p>The expression which is evaluated for each frame to construct its timestamp.
  46239. </p>
  46240. </dd>
  46241. </dl>
  46242. <p>The expression is evaluated through the eval API and can contain the following
  46243. constants:
  46244. </p>
  46245. <dl compact="compact">
  46246. <dt>&lsquo;<samp>FRAME_RATE, FR</samp>&rsquo;</dt>
  46247. <dd><p>frame rate, only defined for constant frame-rate video
  46248. </p>
  46249. </dd>
  46250. <dt>&lsquo;<samp>PTS</samp>&rsquo;</dt>
  46251. <dd><p>The presentation timestamp in input
  46252. </p>
  46253. </dd>
  46254. <dt>&lsquo;<samp>N</samp>&rsquo;</dt>
  46255. <dd><p>The count of the input frame for video or the number of consumed samples,
  46256. not including the current frame for audio, starting from 0.
  46257. </p>
  46258. </dd>
  46259. <dt>&lsquo;<samp>NB_CONSUMED_SAMPLES</samp>&rsquo;</dt>
  46260. <dd><p>The number of consumed samples, not including the current frame (only
  46261. audio)
  46262. </p>
  46263. </dd>
  46264. <dt>&lsquo;<samp>NB_SAMPLES, S</samp>&rsquo;</dt>
  46265. <dd><p>The number of samples in the current frame (only audio)
  46266. </p>
  46267. </dd>
  46268. <dt>&lsquo;<samp>SAMPLE_RATE, SR</samp>&rsquo;</dt>
  46269. <dd><p>The audio sample rate.
  46270. </p>
  46271. </dd>
  46272. <dt>&lsquo;<samp>STARTPTS</samp>&rsquo;</dt>
  46273. <dd><p>The PTS of the first frame.
  46274. </p>
  46275. </dd>
  46276. <dt>&lsquo;<samp>STARTT</samp>&rsquo;</dt>
  46277. <dd><p>the time in seconds of the first frame
  46278. </p>
  46279. </dd>
  46280. <dt>&lsquo;<samp>INTERLACED</samp>&rsquo;</dt>
  46281. <dd><p>State whether the current frame is interlaced.
  46282. </p>
  46283. </dd>
  46284. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  46285. <dd><p>the time in seconds of the current frame
  46286. </p>
  46287. </dd>
  46288. <dt>&lsquo;<samp>POS</samp>&rsquo;</dt>
  46289. <dd><p>original position in the file of the frame, or undefined if undefined
  46290. for the current frame
  46291. </p>
  46292. </dd>
  46293. <dt>&lsquo;<samp>PREV_INPTS</samp>&rsquo;</dt>
  46294. <dd><p>The previous input PTS.
  46295. </p>
  46296. </dd>
  46297. <dt>&lsquo;<samp>PREV_INT</samp>&rsquo;</dt>
  46298. <dd><p>previous input time in seconds
  46299. </p>
  46300. </dd>
  46301. <dt>&lsquo;<samp>PREV_OUTPTS</samp>&rsquo;</dt>
  46302. <dd><p>The previous output PTS.
  46303. </p>
  46304. </dd>
  46305. <dt>&lsquo;<samp>PREV_OUTT</samp>&rsquo;</dt>
  46306. <dd><p>previous output time in seconds
  46307. </p>
  46308. </dd>
  46309. <dt>&lsquo;<samp>RTCTIME</samp>&rsquo;</dt>
  46310. <dd><p>The wallclock (RTC) time in microseconds. This is deprecated, use time(0)
  46311. instead.
  46312. </p>
  46313. </dd>
  46314. <dt>&lsquo;<samp>RTCSTART</samp>&rsquo;</dt>
  46315. <dd><p>The wallclock (RTC) time at the start of the movie in microseconds.
  46316. </p>
  46317. </dd>
  46318. <dt>&lsquo;<samp>TB</samp>&rsquo;</dt>
  46319. <dd><p>The timebase of the input timestamps.
  46320. </p>
  46321. </dd>
  46322. </dl>
  46323. <a name="Examples-188"></a>
  46324. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-188">44.16.1 Examples</a></h3>
  46325. <ul>
  46326. <li>
  46327. Start counting PTS from zero
  46328. <div class="example">
  46329. <pre class="example">setpts=PTS-STARTPTS
  46330. </pre></div>
  46331. </li><li>
  46332. Apply fast motion effect:
  46333. <div class="example">
  46334. <pre class="example">setpts=0.5*PTS
  46335. </pre></div>
  46336. </li><li>
  46337. Apply slow motion effect:
  46338. <div class="example">
  46339. <pre class="example">setpts=2.0*PTS
  46340. </pre></div>
  46341. </li><li>
  46342. Set fixed rate of 25 frames per second:
  46343. <div class="example">
  46344. <pre class="example">setpts=N/(25*TB)
  46345. </pre></div>
  46346. </li><li>
  46347. Set fixed rate 25 fps with some jitter:
  46348. <div class="example">
  46349. <pre class="example">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
  46350. </pre></div>
  46351. </li><li>
  46352. Apply an offset of 10 seconds to the input PTS:
  46353. <div class="example">
  46354. <pre class="example">setpts=PTS+10/TB
  46355. </pre></div>
  46356. </li><li>
  46357. Generate timestamps from a &quot;live source&quot; and rebase onto the current timebase:
  46358. <div class="example">
  46359. <pre class="example">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
  46360. </pre></div>
  46361. </li><li>
  46362. Generate timestamps by counting samples:
  46363. <div class="example">
  46364. <pre class="example">asetpts=N/SR/TB
  46365. </pre></div>
  46366. </li></ul>
  46367. <a name="setrange"></a>
  46368. <h2 class="section"><a href="ffmpeg-all.html#toc-setrange">44.17 setrange</a></h2>
  46369. <p>Force color range for the output video frame.
  46370. </p>
  46371. <p>The <code>setrange</code> filter marks the color range property for the
  46372. output frames. It does not change the input frame, but only sets the
  46373. corresponding property, which affects how the frame is treated by
  46374. following filters.
  46375. </p>
  46376. <p>The filter accepts the following options:
  46377. </p>
  46378. <dl compact="compact">
  46379. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  46380. <dd><p>Available values are:
  46381. </p>
  46382. <dl compact="compact">
  46383. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  46384. <dd><p>Keep the same color range property.
  46385. </p>
  46386. </dd>
  46387. <dt>&lsquo;<samp>unspecified, unknown</samp>&rsquo;</dt>
  46388. <dd><p>Set the color range as unspecified.
  46389. </p>
  46390. </dd>
  46391. <dt>&lsquo;<samp>limited, tv, mpeg</samp>&rsquo;</dt>
  46392. <dd><p>Set the color range as limited.
  46393. </p>
  46394. </dd>
  46395. <dt>&lsquo;<samp>full, pc, jpeg</samp>&rsquo;</dt>
  46396. <dd><p>Set the color range as full.
  46397. </p></dd>
  46398. </dl>
  46399. </dd>
  46400. </dl>
  46401. <a name="settb_002c-asettb"></a>
  46402. <h2 class="section"><a href="ffmpeg-all.html#toc-settb_002c-asettb">44.18 settb, asettb</a></h2>
  46403. <p>Set the timebase to use for the output frames timestamps.
  46404. It is mainly useful for testing timebase configuration.
  46405. </p>
  46406. <p>It accepts the following parameters:
  46407. </p>
  46408. <dl compact="compact">
  46409. <dt>&lsquo;<samp>expr, tb</samp>&rsquo;</dt>
  46410. <dd><p>The expression which is evaluated into the output timebase.
  46411. </p>
  46412. </dd>
  46413. </dl>
  46414. <p>The value for &lsquo;<samp>tb</samp>&rsquo; is an arithmetic expression representing a
  46415. rational. The expression can contain the constants &quot;AVTB&quot; (the default
  46416. timebase), &quot;intb&quot; (the input timebase) and &quot;sr&quot; (the sample rate,
  46417. audio only). Default value is &quot;intb&quot;.
  46418. </p>
  46419. <a name="Examples-108"></a>
  46420. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-108">44.18.1 Examples</a></h3>
  46421. <ul>
  46422. <li>
  46423. Set the timebase to 1/25:
  46424. <div class="example">
  46425. <pre class="example">settb=expr=1/25
  46426. </pre></div>
  46427. </li><li>
  46428. Set the timebase to 1/10:
  46429. <div class="example">
  46430. <pre class="example">settb=expr=0.1
  46431. </pre></div>
  46432. </li><li>
  46433. Set the timebase to 1001/1000:
  46434. <div class="example">
  46435. <pre class="example">settb=1+0.001
  46436. </pre></div>
  46437. </li><li>
  46438. Set the timebase to 2*intb:
  46439. <div class="example">
  46440. <pre class="example">settb=2*intb
  46441. </pre></div>
  46442. </li><li>
  46443. Set the default timebase value:
  46444. <div class="example">
  46445. <pre class="example">settb=AVTB
  46446. </pre></div>
  46447. </li></ul>
  46448. <a name="showcqt"></a>
  46449. <h2 class="section"><a href="ffmpeg-all.html#toc-showcqt">44.19 showcqt</a></h2>
  46450. <p>Convert input audio to a video output representing frequency spectrum
  46451. logarithmically using Brown-Puckette constant Q transform algorithm with
  46452. direct frequency domain coefficient calculation (but the transform itself
  46453. is not really constant Q, instead the Q factor is actually variable/clamped),
  46454. with musical tone scale, from E0 to D#10.
  46455. </p>
  46456. <p>The filter accepts the following options:
  46457. </p>
  46458. <dl compact="compact">
  46459. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  46460. <dd><p>Specify the video size for the output. It must be even. For the syntax of this option,
  46461. check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46462. Default value is <code>1920x1080</code>.
  46463. </p>
  46464. </dd>
  46465. <dt>&lsquo;<samp>fps, rate, r</samp>&rsquo;</dt>
  46466. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  46467. </p>
  46468. </dd>
  46469. <dt>&lsquo;<samp>bar_h</samp>&rsquo;</dt>
  46470. <dd><p>Set the bargraph height. It must be even. Default value is <code>-1</code> which
  46471. computes the bargraph height automatically.
  46472. </p>
  46473. </dd>
  46474. <dt>&lsquo;<samp>axis_h</samp>&rsquo;</dt>
  46475. <dd><p>Set the axis height. It must be even. Default value is <code>-1</code> which computes
  46476. the axis height automatically.
  46477. </p>
  46478. </dd>
  46479. <dt>&lsquo;<samp>sono_h</samp>&rsquo;</dt>
  46480. <dd><p>Set the sonogram height. It must be even. Default value is <code>-1</code> which
  46481. computes the sonogram height automatically.
  46482. </p>
  46483. </dd>
  46484. <dt>&lsquo;<samp>fullhd</samp>&rsquo;</dt>
  46485. <dd><p>Set the fullhd resolution. This option is deprecated, use <var>size</var>, <var>s</var>
  46486. instead. Default value is <code>1</code>.
  46487. </p>
  46488. </dd>
  46489. <dt>&lsquo;<samp>sono_v, volume</samp>&rsquo;</dt>
  46490. <dd><p>Specify the sonogram volume expression. It can contain variables:
  46491. </p><dl compact="compact">
  46492. <dt>&lsquo;<samp>bar_v</samp>&rsquo;</dt>
  46493. <dd><p>the <var>bar_v</var> evaluated expression
  46494. </p></dd>
  46495. <dt>&lsquo;<samp>frequency, freq, f</samp>&rsquo;</dt>
  46496. <dd><p>the frequency where it is evaluated
  46497. </p></dd>
  46498. <dt>&lsquo;<samp>timeclamp, tc</samp>&rsquo;</dt>
  46499. <dd><p>the value of <var>timeclamp</var> option
  46500. </p></dd>
  46501. </dl>
  46502. <p>and functions:
  46503. </p><dl compact="compact">
  46504. <dt>&lsquo;<samp>a_weighting(f)</samp>&rsquo;</dt>
  46505. <dd><p>A-weighting of equal loudness
  46506. </p></dd>
  46507. <dt>&lsquo;<samp>b_weighting(f)</samp>&rsquo;</dt>
  46508. <dd><p>B-weighting of equal loudness
  46509. </p></dd>
  46510. <dt>&lsquo;<samp>c_weighting(f)</samp>&rsquo;</dt>
  46511. <dd><p>C-weighting of equal loudness.
  46512. </p></dd>
  46513. </dl>
  46514. <p>Default value is <code>16</code>.
  46515. </p>
  46516. </dd>
  46517. <dt>&lsquo;<samp>bar_v, volume2</samp>&rsquo;</dt>
  46518. <dd><p>Specify the bargraph volume expression. It can contain variables:
  46519. </p><dl compact="compact">
  46520. <dt>&lsquo;<samp>sono_v</samp>&rsquo;</dt>
  46521. <dd><p>the <var>sono_v</var> evaluated expression
  46522. </p></dd>
  46523. <dt>&lsquo;<samp>frequency, freq, f</samp>&rsquo;</dt>
  46524. <dd><p>the frequency where it is evaluated
  46525. </p></dd>
  46526. <dt>&lsquo;<samp>timeclamp, tc</samp>&rsquo;</dt>
  46527. <dd><p>the value of <var>timeclamp</var> option
  46528. </p></dd>
  46529. </dl>
  46530. <p>and functions:
  46531. </p><dl compact="compact">
  46532. <dt>&lsquo;<samp>a_weighting(f)</samp>&rsquo;</dt>
  46533. <dd><p>A-weighting of equal loudness
  46534. </p></dd>
  46535. <dt>&lsquo;<samp>b_weighting(f)</samp>&rsquo;</dt>
  46536. <dd><p>B-weighting of equal loudness
  46537. </p></dd>
  46538. <dt>&lsquo;<samp>c_weighting(f)</samp>&rsquo;</dt>
  46539. <dd><p>C-weighting of equal loudness.
  46540. </p></dd>
  46541. </dl>
  46542. <p>Default value is <code>sono_v</code>.
  46543. </p>
  46544. </dd>
  46545. <dt>&lsquo;<samp>sono_g, gamma</samp>&rsquo;</dt>
  46546. <dd><p>Specify the sonogram gamma. Lower gamma makes the spectrum more contrast,
  46547. higher gamma makes the spectrum having more range. Default value is <code>3</code>.
  46548. Acceptable range is <code>[1, 7]</code>.
  46549. </p>
  46550. </dd>
  46551. <dt>&lsquo;<samp>bar_g, gamma2</samp>&rsquo;</dt>
  46552. <dd><p>Specify the bargraph gamma. Default value is <code>1</code>. Acceptable range is
  46553. <code>[1, 7]</code>.
  46554. </p>
  46555. </dd>
  46556. <dt>&lsquo;<samp>bar_t</samp>&rsquo;</dt>
  46557. <dd><p>Specify the bargraph transparency level. Lower value makes the bargraph sharper.
  46558. Default value is <code>1</code>. Acceptable range is <code>[0, 1]</code>.
  46559. </p>
  46560. </dd>
  46561. <dt>&lsquo;<samp>timeclamp, tc</samp>&rsquo;</dt>
  46562. <dd><p>Specify the transform timeclamp. At low frequency, there is trade-off between
  46563. accuracy in time domain and frequency domain. If timeclamp is lower,
  46564. event in time domain is represented more accurately (such as fast bass drum),
  46565. otherwise event in frequency domain is represented more accurately
  46566. (such as bass guitar). Acceptable range is <code>[0.002, 1]</code>. Default value is <code>0.17</code>.
  46567. </p>
  46568. </dd>
  46569. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  46570. <dd><p>Set attack time in seconds. The default is <code>0</code> (disabled). Otherwise, it
  46571. limits future samples by applying asymmetric windowing in time domain, useful
  46572. when low latency is required. Accepted range is <code>[0, 1]</code>.
  46573. </p>
  46574. </dd>
  46575. <dt>&lsquo;<samp>basefreq</samp>&rsquo;</dt>
  46576. <dd><p>Specify the transform base frequency. Default value is <code>20.01523126408007475</code>,
  46577. which is frequency 50 cents below E0. Acceptable range is <code>[10, 100000]</code>.
  46578. </p>
  46579. </dd>
  46580. <dt>&lsquo;<samp>endfreq</samp>&rsquo;</dt>
  46581. <dd><p>Specify the transform end frequency. Default value is <code>20495.59681441799654</code>,
  46582. which is frequency 50 cents above D#10. Acceptable range is <code>[10, 100000]</code>.
  46583. </p>
  46584. </dd>
  46585. <dt>&lsquo;<samp>coeffclamp</samp>&rsquo;</dt>
  46586. <dd><p>This option is deprecated and ignored.
  46587. </p>
  46588. </dd>
  46589. <dt>&lsquo;<samp>tlength</samp>&rsquo;</dt>
  46590. <dd><p>Specify the transform length in time domain. Use this option to control accuracy
  46591. trade-off between time domain and frequency domain at every frequency sample.
  46592. It can contain variables:
  46593. </p><dl compact="compact">
  46594. <dt>&lsquo;<samp>frequency, freq, f</samp>&rsquo;</dt>
  46595. <dd><p>the frequency where it is evaluated
  46596. </p></dd>
  46597. <dt>&lsquo;<samp>timeclamp, tc</samp>&rsquo;</dt>
  46598. <dd><p>the value of <var>timeclamp</var> option.
  46599. </p></dd>
  46600. </dl>
  46601. <p>Default value is <code>384*tc/(384+tc*f)</code>.
  46602. </p>
  46603. </dd>
  46604. <dt>&lsquo;<samp>count</samp>&rsquo;</dt>
  46605. <dd><p>Specify the transform count for every video frame. Default value is <code>6</code>.
  46606. Acceptable range is <code>[1, 30]</code>.
  46607. </p>
  46608. </dd>
  46609. <dt>&lsquo;<samp>fcount</samp>&rsquo;</dt>
  46610. <dd><p>Specify the transform count for every single pixel. Default value is <code>0</code>,
  46611. which makes it computed automatically. Acceptable range is <code>[0, 10]</code>.
  46612. </p>
  46613. </dd>
  46614. <dt>&lsquo;<samp>fontfile</samp>&rsquo;</dt>
  46615. <dd><p>Specify font file for use with freetype to draw the axis. If not specified,
  46616. use embedded font. Note that drawing with font file or embedded font is not
  46617. implemented with custom <var>basefreq</var> and <var>endfreq</var>, use <var>axisfile</var>
  46618. option instead.
  46619. </p>
  46620. </dd>
  46621. <dt>&lsquo;<samp>font</samp>&rsquo;</dt>
  46622. <dd><p>Specify fontconfig pattern. This has lower priority than <var>fontfile</var>. The
  46623. <code>:</code> in the pattern may be replaced by <code>|</code> to avoid unnecessary
  46624. escaping.
  46625. </p>
  46626. </dd>
  46627. <dt>&lsquo;<samp>fontcolor</samp>&rsquo;</dt>
  46628. <dd><p>Specify font color expression. This is arithmetic expression that should return
  46629. integer value 0xRRGGBB. It can contain variables:
  46630. </p><dl compact="compact">
  46631. <dt>&lsquo;<samp>frequency, freq, f</samp>&rsquo;</dt>
  46632. <dd><p>the frequency where it is evaluated
  46633. </p></dd>
  46634. <dt>&lsquo;<samp>timeclamp, tc</samp>&rsquo;</dt>
  46635. <dd><p>the value of <var>timeclamp</var> option
  46636. </p></dd>
  46637. </dl>
  46638. <p>and functions:
  46639. </p><dl compact="compact">
  46640. <dt>&lsquo;<samp>midi(f)</samp>&rsquo;</dt>
  46641. <dd><p>midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69)
  46642. </p></dd>
  46643. <dt>&lsquo;<samp>r(x), g(x), b(x)</samp>&rsquo;</dt>
  46644. <dd><p>red, green, and blue value of intensity x.
  46645. </p></dd>
  46646. </dl>
  46647. <p>Default value is <code>st(0, (midi(f)-59.5)/12);
  46648. st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0));
  46649. r(1-ld(1)) + b(ld(1))</code>.
  46650. </p>
  46651. </dd>
  46652. <dt>&lsquo;<samp>axisfile</samp>&rsquo;</dt>
  46653. <dd><p>Specify image file to draw the axis. This option override <var>fontfile</var> and
  46654. <var>fontcolor</var> option.
  46655. </p>
  46656. </dd>
  46657. <dt>&lsquo;<samp>axis, text</samp>&rsquo;</dt>
  46658. <dd><p>Enable/disable drawing text to the axis. If it is set to <code>0</code>, drawing to
  46659. the axis is disabled, ignoring <var>fontfile</var> and <var>axisfile</var> option.
  46660. Default value is <code>1</code>.
  46661. </p>
  46662. </dd>
  46663. <dt>&lsquo;<samp>csp</samp>&rsquo;</dt>
  46664. <dd><p>Set colorspace. The accepted values are:
  46665. </p><dl compact="compact">
  46666. <dt>&lsquo;<samp>unspecified</samp>&rsquo;</dt>
  46667. <dd><p>Unspecified (default)
  46668. </p>
  46669. </dd>
  46670. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  46671. <dd><p>BT.709
  46672. </p>
  46673. </dd>
  46674. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  46675. <dd><p>FCC
  46676. </p>
  46677. </dd>
  46678. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  46679. <dd><p>BT.470BG or BT.601-6 625
  46680. </p>
  46681. </dd>
  46682. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  46683. <dd><p>SMPTE-170M or BT.601-6 525
  46684. </p>
  46685. </dd>
  46686. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  46687. <dd><p>SMPTE-240M
  46688. </p>
  46689. </dd>
  46690. <dt>&lsquo;<samp>bt2020ncl</samp>&rsquo;</dt>
  46691. <dd><p>BT.2020 with non-constant luminance
  46692. </p>
  46693. </dd>
  46694. </dl>
  46695. </dd>
  46696. <dt>&lsquo;<samp>cscheme</samp>&rsquo;</dt>
  46697. <dd><p>Set spectrogram color scheme. This is list of floating point values with format
  46698. <code>left_r|left_g|left_b|right_r|right_g|right_b</code>.
  46699. The default is <code>1|0.5|0|0|0.5|1</code>.
  46700. </p>
  46701. </dd>
  46702. </dl>
  46703. <a name="Examples-29"></a>
  46704. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-29">44.19.1 Examples</a></h3>
  46705. <ul>
  46706. <li>
  46707. Playing audio while showing the spectrum:
  46708. <div class="example">
  46709. <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
  46710. </pre></div>
  46711. </li><li>
  46712. Same as above, but with frame rate 30 fps:
  46713. <div class="example">
  46714. <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
  46715. </pre></div>
  46716. </li><li>
  46717. Playing at 1280x720:
  46718. <div class="example">
  46719. <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]'
  46720. </pre></div>
  46721. </li><li>
  46722. Disable sonogram display:
  46723. <div class="example">
  46724. <pre class="example">sono_h=0
  46725. </pre></div>
  46726. </li><li>
  46727. A1 and its harmonics: A1, A2, (near)E3, A3:
  46728. <div class="example">
  46729. <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),
  46730. asplit[a][out1]; [a] showcqt [out0]'
  46731. </pre></div>
  46732. </li><li>
  46733. Same as above, but with more accuracy in frequency domain:
  46734. <div class="example">
  46735. <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),
  46736. asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
  46737. </pre></div>
  46738. </li><li>
  46739. Custom volume:
  46740. <div class="example">
  46741. <pre class="example">bar_v=10:sono_v=bar_v*a_weighting(f)
  46742. </pre></div>
  46743. </li><li>
  46744. Custom gamma, now spectrum is linear to the amplitude.
  46745. <div class="example">
  46746. <pre class="example">bar_g=2:sono_g=2
  46747. </pre></div>
  46748. </li><li>
  46749. Custom tlength equation:
  46750. <div class="example">
  46751. <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)))'
  46752. </pre></div>
  46753. </li><li>
  46754. Custom fontcolor and fontfile, C-note is colored green, others are colored blue:
  46755. <div class="example">
  46756. <pre class="example">fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))':fontfile=myfont.ttf
  46757. </pre></div>
  46758. </li><li>
  46759. Custom font using fontconfig:
  46760. <div class="example">
  46761. <pre class="example">font='Courier New,Monospace,mono|bold'
  46762. </pre></div>
  46763. </li><li>
  46764. Custom frequency range with custom axis using image file:
  46765. <div class="example">
  46766. <pre class="example">axisfile=myaxis.png:basefreq=40:endfreq=10000
  46767. </pre></div>
  46768. </li></ul>
  46769. <a name="showfreqs"></a>
  46770. <h2 class="section"><a href="ffmpeg-all.html#toc-showfreqs">44.20 showfreqs</a></h2>
  46771. <p>Convert input audio to video output representing the audio power spectrum.
  46772. Audio amplitude is on Y-axis while frequency is on X-axis.
  46773. </p>
  46774. <p>The filter accepts the following options:
  46775. </p>
  46776. <dl compact="compact">
  46777. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  46778. <dd><p>Specify size of video. For the syntax of this option, check the
  46779. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46780. Default is <code>1024x512</code>.
  46781. </p>
  46782. </dd>
  46783. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  46784. <dd><p>Set display mode.
  46785. This set how each frequency bin will be represented.
  46786. </p>
  46787. <p>It accepts the following values:
  46788. </p><dl compact="compact">
  46789. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  46790. <dt>&lsquo;<samp>bar</samp>&rsquo;</dt>
  46791. <dt>&lsquo;<samp>dot</samp>&rsquo;</dt>
  46792. </dl>
  46793. <p>Default is <code>bar</code>.
  46794. </p>
  46795. </dd>
  46796. <dt>&lsquo;<samp>ascale</samp>&rsquo;</dt>
  46797. <dd><p>Set amplitude scale.
  46798. </p>
  46799. <p>It accepts the following values:
  46800. </p><dl compact="compact">
  46801. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  46802. <dd><p>Linear scale.
  46803. </p>
  46804. </dd>
  46805. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  46806. <dd><p>Square root scale.
  46807. </p>
  46808. </dd>
  46809. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  46810. <dd><p>Cubic root scale.
  46811. </p>
  46812. </dd>
  46813. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  46814. <dd><p>Logarithmic scale.
  46815. </p></dd>
  46816. </dl>
  46817. <p>Default is <code>log</code>.
  46818. </p>
  46819. </dd>
  46820. <dt>&lsquo;<samp>fscale</samp>&rsquo;</dt>
  46821. <dd><p>Set frequency scale.
  46822. </p>
  46823. <p>It accepts the following values:
  46824. </p><dl compact="compact">
  46825. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  46826. <dd><p>Linear scale.
  46827. </p>
  46828. </dd>
  46829. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  46830. <dd><p>Logarithmic scale.
  46831. </p>
  46832. </dd>
  46833. <dt>&lsquo;<samp>rlog</samp>&rsquo;</dt>
  46834. <dd><p>Reverse logarithmic scale.
  46835. </p></dd>
  46836. </dl>
  46837. <p>Default is <code>lin</code>.
  46838. </p>
  46839. </dd>
  46840. <dt>&lsquo;<samp>win_size</samp>&rsquo;</dt>
  46841. <dd><p>Set window size. Allowed range is from 16 to 65536.
  46842. </p>
  46843. <p>Default is <code>2048</code>
  46844. </p>
  46845. </dd>
  46846. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  46847. <dd><p>Set windowing function.
  46848. </p>
  46849. <p>It accepts the following values:
  46850. </p><dl compact="compact">
  46851. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  46852. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  46853. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  46854. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  46855. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  46856. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  46857. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  46858. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  46859. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  46860. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  46861. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  46862. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  46863. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  46864. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  46865. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  46866. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  46867. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  46868. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  46869. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  46870. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  46871. </dl>
  46872. <p>Default is <code>hanning</code>.
  46873. </p>
  46874. </dd>
  46875. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  46876. <dd><p>Set window overlap. In range <code>[0, 1]</code>. Default is <code>1</code>,
  46877. which means optimal overlap for selected window function will be picked.
  46878. </p>
  46879. </dd>
  46880. <dt>&lsquo;<samp>averaging</samp>&rsquo;</dt>
  46881. <dd><p>Set time averaging. Setting this to 0 will display current maximal peaks.
  46882. Default is <code>1</code>, which means time averaging is disabled.
  46883. </p>
  46884. </dd>
  46885. <dt>&lsquo;<samp>colors</samp>&rsquo;</dt>
  46886. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  46887. draw channel frequencies. Unrecognized or missing colors will be replaced
  46888. by white color.
  46889. </p>
  46890. </dd>
  46891. <dt>&lsquo;<samp>cmode</samp>&rsquo;</dt>
  46892. <dd><p>Set channel display mode.
  46893. </p>
  46894. <p>It accepts the following values:
  46895. </p><dl compact="compact">
  46896. <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
  46897. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  46898. </dl>
  46899. <p>Default is <code>combined</code>.
  46900. </p>
  46901. </dd>
  46902. <dt>&lsquo;<samp>minamp</samp>&rsquo;</dt>
  46903. <dd><p>Set minimum amplitude used in <code>log</code> amplitude scaler.
  46904. </p>
  46905. </dd>
  46906. </dl>
  46907. <a name="showspatial"></a>
  46908. <h2 class="section"><a href="ffmpeg-all.html#toc-showspatial">44.21 showspatial</a></h2>
  46909. <p>Convert stereo input audio to a video output, representing the spatial relationship
  46910. between two channels.
  46911. </p>
  46912. <p>The filter accepts the following options:
  46913. </p>
  46914. <dl compact="compact">
  46915. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  46916. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  46917. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46918. Default value is <code>512x512</code>.
  46919. </p>
  46920. </dd>
  46921. <dt>&lsquo;<samp>win_size</samp>&rsquo;</dt>
  46922. <dd><p>Set window size. Allowed range is from <var>1024</var> to <var>65536</var>. Default size is <var>4096</var>.
  46923. </p>
  46924. </dd>
  46925. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  46926. <dd><p>Set window function.
  46927. </p>
  46928. <p>It accepts the following values:
  46929. </p><dl compact="compact">
  46930. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  46931. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  46932. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  46933. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  46934. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  46935. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  46936. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  46937. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  46938. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  46939. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  46940. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  46941. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  46942. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  46943. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  46944. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  46945. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  46946. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  46947. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  46948. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  46949. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  46950. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  46951. </dl>
  46952. <p>Default value is <code>hann</code>.
  46953. </p>
  46954. </dd>
  46955. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  46956. <dd><p>Set ratio of overlap window. Default value is <code>0.5</code>.
  46957. When value is <code>1</code> overlap is set to recommended size for specific
  46958. window function currently used.
  46959. </p></dd>
  46960. </dl>
  46961. <p><a name="showspectrum"></a>
  46962. </p><a name="showspectrum-1"></a>
  46963. <h2 class="section"><a href="ffmpeg-all.html#toc-showspectrum-1">44.22 showspectrum</a></h2>
  46964. <p>Convert input audio to a video output, representing the audio frequency
  46965. spectrum.
  46966. </p>
  46967. <p>The filter accepts the following options:
  46968. </p>
  46969. <dl compact="compact">
  46970. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  46971. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  46972. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46973. Default value is <code>640x512</code>.
  46974. </p>
  46975. </dd>
  46976. <dt>&lsquo;<samp>slide</samp>&rsquo;</dt>
  46977. <dd><p>Specify how the spectrum should slide along the window.
  46978. </p>
  46979. <p>It accepts the following values:
  46980. </p><dl compact="compact">
  46981. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  46982. <dd><p>the samples start again on the left when they reach the right
  46983. </p></dd>
  46984. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  46985. <dd><p>the samples scroll from right to left
  46986. </p></dd>
  46987. <dt>&lsquo;<samp>fullframe</samp>&rsquo;</dt>
  46988. <dd><p>frames are only produced when the samples reach the right
  46989. </p></dd>
  46990. <dt>&lsquo;<samp>rscroll</samp>&rsquo;</dt>
  46991. <dd><p>the samples scroll from left to right
  46992. </p></dd>
  46993. </dl>
  46994. <p>Default value is <code>replace</code>.
  46995. </p>
  46996. </dd>
  46997. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  46998. <dd><p>Specify display mode.
  46999. </p>
  47000. <p>It accepts the following values:
  47001. </p><dl compact="compact">
  47002. <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
  47003. <dd><p>all channels are displayed in the same row
  47004. </p></dd>
  47005. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  47006. <dd><p>all channels are displayed in separate rows
  47007. </p></dd>
  47008. </dl>
  47009. <p>Default value is &lsquo;<samp>combined</samp>&rsquo;.
  47010. </p>
  47011. </dd>
  47012. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  47013. <dd><p>Specify display color mode.
  47014. </p>
  47015. <p>It accepts the following values:
  47016. </p><dl compact="compact">
  47017. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  47018. <dd><p>each channel is displayed in a separate color
  47019. </p></dd>
  47020. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  47021. <dd><p>each channel is displayed using the same color scheme
  47022. </p></dd>
  47023. <dt>&lsquo;<samp>rainbow</samp>&rsquo;</dt>
  47024. <dd><p>each channel is displayed using the rainbow color scheme
  47025. </p></dd>
  47026. <dt>&lsquo;<samp>moreland</samp>&rsquo;</dt>
  47027. <dd><p>each channel is displayed using the moreland color scheme
  47028. </p></dd>
  47029. <dt>&lsquo;<samp>nebulae</samp>&rsquo;</dt>
  47030. <dd><p>each channel is displayed using the nebulae color scheme
  47031. </p></dd>
  47032. <dt>&lsquo;<samp>fire</samp>&rsquo;</dt>
  47033. <dd><p>each channel is displayed using the fire color scheme
  47034. </p></dd>
  47035. <dt>&lsquo;<samp>fiery</samp>&rsquo;</dt>
  47036. <dd><p>each channel is displayed using the fiery color scheme
  47037. </p></dd>
  47038. <dt>&lsquo;<samp>fruit</samp>&rsquo;</dt>
  47039. <dd><p>each channel is displayed using the fruit color scheme
  47040. </p></dd>
  47041. <dt>&lsquo;<samp>cool</samp>&rsquo;</dt>
  47042. <dd><p>each channel is displayed using the cool color scheme
  47043. </p></dd>
  47044. <dt>&lsquo;<samp>magma</samp>&rsquo;</dt>
  47045. <dd><p>each channel is displayed using the magma color scheme
  47046. </p></dd>
  47047. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  47048. <dd><p>each channel is displayed using the green color scheme
  47049. </p></dd>
  47050. <dt>&lsquo;<samp>viridis</samp>&rsquo;</dt>
  47051. <dd><p>each channel is displayed using the viridis color scheme
  47052. </p></dd>
  47053. <dt>&lsquo;<samp>plasma</samp>&rsquo;</dt>
  47054. <dd><p>each channel is displayed using the plasma color scheme
  47055. </p></dd>
  47056. <dt>&lsquo;<samp>cividis</samp>&rsquo;</dt>
  47057. <dd><p>each channel is displayed using the cividis color scheme
  47058. </p></dd>
  47059. <dt>&lsquo;<samp>terrain</samp>&rsquo;</dt>
  47060. <dd><p>each channel is displayed using the terrain color scheme
  47061. </p></dd>
  47062. </dl>
  47063. <p>Default value is &lsquo;<samp>channel</samp>&rsquo;.
  47064. </p>
  47065. </dd>
  47066. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  47067. <dd><p>Specify scale used for calculating intensity color values.
  47068. </p>
  47069. <p>It accepts the following values:
  47070. </p><dl compact="compact">
  47071. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  47072. <dd><p>linear
  47073. </p></dd>
  47074. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  47075. <dd><p>square root, default
  47076. </p></dd>
  47077. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  47078. <dd><p>cubic root
  47079. </p></dd>
  47080. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  47081. <dd><p>logarithmic
  47082. </p></dd>
  47083. <dt>&lsquo;<samp>4thrt</samp>&rsquo;</dt>
  47084. <dd><p>4th root
  47085. </p></dd>
  47086. <dt>&lsquo;<samp>5thrt</samp>&rsquo;</dt>
  47087. <dd><p>5th root
  47088. </p></dd>
  47089. </dl>
  47090. <p>Default value is &lsquo;<samp>sqrt</samp>&rsquo;.
  47091. </p>
  47092. </dd>
  47093. <dt>&lsquo;<samp>fscale</samp>&rsquo;</dt>
  47094. <dd><p>Specify frequency scale.
  47095. </p>
  47096. <p>It accepts the following values:
  47097. </p><dl compact="compact">
  47098. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  47099. <dd><p>linear
  47100. </p></dd>
  47101. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  47102. <dd><p>logarithmic
  47103. </p></dd>
  47104. </dl>
  47105. <p>Default value is &lsquo;<samp>lin</samp>&rsquo;.
  47106. </p>
  47107. </dd>
  47108. <dt>&lsquo;<samp>saturation</samp>&rsquo;</dt>
  47109. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  47110. alternative color scheme. <code>0</code> is no saturation at all.
  47111. Saturation must be in [-10.0, 10.0] range.
  47112. Default value is <code>1</code>.
  47113. </p>
  47114. </dd>
  47115. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  47116. <dd><p>Set window function.
  47117. </p>
  47118. <p>It accepts the following values:
  47119. </p><dl compact="compact">
  47120. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  47121. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  47122. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  47123. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  47124. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  47125. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  47126. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  47127. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  47128. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  47129. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  47130. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  47131. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  47132. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  47133. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  47134. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  47135. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  47136. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  47137. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  47138. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  47139. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  47140. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  47141. </dl>
  47142. <p>Default value is <code>hann</code>.
  47143. </p>
  47144. </dd>
  47145. <dt>&lsquo;<samp>orientation</samp>&rsquo;</dt>
  47146. <dd><p>Set orientation of time vs frequency axis. Can be <code>vertical</code> or
  47147. <code>horizontal</code>. Default is <code>vertical</code>.
  47148. </p>
  47149. </dd>
  47150. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  47151. <dd><p>Set ratio of overlap window. Default value is <code>0</code>.
  47152. When value is <code>1</code> overlap is set to recommended size for specific
  47153. window function currently used.
  47154. </p>
  47155. </dd>
  47156. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  47157. <dd><p>Set scale gain for calculating intensity color values.
  47158. Default value is <code>1</code>.
  47159. </p>
  47160. </dd>
  47161. <dt>&lsquo;<samp>data</samp>&rsquo;</dt>
  47162. <dd><p>Set which data to display. Can be <code>magnitude</code>, default or <code>phase</code>.
  47163. </p>
  47164. </dd>
  47165. <dt>&lsquo;<samp>rotation</samp>&rsquo;</dt>
  47166. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  47167. Default value is <code>0</code>.
  47168. </p>
  47169. </dd>
  47170. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  47171. <dd><p>Set start frequency from which to display spectrogram. Default is <code>0</code>.
  47172. </p>
  47173. </dd>
  47174. <dt>&lsquo;<samp>stop</samp>&rsquo;</dt>
  47175. <dd><p>Set stop frequency to which to display spectrogram. Default is <code>0</code>.
  47176. </p>
  47177. </dd>
  47178. <dt>&lsquo;<samp>fps</samp>&rsquo;</dt>
  47179. <dd><p>Set upper frame rate limit. Default is <code>auto</code>, unlimited.
  47180. </p>
  47181. </dd>
  47182. <dt>&lsquo;<samp>legend</samp>&rsquo;</dt>
  47183. <dd><p>Draw time and frequency axes and legends. Default is disabled.
  47184. </p></dd>
  47185. </dl>
  47186. <p>The usage is very similar to the showwaves filter; see the examples in that
  47187. section.
  47188. </p>
  47189. <a name="Examples-179"></a>
  47190. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-179">44.22.1 Examples</a></h3>
  47191. <ul>
  47192. <li>
  47193. Large window with logarithmic color scaling:
  47194. <div class="example">
  47195. <pre class="example">showspectrum=s=1280x480:scale=log
  47196. </pre></div>
  47197. </li><li>
  47198. Complete example for a colored and sliding spectrum per channel using <code>ffplay</code>:
  47199. <div class="example">
  47200. <pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  47201. [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
  47202. </pre></div>
  47203. </li></ul>
  47204. <a name="showspectrumpic"></a>
  47205. <h2 class="section"><a href="ffmpeg-all.html#toc-showspectrumpic">44.23 showspectrumpic</a></h2>
  47206. <p>Convert input audio to a single video frame, representing the audio frequency
  47207. spectrum.
  47208. </p>
  47209. <p>The filter accepts the following options:
  47210. </p>
  47211. <dl compact="compact">
  47212. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  47213. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  47214. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  47215. Default value is <code>4096x2048</code>.
  47216. </p>
  47217. </dd>
  47218. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  47219. <dd><p>Specify display mode.
  47220. </p>
  47221. <p>It accepts the following values:
  47222. </p><dl compact="compact">
  47223. <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
  47224. <dd><p>all channels are displayed in the same row
  47225. </p></dd>
  47226. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  47227. <dd><p>all channels are displayed in separate rows
  47228. </p></dd>
  47229. </dl>
  47230. <p>Default value is &lsquo;<samp>combined</samp>&rsquo;.
  47231. </p>
  47232. </dd>
  47233. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  47234. <dd><p>Specify display color mode.
  47235. </p>
  47236. <p>It accepts the following values:
  47237. </p><dl compact="compact">
  47238. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  47239. <dd><p>each channel is displayed in a separate color
  47240. </p></dd>
  47241. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  47242. <dd><p>each channel is displayed using the same color scheme
  47243. </p></dd>
  47244. <dt>&lsquo;<samp>rainbow</samp>&rsquo;</dt>
  47245. <dd><p>each channel is displayed using the rainbow color scheme
  47246. </p></dd>
  47247. <dt>&lsquo;<samp>moreland</samp>&rsquo;</dt>
  47248. <dd><p>each channel is displayed using the moreland color scheme
  47249. </p></dd>
  47250. <dt>&lsquo;<samp>nebulae</samp>&rsquo;</dt>
  47251. <dd><p>each channel is displayed using the nebulae color scheme
  47252. </p></dd>
  47253. <dt>&lsquo;<samp>fire</samp>&rsquo;</dt>
  47254. <dd><p>each channel is displayed using the fire color scheme
  47255. </p></dd>
  47256. <dt>&lsquo;<samp>fiery</samp>&rsquo;</dt>
  47257. <dd><p>each channel is displayed using the fiery color scheme
  47258. </p></dd>
  47259. <dt>&lsquo;<samp>fruit</samp>&rsquo;</dt>
  47260. <dd><p>each channel is displayed using the fruit color scheme
  47261. </p></dd>
  47262. <dt>&lsquo;<samp>cool</samp>&rsquo;</dt>
  47263. <dd><p>each channel is displayed using the cool color scheme
  47264. </p></dd>
  47265. <dt>&lsquo;<samp>magma</samp>&rsquo;</dt>
  47266. <dd><p>each channel is displayed using the magma color scheme
  47267. </p></dd>
  47268. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  47269. <dd><p>each channel is displayed using the green color scheme
  47270. </p></dd>
  47271. <dt>&lsquo;<samp>viridis</samp>&rsquo;</dt>
  47272. <dd><p>each channel is displayed using the viridis color scheme
  47273. </p></dd>
  47274. <dt>&lsquo;<samp>plasma</samp>&rsquo;</dt>
  47275. <dd><p>each channel is displayed using the plasma color scheme
  47276. </p></dd>
  47277. <dt>&lsquo;<samp>cividis</samp>&rsquo;</dt>
  47278. <dd><p>each channel is displayed using the cividis color scheme
  47279. </p></dd>
  47280. <dt>&lsquo;<samp>terrain</samp>&rsquo;</dt>
  47281. <dd><p>each channel is displayed using the terrain color scheme
  47282. </p></dd>
  47283. </dl>
  47284. <p>Default value is &lsquo;<samp>intensity</samp>&rsquo;.
  47285. </p>
  47286. </dd>
  47287. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  47288. <dd><p>Specify scale used for calculating intensity color values.
  47289. </p>
  47290. <p>It accepts the following values:
  47291. </p><dl compact="compact">
  47292. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  47293. <dd><p>linear
  47294. </p></dd>
  47295. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  47296. <dd><p>square root, default
  47297. </p></dd>
  47298. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  47299. <dd><p>cubic root
  47300. </p></dd>
  47301. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  47302. <dd><p>logarithmic
  47303. </p></dd>
  47304. <dt>&lsquo;<samp>4thrt</samp>&rsquo;</dt>
  47305. <dd><p>4th root
  47306. </p></dd>
  47307. <dt>&lsquo;<samp>5thrt</samp>&rsquo;</dt>
  47308. <dd><p>5th root
  47309. </p></dd>
  47310. </dl>
  47311. <p>Default value is &lsquo;<samp>log</samp>&rsquo;.
  47312. </p>
  47313. </dd>
  47314. <dt>&lsquo;<samp>fscale</samp>&rsquo;</dt>
  47315. <dd><p>Specify frequency scale.
  47316. </p>
  47317. <p>It accepts the following values:
  47318. </p><dl compact="compact">
  47319. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  47320. <dd><p>linear
  47321. </p></dd>
  47322. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  47323. <dd><p>logarithmic
  47324. </p></dd>
  47325. </dl>
  47326. <p>Default value is &lsquo;<samp>lin</samp>&rsquo;.
  47327. </p>
  47328. </dd>
  47329. <dt>&lsquo;<samp>saturation</samp>&rsquo;</dt>
  47330. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  47331. alternative color scheme. <code>0</code> is no saturation at all.
  47332. Saturation must be in [-10.0, 10.0] range.
  47333. Default value is <code>1</code>.
  47334. </p>
  47335. </dd>
  47336. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  47337. <dd><p>Set window function.
  47338. </p>
  47339. <p>It accepts the following values:
  47340. </p><dl compact="compact">
  47341. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  47342. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  47343. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  47344. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  47345. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  47346. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  47347. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  47348. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  47349. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  47350. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  47351. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  47352. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  47353. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  47354. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  47355. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  47356. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  47357. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  47358. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  47359. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  47360. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  47361. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  47362. </dl>
  47363. <p>Default value is <code>hann</code>.
  47364. </p>
  47365. </dd>
  47366. <dt>&lsquo;<samp>orientation</samp>&rsquo;</dt>
  47367. <dd><p>Set orientation of time vs frequency axis. Can be <code>vertical</code> or
  47368. <code>horizontal</code>. Default is <code>vertical</code>.
  47369. </p>
  47370. </dd>
  47371. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  47372. <dd><p>Set scale gain for calculating intensity color values.
  47373. Default value is <code>1</code>.
  47374. </p>
  47375. </dd>
  47376. <dt>&lsquo;<samp>legend</samp>&rsquo;</dt>
  47377. <dd><p>Draw time and frequency axes and legends. Default is enabled.
  47378. </p>
  47379. </dd>
  47380. <dt>&lsquo;<samp>rotation</samp>&rsquo;</dt>
  47381. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  47382. Default value is <code>0</code>.
  47383. </p>
  47384. </dd>
  47385. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  47386. <dd><p>Set start frequency from which to display spectrogram. Default is <code>0</code>.
  47387. </p>
  47388. </dd>
  47389. <dt>&lsquo;<samp>stop</samp>&rsquo;</dt>
  47390. <dd><p>Set stop frequency to which to display spectrogram. Default is <code>0</code>.
  47391. </p></dd>
  47392. </dl>
  47393. <a name="Examples-36"></a>
  47394. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-36">44.23.1 Examples</a></h3>
  47395. <ul>
  47396. <li>
  47397. Extract an audio spectrogram of a whole audio track
  47398. in a 1024x1024 picture using <code>ffmpeg</code>:
  47399. <div class="example">
  47400. <pre class="example">ffmpeg -i audio.flac -lavfi showspectrumpic=s=1024x1024 spectrogram.png
  47401. </pre></div>
  47402. </li></ul>
  47403. <a name="showvolume"></a>
  47404. <h2 class="section"><a href="ffmpeg-all.html#toc-showvolume">44.24 showvolume</a></h2>
  47405. <p>Convert input audio volume to a video output.
  47406. </p>
  47407. <p>The filter accepts the following options:
  47408. </p>
  47409. <dl compact="compact">
  47410. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  47411. <dd><p>Set video rate.
  47412. </p>
  47413. </dd>
  47414. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  47415. <dd><p>Set border width, allowed range is [0, 5]. Default is 1.
  47416. </p>
  47417. </dd>
  47418. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  47419. <dd><p>Set channel width, allowed range is [80, 8192]. Default is 400.
  47420. </p>
  47421. </dd>
  47422. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  47423. <dd><p>Set channel height, allowed range is [1, 900]. Default is 20.
  47424. </p>
  47425. </dd>
  47426. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  47427. <dd><p>Set fade, allowed range is [0, 1]. Default is 0.95.
  47428. </p>
  47429. </dd>
  47430. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  47431. <dd><p>Set volume color expression.
  47432. </p>
  47433. <p>The expression can use the following variables:
  47434. </p>
  47435. <dl compact="compact">
  47436. <dt>&lsquo;<samp>VOLUME</samp>&rsquo;</dt>
  47437. <dd><p>Current max volume of channel in dB.
  47438. </p>
  47439. </dd>
  47440. <dt>&lsquo;<samp>PEAK</samp>&rsquo;</dt>
  47441. <dd><p>Current peak.
  47442. </p>
  47443. </dd>
  47444. <dt>&lsquo;<samp>CHANNEL</samp>&rsquo;</dt>
  47445. <dd><p>Current channel number, starting from 0.
  47446. </p></dd>
  47447. </dl>
  47448. </dd>
  47449. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  47450. <dd><p>If set, displays channel names. Default is enabled.
  47451. </p>
  47452. </dd>
  47453. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  47454. <dd><p>If set, displays volume values. Default is enabled.
  47455. </p>
  47456. </dd>
  47457. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  47458. <dd><p>Set orientation, can be horizontal: <code>h</code> or vertical: <code>v</code>,
  47459. default is <code>h</code>.
  47460. </p>
  47461. </dd>
  47462. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  47463. <dd><p>Set step size, allowed range is [0, 5]. Default is 0, which means
  47464. step is disabled.
  47465. </p>
  47466. </dd>
  47467. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  47468. <dd><p>Set background opacity, allowed range is [0, 1]. Default is 0.
  47469. </p>
  47470. </dd>
  47471. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  47472. <dd><p>Set metering mode, can be peak: <code>p</code> or rms: <code>r</code>,
  47473. default is <code>p</code>.
  47474. </p>
  47475. </dd>
  47476. <dt>&lsquo;<samp>ds</samp>&rsquo;</dt>
  47477. <dd><p>Set display scale, can be linear: <code>lin</code> or log: <code>log</code>,
  47478. default is <code>lin</code>.
  47479. </p>
  47480. </dd>
  47481. <dt>&lsquo;<samp>dm</samp>&rsquo;</dt>
  47482. <dd><p>In second.
  47483. If set to &gt; 0., display a line for the max level
  47484. in the previous seconds.
  47485. default is disabled: <code>0.</code>
  47486. </p>
  47487. </dd>
  47488. <dt>&lsquo;<samp>dmc</samp>&rsquo;</dt>
  47489. <dd><p>The color of the max line. Use when <code>dm</code> option is set to &gt; 0.
  47490. default is: <code>orange</code>
  47491. </p></dd>
  47492. </dl>
  47493. <a name="showwaves"></a>
  47494. <h2 class="section"><a href="ffmpeg-all.html#toc-showwaves">44.25 showwaves</a></h2>
  47495. <p>Convert input audio to a video output, representing the samples waves.
  47496. </p>
  47497. <p>The filter accepts the following options:
  47498. </p>
  47499. <dl compact="compact">
  47500. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  47501. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  47502. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  47503. Default value is <code>600x240</code>.
  47504. </p>
  47505. </dd>
  47506. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  47507. <dd><p>Set display mode.
  47508. </p>
  47509. <p>Available values are:
  47510. </p><dl compact="compact">
  47511. <dt>&lsquo;<samp>point</samp>&rsquo;</dt>
  47512. <dd><p>Draw a point for each sample.
  47513. </p>
  47514. </dd>
  47515. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  47516. <dd><p>Draw a vertical line for each sample.
  47517. </p>
  47518. </dd>
  47519. <dt>&lsquo;<samp>p2p</samp>&rsquo;</dt>
  47520. <dd><p>Draw a point for each sample and a line between them.
  47521. </p>
  47522. </dd>
  47523. <dt>&lsquo;<samp>cline</samp>&rsquo;</dt>
  47524. <dd><p>Draw a centered vertical line for each sample.
  47525. </p></dd>
  47526. </dl>
  47527. <p>Default value is <code>point</code>.
  47528. </p>
  47529. </dd>
  47530. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  47531. <dd><p>Set the number of samples which are printed on the same column. A
  47532. larger value will decrease the frame rate. Must be a positive
  47533. integer. This option can be set only if the value for <var>rate</var>
  47534. is not explicitly specified.
  47535. </p>
  47536. </dd>
  47537. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  47538. <dd><p>Set the (approximate) output frame rate. This is done by setting the
  47539. option <var>n</var>. Default value is &quot;25&quot;.
  47540. </p>
  47541. </dd>
  47542. <dt>&lsquo;<samp>split_channels</samp>&rsquo;</dt>
  47543. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  47544. </p>
  47545. </dd>
  47546. <dt>&lsquo;<samp>colors</samp>&rsquo;</dt>
  47547. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  47548. </p>
  47549. </dd>
  47550. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  47551. <dd><p>Set amplitude scale.
  47552. </p>
  47553. <p>Available values are:
  47554. </p><dl compact="compact">
  47555. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  47556. <dd><p>Linear.
  47557. </p>
  47558. </dd>
  47559. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  47560. <dd><p>Logarithmic.
  47561. </p>
  47562. </dd>
  47563. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  47564. <dd><p>Square root.
  47565. </p>
  47566. </dd>
  47567. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  47568. <dd><p>Cubic root.
  47569. </p></dd>
  47570. </dl>
  47571. <p>Default is linear.
  47572. </p>
  47573. </dd>
  47574. <dt>&lsquo;<samp>draw</samp>&rsquo;</dt>
  47575. <dd><p>Set the draw mode. This is mostly useful to set for high <var>n</var>.
  47576. </p>
  47577. <p>Available values are:
  47578. </p><dl compact="compact">
  47579. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  47580. <dd><p>Scale pixel values for each drawn sample.
  47581. </p>
  47582. </dd>
  47583. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  47584. <dd><p>Draw every sample directly.
  47585. </p></dd>
  47586. </dl>
  47587. <p>Default value is <code>scale</code>.
  47588. </p></dd>
  47589. </dl>
  47590. <a name="Examples-124"></a>
  47591. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-124">44.25.1 Examples</a></h3>
  47592. <ul>
  47593. <li>
  47594. Output the input file audio and the corresponding video representation
  47595. at the same time:
  47596. <div class="example">
  47597. <pre class="example">amovie=a.mp3,asplit[out0],showwaves[out1]
  47598. </pre></div>
  47599. </li><li>
  47600. Create a synthetic signal and show it with showwaves, forcing a
  47601. frame rate of 30 frames per second:
  47602. <div class="example">
  47603. <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]
  47604. </pre></div>
  47605. </li></ul>
  47606. <a name="showwavespic"></a>
  47607. <h2 class="section"><a href="ffmpeg-all.html#toc-showwavespic">44.26 showwavespic</a></h2>
  47608. <p>Convert input audio to a single video frame, representing the samples waves.
  47609. </p>
  47610. <p>The filter accepts the following options:
  47611. </p>
  47612. <dl compact="compact">
  47613. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  47614. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  47615. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  47616. Default value is <code>600x240</code>.
  47617. </p>
  47618. </dd>
  47619. <dt>&lsquo;<samp>split_channels</samp>&rsquo;</dt>
  47620. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  47621. </p>
  47622. </dd>
  47623. <dt>&lsquo;<samp>colors</samp>&rsquo;</dt>
  47624. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  47625. </p>
  47626. </dd>
  47627. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  47628. <dd><p>Set amplitude scale.
  47629. </p>
  47630. <p>Available values are:
  47631. </p><dl compact="compact">
  47632. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  47633. <dd><p>Linear.
  47634. </p>
  47635. </dd>
  47636. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  47637. <dd><p>Logarithmic.
  47638. </p>
  47639. </dd>
  47640. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  47641. <dd><p>Square root.
  47642. </p>
  47643. </dd>
  47644. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  47645. <dd><p>Cubic root.
  47646. </p></dd>
  47647. </dl>
  47648. <p>Default is linear.
  47649. </p>
  47650. </dd>
  47651. <dt>&lsquo;<samp>draw</samp>&rsquo;</dt>
  47652. <dd><p>Set the draw mode.
  47653. </p>
  47654. <p>Available values are:
  47655. </p><dl compact="compact">
  47656. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  47657. <dd><p>Scale pixel values for each drawn sample.
  47658. </p>
  47659. </dd>
  47660. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  47661. <dd><p>Draw every sample directly.
  47662. </p></dd>
  47663. </dl>
  47664. <p>Default value is <code>scale</code>.
  47665. </p></dd>
  47666. </dl>
  47667. <a name="Examples-123"></a>
  47668. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-123">44.26.1 Examples</a></h3>
  47669. <ul>
  47670. <li>
  47671. Extract a channel split representation of the wave form of a whole audio track
  47672. in a 1024x800 picture using <code>ffmpeg</code>:
  47673. <div class="example">
  47674. <pre class="example">ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
  47675. </pre></div>
  47676. </li></ul>
  47677. <a name="sidedata_002c-asidedata"></a>
  47678. <h2 class="section"><a href="ffmpeg-all.html#toc-sidedata_002c-asidedata">44.27 sidedata, asidedata</a></h2>
  47679. <p>Delete frame side data, or select frames based on it.
  47680. </p>
  47681. <p>This filter accepts the following options:
  47682. </p>
  47683. <dl compact="compact">
  47684. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  47685. <dd><p>Set mode of operation of the filter.
  47686. </p>
  47687. <p>Can be one of the following:
  47688. </p>
  47689. <dl compact="compact">
  47690. <dt>&lsquo;<samp>select</samp>&rsquo;</dt>
  47691. <dd><p>Select every frame with side data of <code>type</code>.
  47692. </p>
  47693. </dd>
  47694. <dt>&lsquo;<samp>delete</samp>&rsquo;</dt>
  47695. <dd><p>Delete side data of <code>type</code>. If <code>type</code> is not set, delete all side
  47696. data in the frame.
  47697. </p>
  47698. </dd>
  47699. </dl>
  47700. </dd>
  47701. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  47702. <dd><p>Set side data type used with all modes. Must be set for <code>select</code> mode. For
  47703. the list of frame side data types, refer to the <code>AVFrameSideDataType</code> enum
  47704. in &lsquo;<tt>libavutil/frame.h</tt>&rsquo;. For example, to choose
  47705. <code>AV_FRAME_DATA_PANSCAN</code> side data, you must specify <code>PANSCAN</code>.
  47706. </p>
  47707. </dd>
  47708. </dl>
  47709. <a name="spectrumsynth"></a>
  47710. <h2 class="section"><a href="ffmpeg-all.html#toc-spectrumsynth">44.28 spectrumsynth</a></h2>
  47711. <p>Synthesize audio from 2 input video spectrums, first input stream represents
  47712. magnitude across time and second represents phase across time.
  47713. The filter will transform from frequency domain as displayed in videos back
  47714. to time domain as presented in audio output.
  47715. </p>
  47716. <p>This filter is primarily created for reversing processed <a href="#showspectrum">showspectrum</a>
  47717. filter outputs, but can synthesize sound from other spectrograms too.
  47718. But in such case results are going to be poor if the phase data is not
  47719. available, because in such cases phase data need to be recreated, usually
  47720. it&rsquo;s just recreated from random noise.
  47721. For best results use gray only output (<code>channel</code> color mode in
  47722. <a href="#showspectrum">showspectrum</a> filter) and <code>log</code> scale for magnitude video and
  47723. <code>lin</code> scale for phase video. To produce phase, for 2nd video, use
  47724. <code>data</code> option. Inputs videos should generally use <code>fullframe</code>
  47725. slide mode as that saves resources needed for decoding video.
  47726. </p>
  47727. <p>The filter accepts the following options:
  47728. </p>
  47729. <dl compact="compact">
  47730. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  47731. <dd><p>Specify sample rate of output audio, the sample rate of audio from which
  47732. spectrum was generated may differ.
  47733. </p>
  47734. </dd>
  47735. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  47736. <dd><p>Set number of channels represented in input video spectrums.
  47737. </p>
  47738. </dd>
  47739. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  47740. <dd><p>Set scale which was used when generating magnitude input spectrum.
  47741. Can be <code>lin</code> or <code>log</code>. Default is <code>log</code>.
  47742. </p>
  47743. </dd>
  47744. <dt>&lsquo;<samp>slide</samp>&rsquo;</dt>
  47745. <dd><p>Set slide which was used when generating inputs spectrums.
  47746. Can be <code>replace</code>, <code>scroll</code>, <code>fullframe</code> or <code>rscroll</code>.
  47747. Default is <code>fullframe</code>.
  47748. </p>
  47749. </dd>
  47750. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  47751. <dd><p>Set window function used for resynthesis.
  47752. </p>
  47753. </dd>
  47754. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  47755. <dd><p>Set window overlap. In range <code>[0, 1]</code>. Default is <code>1</code>,
  47756. which means optimal overlap for selected window function will be picked.
  47757. </p>
  47758. </dd>
  47759. <dt>&lsquo;<samp>orientation</samp>&rsquo;</dt>
  47760. <dd><p>Set orientation of input videos. Can be <code>vertical</code> or <code>horizontal</code>.
  47761. Default is <code>vertical</code>.
  47762. </p></dd>
  47763. </dl>
  47764. <a name="Examples-56"></a>
  47765. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-56">44.28.1 Examples</a></h3>
  47766. <ul>
  47767. <li>
  47768. First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate,
  47769. then resynthesize videos back to audio with spectrumsynth:
  47770. <div class="example">
  47771. <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
  47772. 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
  47773. ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
  47774. </pre></div>
  47775. </li></ul>
  47776. <a name="split_002c-asplit"></a>
  47777. <h2 class="section"><a href="ffmpeg-all.html#toc-split_002c-asplit">44.29 split, asplit</a></h2>
  47778. <p>Split input into several identical outputs.
  47779. </p>
  47780. <p><code>asplit</code> works with audio input, <code>split</code> with video.
  47781. </p>
  47782. <p>The filter accepts a single parameter which specifies the number of outputs. If
  47783. unspecified, it defaults to 2.
  47784. </p>
  47785. <a name="Examples-117"></a>
  47786. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-117">44.29.1 Examples</a></h3>
  47787. <ul>
  47788. <li>
  47789. Create two separate outputs from the same input:
  47790. <div class="example">
  47791. <pre class="example">[in] split [out0][out1]
  47792. </pre></div>
  47793. </li><li>
  47794. To create 3 or more outputs, you need to specify the number of
  47795. outputs, like in:
  47796. <div class="example">
  47797. <pre class="example">[in] asplit=3 [out0][out1][out2]
  47798. </pre></div>
  47799. </li><li>
  47800. Create two separate outputs from the same input, one cropped and
  47801. one padded:
  47802. <div class="example">
  47803. <pre class="example">[in] split [splitout1][splitout2];
  47804. [splitout1] crop=100:100:0:0 [cropout];
  47805. [splitout2] pad=200:200:100:100 [padout];
  47806. </pre></div>
  47807. </li><li>
  47808. Create 5 copies of the input audio with <code>ffmpeg</code>:
  47809. <div class="example">
  47810. <pre class="example">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
  47811. </pre></div>
  47812. </li></ul>
  47813. <a name="zmq_002c-azmq"></a>
  47814. <h2 class="section"><a href="ffmpeg-all.html#toc-zmq_002c-azmq">44.30 zmq, azmq</a></h2>
  47815. <p>Receive commands sent through a libzmq client, and forward them to
  47816. filters in the filtergraph.
  47817. </p>
  47818. <p><code>zmq</code> and <code>azmq</code> work as a pass-through filters. <code>zmq</code>
  47819. must be inserted between two video filters, <code>azmq</code> between two
  47820. audio filters. Both are capable to send messages to any filter type.
  47821. </p>
  47822. <p>To enable these filters you need to install the libzmq library and
  47823. headers and configure FFmpeg with <code>--enable-libzmq</code>.
  47824. </p>
  47825. <p>For more information about libzmq see:
  47826. <a href="http://www.zeromq.org/">http://www.zeromq.org/</a>
  47827. </p>
  47828. <p>The <code>zmq</code> and <code>azmq</code> filters work as a libzmq server, which
  47829. receives messages sent through a network interface defined by the
  47830. &lsquo;<samp>bind_address</samp>&rsquo; (or the abbreviation &quot;&lsquo;<samp>b</samp>&rsquo;&quot;) option.
  47831. Default value of this option is &lsquo;<tt>tcp://localhost:5555</tt>&rsquo;. You may
  47832. want to alter this value to your needs, but do not forget to escape any
  47833. &rsquo;:&rsquo; signs (see <a href="#filtergraph-escaping">filtergraph escaping</a>).
  47834. </p>
  47835. <p>The received message must be in the form:
  47836. </p><div class="example">
  47837. <pre class="example"><var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
  47838. </pre></div>
  47839. <p><var>TARGET</var> specifies the target of the command, usually the name of
  47840. the filter class or a specific filter instance name. The default
  47841. filter instance name uses the pattern &lsquo;<samp>Parsed_&lt;filter_name&gt;_&lt;index&gt;</samp>&rsquo;,
  47842. but you can override this by using the &lsquo;<samp>filter_name@id</samp>&rsquo; syntax
  47843. (see <a href="#Filtergraph-syntax">Filtergraph syntax</a>).
  47844. </p>
  47845. <p><var>COMMAND</var> specifies the name of the command for the target filter.
  47846. </p>
  47847. <p><var>ARG</var> is optional and specifies the optional argument list for the
  47848. given <var>COMMAND</var>.
  47849. </p>
  47850. <p>Upon reception, the message is processed and the corresponding command
  47851. is injected into the filtergraph. Depending on the result, the filter
  47852. will send a reply to the client, adopting the format:
  47853. </p><div class="example">
  47854. <pre class="example"><var>ERROR_CODE</var> <var>ERROR_REASON</var>
  47855. <var>MESSAGE</var>
  47856. </pre></div>
  47857. <p><var>MESSAGE</var> is optional.
  47858. </p>
  47859. <a name="Examples-67"></a>
  47860. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-67">44.30.1 Examples</a></h3>
  47861. <p>Look at &lsquo;<tt>tools/zmqsend</tt>&rsquo; for an example of a zmq client which can
  47862. be used to send commands processed by these filters.
  47863. </p>
  47864. <p>Consider the following filtergraph generated by <code>ffplay</code>.
  47865. In this example the last overlay filter has an instance name. All other
  47866. filters will have default instance names.
  47867. </p>
  47868. <div class="example">
  47869. <pre class="example">ffplay -dumpgraph 1 -f lavfi &quot;
  47870. color=s=100x100:c=red [l];
  47871. color=s=100x100:c=blue [r];
  47872. nullsrc=s=200x100, zmq [bg];
  47873. [bg][l] overlay [bg+l];
  47874. [bg+l][r] overlay@my=x=100 &quot;
  47875. </pre></div>
  47876. <p>To change the color of the left side of the video, the following
  47877. command can be used:
  47878. </p><div class="example">
  47879. <pre class="example">echo Parsed_color_0 c yellow | tools/zmqsend
  47880. </pre></div>
  47881. <p>To change the right side:
  47882. </p><div class="example">
  47883. <pre class="example">echo Parsed_color_1 c pink | tools/zmqsend
  47884. </pre></div>
  47885. <p>To change the position of the right side:
  47886. </p><div class="example">
  47887. <pre class="example">echo overlay@my x 150 | tools/zmqsend
  47888. </pre></div>
  47889. <a name="Multimedia-Sources"></a>
  47890. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Multimedia-Sources">45 Multimedia Sources</a></h1>
  47891. <p>Below is a description of the currently available multimedia sources.
  47892. </p>
  47893. <a name="amovie"></a>
  47894. <h2 class="section"><a href="ffmpeg-all.html#toc-amovie">45.1 amovie</a></h2>
  47895. <p>This is the same as <a href="#movie">movie</a> source, except it selects an audio
  47896. stream by default.
  47897. </p>
  47898. <p><a name="movie"></a>
  47899. </p><a name="movie-1"></a>
  47900. <h2 class="section"><a href="ffmpeg-all.html#toc-movie-1">45.2 movie</a></h2>
  47901. <p>Read audio and/or video stream(s) from a movie container.
  47902. </p>
  47903. <p>It accepts the following parameters:
  47904. </p>
  47905. <dl compact="compact">
  47906. <dt>&lsquo;<samp>filename</samp>&rsquo;</dt>
  47907. <dd><p>The name of the resource to read (not necessarily a file; it can also be a
  47908. device or a stream accessed through some protocol).
  47909. </p>
  47910. </dd>
  47911. <dt>&lsquo;<samp>format_name, f</samp>&rsquo;</dt>
  47912. <dd><p>Specifies the format assumed for the movie to read, and can be either
  47913. the name of a container or an input device. If not specified, the
  47914. format is guessed from <var>movie_name</var> or by probing.
  47915. </p>
  47916. </dd>
  47917. <dt>&lsquo;<samp>seek_point, sp</samp>&rsquo;</dt>
  47918. <dd><p>Specifies the seek point in seconds. The frames will be output
  47919. starting from this seek point. The parameter is evaluated with
  47920. <code>av_strtod</code>, so the numerical value may be suffixed by an IS
  47921. postfix. The default value is &quot;0&quot;.
  47922. </p>
  47923. </dd>
  47924. <dt>&lsquo;<samp>streams, s</samp>&rsquo;</dt>
  47925. <dd><p>Specifies the streams to read. Several streams can be specified,
  47926. separated by &quot;+&quot;. The source will then have as many outputs, in the
  47927. same order. The syntax is explained in the <a href="ffmpeg.html#Stream-specifiers">(ffmpeg)&quot;Stream specifiers&quot; section in the ffmpeg manual</a>. Two special names, &quot;dv&quot; and &quot;da&quot; specify
  47928. respectively the default (best suited) video and audio stream. Default
  47929. is &quot;dv&quot;, or &quot;da&quot; if the filter is called as &quot;amovie&quot;.
  47930. </p>
  47931. </dd>
  47932. <dt>&lsquo;<samp>stream_index, si</samp>&rsquo;</dt>
  47933. <dd><p>Specifies the index of the video stream to read. If the value is -1,
  47934. the most suitable video stream will be automatically selected. The default
  47935. value is &quot;-1&quot;. Deprecated. If the filter is called &quot;amovie&quot;, it will select
  47936. audio instead of video.
  47937. </p>
  47938. </dd>
  47939. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  47940. <dd><p>Specifies how many times to read the stream in sequence.
  47941. If the value is 0, the stream will be looped infinitely.
  47942. Default value is &quot;1&quot;.
  47943. </p>
  47944. <p>Note that when the movie is looped the source timestamps are not
  47945. changed, so it will generate non monotonically increasing timestamps.
  47946. </p>
  47947. </dd>
  47948. <dt>&lsquo;<samp>discontinuity</samp>&rsquo;</dt>
  47949. <dd><p>Specifies the time difference between frames above which the point is
  47950. considered a timestamp discontinuity which is removed by adjusting the later
  47951. timestamps.
  47952. </p></dd>
  47953. </dl>
  47954. <p>It allows overlaying a second video on top of the main input of
  47955. a filtergraph, as shown in this graph:
  47956. </p><div class="example">
  47957. <pre class="example">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
  47958. ^
  47959. |
  47960. movie --&gt; scale--&gt; deltapts1 -------+
  47961. </pre></div>
  47962. <a name="Examples-129"></a>
  47963. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-129">45.2.1 Examples</a></h3>
  47964. <ul>
  47965. <li>
  47966. Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it
  47967. on top of the input labelled &quot;in&quot;:
  47968. <div class="example">
  47969. <pre class="example">movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
  47970. [in] setpts=PTS-STARTPTS [main];
  47971. [main][over] overlay=16:16 [out]
  47972. </pre></div>
  47973. </li><li>
  47974. Read from a video4linux2 device, and overlay it on top of the input
  47975. labelled &quot;in&quot;:
  47976. <div class="example">
  47977. <pre class="example">movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
  47978. [in] setpts=PTS-STARTPTS [main];
  47979. [main][over] overlay=16:16 [out]
  47980. </pre></div>
  47981. </li><li>
  47982. Read the first video stream and the audio stream with id 0x81 from
  47983. dvd.vob; the video is connected to the pad named &quot;video&quot; and the audio is
  47984. connected to the pad named &quot;audio&quot;:
  47985. <div class="example">
  47986. <pre class="example">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
  47987. </pre></div>
  47988. </li></ul>
  47989. <a name="Commands-42"></a>
  47990. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-42">45.2.2 Commands</a></h3>
  47991. <p>Both movie and amovie support the following commands:
  47992. </p><dl compact="compact">
  47993. <dt>&lsquo;<samp>seek</samp>&rsquo;</dt>
  47994. <dd><p>Perform seek using &quot;av_seek_frame&quot;.
  47995. The syntax is: seek <var>stream_index</var>|<var>timestamp</var>|<var>flags</var>
  47996. </p><ul>
  47997. <li>
  47998. <var>stream_index</var>: If stream_index is -1, a default
  47999. stream is selected, and <var>timestamp</var> is automatically converted
  48000. from AV_TIME_BASE units to the stream specific time_base.
  48001. </li><li>
  48002. <var>timestamp</var>: Timestamp in AVStream.time_base units
  48003. or, if no stream is specified, in AV_TIME_BASE units.
  48004. </li><li>
  48005. <var>flags</var>: Flags which select direction and seeking mode.
  48006. </li></ul>
  48007. </dd>
  48008. <dt>&lsquo;<samp>get_duration</samp>&rsquo;</dt>
  48009. <dd><p>Get movie duration in AV_TIME_BASE units.
  48010. </p>
  48011. </dd>
  48012. </dl>
  48013. <a name="See-Also"></a>
  48014. <h1 class="chapter"><a href="ffmpeg-all.html#toc-See-Also">46 See Also</a></h1>
  48015. <p><a href="ffmpeg.html">ffmpeg</a>
  48016. <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
  48017. <a href="ffmpeg-utils.html">ffmpeg-utils</a>,
  48018. <a href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
  48019. <a href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
  48020. <a href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
  48021. <a href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
  48022. <a href="ffmpeg-formats.html">ffmpeg-formats</a>,
  48023. <a href="ffmpeg-devices.html">ffmpeg-devices</a>,
  48024. <a href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
  48025. <a href="ffmpeg-filters.html">ffmpeg-filters</a>
  48026. </p>
  48027. <a name="Authors"></a>
  48028. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Authors">47 Authors</a></h1>
  48029. <p>The FFmpeg developers.
  48030. </p>
  48031. <p>For details about the authorship, see the Git history of the project
  48032. (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
  48033. <code>git log</code> in the FFmpeg source directory, or browsing the
  48034. online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
  48035. </p>
  48036. <p>Maintainers for the specific components are listed in the file
  48037. &lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
  48038. </p>
  48039. </div>
  48040. </body>
  48041. </html>