Guest User

Untitled

a guest
Mar 3rd, 2026
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 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/ZSmooth/zsmooth.dll")
  14. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/CTMF/CTMF.dll")
  15. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
  16. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libtemporalmedian.dll")
  17. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
  18. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/akarin.dll")
  19. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/BestSource/BestSource.dll")
  20. # Import scripts
  21. import nnedi3_resample
  22. import smdegrain
  23. import SpotLess
  24. import validate
  25. # Source: 'C:\Users\Selur\Desktop\test_20000.mov'
  26. # Current color space: YUV444P12, bit depth: 12, resolution: 760x488, frame rate: 29.97fps, scanorder: progressive, yuv luminance scale: limited, matrix: 709, format: prores
  27. # Loading 'C:\Users\Selur\Desktop\test_20000.mov' using BestSource
  28. clip = core.bs.VideoSource(source="C:/Users/Selur/Desktop/test_20000.mov", cachepath="J:/tmp/test_20000_bestSource", track=0, hwdevice="opencl")
  29. frame = clip.get_frame(0)
  30. # setting color matrix to 709.
  31. clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT709)
  32. # setting color transfer (vs.TRANSFER_BT601), if it is not set.
  33. if validate.transferIsInvalid(clip):
  34. clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT601)
  35. # setting color primaries info (to vs.PRIMARIES_BT470_BG), if it is not set.
  36. if validate.primariesIsInvalid(clip):
  37. clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT470_BG)
  38. # setting color range to TV (limited) range.
  39. clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
  40. # making sure frame rate is set to 29.97fps
  41. clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
  42. # making sure the detected scan type is set (detected: progressive)
  43. clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # scan type: progressive
  44. # Spot removal using SpotLess
  45. clip = SpotLess.SpotLess(clip, asearch=5, pel=1)
  46. # removing grain using SMDegrain
  47. clip = smdegrain.SMDegrain(clip, tr=3, thSAD=6000, thSADC=6000, interlaced=False, opencl=True, device=-1)
  48. # adjusting output color from YUV444P12 to YUV420P10 for NVEncModel
  49. clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, dither_type="error_diffusion")
  50. # set output frame rate to 29.97fps (progressive)
  51. clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
  52. # output
  53. clip.set_output()
  54. # script was created by Hybrid 2026.03.02.1
Advertisement
Add Comment
Please, Sign In to add comment