Clipping of bright levels...

Shergar wrote on 8/9/2007, 9:16 AM
Am I right in thinking that up to 10% of the highlights information in my lovely M2T files gets discarded by Vegas?

I just finished reading "The DV Rebel's Guide" by Stu Maschwitz. (highly recommended - lots of great stuff about digital effects and color correction) - and learned that the Y (luminance) value in DV, HDV and DVCPRO file formats goes up to 110%, even though edit programmes usually only work up to 100%. Stu explains how to retrieve extra highlight information in bright footage - but only using FCP or Premiere.

I tried Stu's approach to my footage in Premiere (grimacing at the user interface, of course). Lo and behold.... shots that I thought were over-exposed and clipped forever turn out to have extra information when darkened working at 32 bit.

But surely there's a way to access this top ten percent in Vegas too?


Comments

farss wrote on 8/9/2007, 2:17 PM
Vegas does nothing to the top 10% or the bottom 10% either.
GlennChan wrote on 8/9/2007, 2:41 PM
You can do this in Vegas.

Vegas decodes DV to the 16-235 RGB range ("studio RGB" in Vegas terminology). Anything above 235 are(is?) the superwhites in question.

One way to map them into legal range is to use these color curves:
http://glennchan.info/Proofs/forums/sony%20back/curves-and-secondary-presets2.veg

Another method is via levels... see tutorial here:
http://www.vasst.com/resource.aspx?id=a7a8c403-64dc-420d-97d0-90d2f8de9fc1
(registration required I believe.)
Shergar wrote on 8/10/2007, 1:12 AM
Thanks for your input, guys...

Glenn's curves approach works fine for info in the 235-255 range, but I am talking about highlight info which normally falls *outside* the RGB range completely.

In the YCrCb format stored in M2T files, the max Y value can be well over 100%. These extra bright values are normally clipped when mapped to RGB in Vegas (and other NLE's apparently).

It is possible to recover these highlights in both Premiere and FCP to provide higher quality images for color correction. Example...

Raw footage in vegas
http://www.flickr.com/photos/11200479@N05/1069090628/
(The background through the window is over-exposed)

Attempt to recover super whites information using Sony Color Curves as Glenn suggests...
http://www.flickr.com/photos/11200479@N05/1068226725/
(Note the brights are still clipped on the RGB scope)

Extra brightness recovered using Proc Amp in Premiere (at Max Bit Depth)
http://www.flickr.com/photos/11200479@N05/1069088476/
(as if by magic, extra brighness info appears as contrast is lowered in Proc Amp)

I have found that by using the Broadcast Colors filter it seems that I can get some of the extra highlights into RGB...
http://www.flickr.com/photos/11200479@N05/1068549919/

but I believe this is not a linear transformation - it looks like data in the range over 255 is just being translated into range and added into the existing 0-255 RGB data. But this at least indicates that Vegas has access to the extra data internally.

Serena wrote on 8/10/2007, 1:38 AM
No, have a look at the way levels and curves work. First look at what you see on the scope -- data going up to 110%. To get this back within 100 you can clip it off (hardly desirable) or you compress the range so 110 fits into 100. You can do this with levels or curves (the latter for non-linear). There are several controls. If you put that article to the back of your mind and actually explore the controls available to you, you'll see that you've been misled.
Shergar wrote on 8/10/2007, 2:01 AM
Thanks Serena... but now I'm confused by what you mean.

If you look in my example screenshots the scopes clearly show that RGB is clipped in Vegas, with or without curves. I've tried levels too - still clipped. Note I am talking about info which would map from YCrCb ABOVE 255 in RGB space.
farss wrote on 8/10/2007, 2:37 AM
I'm confused by your confusion, there's nothing over 255.

Just because scopes read over 100 doesn't mean it's clipped.
If you've set your scopes to Studio RGB then 100 = 235, still quite a bit of wiggle room left before clipping.

Bob.
Shergar wrote on 8/10/2007, 2:52 AM
Bob,
obviously you are right that there is nothing over 255 in RGB color space. But in YCrCb format there is extra brightness bandwidth which gets clipped converting to RGB.

Looking at the RGB parade in Vegas on my (over exposed) footage, it is easy to see that it's clipped. It stays clipped if I set the scopes to Studio RGB. It's clipped if I load it into Premiere too. But when I reduce contrast in Premiere at max bit depth, I can see from the RGB scope that the clipped info comes into range.

Would it help if I put up example footage to prove this, and show that Premiere can access this info whereas it seems Vegas can't? Trouble is the files would be large, obviously.
farss wrote on 8/10/2007, 4:34 AM
Just one frame would do.
Shergar wrote on 8/10/2007, 8:26 AM
Unfortunately I don't know to access one single frame of the original M2T data, without rendering (and thus losing the brightness data I'm talking about). Any save from Vegas misses the point, since Vegas converts to RGB for its internal handling.... is there some easy trick for this?

Anyway here's a small chunk of the footage extracted via womble so it should be the original M2T video stream....

http://storitel.com/files/clipping.m2t
(sorry it's 8MB - nothing I tried seems to reduce the minimum size)

and here's the first few frames of the same footage after darkening in Premiere.

http://storitel.com/files/afterpremiere.avi

I'm not saying the darker version is better ... but if you look in Vegas using the RGB scopes and compare, there's clearly highlight information retrieved in the Premiere version that can't be got at via curves or levels in Vegas.


GlennChan wrote on 8/10/2007, 1:11 PM
Ok there are three different color spaces here...

Y'CbCr - (assume 8-bit format) legal range for Y' is from 16-235 (Y'). stuff above 235 are superwhites.

computer RGB / "normal" RGB - legal range is from 0-255 (RGB). If you assume this then you lose your superwhites... but Vegas (if you use the default DV and HDV codecs) does not do this. It does...

studio RGB - legal range is from 16-235 (RGB). This will retain superwhites when you convert from Y'CbCr to studio RGB. However, the Y'CbCr color space does allow for colors outside studio RGB space/gamut... these colors aren't any brighter, but they are more saturated. Some of them are simply wildly illegal/erroneous... e.g. they have negative values that would correspond to negative light (and negative light... just doesn't exist). Your camera may or may not generate them.

Practically, there isn't a big difference between what you can do in Vegas comapred to FCP/Premiere here, unless there is a reason you want to access some erroneous Y'CbCr colors.

2- The broadcast safe filter won't help... it only makes it look like you have extra detail.

rs170a wrote on 8/10/2007, 1:20 PM
Try the AutoLevels filter from Mike Crash's site.
I played around with it a bit (in combination with a bit of colour correction) and I liked the results a lot more than what you got out of Premiere.

The bottom line is that what's blown out is gone and, IMO, all the filters in the world won't bring it back. After all, this is video, not film. Next time, invest in a few sheets of ND gel for the windows. It works like a charm.

Mike
farss wrote on 8/10/2007, 3:59 PM
Don't know what all the fuss is about.
I've had no difficulty matching the exPPro avi using Vegas and Color Curves by using a linear transfer. Drag the end point (top right hand end of the curve) down to taste.

There's a bit of a bug in this FX, you need to add a point somewhere on the curve before you can move the end points. Once you've moved the end point R-Click the node and delete it if it's getting in the way.

However to me the PPro output is wrong!
You've now got your whites sitting at around 85% and they're obviosly way overexposed daylight. They should be at 100%, you're ditching dynamic range to make a visually distracting brownish blob more visible, why?
With that shot my approach would be to try the opposite, really clip the top end to get the outside entirely white, less visually distracting than having off color blobs outside the window that distract from the 'story' inside the car.

Bottom line as others have said is the shot got fritzed before the light hit the lens, not even film has enough latitude to save the day, even eyeballs can't really cope. The answer is to reduce the contrast, gell the windows or light the interior or shoot at dusk. Or shoot it in a studio with rear projected scenery outside the car.

And I say again, unlike some systems Vegas does nothing to your footage. With DV you can capture, print to tape and capture that and PTT until you wear out the heads on your VCR and you still have the exact same image as you started with. If you force Vegas to render the footage by say changing a few pixels even after 100 generation it takes forensic inspection to pick the difference. HDV is somewhat different, because Vegas doesn't do "smart" rendering HDV will always be re-encoded and that is lossy but as far as levels go I've not seen any dramatic errors, certainly with a shot like the one in question there's more pressing issues than encoders to worry about.

Bob.
Shergar wrote on 8/11/2007, 1:23 AM
I agree totally with Bob that this shot has more important problems than the burned out whites, and that the PPro output is wrong at this point. I chose the footage only to demonstrate the clipping, not as a color correction example.

I also agree with Glenn that there's no practical difference between Vegas and FCP/Premiere for most footage. I'm only talking about footage containing possibly useful info as YCbCr colors outside the RGB color space. In my project at least this is less than 10% of the total shoot.

And I agree with Mike that external ND filters are the best way to bring the brights down when shooting. And Bob's suggestion to gel the windows... pity we didn't think of that on the day.

However in this clip PPro is clearly able to recover *some* of the blown-out info ... the "brownish blob" as Bob describes it.

I did the darkening to show the retrieval of super-white detail, not as an attempt at color correction. The point of going this way, according to Stu Maschwitz (and he should know - he designed Magic Bullet), is to maximize the amount of legal image data in the RGB space *before* doing color correction in After Effects. I know it seems like nit-picking.

The fuss is because this project is a 90-min feature, and I'm trying to find the highest-quality workflow to go from HDV to 35mm at lowest cost (let's not get started on why HDV...)

Thanks to all of you for your input on this. If/when Sony gives a response to the original question I'll post it here.

Paul
farss wrote on 8/11/2007, 4:22 AM
However in this clip PPro is clearly able to recover *some* of the blown-out info ... the "brownish blob" as Bob describes it.

Yes, but I also pointed out that I can recover exactly the same thing in Vegas! Maybe I'm blind but I could see no difference between what I could get out of Vegas and what you had from PPro.

There's possibly a slight advantage to grading through AE over Vegas, AE has a linear light pipeline which can avoid some potential nasties. Just how bigger an advantage that is for HDV I don't know, I've only been trying with 10bit log source. One thing though, not clipping seems even more critical with that kind of image, so don't be too down on the HDV thing.

Bob.
GlennChan wrote on 8/11/2007, 10:25 AM
The linear blending in AE gives you different results, but it doesn't really help avoid potential nasties. 32-bit float processing in AE can help you avoid banding artifacts... but banding likely won't be visible (it won't be a problem) if you have noise in your image.


I did the darkening to show the retrieval of super-white detail, not as an attempt at color correction. The point of going this way, according to Stu Maschwitz (and he should know - he designed Magic Bullet), is to maximize the amount of legal image data in the RGB space *before* doing color correction in After Effects. I know it seems like nit-picking.
You can do this in Vegas. The curves I linked to show this.

You have to pay attention to the different conversions going on. Vegas will decode from DV (Y'CbCr space) to studio RGB. You have access to the superwhites there. You can map them into legal range, and then output a DV file (or something better). If you output a DV file, then the studio RGB range will get mapped to Y'CbCr range.

When you open the resulting DV file in AE, the Y'CbCr values will map to computer RGB values. And you don't lose any superwhite information in the process, because there are no superwhites in that DV file / in the Y'CbCr values.
Shergar wrote on 8/13/2007, 1:35 AM
Glenn... please suspend disbelief for a moment.....

Using the first frame of the clip I posted - here is a close up of the highlights part of the RGB scopes from Vegas AFTER applying your Map Superwhites curve...

http://www.flickr.com/photos/11200479@N05/1102284400/

Underneath you see the PRPO RGB of the same frame after using Proc Amp

Vegas shows a flat line at 235 - the info which got clipped at 255 originally is scaled down to 235. There is no info between 235 and 255.

PPRO shows plenty of detail above the clipping line. As far as I can see there is no way to retrieve this detail in Vegas.

Here's the full scopes...just to show I'm not cheating
http://www.flickr.com/photos/11200479@N05/1102257142/

The point is that it seems that Vegas can only map a portion of the superwhites into RGB. There is superwhite info in the M2T file that Vegas doesn't handle.
farss wrote on 8/13/2007, 2:52 AM
Now that is INTERESTING!

I wonder what would happen if the m2t file was converted to Cineform first?
Shergar wrote on 8/13/2007, 3:08 AM
Converting to cineform (using Connect HD) makes no difference - clipping is exactly the same in Vegas.
farss wrote on 8/13/2007, 3:12 AM
And the answer is,
the result is different, noticeably less clipping. Even the CF DI has extracted more from the highlights, not as dramatic as the PPro procamp could manage but still.....

Still, one thing that's been drummed into me, even working with much more capable cameras than the Z1 is DO NOT CLIP. And I've seen what can happen, rather unappealing color shifts, like my clipped whites turning bright red when CC is applied.

Bob.
farss wrote on 8/13/2007, 3:15 AM
Sorry but you're wrong, try do an exact A/B. There's not a huge amount in it but the RGB parade shows a difference in the highlight detail between the CF DI and the m2t file.

I cannot recover any more using curves but the uncorrected CF DI does show more detail.

Bob.
Shergar wrote on 8/13/2007, 4:00 AM
Of course you're right again about clipping - the best approach is never to clip.

And you're right that the cineform is different... there seems to be a little more detail in the red channel particularly.

But this is nothing like the result in PPro ... if i apply Glenn's Map Superwhites to the cineform, there's still nothing between 235 and 255. Cineform is tweaking some values, but not remapping overall (nor should it - this would involve scaling all of the legal values)



farss wrote on 8/13/2007, 6:23 AM
Well no, actually I thought about the clipping thing some more after I posted that and with typical video there's times when you might well be forced to clip. You've only got so much dynamic range and letting some highlights blow out might be preferable to loosing detail elsewhere. In the case of your shot in the car if you'd wound the exposure down enough to avoid clipping the exterior then the interior of the car would be deep into black. Of course this is an extreme example and there's an obvious fix but there's plenty of other scenarios that aren't so extreme and there's no answer or the answer will be just too expensive and yield little to zero improvement in the results.

As for what PPro is doing, like I said it's interesting but I'm getting a bit out of my depth on this. I have to wonder visually what it gains you, I mean given the limitations of an 8 bit pipeline I suspect you might risk doing more harm than good overall. Doing it inside a fatter pipeline might make some sense but as Glenn mentioned there's also the risk of banding. I did see some fancy filter that runs in AE to smooth banding though.

Bob.

GlennChan wrote on 8/13/2007, 11:06 AM
Vegas shows a flat line at 235 - the info which got clipped at 255 originally is scaled down to 235. There is no info between 235 and 255.
Yes that's what you want. The curves map the superwhites (that Vegas has access to) to within the legal range.

There are some extreme illegal colors that Vegas can't get at... which it looks like Premiere Pro can.

EDIT: I'm not really sure if cameras generate extremely illegal colors that Vegas can't get at.

In Premiere, in the proc amp, you need to make sure that you set the saturation % as the same number as contrast %, otherwise the colors will be off and it'll look like there is extra detail (when there really isn't). If you don't do this, then something like 50% contrast and 100% saturation will look wrong. (What's really happening is that contrast controls luma/Y' gain, and saturation really controls chroma gain. They both need to come down together.)
farss wrote on 8/13/2007, 2:55 PM
Glenn,
did you look at the screenshots of the scopes that Shergar took?

It certainly looks like he's recovering way more detail.
At the same time looking at the resultant image to my uncalibrated eyes it also looks there's something wierd in the color of what's being recovered.
I think this deserves serious investigation, either:

a) Vegas is badly crippled.
b) The Magic Bullet guys are telling big fibs and spreading FUD.
c) Shergar has misread what they're saying and could end up making bad decisions.

I'm kind of leaning to c) but b) wouldn't be anything new in this business.

Bob.