Log in

View Full Version : Recommend denoise filters...


orion44
1st May 2020, 17:25
I'm about to start backing up my DVD movie collection, and I would like to remove noise on some of these movies.

There's a lot of denoise filters to choose from here:

http://avisynth.nl/index.php/External_filters#Denoisers

Which denoisers would you recommend?

videoh
1st May 2020, 17:26
Depends on the type of noise. Can you post a typical sample that you think needs denoising?

StainlessS
1st May 2020, 22:56
Well as VH said above.

But my fav for pretty much any clip is this one[McDegrainSharp]:- https://forum.doom9.org/showthread.php?p=1737045#post1737045

Frames=1, csharp about 0.33 (although default 0.6 aint bad at all, but maybe a bit too sharp for your taste, check it outl).
Can also set limit if you like [limit amount of change to sharpened original pixels].
[Its a pretty good 'one size fits all' with sharpening if required, if you want automatic denoise without human intervention, otherwise consult VH on each clip :) ]

EDIT:
If you dont mind a larger encoded file, maybe also like to follow McDegrainSharp with

NonlinUSM(z=3, pow=1.1, str=0.25, rad=9)

where str between about 0.25 and 0.33, for local contrast enhancement, not denoise but for seemingly better detail.
Maybe try with/without McDegrainSharp() sharpening.

johnmeyer
2nd May 2020, 05:05
Every video requires different denoising. And then, once you have chosen a denoiser, you have to tune it for each video. If you are really serious, you tune it for each section. All of this is required because noise is sometimes colored (chroma noise), sometimes black and white. Sometimes it is small "grains" or dots, sometimes it is blotchy, from low bitrate encoding. Most of the time it is worse in shadows, but sometimes it can be all over.

I can go on for many more paragraphs, but the point is, as everyone else has said, there is no "one size fits all" noise reduction filter or technique.

Forteen88
2nd May 2020, 08:05
If you try out the TemporalDegrain2-filter, and don't like the aggressive denoising it does, set it to,
TemporalDegrain2(grainLevel=false)

Here are some screenshot-comparisons for TemporalDegrain2-filter,
https://forum.doom9.org/showthread.php?p=1898989#post1898989

Sharc
2nd May 2020, 08:36
I'm about to start backing up my DVD movie collection, and I would like to remove noise on some of these movies.

There's a lot of denoise filters to choose from here:

http://avisynth.nl/index.php/External_filters#Denoisers

Which denoisers would you recommend?

What is your primary reason for 'denoising'?
- Improve compressability / reducing the file size? -> Filter strength vs detail retention
- More pleasant for viewing? -> becomes very subjective
- Fixing bad transfers (blends, compression artifacts like blocks, halos, dotcrawl etc.) -> requires specific filters

Also, DVD footage may be progressive, interlaced or telecined -> apply the filters (spatial? temporal? spacial-temporal?) correctly. The footage may have to be preprocessed accordingly.
As has been said, 'it depends .....'. Denoising is generally very laborious, just considering the settings which each filter offers. The default values are normally a good start though.

I made good experience with dfttest and/or SMDegrain, although the specific DVD may request something else.
Also, you may want to just apply QTGMC. It has built-in denoising functions with settable strengths.

Good luck :)

orion44
2nd May 2020, 13:02
I think I'll avoid using denoisers for now, it just seems too complicated.

But I'd still like to learn about the different types of noises that exists, and which denoisers are suitable for each type of noise.

Are there some resources you could recommend where a person can learn about all this, or is this too complicated for a person who is not an
engineer or an encoding expert?

Boulder
2nd May 2020, 13:16
I think I'll avoid using denoisers for now, it just seems too complicated.
Nah, it is simpler than you think if you don't go overboard. Most of the time, you'll be working against film grain or compression-related noisiness.

