Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit dcc052a

Browse files
authored
Merge pull request #700 from rhodgkins/stream-progress
Allow progress events with streams
2 parents 9f492c3 + 4cbe28e commit dcc052a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/processor.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ var nlRegexp = /\r\n|\r|\n/g;
2121
* @private
2222
*/
2323
function runFfprobe(command) {
24-
command.ffprobe(0, function(err, data) {
24+
const inputProbeIndex = 0;
25+
if (command._inputs[inputProbeIndex].isStream) {
26+
// Don't probe input streams as this will consume them
27+
return;
28+
}
29+
command.ffprobe(inputProbeIndex, function(err, data) {
2530
command._ffprobeData = data;
2631
});
2732
}

lib/utils.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ var utils = module.exports = {
321321
*
322322
* @param {FfmpegCommand} command event emitter
323323
* @param {String} stderrLine ffmpeg stderr data
324-
* @param {Number} [duration=0] expected output duration in seconds
325324
* @private
326325
*/
327326
extractProgress: function(command, stderrLine) {
@@ -333,7 +332,7 @@ var utils = module.exports = {
333332
frames: parseInt(progress.frame, 10),
334333
currentFps: parseInt(progress.fps, 10),
335334
currentKbps: progress.bitrate ? parseFloat(progress.bitrate.replace('kbits/s', '')) : 0,
336-
targetSize: parseInt(progress.size, 10),
335+
targetSize: parseInt(progress.size || progress.Lsize, 10),
337336
timemark: progress.time
338337
};
339338

0 commit comments

Comments
 (0)