Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Imports
- import vapoursynth as vs
- import os
- import ctypes
- # Loading Support Files
- Dllref = ctypes.windll.LoadLibrary("i:/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
- import sys
- # getting Vapoursynth core
- core = vs.core
- # Import scripts folder
- scriptPath = 'i:/Hybrid/64bit/vsscripts'
- sys.path.insert(0, os.path.abspath(scriptPath))
- # Loading Plugins
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/TTempSmooth/TTempSmooth.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/DCTFilter.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DeblockFilter/Deblock/Deblock.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/libtemporalmedian.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
- # Import scripts
- import havsfunc
- import SpotLess
- import lostfunc
- # source: 'C:\Users\Selur\Desktop\tracking error example.avi'
- # current color space: YUV420P8, bit depth: 8, resolution: 634x480, fps: 15, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
- # Loading C:\Users\Selur\Desktop\tracking error example.avi using LWLibavSource
- clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/tracking error example.avi", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0)
- # Setting color matrix to 470bg.
- clip = core.std.SetFrameProps(clip, _Matrix=5)
- clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=5)
- clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=5)
- # Setting color range to TV (limited) range.
- clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
- # making sure frame rate is set to 15
- clip = core.std.AssumeFPS(clip=clip, fpsnum=15, fpsden=1)
- for i in range(5):
- clip = lostfunc.DeSpot(o=clip)
- clip = SpotLess.SpotLess(clip=clip, chroma=False, radT=9)
- clip = core.std.AddBorders(clip=clip, left=0, right=6, top=0, bottom=0) # add borders to archive mod 8 (vsBasicVSRPPFilter) - 640x480
- # adjusting color space from YUV420P8 to RGBS for vsBasicVSRPPFilter
- clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_s="limited")
- # Quality enhancement using BasicVSR++
- from vsbasicvsrpp import BasicVSRPP
- clip = BasicVSRPP(clip=clip, model=3, fp16=True)
- clip = core.std.CropRel(clip=clip, left=0, right=6, top=0, bottom=0) # removing borders (vsBasicVSRPPFilter) - 634x480
- clip = core.std.AddBorders(clip=clip, left=0, right=2, top=0, bottom=0) # add borders to archive mod 4 (vsMCT) - 636x480
- # adjusting color space from RGBS to YUV444P16 for vsMCT
- clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, matrix_s="470bg", range_s="limited", dither_type="error_diffusion")
- # denoising using MCTemporalDenoise
- clip = havsfunc.MCTemporalDenoise(i=clip, settings="very high", ncpu=1)
- clip = core.std.CropRel(clip=clip, left=0, right=2, top=0, bottom=0) # removing borders (vsMCT) - 634x480
- # adjusting output color from: YUV444P16 to YUV420P10 for x265Model
- clip = core.resize.Bicubic(clip=clip, dither_type="error_diffusion", format=vs.YUV420P10, range_s="limited")
- # Output
- clip.set_output()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement