Created
September 19, 2019 17:41
-
-
Save abemassry/4460dbfa61a1217dcddec4557d319691 to your computer and use it in GitHub Desktop.
mov-to-gif
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 | |
rnd=$RANDOM | |
fname=$1 | |
name=$(echo $fname | sed 's/\..*$//') | |
mkdir /tmp/frames$rnd | |
ffmpeg -i $fname -vf scale=320:-1:flags=lanczos,fps=10 /tmp/frames$rnd/ffout%03d.png | |
convert -loop 0 /tmp/frames$rnd/ffout*.png "$name".gif | |
cd /tmp/frames$rnd | |
rm *.png | |
cd /tmp | |
rmdir /tmp/frames$rnd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment