View Full Version : AviSynth+ thread Vol.2
Selur
31st May 2020, 16:21
Having some issue with older plugins and scripts, but posted to the older thread (why isn't that one closed?) since I overlooked that this one exists.
-> https://forum.doom9.org/showthread.php?p=1914333#post1914333
in short:
Loading PlanarTools.dll and SMDegrain fails too. SMDegrain seems to rely 'VersionString' which seems to have changed,.. :/
Known issues
- Due to interface extensions, some plugins relying on old IScriptEnvironment2 no longer work (=crash)
- CPP 2.5 plugins which are using "Invoke" will probably have problems. (perhaps addressed in 3.6.1)
that explains PlanarTools and some other plugins that have problems,..
Cu Selur
manolito
31st May 2020, 18:23
New build:
Avisynth+ 3.6.1. test build 4 - 20200531 (https://drive.google.com/file/d/1EfjzGE9qSYc-ZZAakT2xbIrkpHJ_pwxI/view?usp=sharing)
@manolito: please test with your script that was giving you that strange error of
"Script error: 'Float' cannot be called. Give me a function! ([ScriptClip] Line 3) "
I wonder what message you get this time (if any)
Thanks!
Just did make a few tests using this latest test build 4, but unfortunately the error message is identical to test build 2.
I also tried to replace GRunT 1.01 with the 1.02 build which real.finder just made, but the results are the same.
manolito
31st May 2020, 18:26
can you try this? https://www.solidfiles.com/v/Q4WmdaAZ3jMYn
Thanks for this build. It does work nicely on my ancient computer, but it does not fix the GScriptClip error with the latest AVS+ 3.61 test build.
manolito
31st May 2020, 18:35
Your ScriptClip call had me a little perplexed/confused, not easy to read, and so I started dissecting it,
and once I started could not stop, it dont look correct to me when compared to the original commented out ConditionalFilter stuff.
Sorry, this GScriptClip code is over my head...
It is from MysteryX, I did not modify it in any way. He later replaced it with his own function "ConditionalFilterMT" which is included in his "framerateconverter.dll". But this DLL needs SSE2, so I had to go back to the GScriptClip version. And this works under oder AVS and AVS+ versions up to 3.5.1.
real.finder
31st May 2020, 18:36
but it does not fix the GScriptClip error with the latest AVS+ 3.61 test build.
I think no one but pinterf will fix it :) maybe it some 2.5 plugin that confused the GScriptClip, is your plugins folder in win7 is the same as the one in winxp?
pinterf
31st May 2020, 18:48
Just did make a few tests using this latest test build 4, but unfortunately the error message is identical to test build 2.
I also tried to replace GRunT 1.01 with the 1.02 build which real.finder just made, but the results are the same.
Thanks, I have to solve this because I don't like things that work here and do not work there.
pinterf
31st May 2020, 19:03
EDIT: no need for that, I've got the message now
Hi, manolito, I cannot reproduce that specific error ("float..."), I had other problems with it and the test4 fix the issue what I have experienced.
For the reproducibility I'd need your script, or better, if you are able to make a minimal version from it that still exhibits that stupid error message.
If not, I'll make it shorter myself. Thanks.
EDIT: no need for that, I've got the message now
manolito
31st May 2020, 19:22
No problem...
I already shortened the original MysteryX script considerably and modified it to run under WinXP without requiring SSE2. It also only needs the "oldfashioned" plugins without Hi Color and Hi Bitdepth.
# Frame Rate Converter
# Version: 2-June-2019
# By Etienne Charland aka MysteryX
# Based on Oleg Yushko's YFRC artifact masking,
# johnmeyer's frame interpolation code, and
# raffriff42's "weak mask" and output options.
# Pinterf is the one who spent the most time working on the core libraries, adding features and fixing bugs
# Slightly simplified user interface and code cleanup by manolito
#
# 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; either version 2 of the License, or
# (at your option) any later version.
#
# 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, or visit
# http:#www.gnu.org/copyleft/gpl.html.
#######################################################################################
### mx_fps
### Changes the frame rate with interpolation and fine artifact removal.
##
## YV12/YUY2
## Requires: MaskTools2, MvTools2, GRunT, RemoveGrain, ConvertFpsLimit, FFTW3.dll (in the system32 or syswow64 folder) for Dct values other than 0
##
## @ fps - The new framerate.
##
## @ Preset - The speed/quality preset [slow|normal|fast]. (default=normal)
##
## @ BlkSize - The block size. Supported values are 8, 16 and 32.
## Defaults for 4/3 video of height:
## 0-359: 8
## 400-1199: 16
## 1200-2160: 32
##
## @ BlkSizeV - The vertical block size. (default = BlkSize)
##
## @ Output - Output mode [auto|flow] (default = auto)
## auto=normal artifact masking; flow=interpolation only
##
## @ Prefilter - Specified a custom prefiltered clip. (default = C.RemoveGrain(22))
##
## @ Mask - Enable artifact masking (default = true)
##
## @ MaskTrh - The treshold where a block is considered bad, between 0 and 255. Smaller = stronger.
## 0 to disable artifact masking. (default = 100)
##
## @ MaskOcc - Occlusion mask treshold, between 0 and 255. 0 to disable occlusion masking. (default = 105)
##
## @ SkipTrh - The treshold where a block is counted for the skip mask, between 0 and 255. Smaller = stronger.
## Must be smaller (stronger) than MaskTrh. (default = 55)
##
## @ BlendOver - Try fallback block size when artifacts cover more than specified treshold, or 0 to disable.
## If it fails again, it will revert to frame blending. (default = 60)
##
## @ SkipOver - Skip interpolation of frames when artifacts cover more than specified treshold,
## or 0 to disable. (default = 120)
##
## @ Dct - Overrides DCT parameter (default: Fast=0, Normal=0, Slow=1)
## Useful values are 0, 4 and 1.
##
## @ BlendRatio - Changes the blend ratio used to fill artifact zones. 0 = frame copy and 100 = full blend.
## Other values provide a result in-between to eliminate ghost effects. Default = 40.
##
## Presets
## Fast: Basic interpolation
## Normal: Fast + prefilter + MSuper on prefilter + MRecalculate
## Slow: Normal + DCT=1
##
function mx_fps(clip C, float "fps", string "Preset", int "BlkSize", int "Dct", bool "Mask")
{
Preset = Default(Preset, "normal")
P_SLOW = 1 P_NORMAL = 2 P_FAST = 3
Pset = Preset == "slow" ? P_SLOW : Preset == "normal" ? P_NORMAL : Preset == "fast" ? P_FAST : -1
Assert(Pset != -1, "mx_fps: 'Preset' must be slow, normal or fast {'" + Preset + "'}")
Mask = Default(Mask, true)
Output = Mask ? "auto" : "flow"
O_AUTO = 0 O_FLOW = 1
OPut = Output == "auto" ? O_AUTO : Output == "flow" ? O_FLOW : -1
fps = default(fps, 25.000)
NewNum = int(fps * 1000)
NewDen = 1000
DefH = Max(C.Height, C.Width/4*3)
BlkSize = Default(BlkSize, DefH<360 ? 8 : DefH<1200 ? 16 : 32)
Assert(BlkSize == 8 || BlkSize == 16 || BlkSize == 32, "mx_fps: BlkSize must be 8, 16 or 32")
BlkSizeV = BlkSize
MaskTrh = 100
SkipTrh = 55
MaskOcc = MaskTrh > 0 ? 105 : 0
BlendOver = 60
SkipOver = 120
CalcPrefilter = Pset != P_FAST
Prefilter = CalcPrefilter ? C.RemoveGrain(22) : C
Recalculate = PSET <= P_NORMAL
Dct = Default(Dct, PSET == P_SLOW ? 1 : 0)
BlendRatio = 40
## "B" - Blending, "BHard" - No blending
Try {
B = C.ConvertFpsLimit(NewNum, NewDen, ratio=BlendRatio)
}
Catch(Err_Msg) {
B = C.ChangeFps(floor(fps * 3/2)).ConvertFpsLimit(NewNum, NewDen, ratio=BlendRatio)
}
BHard = C.ChangeFps(NewNum, NewDen)
Blank = BlankClip(C.ConvertToY8(), color_yuv=$000000)
## Adjust parameters for different block sizes, causing stronger or weaker masks
blk = Max(BlkSize, BlkSizeV)
MaskTrh = MaskTrh + (blk<=8 ? -20 : blk<=16 ? 0 : blk<=32 ? 20 : 35)
SkipTrh = SkipTrh + (blk<=8 ? -18 : blk<=16 ? 0 : blk<=32 ? 16 : 30)
MaskTrh = Max(Min(MaskTrh, 255), 0)
SkipTrh = Max(Min(SkipTrh, 255), 0)
gam = blk<=8 ? .56 : blk<=16 ? .50 : blk<=32 ? .36 : .14
## jm_fps interpolation
superfilt = MSuper(prefilter, hpad=16, vpad=16, sharp=1, rfilter=4) # all levels for MAnalyse
super = CalcPrefilter ? MSuper(C, hpad=16, vpad=16, levels=1, sharp=1, rfilter=4) : superfilt # one level is enough for MRecalculate
bak = MAnalyse(superfilt, isb=true, blksize=BlkSize, blksizev=BlkSizeV, overlap = (BlkSize/4+1)/2*2, overlapv = (BlkSizeV/4+1)/2*2, search=3, dct=Dct)
fwd = MAnalyse(superfilt, isb=false, blksize=BlkSize, blksizev=BlkSizeV, overlap = (BlkSize/4+1)/2*2, search=3, dct=Dct)
fwd = Recalculate ? MRecalculate(super, fwd, blksize=BlkSize/2, blksizev=BlkSizeV/2, overlap = BlkSize/2>4?(BlkSize/8+1)/2*2:0, overlapv = BlkSizeV/2>4?(BlkSizeV/8+1)/2*2:0, thSAD=100) : fwd
bak = Recalculate ? MRecalculate(super, bak, blksize=BlkSize/2, blksizev=BlkSizeV/2, overlap = BlkSize/2>4?(BlkSize/8+1)/2*2:0, overlapv = BlkSizeV/2>4?(BlkSizeV/8+1)/2*2:0, thSAD=100) : bak
Flow = MFlowFps(C, super, bak, fwd, num=NewNum, den=NewDen, blend=false, ml=200, mask=2, thSCD2=255)
## "EM" - error or artifact mask
# Mask: SAD
EM = MaskTrh > 0 ? C.ConvertToY8().MMask(bak, ml=255, kind=1, gamma=1/gam, ysc=255, thSCD2=255) : Blank
# Mask: Temporal blending
EMfwd = MaskTrh > 0 ? C.ConvertToY8().MMask(fwd, ml=255, kind=1, gamma=1/gam, thSCD2=255) : EM
EM = MaskTrh > 0 ? EM.Overlay(EMfwd, opacity=.6, mode="lighten", pc_range=true) : EM
# Mask: Occlusion
EMocc = MaskOcc > 0 ? C.ConvertToY8().MMask(bak, ml=MaskOcc, kind=2, gamma=1/gam, ysc=255, thSCD2=255).mt_inpand() : Blank
EM = MaskOcc > 0 ? EM.Overlay(EMocc, opacity=.4, mode="lighten", pc_range=true) : EM
# Last mask frame is white. Replace with previous frame.
EM = EM.DeleteFrame(EM.Framecount-1).Loop(2, EM.Framecount-1)
# 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)
## Create artifact correction mask
Try {
EM = 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(MaskTrh)
\ .Blur(.6)
\ .BicubicResize(C.Width, C.Height)
}
Catch(Err_Msg) {
Try {
BlkSize = BlkSize/2
EM = 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(MaskTrh)
\ .Blur(.6)
\ .BicubicResize(C.Width, C.Height)
}
Catch(Err_Msg) {
BlkSize = BlkSize/2
EM = 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(MaskTrh)
\ .Blur(.6)
\ .BicubicResize(C.Width, C.Height)
}
}
## "M" - Apply artifact removal
EM = EM.ChangeFPS(NewNum, NewDen)
EMskip = EMskip.ChangeFPS(NewNum, NewDen)
M = mt_merge(Flow, B, EM, luma=true, chroma="process")
## 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()
\ (" + string(SkipOver) + " > 0 && Skip >= " + string(SkipOver) + ") ? BHard :
\ (" + string(BlendOver) + " > 0 && Skip >= " + string(BlendOver) + ") ? B : M",
\ args = "EMskip,M,B,BHard", Local=true)
# Output modes
R= (Oput==O_AUTO) [** auto: artifact masking *]
\ ? M
\ : (Oput==O_FLOW) [** flow: interpolation only *]
\ ? Flow
\ : nop
return R
}
pinterf
31st May 2020, 19:23
No problem...
I already shortened the original MysteryX script considerably and modified it to run under WinXP without requiring SSE2. It also only needs the "oldfashioned" plugins without Hi Color and Hi Bitdepth.
Thanks
manolito
31st May 2020, 19:32
FWIW here is the All-In-One version with all the dependencies:
https://www.sendspace.com/file/l24pez
real.finder
31st May 2020, 19:41
FWIW here is the All-In-One version with all the dependencies:
https://www.sendspace.com/file/l24pez
while pinterf test, can you try make the plugins (autoload folder) in your winxp same as the one in your win7 one? then see if the win7 is ok or not, if it ok, then try in the winxp (same plugins and encoding script)
pinterf
31st May 2020, 19:51
Gee,
In manolito's example ScriptClip string parameter was assembled inline with \ and there is no other separator in the resolved string.
Minimal reproduction:
ColorBars()
x = 10 (x > 0) ? last : last
"Int cannot be called, give me a function"
It thinks that 10 (or AverageLuma's return value in the original example which is a float type) have to be treated as a function.
Note: since 3.6 you can have function variables as well (a nice addition from Nekopanda), so a function's return value can be a function object itself. (see readme_history.txt for examples)
Since the 10 (or AverageLuma()) was followed by a parenthesis, the expression preceeding the "(" is expected to be a function object. But it's not a function object, obviously.
Now I have to resolve that case.
pinterf
31st May 2020, 20:10
Or not.
The previous example is the special case of the following (stupid) script
ColorBars()
z = 0
y = 10
x = y (z > 0) ? last : last
there is no function called 'y'
So you cannot have this construction valid, because there is no newline before (SkipOver>0 && Skip>SkipOver)
M = M.GScriptClip("Skip = EMskip.AverageLuma()
\ (" + string(SkipOver) + " > 0 && Skip >= " + string(SkipOver) + ") ? BHard :
\ (" + string(BlendOver) + " > 0 && Skip >= " + string(BlendOver) + ") ? B : M",
\ args = "EMskip,M,B,BHard", Local=true)
What do language lovers say?
manolito
31st May 2020, 20:32
All this ScriptClip stuff is way over my head...
All I can say is that I got this GScriptClip call from an older version of FrameRateConverter which was later replaced by a ConditionalFilterMT call (which I cannot use on my XP computer).
So I am not in a position to judge the correctness of this GScriptClip syntax. But I do know that it worked on previous AVS and AVS+ versions up to 3.5.1.
StainlessS
31st May 2020, 23:55
@Mani,
Yep, but the script you were using was your own conversion of Mx script, I was just saying that the convert was not terribly good, logic ****'ed a bit,
I spent probably a couple of hours trying to understand the original, was awkwardly expressed to begin with (by MX), and was
totally understandable that you had problems doing it your own way, but point is that implementation of your scrip as is, is wrong,
not putting this up to piss you off, I am saying that your results have probably been in error, by how much, I dont know.
EDIT: Full of beer right now, I'll come back if you need assist, spent all night OUTSIDE in the street, just enjoying the feel of not being
locked up [with a good supply of beer and cider ].
EDIT: Merry, Not being locked up, day.
EDIT: I wish I could experience the feel of being incarcerated for a year or two, just so I could experience the feel of being 'let, go', must be great :)
[Mind you, afterwards I might wanna sit on top of a casino and start shooting people, so maybe not so good an idea]
EDIT: Of course the big question is, where can I shoot people for fun, without gettin' caught ? [EDIT: No Answers required, please dont PM me, and yes I'm talkin' to you DG :) ]
manolito
1st June 2020, 02:53
@Mani,
Yep, but the script you were using was your own conversion of Mx script, I was just saying that the convert was not terribly good, logic ****'ed a bit,
I spent probably a couple of hours trying to understand the original, was awkwardly expressed to begin with (by MX), and was
totally understandable that you had problems doing it your own way, but point is that implementation of your scrip as is, is wrong,
not putting this up to piss you off, I am saying that your results have probably been in error, by how much, I dont know.
Sorry, no, you got it wrong...
I did simplify the original MX script quite a bit, but I did not alter this "Apply Blendover and Skipover " section at all. All the different FrameRateConverter versions from 2017 feature exactly this code:
## Apply BlendOver and SkipOver
M2 = SkipOver > 0 ? ConditionalFilterMT(EMskip, B, BHard, "AverageLuma", "<", string(SkipOver)) : B
M = BlendOver > 0 ? ConditionalFilterMT(EMskip, M, M2, "AverageLuma", "<", string(BlendOver)) : M
# M = M.GScriptClip("Skip = EMskip.AverageLuma()
# \ (" + string(SkipOver) + " > 0 && Skip >= " + string(SkipOver) + ") ? BHard :
# \ (" + string(BlendOver) + " > 0 && Skip >= " + string(BlendOver) + ") ? B : M",
# \ args = "EMskip,M,B,BHard", Local=true)
And since I could not use ConditionalFilterMT on my machime, I used te GScriptClip version. This code is the unmodified code by MysteryX, I did not change it in any way.
So if you determined that my script is wrong, then it means that the original MX script was wrong because I just copied and pasted it.
Selur
1st June 2020, 08:03
Does anyone know how to get:
sRestore
HDR AGC
SmoothCurve (from SmoothAdjust)
SmDeGrain (https://raw.githubusercontent.com/realfinder/AVS-Stuff/master/avs%202.5%20and%20up/SMDegrain.avsi doesn't work)
KNLMeansCL (used in TemporalDegrain2)
JincResize
YadifMod2
TMM2
working with Avisynth 3.6 (32bit) or whether there is an update for them somewhere?
Reel.Deel
1st June 2020, 08:29
Does anyone know how to get:
sRestore
HDR AGC
SmoothCurve (from SmoothAdjust)
SmDeGrain (https://raw.githubusercontent.com/realfinder/AVS-Stuff/master/avs%202.5%20and%20up/SMDegrain.avsi doesn't work)
KNLMeansCL (used in TemporalDegrain2)
JincResize
YadifMod2
TMM2
working with Avisynth 3.6 (32bit) or whether there is an update for them somewhere?
sRestore: are you using all of the lastest versions from pinterf? (MaskTools2, TIVTC, RgTools, Average, GRunT) ... https://github.com/pinterf?tab=repositories
JincResize: are you using r44? http://avisynth.nl/index.php/JincResize
KNLMeansCL: https://github.com/pinterf/KNLMeansCL/releases
YadifMod2: https://github.com/Asd-g/yadifmod2/releases
TMM2: https://github.com/Asd-g/TMM2/releases
HDRAGC and SmDeGrain: what are the errors messages, if any?
SmoothAdjust: pray that LaTo still visits time to time. :)
A handful of Chikuzen's plugin had to be rebuilt, you can find many of them here: https://github.com/Asd-g?tab=repositories
Selur
1st June 2020, 09:17
@Reel.Deel:
sRestore: updated all Plugins and now I get 'I don't know what 'AvsPlusVersionNumber' means.'
JincResize: thanks accidentally used the Vapoursynth dll when updating :/
KNLMeansCL: thanks, the 'unofficial test build' works :)
YadifMod2: thanks that build works :)
TMM2: thanks that build works
SMDeGrain: reports: 'I don't know what 'AvsPlusVersionNumber' means.'
HDR AGC: simple reports: 'System exception - Access Violation'
A handful of Chikuzen's plugin had to be rebuilt, you can find many of them here: https://github.com/Asd-g?tab=repositories
Thanks a lot, I'll update my plugins. :)
Cu Selur
Reel.Deel
1st June 2020, 09:26
@Reel.Deel:
sRestore: updated all Plugins and now I get 'I don't know what 'AvsPlusVersionNumber' means.'
JincResize: thanks accidentally used the Vapoursynth dll when updating :/
KNLMeansCL: thanks, the 'unofficial test build' works :)
YadifMod2: thanks that build works :)
TMM2: thanks that build works
SMDeGrain: reports: 'I don't know what 'AvsPlusVersionNumber' means.'
HDR AGC: simple reports: 'System exception - Access Violation'
Thanks a lot, I'll update my plugins. :)
Cu Selur
sRestore and SMDeGrain: you need https://raw.githubusercontent.com/realfinder/AVS-Stuff/master/avs%202.5%20and%20up/Zs_RF_Shared.avsi
HDRAGC: hopefully it will be fixed in AviSynth+ 3.6.1. There is a test version posted by pinterf some days ago.
Gavino
1st June 2020, 11:35
(especially @manolito, @pinterf)
Joining this thread a bit late, and I haven't caught up with all the details yet, but ...
GScriptClip is essentially a wrapper around the built-in ScriptClip, which it calls to do most of the work - this is by design so that it will continue to work and pick up any future changes to the built-in filter.
Since it uses Invoke() to call the 'real' ScriptClip, GRunT may need to be changed if there is some incompatibility with recent changes to Invoke(). I haven't kept up with this topic, and don't have time to study it in detail, but pinterf seems to have the problem under control.
However, if I understand correctly, manolito's problem is not caused by GScriptClip itself, but by recent language changes which mean that the run-time script he passes to GScriptClip no longer works. Because expressions can now produce a value representing a function, a newline is required before a new statement that starts with an opening parenthesis (to prevent the parenthesis being interpreted as part of a function call), as in pinterf's example
x = y (z > 0) ? last : last
Since manolito's runtime script is constructed by string concatentation, the failing statement is less obvious, but (again if I understand correctly) it can be fixed by adding newlines where appropriate when constructing the string.
Is this a correct summary of the situation?
ChaosKing
1st June 2020, 12:00
@Selur have a look at AVSRepo https://forum.doom9.org/showthread.php?t=175822
Just run .\avsrepo-32.exe -t win32 install srestore tmm2 smdegrain yadifmod2 jincresize and you'll get the latest versions with all dependencies
pinterf
1st June 2020, 12:19
(especially @manolito, @pinterf)
However, if I understand correctly, manolito's problem is not caused by GScriptClip itself, but by recent language changes which mean that the run-time script he passes to GScriptClip no longer works. Because expressions can now produce a value representing a function, a newline is required before a new statement that starts with an opening parenthesis (to prevent the parenthesis being interpreted as part of a function call), as in pinterf's example
x = y (z > 0) ? last : last
Since manolito's runtime script is constructed by string concatentation, the failing statement is less obvious, but (again if I understand correctly) it can be fixed by adding newlines where appropriate when constructing the string.
Is this a correct summary of the situation?
Yes. My final example - in which 'y' is followed by () - does not need ScriptClip at all. What's more, it even does not need any new language construct or newer Avisynth+ to give error.
Gavino
1st June 2020, 13:22
Yes. My final example - in which 'y' is followed by () - does not need ScriptClip at all. What's more, it even does not need any new language construct or newer Avisynth+ to give error.
Yes, you're right.
That has always been illegal (and correctly so).
What seems to have changed is that replacing 'y' by '10' (or perhaps any expression at all?), now no longer works, when it did before.
Selur
1st June 2020, 13:23
sRestore and SMDeGrain: you need https://raw.githubusercontent.com/realfinder/AVS-Stuff/master/avs%202.5%20and%20up/Zs_RF_Shared.avsi
Thanks,... using Avisynth scripts gets more and more arcane, more and more dependencies.
Tried with the 3.6.1 test version, didn't help with HDRAGC.
manolito
1st June 2020, 16:26
while pinterf test, can you try make the plugins (autoload folder) in your winxp same as the one in your win7 one? then see if the win7 is ok or not, if it ok, then try in the winxp (same plugins and encoding script)
That's exactly what I always do, because I want to have identical autoload folders on all my computers, no matter which AVS versions I use.
When upgrading from classic AVS 2.61 to AVS+ I overinstall AVS+ in the same folder as AVS 2.61. Then I choose the option to uninstall the previous version and merge the old plugins. This method will automatically remove DirectShowSource.dll from the plugins folder (it has a new DLL in the plugins+ folder). The only things I need to change manually are editing a few AVSI files which are there to autoload C-Plugins. This is no longer necessary under AVS+, so the LoadCPlugin() calls can be removed.
So there are only minor differences between my plugin folders for classic AVS and AVS+. And these plugin folders are identical between Win7 and WinXP. Which of course means that oftentimes I cannot use new plugin versions under Win7 because lots of them will not work under XP. And I do not want to have different plugin versions on my different computers. Least common denominator...
manolito
1st June 2020, 16:30
Thanks,... using Avisynth scripts gets more and more arcane, more and more dependencies.
Amen...
manolito
1st June 2020, 16:38
Because expressions can now produce a value representing a function, a newline is required before a new statement that starts with an opening parenthesis (to prevent the parenthesis being interpreted as part of a function call), as in pinterf's example
x = y (z > 0) ? last : last
Since manolito's runtime script is constructed by string concatentation, the failing statement is less obvious, but (again if I understand correctly) it can be fixed by adding newlines where appropriate when constructing the string.
Is this a correct summary of the situation?
Thanks Gavino for chiming in...
Yes, your summary is absolutely correct. So just adding newlines where appropriate would fix this script.
My question is if this fixed script would still work under older AVS versions. It absolutely needs to work under different AVS versions.
Reel.Deel
1st June 2020, 16:56
Thanks,... using Avisynth scripts gets more and more arcane, more and more dependencies.
I agree, keeping up with real.finder's scripts has been a daunting task. Poor beginners :D. First QTGMC needed some fuctions in SMDegrain, now those functions have been moved to Zs_RF_Shared.avsi, any script that used said functions now requires the helper script. Best thing to do is just to have a copy of the lastest Zs_RF_Shared.avsi ready anytime you use any of his scripts.
Gavino
1st June 2020, 17:06
My question is if this fixed script would still work under older AVS versions. It absolutely needs to work under different AVS versions.
Yes, it would.
A newline has always terminated a statement or expression and still does.
So, as long as your fix puts them in the right places, you should be OK. :)
I must say I share your concern at the bewildering number of changes to AviSynth, which I confess I have been unable to keep up with.
Progress is always to be welcomed, but sometimes it comes at the expense of clarity and a simple and consistent approach. (Just my two cents.)
gispos
1st June 2020, 17:58
MP Pipeline also no longer works with the new versions. And probably also a number of other plugins, I'm back on 3.5 3043
At the moment the whole thing is too complicated for me.:)
FranceBB
1st June 2020, 19:13
MP Pipeline also no longer works with the new versions.
I can reproduce that.
https://i.imgur.com/OVnWquN.png
I tried with a real world script and it failed the same way it failed with:
MP_Pipeline("""
ColorBars(848, 480, pixel_type="YV12")
### ###
""")
https://i.imgur.com/DDYWe2G.png
Apart from that, the other plugins I tried are working.
manolito
1st June 2020, 19:20
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.
Reel.Deel
1st June 2020, 19:38
Are you guys using pinterf's MP_Pipeline? https://github.com/pinterf/MP_Pipeline/releases
gispos
1st June 2020, 20:07
Are you guys using pinterf's MP_Pipeline? https://github.com/pinterf/MP_Pipeline/releases
Of course yes
FranceBB
1st June 2020, 20:17
Are you guys using pinterf's MP_Pipeline? https://github.com/pinterf/MP_Pipeline/releases
Yep. That's the one.
StainlessS
1st June 2020, 20:31
Sorry, no, you got it wrong...
I did simplify the original MX script quite a bit, but I did not alter this "Apply Blendover and Skipover " section at all. All the different FrameRateConverter versions from 2017 feature exactly this code:
And since I could not use ConditionalFilterMT on my machime, I used te GScriptClip version. This code is the unmodified code by MysteryX, I did not change it in any way.
So if you determined that my script is wrong, then it means that the original MX script was wrong because I just copied and pasted it.
OK, thanks for straitening me out :)
Maybe you like to try this
The first line is same as previously given as from dissection of the ConditionalFilter versions of script.
The second line just moves both BlendOver's and SkipOver's to the left, side of comparisons, less confusing [at least for me] to have them on same side.
#M = (Blendover <= 0 || AverageLuma_Skip < Blendover) ? M : (SkipOver <= 0 || AverageLuma_Skip < SkipOver) ? B : BHard
#M = (Blendover <= 0 || Blendover > AverageLuma_Skip ) ? M : (SkipOver <= 0 || SkipOver > AverageLuma_Skip ) ? B : BHard
And the GScriptClip conversion
M = "Skip = AverageLuma" + Chr(10)
\ + "(" + string(Blendover) + " <= 0 || " + string(Blendover) + " > Skip) ? M :" + Chr(10)
\ + "(" + string(SkipOver) + " <= 0 || " + string(SkipOver) + " > Skip) ? B : BHard"
Hope it works.
Maybe MysteryX changed the Conditionalfiltering and omitted to update the gscript stuff.
Anyway, above I believe should give same result as conditionalFilter version.
EDIT: forgot the GScriptClip bit
# 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 :" + Chr(10)
\ + "(" + string(SkipOver) + " <= 0 || " + string(SkipOver) + " > Skip) ? B : BHard",
\ args = "EMskip,M,B,BHard", Local=true)
manolito
1st June 2020, 21:13
Thanks StainlessS,
yes, those missing newlines were exactly what Gavino had to say, and he also said that adding them in the appropriate places should fix it, and this fixed script should also work with older AVS versions.
I will test it later tonite (I got to have dinner first, I'm starving) and report back.
Another question:
In later FrameRateConverter versions MysteryX abandoned this GScriptClip version and replaced it with ConditionalFilterMT which is part of his framerateconverter.dll.
This is what he wrote about the reason why he made this MT version:
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
Now I would like to know if this is still true for the newest AVS+ versions. If not then I could just use the built-in ConditionalFilter version (without the MT) and be done with it. Maybe pinterf could shed some light on this question...
manolito
1st June 2020, 23:33
Sorry, doesn't work...
This time I get a "Script Error: Syntax Error" plus a line number.
Looks like "adding the newlines in the appropriate places" is the tricky thing here.
StainlessS
1st June 2020, 23:49
OK, I musta cocked up somewhere, still looks ok to me.
I'll embed into your script and see if I cant find the problem.
Gavino
2nd June 2020, 00:08
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.
StainlessS
2nd June 2020, 00:12
Yeh, I figured it out big G [thanks], this should work
# 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.
Gavino
2nd June 2020, 09:28
# 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
M = EMskip.GScriptClip("
Skip=AverageLuma
(Blendover<=0 || Blendover>Skip)? M : (SkipOver)<=0 || SkipOver>Skip)? B : BHard",
\ args="Blendover,SkipOver,M,B,BHard",Local=true)
StainlessS
2nd June 2020, 14:20
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 :)
manolito
2nd June 2020, 14:37
This really is a tough one... :devil:
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:
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?
StainlessS
2nd June 2020, 15:15
bug in Gavino edition, remove extra closing parenthesis around 1st SkipOver.
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)
# 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]
# 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)
Gavino
2nd June 2020, 15:53
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.
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.
pinterf
2nd June 2020, 16:09
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?
manolito
2nd June 2020, 19:58
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).
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.
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.
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:
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?
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.
StainlessS
2nd June 2020, 21:02
I cant make any sense out of Manolito results, they be crazy.
Test just to see which clip AverageLuma is taken from
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
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
## 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:
But what is not working exactly
Well, If we knew that, we'd all be cleverer than you :) [and whats the chances of that]
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.