Skip to content

Instantly share code, notes, and snippets.

@bertrandom
Created December 17, 2016 08:15
Show Gist options
  • Save bertrandom/2d80b5fe03eb1d6abd73fb82c43a40ca to your computer and use it in GitHub Desktop.
Save bertrandom/2d80b5fe03eb1d6abd73fb82c43a40ca to your computer and use it in GitHub Desktop.
#!/bin/sh
palette="/tmp/palette.png"
filters="fps=4,scale=320:-1:flags=lanczos"
ffmpeg -v warning -framerate 4 -f image2 -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -framerate 4 -f image2 -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