Git Product home page Git Product logo

gifify's Introduction

gifify Dependency Status

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

It's like jclem/gifify but better in many ways from my point of view.

Demo time

screencast

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

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

Features

I believe my gifify has some features that jclem/gifify is lacking, see:

  • command line interface
  • programmatic JavaScript (Node.JS) stream interface
  • unix friendly, supports stdin, stdout & | pipes
  • optimized! uses pornel/giflossy to generate light GIFS
  • lots of options: movie speed, fps, colors, compression, resize, from & to
  • no temp files used, everything happens in memory
  • fast!

Requirements

Before using gifify, please install:

Installation

npm install -g gifify

Command line usage

> gifify -h

Usage: gifify [options] [file]

  Options:

    -h, --help           output usage information
    -V, --version        output the version number
    --fps <n>            Frames Per Second, defaults to 10
    --from <position>    Start position, hh:mm:ss or seconds, defaults to 0
    --colors <n>         Number of colors, up to 255, defaults to 80
    --compress <n>       Compression (quality) level, from 0 (no compression) to 100, defaults to 40
    -o, --output <file>  Output file, defaults to stdout
    --resize <WxH>       Resize output, use -1 when specifying only width or height. `350x100`, `400x-1`, `-1x200`
    --speed <n>          Movie speed, defaults to 1
    --to <position>      End position, hh:mm:ss or seconds, defaults to end of movie

Programmatic Stream usage

See the example.

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 movie = fs.createReadStream(input);
var gif = fs.createWriteStream(output);

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

gifify(movie, options, function done(err, gifReadStream) {
  if (err) {
    console.error(err);
    return;
  }

  gifReadStream.pipe(gif);
});

Disclaimer

On modern hardware GIF is the slowest and most expensive video codec. Can we please allow it to be obsoleted?

https://pornel.net/efficient-gifs#sec44

YOLO!

Notes

Giflossy is a fork of gifsicle, gifsicle author is currently working on integrating the lossy part in gifsicle.

So in little time we will be able to directly use gifsicle and gifiscle packages.

Thanks

jclem/gifify was a great source of inspiration.

gifify's People

Contributors

vvo avatar

Watchers

 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.