take screenshots at any point during a video
Generate screenshots from videos
This module requires ffmpeg
$ npm install --save video-screen
var videoScreen = require('video-screen');
var fs = require('fs');
videoScreen('path/to/video.mp4')
.pipe(fs.createWriteStream('video.png'));
// or if streams aren't your thing
videoScreen('path/to/video.mp4', function (err, screenshot) {
fs.writeFile('screenshot.png', screenshot, function () {
console.log('screenshot saved!');
});
});
Required
Type: string
String of video path
Type: string
Default: '00:00:01'
The video time where the screenshot should be taken from
Type: number
Default: 200
The width of the generated screenshot
Type: number
Default: 125
The height of the generated screenshot
$ video-screen --help
Take a screenshot of a video
Usage
$ video-screen <input-file> > <output-file>
Options
-t, --time Seeked position of video to take screenshot
-w, --width Width of screenshot
-h, --height Height of screenshot
Example
$ video-screen clip.mp4 > clip.png
MIT