damianociarla / node-ffmpeg

ffmpeg module for nodejs
MIT License
600 stars 140 forks source link

Slow encoding #63

Open everythingspirals opened 4 years ago

everythingspirals commented 4 years ago

Encoding a video using ffmpeg directly is significantly faster (30 seconds versus 80 seconds) than using this module or fluent-ffmpeg, am I doing something wrong? Is this related to nodejs being single-threaded?

let transcode = new ffmpeg(this.testFile)
 transcode.then(function (video) {
                let outputPath = path.join(this.transcodePath, 'output.mp4');
                video.addCommand('-c:v', 'libx264');
                video.addCommand('-b:v', '2000000');
                video.save(outputPath);
});

vs

ffmpeg -i test.mov -b:v 2000000 -c:v libx264 test2.mp4