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. |
|
|
Thread Tools | Search this Thread | Display Modes |
9th December 2006, 13:11 | #1 | Link |
Registered User
Join Date: Mar 2005
Posts: 457
|
Loading External .dll into AviSynth (LoadDll Plugin Inside)
Hi,
i don't know if this function is already present and i'm not aware of it. There is a way to load a /system32 .dll directly into .avs without having to put them in the above directory? Some plugins need external dll to be present in /system32. There is a way to load them like simple plugins, so they can be stored in other directories other than /system32? Thanks UPDATE: Thank to tsp there is now a plugin "LoadDll" you can download here Last edited by 3ngel; 18th December 2006 at 17:54. |
9th December 2006, 13:15 | #2 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,182
|
you can put DLL (not plugin) to any folder, if you add this folder to Path in Windows setting.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
9th December 2006, 13:16 | #3 | Link |
Registered User
Join Date: Mar 2005
Posts: 457
|
I would like a solution Windows independent like
LoadSystemDll("Path/Test.dll") LoadPlugin("PluginThatNeedSystem32dll") EDIT: In this way you can do simple Autoloading packages with those plugin who requires many external .dlls installed. Last edited by 3ngel; 9th December 2006 at 13:27. |
9th December 2006, 15:24 | #6 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,182
|
probably in some other world it could be done so way,
but in our case in existed avisynth and plugins it is implemented differently. (they all must be edited and recompiled). can you live without it? |
11th December 2006, 08:09 | #9 | Link |
Registered User
Join Date: Aug 2005
Posts: 16,267
|
@3ngel
Assuming you have placed the .DLL in your "AVISYNTH" folder, try typing the following line from the "Run" box (available by clicking on the Windows "Start" radiobutton: c:\windows\system\regsvr32 C:\AVISYNTH\system32.dll (Note the SPACE after "regsvr32") Last edited by setarip_old; 11th December 2006 at 08:11. |
11th December 2006, 09:10 | #10 | Link |
Angel of Night
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,562
|
That'll only work on win9x (on nt it's in system32), but since it's on the path using just "regsvr32" works. But here, he's trying to use a standard dll, not a COM server, so loadlibrary won't pick it up even if it does register.
It's possible to read the registry to find the avisynth plugin folder, but there's no requirement for it to be there, so... best to use Ian's solution. |
11th December 2006, 09:30 | #11 | Link |
Registered User
Join Date: Mar 2005
Posts: 457
|
@IanB
but SetWorkingDir() is a avisynth command? (in the case i'll try) Next i would like to do a simple observation. I don't know in what lang avisynth is written, but in C++ there is a simple LoadLib() that load a .dll in memory. I don't think is so complicated to wrap the function in a object (assuming is C++) that load a .dll in memory with a "Global Scope" in order to be visible by the plugin called next. At the end of the script there would be (obviously) another function to unload the .dll from memory UnloadSystemDll() Is so complicated? EDIT: In case the plugins are mapped as "out of process" threads you could implement a wide-system hooking technique as explained here. Last edited by 3ngel; 11th December 2006 at 11:35. |
11th December 2006, 13:06 | #12 | Link | ||
Registered User
Join Date: Mar 2005
Posts: 457
|
Quote:
In the late case there would be no problem at all Quote:
|
||
11th December 2006, 14:18 | #13 | Link |
Registered User
Join Date: Mar 2005
Posts: 457
|
@IanB
Mine was not a critic, obviously, i was just politely discussing I didn't want to put the "problem" on you, i was just showing a situation that can happen. From a user point of view, i am not able to fix the dumb plugin so i expect a little help from the server. The problem is exactly the opposite: the needed library are not static linked. Honestly i don't see all this risk. When a plugin requires external.dll and it's badly written, and it doesnt' find in memory, nor system32 dir, the only thing Avysinth would do is only Preload the needed library (that i specify) in memory, so instead of looking for the disklibrary it finds already in memory. It doesn't involve knowing the name of the functions. In the specific situation, one of is fft3dfilter that requires fftw3.dll to be put forcefully in system32 (it doesn't work in current dir). Last edited by 3ngel; 11th December 2006 at 14:21. |
11th December 2006, 15:03 | #14 | Link |
Angel of Night
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,562
|
Ah, but that's because avisynth plugin folder isn't the current working directory, it's the host's. If you put it in virtualdub's folder, and load the script in vdub, it'll load it just fine. (Unless you modified a shortcut to vdub to point to another folder as the cwd, which is one way around all this. But then I think vdub itself wouldn't be too happy.)
|
13th December 2006, 22:45 | #15 | Link | |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,182
|
i get this message private from 3ngel, but it is not private.
Quote:
2. But current path for DLL search is not your the avs dir, but folder of host application (virtualdub or other), that loads the avisynth.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
|
14th December 2006, 16:55 | #16 | Link | |
Registered User
Join Date: Mar 2005
Posts: 457
|
Quote:
|
|
14th December 2006, 19:56 | #17 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,182
|
Put non-plugin DLL at plugin folder is (was ?) bad practice.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
14th December 2006, 20:05 | #19 | Link |
Registered User
Join Date: Aug 2004
Location: Denmark
Posts: 807
|
if you put a non-avisynth plugin dll in the avisynth autoload folder avisynth will waste a small amount of time figuring out that the dll is not a plugin when the script is loaded.
__________________
Get my avisynth filters @ http://www.avisynth.org/tsp/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|