brew install ffmpeg
brew install gifsicle
ffmpeg -i myVideo.mp4 -vf "scale='min(1280,iw)':-1" -r 5 -f gif - | gifsicle --optimize=3 > myGif.gif
-r 5
- reduce frame rate to 5 per second
scale='min(1280,iw)':-1
- width of the GIF is the smaller of 1280px or the input video; height should be whatever value is needed to maintain the aspect ratio
--optimize=3
tells gifsicle
to use the most aggressive compression
Input
Output
3.2MB, 1280x1343