Git Product home page Git Product logo

gifify's Introduction

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:

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:

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

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
    --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
    --from <position>       Start position, hh:mm:ss or seconds, defaults to 0
    --fps <n>               Frames Per Second, defaults to 10
    -o, --output <file>     Output file, defaults to stdout
    --resize <W:H>          Resize output, use -1 when specifying only width or height. `350:100`, `400:-1`, `-1:200`
    --reverse               Reverses movie
    --speed <n>             Movie speed, defaults to 1
    --subtitles <filepath>  Subtitle filepath to burn to the GIF
    --text <string>         Add some text at the bottom of the movie
    --to <position>         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.

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 in the programmatic API (gifify(readableStream, opts).pipe(writableStream)).

While it's super useful in some cases, if you have the file on disk already, you better do gifify movie.mp4 -o out.gif or gifify(filePath, opts).pipe(writableStream).

Why? Because piping 3.4GB when you want to cut from 40:20 to 40:22 still takes a loooooot of time and does not give you any performance benefit.

FFmpeg has to read from 0GB -> $START_BYTE_40:20 and discards it. But everything flows in your memory.

When using direct file input from command line, we pass the -i filename option to FFmpeg and then it's super fast!

Be careful when |piping.

Adding some text

You can burn some simple text into your GIF:

gifify back.mp4 -o back.gif --from 01:48:23.200 --to 01:48:25.300 --text "What?..What?What?"

Result:

back

Subtitles

You can burn subtitles into your GIF, it's that easy:

gifify 22.mkv -o movie.gif --subtitles 22.ass --from 1995 --to 2002 --resize 600:-1

You must create new subtitles files, the timecodes for the complete film will not work for a five seconds GIF.

Create subtitles using aegisub and augment the font size for a great effect!

Here's the 22.ass from the previous command, created with aegisub:

[Script Info]
; Script generated by Aegisub 3.2.1
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: None

[Aegisub Project Garbage]

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Arial,20,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,2,2,2,10,10,10,1

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:02.50,0:00:03.97,Default,,0,0,0,,{\fnLiberation Sans\fs40}Okay, okay.
Dialogue: 0,0:00:05.00,0:00:06.90,Default,,0,0,0,,{\fnLiberation Sans\fs40}Okay. Okay.

Result extracting a GIF from 22 Jump Street:

22

GIF Performance

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!

Giflossy

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

arunmichaeldsouza avatar calinou avatar designorant avatar gitter-badger avatar greenkeeperio-bot avatar hyperknot avatar jonespen avatar karanjthakkar avatar keitharm avatar kud avatar louisremi avatar lucasc avatar lxe avatar max-mapper avatar pjaspers avatar rafpaf avatar risseraka avatar steezeburger avatar vvo avatar waldyrious avatar zwhitchcox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gifify's Issues

weird gif output

using:

  • yosemite
  • gifsicle-1.82.1-lossy (from here)
  • ffmpeg version 2.1.4 (from brew)
  • ImageMagick 6.9.0-3 Q16 x86_64 2015-01-09 (from brew)

here's what I get from a .mov recorded with Quicktime:

gifify recording.mov -o recording.gif

recording mov

What is happening

i'm doing
gifify slurp.mp4 -o slurp.gif

it creates the slurp.gif but with 0 bytes and no activity on the command line. I'm using version 2.1.1 on osx maveriks.

Is there any way to get progress or stdout activity?

The file is on github

Error: convert needs fontconfig

Hey there.

I'm trying to convert using the following command:

gifify tide\ 1_.mov -o tide_backend.gif --resize '900:-1' 

however I get the following error without anything else:

convert needs fontconfig

Any help please? Cheers

Suggestion: throw error when resize option is not present

As it seems that the --resize option is a requirement (seen in my experience and #23) , maybe throw an error if the parameter is not present in command. Unless this is a bug? Gifify will continue to run indefinitely, and not create a write file in location, if not the --resize option is not defined

progress bars

Is it or can it be possible to get a progress bar when converting a video to gif?

Unclear instructions for installing giflossy

The link just takes you to a page with a packaged download, but downloading and running the Mac OSX script did not work. I ended up cloning the repo and running ./configure and make install and all was well.

Maybe we can make this more clear in the README?

--fps doesn't take the input fps into account

If I have a .mov file recorded via quicktime, which records at 60fps, and use gifify, it creates a gif at 10fps. If I run gifify with --fps 60, it creates a gif 10x as long as the video, but slowed down.

Adding --speed 6 seems to have no effect.

I assumed that --fps controlled the output fps, but had no effect on how often the frames were sampled. Is there a way to do what I'm trying to do using gifify?

Installing version 2.3.0 = npm ERR! cb() never called!

It looks like version 2.3.0 of gifify is broken when you try to install it via npm or yarn.

$ npm i gifify -d:

npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info attempt registry request try #1 at 1:13:35 PM
npm http request GET https://registry.npmjs.org/gifify
npm http 304 https://registry.npmjs.org/gifify
npm info addNameTag [ 'gifify', 'latest' ]
npm ERR! cb() never called!

$ yarn add gifify:

yarn add v0.21.3
info No lockfile found.
[1/4] ๐Ÿ”  Resolving packages...
[2/4] ๐Ÿšš  Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/gifify/-/gifify-2.3.0.tgz: invalid tar file".
info If you think this is a bug, please open a bug report with the information provided in "/Users/keith/Desktop/t/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

I downloaded versions 2.2.2 and 2.3.0 and extracted the archives manually to see if I could find the problem and it looks like the only difference between the 2 versions (other than the src code) is a missing yarn.lock file and .npmignore.

2.2.2:

2.2.2
โ”œโ”€โ”€ .npmignore   <---
โ”œโ”€โ”€ HISTORY.md
โ”œโ”€โ”€ LICENSE.md
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ bin
โ”‚ย ย  โ””โ”€โ”€ gifify
โ”œโ”€โ”€ index.js
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ yarn.lock    <---

1 directory, 8 files

2.3.0:

2.3.0
โ”œโ”€โ”€ HISTORY.md
โ”œโ”€โ”€ LICENSE.md
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ bin
โ”‚ย ย  โ””โ”€โ”€ gifify
โ”œโ”€โ”€ index.js
โ””โ”€โ”€ package.json

1 directory, 6 files

I found this reported issue on yarn's github repo: yarnpkg/yarn#2764.

It looks like publishing via yarn breaks things for some reason currently and it can be fixed by deleting the old yarn file and regenerating it (yarnpkg/yarn#2764 (comment))

Error

I get this error

gifsicle: unrecognized option โ€˜--lossy=80โ€™
Usage: gifsicle [OPTION | FILE | FRAME]...
Try 'gifsicle --help' for more information.

whenever I try to use this.

I installed all the dependencies.

Cutting parts of long movies takes ages

Say you want to cut "hasta la vista, baby" from Terminator 2.

It will be very long because gifify will create a read stream from the movie and pipe it to ffmpeg.

If the sentence is at 1,2gb of the movie then we pipe 1.2gb for nothing.

I expect ffmpeg to be more clever when dealing with the file itself, so we should do that, give the file to
ffmpeg input as -i file.

We will not be able to do so when the user does this: cat movie | gifify but that's not the main usage.

gifsicle: unrecognized option โ€˜--lossy=80โ€™

  const get = require('request').get
  const readStream = get(someURL)
  const gif = require('fs').createWriteStream(`${this.params.id}.gif`)
  gifify(readStream, {}).pipe(gif)

throws

events.js:159
      throw err;
      ^

Error: Uncaught, unspecified "error" event. (gifsicle: unrecognized option โ€˜--lossy=80โ€™
Usage: gifsicle [OPTION | FILE | FRAME]...
Try 'gifsicle --help' for more information.
)
    at Socket.emit (events.js:157:17)
    at Socket.gotSomeErrors (/.../node_modules/gifify/index.js:53:23)
    at emitOne (events.js:90:13)
    at Socket.emit (events.js:182:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at Pipe.onread (net.js:534:20)

gifify not working after installation!

I'm using Ubuntu 14.04 64 bits and after install all dependencies and gifify, de program is not working!

By not working I mean, when I type gifify it returns nothing. And the same thing happens when I use a real command line, trying to convert a file.

This behavior started after the installation of the module node, before this procedure, my attempts to run the program resulted in a error message ( "/usr/bin/env: node: File or folder not found").

I'll add bellow some informations of the installed programs in my system.

Thanks!

ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Dec 25 2014 00:04:42 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)

Version: ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP

LCDF Gifsicle 1.82
Copyright (C) 1997-2014 Eddie Kohler
This is free software; see the source for copying conditions.
There is NO warranty, not even for merchantability or fitness for a
particular purpose.

$ sudo npm install -g gifify

npm http GET https://registry.npmjs.org/gifify
npm http 304 https://registry.npmjs.org/gifify
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/moment-duration-format
npm http GET https://registry.npmjs.org/moment
npm http GET https://registry.npmjs.org/promise
npm http GET https://registry.npmjs.org/whereis
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/moment
npm http 304 https://registry.npmjs.org/promise
npm http 304 https://registry.npmjs.org/moment-duration-format
npm http 304 https://registry.npmjs.org/whereis
npm http GET https://registry.npmjs.org/ms/0.6.2
npm http GET https://registry.npmjs.org/asap
npm http 304 https://registry.npmjs.org/ms/0.6.2
npm http 304 https://registry.npmjs.org/asap
/usr/local/bin/gifify -> /usr/local/lib/node_modules/gifify/bin/gifify
[email protected] /usr/local/lib/node_modules/gifify
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected] ([email protected])
โ””โ”€โ”€ [email protected] ([email protected])

Problems creating image

I'm trying to convert part of .mp4 file but I get the following error:

convert: no decode delegate for this image format ' @ error/constitute.c/ReadImage/504. convert: no images definedgif:-' @ error/convert.c/ConvertImageCommand/3257.

Reinstalled everything from the readme but still getting the same error message, any advice?

quality question

looking at the original gifify gist, I noticed theres the --good option which does this:

ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png  GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png

I'm just curious, does this module do a similar trick? I'm asking because I just made this gif with gifify and it has lotsa weird artifacts

atom-shell-load-events

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x21f80a0] stream 0, offset 0xa8: partial file

