Skip to content

Instantly share code, notes, and snippets.

@amoodie
Last active June 13, 2018 16:12
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 amoodie/027034a33bbd6f335d7bdb5a84cc3291 to your computer and use it in GitHub Desktop.
Save amoodie/027034a33bbd6f335d7bdb5a84cc3291 to your computer and use it in GitHub Desktop.
convert still sequence to gif
fps=20
scale=800
nzero=4
ffmpeg -r $fps -i %0"$nzero"d.png -c:v libx264 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -pix_fmt yuv420p -y out.mp4
ffmpeg -i out.mp4 -vf fps=$fps,scale=$scale:-1:flags=lanczos,palettegen -y palette.png
ffmpeg -i out.mp4 -i palette.png -filter_complex "fps=$fps,scale=$scale:-1:flags=lanczos[x];[x][1:v]paletteuse" -y output.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment