You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2355 lines
66KB

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