-
-
Save dmamills/171014e1e6f790b7a39d to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# mov2giv in out width | |
# mov2gif video_file_in.mov gif_file_out.gif 300 | |
tmp_dir=/tmp/frames_$(date +%s) | |
mkdir $tmp_dir | |
if [ -z "$3" ] | |
then | |
size=600 | |
else | |
size=$3 | |
fi | |
echo "Converting $1 => $2 ($3 px wide)" | |
echo "Generating frames" | |
(ffmpeg -i $1 -vf scale=$size:-1 -r 10 $tmp_dir/ffout%03d.png) >& /dev/null | |
echo "Building gif from frames" | |
(convert -delay 5 -loop 0 $tmp_dir/ffout*.png $2) >& /dev/null | |
echo "Cleaning up" | |
rm -rf $tmp_dir | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment