Showing posts with label Video. Show all posts
Showing posts with label Video. Show all posts

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.

Saturday, May 5, 2012

What is Diffraction?

I just received some concerning news, it turns out my beloved Photos are showing signs of being Diffraction Limited. Are you one of the many Digital Photographers or Videographers suffering from Diffraction?  The test is easy and can be preformed in the privacy of your own computers so please help stop this growing epidemic and get your images checked.

Squint your eyes down, smaller, smaller still, until they are just barely open. What you notice is that the smaller your eyes get the darker and softer your vision becomes. You have just observed a crude example of Light Diffraction.  For the quick solution don't stop down past F/8 then use ND Filters to protect your Photos from Diffraction, it's like how throwing a pair of sunglasses over your eyes get you a darkened image without nearly as much loss of sharpness.

As a Photographer I felt the need to better understand Light and although I am not a Physicist I do know that the 'what', 'how' and 'whys' of Light are still under debate and that a conversation about Particle-Wave Duality is best left to the Quantum Physicists. What a Photographer dealing with Diffraction needs is to understand Light as a Wave. A Light Wave emits from it's source in all directions; what has helped me is to imagine Light as a growing bubble of Photons moving out as a tightly shaped sphere that is immediately followed by another wave and moving faster than the eye can register. They race away until they crash into an obstacle, as the surface of the obstacle is bombarded with photons each point of contact becomes a new point of emission sending another wave of photons back in the other direction. 

Light moves outward as a Radial Wave so when it rushes passed an edge it not only hits one side and reflects back but also around the corner to the second side of the edge reflecting waves across as well. When Light encounters an obstacle with multiple edges in close proximity, like your nearly closed eye lids or the inner edge of a Lens Aperture, the light waves reflect across from one inside edge across to the other and back again sending waves back and forth across the small opening. The opposing waves overlap and interferes with the portion of the wave that made it past the edge cancelling out and redirecting some of the light that passes near the edge off to an extreme angle reshaping the wave that emits out of the obstacle into a wider angle reducing brightness and sharpness that make its way to the sensor.

A Digital Photographic Sensor, like a Georges Seurat pointillism painting, is made up of tiny "Pixel-Sensors".  An Image is projected from the back of a Lens onto the Sensor like a tiny movie theater inside your camera. Then each of these microscopic Pixel-Sensors record one microscopic point of the projection and save it as one pixel of the digital photograph.  However these Pixel-Sensors also have their own edges where the light diffracts, the smaller the Pixel-Sensors the more susceptible they are to diffraction caused by the lens aperture.  A modern day "Full Frame" Camera has Pixel-Senors of about 6.25 microns and an "APS-C" Camera of today has 4.3 microns.

Now 

The solution to avoid diffraction is to keep your Iris settings wide and use the largest and/or highest resolution sensor you can; but understanding why and what your particular camera's diffraction limit is important to getting the sharpest images possible from your lenses.

Basically Diffraction is the lens not getting enough light to the sensor's individual photodiodes to properly resolve your image.  A high resolution sensor has more physical photodiodes, but they have to squeeze them into the same amount of space so the photodiodes need to be smaller which means they have more trouble saturating and when closing down the aperture reducing the light through the lens.  When a pixels next to each other are made from photodiodes that are under-saturated it translates to lower contrast and creates a softer image. That's the easy explanation anyway.
Technically the lens is an obstacle for light to squeeze through, it forces the light down together and then spreads back out at a weaker intensity.  Think of light-rays like waves of water moving through an obstacle, turning strong aggressive waves into a weak gentle ripple.  In a camera the light also needs to squeeze through the aperture and the smaller the aperture the more narrow the flow which cuts down more light-rays that can get through, the light-rays that make it through are then spread back out to cover the sensor area, which results in wider yet weaker light-rays. Modern day 'Bayer Pattern Array' CMOS Sensors are actually a grid of microscopic sensors called photodiodes or 'Pixel Wells'. These 'Pixel Wells' are very small, measured in microns, and each 'Pixel Well' should record a different ray of light than its neighboring 'Pixel Well'; together they are resolving an image down to their microscopic micron's size, which we preserve as fine details, micro contrast or sharpness.  When the individual light-ray are wider than the sensor's microscopic micron sized pixels then each pixel will start to record part of the light-ray of its neighboring pixel, the more they overlap the more similar each pixel is which effectively lowers your pixel count (resolution) and the softer the image appears, a "fully diffracted image" may render 9 individual pixels as 1!  Turning an 18 megapixel image into a 2 megapixel one.  That is called the diffraction effect.

The higher the resolution of a sensor the smaller its 'Pixel Wells' need to be so that they can physically fit on the sensor and the faster they'll reach a diffracted state, called the diffraction limit.  This is why for higher resolutions it is important to use a physically larger sensor; although an argument can be made that higher resolution sensors are still higher resolution when fully diffracted (9 pixels act as 1) than a lower resolution sensor and that is true but only in very extreme cases, for example a fully diffracted 60 megapixel image would be 6.6 megapixels which is still higher resolution than the sensor of my first Canon DSLR, the EOS D60 (6.3 megapixels) which I was still able to make passable 8 x 10 prints with.  Right now we are at about 20 megapixels on most DSLRs and those diffraction limits (that when the diffraction effect starts) are f/11 for Full Frame and f/8 for APS-C; the higher we go the less exposure choices we'll have, one day we might even be diffraction limited at f/2.8... but that's quite a ways off.
Cambridge in Color has a great description of diffraction with very detailed examples and even an interactive 'diffraction calculator', I recommend going back there to carefully read the article and try out their calculators to get a thorough understanding of this effect.



"Diffraction is an optical effect which limits the total resolution of your photography — no matter how many megapixels your camera may have. It happens because light begins to disperse or "diffract" when passing through a small opening (such as your camera's aperture). This effect is normally negligible, since smaller apertures often improve sharpness by minimizing lens aberrations" -http://www.cambridgeincolour.com/tutorials/diffraction-photography.htm