Skip to content

Instantly share code, notes, and snippets.

@Akira-Hayasaka
Last active July 27, 2023 07:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Akira-Hayasaka/e83ba454ae1e9ecaa9c655badbe3148b to your computer and use it in GitHub Desktop.
Save Akira-Hayasaka/e83ba454ae1e9ecaa9c655badbe3148b to your computer and use it in GitHub Desktop.
create gif
ffmpeg -i a.mp4 -vf "fps=10,scale=1280:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif
normal
ffmpeg -i input.mov -r 10 -vf scale=640:-1 -f gif output.gif
mid
ffmpeg -i input.mov -filter_complex "[0:v] fps=10,scale=640:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" output-palette.gif
high
ffmpeg -i input.mov -filter_complex "[0:v] fps=10,scale=w=640:h=-1,split [a][b];[a] palettegen=stats_mode=single [p];[b][p] paletteuse=new=1" output-multiple-palette.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment