Guest User

Untitled

a guest
Mar 5th, 2026
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 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/DenoiseFilter/ZSmooth/zsmooth.dll")
  15. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
  16. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/akarin.dll")
  17. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/vszip.dll")
  18. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DeCrawlFilter/DotKill/DotKill.dll")
  19. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SharpenFilter/CAS/CAS.dll")
  20. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libsangnom.dll")
  21. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
  22. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/EEDI2.dll")
  23. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/EEDI3m_opencl.dll")
  24. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/NNEDI3CL.dll")
  25. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/vcm.dll")
  26. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/BestSource/BestSource.dll")
  27. # Import scripts
  28. import nnedi3_resample
  29. import smdegrain
  30. import SpotLess
  31. import residual
  32. import antiAliasing
  33. import validate
  34. # Source: 'G:\clips\drop outs - comets\test_20000.mov'
  35. # Current color space: YUV444P12, bit depth: 12, resolution: 760x488, frame rate: 29.97fps, scanorder: progressive, yuv luminance scale: limited, matrix: 709, format: prores
  36. # Loading 'G:\clips\drop outs - comets\test_20000.mov' using BestSource
  37. clip = core.bs.VideoSource(source="G:/clips/drop outs - comets/test_20000.mov", cachepath="J:/tmp/test_20000_bestSource", track=0, hwdevice="opencl")
  38. frame = clip.get_frame(0)
  39. # setting color matrix to 709.
  40. clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT709)
  41. # setting color transfer (vs.TRANSFER_BT601), if it is not set.
  42. if validate.transferIsInvalid(clip):
  43. clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT601)
  44. # setting color primaries info (to vs.PRIMARIES_BT470_BG), if it is not set.
  45. if validate.primariesIsInvalid(clip):
  46. clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT470_BG)
  47. # setting color range to TV (limited) range.
  48. clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
  49. # making sure frame rate is set to 29.97fps
  50. clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
  51. # making sure the detected scan type is set (detected: progressive)
  52. clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # scan type: progressive
  53. # Adjusting color sampling to YUV444P16 for vsDeJitterGimmick
  54. clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, dither_type="error_diffusion")
  55. # remove jitter using DeJitter
  56. clip = core.vcm.DeJitter(clip, jmax=10, wsyn=4, thresh=0.03)
  57. # applying anti aliasing using santiag
  58. clip = antiAliasing.santiag(clip, type="sangnom", opencl=True)
  59. # contrast sharpening using CAS
  60. clip = core.cas.CAS(clip, sharpness=1.000)
  61. # adjusting color space from YUV444P16 to YUV444P8 for vsDotKill
  62. clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8)
  63. clip = core.dotkill.DotKillS(clip)
  64. clip = core.vszip.Checkmate(clip, tmax=80)
  65. clip = residual.Vinverse(clip, sstr=100.00)
  66. # Spot removal using SpotLess
  67. clip = SpotLess.SpotLess(clip, pel=1, smoother="zsmooth")
  68. clip = core.std.Crop(clip, left=4, right=14, top=4, bottom=4) # cropping to 742x480
  69. # removing grain using SMDegrain
  70. clip = smdegrain.SMDegrain(clip, tr=3, thSAD=600, thSADC=356, contrasharp=50, interlaced=False, chroma=False, opencl=True, device=-1)
  71. # adjusting output color from YUV444P8 to YUV420P10 for NVEncModel
  72. clip = core.resize.Bicubic(clip=clip, dither_type="error_diffusion", format=vs.YUV420P10, range_in_s="limited")
  73. # set output frame rate to 29.97fps (progressive)
  74. clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
  75. # output
  76. clip.set_output()
  77. # script was created by Hybrid 2026.03.05.1
Advertisement
Add Comment
Please, Sign In to add comment