Simply create 2 streams and add event listeners for 'progress' on both. You'll only get messages from the first command.
I'm not sure if this is also what is happening to you, but I found that if I do something like:
const command = ffmpeg(input).outputFormat('mp4').save(outputFile);
command.on('progress', () => ...);
Then it works once but not the second time. This was because there was a race condition, and the save() was sometimes happening before attaching the event listeners. Instead, this worked for me:
const command = ffmpeg(input).outputFormat('mp4');
command.on('progress', () => ...);
command.save(outputFile);
Confirmed, this putting save before progress works for me too.
Most helpful comment
I'm not sure if this is also what is happening to you, but I found that if I do something like:
Then it works once but not the second time. This was because there was a race condition, and the
save()was sometimes happening before attaching the event listeners. Instead, this worked for me: