Skip to content

Instantly share code, notes, and snippets.

@torque
Last active August 29, 2015 14:05
Show Gist options
  • Save torque/6ab40104fc8fe120f2bc to your computer and use it in GitHub Desktop.
Save torque/6ab40104fc8fe120f2bc to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import os, sys
import vapoursynth as vs
def progress( current_frame, total_frames ):
print( "\rProgress: {0}/{1}".format( current_frame, total_frames ), file=sys.stderr, end='' )
core = vs.get_core( )
# SystemPluginDir=/usr/local/lib
core.std.LoadPlugin( 'libffms2.3.dylib' )
core.std.LoadPlugin( 'libscxvid.dylib' )
input_video = os.path.abspath( sys.argv[1] )
vid = core.ffms2.Source( input_video, cachefile='/tmp/keyframe.index' )
vid = core.resize.Bicubic( vid, format=vs.YUV420P8 )
vid = core.scxvid.Scxvid( vid, input_video[0:-3] + 'scxvid' )
devnull = open( '/dev/null', 'w' )
vid.output( devnull, y4m=False, progress_update=progress )
print( '', file=sys.stderr )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment