Skip to content

Instantly share code, notes, and snippets.

@mikeseif
Created May 12, 2017 21:01
Show Gist options
  • Save mikeseif/4b56df5f2e681c119854c6cf194c613f to your computer and use it in GitHub Desktop.
Save mikeseif/4b56df5f2e681c119854c6cf194c613f to your computer and use it in GitHub Desktop.
gifenc.sh accepts 2 parameters, the first being width and the second being framerate (going higher than 30 will melt most computers when playing back.. gifenc.sh is just another bash script with the following:
#!/bin/sh
palette="/tmp/palette.png"
filters="fps=$4,scale=$3:-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