Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th November 2004, 12:47   #1  |  Link
zilog jones
Registered User
 
zilog jones's Avatar
 
Join Date: Mar 2004
Location: Ireland
Posts: 481
Auto-loading Plugins Limit?

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.
zilog jones is offline   Reply With Quote
Old 26th November 2004, 17:48   #2  |  Link
rfmmars
Registered User
 
Join Date: Feb 2004
Posts: 743
I have 314 VD-plug-in in my VDmod plug-in folder, but I have never tried to autoload.

richard
photorecall.net
rfmmars is offline   Reply With Quote
Old 26th November 2004, 21:44   #3  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,717
I don't know if there's a limit, but there are some well-known troublemakers; the numerous WarpSharp dlls are some of them.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 29th November 2004, 10:38   #4  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
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.
Wilbert is offline   Reply With Quote
Old 17th March 2006, 15:57   #5  |  Link
bagheera1
Registered User
 
bagheera1's Avatar
 
Join Date: Oct 2005
Posts: 46
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.
bagheera1 is offline   Reply With Quote
Old 17th March 2006, 16:46   #6  |  Link
rfmmars
Registered User
 
Join Date: Feb 2004
Posts: 743
Quote:
Originally Posted by Wilbert
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
rfmmars is offline   Reply With Quote
Old 17th March 2006, 17:32   #7  |  Link
bagheera1
Registered User
 
bagheera1's Avatar
 
Join Date: Oct 2005
Posts: 46
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.
bagheera1 is offline   Reply With Quote
Old 17th March 2006, 17:59   #8  |  Link
rfmmars
Registered User
 
Join Date: Feb 2004
Posts: 743
Quote:
Originally Posted by bagheera1
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
rfmmars is offline   Reply With Quote
Old 17th March 2006, 18:24   #9  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
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.

Last edited by tritical; 17th March 2006 at 18:27.
tritical is offline   Reply With Quote
Old 17th March 2006, 22:55   #10  |  Link
bagheera1
Registered User
 
bagheera1's Avatar
 
Join Date: Oct 2005
Posts: 46
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.
bagheera1 is offline   Reply With Quote
Old 18th March 2006, 04:18   #11  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
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.

Last edited by tritical; 18th March 2006 at 04:26.
tritical is offline   Reply With Quote
Old 18th March 2006, 16:42   #12  |  Link
bagheera1
Registered User
 
bagheera1's Avatar
 
Join Date: Oct 2005
Posts: 46
@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.
bagheera1 is offline   Reply With Quote
Old 19th March 2006, 03:14   #13  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
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().

Last edited by tritical; 19th March 2006 at 03:19.
tritical is offline   Reply With Quote
Old 20th March 2006, 15:20   #14  |  Link
bagheera1
Registered User
 
bagheera1's Avatar
 
Join Date: Oct 2005
Posts: 46
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.
bagheera1 is offline   Reply With Quote
Old 20th March 2006, 18:14   #15  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
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.
tritical is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:58.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.