Phantom .cine Colour Management

Working in DYRGB Colour Managed projects I find the the options for interpreting the .cine files in Resolve give a very crunchy starting point. My assumption is that the footage has a linear gamma, and based on that I've got a set up that works for me - but I wonder what others are doing?

What I am doing is setting the Gamma to Rec709 in the Camera RAW settings, and then on a pre-node using a CST that is going from Rec709/Linear to Timeline/Gamma 2.4.

Keen to hear if anyone has a different approach. Or the same one! Bit of reassurance! There doesn't seem to be a huge amount of info out there about this.
 
Working in DYRGB Colour Managed projects I find the the options for interpreting the .cine files in Resolve give a very crunchy starting point. My assumption is that the footage has a linear gamma, and based on that I've got a set up that works for me - but I wonder what others are doing?

What I am doing is setting the Gamma to Rec709 in the Camera RAW settings, and then on a pre-node using a CST that is going from Rec709/Linear to Timeline/Gamma 2.4.

Keen to hear if anyone has a different approach. Or the same one! Bit of reassurance! There doesn't seem to be a huge amount of info out there about this.

As far as I know, Blackmagic/DaVinci has not licensed the cine2tiff library from Vision Research, and is instead using the older SDK that only allows exports in Rec709, "log1," and "log2." Most people use the Rec709 export (I believe that's the default in Resolve), but it's not going to get you what you actually want. Using the cine2tiff library gets you a "proper" linear export that can then be made into, say, LogC using a transform. That's what Colorfront is using now, and their default is to convert to "CFLog/CFGamut" which is basically identical to Arri LogC/Arri Wide Gamut. If I'm not mistaken, Filmlight uses that as well, but DaVinci does not. So if you're trying to do a "proper" conversion to either linear or a supported log space using Resolve, you're probably out of luck for the moment. If someone from DaVinci wants to chime in on this, I'm all ears....
 
Working in DYRGB Colour Managed projects I find the the options for interpreting the .cine files in Resolve give a very crunchy starting point. My assumption is that the footage has a linear gamma, and based on that I've got a set up that works for me - but I wonder what others are doing?

What I am doing is setting the Gamma to Rec709 in the Camera RAW settings, and then on a pre-node using a CST that is going from Rec709/Linear to Timeline/Gamma 2.4.

Keen to hear if anyone has a different approach. Or the same one! Bit of reassurance! There doesn't seem to be a huge amount of info out there about this.

I had similar issues working with Phantom Cine RAW files few months ago. I also experienced a lot of crashes whenever I did something to the RAW controls. Even ended up transcoding all the files. In my case, I went for LOG2 and just dialed in contrast and saturation to taste. Couldn’t find any info on what colourspace the files were, so I assumed they were in rec709.
 
I've found that color managed projects with DWG intermediate working space have all highlight detail available, but interpreting log1 or 2 and using node color management yields less dynamic range with .cine files.
 
A while back, I created a DCTL for Phantom Log1. Since I couldn't find any information about the color space that Log1 Cine actually uses, I made the assumption that it's Rec.709 or an equivalent display color space. Feel free to give it a try if you're interested.
 

Attachments

  • phantom_log1_to_ARRIWG_logC.dctl.zip
    1.2 KB · Views: 140
A while back, I created a DCTL for Phantom Log1. Since I couldn't find any information about the color space that Log1 Cine actually uses, I made the assumption that it's Rec.709 or an equivalent display color space. Feel free to give it a try if you're interested.

Experimentally only, I believe it is rec709 too.

I’ve got some LUTs for on set use with a Flex or VEO, made with Lattice’s Log1/Log2 and Rec709 as the assumed colour space. I’ve checked them against ACES decoded .cine files in Assimilate Scratch colour managed to AWG/LogC and they match.

Were you able to find the phantom log transform somewhere? I’ve tried to find info about Log1/Log2 and suspect I’d need to get the SDK from vision research directly as it doesn’t appear to be online anywhere.
 
Experimentally only, I believe it is rec709 too.

I’ve got some LUTs for on set use with a Flex or VEO, made with Lattice’s Log1/Log2 and Rec709 as the assumed colour space. I’ve checked them against ACES decoded .cine files in Assimilate Scratch colour managed to AWG/LogC and they match.

Were you able to find the phantom log transform somewhere? I’ve tried to find info about Log1/Log2 and suspect I’d need to get the SDK from vision research directly as it doesn’t appear to be online anywhere.
here you go
 

Attachments

  • logandtoe.pdf
    73.5 KB · Views: 100
With much thanks to Jimmy's original DCTL, I've made a DCTL that allows you to pick between the two transforms from the log and toe paper plus a tweaked version of the log2 transform.

On the footage I had for testing, the original transform didn't yield a matching linear image to log1, the tweaked version is much closer.

I've also added an exposure slider, footage exposed for what log1 'looks like' is roughly 2 and footage exposed for log2 is around 2.88.

This version only transforms from log to linear, add a CST node after it to go to any desired space:

PhantomColourManagement.png


Code:
// Phantom Input DCTL - Linearise Phantom Log 1 or 2

DEFINE_UI_PARAMS(p_SPACE, Input, DCTLUI_COMBO_BOX, 0, { PLOG1, PLOG2, PLOG2A }, { Phantom Log 1, Phantom Log 2, Alt Phantom Log 2 })
DEFINE_UI_PARAMS(EXPOSURE, Exposure, DCTLUI_SLIDER_FLOAT, 0, -5, 5, 0.001)

// Phantom Log1 to linear
__DEVICE__ float3 Log1ToLinear(float3 log1) {
    const float r = log1.x > 0.182f ? _expf((log1.x - 0.377675f) / 0.182f) / 30.0f: 0.0625f * log1.x;
    const float g = log1.y > 0.182f ? _expf((log1.y - 0.377675f) / 0.182f) / 30.0f: 0.0625f * log1.y;
    const float b = log1.z > 0.182f ? _expf((log1.z - 0.377675f) / 0.182f) / 30.0f: 0.0625f * log1.z;

    return make_float3(r, g, b);
}

// Phantom Log2 to linear
__DEVICE__ float3 Log2ToLinear(float3 log2) {
    const float r = log2.x > 0.158f ? _expf((log2.x - 0.459732f) / 0.158f) / 30.0f: 0.03125 * log2.x;
    const float g = log2.y > 0.158f ? _expf((log2.y - 0.459732f) / 0.158f) / 30.0f: 0.03125 * log2.y;
    const float b = log2.z > 0.158f ? _expf((log2.z - 0.459732f) / 0.158f) / 30.0f: 0.03125 * log2.z;

    return make_float3(r, g, b);
}

// Tweaked Phantom Log2 to linear
__DEVICE__ float3 Log2aToLinear(float3 log2a) {
    const float r = log2a.x > 0.1593f ? _expf((log2a.x - 0.4609f) / 0.1593f) / 30.0f: 0.03125 * log2a.x;
    const float g = log2a.y > 0.1593f ? _expf((log2a.y - 0.4609f) / 0.1593f) / 30.0f: 0.03125 * log2a.y;
    const float b = log2a.z > 0.1593f ? _expf((log2a.z - 0.4609f) / 0.1593f) / 30.0f: 0.03125 * log2a.z;

    return make_float3(r, g, b);
}

// Apply chosen Log to Linear Transform followed by exposure
__DEVICE__ float3 transform(int p_Width, int p_Height, int p_X, int p_Y, float p_R, float p_G, float p_B)
{
    float3 rgb = make_float3(p_R, p_G, p_B);
    float3 result;

    if (p_SPACE == PLOG1) {
        result = Log1ToLinear(rgb);
    }
    else if (p_SPACE == PLOG2) {
        result = Log2ToLinear(rgb);
    }
    else if (p_SPACE == PLOG2A) {
        result = Log2aToLinear(rgb);
    }

    result = result * pow(2.0, EXPOSURE);

    return result;
}
 
With much thanks to Jimmy's original DCTL, I've made a DCTL that allows you to pick between the two transforms from the log and toe paper plus a tweaked version of the log2 transform.

On the footage I had for testing, the original transform didn't yield a matching linear image to log1, the tweaked version is much closer.

I've also added an exposure slider, footage exposed for what log1 'looks like' is roughly 2 and footage exposed for log2 is around 2.88.

This version only transforms from log to linear, add a CST node after it to go to any desired space:

PhantomColourManagement.png


Code:
// Phantom Input DCTL - Linearise Phantom Log 1 or 2

DEFINE_UI_PARAMS(p_SPACE, Input, DCTLUI_COMBO_BOX, 0, { PLOG1, PLOG2, PLOG2A }, { Phantom Log 1, Phantom Log 2, Alt Phantom Log 2 })
DEFINE_UI_PARAMS(EXPOSURE, Exposure, DCTLUI_SLIDER_FLOAT, 0, -5, 5, 0.001)

// Phantom Log1 to linear
__DEVICE__ float3 Log1ToLinear(float3 log1) {
    const float r = log1.x > 0.182f ? _expf((log1.x - 0.377675f) / 0.182f) / 30.0f: 0.0625f * log1.x;
    const float g = log1.y > 0.182f ? _expf((log1.y - 0.377675f) / 0.182f) / 30.0f: 0.0625f * log1.y;
    const float b = log1.z > 0.182f ? _expf((log1.z - 0.377675f) / 0.182f) / 30.0f: 0.0625f * log1.z;

    return make_float3(r, g, b);
}

// Phantom Log2 to linear
__DEVICE__ float3 Log2ToLinear(float3 log2) {
    const float r = log2.x > 0.158f ? _expf((log2.x - 0.459732f) / 0.158f) / 30.0f: 0.03125 * log2.x;
    const float g = log2.y > 0.158f ? _expf((log2.y - 0.459732f) / 0.158f) / 30.0f: 0.03125 * log2.y;
    const float b = log2.z > 0.158f ? _expf((log2.z - 0.459732f) / 0.158f) / 30.0f: 0.03125 * log2.z;

    return make_float3(r, g, b);
}

// Tweaked Phantom Log2 to linear
__DEVICE__ float3 Log2aToLinear(float3 log2a) {
    const float r = log2a.x > 0.1593f ? _expf((log2a.x - 0.4609f) / 0.1593f) / 30.0f: 0.03125 * log2a.x;
    const float g = log2a.y > 0.1593f ? _expf((log2a.y - 0.4609f) / 0.1593f) / 30.0f: 0.03125 * log2a.y;
    const float b = log2a.z > 0.1593f ? _expf((log2a.z - 0.4609f) / 0.1593f) / 30.0f: 0.03125 * log2a.z;

    return make_float3(r, g, b);
}

// Apply chosen Log to Linear Transform followed by exposure
__DEVICE__ float3 transform(int p_Width, int p_Height, int p_X, int p_Y, float p_R, float p_G, float p_B)
{
    float3 rgb = make_float3(p_R, p_G, p_B);
    float3 result;

    if (p_SPACE == PLOG1) {
        result = Log1ToLinear(rgb);
    }
    else if (p_SPACE == PLOG2) {
        result = Log2ToLinear(rgb);
    }
    else if (p_SPACE == PLOG2A) {
        result = Log2aToLinear(rgb);
    }

    result = result * pow(2.0, EXPOSURE);

    return result;
}
Thanks for sharing, David! I suspect the difference you are seeing is the result of the phantom log being locked into a fixed EL. It's EL 1250 for log1 and EL 2000 for log2. If the ISO setting used during the shoot is different, exposure deviation is expected. The difference between log1 and log2 should be 0.66 stop, which is very close to what you have tested.
 
I think they should match on the the same .cine file decoded using each curve, though?

It’s only a very slight difference in upper shadows and peak.

These waveforms are from the same file, decoded as either Log1 or 2 and passed via LogC/AWG to the old resolve Arri lut. Base exposure would be 320iso equivalent.

Log1 (Base Exposure):
Log1.png

Log2a (Base Exposure):
AltLog2.png

Log2 (Base Exposure):
Log2.png

Log1 (0.66+ Exposure)
Log1+%2B0.66.png
 
Actually I was wrong, the EL is built into the curve so they should be the same. I tested with your DCTL, going from log2 to linear with the 2 stops exposure built in, then applying a linear to log1 transform. It matches pretty closely to the original log1 decoded image. At -0.04 exposures, ie 1.96 stops, you get a perfect match.
 
I've found that color managed projects with DWG intermediate working space have all highlight detail available, but interpreting log1 or 2 and using node color management yields less dynamic range with .cine files.
I'm using RCM still, but using a node for an additional transform. I haven't noticed any detail loss, and the footage is from a. dark environment with wet/shiny ares of bright detail. But I shall definitely look out for this, thanks!
 
Hi everyone, sorry, very new to all this. I'm just an offline editor whose just been handed a load of Phantom .cine files and no transcodes. Can someone please explain very quickly how I can use the DCTL or the code? Appreciate any help I can get. Thanks!
 
Hi everyone, sorry, very new to all this. I'm just an offline editor whose just been handed a load of Phantom .cine files and no transcodes. Can someone please explain very quickly how I can use the DCTL or the code? Appreciate any help I can get. Thanks!

Which application will you be using for the offline editing Resolve, Premiere, FCP X, Avid or other?

Do you know which model Phantom camera the files were recorded with?
 
I'll be cutting in Avid but I was hoping to do the transcodes in Resolve. I think they are 4K Flex files but I-m not 100% sure...

Stuart,

Is it possible you only received the camera originals as the transcodes are on a different drive? Consult with the producer if the camera crew had a DIT or Phantom Tech on set who created the transcodes?

I recommend contacting the camera crew Digital Imaging Tech, 1st AC or Phantom Tech to ask about the specific Phantom camera model used.

Next step is to look at the file metadata in the files to see if the Phantom camera model is listed.

In a non color managed Resolve project under the project settings/camera raw/raw profile (set to Phantom cine) the decode tab options are

Cine default (which should set the gamma to REC 709 for simple offline transcodes)

OR

Camera metadata (will recall whatever the onboard camera metadata was set to)
Start here and compare against Cine Default

OR

Project (allow manually setting the gamma to REC 709, LOG 1, LOG 2)
you don't need to use this option unless you wish to grade in LOG.


Note the timecode setting is a critical parameter as whatever you choose to create the transcodes should also used to re-conform back to the camera originals for the color grading. So make note whatever you choose and provide that setting to the online editor or colorist.

If you are not fully versed or comfortable with the entire Resolve transcoding workflow I suggest outsourcing the work if possible.
 
Last edited:
I would highly recommend transcoding to zero hour timecode, so every clip starts at 00:00:00:00, rather than time zone based timecode. This+reel names from EDLs make for a very seamless Phantom conform in my experience.

If the post house operates on a different time zone than you do, it makes it very difficult to conform when transcodes are done based on time zone timecode.
 
Hey guys, just to add to this, since it seems like there hasn't been much progress with this issue, here's my workaround adapted from this youtube video by ShareGrid:

- Bring the .cine files into Resolve. Create a timeline with your clips.

- Set the Phantom raw settings to Log 2 with the following adjustments:
-> Contrast: -25
-> Highlights: -100
I did this on clip level, video does it on project level. Haven't compared if there is a difference.

- Export your timeline to individual clips, Quicktime ProRes 444 (settings as shown in the video, but I opted for 444 instead of HQ)

- Import the transcoded new .MOVs and put them in a new timeline.

- Now to the weird part that the video doesn't show at all. I used a node-based Color Space Transform workflow:
-> CST in: Rec709/Arri LogC3 to Davinci Wide Gamut/Intermediate
-> CST out: Davinci Wide Gamut/Intermediate to Rec709/Gamma 2.4

- Grade inbetween the CSTs. Everything seems to work fine. Clips behave normally, none of that .cine weirdness. Highlights are all there, crushed contrast gone. Colors seem accurate.

Not an official or necessarily clean workflow, but best results I could achieve with Phantom files so far after scratching my head for a couple of days. It is my first Phantom job however, so take it with a grain of salt and check your results.
 
Back
Top