This transition effect smoothly merges two input videos. Video A gradually becomes more transparent while video B's transparency decreases. Only video A is visible at the beginning of crossfade and only B at the end; both are at varying stage of semitransparency in between these extremes, combined into single video.
Fades the outfading clip (the source) out to a single-colored canvas which is then faded into the infading clip (the destination of transition). The end of fade out as well as the beginning of fade in may be set so the two clip may even crossfade. Also, the rates of these fades can be modified. It is possible to vary the color of canvas, thus creating dynamic background. Fade is a common transition used almost everywhere.
The dialog allows to set the end of fade out and the beginning of the fade in (in percentage of the clip's length), as well as the rate of both fades. There's a color button in order to pick the color of background. If 'dynamic' box is checked, corresponding button appears so that the background color at the end of the clip could be set; the rate slider affects the rate of variation of these color from the beginning to the end. If 'autoscale' is checked, the contributions of the infading clip and the outfading clip are scaled so that the result brightness doesn't overflow.
The following table lists the filter's parameters in network file format.
Table 4.75. Fade parameters
Parameter | Values | Description | Required | Default value |
---|---|---|---|---|
videotransition | Fade | filter name | yes | |
fade_out | real (0, 1) | the end of fade out relative to the length of clip | no | 0.5 (middle of the clip) |
fade_in | real (0, 1) | the start of fade in relative to the length of clip | no | 0.5 (middle of the clip) |
color_R | real (0, 255) | value of the red channel (RGB) in the background color | no | 0 (black) |
color_R_2 | real (0, 255) | value of the red channel (RGB) in the background color at the end | no | color_R (constant channel value) |
color_G | real (0, 255) | value of the green channel (RGB) in the background color | no | 0 (black) |
color_G_2 | real (0, 255) | value of the green channel (RGB) in the background color at the end | no | color_G (constant channel value) |
color_B | real (0, 255) | value of the blue channel (RGB) in the background color | no | 0 (black) |
color_B_2 | real (0, 255) | value of the blue channel (RGB) in the background color at the end | no | color_B (constant channel value) |
autoscale | boolean (0 or 1) | scale the composed brigthness against overflow | no | 1 |
rate_out | real > 0 | rate of fade out | no | 1 (uniform) |
rate_in | real > 0 | rate of fade in | no | 1 (uniform) |
rate_color | real > 0 | rate of interpolation of background color | no | 1 (linear interpolation) |
The YUV or RGB mode is required, hence the YV12, RGB24, RGBA32 and
RGB32 formats are supported. The YV12 format, however, supports only
frames with even dimensions so when either the width or the height of the
frame are of odd dimensions, the frame is converted to the RGB24 format.
If the YUV mode is used, the color_*(_2)
parameters are
converted to their corespondents in YUV.
The algorithm is easy, but has a lot of parameters. For every output
frame the ratio between background color at the beginning and at the end
of the clip as well as the contribution of frames from the outfading and
the infading clip are figured out, according to the rate_*
parameters and the relative position of the frame. The frames from both
tracks are opened in one of supported formats. The algorithm just runs
through the image and for every pixel counts its intensity as a weighted
sum of the intensities of the outfading frame, the infading frame and the
background color.
For example, format_out = 0.25, format_in = 0.5, rate_in =
0.5
settings mean that during the first quarter of the clip the
outfading clip is fading out to black, during the second quarter black
background is viewed and during the last half the infading clip is fading
in from black, slowly at first, then quicker and quicker. It's more
than one would expect from a fade, isn't it?
This is a transition between two video streams; the outgoing clip sweeps the ingoing clip in the selected direction (to the right, to the left, downwards, upwards).
The dialog allows you to set the sweep direction and rate. The default rate in the middle of the slider corresponds to a linear sweep; the lower and higher values make the sweep slower or faster, respectively.