v150 · WebRTC · Media

Pipeline Health Monitor

A canvas-based video source feeds a MediaStreamTrackProcessor. Slow the consumer below the production rate with the slider and watch totalFrames and discardedFrames diverge — the gap is exactly the data your pipeline is losing.

Checking MediaStreamTrackProcessor support…
30 fps (producer always runs at 30 fps)
Pipeline health:
totalFrames
discardedFrames
deliver rate
discard %
totalFrames (black) vs. discardedFrames (red) over time

reading the counters

const processor = new MediaStreamTrackProcessor({ track });

// Chrome 150: read counters at any time
function checkHealth() {
  const total = processor.totalFrames;
  const discarded = processor.discardedFrames;
  const pct = total > 0 ? (discarded / total * 100).toFixed(1) : 0;

  if (pct > 10) {
    console.warn(`Dropping ${pct}% of frames — consumer is too slow`);
    reduceProcessingLoad();
  }
}

// Poll or check after each frame
setInterval(checkHealth, 1000);

see also

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