17.09.2020, 05:59
(14.09.2020, 22:13)Selur Wrote:Quote:Levels Gamma + TimeCube together produce some strange results:Do you see a mistake in the script?
If not, than it's not a bug in Hybrid.
Also without details that actually allow to reproduce the issue I won't even try to reproduce this.
Like last time when you didn't mention at all that you use a high bit depth source and I spend an evening searching for a bug that I couldn't find,...
From developer's explanation TimeCube operates internally in 32 bit float RGB.
Currently Hybrid script use bit depth of input video as input for TimeCube and next just apply Levels (I used 10bit source video in this example):
# adjusting color space from YUV422P10 to RGB30 for vscube
clip = core.resize.Bicubic(clip=clip, format=vs.RGB30, matrix_in_s="470bg", range_s="limited")
# color adjustment using TimeCube
clip = core.timecube.Cube(clip=clip, cube="/Applications/Hybrid.app/Contents/MacOS/TimeCubeFiles/identity.cube")
# Color Adjustment
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=1440, h=1178, interlaced=False, interlacedd=False)
# adjusting output color from: RGB30 to YUV422P10 for ProResModel (i422)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, matrix_s="470bg", range_s="limited")
# Output
As i noticed earlier it produce some strange conflict in colors.
Here is solution:
I was thinking maybe TimeCube outputs 32bit but Levels and other similar filters expect same bit depth as source video? So i try to customize script, and add additional transformation to YUV422P10 before Levels. And it WORKS! No more conflict between Levels and TimeCube.
# adjusting color space from YUV422P10 to RGB30 for vscube
clip = core.resize.Bicubic(clip=clip, format=vs.RGB30, matrix_in_s="470bg", range_s="limited")
# color adjustment using TimeCube
clip = core.timecube.Cube(clip=clip, cube="/Applications/Hybrid.app/Contents/MacOS/TimeCubeFiles/identity.cube")
# color adjustment for Levels
clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, matrix_s="470bg", range_s="limited")
# Color Adjustment
clip = core.std.Levels(clip=clip, min_in=64, max_in=940, min_out=64, max_out=940, gamma=0.50, planes=[0])
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=1440, h=1178, interlaced=False, interlacedd=False)
# adjusting output color from: RGB30 to YUV422P10 for ProResModel (i422)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, matrix_s="470bg", range_s="limited")
# Output