I would start with MCDegrainsharp like StainlessS suggested. Learn how to use Interleave (it's simple as well) to create a before-after view in your script, easier to tune the parameters like bblur, csharp and limit in case of MCDGS.

Groucho2004
2nd May 2020, 13:36
I think I'll avoid using denoisers for now, it just seems too complicated.If you have a contemporary graphics card I can recommend KNLMeansCL() (https://forum.doom9.org/showthread.php?t=171379). Very simple to use and very good.

Boulder
2nd May 2020, 13:40
If you have a contemporary graphics card I can recommend KNLMeansCL() (https://forum.doom9.org/showthread.php?t=171379). Very simple to use and very good.

I agree, that's one very good option as well. And fast too if you have a fast GPU.

StainlessS
2nd May 2020, 14:19
You can create script templates for DGIndex, I have some for Interlaced, some for Progressive [after deciding in DGIndex what it is, not by Interlaced flag (which lies) but by sight].
If Interlaced flag [when playing in DGIndex] says that its Progressive, then it almost certainly is, but if says Interlaced, then could be either.

Here is simple DGIndex Template [no progreesive/interlaced stuff in it].


Function GetFilenameExtension(String fn) {
fn=fn.RevStr i1=fn.FindStr("\") i2=fn.FindStr("/")
i=(i1==0) ? i2 : (i2==0) ? i1 : min(i1,i2)
fn=(i>0) ? Fn.LeftStr(i-1) : fn
i=fn.FindStr(".")
Return (i>0)?fn.LeftStr(i).RevStr:""
}

################################################################################
### Filled in by DGIndex when using as DGIndex Template
VideoFileName ="__vid__"
AudioFileName =LCase("__aud__")
AudioDelay =Value("__del__")
################################################################################
MPEG2Source(VideoFileName)

AudioExt=GetFilenameExtension(AudioFileName)

Audio= (AudioExt==".ac3") ? NICAC3Source(AudioFileName,channels=2,DRC=0)
\ : (AudioExt==".mpa"||AudioExt=="mp1"||AudioExt==".mp2"||AudioExt==".mp3") ? NicMPG123Source(AudioFileName,Normalize=False)
\ : (AudioExt==".wav") ? RaWavSource(AudioFileName)
\ : (AudioExt==".dts") ? NicDTSSource(AudioFileName)
\ : 0

Assert(!isInt(Audio),"NO AUDIO")

(!isInt(Audio)) ? AudioDub(Audio).DelayAudio(AudioDelay).Trim(0,0) : NOP # Trim, chop/add audio to length

(!isInt(Audio) && AudioRate() <> 44100) ? ResampleAudio(44100) : NOP
#(!isInt(Audio) && AudioRate() <> 48000) ? ResampleAudio(48000) : NOP
#(!IsInt(Audio) && (AudioRate() <> 44100 && AudioRate() <> 48000))?ResampleAudio(44100) : NOP
#(!IsInt(Audio))? ConvertToMonO().ResampleAudio(44100) : NOP

Forteen88
2nd May 2020, 14:22
Oh, I read now that your source is DVD.
This filter should be good for more compressibility for the encodes,
http://avisynth.nl/index.php/SPresso

"SPresso was not designed for 1080p processing/encoding; due to its 3x3 kernel it works better on standard definition (SD) content like DVDs and possibly on 720p."
And I don't know how well it denoises.

orion44
2nd May 2020, 18:19
Is there a way in AviSynth to quickly compare the same video with different filter settings (before/after)?

Boulder
2nd May 2020, 18:37
Interleave(original, filtered)

If you only load the source and then denoise, you could use something like this:

DGSource("clip.d2v")
denoised=yourfilteringhere
Interleave(last,denoised)

StainlessS
2nd May 2020, 21:54
Boulder Interleave is good, probably all you need.

Here a weird before & after somebody wanted.

Function SplitTheDiff(clip a, String Filters, Bool "Order",Bool "Alt", Bool "Show", Bool "Amp",Float "Displace") {
/*
SplitTheDiff() by StainlessS @ Doom9, http://forum.doom9.org/showthread.php?p=1725525#post1725525
SplitTheDiff(clip a, String Filters, Bool "Order"=True,Bool "Alt"=False, Bool "Show"=False, Bool "Amp"=True,Float "Displace"=2.0/3.0)
Based on BeforeAfterDiff by Corran which was based on BeforeAfter by AbsoluteDestiny & Corran.

Filters, filters used to see differences before and after their application eg "Blur(1.58)".
Order, Default True. Specifies if the filtered footage will be on the Top (default true=Top if Alt=Default False or Left if Alt= True).
Alt, Default False. Default False = Before and After are top and bottom half of frame otherwise Left and Right of frame.
Show Default False. True Enables Difference layer.
Amp Default True. True Enables Amplify Difference Layer.
Displace Default = 2.0/3.0 (0.0 -> 0.666, silent limiting). Slides difference layer horizontally (if Order==True) or Vertically if
Order==False. To center align Difference Layer, Displace=1.0/3.0 (Difference Layer is 1/3 of X-Dimension when order=True, or
Y-Dimension when Order=False.
eg, SplitTheDiff(filters="""deen("a3d",4)""",Order=True,Alt=False,Show=True,Amp=False,Displace=1.0/3.0).
*/
Assert(Filters!="","SplitTheDiff: We need a Filters String")
Order = Default(Order, True) Alt = Default(Alt, False)
Show = Default(Show, False) Amp = Default(Amp, True)
Displace = Min(Max(Float(Default(Displace, 2.0/3.0)),0.0),2.0/3.0)
Dim = (Alt) ? a.Height : a.Width Div3 = Dim/12*4
placement = Min(Max((Int(Displace*Dim)+2)/4*4,0),Dim - Div3)/4*4
Try {b = Eval("a."+Filters)} Catch(em) {Assert(False,"SplitTheDiff: Error evaluating Filters string" + Chr(10) + em)}
lineH = BlankClip(a,color=$FFFFFF).Crop(0,0,(Width(a)),2)
lineV = BlankClip(a,color=$FFFFFF).Crop(0,0,2,(Height(a)))
ccx=(!Alt)?placement:0 ccy=(Alt)?placement:0
ccw=(!Alt)?Div3:0 cch=(Alt)?Div3:0
c = Subtract(a,b).Crop(ccx,ccy,ccw,cch)
c = (Amp) ? c.Levels(127-16, 1.0, 128+16, 0, 255) : c
c = c.Subtitle("Difference" + ((Amp) ? "\n(Amplified)" : ""),x=5,y=5,lsp=0)
c = (!Alt) ? c.Overlay(lineV,x=0).Overlay(lineV,x=Width(c)-2) : c.Overlay(lineH,y=0).Overlay(lineH,y=Height(c)-2)
bcx = (Order&&Alt) ? Width(a)/4*2 : 0 bcy = (Order&&!Alt) ? Height(a)/4*2 : 0
bcw = (!Order&&Alt) ? Width(a)/4*2 : 0 bch = (!Order&&!Alt)? Height(a)/4*2 : 0
ax=(!Alt) ? (placement>=Div3?0:placement+Div3) : ((Order) ? 0 : a.Width /4*2)
ay=(Alt) ? (placement>=Div3?0:placement+Div3) : ((Order) ? 0 : a.Height/4*2)
b = b.Crop(bcx,bcy,bcw,bch).Subtitle("After",x=((!Alt)?ax:0)+5,y=((Alt)?ay:0)+5)
a = a.Subtitle("Before",x=ax+5,y=ay+5)
dcx = (Order&&Alt) ? Width(a)/4*2 : 0 dcy = (Order&&!Alt) ? Height(a)/4*2 : 0
d = a.Overlay(b,x=dcx,y=dcy)
d = (!Alt) ? d.Overlay(lineH,y=Height(a)/2-1) : d.Overlay(lineV,x=Width(a)/2-1)
Return (!show) ? d : Overlay(d,c,x=(!Alt)?placement:0,y=(Alt)?placement:0)
}


Avisource("D:\Parade.avi")
SplitTheDiff(Last,"Blur(1.58).Blur(1.58).Blur(1.58)",Order=True,Alt=False,Show=True,Amp=True,Displace=1.0/3.0)

return last

https://i.postimg.cc/9fPd66ZR/Split-The-Diff-01.jpg (https://postimages.org/)

jpsdr
3rd May 2020, 12:11
Personnaly, i use NeatVideo, but it's not free.

feisty2
3rd May 2020, 12:47
start from a baseline like V-BM3D (which was proposed way back in 2007), if you're not satisfied with the result, try playing with more recent models (mainly neural net based methods)

magnetite
4th May 2020, 18:49
If you try out the TemporalDegrain2-filter, and don't like the aggressive denoising it does, set it to,


Here are some screenshot-comparisons for TemporalDegrain2-filter,
https://forum.doom9.org/showthread.php?p=1898989#post1898989

I used TemporalDegrain2 initially for dot crawl removal, then I modified it to include rainbow denoising.