Log in

View Full Version : Foolproof and automatic loading of AVS 2.0x plugins


Richard Berg
19th July 2003, 18:54
It took me enough tinkering with this process that I thought I'd share the exact steps.

Download:
LoadPluginEx.dll (http://www.avisynth.org/FileHosting/users/richardb/files/LoadPluginEx2.dll) -- dunno exactly which package it came out of, but it's the one that works
oldPlugins.avsi (http://www.avisynth.org/FileHosting/users/richardb/files/oldPlugins.avsi) -- autoloading script

Make a subdirectory off your plugins directory and stick your preferred AVS 2.0x plugins there. Add LoadPluginEx2.dll to the same folder. (My DLLs are numbered because I was experimenting with several versions, but you can call it whatever you want so long as you update the script below).

Put the .avsi in your regular plugins directory. Open it in a text editor. Should look something like this:
LoadPlugin("c:\pf\avisynth2\plugins\old\LoadPluginEx2.dll")
LoadPlugin("c:\pf\avisynth2\plugins\old\DustV5.dll")
LoadPlugin("c:\pf\avisynth2\plugins\old\GuavaComb.dll")
LoadPlugin("c:\pf\avisynth2\plugins\old\PeachSmoother.dll")
LoadPlugin("c:\pf\avisynth2\plugins\old\SmoothHiQ.dll")

Change the path to your plugins directory if necessary, and add references to any other old plugins you may want to use. Save.

You should now be able to integrate AVS 2.0x and AVS 2.5x plugins seamlessly. Here's a script I used on last night's video capture, for instance:

cap = AviSource("d:\sg-1.avi").ConvertToYUY2
#cap = AviSource("l:\sg-1.avi").ConvertToYUY2
#crop = cap.Crop(0,56,0,-64)
crop = cap # Lindsey's filters apparently don't like crops

comb = crop.GuavaComb(mode = "NTSC", recall=75, maxVariation=15, activation=40)
peach = comb.PeachSmoother(noiseReduction=30, stability=20, spatial=100, dot=FALSE)
peach = peach.Crop(0,56,0,-64)

decomb = peach.Telecide(order=1, guide=1, post=2, vthresh=45, show=FALSE)
decomb = decomb.Decimate(cycle=5, mode=0)

dust = decomb.PixieDust(limit=2)

resize = dust.LanczosResize(640, 360)

return resize
#return StackVertical(decomb, dust)
#return cap.AssumeTFF.SeparateFields

wotef
19th July 2003, 19:30
genius, it works!

btw, is there something special about an .avsi file or is it more that the text file resides in the plugin directory?

thanks again for this nifty tip!

Richard Berg
19th July 2003, 19:48
Just as putting a DLL in the plugins directory is the same as calling LoadPlugin() on it at the top of your script, putting an AVSI file in there is like calling Invoke() on it.

This is probably not as widely known since there have been a few issues with it:
(1) code in an avsi should be limited to commands that don't affect the A/V streams, such as SetWorkingDir or anything wrapped in a function
(2) the default extension has been changed a few times to try to avoid the above conflicts (e.g., if you didn't move the *.avs documentation provided with filters, you'd get weird errors) -- we finally settled on *.avsi ("AVS Include") but I suspect many people's function collections (http://www.avisynth.org/index.php?page=ShareFunctions) haven't been updated

Wilbert
19th July 2003, 22:35
1) I thought that you can't use AviSynth v2.5 plugins after loading loadpluginex.dll?

2) I thought that Loadpluginex.dll is an AviSynth v2.5 plugin?

Dreassica
19th July 2003, 22:54
u can load 2.5 plugins after loadpluginex.dll, i do that all the time with no prob.
It is a 2.5 plugin but it doesnt matter in this case.

Richard Berg
20th July 2003, 01:33
1) I thought that you can't use AviSynth v2.5 plugins after loading loadpluginex.dll?

I don't think you can, but why does that matter? The LoadPlugin commands in the AVSI aren't executed until all your v2.5 plugins are already autoloaded.

2) I thought that Loadpluginex.dll is an AviSynth v2.5 plugin?
Of course it is, otherwise there'd be no point. If you're asking why I stick it in "old," the reason is because it doesn't work when it's autoloaded. (Well it does, but it then interferes with the autoloading of other v2.5 plugins). I suppose it would be clearer to create yet another directory for LoadPluginEx.dll, but I personally can't be bothered ;)

Theory aside, all I care about right now is whether it works as advertised. If so, I think this is valuable information considering how many people have had problems with it. If not, I need to know so I can withdraw my code and revise.

Wilbert
20th July 2003, 10:46
If you're asking why I stick it in "old," the reason is because it doesn't work when it's autoloaded.
I should have asked that, cause that's what I meant. You had to do that with the first version of loadpluginex.dll. But I don't have problems with the newer versions ...

If not, I need to know so I can withdraw my code and revise.
Your methods works fine :)

Richard Berg
22nd July 2003, 01:07
Sounds like a good report. Posted (http://www.avisynth.org/index.php?page=LoadOldPlugins) and linked (http://www.avisynth.org/index.php?page=Section+1%3A+About+AviSynth#q1.15) appropriately.

orion44
25th July 2023, 02:19
Is it possible to port denoise filters from Dust family and PeachSmoother to AviSynth 2.6 and AviSynth+, and also add YV12 support?

I've noticed on GitHub that some users have ported a lot of old AviSynth filters to AviSynth+ (pinterf, asd-g).

orion44
25th July 2023, 22:02
This method doesn't work with AviSynth+.

Any ideas on how to make these old filters work?

orion44
26th July 2023, 02:05
Ok, I figured it out.

I uninstalled AviSynth+ and installed AviSynth 2.6.

It now works perfectly.

Emulgator
26th July 2023, 15:02
Multiple installations side by side:
https://forum.doom9.org/showthread.php?t=172124