Using this video http://techslides.com/demos/sample-videos/small.mp4

You will get this error:

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x21f80a0] stream 0, offset 0xa8: partial file

The problem explained: http://superuser.com/a/479064/35651

User solution:

Run mp4box -hint on the movie file before passing it to gifify.

Gifify solution, if the user gives us the movie file on the command line (gifify movie.mp4), then we
should pass it to ffmpeg as -i file instead of piping it to ffmpeg.

Two benefits:

  • fix this problem
  • also fixes cutting long movies #1

error with moment on fresh installation

Fresh install:

npm install -g gifify

Results in:

$ gifify vidz.mov -o delete-invitations.gif

/usr/local/lib/node_modules/gifify/node_modules/moment-duration-format/lib/moment-duration-format.js:202
    moment.duration.fn.format = function () {
                              ^
TypeError: Cannot set property 'format' of undefined
    at /usr/local/lib/node_modules/gifify/node_modules/moment-duration-format/lib/moment-duration-format.js:202:28
    at Object.<anonymous> (/usr/local/lib/node_modules/gifify/node_modules/moment-duration-format/lib/moment-duration-format.js:482:3)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/gifify/index.js:4:1)
    at Module._compile (module.js:456:26)

Passing in a Readable stream to gifify does not work in node

If I do

outputFileStream = fs.createWriteStream('out.gif');
gifify('blah.gif', { ... }).pipe(outputFileStream);

it works, but if I do

inputFileStream = fs.createReadStream('blah.gif');
outputFileStream = fs.createWriteStream('out.gif');
gifify(inputFileStream, { ... }).pipe(outputFileStream);

it fails with the following

