Created
May 1, 2014 14:47
-
-
Save ryanlerch/7fa82e32898f68410bd5 to your computer and use it in GitHub Desktop.
Generates an Animated GIF from a webm
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 | |
echo "$1" | |
mkdir /tmp/"$1"/ | |
gst-launch-1.0 filesrc location="$1" ! decodebin ! videoconvert ! pngenc ! multifilesink location="/tmp/$1/%04d.png" | |
echo "Trim files manually, and press enter to generate the GIF" | |
nautilus /tmp/"$1"/ & | |
read | |
echo "Generating GIF..." | |
convert -delay 5 /tmp/"$1"/*.png /tmp/"$1"/animation.gif | |
echo "Before:" | |
du -h /tmp/"$1"/animation.gif | |
convert /tmp/"$1"/animation.gif -fuzz 5% -layers Optimize /tmp/"$1"/result.gif | |
echo "After:" | |
du -h /tmp/"$1"/result.gif | |
eog /tmp/"$1"/result.gif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment