# Imports import vapoursynth as vs # getting Vapoursynth core import ctypes import sys import os core = vs.core # Import scripts folder scriptPath = 'F:/Hybrid/64bit/vsscripts' sys.path.insert(0, os.path.abspath(scriptPath)) # Loading Support Files Dllref = ctypes.windll.LoadLibrary("F:/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll") # loading plugins core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/RemoveDirt/RemoveDirtVS.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/HQDN3D/libhqdn3d.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/TTempSmooth/TTempSmooth.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/DCTFilter.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DeblockFilter/Deblock/Deblock.dll") core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.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/SourceFilter/DGDecNV/DGDecodeNV.dll") # Import scripts import killerspots import denoise import artifacts import SpotLess import validate # Source: 'G:\clips\lost cause\Test_video.mkv' # 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 G:\clips\lost cause\Test_video.mkv using DGSource clip = core.dgdecodenv.DGSource("J:/tmp/mkv_b53017f2e08a0d6a79ed0fcc8c9aaeb9_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) # progressive # contrast sharpening using CAS clip = core.cas.CAS(clip=clip, sharpness=1.000) # Spot removal using SpotLess clip = SpotLess.SpotLess(clip=clip, radT=3, pel=2, smoother="zsmooth") for i in range(5): clip = artifacts.DeSpot(o=clip) clip = core.std.Crop(clip=clip, left=174, right=174, top=0, bottom=0)# cropping to 1572x1080 # denoising using MCTemporalDenoise clip = denoise.MCTemporalDenoise(i=clip, settings="very high", thSAD=600, thSAD2=600, thSCD1=600, thSCD2=130, truemotion=True, MVglobal=True, pel=4, pelsearch=2, search=2, searchparam=2, MVsharp=0, DCT=1, ncpu=10) # denoising using HQDN3D clip = core.hqdn3d.Hqdn3d(clip=clip, lum_spac=0.00, chrom_spac=50.00) clip = core.std.AddBorders(clip=clip, left=2, right=2, top=0, bottom=0) # add borders to archive mod 8 (vsKillerSpots) - 1576x1080 clip = killerspots.KillerSpots(clip=clip, advanced=False) clip = core.std.Crop(clip=clip, left=2, right=2, top=0, bottom=0) # removing borders (vsKillerSpots) - 1572x1080 # adjusting output color from: YUV420P8 to YUV420P10 for NVEncModel clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, range_s="limited") # set output frame rate to 24fps (progressive) clip = core.std.AssumeFPS(clip=clip, fpsnum=24, fpsden=1) # output clip.set_output()