Skip to content

Instantly share code, notes, and snippets.

@Cellane
Last active November 7, 2015 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cellane/0d1399a09ebadd4330b7 to your computer and use it in GitHub Desktop.
Save Cellane/0d1399a09ebadd4330b7 to your computer and use it in GitHub Desktop.
import vapoursynth as vs
core = vs.get_core()
clip = video_in
dst_fps = display_fps
while (dst_fps > 60):
dst_fps /= 2
if not (clip.width > 1920 or clip.height > 1080 or container_fps > 59):
src_fps_num = int(container_fps * 1e8)
src_fps_den = int(1e8)
dst_fps_num = int(dst_fps * 1e4)
dst_fps_den = int(1e4)
clip = core.std.AssumeFPS(clip, fpsnum = src_fps_num, fpsden = src_fps_den)
print("Reflowing from ", src_fps_num/src_fps_den, " fps to ", dst_fps_num/dst_fps_den, " fps.")
sup = core.mv.Super(clip, pel=2, hpad=16, vpad=16)
bvec = core.mv.Analyse(sup, blksize=16, isb=True , chroma=True, search=3, searchparam=1)
fvec = core.mv.Analyse(sup, blksize=16, isb=False, chroma=True, search=3, searchparam=1)
clip = core.mv.BlockFPS(clip, sup, bvec, fvec, num=dst_fps_num, den=dst_fps_den, mode=3, thscd2=12)
clip.set_output()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment