Last active
February 5, 2016 09:29
-
-
Save lelandbatey/5088256 to your computer and use it in GitHub Desktop.
Convert video to .gif really easily. See this commit to my help files as an example: https://github.com/lelandbatey/configDebDev/blob/master/helpFiles.txt#L113
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 | |
#Alright, so this should automatically convert a given video into a gif called optimized_output.gif | |
# See here for explanation: https://github.com/lelandbatey/configDebDev/blob/master/helpFiles.txt#L113 | |
ffmpeg -i $1 out%04d.gif # Extracts each frame of the video as a single gif | |
convert -delay 4 out*.gif anim.gif # Combines all the frames into one very nicely animated gif. | |
convert -layers Optimize anim.gif optimized_output.gif # Optimizes the gif using imagemagick | |
# vvvvv Cleans up the leftovers | |
rm out* | |
rm anim.gif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment