digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Capture, Record, Transfer (https://www.digitalfaq.com/forum/video-capture/)
-   -   Minimizing Loss During Capture, Perceived Quality, and Long Capture Approach (https://www.digitalfaq.com/forum/video-capture/10185-minimizing-loss-capture.html)

tbz128 12-13-2019 07:06 PM

Minimizing Loss During Capture, Perceived Quality, and Long Capture Approach
 
3 Attachment(s)
To start off, this site is an excellent resource, so thanks to all who contribute.

I'm archiving family home videos (working VHS and VHS-C for now). I'm trying to appropriately adjust proc amp levels for capture to reduce loss, and after adjusting, I'm perceiving some scenes to be over bright / washed out. I'd like to make sure that:
1) the level adjustment I show later seems reasonable (or that am I way off)
2) the approach to make proc amp adjustments to accommodate the brightest/darkest scenes on a tape seems valid/appropriate, and
3) that these proc amp adjustments won't burn me later when trying to adjust scenes that are not the brightest/darkest scenes.

I've read through the excellent settings guide "Capturing with VirtualDub" (http://www.digitalfaq.com/forum/vide...-settings.html). The capture device I'm using is a Hauppauge 610 USB Live 2 capturing to Huffyuv. I'm trying to minimize quality loss with the equipment I have.

Using the VirtualDub histogram capability, I've adjusted levels to try to eliminate spillover into red regions of the histogram (to prevent under 16 crushing / over 235 clipping). Attached are the following screenshots:

1) DefaultProcAmpSettings_4992.PNG: A frame from a capture with default proc amp settings (roughly middle of the brightness/contrast/hue/saturation/sharpness slides).

2) AdjustedProcAmpSettings_b6201_c4485.PNG: A similar frame from a capture with adjusted proc amp settings (brightness boosted, contrast lowered, and sharpness lowered).

The above were run through an AVISynth script (to crop overscan, ConvertToYV12, and present a Histogram).

3) AdjustedProcAmpSettingsCapture.PNG: A screenshot of virtualdub capture preview with somewhat similar levels, showing the VirtualDub histogram. These levels seemed at the time to me to be decently suited for the scene, but adjacent scenes on the tape seemed to need higher brightness and lower contrast to avoid crushing/clipping (hence the 6201/4485 levels in the other screenshot).

It seems to me that the histogram for screenshot 1 shows black level crushing (I'm basing this on the spike hugging 16 in the luma histogram), but it also seems to me (subjectively) that the image in screenshot 2 is a bit bright and washed out. Maybe this is a number of things (my monitor, eyes, lack of sleep, etc.).

From what I understand, part of the battle with analog video capture is setting up proc amp levels appropriate to the scene. With many scenes throughout each tape (and many tapes), this seems to be a tradeoff in number of tailored captures vs post-capture level adjustment (e.g. with AVISynth). If possible, I'd like to set up the proc amp for the extreme scenes (i.e. the brightest and darkest), which I'm hoping allows for fairly straightforward full-tape capture. I don't mind doing some very basic post-capture level adjustment, but I want to make sure my assumptions and approach is valid.

Do my proc amp adjustments seem reasonable, or am I missing/misinterpreting something?

Will adjusting proc amp for brightest/darkest scenes on a tape cause issues when performing post-capture level adjustment of other scenes?

Is there anything else that you see as a red flag that I should be aware of?

I'd love to make some great captures and rest easy knowing the footage is digitized (and backed up), so I can return the tapes to the closet and (hopefully) never have to touch them again.

Thanks

msgohan 12-13-2019 07:38 PM

IMO, the default Histogram() view in Avisynth (which is actually a waveform monitor) is more useful than the true histogram. There's less guesswork about which pixels are which value.

Typically the darkest parts of the image are actually artifacts where the VCR outputs false black immediately after a very bright detail. If you preserve these, you will wash out the real black level.

https://forum.videohelp.com/threads/...HS#post2107272

tbz128 12-13-2019 09:22 PM

1 Attachment(s)
Thank you. I've attached an image showing both clips with the default Histogram().

Would it be accurate to say that the top clip experienced black level crushing on capture (based on the buildup of white on the edge of the left legal boundary)?

Would it also be accurate to say that the bottom clip probably has its brightness boosted too high (based on the relatively large average gap between the left legal boundary and the grouped white line)? Or is this brightness level desirable because there are some dim groups of white dots between the left legal boundary and the grouped white line)? Would it be better to be more cautious and capture with higher brightness (then lower the brightness later on)?

themaster1 12-14-2019 03:08 AM

If you want an rgb histogram (more precise) (with 16-235 limits well defined):
Quote:

avisource().converttoyv12()
l=Histogram("levels").Crop(width, 0, 256, 72).Subtitle("luma")
r=ConvertToRGB(matrix="PC.601").ShowRed().ConvertT oYV12(matrix="PC.601").Histogram("levels").Crop(wi dth, 0, 256, 72).Subtitle("red")
g=ConvertToRGB(matrix="PC.601").ShowGreen().Conver tToYV12(matrix="PC.601").Histogram("levels").Crop( width, 0, 256, 72).Subtitle("green")
b=ConvertToRGB(matrix="PC.601").ShowBlue().Convert ToYV12(matrix="PC.601").Histogram("levels").Crop(w idth, 0, 256, 72).Subtitle("blue")
StackHorizontal(last,StackVertical(l,r,g,b).AddBor ders(0,0,0,height-288))
Moreover, in complement, coloryuv is always useful (it you gives numbers instead of a graph):
avisource
ColorYUV(analyze=true)

sanlyn 12-14-2019 06:17 AM

Quote:

Originally Posted by tbz128 (Post 65274)
It seems to me that the histogram for screenshot 1 shows black level crushing (I'm basing this on the spike hugging 16 in the luma histogram),

http://www.digitalfaq.com/forum/atta...ttings_4992jpg

It does show black crush or cutoff at exactly y=16, but it's not VirtualDub that does it. The Hauppauge capture device clips darks at y=16. The ATI 600 USB does the same thing.

Trying to adjust levels or hues for every scene in a VHS tape by using a single setting for the tape is an exercise in clinical masochism. Unlike many digital sources, VHS levels and colors explode and implode every few seconds especially on home camera videos that are usually levels nightmares. Your best bet is to set things up for worst case scenarios, then come back in post processing to tweak the results. Post-capture cleanup and tweaking are integral parts of analog restoration and is why lossless capture is recommended in the first place. Don't expect perfect results from the capture step alone.

People spend 2 hours capturing a 2-hour tape. Then, typically, they take 2 weeks to 2 months cleaning it up depending on how much of a disaster the original tape is. I once spent 14 months on a 3-hour taped opera. If all you needed was a single autopilot setting to do this work, you could just send your tape to Walmart and live with the results.

BTW, take another look at the image you posted earlier, shown above at the top of this post. Why go thru the trouble of cutting up and editing screen captures? That entire YUV frame and histogram can more easily be copied directly from the video in VirtualDub by using "Video..." -> "Copy source frame to clipboard" and pasting from the clipboard into your picture app. Or you can just press CNTL +1.

lordsmurf 12-14-2019 06:25 AM

Quote:

Originally Posted by sanlyn (Post 65286)
Trying to adjust levels or hues for every scene in a VHS tape by using a single setting for the tape is an exercise in clinical masochism.

Futility. :borg:

Feedbucket 12-14-2019 08:59 AM

To your second question, also keep in mind what Sanlyn mentioned about the capture device automatically clipping - but it seems like the whites were blown out at the source level and baked in since the pattern looks the same in both screenshots, especially if you were careful to keep it under 235 during capture.

Your second capture is the right idea if you're looking to accommodate worst case. If your scene has values that represent both blacks and whites they'll basically remain intact and you can re-adjust the levels in post so that they are back to 16 and 235.

sanlyn 12-14-2019 09:17 AM

Quote:

Originally Posted by Feedbucket (Post 65289)
To your second question, also keep in mind what Sanlyn mentioned about the capture device automatically clipping - but it seems like the whites were blown out at the source level and baked in since the pattern looks the same in both screenshots, especially if you were careful to keep it under 235 during capture.

Your second capture is the right idea if you're looking to accommodate worst case. If your scene has values that represent both blacks and whites they'll basically remain intact and you can re-adjust the levels in post so that they are back to 16 and 235.

Excellent points. Also, kick me for forgetting to mention that black borders and bottom-border head switching noise will affect the histogram. These are cropped off during setup processes (temporarily, mind you!) and are later modified or masked during post processing. Another home video problem is date and time imprints. Often these are far brighter than the main image content, so be aware of what that type of "feature" (aka=annoyance) is doing.

tbz128 12-14-2019 05:23 PM

3 Attachment(s)
Thanks everyone.

Quote:

It does show black crush or cutoff at exactly y=16, but it's not VirtualDub that does it. The Hauppauge capture device clips darks at y=16. The ATI 600 USB does the same thing.
Quote:

Your best bet is to set things up for worst case scenarios, then come back in post processing to tweak the results.
Right, the capture device was clipping. Sounds like I should adjust brightness/contrast levels such that I prevent the capture device from clipping (16/235) in the worst scene(s) I can find on the tape. Most of the other scenes would then be well within the 16/235 boundaries and could be adjusted in post (e.g. tweak brightness/contrast). Correct?

I had wanted to make sure I wasn't missing something. For example, I did a quick luma offset and contrast adjustment tweak (with ColorYUV(off_y=-10,cont_y=30) attached as AdjustedLumaRGB.png). I see gaps in the luma graph (I'm assuming because of the contrast adjustment stretching things horizontally). Is this ok? (i.e. not perfectly ideal, but the only thing possible since the source had a reduced range).

