This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

SMDegrain (AviSynth) PreFilter Issue
#1
So, whenever I try to use AviSynth's SMDegrain's Prefilter (any of them besides disabled) it throws errors up all over the place, such as no function removeGrain. Etc.

This is on the December 27 2017 build.

Vapoursynth's implementation works but does not allow me to use some of the filters I need from AviSynth.

I've tried downloading the .dlls and avsi's separately to see if the included files were funky but no go. I'm assuming it's a bug with still using 32-bit Avisynth which I'm hoping is not the issue as the filters I need such as some of the line darkeners and some saturation boosters (like Tweak) have never been converted to 64-bit AviSynth.

https://i.imgur.com/Wpl1uqe.png
https://i.imgur.com/ZgmjaRF.png
https://i.imgur.com/QHz9pAI.png
https://i.imgur.com/jWRytF3.png
https://i.imgur.com/RBr4SF7.png
Reply
#2
Will look into after work today an report back.
Reply
#3
1. you can copy the content of those popups using 'CTRL+C', so no need for tons of screenshots. Wink
2. since you didn't post a debug output: What does the used avisynth script look like? I thought that SMDegrain needed removegrain onel when contrasharp as set to true or something other than '0', but seems like I overlooked a call path.

Cu Selur
Reply
#4
(12.01.2018, 21:03)Selur Wrote: 1. you can copy the content of those popups using 'CTRL+C', so no need for tons of screenshots. Wink
2. since you didn't post a debug output: What does the used avisynth script look like? I thought that SMDegrain needed removegrain onel when contrasharp as set to true or something other than '0', but seems like I overlooked a call path.

Cu Selur

Here's the vapoursynth script which works.
# Imports
import os
import sys
import ctypes
# Loading Support Files
Dllref = ctypes.windll.LoadLibrary("C:/Program Files/Hybrid/vsfilters/Support/OpenCL.dll")
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'C:/Program Files/Hybrid/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/vsfilters/Support/libmvtools.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import nnedi3_resample
import mvsfunc
import havsfunc
# Loading D:\Video\Anime\MS GUNDAM WING BD COLLECTION\GUNDAMWINGBD1\GUNDAMWINGBD1\GUNDAMWINGBD1.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="D:/Video/Anime/MS GUNDAM WING BD COLLECTION/GUNDAMWINGBD1/GUNDAMWINGBD1/GUNDAMWINGBD1.mkv", format="YUV420P8", cache=0)
# making sure input color matrix is set as 709
clip = core.resize.Point(clip, matrix_in_s="709")
# Making sure input color range is set to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# cropping the video to 1280x720
clip = core.std.CropRel(clip=clip, left=240, right=240, top=0, bottom=0)
# removing grain using SMDegrain
clip = havsfunc.SMDegrain(input=clip, tr=6, thSAD=600, thSADC=300, RefineMotion=True, contrasharp=True, interlaced=False, subpixel=3, prefilter=0, blksize=8, search=5, truemotion=False)
# denoising using KNLMeansCL
clip = core.knlm.KNLMeansCL(clip=clip, d=9)
# denoising using KNLMeansCL
clip = core.knlm.KNLMeansCL(clip=clip, d=9)
# adjusting output color from: YUV420P8 to YUV420P10 for x265Model (i420)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10)
# Output
clip.set_output()

