Wednesday, May 1, 2013

Black Magic vs Magic Lantern (Round 1)


Newcomer BlackMagic Design takes on the current feather-weight cinema camera champ Magic Lantern, and there's the bell!  ...Magic Lantern starts off with a wild 2K RAW haymaker but misses with only 1931x1288 making contact!  ...Black Magic capitalizes and tries to make an opening with quick jabs of focus peaking and zebras but Magic Lantern blocks and returns with a scaling sensitivity focus peak and raw histogram punches!  ...Now Magic Lantern in control falls back to a conservative steady attack of 8bit YUV422 (BUT OHH WHAT'S THIS?!) they're slowing down after only 16 seconds!  ...Black Magic bounces right back with a steady barrage of 10bit ProRes422! ...Black Magic with seemingly endless energy shows no sign of letting up on the Champ, this may be it folks!  ...Black Magic winds back for their patented 12bit attack (BUT OOOH!) Magic Lantern hits them with a whooping 14bit uppercut!  Black Magic is down! Black Magic is Down! ...ONE! ...TWO! ...THR... and Black Magic is back on their feet folks, looks like we're going to round 2!!!


The Camera Blogs are a buzz, "Magic Lantern finds RAW Video!", "720p 24fps possible with 1000x CF cards!", "Magic Lantern saves Canon from Black Magic!"  Unfortunately this is all just uneducated speculation polluting the interwebs.  The truth is it's not video, it is Raw but can only produce enough frames for about 2 seconds of video.  This is just bloggers looking for attention, please ignore them and let's take a look at the facts.  
First off the Magic Lantern guys themselves said this is not intended for video, they can only get a few second recordings and are pessimistic about getting much more than that.  
So what is this then?  Magic Lantern seems to have found the source of the sensor scan for video, the "file" is a 2K resolution 14bit RAW image but the actual "usable image" is about 1931 x 1288 pixels, the rest of the 2K file are black bars (and consider those random pixels on the bottom a black bar because it is not part of the recorded image).  Even the "720p mode" is still in the same sized 2K file only with a "usable image" of 1931 x 672 pixels.
'A1ex' (from Magic Lantern) has implemented CHDK's DNG converter to save these RAW images to card. (which likely uses the same CR2 RAW converter already in the camera but instead spits out a DNG rather than a CR2) each frame (or "DNG file") is about 5.09MBs for all the 'standard resolution' sizes and about 9MBs for the '5x and 10x zoomed resolution sizes'.  Remember 1920 x 1080 or 1920 x 720 "useable images" are in the same 2K RAW file, just with more black bars in the 720 file; so they are actually the same file size. 
The "frame buffer" where these images were found only allows up to 7.5MB/s, so it can't write the images to a card fast enough (even with a 1000x card) and when the buffer is all filled up the video recording stops, currently it's getting about 50 frames, which at 24fps is about 2 seconds of video.  However even that is only obtained after turning off all other Magic Lantern features and setting the camera's photo mode to 'JPEG only'; which increases the buffer's write speed.  Having RAW+JPEG or RAW mode on will limit this buffer to 4.9MB/s providing about 30 frames before recording stops (1 second).
The simplest way to get these images through this 7.5MB/s buffer to a card would be to "compress" them further, but I don't believe firmware tweaks have the ability to do that.  So they are trying to crop out the 'usable image' in hopes to reduce the file size a bit but even then it won't be enough so they will still need to either increase the buffer speed and/or use a different compression method already in the camera.
In camera compression choices are:


1. RAW (CR2 or DNG) = 14bit 4:4:4 with a Lossless 1.25:1 frame compression

2. YUV LiveView (HDMI) = 8bit 4:2:2 with uncompressed frames

3. Photo JPEG = 8bit 4:2:2 with a Lossy 2.6:1(Fine) or 15:1(Normal) frame compression

or

4. AVC (H.264) = 8bit 4:2:0 with "variable" Lossy frame compressions (approximately 25:1-12:1)

Here is an example of DNG (RAW) vs JPEG (8bit 4:2:2) *BlackMagic uses "Lossless" and "Standard" DNG

The Magic Lantern team has actually tried option 2 in the past, grabbing a "copy" of the frames going to the LiveView and saving them to the removable media card,  this attempt was back in late 2012 which resulted in what they were calling 'silent pics' which saved a 1056 x 704, 8bit, 4:2:2, "YUV" JPEG file for each frame for 24fps.  Their recent attempts with their "LiveView YUV recorder" have evolved into a 1904 x 720 24fps 8bit 4:2:2 Uncompressed "sequence" (a group of frames in one file) that can record up to 400 frames (16 seconds).  This should provide us with similar quality to Canon's clean HDMI out except this is straight to the internal card in 16 second bursts without the need of an external recorder.  Their is currently no sound recorded in the "sequence" but they are also working on a way of recording a separate sound file that matches the first few seconds for audio syncing purposes in post. 
Some have asked if HDMI out is the answer but sending the 14bit RAW images.  HDMI won't work because Canon's HDMI out can't display that much detail; it's limited to 8bit, requires 'de-Bayering'(not RAW data), limits at 4:2:2 'sub-sampling', and needs to crop and resize that 2K image down to 1920 x 1080 before it can send it through the HDMI port.  Once you do all that "compressing" guess what we're left with?  Yep the 8bit 4:2:2 uncompressed (not RAW) image that Canon gave us with the 1.2.1 firmware update. 

So this is not Raw video.  But Magic Lantern have not given up on trying to turning this 2 seconds into a 14bit DNG video solution, they are currently looking for other "paths" to send the DNGs through and they've just discovered that writing bigger chucks at a time increases the write speeds for the removable media cards.  So if they can apply this to the 14bit DNGs we might be able to get 24fps recordings in more usable runtimes rather than their current 2 second limits, but even the magic lantern team is skeptical on that so all we can do is wait patiently and stop reading those over exaggerated misguided blogs.