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.

2396 lines
67KB

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