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

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th February 2012, 18:32   #1  |  Link
torwart
Registered User
 
Join Date: Jul 2010
Location: Tbilisi
Posts: 75
Vhs...

Hi.

I have 3 big problems with VHS restoration.

1) Remove horizontal scratches

2) Color correction

3) Enhance details(sharpen)

Here is one frame of my video:






if only one of this problems will be completly solved , it will be a big step forward.





for any suggestions!!!

Last edited by torwart; 29th February 2012 at 18:39.
torwart is offline   Reply With Quote
Old 29th February 2012, 18:49   #2  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
Hi torwart!
Quote:
if only one of this problems will be completly solved , it will be a big step forward.
We can only solve problem partially
For remove horizontal lines see
http://forum.doom9.org/showthread.ph...287#post943287
After 5 years I have small progress, video became watchable.
yup.
yup is offline   Reply With Quote
Old 29th February 2012, 19:18   #3  |  Link
Ghitulescu
Registered User
 
Ghitulescu's Avatar
 
Join Date: Mar 2009
Location: Germany
Posts: 5,635
It's not the same, here's a typical drop out (digitally captured).

Colour corrections and sharpening are quite simple, there are plenty of scripts here. You need however to use masks, as different parts of your video need different settings.
__________________
Born in the USB (not USA)
Ghitulescu is offline   Reply With Quote
Old 29th February 2012, 20:01   #4  |  Link
torwart
Registered User
 
Join Date: Jul 2010
Location: Tbilisi
Posts: 75
for quick answers

Here is a very good script:

o=last ox=o.width() oy=o.height()

osup = o.MSuper(pel=2,sharp=2)
bv1 = osup.MAnalyse(isb=true, delta=1,blksize=8,overlap=4,search=4)
fv1 = osup.MAnalyse(isb=false,delta=1,blksize=8,overlap=4,search=4)
bc1 = o.MCompensate(osup,bv1)
fc1 = o.MCompensate(osup,fv1)

Interleave(fc1,o,bc1)
MedianblurT(0,0,0,1) # you can also use "Clense(reduceflicker=false)" instead
SelectEvery(3,1)

it helped me a lot in dirt removal and now it helps with vertical scratches. it really works.

is it better to use it with separated fields or frames?
how to make this script more powerful for horizontal scratches?(if line is thick, it(script) leaves half of it)
can i use something else instead of medianblurt? to have more detailes...
torwart is offline   Reply With Quote
Old 29th February 2012, 20:28   #5  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,230
Quote:
1) Remove horizontal scratches
Have you tried capturing using the manual tracking control on the VCR (usually the channel up/down button on the VCR itself)? That sure looks like tracking noise.

Quote:
2) Color correction
It looks like you have both chroma noise and also a chroma shift. Is this a first-generation tape? There are scripts that address each of these issues.

Quote:
3) Enhance details(sharpen)
You need to denoise before you do any sharpening. If you search in this forum for "VHS" and my user name, you will find quite a few script designed to deal with #2 and #3.
johnmeyer is offline   Reply With Quote
Old 29th February 2012, 21:07   #6  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,394
Quote:
3) Enhance details(sharpen)
The term "detail enhancement" implies that there is any detail to start with.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 1st March 2012, 15:29   #7  |  Link
torwart
Registered User
 
Join Date: Jul 2010
Location: Tbilisi
Posts: 75
I did not capture this video. one gye from tv just brought it to me and I have to do all I can to make it better. it is mpeg2 file. 720*576, 50i.

About detailes... not all the frames are like this frame.

what about script from above?? is it possible to change it for better working with horizontal lines???
torwart is offline   Reply With Quote
Old 3rd March 2012, 14:50   #8  |  Link
Tempter57
Registered User
 
Join Date: Jan 2011
Location: Ukraine, Donetsk
Posts: 34
torwart
http://forum.videohelp.com/threads/3...Avisynth/page2
Tempter57 is offline   Reply With Quote
Old 3rd March 2012, 18:45   #9  |  Link
torwart
Registered User
 
Join Date: Jul 2010
Location: Tbilisi
Posts: 75
thank you Tempter57! I tried devcr and script from that page, but lines didn't disapear. i stayed on this script:

SeparateFields()
e=SelectEven().sharpen(0.2)
o=selectOdd().sharpen(0.2)



bvo = o.MVAnalyse(isb = true, truemotion=true, delta = 1, idx = 1, overlap=4, dct=1)
fvo = o.MVAnalyse(isb = false, truemotion=true, delta = 1, idx = 1, overlap=4, dct=1)
fco = o.MVFlow(fvo, idx=1, thSCD1=500)
bco = o.MVFlow(bvo, idx=1, thSCD1=500)
interleave(fco, o, bco)
DeGrainMedian(limitY=255,limitUV=255,mode=1, norow=true)
#DeGrainMedian(limitY=255,limitUV=255,mode=1)
od=selectevery(3,1)

bve = e.MVAnalyse(isb = true, truemotion=true, delta = 1, idx = 2, overlap=4, dct=1)
fve = e.MVAnalyse(isb = false, truemotion=true, delta = 1, idx = 2, overlap=4, dct=1)
fce = e.MVFlow(fve, idx=2, thSCD1=500)
bce = e.MVFlow(bve, idx=2, thSCD1=500)
interleave(fce, e, bce)
DeGrainMedian(limitY=255,limitUV=255,mode=1, norow=true)
#DeGrainMedian(limitY=255,limitUV=255,mode=1)
ed=selectevery(3,1)

interleave(ed,od)
Weave()
sharpen(0.2)

last
o=last ox=o.width() oy=o.height()

osup = o.MSuper(pel=2,sharp=2)
bv1 = osup.MAnalyse(isb=true, delta=1,blksize=8,overlap=4,search=4)
fv1 = osup.MAnalyse(isb=false,delta=1,blksize=8,overlap=4,search=4)
bc1 = o.MCompensate(osup,bv1)
fc1 = o.MCompensate(osup,fv1)

Interleave(fc1,o,bc1)
MedianblurT(0,0,0,1) # you can also use "Clense(reduceflicker=false)" instead
SelectEvery(3,1)
separatefields
lsfmod
weave
tweak(cont=1)



спасибо
torwart is offline   Reply With Quote
Old 4th March 2012, 13:07   #10  |  Link
Tempter57
Registered User
 
Join Date: Jan 2011
Location: Ukraine, Donetsk
Posts: 34
torwart
source & output
My preset for script:
Code:
#ccd_sse2.vdf
#vdf_arguments:CamCD:0
#RemoveGrainSSE2.dll
#RemoveGrainTSSE2.dll
#RemoveDirt.dll
#RepairSSE3.dll
#Warpsharp.dll
#mvtools2.dll
#medianblur.dll
#mt_masktools-25.dll
#MT.dll
#awarpsharp2.dll
#DePulse.dll
#Gradfun2db.dll
#AddGrainC.dll
#DeHalo_alpha.avs
#RemoveColorBleeding.avs
#RemoveDirtMC.avs
#GradFunkMirror.avs
#GrainFactory3.avs
#LimitedSharpenFaster Mod.avs


setmtmode(2)
setmemorymax(640)

ConvertToRGB32()
CamCD(9,1)       # chroma denoiced & DeRainbow
#ConvertToYUY2()
#DePulse(h=20, l=70, d=32, debug=false) 
ConvertToYV12()

#  ==== VHS colorshift ====
Vshift=2  # 2 пикселя на ленте 
Hshift=0 
mergechroma(last.awarpsharp2(depth=16,thresh=255,blur=3).crop(Hshift,Vshift,0,0, align=true).addborders(0,0,Hshift,Vshift))

# RemoveColorBleeding() # Delate Colorbleeding 

#==== Remove horizontal scratches ====
source=last
RemoveDirtMC(false,10).RemoveDirt().RemoveDust(3)
crop(0,300,0,-148,true)
top = last
rdr = Overlay(source,top,y=300).tweak(sat=1.1)

# ==== Denoiced ====
pre = rdr.blur(1.5)
psup = pre.MSuper(pel=2, sharp=2)
rsup = rdr.MSuper(pel=2, sharp=2, levels=1)
vb2 = MAnalyse(psup, isb=true, truemotion=false, delta=2, blksize=16, overlap=8, dct=5)
vb1 = MAnalyse(psup, isb=true, truemotion=false, delta=1, blksize=16, overlap=8, dct=5)
vf1 = MAnalyse(psup,isb=false, truemotion=false, delta=1, blksize=16, overlap=8, dct=5)
vf2 = MAnalyse(psup,isb=false, truemotion=false, delta=2, blksize=16, overlap=8, dct=5)
den = rdr.MDegrain2(rsup,vb1,vf1,vb2,vf2,thSAD=400)

smD = mt_makediff(rdr,den,U=3,V=3)
mrg = rdr.mt_makediff(smD,U=3,V=3)
mrg_super = mrg.MSuper(pel=2,levels=1,chroma=true)
cf1 = MCompensate(mrg, mrg_super, vf1, thSCD1=400)
cb1 = MCompensate(mrg, mrg_super, vb1, thSCD1=400)
interleave(cf1, mrg, cb1)
MedianblurT(0,0,0,1) # Clense(reduceflicker=false)
SelectEvery(3,1)

# ==== Sharpening ====
DeHalo_alpha(rx=1.5, ry=1.5).LSFmod(defaults="slow", strength=240)

# ==== DeBanding & AddGrain ====
GradFunkMirror()
GrainFactory3(2,2,3,60,66,80,1.1,0.9,0.7,0,0,0,0,0,24,56,128,160)

Last edited by Tempter57; 7th March 2012 at 10:47.
Tempter57 is offline   Reply With Quote
Old 4th March 2012, 13:09   #11  |  Link
Tempter57
Registered User
 
Join Date: Jan 2011
Location: Ukraine, Donetsk
Posts: 34
torwart

Code:
# RemoveDirtMC by heini011 on 26 February 2006
# Suggested by johnmeyer on 09 June 2010
# Incorporated into Filmrestoration script by videoFred on 08 July 2010
# Fixed (vector direction) by nephilis on 01 August 2010
# Fixed (swapped parameters) by Emulgator to work with recent MVTools 2.5.10.1 on 20 September 2010
#
function RemoveDirtMC(clip clp, bool "_grey", int "limit")
{
  _grey = default(_grey, false)
  limit = default(limit, 6)
  i     = MSuper(clp, pel=2)
  bvec  = MAnalyse(i, isb=true,  blksize=8, delta=1, truemotion=true) # for a backward search isb should be "true" not "false"
  fvec  = MAnalyse(i, isb=false, blksize=8, delta=1, truemotion=true) # for a forward search isb should be "false" not "true"
  backw = MFlow(clp, i, bvec)
  forw  = MFlow(clp, i, fvec)
  clipa = interleave(backw, clp, forw)
  clipb = RemoveDirt(clipa, _grey, limit)
  clipc = SelectEvery(clipb, 3, 1)
  return clipc
}

function RemoveDirt(clip input, bool "_grey", int "repmode") 
{
  _grey     = default(_grey, false)
  repmode   = default(repmode, 16)
  clmode    = 17
  clensed   = Clense(input, grey=_grey, cache=4)
  sbegin    = ForwardClense(input, grey=_grey, cache=-1)
  send      = BackwardClense(input, grey=_grey, cache=-1)
  alt       = Repair(SCSelect(input, sbegin, send, clensed, debug=true), input, mode=repmode, modeU = _grey ? -1 : repmode) 
  restore   = Repair(clensed, input, mode=repmode, modeU = _grey ? -1 : repmode)
  corrected = RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, gmthreshold=70, dist=1, \
                                  dmode=2, debug=false, noise=10, noisy=12, grey=_grey)
  return RemoveGrain(corrected, mode=clmode, modeU = _grey ? -1 : clmode)
}	

function RemoveDust(clip input, int _mode)
{
repmode = 16
clensed = Clense(input)
rep=Repair(clensed, input, mode=repmode)
return RemoveGrain(rep, mode=_mode)
}

Last edited by Tempter57; 7th March 2012 at 10:32.
Tempter57 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 17:11.


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