Skip to content

Commit

Permalink
Merge pull request fluent-ffmpeg#700 from rhodgkins/stream-progress
Browse files Browse the repository at this point in the history
Allow progress events with streams
  • Loading branch information
njoyard authored Apr 23, 2017
2 parents 9f492c3 + 4cbe28e commit dcc052a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion lib/processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ var nlRegexp = /\r\n|\r|\n/g;
* @private
*/
function runFfprobe(command) {
command.ffprobe(0, function(err, data) {
const inputProbeIndex = 0;
if (command._inputs[inputProbeIndex].isStream) {
// Don't probe input streams as this will consume them
return;
}
command.ffprobe(inputProbeIndex, function(err, data) {
command._ffprobeData = data;
});
}
Expand Down
3 changes: 1 addition & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ var utils = module.exports = {
*
* @param {FfmpegCommand} command event emitter
* @param {String} stderrLine ffmpeg stderr data
* @param {Number} [duration=0] expected output duration in seconds
* @private
*/
extractProgress: function(command, stderrLine) {
Expand All @@ -333,7 +332,7 @@ var utils = module.exports = {
frames: parseInt(progress.frame, 10),
currentFps: parseInt(progress.fps, 10),
currentKbps: progress.bitrate ? parseFloat(progress.bitrate.replace('kbits/s', '')) : 0,
targetSize: parseInt(progress.size, 10),
targetSize: parseInt(progress.size || progress.Lsize, 10),
timemark: progress.time
};

Expand Down

0 comments on commit dcc052a

Please sign in to comment.