vvo /gifify

😻 Convert any video file to an optimized animated GIF.

★ 6,328⑂ 313
JavaScriptCreated 2014-11-22
6,328
stars
+5+4+3
313
forks
–
watchers
–
prs
–
issues
–
releases
–
discussions

README

NOTE FROM AUTHOR

I am no more using this project or providing any support to it, if you want to maintain it, ping me here: [email protected].

This project was created 4 years ago, there might be better ways to turn a video into a GIF now, use google!

/NOTE FROM AUTHOR

 gifify

Convert any video file to an optimized animated GIF. Either in its full length or only a part of it.


  
    
      
      
    
  


 Demo time

!screencast

This screencast was recorded with lolilolicon/FFcast then converted to a GIF with:

shell
gifify screencast.mkv -o screencast.gif --resize 800:-1


 Features

- command line interface
- programmatic JavaScript (Node.JS) stream interface
- unix friendly, supports stdin & stdout
- optimized! uses pornel/giflossy to generate light GIFS
- lots of options: movie speed, fps, colors, compression, resize, reverse, from & to, subtitles
- no temp files used, everything happens in memory
- fast! Extracting a 5-second GIF from the middle of a 2-hour movie takes less than 20 seconds

 Requirements

Before using gifify, please install:

- Node.js ($ brew install node)
- FFmpeg 🐓🐓🐓🐓 ($ brew install ffmpeg)
- convert, the famous ImageMagick ($ brew install imagemagick)
- pornel/giflossy, it's a gifsicle fork (waiting for gifsicle16 to be merged) ($ brew install giflossy)

You can also use the gifify Docker image which comes with everything installed.

 Installation

shell
npm install -g gifify


 Command line usage

shell
 gifify -h

  Usage: gifify [options] [file]

  Options:

    -h, --help              output usage information
    -V, --version           output the version number
    --colors             Number of colors, up to 255, defaults to 80
    --compress           Compression (quality) level, from 0 (no compression) to 100, defaults to 40
    --from        Start position, hh:mm:ss or seconds, defaults to 0
    --fps                Frames Per Second, defaults to 10
    -o, --output      Output file, defaults to stdout
    --resize           Resize output, use -1 when specifying only width or height. 350:100, 400:-1, -1:200
    --reverse               Reverses movie
    --speed              Movie speed, defaults to 1
    --subtitles   Subtitle filepath to burn to the GIF
    --text          Add some text at the bottom of the movie
    --to          End position, hh:mm:ss or seconds, defaults to end of movie
    --no-loop               Will show every frame once without looping


 Programmatic usage

See the example.

js
var fs = require('fs');
var gifify = require('gifify');
var path = require('path');

var input = path.join(__dirname, 'movie.mp4');
var output = path.join(__dirname, 'movie.gif');

var gif = fs.createWriteStream(output);

var options = {
  resize: '200:-1',
  from: 30,
  to: 35
};

gifify(input, options).pipe(gif);


You can also pass a readable stream to gifify(stream, opts).

 Readable stream input performance

Gifify supports streams both on command line (cat movie.mp4 | gifify -o out.gif) and 

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON