Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th October 2012, 18:17   #1  |  Link
manniefresh91
Registered User
 
Join Date: Mar 2012
Posts: 4
Grotesque miniDV restoration

Hi there. I'm having major problems with this DV firewire capture of some home videos. For some reason, the noise on the video is much more than I had anticipated, and the chroma noise is almost unbearable. I've tried long enough to help myself and learn as much as I can about Avisynth usage, but I'm in need of help now.

I have used a combination of fft3d strictly for chroma noise removal and them temporaldegrain for removing some of the luma
noise. I'm keeping the video interlaced.

Quote:
Cnr2()
fft3dfilter(sigma=12.0, plane=3)
SetMTMode(2,2)
assumebff()
separatefields()
TemporalDegrain()
#Yadif(0,-1)
Weave()
I've uploaded a raw sample clip over here - http://www.mediafire.com/?k5bv18b15d1m8y8.

My main priority is to get rid of the chroma noise. I don't particularly mind the luma noise, but the end result on TV isn't that good. Another problem I've encountered is red bands on the edge of the headboard (rainbowing?) after I had removed an obscene amount of noise with some high strength fft3d chroma filtering. Sharpening is not also what I'm looking for, mainly going for smoothness and conformity of video.

Please post up your best efforts with a script - hopefully something not too plugin-laden. I don't have the most powerful of systems, but I don't really mind if I go down to 1fps. You can use bayfiles or mediafire to upload any subsequent clips.

PS if willing, you can go against my [ignorant] preferences and process the video as much as you want, so long as the output is what's most desirable.

Thank you for reading.

Last edited by manniefresh91; 25th October 2012 at 20:06.
manniefresh91 is offline   Reply With Quote
Old 25th October 2012, 19:30   #2  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
there's a virtualdub filter call camcorder color denoise that can do a very good job removing the chroma noise.
And for the yellow cast, you will need another vd filter call cmyk film color to remove it. Afaik, there're no avisynth color filter that can do it properly.
lansing is offline   Reply With Quote
Old 25th October 2012, 19:33   #3  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,695
Your link to the video doesn't work (I get an "invalid security token" error).

As for your chroma noise problem, how are you "capturing" this video? If you use Firewire (1394), then the video will be exactly, bit-for-bit, identical to the video on your tape. Zero difference. You should therefore not be surprised at how the video looks on your computer.

If instead you capture via the analog outputs of your DV camcorder, then you are degrading the video (and audio) and all bets are off. There is no reason to capture that way. You also should not capture via the USB port on your camcorder, if it offers that option.

If you have used 1394 for the "capture," and the video itself has the noise (rather than having it introduced by a lousy capture setup), then if you want to remove it, you are on the right track. However, you should use the "interlaced=true" setting in fft3dfilter. Also, the "sigma=12" setting is way too high for most situations.

Finally, the tools you are using are for general noise filtering and are not really meant strictly for chroma noise. There are dozens of ways to deal with chroma noise in video, and you might search these forums for "chroma noise" to see some of the tools people are using. I use a really old tool, original developed for VirtualDub called CNR. There are better tools available, but this one has worked well for me.
johnmeyer is offline   Reply With Quote
Old 25th October 2012, 20:05   #4  |  Link
manniefresh91
Registered User
 
Join Date: Mar 2012
Posts: 4
Thank you for the Virtualdub plugin. It works well, and I like how you can preview the amount of noise you reduce... in my case it reduces a lot of the chroma noise. I can achieve a similar effect with fft3d I think, just having problems finding the best settings for my video.

The files work, here's an updated link: http://www.mediafire.com/?k5bv18b15d1m8y8

I use firewire to transfer the miniDV video - no analogue composite output. It comes as no major surprise as it wasn't shot in optimal lighting conditions (indoors), but the blue chroma noise in the video is really ugly, and excessive. I somehow knew my fft3d settings were unorthodox, but relative to my video, the figure of 12 is what achieves a decent video. I've updated my script to this now and I liked the result so far, but I'm left with another problem...

Quote:
ConvertToYV12
Cnr2()
fft3dfilter(sigma=12.0, plane=3,interlaced=true)
SetMTMode(2,2)
assumebff()
separatefields()
TemporalDegrain()
Weave()
The problem is now with the colours. It's mainly apparent on faces, near the edges. Don't know what the term is, but the colour isn't right and the skin complexion looks really greyish in areas, I think a high chroma reduction level has had an impact and it's leaving the marks on the skin colour. This is especially apparent with movement. There's like a metaltic, silverish sheen (?) on parts of the face. I think it falls under colour correction. I'll get to a sample of this later.

Thank you for your responses, I'm sure we can get to the bottom of this mess! If I can sort out the colours, as well as my chroma settings, then with a little bit of smoothing/PP'ing to the final product will leave me with a satisfying result.
manniefresh91 is offline   Reply With Quote
Old 25th October 2012, 21:44   #5  |  Link
Lyris
Registered User
 
Join Date: Sep 2007
Location: Europe
Posts: 602
Nothing beats Neat Video for noise reduction, inmy opinion. Not free of course.

UTVideo encoded short sample: http://www.sendspace.com/file/ico5gu
Lyris is offline   Reply With Quote
Old 26th October 2012, 02:52   #6  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,695
I'm not sure Neat will work well for the chroma noise, although this particular video (I was able to download it) provides a nice big sample area that you can use to train Neat.

As for CNR, if you use the wrong settings, it will completely wipe out strong colors. You can use the VirtualDub version to interactively set what is needed, and then transfer those settings into your AVISynth script. Here are some settings I use with VHS tape:

Code:
Cnr2("oxx",8,16,191,100,255,32,255,false)
These may not be quite right for your clip, but you might want to try it and see if it "solves" the gray problem. If it does, you'll know you're on the right track, and you can twiddle the dials until you get satisfactory results.

As for all the other noise, I just got called to dinner, so let me just give you a link to a long series of posts, both in the Vegas forum and here in doom9 to some denoising I did on some underwater DV video that had lots of noise. My initial attempts were not that great, but by the end of the effort, I think I got some really great results. Perhaps you can steal some of the code and use it in your effort. Here's the link:

My Latest Denoising Tests
johnmeyer is offline   Reply With Quote
Old 26th October 2012, 05:24   #7  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Hi manniefresh91, I suggest you try SMDegrain. It's very easy to use, very customizable, and can render some very nice results.
Here's a sample processed with following script.
Code:
# Core plugins for SMDegrain
loadPlugin("C:\dither.dll")   # from Dither package.
loadPlugin("C:\mvtools2.dll") # from Dither package.
loadplugin("C:\mt_masktools-26.dll")

# Plugins for Contrasharp
loadplugin("C:\RemoveGrainSSE2.dll")
loadplugin("C:\RepairSSE2.dll")

# Plugin for prefilter
loadplugin("C:\FFT3DFilter.dll")

# Load scripts
import("C:\dither.avsi")     
import("C:\mt_xxpand_multi.avsi") # from Dither package.
import("C:\SMDegrain v.2.1d.avsi")

SetMTMode(5,4)
avisource("testsample.avi")
SetMTmode(2)
pre = fft3dfilter(sigma=3.0,interlaced=true,plane=0).separatefields()
SMDegrain(tr=7,prefilter=pre,interlaced=true,contrasharp=true,lsb=true,mode=6,chroma=false)
As always, you can tweak some of the settings to meet your needs.

*edit*
You can also process chroma and luma separately. This helps keeping some of the detail in the luma plane. Here's a sample.
Code:
pre = fft3dfilter(sigma=3.0, interlaced=true, plane=0).separatefields()
chroma = SMDegrain(tr=7,prefilter=pre,plane=3,interlaced=true,contrasharp=false,lsb=true,mode=6,chroma=false,globals=2)
luma   = SMDegrain(tr=3,prefilter=pre,plane=0,interlaced=true,contrasharp=true, lsb=true,mode=6,chroma=false,globals=1)
luma.MergeChroma(chroma)

Last edited by Reel.Deel; 26th October 2012 at 14:59.
Reel.Deel is offline   Reply With Quote
Old 26th October 2012, 05:52   #8  |  Link
Bloax
The speed of stupid
 
Bloax's Avatar
 
