VideoHelp Forum




+ Reply to Thread
Results 1 to 21 of 21
  1. Hi

    I'am trying to remove some grain. Im not sure, if this is actually grain, but it is often happening on movies with grain, when there is a night-scene. The grain is moving around very hard then and also the grain is big/large. It is super bad, when there is fog in the nigth.

    I have a 10s clip. Look on the lower right corner (first two seconds).

    When i use a degrainer, it does just not work as it should (or as i want)

    Has anyone a tip how i can solve that (without blurrying everything out)? I basically want just black in a black night. But when i degrain i get even "bigger" and harder moving grain than before degrain.

    EDIT: Here is the videoclip: https://uploadnow.io/f/15fZTQ7
    Last edited by Platos; 3rd Apr 2025 at 18:49.
    Quote Quote  
  2. Tip: Luma limit masking

    oh, just noticed, I cropped the video before processing, since I had the crop values of another file still configured
    -> re-uploaded the file


    Image comparision: https://imgsli.com/MzY2NTE2
    Image Attached Files
    Last edited by Selur; 4th Apr 2025 at 07:54.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  3. Member
    Join Date
    Apr 2006
    Location
    United States
    Search Comp PM
    Which video editing software program might you be using?

    If you are wanting to remove digital noise/grain, the Neat-Video plug-in may suit your needs if you using compatible video editing software.

    I use the plug-in extensively [with Sony Movie Studio 12 and Vegas 18/19/20] and am always impressed with how effective the results can be, even with nighttime footage with very noticeable noise.
    Quote Quote  
  4. I use Hybrid as Software. And i don't use Paysoftware

    Originally Posted by Selur View Post
    Tip: Luma limit masking

    oh, just noticed, I cropped the video before processing, since I had the crop values of another file still configured
    -> re-uploaded the file


    Image comparision: https://imgsli.com/MzY2NTE2
    Hmm, when i watch the video it looks quite good, but when i look at the pictures it looks very bad. Don't understand why.

    But can i do that with the mask with hybrid? Does mask mean i have to manuall mask each frame or sth like that or does it do that by itself ?
    Last edited by Platos; 4th Apr 2025 at 08:36.
    Quote Quote  
  5. Hybrid has some basic masking (and other extended) controls, which are usually not shows.
    • Enable 'Filtering->Vapoursynth->Misc->UI->Show 'Masked'-controls. (to see the masking controls)
    • Enable for example 'Filtering->Vapoursynth->Denoise->MC Temporal Denoise' with 'Settings' 'very high'.
    • Enable 'Masked' (LimitMask with Limit 30 and inverted, is the default; adjust settings to your liking)


    Cu Selur

    Ps.: Enabling all the extended controls:

    usually is a bad idea
    Last edited by Selur; 4th Apr 2025 at 12:46.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  6. AviSynth+

    Code:
    LWLibavVideoSource("superkurz.mkv") 
    ConvertBits(10)
    SMDegrain(tr=2, thsad=100, prefilter=6)
    Encoded with ffmpeg, hevc_nvenc 10 bits.
    Image Attached Files
    Quote Quote  
  7. @ Selur: Thanks, i will have a look on it and try to do what you did.

    @ Jagabo: Yes, that is what happens, when you degrain alot (instead of grain it has now heavy "banding" or "blocking"-like artifacts). For me this is more visible than little grain. Maybe it's just in my eyes, but for me it is worse. That's the problem with Degraining: Instead of removing the grain, it makes the "grains" bigger and moving heavier around (expect you degrain so hart, that everything is washed out). I Also found out, that you need to make a super high crf-setting, if you want to have small grains in dark scenes.

    I have to try the masking-thing, but i fear it is very time consuming. So i will just let the grain stay if it is not a fast thing.

    (I already used SMDegrain, not on the video above, but i already tried it.)
    Quote Quote  
  8. About the banding: apply debanding
    About keeping grain: try adaptive quantization

    Cu Selur

    Ps.: if machine learning is an option, DPIR denoise usually works fine on such content.
    Image Attached Files
    Last edited by Selur; 4th Apr 2025 at 16:06.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  9. Originally Posted by Platos View Post
    I basically want just black in a black night.
    You can try something like
    Code:
    v=ffms2("superkurz.mkv")
    mask=mt_binarize(v,threshold=20,upper=true).grayscale().blur(1.5).blur(1.5).blur(1.5).blur(1.5) #play with the threshold value
    black=BlankClip(color=color_black, width=width(v), height=height(v), pixel_type="YUY2")
    res=overlay(v,black,mask=mask,opacity=0.9,mode="blend") #play with the opacity value
    return res
    #return interleave(mask,v,res) #interleave for debugging
    Last edited by Sharc; 5th Apr 2025 at 05:21.
    Quote Quote  
  10. Originally Posted by Platos View Post
    That's the problem with Degraining: Instead of removing the grain, it makes the "grains" bigger and moving heavier around
    Yes, that is how degraining works. Pixels are averaged with the pixels around them, spatially and/or temporally. Small dots are replaced with bigger, longer lasting, less intense dots.

    Originally Posted by Platos View Post
    I Also found out, that you need to make a super high crf-setting, if you want to have small grains in dark scenes.
    The first thing to go with strong video compression is fine grain. It also helps to work/compress in 10 bits (or more) rather than 8 bits.

    Originally Posted by Platos View Post
    I have to try the masking-thing, but i fear it is very time consuming.
    As was shown by Sharc, building a mask based on brightness is pretty simple. I would have used a "smoother" mask, something like:

    Code:
    mask = Tweak(bright=-20, coring=false).Tweak(cont=40.0, coring=false).Invert().Blur(1.0)
    Originally Posted by Platos View Post
    So i will just let the grain stay
    Grain doesn't bother me at all. I wouldn't bother removing it unless I had some other reason (like needing a highly compressed video).
    Last edited by jagabo; 5th Apr 2025 at 12:05.
    Quote Quote  
  11. @Sharc:

    This looks good, but i don't know how to do that in hybrid

    @ Jagabo: I don't like grain, that's why i make it away. But i could live with some rare scenes, where grain is still there. I always remove grain. But what do you mean with fine grain on strong video compression? You mean you would apply fine (small) grain to cover the compression artifacts? Because that's quite difficult, when the artifacts are big and the grain is small.

    Originally Posted by Selur View Post
    About the banding: apply debanding
    About keeping grain: try adaptive quantization

    Cu Selur

    Ps.: if machine learning is an option, DPIR denoise usually works fine on such content.
    Is DPIR somehow possible with Hybrid (that i can do all in one encoding)?

    And i tried it with the masking. Works quite well, i have to optimze Debanding-settings, but works. Is the "normal" masking in hybrid the luma limit masking you said ?

    And about Masking: Is it somehow possible to make the masking-thing only on some specific scenes ? So can i somehow say "do that only from 25min30s to 26min30s" for example ?

    (Btw: Hybrid is just the best tool ever. Thank you again)
    Quote Quote  
  12. Is DPIR somehow possible with Hybrid (that i can do all in one encoding)?
    Yes, both the torch- as the vs-mlrt- add-on offer DPIR.
    Is the "normal" masking in hybrid the luma limit masking you said ?
    if you enable the masking controls, the first available mask is the LimitMask which is the luma limit mask that I used.

    Is it somehow possible to make the masking-thing only on some specific scene
    Yes, aside from masking, Hybrid also has 'Apply only to'-controls which allow specifying, frame ranges between which the filter will be applied.

    So can i somehow say "do that only from 25min30s to 26min30s" for example ?
    Hybrid doesn't use time ranges, but frame ranges, but it's possible.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  13. Originally Posted by Platos View Post
    @Sharc:
    This looks good, but i don't know how to do that in hybrid
    In Hybrid you can probably add/insert these filters under Filtering->Avisynth->Custom. I didn't try though.
    Quote Quote  
  14. Originally Posted by Selur View Post
    About the banding: apply debanding
    About keeping grain: try adaptive quantization

    Cu Selur

    Ps.: if machine learning is an option, DPIR denoise usually works fine on such content.
    I'am trying to reproduce your result, but i don't reach it. Could you tell me your filter-settings in hybrid? You already postet the settings of MC Temporal Denoise in a picture, but what Settings are you using with GradFun3Mod Debanding for your uplaoded result?

    And is there actually a reason why you use denoise and not degrain? Because this is an old movie which probably have analog tape. Or is Denoise better for this kind of stuff?

    And i want to degrain the whole movie a bit (standart-settings on SMDegrain + contr.Sharp -1). Could i now use SMDegrain and use MC Temporal Denoise a+ Debanding only for these framerange ? Or would you not recommend to do that ?

    Originally Posted by Sharc View Post
    Originally Posted by Platos View Post
    @Sharc:
    This looks good, but i don't know how to do that in hybrid
    In Hybrid you can probably add/insert these filters under Filtering->Avisynth->Custom. I didn't try though.
    I will try that, but first i have to ask chatgpt what the code means to undertstand it ^^ Or maybe let it "convert" to sth vapoursynth.
    Quote Quote  
  15. afk today,...
    I used MCTemporalDenoise since looking at the source with Retinex applied showed strong artifacts.
    No clue what GradFun3Mod setting I used there. Add Retinex, move it to the bottom of the filter list and then try which GradFun3Mod values (my guess is 1.5) have what effect in the Vapoursynth Preview.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  16. Ok thanks, i will try it.

    How do i make the "apply only to" working? When i check "range" and then write "20-100" it does not work. It says sth from "a-z" but how can i know which frames that are? What do i have to write in there when i want it to apply from Frame 20-100 for example?
    Quote Quote  
  17. How do i make the "apply only to" working?
    You read the tool-tip:
    Each line in the text file or in the mappings string must have one of the following forms:
    'a z'
    Replaces frame a in the base clip with frame z from the filtered clip.
    '[a b] z'
    Replaces all frames in the range [a b] of the base clip with frame z from the filtered clip.
    '[a b] [y z]'
    Replaces all frames in the range [a b] in the base clip with frames in the range [y z] from the filtered clip. If the input and output ranges do not have equal sizes, frames will be duplicated or dropped evenly from [y z] to match the size of [a b]. If y > z, the order of the output frames is reversed.
    and specify your range,...
    Since this uses remap.Rfs, you can also read that documentation. https://github.com/Irrational-Encoding-Wizardry/Vapoursynth-RemapFrames

    When i check "range" and then write "20-100" it does not work.
    Yes, you did use a syntax that is not supported -> read the tool-tip

    It says sth from "a-z" but how can i know which frames that are?
    Use the Vapoursynth Preview.

    What do i have to write in there when i want it to apply from Frame 20-100 for example?
    Code:
    [20 100]
    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  18. Thanks man! Then i will do it now on specific frame-range, thanks.

    I did now manage to find good settings (GradFun3Mod was not good). I used MCTemporalDegrain verylow (masked) + vsPlacebo (Debaning) on default (also masked) + regular SMDegrain default + Contr.Sharp -1 + DetailSharpen Strength 0.7.

    The magic makes vsPlacebo. MCTemporal is not the main thing here. I got always huge Banding and GradFun3Mod could not eliminate it at all no matter what settings i tried (maybe i just don't know how). But it works now.

    On Interest here is the result: https://uploadnow.io/f/YbrmK2V
    Quote Quote  
  19. Happy, you found a solution to your liking.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  20. Member oliverturner's Avatar
    Join Date
    May 2025
    Location
    Ciudad de México, México
    Search Comp PM
    Hey everyone,

    I’ve been following this thread and it’s been really insightful! I’ve also struggled with grain in dark scenes before, especially with older footage, and I wanted to share something I’ve tried that might help. Has anyone experimented with adjusting the luma levels before applying a denoise filter? I found that slightly boosting the brightness in those super dark areas can sometimes make the grain less harsh, and then the denoise filter (like SMDegrain or MCTemporal) seems to work a bit better without causing as much banding. Not sure if it’ll work for everyone, but thought I’d throw it out there! Also, I noticed some of you mentioned masking, does that help with keeping details in brighter areas intact? Sorry if I mispelled anything, I’m typing this late at night!
    Quote Quote  
  21. Also, I noticed some of you mentioned masking, does that help with keeping details in brighter areas intact?
    Yes
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  



Similar Threads

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