VideoHelp Forum
+ Reply to Thread
Results 1 to 26 of 26
Thread
  1. How do you remove the color banding (Moire pattern?) from the video clip?

    This clip is from an upscaled video from the original video which also has this color banding/Moire pattern.

    LR_Moire_pattern.avi
    Quote Quote  
  2. What an ugly job using ai for upscaling.
    The issues of the source should be dealt with !before! using ai for upscaling.
    That said, filters like Small_Deflicker and ReduceFilter and SMDegrain might help. (probably have to be applied multiple times)

    Cu Selur

    Ps.: Attached some examples, just to show the general effect,..
    Last edited by Selur; 29th Apr 2023 at 09:09.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  3. Originally Posted by Selur View Post
    The issues of the source should be dealt with !before! using ai for upscaling.
    ^This

    Otherwise you upscale the problems.
    Quote Quote  
  4. Point taken, thank you. And thanks for the samples.

    But what would be the best script to use to remove (or at least minimize) color banding?

    Thanks.
    Quote Quote  
  5. Depends on what it looked like before upscaling

    Filters dealing with specific problems generally work better at the original scale. Probably some type of chroma denoising, derainbow filters
    Quote Quote  
  6. I agree.

    In the source rainbow denoising smoothing, heavy chroma denoising might help.
    In your sample, that wouldn't be enough. Look at the attachment, I there visualized the Y U V channels of your clip, as you can see the wave like interference is in each channel, so just choma filtering will not be enough.
    So some sort of deflickering/defreq will be needed.

    Cu Selur
    Image Attached Files
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  7. Here is the original video before upscaling and before any processing.

    LR_original_video.avi

    See what you make of this, if you have time.
    Last edited by meeshu; 30th Apr 2023 at 09:00.
    Quote Quote  
  8. This happens if I just apply some heavy temporal chroma denoising (ct = 80) using HQDN3D.
    There are probably tons of other filters that could be used, but that is the first one I tried.

    The main point is, that typical ai filters won't know whether the color flickering is meant to be there or not, so they might do funny things with it.

    Cu Selur

    Ps.: also attached a version where I additionally applied codeformer.
    Image Attached Files
    Last edited by Selur; 29th Apr 2023 at 11:49.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  9. Thanks again for the sample clips.

    The results look pretty good!
    Quote Quote  
  10. Technically this is not color banding neither Moire Pattern - just to point this for someone trying to search information how to deal with color banding and/or Moire Pattern in future.
    Quote Quote  
  11. So, what is the best script for removing this issue with the video?

    Thanks.
    Quote Quote  
  12. I did this:

    Code:
    LWLibavVideoSource("LR_original_video.avi", cache=false, prefer_hw=2) 
    ConvertToYV12()
    # apply a very strong temporal noise reduction filter (and some sharpening) to only the chroma
    MergeChroma(SMDegrain(tr=6, thsad=5000, plane=3, prefilter=3).aWarpSharp2(depth=10))
    The use of a motion compensated temporal noise reduction filter reduces the chroma bleeding during motion. But it's much slower.
    Image Attached Files
    Last edited by jagabo; 29th Apr 2023 at 22:10.
    Quote Quote  
  13. Thanks for the sample script.

    I didn't have the function "LWLibavVideoSource" at first, but managed to locate it and installed the associated dll file (LSMASHSource.dll) within AviSynth+ plugins64+ sub-directory.

    I tried running this script via VirtualDub2 on the entire video clip (73 GB!), but VirtualDub2 seemed to hang with the message that VirtualDub was not responding. I waited for several minutes for something to happen, but nothing appeared to be happening so I quit VirtualDub.

    Is this usual for VirtualDub to take awhile processing a large video clip when running this script?
    Quote Quote  
  14. Is this usual for VirtualDub to take awhile processing a large video clip when running this script?
    Did you check RAM, CPU, drive activity?
    LWLibavVideoSource will create an index of the file inside the system RAM which might take some time depending on the system.
    (maybe better use AviSource)

    @jagabo: (I get why aWarpSharp2 is encapsulated in a MergeChroma, but) why MergeChroma and plane=3, shouldn't plane=3 already limit the filtering to the chroma planes?

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  15. Originally Posted by Selur View Post
    @jagabo: (I get why aWarpSharp2 is encapsulated in a MergeChroma, but) why MergeChroma and plane=3, shouldn't plane=3 already limit the filtering to the chroma planes?
    I originally had SMDegrain processing all planes in YV24. So I had it in inside the MergeChroma(). I later changed it to process only the chroma planes to speed it up. Yes, after that change, I could have put SMDgrain() before MergeChroma(aWarpSharp2(depth=10)).
    Last edited by jagabo; 30th Apr 2023 at 03:52. Reason: clarity
    Quote Quote  
  16. @meeshu: Side note: If you set cs=0 and lt=0 in hqdn3d, it will also only filter the chroma planes, see: http://avisynth.nl/index.php/Hqdn3d
    @jagabo: Ah, okay, thought I missed something.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  17. Comments noted, thanks.

    Using this script -

    Code:
    LWLibavVideoSource("LR_original_video.avi", cache=false, prefer_hw=2) 
    ConvertToYV12()
    # apply a very strong temporal noise reduction filter (and some sharpening) to only the chroma
    MergeChroma(SMDegrain(tr=6, thsad=5000, plane=3, prefilter=3).aWarpSharp2(depth=10))
    I managed to get this script to run, and waited about 15~20 minutes for the pre-processing to complete. Applied this script to the full original video, but the results were poor (according to the side by side view of input and output videos as shown in VirtualDub). So I cancelled the process.

    Next I tried this script on the smaller test video clip (LR_original_video.avi) from the original video. My resulting clip seems (to me) not to be as good as the resulting clip in post #12!?

    LR_original_video_processed.avi

    Comments?
    Quote Quote  
  18. Aside from brightness differences which might be caused by different VUI infos, they look the same to me: https://imgsli.com/MTc0Nzc5
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  19. Originally Posted by Selur View Post
    Aside from brightness differences which might be caused by different VUI infos, they look the same to me: https://imgsli.com/MTc0Nzc5
    Hmmm! They appear to look the same using that interesting image comparator, thanks!
    Quote Quote  
  20. Originally Posted by Selur View Post
    @meeshu: Side note: If you set cs=0 and lt=0 in hqdn3d, it will also only filter the chroma planes, see: http://avisynth.nl/index.php/Hqdn3d

    Cu Selur
    Apparently hqdn3d requires the color space(?) to be of form YUV first before calling the hqdn3d function(?)

    As I am basically a beginner, I would really require a detailed script to include hqdn3d and ConvertTo YUV???? functions.
    Quote Quote  
  21. Here's an example script.
    Code:
    SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
    # loading source: G:\clips\chroma banding\LR_original_video.avi
    # color sampling RGB24@8, matrix: bt601, scantyp: progressive, luminance scale: limited
    AviSource("G:\clips\chroma banding\LR_original_video.avi") # adjust the path
    # current resolution: 640x480
    # filtering
    ConvertToYV12(interlaced=false, matrix="Rec601")
    hqdn3d(ls=0.00,cs=3.00,lt=0.00,ct=80.00) # adjust the settings to yout liking
    # setting output fps to 29.970fps
    AssumeFPS(30000,1001)
    PreFetch(16) # adjust to the number of logical CPU cores your CPU has
    #  output: color sampling YV12@8, matrix: bt601, scantyp: progressive, luminance scale: limited
    return last
    Paths etc. should be adjusted.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  22. Thanks for the detailed sample script!

    Currently running this script on the full original video clip.
    Quote Quote  
  23. I hope you tweaked the parameters a bit,...
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  24. Originally Posted by meeshu View Post
    How do you remove the color banding (Moire pattern?) from the video clip?

    This clip is from an upscaled video from the original video which also has this color banding/Moire pattern.

    Image
    [Attachment 70611 - Click to enlarge]
    jesus christ he looks like issac kleiner. Selur is right, this is one very ugly upscaling job. Also don't upscale before cleaning the video. Also that's analogue tape flickering, in no way connected to banding and moire. I expected to see something along the lines of rainbowing in the sample
    Quote Quote  
  25. Originally Posted by Selur View Post
    I hope you tweaked the parameters a bit,...
    Yes, I did make slight changes and made a test run before committing to processing the entire original video.

    Still processing the video as of this writing, but results look pretty good so far!
    Quote Quote  
  26. Probably best approach will be or FFT filter but frequency of those bars is very close to DC (so it will be very difficult to find them in GUI mode - should be possible to set them in manual mode), alternatively if filter similar to GIMP 'wavelet decompose/compose' exist then on low freq (residual or one higher - depends on decomposition level) wavelet plane even average on frame can be used - it should remove those bars easily without affecting other parts...

    In past there was fftquiver but now seem after FQPlus there is new ManyPlus filter .

    This kind of distortions probably is best to dealt in frequency domain.
    Quote Quote  



Similar Threads

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