Skip to content

Instantly share code, notes, and snippets.

@nplusp
Created June 10, 2024 09:03
Show Gist options
  • Save nplusp/e665cadec807f3bfcd88b5a75b1df1b8 to your computer and use it in GitHub Desktop.
Save nplusp/e665cadec807f3bfcd88b5a75b1df1b8 to your computer and use it in GitHub Desktop.
Create gifs from video in terminal
// install dependencies
brew install ffmpeg
brew install gifsicle
// add alias
alias gify='function _gify(){ ffmpeg -i "$1" -pix_fmt rgb8 -r 10 /tmp/{1%.*}_tmp.gif && gifsicle -O3 /tmp/{1%.*}_tmp.gif -o "${1%.*}.gif"; rm /tmp/{1%.*}_tmp.gif; unset -f _gify; }; _gify'
// run it
gify /path/to/file.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment