Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.19 KB | None | 0 0
  1. # This script was generated by SVP 4 Manager.
  2. # Check https://www.svp-team.com for more details.
  3. # core.max_cache_size = 5000
  4.  
  5. import vapoursynth as vs
  6. core = vs.get_core(threads=8)
  7.  
  8. core.std.LoadPlugin("/home/ryan/SVP4/plugins/libsvpflow1_vs64.so")
  9. core.std.LoadPlugin("/home/ryan/SVP4/plugins/libsvpflow2_vs64.so")
  10.  
  11. clip = core.ffms2.Source(source="/home/ryan/Videos/JCS.mkv")
  12.  
  13. super_params     = "{scale:{up:2},gpu:1,rc:true}"
  14. analyse_params   = "{main:{search:{coarse:{distance:-8}}}}"
  15. smoothfps_params = "{gpuid:11,rate:{num:600000,den:10000,abs:true},algo:13,mask:{area:50},scene:{}}"
  16.  
  17. src_fps     = 23.976
  18. demo_mode   = 0
  19. stereo_type = 0
  20. nvof = 0
  21.  
  22. ########## BEGIN OF base.py ##########
  23. # This file is a part of SmoothVideo Project (SVP) ver.4
  24. # This is NOT the full Vapoursynth script, all used variables are defined via
  25. # JScript code that generates the full script text.
  26.  
  27. def interpolate(clip):
  28. # input_um - original frame in 4:2:0
  29. # input_m  - cropped and resized (if needed) frame
  30. # input_m8 - input_m converted to 8-bit
  31.     input_um = clip.resize.Lanczos(format=vs.YUV420P8)
  32.     input_m = input_um
  33.     input_m8 = input_m
  34.  
  35.     if nvof:
  36.         smooth  = core.svp2.SmoothFps_NVOF(input_m,smoothfps_params,nvof_src=input_m8,src=input_um,fps=src_fps)
  37.     else:
  38.         super   = core.svp1.Super(input_m8,super_params)
  39.         vectors = core.svp1.Analyse(super["clip"],super["data"],input_m8,analyse_params)
  40.         smooth  = core.svp2.SmoothFps(input_m,super["clip"],super["data"],vectors["clip"],vectors["data"],smoothfps_params,src=input_um,fps=src_fps)
  41.  
  42.  
  43.     if demo_mode==1:
  44.         return demo(input_m,smooth)
  45.     else:
  46.         return smooth
  47.  
  48. if stereo_type == 1:
  49.     lf = interpolate(core.std.CropRel(clip,0,(int)(clip.width/2),0,0))
  50.     rf = interpolate(core.std.CropRel(clip,(int)(clip.width/2),0,0,0))
  51.     smooth = core.std.StackHorizontal([lf, rf])
  52. elif stereo_type == 2:
  53.     lf = interpolate(core.std.CropRel(clip,0,0,0,(int)(clip.height/2)))
  54.     rf = interpolate(core.std.CropRel(clip,0,0,(int)(clip.height/2),0))
  55.     smooth = core.std.StackVertical([lf, rf])
  56. else:
  57.     smooth =  interpolate(clip)
  58. ########### END OF base.py ###########
  59.  
  60.  
  61. smooth.set_output()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement