rafaelmaeuer
2/16/2017 - 9:32 AM

How to cut a video in specific start & end time in ffmpeg by Node JS? - From http://stackoverflow.com/questions/31046930/how-to-cut-a-video-

How to cut a video in specific start & end time in ffmpeg by Node JS? - From http://stackoverflow.com/questions/31046930/how-to-cut-a-video-in-specific-start-end-time-in-ffmpeg-by-node-js

var ffmpeg = require('fluent-ffmpeg');


    ffmpeg('public/'+req.body.video)
    .setStartTime('00:00:03')
    .setDuration('10')
    .output('public/videos/test/test.mp4')

    .on('end', function(err) {   
        if(!err)
        {
          console.log('conversion Done');


        }                 

    })
    .on('error', function(err){
        console.log('error: ', +err);

    }).run();