Hi everyone,
Can you help me to improve this script ?
I think that there is some noise left and maybe a halo problem on the edges ?
Another thing, the resize method, changes the resolution of the video from 1500x1080 to 1440x1080.
Thanks !
sample video:Code:LWLibavVideoSource("C:\Users\David GC\Desktop\Saint Seiya ANIME script\Asterix und Kleopatra_t00 (1).mkv") Crop(210, 0, -210, -0) ConvertToRGB(matrix="rec709") RGBAdjust(rb=-29, gb=-26, bb=-27)#, r=250.0/200.0, g=250.0/182.0, b=250.0/154.0) RGBAdjust(r=250.0/200.0, g=250.0/182.0, b=250.0/154.0) ConvertToYV12(matrix="rec709") Stab(range=4, dxmax=8, dymax=8, mirror=15) Spline36Resize(720,height) TemporalDegrain(sigma=16) QTGMC(InputType=2) TurnRight().nnedi3(dh=true).TurnLeft() MergeChroma(aWarpSharp2(depth=10), aWarpSharp2(depth=20)) Sharpen(0.4, 0.2)
+ Reply to Thread
Results 1 to 28 of 28
-
-
Is that sample the source or the result of your script? I played around with it the other day and went with less noise, sharper, and cropped away the black borders.
-
The script was something like this:
Code:function UnSharpMask(clip v, float radius, float strength) { blurry = v.BinomialBlur(VarY=radius, VarC=radius, Y=3, U=3, V=3) # or GaussianBlur edges = Subtract(v, blurry).ColorYUV(off_y=2).ColorYUV(cont_y=(int(strength*radius*256.0)-256.0)) Overlay(v, edges.ColorYUV(off_y=-128), mode="Add") Overlay(last, edges.Invert().ColorYUV(off_y=-128), mode="Subtract") ColorYUV(off_u=-1, off_v=-1) #overlay is causing U and V to increase by 1 } LWLibavVideoSource("Asterix und Kleopatra_t00 (1).mkv") Crop(210,0,-210,-0) ConvertToYV24() ColorYUV(gain_y=20, off_y=-10) FineDehalo(rx=3.0, ry=3.0) SMDegrain(thsad=1000, tr=3, PreFilter=4) MergeChroma(aWarpSharp2(depth=10), aWarpSharp2(depth=30)) UnSharpMask(1.5, 0.7) SMDegrain(thsad=1000, tr=3, PreFilter=4) Prefetch(8) # for multithreading in AviSynth+
I've been playing around with reducing the temporal noise reduction to retain more of the snowflakes:
Code:function UnSharpMask(clip v, float radius, float strength) { blurry = v.BinomialBlur(VarY=radius, VarC=radius, Y=3, U=3, V=3) # or GaussianBlur edges = Subtract(v, blurry).ColorYUV(off_y=2).ColorYUV(cont_y=(int(strength*radius*256.0)-256.0)) Overlay(v, edges.ColorYUV(off_y=-128), mode="Add") Overlay(last, edges.Invert().ColorYUV(off_y=-128), mode="Subtract") ColorYUV(off_u=-1, off_v=-1) #overlay is causing U and V to increase by 1 } LWLibavVideoSource("Asterix und Kleopatra_t00 (1).mkv", cache=false, prefer_hw=2) Crop(210,0,-210,-0) ConvertToYV24() ColorYUV(gain_y=20, off_y=-10) FineDehalo(rx=3.0, ry=3.0) SMDegrain(thsad=300, tr=3, PreFilter=4) MergeChroma(aWarpSharp2(depth=10), aWarpSharp2(depth=30)) edges = mt_edge(mode="prewitt", thy1=50, thy2=50).mt_expand().Blur(1.5).GreyScale() Overlay(last, UnSharpMask(1.5, 0.7), mask=edges) Prefetch(8) # for multithreading in AviSynth+
Last edited by jagabo; 17th Jul 2023 at 04:57.
-
How can i open this script ? I don't know how to "call" the first part :function UnSharpMask(, etc.
I tried to create the script but the "FineDehalo" doesn't load. I have the message "there is no function called finedehalo :
Code:LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\LSMASHSource.dll") Import("C:\Program Files (x86)\AviSynth+\plugins\Stab.avsi") Import("C:\Program Files (x86)\AviSynth+\plugins\Dehalo_alpha_MT2.avsi") Import("C:\Program Files (x86)\AviSynth+\plugins\TemporalDegrain.avs") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\DePan.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\DePanEstimate.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\mvtools2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\MedianBlur2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\masktools2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\RgTools.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\fft3dfilter.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\avstp.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\dither.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\aWarpsharpMT.dll") LWLibavVideoSource("C:\Users\David GC\Desktop\ANIME script\Asterix und Kleopatra_t00 (1).mkv") Crop(210,0,-210,-0) ConvertToYV24() ColorYUV(gain_y=20, off_y=-10) FineDehalo(rx=3.0, ry=3.0) SMDegrain(thsad=1000, tr=3, PreFilter=4) MergeChroma(aWarpSharp2(depth=10), aWarpSharp2(depth=30)) SMDegrain(thsad=1000, tr=3, PreFilter=4)
Last edited by david.dgc; 17th Jul 2023 at 15:57.
-
When I originally made that post I accidentally omitted the line that calls UnSharpMask() in the first script. I later edited the post and put it back in. It looks like you got the script before I updated the post.
FineDehalo() can be found here: http://avisynth.nl/index.php/FineDehalo
Put the AVSI file in AviSynth's plugins folder. -
Code:
LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\LSMASHSource.dll") Import("C:\Program Files (x86)\AviSynth+\plugins\Stab.avsi") Import("C:\Program Files (x86)\AviSynth+\plugins\Dehalo_alpha_MT2.avsi") Import("C:\Program Files (x86)\AviSynth+\plugins\FineDehalo.avsi") Import("C:\Program Files (x86)\AviSynth+\plugins\TemporalDegrain.avs") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\DePan.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\DePanEstimate.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\mvtools2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\MedianBlur2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\masktools2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\RgTools.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\fft3dfilter.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\avstp.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\dither.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\aWarpsharpMT.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\aWarpsharpMT.dll") LWLibavVideoSource("C:\Users\David GC\Desktop\ANIME script\Asterix und Kleopatra_t00 (1).mkv") Crop(210,0,-210,-0) ConvertToYV24() ColorYUV(gain_y=20, off_y=-10) FineDehalo(rx=3.0, ry=3.0) SMDegrain(thsad=1000, tr=3, PreFilter=4) MergeChroma(aWarpSharp2(depth=10), aWarpSharp2(depth=30)) UnSharpMask(1.5, 0.7) SMDegrain(thsad=1000, tr=3, PreFilter=4)
I added the SMDegrain.avsi but still this error ?Last edited by david.dgc; 17th Jul 2023 at 17:12.
-
Still error message. What am i doing wrong ?
The line 260 says "Assert(IsVersionOrGreater(3,7,3), "SMDegrain: Update AviSynth+ version")"
[Attachment 72509 - Click to enlarge] -
AviSynth+ and many filters have been in a lot of flux the last year or so. That version of SMDegrain requires a newer version of AviSynth+ than the one you have. You'll have to update AviSynth+ or find an older version of SMDegrain that works. I have an older version that might work for you...
Last edited by jagabo; 18th Jul 2023 at 07:41.
-
Thanks but still doesn't work...
[Attachment 72546 - Click to enlarge]
The line 861: """") : Eval("NL_in.KNLMeansCL(D=d, A=a, h=h,stacked=lsb_in || lsb,device_type=device_type,device_id=deviceid,cha nnels=cnl" + knlm_params + ")")"
The line 801: "Assert(false, "prefilter must be between -1~4: "+string(prefilter))"
The line 181: " input8" -
It's telling you what's wrong: you need KNLMeansCL.
http://avisynth.nl/index.php/KNLMeansCL
Or try setting PreFilter to a lower value. -
Thanks !
I think is ok with SMDegrain, it tells me now that "no function named unsharpmask". I can't find this filter on avisynth.nl ?
It's wharpsharp.dll ? i loaded it but still the error
[Attachment 72549 - Click to enlarge]Last edited by david.dgc; 19th Jul 2023 at 15:54.
-
I included the custom UnSharpMask() I use in post #7 of this thread. You can copy/paste it into your script. UnSharpMask() uses BinomialBlur() which comes with the VariableBlur package:
http://avisynth.nl/index.php/Variableblur -
Code:
LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\LSMASHSource.dll") Import("C:\Program Files (x86)\AviSynth+\plugins\Stab.avsi") Import("C:\Program Files (x86)\AviSynth+\plugins\Dehalo_alpha_MT2.avsi") Import("C:\Program Files (x86)\AviSynth+\plugins\FineDehalo.avsi") Import("C:\Program Files (x86)\AviSynth+\plugins\TemporalDegrain.avs") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\DePan.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\DePanEstimate.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\mvtools2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\MedianBlur2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\variableblur.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\masktools2.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\RgTools.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\fft3dfilter.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\avstp.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\aWarpsharpMT.dll") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\dither.dll") Import("C:\Program Files (x86)\AviSynth+\plugins\dither.avsi") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\KNLMeansCL.dll") Import("C:\Program Files (x86)\AviSynth+\plugins\mt_xxpand_multi.avsi") Import("C:\Program Files (x86)\AviSynth+\plugins\SMDegrain.avsi") Import("C:\Program Files (x86)\AviSynth+\plugins\ExTools.avsi") Import("C:\Program Files (x86)\AviSynth+\plugins\ResizersPack.avsi") LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins\warpsharp.dll") Import("C:\Program Files (x86)\AviSynth+\plugins\Zs_RF_Shared.avsi") LWLibavVideoSource("C:\Users\David GC\Desktop\ANIME script\Asterix und Kleopatra_t00 (1).mkv") Crop(210,0,-210,-0) ConvertToYV24() ColorYUV(gain_y=20, off_y=-10) FineDehalo(rx=3.0, ry=3.0) SMDegrain(thsad=1000, tr=3, PreFilter=4) MergeChroma(aWarpSharp2(depth=10), aWarpSharp2(depth=30)) UnSharpMask(1.5, 0.7) SMDegrain(thsad=1000, tr=3, PreFilter=4)
[Attachment 72553 - Click to enlarge] -
I don't know what's causing that. I don't see anything unusual about line 6, LoadPlugin("...depan.dll"). Maybe the prior Import of TemporalDegrain is causing the problem? Since the script isn't calling TemporalDegrain() try removing that line and see what happens.
I would try this comment out (put a # at the start of the line) the two calls to SMDegrain() and UnSharpMask(). (AviSynth will then ignore those lines.) See if the script loads. If it does, re-enable the calls one by one until you find where it breaks. -
Started a clean script:
Code:Import("C:\Program Files\Hybrid\64bit\Avisynth\avisynthPlugins\FineDehalo.avsi") Import("C:\Program Files\Hybrid\64bit\Avisynth\avisynthPlugins\mt_xxpand_multi.avsi") Import("C:\Program Files\Hybrid\64bit\Avisynth\avisynthPlugins\SMDegrain.avsi") LoadPlugin("C:\Program Files\Hybrid\64bit\Avisynth\avisynthPlugins\KNLMeansCL.dll") #LoadPlugin("C:\Program Files\Hybrid\64bit\Avisynth\avisynthPlugins\variableblur.dll") LoadPlugin("C:\Users\David GC\Desktop\variableblur0.7_x86_x64\x64\variableblur.dll") DirectShowSource("C:\Users\David GC\Desktop\ANIME script\Asterix und Kleopatra_t00 (1).mkv") Crop(210,0,-210,-0) ConvertToYV24() ColorYUV(gain_y=20, off_y=-10) FineDehalo(rx=3.0, ry=3.0) SMDegrain(thsad=1000, tr=3, PreFilter=4) MergeChroma(aWarpSharp2(depth=10), aWarpSharp2(depth=30)) UnSharpMask(1.5, 0.7) SMDegrain(thsad=1000, tr=3, PreFilter=4)
[Attachment 72554 - Click to enlarge]
I loaded the variableblur.dll from the site you sent me and i have this error. Everything works unless when i activate the "unsharpmask" filter.
Thank you for your patience and help -
See post 7, you didn't copy jagabo's inline function into the script
Code:function UnSharpMask(clip v, float radius, float strength) { blurry = v.BinomialBlur(VarY=radius, VarC=radius, Y=3, U=3, V=3) # or GaussianBlur edges = Subtract(v, blurry).ColorYUV(off_y=2).ColorYUV(cont_y=(int(strength*radius*256.0)-256.0)) Overlay(v, edges.ColorYUV(off_y=-128), mode="Add") Overlay(last, edges.Invert().ColorYUV(off_y=-128), mode="Subtract") ColorYUV(off_u=-1, off_v=-1) #overlay is causing U and V to increase by 1 }
-
You didn't include my definition of the UnSharpMask function. Copy it from post #7, and paste it into your script. Just like it appears in my script in that post. Or put a copy of it in the plugins folder with all your other AVS and AVSI functions and Import() it into your script like all those others.
Code:# this creates a function call UnSharpMask # it's not executed until you call it below function UnSharpMask(clip v, float radius, float strength) { blurry = v.BinomialBlur(VarY=radius, VarC=radius, Y=3, U=3, V=3) # or GaussianBlur edges = Subtract(v, blurry).ColorYUV(off_y=2).ColorYUV(cont_y=(int(strength*radius*256.0)-256.0)) Overlay(v, edges.ColorYUV(off_y=-128), mode="Add") Overlay(last, edges.Invert().ColorYUV(off_y=-128), mode="Subtract") ColorYUV(off_u=-1, off_v=-1) #overlay is causing U and V to increase by 1 } Import("C:\Program Files\Hybrid\64bit\Avisynth\avisynthPlugins\FineDehalo.avsi") Import("C:\Program Files\Hybrid\64bit\Avisynth\avisynthPlugins\mt_xxpand_multi.avsi") Import("C:\Program Files\Hybrid\64bit\Avisynth\avisynthPlugins\SMDegrain.avsi") LoadPlugin("C:\Program Files\Hybrid\64bit\Avisynth\avisynthPlugins\KNLMeansCL.dll") #LoadPlugin("C:\Program Files\Hybrid\64bit\Avisynth\avisynthPlugins\variableblur.dll") LoadPlugin("C:\Users\David GC\Desktop\variableblur0.7_x86_x64\x64\variableblur.dll") DirectShowSource("C:\Users\David GC\Desktop\ANIME script\Asterix und Kleopatra_t00 (1).mkv") Crop(210,0,-210,-0) ConvertToYV24() ColorYUV(gain_y=20, off_y=-10) FineDehalo(rx=3.0, ry=3.0) SMDegrain(thsad=1000, tr=3, PreFilter=4) MergeChroma(aWarpSharp2(depth=10), aWarpSharp2(depth=30)) UnSharpMask(1.5, 0.7) # this executes the UnSharpMask function which was created above SMDegrain(thsad=1000, tr=3, PreFilter=4)
-
-
-
using Vapoursynth: SCUNET + GLS line darkening
image: https://imgsli.com/MTkzNDIy
Note, using SCUNet on HD content is probably too slow to be practical (~1fps while eating 10GB VRAM here).
for fun some more methods compared: https://imgsli.com/MTkzNDM4
Cu Selurusers currently on my ignore list: deadrats, Stears555, marcorocchini -
Thanks Selur, very instructive. And really fun
Similar Threads
-
Avisynth script for Muxing
By Donnje in forum EditingReplies: 14Last Post: 15th Jun 2021, 17:07 -
One-click avisynth script?
By Aludin in forum Newbie / General discussionsReplies: 27Last Post: 18th Jul 2019, 08:30 -
Avisynth script joining help
By sulkiyan in forum EditingReplies: 16Last Post: 14th Oct 2018, 15:44 -
Avisynth fix Chroma artifacts in PAL DVD CGI cartoon
By Wizard81 in forum RestorationReplies: 1Last Post: 11th Oct 2018, 10:47