篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown OS X截屏到动画GIF相关的知识,希望对你有一定的参考价值。
# OS X Screencast to animated GIF
This gist shows how to create a GIF screencast using only free OS X tools: *QuickTime and ffmpeg*.
Forked from https://gist.github.com/dergachev/4627207. Updated to use a palette to improve quality and skip 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`
Create a palette image from the video:
ffmpeg -y -i in.mov -vf fps=10,palettegen palette.png
Convert into a GIF using the palette
ffmpeg -i in.mov -i palette.png -filter_complex "fps=10,paletteuse" out.gif
## Installation
The conversion process requires the following command-line tools:
* **ffmpeg** to process the video file
If you use homebrew and homebrew-cask software packages, just type this in:
brew install ffmpeg
## Resources
* http://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality/556031#556031
* http://schneems.com/post/41104255619/use-gifs-in-your-pull-request-for-good-not-evil (primary source!)
* http://www.reddit.com/r/programming/comments/16zu7d/use_gifs_in_your_pull_requests_for_good_not_evil/
* http://superuser.com/questions/436056/how-can-i-get-ffmpeg-to-convert-a-mov-to-a-gif#_=_
* http://gnuski.blogspot.ca/2012/06/creating-animate-gif-with-free-software.html
## 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
以上是关于markdown OS X截屏到动画GIF的主要内容,如果未能解决你的问题,请参考以下文章