View Full Version : One avisynth script for different bitness (64 and 32). How?
silverwing
7th February 2019, 22:06
Hi, All!
Two Avisynth+ (and two MEGUI, respectively) are installed on my system: 64 bit and 32 bit.
At the moment, I am making two scripts depending on the bitness of avisynth, because the DLLs are different. Both scripts perform the same task.
Here is an example:
(32 bit)
...
LoadPlugin ("D:\Megui_X86\tools\avisynth_plugin\mvtools2.dll")
... etc
(64 bit)
...
LoadPlugin ("D:\Megui_X64\tools\avisynth_plugin\mvtools2.dll")
... etc
I want a strange one: make one universal avisynth script that will work in both cases (32 bit and 64 bit).
Something like this (IMHO, GScipt can do if-else):
if (avisynth_bitness == 64)
PluginPath = "D:\Megui_X64\tools\avisynth_plugin\"
else
PluginPath = "D:\Megui_X86\tools\avisynth_plugin\"
LoadPlugin($PluginPath + "mvtools2.dll")
Is it possible like that? If possible, please help with an example or give a specific link where you can read about it.
Thank you for attention.
(Sorry for my bad English)
sneaker_ger
7th February 2019, 22:18
http://avisynth.nl/index.php/Internal_functions#GetProcessInfo
ChaosKing
8th February 2019, 00:09
This should work
version()
PluginPath = (GetProcessInfo == 64) ? "D:\Megui_X64\tools\avisynth_plugin\" : "D:\Megui_X86\tools\avisynth_plugin\"
subtitle(PluginPath)
silverwing
8th February 2019, 03:44
sneaker_ger, ChaosKing, Thank you very much, colleagues! :thanks:
So. Here's what I got.
PluginPath = (GetProcessInfo() == 64) ? "D:\Megui_X64\tools\avisynth_plugin\" : "D:\Megui_X86\tools\avisynth_plugin\"
...
LoadPlugin(PluginPath + "mvtools2.dll")
And it works (checked on 32-bit and 64-bit avisynth+)! Thanks again.
P.S. There is a nuance, of course. Sometime in the future, on a 128-bit Windows system, this focus on 128-bit avisynth++ will not work. :)
It will be necessary to write something like:
AvsBitness = GetProcessInfo()
if (AvsBitness == 128) {
PluginPath = "D:\Megui_X128\tools\avisynth_plugin"
}
else if (AvsBitness == 64) {
PluginPath = "D:\Megui_X64\tools\avisynth_plugin"
}
else {
PluginPath = "D:\Megui_X32\tools\avisynth_plugin"
}
StainlessS
8th February 2019, 05:24
If you use Groucho2004 "Universal Avisynth Installer" :- https://forum.doom9.org/showthread.php?t=172124
You can install both x86 and x64 Avs+, and with the appropriate mvtools2.dll in each of the autoload plugin directories, then there would be no problem (ie you dont need to load it).
Dont know if Grouchy will still be around when AVS+ x128 will be unveiled [might have moved on from D9, or be "as dead as a doornail", would be a nuisance either way.].
silverwing
8th February 2019, 06:19
StainlessS
Yes thank you. :thanks:
I read the topic about "Universal Avisynth Installer".
But this does not quite suit me for several reasons.
1. I just need to deploy from my USB flash one of the archives with MeGUI (32-bit or 64-bit - depending on the system bitness) on any accessible computer with Windows 7 (8, 10). And get started.
2. The account on computer may not have administrative privileges to install avisynth. In the portable MeGUI framework, avisynth is included with this framework. You do not need to install anything - you just need to unpack the archive in any available place. And get started. :)
3. MeGUI can update avisynth (as part of the framework) automatically or manually with two or three mouse clicks. Straight from the MeGUI.
This is not an advertisement of MeGUI, it is the harsh truth of common man's life in Russia - rapid deployment and launch while a super-powerful super-multi-core computer is available. :D
P.S. About hypothetical AVS + x128 (on Windows x128). As one of Hemingway's heroes (Spanish) said, "Quien sabe?". I won’t be surprised if it happens in 10 years, for example. I really hope that in those not very distant years, StainlessS and Groucho2004 will be alive and full of energy. :)
Groucho2004
8th February 2019, 10:55
Dont know if Grouchy will still be around when AVS+ x128 will be unveiled [might have moved on from D9, or be "as dead as a doornail", would be a nuisance either way.].
Most likely humanity will have extinguished itself or have moved to other planets before Avisynth 128 sees the light of day. Either way, I'll definitely be pushing daisies by then. ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.