Log in

View Full Version : Luma levels and encoding


Blue_MiSfit
14th June 2008, 02:27
Hey folks,

So, I've got a lot of stuff to encode, and some of it is _really_ dark. When I view it with Haali renderer set to TV levels, it looks crushed out. When I set it to PC levels, things look better, but it sometimes looks washed out.

How can I really analyze the source, and figure out what luma levels are being used?

My sources are 8mbps NTSC MPEG-2, hard telecined at 60i. Overall reasonable quality. The TV show is West Wing, which is kind of dark to begin with (plus its soft focus effects are confusing)

I would post a sample, but license agreements prohibit it. It's for work :)

I have to output something that will be correct when played at TV levels, since that's what my hardware player does.

Help me make the right decision before I invest (literally) days setting up 96 episodes to encode :D

~MiSfit

J_Darnley
14th June 2008, 12:08
Histogram (http://avisynth.org/mediawiki/Histogram) and maybe Limiter (http://avisynth.org/mediawiki/Limiter). If there are large areas that are PC range then it is likely that it is PC range. A few odd areas, especially at sharp edges can often overshoot (on lossy video) and result in PC range values.

Blue_MiSfit
16th June 2008, 20:16
Damn.

It looks like my content was brutally clipped from PC to TV. The actual encoded levels are TV, but its far too dark, and the histogram shows a brick wall at 16. Bummer. This probably explains why things look over-bright when resampled to TV levels, even though the shadow detail comes out. Any fix possible?

~Misfit

Blue_MiSfit
17th June 2008, 21:01
Any brilliant ideas guys? :) I gotta get this crap started.

I think I'm just going to bring the brightness up and encode it like that :(

~MiSfit

mikeytown2
17th June 2008, 22:48
Any brilliant ideas guys? :) I gotta get this crap started.

I think I'm just going to bring the brightness up and encode it like that :(

~MiSfit

I'm assuming you gave all of these filters a shot
http://avisynth.org/mediawiki/External_filters#Levels_and_Chroma
HDRAGC? Set corrector if using it. The documentation on corrector is a little misleading
Example

ColorBars(320,240).ConvertToYV12()
a = HDRAGC(corrector=0.0).Subtitle("0.0 Default: corrector=0.0")
b = HDRAGC(corrector=1.4).Subtitle("1.4 Almost same as corrector=0.0")
c = HDRAGC(corrector=0.7).Subtitle("0.7 Darker then corrector=0.0")
d = HDRAGC(corrector=2.8).Subtitle("2.8 Lighter then corrector=0.0")
StackHorizontal(a,b,c,d)


It is hard to give advice when there are no samples.

GodofaGap
17th June 2008, 23:05
If the video is really clipped from PC to TV range that's unfortunate since there is not really anything you can do about that. You can't increase contrast in areas where there is none.

Blue_MiSfit
17th June 2008, 23:26
It is hard to give advice when there are no samples.


:( I know... my work is pretty sensitive about this sort of thing...

I had thought of HDRAGC but hadn't really tried it, I will definitely do so!

Thanks guys,

~MiSfit

mikeytown2
18th June 2008, 00:01
Found this interesting discussion in the HDRAGC thread (http://forum.doom9.org/showthread.php?p=923602#post923602). Trying to give you more toys to play with. There is a monster script 4 posts down (#172)

Edit: Colormill in avisynth (http://forum.doom9.org/showthread.php?t=119644)
colormill 2.1.1 (http://forum.videohelp.com/images/guides/p1609789/colormill2.1.1.zip)

Blue_MiSfit
18th June 2008, 02:41
Holy crapoley!

I'm _really_ impressed with hdragc. With some gentle fiddling, I'm able to radically improve the footage.

Here's a couple screenies:
http://img524.imageshack.us/img524/5123/01sourcemd4.th.jpg (http://img524.imageshack.us/my.php?image=01sourcemd4.jpg) Source
http://img524.imageshack.us/img524/5291/02pctvrw0.th.jpg (http://img524.imageshack.us/my.php?image=02pctvrw0.jpg) PC -> TV levels
http://img248.imageshack.us/img248/7522/03hdragcoz5.th.jpg (http://img248.imageshack.us/my.php?image=03hdragcoz5.jpg) Colormatrix+ HDRAGC

Sample 2
http://img181.imageshack.us/img181/345/04sourceia0.th.jpg (http://img181.imageshack.us/my.php?image=04sourceia0.jpg) Source
http://img181.imageshack.us/img181/2221/05pctvfj6.th.jpg (http://img181.imageshack.us/my.php?image=05pctvfj6.jpg) PC -> TV levels
http://img401.imageshack.us/img401/9820/06hdragcwc1.th.jpg (http://img401.imageshack.us/my.php?image=06hdragcwc1.jpg) Colormatrix + HDRAGC

:D :D :D
~MiSfit

Zhelkus
9th July 2008, 23:02
The results are in fact amazing. A small con I noticed is that smaller details that rely on dark colours such as lines on the forehead are gently blurred... but it's extremely subtle, so subtle it's irrelevant. Just pointing it out there.

mikeytown2
9th July 2008, 23:19
in HDRAGC Set reducer=0, it will turn off noise removal from gained shadows