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 17th November 2019, 02:41   #61  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,758
Try this mod to script,

Line 370, Duplicity2.avsi
Code:
    DB=(DBase=="") ? RT_GetFullPathName("~@@@_"+RT_LocalTimeString+".DB") : RT_GetFullPathName(DBase)
Move to 629, just before RT_DBaseAlloc(), add line in red
Code:
        DB=(DBase=="") ? RT_GetFullPathName("~@@@_"+RT_LocalTimeString+".DB") : RT_GetFullPathName(DBase)
RT_DebugF("DBase = '%s'",DB,name="DB_BUGTEST: ")        # Cap in DebugView and post if problem
        RT_DBaseAlloc(DB,FrameCount,"iiiiii")
__________________
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; 17th November 2019 at 02:59.
StainlessS is online now   Reply With Quote
Old 30th October 2021, 19:56   #62  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,535
I wanted to try DropDeadGorgeous to see if it would work on my test clips. I copy/pasted from posts 46, 47, & 48. When I ran it, I got an error that it needed the DB file and I realized I need to run Duplicity2 first.

I downloaded Duplicity2 and ran it from the client supplied in the zip.

However, I got this error:

Code:
Avisynth open failure
I don't know what ThB means
I looked at your client, and you forgot to provide a default value for this variable, yet you pass it in the function call.

I looked at Duplicity2 and found that the default is simply 2x of another variable so I added this line:
Code:
ThB = ThG*2
That fixed that problem but unfortunately, I then got this error:
Code:
Avisynth open failure:
System exception - Access Violation
Duplicity2.avsi, line 760
Line 760 in that avsi file is this:
Code:
    HasGScript ? GScript(InstS) : Eval(InstS,"GS_EVAL") # Use GSCript if installed (loaded plugs override builtin)
Even though GScript is in my plugins folder, I went ahead and explicity loaded it. I tried both RT_Stats_x86.dll and RT_Stats_25.dll (12/22/2020 versions).

I still get the same error, so I think it is something other than not having RT_Stats installed, or not having the latest version.

I am using AVISynth+ 3.7.0 running under Windows XP Pro 32-bit.
johnmeyer is offline   Reply With Quote
Old 7th November 2021, 21:29   #63  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,758
Hi John, sorry for the delay in response, been a bit otherwise engaged.

Quote:
I don't know what ThB means
from post #25, (in blue [I guess I hid it a bit, sorry])
Code:
Import(".\Duplicity2.Avsi")

######
FN  = "D:\G.AVI"          DBase  = "D:\G_Det.DB"         ThB=2.0
#FN  = "D:\GTEST.AVI"      DBase  = "D:\GTEST_Det.DB"        ThB=2.0
#FN = "D:\HAR.AVI"         DBase  = "D:\HAR_Det.DB"          ThB=2.5
#FN = "D:\DeDupTest.AVI"   DBase  = "D:\DeDupTest_Det.DB"    ThB=2.0
######
Avisource(FN)
SRC=Last
###
Mode=2             # 0=Write Frames only : 1=Replace Dupes with Exact Dupes : 2= Interpolate/Blend Duplicates.
ThG=1.0            # Primary Frame Global Detect
ThP=64             # Pixel Count Detect
MaxDupLen=9        # Max detected, if more then is considered static sequence not duplicate)
MaxInterp=9        # Max Interpolated frames when Mode=2 (More than MaxInterp & less or equal to MaxDupLen then uses Blend mode)
InterpFast=true
Show=True
ShowDot=False
ShowBlk=true
VERB=False
###
TITLE=False
STACK=True
STACK4=False
###

Result=SRC.Duplicity2(Mode=Mode,ThG=ThG,ThB=ThB,ThP=ThP,MaxDupLen=MaxDupLen,MaxInterp=MaxInterp,
    \ Show=False,InterpFast=InterpFast,DBase=(STACK4||!SHOW)?DBase:"")

Metrics=SRC.Duplicity2(Mode=Mode,ThG=ThG,ThB=ThB,ThP=ThP,MaxDupLen=MaxDupLen,MaxInterp=MaxInterp,
    \ Show=True,Verb=VERB,ShowBlk=ShowBlk,ShowDot=ShowDot,InterpFast=InterpFast,DBase=(STACK4||!SHOW)?"":DBase)

Dif=Subtract(Result,SRC)

