Log in

View Full Version : Extreme VHS Scratches


DSP8000
1st April 2007, 11:46
Hi guys,

After some researching & testing I found filters that can deal with VHS scratches, horizontal lines, noise...

I don't remember when was the last time that I've seen this kind of extreme VHS degradation. Originally recorded with Hi8 cam in 1975.
It is a home video from my godfather in his early days when he served the Australian Police. It is very valuable tape & I'm trying my best to help him out to put it on a DVD.

I've done some research & reading & the best that I can do is this script:

SetMemoryMax(512)
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\TDeint.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\despot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\deflicker.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\descratch.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\RemoveDirt.avsi")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveDirt.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\FFT3DFilter.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpenFaster.avsi")
AVISource("E:\VHS\vhscapture.avi")
ConvertToYV12()
AssumeBFF()
TDeint(mode=1)
DeSpot()
DeFlicker(scene=40)
DeScratch(mindif=2)
RemoveDirt()
fft3dfilter(sigma=2, bt=5, plane=4)
LimitedSharpenFaster(Smode=3)
AssumeBFF()
SeparateFields()
SelectEvery(4,0,3)
Weave()

Because the scratches are not fully removed I'm thinking of running 2 pass restoration
eg.
1 pass just DeScratch, Deflicker, DeSpot
2 pass the same but with crop, resize, denoising and sharpening

If anyone can help on this it will be very much appreciated, any suggestions are welcome.

My initial workflow was based on DeFlicker Read Me:

From DeFlicker Read Me:

The best results for films restoration within Avithynth probably may be achieved, for example, with a sequence:

1. Color, brightness correction (mostly insensitive to luma variation)
2. Global motion compensation (DePan - insensitive to luma variation)
3. Mean intensity stabilizer (Deflicker - sensitive to global motion (however and to local too) )
4. Local motion compensator (MVTools - sensitive to luma variation)
5. Temporal spots removing (DeSpot - sensitive to luma variation)
6. Temporal noise reduction (RemoveDirt, Dust, etc - sensitive to luma variation)
7. Spatial smoothing (Vaguedenoiser, etc - insensitive to luma variation)
8. Global motion stabilizing (DepanCompensate - insensitive to luma variation)
9. Coding

Here is a 3 seconds unprocessed HuffYUV sample (http://www.wikiupload.com/download_page.php?id=115500)

Any help is appreciated, :thanks:

Blue_MiSfit
2nd April 2007, 06:01
AVISource("E:\VHS\vhscapture.avi")
ConvertToYV12()


Bad. Leave it in the native format as long as you can (YUY2?), or at least use ConvertToYV12(interlaced=true) to avoid slaughtering chroma.

~MiSfit

FredThompson
2nd April 2007, 17:36
Hi8 in 1975? Probably not. You've got a Hi8 transfer from film shot in 1975.

Here is a little code I use for dropouts.TurnLeft()
Descratch(modey=0,modeu=3,modev=3,mindif=1,minlen=50,maxgap=20, \
blurlen=50,keep=100,mark=false,border=0,maxangle=0)
TurnRight()
DeSpot can help with the black spots: http://avisynth.org.ru/despot/despot.html

Also, some tweaking could help bring out details which are overly dark.

http://www.doom9.org/capture/start.html
http://neuron2.net/board/viewtopic.php?t=843
http://neuron2.net/board/viewtopic.php?t=711
http://compression.ru/video/color_enhancement/old_color_en.html
http://compression.ru/video/smart_contrast/index_en.html

DSP8000
4th April 2007, 12:11
Fred, thanks for the script and the links.

Yesterday I had some time to do some reading and apparently there's no way that one script will work for this or that video, this is specific for descratch. I'll have to find the lines, scratches, with graphic editor, write down the pixel values and then adjust the parameters accordingly.
I'm not sure if despot is able to deal with moving spots, coz, as you've probably noticed in the sample, the spots are almost every 3rd frame in a different position.
I'll definitely have some more time on the weekend so will see what happens then.

Thanks for having a look at the sample.