Skip to content

Instantly share code, notes, and snippets.

@AshKyd
Last active February 6, 2018 23:59
Show Gist options
  • Save AshKyd/d60d9f7a621545429b108c2f988db6ba to your computer and use it in GitHub Desktop.
Save AshKyd/d60d9f7a621545429b108c2f988db6ba to your computer and use it in GitHub Desktop.
Gif encoder script
#!/bin/sh
# Use ./gifenc.sh input.mp4 output.gif
palette="/tmp/palette.png"
## Adjust start time and duration
# -ss 00:00:03 -t 00:00:08
# Various filters change framerate, crop, scaling etc
#filters="crop=320:320:500:100,fps=16"
filters="fps=12,scale=200:-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