$ brew install ffmpeg
$ brew install gifsicle
Last active
November 26, 2020 13:23
-
-
Save kjantzer/d3749a36215c02a2701e to your computer and use it in GitHub Desktop.
Create a GIF from Alfred App
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
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