Thursday, July 26, 2012

AfterEffects has wrong DCDM transform?

Yesterday I tried out different things in AfterEffects color management workflow and found out that the DCDM XYZ transform for DCP generation seems to be wrong. Images generated with this setting have a slight magenta cast when viewed with inverse transform in Stereoscopic Player or EasyDCP Player. Images transformed with OpenDCP are fine in players and look identical to originals. Must do some more fiddling and see if error is between chair and monitor or in AE...

Spheron camera does 3D measurements..?

Happened to read about the Spheron camera today and found out that it also does 3D measurements. As their homepage is rather vague about the technology behind it (or rather the description is easy to overlook) it took me some time to find out how it is done. It seems that for 3D measurements you have to shoot two panoramas at different heights and from these two images, simple parallax measurements give you the position in 3D space.

Sounds easy but raised a few questions. How do you measure the position of objects near the "poles" as approaching the poles, separation between the two images disappears? Do you have to measure the set and mark the distance between two points on the image to give the scene it's scale?

Wednesday, July 25, 2012

Thoughts on BMCC part 3

Random thoughts on Blackmagic Cinema Camera.

Lenses and stuff

BMCC camera has canon EF lens mount which means that it accepts all EF, EF-S and ZE lenses. With Nikon to Canon adapter, Nikon lenses should be also possible. Camera has electronic contacts to drive iris and focus (?, said to have focus control through LANC). Iris adjustments are made through menu or by pressing the IRIS button on camera which sets iris so that no pixel is clipped.

As the camera sensor is about 15.8x8.9 mm in size, it has a crop factor of approximately 2.3x in relation to full-frame (Vistavision size) sensor. This is larger than for example Canon 550D or 7D, both of which have crop factor of 1.6x. Compared to 35mm and 16mm film cameras, BMCC is placed somewhere inbetween as Super16 measures 12.52x7.41mm and 35mm is something like 22x12mm. BMCC is somewhat like oversized Super16 and resolution should also be similar to that of 16mm film scan.

A lot of people seem to complain about the not-so-great bokeh abilities due to small sensor but I can't really get the logic behind it. As this camera accepts the EF lenses and focal plane is at the same distance as DSLRs, only effect the smaller sensor has is cropping part of the image. In my eyes it makes the bokeh effect stronger not weaker because the relative size of bokeh rings increases. Anyway, how many shots will be having need for strong artistic bokeh? Not too many I think, because you wouldn't see a damn thing this way...

The last missing feature

Although the camera looks great it still has one missing feature in my opinion and that is genlock input. It could probably be added with firmware update by somehow utilizing the LANC or audio input socket. Don't know exactly if this is technically possible but it shouldn't be very difficult to do as BNC cables with 3.5mm  "mini genlock" jack exist and in the end it's only electricity and a bunch of wires.

Why would I need genlock input? I would like to use this camera for stereoscopic shooting and for that, genlock is a must. LANC could be used to start recording at the same time but without constant syncing, cameras would drift out of sync.

Thoughts on BMCC part 2

Thoughts on Blackmagic Cinema Camera

Dynamic range and encoding options

Previous post discussed the overall story of BMCC and 2.5K bayer pattern CMOS sensor, lets continue in the same line. According to Blackmagic, this camera will have 13 stops of latitude which is great! Why is it great? Because the more latitude you have, the less blown out highlights and black shadow splots you will have. You can always add your clippings and smooth rollouts to your liking but important thing is that you will have the option to get every drop this camera is able to capture.

For recording raw sensor data, CinemaDNG file format is used. It is an Adobe initiated open format for raw sensor data that supports different bayer patterns and bunch of other features. One 2.5K raw file will be about 5MB with 12 bits per pixel. BMCC will use log encoding for raw files and 12 bits are plenty for that. There is a nice discussion about log versus linear in Cineform insider blog. Log encoding preserves more information in shadow areas and is thus more suitable for digital cameras that tend to need some under-exposure to avoid rather ugly looking clipped highlights. On the downside, as log image does not linarly match captured light intensity values but instead contains the derived log-encoded values, it must be linearized with correct operation that suits the log encoding curve. Such curves are usually provided by camera manufacturers in form of simple reversible 1D LUT. When this camera will be released, Davinci Resolve will probably get an update with ACES IDT transform for BMCC camera.

Other encoding options besides CinemaDNG are Prores 422HQ and DNxHD, both in either log encoding for grading or rec709 for fast stuff. Prores is mostly nice feature for FCP users because it suits so damn well with it and Resolve. DNxHD should make both Avid and general Windows/Linux user happy. It is possible to decode Prores on Windows too (Quicktime does that) and with ffmpeg, it is possible to encode Prores on Windows although FCP is said to complain about the files (some missing metadata) although it plays them.

Recording media

Recording media for BMCC is SSD drives which is really nice because they are much cheaper per GB and more readily available than some exotic memory card format. And they are fast too. One 256GB SSD is said to hold about 30 min of RAW CinemaDNG sequences or 2,5h of Prores or DNxHD. SSDs must be formatted in Apple file system but it can be done on Windows too with certain programs. It is said that camera itself cannot format the drive, so no quick-buying these during shoots...

Probably the camera also accepts standard 2.5" HDD drives which are dirt cheap and should be fast enough for Prores/DNxHD 220Mbit/s speed (less than 30MB/s). One 500GB HDD should be able to record almost 5 hours of footage! Someone should try this out!

Thoughts on Blackmagic Cinema Camera

Blackmagic Cinema Camera is to be released in a few days, on 27th of July to be exact. I have been following the discussions about this camera in forum and here are my two cents on this topic.

Since 2008 when Vincent Laforet shot the famous Reverie short that started the whole DSLR film mania, little has happened camera-wize on the low-budget end of nice looking filmmaking. Hacks for Canon cameras and Panasonic GH2 have opened some additional possibilities with higher bit-rates and other rather insignificant features but nothing really exiting has happened. It seems that Canon has dropped the ball in DSLR development because new camera models have brought absolutely nothing new feature or quality wise. Probably it is so because of things like C300 and C500 but they are 5x more expensive than say a 5dmkII.

In may 2012, Blackmagic Design, company best known for video capture cards, converters etc, announced their plans to make a 2.5K CMOS sensor camera that shoots CinemaDNG raw for only 2995$. And not only announced, they showed a working prototype also! RED once also promised 3K for 3K$ but this utopia never realized and Scarlet became the somewhat lighter twin brother for Epic with a much more heftier price tag than 3K$.

So, only three months ago Blackmagic came out of nowhere with it's new camera and surprised everyones socks off. What's so interesting about this camera besides the relatively cheap price?

2.5K CMOS sensor

BMCC has an approximately micro-4/3 sized sensor that measures 15.81 x 8.88 mm with 2432x1366 elements. I say elements because it is not absolutely correct to call these pixels as they don't give you RGB data for each one. As a CMOS sensor, it is basically a single sensor overlaid with Bayer filter. This means that each element "sees" either green, red or blue depending on the position. Most common Bayer filter has twice as many green elements as red or blue because green is most helpful for luminance recording and human eye is also most sensitive to green color.

One could argue that Bayer sensor is similar to 4:2:2 chroma subsampling but this is wrong because they are different schemes for completely different purposes. Chroma subsampling means throwing chroma samples in YCrCb color space which takes place after all the other image reconstruction processes have been done. Bayer pattern with it's distribution of green, red and blue cells contains information about real RGB values and captures as much information as possible with given sensor.

Constructing full RGB image from Bayer pattern is called debayering. Raw image from Bayer sensor is basically monochromatic, it does not have colors as such because each element registered only the light level it received through Bayer filter. Debayering algorithms use clever schemes to interpolate the missing values for all RGB colors and thus reconstruct full RGB raster image. Very basic algorithms do simple interpolation between elements of single color, advanced algorithms use all surrounding elements regardless of "color" and use local gradients to choose, which direction should be chosen for interpolation. It might be called inverse gradient-strength weighted interpolation or something in that direction...

So, as this camera has a Bayer pattern sensor, it does not really have the 2.5K image color-resolution wise. But depending on the debayer algorithm, it comes close. It will be a wonderful fullHD camera for sure and possibly even beyond that. Filming for 2K digital cinema will probably be no problem because even Avatar was up-scaled from 1920 pixels to fill the 1998 pixel wide DCP container. Avatar was filmed mostly with Sony F35 cameras that output true 1920x1080 RGB image (debayered and downscaled from 3.5K sensor) but debayered and downscaled BMCC image probably comes pretty damn close.

Next post will be about dynamic range and encoding.

Tuesday, July 24, 2012

ACES workflow and Resolve

Last two days I have tried to wrap my head around the ACES thing and how it works in Davinci Resolve. ACES was introduced in Resolve 8.something and is now an alternative to native YRGB math. I probably first read about ACES from project Mango blog because Mango was shot with Sony F65 which is meant to support ACES workflow. For Mango (or Tears of Steel as they now call it), they converted the thing from SLog to ACES openexr files and from there on to rec709 which they use for compositing etc. At first I didn't pay much attention to this ACES thing but when I found it from Resolve I decided to dig a little deeper and find out what this whole thing is about.

Basically, ACES is a color gamut that is meant to be so wide that you cannot possibly go beyond it even with extreme grading or transforms. As I understand it, it expresses colors in XYZ space which is device-independent and thus allows to describe all possible colors. Images in ACES colorspace should be scene-referred (as opposed to output-referred/display-referred) which means that color values describe actual light levels in the scene that the camera or other captude device received.

EDIT: ACES has RGB primaries associated with it and thus is a theoretically limited color space. It, however, contains all  colors visible to human eye and so is unlimited in any practical terms. ACES values are  relative scene exposure values - they express real light level ratios in filmed scene.

To achieve the conversion to scene-referred values, something called Input Device Transform is performed. It is a transformation that is specific to imaging device (for example the sensor of certain camera model) and converts the values from recorded camera data to scene exposure values. This transform must be camera and recording method specific because cameras tend to apply different log or gamma curves to map the most valuable data to limited bit depths. IDT reverses these curves and sensor response to calculate real light levels that hit the sensor. It is a bit unclear to me if this should happen in IDT or is some additional 1D or 3D transform needed...

After transforming camera data to scene referred values, something called Reference Rendering Transform is performed. I haven't quite figured out how it works in Resolve but as I understand it, it is basically the emulation of ideal film print that has the pleasing qualities of film. How this transform is constructed and what are the pleasing qualities that it tries to achieve are, is fuzzy to me at the moment. It is meant to replace the current practice of release print film stock emulation LUTs that are used in grading.

EDIT: Reference Rendering Transform applies manipulations that make image look perceptually pleasing. As films stocks have been developed to look pleasing also with some colors being more saturated than others, comparison of RRT with ideal film stock is logical.

For viewing the "ideal film stock" on screen, Output Device Transform is performed. ODT transforms the image to whatever output device you are viewing the image on. Without RRT and ODT you can not display ACES data. ODT is device specific and maps the ideal image to device gamut and gamma. For example if you view the image on P3 DCI projector the ODT makes sure you get the right mapping to the gamut used in projector. Same with rec709 or any other way of displaying images.

In addition to IDT and ODT, operations called Input Device Calibration Transform and Output "thesamething" can be performed. Calibration transforms are meant to level the differences between different models of same device. For example two different Alexa cameras might have slightly different sensor response curves and IDCT is meant to remove that difference between cameras. These transforms are device specific and are not shared. Probably they won't be used much because to construct such a transform you have to run your cameras and output devices through some heavy measurements.

Random rants and progressbar

This blog is meant to replace sometimes failing memory and pieces of paper that tend to get lost or buried under other very-important-stuff. Main focus will probably be related to animation, vfx, grading, digital cinema and information that I find to be useful some way or another. Occasional posts about more earthly themes also possible...