VideoHelp Forum
+ Reply to Thread
Page 1 of 3
1 2 3 LastLast
Results 1 to 30 of 76
Thread
  1. As you all know Doom10 died without notice, so I hope to make videohelp the new home for SMDegrain() and the rest of tools and scripts I made over time. This time I put all my smaller functions here, in one single thread so they become more visible.

    Resizers Functions Pack 4.5

    Here is a pack containing useful functions for resizing.


    LinearResize()

    It revolves around the resizing functions in the Dither Tools but made as easy as a one-liner.
    -It resizes in 32 bit, with lsb_in/lsb_out options.
    -It automatically changes matrix when switching from SD to HD or viceversa. (You can skip resizing and use it only for matrix change in 32bit as well)
    -Allows to resize in a linear fashion.
    -Automatically detects colorspace (RGB or YV12)


    RatioResize()

    This function will resize using only single figures.
    For example;
    resize by half; RatioResize(0.5,"%")
    resize to comply DAR; RatioResize(16/9.0,"DAR")
    resize to comply PAR; RatioResize(10/11.0,"PAR")
    or resize only height/width but keeping scaling proportions; RatioResize(480,"adjust2h")
    I use it more like a visual calculator to get the values and ultimately input those in the above LinearResize()


    PadResize()

    it pads or crops according.

    You want to chain in your video images of different sizes but don't want to resize/degrade them, use PadResize() to conform them to a fixed resolution.

    Maybe you want to compare-preview 2 videos on AvsPmod, to link both tabs they need to match resolution, if you don't want to resize (for comparison purposes for example) you can use PadResize().


    PadMirror()

    Like Addborders() but mirroring the clip's border


    Dither_addborders8()

    It's basically Dither_addborders16() from cretindesalpes' Dither pack but without the 16-bit part.
    The reason was to use PC range colors like true white or black, great for mask work and whatnot.
    All credit goes to him.


    SpliceResize()

    Not the best of pack, but is here. This one is not really mine, it's only my take on the one found in this post.
    The idea is to resize in bicubic (catmull-rom) for high contrast features, and spline64 for the rest. So you get a ringing free good quality resize. Today you have better alternatives, like using the noring setting in the LinearResize() function.


    Resizers Functions Pack 4.5

    Code:
    edit: v4.5 - PadResize() final refactor (mod and rounding issues), also added mirror setting. Script format clean up.
    edit: v4.4 - Fixed PadResize() mod2 issues (refactor). Added Interlacing and cplace options to LinearResize().
    edit: v4.3 - Fixed PadMirror().
    edit: v4.2 - Changed default colors for Dither_addborders8()
    edit: v4.1 - Integrated modulo compliant values and mod parameter to PadResize().
    edit: v4.0 - New functions added; Dither_addborders8(), PadMirror(). Also added the "color" parameter to PadResize().
    edit: v3.2 - Fixed "noring" ternary, had it swapped. Also added annotation of noring limit of up to x3 scale difference.
    edit: v3.1 - Passed the chroma kernel setting to the inner functions of matrix conversion.
    edit: v3.0 - New function added; PadResize()
    edit: v2.2 - Removed one stupid redundant function in LinearResize().
    edit: v2.1 - missed to automatize curves definitions for the linear settings.
    edit: v2.0 - major overhaul. Fixed mod sizes roundings. Also better handling of color matrix conversions, etc etc etc
    edit: v1.2 - fixed code related to mod values, and optimized code a bit.
    Last edited by Dogway; 21st Sep 2015 at 12:02.
    Quote Quote  
  2. Masks Pack 2.3


    This is a set of functions related to masks, so localized filtering will be able, giving you finer control on how and where to filter or protect certain zones.
    Most of them are chunks of codes or concepts from other users over the known forums.


    SatMask()

    The star of the set, by Motenai Yoda and Gavino's help. It allows to pump up saturation where saturation is low, something that is popularly called "Vibrance" in such packages as Photoshop. I also added an option to do the opposite, lower saturation only where is high, called "Dullness". And a third one called "Recover" which recovers saturation from an earlier state of the clip before filtering. It works on 16 bit pipelines as well thanks to the lsb parameter.


    BoxMask()

    This one just creates a boxed square/rectangular mask. It creates the mask so you can use it later with mt_merge() for blending with other clips or versions of the same clip. It has been useful to me in certain occasions where I wanted to hide some obvious artifacts. You can blur the mask at will with blur() so it's not as evident.


    FlatMask()

    cretindesalpes helped me before with this function. It creates a mask for flat areas such as those in animation. Large portions of color areas in the foreground cels (or animated layers in recent animations) will be passed while background and detailed areas will be masked, so you can filter worry-free of losing any detail. Clip merging in this case is integrated, so you just need to define the raw (unfiltered) clip (filtered clip by default is "last")


    LumaMask()

    Didée helped me update his LumaMask procedure to MaskTools2. This will create a simple mask defined by 2 points, "b" where you define up to what value of the clip you want the mask to be black, and "w" where it defines where pure white in the mask will start from. In between a smooth gradation from black to white will be performed. This can be useful in situations where filtering doesn't work nice on dark areas, so you can protect those. Merging ability also is integrated so just define the clip variable to recover darks from and you will be good to go. Another use is to denoise more aggressively fizz noise, common in bright areas.

    Masks Pack 2.3
    Last edited by Dogway; 15th Apr 2015 at 20:12.
    Quote Quote  
  3. (Image Manipulation) Playground Pack


    None of this pack is originally mine. They are all from cretindesalpes except one from Didée (scanlines()). They were scattered code blocks in the forums, and in naked form, so I "recovered" and wrapped them into a function, adding some options, explanations, and eventually fine tuning it along.


    BitDepth()

    It just lowers the bitdepth of your source, so you will start seeing the characteristic "dithering" that conforms images resembling those from gif images. It will also help to understand about the concept of dithering and its possible modes.

    Scanlines()

    If you got some retro game recording it would be a good idea to add some scanlines so pixels blend together (as originally supposed) also as intended and due to scanlines screen brightness will look more dimmed. This function allows to add them in an easy way and with nice looking results, fast and simple. It works in TV range yuv space. By the way, for encoding these I recommend the Touhou tune mode of x264, gives best results for retro games.
    Currently there are more refined (although slower) options like this function from cretindesalpes.

    Dither_average()

    Blends 2 or 3 clips together in high bitdepth linear light. It's a modified version of the example in the Dither tools documentation so it can accept 3 clips, although it is VERY SLOW.

    Dither_LogPreview()

    Correction curve for previewing YUV sources that haven't been correctly converted from LOG space (it'd look as washed out) so contrast will be properly adjusted.


    Playground Pack 1.0
    Last edited by Dogway; 26th Dec 2014 at 01:32.
    Quote Quote  
  4. SmoothContrast() v3.0


    Contrast refers to the difference in brightness and color in an image, this open definition lends to multiple interpretations, like the contrast setting used in common television sets where in order to increase contrast it pushes the curve down from the top and thus clamping the bright values. Or in avisynth ColorYUV(cont_y=20) where it does the same but from the other extreme, clamping the dark values.

    Then there's another concept for contrast more widely used in image editing and processing packages, like Photoshop. It increases contrast by pushing the values in both directions from a given point in the curve, and so forth virtually no losing any pixel data. This procedure draws an "S" type of sinusoidal curve easy to distinguish, and in avisynth is the method used by SGradation(), it is already quite outdated so that's why I made SmoothContrast() which also uses the "S" type of curve for image contrast thanks to the SmoothAdjust plugin developed by LaTo.

    Graph from SGradation()
    Code:
    output luma w/ gamma < 1.0
        ^
     255+                           +
        |                       +
        |                    +
        |                  +
        |                +
        |               +
        |              +
     128+             +
        |            +
        |           +
        |          +
        |        +
        |      +
        |   +
       0+-------------+-------------+> input luma
        0            128           255
    By default it processes in 32 bits just like SmoothAdjust behaves at default, but you can also put it in a 16 bit pipeline by using the lsb= parameter. You can also process saturation only, or in conjunction with contrast. And make use of the "median" parameter to define where you want to perform the contrast from in the curve.

    You will need:
    SmoothAdjust
    Dither (optional)

    I dropped the "local" mode used in previous versions because it wasn't optimal and it could lead to confusion to power users. If you just want to manage gamma in a certain luma range (dark or brights) use SmoothLevels(Lmode= ) instead.

    Enjoy!

    SmoothContrast() v3.0
    Last edited by Dogway; 15th Apr 2015 at 05:55.
    Quote Quote  
  5. Logo v10.1

    Logo() is a simple script that will help you add logos to your video sources in the easiest, fastest and best quality methods.

    You will only need:
    MT version of Avisynth
    masktools2
    ImageSequence

    And add at the end of the script a line like:

    Code:
    Logo("C:\MyLogo.png",x=30,y=30,start=200,end=300)

    It will auto read the alpha channel in case it contains any. It has many more options like loading animated gifs, read documentation, explore and play a bit with the parameters.

    Enjoy : )

    Logo 10.1

    Changelog:
    Code:
    10.1 -Added MT support
         -Defaulted FadeIn FadeOut to 1 second
    10.0 -Optimized (and fixed) modes code
    9.0c -Changed DAR parameter to PAR
         -Added option to copy over logo chroma in screen/multiply modes
         -Minor tweaks
    9.0  -Fixed minor bugs
    8.1  -Corrected bug for logo only first frame
    8.0  -Fixed frame alignment bug
         -Others
    7.1  -Optimized mmod2 function
         -Fixed some bugs for "end" parameter
         -Other minor adjustments
    6.0  -Added DAR flag for anamorphic sources
         -Added watermark "blending" mode
         -Fixed FadeIn/Out bug
         -Other minor adjustments
    5.0  -Fixed and Optimized code (Working Release)
    4.0  -Code rethinking
         -Fixed code
         -Added Over blending mode
         -Added option for matte carving
    3.0  -Automatic alpha detection
         -Fixed and optimized code
         -Changed parameters
         -Added option for animated gifs
         -Added Multiply blending mode
    2.0  -Fixed and optimized code
         -Added alpha option
    1.5  -Added logo masking for images with alpha
         -Added blur parameter
         -Optimized code
    1.0  -Initial release (26-03-2011)
    Last edited by Dogway; 26th Mar 2015 at 12:54.
    Quote Quote  
  6. My slight mods

    Some tiny modifications I made to known scripts.


    LSharpAAF: by Leinad4Mind. I added 8 more anti-aliasing functions to the pack. You can take this script as the last resort for keeping all the AA functions out there so you can call them individually AAA(), or through the script original function LSharpAAF(aatype="AAA") which will do some masking and pre/post processing. Although lately I really like santiagmod(), one of the few I haven't included here, I think it stands nice on its own.
    Some code along the way has also been fixed from the original version.

    LSharpAAF1.55.zip



    FastLineDarken 1.4x MT MOD: by Vectrangle. Added a protection parameter to this line darkener (and thinner as well), in my opinion gives the best and more natural look results after comparing with other ones. By protecting you avoid overdarkening already dark enough lines, that can be the cause for some aliasing and clipping problems. Also a speed suggestion from Didée was added.

    FastLineDarken 1.4x MT MOD.zip




    MCaWarpSharp3: by zee944. This is a bit of all but it can be included in the line enhancer category. It is perfect for those footages that look like seen through a lens (i.e. blurry, chroma aberrations, halo, etc) but it can also work for only blurry footage. It is a bit extreme so use with caution. It's also slow so my modification was mainly for speed improvements although I also reorganized everything a bit.

    MCaWarpSharp3.zip



    QTGMC-3.33d: by Vit. I just included lsb (32 bit precision) option for the mdegrain and dfttest parts so the process beneath should be more accurate. Also added some optimizations.

    QTGMC-3.33d.zip



    MultiSWAR_V2-Beta4: by *.mp4 guy. This is a resizer set of procedures made by *.mp4 guy. I just converted the masktools1 code to masktools2. When I tested it at the time it gave me great results, it was indeed better than naked resizers. It kept all the details (at least psychovisually) with a very natural look, quite good if you are targeting around less than 2x and more than 1.2x resize resolutions. The problem though is the amount of required plugins and the whole set of dizzy parameters.

    MultiSWAR_V2-Beta4.zip
    Last edited by Dogway; 5th Jan 2015 at 10:36.
    Quote Quote  
  7. Hi again, Dogway. I was wanting to check out your LSharpAAF but running "LSharpAAF()" results in:

    Click image for larger version

