If you have an AVI file handy, you can try applying these same filters to your file:ĪVISource("d:\capture.avi") # or whatever the actual pathname isĮven a single-line script containing only the AviSource command can be useful for adding support for >2GB AVI files to applications which only support <2GB ones. In practice a much more useful source filter than Version is AviSource, which reads in an AVI file (or one of several other types of files) from disk.
You can also use the ShowFrameNumber filter, which prints each frame's number onto the frame itself. It's much easier to open a partially-completed script in an application like VirtualDub which will display the frame numbers for you. Keeping track of frame numbers this way is a chore. If you put 0 for the last frame, it's the same as "end of clip," so if you only want to remove the first 120 frames you should use Trim(120,0). The Trim filter takes two arguments, separated by a comma: the first and the last frame to keep from the clip. In this example we used a comment for the first time.Ĭomments start with the # character and continue to the end of the line, and are ignored completely by AviSynth. # (AviSynth starts numbering frames from 0) # Chop off the first 120 frames (0 to 119), and keep the frames 120-150 Let's discard the first 120 of them, and keep the frames 120-150: It takes a long time before the fade starts, so let's trim the beginning of the clip to reduce the wait, and fade out after that. The FadeOut filter takes a numerical argument, which indicates the number of frames to fade. The clip should be the same for the first 9 seconds, and then in the last second it should fade smoothly to black. Add another line to the script file so that it reads: Let's add another one to make the video fade to black at the end. You can chain together lots of transformation filters, just as in VirtualDub. ReduceBy2 is a "transformation filter," meaning that it takes the previous clip and modifies it in some way. You should see the copyright notice again, but now half as large as before.
Now add a second line to the script file, so that it reads like this: The first command in an AviSynth script will always be a source filter. Version is what's called a "source filter", meaning that it generates a clip instead of modifying one.
Windows Media Player and you should see a ten-second video clip showing AviSynth's version number and a copyright notice. The scripts for this are easy to write because you don't have to worry about variables and complicated expressions if you don't want.įor testing create a file called test.avs and put the following single line of text in it: The simplest thing you can do with AviSynth is the sort of editing you can do in VirtualDub. Instead, the application thinks that it is directly opening a filtered AVI file that resides on your hard drive. The application, however, is not aware that AviSynth is working in the background. It opens the videos you referenced in the script, runs the specified filters, and feeds the output to video application. Then, you run a video application, such as VirtualDub, and open the script file.
These commands make references to one or more videos and the filters you wish to run on them. First, you create a simple text document with special commands, called a script.