This is the way I found to create high quality GIFs from videos. Feel free to recommend a better path or tool.
- Install ffmpeg. Make sure ffplay is installed along with ffmpeg.
For example for macOS:
brew install ffmpeg --with-ffplay
- If the original video has black bars at the top/bottom, you can remove them:
- Detect the values for the cropping filter using ffplay. The cropdetect filter is configured with the arguments
cropdetect=limit:round:reset
,24:16:0
is the default.