http://www.digitalfaq.com/forum/atta...stedlumargbjpg


Quote:

Why go thru the trouble of cutting up and editing screen captures?
Because I was naive! Thanks for the tip.


Quote:

If you want an rgb histogram (more precise) (with 16-235 limits well defined)
Excellent, thank you! I'll be using this moving forward. Attached are DefaultProcAmpRGB.png and AdjustedProcAmpRGB.png. Since these are post capture, the most meaningful thing I'm seeing is that the left side if the luma "mountain" seems clipped off (not shockingly, just another view). I'm also assuming that the green values under 16 are normal/expected because the graph is showing RGB color space (which would range from 0-255).

http://www.digitalfaq.com/forum/atta...tprocamprgbjpg

http://www.digitalfaq.com/forum/atta...dprocamprgbjpg

Quote:

To your second question, also keep in mind what Sanlyn mentioned about the capture device automatically clipping - but it seems like the whites were blown out at the source level and baked in since the pattern looks the same in both screenshots, especially if you were careful to keep it under 235 during capture.
Would it be correct to assume (since I had adjusted proc amp for the second capture to prevent clipping), that this is from the camera and/or VCR? Or is this from the capture device prior to application of proc amp (forgive me, I'm not sure if proc amp is adjusting the actual hardware signal handling or if it is an adjustment made between the capture device hardware and what is fed to the codec).

Quote:

black borders and bottom-border head switching noise will affect the histogram
Yup, that's a great point. When setting up proc amp for capture (while viewing the histogram), I had used the guide's recommendation to apply cropping such that the head noise and overscan were removed (so wouldn't impact the histogram). Cropping was then removed just prior to capture.

tbz128 12-14-2019 05:38 PM

Quote:

Trying to adjust levels or hues for every scene in a VHS tape by using a single setting for the tape is an exercise in clinical masochism. Unlike many digital sources, VHS levels and colors explode and implode every few seconds especially on home camera videos that are usually levels nightmares. Your best bet is to set things up for worst case scenarios, then come back in post processing to tweak the results. Post-capture cleanup and tweaking are integral parts of analog restoration and is why lossless capture is recommended in the first place. Don't expect perfect results from the capture step alone.
I'm probably not fully understanding. Should I be doing A or B? (or something else)

A) Try to find the brightest and darkest scenes in the tape (i.e. try to find the worst case scenarios) and set proc amp levels based on those scenes. Record the whole tape. Split the capture into multiple files in post as needed. Perform levels adjustment on each file as needed (I was planning on keeping originals and having saved AVISynth scripts that saved my adjustment such that future adjustments could be made easily).

B) Try to record scene by scene on the tape (instead of capturing the whole tape at once). Adjust proc amp levels for the scene. Scenes would already be split then, and subsequent levels adjustment would probably still be needed (albeit less than in A).

sanlyn 12-14-2019 10:15 PM

Quote:

Originally Posted by tbz128 (Post 65297)
I'm probably not fully understanding. Should I be doing A or B? (or something else)

A) Try to find the brightest and darkest scenes in the tape (i.e. try to find the worst case scenarios) and set proc amp levels based on those scenes. Record the whole tape. Split the capture into multiple files in post as needed. Perform levels adjustment on each file as needed (I was planning on keeping originals and having saved AVISynth scripts that saved my adjustment such that future adjustments could be made easily).

B) Try to record scene by scene on the tape (instead of capturing the whole tape at once). Adjust proc amp levels for the scene. Scenes would already be split then, and subsequent levels adjustment would probably still be needed (albeit less than in A).

A)
You don't have to analyze the entire tape. A quick scan of several segments will give you a good idea of the kind of level extremes you'll encounter. It's possible that now and then you might see a segment pass thru that is simply blown apart by bad levels or other problems, so go back later and re-try that segment if necessary. But most of the time such exceptions can usually be repaired in post by working in the original captured YUV before proceeding with other filters. You should be making initial post-process analyses and corrections in YUV to begin with, anyway. Note that YUV and RGB are two different matrices. They don't store data the same way and they don't behave alike as far as levels and chroma are concerned.

You don't have to get heavily into Avisynth filters to clean up a video at least nominally, but once you get into RGB editors (like NLE's and/or VirtualDub) when you have undesired YUV problems you're making it tough on yourself.

Go to an old webpage titled 7.2 Postprocessing video using AviSynth. Note that the top title line on that page is a paragraph numbered "7.2". Scroll 'way down several inches nearer to the lower 1/3 of the web page to the paragraph that's titled "7.2.9.1 The Basics (brightness/contrast/saturation)" in bold characters. The text mentions VirtualDubMod, which is of course obsolete and can be ignored -- newer VirtualDub editions still work the same way shown in the article.

If you have more questions or want more details, remember that you can post video samples that members can work with. Post video samples in the forum, not in YouTube or offline sites. We can't work reliably with reprocessed offline samples. See How to create a short sample in VirtualDub from a lossless AVI capture.

tbz128 12-15-2019 09:40 AM

1 Attachment(s)
Quote:

Originally Posted by sanlyn (Post 65299)
If you have more questions or want more details, remember that you can post video samples that members can work with.

Thank you. Attached is a short clip in Huffyuv that is one of the worse shots in the tape. This capture was done with proc amp adjusted to minimize values in the "red" portions of the VirtualDub capture histogram (i.e. to keep the values within the legal, "blue" range).

Also, I understand that more time base correction would probably make things better (e.g. the wobbly window pane grill). All I have for now is a borrowed JVC DR-MV150 into my Hauppauge 610.

tbz128 12-15-2019 09:51 AM

2 Attachment(s)
Attached is a frame with histogram generated from the following AVISynth script:

Quote:

AviSource("test_b6201_c4485.avi")
Crop(16,16,-16,-16)
Histogram()
http://www.digitalfaq.com/forum/atta...b6201_c4485jpg

Seems like some basic luma correction might be done with something like the following:
Quote:

AviSource("test_b6201_c4485.avi")
ColorYUV(off_y=-15,gain_y=30)
Crop(16,16,-16,-16)
Histogram()
http://www.digitalfaq.com/forum/atta..._correctionjpg

However, it seems like this correction is pulling black levels into the illegal 0-16 range, right? The video I'm working with seems to have a fairly clear black level line with other tufts of black below that. How would I deal with these tufts?

sanlyn 12-21-2019 01:31 AM

3 Attachment(s)
Quote:

Originally Posted by tbz128 (Post 65313)
Attached is a frame with histogram generated from the following AVISynth script:

http://www.digitalfaq.com/forum/atta...b6201_c4485jpg

Seems like some basic luma correction might be done with something like the following:


http://www.digitalfaq.com/forum/atta..._correctionjpg

However, it seems like this correction is pulling black levels into the illegal 0-16 range, right? The video I'm working with seems to have a fairly clear black level line with other tufts of black below that. How would I deal with these tufts?

You might have to re-capture some of these worst-case segments. Note that the bright scene outside the window is also clipped.

I'd say that trying to make the darker parts of the picture look like daylight would be futile. Really, the only thing you'll find in those crushed shadows is distortion, discoloration, smears, and noise. There's already a ton of distortion in these images already, but you'll be shocked when you see how much damage is done to clipped data. And there's no way to fix it.

It looks as if some clipping was done in the camera. It's too bad you didn't have a film camera, because digital video is in no way capable of rendering a scene with such extremes of contrast between light and dark. It's easy to see how data outside the bright window is clipped (i.e., destroyed). But when you brighten the darkest parts you'll get outright visual junk. Lots of annoying flicker in there, too, put there by your camera. If I were you I'd give this shot just a little brightening in the grim shadows, but not much. It would give something similar to the brighter pick you posted above,
http://www.digitalfaq.com/forum/atta...1&d=1576912489

I used a filter called ContrastMask.avs. The results are attached as test_sample_rework.mp4. Note: change the path statements in the script below to match locations in your system:

Code:

Import("D:\Avisynth 2.6\plugins\ContrastMask.avs")
AviSource("D:\forum\faq\tbz128\test_b6201_c4485.avi")
AssumeTFF()
ConvertToYV12(interlaced=true)
ContrastMask(enhance=5.0)
Levels(8,1.0,255,16,250,dither=true,coring=false)

QTGMC(preset="medium",EZDenoise=8,denoiser="dfttest",ChromaMotion=true,\
  ChromaNoise=true,DenoiseMC=true,border=true,GrainRestore=0.3)
BiFrost(interlaced=false)
FixChromaBleedingMod()
LimitedSharpenFaster()
AddGrainC(2.0,2.0)
### --- restore interlace --- ###
SeparateFields().SelectEvery(4,0,3).Weave()
ConvertToRGB32(interlaced=true,Matrix="Rec601")
Crop(4,0,-12,-10).AddBorders(8,4,8,6)

I opened the script in VirtualDub and loaded some VirtualDub filters to tweak the colors and levels. I used 32-bit filters. The VDub filters I used were CamCorderColorDenoise 1.8, DeFlicker 1.3, ColorMill 2.1, gradation curves, and Donald Graft's Hue\saturation\intensity 1.2. The settings I used are in the attached .vcf file. A .vcf is a text file that you can use to save or load a set of VDub filters and settings. To load the filters with the settings I used, click "File..." -> Load processing settings..." then locate and select the saved .vcf file/ Keep vcf's in a folder with your video project/ Don't save .vcf's in your VDub p[lugins folder.

You can get ContrastMask.avs here: http://www.digitalfaq.com/forum/atta...ontrastmaskavs. For such a small filter it requires some big-time support files:

It requires VariableBlur.dll (get VariableBlur_070.zip at http://www.digitalfaq.com/forum/atta...bleblur_070zip)/ VariableBlur itself requires the FFTW3 Windows system library and the 2010 SP1 VisualC++ runtime. A lot of filters use VariableBlur, but it requires some support files or it won't work. Take a look at VariableBlur's support page for links to its requirements and more instructions:http://avisynth.nl/index.php/VariableBlur.

ContrastMask also requires the premiere masking filter, MaskTools2. One of the late versions that works with VariableBlur and more than a dozen major filters (including QTGMC) is MaskTools2. Version 2.2.18 can be downloaded as a 7zip file at https://github.com/pinterf/masktools...ls2-v2.2.18.7z.

If you don't have the 7-zip program, get it. Very handy, and also unzips ZIP files and has a neat GUI interface. Comes free with an installer for 32-bit and 64-bit: https://www.7-zip.org. The 32-bit version will suffice.

Download and keep the zip file that contains the source code for MaskTools2 (well, after all, since it's openGL material we're supposed to tell you where the source code is): https://github.com/pinterf/masktools/archive/2.2.18.zip.

If you want to see how extensive MaskTools2 is and why it's used by so many other filters, give its support page a casual browse: http://avisynth.nl/index.php/MaskTools2.

Another way to brighten those shadows is to use one of the better so-called autogain filters. HDRagc has settings that will brighten it, all right, to the point where you can see all the fluttery, noisy mush and CMOS junk that's really down there in those shadows.

HDRagc is explained on its home page, with pictures: http://web.archive.org/web/201308120...iko/hdragc.htm. The page has some nice images that show how HDRagc is designed for darker objects that are subdued by strong backlight. They also demonstrate the difference between things that are just dark, and things that are clipped.

You can download it at the top of that web page by clicking the "Download Now!" link, or click here: http://web.archive.org/web/201308120...ragc-1.8.7.zip. I did give HDRagc a try and made things brighter, but the noise and distortion in the brightened shadows were seriously godawful and wouldn't go away.

Angies_Husband 12-21-2019 07:08 PM

This is a great thread! I didn't realize the "Histogram()" command could make a waveform view. Very cool.

I had a somewhat related question, but decided to start a new thread on it, since it was specifically about the capture process prior to the capture card. Essentially, thoughts on best practices for controlling clipping (while not going insane capturing and leveling each segment of the tape separately).

http://www.digitalfaq.com/forum/vide...html#post65391

But I think this thread is a great example of how once content is clipped, it's gone for good. I'm actually kinda amazed how much content is actually on the raw VHS...


All times are GMT -5. The time now is 08:03 AM

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