NOTE: This article is now out of date. A true solution has now been discovered, and you don’t have to compromise anymore.
See this article:
How to Fix the H.264 Gamma Brightness Bug in Quicktime Once and for All
In the previous article, I mentioned that I encountered a serious problem when exporting the “Wheels, Jets, & Rails” travel video for internet distribution. If you export your video with Quicktime, you may have run into this brightness bug without realizing it.
Simply put, exporting video as H.264 in Quicktime artificially brightens (or lightens, depending on who you ask) your video which makes it look very washed out and unprofessional. Though some scenes aren’t affected by this bug as much as others, it reduces the overall quality of your video. For instance, the washed out effect isn’t as visible in a snowy scene, but it’s very pronounced on a summer scene. During this article, I will assume that you already have Quicktime Pro since exporting video is a Quicktime Pro feature.
(Post-Publishing Note: New techniques to do this have been added to the bottom of this article.)
That Darn Gamma
No matter what I did, the resulting H.264 video was too bright, which is what happens when the gamma correction is set too high. (If you’re curious how gamma works, Wikipedia has an excellent description of Gamma Correction.) I wondered if using the MP4 filetype was causing the problem, but it wasn’t. Whether exported in an .mp4 or a .mov file, the resulting file was artificially brightened. To demonstrate this, I’ve used source video for an upcoming video to recreate the problem in the thumbnail on the right.
I did some research and discovered the H.264 Gamma thread on Apple Discussions where I learned that Quicktime’s H.264 encoder has had this gamma bug for about 3 years, and Apple has yet to fix this problem. Apparently, it’s caused by Quicktime forcing H.264 video to a 1.8 gamma level. There is a way, which is outlined on the thread, to correct this problem without rendering video again by using alpha transparency, but that only works on MOV files and doesn’t preserve hinting (i.e. the ability for you to start watching a video before its finished downloading).
I also heard that VisualHub does not have this problem, so I downloaded the trial version and began a series of experiments to find out what setting was best. An article from DearCali.com (which has since changed owners) was very helpful, but after trying many combinations in VisualHub, the gamma problem remained in every H.264 video I exported. (Yes, even after forcing ffmpeg, you geeks.) So I did what I should have done in the beginning, I manually applied a brightness filter in Quicktime.
As far as I know, this is the most straightforward, universal, and foolproof solution to this problem.
How To Counteract the Gamma Bug
To counteract this problem, you only need to add one step your normal process. (See “How to Encode a Video for a Podcast” for specific instructions on how byteful video is exported.) Once you have your final video, open it up in Quicktime and export the movie as “Quicktime Movie” again. It’s easy to make a mistake that would result in the loss of quality here, so follow these steps closely:
- Click “Settings” and set your Compression Type to “Apple Intermediate Codec”, and make sure your Frame Rate is set to “Current” FPS. Click “OK”.
- Now click “Filter”. As you can see, there are many filters that you can apply to a video. Choose “Brightness” and pull the brightness to the left until it says “-7”. You may want to experiment with how much darker you want it be, but in my experience “-7” seems to be just the right balance. Click “OK”.
- Make sure “Sound” is checked, otherwise you won’t have any sound! Then under “Sound” click on “Settings”. The “Linear PCM” format works, but “Apple Lossless” is a smaller file so I use that. Click “OK”, and click “Save”!
The Final Export
Exporting video in Apple Intermediate Codec is much faster than most video codecs, and this is by design. This codec was designed to be an intermediate codec to work with between computers and video cameras, without having a huge file size like most DV codecs.
Once the export is done, try exporting to H.264 again. The settings outlined in “How to Encode a Video for a Podcast” result in the most compatible and highest quality video I’ve been able to achieve with the H.264 codec. As you can see, the resulting file is nearly indistinguishable from the original.
Do you have a suggestion on how to improve this article? Or have you found a better solution to this problem? I’m open to suggestions in the comments.
2008.09.21 Addendum: It’s been brought to my attention that using Compressor 3 produces similar results as the above procedure, however I have not verified this. As always, test different methods to see what works best for you.
Despite the clear explanation I still seems I have the problem. I’ve authored a video with Apple Motion. If I export it with Quicktime Animation codec it looks OK. When I follow your instructions, opening the Animation Codec video in QuicktimePro, exporting first to Apple Intermediate Codec and the brightness at -7, opening the new one and exporting it as h264 for the iPhone, the final result is still washed out.
Just to be clear on the procedure (that I just repeated his morning):
– I created a simple project in Motion with rectangles filled with flat colors (pure red, green, blue, etc.) and a black to white gradient
– I exported with the Animation Codec directly from the app. It looks like the preview in Motion.
– I open the resulting movie file in Quicktime Pro and export it with the Apple Intermediate compression Type and Compressor Preset set to Other, setting the brightness at -7. This creates a temp movie file.
– I open the temp movie file just created and export it with the H264 Codec, Compressor Quality set to Best.
– I open the 3 files and I noticed that:
– the gradient quality has degraded right away in the Intermediate Codec
– in the final H264 some of the colors have shifted severely (the pure blue is purple now)
FYI I have 2 MacBookPro connected to 2 LCD calibrated monitors. Depending where I move the Quicktime window I see after a second the colors shifting, like a specific color setting is applied to the window.
What am I missing?
Thank you in advance!
Keep in mind that the Animation codec is one of the highest-quality codecs that exists, is near-lossless, and produces some of the biggest files. The intermediate codec looses a bit more information than the Animation codec, but it’s very fast and efficient so I recommend it for most video situations.
However, I’ve run a few tests, and I suggest the following:
1. Try Exporting with the Animation codec instead of the Intermediate Codec when doing the brightness adjustment. I got slightly better quality in my final output doing this.
2. The default “export for iphone” settings are rather sloppy and don’t provide the highest quality possible on the iPhone. I recommend trying out the H.264 export settings I outlined in the How to Encode Video for a Podcast article. (Scroll down to “Byteful Video Settings”) The color blue did not shift when I used those settings.
3. The color setting being applied to the window is most likely Quicktime applying gamma adjustments to your video. This is supposed to happen and there’s no way to disable it as far as I know.
If you try out the specific h.264 settings I outlined in the other article, I think you’ll be happier with your result. Let me know if you have any other questions. 🙂
Thanks for chiming in, cd. I’m familiar with that solution, but it was not an option for me because it requires that the files be inside of a .MOV container and not the pure .mp4 container.
Also, in my experience the brightness reduction is not noticeable in most situations I’ve run into. For example, does the “Wheel, Jets, & Rails” video look like crap? I’d venture to say no.
Thanks for pointing out this other solution though. It is my hope that people will see the various solutions collected here and find a method that works best for them.
Anyone else have a solution?
Your brightness option is bad! If you have a pure white background, it will bring down your white so its not a good solution.
Try this instead:
1. Open the Quicktime movie
2. in quicktime player, Go to “Window/Show Movie Properties”
3. Select “Video Track”, then click the “Visual Settings” tab
At the bottom left, change the transparency to “Blend” then move the slider to 100
Change the transparency to “Composition”
4.Close the Movie Properties window, then play or scrub the QT. Your black levels should now look correct
5.Actually, “Save as a self-contained movie.”
uuh, awesome,
I have searched like a dumbass for this solution. Really annoying quicktime does this washing out of my movies. Although I have to convert 2 times now, I think it’s worth it.
By the way, do you have infos about handbrake? The videos there look pretty good, not washed out.
Another question: I had converted an avi to mp4, then tried to export the mp4 again to a smaller bitrate for ipod and, surprisingly, the video wash out was done again, means it got even brighter again. After 5 conversions the screen would be white I guess 🙂
Hi, Manuel!
Handbreak is a great app, but it’s designed to convert DVDs into movie files, not to convert movie files into web-ready h.264 files. Different purposes.
I’m not surprised that the video washed out even more. Whenever you encode video, it’s better to have less steps. The more times something is reconverted, the more quality you will lose. Try converting the original .avi file to the smaller bitrate instead.
My problem with the color change with the H.264 codec is not the increase in brightness. It’s that the colors in your video get completely desaturated. Although I’m recording lectures now where the color integrity is not paramount, for my personal projects I relish in having lush colors, which seem to be impossible with the H.264 codec, and H.264 is the only usable codec for small file sizes. I don’t think there is any change I could make to the saturation of my video in Final Cut Pro that would make up for what H.264 does to the video.
Hi, Nicholas.
I haven’t had much issue with color desaturation. Are you using Compressor or Quicktime Player to make your h.264 files? And what versions are these?
Perhaps this is a more effective solution?
Fix QuickTime Gamma Shift
Torley´s last blog post..Torley’s weekly Twitter for 2008-12-14
Torley, thanks for pointing that out, but I mentioned that technique in the 3rd paragraph of this article: “There is a way, which is outlined on the thread, to correct this problem without rendering video again by using alpha transparency, but that only works on MOV files and doesn’t preserve hinting (i.e. the ability for you to start watching a video before its finished downloading).”
However, thanks for pointing out a concise description of that technique! I’m sure many people will find that useful.
Has anyone gotten that technique to work and ALSO preserve hinting?
I’m sorry; I actually pasted the wrong link. I meant: Brightness Issues with H.264 QuickTime Movies
It’s been frustrating yet encouraging to see multiple threads on this issue. I even asked Neil, the maker of iShowU and Stomp, if he could find a way to fix this. The tag-stripping described in the above link sounds the simplest — but it hasn’t worked for me, or perhaps I’m doing it wrong.
I’d be glad to hear if there are any new insights and/or a simpler solution. That being said, thanx for speaking out about this! =]
Thanks for sharing, Torley! Next time I release a video, I’ll be sure to try out that 3rd-party x264 codec you mention.
And thanks for drawing more attention to this annoying problem! Let me know if you learn anything else, and I’ll be sure to update this entry if I learn anything new, as well.
Thank you ! Merci ! Gracias !
At last I can encode acceptable videos ! What a relief 🙂
Fantastic article! Finally i got a good solution for my doubts to fix washed out videos………… Thanks! Nice contribution………..