View Full Version : Auto-loading Plugins Limit?
zilog jones
26th November 2004, 12:47
After adding a few more filter plugins recent, if I tried loading a script into VirtualDubMod, it would just open and then suddenly close again. This was after getting the screwy dll that DeFreq needed and finding out about the 'C' plugins (and how not to put them in the auto-load directory!), so I was quite annoyed by this stage when it still refused to work!
Then I realised I had over 40 filters in there by this stage, so I just randomly removed a few that I never used, and it started working again!
Is there a limit to how many filters you can load at one time, or is just a Windows memory problem? I have 512MB RAM and Win2k.
rfmmars
26th November 2004, 17:48
I have 314 VD-plug-in in my VDmod plug-in folder, but I have never tried to autoload.
richard
photorecall.net
Boulder
26th November 2004, 21:44
I don't know if there's a limit, but there are some well-known troublemakers; the numerous WarpSharp dlls are some of them.
Wilbert
29th November 2004, 10:38
Yes, there's some upper limit (but it might be a win memory problem ?). I don't remember the number of plugins I had in my folder before I noticed it.
bagheera1
17th March 2006, 15:57
Has anybody put any more thought into this?
I seem to remember a post about 60 or 70 being the limit, but that was a while ago and I cant find it anymore. I was hoping to find out more details, such as:
Is it the number of dll's in the autoload directory, or the number of functions that a dll gives you (telecide,fielddeinterlace,decimate,iscombed are all part of one dll)?
does the import avs count against you?
do avsi's count against you?
is there a workaround other than specifying loadplugin (maby a windows setting)?
this seems to be an annoyance problem rather than a real ass-kicker, but it would be nice to not be annoyed.
rfmmars
17th March 2006, 16:46
Yes, there's some upper limit (but it might be a win memory problem ?). I don't remember the number of plugins I had in my folder before I noticed it.
It must be the selection, however I do have all 340 installed in the plugin directory. It take about 10 seconds for VD to load with all of them. Are we talking the number of plugins in the chain or installed? Besides that I run sometimes 6 copies at a time without a problem using 5 workstations, so I think it must a certain plugin.
Richard
bagheera1
17th March 2006, 17:32
rfmmars
are you refering to virtualdub plugins, or avisynth filters?
I had 53 in my autoload dir, and when I enable tdeint, I get:
Avisynth open failure:
Script error: there is no function named "VagueDenoiser"
VagueDenoiser is the last one in my directory, if I remove a dll (it doesn't have to be the tdeint) by adding .tmp to its name (in this case tcpdeliver), the script loads fine.
rfmmars
17th March 2006, 17:59
rfmmars
are you refering to virtualdub plugins, or avisynth filters?
I had 53 in my autoload dir, and when I enable tdeint, I get:
Avisynth open failure:
Script error: there is no function named "VagueDenoiser"
VagueDenoiser is the last one in my directory, if I remove a dll (it doesn't have to be the tdeint) by adding .tmp to its name (in this case tcpdeliver), the script loads fine.
I thought you were talking VD, sorry for the mistake.
Richard
tritical
17th March 2006, 18:24
The current avisynth limit is 50... that is, avisynth can have a maximum of 50 filter dll's/.vfds (it doesn't matter how many functions the dll has) loaded at any one time. How prescanning works is it searches for .dlls/.vdf's in the plugin directory, loads them, finds any functions in the plugin and stores that information+name. It will do this for a maximum of 50 at which point it can't load anymore. Once it has all the info stored it then unloads all the prescanned plugins. After that, avisynth does .avsi file loading.
An important point to remember is that any filters loaded with LoadPlugin() (even if they are in an avsi file) will not be unloaded if they are not actually required, that means that they stay loaded taking up one of the 50 available slots.
Now, when you attempt to open a script and avisynth finds that it needs to invoke function x it first searches for the required function in currently loaded dlls. If doesn't find it it searches for it in prescanned dlls (which have been unloaded). If it finds it it attempts to load the needed dll (which if there are already 50 plugins loaded will fail). If it still doesn't find the function it searches the internal function list.
So, yes it would be possible to modify the prescan function so that it can load the info for any number of plugins. Just unload each prescanned plugin after the information from it is obtained instead of keeping it around (since it will be unloaded anyways)... that way the limit of 50 would never be reached during prescan.
bagheera1
17th March 2006, 22:55
Thank you for your very informative post.
from your description, it sounds like this prescan modification would be a worthwhile change.
are there any plans to include this in future builds?
as I have already said, it's not a hard problem to work around, now that I know what to look for, but it was sure a killer the first time I got the error.
tritical
18th March 2006, 04:18
I think it would be a good idea to change it as well... I can't really see any down sides and it only takes about 3 lines of code. I added it into the builds of avisynth that I keep on my site if you want to test. As soon as the loaded plugins number reaches 20+ during prescan it unloads all the currently loaded plugins. I'll see if IanB or another dev can add the changes to cvs.
bagheera1
18th March 2006, 16:42
@tritical
I just tried both instaler versions of avisynth on your web site, and the unlimited filter loading seems to work nicely, however there is a side effect.
avisynth fails when this avsi is present
load old plugins.avsi
--------------------------
LoadPlugin("C:\Program Files\AviSynth 2.5\LoadOldPlugin\LoadPluginEx.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\LoadOldPlugin\DustV5.dll")
#LoadPlugin("C:\Program Files\AviSynth 2.5\LoadOldPlugin\warpsharp.dll")
------------------------------------
from your description in your two posts in this thread, I would guess that your 20 plugin loop is including avsi's, and not saving them 'til last.
I looked at your code, but not knowing C++, and not having been a programmer since I used a Teletype and a Data General Eclipse S200 (also punch cards, but I tried to stay away from those, but wathing the card sorter was fun), I thought I'd stay out of the way and just pass along the info.
tritical
19th March 2006, 03:14
Actually, it is a result of another change. In my builds external plugins are no longer allowed to override the internal functions LoadPlugin() and LoadCPlugin(), which LoadPluginEx does. However, you can still access the external plugin's version using dllname_function(). So change your avsi to:
LoadPlugin("C:\Program Files\AviSynth 2.5\LoadOldPlugin\LoadPluginEx.dll")
loadpluginex_LoadPlugin("C:\Program Files\AviSynth 2.5\LoadOldPlugin\DustV5.dll")
The benefit of making it that way is that you can do:
LoadPlugin("2.5filter.dll")
LoadPlugin("loadpluginex.dll")
loadpluginex_LoadPlugin("2.0filter.dll")
LoadPlugin("2.5filter.dll")
loadpluginex_LoadPlugin("2.0filter.dll")
So you no longer have to worry about making sure that you load all 2.5 filters before loading a filter that overrides LoadPlugin().
bagheera1
20th March 2006, 15:20
I used you suggested avsi modification and it worked like a charm. I'm still fuzzy on why it works like a charm, but after some more study, I'm sure it will come to me.
By the way, after looking at my last post I see that it could have been interpreted wrong.
I was not trying to be critical, I certainly could have phrased it better.
tritical
20th March 2006, 18:14
It's no problem, I didn't see it as critical and it was phrased fine. Plus, there was no way you could have known about that internal change... and the likelihood that I screwed something up is usually pretty good.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.