Gifski is all you need.DEPRECATED!
I'm using ffmpeg and imagemagick manually to generate animated gifs from QuickTime mov/mp4. I created this simple cli to make my life easier. I use this tool to take snapshots of interactive UIs and attach to pull requests.
The default options are optimised for quality and file size. The only options exposed are
Protip: Do not record your whole screen and try to generate a gif. This probably won't end well.
brew update brew install ffmpeg brew install imagemagick
npm install -g movtogif-cli
For more options check out the help
movtogif video.mov video.gif
If you're not happy with the file size you can use gifsicle to reduce it. However it may compromise the image quality.
brew install gifsicle gifsicle -O3 video.gif -o video-optimized.gif