View Full Version : SysInfo plugin v0.1.2.9
Groucho2004
24th February 2019, 12:26
This plugin returns info about OS/CPU*/Memory/Screen/Avisynth
System related functions:
string SI_OSVersionString()
Returns Operating System info
float SI_OSVersionNumber()
int SI_OSBuildNumber
float SI_OSServicePack
bool SI_IsOS64Bit
bool SI_IsWin10
bool SI_IsWin7
bool SI_IsWin8
bool SI_IsWin81
bool SI_IsWinServer2003
bool SI_IsWinServer2008
bool SI_IsWinServer2008R2
bool SI_IsWinServer2012
bool SI_IsWinServer2012R2
bool SI_IsWinVista
bool SI_IsWinXP
Convenience functions for the running OS
string SI_CPUName()
Returns the CPU brand string + code name
int SI_NumberOfCPUs()
Returns the number of physical CPUs in the system
int SI_PhysicalCores()
Returns the total number of physical cores in the system. If multiple CPUs
are in the system, the sum of physical cores of all CPUs is returned.
int SI_LogicalCores()
Returns the total number of logical cores in the system. If multiple CPUs
are in the system, the sum of logical cores of all CPUs is returned.
string SI_CPUExtensions()
Returns supported CPU extensions/Instruction sets.
bool SI_HasAVX
bool SI_HasAVX2
bool SI_HasAVX512
bool SI_HasFMA3
bool SI_HasFMA4
bool SI_HasMMX
bool SI_HasSSE
bool SI_HasSSE2
bool SI_HasSSE3
bool SI_HasSSE41
bool SI_HasSSE42
bool SI_HasSSSE3
Convenience functions for supported CPU extensions
int SI_TotalSystemMemory()
Returns the total system memory in MiB
int SI_AvailableSystemMemory()
Returns the available system memory in MiB
string SI_ProcessName()
Returns the name of the current process
int SI_ProcessBitness()
Returns the bitness of the current process
int SI_ModulePath()
Returns the path of the SysInfo plugin.
int SI_ScreenResX()
Returns the horizontal screen resolution
int SI_ScreenResY()
Returns the vertical screen resolution
int SI_ScreenBitsPerPixel()
Returns the screen BPP
int SI_ScreenVRefresh()
Returns the vertical refresh rate of the screen
string SI_GetEnvVar(string "env_var")
Returns the value of the environment variable "env_var"
Example:
Path = SI_GetEnvVar("PATH")
The argument "env_var" is not case-sensitive
string SI_UserName()
Returns the name of the currently logged in user
string SI_GetLogicalDrives()
Returns logical drives with labels
int SI_GetLogicalDriveTotalSize("drive_letter")
Returns the total size (in MiB) for a given drive letter
int SI_GetLogicalDriveFreeSpace("drive_letter")
Returns the free space (in MiB) for a given drive letter
int SI_GetLogicalDriveUsedSpace("drive_letter")
Returns the used space (in MiB) for a given drive letter
Avisynth related functions:
string AI_AvsFileVersion
Returns the value of the FileVersion resource property
string AI_AvsProductVersion
Returns the value of the ProductVersion resource property
int AI_AvsPlusBuildNumber
Returns the AVS+ build number
bool AI_IsAvs26
Returns true if the Avisynth VersionNumber is >= 2.6
bool AI_IsAvsPlus
Returns true for Avisynth+
string AI_AvsDLLPath()
Returns the path of the loaded avisynth.dll
string AI_AvsDLLTimeStamp()
Returns the time stamp (last write time) of the loaded avisynth.dll
bool AI_InternalFunctionExists(string "name")
Returns true if an internal function ("name") is available in the current environment
The argument 'name' is not case-sensitive
bool AI_ExternalFunctionExists(string "name")
Returns true if an external (plugin) function ("name") is available in the current environment
The argument 'name' is not case-sensitive
bool AI_FunctionExists(string "name")
Returns true if an internal or external (plugin) function ("name") is available in the current environment
The argument 'name' is not case-sensitive
string AI_AutoLoadPath(string "registry_location")
Returns the Avisynth auto-load directory/directories. Valid arguments for "registry_location" are (case sensitive!):
(See http://avisynth.nl/index.php/AviSynth%2B#New_Functions for info on the origin of these arguments)
USER_PLUS_PLUGINS
MACHINE_PLUS_PLUGINS
USER_CLASSIC_PLUGINS
MACHINE_CLASSIC_PLUGINS
Other functions:
float SysInfoVersion()
Returns SysInfo.dll version number
Download (32 & 64 bit) (http://www.mediafire.com/folder/x6f7yqjufdg7c/Groucho's_Avisynth_Stuff) (SysInfo_*.7z on the download page)
Recent changes (full history in 'ChangeLog.txt'):
v0.1.2.9
- Updated libcpuid (Intel Rocket Lake, AMD Ryzen Milan)
*CPU feature detection uses Veselin Georgiev's libcpuid C-library (https://github.com/anrieff/libcpuid).
wonkey_monkey
24th February 2019, 12:49
Another fine Groucho2004 production.
Groucho2004
24th February 2019, 12:54
Another fine Groucho2004 production.Thanks. This is my first plugin, I hope I didn't screw up.
StainlessS
24th February 2019, 15:12
Hi G2K4,
Just pointing out something that you may like to query with your provider, below from FlagFox, FireFox extension.
https://i.postimg.cc/QVQvZXRC/G2K4.jpg (https://postimg.cc/QVQvZXRC)
Maybe just means that it is not an HTTPS, dont know.
Groucho2004
24th February 2019, 15:23
Maybe just means that it is not an HTTPS, dont know.It probably isn't. I signed up for this account 20+ years ago when I was still living in Ireland and have been using it for (free) data storage since.
If it is of concern to you I might change the hosting although this host is quite convenient for me...
StainlessS
24th February 2019, 15:45
It is of no concern to me, but as I noticed it, thought I would point it out.
However, took a little look at source, and think you need to use env->SaveString() when returning strings to avs.
Avisynth has its own free store, as have you, you need hand over control and responsibility to free mem to avs.
See Here:- https://forum.doom9.org/showthread.php?p=1633936#post1633936
EDIT: http://avisynth.nl/index.php/Filter_SDK/Env_SaveString
EDIT: eg here
AVSValue SI_OSVersion(AVSValue args, void* user_data, IScriptEnvironment* env)
{
if (!bOSVersionInitialized)
GetOSVersion();
char * os;
os = new char[4096];
sprintf(os, "%s", OSVersion.c_str());
// return os;
AVSValue ret = env->SaveString(os);
delete [] os;
return ret;
}
EDITED
Groucho2004
24th February 2019, 16:00
However, took a little look at source, and think you need to use env->SaveString() when returning strings to avs.
Avisynth has its own free store, as have you, you need hand over control and responsibility to free mem to avs.
See Here:- https://forum.doom9.org/showthread.php?p=1633936#post1633936
EDIT: http://avisynth.nl/index.php/Filter_SDK/Env_SaveString
EDIT: eg here
AVSValue SI_OSVersion(AVSValue args, void* user_data, IScriptEnvironment* env)
{
if (!bOSVersionInitialized)
GetOSVersion();
char * os;
os = new char[4096];
sprintf(os, "%s", OSVersion.c_str());
// return os;
AVSValue ret = env->SaveString(os);
delete [] os;
return ret;
}
EDITED
Thanks! That stray char array was bothering me anyway.
Will change it in the next version.
silverwing
24th February 2019, 21:39
This filter returns info about OS/CPU.
Nice work! I will test. Thank you! :thanks:
Groucho2004
24th February 2019, 21:44
v0.1.0.1
- Better error handling
- Fixed some minor bugs
- Added SI_NumberOfCPUs
Groucho2004
25th February 2019, 00:20
v0.1.0.2
- Added SI_CPUClock
- Added gpl/copyright stuff
BTW, I'm open to suggestions as to what other functions to add (fitting within the scope/context of this plugin).
StainlessS
25th February 2019, 00:58
Added SI_CPUClock
...
SI_CPUClock [int]
Returns the (measured) CPU clock
So would that be whatever it is running at when measured ?
[Ie, would that be, nominal rated clock, current clock incl throttling, max burst clock (as on some ATOM chips, my Win10 ATOM Z3735F is quad @ 1.33GHz, burst to 1.8GHz).]
Guessin' current.
Groucho2004
25th February 2019, 02:35
So would that be whatever it is running at when measured ?
[Ie, would that be, nominal rated clock, current clock incl throttling, max burst clock (as on some ATOM chips, my Win10 ATOM Z3735F is quad @ 1.33GHz, burst to 1.8GHz).]
Guessin' current.It won't be the idle clock since the measuring routine will bring the CPU out of idle state. So yes, I guess it'll be current.
Anyway, I'll probably remove it since it's not terribly useful and, after reading the documentation, results can be unreliable in some cases.
Sparktank
25th February 2019, 07:41
Wow, this cool. Thanks a lot! This is bound to help plenty out in the future.
Groucho2004
25th February 2019, 14:18
v0.1.0.3
- Added SI_AvailableSystemMemory
- Removed SI_CPUClock
Groucho2004
2nd March 2019, 13:56
v0.1.0.4
- Added SI_ModulePath
- Updated some error messages
'SI_ModulePath' returns the directory in which SysInfo.dll resides and can be used for example to load DLL dependencies such as libfftw3f-3.dll via tsp's LoadDLL() (https://forum.doom9.org/showthread.php?t=173259). Example:
LoadDLL(SI_ModulePath + "\libfftw3f-3.dll")
AVISource("Test.avi")
FFT3DFilter()
ChaosKing
2nd March 2019, 14:37
Perfect! Lazy People can use a autoLoadDLLs.avsi script like this now
\plugins
\fft
LoadDLL(SI_ModulePath + "\..\fft\libfftw3-3.dll")
LoadDLL(SI_ModulePath + "\..\fft\libfftw3f-3.dll")
Groucho2004
2nd March 2019, 15:10
Perfect! Lazy People can use a autoLoadDLLs.avsi script like this now
\plugins
\fft
LoadDLL(SI_ModulePath + "\..\fft\libfftw3-3.dll")
LoadDLL(SI_ModulePath + "\..\fft\libfftw3f-3.dll")
Neat. Have not even considered that. :cool:
StainlessS
2nd March 2019, 22:09
Me does this rel Plugins (same script works both x86 & x64 & Std) [Assuming x86/x64 dlls all have same name, or could eg switch on CPU]
InitExternalPlugins.avsi
RT_DebugF("Init_ExternalPlugins")
# ...
fn6= ".\LSMASH_CPP\LSMASHSource.dll" # L-Smash CPP
Exist(fn6) ? RT_DebugF("Loading %s",fn6) : RT_DebugF("NOT FOUND %s",fn6)
Exist(fn6) ? LoadPlugin(fn6) : NOP
Groucho2004
6th March 2019, 19:33
v0.1.0.5
- Added SI_TotalSystemMemory
- Refactor/Reorganize
StainlessS
7th March 2019, 06:34
Ooh lovely, Thank you Grouchy 200.4% https://www.cosgan.de/images/smilie/froehlich/a065.gif
StainlessS
25th March 2019, 15:47
Yo Dude,
Just had a daft idea, hows bout info on current screen display size, depth, could introduce a number of other functions in same vein.
No probs if not implemented, havva guddun :)
EDIT: Was thinkin' to let user know likely frame size ahead of time, of frame returned from new ClipBoard_GetDIB() thingy.
Groucho2004
25th March 2019, 16:27
Just had a daft idea, hows bout info on current screen display size, depth, could introduce a number of other functions in same vein.
Good idea.
EDIT: Was thinkin' to let user know likely frame size ahead of time, of frame returned from new ClipBoard_GetDIB() thingy.Don't know what that means. Can you elaborate a bit?
StainlessS
25th March 2019, 16:30
elaborate a bit?
https://forum.doom9.org/showthread.php?p=1869895#post1869895
Post in thread before your post,
ClipBoard_GetDIB() : Get DIB/BitMap from ClipBoard (RGB24 and RGB32[as RGB24] Only).
Returns:-
Int,
0 : DIB Bitmap not available on ClipBoard
-1: Cannot Open Clipboard
-2: Cannot get ClipBoard data
-3: Lock ClipBoard memory failed
-?: Other errors (See DebugView output, Google)
Clip,
DIB/Bitmap from ClipBoard. (Single Frame RGB24 @ 24FPS).
Groucho2004
25th March 2019, 16:37
So far I have this:
https://i.postimg.cc/GmZjbmbz/Image2.png
Is that what you had in mind?
StainlessS
25th March 2019, 16:42
Perfecto :)
EDIT: But, how come you got two screen x dimensions, dual displays perhaps :)
EDIT: Dual dispay stuff did not even occur to me, function returning number of displays [eg Disps=SI_NumberDisplays()], and then SI_Display_XDim(Display=Disps-1) for Last display x dim.
(above is zero relative display number).
Groucho2004
25th March 2019, 16:47
But, how come you got two screen x dimensions, dual displays perhaps :)Typo in the script. :o
Groucho2004
25th March 2019, 17:08
v0.1.0.6
- Added Device caps for the screen (SI_ScreenXRes, SI_ScreenYRes and SI_ScreenBitsPerPixel)
StainlessS
25th March 2019, 17:14
Oooooo Lovely Jubbly. https://www.cosgan.de/images/smilie/froehlich/c030.gif
StainlessS
25th March 2019, 17:52
Its come in handy already
ShowAndWriteClipBoard_DIB.AVS
# ShowAndWriteClipBoard_DIB.AVS
# Show & Write to Image file, last Bitmap copied to ClipBoard (eg "CTRL/ALT/Print_Screen" or "CTRL/Fn/Print_Screen" or whatever your key combo is)
# VDub2 does NOT need be TOP Window to CAP & Write Screen Using eg CTRL/ALT/Print_Screen
####### CONFIG ################
W=640 # If W > 0 then resize clipBoard Bitmap to W : Else use Original Screen X Dimension
H=480 # If Y > 0 then resize clipBoard Bitmap to H : Else use Original Screen Y Dimension
CHECKEVERY=24 # Check for ClipBoard BitMap every CHECKEVERY frames (24 = once per second for 24FPS Blankclip)
# MPC-HC seems a little unresponsive to this script, VDub2 plays fine, x86 and x64.
WRITE=True # Write BitMap to eg D:\CB_000000.BMP, Requires RT_Stats v1.43 if WRITEFILE NOT FullPathName (Incl COLON eg 'D:\')
WRITEFILE="D:\ClipBoard\CB_" # Path MUST Exist
######## End Of CONFIG ###############
WRITEFILE = (WRITE && FindStr(WRITEFILE,":")==0) ? RT_GetFullPathName(WRITEFILE) : WRITEFILE
XRES=SI_ScreenResX YRES=SI_ScreenResY # Req Groucho2004 SysInfo plugin v0.1.0.7
W = (W<=0) ? XRES : W H = (H<=0) ? YRES : H RESIZE = (W!=XRES || H!=YRES)
BlankClip(Width=W,Height=H,Length=24*60*60,Pixel_Type="RGB24").KillAudio
CLP=Trim(0,-1) WrClp=CLP.BlankClip(Length=0) IMGN=0 # Dummy Prep
SSS="""
n = current_frame
CB=(n % CHECKEVERY == 0) ? ClipBoard_GetDIB() : 0
GotDIB=(CB.IsClip)
(GotDIB) ? ClipBoard_Clear() : NOP
CB = (GotDIB&&RESIZE) ? CB.BiCubicResize(W,H) : CB
WrClp= (GotDIB&&WRITE) ? WrClp++CB : WrClp
current_frame = (GotDIB&&WRITE) ? IMGN : n # Force ImageWriter to use our ClipBoard CAP frame number
CLP = (GotDIB&&WRITE) ? WrClp.ImageWriter(WRITEFILE,type="bmp") : CLP
IMGN = (GotDIB&&WRITE) ? IMGN + 1 : IMGN
return CLP
"""
Scriptclip(SSS)
EDIT: Script Update and now requires current version as per below post.
Groucho2004
25th March 2019, 22:36
v0.1.0.7
- Added proper error handling for DevCaps
- Renamed SI_ScreenXRes/SI_ScreenYRes to SI_ScreenResX/SI_ScreenResY
- Added SI_CPUExtensions
As usual, see first post in this thread for details.
StainlessS
21st April 2019, 12:42
No idea if at all of use, but just found this code in Wsus Offline update : Client/Bin/IfAdmin.cpp
// Code is a Microsoft sample found at http://msdn2.microsoft.com/en-us/library/aa376389.aspx
#include "windows.h"
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
/*++
Routine Description: This routine returns TRUE if the caller's
process is a member of the Administrators local group. Caller is NOT
expected to be impersonating anyone and is expected to be able to
open its own process and process token.
Arguments: None.
Return Value:
TRUE - Caller has Administrators local group.
FALSE - Caller does not have Administrators local group. --
*/
BOOL b;
SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
PSID AdministratorsGroup;
b = AllocateAndInitializeSid(
&NtAuthority,
2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
&AdministratorsGroup);
if(b)
{
if (!CheckTokenMembership( NULL, AdministratorsGroup, &b))
{
b = FALSE;
}
FreeSid(AdministratorsGroup);
}
return(b);
}
Guess that you may already have such code (but just incase you dont have not got none) :)
.
Groucho2004
21st April 2019, 13:34
No idea if at all of use, but just found this code in Wsus Offline update : Client/Bin/IfAdmin.cpp
// Code is a Microsoft sample found at http://msdn2.microsoft.com/en-us/library/aa376389.aspx
#include "windows.h"
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
/*++
Routine Description: This routine returns TRUE if the caller's
process is a member of the Administrators local group. Caller is NOT
expected to be impersonating anyone and is expected to be able to
open its own process and process token.
Arguments: None.
Return Value:
TRUE - Caller has Administrators local group.
FALSE - Caller does not have Administrators local group. --
*/
BOOL b;
SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
PSID AdministratorsGroup;
b = AllocateAndInitializeSid(
&NtAuthority,
2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
&AdministratorsGroup);
if(b)
{
if (!CheckTokenMembership( NULL, AdministratorsGroup, &b))
{
b = FALSE;
}
FreeSid(AdministratorsGroup);
}
return(b);
}
Guess that you may already have such code (but just incase you dont have not got none) :)
.Certainly useful, thank you.
Groucho2004
23rd April 2019, 11:10
v0.1.0.8
- Added 'SI_ProcessBitness'
StainlessS
6th May 2019, 17:26
Any chance of Windows NT version number, for use to eg decide which MvTools.dll to load, XP (<6.0) or Vista+ (>=6.0).
Much easier than having multiple Plugins setups for different hardware (better if avsi plugin loader based on NT version number).
SI_OSVersion could be persuaded to assist but would be a bit of a tedious task and a bit convoluted.
Thanks.
Suggest maybe SI_NtVersionNumber().
Windows NT on WikiPedia:- https://en.wikipedia.org/wiki/Windows_NT
And:- https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions
Groucho2004
6th May 2019, 19:13
Any chance of Windows NT version number, for use to eg decide which MvTools.dll to load, XP (<6.0) or Vista+ (>=6.0).
Much easier than having multiple Plugins setups for different hardware (better if avsi plugin loader based on NT version number).
SI_OSVersion could be persuaded to assist but would be a bit of a tedious task and a bit convoluted.
Thanks.
Suggest maybe SI_NtVersionNumber().
Windows NT on WikiPedia:- https://en.wikipedia.org/wiki/Windows_NT
And:- https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions
Sure, no problem. I suggest SI_OSVersionString() (instead of SI_OSVersion()) and SI_OSVersionNumber(), similar to Avisynth.
Edit - SI_OSVersionNumber(): return string or float?
StainlessS
6th May 2019, 20:44
SI_OSVersionNumber(): return string or float?
Float preferable, easier for direct compare greater/equal/lesser style.
Groucho2004
7th May 2019, 00:40
v0.1.0.9
- Added 'SI_OSVersionNumber'
- Changed 'SI_OSVersion' to 'SI_OSVersionString'
StainlessS
7th May 2019, 00:53
Magical, thank you sir.
Emulgator
17th May 2019, 00:28
#25:EDIT: Dual dispay stuff did not even occur to me,
I'd like to be dispayed too ! Dual ! Or better not...
Well, late to the party I am a bit indeed now, isn't it ;-)
(In a "retiring home from a muscateller" mood...)
And many thanks for your continued work, you both !
StainlessS
20th June 2019, 21:27
Hi Grouchy, can you tell, is there any contradiction in these two outputs regarding CPU extensions.
https://i.postimg.cc/pdWTwzDC/CB-Info.jpg (https://postimages.org/)
and
InitExternalPlugins:
InitExternalPlugins: Auto load plugins script ENTRY
InitExternalPlugins:
InitExternalPlugins:ShowAvsInfo:
InitExternalPlugins:ShowAvsInfo: VersionString = 'AviSynth+ 0.1 (r2772, MT, i386)'
InitExternalPlugins:ShowAvsInfo: OSVersionString = 'Windows 7 (x64) Service Pack 1.0 (Build 7601)'
InitExternalPlugins:ShowAvsInfo: OSVersionNumber = 6.100000
InitExternalPlugins:ShowAvsInfo: CPUName = 'Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz / Yorkfield (Core 2 Quad) 6M'
InitExternalPlugins:ShowAvsInfo: Cores = 04:04 (Phy:Log)
InitExternalPlugins:ShowAvsInfo: CPU Extensions = 'MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1'
InitExternalPlugins:ShowAvsInfo: Total Memory = 12221MB
InitExternalPlugins:ShowAvsInfo: Avail Memory = 9824MB'
InitExternalPlugins:ShowAvsInfo: Sys Bitness = 32 # EDIT: Actually 32 bit AVS bitness
InitExternalPlugins:ShowAvsInfo: Screen Res = 1920x1080
InitExternalPlugins:ShowAvsInfo: Screen BitPerPixel = 32
InitExternalPlugins:ShowAvsInfo:
Produced by this INCOMPLETE script in plugins
RT_debugF("DBGVIEWCLEAR\n\nAuto load plugins script ENTRY\n",name="InitExternalPlugins: ") # 'DBGVIEWCLEAR' sent to Debugview window clears the window. (thanx Wonkey)
# For whatever usage within this script
Global G_InitPlugs_IsAvs26 = ( VersionNumber>=2.6 )
Global G_InitPlugs_IsAvsPlus = ( FindStr(VersionString, "AviSynth+")!= 0 || FindStr(VersionString, " Neo")!= 0 )
Global G_InitPlugs_Bitness = ( SI_ProcessBitness() )
Function ShowAvsInfo() {
myName="InitExternalPlugins:ShowAvsInfo: "
S=RT_String("\nVersionString = '%s'\n", VersionString)
S=RT_String("%sOSVersionString = '%s'\n", S,SI_OSVersionString)
S=RT_String("%sOSVersionNumber = %f\n", S,SI_OSVersionNumber)
S=RT_String("%sCPUName = '%s'\n", S,SI_CPUName)
S=RT_String("%sCores = %02d:%02d (Phy:Log)\n", S,SI_PhysicalCores,SI_LogicalCores)
S=RT_String("%sCPU Extensions = '%s'\n", S,SI_CPUExtensions)
S=RT_String("%sTotal Memory = %dMB\n", S,SI_TotalSystemMemory)
S=RT_String("%sAvail Memory = %dMB'\n", S,SI_AvailableSystemMemory)
S=RT_String("%sSys Bitness = %d\n", S,SI_ProcessBitness)
S=RT_String("%sScreen Res = %dx%d\n", S,SI_ScreenResX,SI_ScreenResY)
S=RT_String("%sScreen BitPerPixel = %d\n", S,SI_ScreenBitsPerPixel)
RT_DebugF("%s",S,name=myName)
}
Function Load_CPP_Plugin(String fn) {
myName = "InitExternalPlugins:Load_CPP_Plugin: "
FN = RT_GetFullPathName(fn)
EX = Exist(FN)
Try {
EX ? LoadPlugin(FN) : NOP
EX ? RT_DebugF("%s LOADED OK",FN,name=my_Name) : RT_DebugF("%s NOT FOUND",FN,name=myName)
} catch(msg) { RT_DebugF("ERROR on '%s'\nSysErr='%s'",FN,msg,name=myName) }
}
Function Load_C_Plugin(String fn) {
myName = "InitExternalPlugins:Load_C_Plugin: "
FN = RT_GetFullPathName(fn)
EX = Exist(FN)
Try {
EX ? Load_Stdcall_Plugin(FN) : NOP
EX ? RT_DebugF("%s LOADED OK",FN,name=my_Name) : RT_DebugF("%s NOT FOUND",FN,name=myName)
} catch(msg) { RT_DebugF("ERROR on '%s'\nSysErr='%s'",FN,msg,name=myName) }
}
Function Import_Avsi(String fn) { # EDIT: This may not work at all
myName = "InitExternalPlugins:Import_Avsi: "
FN = RT_GetFullPathName(fn)
EX = Exist(FN)
Try {
EX ? Import(FN) : NOP
EX ? RT_DebugF("%s IMPORTED OK",FN,name=my_Name) : RT_DebugF("%s NOT FOUND",FN,name=myName)
} catch(msg) { RT_DebugF("ERROR on '%s'\nSysErr='%s'",FN,msg,name=myName) }
}
##################
ShowAvsInfo()
#Load_C_Plugin(".\FFMS_C\ffms2.dll") # FFMpegSource C Plugin
#Import_Avsi(".\FFMS_C\ffms2.avsi") # FFMpegSource C Avsi file with LoadCPlugin line commented OUT.
#Load_CPP_Plugin(".\FFMS2000_CPP\ffms2.dll") # FFMpegSource CPP Plugin
#Import_Avsi(".\FFMS2000_CPP\ffms2.avsi") # FFMpegSource CPP Avsi file with LoadCPlugin line commented OUT.
#Load_CPP_Plugin(".\LSMASH_CPP\LSMASHSource.dll") # L-Smash CPP
#Load_CPP_Plugin(".\DGDecode\DGDecode_x86.DLL") # DGDecode CPP
#Load_C_Plugin("C:\NON-INSTALL\DGAVCDec\DGAVCDecode.dll") # DGAVCDec C
EDIT: Ie, does SSE, SSE2, SSE3 == ISSE
EDIT: Not sure if the avsi Import function actually works when import into local function, might have to use Eval on contents of file, even then might not work, dont know yet. we may need to somehow import into main level script, but dont know how from local function [maybe return contents of file to caller, and they need to eval on it at main level].
Groucho2004
20th June 2019, 21:43
Ie, does SSE, SSE2, SSE3 == ISSEI don't think so. I'll look into it.
Edit: From this (https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions) page:
SSE was originally called Katmai New Instructions (KNI), Katmai being the code name for the first Pentium III core revision. During the Katmai project Intel sought to distinguish it from their earlier product line, particularly their flagship Pentium II. It was later renamed Internet Streaming SIMD Extensions (ISSE[1]), then SSE. AMD eventually added support for SSE instructions, starting with its Athlon XP and Duron (Morgan core) processors. So, ISSE = SSE (I guess?).
Groucho2004
20th June 2019, 22:03
Function ShowAvsInfo() {
myName="InitExternalPlugins:ShowAvsInfo: "
S=RT_String("\nVersionString = '%s'\n", VersionString)
S=RT_String("%sOSVersionString = '%s'\n", S,SI_OSVersionString)
S=RT_String("%sOSVersionNumber = %f\n", S,SI_OSVersionNumber)
S=RT_String("%sCPUName = '%s'\n", S,SI_CPUName)
S=RT_String("%sCores = %02d:%02d (Phy:Log)\n", S,SI_PhysicalCores,SI_LogicalCores)
S=RT_String("%sCPU Extensions = '%s'\n", S,SI_CPUExtensions)
S=RT_String("%sTotal Memory = %dMB\n", S,SI_TotalSystemMemory)
S=RT_String("%sAvail Memory = %dMB'\n", S,SI_AvailableSystemMemory)
S=RT_String("%sSys Bitness = %d\n", S,SI_ProcessBitness)
S=RT_String("%sScreen Res = %dx%d\n", S,SI_ScreenResX,SI_ScreenResY)
S=RT_String("%sScreen BitPerPixel = %d\n", S,SI_ScreenBitsPerPixel)
RT_DebugF("%s",S,name=myName)
}Just curious - Why do you call the function "ShowAvsInfo()" even though it doesn't gather anything related to Avisynth?
StainlessS
20th June 2019, 22:08
Thanks G2K4,
I take it that all three SSE, SSE2 and SSE3 are integer SSE, and so maybe in AVS ISSE is just shorthand for the lot.
Just thought that additional nicety might be the current or Parent process name, in RT_stats we have RT_GetProcessName(), might be handy in your plug too.
I have used to make small changes when using eg MPC-HC (where eg enable output of float audio),
and some other reason connected with Vdub current process, cant offhand remember what that was.
RT_GetProcessName(bool "parent"=false,bool "debug"=false)
Returns string, name of current process eg "VirtualDubMod.exe" or "AvsPMod.exe" or name of parent process
(the one that started our process eg "Explorer.exe"). Debug outputs some info to DebugView.
From RT_
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "RT_Stats.h"
#define DPRINTFNAME "RT_GetProcessName: "
AVSValue __cdecl RT_GetProcessName(AVSValue args, void*, IScriptEnvironment* env) {
bool parent= args[0].AsBool(false);
bool debug = args[1].AsBool(false);
// DWORD WINAPI GetCurrentProcessId(void);
// Return value: The return value is the process identifier of the calling process.
// Minimum supported client:- Windows XP WinBase.h (Processthreadsapi.h W8 Server 2012)
// ssS, Rubbish, also works fine on W2K
DWORD PID = GetCurrentProcessId(); // Cannot fail (I think) as current process is obviously running.
// HANDLE WINAPI CreateToolhelp32Snapshot(DWORD dwFlags,DWORD th32ProcessID);
//
//
// The th32ProcessID argument is only used if TH32CS_SNAPHEAPLIST or
// TH32CS_SNAPMODULE is specified. th32ProcessID == 0 means the current
// process.
//
// NOTE that all of the snapshots are global except for the heap and module
// lists which are process specific. To enumerate the heap or module
// state for all WIN32 processes call with TH32CS_SNAPALL and the
// current process. Then for each process in the TH32CS_SNAPPROCESS
// list that isn't the current process, do a call with just
// TH32CS_SNAPHEAPLIST and/or TH32CS_SNAPMODULE.
//
// dwFlags
//
// #define TH32CS_SNAPHEAPLIST 0x00000001
// #define TH32CS_SNAPPROCESS 0x00000002
// #define TH32CS_SNAPTHREAD 0x00000004
// #define TH32CS_SNAPMODULE 0x00000008
// #define TH32CS_SNAPMODULE32 0x00000010
// #define TH32CS_SNAPALL (TH32CS_SNAPHEAPLIST | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD | TH32CS_SNAPMODULE)
// #define TH32CS_INHERIT 0x80000000
//
HANDLE hProcessSnap = NULL;
// Take a snapshot of all processes in the system.
hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
// Returns an open handle to the specified snapshot if successful or INVALID_HANDLE_VALUE otherwise.
// The snapshot taken by this function is examined by the other tool help functions to provide their results.
// Access to the snapshot is read only. The snapshot handle acts like an object handle and is subject to the same
// rules regarding which processes and threads it is valid in.
// To retrieve an extended error status code generated by this function, use the GetLastError function.
// To destroy the snapshot, use the CloseHandle function.
if (hProcessSnap == INVALID_HANDLE_VALUE)
return -1;
// Describes an entry from a list that enumerates the processes residing in the system address space when a snapshot was taken.
//
// typedef struct tagPROCESSENTRY32 {
// DWORD dwSize;
// DWORD cntUsage;
// DWORD th32ProcessID;
// ULONG_PTR th32DefaultHeapID;
// DWORD th32ModuleID;
// DWORD cntThreads;
// DWORD th32ParentProcessID;
// LONG pcPriClassBase;
// DWORD dwFlags;
// TCHAR szExeFile[MAX_PATH];
// } PROCESSENTRY32;
// typedef PROCESSENTRY32 *PPROCESSENTRY32;
//
// Members
//
// dwSize
// Specifies the length, in bytes, of the structure. Before calling the Process32First function, set this member to
// sizeof(PROCESSENTRY32). If you do not initialize dwSize, Process32First will fail.
// cntUsage
// Number of references to the process. A process exists as long as its usage count is nonzero. As soon as its usage
// count becomes zero, a process terminates.
// th32ProcessID
// Identifier of the process.
// th32DefaultHeapID
// Identifier of the default heap for the process. The contents of this member has meaning only to the tool help
// functions. It is not a handle, nor is it usable by functions other than the ToolHelp functions.
// th32ModuleID
// Module identifier of the process. The contents of this member has meaning only to the tool help functions
// It is not a handle, nor is it usable by functions other than the ToolHelp functions.
// cntThreads
// Number of execution threads started by the process.
// th32ParentProcessID
// Identifier of the process that created the process being examined.
// pcPriClassBase
// Base priority of any threads created by this process.
// dwFlags
// Reserved; do not use.
// szExeFile
// Path and filename of the executable file for the process.
//
// Requirements:- Windows NT/2000/XP: Included in Windows 2000 and later. ::: Tlhelp32.h.
PROCESSENTRY32 pe32 = {0};
// Fill in the size of the structure before using it.
pe32.dwSize = sizeof(PROCESSENTRY32);
// Walk the snapshot of the processes, and for each process,
// BOOL WINAPI Process32First(HANDLE hSnapshot,LPPROCESSENTRY32 lppe);
if (!Process32First(hProcessSnap, &pe32)) {
CloseHandle (hProcessSnap);
return -2; // Cant find first process
}
AVSValue ret = -3; // Init to cant find my own PID
do {
if(pe32.th32ProcessID == PID) {
if(debug) {
dprintf(DPRINTFNAME"ExeFile = %s\n",pe32.szExeFile);
dprintf(DPRINTFNAME"ProcessID = 0x%08X\n",pe32.th32ProcessID);
dprintf(DPRINTFNAME"Threads = %d\n",pe32.cntThreads);
dprintf(DPRINTFNAME"ParentProc = 0x%08X\n",pe32.th32ParentProcessID);
}
if(parent==false) {
ret = env->SaveString(pe32.szExeFile);
} else {
ret = -4; // Init Cant find parent
DWORD PARPID = pe32.th32ParentProcessID;
if (Process32First(hProcessSnap, &pe32)) {
do {
if(pe32.th32ProcessID == PARPID) {
if(debug) {
dprintf(DPRINTFNAME"ExeFile = %s\n",pe32.szExeFile);
dprintf(DPRINTFNAME"ProcessID = 0x%08X\n",pe32.th32ProcessID);
dprintf(DPRINTFNAME"Threads = %d\n",pe32.cntThreads);
dprintf(DPRINTFNAME"ParentProc = 0x%08X\n",pe32.th32ParentProcessID);
}
ret = env->SaveString(pe32.szExeFile);
break;
}
} while (Process32Next(hProcessSnap, &pe32));
}
}
break; // DONE
}
} while (Process32Next(hProcessSnap, &pe32));
CloseHandle (hProcessSnap); // Cleanup process snapshot
return (ret);
}
EDIT: Above there seems to be quite a few '32' snippits in code, perhaps it dont work in 64 bit proc.
EDIT:
Just curious - Why do you call the function "ShowAvsInfo()" even though it doesn't gather anything related to Avisynth?
Just be thankfull that it aint called Test() or Fred(), two popular names I use a lot. [and it does show Avs version String, 1st line).
Groucho2004
20th June 2019, 22:12
Just thought that additional nicety might be the Parent process name, in RT_stats we have RT_GetProcessName(), might be handy in your plug too.
Yep, sounds like a good idea, thanks for the code snippet.
Groucho2004
20th June 2019, 22:14
EDIT:
Just be thankfull that it aint called Test() or Fred(), two popular names I use a lot. [and it does show Avs version String, 1st line).Ok, never mind. :D
I do like "Fred()".
StainlessS
20th June 2019, 22:23
On Qwerty Keyboard, all 4 keys are adjacent, so easy to type for us lazy coders [Fred].
Note also the comment below code on lots of '32' snippits in code block, maybe not work on x64.
EDIT: Off to pub for last orders.
Groucho2004
20th June 2019, 22:24
EDIT: Above there seems to be quite a few '32' snippits in code, perhaps it dont work in 64 bit proc.I wrote a ProcessInfo() class for AVSMeter so there should not be any problems with 64 bit.
Groucho2004
21st June 2019, 11:36
Just thought that additional nicety might be the Parent process name, in RT_stats we have RT_GetProcessName(), might be handy in your plug too.
Yep, sounds like a good idea, thanks for the code snippet.
Edit: It's actually as simple as this:
char szBuffer[MAX_PATH];
GetModuleFileName(NULL, (LPTSTR)szBuffer, sizeof(szBuffer));
:D
StainlessS
21st June 2019, 12:15
Will you be implementing both Current Process Name, & Parent Process Name ? [I intially wrote parent, but meant current process, RT_ returns either].
Groucho2004
21st June 2019, 12:18
Will you be implementing both Current Process Name, & Parent Process Name ?I don't understand the difference. There is always just one process that loads avisynth.dll.
Edit: Ok, I see what you mean. Can you give me an example where it's useful to know the parent process?
StainlessS
21st June 2019, 12:24
Difference is, Current Process is eg MPC-HC or AvsPMod or VirtualDub or MeGUI, Parent is whatever started current, eg Windows Explorer, or maybe command line [maybe Cmd.Exe, not sure] or whatever.
Parent might be of use on rare occasion.
EDIT: I think parent may sometimes not exist, if has been killed since current process start.
Groucho2004
21st June 2019, 12:31
Until a flash of enlightenment reveals its usefulness to me I think I'll give 'parent process name' a miss.
Groucho2004
21st June 2019, 13:27
v0.1.1.0
- Added 'SI_ProcessName'
StainlessS
21st June 2019, 14:05
Ooo lovely https://www.cosgan.de/images/smilie/liebe/n020.gif
EDIT: nothing wrong with a pat on the head (so long as its not a cow pat).
Groucho2004
22nd July 2019, 10:01
v0.1.1.1
- Updated libcpuid (AMD Zen 2 support)
Groucho2004
26th July 2019, 20:39
v0.1.1.2
- Added SI_GetEnvVar
StainlessS
26th October 2019, 11:43
No hurry, but if updating dll, please add a SysInfo dll version number, just so we know what we got available, will display it in AvsInit thingy.
Thanx muchly
Groucho2004
26th October 2019, 11:50
No hurry, but if updating dll, please add a SysInfo dll version number, just so we know what we got available, will display it in AvsInit thingy.
Thanx muchly
It has a version resource.
StainlessS
26th October 2019, 11:52
Arh, so I gotta write something to extract version from version resource. :) [was wantin' it at runtime, check minimum requirement, likely future mandatory Sysinfo of minimum version]
Groucho2004
26th October 2019, 11:57
Arh, so I gotta write something to extract version from version resource. :) [was wantin' it at runtime, check minimum requirement, likely future mandatory Sysinfo of minimum version]Do you mean to add it to the return value of AvisynthPluginInit? Extracting it from the version resource it easy, have a look at AVSMeter, utility.h, GetFileVersion()/GetProductVersion().
StainlessS
26th October 2019, 11:59
Nope, just return a version number as for eg OS NT version number or avisynth VersionNumber(), as a float, not string.
Groucho2004
26th October 2019, 12:01
Nope, just return a version number as for eg OS NT version number or avisynth VersionNumber(), as a float, not string.0.1.1.2 as float? :confused:
Edit: 0.112 ?
StainlessS
26th October 2019, 12:03
Whatever you decide will suit me fine [edit looks gud].
I use this in RT_Stats, [allows compare version number including beta, RT_Stats version 2.0 beta 12 compares Less Than version 2.0]
#include "compiler.h"
#define VERSION_NUMBER 2.0 // 2 [EDIT: Decimal eg 2.01] Digits of precision
#define VERSION_BETA 12 // writes 2 digits
#define VERSION_DATE "02 Aug 2018"
// ...
AVSValue __cdecl RT_Version(AVSValue args, void* user_data, IScriptEnvironment* env) {
double v = VERSION_NUMBER;
if(VERSION_BETA > 0) {
v = v - 0.001 + (VERSION_BETA / 100000.0);
}
return v;
}
EDIT: And
AVSValue __cdecl RT_VersionString(AVSValue args, void* user_data, IScriptEnvironment* env) {
char bf[64],beta[16];
beta[0]='\0';
if(VERSION_BETA > 0) {
sprintf(beta,"Beta%02d",VERSION_BETA);
}
sprintf(bf,"%.2f%s",VERSION_NUMBER,beta);
return env->SaveString(bf);
}
EDIT: Ideally would get version from version resource, not got around to figuring out how to do that and mangle into my Beta thing yet.
Groucho2004
26th October 2019, 12:04
Whatever you decide will suit me fine [edit looks gud].Ok, no problem.
StainlessS
26th October 2019, 12:28
I've done this now so posting.
v=RT_Version
RT_DebugF("Version=v%s : %f",RT_VersionString,v)
BlankCLip.RT_Subtitle("Version=v%s : %f",RT_VersionString,v)
Result, for RT_stats v2.0 Beta 12
00000171 0.27866700 [3664] RT_DebugF: Version=v2.00Beta12 : 1.999120 # RED '9' digit signifies IS BETA VERSION, with 2 digit beta version number
Groucho2004
27th October 2019, 15:48
v0.1.1.3
- Updated libcpuid
- Added SI_FileVersion
StainlessS
27th October 2019, 18:46
Magic :)
StainlessS
30th October 2019, 22:14
Hi there young master Groucho, hows bout an Avisynth v2.58 version SysInfo Plugin (AvisynthPluginInit2).
Groucho2004
30th October 2019, 23:29
v0.1.1.4
- 32 bit version of the plugin also works with Avisynth 2.5.7 / 2.5.8
StainlessS
31st October 2019, 07:33
Well I never, you dont mess about do you. Thanks muchly.
Groucho2004
31st October 2019, 10:03
Well I neverNothing to write home about, just a couple of conditionals sneaked in.
Groucho2004
2nd February 2020, 13:59
v0.1.1.5
- Updated libcpuid to support AMD Threadripper (Castle Peak)
- Updated AVS+ headers
Groucho2004
21st April 2020, 16:18
@Stainless
Test 00:
SysInfo_0.1.1.6.00.7z (http://www.mediafire.com/file/6xzlkgkwl2c72qy/SysInfo_0.1.1.6.00.7z/file)
This is what I have so far:
AI_IsAvs26
AI_IsAvsNeo
AI_IsAvsPlus
SI_AvailableSystemMemory
SI_CPUExtensions
SI_CPUName
SI_FileVersion
SI_GetEnvVar
SI_HasAVX
SI_HasAVX2
SI_HasAVX512
SI_HasFMA3
SI_HasFMA4
SI_HasMMX
SI_HasSSE
SI_HasSSE2
SI_HasSSE3
SI_HasSSE41
SI_HasSSE42
SI_HasSSSE3
SI_IsOS64Bit
SI_IsWin10
SI_IsWin7
SI_IsWin8
SI_IsWin81
SI_IsWinServer2003
SI_IsWinServer2008
SI_IsWinServer2008R2
SI_IsWinServer2012
SI_IsWinServer2012R2
SI_IsWinVista
SI_IsWinXP
SI_LogicalCores
SI_ModulePath
SI_NumberOfCPUs
SI_OSVersionNumber
SI_OSVersionString
SI_PhysicalCores
SI_ProcessBitness
SI_ProcessName
SI_ScreenBitsPerPixel
SI_ScreenResX
SI_ScreenResY
SI_TotalSystemMemory
StainlessS
21st April 2020, 16:34
Thanx GG,
Below, Copied here from here Real.Finder Avisynth Stuff thread:- https://forum.doom9.org/showthread.php?p=1908588#post1908588
GScriptExists() should also return true if the plugin is present but AVS+ with built-in GScript is used, right?
Where GScript is present under AVS+, so Gscript dll is used as external dll Overrides builtin [also user installed dll for a reason, presumably].
Nope, Script func overrides dll, dll overrides builtin.
Wiki:- http://avisynth.nl/index.php/Plugins#Plugin_Autoload_and_Name_Precedence
EDIT:
Also, where in main script and decision as to use GScript(GSTRING) or Avs+ Eval(GSTRING) to process a GSTRING string containing GScript if/for/next/while type stuff,
scriptor should choose to use GScript(GSTRING) where Gscript dll is available whether Avs std or avs+, and only AVS+ Eval(GSTRING) when Avs+ and no GScript dll installed.
Avs64Bit is already covered with 'SI_ProcessBitness'. Do we need it anyway as a convenience function?
Convenience function, I guess you choose if you wanna do it.
I have SytemEnvironment implemented differently. You pass the environment variable and it returns the value. I think that's more elegant and flexible than having a function for each variable (SystemEnvTemp(), SystemEnvComSpec(), SystemEnvComputerName(), SystemEnvUserName()), don't you think?
Again, Convenience functions, but implement as you will. [maybe a note of possible uses in your copious documentation].
The Operating system and CPU caps would really be useful and a helluva lot easier than extraction from the CPU Caps string.
EDIT:
So above GScriptExists() could be used like this
GSTRING = """
Function SomeFunc(int n) { # AKA Terminal() function, but slow iterated version
sum = 0
for(i=1,n) {
sum = sum + i
}
return sum
}
Function Terminal(int n) { # Fast version of above SomeFunc
# Return sum of integers 1 to n. Input n range 1 to 65535, else returns 0. (From Knuth TAOCP Vol 1)
return (n > 65535 || n <= 0) ? 0 : (n % 2 == 0) ? (n+1)*(n/2) : n * ((n + 1) / 2)
}
"""
GSTR = """
if (Sum == Term) {
S2 = " Sum and Term BOTH SAME"
} else {
S2 = " Sum and Term BOTH DIFFERENT"
}
"""
# Install SomeFunc() and Terminal() as Functions
GScriptExists() ? GScript(GSTRING)
\ : IsAvsPLus() ? Eval(GSTRING)
\ : Assert(False,"Need Either GScript or Avs+ for SomeFunc()")
N=3 # N=3 shows Sum=6
Sum = SomeFunc(N)
Term = Terminal(N)
s = "Sum of Numbers 1 to " + String(N) + " = " + String(Sum) + " : Terminal(" + String(N) + ") = " + String(Term)
# Do something that aint a function : Assign a string to S2 Using GScript style If/Else
GScriptExists() ? GScript(GSTR) : Eval(GSTR) # Already Checked above for either GScript Or AVS+
BlankClip(Width=480,height=128)
Subtitle(s+"\n"+S2,lsp=0)
Return Last
Updated Again
https://i.postimg.cc/761jqFzc/G-00.jpg (https://postimages.org/)
EDIT: NOTE For Pinterf, note the horizontal offset of both strings.
Groucho2004
21st April 2020, 16:37
Thanx GGPlease test it, especially 32 bit AVS.
Groucho2004
21st April 2020, 16:41
Including these might be asking too much (or would it)
Function X_HasAlpha(clip c) { c IsAvsPlus ? HasAlpha : IsRGB32 }
Function X_HasChroma(clip c) { c IsRGB ? False : IsAvsPlus ? !IsY : !IsAvs26||!IsY8 }
Function X_IsYV411(clip c) { c IsAvs26 ? IsYV411 : False }
Function X_IsY(clip c) { c IsAvsPlus ? IsY : IsAvs26 ? IsY8 : False } # True=Single Plane : (!IsRGB)=True = Any type with Y, YUY2/YUVA/Y8 etc. BEWARE Y8_Clip.IsYUV returns True
Function X_Is420(clip c) { c IsAvsPlus ? Is420 : IsYV12 }
Function X_Is422(clip c) { c IsAvsPlus ? Is422 : False } # YUY2_Clip.Is422=False [ie not Planar]
Function X_Is444(clip c) { c IsAvsPlus ? Is444 : IsAvs26 ? IsYV24 : False }
Function X_IsRGB48(clip c) { c IsAvsPlus ? IsRGB48 : False }
Function X_IsRGB64(clip c) { c IsAvsPlus ? IsRGB64 : False }
Function X_IsRGBA(clip c) { c IsRGB && X_HasAlpha }
Function X_NumComponents(clip c) { c IsAvsPlus ? NumComponents : IsAvs26&&IsY8 ? 1 : IsRGB32 ?4 : 3 } # Num of channels
Function X_Bpc(clip c) { c IsAvsPlus ? BitsPerComponent : 8 } # Bits per channel, 32 = Float
Function X_ComponentMax(clip c) { c bpc=X_Bpc Return (bpc==32) ? 1.0 : IsAvsPlus ? BitLShift(1,bpc) - 1 : 255} # Max possible component value for colorspace
Function X_ComponentFullScale(clip c) { c bpc=X_Bpc Return (bpc==32) ? 255/256.0 : IsAvsPlus ? BitLShift(255,bpc-8) : 255} # Bit shifted value for colorspace
Function X_ComponentTvBlack(clip c) { c bpc=X_Bpc Return (bpc==32) ? 16/256.0 : IsAvsPlus ? BitLShift( 16,bpc-8) : 16} # TV Black level for colorspace
Function X_ComponentTvWhite(clip c) { c bpc=X_Bpc Return (bpc==32) ? 235/256.0 : IsAvsPlus ? BitLShift(235,bpc-8) : 235} # TV White level for colorspace
Function X_PixelType(clip c) { c IsAvs26 ? PixelType : IsYV12?"YV12":IsYUY2?"YUY2":IsRGB32?"RGB32":"RGB24" } # Eg "RGB32" or "YUV420P10"
Function X_YMod(clip c) { c IsAvsPlus ? (NumComponents==1||IsRGB?1:Height/ExtractU.Height):(IsYV12 ?2:1) } # Y Min crop multiple for Progressive
Function X_XMod(clip c) { c IsAvsPlus ? (NumComponents==1||IsRGB?1:Width/ExtractU.Width):IsAvs26?(IsYV411?4:IsYUY2||IsYV16||IsYV12?2:1):(IsRGB?1:2)} # X Min crop multiple
Function X_CsXMod(Val CSP) { (CSP.IsClip)?CSP:(CSP.IsString)?Blankclip(Length=1,Width=16,height=16,Pixel_type=CSP):Assert(False,"X_CsXMod: CSP Clip or Pixel_Type string ONLY") Return X_XMod }
Function X_CsYMod(Val CSP) { (CSP.IsClip)?CSP:(CSP.IsString)?Blankclip(Length=1,Width=16,height=16,Pixel_type=CSP):Assert(False,"X_CsYMod: CSP Clip or Pixel_Type string ONLY") Return X_YMod }
EDIT: Not sure those in blue are correct or final [just what I'm using right now].SysInfo doesn't take a clip.
Groucho2004
21st April 2020, 16:45
Now I have to think about all this AVS version number/version string stuff. I would really like to simplify it.
Any suggestions are welcome.
StainlessS
21st April 2020, 16:57
If you like, I could do all of above from post #76, you could take all credit (and blame) :)
EDIT:
SysInfo doesn't take a clip.
Maybe SysInfo eg
XAI_IsY(clip c)
or
XAVS_IsY(clip c)
does.
Groucho2004
21st April 2020, 17:00
If you like, I could do all of above from post #76, you could take all credit (and blame) :)What do you mean by 'I could do all of above'? You already did, did you not?
StainlessS
21st April 2020, 17:05
I mean I could provide the C code.
Also, script snippit from #74 updated.
Groucho2004
21st April 2020, 17:08
I mean I could provide the C code.But SysInfo doesn't accept a clip (and shouldn't). Can you not put that in your RT_Stats plug?
StainlessS
21st April 2020, 17:25
But RT_Stats already can do a lot of that stuff, or maybe with avs script assist, we really need smallish dll that does only
a few (well a lot less than the nearly 200 functions in RT_, currently nearly 500KB dll's, bigger if support HBD)
EDIT: Why should SysInfo not accept a clip for some of its functions.
You want another separate Mandatory dll for cross Avs info.
Another mandatory dll would also need duplicate much functionality that is already in your Sysinfo whatsit, probably making SysInfo obsolete.
Groucho2004
21st April 2020, 17:41
But RT_Stats already can do a lot of that stuff, or maybe with avs script assist, we really need smallish dll that does only
a few (well a lot less than the nearly 200 functions in RT_, currently nearly 500KB dll's, bigger if support HBD)
EDIT: Why should SysInfo not accept a clip for some of its functions.
You want another separate Mandatory dll for cross Avs info.
Another mandatory dll would also need duplicate much functionality that is already in your Sysinfo whatsit, probably making SysInfo obsolete.Ok. I'll look into it. :)
StainlessS
21st April 2020, 18:56
The Isxxx and Hasxxx style whatsits need to return avisynth type Bool, false/true, they are returning type Int 0/1.
return (x != 0); // bool returned as implied AVSValue (function return type is AVSValue)
Groucho2004
21st April 2020, 19:35
The Isxxx and Hasxxx style whatsits need to return avisynth type Bool, false/true, they are returning 0/1.
return (x != 0); // bool returned as implied AVSValue (function return type is AVSValue)
Currently, I'm doing this:
AVSValue SI_HasSSE(AVSValue args, void* user_data, IScriptEnvironment* env)
{
return utils.bHasSSE ? TRUE : FALSE;
}
Do I have to use the lower case variants?
StainlessS
21st April 2020, 19:37
I think that TRUE and FALSE are M$ API type BOOL 1 and 0, ie not [EDIT: CPP] type bool true/false. [EDIT: Changed order to match]
EDIT:
Do I have to use the lower case variants?
yes [returning M$ TRUE or FALSE is really returning avisynth type Int 1 or 0]
return utils.bHasSSE ? true : false;
Groucho2004
21st April 2020, 19:43
I think that TRUE and FALSE are M$ type BOOL 1 and 0, ie not [EDIT: CPP] type bool true/false. [EDIT: Changed order to match]
EDIT:
yes
return utils.bHasSSE ? true : false;
Try this (http://www.mediafire.com/file/okrdybctmylwei9/0.1.1.6.01.7z/file).
StainlessS
21st April 2020, 19:57
Thanks,
IsAvs26() is generally taken to mean NOT v2.58, in script
Function IsAvs26() { VersionNumber>=2.6}
Function IsAvsNeo() { FindStr(VersionString," Neo")!=0}
Function IsAvsPlus() { FindStr(VersionString,"AviSynth+")!=0||IsAvsNeo}
Function PlusBuildNumber() { V=VersionString Off=(!IsAvsPlus)?0:FindStr(V,"(r") return (Off==0)?0:V.MidStr(Off+2).Value.Int } # Avs+ & Neo, (More than 4 digits, Max 24 bit, ~16M)
Function AvsPlusVersionNumber() { Return PlusBuildNumber } # Stub for AvsPlusBuildNumber(), suggest AvsPlusVersionNumber is deprecated.
Function AvsVersionNumberString() { s=VersionString ND="0123456789." s=s.MidStr(s.StrBrkChrLen(ND,True)+1) Return s.LeftStr(s.StrMatchChrLen(ND,True)) }
Function SystemInfoExists() { Return RT_FunctionExist("SI_FileVersion")}
Function GScriptExists() { Return RT_FunctionExist("GScript")}
Function SystemEnvTemp() { Return RT_GetSystemEnv("TEMP")} # Path to USER System environment TEMP folder
Function SystemEnvComSpec() { Return RT_GetSystemEnv("COMSPEC")} # Path to System environment command line processor
# eg "C:\Windows\system32\cmd.exe"
Function SystemEnvComputerName() { Return RT_GetSystemEnv("COMPUTERNAME")} # System environment Commputer Name eg "Colossus"
Function SystemEnvUserName() { Return RT_GetSystemEnv("USERNAME")} # System environment User Name eg "God".
#
Function StrReplace(String s,String fnd,string Rep,bool "sig") { Return RT_StrReplace(s,fnd,Rep,Sig) }
#
Function IsAvs64Bit() { SI_ProcessBitness==64}
Function IsOS64Bit() { Return Findstr(SI_OSVersionString,"x64")!=0}
Function IsWinXP() { Return Findstr(SI_OSVersionString,"Windows XP")!=0}
Function IsWinVista() { Return Findstr(SI_OSVersionString,"Vista")!=0}
Function IsWin7() { Return Findstr(SI_OSVersionString,"Windows 7")!=0}
Function IsWin8() { S=SI_OSVersionString Return Findstr(S,"Windows 8 ")!=0||Findstr(S,"Windows 8.0 ")!=0}
Function IsWin81() { Return Findstr(SI_OSVersionString,"Windows 8.1")!=0}
Function IsWin10() { Return Findstr(SI_OSVersionString,"Windows 10")!=0}
Function HasMMX() { S=SI_CPUExtensions i=S.Findstr("MMX") Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasSSE() { S=SI_CPUExtensions i=S.Findstr("SSE") Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasSSE2() { Return Findstr(SI_CPUExtensions,"SSE2")!=0}
Function HasSSE3() { Return Findstr(SI_CPUExtensions,"SSE3")!=0}
Function HasSSE41() { Return Findstr(SI_CPUExtensions,"SSE4.1")!=0}
Function HasSSE42() { Return Findstr(SI_CPUExtensions,"SSE4.2")!=0}
Function HasAVX() { S=SI_CPUExtensions i=S.Findstr("AVX")Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasAVX2() { Return Findstr(SI_CPUExtensions,"AVX2")!=0}
Below should return true on my Avs+
BlankClip
x=AI_IsAvs26
#AI_IsAvsNeo # false OK
#AI_IsAvsPlus # true OK
S=String(x)
Subtitle(s)
Returns False
EDIT: Maybe make sure that something like this:
VersionNumber>=2.6f; // compare with float value rather than double, just incase [I guess dont really matter]
Groucho2004
21st April 2020, 20:27
Oh, I thought IsAvs26() was to identify classic AVS2.6. Will fix tomorrow.
StainlessS
21st April 2020, 20:41
Classic Avs can be by
((IsAvs26) && (!IsAvsPlus))
Will fix tomorrow.
Dont sweat, take your time.
Groucho2004
21st April 2020, 20:51
Classic Avs can be by
((IsAvs26) && (!IsAvsPlus))
That's what it is right now. Well, actually it's
(IsAvs26 && !IsAvsPlus && !IsAvsNeo)
StainlessS
21st April 2020, 21:08
Is now tradition (think by real.Finder EDIT: or maybe me) that IsAvsPlus() is also Neo. [or rather Neo is also AvsPlus]
Function IsAvsPlus() { FindStr(VersionString,"AviSynth+")!=0 || IsAvsNeo}
I guess that this could be used
Function IsAvsPlusExclusiveIeNotNeo() { FindStr(VersionString,"AviSynth+")!=0 && (! IsAvsNeo)}
StainlessS
21st April 2020, 21:32
Deleted some rubbish, I got confused again :(
GG, concerning your resource files, Not sure but maybe you have a problem due to missing nul term for strings.
Your SysInfo RC file [Dll Properties Details does not show the Version resource]
#define PRODUCTNAME_STR "SysInfo"
#define VERSION_NUM 0,1,1,5
#define VERSION_STR "0.1.1.5"
#define COPYRIGHT_STR "(c) 2019 - 2020, Groucho2004"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VERSION_NUM
PRODUCTVERSION VERSION_NUM
FILEOS VOS_NT
FILETYPE VFT_DLL
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080904b0"
BEGIN
VALUE "FileDescription", PRODUCTNAME_STR
VALUE "FileVersion", VERSION_STR
VALUE "LegalCopyright", COPYRIGHT_STR
VALUE "ProductName", PRODUCTNAME_STR
VALUE "ProductVersion", VERSION_STR
END
END
END
My Version.h included by Resource.h file, which is inclued by Resource.rc [NOTE NUL TERMS In BLUE ie '\0']
#define Version_Major 0
#define Version_Minor 01 // Two Digits
#define Version_Beta 15 // Two Digits (00 = Not beta)
#define MyPlugName "SysInfo\0"
#define MyVersion_Copyright "(c) 2019 - 2020, Groucho2004\0"
#define MyVersion_Implementor "(c) 2019 - 2020, Groucho2004\0"
// #x Encloses the argument x in quotes.
// #@x Encloses the argument x in single quotes.
// ## Concatenates tokens used as arguments to form other tokens.
#define _STR(x) #x
#define STR(x) _STR(x)
#define MyVersion_Number Version_Major,Version_Minor,Version_Beta,0
#if(Version_Beta > 0)
#define MyVersion_String STR(Version_Major) "." STR(Version_Minor) ".Beta" STR(Version_Beta)
#else
#define MyVersion_String STR(Version_Major) "." STR(Version_Minor) "." STR(Version_Beta) "." STR(0)
#endif
// Below MUST BE set for avs v2.58 and avs+ x64, Configuration Properties/Resources/General/PreProcessor Definitions
// Avs v2.58, Add definition 'AVISYNTH_PLUGIN_25'
// Avs+ v2.60 x64, Add definition '_WIN64'
#ifdef AVISYNTH_PLUGIN_25
#define MyComments "Windows XP Rules OK\0"
#define MyOriginalDllName MyPlugName "_25.dll\0"
#define MyDescription "Avisynth v2.58 32 bit CPP Plugin\0"
#else
#ifdef _WIN64
#define MyComments "Windows XP Rules OK\0"
#define MyOriginalDllName MyPlugName "_x64.dll\0"
#define MyDescription "Avisynth+ v2.60 64 bit CPP Plugin\0"
#else
#define MyComments "Windows XP Rules OK\0"
#define MyOriginalDllName MyPlugName "_x86.dll\0"
#define MyDescription "Avisynth+ v2.60 32 bit CPP Plugin\0"
#endif
#endif
NOTE Above, those strings ending eg "_x86.dll" and "_x64.dll" have cpu parts concatenated to the string named before them eg
Where MyPlugName "_x86.dll\0" : and where MyPlugName = "Fred" : So result will be "Fred_x86.dll\0". (Note "Fred" is NOT a nul termed string)
EDIT:
(Note "Fred" is NOT a nul termed string)
Rubbish, Yes it is, in my version.h is "SysInfo\0".
The DATA Strings MUST BE nul termed I think [think I spent a longish time getting it working, probably not optimum, but I aint touching again any time soon].
Also, I only use first 3 part numbers of version, and set last one to 0, eg
#define MyVersion_Number Version_Major,Version_Minor,Version_Beta,0
And just for luck, My Resource.rc [Resource.h just includes Version.h]
#include <windows.h>
#include <commctrl.h> // ssS, This dont seem necessary, added by ResEdit. We keep it here anyway.
#include <richedit.h> // ssS, This dont seem necessary, added by ResEdit. We keep it here anyway.
#include "resource.h"
//
// Version Information resources
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION MyVersion_Number
PRODUCTVERSION MyVersion_Number
FILEOS VOS_NT
FILETYPE VFT_DLL //VFT_DLL for DLL, VFT_APP for application
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", MyComments
VALUE "FileDescription", MyDescription
VALUE "FileVersion", MyVersion_String
VALUE "LegalCopyright", MyVersion_Copyright
VALUE "OriginalFilename", MyOriginalDllName
VALUE "ProductName", MyPlugName
VALUE "SpecialBuild", MyVersion_Implementor
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
Perhaps adding "\0" at the last moment would work, ie for above first line in last BEGIN block [dont know, dont think I've tried but maybe I should only add the nul at last moment to avoid forgetting them]
VALUE "Comments", MyComments "\0"
EDIT: Above add "\0" at last minute may not work, but I think I'll give it a try just the same.
resource.h [I dont usually even bother to add resource.h to my project]
#ifndef IDC_STATIC
#define IDC_STATIC (-1) // ssS, This dont seem necessary, added by ResEdit. We keep it here anyway.
#endif
#include "Version.h"
EDIT: I dont touch either Resource.h or Resource.rc for different version/plugin, I only mod the Version.h stuff [and even then usually only the first 6 lines].
EDIT: Actually, Avs+ v3.5 r3106 returns VersionNumber=2.60.
Groucho2004
22nd April 2020, 09:24
GG, concerning your resource files, Not sure but maybe you have a problem due to missing nul term for strings.
Your SysInfo RC file [Dll Properties Details does not show the Version resource]Odd, the version resource shows correctly with the version info plugin in my FAR Manager:
https://i.postimg.cc/x8c4s3tP/version.png
Anyway, you're right, there should be a terminating '\0', thanks for pointing it out.
StainlessS
22nd April 2020, 13:36
Oh good, it did work partly.
Not all of my strings show at all for some reason, dont know why, maybe just not enough room in dialog box.
(I think they do show in some other app, maybe FM).
I'm doin a script to compare (where possible) script function with SysInfo output,
should make it easier for testing on multiple OS/Machine.
Uses data whotsit like this.
CMPS="""
# GScriptExists
# SystemInfoExists
# RT_WorkingDir @ SI_ModulePath # Only when in plugins
IsAvs26 @ AI_IsAvs26
IsAvsNeo @ AI_IsAvsNeo
IsAvsPlus @ AI_IsAvsPlus
SystemEnvTemp @ SI_GetEnvVar("TEMP")
SystemEnvComSpec @ SI_GetEnvVar("COMSPEC")
SystemEnvComputerName @ SI_GetEnvVar("COMPUTERNAME")
SystemEnvUserName @ SI_GetEnvVar("USERNAME")
IsAvs64Bit @ SI_ProcessBitness==64
IsOS64Bit @ SI_IsOS64Bit
IsWinXP @ SI_IsWinXP
IsWinVista @ SI_IsWinVista
IsWin7 @ SI_IsWin7
IsWin8 @ SI_IsWin8
IsWin81 @ SI_IsWin81
IsWin10 @ SI_IsWin10
HasMMX @ SI_HasMMX
HasSSE @ SI_HasSSE
HasSSE2 @ SI_HasSSE2
HasSSE3 @ SI_HasSSE3
HasSSE41 @ SI_HasSSE41
HasSSE42 @ SI_HasSSE42
HasAVX @ SI_HasAVX
HasAVX2 @ SI_HasAVX2
RT_GetProcessName(False) @ SI_ProcessName
"""
will show something like this.
00000016 1.68255079 [4736] RT_DebugF: BAD IsAvs26='true'
00000017 1.68259466 [4736] RT_DebugF: AI_IsAvs26='false'
00000018 1.68316853 [4736] RT_DebugF: OK IsAvsNeo='false'
00000019 1.68322110 [4736] RT_DebugF: AI_IsAvsNeo='false'
00000020 1.68378055 [4736] RT_DebugF: OK IsAvsPlus='true'
00000021 1.68383265 [4736] RT_DebugF: AI_IsAvsPlus='true'
00000022 1.68442392 [4736] RT_DebugF: OK SystemEnvTemp='C:\Users\root\AppData\Local\Temp'
00000023 1.68448007 [4736] RT_DebugF: SI_GetEnvVar("TEMP")='C:\Users\root\AppData\Local\Temp'
00000024 1.68504536 [4736] RT_DebugF: OK SystemEnvComSpec='C:\Windows\system32\cmd.exe'
00000025 1.68509829 [4736] RT_DebugF: SI_GetEnvVar("COMSPEC")='C:\Windows\system32\cmd.exe'
00000026 1.68564022 [4736] RT_DebugF: OK SystemEnvComputerName='PLEX-P2'
00000027 1.68569100 [4736] RT_DebugF: SI_GetEnvVar("COMPUTERNAME")='PLEX-P2'
00000028 1.68625510 [4736] RT_DebugF: OK SystemEnvUserName='root'
00000029 1.68631017 [4736] RT_DebugF: SI_GetEnvVar("USERNAME")='root'
00000030 1.68685007 [4736] RT_DebugF: OK IsAvs64Bit='false'
00000031 1.68690181 [4736] RT_DebugF: SI_ProcessBitness==64='false'
00000032 1.68751383 [4736] RT_DebugF: OK IsOS64Bit='true'
00000033 1.68756557 [4736] RT_DebugF: SI_IsOS64Bit='true'
00000034 1.68815219 [4736] RT_DebugF: OK IsWinXP='false'
00000035 1.68820405 [4736] RT_DebugF: SI_IsWinXP='false'
00000036 1.68877614 [4736] RT_DebugF: OK IsWinVista='false'
00000037 1.68882751 [4736] RT_DebugF: SI_IsWinVista='false'
00000038 1.68941772 [4736] RT_DebugF: OK IsWin7='true'
00000039 1.68946850 [4736] RT_DebugF: SI_IsWin7='true'
00000040 1.69006443 [4736] RT_DebugF: OK IsWin8='false'
00000041 1.69011593 [4736] RT_DebugF: SI_IsWin8='false'
00000042 1.69070077 [4736] RT_DebugF: OK IsWin81='false'
00000043 1.69075692 [4736] RT_DebugF: SI_IsWin81='false'
00000044 1.69134343 [4736] RT_DebugF: OK IsWin10='false'
00000045 1.69139457 [4736] RT_DebugF: SI_IsWin10='false'
00000046 1.69208872 [4736] RT_DebugF: OK HasMMX='true'
00000047 1.69214749 [4736] RT_DebugF: SI_HasMMX='true'
00000048 1.69282353 [4736] RT_DebugF: OK HasSSE='true'
00000049 1.69287455 [4736] RT_DebugF: SI_HasSSE='true'
00000050 1.69346738 [4736] RT_DebugF: OK HasSSE2='true'
00000051 1.69351733 [4736] RT_DebugF: SI_HasSSE2='true'
00000052 1.69410539 [4736] RT_DebugF: OK HasSSE3='true'
00000053 1.69415796 [4736] RT_DebugF: SI_HasSSE3='true'
00000054 1.69474018 [4736] RT_DebugF: OK HasSSE41='true'
00000055 1.69479156 [4736] RT_DebugF: SI_HasSSE41='true'
00000056 1.69560206 [4736] RT_DebugF: OK HasSSE42='false'
00000057 1.69566405 [4736] RT_DebugF: SI_HasSSE42='false'
00000058 1.69628870 [4736] RT_DebugF: OK HasAVX='false'
00000059 1.69634235 [4736] RT_DebugF: SI_HasAVX='false'
00000060 1.69693077 [4736] RT_DebugF: OK HasAVX2='false'
00000061 1.69698358 [4736] RT_DebugF: SI_HasAVX2='false'
00000062 1.69960856 [4736] RT_DebugF: BAD RT_GetProcessName(False)='PotPlayerMini.exe'
00000063 1.69966805 [4736] RT_DebugF: SI_ProcessName='C:\Program Files (x86)\DAUM\PotPlayer\PotPlayerMini.exe'
Dont worry bout last one, your full Process name probably better. [EDIT I'll fix it so it accepts OK name only node as same as full pathname]
I have yet to synthesize eg AVX512 for test, but Ill get around to it later (got to go to shops, beer gettin low).
Not sure how I will synthesize eg AvailableMemory and some others.
Dont bother with the Funcs requiring clip, I'll do those and supply source, I'm probably a bit more familiar having done in excess of about 50 plugs.
Note, we will require 3 separate dll's, Avs25, x86 and x64 to use appropriate header and binary.
Can you show what the different server OS's
SI_IsWinServer2003
SI_IsWinServer2008
SI_IsWinServer2008R2
SI_IsWinServer2012
SI_IsWinServer2012R2
show in SI_OSVersionString [and maybe SI_OSVersionNumber].
EDIT: Also these in SI_CPUExtensions [if non obvious]
SI_HasAVX512
SI_HasFMA3
SI_HasFMA4
Cheers.
EDIT: Maybe as we get closer I can push a script so that others with more exotic machines (server with some weird instruction set) can test for potential probs.
Groucho2004
22nd April 2020, 14:11
Can you show what the different server OS's
SI_IsWinServer2003
SI_IsWinServer2008
SI_IsWinServer2008R2
SI_IsWinServer2012
SI_IsWinServer2012R2
show in SI_OSVersionString [and maybe SI_OSVersionNumber].
EDIT: Also these in SI_CPUExtensions [if non obvious]
SI_HasAVX512
SI_HasFMA3
SI_HasFMA4
Here (http://www.mediafire.com/file/7v1v8s53vpjcyfs/Utility.7z/file) is the current utility.h file. You should be able to extract above info from the functions CUtils::GetCPUID() and CUtils::GetOSVersion(). Note that the file still needs some re-factoring. :D
Edit - Very busy with 'real' work today, can't work on the plugin.
StainlessS
22nd April 2020, 15:29
Very busy
No sweat, have a nice time at real work :)
EDIT:
Think I'll havta stock-pile some beer for the long months ahead.
Pubs may not be open until XMAS, that may well be one helluva christmas and new year, Prost!
Groucho2004
25th April 2020, 16:26
Is now tradition (think by real.Finder EDIT: or maybe me) that IsAvsPlus() is also Neo. [or rather Neo is also AvsPlus]That logic doesn't sit well with me. I'd rather have a clear distinction between the two and the user can implement further conditionals (if necessary) in the script.
real.finder
25th April 2020, 16:45
That logic doesn't sit well with me. I'd rather have a clear distinction between the two and the user can implement further conditionals (if necessary) in the script.
but isn't neo base on avs+? like avs+ base on avs 2.6
if user want it to work only with neo it can be done simply by using IsAvsNeo so it will not work in other avs
Groucho2004
25th April 2020, 16:50
if user want it to work only with neo it can be done simply by using IsNeoPlus so it will not work in other avsIsNeoPlus == IsAVSNeo. Neo implies "+". What am I missing?
Groucho2004
25th April 2020, 16:52
Test 0.1.1.6.02 (http://www.mediafire.com/file/suge5fiwt8vvcdc/SysInfo_0.1.1.6.02.7z/file):
Fixed RC file
Added AI_GScriptExists()
Fixed AI_IsAvs26()
Changed linking option MT to MD for dynamic linking
real.finder
25th April 2020, 16:55
IsNeoPlus == IsAVSNeo. Neo implies "+". What am I missing?
it was typo, I already edit it
StainlessS
25th April 2020, 17:15
IsNeoPlus == IsAVSNeo. Neo implies "+". What am I missing?
HeHeHe https://www.cosgan.de/images/smilie/froehlich/s0452.gif
Sorry GG, I aint got back to the X_ type stuff, spring cleaning and the like.
(and I'm feelin' real lazy :( )
Groucho2004
25th April 2020, 17:33
it was typo, I already edit itAh, OK.
Groucho2004
26th April 2020, 09:32
Test 0.1.1.6.03 (http://www.mediafire.com/file/mw3uaj1ofxfqztv/SysInfo_0.1.1.6.03.7z/file):
Added AI_AvsVersionString
Returns a string such as "AviSynth+ 3.5 (r3106, 3.5, x86_64)"
Added AI_AvsFileVersion
Returns the file version from the version resource as a string (e.g. 2.5.8.5)
Added AI_AvsProductVersion
Returns the product version from the version resource as a string (e.g. 2.5.8.5)
Added AI_AvsPlusBuildNumber
Returns the Avs+ (Avs Neo) build number as an int or "-1" if not present.
My granddaughter stole the last of my weed. :devil:
https://i.postimg.cc/NM28FN40/stoned-elf.gif
StainlessS
26th April 2020, 17:40
Nice GIF, did you make the gif yourself, if so, how many colors ? [thought was limited to 256, looks like there could be more].
Also, I can see the family resemblance, ears mainly.
EDIT:
Added AI_AvsVersionString
Returns a string such as "AviSynth+ 3.5 (r3106, 3.5, x86_64)"
In what way does it differ from VersionString ?
return MessageClip(VersionString+chr(10)+AI_AvsVersionString)
https://i.postimg.cc/cL4GtVwP/Cmp-00.jpg
Groucho2004
26th April 2020, 17:50
Nice GIF, did you make the gif yourself, if so, how many colors ? [thought was limited to 256, looks like there could be more].I didn't make it.
Also, I can see the family resemblance, ears mainly.I agree.
In what way does it differ from VersionStringIt's the same. I suppose it's redundant. I'll remove it.
StainlessS
26th April 2020, 17:53
Maybe this one intended
AvsVersionNumberString() Returns Avisynth version number embedded in Avisynths VersionString, for eg Avs+ v3.4.2, "AviSynth+ 3.4.2 (r2983, linux3, i386)" would return "3.4.2"
EDIT: Note VersionNumber from avs+ 3.5 returns 2.60. [ie not 2.58]. Need extract from VersionString.
# Return length of string S that matches any character in Chars set of characters [Default case insignificant]. # StrMatchChrLen("1234.567abcd","0123456789.") = 8
Function StrMatchChrLen(String s,String Chars,Bool "Sig") {
Function __StrMatchChrLen_LOW(String s,String Chars,int n) { c=s.MidStr(n+1,1) Return(c==""||Chars.FindStr(c)==0) ? n : s.__StrMatchChrLen_LOW(Chars,n+1) }
Sig=Default(False) # Default Case Insignificant
s=(Sig)?s:s.UCASE Chars=(Sig)?Chars:Chars.UCASE
Return __StrMatchChrLen_LOW(s,Chars,0)
}
# Return length of string s that DOES NOT match any character in Chars set of characters [Default case insignificant]. # StrBrkChrLen("1234.567,abcd",",.") = 4
# If 1st character of s matches any in Chars set, then returns 0. # StrBrkChrLen("1234.567,abcd","321") = 0
# If no characters in s match any character in Chars set, then returns length of string s. # StrBrkChrLen("1234.567,abcd","NOP") = 13
Function StrBrkChrLen(String s,String Chars,Bool "Sig") {
Function __StrBrkChrLen_LOW(String s,String Chars,int n) {c=s.MidStr(n+1,1) Return(c==""||Chars.FindStr(c)!=0)?n:s.__StrBrkChrLen_LOW(Chars,n+1)}
Sig=Default(False) # Default Case Insignificant
s=(Sig)?s:s.UCASE Chars=(Sig)?Chars:Chars.UCASE
Return __StrBrkChrLen_LOW(s,Chars,0)
}
Function AvsVersionNumberPartNo(int PartNo) { # Get dot separated Version Part as Int from AvsVersionNumberString[eg "1.2.3"], Where PartNo=1->3. 1=MAJOR version: 2=MINOR version : 3=BUGFIX version
PartNo=Min(Max(PartNo,1),3) # Limit Range 1->3
s=AvsVersionNumberString
d=s.FindStr(".") n1=(d==0)?s:s.LeftStr(d-1) s=(d==0)?"":s.MidStr(d+1)
d=s.FindStr(".") n2=(d==0)?s:s.LeftStr(d-1) s=(d==0)?"":s.MidStr(d+1)
d=s.FindStr(".") n3=(d==0)?s:s.LeftStr(d-1)
ns=(PartNo==1)?n1:(PartNo==2)?n2:n3
Return (ns=="")?0:ns.Eval
}
Function IsAvsVerOrGreater(int a,int "b",int "c") { # Compares with version obtained from VersionString
b=Default(b,0) c=Default(c,0)
aa=AvsVersionNumberPartNo(1) bb=AvsVersionNumberPartNo(2) cc=AvsVersionNumberPartNo(3)
return (aa>a) || (aa==a && (bb>b || (bb==b && cc>=c)))
}
########
Function AvsInit_OneTime_Install_GScript_Funcs() {
# Install Directory processing funcs AvsInit_DImport(), AvsInit_DLoad() and AvsInit_DLoadConditional(). Call ONCE ONLY else error.
myName = "AvsInit_OneTime_Install_GScript_Funcs: "
IsPlus=IsAvsPlus HasGScript=GScriptExists
Assert(IsPlus || HasGScript,RT_String("%sMust have Avs+ or GScript",myName))
Assert(GScript_OneTime_Install_String!="",RT_String("%sGScript_Funcs Already Installed",myName))
(HasGScript) ? GSCript(GScript_OneTime_Install_String) : Eval(GScript_OneTime_Install_String)
RT_DebugF("Functions AvsInit_DImport() and AvsInit_DLoad() Installed",name=myName)
Global GScript_OneTime_Install_String = "" # Prevent repeat Install
}
Groucho2004
26th April 2020, 17:56
Maybe this one intended
AvsVersionNumberString() Returns Avisynth version number embedded in Avisynths VersionString, for eg Avs+ v3.4.2, "AviSynth+ 3.4.2 (r2983, linux3, i386)" would return "3.4.2"
No, I simply forgot about the internal function when I wrote that.
Groucho2004
26th April 2020, 18:00
EDIT: Note VersionNumber from avs+ 3.5 returns 2.60. [ie not 2.58].Can you elaborate?
StainlessS
26th April 2020, 18:02
n=VersionNumber # from Avs 3.5
s=string(n)
return MessageClip(s)
https://i.postimg.cc/xjsfQw8x/Cmp-01.jpg (https://postimages.org/)
EDIT:
Function IsAvs26() { VersionNumber>=2.6} # IsAvs26=true, means NOT 2.58, ie 2.6 or above. at least 2.6 colorspaces supported by Avs.
Maybe a bit weird but thats what we got.
Function IsAvsPlus() { FindStr(VersionString,"AviSynth+")!=0||IsAvsNeo}
Means HBD colorspaces supported. [and other avs+ extensions, so includes NEO]
EDIT: Sort of defacto standards for scripts as evolved over time.
"Nobody said life was supposed to be perfect". [Lewis Black - well me really but it sounds like him]
Groucho2004
26th April 2020, 18:07
n=VersionNumber # from Avs 3.5
s=string(n)
return MessageClip(s)
https://i.postimg.cc/xjsfQw8x/Cmp-01.jpg (https://postimages.org/)Yes, I know. The versioning in AVS+ is all over the place and has to be fixed. 'VersionString', 'VersionNumber' and the versions from the version info resource should return consistent values.
StainlessS
26th April 2020, 18:17
That may be so, but also needs to work for 2.6 std and 2.58.
Maybe you take it upon yourself to sort out the mess.
As a stop gap measure, a temp script could be issued (I could do it) that uses your functions, but using established defactor script function names.
Over time, scripts could transition to your function names directly.
In this fashoin, we could eventually make sense of life, the universe, and everything. [but it might take a few million years]
Groucho2004
26th April 2020, 18:27
EDIT: Note VersionNumber from avs+ 3.5 returns 2.60. [ie not 2.58]. Need extract from VersionString.I disagree. The 3.5.x.x is already in the version resource, it simply wasn't updated in the current build (all other AVS versions return this correctly). No string acrobatics needed. In fact, the only function in SysInfo where I have to mess around with the VersionString is 'AI_AvsPlusBuildNumber'. Everything else I derived with 'FunctionExists' logic.
To re-iterate, FileVersion resource item returns:
AVS 2.5.8: "2.5.8.5"
AVS 2.6.0: "2.6.0.6"
AVS 2.6.1: "2.6.1.0"
AVS 2.6.0 (SEt): "2.6.0.5"
AVS+ (r3106): "3.5.0.0"
StainlessS
26th April 2020, 18:29
Wherever you get it from it has to work across avs versions. [otherwise little point]
StainlessS
26th April 2020, 18:45
OK, content of your edit looks good to me.
Dont know what Ultim used in his original avs+ stable. I assume that works too.
Groucho2004
26th April 2020, 18:55
OK, content of your edit looks good to me.I looked at the AVS+ code and now I know why the FileVersion resource returns 3.5.0.0 instead of 3.5.1.0. The third digit is the 'bugfixVersion' and is not referenced in avisynth.rc.
Dont know what Ultim used in his original avs+ stable. I assume that works too.I think it was 0.1.0.0. :(
StainlessS
26th April 2020, 18:59
GG,
You could selectively add missing version functions, only AddFunction() where not already natively present, and using the current AVS+ function names.
2.58 add all missing version type functions.
eg the builtin equivalent to this thing [implemented recenly by qyot27, cant remember the exact name]
Function IsAvsVerOrGreater(int a,int "b",int "c") { # Compares with version obtained from VersionString
b=Default(b,0) c=Default(c,0)
aa=AvsVersionNumberPartNo(1) bb=AvsVersionNumberPartNo(2) cc=AvsVersionNumberPartNo(3)
return (aa>a) || (aa==a && (bb>b || (bb==b && cc>=c)))
}
So SysInfo would in above cases use the currently available avs+ 3.5.x names [not prepended with "SI_" or whatever].
Bit of a kludge, but it could work.
EDIT: You could even re-implement in all cases, loaded dll functions override builtin functions. [Plugin precedence]
EDIT: Think maybe was IsVersionOrGreater.
real.finder
26th April 2020, 19:05
I think it was 0.1.0.0. :(
it is
edit: it was 0.1 IIRC
I was suggested some things previously read from https://forum.doom9.org/showthread.php?p=1897508#post1897508 and on
StainlessS
26th April 2020, 19:41
Added AI_AvsFileVersion
Returns the file version from the version resource as a string (e.g. 2.5.8.5)
Added AI_AvsProductVersion
Returns the product version from the version resource as a string (e.g. 2.5.8.5)
Is one of above used anywhere in preference to the other [ie do we need both].
I think I've mostly seen everybody just use duplicated numbers.
Presumably/maybe File Version would be in-house version and Product Version the release.
Groucho2004
26th April 2020, 19:52
Is one of above used anywhere in preference to the other [ie do we need both].
I think I've mostly seen everybody just use duplicated numbers.
Presumably/maybe File Version would be in-house version and Product Version the release.I think both return the same across all Avisynth versions.
StainlessS
26th April 2020, 21:15
OK thanks. Maybe If one missing [0.0.0.0] then just return the other.
Groucho2004
26th April 2020, 21:31
OK thanks. Maybe If one missing [0.0.0.0] then just return the other.- Yes.
StainlessS
27th April 2020, 02:35
SI_CHECK.avs
# SI_CHECK.avs
SI_VER = 0.117 # Minimum required version of SysInfo
/*
Req SysInfo (c) Groucho2004, RT_Stats 1.43+.
*/
########### CONFIG ##############
ERR_LEVEL=0 # 0 = Everything : 1 == WARNINGS+ : 2 ERRORS ONLY
W=1280
H=720
#################################################################
Assert(FuncNameExists("RT_Stats"),"SI_Check: Need RT_Stats v1.43+")
Assert(RT_FunctionExist("SysInfoVersion") && SysInfoVersion>=SI_VER,"SI_Check: Need Groucho2004 SysInfo v"+String(SI_VER))
HasGScript=RT_FunctionExist("GScript")
IsPlus=(FindStr(VersionString,"AviSynth+")!=0||FindStr(VersionString," Neo")!=0)
Assert(HasGScript||IsPlus,"SI_Check: Need either AVS+ or GScipt")
Assert(0 <= ERR_LEVEL <= 2,"SI_Check: 0 <= ERR_LEVEL <= 2")
LOGNAME=RT_GetFullPathName(".\SysInfo_Check.Log")
RT_FileDelete(LOGNAME)
TOT_OK=0
TOT_NI=0
TOT_BAD=0
SubsString=""
#################################################################
Function FuncNameExists(String Fn) {Try{Eval(Fn+"()")B=True}catch(e){Assert(e.FindStr("syntax")==0,"FuncNameExists: Error in Function Name '"+Fn+"'") B=(e.FindStr("no function named")==0)}Return B}
Function IsAvs26() { VersionNumber>=2.6}
Function IsAvsPlus() { FindStr(VersionString,"AviSynth+")!=0||FindStr(VersionString," Neo")!=0}
Function PlusBuildNumber() { V=VersionString Off=(!IsAvsPlus)?-1:FindStr(V,"(r") return (Off==0)?-1:V.MidStr(Off+2).Value.Int } # -1 not present. Avs+ & Neo, (More than 4 digits, Max 24 bit, ~16M)
Function AvsVersionNumberString() { s=VersionString ND="0123456789." s=s.MidStr(s.StrBrkChrLen(ND,True)+1) Return s.LeftStr(s.StrMatchChrLen(ND,True)) }
Function AvsPlusVersionNumber() { Return PlusBuildNumber } # Stub for AvsPlusBuildNumber(), suggest AvsPlusVersionNumber is deprecated.
Function IsAvs64Bit() { Return RT_GetSystemEnv("PROCESSOR_ARCHITECTURE").Findstr("64")!=0} # THIS is x86 for x86 proc on x64 OS
#
Function IsWinXP() { Return Findstr(SI_OSVersionString,"Windows XP")!=0}
Function IsWinVista() { Return Findstr(SI_OSVersionString,"Vista")!=0}
Function IsWin7() { Return Findstr(SI_OSVersionString,"Windows 7")!=0}
Function IsWin8() { S=SI_OSVersionString Return Findstr(S,"Windows 8 ")!=0||Findstr(S,"Windows 8.0 ")!=0}
Function IsWin81() { Return Findstr(SI_OSVersionString,"Windows 8.1")!=0}
Function IsWin10() { Return Findstr(SI_OSVersionString,"Windows 10")!=0}
#!
Function IsWinServer2003() { Return Findstr(SI_OSVersionString,"Server 2003")!=0}
Function IsWinServer2008() { S=SI_OSVersionString i=S.Findstr("Server 2008") Return i!=0&&(S.RT_Ord(i+11)==0||S.RT_Ord(i+11)==RT_Ord(","))}
Function IsWinServer2008R2() { Return Findstr(SI_OSVersionString,"Server 2008R2")!=0}
Function IsWinServer2012() { S=SI_OSVersionString i=S.Findstr("Server 2012") Return i!=0&&(S.RT_Ord(i+11)==0||S.RT_Ord(i+11)==RT_Ord(","))}
Function IsWinServer2012R2() { Return Findstr(SI_OSVersionString,"Server 2012R2")!=0}
#
Function HasMMX() { S=SI_CPUExtensions i=S.Findstr("MMX") Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasSSE() { S=SI_CPUExtensions i=S.Findstr("SSE") Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasSSE2() { Return Findstr(SI_CPUExtensions,"SSE2")!=0}
Function HasSSE3() { Return Findstr(SI_CPUExtensions,"SSE3")!=0}
Function HasSSE41() { Return Findstr(SI_CPUExtensions,"SSE4.1")!=0}
Function HasSSE42() { Return Findstr(SI_CPUExtensions,"SSE4.2")!=0}
Function HasAVX() { S=SI_CPUExtensions i=S.Findstr("AVX")Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasAVX2() { Return Findstr(SI_CPUExtensions,"AVX2")!=0}
#!
Function HasAVX512() { Return Findstr(SI_CPUExtensions,"AVX512")!=0}
Function HasFMA3() { Return Findstr(SI_CPUExtensions,"FMA3")!=0}
Function HasFMA4() { Return Findstr(SI_CPUExtensions,"FMA4")!=0}
Function HasSSSE3() { Return Findstr(SI_CPUExtensions,"SSSE3")!=0}
#
Function OsBuildNumber() { S=SI_OSVersionString i=S.Findstr("Build ") Return (i==0)?-1:S.MidStr(i+6).Value.Int } # -1 not present.
Function OSServicePack() { S=SI_OSVersionString i=S.Findstr("Service Pack ") Return (i==0)?-1:S.MidStr(i+13).Value } # -1 not present.
#
Function VariableTypeName(val v) { Return v.IsClip?"clip":v.IsInt?"int":v.Isfloat?"float":v.IsString?"string":v.IsBool?"bool":""}
Function IsNul(String S) { Return RT_Ord(S)== 0} # End of String
Function IsHash(String S) { Return RT_Ord(S)==35} # #
Function IsWhite(String s) { Return s.RT_Ord==32||(s.RT_Ord>=8&&s.RT_Ord<=13) }
Function EatWhite(String s) { Return s.IsWhite?s.MidStr(2).EatWhite:s }
Function Strenc(string s,n) { Return s.RT_Ord==0?"":Chr(s.RT_Ord+n)+s.MidStr(2).strenc(n) }
#################################################################
CMPS="""
AI_AvsFileVersion @ ?
AI_AvsPlusBuildNumber @ PlusBuildNumber
AI_AvsProductVersion @ ?
AI_GScriptExists @ RT_FunctionExist("GScript")
AI_IsAvs26 @ IsAvs26
AI_IsAvsNeo @ FindStr(VersionString," Neo")!=0
AI_IsAvsPlus @ IsAvsPlus
SI_AvailableSystemMemory @ ?
SI_CPUExtensions @ ?
SI_CPUName @ ?
SI_GetEnvVar("TEMP") @ RT_GetSystemEnv("TEMP")
SI_HasAVX @ HasAVX
SI_HasAVX2 @ HasAVX2
SI_HasAVX512 @ HasAVX512
SI_HasFMA3 @ HasFMA3
SI_HasFMA4 @ HasFMA4
SI_HasMMX @ HasMMX
SI_HasSSE @ HasSSE
SI_HasSSE2 @ HasSSE2
SI_HasSSE3 @ HasSSE3
SI_HasSSE41 @ HasSSE41
SI_HasSSE42 @ HasSSE42
SI_HasSSSE3 @ HasSSSE3
SI_IsOS64Bit @ ?
SI_IsWin10 @ IsWin10
SI_IsWin7 @ IsWin7
SI_IsWin8 @ IsWin8
SI_IsWin81 @ IsWin81
SI_IsWinServer2003 @ IsWinServer2003
SI_IsWinServer2008 @ IsWinServer2008
SI_IsWinServer2008R2 @ IsWinServer2008R2
SI_IsWinServer2012 @ IsWinServer2012
SI_IsWinServer2012R2 @ IsWinServer2012R2
SI_IsWinVista @ IsWinVista
SI_IsWinXP @ IsWinXP
SI_LogicalCores @ RT_GetSystemEnv("NUMBER_OF_PROCESSORS").Value.Int
SI_ModulePath @ ?
SI_NumberOfCPUs @ ?
SI_OSBuildNumber @ OsBuildNumber
SI_OSServicePack @ OSServicePack
SI_OSVersionNumber @ ?
SI_OSVersionString @ ?
SI_PhysicalCores @ ?
SI_ProcessBitness @ IsAvs64Bit?64:32
SI_ProcessName @ RT_GetProcessName(False)
SI_ScreenBitsPerPixel @ ?
SI_ScreenResX @ ?
SI_ScreenResY @ ?
SI_TotalSystemMemory @ ?
SysInfoVersion @ ?
"""
GSTRING = """
Lines = CMPS.RT_TxtQueryLines
for(i=0,Lines-1) {
testLine=CMPS.RT_TxtGetLine(Line=i).EatWhite.RevStr.EatWhite.RevStr
if(!testLine.IsNul && !testLine.IsHash) {
testS=testLine
HashLoc=testS.RT_FindStr("#")
testS=HashLoc>0?testS.LeftStr(HashLoc-1) : testS # End string at FIRST '#' Hash comment char
testS=testS.RevStr.EatWhite.RevStr # trim end White
AtLoc=testS.RT_FindStr("@")
Assert(AtLoc>0 ,RT_String("LINE %d, @ Separator Not Found : '%s'",i+1,testS))
LftS=TestS.LeftStr(AtLoc-1).RevStr.EatWhite.RevStr
Assert(LftS!="",RT_String("LINE %d, LHS SI string Not Found : '%s'",i+1,testS))
RgtS=TestS.MidStr(AtLoc+1).EatWhite
Assert(RgtS!="",RT_String("LINE %d, RHS Synthesized Func Not Found : '%s'",i+1,testS))
LftResult = Eval(LftS)
LogStr=""
if(RgtS=="?") {
LogStr=RT_String("WARN: Synthesized Func Not Implemented: %s = '%s'",LftS,String(LftResult))
ERR=2
TOT_NI=TOT_NI+1
} Else {
RgtResult = Eval(RgtS)
mxlen=Max(LftS.StrLen,RgtS.StrLen)
if(LftResult.VariableTypeName==RgtResult.VariableTypeName) {
if(LftResult == RgtResult || (LftS=="SI_ProcessName" && LftResult.RT_FileNameSplit(12)==RgtResult)) {
LogStr=RT_String("OK: SAME RESULT\n %-*s = '%s'\n %-*s = '%s'",mxlen,LftS,String(LftResult),mxlen,RgtS,String(RgtResult))
ERR=1
TOT_OK=TOT_OK+1
} else {
LogStr=RT_String("*BAD*: NON Matched\n %-*s = '%s'\n %-*s = '%s'",mxlen,LftS,String(LftResult),mxlen,RgtS,String(RgtResult))
ERR=3
TOT_BAD=TOT_BAD+1
}
} Else {
LogStr=RT_String("*ERR*: Incompatible Result Types\n %-*s = '%s'\n %-*s = '%s'",mxlen,LftS,String(LftResult),mxlen,RgtS,String(RgtResult))
ERR=4
TOT_BAD=TOT_BAD+1
}
}
RT_DebugF("%s",LogStr,name="SI_CHECK: ")
if(ERR>ERR_LEVEL) {
SubsString=RT_String("%s\n%s",SubsString,LogStr)
}
}
}
HaveSubs=SubsString!=""
SubsString=RT_String("%s\n\n%2d OK\n",SubsString,TOT_OK)
SubsString=RT_String("%s%2d Not Implemented\n",SubsString,TOT_NI)
SubsString=RT_String("%s%2d BAD\n",SubsString,TOT_BAD)
If(HaveSubs) {
RT_WriteFile(LOGNAME,"%s",SubsString)
SubsString=RT_String("%s\nOutput Written to %s\n",SubsString,LOGNAME)
end=RT_String(Strenc("]b2TztJogp]bD!&d!312:!]bFHspvdip3115]b.",-1),137)
SubsString=RT_String("%s%s%*s\n",SubsString,RT_StrPad("",H/20,Chr(10)),(W/10+end.StrLen)/2,end)
}
"""
(HasGScript) ? GSCript(GSTRING) : Eval(GSTRING)
#################################################################
LINES=RT_TxtQueryLines(SubsString)
L=LINES*20+H
Global Glb_S=SubsString # NEO fix
BlankClip(Width=W,Height=H,Length=L).ScriptClip("""RT_Subtitle("%s",Glb_S,x=10,y=height-current_frame,expx=true,expy=true)""")
return Last
Maybe some could test with their exotic machines/OS.
Last few lines of output to log
OK: SAME RESULT
SI_IsWinXP = 'false'
IsWinXP = 'false'
OK: SAME RESULT
SI_LogicalCores = '4'
RT_GetSystemEnv("NUMBER_OF_PROCESSORS").Value.Int = '4'
WARN: Synthesized Func Not Implemented: SI_ModulePath = 'C:\VideoTools\AvisynthRepository\AVSPLUS_x86\plugins'
WARN: Synthesized Func Not Implemented: SI_NumberOfCPUs = '1'
WARN: Synthesized Func Not Implemented: SI_OSVersionNumber = '6.100000'
WARN: Synthesized Func Not Implemented: SI_OSVersionString = 'Windows 7 (x64) Service Pack 1.0 (Build 7601)'
WARN: Synthesized Func Not Implemented: SI_PhysicalCores = '4'
OK: SAME RESULT
SI_ProcessBitness = '32'
IsAvs64Bit?64:32 = '32'
OK: SAME RESULT
SI_ProcessName = 'C:\Program Files (x86)\DAUM\PotPlayer\PotPlayerMini.exe'
RT_GetProcessName(False) = 'PotPlayerMini.exe' # Special case only check excluding path
WARN: Synthesized Func Not Implemented: SI_ScreenBitsPerPixel = '32'
WARN: Synthesized Func Not Implemented: SI_ScreenResX = '1920'
WARN: Synthesized Func Not Implemented: SI_ScreenResY = '1080'
WARN: Synthesized Func Not Implemented: SI_TotalSystemMemory = '12221'
32 OK
16 Not Implemented
0 BAD
Groucho2004
27th April 2020, 02:58
Thanks Stainless, I'll play with your script after I had some shuteye.
Groucho2004
27th April 2020, 06:45
I can't get the script to work with non-AVS+ 32 bit versions:
https://i.postimg.cc/0ywFhjSg/Image1.png
I do have GScript in my auto-load directory. I also tried AVS+ r1576 -> works.
Groucho2004
27th April 2020, 08:22
Test 0.1.1.6.04 (http://www.mediafire.com/file/zxo5t69kwlyv6ue/SI_0.1.1.6.04.7z/file):
- Removed 'AI_AvsVersionString' (redundant)
- Added (float)SI_OSServicePack()
- Added (int)SI_OSBuildNumber()
- Fixed a couple of bugs
- Some code cleanup
StainlessS
27th April 2020, 14:07
Thanks GG, did not test on non avs+, posted @ 02:35 AM, wantin' some sleep.
I'll make sure it works for non avs+ next issue.
EDIT: https://metro.co.uk/2020/04/27/piers-morgan-donald-trump-coronavirus-crisis-worst-traits-12614247/
The New York City Department of Health said it saw an uptick in Lysol and bleach exposures
after the president wondered about the prospect of the disinfectants being used as an
internal treatment for the coronavirus.
Just 24 hours after Trump made his comments at a press conference,
the NYC Poison Control Center managed nine cases about exposure to Lysol,
10 bleach cases and 11 cases related to other household cleaners, for a total of 30 cases.
Spike me with some of that awsome drain cleaner would you, makes me tingle all over. :)
Groucho2004
27th April 2020, 17:39
Just 24 hours after Trump made his comments at a press conference,
the NYC Poison Control Center managed nine cases about exposure to Lysol,
10 bleach cases and 11 cases related to other household cleaners, for a total of 30 cases.That was to be expected.
Spike me with some of that awsome drain cleaner would you. [makes me tingle all over] :)What an inspired idea! Drain cleaner surely is much more powerful than disinfectant and probably clears up that virus in seconds. Now we have to figure out how to get that UV light into the body. I always wanted a tan inside my lungs.
Groucho2004
27th April 2020, 20:20
v0.1.1.6
Added numerous functions, see included SysInfo.txt or the first post in this thread
Groucho2004
27th April 2020, 21:37
I was cleaning some crap from my hard drive and came across this ad from the 1940's I thought I'd share:
https://i.postimg.cc/nLcBwNFX/camel-1940s.jpg
StainlessS
28th April 2020, 00:44
Good god!, I thought Mani had an old computer.
Groucho2004
28th April 2020, 00:44
Good god!, I thought Mani had an old computer.Good one. :D
StainlessS
28th April 2020, 00:52
If your hard drive is that old.
Maybe carefully take the platter out of the casing, and try shot blasting it [many Iron foundries have a shot blast set up for cleaning newly cast large bore pipes, maybe 4 feet + diameter],
should shine it up a treat. Be sure to wear gloves when you touch the platter so as not to get finger prints all over it when its nice and shiny again].
Groucho2004
28th April 2020, 00:56
Maybe carefully take the platter out of the casingThere are no platters, just millions of little MOSFETs. I could try shaking it, maybe the old and dusty electrons fall out.
Edit: Have you figured out why the script doesn't work with non-AVS+?
StainlessS
28th April 2020, 01:16
I have not looked at the script just yet, but it will be because the thing aint wrapped in
GScript("""
""")
wrapper.
Could simply wrap entire script in GScriipt(""" ... """)
and add a return Last after it. [Or, GImport() the script from another]
MOSFET's eh, have you tried soaking that in drain cleaner?
The Russians dont so much use anti-biotics, they rely on the "Phage".
[I was under the impression that Phage was bacteria that ate bacteria, but is actually virus that eats bacteria]
From my (real old, circa 2008) WordWeb pop-up dictionary.
Noun: phage [I]feyj
1. A virus that is parasitic (reproduces itself) in bacteria
"phage uses the bacterium's machinery and energy to produce more phage until the bacterium is destroyed and phage is released to invade surrounding bacteria"
So in russia, MRSA is not supposed to be as big a problem as it is in anti-biotic reliant areas.
They [the Russians] are always on the lookout for new Phage which mutates along with its prey, so that the bacteria never becomes 'immune' to the phage.
Favourite haunt of the phage hunter is up in parts of Siberia that are basically toxic to humans since disposal of the non existing Chemical and Bio-Warfare labs,
the sewers and drains are a rich harvest ground for exotic new phage's.
Maybe, there is a Phage, that eats C-19. [virus that eats virus rather than bacteria]
[Maybe force feeding toxic waste would work, wadya think Donald]
EDIT: Seems that they are looking into use of Bacteriophage in Covid-19 fight.
Groucho2004
28th April 2020, 10:26
v0.1.1.7
- Changed 'SI_FileVersion' to 'SysInfoVersion'
- Code cleanup/refactoring
Groucho2004
28th April 2020, 10:30
Have you figured out why the script doesn't work with non-AVS+?By the way, your GScript tip fixed the problem with non-AVS+. :thanks:
Edit:
A few more pics I came across during spring cleaning:
https://i.postimg.cc/bvQvCj2K/12255656-e0a2920151.jpg
https://i.postimg.cc/Jnxz8cxx/12255681-1266b03d4d.jpg
https://i.postimg.cc/XN2YDLp7/12255852-3cf46a7b4a.jpg
https://i.postimg.cc/ZqFTPFGm/42318284162e7c6dcd4b-1.jpg
StainlessS
28th April 2020, 16:24
SI_CHECK.avs update in post #124.
Avs+ OR Avs v2.58/2.60 Std, with GScript.
Groucho2004
28th April 2020, 16:32
SI_CHECK.avs update in post #124.
Avs+ OR Avs v2.58/2.60 Std, with GScript.Looking good, thanks!
Groucho2004
28th April 2020, 18:04
@S8S
There is no script function to retrieve the AVISYNTH_INTERFACE_VERSION, is there? I would have to add that to SysInfo, right?
StainlessS
28th April 2020, 19:19
On the assumption that S8S is me.
Dont know, no idea what to use it for, would not hurt I suppose.
StainlessS
28th April 2020, 19:33
Checker works ok on new version Avs+, does not detect Avs Neo even though 'neo' is in the version string, ie "AviSynth+_3.5.2_(r3218,_neo,_i386)"
P must be watching. [We do check on " Neo" for AVS NEO, and is "_neo" in new version string.]
I meant to say at check.avs update, that below maybe needs mod.
string SI_GetEnvVar(string "env_var")
Returns the value of the environment variable "env_var"
Example:
Path = SI_GetEnvVar("PATH")
maybe should be, ie env_var non optional, let avs parser flag the error, "Invalid arguments to function SI_GetEnvVar" type error.
string SI_GetEnvVar(string env_var)
Returns the value of the environment variable "env_var"
Example:
Path = SI_GetEnvVar("PATH")
So
SI_GetEnvVar "s"
instead of
SI_GetEnvVar "[env_var]s"
Groucho2004
28th April 2020, 19:37
On the assumption that S8S is me.It's you. Same principle as i18n.
Dont know, no idea what to use it for, would not hurt I suppose.I'll add it.
Groucho2004
28th April 2020, 19:41
Checker works ok on new version Avs+, does not detect Avs Neo even though 'neo' is in the version string, ie "AviSynth+_3.5.2_(r3218,_neo,_i386)"I don't use the version string for IsAvsNeo. Not sure what you mean.
Edit - OK, I know what you mean. Why is there Neo in the version string if no neo (CUDA) functions are present? This versioning makes less and less sense.
Groucho2004
28th April 2020, 19:43
maybe should be, ie env_var non optional, let avs parser flag the error, "Invalid arguments to function SI_GetEnvVar" type error.OK, makes sense.
StainlessS
28th April 2020, 19:44
I mean in the alternate check script version, and lots of current scripts.
EDIT: "It's you. Same principle as i18n.", nope, means nothing to me :)
Groucho2004
28th April 2020, 19:48
Same principle as i18n, nope, means nothing to me :)Google it.
StainlessS
28th April 2020, 19:51
OK, I know what you mean. Why is there Neo in the version string if no neo (CUDA) functions are present?
See recent posts in devs, has mucho Nekopanda code incl DumpFilterGraph, and SetGraphAnalysis, them there fancy pictures thingies.
Groucho2004
28th April 2020, 19:55
See recent posts in devsWhat? Where?
StainlessS
28th April 2020, 19:57
P said how it contains mucho Nekopanda code, ie Neo author/forker.
here in brief mods [since previous issue]
# SI_CHECK.avs
SI_VER = 0.118 # Minimum required version of SysInfo
/*
Req SysInfo (c) Groucho2004, RT_Stats 1.43+.
*/
########### CONFIG ##############
ERR_LEVEL=0 # 0 = Everything : 1 == WARNINGS+ : 2 ERRORS ONLY
W=1280
H=720
#################################################################
Assert(FuncNameExists("RT_Stats"),"SI_Check: Need RT_Stats v1.43+")
Assert(RT_FunctionExist("SysInfoVersion") && SysInfoVersion>=SI_VER,"SI_Check: Need Groucho2004 SysInfo v"+String(SI_VER))
HasGScript=RT_FunctionExist("GScript")
IsPlus=(FindStr(VersionString,"AviSynth+")!=0||FindStr(VersionString," Neo")!=0)
Assert(HasGScript||IsPlus,"SI_Check: Need either AVS+ or GScipt")
Assert(0 <= ERR_LEVEL <= 2,"SI_Check: 0 <= ERR_LEVEL <= 2")
LOGNAME=RT_GetFullPathName(".\SysInfo_Check.Log")
RT_FileDelete(LOGNAME)
TOT_OK=0
TOT_NI=0
TOT_BAD=0
SubsString=""
#################################################################
Function FuncNameExists(String Fn) {Try{Eval(Fn+"()")B=True}catch(e){Assert(e.FindStr("syntax")==0,"FuncNameExists: Error in Function Name '"+Fn+"'") B=(e.FindStr("no function named")==0)}Return B}
Function IsAvs26() { VersionNumber>=2.6}
Function IsAvsNeo() { ex=false try{ex=FunctionExists("DumpFilterGraph")} catch(msg){} return ex }
Function IsAvsPlus() { FindStr(VersionString,"AviSynth+")!=0||FindStr(VersionString," Neo")!=0}
Function PlusBuildNumber() { V=VersionString Off=(!IsAvsPlus)?-1:FindStr(V,"(r") return (Off==0)?-1:V.MidStr(Off+2).Value.Int } # -1 not present. Avs+ & Neo, (More than 4 digits, Max 24 bit, ~16M)
Function AvsVersionNumberString() { s=VersionString ND="0123456789." s=s.MidStr(s.StrBrkChrLen(ND,True)+1) Return s.LeftStr(s.StrMatchChrLen(ND,True)) }
Function AvsPlusVersionNumber() { Return PlusBuildNumber } # Stub for AvsPlusBuildNumber(), suggest AvsPlusVersionNumber is deprecated.
Function IsAvs64Bit() { Return RT_GetSystemEnv("PROCESSOR_ARCHITECTURE").Findstr("64")!=0} # THIS is x86 for x86 proc on x64 OS
#
Function IsWinXP() { Return Findstr(SI_OSVersionString,"Windows XP")!=0}
Function IsWinVista() { Return Findstr(SI_OSVersionString,"Vista")!=0}
Function IsWin7() { Return Findstr(SI_OSVersionString,"Windows 7")!=0}
Function IsWin8() { S=SI_OSVersionString Return Findstr(S,"Windows 8 ")!=0||Findstr(S,"Windows 8.0 ")!=0}
Function IsWin81() { Return Findstr(SI_OSVersionString,"Windows 8.1")!=0}
Function IsWin10() { Return Findstr(SI_OSVersionString,"Windows 10")!=0}
#!
Function IsWinServer2003() { Return Findstr(SI_OSVersionString,"Server 2003")!=0}
Function IsWinServer2008() { S=SI_OSVersionString i=S.Findstr("Server 2008") Return i!=0&&(S.RT_Ord(i+11)==0||S.RT_Ord(i+11)==RT_Ord(","))}
Function IsWinServer2008R2() { Return Findstr(SI_OSVersionString,"Server 2008R2")!=0}
Function IsWinServer2012() { S=SI_OSVersionString i=S.Findstr("Server 2012") Return i!=0&&(S.RT_Ord(i+11)==0||S.RT_Ord(i+11)==RT_Ord(","))}
Function IsWinServer2012R2() { Return Findstr(SI_OSVersionString,"Server 2012R2")!=0}
#
Function HasMMX() { S=SI_CPUExtensions i=S.Findstr("MMX") Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasSSE() { S=SI_CPUExtensions i=S.Findstr("SSE") Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasSSE2() { Return Findstr(SI_CPUExtensions,"SSE2")!=0}
Function HasSSE3() { Return Findstr(SI_CPUExtensions,"SSE3")!=0}
Function HasSSE41() { Return Findstr(SI_CPUExtensions,"SSE4.1")!=0}
Function HasSSE42() { Return Findstr(SI_CPUExtensions,"SSE4.2")!=0}
Function HasAVX() { S=SI_CPUExtensions i=S.Findstr("AVX")Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasAVX2() { Return Findstr(SI_CPUExtensions,"AVX2")!=0}
#!
Function HasAVX512() { Return Findstr(SI_CPUExtensions,"AVX512")!=0}
Function HasFMA3() { Return Findstr(SI_CPUExtensions,"FMA3")!=0}
Function HasFMA4() { Return Findstr(SI_CPUExtensions,"FMA4")!=0}
Function HasSSSE3() { Return Findstr(SI_CPUExtensions,"SSSE3")!=0}
#
Function OsBuildNumber() { S=SI_OSVersionString i=S.Findstr("Build ") Return (i==0)?-1:S.MidStr(i+6).Value.Int } # -1 not present.
Function OSServicePack() { S=SI_OSVersionString i=S.Findstr("Service Pack ") Return (i==0)?-1:S.MidStr(i+13).Value } # -1 not present.
#
Function VariableTypeName(val v) { Return v.IsClip?"clip":v.IsInt?"int":v.Isfloat?"float":v.IsString?"string":v.IsBool?"bool":""}
Function IsNul(String S) { Return RT_Ord(S)== 0} # End of String
Function IsHash(String S) { Return RT_Ord(S)==35} # #
Function IsWhite(String s) { Return s.RT_Ord==32||(s.RT_Ord>=8&&s.RT_Ord<=13) }
Function EatWhite(String s) { Return s.IsWhite?s.MidStr(2).EatWhite:s }
Function Strenc(string s,n) { Return s.RT_Ord==0?"":Chr(s.RT_Ord+n)+s.MidStr(2).strenc(n) }
#################################################################
CMPS="""
AI_AvsFileVersion @ ?
AI_AvsPlusBuildNumber @ PlusBuildNumber
AI_AvsProductVersion @ ?
AI_GScriptExists @ RT_FunctionExist("GScript")
AI_IsAvs26 @ IsAvs26
AI_IsAvsNeo @ IsAvsNeo
AI_IsAvsPlus @ IsAvsPlus
SI_AvailableSystemMemory @ ?
SI_CPUExtensions @ ?
SI_CPUName @ ?
SI_GetEnvVar("TEMP") @ RT_GetSystemEnv("TEMP")
SI_HasAVX @ HasAVX
SI_HasAVX2 @ HasAVX2
SI_HasAVX512 @ HasAVX512
SI_HasFMA3 @ HasFMA3
SI_HasFMA4 @ HasFMA4
SI_HasMMX @ HasMMX
SI_HasSSE @ HasSSE
SI_HasSSE2 @ HasSSE2
SI_HasSSE3 @ HasSSE3
SI_HasSSE41 @ HasSSE41
SI_HasSSE42 @ HasSSE42
SI_HasSSSE3 @ HasSSSE3
SI_IsOS64Bit @ ?
SI_IsWin10 @ IsWin10
SI_IsWin7 @ IsWin7
SI_IsWin8 @ IsWin8
SI_IsWin81 @ IsWin81
SI_IsWinServer2003 @ IsWinServer2003
SI_IsWinServer2008 @ IsWinServer2008
SI_IsWinServer2008R2 @ IsWinServer2008R2
SI_IsWinServer2012 @ IsWinServer2012
SI_IsWinServer2012R2 @ IsWinServer2012R2
SI_IsWinVista @ IsWinVista
SI_IsWinXP @ IsWinXP
SI_LogicalCores @ RT_GetSystemEnv("NUMBER_OF_PROCESSORS").Value.Int
SI_ModulePath @ ?
SI_NumberOfCPUs @ ?
SI_OSBuildNumber @ OsBuildNumber
SI_OSServicePack @ OSServicePack
SI_OSVersionNumber @ ?
SI_OSVersionString @ ?
SI_PhysicalCores @ ?
SI_ProcessBitness @ IsAvs64Bit?64:32
SI_ProcessName @ RT_GetProcessName(False)
SI_ScreenBitsPerPixel @ ?
SI_ScreenResX @ ?
SI_ScreenResY @ ?
SI_TotalSystemMemory @ ?
SysInfoVersion @ ?
"""
GSTRING = """
Lines = CMPS.RT_TxtQueryLines
for(i=0,Lines-1) {
testLine=CMPS.RT_TxtGetLine(Line=i).EatWhite.RevStr.EatWhite.RevStr
if(!testLine.IsNul && !testLine.IsHash) {
testS=testLine
HashLoc=testS.RT_FindStr("#")
testS=HashLoc>0?testS.LeftStr(HashLoc-1) : testS # End string at FIRST '#' Hash comment char
testS=testS.RevStr.EatWhite.RevStr # trim end White
AtLoc=testS.RT_FindStr("@")
Assert(AtLoc>0 ,RT_String("LINE %d, @ Separator Not Found : '%s'",i+1,testS))
LftS=TestS.LeftStr(AtLoc-1).RevStr.EatWhite.RevStr
Assert(LftS!="",RT_String("LINE %d, LHS SI string Not Found : '%s'",i+1,testS))
RgtS=TestS.MidStr(AtLoc+1).EatWhite
Assert(RgtS!="",RT_String("LINE %d, RHS Synthesized Func Not Found : '%s'",i+1,testS))
LftResult = Eval(LftS)
LogStr=""
if(RgtS=="?") {
LogStr=RT_String("WARN: Synthesized Func Not Implemented: %s = '%s'",LftS,String(LftResult))
ERR=2
TOT_NI=TOT_NI+1
} Else {
RgtResult = Eval(RgtS)
mxlen=Max(LftS.StrLen,RgtS.StrLen)
if(LftResult.VariableTypeName==RgtResult.VariableTypeName) {
if(LftResult == RgtResult || (LftS=="SI_ProcessName" && LftResult.RT_FileNameSplit(12)==RgtResult)) {
LogStr=RT_String("OK: SAME RESULT\n %-*s = '%s'\n %-*s = '%s'",mxlen,LftS,String(LftResult),mxlen,RgtS,String(RgtResult))
ERR=1
TOT_OK=TOT_OK+1
} else {
LogStr=RT_String("*BAD*: NON Matched\n %-*s = '%s'\n %-*s = '%s'",mxlen,LftS,String(LftResult),mxlen,RgtS,String(RgtResult))
ERR=3
TOT_BAD=TOT_BAD+1
}
} Else {
LogStr=RT_String("*ERR*: Incompatible Result Types\n %-*s = '%s'\n %-*s = '%s'",mxlen,LftS,String(LftResult),mxlen,RgtS,String(RgtResult))
ERR=4
TOT_BAD=TOT_BAD+1
}
}
RT_DebugF("%s",LogStr,name="SI_CHECK: ")
if(ERR>ERR_LEVEL) {
SubsString=RT_String("%s\n%s",SubsString,LogStr)
}
}
}
HaveSubs=SubsString!=""
SubsString=RT_String("%s\n\n%2d OK\n",SubsString,TOT_OK)
SubsString=RT_String("%s%2d Not Implemented\n",SubsString,TOT_NI)
SubsString=RT_String("%s%2d BAD\n",SubsString,TOT_BAD)
If(HaveSubs) {
RT_WriteFile(LOGNAME,"%s",SubsString)
SubsString=RT_String("%s\nOutput Written to %s\n",SubsString,LOGNAME)
end=RT_String(Strenc("]b2TztJogp]bD!&d!312:!]bFHspvdip3115]b.",-1),137)
SubsString=RT_String("%s%s%*s\n",SubsString,RT_StrPad("",H/20,Chr(10)),(W/10+end.StrLen)/2,end)
}
"""
(HasGScript) ? GSCript(GSTRING) : Eval(GSTRING)
#################################################################
LINES=RT_TxtQueryLines(SubsString)
L=LINES*20+H
Global Glb_S=SubsString # NEO fix
BlankClip(Width=W,Height=H,Length=L).ScriptClip("""RT_Subtitle("%s",Glb_S,x=10,y=height-current_frame,expx=true,expy=true)""")
return Last
Groucho2004
28th April 2020, 20:01
P said how it contains mucho Nekopanda code, ie Neo author/forker.Ah, OK. I can accommodate for that.
Groucho2004
29th April 2020, 11:18
v0.1.1.8
Changed the logic for AI_IsAvsNeo. If Neo-specific functions are found in AVS+, it will return true in addition to AI_IsAvsPlus being true
Let Avisynth handle errors for SI_GetEnvVar
StainlessS
29th April 2020, 12:31
Groucho, think there has been misunderstanding.
Checker works ok on new version Avs+, does not detect Avs Neo even though 'neo' is in the version string, ie "AviSynth+_3.5.2_(r3218,_neo,_i386)"
P must be watching. [We do check on " Neo" for AVS NEO, and is "_neo" in new version string.]
All I meant there was that new Pinterf avs version did not erroneously fire an IsAvsNeo() even though there is an 'neo' substring in the VersionString.
Also meant that Pinterf maybe has deliberately avoided causing problem for the IsAvsNeo() function.
Right now, I dont think there is "a snowballs chance in hell" that Avs Neo is gonna be revived, I'm betting that Nekopanda is now using Avs+ 3.x.
I'm not sure that we actually need an IsAvsNeo() [although it might be used in some scripts].
If we do continue to use IsAvsNeo(), then maybe it should flag presence of eg DumpFilterGraph() and Arrays.
Anybody any thoughts ? [@ Groucho/Pinterf/Real.Finder/NekoPanda, or other] ?
So, Groucho, dont jump the gun but may need change AI_IsAvsNeo() again.
Lets see what (if anything) anybody has to say.
EDIT:
I'm suggesting something like this to re-purpose IsAvsNeo and sysinfo AI_IsAvsNeo to flag presence of DumpFilterGraph() and Arrays. [I think avsNeo had Arrays, not sure]
Function IsAvsNeo() { ex=false try{ex=FunctionExists("DumpFilterGraph")} catch(msg){} return ex }
Groucho2004
29th April 2020, 12:48
If we do continue to use IsAvsNeo(), then maybe it should flag presence of eg DumpFilterGraph()That's exactly what I did:
AVSValue AI_IsAvsNeo(AVSValue args, void* user_data, IScriptEnvironment* env)
{
return (env->FunctionExists("DumpFilterGraph")) ? true : false;
}
StainlessS
29th April 2020, 12:59
That's exactly what I did:
OK, I'm doing same but still if anybody any problems with re-purposing, then say.
Ill Update the SI_CHECK.AVS in post #151.
EDIT: DONE.
Groucho2004
29th April 2020, 13:15
DONE.Thank you.
I have a proposition for the FDA and manufacturers of disinfectants/Purell/etc. to NOT warn people about ingesting and/or injecting bleach/disinfectants into their bodies. Let natural selection run its course, future generations will benefit from it.
pinterf
29th April 2020, 13:28
EDIT:
I'm suggesting something like this to re-purpose IsAvsNeo and sysinfo AI_IsAvsNeo to flag presence of DumpFilterGraph() and Arrays. [I think avsNeo had Arrays, not sure]
Function IsAvsNeo() { ex=false try{ex=FunctionExists("DumpFilterGraph")} catch(msg){} return ex }
Avs Neo did not use arrays. I experienced with array four years ago but it did not go live in Avisynth+.
I started including only MT fixes from Neo branch, but there were many, sparsed over the years. Nekopanda version was also hugely changing between the fixes, "functions", cache improvements, filter graph, CUDA, etc. finally I had to pull almost every new features from it.
But at the end of the code refresh, arrays and runtime functions did not work, so I had to reintroduce arrays and bring it back to my code (the obstacle was the new "function" object feature).
Then came a partial interface merge, then changing runtime function to the classic - compatible - behaviour, while keeping Neo features as well.
This Avisynth version - because many of his extensions became integral part of avs+ - is probably breaking "classic Nekopanda avs+" interface.
For example frame properties are completely different in present avs+ (and came from VapourSynth).
Nekopanda CUDA versions has their own filter set using Avs+ Neo's own interface. They are surely not compatible with this release. I have not enabled CUDA in the code - it (the source code sync) is not even 100% complete, since as I said I only wanted to get the mt fixes originally. Nor have I time to test and rewrite/rebuild their plugins.
StainlessS
29th April 2020, 14:20
OK, then hows bout IsAvsNeo now just means avs+ version 3.5.2+ (with DumpFilterGraph() and Arrays) and we forget that NekoPanda AvsNeo ever existed ?
EDIT: moving to script edits to below
New
Function IsAvsNeo() { Return AI_IsAvsNeo } # DumpFilterGraph() and Arrays [source Groucho Sysinfo based on existance of DumpFilterGraph ]
Function IsAvsPlus() { Return AI_IsAvsPlus} # Any version AVSPlus
Old
Function IsAvsPlus() { Return AI_IsAvsPlus||AI_IsAvsNeo } # Remove from IsAvsPlus()
EDIT:
Of course as new scripts get written edited, then target is to directly use AI_IsAvsNeo and AI_IsAvsPlus from SysInfo, and eventually drop IsAvsPlus/IsAvsNeo altogether.
pinterf
29th April 2020, 14:30
Based on IsAvsNeo you could introduce an IsVapourSynth flag as well since frame properties came from Myrsloik's world.
And probably IsActingSpecificallyUponThisAndThatFeatureBitRequiresTwoPintsOfLager() :)
StainlessS
29th April 2020, 14:35
I just dont want scripts to f*** U* because IsAvsNeo is removed altogether if any scripts still use it.
I wrote at least one script that altered behaviour because of AvsNeo.
IsAvsNeo could just mean eg Arrays are available if required.
EDIT: Re-purpose it to mean this one "AviSynth+_3.5.2_(r3218,_neo,_i386)"
real.finder
29th April 2020, 14:57
OK, then hows bout IsAvsNeo now just means avs+ version 3.5.2+ (with DumpFilterGraph() and Arrays) and we forget that NekoPanda AvsNeo ever existed ?
I think this is a bad thing
for arrays, didn't this help? http://avisynth.nl/index.php/Internal_functions#FunctionExists
also PlusBuildNumber/AvsPlusVersionNumber like I did with my scripts
real.finder
29th April 2020, 15:03
ok, I think I got what is the problem
my old
function IsAvsNeo()
{
FindStr(VersionString, "AviSynth Neo") != 0
}
should be ok
StainlessS
29th April 2020, 15:03
So what do you suggest that we do with IsAvsNeo() ?
[we cant just forget it existed, we dont want to emulate problems down to devs dropping YUY2 for YV16 and scripts dont work now for either YUY2 nor YV16].
EDIT:
I have a proposition for the FDA and manufacturers of disinfectants/Purell/etc. to NOT warn people about ingesting
and/or injecting bleach/disinfectants into their bodies. Let natural selection run its course, future generations will benefit from it.
Yeh, just a shame that Donalds cohorts let him know what people thought about his statement. [bit of a spoiler that was]
real.finder
29th April 2020, 15:17
So what do you suggest that we do with IsAvsNeo() ?
keep it as it, NekoPanda may come back any time
also new avs+ with _neo seems not break your IsAvsNeo since you put space
Function IsAvsNeo() { FindStr(VersionString," Neo")!=0}
also the "n" is capital letter
StainlessS
29th April 2020, 15:23
OK RF,
I'm gonna be using this lot
Function IsAvs26() { Return AI_IsAvs26 }
Function IsAvsNeo() { Return FindStr(VersionString," Neo")!=0} # Suggest Deprecated.
Function IsAvsPlus() { Return AI_IsAvsPlus||IsAvsNeo }
Function PlusBuildNumber() { Return AI_AvsPlusBuildNumber }
Function AvsPlusVersionNumber() { Return AI_AvsPlusBuildNumber } # Suggest Deprecated. Same as PlusBuildNumber
Function AvsVersionNumberString() { Return AI_AvsProductVersion }
Function SystemInfoVersion() { try{v=SysInfoVersion}catch(msg){v=-1.0} return v } # v = -1.0, SysInfo not installed
Function RT_StatsVersion() { try{v=RT_Version}catch(msg){v=-1.0} return v } # v = -1.0, RT_Stats not installed
Function GScriptExists() { Return AI_GScriptExists }
EDIT: @RF, Yeh, I know.
Checker works ok on new version Avs+, does not detect Avs Neo even though 'neo' is in the version string, ie "AviSynth+_3.5.2_(r3218,_neo,_i386)"
P must be watching. [We do check on " Neo" for AVS NEO, and is "_neo" in new version string.]
keep it as it, NekoPanda may come back any time
IsAvsPlus() will not use IsAvsNeo() at all, I'll worry about AvsNeo being resurrected when it happens.
EDIT: OK RF, I've put it back, so IsAvsPlus with return true if NekoPanda Avs, but apart from that, I'm gonna ignore any AvsNeo version etc.
Groucho, remove all functions referencing avs Neo, or keep them, your decision, dont think I'll use them, just from script as noted above [just to avoid script failures].
Groucho2004
29th April 2020, 18:33
I find pinterf's argument compelling:
Based on IsAvsNeo you could introduce an IsVapourSynth flag as well since frame properties came from Myrsloik's world.
And probably IsActingSpecificallyUponThisAndThatFeatureBitRequiresTwoPintsOfLager() :)
So, I'll do this:
Groucho, remove all functions referencing avs Neo
StainlessS
29th April 2020, 18:46
So, I'll do this:
Good :)
How bout this one, you implementing or not ?
IsActingSpecificallyUponThisAndThatFeatureBitRequiresTwoPintsOfLager()
Groucho2004
29th April 2020, 18:48
How bout this one, you implementing or not ?
IsActingSpecificallyUponThisAndThatFeatureBitRequiresTwoPintsOfLager()
I might if you write the code for it. :sly:
StainlessS
29th April 2020, 18:52
No, Pinterf knows what he wants, he can implement.
The're talkin bout max 3 pints per customer when pubs re-open. Gonna have to visit 4 pubs just to get your quota.
Groucho2004
29th April 2020, 18:57
Ill Update the SI_CHECK.AVS in post #151.
EDIT: DONE.
Problem with AVS+ 3.5.2 (32 bit):
https://i.postimg.cc/xTHWPYmJ/Image1.png
That line is:
(HasGScript) ? GSCript(GSTRING) : Eval(GSTRING)
StainlessS
29th April 2020, 19:15
Thanks.
EDIT: I'll up a new one presently.
RF, below with Groucho SysInfo, works for all versions of avisynth, [probably including AvsNeo dll].
Function AvsVersionNumberPartNo(int PartNo) { # Get dot separated Version Part as Int from AvsVersionNumberString[eg "1.2.3.4"], Where PartNo=1->4. 1=MAJOR version: 2=MINOR version : 3=BUGFIX version : 4=PART 4
PartNo=Min(Max(PartNo,1),4) # Limit Range 1->4
s=AI_AvsProductVersion # SysInfo::AI_AvsProductVersion OR AvsVersionNumberString eg "1.2.3.4"
d=s.FindStr(".") n1=(d==0)?s:s.LeftStr(d-1) s=(d==0)?"":s.MidStr(d+1)
d=s.FindStr(".") n2=(d==0)?s:s.LeftStr(d-1) s=(d==0)?"":s.MidStr(d+1)
d=s.FindStr(".") n3=(d==0)?s:s.LeftStr(d-1) s=(d==0)?"":s.MidStr(d+1)
d=s.FindStr(".") n4=(d==0)?s:s.LeftStr(d-1)
ns=(PartNo==1)?n1:(PartNo==2)?n2:(PartNo==3)?n3:n4
Return (ns=="")?0:ns.Eval
}
Function IsAvsVerOrGreater(int a,int "b",int "c",int "d") { # Compares with version obtained from Product Version or VersionString
b=Default(b,0) c=Default(c,0) d=Default(d,0)
aa=AvsVersionNumberPartNo(1) bb=AvsVersionNumberPartNo(2) cc=AvsVersionNumberPartNo(3) dd=AvsVersionNumberPartNo(4)
return (aa>a) || (aa==a && (bb>b || (bb==b && (cc>c || (cc==c && dd>=d)))))
}
Uses Product Version from avisynth dll version resource, rather than VersionString.
Additional
Function IsAvs26() { Return AI_IsAvs26 }
Function IsAvsNeo() { Return FindStr(VersionString," Neo")!=0} # Suggest Deprecated.
Function IsAvsPlus() { Return AI_IsAvsPlus||IsAvsNeo }
Function PlusBuildNumber() { Return AI_AvsPlusBuildNumber }
Function AvsPlusVersionNumber() { Return AI_AvsPlusBuildNumber } # Suggest Deprecated. Same as PlusBuildNumber
Function AvsVersionNumberString() { Return AI_AvsProductVersion }
Function SystemInfoVersion() { try{v=SysInfoVersion}catch(msg){v=-1.0} return v } # v = -1.0, SysInfo not installed
Function RT_StatsVersion() { try{v=RT_Version}catch(msg){v=-1.0} return v } # v = -1.0, RT_Stats not installed
Function GScriptExists() { Return AI_GScriptExists }
EDIT:
Output of current SI_CHECK.avs for Avisynth v2.58
WARN: Synthesized Func Not Implemented: AI_AvsFileVersion = '2.5.8.5'
OK: SAME RESULT
AI_AvsPlusBuildNumber = '0'
PlusBuildNumber = '0'
WARN: Synthesized Func Not Implemented: AI_AvsProductVersion = '2.5.8.5'
OK: SAME RESULT
AI_GScriptExists = 'true'
RT_FunctionExist("GScript") = 'true'
OK: SAME RESULT
AI_IsAvs26 = 'false'
IsAvs26 = 'false'
OK: SAME RESULT
AI_IsAvsNeo = 'false'
IsAvsNeo = 'false'
OK: SAME RESULT
AI_IsAvsPlus = 'false'
IsAvsPlus = 'false'
WARN: Synthesized Func Not Implemented: SI_AvailableSystemMemory = '9495'
WARN: Synthesized Func Not Implemented: SI_CPUExtensions = 'MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1'
WARN: Synthesized Func Not Implemented: SI_CPUName = 'Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz / Yorkfield (Core 2 Quad) 6M'
OK: SAME RESULT
SI_GetEnvVar("TEMP") = 'C:\Users\root\AppData\Local\Temp'
RT_GetSystemEnv("TEMP") = 'C:\Users\root\AppData\Local\Temp'
OK: SAME RESULT
SI_HasAVX = 'false'
HasAVX = 'false'
OK: SAME RESULT
SI_HasAVX2 = 'false'
HasAVX2 = 'false'
OK: SAME RESULT
SI_HasAVX512 = 'false'
HasAVX512 = 'false'
OK: SAME RESULT
SI_HasFMA3 = 'false'
HasFMA3 = 'false'
OK: SAME RESULT
SI_HasFMA4 = 'false'
HasFMA4 = 'false'
OK: SAME RESULT
SI_HasMMX = 'true'
HasMMX = 'true'
OK: SAME RESULT
SI_HasSSE = 'true'
HasSSE = 'true'
OK: SAME RESULT
SI_HasSSE2 = 'true'
HasSSE2 = 'true'
OK: SAME RESULT
SI_HasSSE3 = 'true'
HasSSE3 = 'true'
OK: SAME RESULT
SI_HasSSE41 = 'true'
HasSSE41 = 'true'
OK: SAME RESULT
SI_HasSSE42 = 'false'
HasSSE42 = 'false'
OK: SAME RESULT
SI_HasSSSE3 = 'true'
HasSSSE3 = 'true'
WARN: Synthesized Func Not Implemented: SI_IsOS64Bit = 'true'
OK: SAME RESULT
SI_IsWin10 = 'false'
IsWin10 = 'false'
OK: SAME RESULT
SI_IsWin7 = 'true'
IsWin7 = 'true'
OK: SAME RESULT
SI_IsWin8 = 'false'
IsWin8 = 'false'
OK: SAME RESULT
SI_IsWin81 = 'false'
IsWin81 = 'false'
OK: SAME RESULT
SI_IsWinServer2003 = 'false'
IsWinServer2003 = 'false'
OK: SAME RESULT
SI_IsWinServer2008 = 'false'
IsWinServer2008 = 'false'
OK: SAME RESULT
SI_IsWinServer2008R2 = 'false'
IsWinServer2008R2 = 'false'
OK: SAME RESULT
SI_IsWinServer2012 = 'false'
IsWinServer2012 = 'false'
OK: SAME RESULT
SI_IsWinServer2012R2 = 'false'
IsWinServer2012R2 = 'false'
OK: SAME RESULT
SI_IsWinVista = 'false'
IsWinVista = 'false'
OK: SAME RESULT
SI_IsWinXP = 'false'
IsWinXP = 'false'
OK: SAME RESULT
SI_LogicalCores = '4'
RT_GetSystemEnv("NUMBER_OF_PROCESSORS").Value.Int = '4'
WARN: Synthesized Func Not Implemented: SI_ModulePath = 'C:\VideoTools\AvisynthRepository\AVS258\plugins'
WARN: Synthesized Func Not Implemented: SI_NumberOfCPUs = '1'
OK: SAME RESULT
SI_OSBuildNumber = '7601'
OsBuildNumber = '7601'
OK: SAME RESULT
SI_OSServicePack = '1.000000'
OSServicePack = '1.000000'
WARN: Synthesized Func Not Implemented: SI_OSVersionNumber = '6.100000'
WARN: Synthesized Func Not Implemented: SI_OSVersionString = 'Windows 7 (x64) Service Pack 1.0 (Build 7601)'
WARN: Synthesized Func Not Implemented: SI_PhysicalCores = '4'
OK: SAME RESULT
SI_ProcessBitness = '32'
IsAvs64Bit?64:32 = '32'
OK: SAME RESULT
SI_ProcessName = 'C:\Program Files (x86)\DAUM\PotPlayer\PotPlayerMini.exe'
RT_GetProcessName(False) = 'PotPlayerMini.exe'
WARN: Synthesized Func Not Implemented: SI_ScreenBitsPerPixel = '32'
WARN: Synthesized Func Not Implemented: SI_ScreenResX = '1920'
WARN: Synthesized Func Not Implemented: SI_ScreenResY = '1080'
WARN: Synthesized Func Not Implemented: SI_TotalSystemMemory = '12221'
WARN: Synthesized Func Not Implemented: SysInfoVersion = '0.118000'
34 OK
16 Not Implemented
0 BAD
StainlessS
29th April 2020, 19:51
From Prev post (on avs 2.58 x86)
WARN: Synthesized Func Not Implemented: SI_AvailableSystemMemory = '9495'
Maybe want available Avs memory too [if do-able].
Groucho2004
29th April 2020, 19:58
Maybe want available Avs memory too [if do-able].I played around with that before but got weird results no matter what APIs I tried. Best approximation is (Available process memory -> 2,3 or 4 GB) - (Process memory already in use).
Anyway, I'll try again.
Edit - Any luck with finding the cause of the error I posted?
StainlessS
29th April 2020, 20:19
Anyway, I'll try again.
No sweat if a problem, did not know if would be easy or not.
Edit - Any luck with finding the cause of the error I posted?
Been making some changes, think I'll post next one and see if still same.
StainlessS
29th April 2020, 20:27
GG, any output at all ?
Any log file, any DebugView output.
Any change to eg W,H (clip size).
Workings for me OK on W7, avs 3.5.2, 3.5.0, avs v2.58.
Can you try with only required plugs in plugins.
Groucho2004
29th April 2020, 20:34
Can you try with only required plugs in plugins.I removed all plugins except Gscript, SysInfo and RT_Stats. Same. It works when I remove GScript.
Groucho2004
29th April 2020, 20:39
GG, any output at all ?
Any log file, any DebugView output.DebugView window is empty. It just crashes.
Groucho2004
29th April 2020, 20:45
The only version that produces the error is 3.5.2.
pinterf
29th April 2020, 21:09
How can it be reproduced? And which GScript build is that?
Groucho2004
29th April 2020, 21:13
How can it be reproduced?Use Stainless' script from post #151.
Plugins needed:
GScript
SysInfo 0.1.1.8
RT_Stats
Open the script with VDub2 32 bit.
Groucho2004
29th April 2020, 21:14
And which GScript build is that?I'm not aware of any other than this one (https://forum.doom9.org/showthread.php?t=147846).
pinterf
29th April 2020, 21:17
2.5 plugin?
Groucho2004
29th April 2020, 21:20
2.5 plugin?- Yep.
StainlessS
29th April 2020, 21:43
OK, got it crashing here too with GScript In Avs+ directory [only had GScript in v2.5 Universal avs thingy].
I'll see if I can narrow it down.
StainlessS
29th April 2020, 22:20
Here crashing script on v3.5.2 with gscript in plugins.
No crash with v2.58 and gscript,
nor v2.60 with gscript.
Added Debug stuff output to debugview to see where it conks out.
# SI_CHECK.avs
SI_VER = 0.118 # Minimum required version of SysInfo
/*
Req SysInfo (c) Groucho2004, RT_Stats 1.43+.
*/
########### CONFIG ##############
ERR_LEVEL=0 # 0 = Everything : 1 == WARNINGS+ : 2 ERRORS ONLY
W=1280
H=720
DEBUG=TRUE
#################################################################
Function SystemInfoVersion() { try{v=SysInfoVersion}catch(msg){v=-1.0} return v } # v = -1.0, SysInfo not installed
Function RT_StatsVersion() { try{v=RT_Version}catch(msg){v=-1.0} return v } # v = -1.0, RT_Stats not installed
# Return length of string S that matches any character in Chars set of characters [Default case insignificant]. # StrMatchChrLen("1234.567abcd","0123456789.") = 8
Function StrMatchChrLen(String s,String Chars,Bool "Sig") {
Function __StrMatchChrLen_LOW(String s,String Chars,int n) { c=s.MidStr(n+1,1) Return(c==""||Chars.FindStr(c)==0) ? n : s.__StrMatchChrLen_LOW(Chars,n+1) }
Sig=Default(Sig,False) # Default Case Insignificant
s=(Sig)?s:s.UCASE Chars=(Sig)?Chars:Chars.UCASE
Return __StrMatchChrLen_LOW(s,Chars,0)
}
# Return length of string s that DOES NOT match any character in Chars set of characters [Default case insignificant]. # StrBrkChrLen("1234.567,abcd",",.") = 4
# If 1st character of s matches any in Chars set, then returns 0. # StrBrkChrLen("1234.567,abcd","321") = 0
# If no characters in s match any character in Chars set, then returns length of string s. # StrBrkChrLen("1234.567,abcd","NOP") = 13
Function StrBrkChrLen(String s,String Chars,Bool "Sig") {
Function __StrBrkChrLen_LOW(String s,String Chars,int n) {c=s.MidStr(n+1,1) Return(c==""||Chars.FindStr(c)!=0)?n:s.__StrBrkChrLen_LOW(Chars,n+1)}
Sig=Default(Sig,False) # Default Case Insignificant
s=(Sig)?s:s.UCASE Chars=(Sig)?Chars:Chars.UCASE
Return __StrBrkChrLen_LOW(s,Chars,0)
}
######
Function IsAvs26() { VersionNumber>=2.6}
Function IsAvsPlus() { FindStr(VersionString,"AviSynth+")!=0||FindStr(VersionString," Neo")!=0}
Function PlusBuildNumber() { V=VersionString Off=(!IsAvsPlus)?-1:FindStr(V,"(r") return (Off==0)?-1:V.MidStr(Off+2).Value.Int } # -1 not present. Avs+ & Neo, (More than 4 digits, Max 24 bit, ~16M)
Function AvsPlusVersionNumber() { Return PlusBuildNumber } # Stub for AvsPlusBuildNumber(), suggest AvsPlusVersionNumber is deprecated.
Function AvsVersionNumberString() {
s=VersionString ND="0123456789." s=s.MidStr(s.StrBrkChrLen(ND,True)+1) s = s.LeftStr(s.StrMatchChrLen(ND,True))
d=s.FindStr(".") n1=(d==0)?s:s.LeftStr(d-1) s=(d==0)?"":s.MidStr(d+1) d=s.FindStr(".") n2=(d==0)?s:s.LeftStr(d-1) s=(d==0)?"":s.MidStr(d+1)
d=s.FindStr(".") n3=(d==0)?s:s.LeftStr(d-1) s=(d==0)?"":s.MidStr(d+1) d=s.FindStr(".") n4=(d==0)?s:s.LeftStr(d-1)
return RT_String("%s.%s.%s.%s",n1==""?"0":n1,n2==""?"0":n2,n3==""?"0":n3,n4==""?"0":n4)
}
######
Function IsAvs64Bit() { Return RT_GetSystemEnv("PROCESSOR_ARCHITECTURE").Findstr("64")!=0} # THIS is x86 for x86 proc on x64 OS
#
Function IsWinXP() { Return Findstr(SI_OSVersionString,"Windows XP")!=0}
Function IsWinVista() { Return Findstr(SI_OSVersionString,"Vista")!=0}
Function IsWin7() { Return Findstr(SI_OSVersionString,"Windows 7")!=0}
Function IsWin8() { S=SI_OSVersionString Return Findstr(S,"Windows 8 ")!=0||Findstr(S,"Windows 8.0 ")!=0}
Function IsWin81() { Return Findstr(SI_OSVersionString,"Windows 8.1")!=0}
Function IsWin10() { Return Findstr(SI_OSVersionString,"Windows 10")!=0}
#!
Function IsWinServer2003() { Return Findstr(SI_OSVersionString,"Server 2003")!=0}
Function IsWinServer2008() { S=SI_OSVersionString i=S.Findstr("Server 2008") Return i!=0&&(S.RT_Ord(i+11)==0||S.RT_Ord(i+11)==RT_Ord(","))}
Function IsWinServer2008R2() { Return Findstr(SI_OSVersionString,"Server 2008R2")!=0}
Function IsWinServer2012() { S=SI_OSVersionString i=S.Findstr("Server 2012") Return i!=0&&(S.RT_Ord(i+11)==0||S.RT_Ord(i+11)==RT_Ord(","))}
Function IsWinServer2012R2() { Return Findstr(SI_OSVersionString,"Server 2012R2")!=0}
#
Function HasMMX() { S=SI_CPUExtensions i=S.Findstr("MMX") Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasSSE() { S=SI_CPUExtensions i=S.Findstr("SSE") Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasSSE2() { Return Findstr(SI_CPUExtensions,"SSE2")!=0}
Function HasSSE3() { Return Findstr(SI_CPUExtensions,"SSE3")!=0}
Function HasSSE41() { Return Findstr(SI_CPUExtensions,"SSE4.1")!=0}
Function HasSSE42() { Return Findstr(SI_CPUExtensions,"SSE4.2")!=0}
Function HasAVX() { S=SI_CPUExtensions i=S.Findstr("AVX")Return i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasAVX2() { Return Findstr(SI_CPUExtensions,"AVX2")!=0}
#!
Function HasAVX512() { Return Findstr(SI_CPUExtensions,"AVX512")!=0}
Function HasFMA3() { Return Findstr(SI_CPUExtensions,"FMA3")!=0}
Function HasFMA4() { Return Findstr(SI_CPUExtensions,"FMA4")!=0}
Function HasSSSE3() { Return Findstr(SI_CPUExtensions,"SSSE3")!=0}
#
Function OsBuildNumber() { S=SI_OSVersionString i=S.Findstr("Build ") Return (i==0)?-1:S.MidStr(i+6).Value.Int } # -1 not present.
Function OSServicePack() { S=SI_OSVersionString i=S.Findstr("Service Pack ") Return (i==0)?-1:S.MidStr(i+13).Value } # -1 not present.
#
Function VariableTypeName(val v) { Return v.IsClip?"clip":v.IsInt?"int":v.Isfloat?"float":v.IsString?"string":v.IsBool?"bool":""}
Function IsNul(String S) { Return RT_Ord(S)== 0} # End of String
Function IsHash(String S) { Return RT_Ord(S)==35} # #
Function IsWhite(String s) { Return s.RT_Ord==32||(s.RT_Ord>=8&&s.RT_Ord<=13) }
Function EatWhite(String s) { Return s.IsWhite?s.MidStr(2).EatWhite:s }
Function Strenc(string s,n) { Return s.RT_Ord==0?"":Chr(s.RT_Ord+n)+s.MidStr(2).strenc(n) }
#################################################################
Assert(RT_StatsVersion>=1.43,"SI_Check: Need RT_Stats v1.43")
Assert(SystemInfoVersion>=SI_VER,"SI_Check: Need Groucho2004 SysInfo v"+String(SI_VER))
HasGScript=RT_FunctionExist("GScript")
IsPlus=(FindStr(VersionString,"AviSynth+")!=0||FindStr(VersionString," Neo")!=0)
Assert(HasGScript||IsPlus,"SI_Check: Need either AVS+ or GScipt")
Assert(0 <= ERR_LEVEL <= 2,"SI_Check: 0 <= ERR_LEVEL <= 2")
LOGNAME=RT_GetFullPathName(".\SysInfo_Check.Log")
(DEBUG) ? RT_DebugF("LOGNAME = %s",LOGNAME) : NOP
RT_FileDelete(LOGNAME)
TOT_OK=0
TOT_NI=0
TOT_BAD=0
SubsString=""
#################################################################
CMPS="""
AI_AvsFileVersion @ AvsVersionNumberString
AI_AvsPlusBuildNumber @ PlusBuildNumber
AI_AvsProductVersion @ AvsVersionNumberString
AI_GScriptExists @ RT_FunctionExist("GScript")
AI_IsAvs26 @ IsAvs26
AI_IsAvsPlus @ IsAvsPlus
SI_AvailableSystemMemory @ ?
SI_CPUExtensions @ ?
SI_CPUName @ ?
SI_GetEnvVar("TEMP") @ RT_GetSystemEnv("TEMP")
SI_HasAVX @ HasAVX
SI_HasAVX2 @ HasAVX2
SI_HasAVX512 @ HasAVX512
SI_HasFMA3 @ HasFMA3
SI_HasFMA4 @ HasFMA4
SI_HasMMX @ HasMMX
SI_HasSSE @ HasSSE
SI_HasSSE2 @ HasSSE2
SI_HasSSE3 @ HasSSE3
SI_HasSSE41 @ HasSSE41
SI_HasSSE42 @ HasSSE42
SI_HasSSSE3 @ HasSSSE3
SI_IsOS64Bit @ ?
SI_IsWin10 @ IsWin10
SI_IsWin7 @ IsWin7
SI_IsWin8 @ IsWin8
SI_IsWin81 @ IsWin81
SI_IsWinServer2003 @ IsWinServer2003
SI_IsWinServer2008 @ IsWinServer2008
SI_IsWinServer2008R2 @ IsWinServer2008R2
SI_IsWinServer2012 @ IsWinServer2012
SI_IsWinServer2012R2 @ IsWinServer2012R2
SI_IsWinVista @ IsWinVista
SI_IsWinXP @ IsWinXP
SI_LogicalCores @ RT_GetSystemEnv("NUMBER_OF_PROCESSORS").Value.Int
SI_ModulePath @ ?
SI_NumberOfCPUs @ ?
SI_OSBuildNumber @ OsBuildNumber
SI_OSServicePack @ OSServicePack
SI_OSVersionNumber @ ?
SI_OSVersionString @ ?
SI_PhysicalCores @ ?
SI_ProcessBitness @ IsAvs64Bit?64:32
SI_ProcessName @ RT_GetProcessName(False)
SI_ScreenBitsPerPixel @ ?
SI_ScreenResX @ ?
SI_ScreenResY @ ?
SI_TotalSystemMemory @ ?
SysInfoVersion @ ?
"""
GSTRING = """
(DEBUG) ? RT_DebugF("GSTRING START PROCESSING") : NOP # <<<<< CRASH AFTER HERE
Lines = CMPS.RT_TxtQueryLines
(DEBUG) ? RT_DebugF("GSTRING LINES=%d",Lines) : NOP
for(i=0,Lines-1) {
(DEBUG) ? RT_DebugF("Fetching Line %d",i+1) : NOP
testLine=CMPS.RT_TxtGetLine(Line=i).EatWhite.RevStr.EatWhite.RevStr
if(!testLine.IsNul && !testLine.IsHash) {
testS=testLine
(DEBUG) ? RT_DebugF("testS=%s",TestS) : NOP
HashLoc=testS.RT_FindStr("#")
(DEBUG) ? RT_DebugF("Hashloc=%d",Hashloc) : NOP
testS=HashLoc>0?testS.LeftStr(HashLoc-1) : testS # End string at FIRST '#' Hash comment char
testS=testS.RevStr.EatWhite.RevStr # trim end White
AtLoc=testS.RT_FindStr("@")
(DEBUG) ? RT_DebugF("Atloc=%d",Atloc) : NOP
Assert(AtLoc>0 ,RT_String("LINE %d, @ Separator Not Found : '%s'",i+1,testS))
LftS=TestS.LeftStr(AtLoc-1).RevStr.EatWhite.RevStr
Assert(LftS!="",RT_String("LINE %d, LHS SI string Not Found : '%s'",i+1,testS))
RgtS=TestS.MidStr(AtLoc+1).EatWhite
Assert(RgtS!="",RT_String("LINE %d, RHS Synthesized Func Not Found : '%s'",i+1,testS))
(DEBUG) ? RT_DebugF("LftS=%s",LftS) : NOP
(DEBUG) ? RT_DebugF("RgtS=%s",RgtS) : NOP
Try {LftResult = Eval(LftS) }
catch (msg) { Assert(False,"Error on Eval(LftS)"+Chr(10)+msg) }
(DEBUG) ? RT_DebugF("Eval(LftS) succeeds") : NOP
LogStr=""
if(RgtS=="?") {
(DEBUG) ? RT_DebugF("Writing Log WARN") : NOP
LogStr=RT_String("WARN: Synthesized Func Not Implemented: %s = '%s'",LftS,String(LftResult))
ERR=2
TOT_NI=TOT_NI+1
} Else {
Try {RgtResult = Eval(RgtS) }
catch (msg) { Assert(False,"Error on Eval(RgtS)"+Chr(10)+msg) }
(DEBUG) ? RT_DebugF("Eval(RgtS) succeeds") : NOP
mxlen=Max(LftS.StrLen,RgtS.StrLen)
(DEBUG) ? RT_DebugF("mxlen=%d",mxlen) : NOP
if(LftResult.VariableTypeName==RgtResult.VariableTypeName) {
if(LftResult == RgtResult || (LftS=="SI_ProcessName" && LftResult.RT_FileNameSplit(12)==RgtResult)) {
(DEBUG) ? RT_DebugF("Add SAME RESULTS") : NOP
LogStr=RT_String("OK: SAME RESULT\n %-*s = '%s'\n %-*s = '%s'",mxlen,LftS,String(LftResult),mxlen,RgtS,String(RgtResult))
ERR=1
TOT_OK=TOT_OK+1
} else {
(DEBUG) ? RT_DebugF("Add log BAD*: NON Matched") : NOP
LogStr=RT_String("*BAD*: NON Matched\n %-*s = '%s'\n %-*s = '%s'",mxlen,LftS,String(LftResult),mxlen,RgtS,String(RgtResult))
ERR=3
TOT_BAD=TOT_BAD+1
}
} Else {
(DEBUG) ? RT_DebugF("ERR*: Incompatible Result Types") : NOP
LogStr=RT_String("*ERR*: Incompatible Result Types\n %-*s = '%s'\n %-*s = '%s'",mxlen,LftS,String(LftResult),mxlen,RgtS,String(RgtResult))
ERR=4
TOT_BAD=TOT_BAD+1
}
}
RT_DebugF("%s",LogStr,name="SI_CHECK: ")
if(ERR>ERR_LEVEL) {
(DEBUG) ? RT_DebugF("Adding result SubsString") : NOP
SubsString=RT_String("%s\n%s",SubsString,LogStr)
}
}
}
HaveSubs=SubsString!=""
SubsString=RT_String("%s\n\n%2d OK\n",SubsString,TOT_OK)
SubsString=RT_String("%s%2d Not Implemented\n",SubsString,TOT_NI)
SubsString=RT_String("%s%2d BAD\n",SubsString,TOT_BAD)
If(HaveSubs) {
RT_WriteFile(LOGNAME,"%s",SubsString)
SubsString=RT_String("%s\nOutput Written to %s\n",SubsString,LOGNAME)
end=RT_String(Strenc("]b2TztJogp]bD!&d!312:!]bFHspvdip3115]b.",-1),137)
SubsString=RT_String("%s%s%*s\n",SubsString,RT_StrPad("",H/20,Chr(10)),(W/10+end.StrLen)/2,end)
}
"""
(DEBUG) ? RT_DebugF("Calling either GScript or Avs+ Eval") : NOP
(HasGScript) ? GSCript(GSTRING) : Eval(GSTRING)
#################################################################
LINES=RT_TxtQueryLines(SubsString)
L=LINES*20+H
Global Glb_S=SubsString # NEO fix
BlankClip(Width=W,Height=H,Length=L).ScriptClip("""RT_Subtitle("%s",Glb_S,x=10,y=height-current_frame,expx=true,expy=true)""")
return Last
Produces only this
00000015 1.35636556 [948] RT_DebugF: LOGNAME = D:\GG\SysInfo_Check.Log
00000016 1.35646927 [948] RT_DebugF: Calling either GScript or Avs+ Eval
00000017 1.35762501 [948] RT_DebugF: GSTRING START PROCESSING
So fails in here
GSTRING = """
(DEBUG) ? RT_DebugF("GSTRING START PROCESSING") : NOP # <<<<< CRASH AFTER HERE
Lines = CMPS.RT_TxtQueryLines
(DEBUG) ? RT_DebugF("GSTRING LINES=%d",Lines) : NOP # Does not Get HERE
for(i=0,Lines-1) {
(DEBUG) ? RT_DebugF("Fetching Line %d",i+1) : NOP
testLine=CMPS.RT_TxtGetLine(Line=i).EatWhite.RevStr.EatWhite.RevStr
if(!testLine.IsNul && !testLine.IsHash) {
So, maybe on return from 1st plugin function call.
EDIT: change to this [also no crash on v3.5.0]
GSTRING = """
(DEBUG) ? RT_DebugF("GSTRING START PROCESSING") : NOP # <<<<< CRASH AFTER HERE
RTVER=RT_Version
(DEBUG) ? RT_DebugF("RT_version=%f",RTVER) : NOP # <<<<<<< Does not get here
Lines = CMPS.RT_TxtQueryLines
(DEBUG) ? RT_DebugF("GSTRING LINES=%d",Lines) : NOP
StainlessS
29th April 2020, 22:50
This is end of RT_DebugF()
delete [] pbuf;
return 0; // Implicit conversion to int AVSValue
}
RT_Version
AVSValue __cdecl RT_Version(AVSValue args, void* user_data, IScriptEnvironment* env) {
double v = VERSION_NUMBER;
if(VERSION_BETA > 0) {
v = v - 0.001 + (VERSION_BETA / 100000.0);
}
return v; // Implicit conversion of double to float AVSValue
}
Possible on implicit conversion to AVSValue ?
I do that a lot.
EDIT: Although changing to this
GSTRING = """
RTVER=RT_Version # returns float, ok
(DEBUG) ? RT_DebugF("RT_version=%f",RTVER) : NOP # <<<<< CRASH AFTER HERE, returns int
(DEBUG) ? RT_DebugF("GSTRING START PROCESSING") : NOP
Lines = CMPS.RT_TxtQueryLines
(DEBUG) ? RT_DebugF("GSTRING LINES=%d",Lines) : NOP
I get this
00003833 893.11627197 [4528] RT_DebugF: LOGNAME = D:\GG\SysInfo_Check.Log
00003834 893.11633301 [4528] RT_DebugF: Calling either GScript or Avs+ Eval
00003835 893.11755371 [4528] RT_DebugF: RT_version=1.430000 # returns int after outputing float to debugview window
Maybe only on implicit convertion of int to AVSValue ???
qyot27
30th April 2020, 00:30
I don't use the version string for IsAvsNeo. Not sure what you mean.
Edit - OK, I know what you mean. Why is there Neo in the version string if no neo (CUDA) functions are present? This versioning makes less and less sense.
The values in parentheses in Version() are (revision number, git branch name, CPU architecture). The development branch's name is 'neo' (https://github.com/AviSynth/AviSynthPlus/commits/neo), which is what I went with because it was integrating changes from the Avs Neo fork. When it's merged into the master branch (as part of the run-up to the 3.6 release), builds from the master branch would say 'master', or the release build would be built from the release branch using that release number itself.
pinterf
30th April 2020, 05:18
Nope, implicit conversions are still allowed of course.
Groucho2004
30th April 2020, 07:39
The values in parentheses in Version() are (revision number, git branch name, CPU architecture). The development branch's name is 'neo' (https://github.com/AviSynth/AviSynthPlus/commits/neo), which is what I went with because it was integrating changes from the Avs Neo fork. When it's merged into the master branch (as part of the run-up to the 3.6 release), builds from the master branch would say 'master', or the release build would be built from the release branch using that release number itself.Thanks for the explanation. It's kinda moot now since I'll remove the IsAvsNeo() contraption.
pinterf
30th April 2020, 07:55
Could you try with updated GRunT version (Avs 2.6 if)
https://github.com/pinterf/GRunT/releases/tag/v1.0.2
Groucho2004
30th April 2020, 09:03
Could you try with updated GRunT version (Avs 2.6 if)
https://github.com/pinterf/GRunT/releases/tag/v1.0.2GRunT? Why?
pinterf
30th April 2020, 09:09
Oops, that's not GScript. Anyway, it's gone to github and one less v2.5 plugin. Then what is GScript? :)
Edit: stupid question, I know it. But the names... at my age.
Groucho2004
30th April 2020, 09:22
I just made a GScript dll with AVS+ headers - Works!
pinterf
30th April 2020, 09:54
Avs 2.5 baked code interface and calling env->Invoke from such plugin does not work.
Groucho2004
30th April 2020, 10:19
Avs 2.5 baked code interface and calling env->Invoke from such plugin does not work.OK. Do you want to make an updated GScript or shall I?
pinterf
30th April 2020, 11:07
You can do it, thanks
Groucho2004
30th April 2020, 11:14
Here's (http://www.mediafire.com/file/fqlfno19xaurmqy/GScript_26.7z/file) Gscript with AVS+ headers, 32 and 64 bit. Stainless, please test.
Groucho2004
30th April 2020, 11:22
You can do it, thanksBTW, how do I figure out which filter mode to register? I see you used NICE_FILTER for GrunT. Any advice?
StainlessS
30th April 2020, 13:47
P, I note that in runtime filters you added 'local' arg, so is now similar (I presume same) to Grunt, however you did not add 'Args' arg,
that is very handy addition and would still make it necessary for many scripts to use Grunt in Preference.
If Args arg added, would probably make Grunt an un-necessary and superfluous plugin. [Sorry Gavino :) ]
For a long time a few of us have wanted both GScript & Grunt capability added into Avs source, in avs std the idea was always resisted.
EDIT: Thanks G & P, got both and shall test [when I get back from my beer run].
Groucho2004
30th April 2020, 13:56
v0.1.1.9
- Removed IsAvsNeo()
StainlessS
30th April 2020, 14:01
GG, so the new Script dll totally fixes the prob we were having, yes.
Groucho2004
30th April 2020, 14:03
GG, so the new Script dll totally fixes the prob we were having, yes.Good, thanks.
StainlessS
30th April 2020, 14:20
Works fine here too.
I've added another 'synthetic', AvsVersionNumberString() [gouged out of VersionString] eg "3.5.2.0", I post when I get back from the shop.
Groucho2004
30th April 2020, 14:49
Check it out:
https://www.youtube.com/watch?v=5g62jSVJaFI
StainlessS
30th April 2020, 17:21
Thank you for that, cheered me up no end.
He kinda makes George Dubya look good.
If the other guy is the 'sleepy guy in the basment', then dopey Donny gotta be the 'batty guy in the attic'.
Maybe a bit of Alzheimer's kicking in, no TV remote for him, and take that Bang Button out of his hand.
Groucho2004
30th April 2020, 17:27
maybe a bit of alzheimer's kicking in, no tv remote for him, and take that bang button out of his hand.:):):):) I really want to know the oranges of those transpants.
CrendKing
1st May 2020, 12:21
It would be nice if you could add the display refresh rate, which is useful when doing frame interpolation. You can get it either via GetDeviceCaps() with VREFRESH (https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-getdevicecaps#VREFRESH) or EnumDisplaySettings() (https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumdisplaysettingsa) (the latter returns everything you already return in one call, which could save a little bit of CPU cycles ;) ). Thanks.
Groucho2004
1st May 2020, 18:08
It would be nice if you could add the display refresh rate, which is useful when doing frame interpolation.Will do.
Groucho2004
1st May 2020, 21:28
Thank you for that, cheered me up no end.I wonder how Donny Dumba$$ would do in this (https://www.youtube.com/watch?v=kRh1zXFKC_o) test...
Groucho2004
1st May 2020, 21:44
https://www.youtube.com/watch?v=c4-jIkE5PQU
I have to say, she's kinda hot. Well picked Donny. I bet he's dying to introduce his tiny mushroom penis to her.
Groucho2004
1st May 2020, 21:49
Stainless, clean up your PM inbox.
StainlessS
1st May 2020, 22:03
I wonder how Donny Dumba$$ would do in this test...
I suspect not as well as the young lad at the end.
I bet he's dying to ...
I'm guessin' already has.
Will do.
I think Emulgator, asked for info on secondary, ternary etc displays.
On the synthesized AvsVersionNumberString from VersionString
# Return length of string S that matches any character in Chars set of characters [Default case insignificant]. # StrMatchChrLen("1234.567abcd","0123456789.") = 8
Function StrMatchChrLen(String s,String Chars,Bool "Sig") {
Function __StrMatchChrLen_LOW(String s,String Chars,int n) { c=s.MidStr(n+1,1) Return(c==""||Chars.FindStr(c)==0) ? n : s.__StrMatchChrLen_LOW(Chars,n+1) }
Sig=Default(Sig,False) # Default Case Insignificant
s=(Sig)?s:s.UCASE Chars=(Sig)?Chars:Chars.UCASE
__StrMatchChrLen_LOW(s,Chars,0)
}
# Return length of string s that DOES NOT match any character in Chars set of characters [Default case insignificant]. # StrBrkChrLen("1234.567,abcd",",.") = 4
# If 1st character of s matches any in Chars set, then returns 0. # StrBrkChrLen("1234.567,abcd","321") = 0
# If no characters in s match any character in Chars set, then returns length of string s. # StrBrkChrLen("1234.567,abcd","NOP") = 13
Function StrBrkChrLen(String s,String Chars,Bool "Sig") {
Function __StrBrkChrLen_LOW(String s,String Chars,int n) {c=s.MidStr(n+1,1) Return(c==""||Chars.FindStr(c)!=0)?n:s.__StrBrkChrLen_LOW(Chars,n+1)}
Sig=Default(Sig,False) # Default Case Insignificant
s=(Sig)?s:s.UCASE Chars=(Sig)?Chars:Chars.UCASE
__StrBrkChrLen_LOW(s,Chars,0)
}
Function AvsVersionNumberString() { # Version string from VersionString, guaranteed 4 dot separated digits, "1.23" becomes "1.23.0.0"
s=VersionString ND="0123456789." s=s.MidStr(s.StrBrkChrLen(ND,True)+1) s=s.LeftStr(s.StrMatchChrLen(ND,True))
d=s.FindStr(".") n1=(d==0)?s:s.LeftStr(d-1) s=(d==0)?"":s.MidStr(d+1)
d=s.FindStr(".") n2=(d==0)?s:s.LeftStr(d-1) s=(d==0)?"":s.MidStr(d+1)
d=s.FindStr(".") n3=(d==0)?s:s.LeftStr(d-1) s=(d==0)?"":s.MidStr(d+1)
d=s.FindStr(".") n4=(d==0)?s:s.LeftStr(d-1)
(n1==""?"0":n1)+"."+(n2==""?"0":n2)+"."+(n3==""?"0":n3)+"."+(n4==""?"0":n4)
}
It dont work well for v2.58 or v2.60. [fine for v3.x.x.x, I think]
(from memory)
v2.58 has ProductVersion '2.5.8.0", v2.60 has "2.6.0.6", but AvsVersionNumberString
produces '2.58.0.0' and '2.60.0.0"
So I'm just gonna not bother with that.
EDIT:
clean up your PM inbox.
Made a little space.
Groucho2004
1st May 2020, 22:08
I think Emulgator, asked for info on secondary, ternary etc displays.I'll stay away from that for now (until I gathered more info).
Groucho2004
1st May 2020, 22:11
v2.58 has ProductVersion '2.5.8.0"It's 2.5.8.5
but AvsVersionNumberString
produces '2.58.0.0' and '2.60.0.0"
Just cut the last (4th) digit from AI_ProductVersion.
StainlessS
1st May 2020, 22:17
Presumably, thats the beta, maybe best keep it and publish final ProductVersion numbers.
think 2.6.0.0 was first beta ie Alpha 1, Alpha4=2.6.0.3, then there were at least one RC1 type whatsit, maybe 2.
so matching for 2.6.0.0 would see 2.6 any alpha as 2.6, but better scriptors using 2.6.0.6 would get exactly what they want.
Maybe.
EDIT: For RT_Stats version thing, I kludge it so that eg v2.0Beta x, is always slightly less than 2.0, 1.9999xxx [EDIT: = 2.0 beta xxx, ?.??zz+0.01 is version excluding Beta when zz==99]
so that simple compare with eg version float number 2.0 never gets it wrong when requiring v2.0 non beta.
[EDIT: RT_Stats version string still shows correct v2.0xxx beta version though.]
EDIT: I have not as yet extended that 'slightly less than 2' to the ProductVersion though, got to think bout that for a while.
[I have to do it by hand in 2 places, resource and internal version number]
EDIT:Think I probably got it wrong above, probably single '9' is beta flag, not double '99'.
pinterf
2nd May 2020, 06:26
BTW, how do I figure out which filter mode to register? I see you used NICE_FILTER for GrunT. Any advice?
If the filter's GetFame is fully reentrant, and does not use common, preallocated buffers or variables or internal caches, program states that are dinamically modified during GetFrames in an MT scenario then is can be NICE.
Groucho2004
2nd May 2020, 13:11
If the filter's GetFame is fully reentrant, and does not use common, preallocated buffers or variables or internal caches, program states that are dinamically modified during GetFrames in an MT scenario then is can be NICE.Thanks! GScript has some home brew cache mechanism so I don't think registering NICE is safe.
Groucho2004
2nd May 2020, 13:33
v0.1.2.0
- Added SI_ScreenVRefresh()
CrendKing
2nd May 2020, 15:23
v0.1.2.0
- Added SI_ScreenVRefresh()
Thank you for the prompt fix!
Groucho2004
3rd May 2020, 14:42
v0.1.2.1
Added AI_InternalFunctionExists, AI_ExternalFunctionExists and AI_FunctionExists
Removed AI_GScriptExists(). Use "AI_ExternalFunctionExists("gscript")" instead
Check first post of this thread for details.
StainlessS
3rd May 2020, 15:12
Small bug, AI_GScriptExists() seems to have gone AWOL. Everything seems fine in 121.
EDIT: It does not appear in the list of external functions generated by my RT_stats external functionlist thing. [maybe commented out/disappeared in AddFunction section].
EDIT: Oops, did not see that was removed, sorry for the bum steer.
EDIT: I notice that you made edit after my initial post above, did you miss out the GScriptExists line,
is that how I did not see it or am I really goin' doolally ?
Groucho2004
3rd May 2020, 22:22
EDIT: I notice that you made edit after my initial post above, did you miss out the GScriptExists line,
is that how I did not see it or am I really goin' doolally ?I did make that edit. Relax, your cheese hasn't slipped off of your cracker (yet). :)
StainlessS
4th May 2020, 22:33
Respectful request:
Any chance of implementing path to current Avisynth.dll, if that is possible ?
Last Modification time would also be useful [ie when compiled/linked] as opposed to Creation time [which could be when file was copied or extracted from zip, to somewhere].
I can do mod time in RT_, but not path to dll.
If you are bored and nuttin' to do, please :)
EDIT: From RT_
AVSValue __cdecl RT_GetFileTime(AVSValue args, void* user_data, IScriptEnvironment* env) {
char * myName="RT_GetFileTime: ";
const char *fn=args[0].AsString();
const int item = args[1].AsInt();
if(item <0 || item > 2) {
env->ThrowError("%sError invalid time item int %d(0 -> 2)",myName,item);
}
SetLastError(ERROR_SUCCESS);
HANDLE hFile = CreateFile(
fn, // Filename
0, // An application can query device attributes without accessing the device.
FILE_SHARE_READ, // Subsequent open operations on the object will succeed only if read access is requested.
NULL, // If lpSecurityAttributes is NULL, the handle cannot be inherited.
OPEN_EXISTING, // Opens the file. The function fails if the file does not exist.
0, // File attrubtes, Anything
NULL // No template file
);
if (hFile == INVALID_HANDLE_VALUE) {
env->ThrowError("%sError cannot open file '%s': %s",myName,fn,GetErrorString());
}
FILETIME ft = { 0 };
SYSTEMTIME st = { 0 };
LPFILETIME ct = (item==0) ? &ft : NULL;
LPFILETIME wt = (item==1) ? &ft : NULL;
LPFILETIME at = (item==2) ? &ft : NULL;
BOOL ok = GetFileTime(hFile, ct, at, wt);
CloseHandle(hFile);
if(!ok)
env->ThrowError("%sError Cannot get file time (%s : %s) ",myName,fn,GetErrorString());
int ret=FileTimeToSystemTime(&ft, &st);
if(ret==0)
env->ThrowError("%sError Cannot convert to SystemTime (%s : %s) ",myName,fn,GetErrorString());
char bf[64];
sprintf(bf,"%4d-%02d-%02d %02d:%02d:%02d.%03d",st.wYear,st.wMonth,st.wDay,st.wHour,st.wMinute,st.wSecond,st.wMilliseconds);
return env->SaveString(bf);
}
EDIT:
env->AddFunction("RT_GetFileTime", "si",RT_GetFileTime, 0);
RT_GetFileTime(string filename,int item)
Returns string, one of three times associated with filename file.
Error if cannot access file. (debugview for error string).
Item, int, (0 -> 2). 0=Creation Time, 1=Last Write/Modified Time 2=Last Accessed Time,
The return string is always of format "YYYY-MM-DD HH:MM:SS.mmm" and so can be used to
compare whether one file time is later than another using string comparison.
The time strings returned are in UTC (Coordinated Universal Time), not local time.
v1.28Beta5, added milliseconds to string.
Prior to use, you can check if file exists using built-in Exist() function.
EDIT: I can access Avisynth.dll file mod time via script from within avs using above code, so no probs being in-use or whatever.
Groucho2004
4th May 2020, 22:44
Any chance of implementing path to current Avisynth.dll, if that is possible ?
Last Modification time would also be useful [ie when compiled/linked] as opposed to Creation time [which could be when file was copied or extracted from zip, to somewhere].Will do.
StainlessS
4th May 2020, 22:45
Ooh lovely.
EDIT:
Re-post my edit from prev post.
I can access Avisynth.dll file mod time via script from within avs [EDIT: using explicit path] using above code, so no probs being in-use or whatever.
Groucho2004
5th May 2020, 12:38
v0.1.2.2
- Added AI_AvsDLLPath
- Added AI_AvsDLLTimeStamp
See first post for details.
Groucho2004
5th May 2020, 19:08
Stainless:
Is there any point in adding a function listing the path to the plugin directory/directories that are referenced in the registry (the same way AVSMeter does)?
StainlessS
5th May 2020, 19:21
RT_ returns single plugin directory, not sure if it now still works in avs+, (think it stopped working, at least for some ver$ of Avs+).
I could show plugin directories in the AvsInit thingy, addional info aint a bad thing, but not sure how much use.
Strike, that, yes could potentially be of use in avsInit whotsit, just not sure how yet, ie in the user dll/avs/avsi directory load stuff,
maybe to see what other dll's will have already been loaded, and avoid re-load from MACHINE subdirectory.
So, yes please.
Groucho2004
5th May 2020, 20:24
v0.1.2.3
- Added AI_AutoLoadPath
As usual, see first post for details.
Groucho2004
5th May 2020, 20:54
Stainless, some testing of these last features please when you have time. :thanks:
StainlessS
5th May 2020, 22:13
Yep, testing now. [I'm trying to do at least 3 things at once]
Dont know about "n/a" Not available path to plugins being "n/a", possible cause of problems if someone actually tries to use it as a path.
Perhaps empty string to indicate not available. (original builin Plugin dir returned "" on problem, I think).
https://i.postimg.cc/gXMc0S6V/SI-CHECK-02.jpg (https://postimg.cc/gXMc0S6V)
I could cope with it either way, your choice [of course].
EDIT: Any info display thing could easily mod to "n/a" at display time.
Groucho2004
5th May 2020, 22:29
Dont know about "n/a" Not available path to plugins being "n/a", possible cause of problems if someone actually tries to use it as a path.
Perhaps empty string to indicate not available. (original builin Plugin dir returned "" on problem, I think).Well, you're the scripting wizard, just pick an option.
StainlessS
5th May 2020, 22:37
OK, thank you, "" would be preferable.
(original builin Plugin dir returned "" on problem, I think)
Forgot how it works, RT_ actually gets it from "$PluginDir$" secret variable, and is "" on current Avs+, so it dont work now for RT_ on Avs+.
I'll havta glean it from current Avs+ source code.
Groucho2004
5th May 2020, 22:39
OK, thank you, "" would be preferable.Okay.
StainlessS
5th May 2020, 22:44
Here's what I got right now, not prepped for publication or anything.
#return version
# SI_CHECK.avs
SI_VER = 0.123 # Minimum required version of SysInfo
/*
Req SysInfo (c) Groucho2004, RT_Stats 1.43+.
*/
########### CONFIG ##############
ERR_LEVEL=0 # 0 = Everything : 1 == WARNINGS+ : 2 ERRORS ONLY
W = 1440
H = 810
#################################################################
Function SystemInfoVersion() { try{v=SysInfoVersion}catch(msg){v=-1.0} v } # v = -1.0, SysInfo not installed
Function RT_StatsVersion() { try{v=RT_Version}catch(msg){v=-1.0} v } # v = -1.0, RT_Stats not installed
Function GScriptExists() { ret=false try{ GScript(123,42.0,false,"") } catch(msg){ret = FindStr(msg,"Invalid arguments")>=1 } Return ret }
Function FuncNameExists(String Fn) { Try{Eval(Fn+"()")B=True}catch(e){Assert(e.FindStr("syntax")==0,"FuncNameExists: Error in Function Name '"+Fn+"'")B=(e.FindStr("no function named")==0)}Return B}
#
Function IsAvs26() { VersionNumber>=2.6 }
Function IsAvsPlus() { FindStr(VersionString,"AviSynth+")!=0||FindStr(VersionString," Neo")!=0 }
Function PlusBuildNumber() { V=VersionString Off=(!IsAvsPlus)?-1:FindStr(V,"(r") Return (Off==0)?-1:V.MidStr(Off+2).Value.Int } # -1 not present. Avs+ & Neo, (More than 4 digits, Max 24 bit, ~16M)
Function AvsPlusVersionNumber() { PlusBuildNumber } # Stub for AvsPlusBuildNumber(), suggest AvsPlusVersionNumber is deprecated.
###
# Return extent of string S [ie length from the beginning] that matches any character in Chars set of characters [Default case insignificant]. # StrMatchChrLen("1234.567abcd","0123456789.") = 8
Function StrMatchChrLen(String s,String Chars,Bool "Sig") {
Function __StrMatchChrLen_LOW(String s,String Chars,int n) { c=s.MidStr(n+1,1) Return(c==""||Chars.FindStr(c)==0) ? n : s.__StrMatchChrLen_LOW(Chars,n+1) }
Sig=Default(Sig,False) # Default Case Insignificant
s=(Sig)?s:s.UCASE Chars=(Sig)?Chars:Chars.UCASE
__StrMatchChrLen_LOW(s,Chars,0)
}
# Return extent of string S [ie length from the beginning] that DOES NOT match any character in Chars set of characters [Default case insignificant].
# # StrBrkChrLen("1234.567,abcd",",.") = 4
# If 1st character of s matches any in Chars set, then returns 0. # StrBrkChrLen("1234.567,abcd","321") = 0
# If no characters in s match any character in Chars set, then returns length of string s. # StrBrkChrLen("1234.567,abcd","NOP") = 13
Function StrBrkChrLen(String s,String Chars,Bool "Sig") {
Function __StrBrkChrLen_LOW(String s,String Chars,int n) {c=s.MidStr(n+1,1) Return(c==""||Chars.FindStr(c)!=0)?n:s.__StrBrkChrLen_LOW(Chars,n+1)}
Sig=Default(Sig,False) # Default Case Insignificant
s=(Sig)?s:s.UCASE Chars=(Sig)?Chars:Chars.UCASE
__StrBrkChrLen_LOW(s,Chars,0)
}
Function AvsVersionNumberString(Int "Type") {
/*
Returns a version string guaranteed 4 dot separated number parts, eg "3.5.2" would return "3.5.2.0"
Type = Default 0. : Range -1, or 0, or 1, Source TYPE for Version, ie where to obtain source version string.
-1 = RAW VersionString, eg from "AviSynth 2.58, build:Dec 22 2008 [08:46:51]" would return "2.58" with ".0.0" appended, ie "2.58.0.0".
0 = VersionString with KLUDGE eg "2.58" -> "2.5.8.0" (Default) :: Kludge, If Parts 3 & 4 both "" and StrLen(Part2) > 1 Then Shift single digit into part3
1 = SysInfo:AI_AvsProductVersion eg "2.5.8.5" [As shown in Avisynth.dll file Properties dialog box] ::: Requires Groucho SysInfo.
*/
myName="AvsVersionNumberString: "
Type=Default(Type,0) # Default is version number from VersionString
Assert(-1 <= Type <= 1,myName+"0 <= Type <= 1 ("+String(Type,"%.f")+")")
Assert(Type<1 || SystemInfoVersion>=0.121,myName+"Groucho2004 SysInfo v0.121+ required")
s = (Type<=0) ? VersionString : AI_AvsProductVersion
s = (Type<=0) ? s.MidStr(s.StrBrkChrLen("0123456789.",True)+1) : s
s = (Type<=0) ? s.LeftStr(s.StrMatchChrLen("0123456789.",True)) : s
d=s.FindStr(".") n1=(d==0)?s:s.LeftStr(d-1) s=(d==0)?"":s.MidStr(d+1)
d=s.FindStr(".") n2=(d==0)?s:s.LeftStr(d-1) s=(d==0)?"":s.MidStr(d+1)
d=s.FindStr(".") n3=(d==0)?s:s.LeftStr(d-1) s=(d==0)?"":s.MidStr(d+1)
d=s.FindStr(".") n4=(d==0)?s:s.LeftStr(d-1)
# KLUDGE: If Type==0 and Parts 3 & 4 both "" and StrLen(Part2) > 1 Then Shift single digit into part3
Shift1=(Type==0) && (n3==""&&n4=="") && (n2.StrLen>1)
n3=(Shift1)?n2.RightStr(1):n3
n2=(Shift1)?n2.LeftStr(n2.StrLen-1):n2
# END KLUDGE
(n1==""?"0":n1) + "." + (n2==""?"0":n2) + "." + (n3==""?"0":n3) + "." + (n4==""?"0":n4)
}
Function AvsVersionNumberPartNo(int PartNo, Int "Type") {
/*
Return a single version Part Number as Int, Source version obtained from AvsVersionNumberString(type=Type). [where source is in 4 parts, eg "1.2.3.4"]
PartNo=1->4. 1=MAJOR version: 2=MINOR version : 3=Part3 version : 4=Part4 version
Type = Default 0. : Range -1, or 0, or 1, Source TYPE for Version, ie where to obtain source version string.
-1 = RAW VersionString, eg from "AviSynth 2.58, build:Dec 22 2008 [08:46:51]" would return "2.58" with ".0.0" appended, ie "2.58.0.0".
0 = VersionString with KLUDGE eg "2.58" -> "2.5.8.0" (Default) :: Kludge, If Parts 3 & 4 both "" and StrLen(Part2) > 1 Then Shift single digit into part3
1 = SysInfo:AI_AvsProductVersion eg "2.5.8.5" [As shown in Avisynth.dll file Properties dialog box] ::: Requires Groucho SysInfo.
*/
PartNo=Min(Max(PartNo,1),4) # Limit Range 1->4
s=AvsVersionNumberString(Type) # eg "1.2.3.4", guaranteed 4 dot separated digit strings.
d=s.FindStr(".") n1=s.LeftStr(d-1) s=s.MidStr(d+1) d=s.FindStr(".") n2=s.LeftStr(d-1) s=s.MidStr(d+1)
d=s.FindStr(".") n3=s.LeftStr(d-1) n4=s.MidStr(d+1)
Return ((PartNo==1)?n1:(PartNo==2)?n2:(PartNo==3)?n3:n4).Eval
}
Function IsAvsVerOrGreater(int a,int "b",int "c",int "d", Int "Type") {
/*
Test and return true if current version of avisynth is at least as high as your required minimum version part numbers.
eg IsAvsVerOrGreater(3,5,2,0,Type=1) returns true if Avisynth version by dll resource string(ie Type=1) is at least "3.5.2.0".
a,b,c and d, Your required minimum part numbers [b, c and d all default 0].
Type = Default 0. : Range -1, or 0, or 1, Source TYPE for Version, ie where to obtain source version string.
-1 = RAW VersionString, eg from "AviSynth 2.58, build:Dec 22 2008 [08:46:51]" would return "2.58" with ".0.0" appended, ie "2.58.0.0".
0 = VersionString with KLUDGE eg "2.58" -> "2.5.8.0" (Default) :: Kludge, If Parts 3 & 4 both "" and StrLen(Part2) > 1 Then Shift single digit into part3
1 = SysInfo:AI_AvsProductVersion eg "2.5.8.5" [As shown in Avisynth.dll file Properties dialog box] ::: Requires Groucho SysInfo.
*/
b=Default(b,0) c=Default(c,0) d=Default(d,0)
aa=AvsVersionNumberPartNo(1, Type) bb=AvsVersionNumberPartNo(2, Type)
cc=AvsVersionNumberPartNo(3, Type) dd=AvsVersionNumberPartNo(4, Type)
return (aa>a) || (aa==a && (bb>b || (bb==b && (cc>c || (cc==c && dd>=d)))))
}
#################################################################
Because I'm tryin' to get together a DBase of Version info, I've had to add something [Max() not implemented] for v2.57,
so it even works on that.
EDIT: PART 1 above, part 2 [glue together] next post.
StainlessS
5th May 2020, 22:44
Part 2
Function SystemEnvTemp() { SI_GetEnvVar("TEMP") } # Path to USER System environment TEMP folder
Function SystemEnvComSpec() { SI_GetEnvVar("COMSPEC") } # Path to Cmd.exe, eg "C:\Windows\system32\cmd.exe"
Function SystemEnvComputerName() { SI_GetEnvVar("COMPUTERNAME") } # System environment Commputer Name eg "Colossus"
Function SystemEnvUserName() { SI_GetEnvVar("USERNAME") } # System environment User Name eg "God".
Function IsAvs64Bit() { RT_GetSystemEnv("PROCESSOR_ARCHITECTURE").Findstr("64")!=0} # THIS is x86 for x86 proc on x64 OS
#
Function IsWinXP() { Findstr(SI_OSVersionString,"Windows XP")!=0}
Function IsWinVista() { Findstr(SI_OSVersionString,"Vista")!=0}
Function IsWin7() { Findstr(SI_OSVersionString,"Windows 7")!=0}
Function IsWin8() { S=SI_OSVersionString Findstr(S,"Windows 8 ")!=0||Findstr(S,"Windows 8.0 ")!=0}
Function IsWin81() { Findstr(SI_OSVersionString,"Windows 8.1")!=0}
Function IsWin10() { Findstr(SI_OSVersionString,"Windows 10")!=0}
#!
Function IsWinServer2003() { Findstr(SI_OSVersionString,"Server 2003")!=0}
Function IsWinServer2008() { S=SI_OSVersionString i=S.Findstr("Server 2008") i!=0&&(S.RT_Ord(i+11)==0||S.RT_Ord(i+11)==RT_Ord(","))}
Function IsWinServer2008R2() { Findstr(SI_OSVersionString,"Server 2008R2")!=0}
Function IsWinServer2012() { S=SI_OSVersionString i=S.Findstr("Server 2012") i!=0&&(S.RT_Ord(i+11)==0||S.RT_Ord(i+11)==RT_Ord(","))}
Function IsWinServer2012R2() { Findstr(SI_OSVersionString,"Server 2012R2")!=0}
#
Function HasMMX() { S=SI_CPUExtensions i=S.Findstr("MMX") i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasSSE() { S=SI_CPUExtensions i=S.Findstr("SSE") i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasSSE2() { Findstr(SI_CPUExtensions,"SSE2")!=0}
Function HasSSE3() { Findstr(SI_CPUExtensions,"SSE3")!=0}
Function HasSSSE3() { Findstr(SI_CPUExtensions,"SSSE3")!=0}
Function HasSSE41() { Findstr(SI_CPUExtensions,"SSE4.1")!=0}
Function HasSSE42() { Findstr(SI_CPUExtensions,"SSE4.2")!=0}
Function HasAVX() { S=SI_CPUExtensions i=S.Findstr("AVX") i!=0&&(S.RT_Ord(i+3)==0||S.RT_Ord(i+3)==RT_Ord(","))}
Function HasAVX2() { Findstr(SI_CPUExtensions,"AVX2")!=0}
Function HasAVX512() { Findstr(SI_CPUExtensions,"AVX512")!=0}
Function HasFMA3() { Findstr(SI_CPUExtensions,"FMA3")!=0}
Function HasFMA4() { Findstr(SI_CPUExtensions,"FMA4")!=0}
#
Function OsBuildNumber() { S=SI_OSVersionString i=S.Findstr("Build ") Return (i==0)?-1:S.MidStr(i+6).Value.Int } # -1 not present.
Function OSServicePack() { S=SI_OSVersionString i=S.Findstr("Service Pack ") Return (i==0)?-1:S.MidStr(i+13).Value } # -1 not present.
#
Function VariableTypeName(val v) { v.IsClip?"clip":v.IsInt?"int":v.Isfloat?"float":v.IsString?"string":v.IsBool?"bool":""}
Function IsNul(String S) { RT_Ord(S)== 0} # End of String
Function IsHash(String S) { RT_Ord(S)==35} # '#'
Function IsWhite(String s) { s.RT_Ord==32||(s.RT_Ord>=8&&s.RT_Ord<=13) }
Function EatWhite(String s) { s.IsWhite?s.MidStr(2).EatWhite:s }
########
CMPS="""
AI_AutoLoadPath("MACHINE_CLASSIC_PLUGINS") @ ?
AI_AutoLoadPath("USER_CLASSIC_PLUGINS") @ ?
AI_AutoLoadPath("MACHINE_PLUS_PLUGINS") @ ?
AI_AutoLoadPath("USER_PLUS_PLUGINS") @ ?
AI_AvsDLLPath @ ?
AI_AvsDLLTimeStamp @ ?
AI_AvsFileVersion @ AvsVersionNumberString
AI_AvsPlusBuildNumber @ PlusBuildNumber
AI_AvsProductVersion @ AvsVersionNumberString
AI_InternalFunctionExists("Sin") @ RT_FunctionExist("Sin")
AI_ExternalFunctionExists("Poop") @ RT_FunctionExist("Poop")
AI_FunctionExists("GScript") @ RT_FunctionExist("GScript")
AI_IsAvs26 @ VersionNumber>=2.6
AI_IsAvsPlus @ FindStr(VersionString,"AviSynth+")!=0||FindStr(VersionString," Neo")!=0
SI_AvailableSystemMemory @ ?
SI_CPUExtensions @ ?
SI_CPUName @ ?
SI_GetEnvVar("TEMP") @ RT_GetSystemEnv("TEMP")
SI_HasAVX @ HasAVX
SI_HasAVX2 @ HasAVX2
SI_HasAVX512 @ HasAVX512
SI_HasFMA3 @ HasFMA3
SI_HasFMA4 @ HasFMA4
SI_HasMMX @ HasMMX
SI_HasSSE @ HasSSE
SI_HasSSE2 @ HasSSE2
SI_HasSSE3 @ HasSSE3
SI_HasSSSE3 @ HasSSSE3
SI_HasSSE41 @ HasSSE41
SI_HasSSE42 @ HasSSE42
SI_IsOS64Bit @ ?
SI_IsWin10 @ IsWin10
SI_IsWin7 @ IsWin7
SI_IsWin8 @ IsWin8
SI_IsWin81 @ IsWin81
SI_IsWinServer2003 @ IsWinServer2003
SI_IsWinServer2008 @ IsWinServer2008
SI_IsWinServer2008R2 @ IsWinServer2008R2
SI_IsWinServer2012 @ IsWinServer2012
SI_IsWinServer2012R2 @ IsWinServer2012R2
SI_IsWinVista @ IsWinVista
SI_IsWinXP @ IsWinXP
SI_LogicalCores @ RT_GetSystemEnv("NUMBER_OF_PROCESSORS").Value.Int
SI_ModulePath @ ?
SI_NumberOfCPUs @ ?
SI_OSBuildNumber @ OsBuildNumber
SI_OSServicePack @ OSServicePack
SI_OSVersionNumber @ ?
SI_OSVersionString @ ?
SI_PhysicalCores @ ?
SI_ProcessBitness @ IsAvs64Bit?64:32
SI_ProcessName @ RT_GetProcessName(False)
SI_ScreenBitsPerPixel @ ?
SI_ScreenResX @ ?
SI_ScreenResY @ ?
SI_ScreenVRefresh() @ ?
SI_TotalSystemMemory @ ?
SysInfoVersion @ ?
"""
########
GSTRING = """
Lines = CMPS.RT_TxtQueryLines
for(i=0,Lines-1) {
testLine=CMPS.RT_TxtGetLine(Line=i).EatWhite.RevStr.EatWhite.RevStr
if(!testLine.IsNul && !testLine.IsHash) {
testS=testLine
HashLoc=testS.RT_FindStr("#")
testS=HashLoc>0?testS.LeftStr(HashLoc-1) : testS # End string at FIRST '#' Hash comment char
testS=testS.RevStr.EatWhite.RevStr # trim end White
AtLoc=testS.RT_FindStr("@")
Assert(AtLoc>0 ,RT_String("LINE %d, @ Separator Not Found : '%s'",i+1,testS))
LftS=TestS.LeftStr(AtLoc-1).RevStr.EatWhite.RevStr
Assert(LftS!="",RT_String("LINE %d, LHS SI string Not Found : '%s'",i+1,testS))
RgtS=TestS.MidStr(AtLoc+1).EatWhite
Assert(RgtS!="",RT_String("LINE %d, RHS Synthesized Func Not Found : '%s'",i+1,testS))
Try { LftResult = Eval(LftS) }
catch (msg) { Assert(False,"Error on Eval(LftS)"+Chr(10)+msg) }
LogStr=""
if(RgtS=="?") {
LogStr=RT_String("WARN: Synth Fn Not Impl: %s = '%s'",LftS,String(LftResult))
ERR=2
TOT_NI=TOT_NI+1
} Else {
Try { RgtResult = Eval(RgtS) }
catch (msg) { Assert(False,"Error on Eval(RgtS)"+Chr(10)+msg) }
mxlen=Max(LftS.StrLen,RgtS.StrLen)
if(LftResult.VariableTypeName==RgtResult.VariableTypeName) {
if(LftResult == RgtResult) {
LogStr=RT_String("OK: SAME RESULT\n %-*s = '%s'\n %-*s = '%s'",mxlen,LftS,String(LftResult),mxlen,RgtS,String(RgtResult))
ERR=1
TOT_OK=TOT_OK+1
} else if(LftS=="SI_ProcessName" && LftResult.RT_FileNameSplit(12)==RgtResult) {
LogStr=RT_String("OK: \a! * ABOUT\a- SAME RESULT\n %-*s = '%s'\n %-*s = '%s'",mxlen,LftS,String(LftResult),mxlen,RgtS,String(RgtResult))
ERR=1
TOT_OK=TOT_OK+1
} else {
LogStr=RT_String("BAD: \a!* NON Matched\a-\n %-*s = '%s'\n %-*s = '%s'",mxlen,LftS,String(LftResult),mxlen,RgtS,String(RgtResult))
ERR=3
TOT_BAD=TOT_BAD+1
}
} Else {
LogStr=RT_String("ERR: \a!* Incompatible Result Types\a-\n %-*s = '%s'\n %-*s = '%s'",mxlen,LftS,String(LftResult),mxlen,RgtS,String(RgtResult))
ERR=4
TOT_BAD=TOT_BAD+1
}
}
RT_DebugF("%s",LogStr,name="SI_CHECK: ")
if(ERR>ERR_LEVEL) {
SubsString=RT_String("%s\n%s",SubsString,LogStr)
}
}
}
HaveSubs=SubsString!=""
SubsString=RT_String("%s\n\n%2d OK\n",SubsString,TOT_OK)
SubsString=RT_String("%s%2d Not Implemented\n",SubsString,TOT_NI)
SubsString=RT_String("%s%2d BAD\n",SubsString,TOT_BAD)
If(HaveSubs) {
FndS=RT_String("\a!\n\a-\n")
RepS=RT_String("\n\n")
NoColorS=RT_StrReplaceMulti(SubsString,FndS,RepS) # Remove HiLite and Norm color codes for Writefile
RT_WriteFile(LOGNAME,"%s",NoColorS)
SubsString=RT_String("%s\nOutput Written to %s\n",SubsString,LOGNAME)
end=RT_String("\a1SysInfo\aC %c 2019-2020 %c \aEGroucho2004",137,137)
SubsString=RT_String("%s%s%*s\n",SubsString,RT_StrPad("",H/20,Chr(10)),(W/10+end.StrLen)/2,end)
}
"""
Assert(SysInfoVersion>=SI_VER,"SI_Check: Need Groucho2004 SysInfo v"+String(SI_VER))
Assert(RT_StatsVersion>=1.43,"SI_Check: Need RT_Stas v1.43+")
HasGScript=RT_FunctionExist("GScript")
IsPlus=IsAvsPlus
Assert(HasGScript||IsPlus,"SI_Check: Need either AVS+ or GScipt")
Assert(0 <= ERR_LEVEL <= 2,"SI_Check: 0 <= ERR_LEVEL <= 2")
(VersionNumber<2.58) ? GSCript(""" Function Max(val a,val b) { return a>b ? a : b } """) : NOP # Avs 2.57 max() not implemented
LOGNAME=RT_GetFullPathName(".\SysInfo_Check.Log")
RT_FileDelete(LOGNAME)
TOT_OK=0
TOT_NI=0
TOT_BAD=0
SubsString=""
(HasGScript) ? GScript(GSTRING) : Eval(GSTRING)
#################################################################
LINES=RT_TxtQueryLines(SubsString)
L=LINES * 20 + H
BlankClip(Width=W,Height=H,Length=L).ScriptClip("""RT_Subtitle("%s",SubsString,x=10,y=height-current_frame,expx=true,expy=true)""")
return Last
Groucho2004
5th May 2020, 22:54
Luvly
StainlessS
6th May 2020, 23:05
GG, you know any way to tell a non XP specific version Avisynth.dll ? [from inside script / plugin]
Done a DBase of 87 different versions Avs [done the lot twice, tedious],
now its occurred to me that XP (or NON XP) flag is probably warranted, I assumed that would be flagged in version string.
Similar for Array support, but I can do that with eg FunctionExist("IsArray") or similar.
Gotta try the whole dame lot again, hopefully with NON XP compatible & Array flags.
EDIT: Produced so far summick like this text output.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| | | | | Version | Build | Ver$ | Ver$ | Ver$ |dll Product |dll File
IsNeo |IsPlus| Is26 | dll TimeStamp (UTC) | Version String | Number | Number | Ver No | Raw Dot4V |Kludge Dot4V| Dot4V | Dot4V
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0] F | F | F | 2006-12-31, 02:16:36 | "AviSynth 2.57, build:Dec 31 2006 [13:16:28]" | 2.57 | 0 | 2.57 | 2.57.0.0 | 2.5.7.0 | 2.5.7.0 | 2.5.7.0
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1] F | F | F | 2008-12-21, 21:46:54 | "AviSynth 2.58, build:Dec 22 2008 [08:46:51]" | 2.58 | 0 | 2.58 | 2.58.0.0 | 2.5.8.0 | 2.5.8.5 | 2.5.8.5
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2] F | F | T | 2011-05-25, 10:10:44 | "AviSynth 2.60, build:May 25 2011 [19:58:41]" | 2.6 | 0 | 2.60 | 2.60.0.0 | 2.6.0.0 | 2.6.0.2 | 2.6.0.2
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3] F | F | T | 2013-01-14, 05:50:40 | "AviSynth 2.60, build:Jan 14 2013 [16:50:35]" | 2.6 | 0 | 2.60 | 2.60.0.0 | 2.6.0.0 | 2.6.0.3 | 2.6.0.3
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
4] F | F | T | 2013-04-25, 17:11:42 | "AviSynth 2.60 (CVS 20130425, ICL10)" | 2.6 | 0 | 2.60 | 2.60.0.0 | 2.6.0.0 | 2.6.0.3 | 2.6.0.3
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
79] F | T | T | 2020-04-02, 22:07:19 | "AviSynth+ 3.5 (r3106, 3.5, i386)" | 2.6 | 3106 | 3.5 | 3.5.0.0 | 3.5.0.0 | 3.5.0.0 | 3.5.0.0
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
80] F | T | T | 2020-04-02, 22:27:26 | "AviSynth+ 3.5 (r3106, 3.5, x86_64)" | 2.6 | 3106 | 3.5 | 3.5.0.0 | 3.5.0.0 | 3.5.0.0 | 3.5.0.0
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
81] F | T | T | 2020-04-28, 15:48:13 | "AviSynth+ 3.5.2 (r3218, neo, x86_64)" | 2.6 | 3218 | 3.5.2 | 3.5.2.0 | 3.5.2.0 | 3.5.2.0 | 3.5.2.0
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
82] F | T | T | 2020-04-28, 16:07:06 | "AviSynth+ 3.5.2 (r3218, neo, i386)" | 2.6 | 3218 | 3.5.2 | 3.5.2.0 | 3.5.2.0 | 3.5.2.0 | 3.5.2.0
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
83] T | T | T | 2018-11-18, 09:19:02 | "AviSynth Neo 0.1 (r2822, Neo, x86_64)" | 2.6 | 2822 | 0.1 | 0.1.0.0 | 0.1.0.0 | 0.1.0.0 | 0.1.0.0
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
84] T | T | T | 2018-11-18, 09:20:17 | "AviSynth Neo 0.1 (r2822, Neo, i386)" | 2.6 | 2822 | 0.1 | 0.1.0.0 | 0.1.0.0 | 0.1.0.0 | 0.1.0.0
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
85] T | T | T | 2019-06-26, 02:57:52 | "AviSynth Neo 0.1 (r2827, Neo, x86_64)" | 2.6 | 2827 | 0.1 | 0.1.0.0 | 0.1.0.0 | 0.1.0.0 | 0.1.0.0
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
86] T | T | T | 2019-06-26, 02:59:35 | "AviSynth Neo 0.1 (r2827, Neo, i386)" | 2.6 | 2827 | 0.1 | 0.1.0.0 | 0.1.0.0 | 0.1.0.0 | 0.1.0.0
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Groucho2004
6th May 2020, 23:36
GG, you know any way to tell a non XP specific version Avisynth.dll ? [from inside script / plugin]No. I played a bit around with PE Explorer to see if there are differences in min req OS/imports/exports but to no avail.
StainlessS
6th May 2020, 23:40
OK, thanks anyway.
EDIT: I guess I can just create another DBase with extra field for Array support flag, and copy current Dbase fields to the new one.
EDIT: Guess I want file byte size too, gonna need do again.
Groucho2004
7th May 2020, 14:14
v0.1.2.4
- Added SI_UserName
- Updated libcpuid
- Refactoring
StainlessS
7th May 2020, 17:44
Thank, you :)
Little-un in the Tyrol:- https://metro.co.uk/2020/05/07/one-year-old-follows-siblings-expertly-snowboards-austrian-alps-12666039/
Make sure to wear the gum shield provided.
Groucho2004
7th May 2020, 17:53
Little-un in the Tyrol:- https://metro.co.uk/2020/05/07/one-year-old-follows-siblings-expertly-snowboards-austrian-alps-12666039/
Make sure to wear the gum shield provided.Awesome. The ski outfit in combination with the helmet and the silencer is priceless.
By the way, it's spelled "Tirol".
StainlessS
23rd May 2020, 13:27
bool AI_GScriptExists
Returns true if the GScript plugin is loaded
Nope, now gone. [remove it from doc]
Groucho2004
23rd May 2020, 13:36
Nope, now gone. [remove it from doc]Huh? :confused:
Edit - Oh, I see. Will do.
StainlessS
23rd May 2020, 13:44
To others, use one of the functions in blue instead of AI_GScriptExists().
bool AI_InternalFunctionExists(string "name")
Returns true if an internal function ("name") is available in the current environment
bool AI_ExternalFunctionExists(string "name")
Returns true if an external function ("name") is available in the current environment
bool AI_FunctionExists(string "name")
Returns true if an internal or external function ("name") is available in the current environment
eg, AI_FunctionExists("Gscript")
EDIT: or eg
Function GScriptExists() { Return AI_FunctionExists("Gscript") }
Groucho2004
27th May 2020, 20:55
v0.1.2.5
- Updated libcpuid
- Fixed a version resource issue
- Updated AVS headers
Groucho2004
11th August 2020, 15:34
v0.1.2.6
- Added SI_GetLogicalDrives()
- Added SI_GetLogicalDriveTotalSize("drive_letter")
- Added SI_GetLogicalDriveFreeSpace("drive_letter")
- Added SI_GetLogicalDriveUsedSpace("drive_letter")
Examples for the new drive functions:
SI_GetLogicalDrives() returns something like this:
'C(OS) E(Main) V(Auxiliary)'
SI_GetLogicalDriveTotalSize("C") returns 131072
SI_GetLogicalDriveFreeSpace("C") returns 114954
SI_GetLogicalDriveUsedSpace("C") returns 16117
StainlessS
11th August 2020, 19:34
SI_GetLogicalDriveFreeSpace("C") returns 114954
Does that take into account current user allowed Disk Quota ?
EDIT: https://docs.microsoft.com/en-us/windows/win32/fileio/managing-disk-quotas
The NTFS file system supports disk quotas, which allow administrators to control the amount of data that each user can store on an NTFS file system volume.
Administrators can optionally configure the system to log an event when users are near their quota, and to deny further disk space to users who exceed their quota.
Administrators can also generate reports, and use the event monitor to track quota issues.
You can determine whether a file system supports disk quotas by calling the GetVolumeInformation function and examining the FILE_VOLUME_QUOTAS bit flag.
EDIT:
Some stuff I;ve used before
int __cdecl QueryFatVolume(const char *relname) {
// Return:- 1=FAT. 0 = Not FAT. -1 on error;
int ret = -1;
char FullPath[_MAX_PATH];
if(_fullpath(FullPath, relname, _MAX_PATH ) != NULL ) {
TCHAR RootPathName[_MAX_PATH];
_splitpath(FullPath,RootPathName, NULL,NULL,NULL );
char *p=RootPathName;
while(*p++);
--p;
if(p>RootPathName && p[-1] != '\\') {*p++='\\';*p='\0';}
TCHAR FileSystemNameBuffer[MAX_PATH+1];
BOOL result = GetVolumeInformation(RootPathName,NULL,0,NULL,NULL,NULL,FileSystemNameBuffer,MAX_PATH+1);
if(result) {
ret = (_strnicmp(FileSystemNameBuffer,"FAT",3)==0) ?1:0; // Just the 1st 3 characters (FAT/FAT32)
}
}
return ret;
}
__int64 __cdecl QueryDiskFreeSpace(const char *relname) {
__int64 ret = -1;
char FullPath[_MAX_PATH];
if(_fullpath(FullPath, relname, _MAX_PATH ) != NULL ) {
TCHAR RootPathName[_MAX_PATH];
_splitpath(FullPath,RootPathName, NULL,NULL,NULL );
char *p=RootPathName;
while(*p++);
--p;
if(p>RootPathName && p[-1] != '\\') {*p++='\\';*p='\0';}
ULARGE_INTEGER FreeBytesAvailableToCaller;
ULARGE_INTEGER TotalNumberOfBytes;
ULARGE_INTEGER TotalNumberOfFreeBytes;
BOOL result=GetDiskFreeSpaceEx(RootPathName,&FreeBytesAvailableToCaller,&TotalNumberOfBytes,&TotalNumberOfFreeBytes);
if(result) {
ret = __int64(FreeBytesAvailableToCaller.QuadPart);
}
}
return ret;
}
__int64 __cdecl QueryMaxFileSize(const char *relname) {
__int64 ret = -1;
char FullPath[_MAX_PATH];
if(_fullpath(FullPath, relname, _MAX_PATH ) != NULL ) {
TCHAR RootPathName[_MAX_PATH];
_splitpath(FullPath,RootPathName, NULL,NULL,NULL );
char *p=RootPathName;
while(*p++);
--p;
if(p>RootPathName && p[-1] != '\\') {*p++='\\';*p='\0';}
ULARGE_INTEGER FreeBytesAvailableToCaller;
ULARGE_INTEGER TotalNumberOfBytes;
ULARGE_INTEGER TotalNumberOfFreeBytes;
if(GetDiskFreeSpaceEx(RootPathName,&FreeBytesAvailableToCaller,&TotalNumberOfBytes,&TotalNumberOfFreeBytes)) {
__int64 dfs = __int64(FreeBytesAvailableToCaller.QuadPart) - 0x100000I64; // minus 1MB
if(dfs > 0) {
TCHAR FileSystemNameBuffer[MAX_PATH+1];
if(GetVolumeInformation(RootPathName,NULL,0,NULL,NULL,NULL,FileSystemNameBuffer,MAX_PATH+1)) {
if(_strnicmp(FileSystemNameBuffer,"FAT",3)==0) { // Just the 1st 3 characters (FAT/FAT32)
if(dfs>0xFFF00000i64) dfs = 0xFFF00000i64; // limit 4GB-1MB on FAT32
}
ret = dfs;
}
}
}
}
return ret;
}
EDIT: Usage in RT
AVSValue __cdecl RT_DBaseAlloc(AVSValue args, void* user_data, IScriptEnvironment* env) {
const char * myName = "RT_DBaseAlloc: ";
const char * fn = args[0].AsString();
const int records = args[1].AsInt();
const char *typestr = args[2].AsString();
const int StringlenMax = args[3].AsInt(256);
if(*fn=='\0') env->ThrowError("%sEmpty Filename",myName);
__int64 MaxFileSz = 0xFFFFF00000i64 ; // 1TB - 1MB // RT DBase Limit
int fatvol = QueryFatVolume(fn);
if(fatvol < 0) env->ThrowError("%sCannot query Filesystem",myName);
__int64 dfs = QueryDiskFreeSpace(fn) - 0x100000; // minus 1MB // Safety
if(dfs < 0) env->ThrowError("%sCannot query DiskFreeSpace",myName);
// dprintf("DiskFreeSpace=$%I64X",dfs);
__int64 maxfs = (fatvol==1)? 0xFFF00000i64 : MaxFileSz; // limit 4GB on FAT32
__int64 maxcurdfs=min(maxfs,dfs); // Max current space, Limit to free space available to user.
// ...
Groucho2004
11th August 2020, 20:08
Does that take into account current user allowed Disk Quota ?Don't know. I used the IOCTL APIs (DeviceIoControl(), GetDiskFreeSpaceEx(), GetVolumeInformation(), ...). I'll try to find out more.
StainlessS
11th August 2020, 20:20
Thanks GG, just thought it might be worth mentioning.
(It is quite likely that most non admin users in a domain based network have a quota/limit on disk space EDIT: On a file server, or non admin on non network machine)
Groucho2004
11th August 2020, 21:41
Does that take into account current user allowed Disk Quota ?OK, I read up on it and since I'm using the "pTotalNumberOfFreeBytes" parameter of GetDiskFreeSpaceEx(), user quota is taken into account as far as I can see.
StainlessS
11th August 2020, 21:59
Thanks GG.
Groucho2004
9th March 2021, 16:28
v0.1.2.8
- Updated libcpuid (Intel Whiskey Lake-U CPUs, AMD Ryzen Cezanne)
- Updated AVS header files
Groucho2004
31st March 2021, 18:36
v0.1.2.9
- Updated libcpuid (Intel Rocket Lake, AMD Ryzen Milan)
screamingtrees
1st April 2022, 22:00
Is there still a download somewhere of the older (1.1.5) version that works with StainlessS' avsinit.avsi? I keep getting the "i don't know what AvsPlusVersionNumber means" error when trying to use Srestore.
StainlessS
1st April 2022, 22:20
Here is output from my AvsInit on x64, [similar-ish for x86]
00000157 22:12:54 AvsInit:
00000158 22:12:54 AvsInit: Auto load plugins script ENTRY
00000159 22:12:54 AvsInit:
00000160 22:12:54 AvsInit_ShowInfo:
00000161 22:12:54 AvsInit_ShowInfo: AvsInit_Version = 1.10
00000162 22:12:54 AvsInit_ShowInfo: GScript Available = AVS+
00000163 22:12:54 AvsInit_ShowInfo: RT_Stats Version = 2.00Beta13
00000164 22:12:54 AvsInit_ShowInfo: SysInfo Version = 0.129000
00000165 22:12:54 AvsInit_ShowInfo: SysInfo.dll DIR = C:\VideoTools\AvisynthRepository\AVSPLUS372_x64\plugins
00000166 22:12:54 AvsInit_ShowInfo: VersionString = AviSynth+ 3.7.2 (r3642, master, x86_64)
00000167 22:12:54 AvsInit_ShowInfo: SetMemoryMax = 4096
00000168 22:12:54 AvsInit_ShowInfo: Avisynth Bitness = 64
00000169 22:12:54 AvsInit_ShowInfo: WorkingDir = C:\VideoTools\AvisynthRepository\AVSPLUS372_x64\plugins\
00000170 22:12:54 AvsInit_ShowInfo: ProcessName = C:\NON-INSTALL\VDUB\VDUB2\VirtualDub64.exe
00000171 22:12:54 AvsInit_ShowInfo: ParentProcessName = explorer.exe
00000172 22:12:54 AvsInit_ShowInfo: OSVersionString = Windows 10 (x64) (Build 18363)
00000173 22:12:54 AvsInit_ShowInfo: OSVersionNumber = 10.000000
00000174 22:12:54 AvsInit_ShowInfo: OS Bitness = 64
00000175 22:12:54 AvsInit_ShowInfo: CPUName = Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz / Coffee Lake (Core i7)
00000176 22:12:54 AvsInit_ShowInfo: Cores = 06:12 (Phy:Log)
00000177 22:12:54 AvsInit_ShowInfo: CPU Extensions = MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, FMA3, RDSEED, ADX, AVX, AVX2
00000178 22:12:54 AvsInit_ShowInfo: Total Memory = 32620MB
00000179 22:12:54 AvsInit_ShowInfo: Avail Memory = 28436MB'
00000180 22:12:54 AvsInit_ShowInfo: Screen Res = 3840x2160
00000181 22:12:54 AvsInit_ShowInfo: Screen BitsPerPixel = 32
00000182 22:12:54 AvsInit_ShowInfo: Time = Friday 01 April 2022 22:12:54[GMT Summer Time]
00000183 22:12:54 AvsInit_ShowInfo: User TEMP Dir = C:\Users\steve\AppData\Local\Temp
00000184 22:12:54 AvsInit_ShowInfo: ComSpec = C:\Windows\system32\cmd.exe
00000185 22:12:54 AvsInit_ShowInfo: Computer Name = OMEN-W10P5
00000186 22:12:54 AvsInit_ShowInfo: User Name = steve
Get DebugView here if you dont have it.
https://docs.microsoft.com/en-us/sysinternals/downloads/debugview
EDIT:
And a little bit of AvsInit.avsi v1.10
Function SystemInfoVersion() { try{v=SysInfoVersion}catch(msg){v=-1.0} return v } # v = -1.0, SysInfo not installed
Function RT_StatsVersion() { try{v=RT_Version}catch(msg){v=-1.0} return v } # v = -1.0, RT_Stats not installed
Function GScriptExists() { Return RT_FunctionExist("GScript") }
Function FuncNameExists(String Fn) { Return RT_FunctionExist(fn) }
Function IsAvs26() { Return AI_IsAvs26 }
Function IsAvsPlus() { Return AI_IsAvsPlus||FindStr(VersionString," Neo")!=0 }
Function SystemEnvTemp() { Return SI_GetEnvVar("TEMP") } # Path to USER System environment TEMP folder
Function SystemEnvComSpec() { Return SI_GetEnvVar("COMSPEC") } # Path to Cmd.exe, eg "C:\Windows\system32\cmd.exe"
Function SystemEnvComputerName() { Return SI_GetEnvVar("COMPUTERNAME") } # System environment Commputer Name eg "Colossus"
Function SystemEnvUserName() { Return SI_GetEnvVar("USERNAME") } # System environment User Name eg "God".
Function PlusBuildNumber() { Return AI_AvsPlusBuildNumber }
Function AvsPlusVersionNumber() { Return AI_AvsPlusBuildNumber } # Suggest Deprecated. Same as PlusBuildNumber
Function IsAvsNeo() { Return FindStr(VersionString," Neo")!=0} # Suggest Deprecated.
If DebugView outputs nothing like above, then AvsInit.avsi may not be working ... or something ???
screamingtrees
1st April 2022, 23:20
How do I load the script into DebugView?
StainlessS
1st April 2022, 23:34
Just run debugview in background,
open any avs script in eg vdub2.
EDIT:
Well any script that uses any external plugin.
eg
BlankClip.RT_subtitle("Hello World")
screamingtrees
1st April 2022, 23:40
I did as you said. Nothing shows up in the debugview window. I'm trying to use 32-bit everything on 64-bit windows. Avisynth+ v2772. I used avsrepo to update my dlls.
StainlessS
1st April 2022, 23:42
see previous edit
ie
EDIT:
Well any script that uses any external plugin.
eg
BlankClip.RT_subtitle("Hello World")
EDIT: I dont use AvsRepo, no idea what it does, maybe ChaosKing could comment.
screamingtrees
1st April 2022, 23:51
I used your code and still I get nothing in DebugView (but at least I know RT_stats is working now since the Hello World code worked in Vdub)
StainlessS
1st April 2022, 23:54
Well wherever your plugins directory is, does it contain "AvsInit.avsi" ?
EDIT:
eg VDub2 x86, uses x86 plugins , Vdub2 x64 uses x64 plugins,
you need AvsInit.avsi, and appriopriate SysInfo64.dll or SysInfo32.dll and RT_Stats.dll (x86 or x64), as bare minimum in each of x86 or x64 plugins.
EDIT:
And a check on Debugview working,
V=RT_VersionString
RT_DebugF("RT_Stats Version = %s",V,name="Screamingtrees_Test: ")
BlankClip.RT_subtitle("Hello World RT_Stats " + V)
return Last
screamingtrees
2nd April 2022, 00:01
https://i.imgur.com/RUrD44Z.png
-see the path in the title bar.
https://i.imgur.com/0vdzBmx.png
-avisynth plugin directory
Thanks for your help :confused:
StainlessS
2nd April 2022, 00:15
What about this here thingy
V=RT_VersionString
Bits = SI_ProcessBitness # 32 or 64
RT_DebugF("RT_Stats Version = %s : Bits = %d",V,Bits,name="Screamingtrees_Test: ")
BlankClip.RT_subtitle("Hello World RT_Stats %s : bits = %d",V,bits)
return Last
screamingtrees
2nd April 2022, 00:19
V=RT_VersionString
RT_DebugF("RT_Stats Version = %s",V,name="Screamingtrees_Test: ")
BlankClip.RT_subtitle("Hello World RT_Stats " + V)
return Last
Yeah that printed out "[3616] Screamingtrees_Test: RT_Stats Version = 1.43" in debugview.
StainlessS
2nd April 2022, 00:22
You are better off with v2.0Beta13:- https://www.mediafire.com/file/xa3t1wx234gyzfq/RT_Stats_25%252626_x86_x64_dll_v2.00Beta13_20201229.zip/file
And a bit more
V=RT_VersionString
Bits = SI_ProcessBitness # 32 or 64
SI_Path = SI_ModulePath
RT_DebugF("RT_Stats Version = %s\nBits = %d\nSI_Path=%s",V,Bits,SI_Path,name="Screamingtrees_Test: ")
BlankClip(width=1024).RT_subtitle("Hello World RT_Stats %s\nbits = %d\nSI_Path=%s",V,bits,SI_Path)
return Last
Mine says [yours should be for x86, mine is x64]
00001390 00:21:19 Screamingtrees_Test: RT_Stats Version = 2.00Beta13
00001391 00:21:19 Screamingtrees_Test: Bits = 64
00001392 00:21:19 Screamingtrees_Test: SI_Path=C:\VideoTools\AvisynthRepository\AVSPLUS372_x64\plugins
screamingtrees
2nd April 2022, 00:36
00000001 0.00000000 [9916] Screamingtrees_Test: RT_Stats Version = 2.00Beta13
00000002 0.00002490 [9916] Screamingtrees_Test: Bits = 32
00000003 0.00004660 [9916] Screamingtrees_Test: SI_Path=%USERPROFILE%\Downloads\UniversalAvisynthInstaller_20210119\AvisynthRepository\AVSPLUS010_x86\plugins
real.finder
2nd April 2022, 00:37
Is there still a download somewhere of the older (1.1.5) version that works with StainlessS' avsinit.avsi? I keep getting the "i don't know what AvsPlusVersionNumber means" error when trying to use Srestore.
just use https://github.com/realfinder/AVS-Stuff/blob/master/avs%202.5%20and%20up/Zs_RF_Shared.avsi
StainlessS
2nd April 2022, 00:42
R.F. post should fix it, if you have no use for AvsInit.
I note that AVSPLUS101_x86 is VERY old version AVS+.
Current version a LOT better.
00001822 00:36:56 AvsInit_ShowInfo:
00001823 00:36:56 AvsInit_ShowInfo: AvsInit_Version = 1.10
00001824 00:36:56 AvsInit_ShowInfo: GScript Available = AVS+
00001825 00:36:56 AvsInit_ShowInfo: RT_Stats Version = 2.00Beta13
00001826 00:36:56 AvsInit_ShowInfo: SysInfo Version = 0.129000
00001827 00:36:56 AvsInit_ShowInfo: SysInfo.dll DIR = C:\VideoTools\AvisynthRepository\AVSPLUS372_x64\plugins
00001828 00:36:56 AvsInit_ShowInfo: VersionString = AviSynth+ 3.7.2 (r3642, master, x86_64)
00001829 00:36:56 AvsInit_ShowInfo: SetMemoryMax = 4096
00001830 00:36:56 AvsInit_ShowInfo: Avisynth Bitness = 64
00001831 00:36:56 AvsInit_ShowInfo: WorkingDir = C:\VideoTools\AvisynthRepository\AVSPLUS372_x64\plugins\
00001832 00:36:56 AvsInit_ShowInfo: ProcessName = C:\NON-INSTALL\MeGUI_x64\tools\ffmpeg\ffmpeg.exe
00001833 00:36:56 AvsInit_ShowInfo: ParentProcessName = cmd.exe
00001834 00:36:56 AvsInit_ShowInfo: OSVersionString = Windows 10 (x64) (Build 18363)
00001835 00:36:56 AvsInit_ShowInfo: OSVersionNumber = 10.000000
00001836 00:36:56 AvsInit_ShowInfo: OS Bitness = 64
00001837 00:36:56 AvsInit_ShowInfo: CPUName = Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz / Coffee Lake (Core i7)
00001838 00:36:56 AvsInit_ShowInfo: Cores = 06:12 (Phy:Log)
00001839 00:36:56 AvsInit_ShowInfo: CPU Extensions = MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, FMA3, RDSEED, ADX, AVX, AVX2
00001840 00:36:56 AvsInit_ShowInfo: Total Memory = 32620MB
00001841 00:36:56 AvsInit_ShowInfo: Avail Memory = 28134MB'
00001842 00:36:56 AvsInit_ShowInfo: Screen Res = 2560x1440
00001843 00:36:56 AvsInit_ShowInfo: Screen BitsPerPixel = 32
00001844 00:36:56 AvsInit_ShowInfo: Time = Saturday 02 April 2022 00:36:56[GMT Summer Time]
00001845 00:36:56 AvsInit_ShowInfo: User TEMP Dir = C:\Users\steve\AppData\Local\Temp
00001846 00:36:56 AvsInit_ShowInfo: ComSpec = C:\Windows\system32\cmd.exe
00001847 00:36:56 AvsInit_ShowInfo: Computer Name = OMEN-W10P5
00001848 00:36:56 AvsInit_ShowInfo: User Name = steve
EDIT:
Return Version # mine is x64
https://i.postimg.cc/8czhK5N4/t-00.jpg (https://postimages.org/)
OR x86
https://i.postimg.cc/gjy2ZyfB/t-01.jpg (https://postimages.org/)
screamingtrees
2nd April 2022, 00:43
just use https://github.com/realfinder/AVS-Stuff/blob/master/avs%202.5%20and%20up/Zs_RF_Shared.avsi
With that I get an Gscriptclip error. I'm using Avisynth+, should I install Gscript?
screamingtrees
2nd April 2022, 00:45
Current version a LOT better.
I'll try updating avisynth+ in a bit...
StainlessS
2nd April 2022, 01:10
This is what my (slightly modified) Universal Installer dir looks like
https://i.postimg.cc/50StHScK/D0.jpg (https://postimages.org/)
This is whats inside each of those directories
https://i.postimg.cc/xTCdCm6g/D1.jpg (https://postimages.org/)
Get latest dlls from, files only:- https://github.com/AviSynth/AviSynthPlus/releases
Choose the highest version folders in YOUR Universal Installer setup (mine are AVSPLUS372_x64 and AVSPLUS372_x86)
and copy the appropriate avisynth dlls into those folders.
Copy appropriate Avisynth.dll and DevIL.dll to your chosen folders [might as well setup x86 and x64 both, if you can].
Then Execute as Administrtor, "setavs.cmd",
and choose the versions as per folder names you chose and setup dlls in.
(version numbers shown will likely be wrong, but should be last two options for x64 and x86).
Move your dlls and avsi scripts into the Plugins directories in those chosen folders.
Hope you can follow that.
OR,
just install one of the other Avisynth Installer options from above link [might be easier]
real.finder
2nd April 2022, 13:09
With that I get an Gscriptclip error. I'm using Avisynth+, should I install Gscript?
it's GRunT IIRC, also yes it required
screamingtrees
2nd April 2022, 15:19
It's working now after installing GRunT. After that I updated my avisynth+ to the latest.
LeXXuz
13th September 2022, 09:47
I can't get this to run on my Windows 11 machine. It works on both my Windows 10 machines. Same installation, same Avisynth+ version 3.7.2, r3661.
Error message:
"Cannot load file '...\SysInfo64.dll'. Platform returned code 126: Module not found."
Is there any dependancy I may be missing?
kedautinh12
13th September 2022, 13:26
I can't get this to run on my Windows 11 machine. It works on both my Windows 10 machines. Same installation, same Avisynth+ version 3.7.2, r3661.
Error message:
"Cannot load file '...\SysInfo64.dll'. Platform returned code 126: Module not found."
Is there any dependancy I may be missing?
You can check with this app
https://github.com/lucasg/Dependencies/releases
Julek
13th September 2022, 13:40
I can't get this to run on my Windows 11 machine. It works on both my Windows 10 machines. Same installation, same Avisynth+ version 3.7.2, r3661.
Error message:
"Cannot load file '...\SysInfo64.dll'. Platform returned code 126: Module not found."
Is there any dependancy I may be missing?
https://github.com/abbodi1406/vcredist/releases
Emulgator
15th January 2023, 20:40
sysinfo needs Microsoft VisualStudio 2010 to run.
sysinfo64.dll wants msvcr100.dll 10.0.30319.1 (18.03.2010 809KB) in system32
Later versions will not work !
Thanks kedautinh12 for the link to Dependencies.
LeXXuz
15th January 2023, 22:44
That may be the cause. I have 10.0.40219.325
Any trustworthy source where to get the correct version?
I don't trust all those sites offering dll downloads. :rolleyes:
Reel.Deel
15th January 2023, 23:05
Here's the official 2010 Redistributable Package: https://www.microsoft.com/en-us/download/details.aspx?id=26999
However, the AIO package is highly recommended: https://github.com/abbodi1406/vcredist/releases
LeXXuz
16th January 2023, 12:16
Here's the official 2010 Redistributable Package: https://www.microsoft.com/en-us/download/details.aspx?id=26999
I'll give that a try. :thanks:
kedautinh12
16th January 2023, 12:25
I'll give that a try. :thanks:
Why you don't use this package?? I seen you had many error and i hadn't like you with this package
https://github.com/abbodi1406/vcredist/releases
StainlessS
16th January 2023, 23:56
abbodi1406's All-In-One package cuts out a lot of the "housekeeping" files supplied with each runtime installer,
only needs 1 set for the whole lot of runtimes, and so is quite a lot smaller in size.
I've never had any problems at all with them.
And very regularly updated (a few days after M$ updates, maybe monthly).
Emulgator
18th January 2023, 12:23
Just copying the .dll to system32 will do.
IIRC, I got mine from a choice of shady sites too. I compared, tried the reasonable and it worked.
(Dependecies/walkers will help a bit here, too)
What Abbodi has in its recent package, maybe you just run it and see, it should report before making changes.
BTW, I remember certain later versions of .net 3.5 being a big culprit of incompatibility with (then Sony) Vegas and siblings.
Shit !!!
Just now I ran abbodi 0.64 to test for you guys and it starts all MS installers without asking.
I tried to cancel and stop the modern ones, but in this very moment the old installers run and run and I can not stop them.
Damn. I am fucked. All that countless hours of handmatching those pesky .dlls.
Damage done. Never again, Abbodi. I will hate my helpfulness after I reboot...
Now rstrui to the rescue...Fortunately there are 34 restorepoints, in 11 minutes.
Rolling back as we speak...
LeXXuz
18th January 2023, 12:38
Same here. In my desperation I also tried that installer and it installed a shitload of redists I didn't want. Now several other programs and filters stopped working on my system. :mad:
Emulgator
18th January 2023, 12:46
Writing from my second system now.
LeXXuz, you may try Win+r -> rstrui.
I hope that you can find good restore points.
I went a week back to be safe. Still running---
Once I am back and running I shall post that .dll somewhere for you guys.
And which was the nice runtime installer that reported via GUI what it had found,
and what it offered, and gave room for interaction ?
Sereby, IIRC. Or did earlier Abbodi have a GUI ?
Emulgator
18th January 2023, 13:13
I am screwed deeper than I thought. The rollback did not undo the damage.
Of 3 scripts CQTGMC, QTGMC, QTGMCp I had working: none started, all failed.
Reinstalling the Groucho did not help.
Worse: I am locked out of my Vegas 14, it can not start up anymore. Vegas 13 does.
Not trying all my SWs now...,I am down to my knees...
Reversing the rollback now and trying later restore points...
kedautinh12
18th January 2023, 14:07
If you want install abbodi build clean. First install need unistall all vc++ already in computer via program -> unistall. After first install abbodi build, second and after abbodi build don't need do it again
Emulgator
18th January 2023, 15:39
After first install abbodi build, second and after abbodi build don't need do it again
I fail to see how this suggested sequence could help getting the old matching locks back into their doors...
ked, abbodi just installs the newest builds over the older ones by uninstalling the older ones.
And "undo" is definitely not working as expected, I am still searching for the remnants,
rstrui brings only shiny latest versions up, I can not find my version 10.0.30319.1
Are these destroyed ?
What leaves me with often incompatible versions, all painstakingly matched relations are gone.
I had let in the new locksmith by suggestion, so without further asking he unmounted the old locks from their doors,
took them away
I am left with new locks, old keys, and these old keys can not be updated, because the old locksmith is gone.
LeXXuz
18th January 2023, 15:43
I fail to see how this suggested sequence could help getting the old matching locks back into their doors...
ked, abbodi just installs the newest builds over the older ones by uninstalling the older ones.
What leaves me with often incompatible versions, all painstakingly matched relations are gone.
Old locks unmounted from their doors, taken away by the new locksmith and destroyed.
I am left with new locks, old keys, and these old keys can not be updated, because the old locksmith is gone.
Well said.
Dogway
18th January 2023, 19:13
@Emulgator, do you keep backups? Check what VC++ you had before and install back one by one (CCleaner or Geek might keep registries). Another option is to run Everything and check for "vc_redist", often these files are stored along the installed programs, so you can reinstall them back.
On the bright side, think what favor you did to all of us, I was wondering if that package was useful or not, now I know ^^
Emulgator
18th January 2023, 20:16
Yes, I have backups of almost everything.
All rstrui attempts did not bring back the structure i had.
So uninstalled all runtimes manually, then let Abbodi 0.64 do its ....rrrrr....work again.
manually copied only x64 10.0.30319.1 into system32.
Got some S/W up (Avisynth and so) and running again,
but Vegas 14 still refuses to start up, tells me Error -59 before splash screen and "You have no license..."
(sheesh, I bought everything from 8 to 16) and won't offer inputting my license data anymore, just closes after that message.
Tonight, tonight, ♫♪♬♩ and I won't eat...
StainlessS
18th January 2023, 20:18
Just copying the .dll to system32 will do.
IIRC, I got mine from a choice of shady sites too. I compared, tried the reasonable and it worked.
(Dependecies/walkers will help a bit here, too)
What Abbodi has in its recent package, maybe you just run it and see, it should report before making changes.
BTW, I remember certain later versions of .net 3.5 being a big culprit of incompatibility with (then Sony) Vegas and siblings.
Only update C Runtimes, + VB Runtimes if necessary and Office Runtimes too, no DotNet.
Emulgator
28th January 2023, 20:02
Solved.
1. Shift Vegas 14 installations folder somewhere else.
2. Find the Vegas 14 Installer regkey (different for every language it seems), export somewhere else, then delete in Registry.
3. System control -> Programs -> Vegas 14 -> Uninstall -> Ofc. "Could not find installation", but Windows finally deletes orphaned entry.
4. Now a Vegas 14 reinstall is possible.
5. Start Vegas 14: still blocked.
6. Uninstall Vegas 14 as in 3, now successful.
7. Reinstall Vegas 14 again.
8. Vegas finally comes up with License screen.
9. Input License -> accepted, starting to work.
10. Fortunately my settings were still there, no need to copy installation folder content back.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.