Last active
April 25, 2023 03:57
-
-
Save SlexAxton/4989674 to your computer and use it in GitHub Desktop.
My gif workflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else | |
echo "proper usage: gifify <input_movie.mov>. You DO need to include extension." | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install ffmpeg | |
brew tap phinze/homebrew-cask | |
brew install brew-cask | |
brew cask install x-quartz | |
open /usr/local/Cellar/x-quartz/2.7.4/XQuartz.pkg | |
# click through the stuff | |
brew install gifsicle | |
brew install imagemagick | |
# I had a weird problem with Convert/imagemagick where I had to do: | |
ln -s /usr/local/Cellar/libtool/2.4.2/lib/libltdl.7.dylib libltdl.7.dylib | |
# But hopefully you don't have to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Take screencast using Quicktime. Export as high quality as possible. | |
gifify screencap.mov | |
gifify screencap.mov --good |
For anyone else interested, installing gifify locally works pretty well too.
$ npm install --save-dev gifify
… in your package.json
:
"scripts": {
"gifify": "gifify"
}
And can be run from command line like so:
$ npm run gifify -- -o test.gif test.mp4
… or js script within package.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@vvo and @nexdrew, here's a PR that does it in a curl one-liner: vvo/gifify#46. Feedback?