Created
August 19, 2013 05:50
-
-
Save kennyledet/6266067 to your computer and use it in GitHub Desktop.
python gif-maker.py {filepath} {start time} {run time}
python gif-maker.py movie.mp4 00:00:39 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gif-maker.py | |
# Copyright 2013 Kendrick Ledet | |
import sys, os | |
path = sys.argv[1] | |
start = sys.argv[2] | |
end = sys.argv[3] | |
fname = os.path.basename(path) | |
print fname | |
#os.system('ffmpeg -i "%s" -vcodec copy -acodec copy -ss %s -t %s temp.avi' % (path, start, end)) | |
os.system('ffmpeg -i "{}" -ss "{}" -t "{}" -an -r 15 -s 320x240 tmp/tmp%06d.gif'.format(path, start, end)) | |
os.system('gifsicle --loop tmp/*.gif > "gifs/{}--{}-{}.gif" '.format(fname.split('.')[0], start.replace('/',':'), end)) | |
os.system('rm tmp/*.gif') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment