Avisynth Frequently Asked Questions

Remark: the most recent version can be found on http://www.avisynth.org.

The faq is divided in to five sections:

S1: About AviSynth
S2: AviSynth and frameserving
S3: Filters and colorspaces
S4: Importing filters from VirtualDub
S5: Plugins

S1: About AviSynth:

Q1: What is AviSynth ?
Q2: Who is developing AviSynth ?
Q3: Where can I download the latest versions of AviSynth ?
Q4: What are the main bugs in these versions ?
Q5: Where can I find documentation about AviSynth ?
Q6: How do I install/uninstall AviSynth ?
Q7: How do I make an AVS-file ?
Q8: Where do I save my AVS-file ?
Q9: How do I know which version number of AviSynth I have ?
Q10: Does AviSynth have a GUI (graphical user interface) ?

S2: AviSynth and frameserving:

Q11: What is frameserving and what is it good for ?
Q12: How do I use AviSynth as a frameserver ?
Q13: How do I frameserve my AVS-file to encoder/application X ?
Q14: Problems when Encoder X reads AVS-files ?
Q15: When frameserving I got the following message: "Script error, there is no function named "xxx (some filter)"" ?
Q16: When frameserving from Premiere in Virtualdub or TMPGEnc I got the following message: "IPCSource: wrong server version?" ?
Q17: When frameserving I got the following message: "Script error, there is no function named "IPCSource"" ?
Q18: I'm using AviSynth to frameserve in Premiere.  When loading the AVS script in AVI2SVCD, the GO button remains grey and I have this error message in the log: Unknow Avi Header. (IPCS)
Q19: I get an unrecognized exception error trying to load an avs file with VirtualDub, using dvd2avi v1.77.3 ?
Q20: How do I load my clip into AviSynth (video) ?
Q21: How do I load my clip into AviSynth (audio) ?
Q22: Can I import an audio file other than a WAV-file?
Q23: How do I join video and audio ?
Q24: I loaded a DivX/MPEG file, but the audio seems lost?

S3: Filters and colorspaces:

Q25: What are the most important internal filters of AviSynth ?
Q26: What is RGB/YUV-colorspace ?
Q27: In which colorspaces do AviSynth and the internal filters work ?
Q28: Where can I download external filters which work in YUV/RGB-space ?
Q29: How do I convert between the colorspaces ?
Q30: What/when do I care when filter X works in RGB- or YUV-space ?
Q31: I tried to use the Dissolve filter, but it doesn't seem to work ?
Q32: Is there a fade in/out filter ?

S4: Importing filters from VirtualDub:

Q33: Where can I download the latest version of scripts which import filters from VirtualDub ?
Q34: Which filters are imported ?
Q35: Do these scripts work in RGB-space or in YUV-space ?
Q36: How do I make such a script ?

S5: Plugins:

Q37: Which plugins are available and where do I get them ?
Q38: How do I load a plugin in to AviSynth ?
Q39: What is mpeg2dec.dll and where can I find the newest version ?
Q40: How do I use the "SpatialSoftenMMX" plugin ?
Q41: When i try to use SpatialSoftenMMX, it crashes in VirtualDub ?
Q42: How do I use and where can I get the "Subtitler" and "BMP Loader" plugins ?
Q43: Where can I find the Flask/Xmpeg/DVDx and Premiere plugins ?
Q44: Are the Flask and Premiere plugins different ?
 

S1: About Avisynth:
 

Q1: What is AviSynth ?

A: AviSynth (AVI SYNTHesizer) is a frameserver. An excellent discription is given on Lukes homepage http://www.lukesvideo.com/avisynth.html.

AviSynth is a very useful utility created by Ben Rudiak-Gould. It provides many options for joining and filtering videos. What makes AviSynth unique is the fact that it is not a stand-alone program that produces output files. Instead, AviSynth acts as the "middle man" between your videos and video applications.

Basically, AviSynth works like this: First, you create a simple text document with special commands, called a script. These commands make references to one or more videos and the filters you wish to run on them. Then, you run a video application, such as VirtualDub, and open the script file. This is when AviSynth takes action. It opens the videos you referenced in the script, runs the specified filters, and feeds the output to video application. The application, however, is not aware that AviSynth is working in the background. Instead, the application thinks that it is directly opening a filtered AVI file that resides on your hard drive.

There are five main reasons why you would want to use AviSynth:

     
  1. Join Videos: AviSynth lets you join together any number of videos, including segmented AVIs. You can even selectively join certain portions of a video or dub soundtracks.

  2.  
  3. Filter Videos: Many video processing filters are built in to AviSynth. For example, filters for resizing, cropping, and sharpening your videos.

  4.  
  5. Break the 2 GB Barrier: AviSynth feeds a video to a program rather than letting the program directly open the video itself. Because of this, youu can usually use AviSynth to open files larger than 2 GB in programs that don't natively support files of that size.

  6.  
  7. Open Unsupported Formats: AviSynth can open almost any type of video, including MPEGs and certain Quicktime MOVs. However, when AviSynth feeds video to a program, it looks just like a standard AVI to that program. This allows you to open certain video formats in programs that normally wouldn't support them.

  8.  
  9. Save Disk Space: AviSynth generates the video that it feeds to a program on the fly. Therefore, no temporary or intermediate videos are created. Because of this, you save disk space.

 

Q2: Who is developing AviSynth ?

A: AviSynth (up to v1.0b) is developed by Ben Rudiak-Gould, see http://math.berkeley.edu/~benrg/avisynth.html.  Ben stopped developing and Edwin van Eggelen continued, see http://www.videotools.net/uk/download.php. His latest release is version v1.0b6 which can be found on Edwins homepage given above.

Some versions appeared on the AviSynth forum, for example v1.0b7a by Divine and v1.0b7d by Dividee.

In the beginning of July 2002 there was a second revision of the sourceforge project.  (In the first sourceforge project didn't happen much.) The most recent version is v2.0.6, but more recent weekly builds can be found here. For documentation have a look at Q5.
 

Q3: Where can I download the latest versions of AviSynth ?

A: See Q2. It is also contained in the DVD2SVCD package and on the download page of Doom (these might be not be the newest versions of AviSynth).
 

Q4: What are the main bugs in these versions ?

A: The latest versions:

v1.0b5: Dissolve doesn't work, BicubicResize doesn't work properly.

v1.0b6: ?

v1.0b7a/v1.0b7d: Dissolve doesn't work.

v2.01: ?

v2.02: Layer and MergeChroma don't work.

v2.05: Loop doesn't work when loading a clip without sound.

other bugs can be found in the documentation on the project page, see Q5.
 

Q5: Where can I find documentation about AviSynth ?

A: Documentation about the filters of AviSynth can be found on this site http://www.avisynth.org/, and also on the filters page. For a tutorial on avisynth scripting, have a look at this site. (Some additional info can be found here.) You should read these documents before posting to the forum (but it's OK to post if you have trouble understanding them).
 

Q6: How do I install/uninstall AviSynth ?

A: In v2.05 or older versions: move avisynth.dll to your system/system32 directory and run install.reg.  For autoplugin loading see Q38. Rebooting is not necessary. Make sure you have no other versions of AviSynth floating around on your harddisc, because there is a change that one of those versions will be registered. Remove them if necessary. For uninstalling AviSynth, run uninstall.reg and remove avisynth.dll from your system/system32 directory.

Starting from v2.06 AviSynth comes with an auto installer. Also in this case make sure you have no other versions of AviSynth floating around on your harddisc, because there is a change that one of those versions will be registered. Remove them if necessary. For uninstalling AviSynth go to "program", "AviSynth 2" and select "Uninstall AviSynth".
 

Q7: How do I make an AVS-file ?

A: See Q9 (thus using the text editor you prefer).
 

Q8: Where do I save my AVS-file ?

A: Anywhere on your harddrive.
 

Q9: How do I know which version number of AviSynth I have ?

A: Open a text-editor, for example notepad. At the following line

Version

and save the file with the extension "avs". Save for example as version.avs (make sure that the extension is "avs" and not "txt"). Open the file in an application which can read AVI-files, for example WMP 6.4. The version number will be displayed.
 

Q10: Does AviSynth have a GUI (graphical user interface) ?

A: Two nice tools are available:
The first tool (a modification of VirtualDub with OGM and AC3/MP3/MPEG2 support) VirtualDubMod: It is merged from VirtualDubAVS (Belgabor), VirtualDubMpg2 (Pulco-Citron) and VirtualDubOGM (Suiryc) (based on VirtualDub v1.4.11). Regarding to AviSynth the following utilities are added:

The second tool AVSGenie: AVSGenie allows the user to select a filter from a drop down list or from a popup menu. An editable page of parameters will then be brought into view, with a guide to the filter and it's parameters. A video preview window opens, showing "source" and "target" views.  The source window, in simple cases, shows output of the first line of the script, generally an opened video file. The target window shows the output of the whole script. In this way, effects of filters can easily be seen. The line which represents the source window can be changed.
 

S2: AviSynth and frameserving:
 

Q11: What is frameserving and what is it good for ?

A: An excellent discription is found on Lukes homepage http://www.lukesvideo.com/frameserving.html.

Frameserving is a process by which you directly transfer video data from one program on your computer to another. No intermediate or temporary files are created. The program that opens the source file(s) and outputs the video data is called the frameserver. The program that receives the data could be any type of video application.

There are two main reasons that you would want to frameserve a video:

     
  1. Save Disk Space:

  2. Depending the on the frameserving application, you can usually edit/process your video as it is being frameserved. Because frameserving produces no intermediate files, you can use a frameserver to alter your videos without requiring any additional disk space. For example, if you wanted to join two video files, resize them, and feed them to another video application, frameserving would allow you to do this without creating a large intermediate file.
     
  3. Increased Compatibility:

  4. To the video application that's receiving the frameserved video, the input looks like a relatively small, uncompressed video file. However, the source file that the frameserver is transferring could actually be, for example, a highly compressed MPEG-1 video. If your video application doesn't support MPEG-1 files, it's not a problem because the application is just receiving standard uncompressed video from the frameserver. This feature of frameserving enables you to open certain types of files in an application that wouldn't normally support them.


Furthermore, because the video application is being fed the source video one frame at a time, it doesn't know anything about the file size of the source video. Therefore, if your application has 2 GB or 4 GB limit on input file size, it won't have any effect on your frameserved video. You could feed 100 GB of video via a frameserver to an application limited to 2 GB and it wouldn't cause a problem.
 

Q12: How do I use AviSynth as a frameserver ?

A: Write a script using a text editor. Load your clip (see Q20) in AviSynth, do the necessary filtering and load the AVS-file in encoder/application X (must be an encoder or application which can read AVI-files, see Q13 and Q14).
 

Q13: How do I frameserve my AVS-file to encoder/application X ?

A:

Q14: Problems when Encoder X reads AVS-files ?

A:

  1. Why can't I open my AVS-file in TMPGEnc (this happens in old versions of TMPGEnc) ?
  2. If that doesn't work you can try the following:
  3. How can I solve the lockups while encoding with TMPGEnc12b ?

  4. Disable the direct show/DVD2AVI filter. (Or try to disable other filters, if you still run into problems.)
     
  5. CCE SP crashes when reading an AVS-file, what to do ?
  6. Encoders/players (like CCE SP v2.62/v2.64) will not read AVS-files ?

  7. Many "new" programs do NOT use the Windows functions to read the AVI-files. If they do NOT use those standard Windows functions the AviSynth-script files will not work. Known programs that do NOT use those routines are CCE SP v2.62, Windows Media Encoder vx.x. Furthermore people report problems with Windows Media Player 7.

    Use CCE SP v2.50 and WMP6.4 (under "Program Files" and "Windows Media Player" you will find a file called "mplayer2.exe", this is WMP6.4). In case that you want to use Windows Media Encoder you can use the AVI Wrapper instead which can be downloaded from http://www.videotools.net/uk/download.php.

    If you still want to use CCE SP v2.62 you can try the following:
    Frameserve to CCE SP v2.62 with VFAPI. Create an AVS script and then make a fake AVI with VFAPI (VFAPI v1.04 accepts AVS-files and can be downloaded from Dooms site).
     

  8. Wrong YUY2 Codec causes colorspace errors on AviSynth scripts feeding TMPGEnc?

  9. Some time ago I suddenly found that feeding TMPGEnc with an AviSynth script resulted in what looked like a colorspace conversion error; as if the video had been badly dithered down from 24 bit to 8 bit! (..)

    If you have such problems have a look at the thread (and the suggested solutions) colorspace conversion errors.

Q15: When frameserving I got the following message: "Script error, there is no function named "xxx (some filter)"" ?

A: You probably installed/registered a version of AviSynth which doesn't contain the filter.  Make sure that there are no other versions floating around on your hard disc (there's a possibility that a version will be registered while it is not in your system directory).  Check that the right version is registered, see also Q6.
 

Q16: When frameserving from Premiere in Virtualdub or TMPGEnc I got the following message: "IPCSource: wrong server version?" ?

A: You probably used an AviSynth version which is not compatible with the plugin.  See also Q43.
 

Q17: When frameserving I got the following message: "Script error, there is no function named "IPCSource"" ?

A: You probably used AviSynth v1.0b6.  In this version the IPCSource is removed and put into a different dll (in avisynthEx.dll).  Get this plugin or use another version of AviSynth.
 

Q18: I'm using AviSynth to frameserve in Premiere.  When loading the AVS script in AVI2SVCD, the GO button remains grey and I have this error message in the log: Unknow Avi Header. (IPCS)

A: No frame serving AVI-files will work with DVD2SVCD, except in and later versions of DVD2SVCD 1.0.9b2 where you can use Edwins Link2 program (that is an AVIWRAPPER).
 

Q19: I get an unrecognized exception error trying to load an avs file with VirtualDub, using dvd2avi v1.77.3 ?

A: .d2v created with dvd2avi v1.77.3 is NOT compatible with mpeg2dec.dll! Use v 1.76 instead.  If you still want to use v1.77.3 have a look at this thread.
 

Q20: How do I load my clip into AviSynth (video) ?

A: Make a script containing the lines (replace the filename and the path of the filename):
 

  1. AVI-files (with uncompressed WAV or CBR/VBR MP3-audio (starting from v2.04):

  2. AviSource("d:\filename.avi")
    or disabling the audio:
    AviSource("d:\filename.avi", false)
     
  3. AVI-files that AVISource doesn't support (for example "DV type I AVI-files"), MPEG1-files:

  4. DirectShowSource("d:\filename.avi")
    DirectShowSource("d:\filename.mpg")
     
  5. MPEG2-files (extension m2p or m2v):

  6. Make a DVD2AVI project file and save it (filename.d2v) and load this clip into AviSynth:
    LoadPlugin("d:\mpeg2dec.dll")
    mpeg2source("d:\filename.d2v")

    or download the MPEGdecoder (by Nic) and make the following script (no audio support yet):
    LoadPlugin("d:\MPEGdecoder.dll")
    mpeg2source("d:\filename.m2p")
     

  7. VOB-files:

  8. download the MPEGdecoder (by Nic) and make the following script(no audio support yet).
    LoadPlugin("d:\MPEGdecoder.dll")
    mpeg2source("d:\filename1.vob+d:\filename2.vob")
     
  9. d2v-files (DVD2AVI frameserver files):

  10. LoadPlugin("d:\mpeg2dec.dll")
    mpeg2source("d:\filename.d2v")
     
  11. vdr-files (VirtualDubs frameserver files):

  12. AVISource("d:\filename.vdr")
     
  13. ASF-files (the framerate has to be specified, right click on the file in windows explorer):

  14. DirectShowSource("d:\filename.asf", fps=15)
     
  15. tpr-files (TMPGEnc project files)

  16. First note that the plugin GreedyHMA is proving to be a better IVTC solution (not to mention *MUCH* easier) than TMPGEnc. So if you want to use TMPGEnc for this get the GreedyHMA plugin (this plugin works in YUV-space).

    If you still want to import a tpr-file into an AVS-file, there are two possibilities:

    first one: The TMPGEnc plugin is contained in the VFAPI Plugin zip file (ends with -vfp.zip) which can be download from Dooms site. (This method doesn't always work, some encoders like CCE SP can't read them.)
    LoadVFAPIplugin("d:\TMPGenc.vfp","TMPGsource")
    TMPGsource("d:\filename.tpr")
    FlipVertical
    second one: Import the tpr-file in VFAPI, create a fake avi and then load it into AviSynth (note that VFAPI works in RGB-space). See also http://forum.doom9.org/showthread.php?s=&threadid=10007.
     

  17. aup-files (AviUtl projects)

  18. I don't know if it is possible to load it directly into AviSynth. Import the aup-file in VFAPI, create a fake avi and then load it into AviSynth (note that VFAPI works in RGB). See also http://forum.doom9.org/showthread.php?s=&threadid=10007.
     
  19. QuickTime-files (see http://forum.doom9.org/showthread.php?s=&threadid=23139):

  20. Use DirectShowSource:
    DirectShowSource("d:\filename.mov")
    or if that doesn't work download a plugin (can be found in Dooms download section):
    LoadVFAPIPlugin("C:\QTReader\QTReader.vfp", "QTReader")
    QTReader("C:\quicktime.mov")
Q21: How do I load my clip into AviSynth (audio) ?

A: Make an AVS-file containing the line (change the filename and path):

WavSource("d:\filename.wav")
 

Q22: Can I import an audio file other than a WAV-file?

A: No (not yet), but ...  Only uncompressed audio files (that is uncompressed WAV-files) can be loaded in all versions up to v2.03.  Starting from v2.04 compressed WAV-files can be loaded (currently only MP3-files with a WAV-container).  Starting from v2.05 you can extract audio from a AVI-file in this way:

WavSource("d:\filename.avi")
 

Q23: How do I join video and audio ?

A: Make an avs-file containing the lines (change the filenames and paths):

video = AviSource("d:\filename1.avi")
audio = WavSource("d:\filename2.wav")
AudioDub(video, audio)
 

Q24: I loaded a DivX/MPEG file, but the audio seems lost?

A: You probably used v2.03 or older.  A DivX/MPEG file doesn't contain uncompressed audio.  If you want to load a clip with audio you have to convert the audio to uncompressed WAV (for example in VirtualDub/Nandub), or in case you want to load an AVI with MP3 you can use v2.04 or more recent versions instead.
 

S3: Filters and colorspaces:
 

Q25: What are the most important internal filters of AviSynth ?

A: The internal filters are explained in the documentation, see also Q5.
 

Q26: What is RGB/YUV-colorspace ?

A: A nice explanation is given in YUV Formats and RGB Formats and another explanation can be found here MSDN YUV Formats.
 

Q27: In which colorspaces do AviSynth and the internal filters work ?

A: AviSynth works in RGB and in YUV colorspace, also most of the internal filters work in both spaces.  However the following internal filters work only in YUV space:

As of Avisynth v2, the SpatialSoften, TemporalSoften, Tweak, PeculiarBlend, FixLuminance, FixBrokenChromaUpsampling, MergeChroma and MergeLuma filters work only with YUY2 input and Mask and ResetMask only with RGB32 input.  You can use the ConvertToYUY2 filter if your input is not in YUY2 format (see also Q29).
 

Q28: Where can I download external filters which work in YUV/RGB-space ?

A: Most of the plugins that you can download work in YUV-space.  See also Q38 for importing scripts.  A selection:

Deinterlacing & Pulldown Removal:

  1. Decomb Filter package (by Donald Graft): This package of plugin functions for AviSynth provides the means for removing combing artifacts from telecined progressive streams, interlaced streams, and mixtures thereof. Functions can be combined to implement inverse telecin (IVTC) for both NTSC and PAL streams. [YUY2]

  2.  
  3. GreedyHMA plugin (by Tom Barry): DScaler's Greedy/HM algorithm code to perform pulldown matching, filtering, and video deinterlace. [YUY2]

  4.  
  5. Motion compensated deinterlace filter "TomsMoComp" (by Tom Barry): this is a filter that uses motion compensation and adaptive processing to deinterlace video source (not for NTSC_film). [YUY2]

  6.  
  7. SmoothDeinterlacer (by Xesdeeni): AviSynth port of Gunnar Thalin's Smooth Deinterlacer. [YUY2, RGB]

  8.  
  9. IVTC plugin v2.2 (by "Wizard_FL", Dooms download section): This plugin inverses the telecine process. [YUY2]

  10.  
  11. "IT" (by thejam79): IVTC plugin. Translation of README

  12.  
  13. "AntiComb" (by ?): This filter remove combing. Translation of README
Spatio-Temporal Denoisers/Smoothers:
  1. PeachSmoother (by Lindsey Dubb): An adaptive smoother optimized for TV broadcasts.  Basically, the Peach works by looking for good pixels and gathering orange smoke from them. When it has gathered enough orange smoke, it sprinkles that onto the bad pixels, making them better. When the Peach is seeing lots of good pixels, it gets so happy that a small green dot appears in the upper left corner of the image. [YUY2]

  2.  
  3. "MAM" (by Marc FD): This filter uses movement detection to adapt the denoising method used, in still areas it uses temporal filtering and in moving areas it uses spatial filtering with any spatial and temporal filter you want.  It is no longer developed but can be temporary downloaded from this site. [YUY2]

  4.  
  5. SpatioTemporal Median Filter "STMedianFilter" (by Tom Barry): STMedianFilter is a (slightly motion compensated) spatial/temporal median filter. Bug: strange color changes (clip becomes purple) [YUY2]

  6.  
  7. Convolution3D (by Vlad59): Convolution3D is a spatio-temporal smoother, it applies a 3D convolution filter to all pixels of consecutive frames. [YUY2]
Spatial Denoisers/Smoothers:
  1. Masked Smoother "msmooth" (by Donald Graft): The filter is effective at removing mosquito noise as well as effectively smoothing flat areas in (especially) anime. (currently in the repair shop) [RGB]

  2.  
  3. Smoother HiQ(uality) plugin (by Klaus Post): This filter performs (spatial) smoothing on video material to eliminate noise and MPEG artifacts. [YUY2]

  4.  
  5. Chroma Noise Reducer (by Marc FD): Reduces the noise on the chroma (UV) and preserves the luma (Y). [YUY2]

  6.  
  7. msoften (by Marc FD): This Filter is a spatial denoiser like 2dcleaner.  Some discussion can be found here. [YUY2]

  8.  
  9. General convolution plugin (by Richard Berg): A spatial smoother (description). This plugin will be a built-in function starting from AviSynth v2.01. [YUY2, RGB]

  10.  
  11. Wavelet Noise Reduction (by thejam): It can remove single-frequency noise in three different frequency bands, independently for X- and Y-direction and for the Y, Cr and Cb colorplane (documentation). Note that it only works for PC's with SSE instructructions. [YUY2]

  12.  
  13. Dynamical Noise Reduction 2 filter "DNR2" [YUY2, RGB]

  14.  
  15. 2D Cleaner Noise Reduction filter "_2DClenYUY2" [YUY2]
Temporal Denoisers/Smoothers:
  1. TemporalSmoother plugin (by Dividee): This filter is an adaptive noise reducer, working along the time axis. [YUY2]

  2.  
  3. GrapeSmoother (by Lindsey Dubb): When colors change just a little, the filter decides that it is probably noise, and only slightly changes the color from the previous frame. As the change in color increases, the filter becomes more and more convinced that the change is due to motion rather than noise; and the new color gets more and more weight. [YUY2]

  4.  
  5. Guava Comb (by Lindsey Dubb): Here is Guava Comb, a software comb filter.  It is meant to get rid of rainbows and dot crawl in stationary parts of an image. [YUY2]
Sharpen/Soften Plugins:
  1. TemporalSoften2 plugin (by Dividee): This plugin is better than the built-in one up to v2.02; it removes noise from a video clip by selectively blending pixels.  It is built into v2.03 and all subsequent versions (it replaces the old TemporalSoften function and it is called the same: TemporalSoften). [YUY2]

  2.  
  3. Smart sharpening filter "msharpen" (by Donald Graft): This filter is very effective at sharpening important edges without amplifying noise. [YUY2, RGB]

  4.  
  5. Sharpen/Blur filter "Focus2" (by Marc FD): Sharpen2 and Blur2 are MMX optimisations of the build in Sharpen and Blur functions. [YUY2, RGB]

  6.  
  7. Unfilter plugin (by Tom Barry): this is a filter that softens/sharpens a clip: description. [YUY2]
Resizers:
  1. Lanczos resize filter (Implemented by Nic): Starting from v2.06 AviSynth will have faster a built-in lanczos3 resizer. [YUY2, RGB]

  2.  
  3. SimpleResize plugin (by Tom Barry): A very simple and fast 2 tap linear interpolation. It is unfiltered which means it will not soften much. [YUY2]
Subtitles:
  1. VobSub plugin (by Gabest): A plugin for importing your subtitles. [YUY2, RGB]
MPEG Decoder (source) Plugins:
  1. "MPEG2DEC" (by dividee): Mpeg2dec is a plugin which enables AviSynth to import MPEG2 files.

  2.  
  3. "MPEG2DEC2" (by Tom Barry): A MPEG2DEC.DLL sustitute.  It´s the same MPEG2DEC.DLL with SSE2 optimization. Faster with PIV CPU.

  4.  
  5. "MPEG2DEC3" (by Marc FD): A MPEG2DEC.DLL mod with deblocking and deringing.

  6.  
  7. "mpegDecoder" (by Nic): A MPEG2DEC.DLL sustitute.  Can also read MPEG-2 Transport Streams (VOB) and works very fast.
Have a look at Q39 for more information about the mpeg2dec-plugins.

Misc Plugins:

  1. ImageSequence plugin (by Bzzz2): A plugin that allows to open image sequences.

  2.  
  3. Robust duplicate frame detector "Dub" (by Donald Graft): This filter reduces the size of anime movies by "removing" duplicated frames. [YUY2]

  4.  
  5. Tweak plugin (by Donald Graft): Adjusts hue, saturation, brightness, and contrast.  This plugin is a built in function starting from AviSynth v2.01. [YUY2]

  6.  
  7. WarpSharp, Xsharpen, SmartSmoothHiQ, UnsharpMask, UVTimingH, UVTimingV, LoadAviUtlInputPlugin, Auto24FPS, AutoDeint, FrameCache (by GuiltyX)]: Ported VirtualDub filters. [YUY2]

  8.  
  9. MergeLuma/MergeChroma plugin (by Klaus Post): This plugin is a built-in function starting from AviSynth v2.01. [YUY2]

  10.  
  11. AntiBlink (by Kurosu): Tries to diminish the shimmering (rainbow effect) on areas with great variation of luminance (for instance, letters). [YUY2]

  12.  
  13. CopySame filter (by Mark FD): this filter reduces the size of anime movies by "removing" duplicated frames. [YUY2]

  14.  
  15. Blockbuster (by SansGrip): With this filter one can use several methods trying to reduce or eliminate DCT blocks: adding noise (Gaussian distributed), sharpening, or by blurring.  Some discussion can be found here. [YUY2, RGB ?]

  16.  
  17. Ghostbuster (by SansGrip): This filter is based on Exorcist.  It removes "ghosts" from a clip.  A ghost in this context is a faint copy of the picture offset horizontally.  It works by either subtracting or adding the image from itself at the specified offset. [YUY2]

  18.  
  19. BorderControl plugin (by Simon Walters): After capturing video you might want to crop your video to get rid of rubbish.  BorderControl enables you to smear added borders instead of adding solid borders preventing artefacts between picture and border. [YUY2]

  20.  
  21. ChromaShift (by Simon Walters): ChromaShift shifts the chrominance information over to the right by two pixels to compensate for incorrect Y/UV registration. [YUY2]

  22.  
  23. ViewFields/UnViewFields (by Simon Walters): ViewFields and UnViewFields are a complementary pair of filters to display and identify top and bottom fields from an interlaced source. [YUY2]

  24.  
  25. MJPEGcorrect plugin: Luma (brightness) in MJPEG decoders is often decoded incorrectly to the YUV luma-range, a special plugin was written specifically to fix this issue with MJPEG videos, description. [YUY2]

  26.  
  27. Many VirtualDub filters, see Q33-Q36. [RGB32]
Q29: How do I convert between the colorspaces ?

A: Converting to YUY2:

ConvertToYUY2

and for converting to RGB:

ConvertToRGB

Note that converting between colorspaces isn't completely lossless, and doing several conversions back and forth may degrade your signal. The first conversion back and forth does not hurt your source, but if you use three or more, it may.  Starting with version v2.03, there is a ConvertBackToYUY2 which offers better symmetry if your RGB source was previously converted from YUY2.
 

Q30: What/when do I care when filter X works in RGB- or YUV-space ?

A: The main reason why you should care is the improvement in speed you can obtain by not unnecessarily changing between colorspaces.  If your source is YUV (when encoding DVD's for example, or captures from digital sources) try to use only filters/plugins which work in YUV-space.  On the other hand if your source is in RGB (for example from analog captures) try to use only filters/plugins which work in RGB-space.

Speed is also quite different between the different colorspaces, because each colorspace takes up different amounts of memory.  The slowest colorspace is usually RGB24, because every pixel has an odd alignment in memory, avoid using this mode.  The fastest mode is usually YUY2, because data only takes up half as much space as RGB32.  So if you have to process your video a lot, try using ConvertToYUY2 before you do your filtering.  Note that ConvertToRGB converts to RGB32 if the source is YUY2 - use ConvertToRGB32 to force a RGB24 to RGB32 conversion.

You should also consider your destination colorspace.  If you plan on converting to DivX/Xvid/Huffyuv in VirtualDub without applying filters in VirtualDub, "Fast Recompress" will deliver the YUY-data directly to the codec, saving you another colorspace conversion.  On the other hand, if you plan using TMPGEnc or VirtualDub in "Full Processing" mode, you may consider delivering the source as RGB.
 

Q31: I tried to use the Dissolve filter, but it doesn't seem to work ?

A: The Dissolve filter doesn't work in v1.0b5.  Upgrade to v1.0b6 or v2, see also Q2 and Q3.
 

Q32: Is there a fade in/out filter ?

A: There is only a fade out filter called "FadeOut"/"FadeOut2".  Starting from v2.07 there are also FadeIn filters: FadeIn/FadeIn2.  If you are using an older version, there are two ways to make a FadeIn filter:

The first way (using the Dissolve filter, the Blackness filter and the FadeOut2 filter) is described on the FadeOut page.  The second way (using the FadeOut2 filter and the Reverse filter):

Reverse(FadeOut2(Reverse(clip), n))
 

S4: Importing filters from VirtualDub:
 

Q33: Where can I download the latest version of scripts which import filters from VirtualDub ?

A: The AviSynth scripts are on the ShareFunctions page, or you can download a package called vdub_filtersv15.zip from http://forum.doom9.org/showthread.php?s=&threadid=23804 or http://shelob.mordor.net/dgraft/hosted.html.
 

Q34: Which filters are imported ?

A: Most filters.  Read the corresponding documentation.
 

Q35: Do these scripts work in RGB-space or in YUV-space ?

A: Only in RGB-space.
 

Q36: How do I make such a script ?

A: Example script (this VirtualDub filter can be downloaded from Donalds homepage):

Smart Bob by Donald Graft:

function VD_SmartBob(clip clip, bool "show_motion", int "threshold", bool "motion_map_denoising")
  LoadVirtualdubPlugin("d:\bob.vdf", "_VD_SmartBob", 1)
  return clip.SeparateFields._VD_SmartBob(clip.GetParity?1:0,
    \  default(show_motion, false)?1:0, default(threshold, 10),
    \  default(motion_map_denoising, true)?1:0)
}

The VirtualDub plugin is imported with the command "LoadVirtualdubPlugin".  The first argument gives the path of the plugin, the second argument the name for the plugin that will be used in the script and the third argument is called the preroll.

The preroll should be set to at least the number of frames the filter needs to pre-process to fill its buffers and/or updates its internal variables.  This last argument is used in some filters like: SmartBob, SmartDeinterlace, TemporalCleaner and others.  The reason is that due to filtering architecture of Virtual Dub the future frames can't be accessed by a filter.  Dividee reports: "In the "Add filter" dialog of VirtualDub, some filters have a "Lag:" value in their description. I think this is the value that must be used as preroll.  Unfortunately, this indication is not always present.  In those cases you have to guess."  Of course you can always ask the creator of the filter.

The first step is to find out the sequence of the arguments in the last line where the clip is returned.  Configure the script in VirtualDub and select "Save processing Settings" in the File Menu or press Ctrl+S.  Open the created .vcf file with a text editor and you should see lines like this:

VirtualDub.video.filters.Add("smart bob (1.1 beta 2)");
VirtualDub.video.filters.instance[0].Config(1, 0, 10, 1);

The order of the arguments is the one that has to be used in AviSynth.  To find the role of the arguments, play with them in VirtualDub and examine the resulting lines.

The second step is to test the filter and to compare it with the VirtualDub filter itself.  For the programming itself you can learn a lot by looking at the script which are already contained in vdub_filters.avs.

Example script which uses the function VD_SmartBob:

Import("d:\vdub_filters.avs")
AviSource("d:\filename.avi")
ConvertToRGB32  # only when necessary (but doesn't hurt)
VD_SmartBob(1, 0, 10, 1)
ConvertBackToYUY2  # only when necessary
 

S5: Plugins:
 

Q37: Which plugins are available and where do I get them ?

A: See Q28.
 

Q38: How do I load a plugin in to AviSynth ?

A: Use "LoadPlugin".  An example script:

LoadPlugin("d:\mpeg2dec.dll")
mpeg2source("d:\filename.d2v")
ResampleAudio(44100)  # Add ResampleAudio if you use CCE 2.50 and you experience CCE SP crashes.

Starting from v2.05 you can use its auto-plugin loading future.  Open notepad and type the following:

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Avisynth]
"PluginDir"="c:\\program files\\avisynth\\plugins"

Change the path above if necessary and make sure you created the plugin-dir as well.  Save it as install_autoplugin.reg, and merge it to your registry file by right-clicking on it in your explorer.  Finally move all your plugins/script-functions into the plugin directory.  Those plugins should override the internal filters.  Starting from v2.06 AviSynth comes with an installer, so there's no need to mess around with registry files.
 

Q39: What are mpeg2dec.dll/mpeg2dec2.dll/mpeg2dec3.dll and where can I find those plugins ?

A: mpeg2dec.dll/mpeg2dec2.dll/mpeg2dec3.dll are plugins (if you experiences crashes try the second which is more robust) which enable AviSynth to import MPEG2 files.  Mpeg2source returns the frames in YUV format.

mpeg2dec.dll is available (including some filters) at Dividees homepage, mpeg2dec2.dll is available at trbarry homepage and Marc FD's plugin mpeg2dec3.dll is available at http://forum.doom9.org/showthread.php?s=&threadid=34253&pagenumber=2.

The main difference is that mpeg2dec2.dll is more rubust than mpeg2dec.dll, and mpeg2dec3.dll (which is based on Dividees mpeg2dec.dll) contains Nics post processing (like deblocking and deringing).
 

Q40: How do I use the SpatialSoftenMMX plugin ?

A: The plugin can be downloaded from Dividees homepage, see read the news on 18/08.  For an explanation of this plugin, look here.
 

Q41: When i try to use SpatialSoftenMMX, it crashes in VirtualDub ?

A: You probably used this filter before resizing. Apperently SpatialSoftenMMX doesn't like resolutions that cannot be divided by 8 or 16.  So if you use it after resizing it works, of course.
 

Q42: How do I use and where can I get the "Subtitler" and "BMP Loader" plugins ?

A: These dll files are created by DVD2SVCD and only DVD2SVCD is using them.  But you can also use them in AviSynth, look here.
 

Q43: Where can I find the Flask/Xmpeg/DVDx and Premiere plugins ?

A: You can find them on Edwins homepage, download the package "Premiere Video Server Plugin v0.93+client dll".  This package contains the Flask and Premiere plugins.  In the readme.txt file of the package you will see how to use the Flask plugin in XMPEG and DVDx.

See http://nickyguides.digital-digest.com/frameserve-flask.htm or http://www.vcdhelp.com/premiereavisynth.htm how to use AviSynth as frameserver between Flask/Premiere and TMPGEnc, CCE SP, VirtualDub, WMP6.4.  This guide explains the frameserving using "Avisynth 1.0beta31 + plugin 0.28beta 37".  This can also be done, but if you want to use a new version of AviSynth I suggest to use the "Video Server Plugin" instead.

For frameserving avisynth to other programs such as Premiere, Ulead etc, see Q13
 

Q44: Are the Flask and Premiere plugins different ?

A: Yes, Flask does not support random access while adobe Premiere does.