Quantcast VHS restoration - AviSynth optimization / workflow ideas? - digitalFAQ Forum
  #1  
10-09-2018, 08:31 PM
adinbied adinbied is offline
Free Member
 
Join Date: Mar 2018
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Hi there,

So I know there are many (hundreds?) of posts asking about how to configure AviSynth scripts for restoring VHS captures, but I was hoping I could get some feedback/input on my workflow. So I've got a Panasonic AG-1960 VHS deck (manually cleaned heads after I got it) hooked up via S-Video to a Startech USB Capture device, which then goes to CyberLink PowerDirector and finally is recorded in AVI uncompressed with a video bitrate of ~377 Mb/s. Once I've got it digital, I then feed the video into this AviSynth script:

Code:
AVISource("\\10.0.1.242\Media\96VideoProjects\Capture.avi")
Crop(4,20,-12,-12)

### --- levels fix ---
ColorYUV(gain_y=-15,cont_u=-20)
Levels(20,1.15,255,16,245,dither=true,coring=false)

### --- first stage denoise an smoothing ---
AssumetFF()
ConvertToYV12(interlaced=true)
QTGMC(preset="medium",ChromaMotion=false,border=true,ChromaNoise=true,\
DenoiseMC=false,NoiseDeint="Generate",StabilizeNoise=true,GrainRestore=0.2)
vInverse2()

### --- Work with edges, aliasing, line twitter ---
DeHalo_Alpha(rx=2.0)
Santiag(strh=3,strv=3,type="Sangnom")

### --- 2nd stage motion/noise smoothing ----
RemoveDirtMC(30,false)
MergeChroma(aWarpSharp2(depth=30))

### --- more edge work ---
ConvertToYUY2(interlaced=false)
FixVHSOversharp(20,16,12)
FixVHSOversharp(20,8,4)

##Spot Reduction/Stage 3 Smoothing
fields=AssumeTFF().SeparateFields() # or AssumeBFF
super = MSuper(fields)
backward_vec2 = MAnalyse(super, isb = true, delta = 3, overlap=2)
forward_vec2 = MAnalyse(super, isb = false, delta = 3, overlap=2)
MDegrain1(fields, super, backward_vec2,forward_vec2,thSAD=4000)
Weave()

### --- Reinterlace, prepare for RGB color work ----
SeparateFields().SelectEvery(4,0,3).Weave()
It's been long enough now that I don't remember where I got this from, IIRC it was a combination of scripts from here. Anyway, using Mulder's x264 Launcher, I run this at x264 2-Pass at a target bitrate of 18 Mb/s and preset 'High'. That averages about 2.5-3fps on my OC'ed i5-7600K, so for a 90 minute tape, it takes a while. Anyway, once that is done, I take the lossless LPCM audio from the AVI and turn that into a .wav, which I then feed into Izotope RX Audio Editor 6. From there, I apply various filters depending on what needs doing (often a de-hum, de-clip, de-crackle, and a manual EQ) - then export that as a WAV as well. Finally, I bring the AviSynth output video and processed audio into Adobe Premiere Pro CC 2017, and fix any audio sync issues as well as add a pass of Lumetri Color Correction, adjusting white balances and saturation where needed. I then put that through Adobe Media Encoder at H264 2-Pass with a target bitrate of 6 Mb/s.

Now, I know there are several lossy->lossy transcoding steps in there, but my goal isn't to retain every ounce of detail possible, my goal is to make it look good to the eye. Anyway, there have been several issues with this setup over the last few weeks, and I've realized that maybe this isn't the best solution, idk. I'm curious what everyone on the forum has to think, and hopefully some good will come of it? As far as video samples, would a losslessly trimmed section from the avi work? Or should I re-encode it?

Also, here's a screencap from the lossless capture: https://i.imgur.com/8JjBZmC.png
And here's a screencap from my "processed" version: https://i.imgur.com/52Q0dCa.jpg

Thanks so much for your time!
adinbied
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
10-09-2018, 09:31 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 2,950
Thanks: 90
Thanked 884 Times in 763 Posts
Thanks for the photos.
Don't you know how to post short unfiltered capture samples to the forum? Just ask if you don't. As fas as I can tell the script doesn't seem appropriate for the photos.
Why is the first photo a non-standard 1024x768? Did you capture at that size? If so, why?
Why is the second photo a different size and why is it cropped?
Why are all the brights in the images blown away beyond RGB 255? Why didn't you use some sort of input signal level controls to maintain the signal within a safe video range of y=16-235? If no controls were used during capture, what sort of histogram or other aid did you use to check on y-levels during post processing?
Why are you capturing to uncompressed RGB? Haven't you heard of lossless YUY2 compression to guard against clipped darks and brights and to be easier on your CPU?

A great many other questions could be asked but, really, no one can work in scripting details from still photos. The only things I could conclude from the photos are that the input signal levels need serious correction, the color needs work, and the original tape must be in terrible shape. Otherwise you'll probably get much better advice if you post us some real video to work with.

And welcome to digitalfaq

Last edited by sanlyn; 10-09-2018 at 10:00 PM.
Reply With Quote
  #3  
10-11-2018, 06:31 PM
adinbied adinbied is offline
Free Member
 
Join Date: Mar 2018
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Hi there,
Sorry it's taken me a while to get back to you -- life's been busy. As far as the source being 1024x768, that's the highest resolution my capture device/software can handle, and while I know there isn't enough detail in VHS's to warrant the resolution, my philosophy is that it's better to capture too much detail and downscale later than to do a lower res. As far as the different size and cropping, as you can see from my AviSynth script and the source photo, I'm cropping off the bottom overscan and top warping/weirdness and so that's why the different size. Don't know about the RGB 255 stuff, I'm using PowerDirector and that's what the lossless AVI setting gave.

I now have samples (uploaded to Google Drive due to being large in file size) - with the warning to turn your volume WAAAYY the hell down before playing these - the audio off of the tape is terrible and recorded ridiculously loud.

Anyway, here we are:
Losslessly Trimmed .AVI from the source capture: https://drive.google.com/uc?export=d...E01ORG8ASVT9vK

Trimmed MP4 section after my 'restoration': https://drive.google.com/uc?export=d...5JTPo_bzUshhEN

Thanks!
Reply With Quote
  #4  
10-11-2018, 11:37 PM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 2,950
Thanks: 90
Thanked 884 Times in 763 Posts
Thank you for the sample.

Quote:
Originally Posted by adinbied View Post
Sorry it's taken me a while to get back to you -- life's been busy. As far as the source being 1024x768, that's the highest resolution my capture device/software can handle, and while I know there isn't enough detail in VHS's to warrant the resolution, my philosophy is that it's better to capture too much detail and downscale later than to do a lower res.
That might be true if you were using high-grade hardware upsampling, but you're using mediocre software that's giving you poorly resized video totally devoid of fine detail. it looks almost like anime. The cropping has also altered the aspect ratio: your sample frame is 1.33:1, but the encoded mp4 is 1.369:1. Obviously web posting and disc output formats aren't in your plans.

The uncompressed sample is very poor, but I think you can see that. The lack of detail and the severe color corruption and plastic character makes things look like a second-generation source of some kind. QTGMC is misused here, basically because your video sample isn't interlaced to begin with. It's field-blend progressive, one of the most damaging capturing methods. The damage is permanent, and it looks worse because of resizing field-blended video vertically during capture. Clipped detail is also irreparable due to clipping during capture. On top of that, chroma as well as luma is clipped. There is no way to retrieve bright data that gets lost through clipping.

The horoscopes below illustrate YUV clipping (left image) and seriously oversaturated chroma clipping in RGB (right image).


I see you've spent good money for Adobe software, so you've undoubtedly seen several types of histograms and vectorscopes that are for analysis and aids for repair. Adobe also has a ton of information in its online help about valid video levels, aspect ratios, and all that.

The image below is a sample of a field-blended frame as well as the notches, wiggles, and mice-teeth in vertical edges caused by upsampling this damaged type of frame structure.


I hesitate to get into scripting details, especially since most of the damage here can't be repaired without causing even more loss in other areas, and because the capture methods and software you're using demand a lot of otherwise unnecessary post-processing work and makes poor results inevitable.

Very few readers are going to wait for 1.3 GB of uncompressed video to download. Note that when the images and samples disappear from your off-site storage, this discussion thread will be largely meaningless.

I'd advise capture with either VirtualDub or AmarecTV. Cyberlink is notoriously inferior for resizing and rendering. I don't say this just because so many others before me have said the same thing, but because I've been the Cyberlink route myself -- and regretted every minute of it. Capturing with VirtualDub [Settings Guide]


Attached Images
File Type: png f376_YUV_RGB.png (233.2 KB, 20 downloads)
File Type: jpg f310.jpg (80.1 KB, 19 downloads)

Last edited by sanlyn; 10-11-2018 at 11:48 PM.
Reply With Quote
  #5  
10-12-2018, 12:06 AM
adinbied adinbied is offline
Free Member
 
