.cube lut problem

Any other question that don't fit into the other support categorizes.
Post Reply
aganzerli
Posts: 4
Joined: Fri Apr 19, 2019 10:51 am

.cube lut problem

Post by aganzerli » Fri Apr 19, 2019 12:34 pm

hi!
I'm using ffmpeg to convert dpx/exr files to mp4 files.
It seems there's a problem with how ffmpeg compute transformed color values when using .cube lut files, when MAX_DOMAIN is not equal to 1 in the lut file.
In the .cube file specs, MIN_DOMAIN and MAX_DOMAIN refer to input bounds, but it seems that ffmpeg treats them as output bounds.
For example when MAX_DOMAIN = 4, ffmpeg should remap input value in the range [0, 4] to [0, 1] and then perform its lookup, but for now it seems that input value are left unchanged, and output values are remapped to [0, 4], resulting in a super-bright image.
Can anyone help ?
thanks!

richardpl
Posts: 58
Joined: Sat Aug 01, 2015 6:35 pm

Re: .cube lut problem

Post by richardpl » Sat Apr 20, 2019 8:59 am

Could you upload your .cube file somewhere?

aganzerli
Posts: 4
Joined: Fri Apr 19, 2019 10:51 am

Re: .cube lut problem

Post by aganzerli » Mon Apr 22, 2019 5:22 am

hi!
the file is available here:
https://ufile.io/6zqwtvsq

thanks!

richardpl
Posts: 58
Joined: Sat Aug 01, 2015 6:35 pm

Re: .cube lut problem

Post by richardpl » Sun Apr 28, 2019 9:13 am

Should be fixed.

aganzerli
Posts: 4
Joined: Fri Apr 19, 2019 10:51 am

Re: .cube lut problem

Post by aganzerli » Mon Apr 29, 2019 10:41 am

Hello again and thanks for your quick response !
I've tried with the latest nightly, input is now scaled correctly, but seems clamped at some point..
I've uploaded an ACES exr file, a lut, a reference (what it should look like), and ffmpeg current output so that you can see and test yourself.

You can find everything here : https://ufile.io/z4ju36hp

thanks!

richardpl
Posts: 58
Joined: Sat Aug 01, 2015 6:35 pm

Re: .cube lut problem

Post by richardpl » Mon Apr 29, 2019 6:21 pm

This is both EXR decoder (which does not decode to float) and lut3d filter (which does not work with floats) problem, and is caused by whites/blacks being out of [0 - 1] range.

aganzerli
Posts: 4
Joined: Fri Apr 19, 2019 10:51 am

Re: .cube lut problem

Post by aganzerli » Thu May 02, 2019 10:31 am

oh ok I understand, so is there a way to pass a "scale" value to the decoder (let's say 0.25) so that exr/dpx/etc files in the range [0, 4] would be scaled to [0, 1] at decode time ?

h3roProtagonist
Posts: 1
Joined: Mon Dec 09, 2019 4:40 pm

Re: .cube lut problem

Post by h3roProtagonist » Mon Dec 09, 2019 4:54 pm

Hi! I believe I ran into this same problem or something related...

I'm trying to encode an EXR sequence to a Prores422. Since some input values are quite high, I want to apply a LUT to lower the highlights. It works perfectly inside nuke, but the resulting FFmpeg video comes out with clamped values. It looks to me like the LUT is being applied after making the conversion, and not to the Input sequence. There is any way to work around this limitation?

Post Reply
'