VideoHelp Forum
+ Reply to Thread
Results 1 to 28 of 28
Thread
  1. Member
    Join Date
    Apr 2012
    Location
    Portugal
    Search PM
    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 !

    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)
    sample video:
    Image Attached Files
    Quote Quote  
  2. I just use Handbrake for this type of stuff, I won't be of much help. That's an option if you need it. HB is so straight forward and easy, avisynth scripts scare me lol
    Quote Quote  
  3. Member
    Join Date
    Apr 2012
    Location
    Portugal
    Search PM
    Anybody ?
    Thanks
    Quote Quote  
  4. 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.
    Image Attached Files
    Quote Quote  
  5. Member
    Join Date
    Apr 2012
    Location
    Portugal
    Search PM
    Originally Posted by jagabo View Post
    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.
    It’s a sample from my Blu-ray Disc !
    Quote Quote  
  6. Member
    Join Date
    Apr 2012
    Location
    Portugal
    Search PM
    Originally Posted by jagabo View Post
    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.
    Can you please share your script ?
    Quote Quote  
  7. 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+
    But that causes many of the light snowflakes to disappear.

    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+
    Less noise reduction (you can play around with thsad in SMDegrain for more or less) but more snowflakes.
    Last edited by jagabo; 17th Jul 2023 at 04:57.
    Quote Quote  
  8. Member
    Join Date
    Apr 2012
    Location
    Portugal
    Search PM
    Originally Posted by jagabo View Post
    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+
    But that causes many of the light snowflakes to disappear.

    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+
    Less noise reduction (you can play around with thsad in SMDegrain for more or less) but more snowflakes.
    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)
    thanks
    Last edited by david.dgc; 17th Jul 2023 at 15:57.
    Quote Quote  
  9. 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.
    Quote Quote  
  10. Member
    Join Date
    Apr 2012
    Location
    Portugal
    Search PM
    Originally Posted by jagabo View Post
    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)
    Problem solved for finedehalo, thanks.
    I added the SMDegrain.avsi but still this error ?
    Image Attached Thumbnails Click image for larger version

Name:	Teste jagabo000000.jpg
Views:	25
Size:	19.0 KB
ID:	72492  

    Last edited by david.dgc; 17th Jul 2023 at 17:12.
    Quote Quote  
  11. Try this version of smdegain. It's the one I'm currently using.
    Image Attached Files
    Quote Quote  
  12. Member
    Join Date
    Apr 2012
    Location
    Portugal
    Search PM
    Originally Posted by jagabo View Post
    Try this version of smdegain. It's the one I'm currently using.
    Still error message. What am i doing wrong ?
    The line 260 says "Assert(IsVersionOrGreater(3,7,3), "SMDegrain: Update AviSynth+ version")"

    Image
    [Attachment 72509 - Click to enlarge]
    Quote Quote  
  13. 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...
    Image Attached Files
    Last edited by jagabo; 18th Jul 2023 at 07:41.
    Quote Quote  
  14. Member
    Join Date
    Apr 2012
    Location
    Portugal
    Search PM
    Originally Posted by jagabo View Post
    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...
    Thanks but still doesn't work...

    Image
    [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"
    Quote Quote  
  15. It's telling you what's wrong: you need KNLMeansCL.

    http://avisynth.nl/index.php/KNLMeansCL

    Or try setting PreFilter to a lower value.
    Quote Quote  
  16. Member
    Join Date
    Apr 2012
    Location
    Portugal
    Search PM
    Originally Posted by jagabo View Post
    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
    Image
    [Attachment 72549 - Click to enlarge]
    Last edited by david.dgc; 19th Jul 2023 at 15:54.
    Quote Quote  
  17. 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
    Quote Quote  
  18. Member
    Join Date
    Apr 2012
    Location
    Portugal
    Search PM
    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)
    What error is that ?

    Image
    [Attachment 72553 - Click to enlarge]
    Quote Quote  
  19. 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.
    Quote Quote  
  20. Member
    Join Date
    Apr 2012
    Location
    Portugal
    Search PM
    Originally Posted by jagabo View Post
    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)
    Still this error:

    Image
    [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
    Quote Quote  
  21. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    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
    }
    Quote Quote  
  22. 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)
    Quote Quote  
  23. Member
    Join Date
    Apr 2018
    Location
    Croatia
    Search Comp PM
    So much pain for simple filtering doable with ffmpeg.
    Quote Quote  
  24. Originally Posted by richardpl View Post
    So much pain for simple filtering doable with ffmpeg.
    So why didn't you supply a command line for doing it?
    Quote Quote  
  25. Member
    Join Date
    Apr 2012
    Location
    Portugal
    Search PM
    Originally Posted by jagabo View Post
    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)

    Thanks jagabo for your patience !
    All OK now.
    As I said on the post #8, i didn't know that the function for unsharpmask has to be included on the script.
    I will try to encode the segment and upload it.
    Quote Quote  
  26. Member
    Join Date
    Apr 2012
    Location
    Portugal
    Search PM
    Originally Posted by davexnet View Post
    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
    }
    Done.
    Thanks.
    Quote Quote  
  27. 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 Selur
    Image Attached Files
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  28. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    Thanks Selur, very instructive. And really fun
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!