From 47139607a37a2aedda90e109c605d47136453b79 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Wed, 12 Oct 2016 13:09:46 -0700 Subject: [PATCH 1/3] Added QP statistics This Cl also includes the result of an "untabify", which makes review difficult. Apologies. --- webrtc-stats.html | 82 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 62 insertions(+), 20 deletions(-) diff --git a/webrtc-stats.html b/webrtc-stats.html index 854c0a8f..6100d5c3 100644 --- a/webrtc-stats.html +++ b/webrtc-stats.html @@ -114,16 +114,16 @@

Basic concepts

The stats API is defined in [[!WEBRTC]]. It is defined to return - a set of objects that are a subclass of the RTCStats dictionary. This is - normatively defined in [[!WEBRTC]], but is reproduced here - for ease of reference. + a set of objects that are a subclass of the RTCStats dictionary. This is + normatively defined in [[!WEBRTC]], but is reproduced here + for ease of reference.

-	dictionary RTCStats {
+        dictionary RTCStats {
     DOMHighResTimeStamp timestamp;
     RTCStatsType        type;
     DOMString           id;
-	};
+        };
       

Guidelines for design of stats objects

@@ -207,7 +207,7 @@

This specification is normative for the allowed values of RTCStatsType.

-
+        
 enum RTCStatsType {
 "codec",
 "inbound-rtp",
@@ -221,7 +221,7 @@ 

"remote-candidate", "certificate" }; -

+

The following strings are valid values for RTCStatsType: @@ -332,7 +332,7 @@

-

Stats dictionaries

+

Stats dictionaries

RTCRTPStreamStats dictionary @@ -350,6 +350,7 @@

unsigned long pliCount; unsigned long nackCount; unsigned long sliCount; + unsigned long qpSum; };

@@ -464,10 +465,28 @@

as defined in [[!RFC4585]] section 6.3.2.

+
qpSum of type + unsigned long +
+
+

+ The sum of the QP values of frames passed. The count + of frames is in framesDecoded for inbound + stream stats, and in framesEncoded for + outbound stream stats. +

+

+ The definition of QP value depends on + the codec; for VP8, QP values are defined in + [[RFC6386]]. +

+

Only valid for video.

+

-

+

RTCCodecStats dictionary @@ -554,8 +573,9 @@

RTCInboundRTPStreamStats dictionary

- RTCInboundRTPStreamStats dictionary represents the measurement metrics for - the incoming RTP stream. + The RTCInboundRTPStreamStats dictionary + represents the measurement metrics for + the incoming RTP media stream.

dictionary RTCInboundRTPStreamStats : RTCRTPStreamStats {
@@ -574,6 +594,7 @@ 

double burstDiscardRate; double gapLossRate; double gapDiscardRate; + unsigned long framesDecoded; };

@@ -747,7 +768,15 @@

reported without multiplying by 32768.

- +
+ framesDecoded +
+
+

+ Only valid for video. It represents the total number of frames correctly + decoded for this SSRC. Same definition as totalVideoFrames in + Section 5 of [[!MEDIA-SOURCE]]. +

@@ -766,6 +795,7 @@

unsigned long long bytesSent; double targetBitrate; double roundTripTime; + unsigned long framesEncoded; };

@@ -818,6 +848,16 @@

as defined in section 6.4.1. of [[!RFC3550]].

+
+ framesEncoded of type long +
+
+

+ Only valid for video. It represents the total + number of frames successfully encoded for this RTP + media stream. +

@@ -895,7 +935,7 @@

-
+

RTCMediaStreamTrackStats dictionary @@ -1011,7 +1051,7 @@

Only valid for video. It represents the total number of frames sent for this - SSRC. + MediaStreamTrack.

@@ -1021,7 +1061,7 @@

Only valid for video and when remoteSource is set to true. It - represents the total number of frames received for this SSRC. + represents the total number of frames received for this MediaStreamTrack.

@@ -1030,8 +1070,10 @@

- Only valid for video. It represents the total number of frames correctly - decoded for this SSRC. Same definition as totalVideoFrames in + Only valid for video and when remoteSource is set + to true. It represents the total number of frames correctly + decoded for this MediaStreamTrack, independent of + which SSRC it was received from. It is defined as totalVideoFrames in Section 5 of [[!MEDIA-SOURCE]].

@@ -1043,7 +1085,7 @@

Only valid for video. It is the total number of frames dropped predecode or dropped because the frame missed its display - deadline for this SSRC. It is the same definition as + deadline for this MediastreamTrack. It is the same definition as droppedVideoFrames in Section 5 of [[!MEDIA-SOURCE]].

@@ -1054,7 +1096,7 @@

Only valid for video. It is the total number of corrupted frames - that have been detected for this SSRC. It is the same definition as + that have been detected for this MediaStreamTrack. It is the same definition as corruptedVideoFrames in Section 5 of [[!MEDIA-SOURCE]].

@@ -1845,7 +1887,7 @@

]

-
+

Example of a stats application

From f02a921fd0fb72b3ec10e92147cf8c4ab934725c Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Wed, 23 Nov 2016 13:31:26 +0100 Subject: [PATCH 2/3] Addressed some comments, rebased --- webrtc-stats.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/webrtc-stats.html b/webrtc-stats.html index 6100d5c3..06647b7a 100644 --- a/webrtc-stats.html +++ b/webrtc-stats.html @@ -350,7 +350,7 @@

unsigned long pliCount; unsigned long nackCount; unsigned long sliCount; - unsigned long qpSum; + unsigned long long qpSum; };

@@ -466,20 +466,21 @@

qpSum of type - unsigned long + unsigned long long

The sum of the QP values of frames passed. The count of frames is in framesDecoded for inbound stream stats, and in framesEncoded for - outbound stream stats. + outbound stream stats. If QP varies across the frame, + an average or typical QP value is recorded.

The definition of QP value depends on the codec; for VP8, QP values are defined in [[RFC6386]]. + VP8, VP9 and H.264 - RFC 6386 doesn't use the term -->

Only valid for video.

@@ -594,7 +595,7 @@

double burstDiscardRate; double gapLossRate; double gapDiscardRate; - unsigned long framesDecoded; + unsigned long framesDecoded; };

From cd1149bce1044b30fd4704cf8e3bbe752ad2ca58 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Thu, 1 Dec 2016 15:16:16 +0100 Subject: [PATCH 3/3] Fixed VP8 QP definition --- webrtc-stats.html | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/webrtc-stats.html b/webrtc-stats.html index 06647b7a..c1c796c7 100644 --- a/webrtc-stats.html +++ b/webrtc-stats.html @@ -473,14 +473,19 @@

The sum of the QP values of frames passed. The count of frames is in framesDecoded for inbound stream stats, and in framesEncoded for - outbound stream stats. If QP varies across the frame, - an average or typical QP value is recorded. + outbound stream stats.

The definition of QP value depends on - the codec; for VP8, QP values are defined in - [[RFC6386]]. + the codec; for VP8, the QP value is the value carried + in the frame header as the syntax element "y_ac_qi", and + defined in [[RFC6386]] section 19.2. Its range is 0..127. + +

+

+ Note that the QP value is only + an indication of quantizer values used; many formats have + ways to vary the quantizer value within the frame.

Only valid for video.