VideoHelp Forum




+ Reply to Thread
Results 1 to 4 of 4
  1. Member
    Join Date
    Nov 2025
    Location
    Unites States of America
    Search Comp PM
    Hello!
    I'm trying to properly deinterlace this source using QTGMC (Since every other deinterlacer failed me), it's giving me difficulties and I don't know what to do.
    I've been trying really hard to get the best results as possible by testing out the commands in QTGMC and comparing the two to see if it works better or not, which some did help a little bit, but now I think I'm stuck in a dead end because I haven't figured out to improve any more of the deinterlacing, Which is why I'm reaching out in this forum to see if anyone here could help.
    Just a heads up that probably why I haven' gotten good results on deinterlacing is that because the progressive frames have this weird field separation (Look closely at the outlining)
    Image
    [Attachment 94251 - Click to enlarge]

    These frames that have them only shows up during movement, when it's a static frame for about a second it doesn't show up anymore.
    This is the current script I have right now.
    Code:
    clip = core.vivtc.VFM(clip, 1)
    clip = core.vivtc.VDecimate(clip)
    clip = havsfunc.Vinverse2(clip)
    clip = havsfunc.Vinverse2(clip)
    clip = havsfunc.Vinverse2(clip)
    clip = havsfunc.QTGMC(clip, TFF=True, Preset='Placebo', FPSDivisor=2, TR0=2, TR1=2, TR2=3, Rep0=1, Rep1=0, Rep2=5, NNSize=2, NNeurons=4, EdiQual=2, Sharpness=0.0, GrainRestore=0.4, NoiseRestore=0.2, StabilizeNoise=True, ProgSADMask=25.0)
    Here's the description on my script:
    Because this source is anime/animated, it's actually 23.976fps, so I decimated the source with VFM, Vinverse2 seems to fix some of the weird field separation issue I mentioned earlier (I never actually messed around with the commands, so I might get better results if I get help with that as well), and it seems that InputType=0 for QTGMC works better than InputType=2/InputType=3, ", TR0=2, TR1=2, TR2=3, Rep0=1, Rep1=0, Rep2=5" for some configuration, ", NNSize=2, NNeurons=4, EdiQual=2" less compression caused by NNEDI3, I used no sharpening because it's unnecessary, "GrainRestore=0.4, NoiseRestore=0.2, StabilizeNoise=True", I like to keep my noise & grain.
    If there's anything you can do to improve this script or any tips I can try, please give me a comment, thank you!
    Image Attached Files
    Quote Quote  
  2. Looks like someone messed up converting and upscaling and deinterlacing source and then reinterlaced it, but saved it as progressive video.

    Because this source is anime/animated, it's actually 23.976fps
    I doubt that. Seems more like 12000/1001.

    I would probably use:
    Code:
    clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_TOP) # scan type: top field first
    clip2clip = clip
    clip2clip = qtgmc.QTGMC(Input=clip2clip, Preset="fast", TFF=True, FPSDivisor=2)
    # Deinterlacing using TIVTC
    clip = core.tivtc.TFM(clip, clip2=clip2clip)
    clip = core.tivtc.TDecimate(clip, mode=7, rate=11.98890, dupThresh=0.04, vidThresh=3.50, sceneThresh=15.00) # new fps: 11.9889
    for deinterlacing
    then I would crop,
    Code:
    clip = antiAliasing.santiag(clip, strh=3, strv=3, type="sangnom", aa=128)
    for some anti-aliasing and
    Code:
    clip = degrain.TemporalDegrain2(clip, degrainTR=3, degrainPlane=4, postFFT=0, fftThreads=10, DCT=1)
    to address the line flickering and degrain.
    If you want to avoid the degrain in other areas aside from the lines,
    Code:
    clipMask = clip
    clipMask = core.resize.Bicubic(clip=clipMask, format=vs.GRAY8, range_in_s="limited")
    clipMask = core.std.Prewitt(clip=clipMask)
    for i in range(2):
      clipMask = core.std.Maximum(clipMask)
    clipMask = core.std.ShufflePlanes(clips=[clipMask], planes=[0], colorfamily=vs.GRAY)
    clipFiltered = clip
    # removing grain using TemporalDegrain2
    clipFiltered = degrain.TemporalDegrain2(clipFiltered, degrainTR=3, degrainPlane=4, postFFT=0, fftThreads=10, DCT=1)
    # Resolution: clip: 1080x1080 and clipFiltered: 1080x1080 and clipMask: 1080x1080
    # Color: clip: YUV420P8 and clipFiltered: YUV420P8 and clipMask: GRAY8
    # Merging: clip and clipFiltered based on clipMask
    clip = core.std.MaskedMerge(clip, clipFiltered, clipMask) # PrewittEdgeMask
    seems to work fine.
    full script I used: https://pastebin.com/aqsLFKvR

    Depending on personal taste on could also use some line darkening (i.e. with proToon).

    The problem with that approach is that you still end up with frames like:

    Only way to fix something like this, that comes to mind, would be do lower the resolution (descale) and upscale again, but since you wanted "to keep my noise & grain", this should only be done to the fields and only to the to the pixels around the lines and then sharpen the lines.
    => seems to be too much hassle for me now, but that would be something you can look into

    Don't think there is any classic filter that can fix something like:

    there are quite a few of these messed up interpolation deinterlacing frames in 'high action' shots.

    Cu Selur
    Image Attached Files
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  3. Member
    Join Date
    Nov 2025
    Location
    Unites States of America
    Search Comp PM
    Originally Posted by Selur View Post
    I doubt that. Seems more like 12000/1001.
    Nope, the native fps is 23.976, I already tested that out.

    I'm not a fan of these scripts you've recommended, and I don't need Santiag, it's not my favorite AA (Plus I'm focusing on the deinterlacing for now)
    I was thinking if someone could help remove more of that bad deinterlacing with Vinverse2 I mentioned.

    Originally Posted by Selur View Post
    Depending on personal taste on could also use some line darkening (i.e. with proToon)
    Nah, that's not necessary.

    Originally Posted by Selur View Post
    Only way to fix something like this, that comes to mind, would be do lower the resolution (descale) and upscale again, but since you wanted "to keep my noise & grain"
    That's not what I meant by "keeping the noise & grain" I didn't want QTGMC to have any noise & grain removal.
    Quote Quote  
  4. Nope, the native fps is 23.976, I already tested that out.
    Then I would recommend:
    Code:
    clip = core.tivtc.TFM(clip, blockx=4, blocky=4, MI=16)
    clip = core.tivtc.TDecimate(clip) # new fps: 23.976
    (I don't like it due to the tons so duplicate frames.)
    with the masked TemporalDegrain2
    script: https://pastebin.com/bJVx3Vr2

    Decreasing the block size of TFM fixes most of the issues.

    Cu Selur
    Image Attached Files
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  



Similar Threads