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 25th May 2019, 21:40   #41  |  Link
Dreamject
Registered User
 
Join Date: Dec 2018
Posts: 140
It's not mentioned in http://avisynth.nl/index.php/Block_statements
So it looks like purple text with limitations
Dreamject is offline   Reply With Quote
Old 26th May 2019, 00:09   #42  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
http://avisynth.nl/index.php/AviSynth%2B#GScript
http://avisynth.nl/index.php/Avisynthplus_color_formats
http://avisynth.nl/index.php/Convert
http://avisynth.nl/index.php/ConvertBits
http://avisynth.nl/index.php/Expr
http://avisynth.nl/index.php/High_bi..._with_Avisynth
__________________
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; 26th May 2019 at 00:41.
StainlessS is offline   Reply With Quote
Old 26th May 2019, 01:15   #43  |  Link
Dreamject
Registered User
 
Join Date: Dec 2018
Posts: 140
People search keyword and read what them need. Only today I read that doom9 is 'for everyone interested in DVD conversion.'.

I dont remember I met if then else construction in any example. Suggesting to use eval(""" """) and ignore that if then else exist is mockery of people. Or if you need something like
If x>1 {
a=2
b=3
if y>0 {
c=1
}
else {c=2}
}} else{}

I do not know how it should looks with eval, but something like unhighlighted eval("""" eval(""" """) : eval(""" """) """") scares me. Big/red/blinking warning that you can use if-then-else on every page is better than this instruction. It's not correct for usual people - even if them read, it says like 'gscript is integrated in avs+', but most of us do not know what is gscript. Very sad
Dreamject is offline   Reply With Quote
Old 30th July 2019, 16:56   #44  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Here script to auto load plugins via an avsi.
Also, has facility to autoload GScript style scripts using GImport() when not AVS+, and just Import when AVS+.

GScripts Directory GIMPORT in Plugins, should have all GScript(""" ... """) style wrappers REMOVED from them.

Allows using same startup/loader on avs 2.6 standard, avs+ x86 and x64.

InitExternalPlugins.avsi
Code:
# InitExternalPlugins.avsi

# SetMemoryMax(512) # whatever

# Uses RT_Stats, SysInfo32(or SysInfo64) dlls, and maybe GScript.

RT_DebugF("DBGVIEWCLEAR\n\nAuto load plugins script ENTRY\n",name="InitExternalPlugins: ")          # 'DBGVIEWCLEAR' sent to Debugview window clears the window. (thanx Wonkey)

Function ShowAvsInitInfo() {
    myName="InitExternalPlugins:ShowAvsInitInfo: "
    S=RT_String("\nVersionString      = '%s'\n",                VersionString)
    S=RT_String("%sAvisynth Bitness   = %d\n",                  S,SI_ProcessBitness)
    S=RT_String("%sProcessName        = '%s'\n",                S,SI_ProcessName)
    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("%sScreen Res         = %dx%d\n",               S,SI_ScreenResX,SI_ScreenResY)
    S=RT_String("%sScreen BitPerPixel = %d\n",                  S,SI_ScreenBitsPerPixel)
    S=RT_String("%sTime               = '%s'\n",                S,Time("%A %d %B %Y %H:%M:%S[%Z]"))
    S=RT_String("%sSetMemoryMax       = %d\n",                  S,SetMemoryMax)
    RT_DebugF("%s",S,name=myName)
}

Function AvsInit_Load_CPP_Plugin(String fn) {
    myName = "InitExternalPlugins:AvsInit_Load_CPP_Plugin: "
    Assert(fn != "", +RT_String("%sFn cannot be empty string",myName))
    FN = RT_GetFullPathName(fn)
    EX = Exist(FN)
    Try {
        EX ? LoadPlugin(FN)                            : NOP
        EX ? RT_DebugF("%s LOADED   OK",RT_FilenameSplit(FN,12).RT_StrPad(32),name=myName) : RT_DebugF("%s NOT FOUND",FN,name=myName)
    } catch( msg ) { RT_DebugF("ERROR on '%s'\nSysErr='%s'\n",FN,msg,name=myName) }
}


Function AvsInit_Load_C_Plugin(String fn) {
    myName = "InitExternalPlugins:AvsInit_Load_C_Plugin:   "
    Assert(fn != "", +RT_String("%sFn cannot be empty string",myName))
    FN = RT_GetFullPathName(fn)
    EX = Exist(FN)
    Try {
        EX ? Load_Stdcall_Plugin(FN)                   : NOP
        EX ? RT_DebugF("%s LOADED   OK",RT_FilenameSplit(FN,12).RT_StrPad(32),name=myName) : RT_DebugF("%s NOT FOUND",FN,name=myName)
    } catch( msg ) {
        RT_DebugF("ERROR on '%s'\nSysErr='%s'\n",Fn,msg,name=myName)
    }
}

Function AvsInit_Import_Avs(String fn) {
    myName = "InitExternalPlugins:AvsInit_Import_Avs:     "
    Assert(fn != "", +RT_String("%sFn cannot be empty string",myName))
    FN = RT_GetFullPathName(fn)
    EX = Exist(FN)
    Try {
        EX ? Import(FN)                                : NOP
        EX ? RT_DebugF(" %s IMPORTED OK",RT_FilenameSplit(FN,12).RT_StrPad(32),name=myName) : RT_DebugF("%s NOT FOUND",FN,name=myName)
    } catch( msg ) { RT_DebugF("ERROR on '%s'\nSysErr='%s'\n",FN,msg,name=myName) }
}

Function AvsInit_GImport(String dir) { # Import if AVS+, or GImport if NOT AVS+ and GScript present. Import of both *.avs and *.avsi
    myName = "InitExternalPlugins:AvsInit_GImport:     "
    Got=0
    IsAvsPlus=(FindStr(VersionString, "AviSynth+")>0 || FindStr(VersionString, " Neo")>0)    # EDIT: Added Avisynth Neo
    HasGScript=RT_FunctionExist("GScript")
    Assert(IsAvsPlus || HasGScript,RT_String("%sMust have Avs+ or GScript",myName))
    Assert(dir != "", +RT_String("%sdir cannot be empty string",myName))
    Dir = RT_GetFullPathName(Dir)
    TEMP=RT_GetSystemEnv("TEMP") + "\~" + RT_LocalTimeString + ".tmp"
    nwr = RT_WriteFileList(Dir+"\*.avs|avsi",TEMP)
    GS="""
        if(nwr > 0) {
            for(i=0,nwr-1) {
                fn = RT_ReadTxtFromFile(TEMP,Lines=1,Start=i)
                fn = RT_TxtGetLine(fn)  # Strip NL
                try {
                    if(HasGScript) {
                        RT_DebugF("GImporting ... %s",fn,name=myName)
                        GImport(fn)
                    } Else {
                        RT_DebugF("Importing ... %s",fn,name=myName)
                        Import(fn)
                    }
                    got=got+1
                } catch ( msg ) { RT_DebugF(" *** Catch *** %s",msg,name=myName) }
            }
        }
    """
    (HasGScript) ? GSCript(GS) : Eval(GS)
    RT_FileDelete(TEMP)
    RT_DebugF("    IMPORTED %d scripts",got,name=myName)
}

##################

ShowAvsInitInfo()

AvsInit_Load_CPP_Plugin (".\DGDecode\DGDecode.DLL")                                # DGDecode CPP
AvsInit_Load_C_Plugin   (".\FFMS2_C\ffms2.dll")                                    # FFMpegSource C Plugin
AvsInit_Import_Avs      (".\FFMS2_C\ffms2.avsi")                                   # FFMpegSource C Avsi file with LoadCPlugin line commented OUT.
AvsInit_Load_CPP_Plugin (".\LSMASH_CPP\LSMASHSource.dll")                          # L-Smash CPP

#AvsInit_Load_CPP_Plugin (".\FFMS2000_CPP\ffms2.dll")                               # FFMpegSource CPP Plugin
#AvsInit_Import_Avs      (".\FFMS2000_CPP\ffms2.avsi")                              # FFMpegSource CPP Avsi file with LoadCPlugin line commented OUT.

### Below Scripts should NOT have GScript wrappers ie no GScript(""" ... """). Import() scripts for AVS+, and GImport() when GScript installed.

AvsInit_GImport(".\GIMPORT")                                                       # GIMPORT foldler inside your Plugins directory.

#AvsInit_GImport("..\..\GIMPORT")                                                    # 2 Directories ABOVE plugins, if using Groucho2004 Universal installer, then is in AvisynthRepository smame level as all AVS distro folders.
EDIT: Debug
Code:
00000030    18:50:48.623    InitExternalPlugins:
00000031	18:50:48.623	InitExternalPlugins: Auto load plugins script ENTRY
00000032	18:50:48.623	InitExternalPlugins: 	
00000033	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: 	
00000034	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: VersionString      = 'AviSynth+ 0.1 (r2900, MT, i386)'	
00000035	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: Avisynth Bitness   = 32	
00000036	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: ProcessName        = 'C:\NON-INSTALL\VDUB\VDUB2\VirtualDub.exe'	
00000037	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: OSVersionString    = 'Windows 7 (x64) Service Pack 1.0 (Build 7601)'	
00000038	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: OSVersionNumber    = 6.100000	
00000039	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: CPUName            = 'Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz / Yorkfield (Core 2 Quad) 6M'	
00000040	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: Cores              = 04:04 (Phy:Log)	
00000041	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: CPU Extensions     = 'MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1'	
00000042	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: Total Memory       = 12221MB	
00000043	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: Avail Memory       = 10230MB'	
00000044	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: Screen Res         = 1920x1080	
00000045	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: Screen BitPerPixel = 32	
00000046	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: Time               = 'Tuesday 30 July 2019 18:50:48[GMT Daylight Time]'	
00000047	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: SetMemoryMax       = 1024	
00000048	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: 	
00000049	18:50:48.623	InitExternalPlugins:AvsInit_Load_CPP_Plugin: DGDecode.DLL                     LOADED   OK	
00000050	18:50:48.623	InitExternalPlugins:AvsInit_Load_C_Plugin:   ffms2.dll                        LOADED   OK	
00000051	18:50:48.623	InitExternalPlugins:AvsInit_Import_Avs:      ffms2.avsi                       IMPORTED OK	
00000052	18:50:48.623	InitExternalPlugins:AvsInit_Load_CPP_Plugin: LSMASHSource.dll                 LOADED   OK	
00000053	18:50:48.639	InitExternalPlugins:AvsInit_GImport:     Importing ... C:\VideoTools\AvisynthRepository\AVSPLUS_x86\plugins\GIMPORT\MIFO_Library.avsi	
00000054	18:50:48.639	InitExternalPlugins:AvsInit_GImport:         IMPORTED 1 scripts
OOps, line in red changed
EDIT: Added AviSynth Neo as avs+
__________________
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; 30th July 2019 at 23:20.
StainlessS is offline   Reply With Quote
Old 30th July 2019, 18:54   #45  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Added line, allows using SAME folder of gscript scripts for ALL distros where using Groucho2004 Universal installer.
[although is currently commented out and using the one in current plugins]
Code:
AvsInit_GImport("..\..\GIMPORT")      # 2 Directories ABOVE plugins, if using Groucho2004 Universal installer, then is in AvisynthRepository same level as all AVS distro folders.
Post 44, Added SetMemoryMax line to Avisynth info display as in
Code:
00000030    18:50:48.623    InitExternalPlugins:
00000031	18:50:48.623	InitExternalPlugins: Auto load plugins script ENTRY
00000032	18:50:48.623	InitExternalPlugins: 	
00000033	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: 	
00000034	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: VersionString      = 'AviSynth+ 0.1 (r2900, MT, i386)'	
00000035	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: Avisynth Bitness   = 32	
00000036	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: ProcessName        = 'C:\NON-INSTALL\VDUB\VDUB2\VirtualDub.exe'	
00000037	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: OSVersionString    = 'Windows 7 (x64) Service Pack 1.0 (Build 7601)'	
00000038	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: OSVersionNumber    = 6.100000	
00000039	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: CPUName            = 'Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz / Yorkfield (Core 2 Quad) 6M'	
00000040	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: Cores              = 04:04 (Phy:Log)	
00000041	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: CPU Extensions     = 'MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1'	
00000042	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: Total Memory       = 12221MB	
00000043	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: Avail Memory       = 10230MB'	
00000044	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: Screen Res         = 1920x1080	
00000045	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: Screen BitPerPixel = 32	
00000046	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: Time               = 'Tuesday 30 July 2019 18:50:48[GMT Daylight Time]'	
00000047	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: SetMemoryMax       = 1024	
00000048	18:50:48.623	InitExternalPlugins:ShowAvsInitInfo: 	
00000049	18:50:48.623	InitExternalPlugins:AvsInit_Load_CPP_Plugin: DGDecode.DLL                     LOADED   OK	
00000050	18:50:48.623	InitExternalPlugins:AvsInit_Load_C_Plugin:   ffms2.dll                        LOADED   OK	
00000051	18:50:48.623	InitExternalPlugins:AvsInit_Import_Avs:      ffms2.avsi                       IMPORTED OK	
00000052	18:50:48.623	InitExternalPlugins:AvsInit_Load_CPP_Plugin: LSMASHSource.dll                 LOADED   OK	
00000053	18:50:48.639	InitExternalPlugins:AvsInit_GImport:     Importing ... C:\VideoTools\AvisynthRepository\AVSPLUS_x86\plugins\GIMPORT\MIFO_Library.avsi	
00000054	18:50:48.639	InitExternalPlugins:AvsInit_GImport:         IMPORTED 1 scripts
__________________
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 30th July 2019, 20:13   #46  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Oops, line in post #44 in red changed.
Was
Code:
Assert(IsAvsPlus || HasGScript)
now
Code:
Assert(IsAvsPlus || HasGScript,RT_String("%sMust have Avs+ or GScript",myName))
Kept getting my scripts mixed up, thats what happens when got a slightly different one in each of the Avisynth Universal Installer Plugins dir.
__________________
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 30th July 2019, 20:15   #47  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Quote:
Originally Posted by StainlessS View Post
Oops, line in post #44 in red changed.
Kept getting my scripts mixed up, thats what happens when got a slightly different one in each of the Avisynth Universal Installer Plugins dir.
That is why I use one plugins dir for plugins and one only for scripts

Code:
PluginDir2_5 (HKLM, x86):   D:\AvisynthRepository\AVSPLUS_x86\plugins
PluginDir+   (HKLM, x86):   D:\AvisynthRepository\SCRIPTS
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database

Last edited by ChaosKing; 30th July 2019 at 20:17.
ChaosKing is offline   Reply With Quote
Old 30th July 2019, 20:26   #48  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Clever cloggs

Now can solve all of that nonsense with GScript/Avs+, can remove all GScript wrappers from scripts, avs v2.58, 2.60, 2.61, avs+ x86 and x64, Neo x86, x64.
__________________
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 9th May 2020, 14:23   #49  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Code:
GSCript("")
Above causes Access Violation, both in original v1.1, and Groucho2004 recompile for x86 and x64.

EDIT: Actually, causes AV in current Avs+, however original v1.1 does NOT cause Access Violation under Avs 2.58. [v1.1 OK under v2.60 too]
__________________
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; 9th May 2020 at 14:33.
StainlessS is offline   Reply With Quote
Old 9th May 2020, 15:01   #50  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by StainlessS View Post
Code:
GSCript("")
Above causes Access Violation, both in original v1.1, and Groucho2004 recompile for x86 and x64.

EDIT: Actually, causes AV in current Avs+, however original v1.1 does NOT cause Access Violation under Avs 2.58. [v1.1 OK under v2.60 too]
For me, VDub2 throws this:


Edit - AVSMeter doesn't seem to be bothered at all. It just runs the script. This is the script I used:
Code:
resx = 1000
resy = 1000
colorbars(width = resx, height = resy, pixel_type = "yv12").killaudio().assumefps(25, 1).trim(0, 99999).loop(1000)
GScript("")
return last
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 9th May 2020 at 15:10.
Groucho2004 is offline   Reply With Quote
Old 9th May 2020, 15:13   #51  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Actually, I think the Groucho2004 version of Gscript I used must have been the one before current one,
re-tried with current GScript recompile and no AV or any problem under current avs+ 3.5.2 [x86 or x64].

EDIT: Script I used.
Code:
GScript("")
Return Messageclip("done")
__________________
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 9th May 2020, 15:18   #52  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by StainlessS View Post
Actually, I think the Groucho2004 version of Gscript I used must have been the one before current one,
re-tried with current GScript recompile and no AV or any problem under current avs+ 3.5.2 [x86 or x64].

EDIT: Script I used.
Code:
GScript("")
Return Messageclip("done")
The "GScript_25_32.dll" should crash with 3.5.2 (not sure...).
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 9th May 2020, 15:28   #53  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
The "GScript_25_32.dll" should crash with 3.5.2 (not sure...).
Yip, Access Violation,
__________________
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 9th May 2020, 15:36   #54  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by StainlessS View Post
Yip, Access Violation,
So, just to summarise:
GScript_26_64.dll: does not crash
GScript_26_32.dll: does not crash
GScript_25_32.dll: crashes on 3.5.2
The old DLL from 2009 should also crash on 3.5.2, right?
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 9th May 2020, 15:38   #55  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Sounds bout right.
__________________
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 9th May 2020, 15:40   #56  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by StainlessS View Post
Sounds bout right.
OK, all good then.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 9th May 2020, 15:43   #57  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Should though be noted somewhere that problems can happen when wrong version used.
[and Access violation is something that should not really happen whether correct version or not]
__________________
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 9th May 2020, 15:57   #58  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by StainlessS View Post
Should though be noted somewhere that problems can happen when wrong version used.
[and Access violation is something that should not really happen whether correct version or not]
I think a simple CheckVersion in the constructor should do the trick. I'll try it.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 9th May 2020, 16:06   #59  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
OK, but I've implemented this as safety check,
Code:
Function GScriptExists() {try{GScript("")ret=true}catch(msg){Assert(msg.FindStr("Access")==0 && msg.FindStr("Out of")==0,"GScriptExists: GScript/Avs version Mismatch")ret=false}Return ret}

BlankClip.Subtitle(String(GScriptExists))


EDIT: What is your error message gonna be ?

EDIT: this is better and not necessary to know what your error message will be.
Code:
Function GScriptExists() {try{GScript("")ret=true}catch(msg) {Assert(msg.FindStr("no function")>0,"GScriptExists: GScript/Avs version Mismatch"+Chr(10)+"SysErr="+msg)ret=false}Return ret}

BlankClip.Subtitle(String(GScriptExists))
__________________
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; 9th May 2020 at 16:43.
StainlessS is offline   Reply With Quote
Old 9th May 2020, 16:42   #60  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
By the way, I found this in the latest avisynth.h:
Code:
// Important note on AVISYNTH_INTERFACE_VERSION change:
// Note 1: Those few plugins which were using earlier IScriptEnvironment2 despite the big Warning will crash have to be rebuilt.
// Note 2: How to support earlier avisynth interface with an up-to-date avisynth.h:
//         Use the new frame property features adaptively after querying that at least v8 is supported
//         AviSynth property support can be queried (cpp iface example):
//           has_at_least_v8 = true;
//           try { env->CheckVersion(8); } catch (const AvisynthError&) { has_at_least_v8 = false; }
//         and use it:
//           if (has_at_least_v8) dst = env->NewVideoFrameP(vi, &src); else dst = env->NewVideoFrame(vi);
Whaddaya think?
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Reply

Tags
for-loop, if-then-else, while-loop

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 00:35.


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