Page 1 of 2

Using a LUT (.cube) via workflow

Posted: Fri Mar 15, 2019 5:52 pm
by FranceBB
Hi,
I'm getting some Slog3 and C-Log videos and I'd like to apply a LUT to bring them to the standard linear curve with BT709.
I made a custom Avisynth Script like so:

Code: Select all

# Variables:
#
# m_clip		= The last returned AviSynth media
#
# Do NOT change any of the following variables!!!
# _ffas_video 	= <original video>
# _ffas_audio	= <original audio>
# _ffas_height	= <source height>
# _ffas_width	= <source width>
# _m_clip_a_channels = <total channels>
# _ffas_work_fdr	= Working folder for the workflow
#
LoadPlugin("C:\encoder\encoder\Processors\avs_plugins\LUTs\vscube.dll")


c=Converttoyv24(m_clip)
hbd=ConvertBits(c, bits=16)
plrgb=ConvertToPlanarRGB(hbd)
m_clip=Cube(plrgb, "C:\encoder\encoder\Processors\avs_plugins\LUTs\Slog3_Avisynth.cube")

# The following MUST be the last line of your script
Return m_clip

Then I go back to my usual workflow which includes Clipping Luma and Chroma to Limited TV Range, however I can't manage to make it work.
Since ffmpeg is actually able to use a LUT as well, I think it would be useful to create a Node called "LUT" that goes through ffmpeg and simply adds the "-vf lut3d=" command and then pipes the output to whatever.

Image


You can find the Cube filter for avisynth here, instead: forum.doom9.org/showthread.php?t=175552

By making LUTs available, it would be useful for HLG / PQ as well.

Thank you in advance,
Frank.

Re: Using a LUT (.cube) via workflow

Posted: Sun Mar 24, 2019 1:34 pm
by emcodem
Hey Frank,

this sounds more like it fits to the feature request section as you already know how to apply the lut using ffmpeg. In tje meantime, this might help;
viewtopic.php?f=5&t=849#p3641

cheers, emcodem

Re: Using a LUT (.cube) via workflow

Posted: Wed May 08, 2019 7:10 am
by FranceBB
For the records, I managed to get it to work by compiling vscube myself and it works perfectly fine with 16bit precision calculations.
As to the LUTs, I created them and I shared them here on Doom9: https://forum.doom9.org/showthread.php?p=1873351

- PQ to BT709 SDR
- HLG to BT709 SDR
- PQ to HDR HLG
- Slog3 to BT709 SDR
- Clog3 to BT709 SDR
- Clog3 to PQ
- Clog3 to HLG
- BT709 SDR to PQ
- BT709 SDR to HLG

Feel free to download and use them. ;)

Re: Using a LUT (.cube) via workflow

Posted: Wed May 08, 2019 9:06 am
by momocampo
Hello Franck,

Thanks a lot for this! It will be useful for sure.
I wonder if you work on Sony Slog 2? I must admit it will be useful for me :)
Thanks again.
Cheers.

Benjamin

Re: Using a LUT (.cube) via workflow

Posted: Wed May 08, 2019 12:07 pm
by FranceBB
momocampo wrote: Wed May 08, 2019 9:06 am Hello Franck,

Thanks a lot for this! It will be useful for sure.
I wonder if you work on Sony Slog 2? I must admit it will be useful for me :)
Thanks again.
Cheers.

Benjamin
I don't use Slog2 anymore, but I do have some old contents shot using that curve.
I guess I can try to make a new LUT for it as well when I have time.
You need from Slog2 to BT709 SDR, right?

Re: Using a LUT (.cube) via workflow

Posted: Wed May 08, 2019 6:32 pm
by momocampo
Hello,
Very kind from you.
And yes, it's Slog 2 to rec 709.
Thanks ;)

Benjamin

Re: Using a LUT (.cube) via workflow

Posted: Fri May 10, 2019 9:19 am
by FranceBB
momocampo wrote: Wed May 08, 2019 6:32 pm Hello,
Very kind from you.
And yes, it's Slog 2 to rec 709.
Thanks ;)

Benjamin
It's almost ready.
https://forum.doom9.org/showthread.php? ... ost1874078
Next week I'm gonna make the final tweaks and I'm gonna upload it.

Re: Using a LUT (.cube) via workflow

Posted: Fri May 10, 2019 11:51 am
by momocampo
Hi,
Great!! It's really kind to create this lut for me, I appreciate.
Thanks you very much.
Cheers.

Benjamin

Re: Using a LUT (.cube) via workflow

Posted: Tue May 14, 2019 1:41 pm
by FranceBB
LUT uploaded. Let me know if it works for you. ;)

Re: Using a LUT (.cube) via workflow

Posted: Tue May 14, 2019 3:15 pm
by momocampo
Hello FranceBB,
Well I took it , thank you.
I must find how to test it with my slog2.
Can you help me to tell me where I can find avs plug in ? (vscube.dll into your avisynth script)
Thanks again.

Cheers.
Benjamin