Home
RecentChanges

Search:

» AviSynth is a powerful video FrameServer for Win32.

AviSynth Links:
»Download
»Learn to script
»FAQ
»Manual
»Discussion fora
»Project page
»External filters
»FeedBack

» You can add pages to this website immediately. No login required.
Edit this document

» AboutAviSynth

 

Avisynth 
Logo

Animate

( Diese Seite in flag-germany.gif Deutsch )

Animate(clip clip, int start_frame, int end_frame, string filtername, start_args, end_args)

ApplyRange(clip clip, int start_frame, int end_frame, string filtername, args)

Animate is a meta-filter which evaluates its parameter filter with continuously varying arguments. At frame start-frame and earlier, filter is evaluated with the arguments given by start-args. At frame end-frame and later, filter is evaluated with the arguments given by end-args. In between, the arguments are linearly interpolated for a smooth transition.

ApplyRange is a special case of Animate where start_args = end_args, and present in v2.51. It can be used when you want to apply a certain filter on certain range of frames of a clip. Another difference with Animate is that args can't contain a clip. Starting from v2.53 it supports audio, and start_frame can be equal to end_frame (such that only one frame is processed).

Filter must be enclosed in quotation marks, and the two nested argument lists are not parenthesized. Strings and video clips can't be interpolated, and therefore must be identical in the two argument lists. You can't use OOP notation or implicit last with this filter, even if the filter in the filter argument normally allows them.

This filter will not correctly handle a changing sound track, so I don't recommend its use with filters which modify the sound track. And for heaven's sake don't make the initial and final parameters yield a different output frame size.

The filter argument can even be Animate if you want quadratic rather than linear interpolation, but I'm not going to think about this too much because my head might explode.

Examples: 

# Make a scrolling version of the "Version" video
ver = Version
return Animate(0, 149, "Crop", ver, 0, 0, 64, 32, ver, ver.width, 0, 64, 32)

# or what is the same:
ver = Version()
return Animate(ver,0,149,"Crop", 0,0,64,32, ver.width,0,64,32)

# Fade to white
Animate(100, 200, "Levels", last, 0, 1, 255, 0, 255, last, 0, 1, 255, 255, 255)

# Do a gradual zoom into the center of a 320x240 video, starting at
# 1:1 magnification in frame 100 and ending with 4:1 magnification
# in frame 200

#31-03-04 This wont work - Bicubic needs extra parameters!
#maybe try BilinearResize instead
Animate(100, 200, "BicubicResize",last, 0, 0, 320, 240, 320, 240, last, 120, 90, 80, 60, 320, 240)

# Make the text "Hello, World!" zoom out from the center of a 320x240 video
Animate(0, 48, "Subtitle", last, "Hello, World!", 160, 120, 0, 99999, "Arial", 0, last, "Hello, World!", 25, 130, 0, 99999, "Arial", 48)

ver = Version()
return ver.ApplyRange(0,149,"Crop", 158,0,64,32)

AviSource("E:\pdwork\DO-Heaven.AVI").BicubicResize(320,240)
ApplyRange(0,48,"Subtitle", "Hello, World!",25,130,0,99999,"Arial",48)

# or what is the same:
clip = AviSource("E:\pdwork\DO-Heaven.AVI").BicubicResize(320,240)
ApplyRange(clip, 0,48,"Subtitle", "Hello, World!",25,130,0,99999,"Arial",48)

SourceForge Logo

 


Edit this document | View document history
Document last modified Wed, 02 Feb 2005 14:09:29