Skip to content

Instantly share code, notes, and snippets.

@ahmedam55
Created April 21, 2019 11:02
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 ahmedam55/a40a4df8c4225c349ab6d189b3f92192 to your computer and use it in GitHub Desktop.
Save ahmedam55/a40a4df8c4225c349ab6d189b3f92192 to your computer and use it in GitHub Desktop.
Convert Video to Gif
function gif {
ffmpeg -y -i $1 -vf fps=10,scale=${2:-1280}:-1:flags=lanczos,palettegen palette.png
ffmpeg -i $1 -i palette.png -filter_complex "fps=10,scale=${2:-1280}:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif
rm palette.png
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment