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 7th August 2022, 19:22   #101  |  Link
ErazorTT
Registered User
 
Join Date: Mar 2003
Location: Germany
Posts: 215
I'm having a lut which when using ffmpeg produces the expected behaviour, but when using the cube function returns unexpected things.
The following image shows the result, on the right part there are these waves which are unexpected, and are also not there using ffmpeg.


However when using ffmpeg I'm getting this:


Here are all files I am using:
hlg_test.7z

The command for ffmpeg is:
ffmpeg -i GreyRamp16bits.png -vf lut3d=lut_4000_3.0.cube -pix_fmt rgb48be GreyRamp16bits_converted.png

What is going on here, why the different results?

Last edited by ErazorTT; 20th August 2022 at 20:03.
ErazorTT is offline   Reply With Quote
Old 7th August 2022, 19:54   #102  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
@ErazorTT

Does DGCube have the same problem? https://www.rationalqm.us/board/view...p=16092#p16092
Reel.Deel is offline   Reply With Quote
Old 7th August 2022, 19:56   #103  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,377
For reference, avs version , vpy version that it's based on , and Adobe get similar results

The difference is the default interpolation type for ffmpeg (tetrahedral) . Trilinear , pyramid, prism all produce the pattern to an extent

eg.
ffmpeg -i GreyRamp16bits.png -vf lut3d=lut_4000_3.0.cube:interp=trilinear -pix_fmt rgb48be GreyRamp16bits_converted_trilinear.png

Last edited by poisondeathray; 7th August 2022 at 20:00.
poisondeathray is offline   Reply With Quote
Old 8th August 2022, 11:50   #104  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,580
Quote:
Originally Posted by Reel.Deel View Post
Does DGCube have the same problem?
Is it working for you? What card? Drivers?
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 8th August 2022, 14:54   #105  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by tormento View Post
Is it working for you? What card? Drivers?
No, I am also getting access violation. I have not updated my drivers in a while so I was going to do that and see if it fixes the issue.
Reel.Deel is offline   Reply With Quote
Old 8th August 2022, 16:38   #106  |  Link
ErazorTT
Registered User
 
Join Date: Mar 2003
Location: Germany
Posts: 215
Quote:
Originally Posted by poisondeathray View Post
For reference, avs version , vpy version that it's based on , and Adobe get similar results

The difference is the default interpolation type for ffmpeg (tetrahedral) . Trilinear , pyramid, prism all produce the pattern to an extent

eg.
ffmpeg -i GreyRamp16bits.png -vf lut3d=lut_4000_3.0.cube:interp=trilinear -pix_fmt rgb48be GreyRamp16bits_converted_trilinear.png
Oh that is a nice finding! So its the interpolation. Could this better interpolation be implemented into vscube (or DGCube for that matter)?

Last edited by ErazorTT; 8th August 2022 at 16:50.
ErazorTT is offline   Reply With Quote
Old 8th August 2022, 16:50   #107  |  Link
ErazorTT
Registered User
 
Join Date: Mar 2003
Location: Germany
Posts: 215
Quote:
Originally Posted by Reel.Deel View Post
@ErazorTT

Does DGCube have the same problem? https://www.rationalqm.us/board/view...p=16092#p16092
I just found that DGCube needs 65x65x65 sized LUTs, so I tried again with one of that size. And yes, DGCube behaves that same as vscube.
ErazorTT is offline   Reply With Quote
Old 8th August 2022, 17:46   #108  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,377
Quote:
Originally Posted by ErazorTT View Post
Could this better interpolation be implemented into vscube (or DGCube for that matter)?
It's debatable if a certain interpolation is going to be "better" for all situations;

But having more options is always welcome

You can try submitting a feature request
https://github.com/sekrit-twc/timecube/issues
poisondeathray is offline   Reply With Quote
Old 8th August 2022, 18:11   #109  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,580
Quote:
Originally Posted by Reel.Deel View Post
No, I am also getting access violation.
Generic size version has just been released.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 10th August 2022, 16:07   #110  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,580
Quote:
Here is a new version supporting tetrahedral interpolation. It addresses ErazorTT's issue, as the artifacts do not occur with tetrahedral. Please read the new DGCube.txt file for details and be aware that the filter is now invoked as DGCube(). I'll add this to the timecube-derived Cube() filter as well. Also need to add Vapoursynth support to DGCube().
https://rationalqm.us/misc/DGCube.zip
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 19th August 2022, 12:40   #111  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,580
Notice that in the latest version, no more avsresize is required and it got scorching fast.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 20th August 2022, 19:58   #112  |  Link
ErazorTT
Registered User
 
Join Date: Mar 2003
Location: Germany
Posts: 215
@tormento: Yup, this does now produce the intended results with these luts. Thanks!
ErazorTT is offline   Reply With Quote
Old 20th August 2022, 22:48   #113  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,580
Quote:
Originally Posted by ErazorTT View Post
Thanks!
Much better to thank the author.

Any bug report and testing is the most welcome.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 22nd August 2022, 14:50   #114  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Quote:
Originally Posted by tormento View Post
I wonder why don't DGCube have 2 ver x32 & x64
kedautinh12 is offline   Reply With Quote
Old 22nd August 2022, 17:37   #115  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,580
Quote:
Originally Posted by kedautinh12 View Post
I wonder why don't DGCube have 2 ver x32 & x64
'cause x86 is getting more and more useless, especially with 4k.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 22nd August 2022, 18:05   #116  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
Probably cause old x86 OS like my beloved XP don't really have drivers for modern NVIDIA GPUs so the DG plugins would have nowhere to run except for the old not so powerful NVIDIA GPUs...
I wish NVIDIA kept releasing drivers for XP x86 but it didn't happen, so nowadays I do most of my stuff via RDP from my XP to the remote Windows Server 2019 instance, especially after Tormento made me upgrade my stable Windows 10 Enterprise workstation to the unstable crap called Windows 11 Enterprise which one day upgraded itself only to end up blue screening in loop, thus making me lose every program installed.

Last edited by FranceBB; 22nd August 2022 at 18:07.
FranceBB is offline   Reply With Quote
Old 22nd August 2022, 18:29   #117  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,580
Quote:
Originally Posted by FranceBB View Post
especially after Tormento made me upgrade my stable Windows 10 Enterprise workstation to the unstable crap called Windows 11 Enterprise which one day upgraded itself only to end up blue screening in loop, thus making me lose every program installed.
Oh, dear.

You use crappy hardware and you blame me.

Windows 11 Enterprise x64 here since day 1 (on Insider Channel too) and no major hiccups.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 22nd August 2022, 18:35   #118  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
Quote:
Originally Posted by tormento View Post
Oh, dear.

You use crappy hardware
-> I'm broke, as simple as that xD
FranceBB is offline   Reply With Quote
Old 26th August 2022, 17:38   #119  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
Hi there Donald,
currently it isn't possible to pick which kind of interpolation is used to produce the result in Cube() (I'm talking about the CPU version).
Would it be possible to introduce an option in Cube() like String Interpolation where it can have one of the following values Interpolation="Tricubic", Interpolation="Trilinear", Interpolation="Tetrahedral", where the default is Tetrahedral?

So I imagine the usage to be like:

Code:
Cube("myLUT.cube", fullrange=true, Interpolation="Tetrahedral")

The reason is that I'm currently dealing with a brand new BBC LUT for HLG to BT709 SDR.
I used to use the 8a, which performs clipping, but some majors want me to use the new 9c which works in Studio RGB (Limited TV Range) and preserves overshootings (so the BT709 will have out of range whites and blacks and it won't clip them).

The issue I have with it is that the interpolation Cube() is doing is different from the interpolation the major is using and they will therefore reject the result.


AVS Script:

Code:
LWLibavVideoSource("D:\4K_Ama\05_DI SERVIZIO - EBU UHD HDR COLOR BARS\EBU_HDR_COLOUR_BARS_2160p_v210.mov")

propClearAll()

#From 4:2:2 16bit planar Narrow Range to RGB Planar 16bit Narrow Range
z_ConvertFormat(pixel_type="RGBP16", colorspace_op="2020:std-b67:2020:limited=>rgb:std-b67:2020:limited", resample_filter_uv="spline64", dither_type="error_diffusion", use_props=0)

#From HLG to BT709 with 16bit precision
Cube("A:\avdb\Server\encoder\encoder\Processors\avs_plugins\LUTs\9c_HLG_BT709_Type3_Display_DownMapping_SuperWhite_nocomp-v1_5.cube", fullrange=true)

#From RGB 16bit planar Narrow Range to YUV420 8bit planar Narrow Range with dithering
z_ConvertFormat(pixel_type="YUV420", colorspace_op="rgb:709:709:limited=>709:709:709:limited", resample_filter_uv="spline64", dither_type="error_diffusion", use_props=0)

Here's the result (Left interpolation done by Cube() - Right interpolation done by the major who's selling us the content):

https://i.imgur.com/hyky5sZ.png



Before you say "CUDA!" please note that our workflows are based on 100+ scalable VMs in the cloud that are shut down and only woken up when they need to perform a job and then they're shut down and they're CPU only, so we have no way to use CUDA other than on the legacy MAM on prem which will be discontinued soon-ish.


Thank you in advance,
Frank
FranceBB is offline   Reply With Quote
Old 1st December 2022, 01:55   #120  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
DGCube 22/09/30
https://rationalqm.us/misc/DGCube.zip
kedautinh12 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:09.


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