MediaInfo reported the source as:
Color space : YUV
Chroma subsampling : 4:2:0
Hybrid remembered:
video_colorspace: YUV
video_color: 4:2:0
Vapoursynth script used:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import sys
import os
core = vs.core
# Import scripts folder
scriptPath = 'D:/!_System/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# loading plugins
core.std.LoadPlugin(path="D:/!_System/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="D:/!_System/Hybrid/64bit/vsfilters/SourceFilter/AviSource/avisource.dll")
# Import scripts
import validate
# Source: 'L:\!_convert\1\2007.avi'
# Current color space: YUV420P8, bit depth: 8, resolution: 720x480, frame rate: 30fps, scanorder: progressive, yuv luminance scale: limited, matrix: 470bg
# Loading L:\!_convert\1\2007.avi using VsAviSource
clip = core.avisource.AVISource(path="L:/!_convert/1/2007.avi")
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.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
# making sure frame rate is set to 30fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=30, fpsden=1)
# making sure the detected scan type is set (detected: progressive)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
original = clip
from vsrealesrgan import realesrgan as RealESRGAN
# adjusting color space from YUV420P8 to RGBS for vsRealESRGAN
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_s="limited")
# resizing using RealESRGAN
clip = RealESRGAN(clip=clip, model=5, device_index=0) # 2880x1920
# resizing 2880x1920 to 820x548
# adjusting resizing
clip = core.fmtc.resample(clip=clip, w=820, h=548, kernel="spline64", interlaced=False, interlacedd=False)
original = core.resize.Bicubic(clip=original, width=820, height=548)
# adjusting output color from: RGBS to YUV420P8 for FFV1Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="470bg", range_s="limited", dither_type="error_diffusion")
original = core.text.Text(clip=original,text="Original",scale=1,alignment=7)
clip = core.text.Text(clip=clip,text="Filtered",scale=1,alignment=7)
stacked = core.std.StackHorizontal([original,clip])
# set output frame rate to 30fps (progressive)
stacked = core.std.AssumeFPS(clip=stacked, fpsnum=30, fpsden=1)
# output
stacked.set_output()
Original should be YUV420P8 which got resized to width=820, height=548
original = core.resize.Bicubic(clip=original, width=820, height=548)
Filtered clip was YUV420P8 which got converted to RGBS for RealESRGAN,
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_s="limited")
then downscaled to 820x548
clip = core.fmtc.resample(clip=clip, w=820, h=548, kernel="spline64", interlaced=False, interlacedd=False)
and converted to YUV420P:
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="470bg", range_s="limited", dither_type="error_diffusion")
at:
stacked = core.std.StackHorizontal([original,clip])
both clips should be YUV420P and 820x548, Vapoursyth complains about:
S t a c k H o r i z o n t a l : c l i p f o r m a t a n d h e i g h t m u s t m a t c h
From what I see, everything Hybrid does is correct.
My guess atm. is that the AviSource source filter does not output YUV420P8, but something other.
Would need a small sample of the source, which also causes the problem to look into it.
Does it also happen when not using AviSource?
Cu Selur