Created
June 21, 2023 03:29
-
-
Save misebox/5461553f46de5b2d4e015ad1775d7dc3 to your computer and use it in GitHub Desktop.
The tool that converts a movie file to a compact animation GIF with ffmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -lt 1 ] | |
then | |
echo "usage: $0 <input video file>" | |
fi | |
INPUT_FILE="$1" | |
OUTPUT_FILE=`echo ${INPUT_FILE} | sed -E 's/\.[^\.]*$//'`.gif | |
ffmpeg \ | |
-i ${INPUT_FILE} \ | |
-filter_complex "[0:v] fps=10,scale=640:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" \ | |
${OUTPUT_FILE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment