Skip to content

Instantly share code, notes, and snippets.

@nightpool
Last active November 17, 2022 08:52
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nightpool/72ed3561a9acf1bb010b22b872d5f0fa to your computer and use it in GitHub Desktop.
Save nightpool/72ed3561a9acf1bb010b22b872d5f0fa to your computer and use it in GitHub Desktop.
make good looking small gifs
function gif() {
for file in "$@"
do
echo "${file%.*}".gif
ffmpeg -i "$file" -filter_complex "[0:v] fps=15,scale=w=${WIDTH:-960}:h=-1,split [a][b];[a] palettegen [p];[b] fifo [b]; [b][p] paletteuse" "${file%.*}".gif
done
}

Make a gif!

Make a nice, small gif!

$ gif some_file.mov

Make a bunch of gifs!

 $ gif *.mp4

Choose what width to make your gif at (default 960:

$ WIDTH=500 gif my_recording.mov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment