LG V30 Cine Log LUT support

The LG V30 phone can record video in LG-Cine Log format. The colors are distorted/broken and must be fixed with their official LUTs (they support Premiere, Baselight and Resolve). The LUTs are not compatible with Shotcut, I don’t get original colors like in Davinci Resolve.

There is no other video editor on Linux that is compatible with LG LUTs (I get broken colors). So I was forced to install dual boot Windows just for Davinci Resolve.

Download video samples the the LUTs

Is it possible to make LG V30 LUTs work in Shotcut?

P.S. LG-Cine Log white paper and manual LG-Cine_USER_MANUAL_GL.zip (1.3 MB)

Is the LG LUT in .cube format?
Da Vinci will let you create LUTs.

Have you tried importing the LG LUT into Da Vinci and then exporting as a .CUBE shotcut compatible LUT?

The archive in the download link contains these LUTs

LG-Cine Log LUTs/
├── for Adobe Premiere CC
│   ├── LG-Cine Log_to_P3DCI_tonemapped.cube
│   ├── LG-Cine Log_to_Rec709 2.4gamma_tonemapped.cube
│   └── LG-Cine Log_to_V30 display.cube
├── for Baselight
│   └── LG_CineLog.flspace
└── for Davinci Resolve
    ├── LG-Cine Log_to_ACES2065-1.cube
    ├── LG-Cine Log_to_ACES2065-1.dctl
    ├── LG-Cine Log_to_P3DCI.cube
    ├── LG-Cine Log_to_P3DCI.dctl
    ├── LG-Cine Log_to_P3DCI_tonemapped.cube
    ├── LG-Cine Log_to_Rec709 2.4gamma.cube
    ├── LG-Cine Log_to_Rec709 2.4gamma.dctl
    ├── LG-Cine Log_to_Rec709 2.4gamma_tonemapped.cube
    └── LG-Cine Log_to_V30 display.cube

3 directories, 13 files

None of them work in Shotcut. So I think the problem is in algorithm/encoding specific to video editor, not in file format (.cube).

Anyway I will try to export from Davinci.

Could be the decimal point/ comma bug playing up.
See this thread:

I have also attached the transforms and constants used in the LG LUT in a txt file.
May be of some help.

LG-Cine Log_to_Rec709 2.4gamma.txt (2.4 KB)

Keep in mind that its for a gamma of 2.4

Another thing to note, 3D LUTS have a 17X17X17, 33X33X33 or (I think) 65X65X65 matrix.
Don’t know if shotcut/ffmpeg supports them all.

1 Like

Latest ffmpeg have both those issues fixed: locale and size, size is now max allowed by cube format.

You will need to wait for a new Shotcut release after the next FFmpeg release to get the support for the expanded matrix size in lut3d. I cannot tell you when that will be, but I suspect within a few months.

1 Like

That is great news!
Please mention the fix in changelog (I will check it from time to time).


For now, is there any way to test if the problem is really fixed? (I am not an advanced ffmpeg user)

I tried to run ffmpeg 4.2.2 but I get error:

./ffmpeg -i Sample\ 1\ -\ LG\ Cine\ Log.mp4 -vf lut3d="LG-Cine Log_to_V30 display.cube" output.mp4

...

Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Sample 1 - LG Cine Log.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2019-11-30T12:06:26.000000Z
    com.android.version: 9
  Duration: 00:00:10.16, start: 0.000000, bitrate: 54758 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, smpte170m), 3840x2160, 52152 kb/s, SAR 1:1 DAR 16:9, 24.01 fps, 24 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      creation_time   : 2019-11-30T12:06:26.000000Z
      handler_name    : VideoHandle
    Stream #0:1(eng): Audio: pcm_s24be (in24 / 0x34326E69), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      creation_time   : 2019-11-30T12:06:26.000000Z
      handler_name    : SoundHandle
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (pcm_s24be (native) -> aac (native))
Press [q] to stop, [?] for help
[AVFilterGraph @ 0x56946c0] Error initializing filter 'lut3d' with args 'LG-Cine Log_to_V30 display.cube'
Error reinitializing filters!
Failed to inject frame into filter network: Invalid data found when processing input
Error while processing the decoded data for stream #0:0
[aac @ 0x56953c0] Qavg: 54395.711
[aac @ 0x56953c0] 2 frames left in the queue on closing
Conversion failed!

I will, of course, mention when FFmpeg is upgraded, but I will not remember this particular topic because an ffmpeg upgrade does not directly address it.

4.2.2 is not ffmpeg master version.

I tried “git master: built on 20200208” and still get the same error

I do not get any error. But note that your cube files have extended output range which is not possible to be stored in fixed integer pixel formats, like rgb24. Instead you need float pixel format support in both shotcut and lut3d filter.

With my LUTs and Cine Log samples (uploaded above) ?
Can you share the command you used? (I have no idea about float pixel format and what parameters should I use in ffmpeg)

ffmpeg -i Sample\ 1\ -\ Auto\ Mode.mp4 -vf lut3d=“for Adobe Premiere CC/LG-Cine Log_to_V30 display.cube” -f null -

Thanks.

I was getting error with for Davinci Resolve/LG-Cine Log_to_V30 display.cube

Anyway I get broken colors (same as in Shotcut).

Sample 1 - Auto Mode.mp4 is just for reference, how the colors look in reality. The videos that needs to be fixed/converted is *LG Cine Log.mp4

With for Adobe Premiere CC/LG-Cine Log_to_V30 display.cube it doesn’t throw error but this is the broken result

ffmpeg version N-51670-g3b860bfd6f-static https://johnvansickle.com/ffmpeg/

exactly the same result with ffmpeg version 4.2.2

I found LG-Cine Log white paper and manual.

LG-Cine_USER_MANUAL_GL.zip (1.3 MB)

If you closely inspect .cube files, their domain min/max are not 0/1 thus this black output.
And they are really supposed to work with float pixel formats, and not integer ones.

Sorry but I don’t know what to do with this info.

Should I try manually different -pix_fmt until I guess the right one?

Is it possible to successfully apply LUT on *LG Cine Log.mp4 with ffmpeg (so it will look almost identical to *Auto Mode.mp4) or it is much more complicated and needs careful debugging to check if LG-Cine Log videos and LUTs are compatible with ffmpeg?


At this point I understood that Shotcut will include in next update the latest ffmpeg. But if this will fix my LUT problem is still unknown (as I was unable to apply successfully the LUT yet).

Not possible, as shotcut does not really work with float pixel formats AFAIK.
Also lut3d filter would need to be updated to work with rgb float pixel formats.

After further inspection, we are saying these LUTs are currently incompatible. It is unlikely they will compatible anytime soon in Shotcut - possibly in FFmpeg, but I cannot speak for it. Maybe someone else has LUTs for integer image formats.

1 Like