Skip to content

Instantly share code, notes, and snippets.

@kjantzer
Last active November 26, 2020 13:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjantzer/d3749a36215c02a2701e to your computer and use it in GitHub Desktop.
Save kjantzer/d3749a36215c02a2701e to your computer and use it in GitHub Desktop.
Create a GIF from Alfred App

Install Dependencies

$ brew install ffmpeg
$ brew install gifsicle
export PATH=/usr/local/bin/:$PATH
cd ~/Desktop
# get newest video file
FILE=$(ls -t *.mov | head -1)
# find the dimensions of the video
eval $(ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width $FILE)
SIZE=${streams_stream_0_width}x${streams_stream_0_height}
# convert to GIF
ffmpeg -i $FILE -s $SIZE -r 24 -f gif - | gifsicle --delay=3 > "$FILE.gif"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment