16.03.2024, 17:07
I rewritten the filter and now it is working, here python code
I will add this filter directly in ddeoldify, but the plugin "MiscFilters.dll" must be loaded by Hybrid.
Thanks,
Dan
def vs_clip_color_stabilizer(clip: vs.VideoNode = None, nframes: int = 5, scenechange: bool = True) -> vs.VideoNode:
clip_yuv = clip.resize.Bicubic(format=vs.YUV444PS, matrix_s="709", range_s="limited")
if nframes%2==0:
nframes +=1
N = max(1, min(nframes, 31))
Wi = math.trunc(100.0/nframes)
Wc = 100-(N-1)*Wi
Nh = round((N-1)/2)
weight_list = list()
for i in range(0, Nh):
weight_list.append(Wi)
weight_list.append(Wc)
for i in range(0, Nh):
weight_list.append(Wi)
clip_yuv = vs.core.misc.AverageFrames(clip_yuv, weight_list, scenechange = True, planes=[1,2])
# convert the clip format for deoldify and std.Levels() to RGB24
clip_rgb = clip_yuv.resize.Bicubic(format=vs.RGB24, matrix_in_s="709", range_s="limited", dither_type="error_diffusion")
return clip_rgb
I will add this filter directly in ddeoldify, but the plugin "MiscFilters.dll" must be loaded by Hybrid.
Thanks,
Dan