Skip to content

SQA Overview

Stream Quality Analyzer (SQA) subsystem is intended to collect WebRTC media streams statistics data and then to check a publishing or playback quality metrics. This allows to detect a clients` streaming problems like poor network channel, local encoder/decoder performance issues and so on.

How it works

WebRTC streaming metrics collection

A publishing or playing WebRTC stream metrics available in browser or WebRTC library are anonymously collected at client side

Attention

No any personal data collected. Only WebRTC statistics data are necessary and enough to check a streaming quality.

The metrics batches are sent via Websocket or HTTP/HTTPS to ingest point. WCS used for streaming may be such ingest point too. For example, in small all-in-one server deploy the data flow looks like this

In a complex distributed server networks it is recommended to user HTTPS ingest point

Then metrics data are stored in Clickhouse database.

WebRTC streaming metrics analyzing

The metrics data collected for a certain stream may be analyzed by REST API query /rest-api/stream_metrics_analyzer

POST /rest-api/stream_metrics_analyzer HTTP/1.1
Host: localhost:8081
Content-Type: application/json

{
    "mediaSessionId": "7324b000-a246-11f0-822a-dd36fbada6fa",
    "from": "0",
    "to": "0"
}

Where

  • mediaSessionId is an identifier associated with the media stream. It may be retrieved by REST API /rest-api/v3/stream/find query when stream is publishing or playing.
  • from and to define a time interval to search te stream data, 0 means no time limits

The query returns a possible stream problems list

{
  "Video": {
    "status": "PROBLEM",
    "problems": [
      {
        "startTimestamp": "1759708392408.411",
        "endTimestamp": "1759708392408.411",
        "mediaSessionId": "7324b000-a246-11f0-822a-dd36fbada6fa",
        "level": "WARN",
        "message": "FPS deviates significantly from expected value:  fps=0.00, avg=28.50, deviation=100.00%",
        "metricName": "framesPerSecond"
      },
      {
        "startTimestamp": "1759708392408.411",
        "endTimestamp": "1759708392408.411",
        "mediaSessionId": "7324b000-a246-11f0-822a-dd36fbada6fa",
        "level": "ERROR",
        "message": "Video resolution does not match expected parameters:  (actual=0x0, expected=640x480, timestamp=1759708392408.411)",
        "metricName": "frameWidth/frameHeight/frameWidth/frameHeight"
      }
    ]
  }
}

There is also the visual analyzing tool displaying a metrics graphs and marking a possible issues