Skip to content

Instantly share code, notes, and snippets.

@imkevinxu
imkevinxu / vidtogif.sh
Last active June 17, 2016 17:35
Convert an animated video to gif from http://chrismessina.me/b/13913393/mov-to-gif
# Convert an animated video to gif
# Works best for videos with low color palettes like Dribbble shots
#
# @param $1 - video file name like `animation.mov`
# @param @optional $2 - resize parameter as widthxheight like `400x300`
#
# Example: vidtogif animation.mov 400x300
# Requirements: ffmpeg and gifsicle. Can be downloaded via homebrew
#
# http://chrismessina.me/b/13913393/mov-to-gif
# Convert a live action video to gif
# Works best for videos with high color palettes like videos from your phone
#
# @param $1 - video file name like `video.mp4`
# @param @optional $2 - width size like `720`
#
# Example: ffmpegtogif video.mp4 720
# Requirements: ffmpeg. Can be downloaded via homebrew
#
# http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html