Skip to content

Instantly share code, notes, and snippets.

@hossamghareeb
Created February 12, 2016 05:26
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 hossamghareeb/7de379d2131831cc10f1 to your computer and use it in GitHub Desktop.
Save hossamghareeb/7de379d2131831cc10f1 to your computer and use it in GitHub Desktop.
Convert video to GIF in mac
Converting your screencast/screen recording to Gif is not a big deal. All you need:
1. QuickTime Player to record your screen OR video file if you already have the video that you wanna convert
2. ffmpeg installed in mac
First of all, install HomeBrew using the following command
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then install ffmpeg using the following commmand:
brew install ffmpeg
Now move in the terminal to the folder that contains the video file:
cd folder path goes here
Then run the following commands sequentially:
palette="/tmp/palette.png"
filters="fps=15,scale=700:-1:flags=lanczos"
ffmpeg -i in.mov -vf "$filters,palettegen" -y $palette
ffmpeg -i in.mov -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y out.gif
Set the scale value with width you wanna scale to. Set it to video width if you wanna no scale
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment