Monday, January 19, 2009

Full dynamic range video from Canon 5D MkII.

I been seeing many posts on how crushed the black levels and highlights are with the Canon 5D video mode. Stu Maschwitz has a great post on how to tweak the camera to improve the situation, but also points out the default presentation FCP is also wrong. It turns out that this presentation fault is in all popular editing packages on Mac and PC. They could possibly share the same AVC decoder, but I have a different theory below.

Using a 5D MOV video originally posted DPReview.com, here you can see the clipping that occurs within tools like Vegas, Premiere Pro and FCP when directly opening the MOV files. This zoomed in section shows much of the tree details are crushed into the blacks, when compared to the same sequence converted to an AVI using HDLink with CineForm NEO HD.

After some image enhancement, the black truncation becomes more apparent. These images where manipulated with a 32-bit levels filter (it is not truncating the data) so we see how much data is being lost, a failure to see "the trees from the forest" type of problem.

One common reason for all this error, is the camera H.264 I-frame compression is using 4:2:0 YUV, where display black is 16 and white is 235 out of a 0-255 luma range. If the NLE took this YUV data directly, everything should be fine, but instead is likely going through series YUV to RGB transforms that are truncating the data. Most NLEs extracting RGB from YUV sources map the 16-235 YUV to 0 to 255 RGB, truncating data in the supers, yet it turns out the Canon 5D doesn't even use much in super range (blacks between 0-15 and whites up to 255) as this non-truncated luma histogram shows: It seems that the 5D is limiting the output to broadcast standards (yet another thing the 5D does wrong for video heading for post.) Whereas most video cameras do use the extra range, they assume the broadcast limiting will be handled in post (as they should.) So the NLE's mapping of the 16-235 to 0-255 RGB is actually not the issue, somehow the H.264/AVC decoder used is actually mapping a range like 30-220 only into the NLE space. I have not seem such a big error before, which makes me think there an incorrect flag in the 5D bit-stream that is causing the use of the wrong output math.

Luckly within CineForm NEO HD we use direct YUV to YUV conversion wherever possible, this eliminates many trunction errors, and preserves highlight for mulitple camera sources. In current version of NEO/Prospect HD (v3.4) we don't ship an AVC decoder, so NEO HD searches out for registered decoders already installed, resulting in some users reporting this error and others not so. So the failure is AVC decoder dependent, although this may not be a bug in the decoders, as they all handle regular AVCHD sources without issue (again leading me to believe there is something wrong/different in the 5D bit-stream.) The one AVC decoder that produces the full range of YUV range is CoreAVC. We have been recommending it to AVCHD users as it is both fast and inexpensive (only $15), but it seems it might have extra value for those trying to get the most out of their Canon 5Ds.

In our next major release of NEO HD (and up) we intend to direct support Canon 5D, yet in the meantime for those using CineForm products I recommend you get CoreAVC, the latest version of NEO or Prospect which now favors CoreAVC over any other AVC decoder it might find. This version is currently in public beta and will likely become official in a day or so.

------
1/21/09
Update 1: The new software is now released and available for upgrade or trial directly from cineform.com.

Update 2: I have discover more on AVC Decoders issues for the Canon 5D in the next post.

7 comments:

sutt said...

I'm curious to know if you have reported any of these findings to Canon's SLR group.

It seems to me that if what you are saying is true, there was little communication between Canon's SLR group and the video division before the release of the 5D MkII. There seem to be many issues with the file format specifications that could have been worked out in advance.

David said...

Unfortunately we have no contacts within the SLR group. I sure they are receiving lots of input at the moment.

Video Equipment Leasing said...

Interesting post and great blog. When the Canon 5D first came out, many videographers thought this camera was the answer for an affordable HD upgrade. The footage I've seen in well lit environments looks great while low light environments seem to present some trouble for the CMOS sensor. Overall... I think the camera is an EXCELLENT solution for professional photographers seeking SOME HD video capabilities.

Hope to see you at NAB 2009!

Cédric said...

Hi, I've just uploaded a 10 min test camera of the Mark II shot in NY. With all different lights and conditions to test the capabilities of this wonderful object.
Enjoy and leave me your comments.

http://vimeo.com/4917321

Cheers

criticpapa said...

whoa!!!, you had a passion in blogging, thumbs up for your work of love.. Hehe very inspiring ideas,


anyway I'm william
mind if I put a link back to you?


see my works here ------> Black Suit

man suits said...

Thanks for sharing I highly appreciate it however I'm looking forward for your updates.

Android Indonesia said...

Thanks for review, it was excellent and very informative.
thank you :)