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 Development
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd June 2020, 00:08   #341  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by StainlessS View Post
Code:
M = M.GScriptClip("Skip = AverageLuma" + Chr(10)
\ + "(" + string(Blendover) + " <= 0 || " + string(Blendover) + " > Skip) ? M :" + Chr(10)
\ + "(" + string(SkipOver)  + " <= 0 || " + string(SkipOver)  + " > Skip) ? B : BHard",
\ args = "EMskip,M,B,BHard", Local=true)
That second chr(10) should not be there as this is in the middle of an expression.
The first one is I think the only one required.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 2nd June 2020, 00:12   #342  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Yeh, I figured it out big G [thanks], this should work

Code:
# M2 = SkipOver  > 0 ? ConditionalFilter(EMskip, B, BHard, "AverageLuma", "<", string(SkipOver))  : B
# M  = BlendOver > 0 ? ConditionalFilter(EMskip, M, M2,    "AverageLuma", "<", string(BlendOver)) : M
M = M.GScriptClip("Skip=AverageLuma"+Chr(10)
\ +"("+string(Blendover)+"<=0||"+string(Blendover)+">Skip)?M:"
\ +"("+string(SkipOver) +"<=0||"+string(SkipOver) +">Skip)?B:BHard",
\ args="EMskip,M,B,BHard",Local=true)
EDIT: Re-formatted a little bit.
__________________
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 June 2020 at 00:25.
StainlessS is offline   Reply With Quote
Old 2nd June 2020, 09:28   #343  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by StainlessS View Post
Code:
# M2 = SkipOver  > 0 ? ConditionalFilter(EMskip, B, BHard, "AverageLuma", "<", string(SkipOver))  : B
# M  = BlendOver > 0 ? ConditionalFilter(EMskip, M, M2,    "AverageLuma", "<", string(BlendOver)) : M
M = M.GScriptClip("Skip=AverageLuma"+Chr(10)
\ +"("+string(Blendover)+"<=0||"+string(Blendover)+">Skip)?M:"
\ +"("+string(SkipOver) +"<=0||"+string(SkipOver) +">Skip)?B:BHard",
\ args="EMskip,M,B,BHard",Local=true)
EMskip isn't used in your script.
Shouldn't it be M = EMskip.GScriptClip(...) ???

But also, with GRunT, it is simpler to use 'args' instead of string concatenation to get local variables into the run-time script. So I would replace it all by
Code:
M = EMskip.GScriptClip("
  Skip=AverageLuma
  (Blendover<=0 || Blendover>Skip)? M : (SkipOver)<=0 || SkipOver>Skip)? B : BHard",
\ args="Blendover,SkipOver,M,B,BHard",Local=true)
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 2nd June 2020, 14:20   #344  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Yep, that does look an awful lot better G.
The M = M.... was tacked on at the end, and I could not actually test without finding a bunch of dependencies
so I just did a botch up of pretend clips. [just to test not crash]
As far as the Grunt Args=Args thing instead of string concatenation is concerned, I'm gonna pass blame for that onto MysteryX
__________________
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 June 2020 at 14:22.
StainlessS is offline   Reply With Quote
Old 2nd June 2020, 14:37   #345  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
This really is a tough one...

Quote:
Shouldn't it be M = EMskip.GScriptClip(...) ???
No, it produces garbage.

The streamlined Gavino version also produces exactly the same garbage.

But I could get the StainlessS version working with just 1 difference:
Quote:
M = M.GScriptClip("Skip=EMskip.AverageLuma"+Chr(10)
\ +"("+string(Blendover)+"<=0||"+string(Blendover)+">Skip)?M:"
\ +"("+string(SkipOver) +"<=0||"+string(SkipOver) +">Skip)?B:BHard",
\ args="EMskip,M,B,BHard",Local=true)
The difference is the placement of EMskip. Works under classic AVS 2.61 and under AVS+ 6.1 test version 2.
Does this look right?
manolito is offline   Reply With Quote
Old 2nd June 2020, 15:15   #346  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
bug in Gavino edition, remove extra closing parenthesis around 1st SkipOver.

Code:
M = EMskip.GScriptClip("
  Skip=AverageLuma
  (Blendover<=0 || Blendover>Skip)? M : (SkipOver)<=0 || SkipOver>Skip)? B : BHard",
\ args="Blendover,SkipOver,M,B,BHard",Local=true)
I dont know why it dont work without using EmSkip.AverageLuma, inside the Scriptclip script, Last is EmSkip.

Gavino fixed (we hope)
Code:
# M2 = SkipOver  > 0 ? ConditionalFilter(EMskip, B, BHard, "AverageLuma", "<", string(SkipOver))  : B
# M  = BlendOver > 0 ? ConditionalFilter(EMskip, M, M2,    "AverageLuma", "<", string(BlendOver)) : M
M = EMskip.GScriptClip("
  Skip=EmSkip.AverageLuma
  (Blendover<=0 || Blendover>Skip)? M : (SkipOver<=0 || SkipOver>Skip) ? B : BHard",
\ args="EMskip,Blendover,SkipOver,M,B,BHard",Local=true)
EDIT: Just for the hell of it try [if works, remove in red]
Code:
# M2 = SkipOver  > 0 ? ConditionalFilter(EMskip, B, BHard, "AverageLuma", "<", string(SkipOver))  : B
# M  = BlendOver > 0 ? ConditionalFilter(EMskip, M, M2,    "AverageLuma", "<", string(BlendOver)) : M
M = EMskip.GScriptClip("
  Skip=Last.AverageLuma
  (Blendover<=0 || Blendover>Skip)? M : (SkipOver<=0 || SkipOver>Skip) ? B : BHard",
\ args="EMskip,Blendover,SkipOver,M,B,BHard",Local=true)
__________________
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 June 2020 at 15:19.
StainlessS is offline   Reply With Quote
Old 2nd June 2020, 15:53   #347  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by StainlessS View Post
bug in Gavino edition, remove extra closing parenthesis around 1st SkipOver.
Thanks - Good catch! It was left over when I removed all the string() stuff.
Quote:
I dont know why it dont work without using EmSkip.AverageLuma, inside the Scriptclip script, Last is EmSkip.
Yup, the two versions should act the same.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 2nd June 2020, 16:09   #348  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by Gavino View Post
Thanks - Good catch! It was left over when I removed all the string() stuff.

Yup, the two versions should act the same.
Even if "local=true"?
EDIT: yes of course. Last is set by ScriptClip by the child clip. But what is not working exactly?

Last edited by pinterf; 2nd June 2020 at 16:37.
pinterf is offline   Reply With Quote
Old 2nd June 2020, 19:58   #349  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
Quote:
M = EMskip.GScriptClip("
Skip=AverageLuma
(Blendover<=0 || Blendover>Skip)? M : (SkipOver<=0 || SkipOver>Skip)? B : BHard",
\ args="Blendover,SkipOver,M,B,BHard",Local=true)
This one results in some black and white garbage which looks like a mask (instead of a sexy nude).

Quote:
M = EMskip.GScriptClip("
Skip=EmSkip.AverageLuma
(Blendover<=0 || Blendover>Skip)? M : (SkipOver<=0 || SkipOver>Skip) ? B : BHard",
\ args="EMskip,Blendover,SkipOver,M,B,BHard",Local=true)
Same result for this version.

Quote:
M = EMskip.GScriptClip("
Skip=Last.AverageLuma
(Blendover<=0 || Blendover>Skip)? M : (SkipOver<=0 || SkipOver>Skip) ? B : BHard",
\ args="EMskip,Blendover,SkipOver,M,B,BHard",Local=true)
And again the same output.

Quote:
M = EMskip.GScriptClip("
Skip=Last.AverageLuma
(Blendover<=0 || Blendover>Skip)? M : (SkipOver<=0 || SkipOver>Skip) ? B : BHard",
\ args="Blendover,SkipOver,M,B,BHard",Local=true)
And also the identical output

BUT:
Quote:
M = M.GScriptClip("
Skip=EmSkip.AverageLuma
(Blendover<=0 || Blendover>Skip)? M : (SkipOver<=0 || SkipOver>Skip) ? B : BHard",
\ args="EMskip,Blendover,SkipOver,M,B,BHard",Local=true)
This one DOES work. Any explanation? And are SkipOver and Blendover really applied? What made the difference was removing "EMskip" in the first line and replacing it with "M". The same goes for the other StainlessS versions of Gavino's script.


Any thoughts on this regression?
Quote:
I do not use MP_Pipeline, but I can reproduce the HDRAGC crashes under 3.61 test version 4.
BUT:
It works well under test version 2. Must be some regression in test version 4.

Last edited by manolito; 2nd June 2020 at 20:24.
manolito is offline   Reply With Quote
Old 2nd June 2020, 21:02   #350  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
I cant make any sense out of Manolito results, they be crazy.

Test just to see which clip AverageLuma is taken from

Code:
M      = BlankClip(Pixel_type="YV12",Color_YUV=$208080)     # $20
EMSkip = BlankClip(Pixel_type="YV12",Color_YUV=$308080)     # $30
B      = BlankClip(Pixel_type="YV12",Color_YUV=$408080)     # $40
BHard  = BlankClip(Pixel_type="YV12",Color_YUV=$508080)     # $50

BlendOver = 1.0
SkipOver  = 2.0

Global G_Format="%d] EMSkip=%X Last=%X Last2=%X M=%X B=%X BHard=%X"

# M2 = SkipOver  > 0 ? ConditionalFilter(EMskip, B, BHard, "AverageLuma", "<", string(SkipOver))  : B
# M  = BlendOver > 0 ? ConditionalFilter(EMskip, M, M2,    "AverageLuma", "<", string(BlendOver)) : M
M = M.GScriptClip("
Skip=EmSkip.AverageLuma
LastSkip=Last.AverageLuma
Last2Skip=AverageLuma
MSkip=M.AverageLuma
BSkip=B.AverageLuma
BHardSkip=BHard.AverageLuma
RT_DebugF(G_Format,current_frame,Skip.Int,LastSkip.Int,Last2Skip.Int,MSkip.Int,BSkip.Int,BHardSkip.Int)
(Blendover<=0 || Blendover>Skip)? M : (SkipOver<=0 || SkipOver>Skip) ? B : BHard",
\ args="EMskip,Blendover,SkipOver,M,B,BHard",Local=true)

M
Results on avs+ 3.5 r3106
Code:
M = M.GScriptClip
RT_DebugF: 0] EMSkip=30 Last=20 Last2=20 M=20 B=40 BHard=50

M = EMSkip.GScriptClip
RT_DebugF: 0] EMSkip=30 Last=30 Last2=30 M=20 B=40 BHard=50
Both look ok to me

EDIT:
This is same as original Manolito script but String() stuff removed and args used instead, however is NOT same logic as in ConditionalFilter() calls
Code:
## Apply BlendOver and SkipOver
# M2 = SkipOver > 0 ? ConditionalFilter(EMskip, B, BHard, "AverageLuma", "<", string(SkipOver)) : B
# M = BlendOver > 0 ? ConditionalFilter(EMskip, M, M2, "AverageLuma", "<", string(BlendOver)) : M
M = M.GScriptClip("Skip = EMskip.AverageLuma()
(SkipOver>0 && Skip>=SkipOver) ? BHard : (BlendOver>0 && Skip>=BlendOver) ? B : M",
\ args = "EMskip,Blendover,SkipOver,M,B,BHard", Local=true)
EDIT:
Quote:
Originally Posted by pinterf View Post
But what is not working exactly
Well, If we knew that, we'd all be cleverer than you [and whats the chances of that]
__________________
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 June 2020 at 21:44.
StainlessS is offline   Reply With Quote
Old 2nd June 2020, 22:57   #351  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
Well, I do not pretend to understand all this AVS runtime stuff, but I do make tests and I can interprete the results.

And my test results do make a lot of sense to me. If you have "M = EMskip.GScriptClip" then you assign a mask (EMskip is not a valid video clip, it is just a mask). And whatever you do with this mask with all the GScriptClip calls, the end result will still be a mask instead of a video clip.

Using "M = M.GScriptClip" instead will apply the GScript calls to the real masked video clip M instead to just a mask. And "M" is returned as the result of MX_FPS (unless you specify otherwise).

Whatever, I tested it using a short 1 minute clip using all the different methods which came up so far, and the resulting clips were all bit identical. Speed was also the same. Of course I know that a 1 minute clip does not mean much, it could be that the thresholds for SkipOver and BlendOver were not reached, but basically it seems that all the different methods are valid.
manolito is offline   Reply With Quote
Old 2nd June 2020, 23:20   #352  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by manolito View Post
EMskip is not a valid video clip, it is just a mask
Ah, does it have different properties (dimensions or colorspace) from M and the other clips?

