Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 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/SharpenFilter/AWarpSharp2/libawarpsharp2.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/CTMF/CTMF.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/TCanny.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/GrainFilter/AddGrain/AddGrain.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/EEDI3m_opencl.dll")# vsQTGMC
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/NNEDI3CL.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/scenechange.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DeinterlaceFilter/Bwdif/Bwdif.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll")
- # Import scripts
- import mcdegrainsharp
- import havsfunc
- import validate
- # Source: 'C:\Users\Selur\Desktop\blackmagic.avi'
- # Current color space: YUV420P8, bit depth: 8, resolution: 720x576, frame rate: 25fps, scanorder: top field first, yuv luminance scale: limited, matrix: 470bg
- # Loading C:\Users\Selur\Desktop\blackmagic.avi using LWLibavSource
- clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/blackmagic.avi", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0)
- frame = clip.get_frame(0)
- # Setting detected color matrix (470bg).
- clip = core.std.SetFrameProps(clip=clip, _Matrix=5)
- # setting color transfer (170), if it is not set.
- if validate.transferIsInvalid(clip):
- clip = core.std.SetFrameProps(clip=clip, _Transfer=6)
- # setting color primaries info (to 470), if it is not set.
- if validate.primariesIsInvalid(clip):
- clip = core.std.SetFrameProps(clip=clip, _Primaries=5)
- # setting color range to TV (limited) range.
- clip = core.std.SetFrameProps(clip=clip, _ColorRange=1)
- # making sure frame rate is set to 25fps
- clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
- # making sure the detected scan type is set (detected: top field first)
- clip = core.std.SetFrameProps(clip=clip, _FieldBased=2) # tff
- # Deinterlacing using QTGMC
- clip = havsfunc.QTGMC(Input=clip, Preset="Fast", TFF=True, opencl=True) # new fps: 50
- # Making sure content is preceived as frame based
- clip = core.std.SetFrameProps(clip=clip, _FieldBased=0) # progressive
- # applying deblocking using DeBlock QED
- clip = havsfunc.Deblock_QED(clip)
- # removing grain using MCDegrain
- clip = mcdegrainsharp.mcdegrainsharp(clip=clip, csharp=0.50)
- # applying dehalo using YAHR
- clip = havsfunc.YAHR(clip, depth=16)
- # 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 50fps (progressive)
- clip = core.std.AssumeFPS(clip=clip, fpsnum=50, fpsden=1)
- # output
- clip.set_output()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement