Functions Index :: L :: LineAnim

[<< up one level]

Module:

filters :: animate

Definition:

LineAnim(clip base, clip ovl, int "f_start", int "f_end", int "x_start", int "x_end", int "y_start", int "y_end", float "op_start", float "op_end", int "w_start", int "w_end", int "h_start", int "h_end", clip "mask", string "mode", bool "greymask", string "output", bool "ignore_conditional", bool "pc_range")

Description:

Animates a clip between a start and an end frame while in parallel it overlays it on a base clip using the Overlay() standard Avisynth function. The clip is animated along with it's mask (a full white as default, if none specified), thus allowing the application of any overlay mode supported by Overlay().

The filter accepts all arguments of the Overlay() filter, thus providing a general purpose animation interface for two-point (ie linear) position, opacity and size animation between two frames.

Arguments:

base: The base clip on top of which the animated ovl clip will be overlayed.

ovl: The clip to animate and overlay on top of base clip. If "mask" is not supplied, the function creates a default full opaque (white) mask equal to the dimensions of the ovl clip.

"f_start" (Optional, defaults to 0): The frame from which the animation will start.

"f_end" (Optional, defaults to base.Framecount-1): The frame where the animation will end.

"x_start" (Optional, defaults to Round(ovl.Width/2)): The starting position of the center [1] of the animated ovl clip on the horizontal (x) axis.

Thus if x_start is not specified the left side of ovl clip will be, taking into account possible scaling, on top of the left side of base clip (same behavior with Overlay).

"x_end" (Optional, defaults to x_start): The ending position of the center of the animated ovl clip on the horizontal (x) axis.

"y_start" (Optional, defaults to Round(ovl.Height/2)): The starting position of the center [1] of the animated ovl clip on the vertical (y) axis.

Thus if y_start is not specified the top side of ovl clip will be, taking into account possible scaling, on top of the top side of base clip (same behavior with Overlay).

"y_end" (Optional, defaults to y_start): The ending position of the center of the animated ovl clip on the vertical (y) axis.

"op_start" (Optional, defaults to 1.0): The starting opacity value of the animated ovl clip.

"op_end" (Optional, defaults to op_start): The ending opacity value of the animated ovl clip.

"w_start" (Optional, defaults to ovl.Width): The starting width of the animated ovl clip.

"w_end" (Optional, defaults to ovl.Width): The ending width of the animated ovl clip.

"h_start" (Optional, defaults to ovl.Height): The starting height of the animated ovl clip.

"h_end" (Optional, defaults to ovl.Height): The ending height of the animated ovl clip.

"mask", "mode", "greymask", "output", "ignore_conditional", "pc_range": They have the same functionality as in the Overlay() standard Avisynth function. See the Avisynth documentation for details.

Notes and conditions on arguments relations:

1] From version 1.1.0 and onwards, the implementation of the filter is based on ScriptClip(), thus allowing smaller memory footprint and consequently more complex animations than the previous versions (which were using the Animate() filter).

2] The filter uses internally the Resize filter in order to execute clip resizing when needed. To control which specific Avisynth resizer will be used by the filter place a call to SetDefaultResizer with appropriate parameters before calling the filter.

Examples:

# zoom-in a clip, sliding it top-left to bottom-right

# animate the first 200 frames

bc = AVISource(...) # a 720x480, 600 frames clip

oc = AVISource(...) # a 360x240 clip

# start size: 24x16, end size: 320x240

anim = LineAnim(bc, oc, 0, 200, 12, 360+180, 8, 240+120, \

0.0, 1.0, 24, 360, 16, 240)

...

# stretch a clip, sliding it top to bottom

# animate all clip frames

bc = AVISource(...) # a 720x480, 600 frames clip

oc = AVISource(...) # a 360x240 clip

anim = LineAnim(bc, oc, x_start=360, y_start=60, y_end=240, \

w_start=720, h_start=120, w_end=180, h_end=480)

 

[<< top]

 


[1]: Animation filters (currently LineAnim and PolygonAnim) treat parameters specifying overlay clip's (x,y) position as if they correspond to its center and not to its top-left corner as Overlay() does.

While this may seems odd, it does make the calculation of (x,y) paths simpler because in the general case size will also be animated. If this convention was not used then at any path point a correction would had to be made for the changing size of the animated clip at both x and y.

See the tutorial "Understanding animation filters" for details.

[2]: Further examples can be found at the Example Scripts section of the documentation.