Giter Site home page Giter Site logo

chrisemoulton / video-to-gif-osx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from minimaxir/video-to-gif-osx

0.0 1.0 0.0 4.02 MB

A set of utilities that allow the user to easily convert video files to very-high-quality GIFs on OS X.

License: MIT License

Shell 100.00%

video-to-gif-osx's Introduction

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:

  • Convert Video to GIF - A OS X Service which adds a "Convert Video to GIF" right-click menu item to all video files, which outputs a GIF of the video in the same folder of the source(s). (file must be unzipped on desktop)
  • video_to_gif_osx.sh - A Shell script which accepts video(s) as parameter(s) and outputs a GIF of the video in the same folder of the source(s).
  • Convert Video to GIF App - An Application which prompts the user for video(s) and outputs a GIF of the video in the same folder of the source(s). (file must be unzipped on desktop; when prompted for security warning go to "Security and Privacy" in System Preference and allow Convert Video to GIF App to run)

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

  • If the video has unusual dimensions (e.g. 7.00 aspect ratio), the GIF output will not be resized correctly. (in fairness, you probably do not want a GIF with an unusual aspect ratio)
  • If the video file or the parent directory has spaces, the tool may throw errors.
  • Convert Video to GIF Custom has no sanity check for input validation yet. (e.g. don't increase the frame rate beyond 60fps or bad things happen). If you encounter any issues specific to the Custom app, let me know.

Maintainer

video-to-gif-osx's People

Contributors

minimaxir avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.