Encoding and Luminance Levels

Streamworks Audio wrote on 12/14/2009, 11:28 PM
Here are some more questions about Luminance levels when encoding. I have been looking at some Blu Ray source video as well as a lot of DVDs when I load them in Avisynth - and all the luminance levels for the sources are at 0-255 not 16-235... what I am wondering, just for the sake of knowing, are these videos encoded at such levels then the player adjusts the luminance upon black back (i,e moving them into legal 16-235 range)?

I am moving some of my DVDs to my Apple TV - and I found a lot of the encodes I did were very dark... upon further inspection of my workflow I found that DGDecode and FFDshow (or even the Windows 7 built AVC decoder) would output 0-255... which is not a problem for computer playback... but the problem is that the Apple TV is applying it's own corrections to the video - so if 0 was already black - the Apple TV would play that at -16. I confirm this by encoding a SMPTE Colorbar test (generated by Avisynth). I should add in that if the Apple TV is set to RGB High then the values seem to be 'shifted' as opposed to RGB Low which seems to clips the black levels.

So to adjust I have had to correct the luminance before encoding... but the histogram shows colorbanding (although hard to see by eye) when doing so.... which leads me to think that the source files are in fact encoded at 0-255

I would like to know more about this... as I have for the most part with home movies and such set the levels in Vegas at 16-235 before encoding... if players are adjusting the level while playing back... then that would make my source too bright.

Curious...

Cheers!
Chris

Comments

GlennChan wrote on 12/15/2009, 9:12 PM
1- check that the playback software is correct.

Um... not all test patterns are generated correctly (e.g. don't trust bars from Vegas because there is also a wrong way to do it in Vegas). An easy way to check would be to use any criterion collection DVD (they have color bars), or avia test DVD, or else a commercially produced DVD.

I've never used apple TV so I can't comment on it... but if you can find some known-good material and that plays back fine on your playback software, then it's not the problem.

2- see the example workflows here:
http://www.glennchan.info/articles/vegas/v8color/vegas-9-levels.htm
Streamworks Audio wrote on 12/16/2009, 9:30 AM
Thanks again Glen,

But after some more investigation I have learned more about what was really going on...

The DVDs are in fact (as should be) encoded at 16-235 levels.... using DGDecode (MPEG2Source) in an AVISynth script followed by a ColorYUV analyze (which checks various Luma and Chroma levels) I found that in fact the decoder was outputting the correct levels... the problem was with the Renderer that AviSynth connected to was outputting the levels at 0-255. But of course that means for transcoding (where the renderer is not being used) the levels are fine and needed no further adjusting.

So confusing the way the renderer does that.... on screen it's 0-255 when its actually 16-235. I did a few encode tests to AVC and played them with Windows Media Player in Windows 7, which uses it's own decoder and is DXVA compatible - by changing the output levels in the NVidia control panel I can see that the encodes are in the correct legal range.

The color bar test in AviSynth I think is very accurate - again using various analyzers with it shows the correct levels. The Apple TV's renderer is outputting 0-255, which is what my TV is expecting.

Cheers!
Chris