View Full Version : H.264 Brightness / Contrast issue...


Curtis Bouvier
August 8th, 2006, 01:42 AM
Using Adobe Premier Pro 2.0, having a slight problem with H.264 codec..

It doesn't matter what I save, whether it's a picture or a video, the compression seems to remove alot of brightness and contrast from my work, and there doesn't seem to be a way of correcting this issue, since there is no configuration menue.. other than a quality slider that goes from 0% -100% (doesn't make a difference what percent I use)

If I save at BMP, or PNG, or JPEG or etc, they dont lose any contrast / brightness, but the file is 10X larger.

Any one have any idea's as to what the problem is with H264?

Here is a screenshot showing exactly what I mean:

http://img95.imageshack.us/img95/2057/h264wrongcg5.jpg

Zack Vohaska
August 8th, 2006, 09:04 AM
I was going to ask this question eventually myself -- I'm having the same problems you are with the H.264 codec.

I tried exporting directly to the H.264 codec -- washed-out image (brightness/contrast issue). I exported to an uncompressed AVI file, then tried converting it directly from QT7 to an H.264 file to see if it'd make a difference, but no - still washed out.

Anyone have an idea?

Christopher Lefchik
August 8th, 2006, 11:13 AM
I've noticed the same phenomenon. There is a definite boost in image brightness. Interestingly, playing the same H.264 file in VLC media player yields a picture darker, much richer picture. By default VLC media player uses hardware acceleration (the computer's graphics card) to render the video image. If I deselect that option, the picture in VLC media player looks just like the one in the QuickTime Player.

As if that wasn't confusing enough, playing a DV AVI file in both QuickTime and VLC media player yields an identical image, even though VLC media player is using hardware acceleration.

Zack Vohaska
August 8th, 2006, 11:22 AM
Chris,

I just played one of my H.264-encoded .mov files through VLC player and you're right -- the image plays as how it was rendered uncompressed from my NLE.

Now I'm more confused than ever as to what's causing the brightness boost when viewing the file through the QT7 player. The HD trailers on the Apple site look great! Obviously they're probably using much more advanced H.264 encoding software, but still, one shoot be able to tweak such a simple change. :-/

Greg Boston
August 8th, 2006, 11:28 AM
Chris,

I just played one of my H.264-encoded .mov files through VLC player and you're right -- the image plays as how it was rendered uncompressed from my NLE.

Now I'm more confused than ever as to what's causing the brightness boost when viewing the file through the QT7 player. The HD trailers on the Apple site look great! Obviously they're probably using much more advanced H.264 encoding software, but still, one shoot be able to tweak such a simple change. :-/

It may have to do with gamma. One of the nice things about MPEG4 is that it allows the gamma correction to be imbedded into the file so it should play fine on PC or Mac. I know you guys aren't talking about cross platform here, but I still think gamma can be involved somehow. I just haven't figured out how.

-gb-

Christopher Lefchik
August 8th, 2006, 11:32 AM
EDIT: Scratch the last line in my previous post. I didn't notice that I had a VLC settings dialog open and hadn't saved the settings back to using hardware acceleration. Once that was done, the DV AVI did play darker in VLC media player, compared to the QuickTime Player.

I tried playing an Apple HD H.264 trailer in both QuickTime Player and VLC media player. Just like with my own H.264 video, the picture was darker in VLC media player.

So, with hardware acceleration enabled VLC media player renders a darker image than QuickTime on both H.264 video and DV AVI files. With it disabled the video is rendered lighter, like QuickTime Player renders those files.

Glenn Chan
August 8th, 2006, 02:31 PM
I believe Quicktime can do things to account for Mac VS PC gamma.

2- There is also a gamma difference between:
Rec. 601 video (SD)
sRGB, for computer monitors and digital still cameras.

Quicktime does do things to account for this... i.e. when importing and exporting stills into FCP, FCP will change the gamma of the image.

Greg Boston
August 8th, 2006, 02:49 PM
I believe Quicktime can do things to account for Mac VS PC gamma.

2- There is also a gamma difference between:
Rec. 601 video (SD)
sRGB, for computer monitors and digital still cameras.

Quicktime does do things to account for this... i.e. when importing and exporting stills into FCP, FCP will change the gamma of the image.

I know that MPEG4 can do this. It is referenced in one of my FCP manuals concerning output. Just not sure that all H.264 encoders can do this.

MAC gamma runs 1.0 while PC Gamma runs 2.2 (which is the same as many television CRTs).

-gb-

Eric Gorski
August 8th, 2006, 04:44 PM
i have noticed the same thing. it sux.

Glenn Chan
August 8th, 2006, 05:48 PM
On Macs, the gamma is 1.8.

The gamma of a television: There are many figures for this. The NTSC standard was developed with the assumption that CRTs followed a gamma of 2.2.

If you fit measured data to the following formula:

Output = (input + black level error) ^ something

Gamma would be about 2.4. (According to Charles Poynton; his gamma FAQ is outdated in this regard.) Even that is an oversimplification however.

Another answer, with first-hand measurements:
http://www.nightscapes.net/techniques/TechnicalPapers/BehindGammasDisguise.pdf

Christopher Lefchik
August 9th, 2006, 02:10 PM
I’ve done some more research on this problem. Apparently, the issue is caused by hardware acceleration, in particular Core Video on the Mac and DirectX DirectDraw on the PC. Somehow this must be tied in with QuickTime’s rendering of H.264 embedded ICC profiles.

I confirmed the problem is related to hardware acceleration by opening in QuickTime Player 7.2 an H.264 video I encoded, and playing it with and without DirectX acceleration. See attached screen shots at the end of this post.

Visit these links for more information:

Quicktime Player h.264 Bug (http://sprynthesis.com/blog/?page_id=51)
Update and comments (http://sprynthesis.com/blog/?p=50)
RE: Core Video/ H.264 Color issues (http://lists.apple.com/archives/quicktime-users/2006/Apr/msg00020.html)

To quote a Robert Spryn from the second link:

“I spoke to one quicktime engineer. All I got out of it is that this is a problem they are aware of and working on, and that detailed information on the problem like I provide is helpful.”

This comment was posted on June 26 of this year.

To sum things up, nothing is inherently wrong with the H.264 format; it is QuickTime Player’s handling of the embedded ICC profiles that is at fault. Thus, I would strongly urge against doing anything like increasing saturation or decreasing the brightness of your project in an attempt to correct for this problem when exporting to H.264. If and when Apple fixes this issue regarding ICC profiles and hardware acceleration in the QuickTime Player, any H.264 videos so corrected could end up being rendered rather, well, interesting.

Regarding the screen shots below, in each of the two the QuickTime window on the left is being rendered with DirectX hardware acceleration, and the window on the right with Windows GDI.

Chris Barcellos
August 9th, 2006, 02:52 PM
Christopher:

Nice job of digging this out !!! I thought there was something we were doing wrong.

Zack Vohaska
August 18th, 2006, 02:09 PM
I’ve done some more research on this problem. Apparently, the issue is caused by hardware acceleration, in particular Core Video on the Mac and DirectX DirectDraw on the PC. Somehow this must be tied in with QuickTime’s rendering of H.264 embedded ICC profiles.

I confirmed the problem is related to hardware acceleration by opening in QuickTime Player 7.2 an H.264 video I encoded, and playing it with and without DirectX acceleration. See attached screen shots at the end of this post.

Visit these links for more information:

Quicktime Player h.264 Bug (http://sprynthesis.com/blog/?page_id=51)
Update and comments (http://sprynthesis.com/blog/?p=50)
RE: Core Video/ H.264 Color issues (http://lists.apple.com/archives/quicktime-users/2006/Apr/msg00020.html)

To quote a Robert Spryn from the second link:

“I spoke to one quicktime engineer. All I got out of it is that this is a problem they are aware of and working on, and that detailed information on the problem like I provide is helpful.”

This comment was posted on June 26 of this year.

To sum things up, nothing is inherently wrong with the H.264 format; it is QuickTime Player’s handling of the embedded ICC profiles that is at fault. Thus, I would strongly urge against doing anything like increasing saturation or decreasing the brightness of your project in an attempt to correct for this problem when exporting to H.264. If and when Apple fixes this issue regarding ICC profiles and hardware acceleration in the QuickTime Player, any H.264 videos so corrected could end up being rendered rather, well, interesting.

Regarding the screen shots below, in each of the two the QuickTime window on the left is being rendered with DirectX hardware acceleration, and the window on the right with Windows GDI.


Yes, thank you! I was thinking about doing something crazy like increasing the saturation, haha. Glad to know that the QuickTime development team is aware of the issue and is working on it. :)

Eric Gorski
August 29th, 2006, 11:32 PM
is there a good alternative to H.264 for encoding highquality/lowsize quicktimes?

Christopher Lefchik
August 30th, 2006, 08:43 AM
As far as I know, the Sorenson Pro codec is the only codec that is equal to or better than H.264.

Emre Safak
September 3rd, 2006, 11:17 AM
My monitors are ICC profiled but my H.264 videos still look off. I find I can restore the contrast by using Quicktime's "A/V controls" but that only fixes it on my system. Strangely, ffdshow renders the video correctly; the problem is with Quicktime. I noticed the same problem with other people's encodes, not just my own with Sony Vegas. It is as if Quicktime is doing a (16,235) Levels conversion.

WMV is a good alternative at low bit rates.

Christopher Lefchik
September 4th, 2006, 12:03 PM
Yes, apparently the problem is with QuickTime's handling of ICC profiles embedded in H.264 encoded files.

Emre Safak
September 5th, 2006, 04:30 PM
Yes, apparently the problem is with QuickTime's handling of ICC profiles embedded in H.264 encoded files.
I can't find any references on the Web to ICC profiles in connection to H.264. Can you provide some? I thought color management was not used in video because it would be prohibitively expensive to perform color space conversions on every frame.

Christopher Lefchik
September 5th, 2006, 08:52 PM
Whoa! I did a search for ICC and H.264 and the top result is this thread! Scary.

Anyway, I did some research (not as deep as the first time, though), and can't find anything about ICC profiles being embedded in H.264 video. With all the research and pages I had open on the subject I must have gotten something mixed up.

However, if the last post on this thread is correct (http://discussions.apple.com/message.jspa?messageID=1049610#1049610), QuickTime does attempt to compensate for monitor color profiles.

Steven White
June 26th, 2008, 09:14 AM
Wow. Last post in this thread is September 2006? So far as I can tell, it's still an issue. I'm having problems with H.264 playback both in Quicktime Player Pro and VLC.

Quicktime playback can be "corrected" by selecting the "straight alpha" mode in the video properties and re-saving, but that only works for me with Quicktime files in the *.mov format.

For *.mp4 files, Quicktime is no help - primarily because it's incompatible with High Profile H.264 encoding. While some Main Profile H.264 encodes do work, in general the performance on my Core2Duo T7400 4GB RAM laptop with nVidia Quadro FX1500 graphics is so poor it's not worth even attempting.

In VLC High Profile H.264 playback is smooth as silk, but the gamma issue pops up. Uploads to both Vimeo and YouTube play with correct gamma, as do a variety of open-source flash players that can be used to embed the original High Profile H.264 *.mp4 files in web pages.

My wife reports that on the current Ubuntu on her laptop (on-motherboard graphics), VLC also has a gamma issue, but MPlayer works okay.

-Steve

Ray Bell
June 26th, 2008, 08:19 PM
I posted this on the EX1 area a couple of days ago... see if this doesn't help you...

If your footage seems to be washed out from an improper gama setting while playback using Quick Time here is a fix I found over at Video Copilot...

Using mp4 or h.264 when compressing through QuickTime can make the final video look washed out. This is a common problem that seemed to have no solution… until now. The gamma shift can actually be fixed inside QuickTime Pro without re-compressing your video by simply changing a few settings.

Scrimski at CGtalk.com posted a good walk-through. Thanks!

SOLUTION: After rendering into a QuickTime/h.264 file, open it up in QuickTime Pro and select “Show Movie Properties.” Highlight the video track then click on the “Visual Settings” tab. Towards the bottom left you should see “Transparency” with a drop-down box next to it. Select “Blend” from the menu then move the “Transparency Level” slider to 100%. Choose “Straight Alpha” from the same drop-down and close the properties window and finally “Save.”

This will fix your video files upon the save step.

Steven White
June 27th, 2008, 03:16 PM
Yeah - I ran into that fix for QuickTime. It won't work for high profile *.mp4 though, because QuickTime can't play them.

Fortunately, Flash Player can, AND gets the gamma right.

-Steve

Christopher Ruffell
July 15th, 2008, 02:07 AM
Wow, 2006....to 2008. Go Apple! *sarcasm*

Yet another reason Apple ought to separate QuickTime into two different products; pro and consumer. And even then, FCP should still export and play H.264 as we intended it to be.

Thanks for the tips Ray.

Eugenia Loli-Queru
October 24th, 2008, 12:08 AM
This problem is still there, and even worse, it doesn't seem be fixable by this little trick anymore (the "straight alpha" thing). I just tried my h.264 MOV file that I had exported with Quicktime Pro, and it wouldn't give me back my gamma, it still looks washed out. I know that this trick worked a few months ago, I had tried it. But with the latest Quicktime, it doesn't give me any love.

Bahadir Colak
October 24th, 2008, 09:09 PM
This still looks like a problem if you use h.264 to upload a file to vimeo...

Does anyone have a solution for it?

BTW: First message but long time lurker ;) Hi to everyone (from Istanbul, Turkey)...

Bahadir Colak
October 26th, 2008, 06:31 AM
This still looks like a problem if you use h.264 to upload a file to vimeo...

Does anyone have a solution for it?

BTW: First message but long time lurker ;) Hi to everyone (from Istanbul, Turkey)...

So there is no solution yet huh...

Chris Hocking
February 9th, 2009, 05:15 AM
Zap! It's now 2009... Any ideas?

Aric Mannion
February 9th, 2009, 09:08 AM
You can check enable final cut studio compatibility in the preferences in QT, which may help on your personal machine. Has anyone tried adjusting the contrast IN quicktime when exporting to compensate?
PCs are supposed to display darker than Macs, is this only a problem for mac users?

Herman Van Deventer
February 12th, 2009, 09:00 AM
Solution -

After struggling for many months to find a cure for H264's "milky desease" using Premiere,
TMPG Express etc. etc. - I ran some HDV footage through MPEG STREAMCLIP - Free.

Video Results / The Calyptonians on Vimeo (http://www.vimeo.com/3185046)

Problemo Solved !

Greetings/

The Third World.