Error: Uncaught, unspecified "error" event. (convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.
convert: no images defined `gif:-' @ error/convert.c/ConvertImageCommand/3210.
)
    at Socket.emit (events.js:163:17)
    at Socket.gotSomeErrors (/home/farhan/projects/ReverseGifRedditBot/node_modules/gifify/index.js:53:23)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at Pipe.onread (net.js:551:20)

Unable to use end time (--to)

I've tried across different source videos and different configurations, the gif does start from the defined start time, however, doesn't end based on the "to" value passed. The final gif goes all the way till the end of the video which is the default setting.

Error - gifsicle:<stdin>: empty file

Heya,

Getting this error while using gifify

[cw@pineserv ~]$ gifify watermelonpup.mp4 -o watermelonpup.gif
gifsicle:: empty file

[cw@pineserv ~]$ uname -a
Linux pineserv 3.10.65-4-pine64-longsleep #16 SMP PREEMPT Sun Apr 3 10:56:40 CEST 2016 aarch64 GNU/Linux

According to gifsicle Issue Tracker - kohler/gifsicle#33 - recommended to use -o and -b - Trying to understand how to do that while using gifify.

Appreciate any help.

convert: no images defined `gif:-' @ error/convert.c/ConvertImageCommand/3257

const get = require('request').get
const readStream = get(someURL)
const gif = require('fs').createWriteStream(`${this.params.id}.gif`)
gifify(readStream, {}).pipe(gif)

yields

Error: Uncaught, unspecified "error" event. (convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.
convert: no images defined `gif:-' @ error/convert.c/ConvertImageCommand/3257.
)
    at Socket.emit (events.js:157:17)
    at Socket.gotSomeErrors (/.../node_modules/gifify/index.js:53:23)
    at emitOne (events.js:90:13)
    at Socket.emit (events.js:182:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at Pipe.onread (net.js:534:20)

Maximum call stack size exceeded.

OS: Debian 8 x64
Node: v8.1.0
NPM: v5.0.3

Receiving this error:

RangeError: Maximum call stack size exceeded
    at emitOne (events.js:113:17)
    at ChildProcess.emit (events.js:210:7)
    at emitOne (events.js:115:13)
    at ChildProcess.emit (events.js:210:7)
    at emitOne (events.js:115:13)
    at ChildProcess.emit (events.js:210:7)
    at emitOne (events.js:115:13)
    at ChildProcess.emit (events.js:210:7)
    at emitOne (events.js:115:13)
    at ChildProcess.emit (events.js:210:7)

With this code:

const express = require('express');
const ydl = require('youtube-dl');
const gifify = require('gifify');
const fs = require('fs');

const app = express();
app.listen(80);

const video = ydl('https://www.youtube.com/watch?v=o-qK3u97iB0');

app.get('/', (req, res) => {
	gifify(video, { fps: 29.97 }).pipe(res);
});

convert needs fontconfig

I see this error when I try to use gifify on my OS X 10.10

convert needs fontconfig

I have imagemagick installed via homebrew:

imagemagick: stable 6.9.0-9 (bottled), HEAD
โ€ฆ
==> Dependencies
โ€ฆ
Optional: fontconfig โœ”, โ€ฆ

And also

$ brew install fontconfig
Warning: fontconfig-2.11.1 already installed

What am I missing?

"--lossy=80,--colors 80,..." - unrecognized

There is clearly an issue with the latest gifsicle build. It turns out that the --lossy and --colors are no longer supported in the cli. I found that the issue for gifify resides in index.js @ ln# 165. Not sure why you would publish a wrapper library that is suppose to support a forked version of gifsicle. Be more clear in your documentation.

function computeGifsicleArgs(opts) {
// Gifsicle options
// http://www.lcdf.org/gifsicle/man.html
// --lossy is not yet into master, kohler/gifsicle#16
var args = [
'-O3',
'--lossy ' + opts.compress * 2,
'--colors ' + opts.colors,
'--no-warnings'
];

Typo in ffmpeg install requirement

FFmpeg ๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“ ($ brew install fmpeg --with-libass --with-fontconfig)

Should be

FFmpeg ๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“ ($ brew install ffmpeg --with-libass --with-fontconfig)

Programatically tell when gif process is done

Hey there, trying to make a loop that goes through a folder of movies and converts them all, but I cant seem to figure out how to make it not start making a new gif before the last one finished.

I tried binding to the close callback on the write stream that the gifify command returns, but that doesnt seem to be all that is happening.

Loving gifify though! Any advice on this? Or way to achieve this @vvo?

Neither dependency works on 2.4.0

When installing giflossy it says:

Could not find gifsicle. Is it installed?

More info: https://github.com/vvo/gifify#requirements

When installing gifsicle it say:

gifsicle needs lossy

Using cli interface and global installs.

--speed not working?

I've tried using the --speed option to speed up my gif but so far it hasn't worked. Specifically, I've tried using --speed 2 to try to get the gif to be twice as fast.

How is this option meant to be used?

The full command I used was

gifify in.mov --resize 730:-1 --speed 2 -o out.gif

Partial compatibility with avconv, except for the "to" option

I'm working from an Ubuntu 14.04 installation that is using libav/avconv and I won't be able to install ffmpeg.

So I was able to symlink avconv to ffmpeg, and most of the basic functionality of giffify works, including:

                    gifify test.mp4 --resize:300:-1 --from 5 -o test.gif

However, when specifying the to option, I get this error:

convert.im6: no decode delegate for this image format `/tmp/magick-d4kfVlVz' @ error/constitute.c/ReadImage/544.
convert.im6: no images defined `gif:-' @ error/convert.c/ConvertImageCommand/3044.

The error comes from imagemagick though, so maybe it has nothing to do with ffmpeg (ffmpeg is just my first guess, given my hack with libav)

avconv version 9.16-6:9.16-0ubuntu0.14.04.1
ImageMagick 6.7.7-10 2014-03-06 Q16
LCDF Gifsicle 1.82

`no decode delegate for this image format`

Hello,

I just tried to use gifify to extract a gif from a mp4 video I downloaded from YouTube, and got the following error:

$ gifify input.mp4 -o output.gif --from 257 --to 279 --resize 250:-1
convert.im6: no decode delegate for this image format `/tmp/magick-Ij8cWq6S' @ error/constitute.c/ReadImage/544.
convert.im6: no images defined `gif:-' @ error/convert.c/ConvertImageCommand/3044.

I'm on Ubuntu, with the following dependency versions:

$ fffmpeg -version
ffmpeg version 0.10.12-7:0.10.12-1~saucy1
built on Apr 26 2014 09:54:16 with gcc 4.8.1
configuration: --arch=amd64 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='7:0.10.12-1~saucy1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
libavutil      51. 35.100 / 51. 35.100
libavcodec     53. 61.100 / 53. 61.100
libavformat    53. 32.100 / 53. 32.100
libavdevice    53.  4.100 / 53.  4.100
libavfilter     2. 61.100 /  2. 61.100
libswscale      2.  1.100 /  2.  1.100
libswresample   0.  6.100 /  0.  6.100
libpostproc    52.  0.100 / 52.  0.100
$ convert --version
Version: ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP    
$ gifsicle --version
LCDF Gifsicle 1.82
Copyright (C) 1997-2014 Eddie Kohler
This is free software; see the source for copying conditions.
There is NO warranty, not even for merchantability or fitness for a
particular purpose.

Note that I've installed gifsicle from the giflossy repository. I'm not sure where the issue lies.

Trying to add subtitles

Hi,
I tried to mix a subtitles with my gif, and somehow it didn't work

gifify video.mp4 -o mygif.gif --subtitles subtitles.ass --resize 600:-1 --compress 0 --fps 8 --colors 160 --speed 1

convert.im6: no decode delegate for this image format `/tmp/magick-dmhxdNv4' @ error/constitute.c/ReadImage/544.
convert.im6: no images defined `gif:-' @ error/convert.c/ConvertImageCommand/3044.

My imagemagick supports lots of format by default :

$ identify -list format
   Format  Module    Mode  Description
-------------------------------------------------------------------------------
      3FR  DNG       r--   Hasselblad CFV/H3D39II
        A* RAW       rw+   Raw alpha samples
      AAI* AAI       rw+   AAI Dune image
       AI  PDF       rw-   Adobe Illustrator CS2
      ART* ART       rw-   PFS: 1st Publisher Clip Art
      ARW  DNG       r--   Sony Alpha Raw Image Format
      AVI  MPEG      r--   Microsoft Audio/Visual Interleaved
      AVS* AVS       rw+   AVS X image
        B* RAW       rw+   Raw blue samples
      BGR* BGR       rw+   Raw blue, green, and red samples
     BGRA* BGR       rw+   Raw blue, green, red, and alpha samples
      BIE* JBIG      rw-   Joint Bi-level Image experts Group interchange format (2.0)
      BMP* BMP       rw-   Microsoft Windows bitmap image
     BMP2* BMP       -w-   Microsoft Windows bitmap image (V2)
     BMP3* BMP       -w-   Microsoft Windows bitmap image (V3)
      BRF* BRAILLE   -w-   BRF ASCII Braille format
        C* RAW       rw+   Raw cyan samples
      CAL* CALS      rw-   Continuous Acquisition and Life-cycle Support Type 1
           Specified in MIL-R-28002 and MIL-PRF-28002
     CALS* CALS      rw-   Continuous Acquisition and Life-cycle Support Type 1
           Specified in MIL-R-28002 and MIL-PRF-28002
   CANVAS* XC        r--   Constant image uniform color
  CAPTION* CAPTION   r--   Caption
      CIN* CIN       rw-   Cineon Image File
      CIP* CIP       -w-   Cisco IP phone image format
     CLIP* CLIP      -w+   Image Clip Mask
     CMYK* CMYK      rw+   Raw cyan, magenta, yellow, and black samples
    CMYKA* CMYK      rw+   Raw cyan, magenta, yellow, black, and alpha samples
      CR2  DNG       r--   Canon Digital Camera Raw Image Format
      CRW  DNG       r--   Canon Digital Camera Raw Image Format
      CUR* CUR       rw-   Microsoft icon
      CUT* CUT       r--   DR Halo
      DCM* DCM       r--   Digital Imaging and Communications in Medicine image
           DICOM is used by the medical community for images like X-rays.  The
           specification, "Digital Imaging and Communications in Medicine
           (DICOM)", is available at http://medical.nema.org/.  In particular,
           see part 5 which describes the image encoding (RLE, JPEG, JPEG-LS),
           and supplement 61 which adds JPEG-2000 encoding.
      DCR  DNG       r--   Kodak Digital Camera Raw Image File
      DCX* PCX       rw+   ZSoft IBM PC multi-page Paintbrush
      DDS* DDS       r--   Microsoft DirectDraw Surface
    DFONT* TTF       r--   Multi-face font package (Freetype 2.5.2)
     DJVU* DJVU      r--   D๏ฟฝj๏ฟฝ vu
           See http://www.djvuzone.org/ for details about the DJVU format.  The
           DJVU 1.2 specification is available there and at
           ftp://swrinde.nde.swri.edu/pub/djvu/documents/.
      DNG  DNG       r--   Digital Negative
      DOT  DOT       ---   Graphviz
      DPX* DPX       rw-   SMPTE 268M-2003 (DPX 2.0)
           Digital Moving Picture Exchange Bitmap, Version 2.0.
           See SMPTE 268M-2003 specification at http://www.smtpe.org

     EPDF  PDF       rw-   Encapsulated Portable Document Format
      EPI  PS        rw-   Encapsulated PostScript Interchange format
      EPS  PS        rw-   Encapsulated PostScript
     EPS2* PS2       -w-   Level II Encapsulated PostScript
     EPS3* PS3       -w+   Level III Encapsulated PostScript
     EPSF  PS        rw-   Encapsulated PostScript
     EPSI  PS        rw-   Encapsulated PostScript Interchange format
      EPT  EPT       rw-   Encapsulated PostScript with TIFF preview
     EPT2  EPT       rw-   Encapsulated PostScript Level II with TIFF preview
     EPT3  EPT       rw+   Encapsulated PostScript Level III with TIFF preview
      ERF  DNG       r--   Epson RAW Format
      EXR  EXR       rw-   High Dynamic-range (HDR)
      FAX* FAX       rw+   Group 3 FAX
           FAX machines use non-square pixels which are 1.5 times wider than
           they are tall but computer displays use square pixels, therefore
           FAX images may appear to be narrow unless they are explicitly
           resized using a geometry of "150x100%".

     FITS* FITS      rw-   Flexible Image Transport System
  FRACTAL* PLASMA    r--   Plasma fractal image
      FTS* FTS       rw-   Flexible Image Transport System
        G* RAW       rw+   Raw green samples
       G3* FAX       rw-   Group 3 FAX
      GIF* GIF       rw+   CompuServe graphics interchange format
    GIF87* GIF       rw-   CompuServe graphics interchange format (version 87a)
 GRADIENT* GRADIENT  r--   Gradual linear passing from one shade to another
     GRAY* GRAY      rw+   Raw gray samples
   GROUP4* TIFF      rw-   Raw CCITT Group4
     HALD*           r--   Identity Hald color lookup table image
      HDR* HDR       rw+   Radiance RGBE image format
HISTOGRAM* HISTOGRAM -w-   Histogram of the image
      HRZ* HRZ       rw-   Slow Scan TeleVision
      HTM* HTML      -w-   Hypertext Markup Language and a client-side image map
     HTML* HTML      -w-   Hypertext Markup Language and a client-side image map
      ICB* TGA       rw-   Truevision Targa image
      ICO* ICON      rw+   Microsoft icon
     ICON* ICON      rw-   Microsoft icon
     INFO  INFO      -w+   The image format and characteristics
   INLINE* INLINE    r--   Base64-encoded inline images
      IPL* IPL       rw+   IPL Image Sequence
   ISOBRL* BRAILLE   -w-   ISO/TR 11548-1 format
      J2C* JP2       rw-   JPEG-2000 Code Stream Syntax
      J2K* JP2       rw-   JPEG-2000 Code Stream Syntax
      JBG* JBIG      rw+   Joint Bi-level Image experts Group interchange format (2.0)
     JBIG* JBIG      rw+   Joint Bi-level Image experts Group interchange format (2.0)
      JNG* PNG       rw-   JPEG Network Graphics
           See http://www.libpng.org/pub/mng/ for details about the JNG
           format.
      JP2* JP2       rw-   JPEG-2000 File Format Syntax
      JPC* JP2       rw-   JPEG-2000 Code Stream Syntax
     JPEG* JPEG      rw-   Joint Photographic Experts Group JFIF format (80)
      JPG* JPEG      rw-   Joint Photographic Experts Group JFIF format (80)
      JPX* JP2       rw-   JPEG-2000 File Format Syntax
        K* RAW       rw+   Raw black samples
      K25  DNG       r--   Kodak Digital Camera Raw Image Format
      KDC  DNG       r--   Kodak Digital Camera Raw Image Format
    LABEL* LABEL     r--   Image label
        M* RAW       rw+   Raw magenta samples
      M2V  MPEG      rw+   MPEG Video Stream
      M4V  MPEG      rw+   Raw MPEG-4 Video
      MAC* MAC       r--   MAC Paint
      MAP* MAP       rw-   Colormap intensities and indices
      MAT  MAT       rw+   MATLAB level 5 image format
    MATTE* MATTE     -w+   MATTE format
      MEF  DNG       r--   Mamiya Raw Image File
     MIFF* MIFF      rw+   Magick Image File Format
      MNG* PNG       rw+   Multiple-image Network Graphics (libpng 1.2.50)
           See http://www.libpng.org/pub/mng/ for details about the MNG
           format.
     MONO* MONO      rw-   Raw bi-level bitmap
      MOV  MPEG      rw+   MPEG Video Stream
      MP4  MPEG      rw+   MPEG-4 Video Stream
      MPC* MPC       rw+   Magick Persistent Cache image format
     MPEG  MPEG      rw+   MPEG Video Stream
      MPG  MPEG      rw+   MPEG Video Stream
      MRW  DNG       r--   Sony (Minolta) Raw Image File
      MSL* MSL       rw+   Magick Scripting Language
     MSVG  SVG       rw+   ImageMagick's own SVG internal renderer
      MTV* MTV       rw+   MTV Raytracing image format
      MVG* MVG       rw-   Magick Vector Graphics
      NEF  DNG       r--   Nikon Digital SLR Camera Raw Image File
      NRW  DNG       r--   Nikon Digital SLR Camera Raw Image File
     NULL* NULL      rw-   Constant image of uniform color
        O* RAW       rw+   Raw opacity samples
      ORF  DNG       r--   Olympus Digital Camera Raw Image File
      OTB* OTB       rw-   On-the-air bitmap
      OTF* TTF       r--   Open Type font (Freetype 2.5.2)
      PAL* UYVY      rw-   16bit/pixel interleaved YUV
     PALM* PALM      rw+   Palm pixmap
      PAM* PNM       rw+   Common 2-dimensional bitmap format
    PANGO* PANGO     r--   Pango Markup Language (Pangocairo 1.36.1)
  PATTERN* PATTERN   r--   Predefined pattern
      PBM* PNM       rw+   Portable bitmap format (black and white)
      PCD* PCD       rw-   Photo CD
     PCDS* PCD       rw-   Photo CD
      PCL  PCL       rw+   Printer Control Language
      PCT* PICT      rw-   Apple Macintosh QuickDraw/PICT
      PCX* PCX       rw-   ZSoft IBM PC Paintbrush
      PDB* PDB       rw+   Palm Database ImageViewer Format
      PDF  PDF       rw+   Portable Document Format
     PDFA  PDF       rw+   Portable Document Archive Format
      PEF  DNG       r--   Pentax Electronic File
      PES* PES       r--   Embrid Embroidery Format
      PFA* TTF       r--   Postscript Type 1 font (ASCII) (Freetype 2.5.2)
      PFB* TTF       r--   Postscript Type 1 font (binary) (Freetype 2.5.2)
      PFM* PFM       rw+   Portable float format
      PGM* PNM       rw+   Portable graymap format (gray scale)
      PGX* JP2       r--   JPEG-2000 VM Format
    PICON* XPM       rw-   Personal Icon
     PICT* PICT      rw-   Apple Macintosh QuickDraw/PICT
      PIX* PIX       r--   Alias/Wavefront RLE image format
    PJPEG* JPEG      rw-   Joint Photographic Experts Group JFIF format (80)
   PLASMA* PLASMA    r--   Plasma fractal image
      PNG* PNG       rw-   Portable Network Graphics (libpng 1.2.50)
           See http://www.libpng.org/ for details about the PNG format.
    PNG24* PNG       rw-   opaque 24-bit RGB (zlib 1.2.8)
    PNG32* PNG       rw-   opaque or transparent 32-bit RGBA
     PNG8* PNG       rw-   8-bit indexed with optional binary transparency
      PNM* PNM       rw+   Portable anymap
      PPM* PNM       rw+   Portable pixmap format (color)
  PREVIEW* PREVIEW   -w-   Show a preview an image enhancement, effect, or f/x
       PS  PS        rw+   PostScript
      PS2* PS2       -w+   Level II PostScript
      PS3* PS3       -w+   Level III PostScript
      PSB* PSD       rw+   Adobe Large Document Format
      PSD* PSD       rw+   Adobe Photoshop bitmap
     PTIF* TIFF      rw+   Pyramid encoded TIFF
      PWP* PWP       r--   Seattle Film Works
        R* RAW       rw+   Raw red samples
RADIAL-GRADIENT* GRADIENT  r--   Gradual radial passing from one shade to another
      RAF  DNG       r--   Fuji CCD-RAW Graphic File
      RAS* SUN       rw+   SUN Rasterfile
      RGB* RGB       rw+   Raw red, green, and blue samples
     RGBA* RGB       rw+   Raw red, green, blue, and alpha samples
     RGBO* RGB       rw+   Raw red, green, blue, and opacity samples
      RLA* RLA       r--   Alias/Wavefront image
      RLE* RLE       r--   Utah Run length encoded image
      SCR* SCR       r--   ZX-Spectrum SCREEN$
      SCT* SCT       r--   Scitex HandShake
      SFW* SFW       r--   Seattle Film Works
      SGI* SGI       rw+   Irix RGB image
    SHTML* HTML      -w-   Hypertext Markup Language and a client-side image map
      SR2  DNG       r--   Sony Raw Format 2
      SRF  DNG       r--   Sony Raw Format
  STEGANO* STEGANO   r--   Steganographic image
      SUN* SUN       rw+   SUN Rasterfile
      SVG  SVG       rw+   Scalable Vector Graphics (RSVG 2.40.1)
     SVGZ  SVG       rw+   Compressed Scalable Vector Graphics (RSVG 2.40.1)
     TEXT* TXT       rw+   Text
      TGA* TGA       rw-   Truevision Targa image
THUMBNAIL* THUMBNAIL -w+   EXIF Profile Thumbnail
     TIFF* TIFF      rw+   Tagged Image File Format (LIBTIFF, Version 4.0.3)
   TIFF64* TIFF      rw-   Tagged Image File Format (64-bit) (LIBTIFF, Version 4.0.3)
     TILE* TILE      r--   Tile image with a texture
      TIM* TIM       r--   PSX TIM
      TTC* TTF       r--   TrueType font collection (Freetype 2.5.2)
      TTF* TTF       r--   TrueType font (Freetype 2.5.2)
      TXT* TXT       rw+   Text
     UBRL* BRAILLE   -w-   Unicode Text format
      UIL* UIL       -w-   X-Motif UIL table
     UYVY* UYVY      rw-   16bit/pixel interleaved YUV
      VDA* TGA       rw-   Truevision Targa image
    VICAR* VICAR     rw-   VICAR rasterfile format
      VID* VID       rw+   Visual Image Directory
     VIFF* VIFF      rw+   Khoros Visualization image
      VST* TGA       rw-   Truevision Targa image
     WBMP* WBMP      rw-   Wireless Bitmap (level 0) image
      WMF* WMF       r--   Windows Meta File
      WMV  MPEG      rw+   Windows Media Video
      WMZ* WMZ       r--   Compressed Windows Meta File
      WPG* WPG       r--   Word Perfect Graphics
        X* X         rw+   X Image
      X3F  DNG       r--   Sigma Camera RAW Picture File
      XBM* XBM       rw-   X Windows system bitmap (black and white)
       XC* XC        r--   Constant image uniform color
      XCF* XCF       r--   GIMP image
      XPM* XPM       rw-   X Windows system pixmap (color)
      XPS  XPS       r--   Microsoft XML Paper Specification
       XV* VIFF      rw+   Khoros Visualization image
      XWD* XWD       rw-   X Windows system window dump (color)
        Y* RAW       rw+   Raw yellow samples
    YCbCr* YCbCr     rw+   Raw Y, Cb, and Cr samples
   YCbCrA* YCbCr     rw+   Raw Y, Cb, Cr, and alpha samples
      YUV* YUV       rw-   CCIR 601 4:1:1 or 4:2:2

* native blob support
r read support
w write support
+ support for multiple images

keep getting an error

Hi,
I keep getting this error when using gifify:

events.js:53
EventEmitter.prototype.emit = function emit(type) {
^
RangeError: Maximum call stack size exceeded

I'm running your get started example.

I think it has to do with the ffmpeg module dependency because when im trying to convert via shell I also get an error:

$ gifify inputs/mov.webm -o outputs/mov.gif --resize 800:-1
[Error: Could not find ffmpeg on your system]

Which is odd because i installed ffmpeg and I can require it.

How can i make it work?

Thank You!

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.