Join Date: Sep 2011
Posts: 317
Hm, this doesn't look too shabby for what it does:
Code:
mt_lutxy(last,last.removegrain(20),"x x y - abs 4 / 1 4 / ^ 4 * 0.5 * x y - x y - abs 1.001 + / * +",Y=3,U=2,V=2) #y hallo der didee, dis gud copypasta stuff
Merge(SangNom(0,16),SangNom(1,16))
The only thing I actually wanted to do is remove those nasty lines all over the place. (And I'm unsure about what they are, so :x), and this doesn't seem to nuke the details of everything. Yay.
(By the way, this is applied to the SMDegrain.avi one.)

Edit: Erm, fixed some merging by making SangNom less aggressive. Oopsie. (Note the bed sheet)

Last edited by Bloax; 26th October 2012 at 05:59.
Bloax is offline   Reply With Quote
Old 26th October 2012, 14:45   #9  |  Link
Lyris
Registered User
 
Join Date: Sep 2007
Location: Europe
Posts: 602
Quote:
I'm not sure Neat will work well for the chroma noise,
What makes you say that? It's worked very well in that regard whenever I've used it. The thresholds and frequency characteristics can be adjusted for Chroma individually in the Advanced mode.
Lyris is offline   Reply With Quote
Old 26th October 2012, 16:37   #10  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,695
Quote:
Originally Posted by Lyris View Post
What makes you say that? It's worked very well in that regard whenever I've used it. The thresholds and frequency characteristics can be adjusted for Chroma individually in the Advanced mode.
If you read my previous posts (the one I linked to above) you'll find that I have used Neat on many occasions and have quite a few objections to the results. It is a "spatial-temporal" denoiser, but it has always seemed to me that it does more spatial then temporal denoising. It does as good a job as any spatial denoiser, but because it is a spatial denoiser, it removes too much detail, even when well trained and even when using "mild" settings.

As for chroma noise specifically, I have found various AVISynth plugins to work much better, often with virtually no artifacting.

However, I know that lots of people love Neat, so I certainly don't want to get into any "what's better" discussion. Everyone's needs are different, and everyone has different reactions to the same thing, something you'll see if you read any of the posts in that long thread I linked to in my previous post. In that thread, we never did get any consensus as to what was the "best" approach to denoising that one short clip. I guess this is why discussions of "best" are to be avoided in this forum.
johnmeyer is offline   Reply With Quote
Old 26th October 2012, 17:13   #11  |  Link
Lyris
Registered User
 
Join Date: Sep 2007
Location: Europe
Posts: 602
I'll definitely take a look through this thread and try out the alternatives, then. Neatvideo has given me great results most of the time, but if I can do anything better with AviSynth, better yet.
Lyris is offline   Reply With Quote
Old 26th October 2012, 17:44   #12  |  Link
manniefresh91
Registered User
 
Join Date: Mar 2012
Posts: 4
Some of the sample videos you've produced are fantastic. I'm still testing things out here, but these suggestions have helped a great deal. I've tried CNR on Virtualdub and it does a well enough job. I shall focus on the luma and and experiment with that. Thank you all for your help, I shall post updates when available.

Quote:
Originally Posted by Reel.Deel View Post
Hi manniefresh91, I suggest you try SMDegrain. It's very easy to use, very customizable, and can render some very nice results.
Here's a sample processed with following script.
Code:
# Core plugins for SMDegrain
loadPlugin("C:\dither.dll")   # from Dither package.
loadPlugin("C:\mvtools2.dll") # from Dither package.
loadplugin("C:\mt_masktools-26.dll")

# Plugins for Contrasharp
loadplugin("C:\RemoveGrainSSE2.dll")
loadplugin("C:\RepairSSE2.dll")

# Plugin for prefilter
loadplugin("C:\FFT3DFilter.dll")

# Load scripts
import("C:\dither.avsi")     
import("C:\mt_xxpand_multi.avsi") # from Dither package.
import("C:\SMDegrain v.2.1d.avsi")

SetMTMode(5,4)
avisource("testsample.avi")
SetMTmode(2)
pre = fft3dfilter(sigma=3.0,interlaced=true,plane=0).separatefields()
SMDegrain(tr=7,prefilter=pre,interlaced=true,contrasharp=true,lsb=true,mode=6,chroma=false)
As always, you can tweak some of the settings to meet your needs.

*edit*
You can also process chroma and luma separately. This helps keeping some of the detail in the luma plane. Here's a sample.
Code:
pre = fft3dfilter(sigma=3.0, interlaced=true, plane=0).separatefields()
chroma = SMDegrain(tr=7,prefilter=pre,plane=3,interlaced=true,contrasharp=false,lsb=true,mode=6,chroma=false,globals=2)
luma   = SMDegrain(tr=3,prefilter=pre,plane=0,interlaced=true,contrasharp=true, lsb=true,mode=6,chroma=false,globals=1)
luma.MergeChroma(chroma)
Hello. I've tried running this script of yours (impressive results btw), but the end video for me is blurred motion. The noise reduction results are perfect, but when I try render, I realise the video has gone funny, and the movement/motion in the video is blurry for some reason? Not blurry like a loss of detail, but blurry as in it's producing some kind of malfunction for me and isn't playing like ti should, or like it did in your sample clip. I would like to try your script on another sample clip, but can't get it to function. Any ideas?
manniefresh91 is offline   Reply With Quote
Old 27th October 2012, 04:51   #13  |  Link
um3k
Registered User
 
Join Date: May 2007
Posts: 220
What source filter are you using? If it's DirectShowSource, then try replacing it with AviSource.
um3k is offline   Reply With Quote
Old 27th October 2012, 14:21   #14  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by manniefresh91 View Post
Any ideas?
Post your script that produces the artifacts you described.
Reel.Deel is offline   Reply With Quote
Old 28th October 2012, 00:13   #15  |  Link
manniefresh91
Registered User
 
Join Date: Mar 2012
Posts: 4
I can confirm I am indeed using AviSource in my script. I copied your script exact, to try out on another sample clip. Downloaded the tools/filters I didn't have, except that I was left with one last problem.. when I tried the script, I got this error:


So I amended the final script to this:

Code:
# Core plugins for SMDegrain
loadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\dither.dll")   # from Dither package.
loadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\mvtools2.dll") # from Dither package.
loadplugin("C:\Program Files (x86)\AviSynth 2.5\plugins\mt_masktools_26.dll")

# Plugins for Contrasharp
loadplugin("C:\Program Files (x86)\AviSynth 2.5\plugins\RemoveGrainSSE2.dll")
loadplugin("C:\Program Files (x86)\AviSynth 2.5\plugins\RepairSSE2.dll")

# Plugin for prefilter
loadplugin("C:\Program Files (x86)\AviSynth 2.5\plugins\FFT3DFilter.dll")

# Load scripts
import("C:\Program Files (x86)\AviSynth 2.5\plugins\dither.avsi")     
import("C:\Program Files (x86)\AviSynth 2.5\plugins\mt_xxpand_multi.avsi") # from Dither package.
import("C:\Program Files (x86)\AviSynth 2.5\plugins\SMDegrain v.2.1d.avsi")

SetMTMode(5,4)
AviSource("C:\Users\Desktop\VirtualDub-1.7.6\dvcap2222.11-10-27_21-32.00.avi").ConvertToYV12()
SetMTmode(2)
pre = fft3dfilter(sigma=3.0,interlaced=true,plane=0).separatefields()
SMDegrain(tr=7,prefilter=pre,interlaced=true,contrasharp=true,lsb=true,mode=6,chroma=false)
The red bit above is the only difference between the script you posted and the one I tried. I altered the script in this way since it wouldn't return any video on my system unless I put in that piece. Here is the blurring I was talking about: http://www.mediafire.com/?kcsowqjo1m3xywf

Cheers.

Last edited by manniefresh91; 28th October 2012 at 00:16.
manniefresh91 is offline   Reply With Quote
Old 28th October 2012, 14:02   #16  |  Link
TheSkiller
Registered User
 
Join Date: Dec 2007
Location: Germany
Posts: 632
So you're not getting YV12 from your DV codec, huh? What Codec are you using to decode the DV video?
If it's not Cedocida I highly suggest you install it (free).
TheSkiller is offline   Reply With Quote
Old 29th October 2012, 14:34   #17  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
@manniefresh91
I have been using SMDegrain for months now and have not seen anything remotely close to that. I doubt this is the problem but since your footage is interlaced use ConvertToYV12(interlaced=true).
Not really related to the problem but be aware when using SMDegrain with chroma=false, there's a possibility the chroma will smear.
From experience it depends on the scene(fast panning, fast moving objects), also the higher the thSAD and TR the more vulnerable it is. The smering can be visible but looks nothing like the problem your having.
Reel.Deel is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:33.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.