Guest User

Untitled

a guest
Feb 1st, 2023
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 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/Support/EEDI3m.dll")
  15. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/vsznedi3.dll")
  16. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
  17. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll")
  18. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll")
  19. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/FFT3DFilter/fft3dfilter.dll")
  20. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
  21. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/scenechange.dll")
  22. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
  23. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/libtemporalmedian.dll")
  24. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
  25. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/MiscFilter/EdgeFixer/EdgeFixer.dll")
  26. core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
  27. # Import scripts
  28. import muvsfunc
  29. import havsfunc
  30. import SpotLess
  31. import autowhite
  32. # source: 'C:\Users\Selur\Desktop\sample.avi'
  33. # current color space: YUV422P8, bit depth: 8, resolution: 720x576, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
  34. # Loading C:\Users\Selur\Desktop\sample.avi using LWLibavSource
  35. clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/sample.avi", format="YUV422P8", stream_index=1, cache=0, prefer_hw=0)
  36. # Setting detected color matrix (470bg).
  37. clip = core.std.SetFrameProps(clip, _Matrix=5)
  38. # Setting color transfer info, when it is not set
  39. clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=5)
  40. # Setting color primaries info, when it is not set
  41. clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=5)
  42. # Setting color range to TV (limited) range.
  43. clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
  44. # making sure frame rate is set to 25
  45. clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
  46. clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=0)
  47. # adjusting color space from YUV422P8 to RGB24 for vsAutoWhite
  48. clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="470bg", range_s="limited")
  49. # Color Adjustment
  50. clip = autowhite.AutoWhite(clip=clip)
  51. # adjusting color space from RGB24 to YUV444P8 for vsEdgeFixer
  52. clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8, matrix_s="470bg", range_s="limited")
  53. # Fix bright and dark line artifacts near the border of an image using EdgeFixer
  54. clip = core.edgefixer.Continuity(clip=clip,bottom=16,radius=3)
  55. clip = SpotLess.SpotLess(clip=clip, radT=1)
  56. # cropping the video to 688x568
  57. clip = core.std.CropRel(clip=clip, left=20, right=12, top=4, bottom=4)
  58. # Denoising using QTGMC
  59. clip = havsfunc.QTGMC(Input=clip, Preset="Slower", InputType=2, TR2=3, TFF=False, SourceMatch=0, Lossless=0, EZDenoise=5.00, NoisePreset="Fast")
  60. clip = havsfunc.DeHalo_alpha(clip)
  61. clip = muvsfunc.BlindDeHalo3(clip, interlaced=False)
  62. # adjusting output color from: YUV444P8 to YUV420P10 for NVEncModel
  63. clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, range_s="limited")
  64. # set output frame rate to 25fps
  65. clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
  66. # Output
  67. clip.set_output()
Advertisement
Add Comment
Please, Sign In to add comment