

OS X Screencast to animated GIF
source link: https://gist.github.com/dergachev/4627207
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

OS X Screencast to animated GIF
This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
Instructions
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
- Open "Quicktime Player",
- Go to File -> New Screen Recording
- Selected screen portion by dragging a rectangle, recorded 13 second video.
- Go to File -> Export -> As Movie
- Saved the video in full quality with the filename
in.mov
- Saved the video in full quality with the filename
To convert in.mov into out.gif (filesize: 48KB), open Terminal to the folder with in.mov
and run the following command:
ffmpeg -i in.mov -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif
Notes on the arguments:
-r 10
tells ffmpeg to reduce the frame rate from 25 fps to 10-s 600x400
tells ffmpeg the max-width and max-height--delay=3
tells gifsicle to delay 30ms between each gif--optimize=3
requests that gifsicle use the slowest/most file-size optimization
To share the new GIF using Dropbox and Copy Public URL, run the following:
cp out.gif ~/Dropbox/Public/screenshots/Screencast-`date +"%Y.%m.%d-%H.%M"`.gif
Installation
The conversion process requires the following command-line tools:
- ffmpeg to process the video file
- gifsicle to create and optimize the an animated gif
If you use homebrew and homebrew-cask software packages, just type this in:
brew install ffmpeg
brew cask install xquartz #dependency for gifsicle, only required for mountain-lion and above
open /usr/local/Cellar/x-quartz/2.7.4/XQuartz.pkg # runs the XQuartz installer (YOU NEED TO UPDATE THE PATH)
brew install gifsicle
See also
I ended up rewriting this gist's functionality into screengif, a ruby script with significant quality improvements and a few gratuitous features. Check it out at https://github.com/dergachev/screengif
Resources
Related Ideas
- Extend https://github.com/dergachev/copy-public-url folder action for this use case
- it would automate the conversion before copying Dropbox public URL
- assign the folder action to ~/Dropbox/Public/Screenshots/gif
- consider finding a way to simplify the dependency installation
Recommend
-
56
-
113
-
117
-
121
Easy to use online animated GIF maker and image editor. Upload and edit GIF images for free. Create, crop, resize, reverse, optimize and split animated GIFs, cut and resize videos, WebP and APNG animations.
-
98
emacs-gif-screencast - One-frame-per-action GIF recording for optimal quality/size ratio
-
16
Animated GIFs are an image type that contains multiple images with slight differences. These are then played back kind of like a cartoon is. You could even think of it as a flip-book with a stick man that is slightly different on each page. W...
-
34
To try to export an animation from a JavaFX app to an animated GIF, I started on this thread in StackOverflow, then
-
9
Animated GIF thumbnails from a video This blog post isn’t about Dynamics AX / Dynamics 365, although it may occasionally be useful for some AX/D365 developers as well. Let’s say I have a 30 minutes long movie that I wa...
-
12
Find & Share on GIPHY ...
-
3
Calculating the Duration of an Animated GIF file » Stuart’s MATLAB Videos I have a function that returns the duration of a...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK