Bug 212938 - [WebRTC] Add support for freeze/pause receiver stats
Summary: [WebRTC] Add support for freeze/pause receiver stats
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 13
Hardware: iPhone / iPad iOS 13
: P2 Major
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-06-08 16:27 PDT by charob
Modified: 2020-06-22 09:15 PDT (History)
13 users (show)

See Also:


Attachments
Patch (6.51 KB, patch)
2020-06-22 06:42 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description charob 2020-06-08 16:27:06 PDT
Please refer to: https://w3c.github.io/webrtc-provisional-stats/#dom-rtcvideoreceiverstats

WebRTC can expose some video rendered statistics such as: 

1- freezeCount:
Count the total number of video freezes experienced by this receiver. It is a freeze if frame duration, which is time interval between two consecutively rendered frames, is equal or exceeds Max(3 * avg_frame_duration_ms, avg_frame_duration_ms + 150), where avg_frame_duration_ms is linear average of durations of last 30 rendered frames.

2- pauseCount:
Count the total number of video pauses experienced by this receiver. Video is considered to be paused if time passed since last received packet exceeds 5 seconds.

3- totalFreezesDuration:
Total duration of rendered frames which are considered as frozen (for definition of freeze see freezeCount), in seconds. This value is updated when a frame is rendered.

4- totalPausesDuration:
Total duration of pauses (for definition of pause see pauseCount), in seconds. This value is updated when a frame is rendered.

5- totalFramesDuration:
Total duration of all rendered video frames, in seconds. This value is updated when a frame is rendered.

6- sumOfSquaredFramesDuration:
Sum of squared duration of all rendered frames. It can be used to calculate harmonic frame rate:

totalFramesDuration / sumOfSquaredFrameDurations

This value is updated when a frame is rendered.


And ultimately it would be optimal to have a frameRate stat available as well.
Comment 1 Radar WebKit Bug Importer 2020-06-08 17:06:29 PDT
<rdar://problem/64141493>
Comment 2 youenn fablet 2020-06-22 06:31:18 PDT
As a first step towards that approach, we can expose those as part of 'track' stats.
Comment 3 youenn fablet 2020-06-22 06:40:06 PDT
https://bugs.webkit.org/show_bug.cgi?id=213458 will track 'receiver' stats support, to align with the spec.
Comment 4 youenn fablet 2020-06-22 06:42:40 PDT
Created attachment 402466 [details]
Patch
Comment 5 EWS 2020-06-22 09:15:12 PDT
Committed r263351: <https://trac.webkit.org/changeset/263351>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 402466 [details].