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.

2434 lines
68KB

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