VideoHelp Forum




+ Reply to Thread
Results 1 to 16 of 16
  1. Member
    Join Date
    May 2011
    Location
    Sweden
    Search PM
    QTGMC alone can't do a proper job with messed up fields. My main concern is to make the scanlines disappear as much as possible.
    Image Attached Files
    Last edited by elektro; 2nd Nov 2023 at 16:00.
    Quote Quote  
  2. A smooth horizontal panning should would help analyze the problems. But the first thing you need to do is remove the duplicate frames with TDecimate().
    Last edited by jagabo; 2nd Nov 2023 at 17:35.
    Quote Quote  
  3. Member
    Join Date
    May 2011
    Location
    Sweden
    Search PM
    Originally Posted by jagabo View Post
    There are some duplicate interlaced frames which cause backward jumps in motion. TDecimate() gets rid of those first:

    Code:
    LSMASHVideoSource("Aurora - Lollapalooza Chile, Chile, 2023.mp4")
    AssumeTFF()
    TDecimate(Cycle=5, CycleR=1)
    Blur(0.0, 0.25)
    QTGMC()
    A slight vertical blur (while interlaced) cleans up a lot of the inter-field artifacts. Followed by A QTGMC() to deinterlace. There are still missing frames (which can be see as jumps in motion). Some smart-ish motion interpolation should help with that. A smooth panning show whould would help with that.
    Thanks. Additionally I resized down the video frame by 50% to make the artifacts less noticeable.
    Quote Quote  
  4. That script worked for some frames but didn't seem to work for others. That's why I removed it from the earlier post. A sharp, smooth, horizontally panning shot is needed for better analysis.
    Quote Quote  
  5. Member
    Join Date
    May 2011
    Location
    Sweden
    Search PM
    Originally Posted by jagabo View Post
    That script worked for some frames but didn't seem to work for others. That's why I removed it from the earlier post. A sharp, smooth, horizontally panning shot is needed for better analysis.
    I uploaded another clip. That's the best I could find. I'll use those Avisynth commands for the entire recording, so it's important to get them right (to get the best result based on the source video).
    Image Attached Files
    Quote Quote  
  6. I didn't really come up with anything that cleaned up the residual artifacts without damaging the picture too much. But this fixes the motion for the clip in post #5:

    Code:
    ###################################################
    
    function SmoothFPS_RIFE(clip source, int num, int den)
    { 
        source
        z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:l=>rgb:709:709:f")
        Rife(gpu_thread=1, model=9, fps_num=num, fps_den=den, sc=true, sc_threshold=0.12)
        z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:709:709:f=>709:709:709:l")
    }
    
    ##################################################
    
    LSMASHVideoSource("Aurora - Lollapalooza Chile, Chile, 2023-2.mp4") 
    AssumeTFF()
    TDecimate()
    QTGMC()
    # a strong temporal filter here may remove move some residual noise
    SmoothFPS_RIFE(48000*3, 1001)
    SelectEvery(24, 0, 3, 4, 5, 6, 9, 12, 15, 18, 21)
    RIFE is very slow so you might use an alternate frame rate converter, like FrameRateConverter() or InterFrame(). They don't work as well though.

    You may have to change the SelectEvery() arguments as parts of the video have a different "phase" of missing frames.
    Image Attached Files
    Quote Quote  
  7. Member
    Join Date
    May 2011
    Location
    Sweden
    Search PM
    Originally Posted by jagabo View Post
    I didn't really come up with anything that cleaned up the residual artifacts without damaging the picture too much. But this fixes the motion for the clip in post #5:

    Code:
    ###################################################
    
    function SmoothFPS_RIFE(clip source, int num, int den)
    { 
        source
        z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:l=>rgb:709:709:f")
        Rife(gpu_thread=1, model=9, fps_num=num, fps_den=den, sc=true, sc_threshold=0.12)
        z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:709:709:f=>709:709:709:l")
    }
    
    ##################################################
    
    LSMASHVideoSource("Aurora - Lollapalooza Chile, Chile, 2023-2.mp4") 
    AssumeTFF()
    TDecimate()
    QTGMC()
    # a strong temporal filter here may remove move some residual noise
    SmoothFPS_RIFE(48000*3, 1001)
    SelectEvery(24, 0, 3, 4, 5, 6, 9, 12, 15, 18, 21)
    RIFE is very slow so you might use an alternate frame rate converter, like FrameRateConverter() or InterFrame(). They don't work as well though.

    You may have to change the SelectEvery() arguments as parts of the video have a different "phase" of missing frames.
    Thanks. I appreciate your efforts to help. My PC is pretty old and it will take ages to process the entire video. I'd rather prefer to keep the actual frames (no double frame rate, no interpolated frames), just to remove the interlacing artifacts as much as possible even at the cost of reduced picture quality (but not by much). Is this the optimal solution or is there a better way?

    Code:
    LSMASHVideoSource("Aurora - Lollapalooza Chile, Chile, 2023.mp4")
    AssumeTFF()
    TDecimate(Cycle=5, CycleR=1)
    Blur(0.0, 0.25)
    QTGMC()
    Quote Quote  
  8. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    What is the source of this video? DO you have the camera files?
    It's a shame, nice looking video but mangled by somebody who didn't know any better.
    We see that too often on this site
    Quote Quote  
  9. Member
    Join Date
    May 2011
    Location
    Sweden
    Search PM
    Originally Posted by davexnet View Post
    What is the source of this video? DO you have the camera files?
    It's a shame, nice looking video but mangled by somebody who didn't know any better.
    We see that too often on this site
    I have the entire video (1.4GB). It seems like it was recorded from a livestream. That bloody interlacing saved as progressive video ruined the quality, especially in combination with a fairly low bitrate for the AVC format. I'm trying to get rid of the interlacing artifacts. I also have a Brazil video with a much better quality. I collect concert videos and music videos.
    Last edited by elektro; 3rd Nov 2023 at 16:22.
    Quote Quote  
  10. I worked something that cleans up a lot of the residual noise without damaging the picture too badly:

    Code:
    function SmoothFPS_RIFE(clip source, int num, int den)
    { 
        source
        z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:l=>rgb:709:709:f")
        Rife(gpu_thread=1, model=9, fps_num=num, fps_den=den, sc=true, sc_threshold=0.12)
        z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:709:709:f=>709:709:709:l")
    }
    
    ###################################################
    #
    # 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")
    }
    
    ##################################################
    
    LSMASHVideoSource("Aurora - Lollapalooza Chile, Chile, 2023-2.mp4") 
    AssumeTFF()
    TDecimate()
    cmask = CombMask(10).BinomialBlur(3).SelectEvery(1,0,0)
    QTGMC()
    Overlay(last, QTGMC(InputType=2, EZDenoise=10).Blur(0.0, 1.5).aWarpSharp2(depth=10).Sharpen(0.6), mask=cmask)
    SmoothFPS_RIFE(48000*3, 1001)
    SelectEvery(24, 0, 3, 4, 5, 6, 9, 12, 15, 18, 21)
    Here I build a mask of areas where there is combing in the original video. Then I use that mask to overlay a heavily filtered version of the video over just those areas. Normally I would never use QTGMC's EZDenoise with such high settings. But it works well here since we are limiting it to the areas with bad combing artifacts. You can play around with different EZDenoise strengths, and the additional Blur, aWarpSharp, and Sharpen settings.
    Quote Quote  
  11. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    I asked a question about this myself in 2020.
    https://forum.videohelp.com/threads/398436-In-VirtualDub-where-is-the-capture-BITRATE-...on#post2592253

    Your footage seems to have other issues. Was it resized while interlaced?
    Quote Quote  
  12. Yes, his video has interlaced 4:2:0 chroma and was compressed progressive. That has blended the two fields' chroma together. You can see it in panning shots and other motion.

    The video show no signs of having been resized vertically. The artifacts after QTGMC are from the progressive encoding of interlaced content, the too low bitrate, and the blended chroma.

    Then there's the problem of the original 30i video being decimated to 24 fps then frame repeated to 30 fps.

    I don't know if any of this was caused by the OP preparing the sample clip. If so, he should provide a non-reencoded trim from the original he has.
    Quote Quote  
  13. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Thanks for the info jagabo. Your result with the mask overlay is impressive
    Quote Quote  
  14. Member
    Join Date
    May 2011
    Location
    Sweden
    Search PM
    Originally Posted by jagabo View Post
    Yes, his video has interlaced 4:2:0 chroma and was compressed progressive. That has blended the two fields' chroma together. You can see it in panning shots and other motion.

    The video show no signs of having been resized vertically. The artifacts after QTGMC are from the progressive encoding of interlaced content, the too low bitrate, and the blended chroma.

    Then there's the problem of the original 30i video being decimated to 24 fps then frame repeated to 30 fps.

    I don't know if any of this was caused by the OP preparing the sample clip. If so, he should provide a non-reencoded trim from the original he has.
    I posted the entire original clip here (click the first link): https://forum.videohelp.com/threads/412183-Need-advice-how-to-fix-using-Avisynth-this-...if#post2711030
    When I posted samples, I cropped them losslessly with Avidemux.
    Quote Quote  
  15. Originally Posted by elektro View Post
    When I posted samples, I cropped them losslessly with Avidemux.
    They should be fine then.
    Quote Quote  
  16. Originally Posted by davexnet View Post
    Thanks for the info jagabo.
    You're welcome.

    Originally Posted by davexnet View Post
    Your result with the mask overlay is impressive
    Thanks. Using QTGMC like that to denoise is probably not the best choice. Some other spacie-temporal NR might work better. But it ends up looking ok and you don't really notice the residual noise watching the video at 60 fps.
    Quote Quote  



Similar Threads

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