Use gifski, a free tool (re-)written in Rust. Use the following commands: export OUTPUT_DIR="..." export GIF_NAME="..." export FILE_NAME="..." ffmpeg -i $FILE_NAME $OUTPUT_DIR/frame%04d.png gifski -o $GIF_NAME $OUTPUT_DIR/frame*.png