Last active
January 25, 2023 19:04
-
-
Save akanik/d7e16a6d85476a101762969c17220486 to your computer and use it in GitHub Desktop.
video to animated 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
#https://github.com/skepticli/tutorial-screencast-to-gif | |
#command line | |
mkdir frames | |
ffmpeg -i my-screencast.mov -r 3 frames/image.%03d.png | |
#At this point it might be useful to go into your frames | |
#directory and delete extra images, most likely frames at | |
#the start and end of your video/gif | |
#Optional: Make images smaller | |
cd frames | |
mkdir smaller | |
mogrify -resize 900x -path ./smaller *.png | |
#And now we convert all those image into a gif | |
convert smaller/image.*.png ../output.gif |
Options for optimizing your output.gif:
gifsicle -i created-gif.gif --dither --colors 128 --lossy=30 --resize-width 640 -V -o created-gif-sm.gif
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's an additional tool to use along with the above code: https://superuser.com/questions/875342/how-can-i-repeatedly-take-a-screenshot-of-a-specific-area-in-os-x
Programmed screen grabs. I've used this when pulling from Google Earth Engine.