lib/utils.js
function(command, stderrLine) {
    var progress = parseProgressLine(stderrLine);

    if (progress) {
      // build progress report object
      var ret = {
        frames: parseInt(progress.frame, 10),
        currentFps: parseInt(progress.fps, 10),
        currentKbps: progress.bitrate ? parseFloat(progress.bitrate.replace('kbits/s', '')) : 0,
        targetSize: parseInt(progress.size || progress.Lsize, 10),
        timemark: progress.time
      };

      // calculate percent progress using duration
      if (command._ffprobeData && command._ffprobeData.format && command._ffprobeData.format.duration) {
        var duration = Number(command._ffprobeData.format.duration);
        if (!isNaN(duration))
          ret.percent = (utils.timemarkToSeconds(ret.timemark) / duration) * 100;
      }
      command.emit('progress', ret);
    }
  }
function(command, stderrLine) {
    var progress = parseProgressLine(stderrLine);

    if (progress) {
      // build progress report object
      var ret = {
        frames: parseInt(progress.frame, 10),
        currentFps: parseInt(progress.fps, 10),
        currentKbps: progress.bitrate ? parseFloat(progress.bitrate.replace('kbits/s', '')) : 0,
        targetSize: parseInt(progress.size || progress.Lsize, 10),
        timemark: progress.time
      };

      // calculate percent progress using duration
      if (command._ffprobeData && command._ffprobeData.format && command._ffprobeData.format.duration) {
        var duration = Number(command._ffprobeData.format.duration);
        if (!isNaN(duration))
          ret.percent = (utils.timemarkToSeconds(ret.timemark) / duration) * 100;
      }
      command.emit('progress', ret);
    }
  }
function ( command , stderrLine ) { var progress = parseProgressLine ( stderrLine ) ; if ( progress ) { // build progress report object var ret = { frames : parseInt ( progress . frame , 10 ) , currentFps : parseInt ( progress . fps , 10 ) , currentKbps : progress . bitrate ? parseFloat ( progress . bitrate . replace ( 'kbits/s' , '' ) ) : 0 , targetSize : parseInt ( progress . size || progress . Lsize , 10 ) , timemark : progress . time } ; // calculate percent progress using duration if ( command . _ffprobeData && command . _ffprobeData . format && command . _ffprobeData . format . duration ) { var duration = Number ( command . _ffprobeData . format . duration ) ; if ( ! isNaN ( duration ) ) ret . percent = ( utils . timemarkToSeconds ( ret . timemark ) / duration ) * 100 ; } command . emit ( 'progress' , ret ) ; } }
Extract progress data from ffmpeg stderr and emit 'progress' event if appropriate

@param {FfmpegCommand} command event emitter
@param {String} stderrLine ffmpeg stderr data
@private
Extract progress data from ffmpeg stderr and emit progress event if appropriate