From 2e276e8b6384258fadc7ae6d8c7b9577e7a89aec Mon Sep 17 00:00:00 2001 From: Karthik Date: Mon, 16 Sep 2019 15:03:52 +0300 Subject: [PATCH 1/7] Defining RTCEncodingParameterStats --- webrtc-stats.html | 342 +++++++++++++++++++++++++++++++++++++++++++++- webrtc-stats.js | 10 ++ 2 files changed, 348 insertions(+), 4 deletions(-) diff --git a/webrtc-stats.html b/webrtc-stats.html index 4ba83cdd..a2628488 100644 --- a/webrtc-stats.html +++ b/webrtc-stats.html @@ -452,7 +452,8 @@

"local-candidate", "remote-candidate", "certificate", -"stunserverconnection" +"stunserverconnection", +"encoding-parameters" };

@@ -678,6 +679,15 @@

RTCStunServerConnectionStats.

+
+ encoding-parameters +
+
+

+ Information about RTP encodings of media. It is accessed by the + RTCEncodingParameterStats. +

+
@@ -818,7 +828,7 @@

dictionary RTCCodecStats : RTCStats {
-             unsigned long payloadType;
+             octet payloadType;
              RTCCodecType  codecType;
              DOMString     transportId;
              DOMString     mimeType;
@@ -833,8 +843,7 @@ 

- payloadType of type unsigned - long + payloadType of type octet

@@ -4209,6 +4218,331 @@

+
+

+ RTCEncodingParameterStats dictionary +

+
+
dictionary RTCEncodingParameterStats : RTCStats {
+             DOMString rid;
+             octet payloadType;
+             boolean active;
+             unsigned long ptime;
+             unsigned long maxBitrate;
+             double maxFramerate;
+             double scaleResolutionDownBy;
+             sequence<DOMString> scalabilityModes;
+  };
+
+

+ Dictionary RTCEncodingParameterStats Members +

+
+
+ rid of type DOMString +
+
+

+ Restriction Identifier(rid) of the encoding. +

+
+
+ payloadType of type octet +
+
+

+ Payload type as used in RTP encoding. +

+
+
+ active of type boolean +
+
+

+ Indicates that this encoding is actively being sent or not sent. +

+
+
+ ptime of type unsigned long +
+
+

+ Indicates the preferred duration of media represented by a packet in milliseconds for this encoding. + Typically, this is only relevant for audio encoding. +

+
+
+ maxBitrate of type unsigned long +
+
+

+ Indicates the maximum bitrate that can be used by this encoding. +

+
+
+ maxFramerate of type double +
+
+

+ Indicates the maximum framerate that can be used by this encoding. +

+
+
+ scaleResolutionDownBy of type double +
+
+

+ The video's resolution will be scaled down in each dimension by the given value. +

+
+
+ scalabilityModes of type DOMString +
+
+

Scalability mode identifiers and characteristics are indicated in the table below, which is based + on the pre-defined scalability modes in [[AV1]] Section 6.7.5.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Scalability ModeSpatial LayersResolution RatioTemporal LayersInter-layer dependency
L1T212
L1T313
L2T122:11Yes
L2T222:12Yes
L2T322:13Yes
L3T132:11Yes
L3T232:12Yes
L3T332:13Yes
L2T1h21.5:11Yes
L2T2h21.5:12Yes
L2T3h21.5:13Yes
S2T122:11No
S2T222:12No
S2T322:13No
S2T1h21.5:11No
S2T2h21.5:12No
S2T3h21.5:13No
S3T132:11No
S3T232:12No
S3T332:13No
S3T1h31.5:11No
S3T2h31.5:12No
S3T3h31.5:13No
L3T2_KEY32:12Yes
L3T3_KEY32:13Yes
L4T5_KEY42:15Yes
L4T7_KEY42:17Yes
L3T2_KEY_SHIFT32:12Yes
L3T3_KEY_SHIFT32:13Yes
L4T5_KEY_SHIFT42:15Yes
L4T7_KEY_SHIFT42:17Yes
+
+
+
+
+

diff --git a/webrtc-stats.js b/webrtc-stats.js index 1e205437..e6176425 100644 --- a/webrtc-stats.js +++ b/webrtc-stats.js @@ -111,6 +111,16 @@ var respecConfig = { status: "Internet Draft", publisher: "IETF" }, + "AV1": { + "title": "AV1 Bitstream and Decoding Process Specification", + "href": "https://aomediacodec.github.io/av1-spec/av1-spec.pdf", + "authors": [ + "Peter de Rivaz", + "Jack Haughton" + ], + "status": "January 9, 2019", + "publisher": "Alliance for Open Media" + }, "JSEP": { "authors":["Justin Uberti","Cullen Jennings","Eric Rescorla"], "href": "http://datatracker.ietf.org/doc/draft-ietf-rtcweb-jsep/", From 8f44f1c0fda02b9273d21dc31cbd3157dcc1356e Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Mon, 16 Sep 2019 07:24:46 -0700 Subject: [PATCH 2/7] adding frames discarded on send (#485) Fixes #397 --- webrtc-stats.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/webrtc-stats.html b/webrtc-stats.html index 4ba83cdd..193e469c 100644 --- a/webrtc-stats.html +++ b/webrtc-stats.html @@ -1859,6 +1859,7 @@

unsigned long hugeFramesSent; unsigned long framesEncoded; unsigned long keyFramesEncoded; + unsigned long framesDiscardedOnSend; unsigned long long qpSum; unsigned long long totalSamplesSent; boolean voiceActivityFlag; @@ -2059,6 +2060,18 @@

you the number of delta frames encoded.

+
+ framesDiscardedOnSend of type unsigned long +
+
+

+ Total number of video frames that have been discarded for this SSRC due to socket + errors, i.e. a socket error occured when handing the packets to the socket. This + might happen due to various reasons, including full buffer or no available + memory. +

+
qpSum of type unsigned long long From c903a33df35fca3a0c93eab44c1b88bcc102e37f Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Mon, 16 Sep 2019 07:25:48 -0700 Subject: [PATCH 3/7] moving things to the correct dictionary (#487) This fixes #486 If my assumptions in #486 are wrong, delete this branch. --- webrtc-stats.html | 76 +++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/webrtc-stats.html b/webrtc-stats.html index 193e469c..8278c00a 100644 --- a/webrtc-stats.html +++ b/webrtc-stats.html @@ -1762,10 +1762,7 @@

dictionary RTCSentRtpStreamStats : RTCRtpStreamStats {
              unsigned long      packetsSent;
-             unsigned long      packetsDiscardedOnSend;
-             unsigned long      fecPacketsSent;
              unsigned long long bytesSent;
-             unsigned long long bytesDiscardedOnSend;
 };

@@ -1783,29 +1780,6 @@

[[!RFC3550]] section 6.4.1.

-
- packetsDiscardedOnSend of type unsigned long -
-
-

- Total number of RTP packets for this SSRC that have been discarded due to socket - errors, i.e. a socket error occured when handing the packets to the socket. This - might happen due to various reasons, including full buffer or no available - memory. -

-
-
- fecPacketsSent of type unsigned - long -
-
-

- Total number of RTP FEC packets sent for this SSRC. This counter can also be - incremented when sending FEC packets in-band with media packets (e.g., with - Opus). -

-
bytesSent of type unsigned long long @@ -1816,18 +1790,6 @@

section 6.4.1.

-
- bytesDiscardedOnSend of type unsigned long long -
-
-

- Total number of bytes for this SSRC that have been discarded due to socket - errors, i.e. a socket error occured when handing the packets containing the bytes - to the socket. This might happen due to various reasons, including full buffer or - no available memory. Calculated as defined in [[!RFC3550]] section 6.4.1. -

-

@@ -1848,6 +1810,9 @@

DOMString senderId; DOMString remoteId; DOMHighResTimeStamp lastPacketSentTimestamp; + unsigned long packetsDiscardedOnSend; + unsigned long long bytesDiscardedOnSend; + unsigned long fecPacketsSent; unsigned long long retransmittedPacketsSent; unsigned long long retransmittedBytesSent; double targetBitrate; @@ -1930,6 +1895,41 @@

statistics were generated by the local endpoint.

+
+ packetsDiscardedOnSend of type unsigned long +
+
+

+ Total number of RTP packets for this SSRC that have been discarded due to socket + errors, i.e. a socket error occured when handing the packets to the socket. This + might happen due to various reasons, including full buffer or no available + memory. +

+
+
+ bytesDiscardedOnSend of type unsigned long long +
+
+

+ Total number of bytes for this SSRC that have been discarded due to socket + errors, i.e. a socket error occured when handing the packets containing the bytes + to the socket. This might happen due to various reasons, including full buffer or + no available memory. Calculated as defined in [[!RFC3550]] section 6.4.1. +

+
+
+ fecPacketsSent of type unsigned + long +
+
+

+ Total number of RTP FEC packets sent for this SSRC. This counter can also be + incremented when sending FEC packets in-band with media packets (e.g., with + Opus). +

+
retransmittedPacketsSent of type unsigned long long From f5dfb21e7386a36ab88bdf71453d14f0b2cc519b Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Mon, 16 Sep 2019 07:26:15 -0700 Subject: [PATCH 4/7] packet vs report block (#488) fixes #433 --- webrtc-stats.html | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/webrtc-stats.html b/webrtc-stats.html index 8278c00a..81fc810b 100644 --- a/webrtc-stats.html +++ b/webrtc-stats.html @@ -693,6 +693,12 @@

The dictionaries for RTP statistics are structured as a hierarchy, so that those stats that make sense in many different contexts are represented just once in IDL.

+

+ The metrics exposed here correspond to local measurements and those reported by RTCP packets. + Compound RTCP packets contain multiple RTCP report blocks, such as Sender Report (SR) and + Receiver Report (RR). Wheras, a non-compound RTCP packets may contain just a single + RTCP SR or RR block. +

The lifetime of all RTP monitored objects starts when the RTP stream is first used: When the first RTP packet is sent or received on the SSRC it represents, or when @@ -712,7 +718,7 @@

RTCReceivedRtpStreamStats: Stats measured at the receiving end of an RTP stream, known either because they're measured locally or transmitted via an RTCP - Receiver Report (RR) or Extended Report (XR). + Receiver Report (RR) or Extended Report (XR) block.

  • @@ -725,7 +731,7 @@

    RTCRemoteInboundRtpStreamStats: Stats relevant to the remote receiving end of an RTP stream - usually computed by combining local data with data received - via an RTCP RR or XR. + via an RTCP RR or XR block.

@@ -1322,7 +1328,7 @@

The average RTCP interval between two consecutive compound RTCP packets. This is calculated by the sending endpoint when sending compound RTCP reports. Compound - packets must contain at least a RTCP RR or SR packet and an SDES packet with the + packets must contain at least a RTCP RR or SR block and an SDES packet with the CNAME item.

@@ -2148,7 +2154,7 @@

The average RTCP interval between two consecutive compound RTCP packets. This is calculated by the sending endpoint when sending compound RTCP reports. Compound - packets must contain at least a RTCP RR or SR packet and an SDES packet with the + packets must contain at least a RTCP RR or SR block and an SDES packet with the CNAME item.

From 2929ae93278c414a795007cc57aa6056e9bf0762 Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Mon, 16 Sep 2019 07:33:47 -0700 Subject: [PATCH 5/7] Packets and Bytes Discard on send for ICE candidate pair (#489) Fixes #438 --- webrtc-stats.html | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/webrtc-stats.html b/webrtc-stats.html index 81fc810b..5c85354a 100644 --- a/webrtc-stats.html +++ b/webrtc-stats.html @@ -3690,6 +3690,8 @@

unsigned long long retransmissionsSent; unsigned long long consentRequestsSent; DOMHighResTimeStamp consentExpiredTimestamp; + unsigned long packetsDiscardedOnSend; + unsigned long long bytesDiscardedOnSend; };

@@ -4002,6 +4004,30 @@

expired this value must be undefined.

+
+ packetsDiscardedOnSend of type unsigned long +
+
+

+ Total number of packets for this candidate pair that have been discarded due to socket + errors, i.e. a socket error occured when handing the packets to the socket. This + might happen due to various reasons, including full buffer or no available + memory. +

+
+
+ bytesDiscardedOnSend of type unsigned long long +
+
+

+ Total number of bytes for this candidate pair that have been discarded due to socket + errors, i.e. a socket error occured when handing the packets containing the bytes + to the socket. This might happen due to various reasons, including full buffer or + no available memory. Calculated as defined in [[!RFC3550]] section 6.4.1. +

+

From 755c1f9e6a4c24ad4a6097ff1eeeccdc3457da15 Mon Sep 17 00:00:00 2001 From: Varun Singh Date: Mon, 16 Sep 2019 07:35:23 -0700 Subject: [PATCH 6/7] Clarify Cumulative metric for XR blocks and not interval (#490) If these are reported in XR blocks, these metrics should be in RTCReceivedRtpStreamStats and not in RTCInboundRtpStreamStats --- webrtc-stats.html | 75 ++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/webrtc-stats.html b/webrtc-stats.html index 5c85354a..f2a31934 100644 --- a/webrtc-stats.html +++ b/webrtc-stats.html @@ -971,6 +971,9 @@

double burstDiscardRate; double gapLossRate; double gapDiscardRate; + unsigned long framesDropped; + unsigned long partialFramesLost; + unsigned long fullFramesLost; };

@@ -1121,6 +1124,42 @@

[[!RFC7004]], however, the actual value is reported without multiplying by 32768.

+
+ framesDropped of type unsigned + long +
+
+

+ Only valid for video. The total number of frames dropped prior to decode or dropped + because the frame missed its display deadline for this receiver's track. The measurement + begins when the receiver is created and is a cumulative metric as defined in + Appendix A (g) of [[!RFC7004]]. +

+
+
+ partialFramesLost of type unsigned long +
+
+

+ Only valid for video. The cumulative number of partial frames lost. The measurement + begins when the receiver is created and is a cumulative metric as defined in + Appendix A (j) of [[!RFC7004]]. This metric is incremented when the frame is sent + to the decoder. If the partial frame is received and recovered via retransmission + or FEC before decoding, the framesReceived counter is incremented. +

+
+
+ fullFramesLost of type unsigned + long +
+
+

+ Only valid for video. The cumulative number of full frames lost. The measurement + begins when the receiver is created and is a cumulative metric as defined in + Appendix A (i) of [[!RFC7004]]. +

+

@@ -1172,9 +1211,6 @@

double totalAudioEnergy; double totalSamplesDuration; unsigned long framesReceived; - unsigned long framesDropped; - unsigned long partialFramesLost; - unsigned long fullFramesLost; DOMString decoderImplementation; };
@@ -1652,39 +1688,6 @@

this RTP stream. This metric is incremented when the complete frame is received.

-
- framesDropped of type unsigned - long -
-
-

- Only valid for video. The total number of frames dropped prior to decode or dropped - because the frame missed its display deadline for this receiver's track. As defined - in Appendix A (g) of [[!RFC7004]]. -

-
-
- partialFramesLost of type unsigned long -
-
-

- Only valid for video. The cumulative number of partial frames lost, as defined in - Appendix A (j) of [[!RFC7004]]. This metric is incremented when the frame is sent - to the decoder. If the partial frame is received and recovered via retransmission - or FEC before decoding, the framesReceived counter is incremented. -

-
-
- fullFramesLost of type unsigned - long -
-
-

- Only valid for video. The cumulative number of full frames lost, as defined in - Appendix A (i) of [[!RFC7004]]. -

-
decoderImplementation of type DOMString From 0b67d983c345a4727ec5c0bf6676fa56dafb003c Mon Sep 17 00:00:00 2001 From: lennart-csio Date: Mon, 16 Sep 2019 17:51:35 +0300 Subject: [PATCH 7/7] ice-server instead of stunserverconnection (#493) * issue #444 * editor removed whitespaces --- webrtc-stats.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/webrtc-stats.html b/webrtc-stats.html index f2a31934..0a2e4e06 100644 --- a/webrtc-stats.html +++ b/webrtc-stats.html @@ -452,7 +452,7 @@

"local-candidate", "remote-candidate", "certificate", -"stunserverconnection" +"ice-server" };

@@ -670,12 +670,12 @@

- stunserverconnection + ice-server

- Information about the connection to a STUN or TURN server. It is accessed by the - RTCStunServerConnectionStats. + Information about the connection to an ICE server (e.g. STUN or TURN). It is accessed by the + RTCIceServerStats.

@@ -4170,12 +4170,12 @@

-
+

- RTCStunServerConnectionStats dictionary + RTCIceServerStats dictionary

-
dictionary RTCStunServerConnectionStats : RTCStats {
+          
dictionary RTCIceServerStats : RTCStats {
              DOMString url;
              long port;
              DOMString protocol;
@@ -4186,16 +4186,16 @@ 

};

- Dictionary RTCStunServerConnectionStats Members + Dictionary RTCIceServerStats Members

-
+
url of type DOMString

- The URL of the TURN or STUN server. + The URL of the ICE server (e.g. TURN or STUN server).