Encode mov from exr [linear>logC>rec709]

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Encode mov from exr [linear>logC>rec709]

Clement Poulain
Hey guys,

I am working with an exr image sequence (colorspace: linear)
I have a lut file to go from AlexaV3LogC to rec709.
Obviously to do the encoding i need to change the colorspace first.
I can't use apply_trc flag as AlexaV3LogC is different from ffmpeg logC
colorspace.

To counter that in Nuke i used a Expression node with this value in every
channels (channel r example):
*r>0.0106232?(log10((r + 0.00937677) / 0.18)*0.2471896) +
0.385537:(((r+0.00937677) / 0.18) + 0.04378604) * 0.9661776*

Which is the same than using a OCIOColorSpace node with in=linear and
out=AlexaV3LogC

As i want to do that with ffmpeg, i updated those expressions with ffmpeg
convention:
*"lutrgb=r='if(gt(val, 0.0106232), log((val + 0.00937677) /
0.18)/log(10)*0.2471896 + 0.385537, (((val + 0.00937677) / 0.18) +
0.04378604) * 0.9661776)':g='if(gt(val, 0.0106232), log((val + 0.00937677)
/ 0.18)/log(10)*0.2471896 + 0.385537, (((val + 0.00937677) / 0.18) +
0.04378604) * 0.9661776)':b='if(gt(val, 0.0106232), log((val + 0.00937677)
/ 0.18)/log(10)*0.2471896 + 0.385537, (((val + 0.00937677) / 0.18) +
0.04378604) * 0.9661776)'"*

Theoretically, and double checked in a python shell:
for a val=0.2 val will be 0.40..
for a val=0.01 val will be 0.14..

But it seems that I can't use the log(x) function in lutrgb.
I get black frames with no data: every pixel [0,0,0]

By removing all log(x) functions, obviously the values are wrong, but I can
see my images..
And I don't have any error message.

Did someone already use log(x) function in lutrgb?
Is there a clever way to do it?
Any help is welcome.

Thank you.
Clement
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Encode mov from exr [linear>logC>rec709]

Paul B Mahol
On 2/22/19, Clement Poulain <[hidden email]> wrote:
> Hey guys,
>
> I am working with an exr image sequence (colorspace: linear)
> I have a lut file to go from AlexaV3LogC to rec709.

Could use lut1d filter, if you have .cube 1D LUT file.

> Obviously to do the encoding i need to change the colorspace first.
> I can't use apply_trc flag as AlexaV3LogC is different from ffmpeg logC
> colorspace.
>
> To counter that in Nuke i used a Expression node with this value in every
> channels (channel r example):
> *r>0.0106232?(log10((r + 0.00937677) / 0.18)*0.2471896) +
> 0.385537:(((r+0.00937677) / 0.18) + 0.04378604) * 0.9661776*
>
> Which is the same than using a OCIOColorSpace node with in=linear and
> out=AlexaV3LogC
>
> As i want to do that with ffmpeg, i updated those expressions with ffmpeg
> convention:
> *"lutrgb=r='if(gt(val, 0.0106232), log((val + 0.00937677) /
> 0.18)/log(10)*0.2471896 + 0.385537, (((val + 0.00937677) / 0.18) +
> 0.04378604) * 0.9661776)':g='if(gt(val, 0.0106232), log((val + 0.00937677)
> / 0.18)/log(10)*0.2471896 + 0.385537, (((val + 0.00937677) / 0.18) +
> 0.04378604) * 0.9661776)':b='if(gt(val, 0.0106232), log((val + 0.00937677)
> / 0.18)/log(10)*0.2471896 + 0.385537, (((val + 0.00937677) / 0.18) +
> 0.04378604) * 0.9661776)'"*
>
> Theoretically, and double checked in a python shell:
> for a val=0.2 val will be 0.40..
> for a val=0.01 val will be 0.14..
>
> But it seems that I can't use the log(x) function in lutrgb.
> I get black frames with no data: every pixel [0,0,0]
>
> By removing all log(x) functions, obviously the values are wrong, but I can
> see my images..
> And I don't have any error message.
>
> Did someone already use log(x) function in lutrgb?
> Is there a clever way to do it?

Pixel values are in range 0-255 not 0-1.
At least only integer pixels are supported by lutrgb filter.

> Any help is welcome.
>
> Thank you.
> Clement
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Encode mov from exr [linear>logC>rec709]

Gonzalo Garramuño-2
In reply to this post by Clement Poulain
On 2/22/19, Clement Poulain <[hidden email]> wrote:> Hey guys,>> I am working with an exr image sequence (colorspace: linear)> I have a lut file to go from AlexaV3LogC to rec709.Could use lut1d filter, ihf you have .cube 1D LUT file.> Obviously to do the encoding i need to change the colorspace first.> I can't use apply_trc flag as AlexaV3LogC is different from ffmpeg logC> colorspace.>> To counter that in Nuke i used a Expression node with this value in every> channels (channel r example):> *r>0.0106232?(log10((r + 0.00937677) / 0.18)*0.2471896) +> 0.385537:(((r+0.00937677) / 0.18) + 0.04378604) * 0.9661776*>> Which is the same than using a OCIOColorSpace node with in=linear and> out=AlexaV3LogC>You should not use ffmpeg for this.  Use oiiotool which is part of the openimageio project.  My viewer ships with a precompiled version of it and also supports OCIO. You can find my viewer at:http://www.sourceforge.net/projects/mrviewer _______________________________________________> ffmpeg-user mailing list> [hidden email]> https://ffmpeg.org/mailman/listinfo/ffmpeg-user>> To unsubscribe, visit link above, or email> [hidden email] with subject "unsubscribe"._______________________________________________ffmpeg-user mailing [hidden email]://ffmpeg.org/mailman/listinfo/ffmpeg-userTo unsubscribe, visit link above, or [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".