webrtc-stats
webrtc-stats copied to clipboard
Define a mechanism for setting the trigger duration for a video freeze
In the W3C Identifiers for WebRTC's Statistics API spec, the logic for marking a video freeze, is defined as follows(see freezeCount):
- Calculate the linear average of the past 30 rendering frame durations and label it as
avg_frame_duration_ms. - Calculate the interval between the current two frames. If this value is greater than Max(3 *
avg_frame_duration_ms,avg_frame_duration_ms+ 150), it is considered as a freeze.
In situations where the network is good, this logic is quite reasonable. However, in the case of a weak or poor network, the value of avg_frame_duration_ms may be larger, for example, 150ms. In this scenario, the freeze trigger value would be 450ms, which may not meet the needs in practice. As generally, 200ms might be considered a freeze.
So The spec can define a mechanism for developers to set the trigger duration for video freeze (i.e., when the interval between two frames exceeds this duration, it is recorded as a freeze event).