VideoHelp Forum

+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. Member
    Join Date
    Oct 2021
    Location
    Poland
    Search PM
    Hello, can someone tell me how to remove those weird bad interlace lines on video that is progressive? Maybe some AviSynth script would help.
    Quote Quote  
  2. Without a short sample of the file you use as source: no
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  3. Member
    Join Date
    Oct 2021
    Location
    Poland
    Search PM
    Here's the short sample of file:
    cnpolandecpnextbumpereliotkid.mp4
    Quote Quote  
  4. Those were caused by re-sizing interlaced video without first deinterlacing. They are horizontal lines, but as you can see, they are much taller than a single scan line and are therefore not "interlace lines."

    They cannot easily be repaired, although I did come up with a way to dramatically reduce the problem when I helped someone years ago over in doom9.org. Here is a link to that thread:

    repair bad deinterlacing

    I never took the extra time to generalize the code into a function, so you'll have to tweak it for your frame rate and resolution.

    [edit] Post #42 in the thread I linked to has the "final" code that I posted. However, remember that it will not work on your clip without tweaking.
    Last edited by johnmeyer; 1st Jan 2022 at 11:34.
    Quote Quote  
  5. something like:
    Code:
    Spline36Resize(640,240)
    AssumeTFF()
    QTGMC(Preset="Fast")
    Spline36Resize(640,480)
    should work. (basically throwing away half of the height)
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  6. You can reduce the damage by only applying the fix to areas where there are comb artifacts.

    Code:
    ###################################################
    #
    # build a mask of areas where there are 
    # alternating horizontal lines
    #
    ##################################################
    
    function CombMask(clip v, int "threshold")
    {
        threshold = default(threshold, 5)
    
        Subtract(v, v.blur(0.0, 1.0).Sharpen(0.0, 0.6))
        GeneralConvolution(0, "
            0  8  8  8  0
           -0 -8 -8 -8 -0 
            0  8  8  8  0
           -0 -8 -8 -8 -0
            0  8  8  8  0", chroma=false, alpha=false)
        mt_lut("x 125 - abs")
        mt_binarize(threshold) # threshold
        mt_inpand()
        mt_expand()
        mt_expand(chroma="-128")
    }
    
    ##################################################
    
    src = LSMASHVideoSource("cnpolandecpnextbumpereliotkid.mp4").AssumeTFF()
    
    combmask = CombMask(src, 5).Blur(1.4).Blur(1.4)
    blurry = Spline36Resize(src, src.width, src.height/3).Spline36Resize(src.width, src.height)
    
    Overlay(src, blurry, mask=combmask)
    Quote Quote  



Similar Threads