![]() |
|
help please - Printable Version +- Selur's Little Message Board (https://forum.selur.net) +-- Forum: Talk, Talk, Talk (https://forum.selur.net/forum-5.html) +--- Forum: Small Talk (https://forum.selur.net/forum-7.html) +--- Thread: help please (/thread-4358.html) |
RE: help please - Selur - 05.05.2026 that sample does not seem to have the flags it gets detected as bt460 # Imports
import sys
import os
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Limit frame cache to 48449MB
core.max_cache_size = 48449
# Import scripts folder
scriptPath = 'F:/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# loading plugins
core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/fmtconv.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/DGDecNV/DGDecodeNV_AVX2.dll")
# Import scripts
import validate
# Source: 'C:\Users\Selur\Desktop\selur sample.mkv'
# Current color space: YUV420P8, bit depth: 8, resolution: 700x476, frame rate: 23.976fps, scanorder: progressive, yuv luminance scale: limited, matrix: 470bg, format: AVC
# Loading 'C:\Users\Selur\Desktop\selur sample.mkv' using DGSource
clip = core.dgdecodenv.DGSource("J:/tmp/mkv_3361fb2859a06a1d0288f25dd3159329_853323747.dgi") # 23.976 fps, scanorder: progressive
frame = clip.get_frame(0)
# setting color matrix to 470bg.
clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT470_BG)
# 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 23.976fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
# making sure the detected scan type is set (detected: progressive)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # scan type: progressive
# adjusting output color from YUV420P8 to YUV420P10 for NVEncModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10)
# set output frame rate to 23.976fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
# output
clip.set_output()Cu Selur RE: help please - lsd4me2 - 05.05.2026 well what else exactly as i supposed to do then? hybrid incorrectly flags it as 470bg, so i override the input to smpte170m via Filterering/misc. then i inserted before my very first filter, # matrix smpte170m # transfer bt601 # primaries smpte170m # colorrange limited # colorformat YUV444P16 # width 700 # height 476 clip = core.std.CropRel(clip, left=10, top=0, right=10, bottom=4) clip = core.fmtc.resample(clip, css="444", kernel="spline", taps=6) clip = core.fmtc.bitdepth(clip, bits=16, dmode=3) clip = core.std.SetFrameProps(clip, _Matrix=6, _Transfer=6, _Primaries=6, _ColorRange=1) and then i tagged every other custom command with the same (even though it never changed after) # matrix smpte170m # transfer bt601 # primaries smpte170m # colorrange limited # colorformat YUV444P16 # width 700 # height 476 You said i had to let hybrid know what was happening I DID does this even matter? -vcodec png -dpi 0 -dpm 0 -pred 0 -vf zscale=matrixin=470bg:matrix=470bg,format=rgb48 -pix_fmt rgb48be? ots from the png tab? is is actually converting to 470bg? RE: help please - Selur - 05.05.2026 1. Uploaded a new dev with a 'quick-fix' which hopefully doesn't break anything else. (will also later look at whether changes in custom-sections are properly taken into account for the calculation of the output color matrix that is fed send to the encoder) 2. If the input is not properly detected, better use Filtering->Misc->Overwrite instead of custom-sections. Cu Selur RE: help please - lsd4me2 - 06.05.2026 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 RE: help please - Selur - 06.05.2026 # matrix smpte170m
# transfer bt601
# primaries smpte170m
# colorrange limitedQuote:Insert before:=> 0. use 'code'-tags 1. There is no way in Hybrid to change primaries and transform other than in the encoder settings, if the encoder has VUI parameters which support it.Hybrid does not change these in the script. 2. There is a bug in the handling, will try to look at it tomorrow after work 3. like I wrote use Filtering->Misc->Overwrite 4. Hybrid does not care about SetFrameProps Cu Selur RE: help please - Selur - 07.05.2026 As a small update: atm. those values are not meant to overwrite the output characteristics of the script. Atm. those are set by the external control. That said I'm thinking about how problematic it would be to support this. RE: help please - Selur - 07.05.2026 Updated the tool-tip with the correct 'colormatrix' values. Changed the handling a bit, 'colormatrix' and 'lumascale' now allow overwriting the output values and seem to be properly propagated to the encoder. => uploaded a new dev Cu Selur RE: help please - lsd4me2 - 08.05.2026 Thank you!! RE: help please - lsd4me2 - 09.05.2026 hmm, i thought it was fixed as it does show 170m now in the png options. But when i add a job and hit start is crashes. Actually it doesnt matter what output i set they all crash with "set absolute paths crashed.." preview works fine Also with the imput override to smpte170m hyvrid still sets the primaries to 470bg, this is on the Hybrid 2026.05.07.1 dev build # Source: 'D:\Season 4 disk 1\A1_t00.mkv' # Current color space: YUV420P8, bit depth: 8, resolution: 720x480, frame rate: 23.976fps, scanorder: progressive, 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}) RE: help please - Selur - 09.05.2026 Quote:hyvrid still sets the primaries to 470bg,Correct. ColorMatrix, Primaries and Transfer are totally different things. Changing the ColorMatrix does not change the other two. Also for clarification: # 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)Quote:But when i add a job and hit start is crashes. Actually it doesnt matter what output i set they all crash with "set absolute paths crashed.."Can't reproduce that here. Uninstall Hybrid, reinstall the dev and if the problem still occurs, share proper details, then I can look at it. Cu Selur |