16.05.2026, 22:38
Hi Selur,
I hope you are doing well .
I wanted to share an example script regarding the issue I mentioned with HAVC_ColorAdjust. Maybe it could help identify the source of the problem.
I hope you are doing well .
I wanted to share an example script regarding the issue I mentioned with HAVC_ColorAdjust. Maybe it could help identify the source of the problem.
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import sys
import os
core = vs.core
# Import scripts folder
scriptPath = 'C:/Program Files/Hybrid2/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# loading plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid2/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid2/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll")
# Import scripts
import vsdeoldify as havc
import validate
# Source: 'C:\Users\NASS\Desktop\LA\restoredcolor.mp4'
# Current color space: YUV420P8, bit depth: 8, resolution: 938x698, frame rate: 24fps, scanorder: progressive, yuv luminance scale: limited, matrix: 709, transfer: bt.709, primaries: bt.709, format: AVC
# Loading ' C:\Users\NASS\Desktop\LA\restoredcolor.mp4Ä using LWLibavSource
clip = core.lsmas.LWLibavSource(source="C:\Users\NASS\Desktop\LA\restoredcolor.mp4 ", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0)
frame = clip.get_frame(0)
# setting color matrix to 709.
clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT709)
# setting color transfer (vs.TRANSFER_BT709), if it is not set.
if validate.transferIsInvalid(clip):
clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT709)
# setting color primaries info (to vs.PRIMARIES_BT709), if it is not set.
if validate.primariesIsInvalid(clip):
clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT709)
# setting color range to TV (limited) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
# making sure frame rate is set to 24fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=24, fpsden=1)
# making sure the detected scan type is set (detected: progressive)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # scan type: progressive
# adjusting color space from YUV420P8 to RGB24 for vsColorAdjust
clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="709", range_in_s="limited", range_s="full")
# stabilize colors using ColorAdjust (HAVC)
clip = havc.HAVC_ColorAdjust(clip, BlackWhiteTune="strong", BlackWhiteMode=6, Strength=1)
# adjusting output color from RGB24 to YUV420P8 for x264Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="709", range_in_s="full", range_s="limited") # additional resize to match target color sampling
# set output frame rate to 24fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=24, fpsden=1)
# output
clip.set_output()
# script was created by Hybrid 2026.03.21.1
