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/ZSmooth/zsmooth.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/CTMF/CTMF.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libtemporalmedian.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/akarin.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/BestSource/BestSource.dll")
- # Import scripts
- import nnedi3_resample
- import smdegrain
- import SpotLess
- import validate
- # Source: 'C:\Users\Selur\Desktop\test_20000.mov'
- # Current color space: YUV444P12, bit depth: 12, resolution: 760x488, frame rate: 29.97fps, scanorder: progressive, yuv luminance scale: limited, matrix: 709, format: prores
- # Loading 'C:\Users\Selur\Desktop\test_20000.mov' using BestSource
- clip = core.bs.VideoSource(source="C:/Users/Selur/Desktop/test_20000.mov", cachepath="J:/tmp/test_20000_bestSource", track=0, hwdevice="opencl")
- frame = clip.get_frame(0)
- # setting color matrix to 709.
- clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT709)
- # 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 29.97fps
- clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, 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
- # Spot removal using SpotLess
- clip = SpotLess.SpotLess(clip, asearch=5, pel=1)
- # removing grain using SMDegrain
- clip = smdegrain.SMDegrain(clip, tr=3, thSAD=6000, thSADC=6000, interlaced=False, opencl=True, device=-1)
- # adjusting output color from YUV444P12 to YUV420P10 for NVEncModel
- clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, dither_type="error_diffusion")
- # set output frame rate to 29.97fps (progressive)
- clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
- # output
- clip.set_output()
- # script was created by Hybrid 2026.03.02.1
Advertisement
Add Comment
Please, Sign In to add comment