Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generates an Animated GIF from a webm
#!/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
You can’t perform that action at this time.