Advanced Encoding Using Avisynth
Avisynth is a frame-server. It takes a video file, processes it as you want and then feeds it to other encoders as a pseudo-avi with uncompressed video and audio (there is no actual avi file created).
 It has some of the best filters for cleaning up/"improving" videos and  they work much faster than the ones in virtualdub.
It is a script written in notepad and saved as a avs file. If you have ever used basic, this should be straightforward for you.
Virtualdub MOD is able to use templates for loading videos using avisynth. It is much more complex to use than VirtualDub. We shall use it only for creating avisynth scripts automatically.

Preliminary setup

Software needed

Avisynth 2.08 (Win 98,ME?)or 2.5.5(WinXP,2000?)-download from download link at
http://www.avisyth.org
Run exe file to install.

Link to Virtualdub Mod
http://prdownloads.sourceforge.net/virtualdubmod/VirtualDubMod_1_5_10_1_All_inclusive.zip
Extract zip file  into new folder and create a desktop shortcut for the vdubmod exe file.
Download following plugins for Avisynth 2.08extract the dll files and the help/settings files into your avisynth plugins folder. Other files are source code and not needed.
http://www.avisynth.org/warpenterprises/files/convolution3d_20_dll_20021019.zip
http://www.avisynth.org/warpenterprises/files/greedyhma_20_dll_20011103.zip
http://www.avisynth.org/warpenterprises/files/mpasource_20_dll_20030415.zip
http://www.avisynth.org/warpenterprises/files/mpeg2dec_20_dll_20010816.zip
http://www.avisynth.org/warpenterprises/files/imagesequence_20_dll_20030507.zip
http://www.avisynth.org/warpenterprises/files/xlogo_20_dll_20030418.zip

or Download following plug-ins for avisynth2.5.5-extract the dll files and the help/settings files into your avisynth plugins folder. Other files are source code and not needed.
http://www.avisynth.org/warpenterprises/files/ac3source_25_dll_20030126.zip
http://www.avisynth.org/warpenterprises/files/greedyhma_25_dll_20030728.zip
http://www.avisynth.org/warpenterprises/files/imagesequence_25_dll_20030507.zip
http://www.avisynth.org/warpenterprises/files/mpasource_25_dll_20031214.zip
http://www.avisynth.org/warpenterprises/files/mpeg2dec_25_dll_20030107.zip
http://www.avisynth.org/warpenterprises/files/removedirt_25_dll_20040213.zip
http://www.avisynth.org/warpenterprises/files/xlogo_25_dll_20030630.zip
http://www.avisynth.org/warpenterprises/files/convolution3d_25_dll_20030422.zip
There are a lot of  other plugins-the above will be sufficient for this tutorial.

Click on auxsetup.exe either in your Virtualdub Mod folder or your Virtualdub MPEGfolder-click on the install handler button and finish process to enable frameserving from all versions of vdub you have!!

Also download following virtualdub plugins and extract the vdf files to your  virtualdub MPEG2 plugins folder (not in vdub mod!!)
http://neuron2.net/logo14.zip
http://eodvdf.narod.ru/AutoLevels.rar

Using Virtualdub Mod to create avisynth files
1.
File-Open Video File


2.To load a mpg or a vob select DirectShowSource from the dropdown box as shown
selecting
and then select your mpg or vob.

The file will load as an avisynth file after creating the avs file. The avs file will be in the same file as your video.
If your file is video.xxx, the avs file will be video--DirectShowSource.avs.
Avis can be loaded using AviSource (some video codecs need DirectShowSource).
Look in the Docs folder-English subfolder for the file corefilters.html. It will give you details of all built-in filters of avisynth.
Try practising scripting-by adding to the avs files generated above.

We will use  two types of files-
avst files go into your templates folder of virtualdub mod
avsi files go into plugins folder of avisynth.


Download
Cleaningfunction
templateforcleaningavi
mpgcleaner
You will get avicleaner  and mpgvobcleaner in the dropdown list of avisynth templates in virtuaaldubmod.

Virtualdub plugins can be loaded via avisynth. Problem is  that they cause crash when used in my 98 with Avisynth 2.5.5(probably in ME also). They work perfect in  my XP (probably in 2000 as well). If you want to use virtualdub plugins in 98 (ME?)-you need to use 2.08-problem with 2.08-can't load both video and audio from mpg and  vobs with  DirectShowSource and can't load ac3 audio (Dolby audio).
The following slightly roundabout way can use vdub plugins as well as builtin filters of vdub but will slow down encoding with 2.5.5. If you have 98(or ME) and a slow PC and want to use virtualdub plugins in avisynth, you can, using avisynth 2.08 (downloadable from same site) but procedure is not simple. You have to seperate the audio and the video and  load them in avisynth.
With XP you can use virtualdub plugins in Avisynth 2.5.5 and need not adopt following complex route.
For details see
Advanced Avisynth

  Intro to advanced encoding with Avisynth:
1.Load your mpg or vob in Virtualdub MPEG2.
2.Click on Video-Filters to get  dialog box as follows
filter
3.If video looks washed out (faded colors) or too dark-highlight Autolevels and click OK to get following dialog box
autolevel
Click Show Preview. If vid is too bright, reduce MaxGain till brightness is OK. Then if vid is too green/red, reduce Green/Red Color temperature till color is OK. Click OK. Skip this step if vid color is OK.
4.If you want to add a logo, you can use a 24bit bitmap file (to be safe, load image file in Paint and save as a 24 bit bitmap). Built-in logo filter is less flexible than the third party plugin.Leave it to you to add the logo.
5.Next, In Virtualdub MPEG2-Load your file , then-File-Start Frame-server-in the dialog box you get-click start. In the file save as box you get, name it xxx.vdr and click OK.
6.Next Open Virtualdub Mod and open the vdr file with  avicleaner template to create an avs file-must if you are using Win98(ME?) and Avisynth 2.5.5-even if you opt not to use either filter!!. If color of original is OK and you do not want to put logo-open the mpg or vob  directly in Vdub Mod using mpgvobcleaner  template if you have XP(2000?) to generate avs file.
7.You can load the avs file in Virtualdub MPEG2(second window) and then follow the tutorial as in
Tutorial on conversion to avi
or
Tutorial on Conversion to rmvb