Skip to content

Instantly share code, notes, and snippets.

@lucasrowe
Last active October 4, 2016 07:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucasrowe/04e894da84fbaf5af675 to your computer and use it in GitHub Desktop.
Save lucasrowe/04e894da84fbaf5af675 to your computer and use it in GitHub Desktop.
Gif conversion from .mov

Gif Conversion from .mov

One day I'll convert this into a handy script to quickly convert our .mov files. Until then I'll record all my conversion tasks here.

Here's a better writeup https://gist.github.com/dergachev/4627207 -- I just wanted one specific to my needs Or here http://blog.room208.org/post/48793543478

Examples

  • Convert first 7 seconds of webclip.mov to a gif at a framerate of 8 f/s

    ffmpeg -t 7 -i webclip.mov -s 304x540 -pix_fmt rgb24 -r 8 -f gif - | gifsicle --optimize=3 --delay=10 > webclip-2.gif

  • Delete the first 4 frames of fish-swimming.gif --batch edits the file in place, -i designates the input file --delete does the frame deletion

    gifsicle --batch -i fish-swimming.gif --delete "#1-4"

Ffmpeg to Imagemagick example

  • Split it into pngs

    ffmpeg -i dev-preview.mov -t 10 out%03d.png

  • Convert it into .gif with imagemagick

    convert -fuzz 1% -delay 0x30 *.png -coalesce -layers OptimizeTransparency animation.gif

  • Fix colors if needed

    gifsicle --batch -i animation.gif --optimize=3 --colors 256

Mini Stackem

ffmpeg -i gif-loop2.mov -s 304x486 out%03d.png
convert -fuzz 3% -delay 2 *.png -coalesce -layers OptimizeTransparency animation.gif
gifsicle --batch -i animation.gif --optimize=3 --colors 256

Rogue Adventures - Cave Light

 ffmpeg -i CaveLight_Looping.mov -r 12 out%03d.png
 convert -fuzz 1% *.png -coalesce -layers OptimizeTransparency animation.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment