Guest User

Untitled

a guest
Apr 15th, 2026
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.70 KB | None | 0 0
  1. # Imports
  2. import sys
  3. import os
  4. import vapoursynth as vs
  5. # getting Vapoursynth core
  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/FrameFilter/ReduceFlicker/ReduceFlicker.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/fmtconv.dll")
  18. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/DGDecNV/DGDecodeNV_AVX2.dll")
  19. # Import scripts
  20. import SpotLess
  21. import validate
  22. # Source: 'C:\Users\Selur\Desktop\Doraemon (1979) - 1144 (CS298 1440x1080 MPEG2-TS)_1.ts'
  23. # Current color space: YUV420P8, bit depth: 8, resolution: 1440x1080, frame rate: 29.97fps, scanorder: progressive, yuv luminance scale: limited, matrix: 709, transfer: bt.709, primaries: bt.709, format: mpeg-2
  24. # Loading 'C:\Users\Selur\Desktop\Doraemon (1979) - 1144 (CS298 1440x1080 MPEG2-TS)_1.ts' using DGSource
  25. clip = core.dgdecodenv.DGSource("J:/tmp/ts_72e02d208e015990b0aa04e6aa7ad43f_853323747.dgi") # 29.97 fps, scanorder: progressive
  26. frame = clip.get_frame(0)
  27. # setting color matrix to 709.
  28. clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT709)
  29. # setting color transfer (vs.TRANSFER_BT709), if it is not set.
  30. if validate.transferIsInvalid(clip):
  31. clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT709)
  32. # setting color primaries info (to vs.PRIMARIES_BT709), if it is not set.
  33. if validate.primariesIsInvalid(clip):
  34. clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT709)
  35. # setting color range to TV (limited) range.
  36. prop_name = '_Range' if core.core_version.release_major >= 74 else '_ColorRange'
  37. clip = core.std.SetFrameProps(clip=clip, **{prop_name: vs.RANGE_LIMITED})
  38. # making sure frame rate is set to 29.97fps
  39. clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
  40. # making sure the detected scan type is set (detected: progressive)
  41. clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # scan type: progressive
  42. clip = core.std.Crop(clip, left=186, right=186, top=6, bottom=4) # cropping to 1068x1070
  43. clip = core.fmtc.resample(clip=clip, w=640, h=640, kernel="cubic", interlaced=False, interlacedd=False) # resizing for 'Gimmick' (vsSpotLess)
  44. # Spot removal using SpotLess
  45. clip = SpotLess.SpotLess(clip, rec=True, pel=1, smoother="zsmooth")
  46. # removing flickering using ReduceFlicker
  47. clip = core.rdfl.ReduceFlicker(clip, strength=3, aggressive=1)
  48. # adjusting color space from YUV420P16 to RGBH for vsBasicVSRPPFilter
  49. clip = core.resize.Bicubic(clip=clip, format=vs.RGBH, matrix_in_s="709", range_in_s="limited", range_s="full")
  50. # Quality enhancement using BasicVSR++
  51. from vsbasicvsrpp import basicvsrpp as BasicVSRPP
  52. clip = BasicVSRPP(clip, model=4)
  53. clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, dither_type="error_diffusion")
  54. # Resizing using 10 - bicubic spline
  55. clip = core.fmtc.resample(clip, kernel="spline16", w=1358, h=1020, interlaced=False, interlacedd=False) # resolution 1358x1020
  56. # adjusting output color from RGBS to YUV420P10 for NVEncModel
  57. clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="709", range_in_s="full", range_s="limited") # additional resize to match target color sampling
  58. # set output frame rate to 29.97fps (progressive)
  59. clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
  60. # output
  61. clip.set_output()
  62. # script was created by Hybrid 2026.04.15.1
Advertisement
Add Comment
Please, Sign In to add comment