Skip to content

Instantly share code, notes, and snippets.

@atineoSE
Created June 18, 2022 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atineoSE/beca753968823c6bdcf9c8d183eb85a0 to your computer and use it in GitHub Desktop.
Save atineoSE/beca753968823c6bdcf9c8d183eb85a0 to your computer and use it in GitHub Desktop.
Small script to generate animated gif
#!/bin/sh
# 1st param is input file, 2nd is output file, 3rd is framerate, 4th is width in pixel
palette="palette.png"
filters="fps=$3,scale=$4:-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