Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Imports
- import sys
- import os
- import vapoursynth as vs
- # using Vapoursynth R78
- # getting Vapoursynth core
- 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/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/fmtconv.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SharpenFilter/AWarpSharp2/libawarpsharp2.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/zsmooth/zsmooth.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/mvutensils/mvutensils.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/akarin/libakarin.dll")
- core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/DGDecNV/DGDecodeNV_AVX2.dll")
- # Import scripts
- import sharpen
- import edge
- import SpotLess
- import color
- import chromashift
- import validate
- # Source: 'C:\Users\Selur\Desktop\U-MATIC.mp4'
- # clip current meta; color space: YUV420P8, bit depth: 8, resolution: 960x720, fps: 59.94, color matrix: 709, color primaries: Unspecific, color transfer: BT.709, yuv luminance scale: limited, scanorder: progressive, full height: true (Source)
- # Loading 'C:\Users\Selur\Desktop\U-MATIC.mp4' using DGSource
- clip = core.dgdecodenv.DGSource("J:/tmp/mp4_e1f516cc55688f3f8b976a560aca7ee4_853323747.dgi") # 59.94 fps, scanorder: progressive
- frame = clip.get_frame(0)
- # setting color matrix to 709.
- clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT709)
- # setting color transfer (vs.TRANSFER_BT709), if it is not set.
- if validate.transferIsInvalid(clip):
- clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT709)
- # setting color primaries info (to vs.PRIMARIES_BT709), if it is not set.
- if validate.primariesIsInvalid(clip):
- clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT709)
- # setting color range to TV (limited) range.
- prop_name = '_Range' if core.core_version.release_major >= 74 else '_ColorRange'
- clip = core.std.SetFrameProps(clip=clip, **{prop_name: vs.RANGE_LIMITED})
- # making sure frame rate is set to 59.94fps
- clip = core.std.AssumeFPS(clip=clip, fpsnum=60000, 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
- # Chroma adjustment using ChromaShiftSP
- clip = chromashift.ChromaShiftSP(clip, X=10.00)
- # adjusting color space from YUV420P8 to RGB24 for vsRGBAdjust
- clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="709", range_in_s="limited", range_s="full")
- # color adjustment using RGBAdjust
- clip = color.RGBAdjust(clip, rb=-30.000, gb=-10.000, bb=-15.000, rg=1.100, gg=1.200, bg=1.100)
- # adjusting color space from RGB24 to YUV444P8 for vsSpotLess
- clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8, matrix_s="709", range_in_s="full", range_s="limited")
- # Spot removal using SpotLess
- clip = SpotLess.SpotLess(clip, radT=3, rec=True, pel=1)
- clip = core.std.Crop(clip, left=20, right=20, top=0, bottom=0) # cropping to 920x720
- # Fix bright and dark line artifacts near the border of an image using BalanceBorders
- clip = edge.bbmod(clip, cLeft=0, cTop=0, cRight=12, cBottom=0)
- # sharpening using AWarpSharp2
- clip = sharpen.AWarpSharp2(clip, blur=2, depth=32, chroma=True, planes=[1,2])
- # Resizing using 10 - bicubic spline
- clip = core.fmtc.resample(clip, kernel="spline16", w=1920, h=1504, interlaced=False, interlacedd=False) # resolution 1920x1504 before YUV444P8 after YUV444P16
- # adjusting output color from YUV444P16 to YUV420P10 for NVEncModel
- clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, dither_type="error_diffusion")
- # set output frame rate to 59.94fps (progressive)
- clip = core.std.AssumeFPS(clip=clip, fpsnum=60000, fpsden=1001)
- # output
- clip.set_output()
- # clip current meta; color space: YUV420P10, bit depth: 10, resolution: 1920x1504, fps: 59.94, color matrix: 709, color primaries: Unspecific, color transfer: BT.709, yuv luminance scale: limited, scanorder: progressive, full height: true (Meta)
- # script was created by Hybrid 2026.07.30.1
Advertisement
Add Comment
Please, Sign In to add comment