hydra3333
17th May 2014, 02:04
Couldn't resist the British pun in the title :)
I have been given a 1987 VHS work training video which looks like an edit of an earlier version.
The only VHS capture mechanism I have is an LG RC689D which records it straight onto a DVD.
Final output will be avisynth -> HC -> DVD.
I haven't played with chroma before, so seeking your opinions.
1. What do you prefer, to fix what appears to be chroma "drop"(?) and "bleed" ?
So far the links found are
http://forum.doom9.org/showthread.php?t=165069&highlight=chroma+bleed 2012 Avoid using VirtualDub to prevent format conversions?
http://forum.doom9.org/showthread.php?t=162563&highlight=chroma+bleed 2011 Fixing chroma bleeding
http://forum.doom9.org/showthread.php?t=149361&highlight=chroma+bleed 2009 VHS Video assistance
http://forum.doom9.org/showthread.php?t=136373&highlight=chroma+bleed 2008 My PAL S-VHS clean up script
http://forum.doom9.org/showthread.php?t=132066&highlight=chroma+bleed 2007 Colour (color!) bleed solution - does this exist?
http://forum.doom9.org/showthread.php?t=116131&highlight=chroma+bleed 2006 chroma bleed (esp. red)
http://forum.doom9.org/showthread.php?t=77074&highlight=chroma+bleed 2004 Saturated colors bleed - no more
http://forum.videohelp.com/threads/352940-How-to-fix-Chroma-Bleed-with-AviSynth 2013
http://forum.videohelp.com/threads/352940-How-to-fix-Chroma-Bleed-with-AviSynth?p=2251076&viewfull=1#post2251076
MergeChroma(awarpsharp2(depth=25)) #fix chroma bleeding. tune the depth parameter to fix your specific issue
http://forum.videohelp.com/threads/352940-How-to-fix-Chroma-Bleed-with-AviSynth?p=2246571&viewfull=1#post2246571
Overlay(GreyScale(last),last,y=-updown,mode="chroma") #move chroma. where -ve=up;
Overlay(GreyScale(last),last.Sharpen(0,1.0),y=-updown,mode="chroma") #move chroma. sharpen to enhance thin colours, You might try a lower warpsharp value along with the sharpen
with http://forum.videohelp.com/threads/352940-How-to-fix-Chroma-Bleed-with-AviSynth?p=2259419&viewfull=1#post2259419
Overlay(last,last.Sharpen(0,1.0),y=-updown,mode="chroma") #move chroma. sharpen to enhance thin colours, You might try a lower warpsharp value along with the sharpen
with http://forum.doom9.org/showthread.php?p=1118591#post1118591
mergechroma(last.crop(Hshift,Vshift,0,0).addborders(0,0,Hshift,Vshift)) #move chroma. no sharpening. Vshift: The chroma in PAL VHS drops by one line per field (2 lines per frame) per generation of tape. Hshift: The chroma on some tapes may be shifted by a couple of pixels. This shifts it back.
2. The colour on faces etc appears overdone when viewed on a TV
... should I lower the gamma with Tweak or something, or would your view be to leave it with HDRAGC ?
Advice and/or pointers welcomed.
So far, I have the script below to clean it up, ex chroma fixing.
SetMTmode(mode=5,threads=4) # start with mode=5 forAVIsource http://forum.doom9.org/showthread.php?p=1067216#post1067216
SetMemoryMax(768)
MPEG2Source("T:\VHS\Training-1987-raw.d2v",info=0,ipp=true,cpu=0)
AssumeFPS(25)
AssumeTFF()
changefps(last,last,true) # http://forum.doom9.org/showthread.php?p=1473445#post1473445
SetMTmode(mode=2,threads=4)
ii0 = LAST
#
# see http://doom10.org/index.php?topic=2309.msg12233#msg12233
SeparateFields()
deblock_QED()
Weave()
AssumeTFF()
#
Crop(0,0,0,-16) # for VHS source
#
# see JohnMeyer # http://forum.doom9.org/showthread.php?p=1663043#post1663043
# Only use chroma restoration for analog source material
Cnr2("oxx",8,16,191,100,255,32,255,false) #VHS
#
# Degrain the clip using SMdegrain. It uses pre-filtered motion vectors etc ------------
# smdegrain handles interlaced
# tr=3 means mdegrain3
SMDegrain(tr=2, Contrasharp=true, RefineMotion=false, plane=4, Interlaced=true, pel=2, prefilter=3, blksize=8, overlap=4, Chroma=false)
#SMDegrain(tr=3, Contrasharp=true, RefineMotion=false, plane=4, Interlaced=true, pel=2, prefilter=3, blksize=8, overlap=4, Chroma=false)
#
# QTGMC interlaced clip delinterlacing
# Preset = "Placebo", "Very Slow", "Slower", "Slow", "Medium", "Fast", "Faster", "Very Fast", "Super Fast", "Ultra Fast", "Draft". Default "Slower"
# SLMode = (0,1,2,3,4) Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth
# Sharpness = (0.0...) How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)
# NoiseDeint (string) When noise is taken from interlaced source, how to 'deinterlace' it before restoring. "Bob" and "DoubleWeave" are fast but with minor issues: "Bob" is coarse and "Doubleweave" lags by one frame. "Generate" is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects "DoubleWeave"
# StabilizeNoise (bool) Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for "Generate" mode
#QTGMC(Preset="Slow",EdiThreads=4,Sharpness=1.2,SLMode=1) # result is double framerate progressive, so re-interlate it later
#QTGMC(Preset="Slower",EdiThreads=4,Sharpness=1.2,SLMode=1) # result is double framerate progressive, so re-interlate it later
#QTGMC(Preset="Very Slow",EdiThreads=4,Sharpness=1.2,SLMode=1) # result is double framerate progressive, so re-interlate it later
#QTGMC(Preset="Very Slow",EdiThreads=4,SLMode=2,EZKeepGrain=1.2,NoiseProcess=2) # result is double framerate progressive, so re-interlate it later
# hmm... where did I get this QTGMC ? was it johnnymeyer ?
#QTGMC(Preset="Slow", EdiThreads=4, SLMode=1, NoiseDeint="Generate", StabilizeNoise=true) # result is double framerate progressive, so re-interlate it later
#
QTGMC( Preset="Slower",SLMode=2,Sharpness=1.2,NoiseProcess=2,GrainRestore=0.4,NoiseRestore=0.2,Sigma=1.8,NoiseDeint="Generate",StabilizeNoise=true) # result is double framerate progressive, so re-interlate it later
#
unsharpmask(60,3,0)
LimitedSharpenFaster(smode=4,strength=100)
#
## HDRAGC apparently can't be used inside MT or AGC will be calculated differently in each slice
#SetMTmode(mode=5,threads=4)
#HDRAGC()
#HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=0.75, corrector=0.8, reducer=2.0, black_clip=1.0)
#maybe this one -- HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0)
#HDRAGC(coef_gain=0.1, min_gain=0.2, max_gain=1.0, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0)
#HDRAGC(coef_gain=0.2, min_gain=0.2, max_gain=1.0, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0) # default. +coef_gain=brighter decrease to limit. +coef_sat=more saturation
#HDRAGC(coef_gain=0.3, min_gain=0.2, max_gain=1.0, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0) # default. +coef_gain=brighter decrease to limit. +coef_sat=more saturation
#HDRAGC(coef_gain=0.5, min_gain=0.5, max_gain=2.0, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0) # default. +coef_gain=brighter decrease to limit. +coef_sat=more saturation
#HDRAGC(coef_gain=1.0, coef_sat=1.0) # default. +coef_gain=brighter decrease to limit. +coef_sat=more saturation
#HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0)
#SetMTmode(mode=2,threads=4)
#
# Re-Interlace and halve framerate
AssumeTFF()
Blur(0,0.25).SeparateFields().SelectEvery(4,0,3).Weave() #reinterlace - ASSUMED TFF HERE # BLUR(0,1) per http://forum.doom9.org/showthread.php?p=1488308#post1488308
#
#AddBorders (clip, int left, int top, int right, int bottom, int "color")
addborders(0,0,0,16) # for the VHS-C cassettes only
#
AssumeTFF()
AssumeFPS(25)
ii1 = LAST
#
# ----------- START compare
boxify8(ii0,"original",ii1,"deblock+cnr2+degrained+qtgmc+unsharpmask") ++ ii0
# ----------- END compare
Converttoyv12()
##### "HC uses custom avisynth routines, you have to add Distributor() to the end of the script."
#Distributor() # use this when using HC and SetMTmode, per http://forum.doom9.org/showthread.php?p=1063622#post1063622
# http://forum.doom9.org/showthread.php?p=1067589#post1067589
# ChangeFPS(Last, Last, True) makes fast scripts faster and slow scripts slower
#ChangeFPS(Last, Last, True) # use this when using HC and SetMTmode, per http://forum.doom9.org/showthread.php?p=1064118#post1064118
#SetPlanarLegacyAlignment(True) #crashes avisynth when NNEDIx is used ina script
Distributor()
#
# Clip Display Comparison functions
#
Function boxify4(Clip a, string asub, Clip b, string bsub) { snip }
Function boxify8(Clip a, string asub, Clip b, string bsub) { snip }
edit: I'm beginning to think some clips within the video have larger offsets than others, eg the hands in the first attached image are offset more to the right.
I have been given a 1987 VHS work training video which looks like an edit of an earlier version.
The only VHS capture mechanism I have is an LG RC689D which records it straight onto a DVD.
Final output will be avisynth -> HC -> DVD.
I haven't played with chroma before, so seeking your opinions.
1. What do you prefer, to fix what appears to be chroma "drop"(?) and "bleed" ?
So far the links found are
http://forum.doom9.org/showthread.php?t=165069&highlight=chroma+bleed 2012 Avoid using VirtualDub to prevent format conversions?
http://forum.doom9.org/showthread.php?t=162563&highlight=chroma+bleed 2011 Fixing chroma bleeding
http://forum.doom9.org/showthread.php?t=149361&highlight=chroma+bleed 2009 VHS Video assistance
http://forum.doom9.org/showthread.php?t=136373&highlight=chroma+bleed 2008 My PAL S-VHS clean up script
http://forum.doom9.org/showthread.php?t=132066&highlight=chroma+bleed 2007 Colour (color!) bleed solution - does this exist?
http://forum.doom9.org/showthread.php?t=116131&highlight=chroma+bleed 2006 chroma bleed (esp. red)
http://forum.doom9.org/showthread.php?t=77074&highlight=chroma+bleed 2004 Saturated colors bleed - no more
http://forum.videohelp.com/threads/352940-How-to-fix-Chroma-Bleed-with-AviSynth 2013
http://forum.videohelp.com/threads/352940-How-to-fix-Chroma-Bleed-with-AviSynth?p=2251076&viewfull=1#post2251076
MergeChroma(awarpsharp2(depth=25)) #fix chroma bleeding. tune the depth parameter to fix your specific issue
http://forum.videohelp.com/threads/352940-How-to-fix-Chroma-Bleed-with-AviSynth?p=2246571&viewfull=1#post2246571
Overlay(GreyScale(last),last,y=-updown,mode="chroma") #move chroma. where -ve=up;
Overlay(GreyScale(last),last.Sharpen(0,1.0),y=-updown,mode="chroma") #move chroma. sharpen to enhance thin colours, You might try a lower warpsharp value along with the sharpen
with http://forum.videohelp.com/threads/352940-How-to-fix-Chroma-Bleed-with-AviSynth?p=2259419&viewfull=1#post2259419
Overlay(last,last.Sharpen(0,1.0),y=-updown,mode="chroma") #move chroma. sharpen to enhance thin colours, You might try a lower warpsharp value along with the sharpen
with http://forum.doom9.org/showthread.php?p=1118591#post1118591
mergechroma(last.crop(Hshift,Vshift,0,0).addborders(0,0,Hshift,Vshift)) #move chroma. no sharpening. Vshift: The chroma in PAL VHS drops by one line per field (2 lines per frame) per generation of tape. Hshift: The chroma on some tapes may be shifted by a couple of pixels. This shifts it back.
2. The colour on faces etc appears overdone when viewed on a TV
... should I lower the gamma with Tweak or something, or would your view be to leave it with HDRAGC ?
Advice and/or pointers welcomed.
So far, I have the script below to clean it up, ex chroma fixing.
SetMTmode(mode=5,threads=4) # start with mode=5 forAVIsource http://forum.doom9.org/showthread.php?p=1067216#post1067216
SetMemoryMax(768)
MPEG2Source("T:\VHS\Training-1987-raw.d2v",info=0,ipp=true,cpu=0)
AssumeFPS(25)
AssumeTFF()
changefps(last,last,true) # http://forum.doom9.org/showthread.php?p=1473445#post1473445
SetMTmode(mode=2,threads=4)
ii0 = LAST
#
# see http://doom10.org/index.php?topic=2309.msg12233#msg12233
SeparateFields()
deblock_QED()
Weave()
AssumeTFF()
#
Crop(0,0,0,-16) # for VHS source
#
# see JohnMeyer # http://forum.doom9.org/showthread.php?p=1663043#post1663043
# Only use chroma restoration for analog source material
Cnr2("oxx",8,16,191,100,255,32,255,false) #VHS
#
# Degrain the clip using SMdegrain. It uses pre-filtered motion vectors etc ------------
# smdegrain handles interlaced
# tr=3 means mdegrain3
SMDegrain(tr=2, Contrasharp=true, RefineMotion=false, plane=4, Interlaced=true, pel=2, prefilter=3, blksize=8, overlap=4, Chroma=false)
#SMDegrain(tr=3, Contrasharp=true, RefineMotion=false, plane=4, Interlaced=true, pel=2, prefilter=3, blksize=8, overlap=4, Chroma=false)
#
# QTGMC interlaced clip delinterlacing
# Preset = "Placebo", "Very Slow", "Slower", "Slow", "Medium", "Fast", "Faster", "Very Fast", "Super Fast", "Ultra Fast", "Draft". Default "Slower"
# SLMode = (0,1,2,3,4) Sharpness limiting: 0 = off, [1 = spatial, 2 = temporal] : before final temporal smooth, [3 = spatial, 4 = temporal] : after final temporal smooth
# Sharpness = (0.0...) How much to resharpen the temporally blurred clip (default is always 1.0 unlike original TGMC)
# NoiseDeint (string) When noise is taken from interlaced source, how to 'deinterlace' it before restoring. "Bob" and "DoubleWeave" are fast but with minor issues: "Bob" is coarse and "Doubleweave" lags by one frame. "Generate" is a high quality mode that generates fresh noise lines, but it is slower. Unknown value selects "DoubleWeave"
# StabilizeNoise (bool) Use motion compensation to limit shimmering and strengthen detail within the restored noise. Recommended for "Generate" mode
#QTGMC(Preset="Slow",EdiThreads=4,Sharpness=1.2,SLMode=1) # result is double framerate progressive, so re-interlate it later
#QTGMC(Preset="Slower",EdiThreads=4,Sharpness=1.2,SLMode=1) # result is double framerate progressive, so re-interlate it later
#QTGMC(Preset="Very Slow",EdiThreads=4,Sharpness=1.2,SLMode=1) # result is double framerate progressive, so re-interlate it later
#QTGMC(Preset="Very Slow",EdiThreads=4,SLMode=2,EZKeepGrain=1.2,NoiseProcess=2) # result is double framerate progressive, so re-interlate it later
# hmm... where did I get this QTGMC ? was it johnnymeyer ?
#QTGMC(Preset="Slow", EdiThreads=4, SLMode=1, NoiseDeint="Generate", StabilizeNoise=true) # result is double framerate progressive, so re-interlate it later
#
QTGMC( Preset="Slower",SLMode=2,Sharpness=1.2,NoiseProcess=2,GrainRestore=0.4,NoiseRestore=0.2,Sigma=1.8,NoiseDeint="Generate",StabilizeNoise=true) # result is double framerate progressive, so re-interlate it later
#
unsharpmask(60,3,0)
LimitedSharpenFaster(smode=4,strength=100)
#
## HDRAGC apparently can't be used inside MT or AGC will be calculated differently in each slice
#SetMTmode(mode=5,threads=4)
#HDRAGC()
#HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=0.75, corrector=0.8, reducer=2.0, black_clip=1.0)
#maybe this one -- HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0)
#HDRAGC(coef_gain=0.1, min_gain=0.2, max_gain=1.0, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0)
#HDRAGC(coef_gain=0.2, min_gain=0.2, max_gain=1.0, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0) # default. +coef_gain=brighter decrease to limit. +coef_sat=more saturation
#HDRAGC(coef_gain=0.3, min_gain=0.2, max_gain=1.0, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0) # default. +coef_gain=brighter decrease to limit. +coef_sat=more saturation
#HDRAGC(coef_gain=0.5, min_gain=0.5, max_gain=2.0, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0) # default. +coef_gain=brighter decrease to limit. +coef_sat=more saturation
#HDRAGC(coef_gain=1.0, coef_sat=1.0) # default. +coef_gain=brighter decrease to limit. +coef_sat=more saturation
#HDRAGC(coef_gain=0.1, min_gain=0.1, max_gain=0.5, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0)
#SetMTmode(mode=2,threads=4)
#
# Re-Interlace and halve framerate
AssumeTFF()
Blur(0,0.25).SeparateFields().SelectEvery(4,0,3).Weave() #reinterlace - ASSUMED TFF HERE # BLUR(0,1) per http://forum.doom9.org/showthread.php?p=1488308#post1488308
#
#AddBorders (clip, int left, int top, int right, int bottom, int "color")
addborders(0,0,0,16) # for the VHS-C cassettes only
#
AssumeTFF()
AssumeFPS(25)
ii1 = LAST
#
# ----------- START compare
boxify8(ii0,"original",ii1,"deblock+cnr2+degrained+qtgmc+unsharpmask") ++ ii0
# ----------- END compare
Converttoyv12()
##### "HC uses custom avisynth routines, you have to add Distributor() to the end of the script."
#Distributor() # use this when using HC and SetMTmode, per http://forum.doom9.org/showthread.php?p=1063622#post1063622
# http://forum.doom9.org/showthread.php?p=1067589#post1067589
# ChangeFPS(Last, Last, True) makes fast scripts faster and slow scripts slower
#ChangeFPS(Last, Last, True) # use this when using HC and SetMTmode, per http://forum.doom9.org/showthread.php?p=1064118#post1064118
#SetPlanarLegacyAlignment(True) #crashes avisynth when NNEDIx is used ina script
Distributor()
#
# Clip Display Comparison functions
#
Function boxify4(Clip a, string asub, Clip b, string bsub) { snip }
Function boxify8(Clip a, string asub, Clip b, string bsub) { snip }
edit: I'm beginning to think some clips within the video have larger offsets than others, eg the hands in the first attached image are offset more to the right.