Node.js Fluent-FFMPEG Example to Convert Video to Images at Custom Time Using takeScreenshots() in Command Line
const ffmpeg = require('fluent-ffmpeg');
ffmpeg({ source: './video.mp4' })
.on('filenames', (filenames) => {
console.log('Created file names', filenames);
})
.on('end', () => {
console.log('Job done');
})
.on('error', (err) => {
console.log('Error', err);
})
.takeScreenshots({
filename: 'example.jpg',
timemarks: [ 2, 4 ]
}, 'images');