Skip to content

Instantly share code, notes, and snippets.

@akanik
Last active January 25, 2023 19:04
Show Gist options
  • Save akanik/d7e16a6d85476a101762969c17220486 to your computer and use it in GitHub Desktop.
Save akanik/d7e16a6d85476a101762969c17220486 to your computer and use it in GitHub Desktop.
video to animated gif
#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
@akanik
Copy link
Author

akanik commented Jun 14, 2021

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.

@akanik
Copy link
Author

akanik commented Jan 25, 2023

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