Avisynth - An Introduction
By Alan O (aka Hitthebongo)
Introduction
While video editing programs like movie Maker provide an easy way to perform and customize a whole range of effects, there are a few areas where it falls on it's face. For instance, trying to arrange several videos in to a grid (sometimes known as the Brady Bunch Effect) is notoriously difficult due to the lack of multiple video tracks. While I am sure that Microsoft did the right thing keeping things simple in Movie Maker with only one video track, it should be acknowledged that it has its limitations. Fortunately some of the tasks it struggles with are handled exceedingly well with the free application Avisynth
At this pont it would prove useful to take a quote from the Avisynth mediawiki page:
AviSynth is a powerful tool for video post-production. It provides almost unlimited ways of editing and processing videos. AviSynth works as a frameserver, providing instant editing without the need for temporary files.AviSynth itself does not provide a graphical user interface (GUI) but instead relies on a script system that allows advanced non-linear editing. While this may at first seem tedious and unintuitive, it is remarkably powerful and is a very good way to manage projects in a precise, consistent, and reproducible manner. Because text-based scripts are human readable, projects are inherently self-documenting. The scripting language is simple yet powerful, and complex filters can be created from basic operations to develop a sophisticated palette of useful and unique effects.
Please read on if you'd like a crack at Avisynth yourself. I'm in no way going to provide a tutorial on script making as I'm still at the novice stage myself. I am however more than happy to share a few tips to help guide the uninitiated on how to turn an avisynth project in to a nice n' shiny video file. In this guide I will make available a sample project folder containing a couple of scripts and media to use for test purposes.
Prerequisites
Avisynth must firstly be installed. It may be downloaded from www.free-codecs.com
An application is required that we can feed the aviscript file in to, which in turn will create a video file. There are several that offer direct support and are listed below. One I use more than any other is Nic's WM9 Encoder. This tiny application has only one function in life which is to chew on aviscripts and then spit out some very tasty wmv files. For the purpose of this guide I will be restricting my references to just this Encoder. If you wish to consider other applications that are Avisynth friendly - here are a few I know of:
Nics WM9 Encoder (Highly recommended)
Virtualdub (Highly recommended)
Please note - while the above explicitly state that aviscripts may be imported, there are many other applications that will also import them if you force the application in to looking for ALL file types. Windows Media Encoder 9 is one such example.
It is very useful to be able to preview a script before the process of encoding begins as it will highlight script errors straight away. Installed alongside recent versions of Windows Media Player ( 9/10/11) should be an old legacy version (6.4) of the player. This can be found by clicking on the mplayer2.exe executable located in the following folder: C:\Program Files\Windows Media Player. This player views scripts in a fast and efficient manner by simply dragging one in to the main player window.
Windows Media Player 6.4
Alternatively you might consider Media Player Classic . Many people prefer this simple player over the bloated mass that is WMP 09/10/11
Note - If an aviscript does not playback in wmp6.4, it may be due to a missing YUV12 filter which is required to display Avisynth scripts. The Helix YUV Decoder is one solution that works fine for me.
It is nice to have a way to view and edit the scripts. Microsofts own text editor Notepad provides one method. A much more useful alternative however comes in the form of the all singing and all dancing AvsP. This comes highly recommended
AvsP
Finally, for the purposes of this introduction, please download the zipped folder below which is a very simple Avisynth project folder. It contains 2 scripts and a small wmv video clip for test purposes.It is good practice to unzip/extract the zipped file in to an empty folder
Script Preview
Once you have Avisynth installed and an Avisynth project folder to play with it's time to put Avisynth to the test. In the project folder that was downloaded , locate the script titled VERSION.avs and drag it in to the main window of WMP 6.4. You should now see the player displaying the version info of the Avisynth installation.
Avisynth Version Info
Next locate the other script in the project folder titled Test.avs and preview in exactly the same manner by dragging in to wmp6.4. You should now see the test video displayed as a 2x2 video with coloured filter effects (If you don't see the video and get an error message with either script, you may need to install the Helix YUV Decoder or an alternative)
So far so good - hopefully!. It's now time to get on with rendering the movie. For creating high quality wmv's I would highly recommend using Nic's WM9 Encoder
Encoding using Nic's Encoder
Nic's Windows Media Encoder
To configure Nic's Encoder to create high quality wmv's which may be imported in to Movie Maker, try the settings above.Please take note of the following however:
Faster encodings can be achieved by de-selecting the Use Multipass Encoding box.
Opening up Advanced Options and setting the Minimum/Maximum Complexity to Fastest will result in VERY fast encodings .
By ticking Use Input Size the resolution of the created video will be as defined within the Aviscript.
Sometimes a script may have a very high resolution and may need to be scaled back. Deselecting Use Input Size will allow a user defined resolution to be made (768 x 576 for example)
try and match the FPS (Frames Per Second) setting to that of the source video. UK PAL videos are typically 25fFPS and North American NTSC videos are typically 29.97 FPS
Caution...Nic's encoder is BETA software. Sometimes if incompatible config selections are made it can result in a failed encoding. Typically these problems surface when Variable Bit Rates are selected on either the video and audio but are not supported by the selected compressor.
Once all settings have been made simply select Encode and wait while the video is created!
If that has given you a taste for Avisynth you may wish to check out some of the scripts I've been putting together