View Full Version : Noisy Witness
Lokean
12th August 2006, 01:58
I recently bought the BBC DVD release of Silent Witness series 1. I have a couple of problems with this source, that I would like to get some input on. I have uploaded two clips for you to check: http://tinyurl.com/jodjo and http://tinyurl.com/rnxhx.
While the DVD cover claims the aspect ratio is 4:3, to my eyes it isn't anything like that. I would say the wall-lamp in the second clip should be round, which leads me to something like a 16:10 AR after cropping. http://tinyurl.com/gdxrb - does that look right to you?
More problematic is the noise (mostly grain, as far as I can see). Ideally I would like to get rid of most of the noise and then also enhance the sharpness. I am not really concerned about compressability. I want to clean this up and make it look as good as possible - within reasonable bounds. I have been playing around with various filters, mostly combinations of RemoveDirt, RemoveGrain and MSharpen, and alternatives like VagueDenoiser and asharp, but gotten nowhere near the quality I would like to see. So what would you recommend for this source?
Pookie
12th August 2006, 06:25
A combination of MVdegrain and SeeSaw will take care of the grain part. You'll need MVTools v1.48 or higher, plus RemoveGrain and Masktools v1.58 and SeeSaw.avs - Double check that you have the latest MVtools from http://avisynth.org.ru/ .
backward_vec2 = last.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = last.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = last.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = last.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
a=last.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400,idx=1)
b = a.RemoveGrain(mode=11) #try mode=25 for sharper or mode=17 for stronger - degrainmedian(mode=1) also works nicely
SeeSaw(a,b, NRlimit=5, NRlimit2=6,Sstr=1.5, Slimit=8, Spower=8, Szp=16,soothet=80)
While the above combination isn't blazingly fast, it does a superior job of grain removal plus maintaining sharpness. These settings should be tweaked to fit your source - you'll find the sweet spot with some testing. Test out the various SeeSaw settings that can calm the image down as well - SootheT, SootheS, Bias. Big thanks to Fizick, Didée, Manao, and kassandro.
source
http://fileserver2.jpghosting.com/images/tn_noisy_98d9da3db18660245b66ac1280c6c785.png (http://fileserver2.jpghosting.com/images/noisy_98d9da3db18660245b66ac1280c6c785.png)
processed
http://fileserver2.jpghosting.com/images/tn_processed_03728c32732269d0df8ae00e0fd75692.png (http://fileserver2.jpghosting.com/images/processed_03728c32732269d0df8ae00e0fd75692.png)
The noise in your first clip looks like Dot Crawl http://en.wikipedia.org/wiki/Dot_crawl
Lokean
12th August 2006, 14:48
Thanks a lot, that does look like a huge improvement. I'll play around with the variables and see how that works on the rest.
MrTroy
12th August 2006, 15:34
While the DVD cover claims the aspect ratio is 4:3, to my eyes it isn't anything like that. I would say the wall-lamp in the second clip should be round, which leads me to something like a 16:10 AR after cropping. http://tinyurl.com/gdxrb - does that look right to you?
I assume the videos you uploaded are unprocessed DVD clips? They appear to be 1.55:1 (BBC's pseudo-widescreen format) in a 4:3 frame - hence the black bars.
Lokean
12th August 2006, 16:39
Yes, they are unprocessed, just the video as it appears on the DVD. I was a bit surprised that it doesn't contain a correct DAR, and I had to fiddle around in my player to get something that looked correct. Reading up on DAR (http://en.wikipedia.org/wiki/Aspect_ratio_%28image%29) now, I find that 14:9 (1.56) is used more often as a compromise between 4:3 TV and 16:9 widescreen. Good to know!
Pookie
12th August 2006, 20:13
Interesting info on the aspect ratio.
BTW, you can almost double your processing rate using MVdegrain1. Using a modified example from the MVtools documentation:
backward_vec2 = last.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = last.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
a=last.MVDegrain1(backward_vec2,forward_vec2,thSAD=400,idx=1)
b = a.DeGrainMedian(mode=1)
SeeSaw(a,b, NRlimit=5, NRlimit2=6,Sstr=1.5, Slimit=9, Spower=9, Szp=16)
It looks quite nice, just not as nice as the top example.
Finally, you can cool things down on heavily grained scenes with the use of ReduceFluctuations(limit=2) from kassandro's ReduceFlicker v0.1 release. Just don't go stronger than limit=2 as it can start smearing beyond that.
It makes a noticeable difference when used sparingly, right before the degraining filter in your script. Not the easiest plugin to find, if you want it I'll upload it somewhere.
Lokean
13th August 2006, 00:02
I've tried out a few things, including your faster version. I found that RemoveDirt improves it quite a bit as well, without negative effect on the sharpness. I've tried a few sharpeners after the denoise filters, but they seem to make things worse rather than better. So I'm thinking of going with this:
RemoveDirt()
backward_vec2 = last.MVAnalyse( isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
backward_vec1 = last.MVAnalyse( isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec1 = last.MVAnalyse( isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec2 = last.MVAnalyse( isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
a = last.MVDegrain2( backward_vec1, forward_vec1, backward_vec2, forward_vec2, thSAD=400, idx=1 )
b = a.DeGrainMedian( mode=1 )
SeeSaw( a, b, NRlimit=5, NRlimit2=6, Sstr=1.5, Slimit=8, Spower=8, Szp=16, sootheT=80, bias=40 )
Pookie
13th August 2006, 01:08
I had the script running at around 2.5 fps on an old 2.4Ghz with 1GB RAM, so it will take app. 10 hrs to process a 1 hour episode. If you have the disk space, you might want to consider saving to Huffyuv AVI, then doing your XVID, 264, or MPEG encoding with the processed AVIs. If you try that, make sure to check the "segment output file" box when saving in VirtualDub. Saving in 2GB segments is a good thing.
Lokean
14th August 2006, 00:49
Sure this is slow. A two-pass encoding of a 49 minute episode took me almost 21 hours. But I'm satisfied with the results, and that's what counts. Thanks again for your help.
Melanchthon
15th August 2006, 01:20
Finally, you can cool things down on heavily grained scenes with the use of ReduceFluctuations(limit=2) from kassandro's ReduceFlicker v0.1 release.
Why the 0.1 release? It looks to be a useful filter, so I'm not asking this just out of curiosity.
Pookie
15th August 2006, 03:48
Purely out of laziness :o Later versions require an additional support plugin to be installed - AVStimer - so it becomes another .dll to have to monitor for updates and potential incompatibilities. The syntax is more complicated as well.
frednerk33
21st August 2006, 08:37
OK thanks Pookie ! (referred from http://forum.doom9.org/showthread.php?p=865853#post865853)
A combination of MVdegrain and SeeSaw will take care of the grain part. You'll need MVTools v1.48 or higher, plus RemoveGrain and Masktools v1.58 and SeeSaw.avs - Double check that you have the latest MVtools from http://avisynth.org.ru/ .
backward_vec2 = last.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = last.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = last.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = last.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
a=last.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400,idx=1)
b = a.RemoveGrain(mode=11) #try mode=25 for sharper or mode=17 for stronger - degrainmedian(mode=1) also works nicely
SeeSaw(a,b, NRlimit=5, NRlimit2=6,Sstr=1.5, Slimit=8, Spower=8, Szp=16,soothet=80)
Um, will it work with Manao's Masktools v2.0a30 or only 1.58 ?
edit: oops, silly me, yes use 1.58, since Manao's Masktools v2.0a30 is MaskTools v2
Source links:
(Manao's Masktools at http://manao4.free.fr/)
(Manao & Fizick mvtools 1.4.10 at http://avisynth.org.ru/mvtools/mvtools.html)
(Manao's (old?) original mvtools 0.9.9.1 http://manao4.free.fr/)
(kassandro's RemoveGrain 1.0 http://home.arcor.de/kassandro/RemoveGrain/)
(SeeSaw 2006.01.02 http://forum.doom9.org/showthread.php?p=758021#post758021 and http://home.arcor.de/dhanselmann/_stuff/)
Pookie
21st August 2006, 10:47
SeeSaw uses v1.58 of Masktools
MVdegrain is part of MVtools 1.4x or higher. Get the latest one, as Fizick has made many improvements to the quality of MVdegrain.
I'd use DegrainMedian(mode=1) for the "b=a.yourdenoiser", ala
backward_vec2 = last.MVAnalyse( isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
backward_vec1 = last.MVAnalyse( isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec1 = last.MVAnalyse( isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1 )
forward_vec2 = last.MVAnalyse( isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1 )
a = last.MVDegrain2( backward_vec1, forward_vec1, backward_vec2, forward_vec2, thSAD=400, idx=1 )
b = a.DeGrainMedian( mode=1 )
SeeSaw( a, b, NRlimit=4, NRlimit2=5, Sstr=1.5, Slimit=9, Spower=9, Szp=16, sootheT=80, bias=40 )
Watch out for halos :)
bkman
21st August 2006, 10:52
If you want to slow it down even more-- I mean increase the quality even more, use fft3dfilter as the b=a.denoiser. :D
frednerk33
21st August 2006, 10:57
Cheers Pookie, will go that a go. As you say, yes use 1.58, since Manao's Masktools v2.0a30 is MaskTools v2
BKMAN, OK will try that too.
Source links:
(Manao's Masktools at http://manao4.free.fr/)
(Manao & Fizick mvtools 1.4.10 at http://avisynth.org.ru/mvtools/mvtools.html)
(Manao's (old?) original mvtools 0.9.9.1 http://manao4.free.fr/)
(kassandro's RemoveGrain 1.0 http://home.arcor.de/kassandro/RemoveGrain/)
(SeeSaw 2006.01.02 http://forum.doom9.org/showthread.php?p=758021#post758021 and http://home.arcor.de/dhanselmann/_stuff/)
(DeGrainMedian 0.8.1 http://avisynth.org.ru/degrain/degrainmedian.html)
Pookie
21st August 2006, 10:58
If you want to slow it down even more-- I mean increase the quality even more, use fft3dfilter as the b=a.denoiser. :D
:D Yeah, you'll have to time this one with a calendar. But if the source is worth it, it's hard to do better.
frednerk33
21st August 2006, 11:03
If you want to slow it down even more-- I mean increase the quality even more, use fft3dfilter as the b=a.denoiser. :D
Hm, what settings would you suggest "in general" for fft3dfilter, to give the "increased quality" over the DeGrainMedian... that maybe too hard to answer I know, depends on the clip etc etc...
Cheers
bkman
21st August 2006, 11:13
Just for basic use you will probably only have to set the sigma parameter. 2-3 for sharp results, and 4-6 for softer.
Pookie
21st August 2006, 11:20
I'd use FFT3dfilter only if you have a lot of chroma noise and therefore set BT=3 to process only the chroma planes. Still, if you read the SeeSaw thread, FFT3dfilter as the b=a.denoiser can result in a washed out target file. If you use it, you may have to increase Saturation with the Tweak command in AviSynth.
Don't rule out DegrainMedian(mode=1) - the way it works with SeeSaw is like Peanut Butter and Jelly.
bkman
21st August 2006, 11:29
I'd use FFT3dfilter only if you have a lot of chroma noise and therefore set BT=3 to process only the chroma planes.
You mean Plane=3. BT controls the temporal block size.
I agree that degrainmedian is usually fine, though, I've just found that fft is a little sharper and more temporally stable with seesaw.
Actually, pookie's original scrip with just removegrain seems to produce the results closest in detail to the original source (not counting noise). degrainmedian and fft3dfilter combined with seesaw will usually result in sharpness past that of the source, which you may or may not want.
Pookie
21st August 2006, 11:30
Whoops, you're absolutely right.:o Plane=3
frednerk33
21st August 2006, 11:40
Great advice. On that basis, I am a little hesitant to try my luck to "increase Saturation with the Tweak command" after a
b = a.FFT3DFilter(sigma=3, plane=4, bt=3, sharpen=0, interlaced=false)
so, in still seeking "sharpness past that of the source" which seems desirable at this point, will probably go with
b = a.DegrainMedian(mode=1)
Lokean
21st August 2006, 13:53
Can we make this work with MultiThreading as well? And how would you go about it? (I have a dual core proc after all...)
Pookie
21st August 2006, 16:04
Only the SeeSaw part (which is pretty fast to begin with). See the last pages of the SeeSaw thread for Syntax. Degrainmedian should work with MT as well, but not MVdegrain.
bkman
22nd August 2006, 11:10
Only the SeeSaw part (which is pretty fast to begin with). See the last pages of the SeeSaw thread for Syntax. Degrainmedian should work with MT as well, but not MVdegrain.
Actually, I've tested MT modes with this script on my single-core (FWIW) PC, and it worked (without error) using SetMTmode(6,2) with almost 100% efficiency, so you might get as high as a 2x speedup with an actual dual-core PC.
Pookie
22nd August 2006, 11:25
Actually, I've tested MT modes with this script on my single-core (FWIW) PC, and it worked (without error) using SetMTmode(6,2) with almost 100% efficiency, so you might get as high as a 2x speedup with an actual dual-core PC.
That's great news. I'll test the same tomorrow and report results.
Lokean
23rd August 2006, 18:09
Which Avisynth version do you use for MT mode?
foxyshadis
23rd August 2006, 18:12
tsp's special compile, based on 2.5.6. See the MT thread.
Lokean
23rd August 2006, 18:15
Any advantages/disadvantages in using the 2.6.0 alpha?
Pookie
24th August 2006, 01:30
Any advantages/disadvantages in using the 2.6.0 alpha?
If you put the MT aware avisynth.dll file in same folder as your encoder, it should pick it up (at least that's how I do it). That eliminates having to copy over the one in the Windows folder.
dunno about 2.60...haven't tried it out yet.
I did go from 3fps to 5-6 via the above settings and putting the MT statement in front of SeeSaw. Initial tests look stable, but I haven't really put it through the rounds.
Also, Fizick updated his MVtools version - seems a bit peppier :)
bkman
24th August 2006, 02:01
Try MT mode 2 also. Supposedly mode 5 and 6 don't really multithread very much.
Lokean
24th August 2006, 13:52
Too bad it doesn't really work for me, it still uses only one core. I guess I need a MT-aware avsproxy then. (I'm using avisynth through avsproxy on wine, so I can feed it to avidemux on a 64-bit Linux system.)
frednerk33
26th August 2006, 08:14
For those with an interest in Pookie's MVDegrain2/SeeSaw type script above, there's test results over at http://forum.doom9.org/showthread.php?p=868048#post868048 PS Is cross-referencing like this allowed ?
G_M_C
4th September 2006, 22:34
Im trying the script today on a clip with a similar kind of noise. I´ve installed everything needed, but i don´t know if i did it correctly because SeeSaw keeps giving me errors.
It keeps saying "There is no function called yv12lutxy". As far as i can tell i' ve altered nothing in any of the scripts etc.
What am i doing wrong ?
The clip is XviD encoded/yv12.
Pookie
4th September 2006, 23:45
That error message is related to Masktools. Try this version:
http://manao4.free.fr/MaskTools-v1.5.8.zip
G_M_C
5th September 2006, 10:12
That error message is related to Masktools. Try this version:
http://manao4.free.fr/MaskTools-v1.5.8.zip
Thx :)
I'll try this as soon as i come home from work !
markrb
15th November 2006, 03:10
If you wouldn't mind I could use some basic guidance as what exactly I do escapes me.
I have Avisynth 2.56a and all the dll's and the seesaw script are in the plugins folder.
If I have a basic avs file of:
DGDecode_mpeg2source("D:\ent\VTS_02_1.d2v",info=3)
ColorMatrix(hints=true)
How do I add the original Pookie function/script to use?
Do I save it as an avs and load it as a function or do I simply add the text right at the end of the avs file?
Programming of any sort is not my strength.
Thanks,
Mark
Hey I am not as thick as I thought I was. I actually got it to work.
Now to see how it works on my source.
Pookie
15th November 2006, 03:48
How do I add the original Pookie function/script to use?
.
Thanks. Not exactly original - I just combined two sets of documentation examples to create an incredibly slow degrain script that maintains a bit of sharpness.:D That's the cool part of Avisynth - there are tons of recipies for video enhancement.
Skelsgard
20th November 2006, 22:34
I´m using Pookie´s method of SeeSaw + RemoveGrain/DegrainMedian and it couldn´t work better for me.
The problem now is that I have a movie that oddly presents "progressive" cyclic noise, and it´s been bothering me since I bought it.
In a 3 frame sequence, the noise goes from almost non in the 1rst frame to heavy in the 3rd one. And again.
The denoising works like a charm but the problem is that I would need to adjust the settings for every frame to get a consistent noise removal throughout the movie. Something like low stregth filtering for the first frame, medium for the 2nd one, and heavy for the 3rd one. And to apply this pattern in a cyclic way.
Not being an expert user of Avisynth myself, I wonder if there´s any way to achieve this with scripting.
Cheers.
Pookie
21st November 2006, 00:44
Hmm, that's kind of like the "Reverse-Seesaw" (SawSee?). Post a 10-15 sec clip somewhere. Could it be some weird Telecine problem?
Skelsgard
21st November 2006, 15:30
Here´s a 3 second clip of the movie with and without DegrainMedian+SeeSaw.
Encoded with Avisynth + MeGUI in X264 HQ settings, remuxed to AVI so the noise cycle can be viewed in VirtualDub.
No Telecine or Interlacing as the movie is PAL (as I´m already trying to clean it, I take the chance to convert it to NTSC all at once). I can post the original 720x576 frame if needed but it´s not very different from the resized one (Lanczos4Resize(720,480)).
Without Degrain+SeeSaw:
http://www.badongo.com/vid/242873
With:
http://www.badongo.com/vid/242874
Some pics to show the 3 frame cycle noise:
http://img297.imageshack.us/img297/6498/bsns01po0.jpg
http://img176.imageshack.us/img176/7320/bsns02dp6.jpg
http://img82.imageshack.us/img82/1473/bsns03rr5.jpg
Cheers.
Pookie
21st November 2006, 18:23
That looks like the h264 encoder's built in noise reduction struggling with a tough source. The (mostly) chroma noise is on every frame, it is just being smoothed on some. That 1-2-3 pattern looks like motion estimation/compensation during the transcode. I'll bet the original Mpeg2 has the same heavy chroma noise on each frame.
You can reduce it by using fft3dfilter(plane=3) with a strong sigma value. ReduceFluctuations will help mask it as well. I'd try something like:
a=last.mvdegrain..
b=a.FFT3DFilter(sigma=4,plane=3,bw=32,bh=32,bt=3,ow=16,oh=16,degrid=1).Reducefluctuations(limit=1)
SeeSaw(a,b,......)...
BTW, check out Fizick's 1.62 version of MVTools that reduces some of the luma related flickering during scene fades.
backward_vec2 = last.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = last.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = last.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = last.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
a=last.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400,idx=1)
Skelsgard
21st November 2006, 22:35
The pics are prior to compression to H264.
Here a sample of the MPEG-2 original file.
http://www.badongo.com/vid/243091
Cheers.
Pookie
21st November 2006, 23:39
Okay, looks like a bad transfer from NTSC to PAL. I'll take a look, but perhaps our PAL experts can chime in on this one ?
Yup, it can be brought back to original 23.976 fps, then degrained. Restore24 or Crestore?
Edit:
Results of bringing it back to NTSC with Restore24 and MVdegrain/SeeSaw - the strobing grain is gone, but R24 needs some settings invoked to fix a bit of jerkiness (my fault, not the script's). This restoration combination will have to be timed via calendar.
Other option - Keep it at PAL resolution, then add grain/noise to the image to mask the strobing. You can then hit it with noise reduction filters and the results will look more balanced. Or don't denoise it at all after you've added the grain.
http://www.bestsharing.com/files/ms001177725/b-test.zip.html (18MB h264 examples of both)
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.