Guest User

conventional_crazy

a guest
Nov 27th, 2023
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.56 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/libfftw3-3.dll")
  13. Dllref = ctypes.windll.LoadLibrary("F:/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
  14. # Loading Plugins
  15. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SharpenFilter/CAS/CAS.dll")
  16. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DebandFilter/Flash3kDeband/flash3kyuu_deband.dll")
  17. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SharpenFilter/AWarpSharp2/libawarpsharp2.dll")
  18. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/TCanny.dll")
  19. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/vcm.dll")
  20. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/TTempSmooth/TTempSmooth.dll")
  21. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/DCTFilter.dll")
  22. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DeblockFilter/Deblock/Deblock.dll")
  23. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libtemporalmedian.dll")
  24. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/KNLMeansCL.dll")
  25. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll")
  26. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll")
  27. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
  28. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll")
  29. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/EEDI3m_opencl.dll")
  30. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/NNEDI3CL.dll")
  31. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
  32. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/scenechange.dll")
  33. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
  34. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
  35. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/DeinterlaceFilter/Bwdif/Bwdif.dll")
  36. core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
  37. # Import scripts
  38. import mvsfunc
  39. import muvsfunc
  40. import G41Fun
  41. import SpotLess
  42. import havsfunc
  43. # source: 'C:\Users\Selur\Desktop\Sample Video.avi'
  44. # current color space: YUV422P8, bit depth: 8, resolution: 720x576, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: top field first
  45. # Loading C:\Users\Selur\Desktop\Sample Video.avi using LWLibavSource
  46. clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/Sample Video.avi", format="YUV422P8", stream_index=0, cache=0, prefer_hw=0)
  47. # Setting detected color matrix (470bg).
  48. clip = core.std.SetFrameProps(clip, _Matrix=5)
  49. # Setting color transfer info (470bg), when it is not set
  50. clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=5)
  51. # Setting color primaries info (), when it is not set
  52. clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=5)
  53. # Setting color range to TV (limited) range.
  54. clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
  55. # making sure frame rate is set to 25
  56. clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
  57. clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2) # tff
  58. # Deinterlacing using QTGMC
  59. clip = havsfunc.QTGMC(Input=clip, Preset="Faster", TFF=True, opencl=True) # new fps: 50
  60. # Making sure content is preceived as frame based
  61. clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=0) # progressive
  62. clip = core.std.CropRel(clip=clip, left=10, right=14, top=0, bottom=8)# cropping to 696x568
  63. # denoising using KNLMeansCL
  64. clip = core.knlm.KNLMeansCL(clip=clip, h=4.00, channels="UV")
  65. # Spot removal using SpotLess
  66. clip = SpotLess.SpotLess(clip=clip, radT=3, pel=1)
  67. # denoising using MCTemporalDenoise
  68. clip = havsfunc.MCTemporalDenoise(i=clip, settings="very high", ncpu=1)
  69. # denoising using mClean
  70. clip = G41Fun.mClean(clip=clip)
  71. # contrast sharpening using CAS
  72. clip = core.cas.CAS(clip=clip, sharpness=0.600)
  73. # adjusting output color from: YUV422P8 to YUV420P10 for NVEncModel
  74. clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, range_s="limited")
  75. # set output frame rate to 50fps (progressive)
  76. clip = core.std.AssumeFPS(clip=clip, fpsnum=50, fpsden=1)
  77. # Output
  78. clip.set_output()
Advertisement
Add Comment
Please, Sign In to add comment