Join Date: Mar 2018
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
OK, so I still have access to the tape - I'll see if I can re-capture it over the weekend and upload a sample of that. Do you have any tips for setting up VirtualDub for capture? The only reason I used CyberLink PowerDirector was because my initial capture device a few years back was an ION Video 2 PC, and that was the only software that recognized it. Now that I've got a slightly nicer Startech device, it should be compatible with more stuff. As far as the aspect ratio, I was only planning on distributing the files digitally and sending them as-is. Most if not all modern software media players can support weird aspect ratios, and most online video services support different aspect ratios natively. As far as DVD, well, I'm the only person I know who has a computer with a DVD drive anymore... For more info, the analog video I'm capturing from is a second-gen source (originally recorded on VHS-C then transferred to VHS), but it's all I've got. As far as the field blending - that would be something solvable by re-capturing using correct software, right? In regards to the file size and file hosting, I didn't want to put unnecessary strain on the site's server, and I saw that the max upload size was 99mb. I didn't want to re-encode the source file I'm working with (to give people a better idea of what I'm working with) and I also didn't want to trim the length too short. As for using Google Drive, it's far from perfect, but it works for now. Finally, massive thanks for sticking with me -- I'm still learning and every bit of information is helpful!
Reply With Quote
  #6  
10-12-2018, 07:03 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 2,950
Thanks: 90
Thanked 884 Times in 763 Posts
Quote:
Originally Posted by adinbied View Post
OK, so I still have access to the tape - I'll see if I can re-capture it over the weekend and upload a sample of that. Do you have any tips for setting up VirtualDub for capture?
There is a link to an updated guide in post #4, but here it is again: Capturing with VirtualDub [Settings Guide].

Quote:
Originally Posted by adinbied View Post
I'm the only person I know who has a computer with a DVD drive anymore...
That's interesting. Everyone I know has one, many have two, and some have DVD and BluRay.
Reply With Quote
  #7  
10-12-2018, 07:13 AM
lordsmurf's Avatar
lordsmurf lordsmurf is offline
Site Staff | Video
 
Join Date: Dec 2002
Posts: 7,393
Thanks: 754
Thanked 1,132 Times in 1,008 Posts
Quote:
Originally Posted by sanlyn View Post
That's interesting. Everyone I know has one, many have two, and some have DVD and BluRay.
I have 3 in my main system: 2x BD-R and 1x DVD-R.

- Did my advice help you? Then become a Premium Member and support this site.
- Find television shows, cartoons, DVDs and Blu-ray releases at the TVPast forums.
Reply With Quote
  #8  
10-13-2018, 11:07 PM
adinbied adinbied is offline
Free Member
 
Join Date: Mar 2018
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
So I've re-captured the tape using VirtualDub (had some issues with the Overlay/Preview not showing up, but I ended up disabling it because the capture worked fine anyway) here is the link to a sample encoded in HuffYUV (with the same warning about the audio) https://drive.google.com/uc?export=d...dnxDZ2kpWxFPpf .

Based on the sample, what Avisynth filters/scripting stuff do you reccomend?

Thanks!
Reply With Quote
  #9  
Yesterday, 04:52 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 2,950
Thanks: 90
Thanked 884 Times in 763 Posts
Tyhanks for the samples.

These caps look much better than the earlier ones. Keep in mind that that then source video is, to be charitable, pretty thoroughly trashed and that no one can fix everything. Still, some improvements are possible. Tonight I played with levels and color,m which in itself looks vastly better. I'll be driving all day tomorrow but will have my laptop with me this week and will be able to get on with denoising and repair.

There appeared to be no effort to control input signal levels during capture, so brights were shar-0kly clipped and highlight details were destroyed. One advantage to capture with VirtualDub is that levels can be controlled to prevent hard clipping. We've seen captures made with your USB device in other posts, so it's known that the device proc amp controls are accessible in VirtualDub. You might want to consult your Adobe Pro online documentation about safe/legal video levels.

Some of the work so far:

Original frame:


Color And Levels, mild initial denoise:



Please stay tuned.....


Attached Images
File Type: jpg Original.jpg (58.7 KB, 8 downloads)
File Type: jpg Color And Levels - mild denoise.jpg (46.0 KB, 7 downloads)

Last edited by sanlyn; Yesterday at 05:13 AM.
Reply With Quote
Reply




Tags
avisynth, restoration, vhs, workflow

Similar Threads
Thread Thread Starter Forum Replies Last Post
Video restoration newbie: Avisynth scripts? latreche34 Restore, Filter, Improve Quality 33 01-11-2017 02:05 PM
Virtualdub and Avisynth workflow and filter advice for VHS restore Zoink187 Restore, Filter, Improve Quality 11 07-23-2014 07:31 AM
VPS Optimization for Better Performance? BlueOrchard Website and Server Troubleshooting 1 01-24-2012 05:53 PM
PAL/NTSC Conversion Guide updates + de-blur restoration (add Avisynth use) admin Restore, Filter, Improve Quality 2 02-19-2011 11:42 AM

Thread Tools



 
All times are GMT -5. The time now is 01:57 PM  —  vBulletin Copyright Jelsoft Enterprises Ltd