WebRTC Metrics

A comprehensive overview of WebRTC statistics, derived calculations, extracted features, and observable signals, to better understand call quality, connectivity, and user experience in rtcStats

Back
On this page6 sections
trackcodecvideoaudiosdp

Codec (feature)

Last updated Applies tortcstats-serverrtcstats.com

Track-level features recording the negotiated codec MIME type and its SDP fmtp parameters for each media track.

Description

Track-level features, extracted per media track into features_track.

These features record which codec a track actually used, read from the first getStats:

  • codecMimeType - the MIME type of the negotiated codec (e.g. video/VP8, video/H264, audio/opus).
  • codecSdpFmtpLine - the SDP fmtp parameters for that codec ('' if none).

Extracted by the open-source rtcstats-features package.

Why it matters

codecMimeType tells you what your endpoints negotiated, which is not always what you offered. After a codec rollout (say, enabling AV1 or VP9), this is how you confirm real-world adoption across browsers and versions. Codec distribution also explains quality and CPU differences between cohorts, and codecSdpFmtpLine exposes profile-level detail (H.264 profile-level-id, Opus FEC/DTX flags) that can differ subtly between clients and cause interop surprises.

Common values

  • Video: video/VP8, video/VP9, video/H264, video/AV1.
  • Audio: audio/opus, audio/PCMU, audio/PCMA.
  • codecSdpFmtpLine: codec-specific parameter string, or empty.

SQL example

Codec distribution across all outbound tracks on connections that actually established:

SELECT
  track.codec_mime_type,
  COUNT(*) AS tracks
FROM features_track AS track
JOIN features_connection AS connection ON connection.id = track.connection_id
WHERE track.codec_mime_type IS NOT NULL
  AND connection.connected          -- only connections that reached 'connected'
  AND track.direction = 'outbound'  -- 'inbound' or 'outbound'
  AND track.kind = 'video'          -- 'audio' or 'video'
GROUP BY track.codec_mime_type
ORDER BY tracks DESC;

See also