» AviSynth is a powerful video FrameServer for Win32.

AviSynth Links:
»Learn to script
»Discussion fora
»Project page
»External filters

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

» AboutAviSynth




( Diese Seite in flag-germany.gif Deutsch )


With these functions you can add external plugins to AviSynth. Many of these plugins are VERY helpful!

LoadPlugin(string filename [, ...])

loads one or more external plugins. These plugins have to use the AviSynth external plugin interface, for which some preliminary documentation is available in the FilterSDK.

LoadVirtualDubPlugin(string filename, string filtername, int preroll)

loads a plugin written for VirtualDub. "filename" is the name of the .vdf file. After calling this function, the filter will be known as "filtername" in AviSynth. VirtualDub filters only support RGB32. Some filters' output depends on previous frames; for those, preroll should be set to at least the number of frames the filter needs to pre-process to fill its buffers and/or update its internal variables.

Convenient AviSynth-style interfaces to many VirtualDub plugins are available in the file vdub_filters.avs, which is included in some AviSynth distributions and in the ShareFunctions section. To use it, edit the VirtualDub_plugin_directory variable at the top of the file to point to your VirtualDub plugin directory and import the file in your script (using Import from ScriptFunctions).

LoadVFAPIPlugin(string filename, string filtername)

allows you to use VFAPI plugins, which are also TMPGEnc import plugins although TMPG support appears to be buggy at the moment.

Though the preceding commands still exist, starting with v2.06 of AviSynth you can specify a plugin directory for AviSynth to use. By putting all plugins, both native AviSynth and VirtualDub ones (not sure about VFAPI) in this directory, these commands become obsolete. Note that most applications using AviSynth such as GordianKnot has not been updated to reflect this change and automatically generated .avs files should have these functions removed.

LoadCPlugin?(string filename [, ...])

C-plugins must be loaded with LoadCPlugin. Advice: keep this plugin outside your auto plugin loading directory to prevent crashes. [discussion] [AVISynth C API (by kevina20723)]

Plugin autoload and name precedence v2

It is possible to put all plugins and script files with user-defined functions or (global) variables in a directory from where all files with the extension .AVS and .DLL are loaded at startup, unloaded and then loaded dynamically as the script needs them.

Scripts in this directory should only contain function definitions and global variables, no main processing section (else strange errors may occur), it also is not recommended to put other files in that directory.

The directory is stored in the registry (the registry key has changed for v2.5). You can use double-clicking a .REG-file with the following lines to set the path (of course inserting your actual path):


"PluginDir2_5"="c:\\program files\\avisynth\\plugins"

The order in which function names take precedence is as follows:

  1. user-defined function (always have the highest priority)
  2. plugin-function (have higher priority than built-in functions - they will override a built-in function)
  3. built-in function

Inside those groups the function loaded at last takes precedence, there is no error in a namespace conflict.

Plugin autoload and conflicting function names v2.55

Starting from v2.55 there is DLLName_function() support. The problem is that two plugins can have different functions which are named the same. To call the needed one, DLLName_function() support is added. It only works for auto-loaded plugins. It doesn't auto-generate the additional names for plug-ins loaded with LoadPlugin.

Some examples:

# using fielddeinterlace from decomb510.dll

Suppose you have the plugins mpeg2dec.dll and mpeg2dec3.dll in your auto plugin dir, and you want to load a d2v file with mpeg2dec.dll (which outputs YUY2):

# using mpeg2source from mpeg2dec.dll

# using mpeg2source from mpeg2dec3.dll

You can find a large selection of AviSynth plugins to download in [FAQ #3.4] and [FAQ #3.5].

SourceForge Logo


Edit this document | View document history
Document last modified Tue, 19 Oct 2004 15:18:26