View Full Version : AviSynth+ SMDegrain Filter Error
meeshu
18th February 2024, 09:56
Trying to run this avisynth+ script -
AviSource("D:\Downloads\LR_color_banding.avi")
ConvertToYV12(interlaced=false, matrix="Rec601")
A=last
SMDegrain(thsad=3000, tr=4, PreFilter=2, plane=3)
PreFetch(4)
B=last
StackHorizontal(A, B)
On running this script via VirtualDub2 build 44282 and AviSynth+ version 3.7.3, I get error message appearing.
Avisynth open failure:
Script error: expected ')'
((null), line 1, column 4)
(C:/Program Files (x86)/AviSynth+/plugins64+/SMDegrain.avsi, line 879)
(C:/Program Files (x86)/AviSynth+/plugins64+/SMDegrain.avsi, line 75)
(D:\Downloads\LR_color_banding.avs, line 5)
Running SMDegrain version 3.1.2d I believe.
SMDegrain script was downloaded as raw format text from here (https://github.com/avisynth-repository/SMDegrain/blob/master/SMDegrain.avsi) and copied to Notepad++ and then saved as an avsi file for avisynth.
What is wrong with the avsi script? Why getting the error?
takla
18th February 2024, 11:03
I dunno. Maybe try EZdenoise (https://www.mediafire.com/file/3ojdzwiat4ossw0/EZdenoise_v4.zip/file)
Its like SMDegrain but simpler. Only requirement is MvTools2 (https://github.com/pinterf/mvtools/releases/tag/2.7.45)
Here is an example with the same settings you used with SMDegrain:
EZdenoise(thSAD=0, thSADC=3000, TR=4, Chroma=true, out16=true)
ConvertBits(10, dither=1)
DTL
18th February 2024, 11:14
"(C:/Program Files (x86)/AviSynth+/plugins64+/SMDegrain.avsi, line 879)
(C:/Program Files (x86)/AviSynth+/plugins64+/SMDegrain.avsi, line 75)"
Try to open this script in the text editor and look at these lines. And/or copy into error report.
meeshu
18th February 2024, 11:30
I dunno. Maybe try EZdenoise (https://www.mediafire.com/file/3ojdzwiat4ossw0/EZdenoise_v4.zip/file)
Its like SMDegrain but simpler. Only requirement is MvTools2 (https://github.com/pinterf/mvtools/releases/tag/2.7.45)
Here is an example with the same settings you used with SMDegrain:
EZdenoise(thSAD=0, thSADC=3000, TR=4, Chroma=true, out16=true)
ConvertBits(10, dither=1)
Thanks for this suggestion. I'll look into this alternative filter later.
meeshu
18th February 2024, 11:31
"(C:/Program Files (x86)/AviSynth+/plugins64+/SMDegrain.avsi, line 879)
(C:/Program Files (x86)/AviSynth+/plugins64+/SMDegrain.avsi, line 75)"
Try to open this script in the text editor and look at these lines. And/or copy into error report.
Line 75 reads -
sisphbd = AvsPlusVersionNumber > 2294
Line 879 reads -
IsAvsNeo ? eval(MidStr(VersionString(),20,4)) : IsAvsPlus ? eval(MidStr(VersionString(),17,4)) : 0
kedautinh12
18th February 2024, 11:40
Try the latest avs+ build
https://forum.doom9.org/showthread.php?p=1996799#post1996799
DTL
18th February 2024, 18:13
"AvsPlusVersionNumber"
It may be something around includes (helpers scripts) about getting AVS version. Maybe you miss these includes. Try search into all your includes scripts where AvsPlusVersionNumber is defined.
It looks function from https://github.com/realfinder/AVS-Stuff/blob/Community/avs%202.5%20and%20up/Zs_RF_Shared.avsi . Need to include it ?
meeshu
18th February 2024, 23:26
I dunno. Maybe try EZdenoise (https://www.mediafire.com/file/3ojdzwiat4ossw0/EZdenoise_v4.zip/file)
Its like SMDegrain but simpler. Only requirement is MvTools2 (https://github.com/pinterf/mvtools/releases/tag/2.7.45)
Here is an example with the same settings you used with SMDegrain:
EZdenoise(thSAD=0, thSADC=3000, TR=4, Chroma=true, out16=true)
ConvertBits(10, dither=1)
I tried EZdenoise filter and it seemed to sort of work but was sluggish and the audio appeared to be out of sync with the imagery.
Try the latest avs+ build
https://forum.doom9.org/showthread.php?p=1996799#post1996799
I've downloaded this release, but how exactly do you install this release? Overwrite the existing AviSynth+ installation? Or uninstall existing AviSynth installation and just copy and paste this latest release to a new (sub)directory? Or?
"AvsPlusVersionNumber"
It may be something around includes (helpers scripts) about getting AVS version. Maybe you miss these includes. Try search into all your includes scripts where AvsPlusVersionNumber is defined.
It looks function from https://github.com/realfinder/AVS-Stuff/blob/Community/avs%202.5%20and%20up/Zs_RF_Shared.avsi . Need to include it ?
This suggests to be some coding issue (with SMDegrain.avsi ?) which is beyond me. I can't and shouldn't have to mess around with the code.
I suspect the issue may be something to do with the version of AviSynth I have installed. I've tried a couple of older versions of AviSynth but continue to receive the same error message as in my first post, or get some other error.
kedautinh12
19th February 2024, 00:38
Just put avisynth.dll and devil.dll follow instruction
Win32: put x86 of two files above into windows/system32 and plugins of x86 into program file/AviSynth+/plugins+
Win64:
1, put x64 of two files above into windows/system32 and put x86 of two files above into windows/sysWOW64
2, put x64 plugins into Program Files (x86)/AviSynth+/plugins64+ and x86 plugins into Program Files (x86)/AviSynth+/plugins+
kedautinh12
19th February 2024, 00:42
"This suggests to be some coding issue (with SMDegrain.avsi ?) which is beyond me. I can't and shouldn't have to mess around with the code.
I suspect the issue may be something to do with the version of AviSynth I have installed. I've tried a couple of older versions of AviSynth but continue to receive the same error message as in my first post, or get some other error."
DTL suggestion right, you need this script to don't have issue, download Zs_RF_Shared.avsi and put into Program Files (x86)/AviSynth+/plugins+ and Program Files (x86)/AviSynth+/plugins64+
meeshu
19th February 2024, 04:32
Thanks kedautinh12 for the clarification.
I've installed the updated AviSynth files and also the Zs_RF_Shared.avsi script.
On running my script as per my first post I get this error message -
Avisynth open failure:
Script error: There is no function named 'removegrain'.
(C:/Program Files (x86)/AviSynth+/plugins64+/Zs_RF_Shared.avsi, line 663)
(C:/Program Files (x86)/AviSynth+/plugins64+/SMDegrain.avsi, line 809)
(C:/Program Files (x86)/AviSynth+/plugins64+/SMDegrain.avsi, line 181)
(D:\Downloads\LR_color_banding.avs, line 5)
Line 663 of Zs_RF_Shared.avsi reads -
\ : yuy26 ? mt_makediff(clp.Planar2Interleaved(ch2).ConvertToYV16(),clp.removegrain(rg11y,rg11,planar=planar).removegrain(rg20y,rg20,planar=planar).removegrain(rg20y,rg20,planar=planar).Planar2Interleaved(ch2).ConvertToYV16(),y=y2,U=u2,V=v2).ConvertToYUY2().Interleaved2planar(ch2) : mt_makediff(clp,clp.removegrain(rg11y,rg11,planar=planar).removegrain(rg20y,rg20,planar=planar).removegrain(rg20y,rg20,planar=planar),y=y2,U=u2,V=v2)
Line 809 of SMDegrain.avsi reads -
Assert(false, "prefilter must be between -1~4: "+string(prefilter))
Line 181 of SMDegrain.avsi reads -
input8
What is wrong now with the scripts?
Thank you.
StainlessS
19th February 2024, 07:45
Avisynth open failure:
Script error: There is no function named 'removegrain'.
(C:/Program Files (x86)/AviSynth+/plugins64+/Zs_RF_Shared.avsi, line 663)
(C:/Program Files (x86)/AviSynth+/plugins64+/SMDegrain.avsi, line 809)
(C:/Program Files (x86)/AviSynth+/plugins64+/SMDegrain.avsi, line 181)
(D:\Downloads\LR_color_banding.avs, line 5)
ie, script LR_color_banding.avs calls script SMDegrain.avsi calls script Zs_RF_Shared.avsi which requires removegrain function [which is included in DgTools plugin dll].
From SMDegrain.avsi
################################################################################################
### ###
### Simple MDegrain Mod - SMDegrain() ###
### ###
### Mod by Dogway - Original idea by Didée and Caroliano ###
### ###
### Special Thanks: Sagekilla, Didée, cretindesalpes, Gavino and MVtools people ###
### ###
### v0.2.0 by Caroliano - 24 Jan 2010 ###
### v0.4.0d by Dogway - 03 Sep 2011 ###
### v3.1.2d by Dogway - 21 July 2015 ###
### v3.1.2.111s by A.SONY. - 09 Febr 2021 ###
### v3.4.7d by Dogway - 15 Feb 2022 ###
### ###
################################################################################################
###
### Based on Caroliano's concept: https://forum.doom9.org/showthread.php?t=152326
### Also on Didée's concept: https://forum.doom9.org/showthread.php?p=1076491#post1076491
###
### General purpose simple degrain function. Pure temporal denoiser. Basically a wrapper(function)/frontend of mvtools2+mdegrain
### with some added common related options. Goal is accessibility and quality but not targeted to any specific kind of source.
### The reason behind is to keep it simple so for basic usage you will only need ExTools and MVTools2.
###
### Check documentation for deep explanation on settings and defaults.
### https://forum.doom9.org/showthread.php?t=182881
###
### UHD: Use as input (or at least as prefilter) the decoded (and tonemapped) PQ clip (ie. DGHDRtoSDR(mode="pq",white=100))
###
###
### Dependencies:
### MVTools2
### ExTools
### LSFmod/SharpenersPack (for Contrasharp or LFR)
### ResizersPack (for Contrasharp
### or Str=0.1 to 1.0 ~ex_retinex()~)
### GradePack (for Str=0.1 to 1.0 ~ex_retinex()~)
### RgTools (for Contrasharp
### or prefilter=0~3)
### DFTTest (for prefilter=4)
### KNLMeansCL (for prefilter=5)
### BM3D (for prefilter=6) # Buggy when used along ffvideosource() or cropping in DGSource()
### DGDecNV (for prefilter=7)
### TransformsPack (for prefilter=6 or prefilter=7)
### neo_tmedian (for mode="medianT")
### nnedi3 (for subpixel=4)
### SysInfo (for subpixel=4)
### Average (for mfilter + (Contrasharp or mode!=MDegrain) )
###
RgTools::RemoveGrain on wiki [RgTools is collection of plugins in single dll file, incl RemoveGrain.]
http://avisynth.nl/index.php/RgTools
[EDIT: Depite what it says on Wiki, the wiki linked dll (says v1.0) is currently v1.2]
You need the RgTools plugin, described as requirement for SmDegrain. [used in Zs_RF_Shared.avsi, called by SmDegrain]
Depending upon arguments to SmDegrain, you may need SOME/ALL dependencies as noted in SmDegrain Dependencies.
meeshu
19th February 2024, 11:31
Thanks for clarifying this!
Yes, I'm missing a lot of dependencies for SMDegrain and others. Through trial and error, and downloading additional dependences as required, I finally got my script to run without error!
takla
19th February 2024, 14:14
I tried EZdenoise filter and it seemed to sort of work but was sluggish and the audio appeared to be out of sync with the imagery.
EZdenoise doesn't touch/process audio streams.
Your hardware is too weak for realtime playback with audio in sync.
Also I don't know why this would matter in the first place? You can just mux the audiostreams into the videostream once it has finished encoding.
If EZdenoise caused audio desync, so will SMDgrain. Like I said, they are mostly the same.
You should seriously review the way you have things set up. It sounds pretty messy.
StainlessS
19th February 2024, 17:21
Your hardware is too weak for realtime playback with audio in sync.
AviSource("D:\Downloads\LR_color_banding.avi")
ConvertToYV12(interlaced=false, matrix="Rec601")
RETURN LAST
A=last
SMDegrain(thsad=3000, tr=4, PreFilter=2, plane=3)
PreFetch(4)
B=last
StackHorizontal(A, B)
Return Last early without the fancy stuff, is there out of sync audio ?
meeshu
20th February 2024, 04:04
Using my default script with default settings for SMDegrain as shown, there is no audio out of sync occurring. The audio starts to become de-synchronized when using (much) higher values for tr, and the video clip processing becomes slower/sluggish similar to default settings for EZdenoise script.
As an aside: my attachment in my first post is still "Attachments Pending Approval"!? Does a moderator have to approve my attachments? If so, why is it taking so long for approval? No moderators here (now)?
StainlessS
20th February 2024, 10:49
Using my default script with default settings for SMDegrain as shown, there is no audio out of sync occurring.
Then there is probably no problem playing mp4/mkv encoded using the script, only problem when trying to play in real time (due to heavy script and slower machine).
As an aside:
Moderators are terribly overworked, and it might never be approved, best host on some free site and insert link into post.
Postimage instructions:- https://forum.doom9.org/showthread.php?p=1959414&highlight=postimage#post1959414
NOTE, the ad links mentioned in above post, dont seem to have happened for some time.
meeshu
20th February 2024, 10:51
Noted thank you!
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.