home
NOTE: Under Construction - I'm in the middle of upgrading my site and lots of stuff is kinda broken. Please forgive the mess.

ffmpeg GIF Maker Command (2023 Edition)

October 2023

This is the starting point. Need to pull in all the different notes on the different formats and probably just make different ones in general for optional output?

Code
#!/bin/bash
INPUT_PATH="/Users/alan/Videos/yo/ezgif.com-crop-video.mp4"
OUTPUT_PATH="/Users/alan/Desktop/output.gif"
WIDTH=300
FPS=10
COLORS=190
CROP="crop=in_w:in_h:0:0,"
START="-ss 0.7"
TIME="-t 2"
# TIME="-t 10"
# TIME=""

ffmpeg -loglevel panic -hide_banner -i "${INPUT_PATH}" $START $TIME \
       -vf "${CROP}fps=${FPS},scale=${WIDTH}:-2:flags=lanczos,split[s0][s1];\
      [s0]palettegen=max_colors=${COLORS}:reserve_transparent=0[p];\
      [s1][p]paletteuse=dither=sierra2" \
       -y "${OUTPUT_PATH}"

open $OUTPUT_PATH
Results
═══ § ═══