PDA

View Full Version : Preserve RGB levels 1-255 in mpeg/vob??


shorton
26th August 2005, 15:54
Hi guys:

I'm trying to make my own calibration disc set. To do this I need some video that includes levels from 1-15 (below black) and 236-255 (above white). It's a simple taks to get those digital levels in the bmp, but in all of my tools to get to mpv the colors get mangled. I gues it's something to do with RGB to YUV conversions, but that's getting over my head. All I know for sure is it HAS been done (i.e. Digital Video Essentials (I have), DVE Pro (I have) and also on Avia Pro (I'm told)).

As a test I tried ripping out a clip from a popular authoring program using DVD Shrink, demuxing the VOB with regig, then creating a small VOB back with DVD Maestro. A friend with a HTPC setup can capture a resluting playback from and check the levels on the output colors. The result of that process was the colors of the original were changed.

Does anyone know an app (or set of apps) that I can accomplish the bmp-to-DVD chain an preserve the digital RGB 1-255 levels? I have Scenarist, but I shudder to think of learning it just for this project since I'm proficient with Maestro.

I saw the mpucoder's? "muxman" and wondered if it could swing it. I'd be happy to send someone a sample bmp if that's any help.

I'll be making the calibration disc freely available once it's finished. Assuming I can get over this roadblock that is.

Thanks, Scott

mpucoder
26th August 2005, 19:10
If the decoders and encoders are following the correct standards (either ITU-R BT.470 B or G for PAL, or SMPTE 170 M for NTSC) for the matrix coefficients there should be no problems. However you mention below black, and above white. That is not possible to convert to RGB and then back to YUV. The RGB values range from 0 to 255, Y ranges from 16 to 235, and U/V range from -112 to +112. A YUV value of 235, 0, 0 yields an RGB value of 255, 255, 255. If the Y value is out of range, ie less than 16 or greater than 235, the "floor" and "ceiling" functions in the colorspace conversion function will limit the RGB values to 0-255.

In other words, out of range Y values should not be created by any encoder, they have to be made artificially.

shorton
26th August 2005, 20:39
Thanks for the reply

Well, that stinks. I think. So there is no way to get a grayscale image that includes say RGB 12/12/12 (what would be measured on a bmp RGB file) on a DVD? That is get it with avaliable software tools? I don't know how to do it artificially.

Both the pro commercial calibration packages do it, and one consumer level package.

Would it help to provide a snippet of VOB that shows these levels? I can PM you a link to one. To be sure I'm asking for the right thing?

Worst case, I tried assembling the clips (I own) extracted with DVD Shrink. I'm told by one of the HTPC guys that worked and no levels changed for the original material now cut out. But I can't easily build a menu and chapter point behavior with the VOB's. I tried to demuxed one with rejig, then author the dvd with DVD Maestro. The same HTPC guys checked it and said the colors got shifted by that process. Not sure which thing/part did it.

I'd owe somebody a lot of beer or something if they could get me past this roadblock. :D

Worst case, if I can cut out patterns from my own discs and reassemble them without shifting the colors that would be the next best thing to using my own patteerns. If I use my own, I can share, otherwise I can't.

Thanks again very much for the time to help, Scott

P.S. This is for NTSC FWIW

mic
26th August 2005, 22:23
TV standard doesn't use full range of color (ie.255), & most equipment follows along. A capture might not record out of spec levels, &/or the equipment providing the signal you captured, might not send them.

To record say a test DVD using 0 & 255 levels, save your image(s) as 24 bit .png, importing into DVD authoring app as menu pages. (no big deal, took 3 minutes for simple test, as I hadn't verified black level before). As far as the DVD and software player go, you'll get what you put in. Hardware playback may differ, & may have to adjust TV or TV monitor which is set for reduced range. FWIW, I think some DVD players called lower levels superblack.

That all said, you might find that setting a TV so darks look OK using full range, messes up everything else that doesn't. And you might find some distortion using full white.

Luck

mpucoder
26th August 2005, 22:26
You have the full range of values available in bmp's, it's just that 0/0/0 RGB = 16/0/0 YUV

shorton
26th August 2005, 22:43
TV standard doesn't use full range of color (ie.255), & most equipment follows along. A capture might not record out of spec levels, &/or the equipment providing the signal you captured, might not send them.

To record say a test DVD using 0 & 255 levels, save your image(s) as 24 bit .png, importing into DVD authoring app as menu pages. (no big deal, took 3 minutes for simple test, as I hadn't verified black level before). As far as the DVD and software player go, you'll get what you put in. Hardware playback may differ, & may have to adjust TV or TV monitor which is set for reduced range. FWIW, I think some DVD players called lower levels superblack.

That all said, you might find that setting a TV so darks look OK using full range, messes up everything else that doesn't. And you might find some distortion using full white.

Luckmic:

Thanks, the player and display chain haven't been a problem. Some show the BTB material, other's don't. That's one of the uses of the DVD I'm trying to make, to see which do and don't and adjust them accordingly.

The problem has been getting the DVD to contain the test material. I have a range of patterns to use so importing as a menu isn't really a good thing. My app (Maestro) will allow direct imports of the stills but it changes the colors as far as I've been able to tell.

shorton
26th August 2005, 22:52
That all said, you might find that setting a TV so darks look OK using full range, messes up everything else that doesn't. And you might find some distortion using full white.The procedure most calibrators use for calibrationg these displays (that can show BTB and WTW) is this: Adjust just until a black background (digital 16) matches the BTB pattern area (which is as low as a DLP can go). For WTW, it is the concensous of the home theater community that many DVD's include WTW data. It's due to a variety of reasons including issues with legacy CRT devices whit ceilings and floors. But most calibrators will use these comercial WTW patterns I'm trying to replicate and adjust so a DLP for instance can just display data at levels over 235 (video/reference white). This is all about maximizing contrast ratio on home theater (or any) display.

It is these BTB and WTW animated, moving stripes included on these reference calibration discs (i.e. DIgital Video Essentials)I want to duplicate.

See this link: It has one of the patterns I want to replicate:
http://www.videoessentials.com/ve_d_alb_discnotes.php


Thanks again, Scott

mpucoder
26th August 2005, 23:09
As said earlier, these values are outside the ITU range for YUV values, therefore any program that converts to/from RGB will alter the values. It would be best to stay in the YUV colorspace. Most authoring programs can work with mpeg encoded images as well as bmp without changing any color values. If these test patterns are a still cell they can be extracted by PgcDemux as cells to m2v files. Otherwise use an mpeg-aware editor to extract each frame as a seperate m2v. MuxMan and Scenarist can use single frame m2v files as is, just like a bmp.
Or if it is a video sequence you can also demux/edit staying in the mpeg compressed domain, and use these files as source. Scenarist, MuxMan, Maestro, DvdAuthor, DVD Lab, and many others, will not re-encode them.

mic
26th August 2005, 23:50
FWIW & all... I believe mpucoder's correct, that you're running into prob. with software etc. doing what it feels it ought to.

If you got the patterns into an mpg2 file with full range into a DVD authoring program that didn't insist on re-encoding anything, you should be all right. I don't know if DVD Maestro is recompressing your video or not, but if it is, download the DVDLab trial.

If the patterns exist already on DVD, use them as is. If you use Shrink to isolate the videos you want, use 100% qual., then de-mux video from vob. I don't think the mpg2 would be touched. Or rip titles individually & de-mux. Any of these would preserve the patterns so wouldn't encounter any color space conversions.

I still like the idea of using menus, but then I'm lazy. :) Instead of setting menu loop and all that, creating a new menu page and dragging stills or video to background is trivial.

RE: calibrations...

Not contradicting, but just mentioning a potential gotcha...

While you can calibrate a TV or TV monitor to look good with lower black levels, if you later pop in a letterboxed DVD (in my experience anyway), you'll sometimes see a difference between the letterboxing on the DVD & that produced by the TV screen. Just one example I've run into, and tons of other issues involved I know, but... As far as white goes, depends on the TV, placement & size of white object etc., but it is possible on CRT TVs to cause distortion, which if it were a test pattern, might defeat the purpose.

BTW, with a DVD that includes the full PC range, 0 - 255, don't know that you can actually achieve those extreme levels on external hardware, though can definitely exceed the normal TV range. Signal voltages I don't believe will let you in NTSC land.