View Full Version : Messy DVD source. How to denoise, clean and sharpen?
kenpachi
29th July 2010, 13:56
sample: http://www.speedyshare.com/files/23574893/sample.rar
I have a DVD there is much noise etc. I wonder if it's some sort of TV ArchiveBETA/VHS rip. I've tried some combinations and this is the best results I achieved (below). Is there a better way to treat this video? I don't want to use too strong DeSpot because of artifacts especially while motion. Also, I want to keep sharpening but I've noticed it remarks some blocking (watch cheek bones carefully).
mpeg2source(".\sample.d2v") + mpeg2source(".\sample2.d2v") + \
mpeg2source(".\sample3.d2v") + mpeg2source(".\sample4.d2v") + \
mpeg2source(".\sample5.d2v") + mpeg2source(".\sample6.d2v") + \
mpeg2source(".\sample7.d2v") + mpeg2source(".\sample8.d2v")
Crop(14, 4, -10, -2)
a = last
#DeScratch(mindif=1, minlen=5, border=1)
DeSpot(p1=35, p2=14, pwidth=100, pheight=100, mthres=20, \
mwidth=20, mheight=15, interlaced=false, merode=48, \
ranked=false, p1percent=20, dilate=0, fitluma=false, \
blur=3, motpn=true, seg=2, color=true)
#daa()
#DeSpot(p1=35, p2=2, pwidth=100, pheight=100, mthres=25, \
# mwidth=20, mheight=15, interlaced=false, merode=50, \
# ranked=false, p1percent=0, dilate=0, fitluma=false, \
# blur=3, motpn=true, seg=0)
#DeSpot(p1=35, p2=14, pwidth=70, pheight=70, mthres=25, \
# mwidth=20, mheight=15, interlaced=false, merode=33, \
# ranked=false, p1percent=0, dilate=0, fitluma=false, \
# blur=4, motpn=false, seg=0, tsmooth=3)
#RemoveDirt(grey=true)
#Temporalsoften(3,5,5,mode=2,scenechange=10)
Temporalsoften(4,8,8,mode=2,scenechange=10)
#smoothlevels(25,1.0,255,0,255)
Undot()
#GradFunkMirror(strength = 1.2)
#fft3dfilter(sigma=0.5, bt=3, dehalo=1)
limitedsharpenfaster(strength=65)
#grainfactory3(3,4,2,45,45,45,1.05,1.05,1.05, temp_avg=25)
#Lanczos4Resize(672, 544)
#AddGrain(3, 0, 0)
StackHorizontal(a.Lanczos4Resize(672, 544), \
last.Lanczos4Resize(672, 544).AddGrain(3, 0, 0))
#return last
Nightshiver
30th July 2010, 05:45
It doesn't look that grainy to me, just old. Anyway:
MPEG2Source("D:\sample\sample.d2v", cpu=0)
Deblock_QED()
DeSpot(p1=35, p2=14, pwidth=100, pheight=100, mthres=10, \
mwidth=20, mheight=15, interlaced=false, merode=48, \
ranked=false, p1percent=20, dilate=0, fitluma=false, \
blur=3, motpn=true, seg=2, color=true)
source = last
vectors = source.MVAnalyseMulti(refframes=3, pel=2, overlap=4, sharp=1, idx=1)
source.MVDegrainMulti(vectors,thSAD=500,idx=1)
LimitedSharpenFaster(ss_x=1.8, ss_y=1.8, smode=3, strength=185, overshoot=1, undershoot=1)
crop( 14, 4, -10, -2)
Spline36Resize(720,544)
The one thing I changed with your DeSpot call was the mthres, as you had it so high it was giving artifacts and I just lowered it till the artifacts weren't there anymore. If you still want more sharpening than this, use SeeSaw.
kenpachi
30th July 2010, 12:36
@Nightshiver: I was also lowering mthres to reduce artifacts but still keeping efficiency. mtresh=20 is the lowest to use DeSpot at frame 210. Now You mention it I can see some more artifacts but can You say where exactly are the biggest ones? Maybe I could keep that high mthres using some sort of stabilizer (artifacts are sometimes caused by unstabilized video)?. Know any good? Isn't there a way to keep mthres high not crapping the video?
I wonder how big studios professionally restore video from old noised video reels. I imagine after soft and very safe automatic denoising they take frames separately and restore them manually. Is that so?
poisondeathray
30th July 2010, 15:16
I wonder how big studios professionally restore video from old noised video reels. I imagine after soft and very safe automatic denoising they take frames separately and restore them manually. Is that so?
Yes they do, but they also have better tools such as motion tracking, rig & object removal tools (they look at frames temporally and can replace specific parts of individual frames from referring to a previous or after "good" frame), so not everything is "manual" as in photoshop or paint . There are different degrees of complexity to "manual"
kenpachi
30th July 2010, 17:09
With mthres higher than 16 I get artifact at 134th frame. I can't find other artifacts so maybe mthres=15 is OK, should it really be as low as 10?
Deblock_QED works very fine (deblcking only 8x8?). Thanks for the tip Nightshiver.
Also, I got problems with this whole multi-thread motion compensation. I can't get MVAnalyseMulti and MVDegrainMulti working. I have both the latest MVTools v.1.11.4.5 (http://avisynth.org.ru/mvtools/mvtools.html) and MVTools v2.5.10.1 (http://avisynth.org.ru/mvtools/mvtools2.html) but cannot use any of multi-alias versions. Below is the syntax I can proceed:
vectors = last.MVAnalyse(pel=2, overlap=4, sharp=1, idx=1)
last = last.MVDegrain3(vectors,thSAD=500,idx=1)
But then an error pops up: "Error in MVDegrain3: vector clip must be specified". Mark, there is no <refframes> param in my plugins. Is it really that better from TemporalSoften it's way worth using it? Is TemporalSoften just a smoother when Degrain a sophisticated function with motion compensation that makes a huge difference? How to get it working?
EDIT:
I have tried example from MVTools Help:
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)
last.MVDegrain2(backward_vec1,forward_vec1,backward_vec2, \
forward_vec2,thSAD=400,idx=1)
and although the script slowed down noticeably, the results are awesome. But still worth extra CPU effort?
EDIT:
I've just compared TemporalSoften and Denoising with motion compensation. MVTools rulez - This method is just beyond everything I've seen. Very slow but totally worth every additional hour. Sharpening doesn't remark noise at all! I like it.
Nightshiver
31st July 2010, 02:20
This is why I always use MVDegrain :) It's always worth the extra time to get better results. Here's the link for the mvtools version that I use in case it works for you:
http://www.mediafire.com/?1q5yxmmdjqrbklq
kenpachi
31st July 2010, 23:02
Thanks for this version. I've looked hard but it seems Josey Wells' (similar problem in this thread (http://forum.doom9.org/showthread.php?t=147206)) version can't be found anymore. The only sign of 'Multi' I found was here - MVTools v.1.11.4.5 (http://avisynth.org.ru/mvtools/mvtools.html) and here - MVTools v2.5.10.1 (http://avisynth.org.ru/mvtools/mvtools2.html) where a link takes you here - http://forum.doom9.org/showthread.php?t=84770. I've also searched for this version here - http://manao4.free.fr/ but with no luck.
@Nightshiver: This Josey's version seems to be faster but can't say for sure as I compared different combinations:
vectors = last.MVAnalyseMulti(refframes=3, pel=2, \
overlap=4, sharp=1, idx=1)
last.MVDegrainMulti(vectors, thSAD=500, idx=1)
vs.
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)
last.MVDegrain2(backward_vec1,forward_vec1,backward_vec2, \
forward_vec2,thSAD=500,idx=1)
Also, with the same param thSAD=500, Josey's version seems to be better in removing grain. I wonder if it can be fixed by choosing MVDegrain3 instead of MVDegrain2. I still don't know if MVDegrain2 is multi-threaded as MVDegrainMulti is. I've compared fps results on my mobile c2d(2cores):
MVTools.dll:
1st pass: 1.33fps
2nd pass: 1.42fps
MVToolsJoseysMulti.dll:
1st pass: 1.49fps
2nd pass: 1.27fps
and they are pretty alike. If they both are multi-threaded, then one question more: why Josey's version gives slightly better results at thSAD=500?
Nightshiver, can You provide the Help File as well if attached? thx.
Nightshiver
2nd August 2010, 20:14
Sorry no help files. Don't think Josey provided those very often. You are also misinterpreting the name of "MVDegrainMulti". The Multi doesn't mean multi-threaded, it just means multi grain, such as being able to write MVDegrain3 as this
source = last
vectors = source.MVAnalyseMulti(refframes=3, pel=2, overlap=4, sharp=1, idx=1)
source.MVDegrainMulti(vectors,thSAD=800,idx=1)
With the refframes equalling the MVDegrain amount you want. (E.g., refframes=6 would translate to MVDegrain6 and so on) It is simply a shorter way of writing the whole syntax of MVDegrain than what you write it as. I also have no idea what version mine is, but I'm pretty sure it's one of the last builds he did. As for the reason Josey's version might give you better results is that the different versions (The one's by Josey and the one's by Fizick) have different calls, functions, and ways they go about doing their business. Fizick continued the development after Josey quit.
For more of Josey's versions, just keep going back (as in smaller page numbers) in this thread. (http://forum.doom9.org/showthread.php?t=84770&highlight=mvdegrain&page=57)
kenpachi
2nd August 2010, 21:03
Uh, multi in this way... Now I get it. Thx for some explanation.
Last time I run the script on a 4core to see how it'd go because encoding on my 2core is a real nightmare (1.45fps in 1st pass) (more in this thread (http://forum.doom9.org/showthread.php?p=1422674#post1422674)). Funny thing it seems 4core uses only 2 of 4 cores (50% of CPU). If MVTools is not fully multi-threaded I plan to use MT plugin. I saw a solution of this type:
MT("""
vectors = last.MVAnalyseMulti(refframes=3, pel=2, \
overlap=4, sharp=1, idx=1)
last.MVDegrainMulti(vectors, thSAD=500, idx=1)
""", 4)
I wonder if it can lead to any problems or runtime-errors. Is it gonna speed up the script for sure? And one more thing - let's say I run 1st pass on one computer (2core) using the script without MT(). Then I take the stats and the mbtree stats to the other PC (4core), I modify the script with MT() and run 2nd pass using the modified script. Is it all safe and ok? I guess there shouldn't be any problems.
um3k
2nd August 2010, 21:16
MVTools works with SetMTMode. Probably worth a try.
Gavino
2nd August 2010, 22:45
You are also misinterpreting the name of "MVDegrainMulti". The Multi doesn't mean multi-threaded, it just means multi grain ...
I think it means both. As I understand it, MVDegrainMulti has separate threads for each of Y, U, and V processing. See this post by josey_wells.
kenpachi
2nd August 2010, 22:58
You guys, and what about the last question? The part about modifying between passes. No problem?
leon1789
2nd August 2010, 23:24
I have a DVD there is much noise etc. I wonder if it's some sort of TV ArchiveBETA/VHS rip. I've tried some combinations and this is the best results I achieved (below). Is there a better way to treat this video? I don't want to use too strong DeSpot because of artifacts especially while motion. Also, I want to keep sharpening but I've noticed it remarks some blocking (watch cheek bones carefully).
Hi,
just a test:
mpeg2source(".\sample.d2v") + mpeg2source(".\sample2.d2v") + \
mpeg2source(".\sample3.d2v") + mpeg2source(".\sample4.d2v") + \
mpeg2source(".\sample5.d2v") + mpeg2source(".\sample6.d2v") + \
mpeg2source(".\sample7.d2v") + mpeg2source(".\sample8.d2v")
CropResizeBorder(bords=false,leftCut=2)
a = last
SoftSharpen(preset="light", denois=6, denoisT=10.3, sharp=20.40)
return stackhorizontal(a.subtitle("after CropResizeBorder"), \
last.subtitle("after SoftSharpen"))
picture n°140 :
http://img97.imageshack.us/img97/4831/image1quz.th.png (http://img97.imageshack.us/i/image1quz.png/)
videoFred
3rd August 2010, 08:50
I think it means both. As I understand it, MVDegrainMulti has separate threads for each of Y, U, and V processing. See this post by josey_wells.
I agree, I have understood the same. Anyhow, I use MVDegrainMulti() together with MT.dll and it works fine. Even with SetMTMode(1,0).
Please do not ask me how it works and why it works, but it works. :p
PS: I'm using MVToolsMulti V1.9.7.7 Intel10-Core2-SSE4
Fred.
kenpachi
6th August 2010, 20:30
comparison: sampleShow.mkv (http://www.speedyshare.com/files/23691064/sampleShow.mkv)
I feel like I should summarize the topic in some way. I've encoded a comparison that shows exactly what we managed to achieve (above). Special thanks to Nightshiver who did most of the job.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.