Hey all,
I found a ~35yr old tape of one of my dad's concerts, gave me my first real restoration challenge. Headed for NTSC DVD, captured in lossless YUV2/PCM.
Here's my progress so far:
- Removed temporal and chroma noise
- Masked very noisy/distorted edges 16px (I assume this is the best way to go, they look beyond repair to me)
- Fixed really bad chromashift/bleed
- Sharpened just slightly
- Tweaked hue, contrast and saturation slightly.
I'm looking for any input/improvements on the above, and also specifically:
- Horizontal lines throughout--no idea how to address these
- Color correction. This is where I'm basically lost. I used some tweak() options, and spent a few minutes in ColorYUV(), but quickly fell off the wagon there. I really appreciate any help I can get!
Script:
Thanks everyone.Code:SetMTMode(2,8) SetMemoryMax(1500) Loadplugin("C:\Program Files\AviSynth 2.5\plugins\MVTools\mvtools2.dll") LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\CNR\Cnr2.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\aWarpSharp\aWarpSharp.dll") LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\AutoAdjust\AutoAdjust.dll") LoadPlugin("c:\Program Files\AviSynth 2.5\plugins\ffms2\ffms2.dll") LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ChromaShift\ChromaShift.dll") source=AviSource("source.avi") source=source.ConvertToYV12(interlaced=true, matrix="Rec601") source=source.LanczosResize(720,480) source.killaudio() source.AssumeTFF() original=source # Fix Chroma shift source=ChromaShift(C=-2,L=-4) # Deal with nasty edges source=source.crop(16, 0, -16, -16).AddBorders(16, 0, 16, 16, color=$000000) # Sharpen a bit source=source.aWarpSharp(depth=4) # Fix Chroma bleed source=MergeChroma(source,awarpsharp2(source,depth=50)) # Fix color source=source.tweak(hue=15, cont=1.3, sat=1.1, coring=false) # Remove VHS noise chroma=source.Cnr2("oxx",8,16,191,100,255,32,255,false) #VHS output=MDegrain2i2(chroma,8,2,0) StackHorizontal(original, output) #return original #------------------------------- function MDegrain2i2(clip source, int "blksize", int "overlap", int "dct") { Vshift=2 # 2 lines per bobbed-field per tape generation (PAL); original=2; copy=4 etc Hshift=0 # determine experimentally overlap=default(overlap,0) # overlap value (0 to 4 for blksize=8) dct=default(dct,0) # use dct=1 for clip with light flicker fields=source.SeparateFields() # separate by fields #This line gets rid of vertical chroma halo. Don't use unless you have the problem #fields=MergeChroma(fields,crop(fields,Hshift,Vshift,0,0).addborders(0,0,Hshift,Vshift)) super = fields.MSuper(pel=2, sharp=1) backward_vec2 = super.MAnalyse(isb = true, delta = 2, blksize=blksize, overlap=overlap, dct=dct) forward_vec2 = super.MAnalyse(isb = false, delta = 2, blksize=blksize, overlap=overlap, dct=dct) backward_vec4 = super.MAnalyse(isb = true, delta = 4, blksize=blksize, overlap=overlap, dct=dct) forward_vec4 = super.MAnalyse(isb = false, delta = 4, blksize=blksize, overlap=overlap, dct=dct) #Increase thSAD for more denoising. Won't do much beyone about 1500 MDegrain2(fields,super, backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=700) Weave() }
Edit: Added a few seconds of source (sample-huffyuv.avi) and output (output.m2v)
+ Reply to Thread
Results 1 to 24 of 24
-
Last edited by diprotic; 2nd Mar 2015 at 08:59.
-
plenty of errors.
source footage is interlaced, the filters chromashift,chromableed,sharpen etc.. should take that into consideration
crop+addborders should be at the end of your script
try this instead:
AviSource("source.avi")
assumetff()
separatefields
A=Last
B=A.Greyscale()
Overlay(B,A,X=0,Y=-2,Mode="Chroma") # change Y X values at will
weave()
ConverttoRGB32(matrix="rec601",interlaced=true)
separatefields()
#### CCD COLOR DENOISING :
LoadVirtualDubPlugin("C:\Program Files (x86)\virtualdubmod1.5\plugins\Camcorder_Color_Den oise_sse2.vdf", "CCD", 1)
CCD(15,1)
weave()
mdegrain2i2(4,0)*** DIGITIZING VHS / ANALOG VIDEOS SINCE 2001**** GEAR: JVC HR-S7700MS, TOSHIBA V733EF AND MORE -
Well.....good first effort, but a a coupe of pointers to start:
* -Don't resize interlaced video. And don't use Lanczos. SPline36Resize can do it without Lanczos artifacts.
* -Resize after cleanup, not before or during.
themaster1 has the right idea. But tell the truth, we can't really get into detail with still images. The pics do show, of course, that you have work to do -- they also show the video is oversaturated and brights are clipped. You can upload video samples in the forum. We would need just a few seconds of unprocessed original capture with motion of some kind (someone moving, waving, some kind of motion), losslessly compressed with huffyuv or Lagarith to reduce the sample size. Keep the original's YUY2 color and don't put the sample through any processing. If you need instructions on this, just ask.
We also need a little more detail on the video player and capture device. As for resizing, borders, etc., I think we'd have a similar but better suggestion. But we need a sample to go any further.
[EDIT] Just taking your script, it can be simplified the following way (below). Not saying it's the best way to to work the video -- I'd use something different, and themaster1 and others likely would take a different course.
Code:# --- This version assumes working with video at original size --- # --- for demo only. Resize the final output later. -------------- AviSource("source.avi").killaudio() ConvertToYV12(interlaced=true, matrix="Rec601") AssumeTFF() original=last original MDegrain2i2((last,8,2,0) SeparateFields() Cnr2("oxx",8,16,191,100,255,32,255,false) #VHS ChromaShift(C=-2,L=-4) tweak(hue=15, cont=1.3, sat=1.1, coring=false) MergeChroma(source,awarpsharp2(source,depth=50)) aWarpSharp(depth=4) Weave() Crop(8,0,-8,-8).AddBorders(8,4,8,4) output=last StackHorizontal(original,output) return last
Last edited by LMotlow; 2nd Mar 2015 at 08:26.
- My sister Ann's brother -
@newpall: done! Added source video and output to OP.
@LMotlow:
Wow, thanks for the tips. I'm pretty proud of my first try, but I'm here to learn and I really appreciate anything you all can offer. If that means throwing out all my work and taking a different approach, absolutely.
The video player is a pretty recent Sony consumer grade deck with S-Video out. The capture card is a Bt878. Capped in VirtualVCR as YUY2 at 640x480 using default card settings. I can't afford a really nice TBC, proc amp, and detailer right now.. I will of course keep all my source tapes in case that changes, I can redo the work. -
Thanks for the info and the sample. Looks like your (our) work is cut out for you (us), LOL!
Yep, a line tbc is a necessity. VCR's with those built-in are hard to find, but they're around. In good condition, they're kinda pricey. Many here use a Panasonic ES1- or ES15 as a tbc pass-thru unit. Not as good at cleaning chroma as a top-end JVC or Panasonic pro machine, but a lot better than nothing, and cheaper than a lab tbc. There's a long standing thread on the subject here, with lots of techy stuff and graphs: https://forum.videohelp.com/threads/319420-Who-uses-a-DVD-recorder-as-a-line-TBC-and-what-do-you-use.- My sister Ann's brother -
That seems to be a multi-generation copy: the chroma drops one line per field (two lines per frame) each time you dub VHS. Do you have an earlier generation tape? Try to find one if at all possible.
Apart from the white balance of the original recording, that's not bad. If it's really from 1980, it's doing quite well.
I tend to use a line TBC for everything by default (unless it clearly makes it worse) but honestly, that footage doesn't scream out for one. It will make a small difference, but not a huge one. You're lucky with how well this tape plays.
The pattern of noise is a bit strange. It's like the chroma phase error alternates each field. Is it really on the tape, or is it being introduced when capturing, either by the VCR or interference on the cables or in the card? You do get noise just like that on VHS tapes, but you can also get noise like that due to other issues, so it's worth checking.
I'd add a little bit of the luma noise back in at the end.
I'd encode it to 704x480, not 720x480. If it wasn't interlaced (or the output wasn't interlaced), I'd just resize the good part of the picture to fill that (it'll be near enough the right shape) - but as it is interlaced and going onto DVD, I'd crop and add borders to put the wanted picture into the middle of the frame, not the top, without breaking the interlacing.
Hope this helps.
Cheers,
David. -
It obviously need white balancing, assuming the visible page of the book on the left top is white the temperature needs to go down while the tint needs to go up.
-
Hey David, thanks for your time! BTW that was my dad's name.
The tape's label says "duplicate." Honestly it's a miracle I even have this tape, I doubt I will ever see anything like it.
The tape's label also says 12/28/1980, and everything I know about the concert suggests that's accurate.
I've captured another, much more recent, VHS tape on this exact setup without the horizontal line artifacts, so I don't suspect the hardware.
As far as the luma noise and scaling, can you give me an AVS example? I think I'm following, but I could use some help.
Thanks again! -
-
-
-
For a quick run, see attached mpg. I'm with newpball, some color work requires a few elements beyond YUV. But I use the original YUV for basic levels and corrections that get too hairy in RGB. I used Avisynth for the basics, then VirtualDub. Needs some tweaking (kinda busy around here this a.m.), probably add back some noise and some tricky sharpening. Will tweak later and try to find my notes on what the heck I did. Main denoisers were QTGMC, a modified MDeGrain2 from 2BDecided a while back, SmoothUV, and Virtualdub's temporalsmoother. If I did it again, likely half of it would change. Will have to tone down all those filters later, it's over smoothed now. Color was a quick fix with AfterEffects, then transposed the settings to VDub's gradation curves and ColorMill (could stand to tweak that, too).
- My sister Ann's brother -
-
Last edited by diprotic; 2nd Mar 2015 at 11:32.
-
You have blacks crushed at Y=16. You might be able to tease more detail out of those darks by adjusting the capture device's video proc amp. That would be my first priority. A good head cleaning might help with the horizontal stripes in the luma. Get the best capture you can. Then worry about filtering.
-
Some of those white dropouts drove me bonkers.
Been busy. During the starting zoom in, note line shimmer in the wooden blanks (calmed a bit with Avisynth). Note shimmer in the big book on the wall on the left. A line tbc is designed to fix this stuff. Can't be fixed after capture. Notice hard and grainy shadows in dad's face and shirt, hot spots on face -- coming from the VCR. Sharpeners make it worse, so I kept light -- smears, fuzzy motion, low detail, these don't sharpen well at all. Objects shift and warp during movement (bad VCR alignment). Still some bad interlace in the original and what looks like dot crawl. You need a better VCR. And ye olde tbc needed!.
Code:AviSource("Drive:\path to video\sample-huffyuv.avi") # <- adjust for location in your system. ConvertToYV12(interlaced=true) AssumeTFF().QTGMC(preset="very fast",sharpness=0.8) vInverse() # --- crop borders + bottom noise, restore frame to mod-8 ---- Crop(8,0,-8,-14).AddBorders(0,2,0,4) # --- Fix levels a bit, bring up shadows, dither to avoid banding. ----- ColorYUV(gain_y=25) SmoothLevels(12, 1.0, 255, 16, 245, chroma=200,limiter=0,tvrange=true,dither=100,protect=6) # --- Clean some of the color noise. ----- Cnr2("oxx",8,16,191,100,255,32,255,false) ChromaShift(L=-4) # --- Some denoising. Clean even and odd frames separately to catch dropouts---- source=last e=Source.SelectEven().MDegrain2_mod() o=Source.SelectOdd().MDegrain2_mod() Interleave(e,o) # --- Calm more noise and motion shimmer, tighten up edges (use old warpsharp) --- TemporalSoften(4,4,8,15,2) mergechroma(aWarpSharp(depth=20.0, thresh=0.75, blurlevel=2, cm=1)) # ---- resize to final output, keep 4:3 image DAR ---- Crop(0,2,0,-4).Spline36Resize(704,472).AddBorders(0,4,0,4) #<- ---704x480 --- # ---- anti-banding, smooth clay-face effect, mild sharpen, add noise --- GradFun2DBmod(thr=1.5,mask=false) LimitedSharpenFaster(strength=75) grainfactory3(g1str=1, g2str=1, g3str=1) AddGrainC(2.0, 2.0) # ---- Reinterlace, prepare for VirtualDub filters ---- AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave() ConvertToRGB32(matrix="Rec601",interlaced=true) return last #----------------------------- Function MDegrain2_mod(clip) { super = clip.MSuper(pel=2, sharp=1) backward_vec2 = MAnalyse(super, isb = true, delta = 2, blksize=8, overlap=4, dct=0) backward_vec1 = MAnalyse(super, isb = true, delta = 1, blksize=8, overlap=4, dct=0) forward_vec1 = MAnalyse(super, isb = false, delta = 1, blksize=8, overlap=4, dct=0) forward_vec2 = MAnalyse(super, isb = false, delta = 2, blksize=8, overlap=4, dct=0) MDegrain2(clip,super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400) return last }
- CDD_sse2.vdf (Camcorder Color Denoise)
- TemporalSmoother (VirtualDub built-in, level=2)
- curves.primary correction: vdf (gradation curves)
- secondary correction: curves.vdf (gradation curves)
- saturated green: hue.vdf (Hue/Satuation_Intensity, by Donald Graft)
- levels/midlevels: ColorMill.vdf (ColorMill)
A .vcf file of the VDub settings is attached. In VirtualDub use "File..." -> "load processing settings", navigate to the vcf file, and click OK or whatever. Wiullload the filters and settings named. The filters must be in your VirtualDub plugins. I set Virtual output after filtering to YV12 with the lossless Lagarith compressor. Many versions of huffyuv won't handle YV12.
Corrections and levels determined with help of ColorTools histogram and CSAmp,exe pixel reader. Color is subjective and personal. Feel free to play.Last edited by LMotlow; 4th Mar 2015 at 09:53.
- My sister Ann's brother -
@LMotlow Wow. I'm not quite sure how to thank you. Far above anything I was able to achieve.
So, I see both VirtualDub settings and an avisynth script. I'm not 100% on how to run my source through all that. What I've done so far is just feed the .avs right into HC. Do I feed the avs into VDub, then somehow into HC? Or did you go straight to mpeg2 from vdub?
Also: let's talk about capture, since it seems that is the only thing holding this back. I can't afford anything really high end, even more so since this will likely be my only serious restoration job. Is there any service available (possibly from this forum) to do proper captures? I would part with some $$ to get a high quality cap seeing as this source is 35 years old, and it may be some time before I could afford a proper setup.
Thanks again, very much! -
Last edited by jagabo; 4th Mar 2015 at 12:03. Reason: typo
-
Workflow dependas a lot on how troublesome the video is.
A clip like this is lots of trouble. I edit and sometimes re-encode lots of cable TV DVD and HD recordings. Never yet seen the need for all the cleanup VHS is so hungry for, but I'm still working a lot of old tapes. Most of what I learned came from a handful of members here, some of them no longer around (phooey).
With this clip I first tried several cleanup routines and made a bunch of tests, but kept only the best compromise. That cleanup was scripts running in Virtualdub. You can hit F2 or "File..." -> "reopen video" after making script changes and VDub will reopen to the frame you were looking at. When I got what I wanted (I never do, really, just the best I can muster) and if I know I need RGB for more work, I save that file as RGB with Lagarith. Then open that saved work directly in VDub, do what has to be done, and save the results as YV12 for the encoder. Save the VDub settings as a .vcf. If I'm using HCenc, I make a quickie one-line .avs script to just open the file and let HCenc have it. Trying to do it all in one step with heavy filters and trials and tests is real torture. I use several encoders, so I seldom feed files directly from VirtualDub. I keep changing my mind with the encoders, too. The sample I posted was encoded with TMPGenc Plus 2.5. I could use something else, but I happened to have it open on the desktop.
Once you get the kinks worked out, it's usually possible to run it all at one time: run the script in VirtualDub and load VDub's filters at the same time.
.
Getting a good VCR is a trek. I have 4, collected over the years from eBay and a pro repair shop, and burned up a couple of duds on the way. We're going back 12 years with this stuff. I have some 1996 and 1998 Panasonics, two of them legacy SVHS PV-S4670's from 1996, and a couple of component only players, all with Dynamorphous heads. Not dirt cheap, but affordable. The big gun is my AG-1980, but those beasts are such a hassle, mine was repaired 3 times in 3 years! In general, VCR's started going downhill rapidly after 1998.
Oh. Forgot the ancient SONY. I had a 1991 SLV-585HF that lasted 9 years (motherboard RIP). Six years later I found one that was pretty clean, but needed work. Had it rebuilt by a guy in Florida, recommended by former member sanlyn. I use it mostly for old tapes I recorded on my old '585' in the early 90's. Sad to say, SONY never again made VCR's as capable as the old 585's and 695's from the early 90's. That 585 and most of the Pannies have no line tbc, so I hook up a used Panasonic ES15 as tbc pass-thru. The capture card is an old ATI AGP All In Wonder in a cheapie XP PC I built from spare parts.
Why use multiple VCR's? You never can tell how a tape plays in one VCR over another until you try. Yes, you do see different results. Often an old tape doesn't look so great in the pricey AG-1980.
Yep, finding VCR's is the hassle of a lifetime, but you still see goodies now and then. Member Orsetto has dozens of posts about VCR's, mainstream, prosumer, and pro, so you might want to search out his posts. I've had good luck following his advice.
jagabo mentioned a proc amp. Usefull stuff, but the cheapies are real junk. I use mine to set levels during capture (an old Sign Video PA-100 with its luminance meter, which is worth the price of admission all by itself). Color correction during VHS capture is a total pain in the neck, and often futile. VHS changes color balance and levels almost by the minute. If you have the same color problem thru the tape, a proc amp is useful, but you also have a few filters in many capture cards that VirtualDub can hook into during capture. I also use VDub's histogram during capture to check levels....or as jajagbno says, try your capture device proc amp.
Keeping VCR hassles in mind, a member here (lordsmurf) runs a capture service with other pro's that comes highly recommended. Contact his outfit at www.digitalfaq.com. Several services offered include VHS to lossless AVI. Lots of "services" around but the only thing that's "pro" with many is the price. Some will cap VHS to DV, which you don't want when you can get lossless at the same price or less.
I keep thinking what you could get from that old tape with a better VCR and tbc, despite the aging problems. Thank goodness most tapes don't need so much fixin'.
Last edited by LMotlow; 4th Mar 2015 at 12:01.
- My sister Ann's brother -
@jagabo: I did a re-cap after tweaking the bt878's proc amp and got much better colors and levels. I'm didn't examine it close enough to see if it addresses anything that LMotlow talks about (the "shimmering" especially).
@LMotlow: Many thanks again. I have some hard thinking to do. I really enjoy the process of restoration, but enjoyment isn't the top priority here. Preserving and restoring one of the best memories I have of my dad is the top priority, so I'm inclined to just let lordsmurf do what he does best. I checked his site and it sounds like that's exactly what I really need, at a reasonable price. There's no way I can compete with his skill (and gear).
Either way, I will really enjoy tinkering with the script and settings you gave me. One way or the other I'd really like to do a best-effort encode with my current setup, just to satisfy my curiosity. Even if the pros handle the real work, I can still have some fun -
Thanks for the recommendation.
Yes, sadly, many are "pro" in name only. The recession killed off many of the hucksters, but some do persist. I have some great "us vs. them" comparisons that I'll be publishing here this spring. It's dreadful stuff. How many video "pros" have actually worked for studios? (Like I have!) Not many! You must be careful who you pay for video work.Want my help? Ask here! (not via PM!)
FAQs: Best Blank Discs • Best TBCs • Best VCRs for capture • Restore VHS