Skip to content

Instantly share code, notes, and snippets.

@Kaiyuan
Created March 21, 2019 07:52
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Kaiyuan/4e45639128567882f6a9f00aae299015 to your computer and use it in GitHub Desktop.
Save Kaiyuan/4e45639128567882f6a9f00aae299015 to your computer and use it in GitHub Desktop.
set filelink=%1
set filecolor=%1.png
ffmpeg -i %filelink% -r 24 -vf fps=24,scale=240:-1:flags=lanczos,palettegen -y %filecolor% && ffmpeg -v warning -i %filelink% -i %filecolor% -r 4 -lavfi fps=24,scale=240:-1:flags=lanczos[x];[x][1:v]paletteuse -y %filelink%.gif && del /F /S /Q %filecolor%
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment