Skip to content

Instantly share code, notes, and snippets.

@acagastya
Created December 14, 2019 14:50
Show Gist options
  • Save acagastya/7c13d4b91f6aad5f9f6c16361584ab22 to your computer and use it in GitHub Desktop.
Save acagastya/7c13d4b91f6aad5f9f6c16361584ab22 to your computer and use it in GitHub Desktop.
from moviepy.editor import *
import sys
if len(sys.argv) < 2:
sys.stderr.write("Missing parameters.\n")
sys.exit(1)
try:
clip = (VideoFileClip(sys.argv[1]))
clip.write_gif(sys.argv[2] + ".gif")
sys.stdout.write("Done!\n")
sys.exit(0)
except OSError:
sys.stderr.write("File {input} not found.\n".format(input=sys.argv[1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment