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/Support/EEDI3m.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/vsznedi3.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.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/NEO_FFT3DFilter/neo-fft3d.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.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/SourceFilter/DGDecNV/DGDecodeNV.dll")
- # defining beforeQTGMCFilter-function - START
- def beforeQTGMCFilter(clip):
- clip = core.std.Transpose(clip)
- return clip
- # defining beforeQTGMCFilter-function - END
- # defining beforeCnr2-function - START
- def beforeCnr2(clip):
- clip = core.std.Transpose(clip)
- return clip
- # defining beforeCnr2-function - END
- # Import scripts
- import havsfunc
- # source: 'C:\Users\Selur\Desktop\sample.mkv'
- # current color space: YUV420P8, bit depth: 8, resolution: 720x576, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
- # Loading C:\Users\Selur\Desktop\sample.mkv using DGSource
- clip = core.dgdecodenv.DGSource("J:/tmp/mkv_db12488da61ced703c8f93b70430eca5_853323747.dgi")# 25 fps, scanorder: progressive
- frame = clip.get_frame(0)
- # Setting detected color matrix (470bg).
- clip = core.std.SetFrameProps(clip, _Matrix=5)
- # Setting color transfer (to 470bg), if it is not set.
- if '_Transfer' not in frame.props or not frame.props['_Transfer']:
- clip = core.std.SetFrameProps(clip, _Transfer=5)
- # Setting color primaries info (to 5), if it is not set.
- if '_Primaries' not in frame.props or not frame.props['_Primaries']:
- clip = 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 25
- clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
- clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=0) # progressive
- clip = beforeQTGMCFilter(clip)
- # Denoising using QTGMC
- clip = havsfunc.QTGMC(Input=clip, Preset="Fast", InputType=3, TR2=1, TFF=False, SourceMatch=0, Lossless=0)
- clip = beforeCnr2(clip)
- # 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 25fps (progressive)
- clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
- # Output
- clip.set_output()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement