Open TechnoTew opened 4 years ago
Same here! Please fix this.
After some reading on the issue board, turn out this project need maintainer, this project currently is in "low maintain mode" which is understandable, base on this Wiki
var ffmpeg = require('../lib/fluent-ffmpeg');
function run1() {
var file_path = '/Users/remote_edit/Desktop/fluent-ffmpeg2/examples/test.mp4'
var command = ffmpeg(file_path);
command.audioCodec('libmp3lame')
.videoCodec('libx264')
.videoBitrate(1000)
.size('640x480')
.on('progress', function (progress) {
console.log('First video: ' + progress.percent + '% done');
})
.on('end', function (progress) {
run2();
})
.save('./First.mp4')
}
function run2() {
console.log('run2 get run');
var file_path = '/Users/remote_edit/Desktop/fluent-ffmpeg2/examples/test.mp4'
var command = ffmpeg(file_path);
command.audioCodec('libmp3lame')
.videoCodec('libx264')
.videoBitrate(1000)
.size('640x480')
.on('progress', function (progress) {
console.log('Second video: ' + progress.percent + '% done');
})
.on('end', function (progress) {
console.log('done');
})
.save('./Second.mp4')
}
run1();
but in my production code (an Electron.js Desktop App) it has this "progress not correct" issue
.save()
should be the last, here is the right way to do it@TechnoTew I think in your case, saveToFile
should be the last one.
I can confirm this is still a thing, the .save
method must be called after the .on
methods in the chain
Version information
Code to reproduce
(note: if the problem only happens with some inputs, include a link to such an input file)
Expected results
Message changing based on progress, both progress being shown
Observed results
Only the audio download progress is shown