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

Reply
 
Thread Tools Search this Thread Display Modes
Old Today, 16:21   #301  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,017
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.p...33#post1914333
in short:
Loading PlanarTools.dll and SMDegrain fails too. SMDegrain seems to rely 'VersionString' which seems to have changed,.. :/

Quote:
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
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old Today, 18:23   #302  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 2,796
Quote:
Originally Posted by pinterf View Post
New build:
Avisynth+ 3.6.1. test build 4 - 20200531

@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 is offline   Reply With Quote
Old Today, 18:26   #303  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 2,796
Quote:
Originally Posted by real.finder View Post
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 is offline   Reply With Quote
Old Today, 18:35   #304  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 2,796
Quote:
Originally Posted by StainlessS View Post
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.
manolito is offline   Reply With Quote
Old Today, 18:36   #305  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 1,646
Quote:
Originally Posted by manolito View Post
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?
__________________
My Avisynth Stuff
real.finder is offline   Reply With Quote
Old Today, 18:48   #306  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,579
Quote:
Originally Posted by manolito View Post
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 is offline   Reply With Quote
Old Today, 19:03   #307  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,579
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

Last edited by pinterf; Today at 19:23.
pinterf is offline   Reply With Quote
Old Today, 19:22   #308  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 2,796
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.

Quote:
# 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
}
manolito is offline   Reply With Quote
Old Today, 19:23   #309  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,579
Quote:
Originally Posted by manolito View Post
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
pinterf is offline   Reply With Quote
Old Today, 19:32   #310  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 2,796
FWIW here is the All-In-One version with all the dependencies:
https://www.sendspace.com/file/l24pez
manolito is offline   Reply With Quote
Old Today, 19:41   #311  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 1,646
Quote:
Originally Posted by manolito View Post
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)
__________________
My Avisynth Stuff
real.finder is offline   Reply With Quote
Old Today, 19:51   #312  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,579
Gee,
In manolito's example ScriptClip string parameter was assembled inline with \ and there is no other separator in the resolved string.

Minimal reproduction:

Code:
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 is offline   Reply With Quote
Old Today, 20:10   #313  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,579
Or not.
The previous example is the special case of the following (stupid) script
Code:
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)
Code:
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?
pinterf is offline   Reply With Quote
Old Today, 20:32   #314  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 2,796
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.
manolito is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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

Forum Jump


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


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