Guest User

Untitled

a guest
Jan 18th, 2026
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.02 KB | None | 0 0
  1. # Imports
  2. import vapoursynth as vs
  3. # getting Vapoursynth core
  4. import sys
  5. import os
  6. core = vs.core
  7. # Limit frame cache to 48449MB
  8. core.max_cache_size = 48449
  9. # Import scripts folder
  10. scriptPath = 'F:/Hybrid/64bit/vsscripts'
  11. sys.path.insert(0, os.path.abspath(scriptPath))
  12. # loading plugins
  13. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/CTMF/CTMF.dll")
  14. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libvs_placebo.dll")
  15. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
  16. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/DeScratch/DeScratch.dll")
  17. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/ZSmooth/zsmooth.dll")
  18. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
  19. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SharpenFilter/CAS/CAS.dll")
  20. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/akarin.dll")
  21. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/FrameFilter/RIFE/librife.dll")
  22. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
  23. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/DGDecNV/DGDecodeNV_AVX2.dll")
  24. # Import scripts
  25. import nnedi3_resample
  26. import smdegrain
  27. import vsdeoldify as havc
  28. import SpotLess
  29. import color
  30. import validate
  31. # Source: 'C:\Users\Selur\Desktop\Zombie clip 35mm.mp4'
  32. # Current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, frame rate: 24fps, scanorder: progressive, yuv luminance scale: limited, matrix: 709, transfer: bt.709, primaries: bt.709, format: AVC
  33. # Loading 'C:\Users\Selur\Desktop\Zombie clip 35mm.mp4' using DGSource
  34. clip = core.dgdecodenv.DGSource("J:/tmp/mp4_6be8ee438587efcb0551ce006000ae5a_853323747.dgi") # 24 fps, scanorder: progressive
  35. frame = clip.get_frame(0)
  36. # setting color matrix to 709.
  37. clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT709)
  38. # setting color transfer (vs.TRANSFER_BT709), if it is not set.
  39. if validate.transferIsInvalid(clip):
  40. clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT709)
  41. # setting color primaries info (to vs.PRIMARIES_BT709), if it is not set.
  42. if validate.primariesIsInvalid(clip):
  43. clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT709)
  44. # setting color range to TV (limited) range.
  45. clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
  46. # making sure frame rate is set to 24fps
  47. clip = core.std.AssumeFPS(clip=clip, fpsnum=24, fpsden=1)
  48. # making sure the detected scan type is set (detected: progressive)
  49. clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # scan type: progressive
  50. # adjusting color space from YUV420P8 to RGBS for vsReplaceSingle
  51. clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="709", range_in_s="limited", range_s="full", dither_type="error_diffusion")
  52. from FillDuplicateFrames import FillDuplicateFrames
  53. fdf = FillDuplicateFrames(clip=clip, mode="Replace", frames=[36, 72, 92], method="rife", sceneThr=0, rifeModel=24)
  54. clip = fdf.out
  55. # adjusting color using Levels on RGBS (32 bit)
  56. clip = core.std.Levels(clip, min_in=90/255.0, max_in=255/255.0, min_out=0/255.0, max_out=255/255.0)
  57. # adjusting color space from RGBS to YUV444PS for vsTweak
  58. clip = core.resize.Bicubic(clip=clip, format=vs.YUV444PS, matrix_s="709", range_in_s="full", range_s="limited") # additional resize to match target color sampling
  59. # adjusting color using Tweak
  60. clip = color.Tweak(clip, hue=0.00, sat=0.00, cont=1.00, coring=True)
  61. # adjusting color space from YUV444PS to YUV444P16 for vsCAS
  62. clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16)
  63. # contrast sharpening using CAS
  64. clip = core.cas.CAS(clip, sharpness=0.700)
  65. # Spot removal using SpotLess
  66. clip = SpotLess.SpotLess(clip, chroma=False, truemotion=False, rec=True, pel=2, smoother="zsmooth")
  67. # adjusting color space from YUV444P16 to YUV444P8 for vsDeScratch
  68. clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8)
  69. # scratch removal using DeScratch
  70. clip = core.descratch.DeScratch(clip, asym=15, modey=3, modeu=3, modev=3, minlen=50, maxgap=5)
  71. clipMerge = clip
  72. clip = core.fmtc.resample(clip=clip, w=720, h=308, kernel="cubic", interlaced=False, interlacedd=False) # resizing for 'Gimmick' (vsHAVC)
  73. # adjusting color space from YUV444P16 to RGB24 for vsHAVC
  74. clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="709", range_in_s="limited", range_s="full")
  75. # adding colors using HAVC
  76. clip = havc.HAVC_main(clip, ColorModel="Stable+Artistic", CombMethod="Adaptive-Luma", ColorTemp="high", ColorFix="none", BlackWhiteTune="medium", BlackWhiteMode=4)
  77. clip = core.fmtc.resample(clip=clip, w=1920, h=1080, kernel="cubic", interlaced=False, interlacedd=False) # undo resizing for 'Gimmick' (vsHAVC)
  78. clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8, matrix_s="709", range_in_s="full", range_s="limited")
  79. clip = core.std.Merge(clipMerge,clip,[0, 1, 1]) # merge filtered and unfiltered by plane
  80. clip = core.std.Crop(clip, left=0, right=0, top=130, bottom=132) # cropping to 1920x818
  81. # adjusting color space from YUV444P8 to YUV444P16 for vsGLSLSaturation
  82. clip = core.resize.Bicubic(clip=clip, dither_type="error_diffusion", format=vs.YUV444P16, range_in_s="limited")
  83. # adjusting saturation using GSLS bSat
  84. with open("F:/Hybrid/64bit/vsfilters/GLSL/parameterized/bSat.hook.glsl") as glslf:
  85. glsl = glslf.read()
  86. glsl = glsl.replace('#define SatFactor 2.43', '#define SatFactor 1.25')
  87. clip = core.placebo.Shader(clip, shader_s=glsl, width=clip.width, height=clip.height)
  88. # removing grain using SMDegrain
  89. clip = smdegrain.SMDegrain(clip, tr=3, contrasharp=70, interlaced=False, opencl=True, device=-1)
  90. # letterboxing 1920x818 to 1920x1080
  91. clip = core.std.AddBorders(clip, left=0, right=0, top=131, bottom=131)
  92. # adjusting output color from YUV444P16 to YUV420P10 for NVEncModel
  93. clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10)
  94. # set output frame rate to 24fps (progressive)
  95. clip = core.std.AssumeFPS(clip=clip, fpsnum=24, fpsden=1)
  96. # output
  97. clip.set_output()
  98. # script was created by Hybrid 2026.01.17.1
Advertisement
Add Comment
Please, Sign In to add comment