Go Back    Forum > Digital Video > Video Project Help > Capture, Record, Transfer

Reply
 
LinkBack Thread Tools
  #1  
04-25-2021, 01:09 PM
rick_s rick_s is offline
Free Member
 
Join Date: Jun 2020
Location: Ontario, Canada
Posts: 10
Thanked 2 Times in 2 Posts
I have recently begun capturing my camcorder VHS-C (NTSC) tapes after spending several months researching the threads here. One thing I'm still not clear on is Sanlyn's comment in one of the guides here about adjusting proc amp brightness and contrast values within VirtualDub to keep within the preferred 16-235 video range.

My current process is:
1) Capturing with an AIW 9600 AGP card to VirtualDub Lagarith lossless YUY2 file at 720x480.
2) Using AviSynth I deinterlace, crop to 704x480 and mask out remaining edge noise then resize to 640x480 (for square pixel displays).
3) Move the lossless files to another workstation that has routinely colour calibrated displays and open in Adobe Premiere Pro and edit out unwanted frames, add titles, colour/saturation/levels, etc
4) My intent is to encode to H.264 (I assume that's the best format) and put them on USB drives for for family members to watch on computers and smart TVs.

What I'm finding is, after adjusting proc amp settings so brights are within range and blacks dip a little bit into the Red as per the guide, the initial captured files are of low contrast and washed out looking. When I bring the file into Premiere I end up moving the black and white levels back out and adjust curves to get suitable contrast so I can get a decent looking image when viewed a TV or PC off a USB stick.

My questions is, if the final files are being viewed on a computer or smart TV directly from a file on a disk drive (or media streaming hub), do I still need to keep everything within 16-235 because somewhere in my process colour spaces are being changed and clipping darks and brights, or can I just keep everything within the full RGB 0-255 range that my capture card is seeing from the VCR and not have to make so many adjustments in Premiere Pro?
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
04-26-2021, 07:28 AM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
The first "level adjustement" is related to the range captured by your card: if it (legally) captures the 16-235 range, and the VHS video is 0-255 range you should adjust the proc amp to stay inside 16-235 range while capturing. [I said legally for lordsumrf joy :-)]

Then you have 2 options:

1- do nothing to the captured file in term of post processing and watch the file as it is on PC or on TV. In this case I experienced that is better to expand the levels to 0-255 for PC viewing and for TV viewing, but concering the TV levels you may have a different behaviour, so you have to experiment yourself.

2- do a post processing (denoising, sharpening, etc.). The fact that the levels are 16-235 is mandatory for the filters to work in the proper range. This was achieved with the first "level adjustement"; if not the levels must be centered in the range 16-235 prior to filtering (many sanlyn posts explain well this).

In this second option I experienced that after filtering the levels at the end are 0-255:

http://www.digitalfaq.com/forum/vide...ore-after.html

Beeing that I leave the levels at 0-255 for PC or TV viewing as per option 1, but again you should experiment yourself.

I also keep the levels at 0-255 for h264 encoding, but this is more arguable.
Reply With Quote
  #3  
04-26-2021, 04:29 PM
rick_s rick_s is offline
Free Member
 
Join Date: Jun 2020
Location: Ontario, Canada
Posts: 10
Thanked 2 Times in 2 Posts
Quote:
Originally Posted by lollo2 View Post
The first "level adjustement" is related to the range captured by your card: if it (legally) captures the 16-235 range, and the VHS video is 0-255 range you should adjust the proc amp to stay inside 16-235 range while capturing. [I said legally for lordsumrf joy :-)]
Thanks for the reply lollo2.

That's one of the things that wasn't clear to me. Do I need to adjust the incoming capture feed to be within 16-235 because my capture card can't capture any discernible detail in the 0-15 and 236-255 range,
OR...
is my ATI All-In-Wonder 9600 capable of capturing the full 0-255 range but it's considered best practice to start with limited levels in the process because some destination video displays (or video file formats?) will be clipping the detail outside of the 16-235 range?

I'll redo a couple of my captures using the default proc amp settings and see how they compare.
Reply With Quote
  #4  
04-26-2021, 05:32 PM
keaton keaton is offline
Premium Member
 
Join Date: Jan 2017
Location: USA
Posts: 191
Thanked 90 Times in 64 Posts
The fundamentals here are that there are 2 different domains involved - The YUV video domain, and the RGB domain.

Capture works in the YUV video domain (also the broadcast television domain), where luminance (the Y in YUV) is constrained to 16 to 235, and about 16 to 240 in the UV (the color channels). Capture histogram in Virtualdub is the Y channel (i.e. 16 to 235). Anything in the red is below 16 or above 235.

Computers displays work in the RGB domain, which has Red, Green, and Blue values in the 0 to 255 range.

You work with software on a PC, it converts between the YUV and RGB domains. When you use software tools that work in YUV, remain in the 16 to 235 range for Luminance (i.e. using Avisynth plugins and displaying levels in an avisynth histogram that shows you a legal luminance range of 16 to 235). When you work with tools using the RGB range, (e.g. Virtualdub plugins such as ColorMill or Gradation Curves), you have the range of 0 to 255 to play with because Virtualdub is RGB based. When done and saving an AVI in a RGB based tool, it can be converted back to a lossless AVI that is YUV based.

There are mathematical formulas involved that convert between these two domains of YUV and RGB, which good software tools will use. I cannot speak for all of them. When you do things such as ConvertToYUY2 or ConvertToYV16 in Avisynth that is a YUV based domain. Whereas ConvertToRGB in Avisynth converts to RGB domain. Depending on the tool you are using, or the domain your file is being processed in, then you need to be aware so you know what the legal range is.

These mathematical formulas are more complex than simply clipping off the lower 0-15 and upper 236-255. The darkest dark in YUV is 16, which is mapped to RGB of 0, and vice versa. Similarly the brightest bright in YUV is 235, which is mapped to RGB of 255, and vice versa.

If you capture outside this domain of 16 to 235, that means you've clipped shadow or highlight and may lose details. Once clipped, you cannot get it back. Although, if you do have clipped video, the best you can do is use something like Avisynth Levels function to remap these out of gamut values to be in the 16 to 235 gamut, so that at least it is broadcast safe. A PC won't care. But in things like broadcast or video disc production, you need to be sure your levels are within these ranges. The rest is just whether or not you are crushing/clipping details on the high or low end.

If you want to improve contrast later, and many of us do, then use tools like Virtualdub, Avisynth, or whatever to utilize as much of the legal gamut of YUV or RGB, depending on what domain your tool is working in, to get as full of a contrast as possible.

When saving files to a format such as HuffYUV or Lagarith AVI, it is in the YUV domain. When converting from a lossless AVI to MPEG-2 or H264 (i.e. MPEG-4), the result is also in the YUV domain. When the file is played on a computer monitor, YUV is converted to RGB before it is displayed to the monitor. When played on a TV, it remains in the YUV domain.

I hope this helps clear things up. I encourage you to search/read the forum for more. There's tons of threads on this subject.
Reply With Quote
The following users thank keaton for this useful post: Hushpower (04-27-2021), rick_s (04-27-2021)
  #5  
04-27-2021, 05:56 AM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
Quote:
Do I need to adjust the incoming capture feed to be within 16-235 because my capture card can't capture any discernible detail in the 0-15 and 236-255 range,
OR...
is my ATI All-In-Wonder 9600 capable of capturing the full 0-255 range
1) If your ATI All-In-Wonder 9600 is capable of capturing the full 0-255 range you do nothing in capture.
Then, if you plan further work in AviSynth (YUV domain, as keaton rightly point out) you will move the levels to 16-235. You may also move the levels to 16-235 if your are watching the original captured file on TV and are not happy with the levels.

2) If your ATI All-In-Wonder 9600 (legally) is not capable of capturing the full 0-255 range you do adjust the incoming level in capture with procamp to stay in 16-235 range.

Addition: according to this test http://www.digitalfaq.com/forum/vide...html#post62640 ATI All-In-Wonder 9600 captures the range 16-252. Try yourself
You could then use the procamp to capture in the range 16-252 instead of 16-235, but then for the region 235-252 same as 1) apply

Last edited by lollo2; 04-27-2021 at 06:11 AM.
Reply With Quote
The following users thank lollo2 for this useful post: rick_s (04-27-2021)
  #6  
04-27-2021, 08:08 AM
traal traal is offline
Free Member
 
Join Date: Jan 2016
Posts: 398
Thanked 75 Times in 68 Posts
When I try to expand the luma range to 0-255, the video looks unnaturally contrasty, and I can't seem to fix it. Leaving it in the 16-235 range looks best to me, even without the rich, dark blacks.
Reply With Quote
  #7  
04-27-2021, 08:53 AM
lollo2 lollo2 is offline
Free Member
 
Join Date: Mar 2013
Location: Italy
Posts: 673
Thanked 189 Times in 163 Posts
Quote:
When I try to expand the luma range to 0-255
Why do you need to expand the range? I do not see a reason for that, but I may be wrong.

Quote:
video looks unnaturally contrasty, and I can't seem to fix it
On the other hand, the filtering in avisynt expand the YUV input range 16-235 to YUV output range 0-255, even if no RGB filters are used, and often the black levels are not good to my personal taste. I then add a level correction after filtering:

http://www.digitalfaq.com/forum/vide...html#post69908
Reply With Quote
  #8  
04-27-2021, 10:29 AM
rick_s rick_s is offline
Free Member
 
Join Date: Jun 2020
Location: Ontario, Canada
Posts: 10
Thanked 2 Times in 2 Posts
Quote:
Originally Posted by keaton View Post
I hope this helps clear things up. I encourage you to search/read the forum for more. There's tons of threads on this subject.
Thank you for the detailed explanation, that helps to make some sense now. The RGB colour gamut isn't as large as what YUV covers.

My process is pretty straight forward:
- I capture in YUV then run the file with a very basic AviSynth script to deinterlace to 59.94fps, crop and resize and save in the same lossless YUV format (no colour space converstion is specified, no other restoration filters are used)
- The file then goes to Abobe Premiere Pro for colour/contrast adjustments and exported as an H.264 file which I'm assuming is in the same YUV colour space that I started with and worked with.
- The final MP4 files will be viewed on computers and smart TVs from a USB drive. No DVDs, no Youtube, nothing broadcast related, etc.

I just did a capture test with the default proc amp settings and it created a file with the full range of 0-255 histogram levels that a JVC S-VHS VCR was feeding the AIW 9600 card (including the stuff in the red zones). When viewing the file in Premiere Pro the Lumetri Luma waveform and vector scopes show the full range of luma and chroma activity from 0 to 255 just as was captured (including the detail at the ends of the range). When I bring the exported MP4 file back into Premiere I see the same histogram levels (nothing lost or clipped)

Being that my final video file is only going to be shown on computers and TVs it looks like my issue will be a colour space conversion on computers. As Keaton said "TVs are YUV" (although I'm not sure if a TV reading a file through a USB connection acts like a computer and does an RGB conversion and clips the darks and brights or not).

Understanding now why the final YUV video file needs to be within 16-235 range, I did a couple of tests today and what I found was that I think I get better results capturing in full 0-255 and compressing the range in Premiere Pro than I do if I adjust the proc amp to keep the capture inside 16-235 then try to expand out the darks, brights, curve adjustments etc for a decent amount of contrast so the image doesn't look so flat. I kind of equate the levels adjustments to resizing an image; its better to start with a high resolution image and downsize than upsize from a lower resolution image. I'll have to do some more tests and try it on a TV to compare.
Reply With Quote
  #9  
04-27-2021, 06:25 PM
keaton keaton is offline
Premium Member
 
Join Date: Jan 2017
Location: USA
Posts: 191
Thanked 90 Times in 64 Posts
Quote:
Originally Posted by rick_s View Post
Thank you for the detailed explanation, that helps to make some sense now. The RGB colour gamut isn't as large as what YUV covers.
You're welcome. Well, kinda. Just because YUV outside 16 to 235 can be registered in YUV doesn't mean it provides any additional gamut that is discernable on a display. The YUV 16 to 235 legal range covers same gamut as RGB 0 to 255. There is no clipping involved so long as you keep the YUV capture within 16 to 235. Avisynth has functions that convert between TV (YUV 16-235) and PC (RGB 0-255) For each, the lowest value (16 for YUV and 0 for RGB) is the darkest you can go, and the highest value is the brightest you can go. YUV of 0 to 15 cannot go any darker and are also mapped to RGB 0. YUV above 235 also maps to RGB 255. But values in between 16 to 235 are mapped using floating point arithmetic (i.e. fractions of an integer value). If you have YUV data that is outside the legal gamut of 16 to 235, what you'll see in RGB is more values are crushed against the 0 or 255 edges in those histograms, which destroys subtle details in shadows or highlights. Likewise, if you convert back to YUV, more data will be crushed against the 16 and 235 edges.

Quote:
- I capture in YUV then run the file with a very basic AviSynth script to deinterlace to 59.94fps, crop and resize and save in the same lossless YUV format (no colour space converstion is specified, no other restoration filters are used)
QTGMC can also modify the levels a bit, depending on what functions in it you use. Suggest looking at histogram in Avisynth using Histogram("levels") after you've done all your processing. Also suggest cropping off all the edge noise before the Histogram call so you don't allow that to effect your histogram results. Since that part will be cropped out anyway, you don't want that stuff (which is sometimes darker or brighter than anything else in frame) to give you a false impression of what the darkest dark or brightest bright is. Then do the addborders call last. Otherwise, you'll see a big wall at 16 on the YUV histogram due to all the dark edge you've added back in to preserve the 720 x 480 resolution. You may need to have a ConvertToYV16(interlaced=true) call (if you are staying in 4:2:2 color space, otherwise ConvertToYV12 for 4:2:0) before the Histogram call to be in the right color space for Histogram to work. Observe the top histogram for luminance, notice it has a range below 16 and above 235 to show if your luminance is outside the legal range and causing crushed shadows or highlights.

Example:
Code:
ConvertToYV16(interlaced=true)

# Assuming that if you uncommented these Histogram("levels") and crop calls here that the video won't have anything outside 16-235

#crop(4,0,-12,-8) # Tailor values for your specific case
#Histogram("levels")

# QTGMC can effect levels a bit with some options
QTGMC(preset="medium")

# Crop off edge noise and white or black borders where video isn't present so that it doesn't influence the histogram
crop(4,0,-12,-8) # Tailor values for your specific case

# The Levels call is just an example. If you find the darkest value is a couple points below 16 in YUV histogram, set input lowest value to say 13
# And if you find brightest bright is above 235 by a couple, then set value below to 237
# The values 13 and 237 can be tweaked higher or lower until the Histogram result does not go outside 16-235
# If, on the other hand, values don't ever reach to 16 or 235, you can increase the 1st value to Levels above 16
# and the 3rd value to Levels below 235 until you find values that do bring the darkest closer to 16 and brightest closer to 235
# If the video looks too dark, you can modify the second value here from 1.0 to 1.1 or whatever to increase the contrast, but still preserve the 16 to 235 range.
# If the video looks too bright, you can modify the second value here from 1.0 to 0.9 or whatever to decrease the contrast, but still preserve the 16 to 235 range.
Levels(13,1.0,237,16,235,coring=false,dither=true)

Histogram("levels") # Comment this line out before rendering final file

addborders(8,4,8,4) # Tailor values based on values entered in crop call above to get back to 720 x 480 or 704 x 480
Quote:
- The file then goes to Abobe Premiere Pro for colour/contrast adjustments and exported as an H.264 file which I'm assuming is in the same YUV colour space that I started with and worked with.
Never used Adobe. But it likely has some kind of levels or curves adjustments (similar to Photoshop) that allows you to adjust your contrast (i.e. luminance). I would say that it is better to capture within 16 to 235 so that you do not crush any detail. I would think that what you may see as an improvement when capturing outside the gamut of 16 to 235 is that the midrange looks better to you because that approach shifted more values to the right or left. But what I would guess you are not seeing is how that is destroying details in the shadows and highlights because you now have a histogram that has data being crushed up against the wall of 0 or 255 when in RGB. I'm guessing that Adobe histograms are expressed in RGB domain.

Put another way, capture the data within 16 to 235, so that it is not losing any detail. What you may notice is that the histogram shows too much data in the lower half of the histogram (too much midrange being pushed closer to shadows) or not enough in the upper half (too much highlight being pushed into the midrange). This also causes the flat or washed out look. The real solution to that is to adjust the luminance with a level or curve adjustment so that you push more data from dark to midrange or push more data from highlight to midrange, as the case may be. One way to adjust that is in the Avisynth example above where the second value in the Levels call is a decimal where a value above 1.0 increases contrast toward highlight and a value below 1.0 decreases contrast toward shadow. There are other functions in Avisynth, such as Tweak that do similar things.

Best of luck to you.

Last edited by keaton; 04-27-2021 at 07:04 PM.
Reply With Quote
The following users thank keaton for this useful post: rick_s (04-28-2021)
  #10  
04-28-2021, 02:38 PM
rick_s rick_s is offline
Free Member
 
Join Date: Jun 2020
Location: Ontario, Canada
Posts: 10
Thanked 2 Times in 2 Posts
Quote:
Originally Posted by keaton View Post
You're welcome. Well, kinda. Just because YUV outside 16 to 235 can be registered in YUV doesn't mean it provides any additional gamut that is discernable on a display.
Thanks again for taking the time to explain this out in so much detail. I think where I was getting thrown off was because my VCR was feeding my capture card various dark and bright information outside of the legal video range (which I could capture and see the full range in Premiere) that they were valid levels to work with, otherwise why would those out of range levels even get output by the VCR? I was figuring it was best to keep all of the levels range detail and just reduce from there as needed.

Quote:
Originally Posted by keaton View Post
Never used Adobe. But it likely has some kind of levels or curves adjustments (similar to Photoshop) that allows you to adjust your contrast (i.e. luminance). I would say that it is better to capture within 16 to 235 so that you do not crush any detail. I would think that what you may see as an improvement when capturing outside the gamut of 16 to 235 is that the midrange looks better to you because that approach shifted more values to the right or left.
Premiere Pro CC has an amazing GUI for doing levels adjustments and colour work. Certainly more tools there then I would ever need. You were right in that my full range captures looked better being that the midtones and shadows were appearing darker and helping the contrast.

I tried your AviSynth suggestion of Histogram and levels scripts today and now understand how they work. I only have a very basic understanding of AviSynth, just enough to get it working and do deinterlacing, crop, borders and resize.

Since I have 30 tapes done so far where I adjusted to Proc Amp to try to keep within the 16-235 range, I'll follow your advice to keep capturing inside of that range and make levels and contrast curve adjustments after to make things look better. The one thing I find frustrating in capturing with VirtualDub is the process of using its histogram feature to make proc amp adjustments (all lot of back and forth with no real-time preview, not to mention remembering to turn off the cropping ). I started doing it for each scene but it was too time consuming so I just settled on a "one size seems to fit all" type of setting depending on which VCR I'm using.
Reply With Quote
The following users thank rick_s for this useful post: keaton (04-28-2021)
  #11  
04-28-2021, 08:51 PM
keaton keaton is offline
Premium Member
 
Join Date: Jan 2017
Location: USA
Posts: 191
Thanked 90 Times in 64 Posts
Quote:
Originally Posted by rick_s View Post
Thanks again for taking the time to explain this out in so much detail. I think where I was getting thrown off was because my VCR was feeding my capture card various dark and bright information outside of the legal video range (which I could capture and see the full range in Premiere) that they were valid levels to work with, otherwise why would those out of range levels even get output by the VCR? I was figuring it was best to keep all of the levels range detail and just reduce from there as needed.
You're welcome! Video levels are changed by so many things, including: the broadcast itself, the VCR that made the recording, the VCR that plays it back, and other things in the video capture chain. Most of those things are likely not calibrated, and it only takes one of them to cause levels to go out of gamut. Only histograms and scopes can truly tell you what's legal.

Quote:
Originally Posted by rick_s View Post
Premiere Pro CC has an amazing GUI for doing levels adjustments and colour work. Certainly more tools there then I would ever need. You were right in that my full range captures looked better being that the midtones and shadows were appearing darker and helping the contrast.

I tried your AviSynth suggestion of Histogram and levels scripts today and now understand how they work. I only have a very basic understanding of AviSynth, just enough to get it working and do deinterlacing, crop, borders and resize.
Glad to help you with the fundamentals. They are the bedrock of quality video transfering/remastering.

Quote:
Originally Posted by rick_s View Post
Since I have 30 tapes done so far where I adjusted to Proc Amp to try to keep within the 16-235 range, I'll follow your advice to keep capturing inside of that range and make levels and contrast curve adjustments after to make things look better. The one thing I find frustrating in capturing with VirtualDub is the process of using its histogram feature to make proc amp adjustments (all lot of back and forth with no real-time preview, not to mention remembering to turn off the cropping ). I started doing it for each scene but it was too time consuming so I just settled on a "one size seems to fit all" type of setting depending on which VCR I'm using.
I've been there many times forgetting to undo the cropping during preview before capture. I wouldn't believe someone saying they haven't.

My AIW card only captures in Preview mode. Other cards only capture in Overlay, some in either. If you haven't tried, maybe you have a card that can capture in Preview. If so, then you would have a live histogram during capture.

Otherwise, you are flying a bit blind. Which is not great. However, if that's the only option, you can try to preview the tape in the darkest scenes and the brightest scenes. And give yourself a little bit of cushion and not press things to the limit during capture. Not too much cushion if you can avoid it, but a little is a good idea. It's just a wild guess, of course, because sometimes you still see a spike outside the legal range after all that previewing. I think it tends to happen more with highlights than shadows. So, if that does happen, you can always do a Levels(16,1.0,240,16,235,coring=false,dither=true) call (assuming nothing was going higher than 240) to pull those crushed highlights back into legal range. Not the end of the world, and probably not worth redoing a capture over.

If you have a tape recorded from the same machine on the same broadcast channel, then you may be able to get a good idea after a bit of capture what proc amp settings you need, and the rest may not need any previewing. When you switch to a tape made from a different machine or played back on a different capture VCR or a recording of a different TV channel, maybe take notes of where the levels were so you can revert them when you switch back to more recordings from the same combination. I haven't found I've had to dial things up or down too much over the range of tapes I've captured. If using more than one capture VCR, you may start to get a sense of basic characteristics of machine A vs B and know that if you try the tape in the other machine you have to shift brightness up or down so many ticks to get shadows to the same place as the other. Of course if you have to shift brightness up or down, then naturally the contrast would likely need to be dialed down or up a bit accordingly.

But, the overall philosophy should be to just get a decent capture that's not going out of range much, or at all if possible. Levels adjustments can always be done in post to fully utilize shadow and highlight. But there's a limit to that, of course. If you capture things with lots of empty space on the histogram and the scene should have a healthy amount of shadow, midrange, and highlight, then using levels and curves to stretch it out may have some limitations of effectiveness compared to starting with a healthier capture histogram-wise. What you cannot undo is the damage done by too much clipping.
Reply With Quote
The following users thank keaton for this useful post: rick_s (04-28-2021)
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
VirtualDub, Histogram and encoding levels WarbirdVideos Capture, Record, Transfer 7 12-10-2019 07:38 PM
Red line in VirtualDub capture histogram Feedbucket Capture, Record, Transfer 3 01-23-2019 03:54 AM
VirtualDub level and histogram settings on captures? greeneagle Capture, Record, Transfer 2 07-13-2016 10:43 AM
Avisynth histogram vs. ColorYUV for calibrating levels? CyborgHyena Restore, Filter, Improve Quality 3 12-28-2015 04:13 PM




 
All times are GMT -5. The time now is 12:56 PM