vid2gif
v1.0.1
Published
Browser module for converting a video element into a GIF file.
Downloads
6
Readme
#vid2gif Convert a video element to an animated GIF in the browser.
Usage
vid2gif
is designed to be used with browserify. To use it, include it in a browserified module:
var vid2gif = require('vid2gif')
var NUM_FRAMES = 10
vid2gif(document.querySelector('video'), NUM_FRAMES, function(err, gifBlob) {
if (err) {
alert('oh no!: ' + err)
return
}
var img = document.createElement('img')
img.src = window.URL.createObjectURL(gifBlob)
docuument.body.appendChild(img)
})
API
var vid2gif = require('vid2gif')
vid2gif(videoElement, numFrames, cb)
Convert videoElement
's source (with known number of frames numFrames
, assumed to be evenly
distributed) to an animated GIF, calling cb
when done. cb
is a function(err, gifBlob)
.
Installation
npm install vid2gif
License
MIT