Log in

View Full Version : Help needed in cleanup of multi-generational VHS recording


RidgeShark
6th December 2008, 22:27
So I've searched all over the doom9 message boards and found a very useful script for cleaning up some ugly VHS footage I have. Here's a sample of that footage - http://www.megaupload.com/?d=NSVVJ4H1

And here's the script I've been using -

AviSource("C:\Source")
ConverttoYV12()

source=last
backward_vec2 = MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1,

idx = 1,dct=1)
backward_vec1 = MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1,

idx = 1,dct=1)
forward_vec1 = MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1,

idx = 1,dct=1)
forward_vec2 = MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1,

idx = 1,dct=1)
MVDegrain2

(source,backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=100,idx=2)


I'm posting this message because I am very much an amateur at using Avisynth. I don't know if there are better techniques out there that could help with this particular VHS footage. For instance, although this script goes a long way towards cleaning up the footage, I'm still left with slight, strange horizontal lines in the video. Also, I'd like to convert the footage to 23.976 progressive fps if possible. After doing the cleanup, I tried using this script -

Telecide()
Decimate()

But it has problems and still shows interlacing in many frames. I know the source is bad, but I still hope it's possible to accurately IVTC the footage.

Any help is very much appreciated.

scharfis_brain
7th December 2008, 00:15
youl'll need to bob-deinterlace it (simple bob() should suffice)
then do some wavelet denoising to get rid of the horizontal interference.
after this do your mocomped denoise and
as last step you need deblending to get back to the original 23.976fps.

Sagekilla
7th December 2008, 01:49
That's an awfully low thSAD if your material is very bad as you say.. the default is 400, and on noisy material you usually have to increase it.

Nightshiver
7th December 2008, 03:23
This gets rid of most of the noise:

converttoyv12()
bob()
degrainpiramid(2,4,3)
source = last
vectors = source.MVAnalyseMulti(refframes=5, pel = 2, overlap=4, sharp=1, idx = 1)
source.MVDegrainMulti(vectors,thSAD=1000,idx=1)

for degrainpiramid, go here: http://forum.doom9.org/showpost.php?p=711189&postcount=6
You still have to get the frame rate back to 23.976, though.

2Bdecided
9th December 2008, 12:21
Is this the best source available? :(

You need to shift the chroma up a few lines, since it drops one line for each generation of VHS, e.g. try

bob(0.0,1.0)

Vshift=4
Hshift=0
last.mergechroma(last.crop(Hshift,Vshift,0,0).addborders(0,0,Hshift,Vshift))


Change the Vshift value until the chroma lines up vertically.

Cheers,
David.

RidgeShark
28th January 2009, 03:31
Thank you all very much for the help. I've Frankensteined a script from all of the suggestions, as well as from reading some other threads, and came up with this -

AviSource("video.avi")
ConverttoYV12()
FFT3DFilter(plane=3,sigma=3,interlaced=true)
source=last
fields=source.AssumeTFF().SeparateFields().degrainpiramid(2,4,3)

prefiltered = degrainmedian(norow=true, mode=0,limity=10) #aggresive for better motion search
super = MSuper(levels=1,rfilter=4)
superfilt = MSuper(prefiltered)
backward_vectors = MAnalyse(superfilt, isb = true)
forward_vectors = MAnalyse(superfilt, isb = false)

forward_compensation = MCompensate(super, forward_vectors)
backward_compensation = MCompensate(super, backward_vectors)

interleave(forward_compensation, last, backward_compensation)
DeGrainMedian(norow=true, mode=0) #norow filters single rows, good for getting lines could be less aggressive
selectevery(3,1)
source=last
fields=source.AssumeTFF().SeparateFields() # or 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=900,idx=1)
Weave()
aux=DeGrainMedian(mode=0, limity=7, interlaced=true)
VagueDenoiser(threshold=2, auxclip=aux, interlaced=true, wiener=true)

It does a great job cleaning and also manages to get rid of most of the horizontal line interference. It leaves a little splotchiness in the darker areas in the video, but I'll accept it if that's the price I have to pay to remove the horizontal interference.

Finally, to extract a 23.976 framerate, I'm using AnimeIVTC -

animeivtc(mode=1,aa=0)

When paused, traces of blended frames (which is a problem with the source) can be seen. Despite this problem, I am very happy with the output. The image is about as pleasing at it can get and the motion looks natural.

RidgeShark
2nd May 2009, 03:04
I've recently discovered that all the noise in my videoclip exists completely in the luma channel, and is not present in the chroma. Using this script helps to quickly and easily get rid of most of the horizontal noise -

DeGrainMedian(limitY=8, limitUV=0, mode=1, interlaced=true, norow=false)
DeGrainMedian(limitY=3, limitUV=0, mode=1, interlaced=true, norow=false)

Mounir
8th May 2009, 01:14
no chroma noise on vhs, how is that even possible? you're mistaken imo