Advertisement
Guest User

Untitled

a guest
Oct 15th, 2022
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. # Imports
  2. import vapoursynth as vs
  3. import os
  4. import ctypes
  5. # Loading Support Files
  6. Dllref = ctypes.windll.LoadLibrary("i:/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
  7. import sys
  8. # getting Vapoursynth core
  9. core = vs.core
  10. # Import scripts folder
  11. scriptPath = 'i:/Hybrid/64bit/vsscripts'
  12. sys.path.insert(0, os.path.abspath(scriptPath))
  13. # Loading Plugins
  14. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
  15. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/TTempSmooth/TTempSmooth.dll")
  16. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
  17. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll")
  18. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/DCTFilter.dll")
  19. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DeblockFilter/Deblock/Deblock.dll")
  20. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/libtemporalmedian.dll")
  21. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
  22. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll")
  23. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
  24. # Import scripts
  25. import havsfunc
  26. import SpotLess
  27. import lostfunc
  28. # source: 'C:\Users\Selur\Desktop\tracking error example.avi'
  29. # current color space: YUV420P8, bit depth: 8, resolution: 634x480, fps: 15, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
  30. # Loading C:\Users\Selur\Desktop\tracking error example.avi using LWLibavSource
  31. clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/tracking error example.avi", format="YUV420P8", stream_index=0, cache=0, prefer_hw=0)
  32. # Setting color matrix to 470bg.
  33. clip = core.std.SetFrameProps(clip, _Matrix=5)
  34. clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=5)
  35. clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=5)
  36. # Setting color range to TV (limited) range.
  37. clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
  38. # making sure frame rate is set to 15
  39. clip = core.std.AssumeFPS(clip=clip, fpsnum=15, fpsden=1)
  40. for i in range(5):
  41. clip = lostfunc.DeSpot(o=clip)
  42. clip = SpotLess.SpotLess(clip=clip, chroma=False, radT=9)
  43. clip = core.std.AddBorders(clip=clip, left=0, right=6, top=0, bottom=0) # add borders to archive mod 8 (vsBasicVSRPPFilter) - 640x480
  44. # adjusting color space from YUV420P8 to RGBS for vsBasicVSRPPFilter
  45. clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_s="limited")
  46. # Quality enhancement using BasicVSR++
  47. from vsbasicvsrpp import BasicVSRPP
  48. clip = BasicVSRPP(clip=clip, model=3, fp16=True)
  49. clip = core.std.CropRel(clip=clip, left=0, right=6, top=0, bottom=0) # removing borders (vsBasicVSRPPFilter) - 634x480
  50. clip = core.std.AddBorders(clip=clip, left=0, right=2, top=0, bottom=0) # add borders to archive mod 4 (vsMCT) - 636x480
  51. # adjusting color space from RGBS to YUV444P16 for vsMCT
  52. clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, matrix_s="470bg", range_s="limited", dither_type="error_diffusion")
  53. # denoising using MCTemporalDenoise
  54. clip = havsfunc.MCTemporalDenoise(i=clip, settings="very high", ncpu=1)
  55. clip = core.std.CropRel(clip=clip, left=0, right=2, top=0, bottom=0) # removing borders (vsMCT) - 634x480
  56. # adjusting output color from: YUV444P16 to YUV420P10 for x265Model
  57. clip = core.resize.Bicubic(clip=clip, dither_type="error_diffusion", format=vs.YUV420P10, range_s="limited")
  58. # Output
  59. clip.set_output()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement