digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Capture, Record, Transfer (https://www.digitalfaq.com/forum/video-capture/)
-   -   Restoring a bunch of VHS workout videos? (https://www.digitalfaq.com/forum/video-capture/9173-restoring-bunch-vhs.html)

nai1ed 11-19-2018 09:52 AM

Restoring a bunch of VHS workout videos?
 
Okay, my wife has tasked me with transferring all her old VHS workout tapes to DVD or Plex. Luckily being an IT person had already had tons of hardware at my disposal, but I want to get the best possible output with what I have. I recently purchased some additional equipment such as

JVC SR-V101US - This VHS works great and I think will be the main unit.
JVC HR-S3912U - Got this real cheap and works great but no TBC.
Elite Video Broadcast BVP-4plus - Just ordered this, heard it works great to restore color.
Panasonic DMR-ES15 - I read this is the unit to have for its TBC passthrough.

Equipment I already own.

I have a bunch of different capture cards.
Several Hauppauge cards - MCE150, HVR 1600, and HVR1250
Diamond VC500 USB, ATI AIW 9600(AGP) and X600(PCIE), and ATI Theater 650 PCIe. Also have some older ATI AIW Rage Pro and Avermedia 150 PCI cards, plus a bunch of DVR cards for surveillance systems.

I have tons of motherboards and could build a dedicated PC, but I have this HP T620 thinclient with PCIE slot that I'd love to use with the ATI Theater 650.

I guess my questions is would the ATI theater 650 be my best choice? I don't think it supports capture to AVI with virtualdub but I do like the color filters this card has compared to some others I've used. Right now I'm using Pinnacle Studio 12 to capture with. Building a Windows XP machine is a real pain dealing with drivers and updates and software compatibility. As I mentioned earlier, I do like this HP T620 running Windows 7 64bit, it makes for a very slick PC.

Any thoughts?

Thanks

Brian

sanlyn 11-20-2018 03:55 AM

Welcome to the forum.

Quote:

Originally Posted by nai1ed (Post 57348)
Okay, my wife has tasked me with transferring all her old VHS workout tapes to DVD or Plex.

You're from IT, right? So am I. I don't trust servers. Also, DVD and servers have two different media requirements. One solution is to capture to a format that lets you archive a trusted and true-copy master and go in any direction from there. That means capture to lossless media.

Quote:

Originally Posted by nai1ed (Post 57348)
I want to get the best possible output with what I have.

Are you sure? It might be a good idea to clarify what you mean by "best possible", as a great many people use that exact term to describe entirely different concepts. I ask at this point, because this statement can come back to haunt you when it confuses readers who'd like to reply in detail but can't do so unless they know what you really mean. Many people use such terms without knowing what high quality is, what it looks like, or what it takes to get it.

JVC SR-V101US - Decent player, with good line tbc. Turn off the noise reduction with some tapes unlesss you enjoy working with motion smear. JVC and a few other VCR's are notorious for their primitive dnr, works OK on some tapes, can be detrimental on others. It depends. There are better denoisers in post processing.

JVC HR-S3912U. I have one. No cigar with this one, makes too much noise. Smears chroma and detail, has a real problem with DCT edge noise on most tapes. Just to remind you:
Quote:

I want to get the best possible output with what I have.
Elite Video Broadcast BVP-4plus. If you want to "restore color" to VHS, keep in mind that any color correction you make during capture will be difficult to alter later, if not impossible. Of course you are working with a properly calibrated monitor and histograms that display colors accurately. But the real value for proc amps is assurance of valid video levels and preventing crushed darks and clipped brights. If the terms "black level", "D6500 monitor calibration", "VHS nonlinear chroma response", and "y=16 to 235" don't mean much to you, then you will inflict a lot of damage with a BVP-4. Most of it will require re-capture. I still have my BVP-4 and my Sign Video PA-100 (the latter is far more useful with its LED luminance meter). Besides, as you will discover, color correction with VHS during capture is an exercise in masochism.

Panasonic DMR-ES15 - usually connected for its line-level tbc, which your SR-V101US already has (but you can use the ES15 if JVC's tbc gets in the way. It happens). The ES15 is also useful as a frame-level tbc to insure good audio sync and prevent dropped frames. Turn off the ES15's noise reduction or you'll be posting complaints about posterizing effects, macroblocks and ghosting, which I'm sure you'd prefer to avoid because they're pains in the tush to correct afterwards and the filters required will wreck your videos. One shortcoming of pass-thru units: they're not "complete" tbc's in that they won't defeat copy protection or false-positive signal errors.

Quote:

Originally Posted by nai1ed (Post 57348)
I have a bunch of different capture cards.
Several Hauppauge cards - MCE150, HVR 1600, and HVR1250

These are not designed for lossless capture or optimized for VHS source. Don't use them for VHS capture. Let me remind you of this statement:
Quote:

I want to get the best posssible output with what I have.
Quote:

Originally Posted by nai1ed (Post 57348)
Diamond VC500 USB, ATI AIW 9600(AGP) and X600(PCIE), and ATI Theater 650 PCIe. Also have some older ATI AIW Rage Pro and Avermedia 150 PCI cards, plus a bunch of DVR cards for surveillance systems.

Your best bets are the VC500 and, even better, the AIW 9600 -- the former being a big favorite worldwide for many years, the latter being one of the best analog-to-digital capture devices ever made by anyone anywhere. The others are second-rate or worse and not representative of the high quality that ATI had to offer over the years.

Quote:

Originally Posted by nai1ed (Post 57348)
would the ATI theater 650 be my best choice?

No.

If you don't want the VC500 or the AIW 9600, there are many buyers in our forum marketplace who are dying to get their hands on either product and put them to use -- although you can buy a brand new VC500 at budget rates on Amazon these days.

Quote:

Originally Posted by nai1ed (Post 57348)
Right now I'm using Pinnacle Studio 12 to capture with.

:eek:

The general consensus during the life of this forum and other advanced video tech sources is that Pinnacle is to be avoided. In particular, if you want high quality lossless capture and you were serious when you used the word "restoring" in your thread's title, then I'd suggest that pinnacle won't give you what you say you want.

Quote:

Originally Posted by nai1ed (Post 57348)
Building a Windows XP machine is a real pain dealing with drivers and updates and software compatibility.

What XP updates? The XP update server was shut down years ago. Anyway, that decision clarifies a great many issues. I take it this means that you really didn't mean it when you wrote:
Quote:

I want to get the best possible output with what I have.
What about those Windows 7 updates, by the way? Are they more fun to shut down and reboot than they were with XP?
:wink2:

Quote:

Originally Posted by nai1ed (Post 57348)
I do like this HP T620 running Windows 7 64bit, it makes for a very slick PC.

Win7 makes for many limitations and workarounds when it comes to video restoration work, particular since a lot of excellent (and mostly free) video apps won't run in Windows 7. Most of the good stuff for video is 32-bit anyway. But Windows 7 users (including me) have made mods and concessions that get the job done, and recommended capture devices like the VC500 have Win7 drivers. XP is still king of the hill for VHS capture hardware, but it's doable with Windows 7 and the right hardware and software.

I saw no mention of VHS cleanup. Likely you won't require a great deal of it with clean retail tapes and your SR-V101, but there are those occasional nightmares, even with retail. No mention here of how to repair common VHS defects. Repairing them is what is meant by "restoration". You'll want to clean up ripples, dropouts, spots, head-switching noise, chroma displacement and bleed, projector hop, sloppy interlace combing or bad telecine, aliasing, rainbows and other chroma noise remnants, and residual tape noise (vague "floating grunge"). Not every retail tape is a masterpiece of lab work, and some tape surfaces don't hold up so well after much playing. The noise reduction in VCRs can't clean up everything -- there are thousands of forum posts to prove it.

If you're serious about levels and color correction, capture-time YUV correction is often far too basic for the kind of color problems you get with VHS. If you really want that high quality output you mentioned, post processing color is far more flexible and sophisticated and easier than you'd think, even with the hundreds of color adjustments available in Avisynth and VirtualDub alone. The color controls in Pinnacle and most budget editors are not only inadequate, they're useless with VHS color problems. On the other hand, over-priced bloatware like Adobe Premiere is a lot to pay to use only 15% of its software just for color work, even if its color controls are superbly designed, but that and the free DaVinci Resolve or pricey ColorFinesse are overkill for your purposes. For most of us, the combo of Avisynth and VirtualDub are more than adequate for cleanup and color work.

Whatever you decide, good luck. If you encounter problems, don't be afraid to post questions or samples of video work that's giving you troubles.

nai1ed 11-20-2018 07:51 AM

Thank you so much for the reply. You've given me lots of good advice and I greatly appreciate it. I think I'll put together a system with the ATI AIW 9600, but I may also try using the VC500 with my HP T620. I had already done a capture with the VC500 and the Theater 650 and I noticed the colors were much more vibrant with the 650. (But that was using Pinnacle Studio).

When using Windows XP, are you just staying with SP2? I'm assuming .NET will need to be installed as well. I don't plan on browsing the web with it, but I would like to access my NAS on the network.

Also, do you recommend using the Panasonic ES15 to record DVD's, or just use as a passthrough?

I do a lot of video editing at work with TMPGENC Master Works 6, but I'm not too familiar with Virtualdub or Avisynth. Is Avisynth the best tool for fixing bad VHS tapes?

Thank you

Brian

JPMedia 11-20-2018 08:52 AM

The ES-15 should only be used as a pass-through. Make sure to turn off Noise Reduction in the menu before using the ES-15 in your workflow.

There are many better options if you're looking for a stand-alone DVD recorder. Specifically you should look for a model that uses the LSI chipset.

A list of such players can be found in this thread: http://www.digitalfaq.com/forum/vide...ipset-dvd.html

nai1ed 11-20-2018 09:14 AM

Thanks for that list. I noticed the Panasonic ES20 is listed, is there a big difference between the ES15 and ES20? Seems a bit redundant have these 2 DVD recorders stacked up. My goal is to use Virtualdub and Avisynth to cleanup and fix some videos that need it, but if the tape already plays perfect on the VHS, why not save time and dub it directly to DVD. I really don't want to spend an aternity converting all these VHS tapes, but I also want good quality.

Thanks

Brian

lordsmurf 11-20-2018 01:54 PM

Quote:

Originally Posted by nai1ed (Post 57353)
Thanks for that list. I noticed the Panasonic ES20 is listed, is there a big difference between the ES15 and ES20?

The ES10 and ES15 are good for TBC(ish) passthrough. But the ES20/25/etc are either so weak as to be useless, or have no TBC(ish) properties at all.

Panasonics further give lousy recording quality on most all of their units. At very most, to be generous, I'd consider an LSI-based Panasonic, but only when using it in XP 1-hour recording mode, maybe 2-hour SP at worst. I forget which is the ES units used LSI, and which did not, but that info can be found in the forum from years past. I'm thinking it was just 1 model, and it was the ES25.

So the ES20 model is mostly/entirely useless.

I've not had time to read the whole thread yet, but wanted to make the quick important reply.

nai1ed 11-20-2018 02:01 PM

I see. So anything after the ES15 is pointless. I do have a Toshiba DVD recorder VHS combo DVR620, but the VHS doesn't play all that well. I was hoping to dub some of these VHS tapes to DVD that play just fine, but I'm not sure which DVD recorder I should use.

sanlyn 11-20-2018 08:20 PM

Quote:

Originally Posted by nai1ed (Post 57351)
I think I'll put together a system with the ATI AIW 9600, but I may also try using the VC500 with my HP T620. I had already done a capture with the VC500 and the Theater 650 and I noticed the colors were much more vibrant with the 650. (But that was using Pinnacle Studio).

The ATI 650 has AGC issues. You don't want a master capture that is lossy DV with plastic color and uncontrolled artificial gain. A master is supposed to be as near as one can get to a transparent, unaltered digital copy of the original. From there you can do anything you want. I'm suspicious of the term "vibrant color" because it has no objective meaning and doesn't say anything about safe or unsafe chroma levels, for which there are definite limits in digital video. If you aren't using a calibrated monitor when making corrections, display of the same video on other devices can be a problem.

My main capture PC is a home built XP/Sp3 with an ATI AIW 9600XT card. I have a secondary Win7 PC that uses the VC500 and once used a Hauppauge USB-2 (but the USB-2 clipped blacks, which I didn't care for), and an older helper XP/Sp2 with an AIW 7500 for capture.

Quote:

Originally Posted by nai1ed (Post 57351)
Is Avisynth the best tool for fixing bad VHS tapes?

Yes. "Editors" can't compete with it for video repair and mods. VirtualDub is the easiest way to run Avisynth filters, while VDub itself has over 200 filters of its own that can be quite handy. Don't think of these two apps as editors but as "video processors'.

Quote:

Originally Posted by nai1ed (Post 57353)
is there a big difference between the ES15 and ES20?

The ES20 is a visibly cleaner recorder with its LSI processor, but its tbc isn't nearly as effective as the ES10/ES15. You can make a fairly neat DVD from a pristine tape with the ES20 and other LSI-chip DVD-R's, but you'll have to figure out if you want to live with highly visible head-switching noise at borders and some very visible VHS defects such as chroma bleed, dropouts (spots and horizontal ripples), color shifts, and other common VHS glitches. MPEG is a final delivery format, not designed for edits or image mods without incurring quality hits and re-encoding loss. The ES20's dnr (like similar dnr on other recorders) can cause ghosting if left enabled.

In any case, you shouldn't record noisy VHS tape direct to DVD in a DVD-R at no less less than 6.2kbps Variable Bitrate, which is about 90 minutes per DVD disc. The absolute max would be 4.6kbps VBR, or 2 hours of DVD program. Unfortunately, without cleanup the usual VHS noise eats lots of the encoding bitrate, even if the result "looks" fairly OK, so details and motion rendering get relatively bitrate-starved.

nai1ed 11-21-2018 08:00 AM

2 Attachment(s)
What I meant by vibrant color on the ATI 650 is that the video was noticeably brighter. I did a capture of a video workout on the beach with the ATI 650 and the VC500, and on the VC500 it looked like it was late evening, but on the ATI 650 it looked like mid day.

One thing I did noticed is that I can't make any adjustments with EzGrabber. How do I make color adjustments on the VC500? The menu's wont let me make changes.
http://www.digitalfaq.com/forum/atta...1&d=1542809018

Here is my current setup -

http://www.digitalfaq.com/forum/atta...1&d=1542809018

sanlyn 11-21-2018 08:15 AM

No one recommends using EZGrabber for capture. It's installed so that other capture programs can use its capture drivers. The capture app most people use is VirtualDub. VDub hooks into the VC500's proc amp controls. Brightness, contrast, etc., are controlled with the proc amp controls and checked with the input histogram. http://www.digitalfaq.com/forum/vide...-settings.html

nai1ed 11-21-2018 08:22 AM

1 Attachment(s)
Oh, I see. I thought I had to make the changes in the EzGrabber. Maybe you can help me with some Virtualdub Filters though. I have my wife's High School graduation tape from 1991 and the quality looks bad. Lots of color banding and color bleeding.

Here is a screenshot taken from VLC.

http://www.digitalfaq.com/forum/atta...1&d=1542810015

I used virtualdub with the VC500 to capture a short video in AVI uncompressed.

sanlyn 11-21-2018 11:45 AM

Quote:

Originally Posted by nai1ed (Post 57365)
Oh, I see. I thought I had to make the changes in the EzGrabber. Maybe you can help me with some Virtualdub Filters though. I have my wife's High School graduation tape from 1991 and the quality looks bad. Lots of color banding and color bleeding.

Here is a screenshot taken from VLC.
..............
..............
I used virtualdub with the VC500 to capture a short video in AVI uncompressed.

Thanks for the image.
Several problems here. No one would apply filters to a still image, as there is no way to judge noise characteristics with non-moving media. Second, there are obviously crushed darks and blown-out highlights and hot spots (i.e., clipping) because of the YUV->RGB conversion when making the png. Third, you shouldn't be capturing uncompressed -- it's a drag on your CPU, makes overly big capture files, and it makes it really tough to get a decent upload size for video samples. VHS is usually captured to YUY2 color and compressed with huffyuv real-time lossless compression, which can actually load from the capture stream into an avi file more easily than an uncompressed stream.

If you captured in RGB, the clipping damage is already done and can't be repaired. The still photo appears to be from a dubbed tape (multi-gen tape copy), has seriously bad dct and sharpening halos (black halo on the left edges of objects, bright halo on the right edges). Chroma is corrupt (there are no clean whites or grays, most colors have a heavy cyan or green color cast). Corrections when working from a still image such as this would not be feasible. Any color correction, if possible, would first have to be done in a YUV capture medium that has not been converted to RGB..

How to create a short sample of 5 to 8 seconds or so (with motion of some kind) using VirtualDub: Open the avi capture in VirtualDub. Use the navigation and start/end controls in the lower left-hand corner of the VirtualDub window to mark the start point of your short sample, and use the "Edit' menu items to delete the video portion at the left of the starting point. Then use the same controls to mark the end point of the desired sample, and the edit menu controls to delete the portion of video that follows the end point.

After you have set up your sample, click "Video...", and in the dropdown menu that appears, click "Direct stream copy". Then click "File..." -> "Save AVI...", and give your sample a name and location.

In order to upload a sample, go into "advanced" viewing mode in a forum Reply window and click the "Manage Attachments" command button. Follow instructions on the upload dialog window that appears. The upload might seem slow because submissions are scanned for viruses and other problems during the upload process. Give the upload a few minutes to complete. The file size limit for video samples is 99MB. If your capture is uncomporssed RGB, then file size would be 3 to 4 times the size of a losslessly compressed AVI.

nai1ed 11-21-2018 11:58 AM

I will try this tonight and upload a 5 second sample.

Thank you

nai1ed 11-21-2018 07:31 PM

1 Attachment(s)
http://www.digitalfaq.com/forum/atta...1&d=1542850176

I uploaded a sample, but this time I used my ATI AIW 9600 but followed your instructions.

Thanks

Brian

sanlyn 11-21-2018 09:30 PM

Thanks for the sample. I'll take a look and post details as soon as I can. Perhaps other readers might have a look as well.

:salute:

Obviously, not a tape that's in the best condition. At first look, however, it's just as obvious that it's made worse by capturing with uncontrolled and illegal (i.e, digitally unsafe) input signal levels. The image below shows a sample frame with its black borders and head -switching noise removed, and a YUV levels histogram attached at the right-hand side.

http://www.digitalfaq.com/forum/atta...1&d=1542858648

Take a look at the right-hand graph and the white bar along the top of the graph. Note the bright yellow at each end of the white bar. The yellow indicates clipped (i.e, destroyed) data. Detail is already sparse, but throwing away parts of the signal doesn't help.

Later I'll see what I can do with what's left, but even with video as poorly taped as this you should learn to control your input signal. There is nothing an encoder can do with the yellowed-out data except waste bitrate on large areas that have pixels with no recognizable information. Controlling the input signal with proc amp settings is discussed in the latest Guide in post #4, while measuring the input signal with VDub's capture histogram is explained in post #3 . Most users would measure a couple of minutes or take quick "spot readings" of tape before capture, and then set level controls to handle worst-case scenarios of data leaping off the histogram.

I'll post more details later. Thanks again.

sanlyn 11-21-2018 10:33 PM

1 Attachment(s)
Some quick initial color balance corrections.

http://www.digitalfaq.com/forum/atta...1&d=1542861141

But I think you can see there's a lot to be desired and a long way to go.
More notes, later.

nai1ed 11-22-2018 07:30 AM

So when looking at the histogram, I should adjust levels so they are just a tiny bit in the red?

sanlyn 11-22-2018 09:13 AM

The levels will vary from minute to minute -- not so much with retail video like workout tapes, but home videos can get crazy. Most people just sample a few seconds of tape at random spots, then adjust for worst-case scenarios. A little occasional overflow into red can be corrected later if necessary in post cleanup, but when red starts smashing against the left or right walls you're in trouble.

nai1ed 11-22-2018 04:42 PM

I noticed when doing a capture I was getting lots of dropped frames until I disable audio playback. Is this normal? Also, which filters do you think would be best for this project?

Thanks

hodgey 11-22-2018 06:06 PM

Yeah that's normal, virtualdub doesn't handle audio playback well in capture mode.

sanlyn 11-22-2018 09:53 PM

Quote:

Originally Posted by nai1ed (Post 57387)
which filters do you think would be best for this project?

I can post more detailed suggestions and some samples later. But there is no such thing as one-size-fits-all for every video. Many tapes will have common problems with common solutions, some will be wrecks like your sample that require special treatment. In any case, the only "filter" that should ever be applied to lossless captures are the proc amp controls for managing levels. Cleanup occurs after capture.

nai1ed 11-23-2018 08:07 AM

I might try using my EliteVideo BVP-4+ to adjust colors. It supports Svideo in/out so I shouldn't lose any quality.

sanlyn 11-23-2018 08:14 PM

Quote:

Originally Posted by nai1ed (Post 57392)
I might try using my EliteVideo BVP-4+ to adjust colors. It supports Svideo in/out so I shouldn't lose any quality.

That would make some changes, although usually simple tint controls can't correct specific target areas of the spectrum. And in YUV they only correct one color at a time, not two colors simultaneously. But you can give it a try.

All I can say about the day-after Thanksgiving cleanup is oh my aching back. Had to help my sister after 45 relatives stuffed themselves and it took all day because her hubby hurt his back (Likely story, Sam!)... then I had a long drive back home. I'll clean up all my script data and filter links and post details tomorrow. Sorry for the delay.

nai1ed 11-23-2018 08:22 PM

No worries, I know how crazy holidays can get, but luckily I had Thursday and Friday off from work so it makes all worth the while. I'll be eating leftover turkey all next week :)

sanlyn 11-24-2018 09:19 AM

2 Attachment(s)
I wish I had a history of the tape from which you made your sample. In any case I think you know beforehand that many of its original elements can't be restored. Detail can't be recreated from nothing. Sharpening won't help because edges are oversharpened (black halos) and then badly smeared, and in some cases edges don't even exist. Between edges, detail suffers from the same smearing, blurring, and ghosting. I used a sharpener for chroma-only, which worked to a small (very small) extent to relieve some color smearing. But let's face it: the original images are wrecked.

All one can do is try to work on tape noise and overall color balance. Some of the noise was permanently embedded by tape dubbing. When playing this sample look at the left-hand corner of the room where you see a closed doorway, and the vertical edges in that corner will "wiggle" and shift. Some edges in the large central flag on the wall also wiggle a bit and show some aliasing (sawtooth edges) during motion. These distortions are the result of scanline timing errors from the original source player(s). Those errors can't be eliminated afterward. They could be fixed only during the original dub.

Color response is convoluted, a mix of distortions and discolorations between the original player and recording VCR. Blacks and very dark grays are colors that should consist of equal RGB proportions of Red, Green, and Blue. Pure black would have RGB values of 0,0,0. Dark "video black" would have RGB values of 16, 16, 16, and a very dark gray that would be shadows in a black object would be 32,32,32. There are no such colors in the supposedly black objects and shadows of the sample. In the foreground there are some black robed figures and the square tops of black graduation caps, but none of the caps can be made to look convincingly black or dark gray. No matter how the blacks are manipulated with color controls, each has a distinct and different non-black color cast. White is another color that has equal proportions of red, green, and blue. The white-gowned figures would in reality be slightly off-white; the nearest one could achieve is something approaching RGB 185, 185, 185, or somewhere in that general range -- but the corrupt variations are pretty wide here, mostly with yellowish or reddish shadowy smears that should be neutral. Some colors in the sample simply don't look real. It has the strangest looking greens I've ever seen.

If it were not for all the tape noise and scanline errors from the original player, one could skip the denoising filters and just try for a partial effort at color correction. The noise smoothers I used were the built-in cleaning features of QTGMC, which also helped with the color stains and discolorations (i.e, chroma noise). There was a magenta stain across the top border and chromatic distortions elsewhere that were cleaned a bit with Avisynth using what are called anti-rainbow filters (cnr2 and Bifrost) and a VirtualDub chroma cleaner called Color Camcorder Denoise (aka "CCD"). An avisynth special sharpener was used for color-only edge contrast enhancement to clear up a little of the chroma bleeding and smearing around the few distinct edges that could be found.

Much of the visual confusion that one experiences when viewing this video is partially due to the blackish and bright opposing edge halos, especially on the white robed figures. The halos themselves have a whitish sharpened edge. Unfortunately the only thing halo cleaners can do with this type of distortion is to calm it a little. It can't be eliminated because the objects don't have cleanly defined or stable contours anyway.

On less damaged video you could use the same filters but at different settings, especially for QTGMC. One could have used more softening and smoothing filtration here but, seriously, the video is already borked to begin with and more filtering would look even worse.

Below is the Avisynth script I used on the way to making the attached mpeg encode. Like any program code, avisynth executes statements in the order in which they occur in the script.

Code:

Import("D:\Avisynth 2.5\plugins\MDG2.avs")

AviSource ("J:\forum\faq\nai1ed\A\sample1.avi")
ColorYUV(cont_y=-25)
Levels(16,0.90,255,16,245,dither=true,coring=false)
Tweak(sat=0.6,StartHue=275,EndHue=340,dither=true,coring=false)
Tweak(sat=0.75,StartHue=160,EndHue=275,dither=true,coring=false)
Tweak(sat=1.3,StartHue=60,EndHue=160,dither=true,coring=false)

AssumeTFF()
SeparateFields()
FixVHSOversharp(20,16,12)
FixVHSOversharpL(20,12,8)
Cnr2(mode="ooo", scdthr=255.0, ln=255, lm=222, un=255, um=255, vn=255, vm=255)
Weave()

ConvertToYV12(interlaced=true)
QTGMC(preset="medium",FPSdivisor=2,ChromaMotion=true,border=true,\
  ChromaNoise=true,GrainRestore=0.3,sharpness=0.7)
MDG2()
BiFrost(interlaced=false)
MergeChroma(aWarpSharp2(depth=20).aWarpSharp2(depth=10))
AddGrainC(1.25,1.25)
Crop(4,0,0,-12).AddBorders(2,6,2,6)
ConvertToRGB32(matrix="Rec601",interlaced=false)

This script was saved as a text file with the Avisynth file extension of .avs ("Sample1_00.avs"). I ran the script by opening VirtualDub, clicking "File..." -> "Open video file...", then locating the .avs file and selecting it. VirtualDub considers an .avs script to be an incoming "video", not a text file. With the script open in VirtualDub I loaded VDub filters and adjusted them. Then with the desired filters applied, I clicked "File..." -> "Save as AVI...". I gave the output a name and location, and saved the Avisynth output and the VDub filter results at the same time in one AVI. The script processed at about 5 frames per second (yes, QTGMC and MDG2 are slow filters). Before saving it I adjusted VDub to output YV12 color and Lagarith lossless compression, all ready for MPEG encoding. Huffyuv can't compress YV12. Huff is YUY2 or RGB only. I use Huffyuv for capture because it's easy on the CPU, but In use Lagarith for RGB, YUY2, and YV12 working files (https://lags.leetcode.net/codec.html).

The settings of the VDub filters I used were saved in a .vcf file. The .vcf settings file is attached. You load a .vcf by clickinbg "File..." -> "Load processing settings...", then locate and select the saved .vcf. A vcf should be saved in a folder with your video project, not with your plugins. The VDUb filters I used must be present in your VDub plugins or the .vcf will simply display an error message. The three filters I used were:
(1) Color Camcorder Denoise v1.7, http://www.digitalfaq.com/forum/atta...ove-ccd_v17zip.
(2) gradation curves 1.45, http://www.digitalfaq.com/forum/atta...1&d=1489408797.
(3) ColorMill 2.1, http://www.digitalfaq.com/forum/atta...colormill21zip.
The .zip downloads above also contain documentation.

Two other useful tools I used for analyzing color in Virtualdub's GUI were the ColorTools histogram/vectorscope filter and the CSamp pixel reader for getting the RGB pixel values. Because you have Win7 or Win10 you need the updated version of ColorTools (http://www.digitalfaq.com/forum/atta...1&d=1487006540).
CSamp is a freestanding desktop tool that needs no installer: http://www.digitalfaq.com/forum/atta...on-dv-csampzip.
CSamp comes with its own small help file.
Some previous examples of using these VDub filters are in an earlier post Information Overload #3, in a thread that contains other examples of scripts and filters form a not-so-great video sample.()

VirtualDub and Avisynth filters usually come as .zip files. Don't download new filters directly into your plugin folders. The Zips contain the filter plus several other files, all of which would soon have your plugin folders in a dysfunctional mess. Instead, create a new folder somewhere (call it "Filters" -- clever, huh?). Then for each new filter that you download create a subfolder with the filter's name. Download into those subfolders and unzip there. Then load just a copy of the filter itself into your plugins. Thus, you'll always know where the original filter and its documentation are located. Virtualdub filter files have a .vdf extension.

Note: Avisynth, VirtualDub, and all of its filters and lossless codecs mentioned here are 32-bit versions. They work just fine in 64-bit Windows. There are 64-bit filter versions in development, but they're in limited numbers and many are still buggy.

The version of Avisynth I'm using is version 2.6.0 32-bit (May 2015)
https://www.videohelp.com/download/A...xe?r=GHpWsrmmg
The default Windows install folder is Program Files (x86)\Avisynth, although you can create an "Avisynth" folder anywhere and direct the installer to use that folder. Avisynth installs only its own folder, help files, and a plugins folder, plus a few registry entries. The only .dll it installs is the 32-bit Avisynth.dll in the SYSWOW64 folder. In 32-bit Windows, it's installed in System32. The only file association you need to make when the installer runs is to associate .avs files with Notepad, so that when you double-click an .avs file it automatically opens in Notepad.

You uninstall Avisynth by going into its program folder and executing uninstall.exe. Or, open its program group in your program listing and look for "Uninstall Avisynth". When it's uninstalled it removes its registry entries and Avisynth.dll, but it leaves the program folder and plugins intact.

Like any popular video software, Avisynth has its home page: http://avisynth.nl/index.php/Main_Page. It's filled with links that will take you to places you never dreamed of visiting, but the links that most people start with are under the label "New to Avisynth - Start Here". Under that heading you'll quickly discover that the first two introductory links are in reverse logical order. Rather than start with the first link listed, go to "Getting started - An introductory guide" (http://avisynth.nl/index.php/Getting_started). This tutorial page works well, but they tell you to open test scripts in MediaPlayer. Forget that. The newest MediaPlayer versions are dysfunctional to begin with -- just stick with VirtualDub for running scripts.

Of course you will need some filters, which Avisynth and VirtualDub call plugins. While you certainly won't need all of the plugins shown in the two links that follow, it's nice to know you have a choice. You build up your toolbox as you go along, and you'll find that some plugins keep showing up everywhere in projects because they solve common and frequent problems.
Main page for current Avisynth plugins: http://avisynth.nl/index.php/External_filters
Favorite source for VirtualDub plugins: http://www.infognition.com/VirtualDubFilters/
There are additional archive sites all over the internet.

It looks intimidating. But, then, some very inexperienced people have accomplished marvelous things with Avisynth and VIrtualdub. They learn most of it from following project threads in video forums. Software like Adobe Premiere and AfterEffects, or the old SONY Vegas Pro, and many other pricey packages are even more complicated. Avisynth and VirtualDub don't get that difficult. And They're free!

I'll get into the script and filter details in the next post.

sanlyn 11-24-2018 09:53 AM

2 Attachment(s)
The big problems with badly degraded video are the extra filtering and the processing time they consume. Then there is the fact that the results can't look as good as a source that's more or less intact to begin with. A lot of damage just can't be repaired. On other hand, even a so-called "clean" analog source still needs some work, and one still needs a toolbox of effective filters to get improved results. The difference between a poor source and a good source is the vast difference in the quality of the results.

Below are script and filter details for the script in the preceding post:

Import("D:\Avisynth 2.5\plugins\MDG2.avs")
It happens that the MDG2 plugin is a script-coded .avs file. Avisynth plugins come in three formats: .dll, .avsi, and .avs. A .dll and an .avsi plugin load automatically when a script calls for them. An .avs is a plain text file whose coded text must be explicitly imported into your script using the Import() function. You could also copy the text yourself into the bottom of your script, but it's a pain and some of the .avs filters have hundreds of lines of code.
Import(): http://avisynth.nl/index.php/Internal_functions#Import.

AviSource ("J:\forum\faq\nai1ed\A\sample1.avi")
The AviSource() function open and decodes many video codecs if the codec is installed on your PC. Once decoded, the file as AVisynth delivers it is uncompressed. If you want compressed output, you'll have to recompreess it yourself, for instance by telling VirtualDub to do it.
AviSource(): http://avisynth.nl/index.php/AviSource.

ColorYUV(cont_y=-25)
Levels(16,0.90,255,16,245,dither=true,coring=false )
Tweak(sat=0.6,StartHue=275,EndHue=340,dither=true, coring=false)
Tweak(sat=0.75,StartHue=160,EndHue=275,dither=true ,coring=false)
Tweak(sat=1.3,StartHue=60,EndHue=160,dither=true,c oring=false)

ColorYUV() is a multi-faceted builtin function that works on contrast, gamma, high end extension, black levels, and so forth. Its wiki page gives you a whole catalog of things it can adjust. Here, it's used to lower contrast. There are different kinds of contrast controls; with ColorYUV, contrast expands pixel values (luminance) from the center outward in each direction or, with negative values it shrinks pixel values toward the middle. Because a histogram showed luminance extending outside safe values at both ends of the dark-to-bright spectrum, cont_y was used to shrink the response curve toward the middle of the spectrum. As you can guess by its name, it works only in YUV colorspaces.
ColorYUV(): http://avisynth.nl/index.php/ColorYUV

The builtin Levels() function works on luminance pixel values and on gamma (midtone response). Here, it adjusts luminance levels to stay within the range y=16-235. RGB display will expand YUV from 16-235 to 0-255. If the YUV range is already darker than 16 or brighter than 235, an RGB display or process will destroy the out of range values (aka "clipping"). The numbers in the Levels() command indicate the following values, in this order: input dark values, desired gamma, input bright values, desired dark output adjust, desired bright output adjust. Dither and coring are explained on the Levels() wiki page (http://avisynth.nl/index.php/Levels).

The Tweak() statements (http://avisynth.nl/index.php/Tweak) adjust saturation in the YUV color range shown by the numbers in the startHue and endhue values. The numbers reflect the positions of colors in degrees around the YUV color wheel:

http://www.digitalfaq.com/forum/atta...uv-color-wheel

The images below are YUV vectorscopes that display measured saturation values. The vectorscope on the left shows the original saturation pattern before filtering. The pattern indicates an oversupply of saturation in the blue-cyan and green-yellow areas, and a deficit in red. The vectorscope on the right shows the more evenly balanced result of the Tweak and ColorYUV statements with reduced blue-cyan/yellow levels and more populated reds.

http://www.digitalfaq.com/forum/atta...1&d=1543073451

Avisynth histograms/vectorscopes: http://avisynth.nl/index.php/Histogram

AssumeTFF()
SeparateFields()
FixVHSOversharp(20,16,12)
FixVHSOversharpL(20,12,8)
CNR2(mode="ooo", scdthr=255.0, ln=255, lm=222, un=255, um=255, vn=255, vm=255)
Weave()

Avisynth's default field order priority for interlaced or telecined video is Bottom Field First (BFF). But most of the time you'll encounter Top Field First (TFF). AssumeTFF() informs Avisynth that the current video's field order is TFF. Then, SeparateFields() breaks apart each interlaced frame into its two half-height image fields. This is a non-destructive form of deinterlace, which will be required by the Avisynth filters that immediately follow.
AssumeTFF(): http://avisynth.nl/index.php/Parity
SeparateFields(): http://avisynth.nl/index.php/SeparateFields

FixVHSOversharp(20,16,12) and FixVHSOversharpL(20,12,8) go after edge halos and ghosting on right and left edges respectively. These two filters aren't enough to completely fix the ugly edge halos in the clip, and in fact will simply soften edge halos a bit -- which is what is desired here because of the over-sharpened halos themselves. The numeric values in the syntax for the two FixVHSOversharp commands are explained in the help file that comes with the filter and are actually copied from the documented samples. FixVHSOversharp works only in a YUY2 colorspace.

CNR2 is a chroma filter that helps neutralize color streaks and blotches. The values that follow the CNR2 command are actually defaults except for "mode="ooo" which activates a "wide" disturbance detection for Y (luma), U (yellow-blue), and V (red-green) channels. The scdthr, ln, lm, un, um, vn, and vm set luminance and chroma filtering limits for scene changes, luma, U, and V channels. The numbers shown are defaults except for the "222" which tends to reflect an average peak value for luminance "hot spots" in VHS video. You could probably use all values at default 255 with no problems.
FixVHSOvershartp.dll: http://www.digitalfaq.com/forum/atta...ll_20030723zip.
CNR2.dll is at http://www.digitalfaq.com/forum/atta...d-cnr2_v261zip.

Weave() is the function that puts all the separated fields back into their original order and position in the interlaced frames. http://avisynth.nl/index.php/Weave.

ConvertToYV12(interlaced=true)
QTGMC(preset="medium",FPSdivisor=2,ChromaMotion=tr ue,border=true,\
ChromaNoise=true,GrainRestore=0.3,sharpness=0.7)

Your sample clip used YUY2 color, preferred because it's more like the YPbPr color in VHS, but the filters that follow require YV12 color. Leave these conversions to Avisynth, which does it with great precision (many editors make a mess of YV12 conversions). For any colorspace conversion you must tell Avisynth whether or not the video is interlaced. Note that telecined video, the conversion of film speed to 29.97fps by inserted qdditional fields, is considered a form of interlace. Other conversion function parameters can be used, but usually you'll just ignore them and use defaults.
ConvertToYV12(): http://avisynth.nl/index.php/Convert

With QTGMC you come to one of the heavy-hitters. This is a deinterlacer. In using complex motion-compensated algorithms and additional support filters to deinterlace as cleanly as possible (something most deinterlacers don't do), one side effect of QTGMC is that it also denoises in several ways. It reduces grain, cleans edges, and smooths uneven motion to a certain extent. The preset="medium" parameter sets up a reasonably efficient denoising level (there are faster presets and slower ones). FPSdivisor=2 is a special parameter that discards alternate fields and maintains the original 29.97fps framerate. This is a decision you'll have to make: field decimation can make for less smooth motion that interlaced or double-rate video. If you retained all fields, interlacing would play at 59.94 fields per second. if you double-rate interlace, the video would play at 59.94 frames per second. But there's not that much motion in your clip. Sports video would be a different story. I decided to discard fields because of all the interlace damage and noise inflicted on this tape. The normal way would be to retain all fields, run special filters to calm buzzing edges and combing, and re-interlace after filtering -- but with this damaged video the edge noise and excessive combing would be intolerable.

The extra cleanup parameters that are activated in the QTGMC statement are ChromaMotion (consider chroma, not just luma, when analyzing motion), border (pad a little vertically to avoid top or bottom border flutter), ChromaNoise (clean color noise as well as luma noise (grain)), Grainrestore (restore a very small amount of original grain to avoid a plastic over-filtered look), and reduce Sharpness a little so sharpened halos won't look worse.

QTGMC and its pile of support files and extra filters come as a 32-bit package. The .zip file contains all updates as of November 2017 (subsequent updates require a different version of QTGMC that you won't need for a long while, if ever). Most of the support files are popular standalone filters in their own right. The .zip also has links to required Microsoft VisualC++ runtimes if you don't have them. There are quick read-me files in the zip, as well as all of the original documentation that comes with the support files. READ the READ-ME's first! Ignore them at your peril. The3 complete QTGMC .zip package and all its subfolders is at:
http://www.digitalfaq.com/forum/atta...g-qtgmc_newzip

MDG2()
BiFrost(interlaced=false)
MergeChroma(aWarpSharp2(depth=20).aWarpSharp2(dept h=10))
AddGrainC(1.25,1.25)

MDG2.avs is a packaged version of the MDegrain2 function that comes with MVTools2.dll. It's a degrainer that also helps to smooth buzzy edges. It requires MVTools2, which comes with QTGMC. it also requires aWarpSharp.dll (see remarks, 2 paragraphs below).

Bifrost is another color and stain cleaner. You have to tell it whether or not your video is interlaced. At this point in the script, your video isn't interlaced. You can get Bifrost_v2.zip at http://www.digitalfaq.com/forum/atta...-bifrost_v2zip.

MergeChroma(aWarpSharp2(depth=20).aWarpSharp2(dept h=10)) combines the results of chroma-only sharpening with luma from previous statements. In short, this tells aWarpSharp2 to sharpen only the color channels, not the luma channel, because luma is already oversharpened. This tends to "tighten" colors closer around the edges they belong to. It won't clean up the chroma smearing mess entirely, but it helps. Get aWarpSharp2_2015.zip at
http://www.digitalfaq.com/forum/atta...sharp2_2015zip. It also requires the Microsoft VisualC++ runtime 2013 (which you will need for some other filters later), and you can get it at http://www.microsoft.com/en-us/downl....aspx?id=40784.
MergeChroma: http://avisynth.nl/index.php/Merge

AddGrainC is an old standby used by dozens of more complex filters. It adds a small amount of very fine film-like grain to mask hard macroblock edges and to avoid an over-filtered or posterized look. AddGrainC.dll and the 2012 VisualC++ runtime installs with the QTGMC package. Or get AddGrainC and the 2012 runtime separately at http://avisynth.nl/index.php/AddGrainC.

Crop(4,0,0,-12).AddBorders(2,6,2,6)
These two commands remove unwanted border pixels and replace them with new black ones. Crop() removes edge pixels in this order: 4 left border pixels, zero top border pixels, zero right border pixels, and 12 bottom border pixels. The bottom pixels are head-switching noise. Cropping might seem simple, but there are very stringent rules. You can see the rules in a small grid near the bottom of Crop's wiki page, linked below. Next, AddBorders() gives you brand-new black border pixels in the same order processing order but it attempts to center the original image in the frame: add 2 left border pixels, 6 top border pixels, 2 right border pixels, and 6 bottom border pixels. The default border color is black but you can choose many other colors.
Crop(): http://avisynth.nl/index.php/Crop
AddBorders(): http://avisynth.nl/index.php/AddBorders

ConvertToRGB32(matrix="Rec601",interlaced=false) is another colorspace conversion, this time for use by the VirtualDub filters that will be applied to the script's output. As usual, you must tell conversion functions whether or not your video is interlaced (at this point, it isn't) -- not making this clear can screw up your colors. The color matrix used for standard definition video is "Rec601", which is a flavor of RGB that VirtualDub will use. VirtualDub filters run in RGB color. if you don't make the conversion here, VirtualDub will do it when you load its filters. But Avisynth can usually do it more cleanly.

Without this conversion, your output at the end of this script is YV12 color. If you want to save the script as YV12 at this point, you'll need a lossless compressor other than huffyuv, which can't compress YV12. I suggest Lagarith, since it's mainstreamn, recognized by media players and editors, and makes slightly smaller files than huffyuv. Here's Lagarith's link again: https://lags.leetcode.net/codec.html.

Using the Virtualdub filters:


The Avisynth script makes some initial levels and color corrections in YUV color. These were basic adjustments that are easier in the original colorspace, and are often not possible after conversion to other color systems. This particular video sample required work in the saturation department that would have been difficult in other software. Fortunately most videos don't require a bunch of Tweak statements as tricky as those used in the script.

After the basic corrections in YUV, color controls in VirtualDub can tweak the results and target certain areas more specifically. Shadows in bright objects still looked a little blue-green (those would be the midtone range centered at about RGB 128 in the middle of the spectrum). Flesh tones weren't quite right (rather orange-y, often grayed out, and very badly smeared), so adding a little warmth with Colormill and reducing cyan with gradation curves helped somewhat.

The image below shows the Red, Green, and Blue adjustment panes in the Gradation Curve plugin, as used in processing the sample clip.

http://www.digitalfaq.com/forum/atta...1&d=1543074259

Red is at the far left. The diagonal line for Red is curved upward, which increases the brightness of reds from the darkest values (at the bottom) to the brightest vales (at the top). There's a kink in the curve near the top of Red's vertical line intended to calm a slight red peak in the brighter reds. In the Green and Blue panes, both colors are lowered slightly across most of the range, but Green are lowered a little more at the high end to correct whites that were too green, and both Green and Blue vertical lines are raised somewhat in the darks (at the bottom) to correct darker colors that were too red. The curves plugin is similar to curves in Adobe Photoshop, Premiere Pro, and other high-end apps. Its .zip package comes with documentation.

The adjustments needed to correct whites, grays, and other areas of the spectrum were determined by using the Csamp pixel reader to analyze pixels that were supposed to be whites, grays, or blacks. the RGB values shown by Csamp would indicate why those pixel colors were "off'. If a supposedly white pixel measured R185 G210 B213, it would indicate that those pixels didn't look white because there was too much green and blue and not enough red. So the bright colors would be manipulated to make Red, Green and Blue have similar values such as R200, G200 B200. Those values would equal white with about the same brightness as before.

The filters and settings ultimately used were saved in the .vcf file attached to the preceding post.

Speeding up Avisynth scripts for testing VirtualDub filters:
If you're running a script in VirtualDub and adding VDub filters at the same time, a slow Avisynth script can make scrolling thru the video very difficult while trying to adjust filters. Plugins like QTGMC can be very slow at certan settings and with very noisy video. You can temporarily make the script run faster if you comment-out some statements to prevent their execution. For example you can use Avisynth's comment in this statement:

Code:

QTGMC(preset="medium",FPSdivisor=2,ChromaMotion=true,border=true,\
  ChromaNoise=true,GrainRestore=0.3,sharpness=0.7)

and change it into this statement, which prevents QTGMC fromn running:
Code:

# QTGMC(preset="medium",FPSdivisor=2,ChromaMotion=true,border=true,\
#    ChromaNoise=true,GrainRestore=0.3,sharpness=0.7)

Any text that follows the cross-hatch or pound character (#) is converted to a comment, which is ignored by Avisynth. After making this change, in VirtualDub hit the F2 key (or click "File..." -> "Reopen video file") to reload the script at the point where you stopped scrolling. And don't forget to remove the comment marks when you're ready to save the file!

All I can add at this point is that I hope your other videos are in much better shape. If you wish you can submit a better sample from a workout tape to see how much better things can look.

nai1ed 11-24-2018 05:07 PM

Thanks so much for your help. There is a lot here for me to digest, but I'll go through it step by step and try to understand it all.


All times are GMT -5. The time now is 08:18 PM

Site design, images and content © 2002-2026 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2026 Jelsoft Enterprises Ltd.