Here's the Avisynth which does not work (even without the other filters) same settings in the GUI
SetMemoryMax(1536)
SetMTMode(5,8) # changing MT mode
LoadPlugin("C:\PROGRA~1\Hybrid\AVISYN~1\LoadDll.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\AVISYN~1\KNLMeansCL.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\AVISYN~1\mvtools2.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\AVISYN~1\mt_masktools-26.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\AVISYN~1\VariableBlur.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\AVISYN~1\warpsharp.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\AVISYN~1\RgTools.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\AVISYN~1\aWarpSharp.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\AVISYN~1\Toon-v1.1.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\AVISYN~1\flash3kyuu_deband.dll")
LoadDll("C:\PROGRA~1\Hybrid\AVISYN~1\OpenCL.dll")
Import("C:\Program Files\Hybrid\avisynthPlugins\SMDegrain.avsi")
Import("C:\Program Files\Hybrid\avisynthPlugins\LimitedSharpenFasterMod.avs")
LoadCPlugin("C:\PROGRA~1\Hybrid\AVISYN~1\ffms2.dll")
# loading source: D:\Video\Anime\MS GUNDAM WING BD COLLECTION\GUNDAMWINGBD1\GUNDAMWINGBD1\GUNDAMWINGBD1.mkv
#  input luminance scale tv
FFVideoSource("D:\Video\Anime\MS GUNDAM WING BD COLLECTION\GUNDAMWINGBD1\GUNDAMWINGBD1\GUNDAMWINGBD1.mkv",cachefile="D:\Downloads\Video\Anime\MS GUNDAM WING BD COLLECTION\GUNDAMWINGBD1\GUNDAMWINGBD1\mkv_62a98586f99b58e15d3dc3ffa1f9a0e4_41_1_0.ffindex")
# current resolution: 1920x1080
SetMTMode(2) # changing MT mode
# cropping to 1280x720
Crop(240,0,-240,0)
# current resolution: 1280x720
# color modifications
Tweak(sat=1.10)
# denoising using KNLMeansCL
SetMTMode(5) # changing MT mode
KNLMeansCL(d=10,a=9,device_type="auto")
KNLMeansCL(d=10,a=9,device_type="auto")
# grain handling
SetMTMode(2) # changing MT mode
SMDegrain(tr=6,thSAD=600,thSADC=300,RefineMotion=true,contrasharp=true,interlaced=false,subpixel=3,prefilter=0,blksize=8,search=5,Truemotion=false)
# line darkening
Toon()
# debanding
f3kdb(dither_algo=3,grainY=1,grainC=1,dynamic_grain=true,Y=32,Cb=32,Cr=32,blur_first=false)
distributor()
return last
Reply
#5
For the future: the Vapoursynth script doesn't help with a Avisynth problem. Smile
Funny thing is RemoveGrain is loaded through 'LoadPlugin("C:\PROGRA~1\Hybrid\AVISYN~1\RgTools.dll")'. Smile
-> will look at the 'C:\Program Files\Hybrid\avisynthPlugins\SMDegrain.avsi'
(I also noticed a bug which loads KNLMeansCL two times Wink)

Cu Selur
Reply
#6
Send you a PM with a link to a dev version which should hopefully fix the issue.

Cu Selur
Reply
#7
(13.01.2018, 10:11)Selur Wrote: Send you a PM with a link to a dev version which should hopefully fix the issue.

Cu Selur

Did not fix it completely it is at least it's saying something a bit different. Like I mentioned in the pm I didn't want to bother you with the double calls till this was fixed, but you did at least get rid of the KNLMeansCL one, I'll see if I can find the other, I wrote it down somewhere.

The new error is below that popped up as soon as I entered the new settings, however it does appear as though it has something to do with countrasharp -1 as setting it to zero brings us back to the removegrain issue.

Oh and I meant to mention that the reason for no debug file is it's not giving one despite me setting a output path for it. Neither for tryign an AVISynth preview or telling it to run as a job.

New error code:
---------------------------
Error
---------------------------
Avisynth preview error: Avisynth error ����:
---------------------------
OK
---------------------------

---------------------------
Error
---------------------------
Avisynth preview error: Script error: there is no function named "Quantile"
---------------------------
OK
---------------------------
---------------------------
Error
---------------------------
Avisynth preview error: (C:\Program Files\Hybrid\32bit\avisynthPlugins\SMDegrain.avsi, line 568)
---------------------------
OK
---------------------------
---------------------------
Error
---------------------------
Avisynth preview error: (C:\Program Files\Hybrid\32bit\avisynthPlugins\SMDegrain.avsi, line 534)
---------------------------
OK
---------------------------
---------------------------
Error
---------------------------
Avisynth preview error: (C:\Program Files\Hybrid\32bit\avisynthPlugins\SMDegrain.avsi, line 500)
---------------------------
OK
---------------------------
---------------------------
Error
---------------------------
Avisynth preview error: (D:\Video\Anime\MS GUNDAM WING BD COLLECTION\GUNDAMWINGBD1\GUNDAMWINGBD1\tempPreviewAvisynthFile06_21_05_046_tmp.avs, line 36)
---------------------------
OK
---------------------------
SetMemoryMax(1536)
SetMTMode(5,8) # changing MT mode
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\LoadDll.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\KNLMeansCL.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\mvtools2.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\mt_masktools-26.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\nnedi3.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\VariableBlur.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\warpsharp.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\RgTools.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\aWarpSharp.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\MaskTools.dll")
LoadDll("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\OpenCL.dll")
Import("C:\Program Files\Hybrid\32bit\avisynthPlugins\SMDegrain.avsi")
Import("C:\Program Files\Hybrid\32bit\avisynthPlugins\LimitedSharpenFasterMod.avs")
Import("C:\Program Files\Hybrid\32bit\avisynthPlugins\Mftoon.avsi")
LoadCPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\ffms2.dll")
# loading source: D:\Video\Anime\MS GUNDAM WING BD COLLECTION\GUNDAMWINGBD1\GUNDAMWINGBD1\GUNDAMWINGBD1.mkv
#  input luminance scale tv
FFVideoSource("D:\Video\Anime\MS GUNDAM WING BD COLLECTION\GUNDAMWINGBD1\GUNDAMWINGBD1\GUNDAMWINGBD1.mkv",cachefile="D:\Video\Anime\MS GUNDAM WING BD COLLECTION\GUNDAMWINGBD1\GUNDAMWINGBD1\mkv_62a98586f99b58e15d3dc3ffa1f9a0e4_41_1_0.ffindex")
# current resolution: 1920x1080
SetMTMode(2) # changing MT mode
# cropping to 1440x1080
Crop(240,0,-240,0)
# current resolution: 1440x1080
# color modifications
Tweak(sat=1.10)
# denoising using KNLMeansCL
SetMTMode(5) # changing MT mode
KNLMeansCL(d=10,a=9,device_type="auto")
# grain handling
SetMTMode(2) # changing MT mode
SMDegrain(tr=6,thSAD=600,thSADC=300,RefineMotion=true,contrasharp=true,interlaced=false,subpixel=3,prefilter=0,blksize=8,search=5,Truemotion=false)
# line darkening
mfToon(strength=64)
distributor()
return last
Reply
#8
Okay, seems like it also need 'RemoveGrainHD' as dependency,...
-> will send you a new version once I have some time (busy atm.)
Reply
#9
Was busy too. Still no go on the test build.

---------------------------
Error
---------------------------
Avisynth preview error: Avisynth error �|7�|7}78}7X}7x}7�}7�}7�}7�}7~78~7X~7x~7�~7�~7:
---------------------------
OK
---------------------------
---------------------------
Error
---------------------------
Avisynth preview error: Script error: there is no function named "Quantile"
---------------------------
OK
---------------------------
---------------------------
Error
---------------------------
Avisynth preview error: (C:\Program Files\Hybrid\32bit\avisynthPlugins\SMDegrain.avsi, line 568)
---------------------------
OK
---------------------------
---------------------------
Error
---------------------------
Avisynth preview error: (C:\Program Files\Hybrid\32bit\avisynthPlugins\SMDegrain.avsi, line 534)
---------------------------
OK
---------------------------
---------------------------
Error
---------------------------
Avisynth preview error: (C:\Program Files\Hybrid\32bit\avisynthPlugins\SMDegrain.avsi, line 500)
---------------------------
OK
---------------------------
---------------------------
Error
---------------------------
Avisynth preview error: (C:\Users\phazer11\AppData\Local\Temp\tempPreviewAvisynthFile03_57_18_580_tmp.avs, line 29)
---------------------------
OK
---------------------------
---------------------------
Error
---------------------------
Avisynth preview error: Couldn't import -1 (1): ?|7?|7}78}7X}7x}7?}7?}7?}7?}7~78~7X~7x~7?~7?~7
---------------------------
OK
---------------------------

And it's still throwing up the removegrain error when I set contrasharp to 0 from -1
Reply
#10
Thought I added RemovegrainHD, but will check again later and report back. (May be I just fixed it for Vapoursynth.)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)