Created
December 15, 2016 17:05
-
-
Save mattstabeler/2231b0bed4a7c45e7ef628286ead0660 to your computer and use it in GitHub Desktop.
convert a movie file to a gif
This file contains 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
#!/bin/bash | |
# assumes you have ffmpeg - brew install ffmpeg | |
if [ -z "$1" ]; then | |
echo "No input file" | |
exit | |
fi | |
if [ -z "$2" ]; then | |
echo "No output file" | |
exit | |
fi | |
RATE=$3 | |
if [ -z "$3" ]; then | |
echo "No Framerate, using 10fps" | |
RATE=10 | |
fi | |
ffmpeg -ss 00:00:00.000 -i $1 -pix_fmt rgb24 -r $RATE $2 | |
# Limit the length: | |
# ffmpeg -ss 00:00:00.000 -i $1 -pix_fmt rgb24 -r 10 -t 00:00:10.000 $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment