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.

2340 lines
65KB

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