Skip to content

Instantly share code, notes, and snippets.

@scarf005
Last active November 25, 2024 13:16
Show Gist options
  • Save scarf005/600fe086c48c3e71b0cc0ad2d918b944 to your computer and use it in GitHub Desktop.
Save scarf005/600fe086c48c3e71b0cc0ad2d918b944 to your computer and use it in GitHub Desktop.
#!/bin/bash
INPUT=${1:-input.mp4}
OUTPUT=${2:-output.gif}
ffmpeg -i "$INPUT" -vf "fps=10,palettegen=max_colors=20:reserve_transparent=0" palette.png
ffmpeg -i "$INPUT" -i palette.png -filter_complex "fps=4,paletteuse" "$OUTPUT" -y
rm palette.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment