Node.js Fluent-FFMPEG Example to Convert Video to Images at Custom Time Using takeScreenshots() in Command Line

You are currently viewing Node.js Fluent-FFMPEG Example to Convert Video to Images at Custom Time Using takeScreenshots() in Command Line

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');

Ranjith

Hi, I'm Manoj a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply