<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://avisynth.nl/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://avisynth.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AlanHK</id>
		<title>Avisynth wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://avisynth.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AlanHK"/>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Special:Contributions/AlanHK"/>
		<updated>2026-04-07T16:01:26Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.24</generator>

	<entry>
		<id>http://avisynth.nl/index.php/Plugins</id>
		<title>Plugins</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php/Plugins"/>
				<updated>2014-11-20T03:07:30Z</updated>
		
		<summary type="html">&lt;p&gt;AlanHK: /* Plugin autoload and name precedence v2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Commands for loading plugins ==&lt;br /&gt;
&lt;br /&gt;
With these functions you can add external functions to AviSynth.&lt;br /&gt;
&lt;br /&gt;
 LoadPlugin (&amp;quot;filename&amp;quot; [, ...])&lt;br /&gt;
&lt;br /&gt;
Loads one or more external avisynth plugins (DLLs).&lt;br /&gt;
&lt;br /&gt;
 LoadVirtualDubPlugin (&amp;quot;filename&amp;quot;, &amp;quot;filtername&amp;quot;, preroll)&lt;br /&gt;
&lt;br /&gt;
This loads a plugin written for [[VirtualDub]]. &amp;quot;filename&amp;quot; is the name of the .vdf file. After calling this function, the filter will be known as &amp;quot;filtername&amp;quot; in AviSynth. VirtualDub filters only supports [[RGB32]]. If the video happens to be in RGB24-format, then you must use [[ConvertToRGB32]] ([[ConvertToRGB]] won't suffice).&lt;br /&gt;
&lt;br /&gt;
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 updates its internal variables.&lt;br /&gt;
&lt;br /&gt;
 LoadVFAPIPlugin (&amp;quot;filename&amp;quot;, &amp;quot;filtername&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
This allows you to use VFAPI plugins (TMPGEnc import plugins).&lt;br /&gt;
&lt;br /&gt;
 LoadCPlugin (&amp;quot;filename&amp;quot; [, ...])&lt;br /&gt;
 Load_Stdcall_Plugin (&amp;quot;filename&amp;quot; [, ...])&lt;br /&gt;
&lt;br /&gt;
Loads so called Avisynth C-plugins (DLLs).&lt;br /&gt;
Load_Stdcall_Plugin() is an alias for LoadCPlugin(). &lt;br /&gt;
C-plugins are created on pure C language and use special &amp;quot;AviSynth C API&amp;quot; (unlike ordinary Avisynth plugins which are created with MS C++). C-plugins must be loaded with LoadCPlugin() or Load_Stdcall_Plugin().&lt;br /&gt;
&lt;br /&gt;
Kevin provides a LoadCPlugin.dll that overloads the LoadCPlugin() verb to support plugins compiled using the C subroutine calling sequence, use Load_Stdcall_Plugin() to load stdcall calling sequence plugins when using Kevins version. Advice: keep these plugins outside your auto plugin loading directory to prevent crashes. ([http://forum.doom9.org/showthread.php?s=&amp;amp;threadid=58840 discussion]), ([http://kevin.atkinson.dhs.org/avisynth_c/ AVISynth C API (by kevina20723)]).&lt;br /&gt;
&lt;br /&gt;
== Plugin autoload and name precedence v2 ==&lt;br /&gt;
&lt;br /&gt;
It is possible to put all plugins and script files with [[User_defined_script_functions|user-defined functions]] or (global) [[Script_variables|variables]] in a directory from where all files with the extension .AVSI (v2.08, v2.5, the type was .AVS in v2.05-2.07) and .DLL are loaded at startup, unloaded and then loaded dynamically as the script needs them.&lt;br /&gt;
&lt;br /&gt;
.AVSI 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.&lt;br /&gt;
&lt;br /&gt;
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):&lt;br /&gt;
 &lt;br /&gt;
 REGEDIT4&lt;br /&gt;
 &lt;br /&gt;
 [HKEY_LOCAL_MACHINE\SOFTWARE\Avisynth]&lt;br /&gt;
 &amp;quot;plugindir2_5&amp;quot;=&amp;quot;c:\\program files\\avisynth 2.5\\plugins&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The order in which function names take precedence is as follows:&lt;br /&gt;
&lt;br /&gt;
* user-defined function (always have the highest priority)&lt;br /&gt;
** plugin-function (higher priority than built-in, will override a built-in function)&lt;br /&gt;
*** built-in function&lt;br /&gt;
&lt;br /&gt;
Inside those groups the function loaded at last takes precedence, there is no error in a namespace conflict.&lt;br /&gt;
&lt;br /&gt;
== Plugin autoload and conflicting function names v2.55 ==&lt;br /&gt;
&lt;br /&gt;
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 auto-generates the additional names both for auto-loaded plugins and for plugins loaded with LoadPlugin.&lt;br /&gt;
&lt;br /&gt;
'''Some examples:'''&lt;br /&gt;
&lt;br /&gt;
 # using fielddeinterlace from decomb510.dll&lt;br /&gt;
 AviSource(&amp;quot;D:\captures\jewel.avi&amp;quot;)&lt;br /&gt;
 decomb510_fielddeinterlace(blend=false)&lt;br /&gt;
&lt;br /&gt;
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):&lt;br /&gt;
&lt;br /&gt;
 # using mpeg2source from mpeg2dec.dll&lt;br /&gt;
 mpeg2dec_mpeg2source(&amp;quot;F:\From_hell\from_hell.d2v&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
or with mpeg2dec3.dll (which outputs YV12):&lt;br /&gt;
&lt;br /&gt;
 # using mpeg2source from mpeg2dec3.dll&lt;br /&gt;
 mpeg2dec3_mpeg2source(&amp;quot;F:\From_hell\from_hell.d2v&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Back to [[AviSynth Syntax]].&lt;br /&gt;
&lt;br /&gt;
[[Category:AviSynth_Syntax]]&lt;br /&gt;
[[Category:Scripting_Basics]]&lt;/div&gt;</summary>
		<author><name>AlanHK</name></author>	</entry>

	</feed>