Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Imports
- import vapoursynth as vs
- # getting Vapoursynth core
- import sys
- import os
- 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/vsfilters/DenoiseFilter/CTMF/CTMF.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libvs_placebo.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/DeScratch/DeScratch.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/ZSmooth/zsmooth.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SharpenFilter/CAS/CAS.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/akarin.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/FrameFilter/RIFE/librife.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/DGDecNV/DGDecodeNV_AVX2.dll")
- # Import scripts
- import nnedi3_resample
- import smdegrain
- import vsdeoldify as havc
- import SpotLess
- import color
- import validate
- # Source: 'C:\Users\Selur\Desktop\Zombie clip 35mm.mp4'
- # Current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, frame rate: 24fps, scanorder: progressive, yuv luminance scale: limited, matrix: 709, transfer: bt.709, primaries: bt.709, format: AVC
- # Loading 'C:\Users\Selur\Desktop\Zombie clip 35mm.mp4' using DGSource
- clip = core.dgdecodenv.DGSource("J:/tmp/mp4_6be8ee438587efcb0551ce006000ae5a_853323747.dgi") # 24 fps, scanorder: progressive
- 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 RGBS for vsReplaceSingle
- clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="709", range_in_s="limited", range_s="full", dither_type="error_diffusion")
- from FillDuplicateFrames import FillDuplicateFrames
- fdf = FillDuplicateFrames(clip=clip, mode="Replace", frames=[36, 72, 92], method="rife", sceneThr=0, rifeModel=24)
- clip = fdf.out
- # adjusting color using Levels on RGBS (32 bit)
- clip = core.std.Levels(clip, min_in=90/255.0, max_in=255/255.0, min_out=0/255.0, max_out=255/255.0)
- # adjusting color space from RGBS to YUV444PS for vsTweak
- clip = core.resize.Bicubic(clip=clip, format=vs.YUV444PS, matrix_s="709", range_in_s="full", range_s="limited") # additional resize to match target color sampling
- # adjusting color using Tweak
- clip = color.Tweak(clip, hue=0.00, sat=0.00, cont=1.00, coring=True)
- # adjusting color space from YUV444PS to YUV444P16 for vsCAS
- clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16)
- # contrast sharpening using CAS
- clip = core.cas.CAS(clip, sharpness=0.700)
- # Spot removal using SpotLess
- clip = SpotLess.SpotLess(clip, chroma=False, truemotion=False, rec=True, pel=2, smoother="zsmooth")
- # adjusting color space from YUV444P16 to YUV444P8 for vsDeScratch
- clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8)
- # scratch removal using DeScratch
- clip = core.descratch.DeScratch(clip, asym=15, modey=3, modeu=3, modev=3, minlen=50, maxgap=5)
- clipMerge = clip
- clip = core.fmtc.resample(clip=clip, w=720, h=308, kernel="cubic", interlaced=False, interlacedd=False) # resizing for 'Gimmick' (vsHAVC)
- # adjusting color space from YUV444P16 to RGB24 for vsHAVC
- clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="709", range_in_s="limited", range_s="full")
- # adding colors using HAVC
- clip = havc.HAVC_main(clip, ColorModel="Stable+Artistic", CombMethod="Adaptive-Luma", ColorTemp="high", ColorFix="none", BlackWhiteTune="medium", BlackWhiteMode=4)
- clip = core.fmtc.resample(clip=clip, w=1920, h=1080, kernel="cubic", interlaced=False, interlacedd=False) # undo resizing for 'Gimmick' (vsHAVC)
- clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8, matrix_s="709", range_in_s="full", range_s="limited")
- clip = core.std.Merge(clipMerge,clip,[0, 1, 1]) # merge filtered and unfiltered by plane
- clip = core.std.Crop(clip, left=0, right=0, top=130, bottom=132) # cropping to 1920x818
- # adjusting color space from YUV444P8 to YUV444P16 for vsGLSLSaturation
- clip = core.resize.Bicubic(clip=clip, dither_type="error_diffusion", format=vs.YUV444P16, range_in_s="limited")
- # adjusting saturation using GSLS bSat
- with open("F:/Hybrid/64bit/vsfilters/GLSL/parameterized/bSat.hook.glsl") as glslf:
- glsl = glslf.read()
- glsl = glsl.replace('#define SatFactor 2.43', '#define SatFactor 1.25')
- clip = core.placebo.Shader(clip, shader_s=glsl, width=clip.width, height=clip.height)
- # removing grain using SMDegrain
- clip = smdegrain.SMDegrain(clip, tr=3, contrasharp=70, interlaced=False, opencl=True, device=-1)
- # letterboxing 1920x818 to 1920x1080
- clip = core.std.AddBorders(clip, left=0, right=0, top=131, bottom=131)
- # adjusting output color from YUV444P16 to YUV420P10 for NVEncModel
- clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10)
- # 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.01.17.1
Advertisement
Add Comment
Please, Sign In to add comment