PDA

View Full Version : Noisy & Deinterlaced, or Less Noise & Interlaced


jeremyofmany
21st December 2006, 07:27
I have a problem with using MVTools' DeGrain1 function to reduce noise while using TDeint to deinterlace.
I can either leave the following highlighted line out of my script for deinterlacing to take place, but have severe noise:
AviSource("D:\Hamsters(DV).avi")
LoadPlugin("D:\Video Tools\AviSynth Filters\tdeint.dll")
LoadPlugin("D:\Video Tools\AviSynth Filters\AGC.dll")
LoadPlugin("D:\Video Tools\AviSynth Filters\MVTools.dll")
LoadPlugin("D:\Video Tools\AviSynth Filters\RemoveGrain\RemoveGrain.dll")
TDeint(Order=0)
fields=AviSource("D:\Hamsters(DV).avi").AssumeBFF()
backward_vec2 = fields.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=2, idx = 1)
forward_vec2 = fields.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=2, idx = 1)
fields.MVDegrain1(backward_vec2,forward_vec2,thSAD=400,idx=1)
AssumeFrameBased().SeparateFields()
HDRAGC(coef_gain=0.7)
Weave()
Or I can leave that line, have it be severely noisy but it remains Interlaced.

I obviously want to reduce the noise and have it deinterlaced at the same time.

Screenshots:
Noisy & Deinterlaced (http://jeremy.zxian.org/Screenshots/Noisy.Deinterlaced.jpg)
Less Noise & Interlaced (http://jeremy.zxian.org/Screenshots/Less Noisy.Interlaced.jpg)

Any suggestions/corrections?

Thanks,
Jeremy

foxyshadis
21st December 2006, 08:59
I think you're getting all confused; that's a pretty mixed up script. :p I'll show you what the compiler sees:

last=AviSource("D:\Hamsters(DV).avi")
LoadPlugin("D:\Video Tools\AviSynth Filters\tdeint.dll")
LoadPlugin("D:\Video Tools\AviSynth Filters\AGC.dll")
LoadPlugin("D:\Video Tools\AviSynth Filters\MVTools.dll")
LoadPlugin("D:\Video Tools\AviSynth Filters\RemoveGrain\RemoveGrain.dll")
last=last.TDeint(Order=0)
fields=AviSource("D:\Hamsters(DV).avi").AssumeBFF()
backward_vec2 = fields.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=2, idx = 1)
forward_vec2 = fields.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=2, idx = 1)
last=fields.MVDegrain1(backward_vec2,forward_vec2,thSAD=400,idx=1)
last=last.AssumeFrameBased().SeparateFields()
last=last.HDRAGC(coef_gain=0.7)
last=last.Weave()

If you follow this, it should be easy to see why the deinterlacing isn't applied: last is getting co-opted by the mvdegrain, which deadends at the second avisource, so you lose everything before it. That's what sometimes happens when you copy a script into another too hastily. So how to fix:
* Remove the second Avisource. Replace with fields=last.
* Skip separatefields/weave! You are deinterlaced now, don't touch fields anymore unless you're reinterlacing.

davidhorman
21st December 2006, 11:00
Never mind, don't know what I'm talking about :rolleyes:

David

jeremyofmany
21st December 2006, 18:35
Foxyshadis, thank you for that. I had no idea that my scripting was so bad. :D
It's fixed now. I'm connected remotely so it took UltraVNC about 30 seconds to show me the frame in VirtualDub which resulted in enough foot-stomping to dent the floor under my desk. ;)
I sincerely appreciate the help. You guys rock. :)

jeremyofmany
22nd December 2006, 08:46
I need some honest opinions. Screenshots below are the original source's first frame, and the same but run within my script:
Original Frame 1 (http://jeremy.zxian.org/Screenshots/Original_Frame_1.jpg)
AviSynth's Frame 1 (http://jeremy.zxian.org/Screenshots/AviSynth_Frame_1.jpg)

Original Frame 13543 (http://jeremy.zxian.org/Screenshots/Original Frame 13543.jpg)
AviSynth's Frame 13543 (http://jeremy.zxian.org/Screenshots/AviSynth Frame 13543.jpg)

Should I make any adjustments/additions?

jeremyofmany
23rd December 2006, 05:02
foxyshadis, what do you think? :confused:

juhok
23rd December 2006, 05:14
Frame1 is 404, and Frame13543 looks pretty washed out to me. Why make the black gray? Black should be black. So.. I would apply a lighter gain.

foxyshadis
23rd December 2006, 05:26
I think you should fix that first frame, didn't seem to upload. :p

I like the result. I'm not sure it's possible to do much more with it without giving it a smooth, detail-free look. You might try limitedsharpenfaster, or seesaw+denoiser (I'm not sure what denoiser would be gentle enough to avoid smearing, which messes seesaw up) just to sharpen up some of the softness, and hopefully not too much of the noise. Probably increase the saturation somewhat as well. In fact, you'll probably want to play with HDRAGC and levels a lot to give it a really solid look.

jeremyofmany
23rd December 2006, 07:19
Why make the black gray? Black should be black. So.. I would apply a lighter gain.
It is that way because I just used default settings on the HDRAGC filter simply to get it functional in my script. I haven't played with it much.
Honestly, I hate using denoisers. I shouldn't have to. This is obviously very hard footage to deal with. Most of the video is noise. Removing noise is removing detail. Of course you don't need ultimate quality to see what's happening in the video. The purpose of me doing this is to *improve* it by whatever means so I can encode it, burn it and keep it as memories. I have another video which doesn't have very much noise at all. That will be easier to deal with, which I'm looking forward to. My new camcorder deals much better in low-light situations so even if I were to record in similar conditions as what those old ones were, the noise wouldn't be nearly as bad.
I see what juhok means about it looking washed out. I'll have to see about adjusting the colors and gain. But damn, that noise! Grrr.. :mad: