Convert MOV files into animated GIF's for quick preview and e-mail friendly sharing.
This was designed for Mac OS X users.
Homebrew is a package manager for Mac OS x. You will need this to later download a few open source libraries.
Using homebew, you will need to install ffmpeg. This is the tool that will compress your existing .mov file.
brew install ffmpeg
Quartz is required to use the next package, Gifsicle.
brew cask install xquartz
brew install gifsicle
I created a Convert class that will do all the work. I also made it Object Oriented so that you can later decide to integrate it into a larger application.
ruby Converter.rb
Using this simple class as my base, I can easily integrate this into a Rake Task or maybe use FileList to do more work with string manipulation. Hopefully this simple tutorial shows you that the possibilities are infinite using Ruby, Shell, and home-brew.
- If you want to learn more about how
%xworks in Ruby, read this tutorial