Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th August 2018, 17:22   #21  |  Link
videoh
Registered User
 
Join Date: Jul 2014
Posts: 758
I have vscube ported to Avisynth+ and have successfully applied a 3D LUT using an Avisynth+ script. I have to properly implement the parameters and test thoroughly before I can give it to y'all. Meanwhile, I have a few questions:

1. In Vapoursynth, this gives me a red clip:

clip = core.std.BlankClip(width=640,height=480,format=vs.RGB24, length=1000, keep=True, color=[255, 0, 0])

but this gives me a black clip:

clip = core.std.BlankClip(width=640,height=480,format=vs.RGB48, length=1000, keep=True, color=[255, 0, 0])

So is it a bug or am I missing something?

2. Can anyone give me a HDR10 PQ->SDR 3D LUT that I can test with?

Thank you.
videoh is offline   Reply With Quote
Old 15th August 2018, 17:27   #22  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,828
Quote:
Originally Posted by videoh View Post

1. In Vapoursynth, this gives me a red clip:

clip = core.std.BlankClip(width=640,height=480,format=vs.RGB24, length=1000, keep=True, color=[255, 0, 0])

but this gives me a black clip:

clip = core.std.BlankClip(width=640,height=480,format=vs.RGB48, length=1000, keep=True, color=[255, 0, 0])

So is it a bug or am I missing something?
In 16bit, 100% red would be 65535
poisondeathray is offline   Reply With Quote
Old 15th August 2018, 17:35   #23  |  Link
videoh
Registered User
 
Join Date: Jul 2014
Posts: 758
Duh, thank you, poisondeathray!
videoh is offline   Reply With Quote
Old 16th August 2018, 01:32   #24  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,955
Quote:
In 16bit, 100% red would be 65535
Yep, that is a little bit of a nasty, its pretty horrible that one has to cater to differing ranges dependant upon
bit depth, cant suggest anything better, but is still horrible.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 16th August 2018 at 01:42.
StainlessS is offline   Reply With Quote
Old 16th August 2018, 02:55   #25  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 5,722
Quote:
Originally Posted by videoh View Post
2. Can anyone give me a HDR10 PQ->SDR 3D LUT that I can test with?
https://displaycal.net

you can create 3D lut from what ever source profile with what ever target nit you want with this tool.
huhn is offline   Reply With Quote
Old 16th August 2018, 06:22   #26  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,181
DaVinci Resolve 15 (including free version) has a series of HDR ST 2084 (300 - 4000 nits) <-> Gamma (2.4, 2.6, 2.8) conversion LUT's (cube). I've not tested any of them outside of Resolve though.

With the program installed, the folder location is C:\ProgramData\Blackmagic Design\DaVinci Resolve\Support\LUT\HDR ST 2084.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 16th August 2018 at 06:27.
WorBry is offline   Reply With Quote
Old 16th August 2018, 08:57   #27  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 1,784
Quote:
Originally Posted by StainlessS View Post
Yep, that is a little bit of a nasty, its pretty horrible that one has to cater to differing ranges dependant upon
bit depth, cant suggest anything better, but is still horrible.
One solution is to allow a different way of specifying colour like fcolor={1.0, 0.0, 0.0}
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 16th August 2018, 11:23   #28  |  Link
videoh
Registered User
 
Join Date: Jul 2014
Posts: 758
Quote:
Originally Posted by WorBry View Post
DaVinci Resolve 15 (including free version) has a series of HDR ST 2084 (300 - 4000 nits) <-> Gamma (2.4, 2.6, 2.8) conversion LUT's (cube). I've not tested any of them outside of Resolve though.

With the program installed, the folder location is C:\ProgramData\Blackmagic Design\DaVinci Resolve\Support\LUT\HDR ST 2084.
That's great, WorBry, thank you!
videoh is offline   Reply With Quote
Old 16th August 2018, 15:49   #29  |  Link
videoh
Registered User
 
Join Date: Jul 2014
Posts: 758
Here is a test version of 3D LUT support for Avisynth+. I will provide source code when it is tested OK. Please refer to the user document for usage details. Your feedback will be appreciated.

http://rationalqm.us/misc/avscube_1.0.rar
videoh is offline   Reply With Quote
Old 17th August 2018, 03:11   #30  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,181
Done a few quick tests - applied a few color grade 3D cube LUT's (created in Resolve) with avscube to some (linear) Rec709 HD test footage and greyscale ramps - and it looks to be working as expected. Excellent.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 17th August 2018 at 04:11.
WorBry is offline   Reply With Quote
Old 17th August 2018, 13:59   #31  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Germany
Posts: 620
It works as expected.
By the way, you wrote to use avsresize to convert to RGB 16bit, but you can convert without using it like so:

Code:
video3=DGDecode_MPEG2Source("I:\Production\RAW\424-430\427.d2v")
audio3=FFAudioSource("I:\Production\RAW\424-430\427 T81 2_0ch 224Kbps DELAY -134ms.ac3")
AudioDub(video3, audio3)

tfm(mode=1,pp=5,slow=2,micmatching=2,clip2=tdeint(mode=2,type=3)) 
tdecimate()
ConvertFPS(23.976)

trim(0, 500)

Crop(4, 0, -4, -0)

Spline64Resize(848, 480)

ConvertBits(16)

ConvertToPlanarRGB()

Cube("BT601_to_BT709.cube")

Converttoyuv420()
I tested it with a simple BT601 to BT709.
I don't really do BT601 to BT709 conversion using a LUT 'cause I generally use ColorMatrix for 8bit and Dither_Tools for 16bit, but in order to test your new plugin, I did and it was fine.

Thank you very much indeed.
__________________
Broadcast Encoder
LinkedIn
FranceBB is offline   Reply With Quote
Old 17th August 2018, 18:23   #32  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,181
Quick question for ye high bit-depth AVS processing experts (me not being one).

I have some 10-bit 422 DNxHD.mov clips with 'full range' (0-1023 in 10-bit) luma. I want to test a 3D LUT.cube (created with DaVinci Resolve) that applies a 'soft clip' i.e. clips 'Full' to 'Limited' range (64 - 940) but with a soft roll-off - offers an alternative to 'hard-clipping' (clamping) or compression when constraining full range material to 'broadcast safe' range.

Came up with this basic script, but I'm not sure what 'colorspace_op' string expressions to apply in z_ConvertFormat so that 'Full' (PC.709) range coefficients are applied in the conversion to RGBP16 and then 'Limited' (Rec.709) range coefficients are applied in the output conversion to YV16:

Code:
LSMASHVideoSource("{Path}:\Test_DNxHD_10bit_422_Full_Range.mov", format="YUV422P10")
ConvertFromDoubleWidth(bits=10)
z_ConvertFormat(pixel_type="RGBP16",colorspace_op ="?????")
Cube("{Path}:\Soft_Clip_64_940_20.cube")
z_ConvertFormat(pixel_type="YV16",colorspace_op ="?????")
Could anyone point me to a reference that gives a full description of the 'colorspace_op' parameter terms and definitions.

Thanks.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 17th August 2018 at 18:56.
WorBry is offline   Reply With Quote
Old 17th August 2018, 19:13   #33  |  Link
videoh
Registered User
 
Join Date: Jul 2014
Posts: 758
https://forum.doom9.org/showthread.p...47#post1784247

One thing I am not clear on is whether the 3D LUT expects linear RGB. If so, then maybe something like:

z_ConvertFormat(pixel_type="RGBP16",colorspace_op="709:709:709:l=>rgb:linear:709:f")
Cube("{Path}:\Soft_Clip_64_940_20.cube")
z_ConvertFormat(pixel_type="YV16",colorspace_op="rgb:linear:709:f=>709:709:709:l")

But the cube name suggests it is for limited range, so wouldn't you want to keep it limited and set fullrange=false for Cube()? Just a thought, I'm probably more clueless than you about this stuff.

Thanks, guys, for your testing and feedback.

Last edited by videoh; 17th August 2018 at 19:15.
videoh is offline   Reply With Quote
Old 17th August 2018, 20:37   #34  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,181
Thanks for reference link. It's clear now. Works as expected. Example:
Code:
LSMASHVideoSource("{Path}:\GSRamp_DNxHD_10bit_422_Full_Range.mov", format="YUV422P10")
ConvertFromDoubleWidth(bits=10)
z_ConvertFormat(pixel_type="RGBP16",colorspace_op ="709:709:709:f=>rgb:709:709:f")
Cube("{Path}:\Soft_Clip_64_940_20.cube")
z_ConvertFormat(pixel_type="YV16",colorspace_op ="rgb:709:709:l=>709:709:709:l") 
#
LanczosResize(720,720)
TurnRight()
Histogram(mode="classic")


Resolve actually has a dedicated tool for creating custom Soft-Clip LUT's but they are 1D LUT's with a proprietary file extension (.olut) for in-program use only - as far as I know they cannot be converted externally. Only workaround is to apply the Soft-Clip LUT to a clip (full range greyscale ramp) on the timeline and generate an exportable 3D Cube LUT from that. But it works. Cool.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 27th August 2018 at 19:57.
WorBry is offline   Reply With Quote
Old 17th August 2018, 21:42   #35  |  Link
videoh
Registered User
 
Join Date: Jul 2014
Posts: 758
Thanks for the feedback, WorBry. And FranceBB. Great to hear it is working as expected.

@all

I added the source code to the linked file. It's just one new file and the Avs+ headers added to the vscube directory. Maybe sekrit-twc can absorb it. Otherwise I will link it at my website.
videoh is offline   Reply With Quote
Old 27th August 2018, 18:58   #36  |  Link
Revan654
Registered User
 
Revan654's Avatar
 
Join Date: May 2004
Posts: 324
Do any of the 3D Lut Filters Support iluts, cube_shaperlut or olut? These are mainly generated through Blackmagic.
Revan654 is offline   Reply With Quote
Old 27th August 2018, 19:55   #37  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,181
As mentioned earlier:

Quote:
Originally Posted by WorBry View Post
Resolve actually has a dedicated tool for creating custom Soft-Clip LUT's but they are 1D LUT's with a proprietary file extension (.olut) for in-program use only - as far as I know they cannot be converted externally. Only workaround is to apply the Soft-Clip LUT to a clip (full range greyscale ramp) on the timeline and generate an exportable 3D Cube LUT from that. But it works. Cool.
That's the only workaround I know. I use the Grey Scale generator (Edit Page>Effects Library> Generators) to create the Grey Scale clip on the timeline (convert to New Compound Clip). On the Color Page, I then apply the 1D LUT to the clip (Node Graph) and right click the clip thumbnail (Timeline) to select Generate 3DLUT (cube).
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 27th August 2018 at 20:23.
WorBry is offline   Reply With Quote
Old 30th August 2018, 00:05   #38  |  Link
Stephen R. Savage
Registered User
 
Stephen R. Savage's Avatar
 
Join Date: Nov 2009
Posts: 341
Do these other LUT formats have features that are not available in CUBE? If so, they can be implemented, given a specification and examples.
Stephen R. Savage is offline   Reply With Quote
Old 30th August 2018, 03:32   #39  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,181
Quote:
Originally Posted by Revan654 View Post
..cube_shaperlut..
I think a .cube_shaperlut is just some internal system intermediary. If you look in:

C:\ProgramData\Blackmagic Design\DaVinci Resolve\Support

....you'll see that there are two folders, LUT and .LUT

The LUT folder is where the actual 3D.cube and ID (.ilut/.olut) files reside and where externally created 3D cube LUT's should be placed for import.

The .LUT folder is a private system folder. In it you'll see there is a corresponding .cube_shaperlut extension file and a .cube_shaperlut.png for each 3D.cube LUT found in the LUT folder. For each ID (.ilut/.olut) LUT in the LUT folder however there is a like-named file (but with no extension) and .png file.

Looks like these files are generated automatically when the LUT Listing is updated.

Edit: There was some suggestion that other programs (Nuke) are able to read these .cube_shaperlut files, when the extension is changed to .cube.

https://www.liftgammagain.com/forum/...lorspace.5644/

Out of curiosity, I put that to the test. Copied the .cube_shaperlut file corresponding to one of the 3D.cube LUT's that I had tested earlier, changed the extension to .cube and tried it with AVSCube. No chance - 'Unhandled C ++ Exception'. The file size was also smaller (421kb) than the bone-fide .cube LUT (971 kb).

Also tried placing the .cube_shaperlut file (with extension changed to .cube) in the Support> LUT folder. After updating the LUT listing, the file did appear in the 3D LUT drop down menu and LUT gallery, but applying it to a clip had absolutely no effect.

I don't think these .cube_shaperlut files hold any value outside of Resolve.

Incidentally, the .png file that is created in the .LUT folder is the stock thumbnail image that is presented in the LUT Gallery with the LUT effect applied. Maybe these .cube_shaperlut files are operators for that.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 4th September 2018 at 05:17.
WorBry is offline   Reply With Quote
Old 23rd November 2018, 20:06   #40  |  Link
TomArrow
Registered User
 
Join Date: Dec 2017
Posts: 27
This plugin is amazing, works very fine. Thank you.

Any way you could implement an alternate function that, instead of a path to a .cube file, accepts a HALD CLUT?

For reference, it's this: http://www.quelsolaar.com/technology/clut.html

Now, I know I can just convert a CLUT to a CUBE file, but what I would really wanna do is be able to load a non-static CLUT.

Imagine this: Your friend is working on the same project as you and has done a color correction on an entire movie. You wanna continue his work, but dont want to send terabytes of data around. So your friend simply renders his corrections into a Lagarith RGB HALD CLUT AVI and you simply load it over the source material and BAM, you have all his corrections, no matter what software he used.

Could also play around with that a lot and create funny effects I'm sure. Shouldn't be too difficult to implement, right? It would just have to accept a 16bit RGB 4096x4096 clip. That could come from an Image (ImageSource) or from a video, it wouldn't matter.
TomArrow is offline   Reply With Quote
Reply

Tags
3dl, cube, hdr, lut, sdr

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:36.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.