Name:	LSharpAAFErrorMessage.JPG
Views:	2181
Size:	25.1 KB
ID:	30890

    which I don't understand because I can run "LSFMod()" without issue. I tried renaming "LimitedSharpenFasterMod.avsi" to "LSFmod.v1.9.avsi", per the listed requirements, but I receive the same error message (although I can still run "LSFMod()" sucessfully). I've also tried importing LSFMod in the script, which seems to import OK, but I receive the same error message. I've searched about for an answer but with no success. Do you have any ideas? Thanks.
    Quote Quote  
  8. Works for me. I don't know what can be wrong. Check the paths where LimitedSharpenFaster.avsi is located. There's no such thing as LimitedSharpenFastermod.avsi, that is LSFmod.v1.9.avsi, The function call names are LimitedSharpenFaster() and LSFmod() respectively.
    Quote Quote  
  9. I finally came to that realization, that LimitedSharpenFaster and LSFMod aren't the same thing. Yes, sometimes I'm a bit slow. Anyway, once I added the LimitedSharpenFaster.avsi to my plugins folder all is well. Thanks for the telepathic help, ha ha.

    On a related subject, and actully pertinent to this thread, I'm comparing sharpeners in preparation for encoding my early seasons Simpsons NTSF DVD's. I've tried:

    1) QTGMC (it's built-in sharpening function)

    2) Toon

    3) ToonLite

    4) FastLineDarkenMod

    5) LSFMod

    6) LSharpAAF

    7) LimitedSharpenFaster

    8) MCaWarpSharp


    MCaWarpSharp is easily the best, but a one minute TestClip takes 20 minutes to encode on my fastest set up so it's unfortunately not very practical to use for 200+ 23 minute episodes (unless you know some tricks for speeding it up ). Given your vast experience I'd really be curious for your opinion on which sharpener you think would give the best combination of speed-quality, especially considering the limitations of the source material. I'm shooting for a video bit rate ~1500 Kbps and would be OK with each episode taking a couple of hours to encode. Here's my basic script:

    Code:
    # Set DAR in encoder to 6480 : 4739. The following lines for automatic signalling
    global MeGUI_darx = 6480
    global MeGUI_dary = 4739
    LoadPlugin("F:\[0]StandAloneApps\MeGUI-2500(core)2443(data)0.3.5(libs)[Portable]\tools\ffms\ffms2.dll")
    FFVideoSource("D:\Temp\zSimpTemp\S1.E1-[I-4028].mkv", fpsnum=30000, fpsden=1001, threads=1)
    Threads=4
    SetMTMode(5,Threads)
    # SelectRangeEvery(1000,66)
    SetMTMode(2)
    LoadPlugin("F:\[0]StandAloneApps\MeGUI-2500(core)2443(data)0.3.5(libs)[Portable]\tools\avisynth_plugin\TIVTC.dll")
    TFM(Order=-1).TDecimate(Mode=1)
    #deinterlace
    #crop
    #resize
    #denoise
    QTGMC(FPSDivisor=2,Lsb=True,Preset="Medium",EZDenoise=2,Sharpness=0)
    Add-Sharpener-Here
    I know it's my eyes that count, I'm just thinking that you might know which sharpeners and-or features would be a waste of time and which would really help with regards to this particular source material. Only if you're willing though; otherwise I understand. Thanks.
    Quote Quote  
  10. MCaWarpSharp is highly experimental. It can work very nice on very specific sources but generally won't and not at the lowest settings. All my work on the function was to speed it up at the expense of some quality.

    The best sharpener is not to blur. That's why masking is more important than sharpening details that got blurred in an earlier stage of the script.

    QTGMC's core is nnedi3, it's an antialiaser and hence will smooth out your details.

    This is more or less what I would do checking your source:
    Code:
    # Gibbs noise denoise block
    edge=mt_edge("prewitt",thY1=20,thY2=40).removegrain(17)
    mask=mt_logic(edge.mt_expand().mt_expand().mt_expand().mt_expand(),edge.mt_inflate().mt_inpand(),"xor")
    mt_merge(dfttest(),mask,luma=true)
    
    # overall temporal denoise, could probably be optimized
    smdegrain(tr=2,thSAD=400,contrasharp=20,prefilter=2,refinemotion=true,lsb_out=true,show=false)
    # debanding
    GradFun3(thr=0.55, radius=12, mask=2, smode=1, lsb=true, lsb_in=true, staticnoise=true, y=3, u=3, v=3)
    DitherPost(stacked=true,prot=false,mode=0)
    
    # line darkener and thinner
    FastLineDarkenMOD(prot=6, thinning=0, strength=20)
    aWarpSharp2(depth=3,type=1,blur=4,thresh=128,chroma=2)
    I use the internal smdegrain contrasharp, then line darkener and thinner.
    There's a strong and static Gibbs noise around edges so I created the first block to deal with that, everything is tweakable since I didn't spend too much on values.
    Quote Quote  
  11. Wow, Dogway, thank you so much, really . I just ran this script


    Code:
    # Set DAR in encoder to 6480 : 4739. The following line is for automatic signalling
    global MeGUI_darx = 6480
    global MeGUI_dary = 4739
    LoadPlugin("F:\[0]StandAloneApps\MeGUI-2500(core)2443(data)0.3.5(libs)[Portable]\tools\ffms\ffms2.dll")
    Threads=8
    SetMTMode(5,Threads)
    FFVideoSource("D:\Temp\zSimpTemp\[000000]MeGUITemp\S1.E1-[I-4028].mkv", fpsnum=30000, fpsden=1001, threads=1)
    # SelectRangeEvery(1000,66)
    SetMTMode(2)
    #deinterlace
    LoadPlugin("F:\[0]StandAloneApps\MeGUI-2500(core)2443(data)0.3.5(libs)[Portable]\tools\avisynth_plugin\TIVTC.dll")
    TFM(Order=-1).TDecimate(Mode=1)
    #crop
    #resize
    #denoise
    # Gibbs noise denoise block
    edge=mt_edge("prewitt",thY1=20,thY2=40).removegrain(17)
    mask=mt_logic(edge.mt_expand().mt_expand().mt_expand().mt_expand(),edge.mt_inflate().mt_inpand(),"xor")
    mt_merge(dfttest(),mask,luma=true)
    # overall temporal denoise, could probably be optimized
    smdegrain(tr=2,thSAD=400,contrasharp=20,prefilter=2,refinemotion=true,lsb_out=true,show=false)
    # debanding
    GradFun3(thr=0.55, radius=12, mask=2, smode=1, lsb=true, lsb_in=true, staticnoise=true, y=3, u=3, v=3)
    DitherPost(stacked=true,prot=false,mode=0)
    # line darkener and thinner
    FastLineDarkenMOD(prot=6, thinning=0, strength=20)
    aWarpSharp2(depth=3,type=1,blur=4,thresh=128,chroma=2)

    on my test clip and it looks really good except for some combing. The main reason I was using QTGMC in the first place was because if I only ran the TIVTC script the resulting file had sections of combing (check the 26s mark, when Homer crosses in front of the camera there's combing all across his lower back). Somehow running QTGMC to deinterlace the de-telecined output from the TIVTC script eliminated this combing. Really, run the TIVTC script alone and check the result, then add "QTGMC()" to the script and check the difference. The combing is gone. Would it be possible to reinsert the QTGMC portion of my original script, but with no denoising or sharpening, into the above script to remove the combing? What would you suggest?
    Quote Quote  
  12. Combing happens when inverse telecine fails, this is usual on animation and inconsistent 3:2 patterns. To do this properly it would require something like YATTA, but it involves user interaction.

    If you want something automatic you can use a decomber, QTGMC is a deinterlacer so it's like doing a surgery with a hammer. Use vinverse to decomb. Also added some settings to improve IVTC. Find the correct 'order'.

    Code:
    TFM(order=1,slow=2,pp=0)
    TDecimate(mode=1)
    Vinverse()
    # deshaker
    stab()
    I would also add some deshaker after IVTC, source shakes a bit and defeats the purpose of temporal denoising. Try something like stab().
    Quote Quote  
  13. OK, according to MeGUI's analyzer it's bottom field first, and I've tracked down Vinverse, DePan, DePanEstimate, and Stab. Running

    Code:
    # Set DAR in encoder to 6480 : 4739. The following line is for automatic signalling
    global MeGUI_darx = 6480
    global MeGUI_dary = 4739
    LoadPlugin("F:\[0]StandAloneApps\MeGUI-2500(core)2443(data)0.3.5(libs)[Portable]\tools\ffms\ffms2.dll")
    SetMemoryMax(400)
    SetMTMode(5,8)
    FFVideoSource("D:\Temp\zSimpTemp\[000000]MeGUITemp\S1.E1-[I-4028].mkv", fpsnum=30000, fpsden=1001, threads=1)
    # SelectRangeEvery(1000,66)
    SetMTMode(2)
    #deinterlace
    LoadPlugin("F:\[0]StandAloneApps\MeGUI-2500(core)2443(data)0.3.5(libs)[Portable]\tools\avisynth_plugin\TIVTC.dll")
    TFM(Order=0,Slow=2,PP=0).TDecimate(Mode=1)
    Vinverse()
    # Deshaker
    Stab()
    #crop
    #resize
    #denoise
    # Gibbs noise denoise block
    Edge=MT_Edge("prewitt",thY1=20,thY2=40).removegrain(17)
    mask=mt_logic(edge.mt_expand().mt_expand().mt_expand().mt_expand(),edge.mt_inflate().mt_inpand(),"xor")
    mt_merge(dfttest(),mask,luma=true)
    # overall temporal denoise, could probably be optimized
    SMDegrain(tr=2,thSAD=400,ContraSharp=20,PreFilter=2,RefineMotion=True,Lsb_Out=True,Show=False)
    # debanding
    GradFun3(thr=0.55, radius=12, mask=2, smode=1, lsb=true, lsb_in=true, staticnoise=true, y=3, u=3, v=3)
    DitherPost(stacked=true,prot=false,mode=0)
    # line darkener and thinner
    FastLineDarkenMOD(prot=6, thinning=0, strength=20)
    aWarpSharp2(depth=3,type=1,blur=4,thresh=128,chroma=2)
    on my fast machine took 6m28 seconds for the 1m09s TestClip, and the results are really really good. Seriously, given how the original clip looks the results are pretty amazing. Thanks Dogway . I'll makes some tests adjusting the SMDegrain settings (the only thing I've the slightest clue about, ha ha) and check the results.

    A couple more questions while you're in such a helpful mood .

    1) I'll be using my slow machine for this, so the encode time is doubled. If you were to try and shave some time off the above script with an eye to the speed-quality payoff, what would you do? That is, in order of Least-Quality-Lost-For-Most-Speed-Improvement, what are, for example, the first couple-three tweaks you'd make to the above script?

    2) My normal x264 settings for animated sources are

    Code:
    program --preset veryslow --tune animation --crf 15.0 --deblock 2:1 --ref 12 --rc-lookahead 120 --merange 32 --no-fast-pskip --stitchable --output "output" "input"
    Given the source and your experience, can you recommend changes to speed things up without a noticeable loss of quality?

    Thanks a lot, I really appreciate your help (and I'm really excited to start encoding!).
    Last edited by LouieChuckyMerry; 28th Mar 2015 at 03:41. Reason: It's "Vinverse", not "Vinvers".
    Quote Quote  
  14. There's not much place to shave for speed. Try this line.
    Code:
    SMDegrain(tr=2,thSAD=400,ContraSharp=true,PreFilter=2,RefineMotion=false,Lsb_Out=True,chroma=false, plane=0, hpad=0, vpad=0)
    You can disable "lsb" but probably you shouldn't.

    Encode to lossless, then to x264. It's usually faster than trying to do everything at once.
    Quote Quote  
  15. There's not much place to shave for speed. Try this line.
    Code:
    SMDegrain(tr=2,thSAD=400,ContraSharp=true,PreFilter=2,RefineMotion=false,Lsb_Out=True,chroma=false, plane=0, hpad=0, vpad=0)
    You can disable "lsb" but probably you shouldn't.

    Encode to lossless, then to x264. It's usually faster than trying to do everything at once.
    Quote Quote  
  16. Given how good the results are I figured there wasn't much shaving to be done. I'll try the above and compare it to the original, and I agree that I probably shouldn't disable "lsb", so I won't.

    What lossless codec do you recommend?

    Finally (I swear! ), my MT AviSynth is throwing a fit with this relatively complicated script (my usual script for live action is quite simple). On the now defunct SMDegrain thread on Doom10 you once recommended a version of, if I remember correctly, MT Pipeline to me, but I never had a need to actually try it. Would you pretty please post that link here? Thank you.


    Edit: I just noticed that when I playback any of the test clips with this script (either your first suggestion or with the SMDegrain line altered but the rest the same) the top of the frame "bounces", for lack of a better word. I've been so focused on the details that I didn't notice until now. It's as if the top edge of the picture is attached to a spring and moves up and down for a range of ~10 pixels. Any thoughts? BouncyTestClipResult
    Last edited by LouieChuckyMerry; 28th Mar 2015 at 22:48.
    Quote Quote  
  17. Yes, the bounce is a subproduct of stab(), crop a bit the borders. I use FFV1 for encoding to lossless, you can use lagarith too. I don't think you don't need mp_pipeline for this but in case you want to test check the archived doom10 pages. It's a bit complicated.
    Quote Quote  
  18. Originally Posted by Dogway View Post
    Yes, the bounce is a subproduct of stab(), crop a bit the borders.
    No problem, what's another line to my script .


    Originally Posted by Dogway View Post
    I use FFV1 for encoding to lossless, you can use lagarith too.
    I'll try both. I ran your original suggestion with UtVideo earilier today and it took exactly (within a second, actually) as long x264 (with my settings), but it seemed much more stable.


    Originally Posted by Dogway View Post
    I don't think you don't need mp_pipeline for this but in case you want to test check the archived doom10 pages. It's a bit complicated.
    From my limited experience I need to fiddle about with "SetMemoryMax()" and the "SetMTMode"s. Having only ever used very basic scripts with SMDegrain I've thus far been able to get away without a "SetMemoryMax()". More testing needed...
    Quote Quote  
  19. Ahhh, what would you recommend for a resizer, given the source material? Thanks.
    Quote Quote  
  20. of course, LinearResize(), use default spline36 kernel.
    Quote Quote  
  21. Nice, Spline36 is my default resizer in MeGUI. I ran a cropping test and 4 pixels does the trick but I'm wondering if a multiple of 16 would be better? Also, is there any reason I should resize?
    Quote Quote  
  22. Don't worry with multiple of 16, any size is fine. I usually resize to square pixel (applying proper source PAR), to avoid ambiguity in target files. Stretched pixels only have a meaning on constrained environments with SD formats (DVD, SD broadcast, etc)
    Quote Quote  
  23. Originally Posted by Dogway View Post
    Don't worry with multiple of 16, any size is fine. I usually resize to square pixel (applying proper source PAR), to avoid ambiguity in target files. Stretched pixels only have a meaning on constrained environments with SD formats (DVD, SD broadcast, etc)
    Would you be willing to translate that .
    Quote Quote  
  24. Don't encode anamorphic, the topic is too deep to delve into details.

    Find your source PAR and use it like this:
    Code:
    RatioResize(10/11.0,"PAR")
    Quote Quote  
  25. OK, if I understand correctly from here

    Click image for larger version

Name:	PARChart.JPG
Views:	2098
Size:	46.8 KB
ID:	30962

    you were kind enough to choose the correct numbers in the above line, thanks. A quick test cropping and resizing with the script


    Code:
    # Set DAR in encoder to 6480 : 4739. The following line is for automatic signalling
    global MeGUI_darx = 6480
    global MeGUI_dary = 4739
    LoadPlugin("F:\[0]StandAloneApps\MeGUI-2500(core)2443(data)0.3.5(libs)[Portable]\tools\ffms\ffms2.dll")
    SetMemoryMax(400)
    SetMTMode(5,8)
    FFVideoSource("D:\Temp\zSimpTemp\[000000]MeGUITemp\S1.E1-[I-4028].mkv", fpsnum=30000, fpsden=1001, threads=1)
    SetMTMode(2)
    ### Deinterlace ###
    LoadPlugin("F:\[0]StandAloneApps\MeGUI-2500(core)2443(data)0.3.5(libs)[Portable]\tools\avisynth_plugin\TIVTC.dll")
    TFM(Order=0,Slow=2,PP=0).TDecimate(Mode=1)
    Vinverse()
    ### Deshaker ###
    Stab()
    ### Crop ###
    Crop(8,4,-4,0)
    ### Resize ###
    RatioResize(10/11.0,"PAR")
    ### Gibbs Noise Block ###
    Edge=MT_Edge("prewitt",thY1=20,thY2=40).RemoveGrain(17)
    Mask=MT_Logic(Edge.MT_Expand().MT_Expand().MT_Expand().MT_Expand(),Edge.MT_Inflate().MT_Inpand(),"xor")
    MT_Merge(dfttest(),Mask,Luma=True)
    ### Overall Temporal Denoise, Could Probably Be Optimized ###
    SMDegrain(tr=2,thSAD=400,ContraSharp=True,RefineMotion=True,Plane=0,Lsb_Out=True,PreFilter=2,Chroma=False,HPad=0,VPad=0)
    ### Debanding ###
    GradFun3(thR=0.55,Radius=12,Mask=2,SMode=1,Lsb=True,Lsb_In=True, StaticNoise=True,Y=3,U=3,V=3)
    DitherPost(Stacked=True,Prot=False,Mode=0)
    ### Line Darkener And Thinner ###
    FastLineDarkenMod(Prot=6,Thinning=0,Strength=20)
    aWarpSharp2(Depth=3,Type=1,Blur=4,Thresh=128,Chroma=2)

    resulted in an output at 644*476 (4:3). Does that seem reasonable?

    It's well past my bedtime, so tomorrow I'll test variations of your Shave For Speed recommendations and test different denoising strengths. Ahhh, above I should've typed "what would you recommend for cropping", not "what would you recommend for a resizer". In the process of trying to figure out "RatioResize" I read about "LinearResize" but couldn't figure out how to crop with it. Or is that a really stupid question?
    Last edited by LouieChuckyMerry; 30th Mar 2015 at 23:38.
    Quote Quote  
  26. Hi Dogway, Happy Friday . I've been testing (and testing and testing...) for the last few days and I've just about settled on the following script:


    Code:
    # Set DAR in encoder to 6480 : 4739. The following line is for automatic signalling
    global MeGUI_darx = 6480
    global MeGUI_dary = 4739
    LoadPlugin("F:\[0]StandAloneApps\MeGUI-2500(core)2443(data)0.3.5(libs)[Portable]\tools\ffms\ffms2.dll")
    #SetMemoryMax(200)
    #SetMTMode(5,4)
    FFVideoSource("D:\Temp\zSimpTemp\[000000]MeGUITemp\S1.E1-[I-4028].mkv", fpsnum=30000, fpsden=1001, threads=1)
    #SetMTMode(2)
    ### Deinterlace ###
    LoadPlugin("F:\[0]StandAloneApps\MeGUI-2500(core)2443(data)0.3.5(libs)[Portable]\tools\avisynth_plugin\TIVTC.dll")
    TFM(Order=0,Slow=2,PP=0).TDecimate(Mode=1)
    Vinverse()
    ### Deshaker ###
    Stab(Mirror=15)
    ### Crop ###
    Crop(8,0,-8,0)
    ### Resize ###
    RatioResize(10/11.0,"PAR")
    ### Gibbs Noise Block ###
    Edge=MT_Edge("prewitt",thY1=20,thY2=40).RemoveGrain(17)
    Mask=MT_Logic(Edge.MT_Expand().MT_Expand().MT_Expand().MT_Expand(),Edge.MT_Inflate().MT_Inpand(),"xor")
    MT_Merge(dfttest(),Mask,Luma=True)
    ### Overall Temporal Denoise, Could Probably Be Optimized ###
    SMDegrain(tr=2,thSAD=600,ContraSharp=True,RefineMotion=True,Plane=0,Lsb_Out=True,PreFilter=2,Chroma=True)
    ### Debanding ###
    GradFun3(thR=0.55,Radius=12,Mask=2,SMode=1,Lsb=True,Lsb_In=True, StaticNoise=True,Y=3,U=3,V=3)
    DitherPost(Stacked=True,Prot=False,Mode=0)
    ### Line Darkener And Thinner ###
    FastLineDarkenMod(Strength=20,Prot=6,Thinning=0)
    aWarpSharp2(Blur=4,Type=1,Depth=3,Chroma=2)

    I've decided that MT AviSynth is far too unstable on my slower (dual-core) setup, but running 2 encodes simultaneously achieves ~100% CPU usage and takes ~9 hours to complete, so it's reasonable for overnight processing. I've also modified "Stab()" to "Stab(Mirror=15)" so the edges don't "bounce", and cropping 8 pixels from the left and right cleans up the source's sides and outputs a nice 640*480 file after "RatioResize(10/11.0,"PAR")". In addition, I've decided that upping the thSAD to 600 removes the detail edge noise that 400 wasn't cleaning without noticeable blurring, which makes for a better looking finished product. Finally, I rearranged the settings for FastLineDarkenMod and aWarpSharp2 so they're in the proper order .

    My only remaining question is if it's possible to reduce what appears to be blocking in large areas of solid color. It's apparent with the bit rate ~2000 Kbps but I'm not sure if it's actually blocking because I tested various deblock settings and there didn't seem to be any change. I don't know if this is actually compressed noise, a result of the GradFun3 settings, or, well, I don't know. Do you have any thoughts? Really truly thanks for all your help; the 2 test encodes I ran last night look amazing given the source material. I just want to try minimizing the blocking before I start full-force encoding. Ahhh, given the result would you tweak any of the above settings?

    Doh!:

    S1.E1-TestClipReEnc[Blocking_]
    Last edited by LouieChuckyMerry; 3rd Apr 2015 at 02:01. Reason: Forgot The Link.
    Quote Quote  
  27. GradFun3 is there for the what seems to be blocking. It's just quantization banding. You can't do much about it if GradFun3 and a thSAD of 600 don't remove it already.
    Quote Quote  
  28. Thanks for your answer, Dogway. Given the quality of the source material I'm beyond pleased at the results with your scrip; the outputs are really really good. Seriously, it's a massive improvement, light years beyond my original ideas. I'll be busy for awhile with the first season but prepare for more ignorant questions in the future . Be well.
    Last edited by LouieChuckyMerry; 3rd Apr 2015 at 20:39.
    Quote Quote  
  29. Next time open a new thread if the scope of your questions are bigger than the thread's topic.
    Quote Quote  
  30. Originally Posted by Dogway View Post
    Next time open a new thread if the scope of your questions are bigger than the thread's topic.
    I actually did, but nobody replied. Then I came here to ask about one of your tools and one thing led to another. Next time I'll stick to my own thread, though. Thanks for your patience.
    Last edited by LouieChuckyMerry; 4th Apr 2015 at 06:19.
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!