Advertisement
Guest User

Untitled

a guest
Apr 25th, 2025
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 KB | None | 0 0
  1. # Imports
  2. import vapoursynth as vs
  3. # getting Vapoursynth core
  4. import ctypes
  5. import sys
  6. import os
  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 Support Files
  12. Dllref = ctypes.windll.LoadLibrary("F:/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
  13. # loading plugins
  14. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/ZSmooth/zsmooth.dll")
  15. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll")
  16. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll")
  17. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
  18. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/EEDI3m_opencl.dll")# vsQTGMC
  19. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/NNEDI3CL.dll")
  20. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
  21. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
  22. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DeinterlaceFilter/Bwdif/Bwdif.dll")
  23. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll")
  24.  
  25. # Import scripts
  26. import misc
  27. import qtgmc
  28. import validate
  29. # Source: 'C:\Users\Selur\Desktop\input.avi'
  30. # Current color space: YUV422P8, bit depth: 8, resolution: 720x480, frame rate: 29.97fps, scanorder: top field first, yuv luminance scale: limited, matrix: 470bg, format: Lagarith
  31. # Loading C:\Users\Selur\Desktop\input.avi using LWLibavSource
  32. clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/input.avi", format="YUV422P8", stream_index=0, cache=0, prefer_hw=0)
  33. frame = clip.get_frame(0)
  34. # setting color matrix to 470bg.
  35. clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT470_BG)
  36. # setting color transfer (vs.TRANSFER_BT601), if it is not set.
  37. if validate.transferIsInvalid(clip):
  38. clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT601)
  39. # setting color primaries info (to vs.PRIMARIES_BT470_BG), if it is not set.
  40. if validate.primariesIsInvalid(clip):
  41. clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT470_BG)
  42. # setting color range to TV (limited) range.
  43. clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
  44. # making sure frame rate is set to 29.97fps
  45. clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
  46. # making sure the detected scan type is set (detected: top field first)
  47. clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_TOP) # tff
  48. # Deinterlacing using QTGMC
  49. clip = qtgmc.QTGMC(Input=clip, Preset="Fast", TFF=True, opencl=True) # new fps: 59.94
  50. # Making sure content is preceived as frame based
  51. clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
  52.  
  53. # adjusting color format to YUV444P8 for custom section
  54. clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8, range_s="limited")
  55.  
  56.  
  57. clip = misc.ShiftLinesHorizontally(clip, shift=18, ymin=468, ymax=479)
  58.  
  59. # output
  60. clip.set_output()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement