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/SharpenFilter/CAS/CAS.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/SharpenFilter/AWarpSharp2/libawarpsharp2.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DebandFilter/Flash3kDeband/flash3kyuu_deband.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/GrainFilter/RemoveGrain/RemoveGrainVS.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/FFT3DFilter/fft3dfilter.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/EEDI3m.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/NNEDI3CL.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/scenechange.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DeinterlaceFilter/Bwdif/Bwdif.dll")
- core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
- # Import scripts
- import havsfunc
- # source: 'C:\Users\Selur\Desktop\Donna-Summer-2-tff.mp4'
- # current color space: YUV422P10, bit depth: 10, resolution: 760x488, fps: 29.97, color matrix: 709, yuv luminance scale: limited, scanorder: top field first
- # Loading C:\Users\Selur\Desktop\Donna-Summer-2-tff.mp4 using LibavSMASHSource
- clip = core.lsmas.LibavSMASHSource(source="C:/Users/Selur/Desktop/Donna-Summer-2-tff.mp4")
- # Setting color matrix to 709.
- clip = core.std.SetFrameProps(clip, _Matrix=1)
- clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=1)
- 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 29.970
- clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
- clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2)
- # setting field order to what QTGMC should assume (top field first)
- clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2)
- # Deinterlacing using QTGMC
- clip = havsfunc.QTGMC(Input=clip, Preset="Fast", TFF=True, opencl=True) # new fps: 59.94
- # make sure content is preceived as frame based
- clip = core.std.SetFieldBased(clip, 0)
- # applying deblocking using DeBlock QED
- clip = havsfunc.Deblock_QED(clip, aOff1=2, aOff2=3, bOff1=2, bOff2=3, uv=1)
- # cropping the video to 742x482
- clip = core.std.CropRel(clip=clip, left=10, right=8, top=4, bottom=2)
- ## Starting applying 'EdgeMask (Prewitt)' masked filtering for vsDFTTest
- clipMask = clip
- clipMask = core.std.ShufflePlanes(clipMask, 0, vs.GRAY)
- clipMask = core.std.Prewitt(clip=clipMask)
- clipMask = core.std.InvertMask(clipMask)
- clipFiltered = clip
- # denoising using DFTTest
- clipFiltered = core.dfttest.DFTTest(clip=clipFiltered, sigma=50.00, sigma2=30.00)
- clip = core.std.MaskedMerge(clip, clipFiltered, clipMask)
- ## Finished applying 'Edgemask (Prewitt)' masked filtering for vsDFTTest
- # debanding using f3kdb
- clip = core.f3kdb.Deband(clip, keep_tv_range=True, output_depth=16)
- # sharpening using AWarpSharp2
- clip = core.warp.AWarpSharp2(clip=clip, thresh=255, blur=2, depth=8, planes=[1,2])
- # contrast sharpening using CAS
- clip = core.cas.CAS(clip=clip, sharpness=0.600)
- # Resizing using 10 - bicubic spline
- clip = core.fmtc.resample(clip=clip, kernel="spline16", w=884, h=488, interlaced=False, interlacedd=False) # resolution 884x488
- # adjusting output color from: YUV422P16 to YUV422P10 for x265Model
- clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, range_s="limited", dither_type="none")
- # set output frame rate to 59.94fps
- clip = core.std.AssumeFPS(clip=clip, fpsnum=60000, fpsden=1001)
- # Output
- clip.set_output()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement