+ Reply to Thread
Results 31 to 47 of 47
Last edited by jagabo; 4th May 2021 at 19:11.
There seems to be some confusion here. From what I have read, the darkest luma level (black) should be set around RGB=16 .....
The conversion YUV <-> RGB depends on the conversion matrix which is in effect.
As I understand it:
a. according to ITU-R BT-601 Studio encoding parameters of digital television for standard 4:3 and wide-screen 16:9 aspect ratios:
Black: Y'CbCr(16,128,128) <-> RGB(16,16,16)
White: Y'CbCr(235,128,128) <-> RGB(235,235,235)
This seems to leave headroom for RGB also.
b. according to Intel and some other documents (https://software.intel.com/content/www/us/en/develop/documentation/ipp-dev-reference/t...?language=en):
Black: Y'CbCr(16,128,128) <-> RGB(0,0,0)
White: Y'CbCr(235,128,128) <-> RGB(255,255,255)
Last edited by Sharc; 5th May 2021 at 02:53.
AviSynth with ConvertToRGB(matrix="PC.601") or ConvertToRGB(matrix="PC.709").
But when you view video and images on a computer monitor black is at RGB=0, white at RGB=255.
Last edited by Sharc; 5th May 2021 at 07:03.
If you want to see actual YUV values on your computer screen use a script that looks like this:
AviSource("testXP4a.avi") StackHorizontal(ColorYUV(cont_u=-256, cont_v=-256).Subtitle("Y"), UtoY().Subtitle("U"), VtoY().Subtitle("V")) ConvertToRGB(matrix="PC.601")
[Attachment 58729 - Click to enlarge]
You can then read YUV values directly off the screen with csamp, VirtualDub, or some other screen color tool.
In VirtualDub add the crop filter and hold down a Shift key while moving the mouse cursor over the preview image:
[Attachment 58730 - Click to enlarge]
You can't see the mouse cursor in the screenshot but it was over the top letterbox bar. The RGB values in the image reflect the Y values in the Y portion of the image, the U values in the U portion of the image, and the V values in the V portion of the image. So the Y value of the top letterbox bar is 35.
Last edited by jagabo; 5th May 2021 at 09:38.
Yes, this is craziness. I even found an entire web page, that is devoted to discussing this confusion:
Then, there is the question of which standard a particular capture diver uses. PC.601 is the standard for old SD analog video, and PC.709 is the standard for HD. Does that mean that an analog SD capture device is using PC.601? Not necessarily! Which, gets into a lot of second guessing that could make one's brain explode.
So, from what I see, it is best to ignore how YCbCr is being handled. The ultimate objective is to obtain the best RGB output. This gets back to doing test captures of the most problematic scenes, examining individual frames, and adjusting settings to yield the most acceptable RGB histograms:
[Attachment 58734 - Click to enlarge]
Note that in the top image, the "black" of the letterbox area is still around RGB 8. However, the heel of the histogram is at 0. Nothing is being crushed, other than a bit of noise and a few sharpening artifacts. The blacks of the second image still appear a little muddy---even though the histogram shows some details being crushed. Old analog video was never very good at handling darker areas.
@jagabo: Nice! Thank you for these tricks. I must bookmark this.
I fear that I am a bit lost, as to how to use scripts. I have seen scripts mentioned many times. But, I have never seen where they come into play.
AviSynth, call it YUV. That's what you're dealing with here. limited range rec.601 standard definition video.
full range RGB to limited range YCbCr: Y = (0.257 * R) + (0.504 * G) + (0.098 * B) + 16 Cr = V = (0.439 * R) - (0.368 * G) - (0.071 * B) + 128 Cb = U = -(0.148 * R) - (0.291 * G) + (0.439 * B) + 128 limited range YCbCr to full range RGB: B = 1.164(Y - 16) + 2.018(U - 128) G = 1.164(Y - 16) - 0.813(V - 128) - 0.391(U - 128) R = 1.164(Y - 16) + 1.596(V - 128)
Last edited by jagabo; 5th May 2021 at 20:32.
Yes, I understand the formulas mentioned. My question involves how to apply scripts in software, like VDub. I have worked with programs capable of running scripts. However, I have yet to find this feature in either VDub or GraphStudio.
Though I have an extensive background in both analog video production and TV/VCR repair, digital video capture is new to me. That said, I do have an extensive background in scanning and editing still images from film. It just took me a minute to comprehend all of the arcane and esoteric concepts being thrown around in digital video capture. For one, I had to realize that the YUV colorspace was not the same as the YIQ colorspace, with which I was familiar. YUV is the newer analog "component" output standard, used by digital devices like DVD players. YIQ is the older standard, still used in NTSC composite and S-video. Though 'Y' is the same in both standards, the I and Q color axes are not the same as the U and V axes. Everyone thoroughly confused now?
Which, brings me to the confusion over 'Y' value numbers being thrown around. Previously, I had only seen the 'Y' component in analog form, on a waveform scope. I had to mentally convert the numbers into a visual image, to comprehend what was being described. "Black" is set to Y=16, so that the horizontal and vertical blanking could be set at Y=0 (below black). This was done to keep the electron gun retrace lines from becoming visible on the old CRT's. Y=235 is equivalent to the "yellow" on a VU meter in audio recording, and Y=255 is the red (though in setting video 'Y' levels, avoiding the "yellow" can be more critical, due to possible later effects of adding chroma).
Finally, there is the question of the capture device's purpose in the workflow. Because the capture device is part of a video production, one tends to view it as a piece of studio equipment. In fact, the capture device is actually a television receiver! It converts an analog video signal into its RGB components, just as a TV would. So, I have to approach setting levels, as I would with a customer's set on the test bench. As a final step with any customer repair, I would calibrate the picture tube. I would connect the set to a colorbar generator, set on grayscale. I would then adjust the "screen" (brightness) to get a good black, and the "gain" (contrast) to get a good corresponding white. This had to be done visually.
Luckily, with a digital RGB output, I now have an RGB histogram to work with. This merely involves exporting a video frame to any image editor. Here is where my experience with image editing comes into play. In image editing, a good "black" is defined as anything between 2 and 10, and a good "white" between 245 and 253---not 0/255! In fact, most pro-level film scanners will set black/white at 5/250. Many print houses require ranges no greater than 2/253 This is to avoid clipping the heel and toe of the histogram, where a few trailing values could reach 0 and/or 255. This may seem trivial. But, hard-smashing blacks/whites against the 0/255 limits produces a harshness clearly visible to the naked eye. Leaving the heel and toe of the histogram produces an image that seems much-more natural (note histograms in #36 above). I don't see why the same concepts shouldn't be applied to video.
By the way, if anyone has an old, working analog colorbar generator (NTSC capable) that they wish to sell for cheap, I would be interested. Preferably, one with S-video out, and the ability to display a step grayscale.
AviSynth scripts direclty with VirtualDub as if they are video files, File -> Open Video File... VirutualDub2 has a built in AviSynth script editor. AVSPmod is a third part AviSynth script editor that provides a lot of hand holding. You need to install AviSynth and probably a lot of third party filters. I recommend AviSynth+ and VirtualDub2.
One thing to beware of with VirtualDub (all versoin) is that all filtering used to work only in RGB. More recent versions allow filters to work in YUV but many filters have not been updated. So you may end up with a rec.601 conversion (crushing superblacks and superwhites) before many filters.
Thanks for that. I'll have to look into it. Eventually, I want to start editing, and putting together presentations from my master copies. Scripts may help with more complex tweaks.
In my version VDub, YUV adjustments can be applied to the capture preview. But, all filters are disabled, once capture is started. I have been using GraphStudio to set my levels.
Here's a frame from a commercial DVD:
[Attachment 58756 - Click to enlarge]
The letterbox bars are at Y=16. The black level of the active picture is around Y=18 in this frame, the white level around Y=235. Obviously, not every shot will have full black and full white. But this is typical of the extremes.
Last edited by jagabo; 7th May 2021 at 08:16.
That looks pretty good. Here are the resulting RGB histograms of the active image:
[Attachment 58757 - Click to enlarge]
Though the blacks and whites aren't being truly crushed, they are rather crowded. Mostly, it is the reds in the shadows, and the greens and blues in the sky. For making master copies, I would try backing-off the proc-amp contrast by one notch. However, proc-amp settings are rather course. So, if the new setting leaves too much space at the ends of the histogram, I would have to live with the current setting.
For me, the idea of a master copy is to capture as much info from the tape as possible. I can always make minor tweaks to the blacks and whites in post, when I make scene-by-scene edited copies. Of course, if I leave too much space at the ends of the histogram, the resulting edited copies could look posterized. It's a compromise, no matter what.
Which again brings up the question of the difference between DVD's and camcorder tapes. Do camcorder tapes have the same range of 'Y' as a commercial DVD? If the camcorder Y-range is slightly less, than the setting that you currently have, might be perfect. My reason for trying to set range with a DVD, is to avoid unnecessary wear on my old tapes.
i just realized another reason for calibrating levels by RGB output---the issue of "tolerances". Consumer analog components typically come with a 10% tolerance. A 10% tolerance could mean an error of as much +/- 25 RGB steps! Professional gear and test equipment may go with the pricier 5%. Still, even that could mean an error of +/- 12 steps. Just because the input is by-the-book, doesn't guarantee that the output will be right.