Generates a sprite grid of video thumbnails using ffmpeg.
var fs = require('fs');
var thumbs = require('video-thumb-grid');
var grid = thumbs(fs.createReadStream('video.mov'));
grid.count(100);
grid.interval(4);
grid.start(0);
grid.render(function(err, buf){
if (err) throw err;
fs.writeFileSync('grid.jpg', buf);
});
Constructs a new Grid with the given input Readable stream.
Constructs a new Grid with the given input fs path.
Returns the number of thumbnails to generate. Defaults to 100.
count.Grid instance object.Returns the number of rows in the grid. Defaults to the creating a
"square" by calculating the square root of count.
count.Grid instance object.Returns how many seconds to wait between thumbs. Defaults to 1.
int.Grid instance object.Returns the number of seconds at which we start capturing thumbs.
Defaults to 0.
Returns the width of each individual thumb in the grid.
Defaults to 192.
w.Grid instance object.Returns the height of each individual thumb in the grid.
Defaults to 144.
h.Grid instance object.Returns the quality of the resulting JPEG. Defaults to 50.
q.Grid instance object.Returns the quality of frames returned by ffmpeg. This corresponds to
the q option, which takes a value from 1 (highest) to 31 (lowest).
Defaults to 1.
ffmpeg video quality.Grid instance object.Returns the prefix used for debug messages. Defaults to an empty string.
prefix.Grid instance object.fn with err, buf, buf being the resulting JPEG grid.Grid#abort.Grid instance object.ffmpeg process, if ongoing, or the grid composition.Grid instance object.Returns the program that will be called. Defaults to ffmpeg.
cmd.Grid instance object.ffmpeg ChildProcess.msg to stdout when DEBUG is enabled. The type can be info or ffmpeg which helps separate the noise.interval and start combination can't possibly meet count
due to the length of the video, the grid will be populated with empty
spaces.ffmpeg must be installed an available in $PATHlibjpeg needs to be installed for the picha dependency to buildMIT – Copyright (c) 2014 Automattic, Inc.