Today, 02:37
I downloaded the latest dev build first thing first. The overwrite input color matrix via Filtering/misc is set to SMPTE170m same as before i loaded an episode with no filter enabled, no custom scripts except 1 in before end, this is the generated script,
# Imports
import sys
import os
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Import scripts folder
scriptPath = 'C:/Program Files/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# loading plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DeinterlaceFilter/TIVTC/libtivtc.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll")
# defining beforeEnd-function - START
def beforeEnd(clip):
clip = core.text.FrameProps(clip)
clip.set_output()
return [clip]
# defining beforeEnd-function - END
# Import scripts
import validate
# Source: 'D:\Season 4 disk 1\A1_t00.mkv'
# Current color space: YUV420P8, bit depth: 8, resolution: 720x480, frame rate: 29.97fps, scanorder: bottom field first, yuv luminance scale: limited, matrix: 170m, format: mpeg-2
# Loading 'D:\Season 4 disk 1\A1_t00.mkvÄ using LWLibavSource
clip = core.lsmas.LWLibavSource(source="D:/Season 4 disk 1/A1_t00.mkv", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0)
frame = clip.get_frame(0)
# setting color matrix to 170m.
clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_ST170_M)
# setting color transfer (vs.TRANSFER_BT601), if it is not set.
if validate.transferIsInvalid(clip):
clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT601)
# setting color primaries info (to vs.PRIMARIES_BT470_BG), if it is not set.
if validate.primariesIsInvalid(clip):
clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT470_BG)
# setting color range to TV (limited) range.
prop_name = '_Range' if core.core_version.release_major >= 74 else '_ColorRange'
clip = core.std.SetFrameProps(clip=clip, **{prop_name: vs.RANGE_LIMITED})
# making sure frame rate is set to 29.97fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# making sure the detected scan type is set (detected: bottom field first)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_BOTTOM) # scan type: bottom field first
# Deinterlacing using TIVTC
clip = core.tivtc.TFM(clip)
clip = core.tivtc.TDecimate(clip) # new fps: 23.976
# Making sure content is preceived as frame based
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # scan type: progressive
[clip] = beforeEnd(clip)
# clip current meta; color space: YUV420P8, bit depth: 8, resolution: 720x480, fps: 23.976, color matrix: 170m, yuv luminance scale: limited, scanorder: progressive, full height: true
# set output frame rate to 23.976fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
# output
clip.set_output()
# clip current meta; color space: YUV420P8, bit depth: 8, resolution: 720x480, fps: 23.976, color matrix: 170m, yuv luminance scale: limited, scanorder: progressive, full height: true (Meta)
# script was created by Hybrid 2026.05.05.1
Yet in my preview windows i have this so the override does not work, regardless of what the script claims, I have 470bg colormatrix and primaries,
https://ibb.co/Z0MSZ6N
Next i added this at the top of my before end command,
# matrix smpte170m
# transfer bt601
# primaries smpte170m
# colorrange limited
and got this,
https://ibb.co/R4YYtbPs
lastly I added tthe actual command to force it,
# matrix smpte170m
# transfer bt601
# primaries smpte170m
# colorrange limited
clip = core.std.SetFrameProps(clip, _Matrix=6, _Transfer=6, _Primaries=6, _Range=1)
clip = core.text.FrameProps(clip)
clip.set_output()
https://ibb.co/Z1VPjqkK
As you can see the issue is not with customs commands, the override is broken. Also it would be nice to know the proper tag for SMPTE170m primaries, the tag alone didn't work (pic 2). Hope this helps with your troubleshooting.........
O, and even with clip = core.std.SetFrameProps(clip, _Matrix=6, _Transfer=6, _Primaries=6, _Range=1) confirmed at the end of chain, and smpte170m override set hybrid still does this when output to png, -vcodec png -dpi 0 -dpm 0 -pred 0 -vf zscale=matrixin=470bg:matrix=470bg,format=rgb24 -pix_fmt rgb24
# Imports
import sys
import os
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Import scripts folder
scriptPath = 'C:/Program Files/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# loading plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DeinterlaceFilter/TIVTC/libtivtc.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll")
# defining beforeEnd-function - START
def beforeEnd(clip):
clip = core.text.FrameProps(clip)
clip.set_output()
return [clip]
# defining beforeEnd-function - END
# Import scripts
import validate
# Source: 'D:\Season 4 disk 1\A1_t00.mkv'
# Current color space: YUV420P8, bit depth: 8, resolution: 720x480, frame rate: 29.97fps, scanorder: bottom field first, yuv luminance scale: limited, matrix: 170m, format: mpeg-2
# Loading 'D:\Season 4 disk 1\A1_t00.mkvÄ using LWLibavSource
clip = core.lsmas.LWLibavSource(source="D:/Season 4 disk 1/A1_t00.mkv", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0)
frame = clip.get_frame(0)
# setting color matrix to 170m.
clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_ST170_M)
# setting color transfer (vs.TRANSFER_BT601), if it is not set.
if validate.transferIsInvalid(clip):
clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT601)
# setting color primaries info (to vs.PRIMARIES_BT470_BG), if it is not set.
if validate.primariesIsInvalid(clip):
clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT470_BG)
# setting color range to TV (limited) range.
prop_name = '_Range' if core.core_version.release_major >= 74 else '_ColorRange'
clip = core.std.SetFrameProps(clip=clip, **{prop_name: vs.RANGE_LIMITED})
# making sure frame rate is set to 29.97fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# making sure the detected scan type is set (detected: bottom field first)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_BOTTOM) # scan type: bottom field first
# Deinterlacing using TIVTC
clip = core.tivtc.TFM(clip)
clip = core.tivtc.TDecimate(clip) # new fps: 23.976
# Making sure content is preceived as frame based
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # scan type: progressive
[clip] = beforeEnd(clip)
# clip current meta; color space: YUV420P8, bit depth: 8, resolution: 720x480, fps: 23.976, color matrix: 170m, yuv luminance scale: limited, scanorder: progressive, full height: true
# set output frame rate to 23.976fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
# output
clip.set_output()
# clip current meta; color space: YUV420P8, bit depth: 8, resolution: 720x480, fps: 23.976, color matrix: 170m, yuv luminance scale: limited, scanorder: progressive, full height: true (Meta)
# script was created by Hybrid 2026.05.05.1
Yet in my preview windows i have this so the override does not work, regardless of what the script claims, I have 470bg colormatrix and primaries,
https://ibb.co/Z0MSZ6N
Next i added this at the top of my before end command,
# matrix smpte170m
# transfer bt601
# primaries smpte170m
# colorrange limited
and got this,
https://ibb.co/R4YYtbPs
lastly I added tthe actual command to force it,
# matrix smpte170m
# transfer bt601
# primaries smpte170m
# colorrange limited
clip = core.std.SetFrameProps(clip, _Matrix=6, _Transfer=6, _Primaries=6, _Range=1)
clip = core.text.FrameProps(clip)
clip.set_output()
https://ibb.co/Z1VPjqkK
As you can see the issue is not with customs commands, the override is broken. Also it would be nice to know the proper tag for SMPTE170m primaries, the tag alone didn't work (pic 2). Hope this helps with your troubleshooting.........
O, and even with clip = core.std.SetFrameProps(clip, _Matrix=6, _Transfer=6, _Primaries=6, _Range=1) confirmed at the end of chain, and smpte170m override set hybrid still does this when output to png, -vcodec png -dpi 0 -dpm 0 -pred 0 -vf zscale=matrixin=470bg:matrix=470bg,format=rgb24 -pix_fmt rgb24

