Skip to content

Instantly share code, notes, and snippets.

@alexander-elgin
Created January 30, 2020 15:34
Show Gist options
  • Save alexander-elgin/c1310e169a913aa25d9ed36c2daf1a9e to your computer and use it in GitHub Desktop.
Save alexander-elgin/c1310e169a913aa25d9ed36c2daf1a9e to your computer and use it in GitHub Desktop.
Video Thumbnail
var ffmpeg = require('fluent-ffmpeg');
var path = require('path');
new ffmpeg(path.join(__dirname, 'input.mp4'))
.takeScreenshots({
filename: 'thumbnail.png',
size: '640x480',
timemarks: [ '50%' ],
}, __dirname, function(err) {
if (err) {
console.error(err);
} else {
console.log('screenshots were saved');
}
});
@alexander-elgin
Copy link
Author

npm install --save fluent-ffmpeg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment