Load Cube (3DLUT files) fails with Invalid file

Started by Cacho, February 06, 2024, 02:00:39 AM

Previous topic - Next topic

Cacho

I have an OM-1 camera, and took a video with a flat profile. I have the 3D LUT files for my camera, that I downloaded from the company site.

When I try to load the .cube file with avidemux via

    Filters > Colors > 3D Lut > Load Cube

I get an error:

    Load failed: invalid file.

This is the format of the .cube file:

LUT_3D_SIZE 33

0.000000 0.000000 0.000000
0.053071 0.002243 0.002777
0.111055 0.005081 0.006271
0.150546 0.007065 0.008820
0.197253 0.008896 0.011322
0.240299 0.010163 0.013214
...

I am able to apply this .cube file with ffmpeg with this command:

    ffmpeg -i <inputfile.mov> -vf lut3d='OMSYSTEM_OM-Log400_BT2020_to_WDR_BT709_v10.cube' <outputfile.mp4>

getting a beautiful video file.

What am I doing wrong?

Sorry if this was asked before, but I was unable to find the answer.

szlldm

The issue caused by the cube file containing DOS/Windows newlines. This case should be already handled, but something is obviously wrong. Until it gets fixed in Avidemux, you can temporarily create a working cube file with
cat your-3dlut-file.cube | tr -d '\015' > temp.cube(this converts all DOS/Windows newlines to Unix newlines)

eumagga0x2a

A new appImage containing the code change by szlldm that allows 3D LUT video filter in Avidemux to handle .cube files with DOS line endings is available on the server.