Git Product home page Git Product logo

giffy's Introduction

giffy

command line tool for creating animated gifs from videos

futurama

Requirements

The following packages: avconv, gifsicle, and imagemagick. Use apt-get or yum to install.

I have only tested on Ubuntu 12.04 LTS.

Installation

git clone https://github.com/jpwright/giffy.git

Command line options

OPTIONS:
   -h, --help             Show this message
   -i, --input            Input file. Can be a wide variety of formats, try 'avconv -formats' to see a list.
   -o, --output           Output file. 
   -s, --start            Start timestamp. Can be a number of seconds or in hh:mmss[.xxx] form.
   -d, --duration         Duration. Should be a number of seconds (decimals OK)
   -r, --resize           Resize operator. Can be a percentage (50%) or a width in pixels (50). Default is 100%.
   -t, --caption          Caption operator. Should be a string, for example '-caption 'caption words here''. You can insert linebreaks into the caption by inserting '\n'.
   -l, --caption-height   Line height of caption, either as a percentage or in number of pixels.
   -f, --fps              Frames per second for the output gif. Default is 24. Max is 48.
   -z, --optimize         Optimization level. Default (and maximum) is 3.
   -c, --compress         Enable compression to 256 colors. Will reduce output filesize at the expense of quality.
   -v, --verbose          Verbose output.

Examples

Bare minimum

To make a gif called out.gif from a movie in.mp4 consisting of the first 3 seconds:
giffy -i in.mp4 -o out.gif -s 0 -d 3

Resizing

To make that gif half the size in each dimension:
giffy -i in.mp4 -o out.gif -s 0 -d 3 -r 50%

To force that gif to be 200 pixels wide:
giffy -i in.mp4 -o out.gif -s 0 -d 3 -r 200

Captioning

To add a caption:
giffy -i in.mp4 -o out.gif -s 0 -d 3 -t "Hello world"

To add a caption with multiple lines:
giffy -i in.mp4 -o out.gif -s 0 -d 3 -t "Hello world\nGoodbye world"

To add a caption with line height 24px:
giffy -i in.mp4 -o out.gif -s 0 -d 3 -t "Hello world" -l 24

To add a caption with line height 10% of the output gif:
giffy -i in.mp4 -o out.gif -s 0 -d 3 -t "Hello world" -l 10%

Speedup

To animate at 36 fps:
giffy -i in.mp4 -o out.gif -s 0 -d 3 -f 36

Note that the default is 24, regardless of the fps of the input movie.

Optimization

To change the gif optimization level:
giffy -i in.mp4 -o out.gif -s 0 -d 3 -z 1

See the gifsicle manpage for an explanation of gif optimization levels.

To compress to 256 colors:
giffy -i in.mp4 -o out.gif -s 0 -d 3 -c

giffy's People

Contributors

jpwright avatar

Stargazers

Sai Htaung Kham avatar Keith A. Istré avatar Roberto Salas avatar Reza Sameei avatar Eric Morris avatar

Watchers

James Cloos avatar  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.