Guest User

Untitled

a guest
Nov 10th, 2026
4
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.91 KB | None | 0 0
  1. # Imports
  2. import sys
  3. import os
  4. import vapoursynth as vs
  5. # using Vapoursynth R82
  6. # getting Vapoursynth core
  7. core = vs.core
  8. # Import scripts folder
  9. scriptPath = 'F:/Hybrid/64bit/vsscripts'
  10. sys.path.insert(0, os.path.abspath(scriptPath))
  11. # loading plugins
  12. core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/znedi3.dll")
  13. core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/fmtconv.dll")
  14. core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/vszip/vszip.dll")
  15. core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/mvutensilsvk.dll")
  16. core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/zsmooth/zsmooth.dll")
  17. core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/mvutensils/mvutensils.dll")
  18. core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/akarin/libakarin.dll")
  19. core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/descratch.dll")
  20. core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/cas.dll")
  21. core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/AutoAdjust.dll")
  22. core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/libvs_placebo.dll")
  23. core.std.LoadPlugin(path="F:/Hybrid/64bit/Vapoursynth/Lib/site-packages/vapoursynth/plugins2/LSMASHSource.dll")
  24. # Import scripts
  25. import edi_rpow2
  26. import fromDoom9
  27. import killerspots
  28. import SpotLess
  29. import sharpen
  30. import validate
  31. # Source: 'G:\clips\comets tracking artifacts\the-letter_1929.mp4'
  32. # clip current meta; color space: YUV420P8, bit depth: 8, resolution: 640x480, fps: 23.976, color matrix: 470bg, color primaries: Unspecific, color transfer: Unspecified, yuv luminance scale: limited, scanorder: progressive, full height: true (Source)
  33. # Loading 'G:\clips\comets tracking artifacts\the-letter_1929.mp4' using LWLibavSource
  34. clip = core.lsmas.LWLibavSource(source="G:/clips/comets tracking artifacts/the-letter_1929.mp4", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0)
  35. frame = clip.get_frame(0)
  36. # setting color matrix to 470bg.
  37. clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT470_BG)
  38. # setting color transfer (vs.TRANSFER_BT601), if it is not set.
  39. if validate.transferIsInvalid(clip):
  40. clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT601)
  41. # setting color primaries info (to vs.PRIMARIES_BT470_BG), if it is not set.
  42. if validate.primariesIsInvalid(clip):
  43. clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT470_BG)
  44. # setting color range to TV (limited) range.
  45. prop_name = '_Range' if core.core_version.release_major >= 74 else '_ColorRange'
  46. clip = core.std.SetFrameProps(clip=clip, **{prop_name: vs.RANGE_LIMITED})
  47. # making sure frame rate is set to 23.976fps
  48. clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
  49. # making sure the detected scan type is set (detected: progressive)
  50. clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # scan type: progressive
  51. # adjusting color space from YUV420P8 to YUV444P16 for vsGLSLSaturation
  52. clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16)
  53. # adjusting saturation using GSLS bSat
  54. with open("F:/Hybrid/64bit/vsfilters/GLSL/parameterized/bSat.hook.glsl") as glslf:
  55. glsl = glslf.read()
  56. glsl = glsl.replace('#define SatFactor 2.43', '#define SatFactor 0')
  57. clip = core.placebo.Shader(clip, shader_s=glsl, width=clip.width, height=clip.height)
  58. # adjusting levels, gamma, saturation and white balance using AutoAdjust
  59. clip = core.autoadjust.AutoAdjust(clip, auto_gain=True, gain_mode=1, chroma_process=0, auto_balance=True, high_quality=True)
  60. # contrast sharpening using CAS
  61. clip = core.cas.CAS(clip, planes=[0])
  62. # adjusting color space from YUV444P16 to YUV444P8 for vsDeScratch
  63. clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8, dither_type="error_diffusion")
  64. # scratch removal using DeScratch
  65. clip = core.descratch.DeScratch(clip, asym=30, mindif=10, modey=3, minlen=80, maxgap=2)
  66. # sharpening using DetailSharpen
  67. clip = sharpen.DetailSharpen(clip, power=2.000, tools={'expr': 'akarin', 'median': 'zsmooth'})
  68. # Spot removal using SpotLess
  69. clip = SpotLess.SpotLess(clip, chroma=False, radT=3, asearch=5, truemotion=False, rec=True, fasthbd=True, pel=1, mStart=True, mEnd=True, tools={'mv': 'mvutensils', 'expr': 'akarin', 'tmedian': 'zsmooth', 'ttempsmooth': 'zsmooth', 'boxblur': 'vszip', 'hysteresis': 'hysteresis'})
  70. # spot/dirt removal using KillerSpots
  71. clip = killerspots.KillerSpots(clip, tools={'mv': 'mvutensils', 'rg': 'zsmooth', 'removedirt': 'removedirt'})
  72. # VHS denoising with motion-compensation
  73. clip = fromDoom9.VHSClean(clip, blur_sharp=False, tools={'mv': 'mvgpu', 'expr': 'akarin', 'boxblur': 'vszip'})
  74. # resizing using ZNEDI3
  75. # current: 640x480 target: 1920x1440
  76. clip = edi_rpow2.nnedi3_rpow2(clip, rfactor=4, tools={'nnedi3': 'znedi3'}) # 2560x1920
  77. # resizing 2560x1920 to 1920x1440
  78. clip = core.fmtc.resample(clip, w=1920, h=1440, kernel="spline64", interlaced=False, interlacedd=False) # before YUV444P8 after YUV444P16
  79. # adjusting output color from YUV444P16 to YUV420P10 for NVEncModel
  80. clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, dither_type="error_diffusion")
  81. # set output frame rate to 23.976fps (progressive)
  82. clip = core.std.AssumeFPS(clip=clip, fpsnum=24000, fpsden=1001)
  83. # set output pixel aspect ratio to 1:1
  84. clip = core.std.SetFrameProps(clip=clip, _SARNum=1, _SARDen=1)
  85. # output
  86. clip.set_output()
  87. # clip current meta; color space: YUV420P10, bit depth: 10, resolution: 1920x1440, fps: 23.976, color matrix: 470bg, color primaries: Unspecific, color transfer: Unspecified, yuv luminance scale: limited, scanorder: progressive, full height: true (Meta)
  88. # script was created by Hybrid 2026.11.10.1
Advertisement
Add Comment
Please, Sign In to add comment