Home

Awesome

Convert Video to GIF on OSX

This repository contains a set of utilities that allow the user to easily convert video files to high-quality, low file size GIFs on OS X. This post is a complement to my blog post Making a Video-to-GIF Right-Click Menu Item in OS X

The primary intent for this tool is used with Quicktime Movie files obtained from using the Screen Recording feature on OS X or iOS input.

The tool comes in three forms, depending on user needs:

There is also a special fourth tool, Convert Video to GIF App Custom app, which is less streamlined but also allows you to specify a custom start time, end time, maximum width, frame rate, and # of colors. For example, here's a GIF of Freedom Planet from a test video of 2:00 to 2:05, a max width of 640px, and 4 colors:

Installation

Note: Installation may have issues depending on system config, particularly step #2. If you run into issues, let me know.

  1. Open up Terminal and install Homebrew by running this command and following the instructions:

     ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
     
    
  2. Install the three GIF-making applications using this Homebrew command:

     brew install ImageMagick mplayer gifsicle
    
  3. Download the tool of choice. To install the Convert Video to GIF Service, download and double-click.

Tests

When running into the script, you may run into an issue where the .GIF is generated, but the file size is zero bytes. That means the script errored out at some point except the "create a GIF" line.

The tests folder contains a basic test case to debug the script. To activate the test, cd into the folder and run:

sh test.sh test_video.mov

This outputs a test_results.txt in addition to the test GIF. If test_results.txt matches expected_results.txt, you should be good to go. If there is a discrepency, send me the output of test_results.txt.

Notes

All forms have a max GIF width of 480px; this is a value chosen to both manage file size and compatability with all applications. If you wish to create larger GIFs, open up the tool and change the value of GIF_MAX_SIZE at the beginning of the file.

Known Issues

Maintainer