filters.texi 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144
  1. @chapter Filtergraph description
  2. @c man begin FILTERGRAPH DESCRIPTION
  3. A filtergraph is a directed graph of connected filters. It can contain
  4. cycles, and there can be multiple links between a pair of
  5. filters. Each link has one input pad on one side connecting it to one
  6. filter from which it takes its input, and one output pad on the other
  7. side connecting it to the one filter accepting its output.
  8. Each filter in a filtergraph is an instance of a filter class
  9. registered in the application, which defines the features and the
  10. number of input and output pads of the filter.
  11. A filter with no input pads is called a "source", a filter with no
  12. output pads is called a "sink".
  13. @section Filtergraph syntax
  14. A filtergraph can be represented using a textual representation, which
  15. is recognized by the @code{-vf} and @code{-af} options of the ff*
  16. tools, and by the @code{avfilter_graph_parse()} function defined in
  17. @file{libavfilter/avfiltergraph.h}.
  18. A filterchain consists of a sequence of connected filters, each one
  19. connected to the previous one in the sequence. A filterchain is
  20. represented by a list of ","-separated filter descriptions.
  21. A filtergraph consists of a sequence of filterchains. A sequence of
  22. filterchains is represented by a list of ";"-separated filterchain
  23. descriptions.
  24. A filter is represented by a string of the form:
  25. [@var{in_link_1}]...[@var{in_link_N}]@var{filter_name}=@var{arguments}[@var{out_link_1}]...[@var{out_link_M}]
  26. @var{filter_name} is the name of the filter class of which the
  27. described filter is an instance of, and has to be the name of one of
  28. the filter classes registered in the program.
  29. The name of the filter class is optionally followed by a string
  30. "=@var{arguments}".
  31. @var{arguments} is a string which contains the parameters used to
  32. initialize the filter instance, and are described in the filter
  33. descriptions below.
  34. The list of arguments can be quoted using the character "'" as initial
  35. and ending mark, and the character '\' for escaping the characters
  36. within the quoted text; otherwise the argument string is considered
  37. terminated when the next special character (belonging to the set
  38. "[]=;,") is encountered.
  39. The name and arguments of the filter are optionally preceded and
  40. followed by a list of link labels.
  41. A link label allows to name a link and associate it to a filter output
  42. or input pad. The preceding labels @var{in_link_1}
  43. ... @var{in_link_N}, are associated to the filter input pads,
  44. the following labels @var{out_link_1} ... @var{out_link_M}, are
  45. associated to the output pads.
  46. When two link labels with the same name are found in the
  47. filtergraph, a link between the corresponding input and output pad is
  48. created.
  49. If an output pad is not labelled, it is linked by default to the first
  50. unlabelled input pad of the next filter in the filterchain.
  51. For example in the filterchain:
  52. @example
  53. nullsrc, split[L1], [L2]overlay, nullsink
  54. @end example
  55. the split filter instance has two output pads, and the overlay filter
  56. instance two input pads. The first output pad of split is labelled
  57. "L1", the first input pad of overlay is labelled "L2", and the second
  58. output pad of split is linked to the second input pad of overlay,
  59. which are both unlabelled.
  60. In a complete filterchain all the unlabelled filter input and output
  61. pads must be connected. A filtergraph is considered valid if all the
  62. filter input and output pads of all the filterchains are connected.
  63. Follows a BNF description for the filtergraph syntax:
  64. @example
  65. @var{NAME} ::= sequence of alphanumeric characters and '_'
  66. @var{LINKLABEL} ::= "[" @var{NAME} "]"
  67. @var{LINKLABELS} ::= @var{LINKLABEL} [@var{LINKLABELS}]
  68. @var{FILTER_ARGUMENTS} ::= sequence of chars (eventually quoted)
  69. @var{FILTER} ::= [@var{LINKNAMES}] @var{NAME} ["=" @var{ARGUMENTS}] [@var{LINKNAMES}]
  70. @var{FILTERCHAIN} ::= @var{FILTER} [,@var{FILTERCHAIN}]
  71. @var{FILTERGRAPH} ::= @var{FILTERCHAIN} [;@var{FILTERGRAPH}]
  72. @end example
  73. @c man end FILTERGRAPH DESCRIPTION
  74. @chapter Audio Filters
  75. @c man begin AUDIO FILTERS
  76. When you configure your FFmpeg build, you can disable any of the
  77. existing filters using --disable-filters.
  78. The configure output will show the audio filters included in your
  79. build.
  80. Below is a description of the currently available audio filters.
  81. @section anull
  82. Pass the audio source unchanged to the output.
  83. @c man end AUDIO FILTERS
  84. @chapter Audio Sources
  85. @c man begin AUDIO SOURCES
  86. Below is a description of the currently available audio sources.
  87. @section anullsrc
  88. Null audio source, never return audio frames. It is mainly useful as a
  89. template and to be employed in analysis / debugging tools.
  90. It accepts as optional parameter a string of the form
  91. @var{sample_rate}:@var{channel_layout}.
  92. @var{sample_rate} specify the sample rate, and defaults to 44100.
  93. @var{channel_layout} specify the channel layout, and can be either an
  94. integer or a string representing a channel layout. The default value
  95. of @var{channel_layout} is 3, which corresponds to CH_LAYOUT_STEREO.
  96. Check the channel_layout_map definition in
  97. @file{libavcodec/audioconvert.c} for the mapping between strings and
  98. channel layout values.
  99. Follow some examples:
  100. @example
  101. # set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO.
  102. anullsrc=48000:4
  103. # same as
  104. anullsrc=48000:mono
  105. @end example
  106. @c man end AUDIO SOURCES
  107. @chapter Audio Sinks
  108. @c man begin AUDIO SINKS
  109. Below is a description of the currently available audio sinks.
  110. @section anullsink
  111. Null audio sink, do absolutely nothing with the input audio. It is
  112. mainly useful as a template and to be employed in analysis / debugging
  113. tools.
  114. @c man end AUDIO SINKS
  115. @chapter Video Filters
  116. @c man begin VIDEO FILTERS
  117. When you configure your FFmpeg build, you can disable any of the
  118. existing filters using --disable-filters.
  119. The configure output will show the video filters included in your
  120. build.
  121. Below is a description of the currently available video filters.
  122. @section blackframe
  123. Detect frames that are (almost) completely black. Can be useful to
  124. detect chapter transitions or commercials. Output lines consist of
  125. the frame number of the detected frame, the percentage of blackness,
  126. the position in the file if known or -1 and the timestamp in seconds.
  127. In order to display the output lines, you need to set the loglevel at
  128. least to the AV_LOG_INFO value.
  129. The filter accepts the syntax:
  130. @example
  131. blackframe[=@var{amount}:[@var{threshold}]]
  132. @end example
  133. @var{amount} is the percentage of the pixels that have to be below the
  134. threshold, and defaults to 98.
  135. @var{threshold} is the threshold below which a pixel value is
  136. considered black, and defaults to 32.
  137. @section boxblur
  138. Apply boxblur algorithm to the input video.
  139. This filter accepts the parameters:
  140. @var{luma_power}:@var{luma_radius}:@var{chroma_radius}:@var{chroma_power}:@var{alpha_radius}:@var{alpha_power}
  141. Chroma and alpha parameters are optional, if not specified they default
  142. to the corresponding values set for @var{luma_radius} and
  143. @var{luma_power}.
  144. @var{luma_radius}, @var{chroma_radius}, and @var{alpha_radius} represent
  145. the radius in pixels of the box used for blurring the corresponding
  146. input plane. They are expressions, and can contain the following
  147. constants:
  148. @table @option
  149. @item w, h
  150. the input width and heigth in pixels
  151. @item cw, ch
  152. the input chroma image width and height in pixels
  153. @item hsub, vsub
  154. horizontal and vertical chroma subsample values. For example for the
  155. pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
  156. @end table
  157. The radius must be a non-negative number, and must be not greater than
  158. the value of the expression @code{min(w,h)/2} for the luma and alpha planes,
  159. and of @code{min(cw,ch)/2} for the chroma planes.
  160. @var{luma_power}, @var{chroma_power}, and @var{alpha_power} represent
  161. how many times the boxblur filter is applied to the corresponding
  162. plane.
  163. Some examples follow:
  164. @itemize
  165. @item
  166. Apply a boxblur filter with luma, chroma, and alpha radius
  167. set to 2:
  168. @example
  169. boxblur=2:1
  170. @end example
  171. @item
  172. Set luma radius to 2, alpha and chroma radius to 0
  173. @example
  174. boxblur=2:1:0:0:0:0
  175. @end example
  176. @item
  177. Set luma and chroma radius to a fraction of the video dimension
  178. @example
  179. boxblur=min(h\,w)/10:1:min(cw\,ch)/10:1
  180. @end example
  181. @end itemize
  182. @section copy
  183. Copy the input source unchanged to the output. Mainly useful for
  184. testing purposes.
  185. @section crop
  186. Crop the input video to @var{out_w}:@var{out_h}:@var{x}:@var{y}.
  187. The parameters are expressions containing the following constants:
  188. @table @option
  189. @item E, PI, PHI
  190. the corresponding mathematical approximated values for e
  191. (euler number), pi (greek PI), PHI (golden ratio)
  192. @item x, y
  193. the computed values for @var{x} and @var{y}. They are evaluated for
  194. each new frame.
  195. @item in_w, in_h
  196. the input width and heigth
  197. @item iw, ih
  198. same as @var{in_w} and @var{in_h}
  199. @item out_w, out_h
  200. the output (cropped) width and heigth
  201. @item ow, oh
  202. same as @var{out_w} and @var{out_h}
  203. @item a
  204. same as @var{iw} / @var{ih}
  205. @item sar
  206. input sample aspect ratio
  207. @item dar
  208. input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
  209. @item hsub, vsub
  210. horizontal and vertical chroma subsample values. For example for the
  211. pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
  212. @item n
  213. the number of input frame, starting from 0
  214. @item pos
  215. the position in the file of the input frame, NAN if unknown
  216. @item t
  217. timestamp expressed in seconds, NAN if the input timestamp is unknown
  218. @end table
  219. The @var{out_w} and @var{out_h} parameters specify the expressions for
  220. the width and height of the output (cropped) video. They are
  221. evaluated just at the configuration of the filter.
  222. The default value of @var{out_w} is "in_w", and the default value of
  223. @var{out_h} is "in_h".
  224. The expression for @var{out_w} may depend on the value of @var{out_h},
  225. and the expression for @var{out_h} may depend on @var{out_w}, but they
  226. cannot depend on @var{x} and @var{y}, as @var{x} and @var{y} are
  227. evaluated after @var{out_w} and @var{out_h}.
  228. The @var{x} and @var{y} parameters specify the expressions for the
  229. position of the top-left corner of the output (non-cropped) area. They
  230. are evaluated for each frame. If the evaluated value is not valid, it
  231. is approximated to the nearest valid value.
  232. The default value of @var{x} is "(in_w-out_w)/2", and the default
  233. value for @var{y} is "(in_h-out_h)/2", which set the cropped area at
  234. the center of the input image.
  235. The expression for @var{x} may depend on @var{y}, and the expression
  236. for @var{y} may depend on @var{x}.
  237. Follow some examples:
  238. @example
  239. # crop the central input area with size 100x100
  240. crop=100:100
  241. # crop the central input area with size 2/3 of the input video
  242. "crop=2/3*in_w:2/3*in_h"
  243. # crop the input video central square
  244. crop=in_h
  245. # delimit the rectangle with the top-left corner placed at position
  246. # 100:100 and the right-bottom corner corresponding to the right-bottom
  247. # corner of the input image.
  248. crop=in_w-100:in_h-100:100:100
  249. # crop 10 pixels from the left and right borders, and 20 pixels from
  250. # the top and bottom borders
  251. "crop=in_w-2*10:in_h-2*20"
  252. # keep only the bottom right quarter of the input image
  253. "crop=in_w/2:in_h/2:in_w/2:in_h/2"
  254. # crop height for getting Greek harmony
  255. "crop=in_w:1/PHI*in_w"
  256. # trembling effect
  257. "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)"
  258. # erratic camera effect depending on timestamp
  259. "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)"
  260. # set x depending on the value of y
  261. "crop=in_w/2:in_h/2:y:10+10*sin(n/10)"
  262. @end example
  263. @section cropdetect
  264. Auto-detect crop size.
  265. Calculate necessary cropping parameters and prints the recommended
  266. parameters through the logging system. The detected dimensions
  267. correspond to the non-black area of the input video.
  268. It accepts the syntax:
  269. @example
  270. cropdetect[=@var{limit}[:@var{round}[:@var{reset}]]]
  271. @end example
  272. @table @option
  273. @item limit
  274. Threshold, which can be optionally specified from nothing (0) to
  275. everything (255), defaults to 24.
  276. @item round
  277. Value which the width/height should be divisible by, defaults to
  278. 16. The offset is automatically adjusted to center the video. Use 2 to
  279. get only even dimensions (needed for 4:2:2 video). 16 is best when
  280. encoding to most video codecs.
  281. @item reset
  282. Counter that determines after how many frames cropdetect will reset
  283. the previously detected largest video area and start over to detect
  284. the current optimal crop area. Defaults to 0.
  285. This can be useful when channel logos distort the video area. 0
  286. indicates never reset and return the largest area encountered during
  287. playback.
  288. @end table
  289. @section drawbox
  290. Draw a colored box on the input image.
  291. It accepts the syntax:
  292. @example
  293. drawbox=@var{x}:@var{y}:@var{width}:@var{height}:@var{color}
  294. @end example
  295. @table @option
  296. @item x, y
  297. Specify the top left corner coordinates of the box. Default to 0.
  298. @item width, height
  299. Specify the width and height of the box, if 0 they are interpreted as
  300. the input width and height. Default to 0.
  301. @item color
  302. Specify the color of the box to write, it can be the name of a color
  303. (case insensitive match) or a 0xRRGGBB[AA] sequence.
  304. @end table
  305. Follow some examples:
  306. @example
  307. # draw a black box around the edge of the input image
  308. drawbox
  309. # draw a box with color red and an opacity of 50%
  310. drawbox=10:20:200:60:red@@0.5"
  311. @end example
  312. @section drawtext
  313. Draw text string or text from specified file on top of video using the
  314. libfreetype library.
  315. To enable compilation of this filter you need to configure FFmpeg with
  316. @code{--enable-libfreetype}.
  317. The filter also recognizes strftime() sequences in the provided text
  318. and expands them accordingly. Check the documentation of strftime().
  319. The filter accepts parameters as a list of @var{key}=@var{value} pairs,
  320. separated by ":".
  321. The description of the accepted parameters follows.
  322. @table @option
  323. @item fontfile
  324. The font file to be used for drawing text. Path must be included.
  325. This parameter is mandatory.
  326. @item text
  327. The text string to be drawn. The text must be a sequence of UTF-8
  328. encoded characters.
  329. This parameter is mandatory if no file is specified with the parameter
  330. @var{textfile}.
  331. @item textfile
  332. A text file containing text to be drawn. The text must be a sequence
  333. of UTF-8 encoded characters.
  334. This parameter is mandatory if no text string is specified with the
  335. parameter @var{text}.
  336. If both text and textfile are specified, an error is thrown.
  337. @item x, y
  338. The offsets where text will be drawn within the video frame.
  339. Relative to the top/left border of the output image.
  340. The default value of @var{x} and @var{y} is 0.
  341. @item fontsize
  342. The font size to be used for drawing text.
  343. The default value of @var{fontsize} is 16.
  344. @item fontcolor
  345. The color to be used for drawing fonts.
  346. Either a string (e.g. "red") or in 0xRRGGBB[AA] format
  347. (e.g. "0xff000033"), possibly followed by an alpha specifier.
  348. The default value of @var{fontcolor} is "black".
  349. @item boxcolor
  350. The color to be used for drawing box around text.
  351. Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format
  352. (e.g. "0xff00ff"), possibly followed by an alpha specifier.
  353. The default value of @var{boxcolor} is "white".
  354. @item box
  355. Used to draw a box around text using background color.
  356. Value should be either 1 (enable) or 0 (disable).
  357. The default value of @var{box} is 0.
  358. @item shadowx, shadowy
  359. The x and y offsets for the text shadow position with respect to the
  360. position of the text. They can be either positive or negative
  361. values. Default value for both is "0".
  362. @item shadowcolor
  363. The color to be used for drawing a shadow behind the drawn text. It
  364. can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA]
  365. form (e.g. "0xff00ff"), possibly followed by an alpha specifier.
  366. The default value of @var{shadowcolor} is "black".
  367. @item ft_load_flags
  368. Flags to be used for loading the fonts.
  369. The flags map the corresponding flags supported by libfreetype, and are
  370. a combination of the following values:
  371. @table @var
  372. @item default
  373. @item no_scale
  374. @item no_hinting
  375. @item render
  376. @item no_bitmap
  377. @item vertical_layout
  378. @item force_autohint
  379. @item crop_bitmap
  380. @item pedantic
  381. @item ignore_global_advance_width
  382. @item no_recurse
  383. @item ignore_transform
  384. @item monochrome
  385. @item linear_design
  386. @item no_autohint
  387. @item end table
  388. @end table
  389. Default value is "render".
  390. For more information consult the documentation for the FT_LOAD_*
  391. libfreetype flags.
  392. @item tabsize
  393. The size in number of spaces to use for rendering the tab.
  394. Default value is 4.
  395. @end table
  396. For example the command:
  397. @example
  398. drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
  399. @end example
  400. will draw "Test Text" with font FreeSerif, using the default values
  401. for the optional parameters.
  402. The command:
  403. @example
  404. drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
  405. x=100: y=50: fontsize=24: fontcolor=yellow@@0.2: box=1: boxcolor=red@@0.2"
  406. @end example
  407. will draw 'Test Text' with font FreeSerif of size 24 at position x=100
  408. and y=50 (counting from the top-left corner of the screen), text is
  409. yellow with a red box around it. Both the text and the box have an
  410. opacity of 20%.
  411. Note that the double quotes are not necessary if spaces are not used
  412. within the parameter list.
  413. For more information about libfreetype, check:
  414. @url{http://www.freetype.org/}.
  415. @section fade
  416. Apply fade-in/out effect to input video.
  417. It accepts the parameters:
  418. @var{type}:@var{start_frame}:@var{nb_frames}
  419. @var{type} specifies if the effect type, can be either "in" for
  420. fade-in, or "out" for a fade-out effect.
  421. @var{start_frame} specifies the number of the start frame for starting
  422. to apply the fade effect.
  423. @var{nb_frames} specifies the number of frames for which the fade
  424. effect has to last. At the end of the fade-in effect the output video
  425. will have the same intensity as the input video, at the end of the
  426. fade-out transition the output video will be completely black.
  427. A few usage examples follow, usable too as test scenarios.
  428. @example
  429. # fade in first 30 frames of video
  430. fade=in:0:30
  431. # fade out last 45 frames of a 200-frame video
  432. fade=out:155:45
  433. # fade in first 25 frames and fade out last 25 frames of a 1000-frame video
  434. fade=in:0:25, fade=out:975:25
  435. # make first 5 frames black, then fade in from frame 5-24
  436. fade=in:5:20
  437. @end example
  438. @section fieldorder
  439. Transform the field order of the input video.
  440. It accepts one parameter which specifies the required field order that
  441. the input interlaced video will be transformed to. The parameter can
  442. assume one of the following values:
  443. @table @option
  444. @item 0 or bff
  445. output bottom field first
  446. @item 1 or tff
  447. output top field first
  448. @end table
  449. Default value is "tff".
  450. Transformation is achieved by shifting the picture content up or down
  451. by one line, and filling the remaining line with appropriate picture content.
  452. This method is consistent with most broadcast field order converters.
  453. If the input video is not flagged as being interlaced, or it is already
  454. flagged as being of the required output field order then this filter does
  455. not alter the incoming video.
  456. This filter is very useful when converting to or from PAL DV material,
  457. which is bottom field first.
  458. For example:
  459. @example
  460. ./ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
  461. @end example
  462. @section fifo
  463. Buffer input images and send them when they are requested.
  464. This filter is mainly useful when auto-inserted by the libavfilter
  465. framework.
  466. The filter does not take parameters.
  467. @section format
  468. Convert the input video to one of the specified pixel formats.
  469. Libavfilter will try to pick one that is supported for the input to
  470. the next filter.
  471. The filter accepts a list of pixel format names, separated by ":",
  472. for example "yuv420p:monow:rgb24".
  473. Some examples follow:
  474. @example
  475. # convert the input video to the format "yuv420p"
  476. format=yuv420p
  477. # convert the input video to any of the formats in the list
  478. format=yuv420p:yuv444p:yuv410p
  479. @end example
  480. @anchor{frei0r}
  481. @section frei0r
  482. Apply a frei0r effect to the input video.
  483. To enable compilation of this filter you need to install the frei0r
  484. header and configure FFmpeg with --enable-frei0r.
  485. The filter supports the syntax:
  486. @example
  487. @var{filter_name}[@{:|=@}@var{param1}:@var{param2}:...:@var{paramN}]
  488. @end example
  489. @var{filter_name} is the name to the frei0r effect to load. If the
  490. environment variable @env{FREI0R_PATH} is defined, the frei0r effect
  491. is searched in each one of the directories specified by the colon
  492. separated list in @env{FREIOR_PATH}, otherwise in the standard frei0r
  493. paths, which are in this order: @file{HOME/.frei0r-1/lib/},
  494. @file{/usr/local/lib/frei0r-1/}, @file{/usr/lib/frei0r-1/}.
  495. @var{param1}, @var{param2}, ... , @var{paramN} specify the parameters
  496. for the frei0r effect.
  497. A frei0r effect parameter can be a boolean (whose values are specified
  498. with "y" and "n"), a double, a color (specified by the syntax
  499. @var{R}/@var{G}/@var{B}, @var{R}, @var{G}, and @var{B} being float
  500. numbers from 0.0 to 1.0) or by an @code{av_parse_color()} color
  501. description), a position (specified by the syntax @var{X}/@var{Y},
  502. @var{X} and @var{Y} being float numbers) and a string.
  503. The number and kind of parameters depend on the loaded effect. If an
  504. effect parameter is not specified the default value is set.
  505. Some examples follow:
  506. @example
  507. # apply the distort0r effect, set the first two double parameters
  508. frei0r=distort0r:0.5:0.01
  509. # apply the colordistance effect, takes a color as first parameter
  510. frei0r=colordistance:0.2/0.3/0.4
  511. frei0r=colordistance:violet
  512. frei0r=colordistance:0x112233
  513. # apply the perspective effect, specify the top left and top right
  514. # image positions
  515. frei0r=perspective:0.2/0.2:0.8/0.2
  516. @end example
  517. For more information see:
  518. @url{http://piksel.org/frei0r}
  519. @section gradfun
  520. Fix the banding artifacts that are sometimes introduced into nearly flat
  521. regions by truncation to 8bit colordepth.
  522. Interpolate the gradients that should go where the bands are, and
  523. dither them.
  524. This filter is designed for playback only. Do not use it prior to
  525. lossy compression, because compression tends to lose the dither and
  526. bring back the bands.
  527. The filter takes two optional parameters, separated by ':':
  528. @var{strength}:@var{radius}
  529. @var{strength} is the maximum amount by which the filter will change
  530. any one pixel. Also the threshold for detecting nearly flat
  531. regions. Acceptable values range from .51 to 255, default value is
  532. 1.2, out-of-range values will be clipped to the valid range.
  533. @var{radius} is the neighborhood to fit the gradient to. A larger
  534. radius makes for smoother gradients, but also prevents the filter from
  535. modifying the pixels near detailed regions. Acceptable values are
  536. 8-32, default value is 16, out-of-range values will be clipped to the
  537. valid range.
  538. @example
  539. # default parameters
  540. gradfun=1.2:16
  541. # omitting radius
  542. gradfun=1.2
  543. @end example
  544. @section hflip
  545. Flip the input video horizontally.
  546. For example to horizontally flip the video in input with
  547. @file{ffmpeg}:
  548. @example
  549. ffmpeg -i in.avi -vf "hflip" out.avi
  550. @end example
  551. @section hqdn3d
  552. High precision/quality 3d denoise filter. This filter aims to reduce
  553. image noise producing smooth images and making still images really
  554. still. It should enhance compressibility.
  555. It accepts the following optional parameters:
  556. @var{luma_spatial}:@var{chroma_spatial}:@var{luma_tmp}:@var{chroma_tmp}
  557. @table @option
  558. @item luma_spatial
  559. a non-negative float number which specifies spatial luma strength,
  560. defaults to 4.0
  561. @item chroma_spatial
  562. a non-negative float number which specifies spatial chroma strength,
  563. defaults to 3.0*@var{luma_spatial}/4.0
  564. @item luma_tmp
  565. a float number which specifies luma temporal strength, defaults to
  566. 6.0*@var{luma_spatial}/4.0
  567. @item chroma_tmp
  568. a float number which specifies chroma temporal strength, defaults to
  569. @var{luma_tmp}*@var{chroma_spatial}/@var{luma_spatial}
  570. @end table
  571. @section lut, lutrgb, lutyuv
  572. Compute a look-up table for binding each pixel component input value
  573. to an output value, and apply it to input video.
  574. @var{lutyuv} applies a lookup table to a YUV input video, @var{lutrgb}
  575. to an RGB input video.
  576. These filters accept in input a ":"-separated list of options, which
  577. specify the expressions used for computing the lookup table for the
  578. corresponding pixel component values.
  579. The @var{lut} filter requires either YUV or RGB pixel formats in
  580. input, and accepts the options:
  581. @table @option
  582. @var{c0} (first pixel component)
  583. @var{c1} (second pixel component)
  584. @var{c2} (third pixel component)
  585. @var{c3} (fourth pixel component, corresponds to the alpha component)
  586. @end table
  587. The exact component associated to each option depends on the format in
  588. input.
  589. The @var{lutrgb} filter requires RGB pixel formats in input, and
  590. accepts the options:
  591. @table @option
  592. @var{r} (red component)
  593. @var{g} (green component)
  594. @var{b} (blue component)
  595. @var{a} (alpha component)
  596. @end table
  597. The @var{lutyuv} filter requires YUV pixel formats in input, and
  598. accepts the options:
  599. @table @option
  600. @var{y} (Y/luminance component)
  601. @var{u} (U/Cb component)
  602. @var{v} (V/Cr component)
  603. @var{a} (alpha component)
  604. @end table
  605. The expressions can contain the following constants and functions:
  606. @table @option
  607. @item E, PI, PHI
  608. the corresponding mathematical approximated values for e
  609. (euler number), pi (greek PI), PHI (golden ratio)
  610. @item w, h
  611. the input width and heigth
  612. @item val
  613. input value for the pixel component
  614. @item clipval
  615. the input value clipped in the @var{minval}-@var{maxval} range
  616. @item maxval
  617. maximum value for the pixel component
  618. @item minval
  619. minimum value for the pixel component
  620. @item negval
  621. the negated value for the pixel component value clipped in the
  622. @var{minval}-@var{maxval} range , it corresponds to the expression
  623. "maxval-clipval+minval"
  624. @item clip(val)
  625. the computed value in @var{val} clipped in the
  626. @var{minval}-@var{maxval} range
  627. @item gammaval(gamma)
  628. the computed gamma correction value of the pixel component value
  629. clipped in the @var{minval}-@var{maxval} range, corresponds to the
  630. expression
  631. "pow((clipval-minval)/(maxval-minval)\,@var{gamma})*(maxval-minval)+minval"
  632. @end table
  633. All expressions default to "val".
  634. Some examples follow:
  635. @example
  636. # negate input video
  637. lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
  638. lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
  639. # the above is the same as
  640. lutrgb="r=negval:g=negval:b=negval"
  641. lutyuv="y=negval:u=negval:v=negval"
  642. # negate luminance
  643. lutyuv=negval
  644. # remove chroma components, turns the video into a graytone image
  645. lutyuv="u=128:v=128"
  646. # apply a luma burning effect
  647. lutyuv="y=2*val"
  648. # remove green and blue components
  649. lutrgb="g=0:b=0"
  650. # set a constant alpha channel value on input
  651. format=rgba,lutrgb=a="maxval-minval/2"
  652. # correct luminance gamma by a 0.5 factor
  653. lutyuv=y=gammaval(0.5)
  654. @end example
  655. @section mp
  656. Apply an MPlayer filter to the input video.
  657. This filter provides a wrapper around most of the filters of
  658. MPlayer/MEncoder.
  659. This wrapper is considered experimental. Some of the wrapped filters
  660. may not work properly and we may drop support for them, as they will
  661. be implemented natively into FFmpeg. Thus you should avoid
  662. depending on them when writing portable scripts.
  663. The filters accepts the parameters:
  664. @var{filter_name}[:=]@var{filter_params}
  665. @var{filter_name} is the name of a supported MPlayer filter,
  666. @var{filter_params} is a string containing the parameters accepted by
  667. the named filter.
  668. The list of the currently supported filters follows:
  669. @table @var
  670. @item 2xsai
  671. @item decimate
  672. @item delogo
  673. @item denoise3d
  674. @item detc
  675. @item dint
  676. @item divtc
  677. @item down3dright
  678. @item dsize
  679. @item eq2
  680. @item eq
  681. @item field
  682. @item fil
  683. @item fixpts
  684. @item framestep
  685. @item fspp
  686. @item geq
  687. @item gradfun
  688. @item harddup
  689. @item hqdn3d
  690. @item hue
  691. @item il
  692. @item ilpack
  693. @item ivtc
  694. @item kerndeint
  695. @item mcdeint
  696. @item mirror
  697. @item noise
  698. @item ow
  699. @item palette
  700. @item perspective
  701. @item phase
  702. @item pp7
  703. @item pullup
  704. @item qp
  705. @item rectangle
  706. @item remove-logo
  707. @item rotate
  708. @item sab
  709. @item screenshot
  710. @item smartblur
  711. @item softpulldown
  712. @item softskip
  713. @item spp
  714. @item swapuv
  715. @item telecine
  716. @item test
  717. @item tile
  718. @item tinterlace
  719. @item unsharp
  720. @item uspp
  721. @item yuvcsp
  722. @item yvu9
  723. @end table
  724. The parameter syntax and behavior for the listed filters are the same
  725. of the corresponding MPlayer filters. For detailed instructions check
  726. the "VIDEO FILTERS" section in the MPlayer manual.
  727. Some examples follow:
  728. @example
  729. # remove a logo by interpolating the surrounding pixels
  730. mp=delogo=200:200:80:20:1
  731. # adjust gamma, brightness, contrast
  732. mp=eq2=1.0:2:0.5
  733. # tweak hue and saturation
  734. mp=hue=100:-10
  735. @end example
  736. See also mplayer(1), @url{http://www.mplayerhq.hu/}.
  737. @section negate
  738. Negate input video.
  739. This filter accepts an integer in input, if non-zero it negates the
  740. alpha component (if available). The default value in input is 0.
  741. @section noformat
  742. Force libavfilter not to use any of the specified pixel formats for the
  743. input to the next filter.
  744. The filter accepts a list of pixel format names, separated by ":",
  745. for example "yuv420p:monow:rgb24".
  746. Some examples follow:
  747. @example
  748. # force libavfilter to use a format different from "yuv420p" for the
  749. # input to the vflip filter
  750. noformat=yuv420p,vflip
  751. # convert the input video to any of the formats not contained in the list
  752. noformat=yuv420p:yuv444p:yuv410p
  753. @end example
  754. @section null
  755. Pass the video source unchanged to the output.
  756. @section ocv
  757. Apply video transform using libopencv.
  758. To enable this filter install libopencv library and headers and
  759. configure FFmpeg with --enable-libopencv.
  760. The filter takes the parameters: @var{filter_name}@{:=@}@var{filter_params}.
  761. @var{filter_name} is the name of the libopencv filter to apply.
  762. @var{filter_params} specifies the parameters to pass to the libopencv
  763. filter. If not specified the default values are assumed.
  764. Refer to the official libopencv documentation for more precise
  765. informations:
  766. @url{http://opencv.willowgarage.com/documentation/c/image_filtering.html}
  767. Follows the list of supported libopencv filters.
  768. @anchor{dilate}
  769. @subsection dilate
  770. Dilate an image by using a specific structuring element.
  771. This filter corresponds to the libopencv function @code{cvDilate}.
  772. It accepts the parameters: @var{struct_el}:@var{nb_iterations}.
  773. @var{struct_el} represents a structuring element, and has the syntax:
  774. @var{cols}x@var{rows}+@var{anchor_x}x@var{anchor_y}/@var{shape}
  775. @var{cols} and @var{rows} represent the number of colums and rows of
  776. the structuring element, @var{anchor_x} and @var{anchor_y} the anchor
  777. point, and @var{shape} the shape for the structuring element, and
  778. can be one of the values "rect", "cross", "ellipse", "custom".
  779. If the value for @var{shape} is "custom", it must be followed by a
  780. string of the form "=@var{filename}". The file with name
  781. @var{filename} is assumed to represent a binary image, with each
  782. printable character corresponding to a bright pixel. When a custom
  783. @var{shape} is used, @var{cols} and @var{rows} are ignored, the number
  784. or columns and rows of the read file are assumed instead.
  785. The default value for @var{struct_el} is "3x3+0x0/rect".
  786. @var{nb_iterations} specifies the number of times the transform is
  787. applied to the image, and defaults to 1.
  788. Follow some example:
  789. @example
  790. # use the default values
  791. ocv=dilate
  792. # dilate using a structuring element with a 5x5 cross, iterate two times
  793. ocv=dilate=5x5+2x2/cross:2
  794. # read the shape from the file diamond.shape, iterate two times
  795. # the file diamond.shape may contain a pattern of characters like this:
  796. # *
  797. # ***
  798. # *****
  799. # ***
  800. # *
  801. # the specified cols and rows are ignored (but not the anchor point coordinates)
  802. ocv=0x0+2x2/custom=diamond.shape:2
  803. @end example
  804. @subsection erode
  805. Erode an image by using a specific structuring element.
  806. This filter corresponds to the libopencv function @code{cvErode}.
  807. The filter accepts the parameters: @var{struct_el}:@var{nb_iterations},
  808. with the same syntax and semantics as the @ref{dilate} filter.
  809. @subsection smooth
  810. Smooth the input video.
  811. The filter takes the following parameters:
  812. @var{type}:@var{param1}:@var{param2}:@var{param3}:@var{param4}.
  813. @var{type} is the type of smooth filter to apply, and can be one of
  814. the following values: "blur", "blur_no_scale", "median", "gaussian",
  815. "bilateral". The default value is "gaussian".
  816. @var{param1}, @var{param2}, @var{param3}, and @var{param4} are
  817. parameters whose meanings depend on smooth type. @var{param1} and
  818. @var{param2} accept integer positive values or 0, @var{param3} and
  819. @var{param4} accept float values.
  820. The default value for @var{param1} is 3, the default value for the
  821. other parameters is 0.
  822. These parameters correspond to the parameters assigned to the
  823. libopencv function @code{cvSmooth}.
  824. @section overlay
  825. Overlay one video on top of another.
  826. It takes two inputs and one output, the first input is the "main"
  827. video on which the second input is overlayed.
  828. It accepts the parameters: @var{x}:@var{y}.
  829. @var{x} is the x coordinate of the overlayed video on the main video,
  830. @var{y} is the y coordinate. The parameters are expressions containing
  831. the following parameters:
  832. @table @option
  833. @item main_w, main_h
  834. main input width and height
  835. @item W, H
  836. same as @var{main_w} and @var{main_h}
  837. @item overlay_w, overlay_h
  838. overlay input width and height
  839. @item w, h
  840. same as @var{overlay_w} and @var{overlay_h}
  841. @end table
  842. Be aware that frames are taken from each input video in timestamp
  843. order, hence, if their initial timestamps differ, it is a a good idea
  844. to pass the two inputs through a @var{setpts=PTS-STARTPTS} filter to
  845. have them begin in the same zero timestamp, as it does the example for
  846. the @var{movie} filter.
  847. Follow some examples:
  848. @example
  849. # draw the overlay at 10 pixels from the bottom right
  850. # corner of the main video.
  851. overlay=main_w-overlay_w-10:main_h-overlay_h-10
  852. # insert a transparent PNG logo in the bottom left corner of the input
  853. movie=logo.png [logo];
  854. [in][logo] overlay=10:main_h-overlay_h-10 [out]
  855. # insert 2 different transparent PNG logos (second logo on bottom
  856. # right corner):
  857. movie=logo1.png [logo1];
  858. movie=logo2.png [logo2];
  859. [in][logo1] overlay=10:H-h-10 [in+logo1];
  860. [in+logo1][logo2] overlay=W-w-10:H-h-10 [out]
  861. # add a transparent color layer on top of the main video,
  862. # WxH specifies the size of the main input to the overlay filter
  863. color=red@.3:WxH [over]; [in][over] overlay [out]
  864. @end example
  865. You can chain togheter more overlays but the efficiency of such
  866. approach is yet to be tested.
  867. @section pad
  868. Add paddings to the input image, and places the original input at the
  869. given coordinates @var{x}, @var{y}.
  870. It accepts the following parameters:
  871. @var{width}:@var{height}:@var{x}:@var{y}:@var{color}.
  872. The parameters @var{width}, @var{height}, @var{x}, and @var{y} are
  873. expressions containing the following constants:
  874. @table @option
  875. @item E, PI, PHI
  876. the corresponding mathematical approximated values for e
  877. (euler number), pi (greek PI), phi (golden ratio)
  878. @item in_w, in_h
  879. the input video width and heigth
  880. @item iw, ih
  881. same as @var{in_w} and @var{in_h}
  882. @item out_w, out_h
  883. the output width and heigth, that is the size of the padded area as
  884. specified by the @var{width} and @var{height} expressions
  885. @item ow, oh
  886. same as @var{out_w} and @var{out_h}
  887. @item x, y
  888. x and y offsets as specified by the @var{x} and @var{y}
  889. expressions, or NAN if not yet specified
  890. @item a
  891. same as @var{iw} / @var{ih}
  892. @item sar
  893. input sample aspect ratio
  894. @item dar
  895. input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
  896. @item hsub, vsub
  897. horizontal and vertical chroma subsample values. For example for the
  898. pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
  899. @end table
  900. Follows the description of the accepted parameters.
  901. @table @option
  902. @item width, height
  903. Specify the size of the output image with the paddings added. If the
  904. value for @var{width} or @var{height} is 0, the corresponding input size
  905. is used for the output.
  906. The @var{width} expression can reference the value set by the
  907. @var{height} expression, and viceversa.
  908. The default value of @var{width} and @var{height} is 0.
  909. @item x, y
  910. Specify the offsets where to place the input image in the padded area
  911. with respect to the top/left border of the output image.
  912. The @var{x} expression can reference the value set by the @var{y}
  913. expression, and viceversa.
  914. The default value of @var{x} and @var{y} is 0.
  915. @item color
  916. Specify the color of the padded area, it can be the name of a color
  917. (case insensitive match) or a 0xRRGGBB[AA] sequence.
  918. The default value of @var{color} is "black".
  919. @end table
  920. Some examples follow:
  921. @example
  922. # Add paddings with color "violet" to the input video. Output video
  923. # size is 640x480, the top-left corner of the input video is placed at
  924. # column 0, row 40.
  925. pad=640:480:0:40:violet
  926. # pad the input to get an output with dimensions increased bt 3/2,
  927. # and put the input video at the center of the padded area
  928. pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
  929. # pad the input to get a squared output with size equal to the maximum
  930. # value between the input width and height, and put the input video at
  931. # the center of the padded area
  932. pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
  933. # pad the input to get a final w/h ratio of 16:9
  934. pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
  935. # for anamorphic video, in order to set the output display aspect ratio,
  936. # it is necessary to use sar in the expression, according to the relation:
  937. # (ih * X / ih) * sar = output_dar
  938. # X = output_dar / sar
  939. pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2"
  940. # double output size and put the input video in the bottom-right
  941. # corner of the output padded area
  942. pad="2*iw:2*ih:ow-iw:oh-ih"
  943. @end example
  944. @section pixdesctest
  945. Pixel format descriptor test filter, mainly useful for internal
  946. testing. The output video should be equal to the input video.
  947. For example:
  948. @example
  949. format=monow, pixdesctest
  950. @end example
  951. can be used to test the monowhite pixel format descriptor definition.
  952. @section scale
  953. Scale the input video to @var{width}:@var{height} and/or convert the image format.
  954. The parameters @var{width} and @var{height} are expressions containing
  955. the following constants:
  956. @table @option
  957. @item E, PI, PHI
  958. the corresponding mathematical approximated values for e
  959. (euler number), pi (greek PI), phi (golden ratio)
  960. @item in_w, in_h
  961. the input width and heigth
  962. @item iw, ih
  963. same as @var{in_w} and @var{in_h}
  964. @item out_w, out_h
  965. the output (cropped) width and heigth
  966. @item ow, oh
  967. same as @var{out_w} and @var{out_h}
  968. @item a
  969. same as @var{iw} / @var{ih}
  970. @item sar
  971. input sample aspect ratio
  972. @item dar
  973. input display aspect ratio, it is the same as (@var{iw} / @var{ih}) * @var{sar}
  974. @item hsub, vsub
  975. horizontal and vertical chroma subsample values. For example for the
  976. pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
  977. @end table
  978. If the input image format is different from the format requested by
  979. the next filter, the scale filter will convert the input to the
  980. requested format.
  981. If the value for @var{width} or @var{height} is 0, the respective input
  982. size is used for the output.
  983. If the value for @var{width} or @var{height} is -1, the scale filter will
  984. use, for the respective output size, a value that maintains the aspect
  985. ratio of the input image.
  986. The default value of @var{width} and @var{height} is 0.
  987. Some examples follow:
  988. @example
  989. # scale the input video to a size of 200x100.
  990. scale=200:100
  991. # scale the input to 2x
  992. scale=2*iw:2*ih
  993. # the above is the same as
  994. scale=2*in_w:2*in_h
  995. # scale the input to half size
  996. scale=iw/2:ih/2
  997. # increase the width, and set the height to the same size
  998. scale=3/2*iw:ow
  999. # seek for Greek harmony
  1000. scale=iw:1/PHI*iw
  1001. scale=ih*PHI:ih
  1002. # increase the height, and set the width to 3/2 of the height
  1003. scale=3/2*oh:3/5*ih
  1004. # increase the size, but make the size a multiple of the chroma
  1005. scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
  1006. # increase the width to a maximum of 500 pixels, keep the same input aspect ratio
  1007. scale='min(500\, iw*3/2):-1'
  1008. @end example
  1009. @section select
  1010. Select frames to pass in output.
  1011. It accepts in input an expression, which is evaluated for each input
  1012. frame. If the expression is evaluated to a non-zero value, the frame
  1013. is selected and passed to the output, otherwise it is discarded.
  1014. The expression can contain the following constants:
  1015. @table @option
  1016. @item PI
  1017. Greek PI
  1018. @item PHI
  1019. golden ratio
  1020. @item E
  1021. Euler number
  1022. @item n
  1023. the sequential number of the filtered frame, starting from 0
  1024. @item selected_n
  1025. the sequential number of the selected frame, starting from 0
  1026. @item prev_selected_n
  1027. the sequential number of the last selected frame, NAN if undefined
  1028. @item TB
  1029. timebase of the input timestamps
  1030. @item pts
  1031. the PTS (Presentation TimeStamp) of the filtered video frame,
  1032. expressed in @var{TB} units, NAN if undefined
  1033. @item t
  1034. the PTS (Presentation TimeStamp) of the filtered video frame,
  1035. expressed in seconds, NAN if undefined
  1036. @item prev_pts
  1037. the PTS of the previously filtered video frame, NAN if undefined
  1038. @item prev_selected_pts
  1039. the PTS of the last previously filtered video frame, NAN if undefined
  1040. @item prev_selected_t
  1041. the PTS of the last previously selected video frame, NAN if undefined
  1042. @item start_pts
  1043. the PTS of the first video frame in the video, NAN if undefined
  1044. @item start_t
  1045. the time of the first video frame in the video, NAN if undefined
  1046. @item pict_type
  1047. the picture type of the filtered frame, can assume one of the following
  1048. values:
  1049. @table @option
  1050. @item PICT_TYPE_I
  1051. @item PICT_TYPE_P
  1052. @item PICT_TYPE_B
  1053. @item PICT_TYPE_S
  1054. @item PICT_TYPE_SI
  1055. @item PICT_TYPE_SP
  1056. @item PICT_TYPE_BI
  1057. @end table
  1058. @item interlace_type
  1059. the frame interlace type, can assume one of the following values:
  1060. @table @option
  1061. @item INTERLACE_TYPE_P
  1062. the frame is progressive (not interlaced)
  1063. @item INTERLACE_TYPE_T
  1064. the frame is top-field-first
  1065. @item INTERLACE_TYPE_B
  1066. the frame is bottom-field-first
  1067. @end table
  1068. @item key
  1069. 1 if the filtered frame is a key-frame, 0 otherwise
  1070. @item pos
  1071. the position in the file of the filtered frame, -1 if the information
  1072. is not available (e.g. for synthetic video)
  1073. @end table
  1074. The default value of the select expression is "1".
  1075. Some examples follow:
  1076. @example
  1077. # select all frames in input
  1078. select
  1079. # the above is the same as:
  1080. select=1
  1081. # skip all frames:
  1082. select=0
  1083. # select only I-frames
  1084. select='eq(pict_type\,PICT_TYPE_I)'
  1085. # select one frame every 100
  1086. select='not(mod(n\,100))'
  1087. # select only frames contained in the 10-20 time interval
  1088. select='gte(t\,10)*lte(t\,20)'
  1089. # select only I frames contained in the 10-20 time interval
  1090. select='gte(t\,10)*lte(t\,20)*eq(pict_type\,PICT_TYPE_I)'
  1091. # select frames with a minimum distance of 10 seconds
  1092. select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
  1093. @end example
  1094. @anchor{setdar}
  1095. @section setdar
  1096. Set the Display Aspect Ratio for the filter output video.
  1097. This is done by changing the specified Sample (aka Pixel) Aspect
  1098. Ratio, according to the following equation:
  1099. @math{DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR}
  1100. Keep in mind that this filter does not modify the pixel dimensions of
  1101. the video frame. Also the display aspect ratio set by this filter may
  1102. be changed by later filters in the filterchain, e.g. in case of
  1103. scaling or if another "setdar" or a "setsar" filter is applied.
  1104. The filter accepts a parameter string which represents the wanted
  1105. display aspect ratio.
  1106. The parameter can be a floating point number string, or an expression
  1107. of the form @var{num}:@var{den}, where @var{num} and @var{den} are the
  1108. numerator and denominator of the aspect ratio.
  1109. If the parameter is not specified, it is assumed the value "0:1".
  1110. For example to change the display aspect ratio to 16:9, specify:
  1111. @example
  1112. setdar=16:9
  1113. # the above is equivalent to
  1114. setdar=1.77777
  1115. @end example
  1116. See also the @ref{setsar} filter documentation.
  1117. @section setpts
  1118. Change the PTS (presentation timestamp) of the input video frames.
  1119. Accept in input an expression evaluated through the eval API, which
  1120. can contain the following constants:
  1121. @table @option
  1122. @item PTS
  1123. the presentation timestamp in input
  1124. @item PI
  1125. Greek PI
  1126. @item PHI
  1127. golden ratio
  1128. @item E
  1129. Euler number
  1130. @item N
  1131. the count of the input frame, starting from 0.
  1132. @item STARTPTS
  1133. the PTS of the first video frame
  1134. @item INTERLACED
  1135. tell if the current frame is interlaced
  1136. @item POS
  1137. original position in the file of the frame, or undefined if undefined
  1138. for the current frame
  1139. @item PREV_INPTS
  1140. previous input PTS
  1141. @item PREV_OUTPTS
  1142. previous output PTS
  1143. @end table
  1144. Some examples follow:
  1145. @example
  1146. # start counting PTS from zero
  1147. setpts=PTS-STARTPTS
  1148. # fast motion
  1149. setpts=0.5*PTS
  1150. # slow motion
  1151. setpts=2.0*PTS
  1152. # fixed rate 25 fps
  1153. setpts=N/(25*TB)
  1154. # fixed rate 25 fps with some jitter
  1155. setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
  1156. @end example
  1157. @anchor{setsar}
  1158. @section setsar
  1159. Set the Sample (aka Pixel) Aspect Ratio for the filter output video.
  1160. Note that as a consequence of the application of this filter, the
  1161. output display aspect ratio will change according to the following
  1162. equation:
  1163. @math{DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR}
  1164. Keep in mind that the sample aspect ratio set by this filter may be
  1165. changed by later filters in the filterchain, e.g. if another "setsar"
  1166. or a "setdar" filter is applied.
  1167. The filter accepts a parameter string which represents the wanted
  1168. sample aspect ratio.
  1169. The parameter can be a floating point number string, or an expression
  1170. of the form @var{num}:@var{den}, where @var{num} and @var{den} are the
  1171. numerator and denominator of the aspect ratio.
  1172. If the parameter is not specified, it is assumed the value "0:1".
  1173. For example to change the sample aspect ratio to 10:11, specify:
  1174. @example
  1175. setsar=10:11
  1176. @end example
  1177. @section settb
  1178. Set the timebase to use for the output frames timestamps.
  1179. It is mainly useful for testing timebase configuration.
  1180. It accepts in input an arithmetic expression representing a rational.
  1181. The expression can contain the constants "PI", "E", "PHI", "AVTB" (the
  1182. default timebase), and "intb" (the input timebase).
  1183. The default value for the input is "intb".
  1184. Follow some examples.
  1185. @example
  1186. # set the timebase to 1/25
  1187. settb=1/25
  1188. # set the timebase to 1/10
  1189. settb=0.1
  1190. #set the timebase to 1001/1000
  1191. settb=1+0.001
  1192. #set the timebase to 2*intb
  1193. settb=2*intb
  1194. #set the default timebase value
  1195. settb=AVTB
  1196. @end example
  1197. @section showinfo
  1198. Show a line containing various information for each input video frame.
  1199. The input video is not modified.
  1200. The shown line contains a sequence of key/value pairs of the form
  1201. @var{key}:@var{value}.
  1202. A description of each shown parameter follows:
  1203. @table @option
  1204. @item n
  1205. sequential number of the input frame, starting from 0
  1206. @item pts
  1207. Presentation TimeStamp of the input frame, expressed as a number of
  1208. time base units. The time base unit depends on the filter input pad.
  1209. @item pts_time
  1210. Presentation TimeStamp of the input frame, expressed as a number of
  1211. seconds
  1212. @item pos
  1213. position of the frame in the input stream, -1 if this information in
  1214. unavailable and/or meanigless (for example in case of synthetic video)
  1215. @item fmt
  1216. pixel format name
  1217. @item sar
  1218. sample aspect ratio of the input frame, expressed in the form
  1219. @var{num}/@var{den}
  1220. @item s
  1221. size of the input frame, expressed in the form
  1222. @var{width}x@var{height}
  1223. @item i
  1224. interlaced mode ("P" for "progressive", "T" for top field first, "B"
  1225. for bottom field first)
  1226. @item iskey
  1227. 1 if the frame is a key frame, 0 otherwise
  1228. @item type
  1229. picture type of the input frame ("I" for an I-frame, "P" for a
  1230. P-frame, "B" for a B-frame, "?" for unknown type).
  1231. Check also the documentation of the @code{AVPictureType} enum and of
  1232. the @code{av_get_picture_type_char} function defined in
  1233. @file{libavutil/avutil.h}.
  1234. @item checksum
  1235. Adler-32 checksum of all the planes of the input frame
  1236. @item plane_checksum
  1237. Adler-32 checksum of each plane of the input frame, expressed in the form
  1238. "[@var{c0} @var{c1} @var{c2} @var{c3}]"
  1239. @end table
  1240. @section slicify
  1241. Pass the images of input video on to next video filter as multiple
  1242. slices.
  1243. @example
  1244. ./ffmpeg -i in.avi -vf "slicify=32" out.avi
  1245. @end example
  1246. The filter accepts the slice height as parameter. If the parameter is
  1247. not specified it will use the default value of 16.
  1248. Adding this in the beginning of filter chains should make filtering
  1249. faster due to better use of the memory cache.
  1250. @section split
  1251. Pass on the input video to two outputs. Both outputs are identical to
  1252. the input video.
  1253. For example:
  1254. @example
  1255. [in] split [splitout1][splitout2];
  1256. [splitout1] crop=100:100:0:0 [cropout];
  1257. [splitout2] pad=200:200:100:100 [padout];
  1258. @end example
  1259. will create two separate outputs from the same input, one cropped and
  1260. one padded.
  1261. @section transpose
  1262. Transpose rows with columns in the input video and optionally flip it.
  1263. It accepts a parameter representing an integer, which can assume the
  1264. values:
  1265. @table @samp
  1266. @item 0
  1267. Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
  1268. @example
  1269. L.R L.l
  1270. . . -> . .
  1271. l.r R.r
  1272. @end example
  1273. @item 1
  1274. Rotate by 90 degrees clockwise, that is:
  1275. @example
  1276. L.R l.L
  1277. . . -> . .
  1278. l.r r.R
  1279. @end example
  1280. @item 2
  1281. Rotate by 90 degrees counterclockwise, that is:
  1282. @example
  1283. L.R R.r
  1284. . . -> . .
  1285. l.r L.l
  1286. @end example
  1287. @item 3
  1288. Rotate by 90 degrees clockwise and vertically flip, that is:
  1289. @example
  1290. L.R r.R
  1291. . . -> . .
  1292. l.r l.L
  1293. @end example
  1294. @end table
  1295. @section unsharp
  1296. Sharpen or blur the input video.
  1297. It accepts the following parameters:
  1298. @var{luma_msize_x}:@var{luma_msize_y}:@var{luma_amount}:@var{chroma_msize_x}:@var{chroma_msize_y}:@var{chroma_amount}
  1299. Negative values for the amount will blur the input video, while positive
  1300. values will sharpen. All parameters are optional and default to the
  1301. equivalent of the string '5:5:1.0:5:5:0.0'.
  1302. @table @option
  1303. @item luma_msize_x
  1304. Set the luma matrix horizontal size. It can be an integer between 3
  1305. and 13, default value is 5.
  1306. @item luma_msize_y
  1307. Set the luma matrix vertical size. It can be an integer between 3
  1308. and 13, default value is 5.
  1309. @item luma_amount
  1310. Set the luma effect strength. It can be a float number between -2.0
  1311. and 5.0, default value is 1.0.
  1312. @item chroma_msize_x
  1313. Set the chroma matrix horizontal size. It can be an integer between 3
  1314. and 13, default value is 5.
  1315. @item chroma_msize_y
  1316. Set the chroma matrix vertical size. It can be an integer between 3
  1317. and 13, default value is 5.
  1318. @item luma_amount
  1319. Set the chroma effect strength. It can be a float number between -2.0
  1320. and 5.0, default value is 0.0.
  1321. @end table
  1322. @example
  1323. # Strong luma sharpen effect parameters
  1324. unsharp=7:7:2.5
  1325. # Strong blur of both luma and chroma parameters
  1326. unsharp=7:7:-2:7:7:-2
  1327. # Use the default values with @command{ffmpeg}
  1328. ./ffmpeg -i in.avi -vf "unsharp" out.mp4
  1329. @end example
  1330. @section vflip
  1331. Flip the input video vertically.
  1332. @example
  1333. ./ffmpeg -i in.avi -vf "vflip" out.avi
  1334. @end example
  1335. @section yadif
  1336. Deinterlace the input video ("yadif" means "yet another deinterlacing
  1337. filter").
  1338. It accepts the optional parameters: @var{mode}:@var{parity}:@var{auto}.
  1339. @var{mode} specifies the interlacing mode to adopt, accepts one of the
  1340. following values:
  1341. @table @option
  1342. @item 0
  1343. output 1 frame for each frame
  1344. @item 1
  1345. output 1 frame for each field
  1346. @item 2
  1347. like 0 but skips spatial interlacing check
  1348. @item 3
  1349. like 1 but skips spatial interlacing check
  1350. @end table
  1351. Default value is 0.
  1352. @var{parity} specifies the picture field parity assumed for the input
  1353. interlaced video, accepts one of the following values:
  1354. @table @option
  1355. @item 0
  1356. assume top field first
  1357. @item 1
  1358. assume bottom field first
  1359. @item -1
  1360. enable automatic detection
  1361. @end table
  1362. Default value is -1.
  1363. If interlacing is unknown or decoder does not export this information,
  1364. top field first will be assumed.
  1365. @var{auto} specifies if deinterlacer should trust the interlaced flag
  1366. and only deinterlace frames marked as interlaced
  1367. @table @option
  1368. @item 0
  1369. deinterlace all frames
  1370. @item 1
  1371. only deinterlace frames marked as interlaced
  1372. @end table
  1373. Default value is 0.
  1374. @c man end VIDEO FILTERS
  1375. @chapter Video Sources
  1376. @c man begin VIDEO SOURCES
  1377. Below is a description of the currently available video sources.
  1378. @section buffer
  1379. Buffer video frames, and make them available to the filter chain.
  1380. This source is mainly intended for a programmatic use, in particular
  1381. through the interface defined in @file{libavfilter/vsrc_buffer.h}.
  1382. It accepts the following parameters:
  1383. @var{width}:@var{height}:@var{pix_fmt_string}:@var{timebase_num}:@var{timebase_den}:@var{sample_aspect_ratio_num}:@var{sample_aspect_ratio.den}:@var{scale_params}
  1384. All the parameters but @var{scale_params} need to be explicitely
  1385. defined.
  1386. Follows the list of the accepted parameters.
  1387. @table @option
  1388. @item width, height
  1389. Specify the width and height of the buffered video frames.
  1390. @item pix_fmt_string
  1391. A string representing the pixel format of the buffered video frames.
  1392. It may be a number corresponding to a pixel format, or a pixel format
  1393. name.
  1394. @item timebase_num, timebase_den
  1395. Specify numerator and denomitor of the timebase assumed by the
  1396. timestamps of the buffered frames.
  1397. @item sample_aspect_ratio.num, sample_aspect_ratio.den
  1398. Specify numerator and denominator of the sample aspect ratio assumed
  1399. by the video frames.
  1400. @item scale_params
  1401. Specify the optional parameters to be used for the scale filter which
  1402. is automatically inserted when an input change is detected in the
  1403. input size or format.
  1404. @end table
  1405. For example:
  1406. @example
  1407. buffer=320:240:yuv410p:1:24:1:1
  1408. @end example
  1409. will instruct the source to accept video frames with size 320x240 and
  1410. with format "yuv410p", assuming 1/24 as the timestamps timebase and
  1411. square pixels (1:1 sample aspect ratio).
  1412. Since the pixel format with name "yuv410p" corresponds to the number 6
  1413. (check the enum PixelFormat definition in @file{libavutil/pixfmt.h}),
  1414. this example corresponds to:
  1415. @example
  1416. buffer=320:240:6:1:24:1:1
  1417. @end example
  1418. @section color
  1419. Provide an uniformly colored input.
  1420. It accepts the following parameters:
  1421. @var{color}:@var{frame_size}:@var{frame_rate}
  1422. Follows the description of the accepted parameters.
  1423. @table @option
  1424. @item color
  1425. Specify the color of the source. It can be the name of a color (case
  1426. insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an
  1427. alpha specifier. The default value is "black".
  1428. @item frame_size
  1429. Specify the size of the sourced video, it may be a string of the form
  1430. @var{width}x@var{heigth}, or the name of a size abbreviation. The
  1431. default value is "320x240".
  1432. @item frame_rate
  1433. Specify the frame rate of the sourced video, as the number of frames
  1434. generated per second. It has to be a string in the format
  1435. @var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
  1436. number or a valid video frame rate abbreviation. The default value is
  1437. "25".
  1438. @end table
  1439. For example the following graph description will generate a red source
  1440. with an opacity of 0.2, with size "qcif" and a frame rate of 10
  1441. frames per second, which will be overlayed over the source connected
  1442. to the pad with identifier "in".
  1443. @example
  1444. "color=red@@0.2:qcif:10 [color]; [in][color] overlay [out]"
  1445. @end example
  1446. @section movie
  1447. Read a video stream from a movie container.
  1448. It accepts the syntax: @var{movie_name}[:@var{options}] where
  1449. @var{movie_name} is the name of the resource to read (not necessarily
  1450. a file but also a device or a stream accessed through some protocol),
  1451. and @var{options} is an optional sequence of @var{key}=@var{value}
  1452. pairs, separated by ":".
  1453. The description of the accepted options follows.
  1454. @table @option
  1455. @item format_name, f
  1456. Specifies the format assumed for the movie to read, and can be either
  1457. the name of a container or an input device. If not specified the
  1458. format is guessed from @var{movie_name} or by probing.
  1459. @item seek_point, sp
  1460. Specifies the seek point in seconds, the frames will be output
  1461. starting from this seek point, the parameter is evaluated with
  1462. @code{av_strtod} so the numerical value may be suffixed by an IS
  1463. postfix. Default value is "0".
  1464. @item stream_index, si
  1465. Specifies the index of the video stream to read. If the value is -1,
  1466. the best suited video stream will be automatically selected. Default
  1467. value is "-1".
  1468. @end table
  1469. This filter allows to overlay a second video on top of main input of
  1470. a filtergraph as shown in this graph:
  1471. @example
  1472. input -----------> deltapts0 --> overlay --> output
  1473. ^
  1474. |
  1475. movie --> scale--> deltapts1 -------+
  1476. @end example
  1477. Some examples follow:
  1478. @example
  1479. # skip 3.2 seconds from the start of the avi file in.avi, and overlay it
  1480. # on top of the input labelled as "in".
  1481. movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
  1482. [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
  1483. # read from a video4linux2 device, and overlay it on top of the input
  1484. # labelled as "in"
  1485. movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
  1486. [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
  1487. @end example
  1488. @section nullsrc
  1489. Null video source, never return images. It is mainly useful as a
  1490. template and to be employed in analysis / debugging tools.
  1491. It accepts as optional parameter a string of the form
  1492. @var{width}:@var{height}:@var{timebase}.
  1493. @var{width} and @var{height} specify the size of the configured
  1494. source. The default values of @var{width} and @var{height} are
  1495. respectively 352 and 288 (corresponding to the CIF size format).
  1496. @var{timebase} specifies an arithmetic expression representing a
  1497. timebase. The expression can contain the constants "PI", "E", "PHI",
  1498. "AVTB" (the default timebase), and defaults to the value "AVTB".
  1499. @section frei0r_src
  1500. Provide a frei0r source.
  1501. To enable compilation of this filter you need to install the frei0r
  1502. header and configure FFmpeg with --enable-frei0r.
  1503. The source supports the syntax:
  1504. @example
  1505. @var{size}:@var{rate}:@var{src_name}[@{=|:@}@var{param1}:@var{param2}:...:@var{paramN}]
  1506. @end example
  1507. @var{size} is the size of the video to generate, may be a string of the
  1508. form @var{width}x@var{height} or a frame size abbreviation.
  1509. @var{rate} is the rate of the video to generate, may be a string of
  1510. the form @var{num}/@var{den} or a frame rate abbreviation.
  1511. @var{src_name} is the name to the frei0r source to load. For more
  1512. information regarding frei0r and how to set the parameters read the
  1513. section @ref{frei0r} in the description of the video filters.
  1514. Some examples follow:
  1515. @example
  1516. # generate a frei0r partik0l source with size 200x200 and framerate 10
  1517. # which is overlayed on the overlay filter main input
  1518. frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay
  1519. @end example
  1520. @section rgbtestsrc, testsrc
  1521. The @code{rgbtestsrc} source generates an RGB test pattern useful for
  1522. detecting RGB vs BGR issues. You should see a red, green and blue
  1523. stripe from top to bottom.
  1524. The @code{testsrc} source generates a test video pattern, showing a
  1525. color pattern, a scrolling gradient and a timestamp. This is mainly
  1526. intended for testing purposes.
  1527. Both sources accept an optional sequence of @var{key}=@var{value} pairs,
  1528. separated by ":". The description of the accepted options follows.
  1529. @table @option
  1530. @item size, s
  1531. Specify the size of the sourced video, it may be a string of the form
  1532. @var{width}x@var{heigth}, or the name of a size abbreviation. The
  1533. default value is "320x240".
  1534. @item rate, r
  1535. Specify the frame rate of the sourced video, as the number of frames
  1536. generated per second. It has to be a string in the format
  1537. @var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
  1538. number or a valid video frame rate abbreviation. The default value is
  1539. "25".
  1540. @item duration
  1541. Set the video duration of the sourced video. The accepted syntax is:
  1542. @example
  1543. [-]HH[:MM[:SS[.m...]]]
  1544. [-]S+[.m...]
  1545. @end example
  1546. See also the function @code{av_parse_time()}.
  1547. If not specified, or the expressed duration is negative, the video is
  1548. supposed to be generated forever.
  1549. @end table
  1550. For example the following:
  1551. @example
  1552. testsrc=duration=5.3:size=qcif:rate=10
  1553. @end example
  1554. will generate a video with a duration of 5.3 seconds, with size
  1555. 176x144 and a framerate of 10 frames per second.
  1556. @c man end VIDEO SOURCES
  1557. @chapter Video Sinks
  1558. @c man begin VIDEO SINKS
  1559. Below is a description of the currently available video sinks.
  1560. @section buffersink
  1561. Buffer video frames, and make them available to the end of the filter
  1562. graph.
  1563. This sink is mainly intended for a programmatic use, in particular
  1564. through the interface defined in @file{libavfilter/vsink_buffer.h}.
  1565. It does not require a string parameter in input, but you need to
  1566. specify a pointer to a list of supported pixel formats terminated by
  1567. -1 in the opaque parameter provided to @code{avfilter_init_filter}
  1568. when initializing this sink.
  1569. @section nullsink
  1570. Null video sink, do absolutely nothing with the input video. It is
  1571. mainly useful as a template and to be employed in analysis / debugging
  1572. tools.
  1573. @c man end VIDEO SINKS