SRC     = (TITLE) ? SRC.TSub("Src")             : SRC
Result  = (TITLE) ? Result.TSub("Result")       : Result
Metrics = (TITLE) ? Metrics.TSub("Metrics")     : Metrics
Dif     = (TITLE) ? Dif.TSub("Dif(Result,Src)") : Dif

LFT=StackVertical((STACK4||!SHOW)?Result:Metrics,SRC)
RGT=StackVertical(Metrics,Dif)
STK4=StackHorizontal(LFT,RGT)

(STACK4) ? STK4 : (STACK) ? LFT : (Show)?Metrics:Result

Return Last


# Stack Overhead Subtitle Text, with optional FrameNumber shown.
Function TSub(clip c,string Tit,Bool "ShowFrameNo",Int "Col"){
    c.BlankClip(height=20,Color=Default(Col,0))
    (Default(ShowFrameNo,False))?ScriptClip("""Subtitle(String(current_frame,"%.f] """+Tit+""""))"""):Subtitle(Tit)
    Return StackVertical(c).AudioDubEx(c)
}
Quote:
Avisynth open failure:
System exception - Access Violation
Duplicity2.avsi, line 760
I seem to recall a GScript update recent-ish, maybe to smooth out something when using with avs+.
Also, if using AVS+, then GScript not required. [EDIT: remove GScript from plugins and retest with XP version AVS+]
Also, are you using XP version of AVS+ ? [It needs it now, recent test versions of AVS+ do not always contain the XP compat version of AVS+].


EDIT: GScript updated for AVS+ arrays, maybe other mods. [30 Nov 2020].
EDIT: I don't know where I got the 30 Nov 2020 GSCript from, Groucho compiled for x64 May 2020, but that aint it. [EDIT: I think Pinterf maybe did the 30 Nov 2020 ver$]

EDIT: Current AVS+ on XP requires special version because non XP ver$ uses system calls that are non-existing on XP [and so will crash].
__________________
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; 8th November 2021 at 03:10.
StainlessS is online now   Reply With Quote
Old 8th November 2021, 03:57   #64  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 381
Isn't GRunT like replacement for GScript?
VoodooFX is offline   Reply With Quote
Old 8th November 2021, 12:20   #65  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,758
Quote:
Isn't GRunT like replacement for GScript?
Nope.
Gscript = If, For, While, etc [for non + AVS]
Grunt = GScriptClip(Args="...",Local=True/False), + GFrameEvaluate, GConditionalFilter, GWriteFile and GWriteFileIf .
[ with Grunt, ScriptClip(Args="...",Local=True/False) etc also works, the 'G' versions just makes Grunt requirement explicit ]

Grunt:- https://forum.doom9.org/showthread.php?t=139337

Not sure if Avs+ implements as below
Quote:
Originally Posted by Gavino View Post
For added convenience, there is a new variant of ConditionalFilter which takes a single boolean expression instead of three separate parameters as at present. This is useful when the condition to be tested is a compound one or is already available in boolean form. For example,
Code:
ConditionalFilter(c, c1, c2, \
 "AverageLuma(c1) > AverageLuma() && AverageLuma(c1) > AverageLuma(c2)")
where previously you would have to add (...,"=", "true")
EDIT:
Quote:
Originally Posted by StainlessS View Post
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.
__________________
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; 8th November 2021 at 13:15.
StainlessS is online now   Reply With Quote
Old 8th November 2021, 15:36   #66  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 381
Quote:
Originally Posted by StainlessS View Post
Gscript = If, For, While, etc [for non + AVS]
Then why this example below produces "Script error: syntax error"?

Code:
dummy = 1
BlankClip()
if(dummy == 0) {
    crop(2,2,-2,-2)
    } else {
        crop(4,4,-4,-4)
    }

Last edited by VoodooFX; 8th November 2021 at 19:14.
VoodooFX is offline   Reply With Quote
Old 8th November 2021, 17:03   #67  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 1,554
I think you might need a space between the if and the bracket
__________________
[i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub
Dogway is offline   Reply With Quote
Old 8th November 2021, 19:16   #68  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 381
Quote:
Originally Posted by Dogway View Post
I think you might need a space between the if and the bracket
Didn't helped. Btw, error is at the first curly bracket.
VoodooFX is offline   Reply With Quote
Old 8th November 2021, 19:33   #69  |  Link
Dogway
Registered User
 
Join Date: Nov 2009
Posts: 1,554
Ah yep, well it works for me but I use internal conditionals. Might be a Gscript bug.
__________________
[i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub
Dogway is offline   Reply With Quote
Old 8th November 2021, 20:47   #70  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,758
Gcript requires to be wrapped in GScript("..."), eg

Code:
dummy = 1
BlankClip()
GSCript("""
    if(dummy == 0) {
        crop(2,2,-2,-2)
        } else {
            crop(4,4,-4,-4)
        }
""")
Untested.

Or you can import a GScript script use eg GImport("..."), where script itself dont need no GScript("""...""") wrapper.

EDIT: GScript:- https://forum.doom9.org/showthread.p...hlight=GSCript

EDIT: AVS+ implemented GScript language extensions do not require GScript("...") wrappers.
Best avoid loading GScript() plugin when using AVS+. (otherwise if/while etc will require Gscript wrappers, [plugins override builtins] EDIT: Not sure about this, maybe wrong)

EDIT:
Just tried above script, with and without GScript() wrappers, and both worked OK. [avs+ x64 with GScript dll in plugins]
I used to 'belly-ache' about wiki saying something like "avs+ does not need GScript wrappers",
saying that it should read "will not work with Gscript wrapper", so I guess Pinterf got the message and fixed it.
EDIT: Leaving GScript("...") wrapper uncommented, and removing dll from plugins, does produce an error for above script.
__________________
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; 8th November 2021 at 21:17.
StainlessS is online now   Reply With Quote
Old 8th November 2021, 21:06   #71  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 381
Quote:
Originally Posted by StainlessS View Post
Best avoid loading GScript() plugin when using AVS+.
Then to hell with that Avs 2.6 support, time to let it rest in peace.
VoodooFX is offline   Reply With Quote
Old 8th November 2021, 21:19   #72  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,758
Quote:
To hell with ...
But see edits.

EDIT:
Best to advise user that v2.60 std using Gscript plugin, then need to load the script using GScript lang extensions using the GImport()
command, and use simple Import() or Plugins autoload avsi, when using AVS+. [AND STRIP ALL INSTANCES of the GScript Wrappers from the actual script containing GScript extensions].
__________________
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; 8th November 2021 at 21:26.
StainlessS is online now   Reply With Quote
Old 8th November 2021, 21:47   #73  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 381
Quote:
Originally Posted by StainlessS View Post
But see edits.
I see.
I renamed InpaintDelogo.avsi to InpaintDelogo.avs, then called it with:
GImport("c:\Program Files (x86)\AviSynth 2.5\plugins\InpaintDelogo.avs")
And looks like it started working with Avs 2.6. [when it comes to run actual if/else code then same error]

EDIT:
Actually it still does't work, it just squashed that error on the script load stage.

EDIT2:
But that "dummy" example works...

EDIT3:
It doesn't work because if/else is inside eval("""..."""), need to get rid of it.

Last edited by VoodooFX; 8th November 2021 at 23:23.
VoodooFX is offline   Reply With Quote
Old 8th November 2021, 23:15   #74  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,758
You can only really load script functions containing GScript extensions, [or whatever code allowed in *.avsi scripts],
in main script, must still wrap any GScript extension code.

Not ideal, but there you go [Gscript("...") and GImport("...") and GEval("...") only affect code that is wrapped in those G thingies]

where Import() is sorta like
Code:
S = RT_ReadTextFromFile(".\SomeScriptFile.avs")
Eval(S)
GImport() is sorta like,
Code:
S = RT_ReadTextFromFile(".\SomeIfElseFile.avs")
GEval(S)
GScript() is sorta like,
Code:
S = "Some If Else stuff"
GEval(S)
You can use eg

Code:
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 HasGScript()  { Return FuncNameExists("GSCript") }    # v2.60 std dont have FunctionExist(), so we use above whotsit [which i believe will work ok even in v2.58].

gString =""" Some If Else Stuff"""
(HasGScript) ? GEval(gString) :  ? Eval(gString)
Quote:
Originally Posted by VoodooFX View Post
EDIT3:
It doesn't work because if/else is inside eval("""..."""), need to get rid of it.
looks like you got it.
__________________
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; 8th November 2021 at 23:43.
StainlessS is online now   Reply With Quote
Old 8th November 2021, 23:55   #75  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 381
Thanks StainlessS, I think I can make it work with few small edits.

So, your DetSub_Extract.avs can be Avs 2.6 compatible too after all, or not?
VoodooFX is offline   Reply With Quote
Reply

Tags
dedup, deduplicate, duplicates

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 16:32.


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