Skip to content

Instantly share code, notes, and snippets.

@fiftin
Created March 31, 2018 07:43
Show Gist options
  • Save fiftin/6f6c4ecf81bbf1568a184f2fccc1c451 to your computer and use it in GitHub Desktop.
Save fiftin/6f6c4ecf81bbf1568a184f2fccc1c451 to your computer and use it in GitHub Desktop.
ffmpeg: script for convering to gif with high quality
#!/bin/sh
palette="/tmp/palette.png"
filters="fps=15,scale=1000:-1:flags=lanczos"
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment