Saturday, April 17, 2010

H.264 Gamma shift issue

Although H.264 has many advantages and has quickly become an industry standard for mobile devices and video sharing sites it still has one major downside, which is a gamma shift or brightening of the midtones. this may be an acceptable trade off for the excellent compression ratio for many situations but there are obviously cases where colour and luminance are of huge importance and such a shift is not acceptable.

This issue has been brought up a lot throughout forums all over the net for quite a while but Apple have never offered a satisfactory solution or update as far as I'm aware.
An open source codec named x264 (made by the people who brought you the popular open source VLC media player) has been offered as a work around and in looking into it it seems to be an excellent codec that will be constantly evolving and improving according to the needs of the community as is intent with open source). The codec is only needed for encoding not for decompressing therefore others wont need to have x264 to view your work, as long as they have H264 which almost every machine will have by now.

Get x264 codec (recommended)  for mac here  and PC here

Despite this issue right now H.264 may be the best option around (with the possible exception of x264 & Apple ProRes for editing HD) but things are set to change as they always do in any technology, keep an eye on VP8 and HTML5 which promise to give H.264 a run for it's money.

In the meantime here is another workaround written by Andrew Stewart over at the video copilot blog that seems to have garnered a number of positive replies...


Hi all,

I have a quicktime gamma workaround that works for exporting h264s and other codecs that have the gamma shift issue. We use it at work for sending h264’s of telecine color grading reference to some very fussy clients, and so far no complaints :)

The blend/transparency/alpha trick comes close, but the blacks are still a little bit grey and dosent give the same results on both mac and pc. The trick we use has been coined the ‘tiff trick’ and works by tricking quicktime into using default tiff image gamma before an export.

How to do it:

1) Create a small (32×32 pixels or so) tiff or bitmap – dosent matter what color, just make it 8bit and RGB
2) Open a new player and ‘Open image sequence’ and select the tiff/bitmap. set the frame rate to whatever you’re going to be working in
3) Open your desired quicktime in another player, ’select-all’ and ‘copy’ the clip
4) Back in you ‘tiff/bitmap’ movie hit ‘add to movie’ – this will add the video over the top of the tiff/bitmap on a second video layer
5) Export using your desired codec

All going well the gamma will match your original video very closely

3 Comments:

Blogger Unknown said...

Crackin stuff Andy, was just noodling around the place seeing about a fix for this today and lo and behold you've got it lined up on a platter. Cheers!

April 17, 2010 at 12:31 PM  
Blogger Administrator said...

Thanks Eimhin. Glad somebody finds it of some interest/use. Enjoy, but I want my platter back when your done k?

April 17, 2010 at 6:47 PM  
Anonymous Anonymous said...

Hey Andy! it's seb. i have no idea how to do what you just said but i'm taking the long way around with Megui and avisynth hopfully this will work out and x 264 will show good results^^.

i was wondering if you could tell me how to make the motion blur work in AF. ihave my whole project rendered out as trillions of colors(16 bit) pngs. is it possible to use motion blur on footage ? or do i need to render out the character seperatly for each scene ?(cause i'm not doing that >_<) i tried activating motion blur on the layers, the master switch on the top. going into the comp settings adv and changing the shutter angle and samples... i've used cc force motion blur with poor results so far.

ow! i rendered out an occlution pass for the whole thing and it really looks nice^^.

so yea one out of 3 so far. still need motion blur and foaley.

i#m hoping to submit this to galway.

anyway all the best hope the kids are well^^. see you around if your in next week or else next september.

May 8, 2010 at 5:57 PM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home