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

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

 

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

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th February 2019, 12:26   #1  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,031
SysInfo plugin v0.1.2.6

This plugin returns info about OS/CPU*/Memory/Screen/Avisynth

Code:
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) (SysInfo_*.7z on the download page)


Recent changes (full history in 'ChangeLog.txt'):

v0.1.2.6
- Added SI_GetLogicalDrives()
- Added SI_GetLogicalDriveTotalSize("drive_letter")
- Added SI_GetLogicalDriveFreeSpace("drive_letter")
- Added SI_GetLogicalDriveUsedSpace("drive_letter")


*CPU feature detection uses Veselin Georgiev's libcpuid C-library.
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 11th August 2020 at 15:34.
Groucho2004 is offline   Reply With Quote
Old 24th February 2019, 12:49   #2  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,034
Another fine Groucho2004 production.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 24th February 2019, 12:54   #3  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,031
Quote:
Originally Posted by wonkey_monkey View Post
Another fine Groucho2004 production.
Thanks. This is my first plugin, I hope I didn't screw up.
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 24th February 2019 at 13:53.
Groucho2004 is offline   Reply With Quote
Old 24th February 2019, 15:12   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 8,539
Hi G2K4,

Just pointing out something that you may like to query with your provider, below from FlagFox, FireFox extension.



Maybe just means that it is not an HTTPS, dont know.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 24th February 2019, 15:23   #5  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,031
Quote:
Originally Posted by StainlessS View Post
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...
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 24th February 2019 at 21:50.
Groucho2004 is offline   Reply With Quote
Old 24th February 2019, 15:45   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 8,539
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.p...36#post1633936

EDIT: http://avisynth.nl/index.php/Filter_SDK/Env_SaveString

EDIT: eg here
Code:
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
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 24th February 2019 at 15:57.
StainlessS is offline   Reply With Quote
Old 24th February 2019, 16:00   #7  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,031
Quote:
Originally Posted by StainlessS View Post
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.p...36#post1633936

EDIT: http://avisynth.nl/index.php/Filter_SDK/Env_SaveString

EDIT: eg here
Code:
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.
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 25th March 2019 at 22:56.
Groucho2004 is offline   Reply With Quote
Old 24th February 2019, 21:39   #8  |  Link
silverwing
Registered User
 
Join Date: Nov 2017
Location: Russia, Nizhny Novgorod
Posts: 25
Quote:
Originally Posted by Groucho2004 View Post
This filter returns info about OS/CPU.
Nice work! I will test. Thank you!
silverwing is offline   Reply With Quote
Old 24th February 2019, 21:44   #9  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,031
v0.1.0.1
- Better error handling
- Fixed some minor bugs
- Added SI_NumberOfCPUs
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 25th February 2019, 00:20   #10  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,031
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).
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 25th February 2019 at 00:28.
Groucho2004 is offline   Reply With Quote
Old 25th February 2019, 00:58   #11  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 8,539
Quote:
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.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 25th February 2019, 02:35   #12  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,031
Quote:
Originally Posted by StainlessS View Post
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.
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 25th February 2019 at 02:42.
Groucho2004 is offline   Reply With Quote
Old 25th February 2019, 07:41   #13  |  Link
Sparktank
47.952fps@71.928Hz
 
Sparktank's Avatar
 
Join Date: Mar 2011
Posts: 938
Wow, this cool. Thanks a lot! This is bound to help plenty out in the future.
__________________
Win10 (x64) build 18362| GPU Caps Viewer 1.42.4.0
NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4)
NTSC | DVD: R1 | BD: A
Intel Xeon X5660 @2.80GHz
Sparktank is offline   Reply With Quote
Old 25th February 2019, 14:18   #14  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,031
v0.1.0.3
- Added SI_AvailableSystemMemory
- Removed SI_CPUClock
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 2nd March 2019, 13:56   #15  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,031
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(). Example:
Code:
LoadDLL(SI_ModulePath + "\libfftw3f-3.dll")
AVISource("Test.avi")
FFT3DFilter()
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 14th March 2019 at 15:22.
Groucho2004 is offline   Reply With Quote
Old 2nd March 2019, 14:37   #16  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,363
Perfect! Lazy People can use a autoLoadDLLs.avsi script like this now

\plugins
\fft

Code:
LoadDLL(SI_ModulePath + "\..\fft\libfftw3-3.dll")
LoadDLL(SI_ModulePath + "\..\fft\libfftw3f-3.dll")
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database || https://github.com/avisynth-repository

Last edited by ChaosKing; 2nd March 2019 at 14:39.
ChaosKing is offline   Reply With Quote
Old 2nd March 2019, 15:10   #17  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,031
Quote:
Originally Posted by ChaosKing View Post
Perfect! Lazy People can use a autoLoadDLLs.avsi script like this now

\plugins
\fft

Code:
LoadDLL(SI_ModulePath + "\..\fft\libfftw3-3.dll")
LoadDLL(SI_ModulePath + "\..\fft\libfftw3f-3.dll")
Neat. Have not even considered that.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 2nd March 2019, 22:09   #18  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 8,539
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
Code:
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
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 2nd March 2019 at 22:11.
StainlessS is offline   Reply With Quote
Old 6th March 2019, 19:33   #19  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,031
v0.1.0.5
- Added SI_TotalSystemMemory
- Refactor/Reorganize
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 7th March 2019, 06:34   #20  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 8,539
Ooh lovely, Thank you Grouchy 200.4%
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 7th March 2019 at 06:47.
StainlessS is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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

Forum Jump


All times are GMT +1. The time now is 12:21.


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