View Full Version : old VHS, lots of bleeding ghosting - what to do ?


hydra3333
26th February 2011, 04:17
The attached samples are from a much treasured 1983 VHS tape recording from TV, it has lots of what I think is ghosting and colour bleeding and some noise. The clips are "split" from the only remaining DVD copy of the lost tape.

I am wondering what to do to it to clean it up and sharpen it. I had thought crop it a bit, MDegrain1, and then ... lost the plot.

Suggestions (with examples if possible) on how to address the issues would be most welcome.

http://www.mediafire.com/?32f18ve0c754le4 10Mb see 1/2 way in
http://www.mediafire.com/?dxu78k4sv2v7lu2 10Mb

2Bdecided
28th February 2011, 16:51
Impressive how it's been blend deinterlaced while leaving interlaced jaggies in there - that don't respond to deinterlacing. That's quite a trick. Are you sure it was simple VHS > DVD? No resizing, Xvid, etc?

Some of the ghosting (multipath reception during the original recording?) is reduced by this...
shift=52
a=last
b=last.Crop(0,0,-shift,0).AddBorders(shift,0,0,0)
overlay(b,opacity=0.07,mode="add").MergeChroma(a)
return lastbut that leaves a hard line near the left hand side - soften the border somehow, then you'll have a soft line(!) because either way there's a bit of wanted information missing.

Cheers,
David.

-Vit-
28th February 2011, 20:19
The interlacing artefacts and some of the noise can be tackled with QTGMC's progressive repair mode:
QTGMC( Preset="Slower", InputType=2 )
or the dual version (slow), which fixes a few more problems:

t=QTGMC( Preset="Slower", InputType=2 )
b=QTGMC( Preset="Slower", InputType=3 )
Repair(t,b,1)

Might slightly enhance the halos, so you could set a lower sharpness.

N.B. I could only get QTGMC to properly work with this source using DGDecode_mpeg2source.

hydra3333
4th March 2011, 22:55
Thanks to both for your responses !

Impressive how it's been blend deinterlaced while leaving interlaced jaggies in there - that don't respond to deinterlacing. That's quite a trick. Are you sure it was simple VHS > DVD? No resizing, Xvid, etc?
No I'm not sure. Given it's on DVD and the source was VHS capture then there would have been some processing of some kind, maybe with an early version of tmpgenc or something.

Will give these a try.

hydra3333
8th March 2011, 09:40
or the dual version (slow), which fixes a few more problems:

t=QTGMC( Preset="Slower", InputType=2 )
b=QTGMC( Preset="Slower", InputType=3 )
Repair(t,b,1)


Ever had one of those days where literally everything goes wrong ? I've been having one :(

Anyway, the above script gives me
multiple calls to qtgmc, set PrevGlobals="Replace" or read script docs on 'GLOBALS'

-Vit-
8th March 2011, 09:47
Actually, you're lucky. The reason you're getting that error is because I've speeded up just that kind of thing. You only need to do what it said (add PrevGlobals="Replace" to your QTGMC calls). But in this case there's a better solution:
t = QTGMC( Preset="Slower", InputType=2 )
b = QTGMC( Preset="Slower", InputType=3, PrevGlobals="Reuse" ) # Reuse motion vectors from first call for a good speed-up
Repair( t, b, 1 )

The second QTGMC call will now reuse some calculations from the first, making it quite a bit faster than it would be.

hydra3333
20th March 2011, 07:58
Thanks. X264 kept crashing on me, until I told it not to use MT mode 2 and only use 1 thread, and ensured that all of the latest versions of plugins were loaded (including the fftw3.dll thingy - copy the latest libfftw3f-3.dll to fftw3.dll and then copy both into Windows-System32 for XP or SysWOW64 for win7).

SetMTmode(mode=5,threads=1) # start with mode=5 forAVIsource http://forum.doom9.org/showthread.php?p=1067216#post1067216
#<snip loading plugins etc)
Mpeg2Source("G:\HDTV\sport\1983-sport.d2v",info=0,ipp=true,cpu=0)
Assumefps(25)
Crop(0,16,-32,-8,align=true)
AddBorders(16, 16, 16, 8)
# The interlacing artefacts and some of the noise can be tackled with QTGMC's progressive repair mode:
#QTGMC(Preset="Slower",InputType=2)
# OR ...
t=QTGMC(Preset="Slower",InputType=2, Sharpness=0.9)
b=QTGMC(Preset="Slower",InputType=3, Sharpness=0.9, PrevGlobals="Reuse")
Repair(t,b,1)

Will see how it goes...

-Vit-
20th March 2011, 15:34
You shouldn't try to x264 at the same time as a complex multi-threaded script. You'll run out of memory on 32-bit Avisynth. Render the script to some lossless format, then x264 that.

Taurus
20th March 2011, 17:59
Interesting how any Discussion about avisynth filtering vanishes into MT tweaks.

@hydra3333:
Why dont you clean up your stuff, I mean your video,
and play the speedgame later on?
As -Vit- suggested:
Test your scripts in a single theaded environment 32bit or 64bit until you're satisfied with the result.

I am back to 32bit for now. Could'nt stand the hazzles with suboptimal plugins for 64bit.
In 32bit most scripts work multithreaded without crashing or trashing.
And dont give a d... for 8...10% more speed.
Of course allocated memory is an argument to use 64bit.
But I can see you are using SD source material and just two instances of QTGMC.
Should be quite easy to handle.
I've tried to download your samples.
But Mediafire hangs at the moment.
Maybe later.

hydra3333
21st March 2011, 11:21
It worked ok (32 bit avisynth etc, Win7 Home Premium 64bit) with one thread. Not fussed about speed, this is a once-off... or tending to be lots of a once-off whilst homing in on reasonable eye experience :)

I wondered if the sharpness could be improved without too many hassles (since the source is so awful and ghosted anyway) so I am trying this ...
t=QTGMC(Preset="Slower",InputType=2, Sharpness=1.2, SLMode=1)
b=QTGMC(Preset="Slower",InputType=3, Sharpness=1.2, SLMode=1, PrevGlobals="Reuse")
Repair(t,b,1)

Also throwing in a deblock_qed as a final step since I thought I saw blocking in the result.

Taurus
21st March 2011, 12:14
I have tried your source and script :mad::p.
QTGMC is so......slooow with this settings.
If it's a one time thingy it might be allright,
but this must be a real treasure if you throw all your grips
and cpu cycles on this source.

Did you try deblocking first with Mpeg2Source?
I see you enabled postprocessing for force field-based (interlaced) post-processing.
But you disabled deblocking.

Yeah, I noticed the strong ghosting and some leftover bleeding in the encoded video.
Dont sharpen it more.
The result will not please your eyes.
I've tried adhoc a few degrainers and denoisers for speed reasons.
I must say QTGMC is doing a good job on this source.
Deblock_qed will do more harm then good.
Any way I do not see so much blocking after encoding your samples.
But this could be because of me loosing eyesight or my old CRT monitor :)

hydra3333
21st March 2011, 12:41
Right ho. "Dear to my heart" is a term I'd use for this video :) Maybe I'm imagining blocking or saw it in non-clipped video high motion areas. Have just aborted a current encode to use this for the source ...
Mpeg2Source("file.D2V",info=0,ipp=true,cpu=6)

Thanks.

hydra3333
28th March 2011, 23:54
Well it turned out OK, by comparison to the source :), with this
SetMemoryMax(256)
LoadPlugin("C:\SOFTWARE\DGindex\DGDecode.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\DePan.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\AGC.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Cnr2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\dctfilter.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\fft3dfilter.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\degrainmedian.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Convolution3d.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\despot.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\WarpSharp.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\aWarpSharp.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\mt_masktools-25-broke-backward-compatibility.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\mvtools2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Unfilter.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\AddgrainC.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\hqdn3d.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Colormatrix.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\NNEDI2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\NNEDI3.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\EEDI2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\EEDI3.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\VerticalCleanerSSE3.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\dfttest.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\VariableBlur.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\FFTQuiver.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\RemoveGrainSSE2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\RepairSSE2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\RemoveDirtSSE2.dll")
Import("C:\Program Files (x86)\AviSynth 2.5\LimitedSharpenFaster.avs")
Import("C:\Program Files (x86)\AviSynth 2.5\Deblock_QED_MT2.avs")
Import("C:\Program Files (x86)\AviSynth 2.5\QTGMC-3.31.avsi")
Mpeg2Source("G:\SDTV\the-file.d2v",info=0,ipp=true,cpu=6)
Assumefps(25)
Crop(0,16,-32,-8,align=true)
AddBorders(16, 16, 16, 8)
# DE-INTERLACING and RE-INTERLACING http://forum.doom9.org/showthread.php?p=1374335#post1374335
# Some of the ghosting (multipath reception during the original recording?) is reduced by this...
# The interlacing artefacts and some of the noise can be tackled with QTGMC's progressive repair mode:
#QTGMC(Preset="Slower",InputType=2)
# OR ...
t=QTGMC(Preset="Slower",InputType=2, Sharpness=1.2, SLMode=1)
b=QTGMC(Preset="Slower",InputType=3, Sharpness=1.2, SLMode=1, PrevGlobals="Reuse")
Repair(t,b,1)
AssumeFPS(25)
SetPlanarLegacyAlignment(True)