I was assuming all the clips were similar in these respects (and StainlessS's test assumed that too). Since the clip properties of the result of ScriptClip are taken from its input, that could be the difference.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 3rd June 2020, 00:32   #353  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Was tryin' to find "ConvertFpsLimit" dependency, and found that I did compile of non SSE2 ie C + MMX/iSSE for Mani, dont recall doing that at all [memories, like the corners of my mind ...]
C + MMX/iSSE version here:- https://forum.doom9.org/showthread.p...21#post1876121

OK, I've got full script working now.

Mani's/MysteryX original Scriptclip version but removed string() stuff using args, and also removed Scriptclip internal M (using Last instead)
NOTE, this is still the version that is logically different to the commented out conditionalfilter stuff.
Code:
## Apply BlendOver and SkipOver
# M2 = SkipOver > 0 ? ConditionalFilter(EMskip, B, BHard, "AverageLuma", "<", string(SkipOver)) : B
# M = BlendOver > 0 ? ConditionalFilter(EMskip, M, M2, "AverageLuma", "<", string(BlendOver)) : M
M = M.GScriptClip("Skip = EMskip.AverageLuma()
(SkipOver>0 && Skip>=SkipOver) ? BHard : (BlendOver>0 && Skip>=BlendOver) ? B : Last",
\ args = "EMskip,Blendover,SkipOver,B,BHard", Local=true)
Same but with same logic as conditionalfilter stuff
Code:
## Apply BlendOver and SkipOver
# M2 = SkipOver  > 0 ? ConditionalFilter(EMskip, B, BHard, "AverageLuma", "<", string(SkipOver))  : B
# M  = BlendOver > 0 ? ConditionalFilter(EMskip, M, M2,    "AverageLuma", "<", string(BlendOver)) : M
M = M.GScriptClip("
Skip=EmSkip.AverageLuma
(Blendover<=0 || Blendover>Skip)? Last : (SkipOver<=0 || SkipOver>Skip) ? B : BHard",
\ args="EMskip,Blendover,SkipOver,B,BHard",Local=true)
Both work but dont know which is best (presume the conditionalFilter logic one)
Previoulsy 'M' now Last marked in blue.

EDIT:
@ Gavino,
EmSkip is (for JohnMeyer Parade clip) 32x24 pixels, so is a lot smaller than others.

Is derived from Mvtools SAD and Occlusion Masks and
Code:
# Create skip mask
EMskip = EM.BicubicResize(Round(C.Width/BlkSize/4.0)*4, Round(C.Height/BlkSizeV/4.0)*4)
\ .mt_expand(mode= mt_circle(zero=true, radius=1))
\ .mt_binarize(SkipTrh)
__________________
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; 3rd June 2020 at 00:57.
StainlessS is offline   Reply With Quote
Old 3rd June 2020, 01:23   #354  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
Quote:
Originally Posted by StainlessS View Post
Both work but dont know which is best (presume the conditionalFilter logic one)
MysteryX abandoned the GScriptClip stuff in favor of the ConditionalFilter logic some time ago, so you are probably right to assume that the ConditionalFilter logic works better.

But MysteryX used his own ConditionalFilterMT function because he determined that the internal ConditionalFilter function was not compatible with multithreading. And unfortunately this ConditionalFilterMT function does not work on my old PC because it requires SSE2.

So here my question again: (to pinterf)
Is it still true for current versions of AVS+ that ConditionalFilter is not compatible with multithreading?
Because if this is no longer true then I can easily ditch all this GScriptClip stuff and use ConditionalFilter instead. Would make my life much easier...
manolito is offline   Reply With Quote
Old 3rd June 2020, 01:28   #355  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Mani, Point out for Pinterf, where it was that MX said that [might be some clues as to reason].
__________________
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 3rd June 2020, 01:48   #356  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
I think I posted it before, but cannot find it right now...

https://github.com/mysteryx93/FrameRateConverter

Quote:
ConditionalFilterMT

Avisynth+ MT provides great capabilities to process videos. However, conditional functions are not compatible with MT (multi-threading) due to design limitations. To work around this problem, this class provides a subset of conditional features that will work with MT mode.
manolito is offline   Reply With Quote
Old 3rd June 2020, 07:12   #357  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by manolito View Post
But MysteryX used his own ConditionalFilterMT function because he determined that the internal ConditionalFilter function was not compatible with multithreading. And unfortunately this ConditionalFilterMT function does not work on my old PC because it requires SSE2.

So here my question again: (to pinterf)
Is it still true for current versions of AVS+ that ConditionalFilter is not compatible with multithreading?
The multithreading issues with runtime filter family (ConditionalFilter and ScriptClip) have been fixed.
pinterf is offline   Reply With Quote
Old 3rd June 2020, 08:37   #358  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by StainlessS View Post
@ Gavino,
EmSkip is (for JohnMeyer Parade clip) 32x24 pixels, so is a lot smaller than others.
Thanks.
That explains why using EmSkip.GscriptClip() didn't work, as the result will also be 32x24.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 3rd June 2020, 14:11   #359  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Quote:
Originally Posted by real.finder View Post

both, fftw3.dll were used to be old one that come with FFT3DFilter, the default name for new one one is libfftw3f-3.dll
Today I checked my source code and found that I have been checking first libfft3f-3.dll and then others. So that does not require change.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 3rd June 2020, 15:58   #360  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
(MP pipeline and other things are being solved)
pinterf is offline   Reply With Quote
Reply


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 08:57.


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