Log in

View Full Version : Loading and applying 3D LUTs


Pages : [1] 2

Reel.Deel
2nd April 2016, 19:43
Just wondering how to go about loading and using .cube 3D LUTs in VapourSynth. I would like to use these LUTs here (1 (https://www.groundcontrolcolor.com/free-cinestyle-lut.html) / 2 (https://www.groundcontrolcolor.com/free-gopro-lut.html)), but I'm not sure if this can this be done with std.Lut or is it one-of-those-things that will require a plugin?


Edit - I'm not the author, just posting link here for convenience.
------------------
Timecube, a plugin to load and apply 3D luts to a video:

Sources: https://github.com/sekrit-twc/timecube
Binary: https://github.com/sekrit-twc/timecube/releases

Usage:
timecube.Cube(clip clip, string cube="")

Parameters:
clip = Input clip, colorspace must be RGBS.
cube = Path to 3D lut file, only .cube files are supported.

kolak
2nd April 2016, 20:20
No idea about vs, but you cal always use free Resolve.

Reel.Deel
2nd April 2016, 20:43
No idea about vs, but you cal always use free Resolve.

I have Resolve but I would like to do be able to do it in VapourSynth. For me VS would be a bit more straight forward and would not require any intermediate files since I can easily pipe to x264/x265.

Myrsloik
2nd April 2016, 20:59
You'll need a new plugin for that. Is there format actually documented somewhere?

Reel.Deel
2nd April 2016, 21:04
You'll need a new plugin for that. Is there format actually documented somewhere?

Adobe's Cube LUT Specification.pdf (http://wwwimages.adobe.com/content/dam/Adobe/en/products/speedgrade/cc/pdfs/cube-lut-specification-1.0.pdf)

Myrsloik
2nd April 2016, 21:19
Adobe's Cube LUT Specification.pdf (http://wwwimages.adobe.com/content/dam/Adobe/en/products/speedgrade/cc/pdfs/cube-lut-specification-1.0.pdf)

Looks surprisingly simple, especially since there's sample code for reading the files is in there too. Maybe I'll have a go at it some day but probably not soon.

Reel.Deel
7th April 2016, 13:56
Looks surprisingly simple, especially since there's sample code for reading the files is in there too. Maybe I'll have a go at it some day but probably not soon.

Good to hear that it looks simple. Hopefully we'll see this integrated into VS sometime. Thanks for the feedback.

Joachim Buambeki
28th April 2017, 23:24
Have there been any news on this? Having 3Dluts would be great for professional workflows where you want to apply certain looks to your ungraded footage.

TIA!

lansing
13th May 2017, 02:41
any update on this?

Myrsloik
24th May 2017, 00:15
any update on this?

Nope, too much other stuff to do.

Revgen
29th May 2017, 06:59
I currently use FFMPEG's 3DLut filter for .cube files. It's not as convenient as having a Vapoursynth/Avisynth plugin, but it's more flexible than Davinci Resolve. Resolve doesn't support efficient lossless codecs (FFV1, X264 lossless, UTVideo, etc), avisynth input, or piping VapourSynth scripts.

Myrsloik
29th May 2017, 12:52
Why didn't anyone tell me there's code I can borrow? Maybe I'll actually do something about this after I release R38

Myrsloik
29th May 2017, 19:17
If you can provide some before/after clips with a lut applied (and the lut file) so we can easily test a plugin that'd be great. Or this is not going to happen...

lansing
30th May 2017, 03:53
Here's my image before/after of a lut, lut file included

lut sample (http://www.mediafire.com/file/98or62viri479ob/lut_sample.7z)

lansing
9th June 2017, 04:03
PLUGIN (https://www.dropbox.com/s/shk9lbzo432b7a8/timecube_r0.7z?dl=0)

I got an error "Cube: must be RGBS" after I converted the clip to RGB

Revgen
9th June 2017, 08:12
I don't know how to use the vscube plugin. Any pointers would be appreciated.

Revgen
9th June 2017, 09:07
I'm also receiving the "Cube: must be RGBS" error. The .cube file works fine with FFMPEG.

UPDATE:

Okay. It works now. Thank you.

lansing
9th June 2017, 14:08
I got an error "Resize error 3074: no path between colorspaces", what does it means?

sneaker_ger
9th June 2017, 14:46
Read posts #2491 to #2495.

TheFluff
9th June 2017, 18:22
link (https://forum.doom9.org/showthread.php?p=1802859#post1802859) for convenience

lansing
9th June 2017, 19:33
I'm getting tiny dot artifacts along the lines on my anime


rgb_clip = core.resize.Bicubic(source, matrix_in_s="709", format=vs.RGBS)
cc = core.timecube.Cube(rgb_clip, cube=r"test.cube")


sample (http://www.mediafire.com/file/czje0509srzr296/lut_video_sample.7z)

dipje
9th June 2017, 21:04
....or piping VapourSynth scripts.



Although I'm loving the work on a plugin of these, just wanted you to know that you can pipe YUV 4:2:2 10bit and RGB 10bit into Davinci Resolve by using AVFS (RGB 10bit into AVFS / VfW was done pretty recently, thanks again Myrsloik!)

lansing
10th June 2017, 00:16
FIXED (https://www.dropbox.com/s/3y4z1f67e863d95/timecube_r0.1.7z?dl=0)

Thanks, it works good now

bin.n2f
10th June 2017, 02:13
how to control this plugin , the image output is blueish
is there any documentation ?

Revgen
10th June 2017, 07:28
Although I'm loving the work on a plugin of these, just wanted you to know that you can pipe YUV 4:2:2 10bit and RGB 10bit into Davinci Resolve by using AVFS (RGB 10bit into AVFS / VfW was done pretty recently, thanks again Myrsloik!)

AVFS has always been funky for me, so I never thought to try it with Resolve. I'll go that route if I ever have the need to try Resolve again.

Reel.Deel
10th June 2017, 14:55
@Stephen R. Savage

Thanks! Any possibility of adding avs+ support?

lansing
7th August 2017, 14:21
The update doesn't apply to 64 bit version, I'm still getting "Cube: must be RGBS" error when my source is RGB24.

Stephen R. Savage
14th January 2018, 05:45
I found a bug. Fixed build (https://github.com/sekrit-twc/timecube/releases/download/r1/timecube_r1.7z).

poisondeathray
15th January 2018, 04:21
I found a bug. Fixed build (https://github.com/sekrit-twc/timecube/releases/download/r1/timecube_r1.7z).


This crashes vsedit and vdfm for me. In case there were issues with my LUT's , lansing's video sample and cube lut in post#21 crash as well . In case it was some issues with mod16, I resized and tested mod16 still crash

vdfm crash details (short)

An instruction not supported by the CPU was executed at 7ffb07bb817c.


This was on a Haswell with AVX2 only, or I might be completely off base and it might be related to seomthing else

poisondeathray
15th January 2018, 07:15
I fixed it for real this time.

Yes you did... working now :) Thanks

Yanak
23rd March 2018, 16:39
Hello,

Will it be hard/ difficult or even possible to port the plugin into avisynth ?

This is something that will be really useful, if it doesn't take too much efforts or a complete rewrite of course

Thank you.

Selur
10th May 2018, 06:04
Is this on GitHub somewhere and can it be build of Linux and Mac too?

poisondeathray
10th May 2018, 06:13
Is this on GitHub somewhere and can it be build of Linux and Mac too?

https://github.com/sekrit-twc/timecube/

I don't know about linux / mac

Richard1485
3rd June 2018, 13:46
Will it be hard/ difficult or even possible to port the plugin into avisynth?

This is something that will be really useful, if it doesn't take too much efforts or a complete rewrite of course


Yes, a version for AviSynth (or AviSynth+) would be most useful.

lansing
3rd June 2018, 16:23
Yes, a version for AviSynth (or AviSynth+) would be most useful.

You can't, avisynth doesn't support rgbs format

poisondeathray
3rd June 2018, 16:55
You can't, avisynth doesn't support rgbs format

AVS+ does, as "RGBPS"
http://avisynth.nl/index.php/Avisynthplus_color_formats

And you don't *need* RGBS for this LUT application. It will work with other RGB formats, e.g. RGB30, RGB48, even regular RGB24

Richard1485
3rd June 2018, 18:08
^ It should be theoretically possible then. :)

poisondeathray
3rd June 2018, 18:11
^ It should be theoretically possible then. :)

Yes; for example, ffmpeg already has a lut filter for a long time and it works with RGB24 and RGB48 (but ffmpeg does not support float or RGBS)

But neither avs+, or ffmpeg can export a RGBH/RGBS float format into actual physical files. Only vapoursynth currently can (with the imagemagick plugin). Maybe someday avs+ will get an updated IM plugin too... (I should add there are other free/open source tools that fully support import/export of float formats, such natron, but they aren't discussed here often)

Richard1485
3rd June 2018, 21:39
Yeah, I use ffmpeg to apply LUTs when I have to, usually rendering to lossless AVI. Of course, you can pipe straight to an encoder, but I prefer to check the video at each stage so I can keep track of what is going on. Being able to do everything in AviSynth(+) would be a big advantage.

poisondeathray
3rd June 2018, 22:30
Yeah, I use ffmpeg to apply LUTs when I have to, usually rendering to lossless AVI. Of course, you can pipe straight to an encoder, but I prefer to check the video at each stage so I can keep track of what is going on. Being able to do everything in AviSynth(+) would be a big advantage.

Yes, it would be nice to use in avs+ , but what is stopping you from using vapoursynth , today ? Add another tool for the toolbelt. Vapoursynth editor can preview all the different pixel types from a vpy script. It's similar to avspmod. (Or vdub2, or mpv if you prefer) .

Richard1485
3rd June 2018, 23:05
I've tinkered with VapourSynth a bit. It's just that I'd end up going back to AviSynth for various reasons (audio work, use of DGIndexNV, familiarity, etc), most of which I've no doubt whatsoever are surmountable. I guess I just don't like going back and forth between tools if I can avoid it. Hell, I'd order my shopping by writing an AviSynth script if it were possible.☺ Anyway, I'll try to stop hijacking threads.

Selur
4th June 2018, 19:46
as a side note to that: DGIndexNV works fine with Vapoursynth, using it for month,...

Richard1485
5th June 2018, 11:01
A month? I thought that there was some issue getting it to work with VapourSynth. Thanks for letting me know: I'll check it out.

Stephen R. Savage
30th August 2018, 03:11
timecube r2 pre-release version: link (https://github.com/sekrit-twc/timecube/releases/download/r2/timecube_r2.7z)

Key changes:

Developer API for Cube processing
Fixed processing of limited range
Option to use different output format than source
AVX-512 mode for up to 33% speedup
Minor optimization in other modes (2-3%)

groucho86
25th August 2019, 19:47
If someone could figure out the necessary configure/make files to compile timecube on Mac/Linux it would be much appreciated.

Are_
26th August 2019, 00:57
Timecube already has a makefile in its repo. What problem is it giving to you?

groucho86
26th August 2019, 03:04
Once I cd into the root folder of timecube-r2a and run make, I get the following error:
c++ -c -o vscube/vscube.o vscube/vscube.cpp
vscube/vscube.cpp:6:10: fatal error: 'timecube.h' file not found
#include "timecube.h"
^~~~~~~~~~~~
1 error generated.
make: *** [vscube/vscube.o] Error 1

I'm used to running an ./autogen.sh and ./configure before running make. I tried repurposing those from other plugin sources but was unsuccessful.

Are_
26th August 2019, 16:00
timecube repo has a submodule, you need to fetch it with:
git clone --recursive https://github.com/sekrit-twc/timecube.git

groucho86
26th August 2019, 17:21
timecube repo has a submodule, you need to fetch it with:
git clone --recursive https://github.com/sekrit-twc/timecube.git


That worked, thank you _Are!

ASVTut
16th December 2019, 02:26
I hope this isn't too off-topic, but why does the Timecube Readme have the "You are Educated Evil" thing? Is it an in-joke about LUTs? At first, I thought the repo was hacked.