From cd494150381c2588d5b2f4c3425bd772eee8f29d Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Fri, 2 Aug 2024 10:45:37 +1000 Subject: [PATCH] RTCRemoteInboundRtpStreamStats - plus alignment with outbound (#32657) * RTCRemoteInboundRtpStreamStats: id * RTCRemoteInboundRtpStreamStats.timestamp * RTCRemoteInboundRtpStreamStats.type * RTCRemoteInboundRtpStreamStats.transportId * RTCRemoteOuboundRtpStreamStats.transportId - match to inbound * RTCRemoteInboundRtpStreamStats.ssrc * RTCRemoteOutboundRtpStreamStats.ssrc - alignment * RTCRemoteInboundRtpStreamStats.kind * RTCRemoteOutboundRtpStreamStats.kind - alignment * Tweaks/aligment for transport id * RTCRemoteInboundRtpStreamStats.codecId * RTCRemoteOutboundRtpStreamStats.codecId - alignment * RTCRemoteOutboundRtpStreamStats improve description * RTCRemoteInboundRtpStreamStats - partial draft * RTCRemoteInboundRtpStreamStats.jitter and glossary * RTCRemoteInboundRtpStreamStats.packetsLost * RTCRemoteInboundRtpStreamStats.packetsReceived * Minor fixes to timestamp * rttmeasurements property * Add RTCRemoteInboundStats to sidebar * Assorted minor improvements * RTCRemoteInboutRtpStreamStats.totalrtt, localid, rttmeas * RTCRemoteOutboundRtpStreamStats - matching localid, rttmeas, totalrtt * RTCRemoteInboundRtpStreamStats.roundTripTime * RTCRemoteInboundRtpStreamStats.fractionLost * Apply suggestions from code review Co-authored-by: wbamberg * Update files/en-us/web/api/rtcremoteinboundrtpstreamstats/index.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Stat properties in alphabetic order. Fix NOTE to new form * fractionLost - tidy and point solely to algorithm for info on how it is calc. * Note that the value is not precise, but is a useful indicator * Apply suggestions from code review Co-authored-by: wbamberg --------- Co-authored-by: wbamberg Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- files/en-us/glossary/jitter/index.md | 13 ++ .../codecid/index.md | 25 ++++ .../fractionlost/index.md | 38 ++++++ .../id/index.md | 27 +++++ .../rtcremoteinboundrtpstreamstats/index.md | 113 ++++++++++++++++++ .../jitter/index.md | 32 +++++ .../kind/index.md | 31 +++++ .../localid/index.md | 40 +++++++ .../packetslost/index.md | 33 +++++ .../packetsreceived/index.md | 28 +++++ .../roundtriptime/index.md | 32 +++++ .../roundtriptimemeasurements/index.md | 31 +++++ .../ssrc/index.md | 41 +++++++ .../timestamp/index.md | 27 +++++ .../totalroundtriptime/index.md | 30 +++++ .../transportid/index.md | 25 ++++ .../type/index.md | 27 +++++ .../codecid/index.md | 4 +- .../rtcremoteoutboundrtpstreamstats/index.md | 46 +++---- .../kind/index.md | 10 +- .../localid/index.md | 4 +- .../roundtriptimemeasurements/index.md | 27 +++++ .../ssrc/index.md | 15 ++- .../totalroundtriptime/index.md | 30 +++++ .../transportid/index.md | 6 +- files/jsondata/GroupData.json | 1 + 26 files changed, 691 insertions(+), 45 deletions(-) create mode 100644 files/en-us/glossary/jitter/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/codecid/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/fractionlost/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/id/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/jitter/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/kind/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/localid/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/packetslost/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/packetsreceived/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/roundtriptime/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/roundtriptimemeasurements/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/ssrc/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/timestamp/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/totalroundtriptime/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/transportid/index.md create mode 100644 files/en-us/web/api/rtcremoteinboundrtpstreamstats/type/index.md create mode 100644 files/en-us/web/api/rtcremoteoutboundrtpstreamstats/roundtriptimemeasurements/index.md create mode 100644 files/en-us/web/api/rtcremoteoutboundrtpstreamstats/totalroundtriptime/index.md diff --git a/files/en-us/glossary/jitter/index.md b/files/en-us/glossary/jitter/index.md new file mode 100644 index 000000000000000..131f8a869edb6c1 --- /dev/null +++ b/files/en-us/glossary/jitter/index.md @@ -0,0 +1,13 @@ +--- +title: Jitter +slug: Glossary/Jitter +page-type: glossary-definition +--- + +{{GlossarySidebar}} + +**Jitter** is the term used in computer networking to refer to [packet delay variation](https://en.wikipedia.org/wiki/Packet_delay_variation) — the variance in the rate at which packets arrive at a destination (the average of the squared difference from the mean packet arrival rate). + +"High jitter" indicates that packets are arriving at significantly varying rates, possibly due to network congestion, packet loss, and routing of packets in a stream through different paths. + +High jitter can significantly degrade the performance of real-time web applications, including voice/video streaming and online gaming. diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/codecid/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/codecid/index.md new file mode 100644 index 000000000000000..2f50bf93f7d7965 --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/codecid/index.md @@ -0,0 +1,25 @@ +--- +title: "RTCRemoteInboundRtpStreamStats: codecId property" +short-title: codecId +slug: Web/API/RTCRemoteInboundRtpStreamStats/codecId +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-outbound-rtp.codecId +--- + +{{APIRef("WebRTC")}} + +The **`codecId`** property of the {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary is a string that uniquely identifies the object that was inspected to produce the data in the {{domxref("RTCCodecStats")}} for the {{Glossary("RTP")}} stream. + +`RTCRemoteInboundRtpStreamStats` and `RTCCodecStats` objects are correlated by iterating the {{domxref("RTCStatsReport")}} to find the statistics objects where `RTCRemoteInboundRtpStreamStats.codecId` is equal to {{domxref("RTCCodecStats.id")}}. + +## Value + +A string that contains the {{domxref("RTCCodecStats.id","id")}} of the object that was inspected to produce the {{domxref("RTCCodecStats")}} object associated with this RTP stream. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/fractionlost/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/fractionlost/index.md new file mode 100644 index 000000000000000..a864bcb79020ca1 --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/fractionlost/index.md @@ -0,0 +1,38 @@ +--- +title: "RTCRemoteInboundRtpStreamStats: fractionLost property" +short-title: fractionLost +slug: Web/API/RTCRemoteInboundRtpStreamStats/fractionLost +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-inbound-rtp.fractionLost +--- + +{{APIRef("WebRTC")}} + +The **`fractionLost`** property of the {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary provides a value that can be used to determine the fraction of packets lost for this [synchronization source (SSRC)](/en-US/docs/Web/API/RTCRemoteInboundRtpStreamStats/ssrc) in the last reporting interval. + +To convert the value to a percentage, divide it by 256 and multiply by 100. +For example, a value of 20 indicates a 7.8% packet loss. + +Note that the value may not be precisely accurate due to the way that it is calculated, but it does provides a quick and convenient measure of the link quality. + +## Value + +A number giving the fraction packet loss in the last reporting interval, multiplied by 256. +The value is 0 if the calculated packet loss is negative. + +> [!NOTE] +> The value comes from the 8-bit `fraction lost` field of the last Sender Report (SR) or Receiver Report (RR) RTCP packet. +> The algorithm for calculating the value is defined in [RFC 3550, Appendix A.3: Determining Number of Packets Expected and Lost](https://datatracker.ietf.org/doc/html/rfc3550#appendix-A.3). + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{rfc("3550","SR: Sender Report RTCP Packet", "6.4.1")}} +- {{rfc("3550","RR: Receiver Report RTCP Packet", "6.4.2")}} diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/id/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/id/index.md new file mode 100644 index 000000000000000..1e59650e4ebd030 --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/id/index.md @@ -0,0 +1,27 @@ +--- +title: "RTCRemoteInboundRtpStreamStats: id property" +short-title: id +slug: Web/API/RTCRemoteInboundRtpStreamStats/id +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-inbound-rtp.id +--- + +{{APIRef("WebRTC")}} + +The **`id`** property of the {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary is a string that uniquely identifies the object for which this object provides statistics. + +Using the `id`, you can correlate this statistics object with others, in order to monitor statistics over time for a given WebRTC object, such as an {{domxref("RTCPeerConnection")}}, or an {{domxref("RTCDataChannel")}}. + +## Value + +A string that uniquely identifies the object for which this `RTCRemoteInboundRtpStreamStats` object provides statistics. + +The format of the ID string is not defined by the specification, so you cannot reliably make any assumptions about the contents of the string, or assume that the format of the string will remain unchanged for a given object type. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/index.md new file mode 100644 index 000000000000000..b7931f786911767 --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/index.md @@ -0,0 +1,113 @@ +--- +title: RTCRemoteInboundRtpStreamStats +slug: Web/API/RTCRemoteInboundRtpStreamStats +page-type: web-api-interface +browser-compat: api.RTCStatsReport.type_remote-inbound-rtp +--- + +{{APIRef("WebRTC")}} + +The **`RTCRemoteInboundRtpStreamStats`** dictionary of the [WebRTC API](/en-US/docs/Web/API/WebRTC_API) is used to report statistics from the remote endpoint about a particular incoming RTP stream. +These will correspond to an outgoing RTP stream at the local end of the {{domxref("RTCPeerConnection")}}. + +The statistics can be obtained by iterating the {{domxref("RTCStatsReport")}} returned by {{domxref("RTCPeerConnection.getStats()")}} or {{domxref("RTCRtpReceiver.getStats()")}} until you find a report with the [`type`](#type) of `remote-inbound-rtp`. + +## Instance properties + +### Remote inbound specific statistics + + + +- {{domxref("RTCRemoteInboundRtpStreamStats.fractionLost", "fractionLost")}} {{optional_inline}} + - : A number indicating the fraction of packets lost for this SSRC since the last sender or receiver report. +- {{domxref("RTCRemoteInboundRtpStreamStats.localId", "localId")}} {{optional_inline}} + - : A string that is used to find the local {{domxref("RTCOutboundRtpStreamStats")}} object that shares the same [synchronization source (SSRC)](/en-US/docs/Web/API/RTCRemoteInboundRtpStreamStats/ssrc). +- {{domxref("RTCRemoteInboundRtpStreamStats.roundTripTime", "roundTripTime")}} {{optional_inline}} + - : A number that indicates the estimated round trip time (RTT) for this SSRC, in seconds. + This property will not exist until valid RTT data has been received. +- {{domxref("RTCRemoteInboundRtpStreamStats.roundTripTimeMeasurements", "roundTripTimeMeasurements")}} {{optional_inline}} + - : A positive integer indicating the total number of valid round trip time measurements received for this [synchronization source (SSRC)](#ssrc). +- {{domxref("RTCRemoteInboundRtpStreamStats.totalRoundTripTime", "totalRoundTripTime")}} {{optional_inline}} + - : A number indicating the cumulative sum of all round trip time measurements since the beginning of the session, in seconds. + The average round trip time can be computed by dividing `totalRoundTripTime` by [`roundTripTimeMeasurements`](#roundtriptimemeasurements). + +### Received RTP stream statistics + + + +- {{domxref("RTCRemoteInboundRtpStreamStats.jitter", "jitter")}} {{optional_inline}} + - : A number indicating the {{glossary("jitter", "packet jitter")}} for this synchronization source, measured in seconds. +- {{domxref("RTCRemoteInboundRtpStreamStats.packetsLost", "packetsLost")}} {{optional_inline}} + - : An integer indicating the total number of RTP packets lost for this SSRC, as measured at the remote endpoint. + This value can be negative if duplicate packets were received. +- {{domxref("RTCRemoteInboundRtpStreamStats.packetsReceived", "packetsReceived")}} {{optional_inline}} + - : A positive integer indicating the total number of RTP packets received for this SSRC, including retransmissions. + +### Common RTP stream statistics + + + +- {{domxref("RTCRemoteInboundRtpStreamStats.codecId", "codecId")}} {{optional_inline}} + - : A string that uniquely identifies the object that was inspected to produce the {{domxref("RTCCodecStats")}} object associated with this {{Glossary("RTP")}} stream. +- {{domxref("RTCRemoteInboundRtpStreamStats.kind", "kind")}} + - : A string indicating whether the {{domxref("MediaStreamTrack")}} associated with the stream is an audio or a video track. +- {{domxref("RTCRemoteInboundRtpStreamStats.ssrc", "ssrc")}} + - : A positive integer that identifies the SSRC of the RTP packets in this stream. +- {{domxref("RTCRemoteInboundRtpStreamStats.transportId", "transportId")}} {{optional_inline}} + - : A string that uniquely identifies the object which was inspected to produce the {{domxref("RTCTransportStats")}} object associated with this RTP stream. + +### Common instance properties + +The following properties are common to all WebRTC statistics objects. + + + +- {{domxref("RTCRemoteInboundRtpStreamStats.id", "id")}} + - : A string that uniquely identifies the object that is being monitored to produce this set of statistics. +- {{domxref("RTCRemoteInboundRtpStreamStats.timestamp", "timestamp")}} + - : A {{domxref("DOMHighResTimeStamp")}} object indicating the time at which the sample was taken for this statistics object. +- {{domxref("RTCRemoteInboundRtpStreamStats.type", "type")}} + - : A string with the value `"inbound-rtp"`, indicating the type of statistics that the object contains. + +## Examples + +Given a variable `peerConnection` that is an instance of an {{domxref("RTCPeerConnection")}}, the code below uses `await` to wait for the statistics report, and then iterates it using `RTCStatsReport.forEach()`. +It then filters the dictionaries for just those reports that have the type of `remote-inbound-rtp` and logs the result. + +```js +const stats = await myPeerConnection.getStats(); + +stats.forEach((report) => { + if (report.type === "remote-inbound-rtp") { + console.log("Remote Inbound RTP Stream Stats:"); + console.log(`id: ${report.id}`); + console.log(`timestamp: ${report.timestamp}`); + console.log(`transportId: ${report.transportId}`); + console.log(`ssrc: ${report.ssrc}`); + console.log(`kind: ${report.kind}`); + console.log(`codecId: ${report.codecId}`); + console.log(`packetsReceived: ${report.packetsReceived}`); + console.log(`packetsLost: ${report.packetsLost}`); + console.log(`jitter: ${report.jitter}`); + console.log(`totalRoundTripTime: ${report.totalRoundTripTime}`); + console.log( + `roundTripTimeMeasurements: ${report.roundTripTimeMeasurements}`, + ); + console.log(`roundTripTime: ${report.roundTripTime}`); + console.log(`localId: ${report.localId}`); + console.log(`fractionLost: ${report.fractionLost}`); + } +}); +``` + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{domxref("RTCStatsReport")}} diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/jitter/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/jitter/index.md new file mode 100644 index 000000000000000..42e59e96a66c27a --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/jitter/index.md @@ -0,0 +1,32 @@ +--- +title: "RTCRemoteInboundRtpStreamStats: jitter property" +short-title: jitter +slug: Web/API/RTCRemoteInboundRtpStreamStats/jitter +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-inbound-rtp.jitter +--- + +{{APIRef("WebRTC")}} + +The **`jitter`** property of the {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary returns the {{glossary("Jitter", "packet jitter")}} for the [synchronization source (SSRC)](/en-US/docs/Web/API/RTCRemoteInboundRtpStreamStats/ssrc) as measured by the remote endpoint. + +High packet jitter values indicate that packet arrival rates vary significantly, which may degrade video, audio, and other real-time communications over WebRTC. + +## Value + +Packet jitter, in seconds. + +The value is calculated using the "interarrival jitter" algorithm described in {{RFC("3550", "", "6.4.1")}}. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{domxref("RTCRemoteInboundRtpStreamStats.ssrc")}} +- {{domxref("RTCInboundRtpStreamStats.jitter")}} diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/kind/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/kind/index.md new file mode 100644 index 000000000000000..0e302e8faee8010 --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/kind/index.md @@ -0,0 +1,31 @@ +--- +title: "RTCRemoteInboundRtpStreamStats: kind property" +short-title: kind +slug: Web/API/RTCRemoteInboundRtpStreamStats/kind +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-inbound-rtp.kind +--- + +{{APIRef("WebRTC")}} + +The **`kind`** property of the {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary is a string indicating whether the described {{Glossary("RTP")}} stream contains audio or video media. + +This string will always be the same as the {{domxref("MediaStreamTrack.kind", "kind")}} of the {{domxref("MediaStreamTrack")}} object carried by the stream. +It will also match the media type of the codec associated with this statistics objects (i.e. the MIME type of the associated codec's {{domxref("RTCCodecStats.mimeType")}} property). + +## Value + +The kind is always one of: + +- `"audio"` + - : The stream contains audio media. +- `"video"` + - : The stream contains video media. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/localid/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/localid/index.md new file mode 100644 index 000000000000000..79234854e531656 --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/localid/index.md @@ -0,0 +1,40 @@ +--- +title: "RTCRemoteInboundRtpStreamStats: localId property" +short-title: localId +slug: Web/API/RTCRemoteInboundRtpStreamStats/localId +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-inbound-rtp.localId +--- + +{{APIRef("WebRTC")}} + +The {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary's **`localId`** property is a string that can be used to identify the {{domxref("RTCOutboundRtpStreamStats")}} object whose {{domxref("RTCOutboundRtpStreamStats.remoteId", "remoteId")}} matches this value. + +Together, these two objects provide statistics about the inbound and outbound sides of the same [synchronization source (SSRC)](/en-US/docs/Web/API/RTCRemoteInboundRtpStreamStats/ssrc). + +## Value + +A string which can be compared to the value of an {{domxref("RTCOutboundRtpStreamStats")}} object's {{domxref("RTCOutboundRtpStreamStats.remoteId", "remoteId")}} property to see if the two represent statistics for each of the two sides of the same set of data sent by the local peer. + +## Usage notes + +You can think of the local and remote views of the same RTP stream as pairs, each of which has a reference back to the other one. +Thus, if an {{domxref("RTCStatsReport")}} includes an `remote-inbound-rtp` statistics object (of type `RTCRemoteInboundRtpStreamStats`), it should also have a corresponding `outbound-rtp` object. + +Both of these provide information about the same batch of packets being sent from the local device to the remote peer. +The difference is that `outbound-rtp` offers statistics about the outgoing data from the local peer's perspective, while `remote-inbound-rtp` provides statistics about the same data from the perspective of the remote peer, as it is received. + +## Examples + +See the example in {{domxref("RTCRemoteOutboundRtpStreamStats.localId")}}. +This shows how to correlate statistics about data sent from the remote peer (from the perspective of the remote peer) with the incoming data from the perspective of the local peer. + +The code to correlate send data from the perspective of the local peer and received data from the perspective of the remote peer would be almost the same, and can be inferred from that example. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/packetslost/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/packetslost/index.md new file mode 100644 index 000000000000000..70d49b3c767acfb --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/packetslost/index.md @@ -0,0 +1,33 @@ +--- +title: "RTCRemoteInboundRtpStreamStats: packetsLost property" +short-title: packetsLost +slug: Web/API/RTCRemoteInboundRtpStreamStats/packetsLost +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-inbound-rtp.packetsLost +--- + +{{APIRef("WebRTC")}} + +The **`packetsLost`** property of the {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary returns the total number of {{Glossary("RTP")}} packets lost from the [synchronization source (SSRC)](/en-US/docs/Web/API/RTCRemoteInboundRtpStreamStats/ssrc), as reported by the remote endpoint, since the beginning of reception. + +## Value + +An integer value indicating the number of lost RTP packets. + +This value can be negative. +It is determined by subtracting the number of packets received from the number of packets that are expected. +The number of packets that are expected is calculated in a way that assumes that all packets only need to be sent once (based on sequence numbers), while the number of packets received also includes any packets that had to be resent (and hence may be bigger). +For more information see the "cumulative number of packets lost" section in {{RFC("3550", "", "6.4.1")}}. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{domxref("RTCRemoteInboundRtpStreamStats.ssrc")}} +- {{domxref("RTCInboundRtpStreamStats.packetsLost")}} diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/packetsreceived/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/packetsreceived/index.md new file mode 100644 index 000000000000000..5547198b9d7ef76 --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/packetsreceived/index.md @@ -0,0 +1,28 @@ +--- +title: "RTCRemoteInboundRtpStreamStats: packetsReceived property" +short-title: packetsReceived +slug: Web/API/RTCRemoteInboundRtpStreamStats/packetsReceived +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-inbound-rtp.packetsReceived +--- + +{{APIRef("WebRTC")}} + +The **`packetsReceived`** property of the {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary returns the total number of {{Glossary("RTP")}} packets received from the [synchronization source (SSRC)](/en-US/docs/Web/API/RTCRemoteInboundRtpStreamStats/ssrc) of this stream by the remote endpoint, including retransmissions. + +## Value + +A positive integer value indicating the total number of received RTP packets at the remote endpoint. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{domxref("RTCRemoteInboundRtpStreamStats.ssrc")}} +- {{domxref("RTCInboundRtpStreamStats.packetsReceived")}} diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/roundtriptime/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/roundtriptime/index.md new file mode 100644 index 000000000000000..7245093d1ecc410 --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/roundtriptime/index.md @@ -0,0 +1,32 @@ +--- +title: "RTCRemoteInboundRtpStreamStats: roundTripTime property" +short-title: roundTripTime +slug: Web/API/RTCRemoteInboundRtpStreamStats/roundTripTime +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-inbound-rtp.roundTripTime +--- + +{{APIRef("WebRTC")}} + +The **`roundTripTime`** property of the {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary indicates the estimated round trip time (RTT) for this [synchronization source (SSRC)](/en-US/docs/Web/API/RTCRemoteInboundRtpStreamStats/ssrc), in seconds. + +The round trip time is calculated based on the RTCP timestamps in the RTCP Sender Report (SR), and requires a report with a Delay Since Last SR (DLSR) block that has a value other than 0. +The property does not exist until such a report has been received. + +Note that the _average_ RTT for the session can be computed by dividing {{domxref("RTCRemoteInboundRtpStreamStats.totalRoundTripTime","totalRoundTripTime")}} by {{domxref("RTCRemoteInboundRtpStreamStats.roundTripTimeMeasurements","roundTripTimeMeasurements")}}. + +## Value + +A number indicating the current estimated round trip time, in seconds. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{rfc("3550","SR: Sender Report RTCP Packet", "6.4.1")}} diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/roundtriptimemeasurements/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/roundtriptimemeasurements/index.md new file mode 100644 index 000000000000000..abea23054c0b5cc --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/roundtriptimemeasurements/index.md @@ -0,0 +1,31 @@ +--- +title: "RTCRemoteInboundRtpStreamStats: roundTripTimeMeasurements property" +short-title: roundTripTimeMeasurements +slug: Web/API/RTCRemoteInboundRtpStreamStats/roundTripTimeMeasurements +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-inbound-rtp.roundTripTimeMeasurements +--- + +{{APIRef("WebRTC")}} + +The **`roundTripTimeMeasurements`** property of the {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary contains a positive integer value that represents the total number valid round trip time measurements received for this [synchronizing source](#ssrc). + +The count can be used as a measure of the availability and reliability of round-trip-time measurement data. + +## Value + +A positive number indicating the number of valid round trip time measurements. + +This is the count of _RTCP Receiver Reports (RR)_ received for this [synchronizing source](#ssrc) that contain a non-zero value for the "delay since last SR (DLSR)" field. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{rfc("3550","RR: Receiver Report RTCP Packet", "6.4.2")}} diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/ssrc/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/ssrc/index.md new file mode 100644 index 000000000000000..56278e65d486fd3 --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/ssrc/index.md @@ -0,0 +1,41 @@ +--- +title: "RTCRemoteInboundRtpStreamStats: ssrc property" +short-title: ssrc +slug: Web/API/RTCRemoteInboundRtpStreamStats/ssrc +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-inbound-rtp.ssrc +--- + +{{APIRef("WebRTC")}} + +The **`ssrc`** property of the {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary contains a positive integer value that identifies the synchronization source (SSRC) of this stream of {{Glossary("RTP")}} packets. + +A source might be something like a microphone, or a mixer application that combines multiple sources. +All packets from the same source share the same time source and sequence space, and so can be ordered relative to each other. +Note that two streams with the same `ssrc` value refer to the same source. + +## Value + +A positive 32-bit integer uniquely identifying the SSRC of the RTP packets whose statistics are covered by this {{domxref("RTCRemoteInboundRtpStreamStats")}} object. + +The manner in which SSRC values are generated is not mandated by the specification, although it does make recommendations. +You should not make any assumptions based on the value of `ssrc` other than that any two objects with the same `ssrc` value refer to the same source. +See {{RFC("3550", "", "8")}} for additional information about `ssrc`. + +> [!NOTE] +> The specification includes an example that generates values for `ssrc` using MD5. +> While not part of the standard, exactly, it is a good mechanism that may be used by some browsers; others may use other methods, such as random number generators. +> _Do not_ rely upon these values meaning anything other than "these objects are associated with the same source." + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{domxref("RTCRtpReceiver.getSynchronizationSources()")}} +- {{domxref("RTCEncodedAudioFrame.getMetadata()")}} diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/timestamp/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/timestamp/index.md new file mode 100644 index 000000000000000..b1d8c1e3dd36100 --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/timestamp/index.md @@ -0,0 +1,27 @@ +--- +title: "RTCRemoteInboundRtpStreamStats: timestamp property" +short-title: timestamp +slug: Web/API/RTCRemoteInboundRtpStreamStats/timestamp +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-inbound-rtp.timestamp +--- + +{{APIRef("WebRTC")}} + +The **`timestamp`** property of the {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary is a {{domxref("DOMHighResTimeStamp")}} object specifying the time at which the data in the object was sampled. + +For this object the timestamp is the time at which the _RTCP Receiver Report (RR)_ was received at the local end of the communication (the RR report is defined in {{rfc("3550","", "6.4.2")}}). + +## Value + +A {{domxref("DOMHighResTimeStamp")}} value indicating the time at which the activity described by the statistics in this object was recorded, in milliseconds elapsed since the beginning of January 1, 1970, UTC. + +The value should be accurate to within a few milliseconds but may not be entirely precise, either because of hardware or operating system limitations or because of [fingerprinting](/en-US/docs/Glossary/Fingerprinting) protection in the form of reduced clock precision or accuracy. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/totalroundtriptime/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/totalroundtriptime/index.md new file mode 100644 index 000000000000000..e40d30ac4e8ab80 --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/totalroundtriptime/index.md @@ -0,0 +1,30 @@ +--- +title: "RTCRemoteInboundRtpStreamStats: totalRoundTripTime property" +short-title: totalRoundTripTime +slug: Web/API/RTCRemoteInboundRtpStreamStats/totalRoundTripTime +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-inbound-rtp.totalRoundTripTime +--- + +{{APIRef("WebRTC")}} + +The **`totalRoundTripTime`** property of the {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary indicates the cumulative number sum of all round trip time (RTT) measurements since the beginning of the session, in seconds. + +The individual round trip time is calculated based on the RTCP timestamps in the RTCP Receiver Report (RR), hence requires a DLSR value other than 0. +The average RTT can be computed by dividing `totalRoundTripTime` by {{domxref("RTCRemoteInboundRtpStreamStats.roundTripTimeMeasurements","roundTripTimeMeasurements")}}. + +## Value + +A number indicating the total round trip time for the session, in seconds. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{rfc("3550","RR: Receiver Report RTCP Packet", "6.4.2")}} diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/transportid/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/transportid/index.md new file mode 100644 index 000000000000000..3f20e4b95aaa3ed --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/transportid/index.md @@ -0,0 +1,25 @@ +--- +title: "RTCRemoteInboundRtpStreamStats: transportId property" +short-title: transportId +slug: Web/API/RTCRemoteInboundRtpStreamStats/transportId +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-inbound-rtp.transportId +--- + +{{APIRef("WebRTC")}} + +The **`transportId`** property of the {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary is a string that uniquely identifies the associated {{domxref("RTCTransportStats")}} statistics object for this RTP stream's underlying transport. + +`RTCRemoteInboundRtpStreamStats` and `RTCTransportStats` objects are correlated by iterating the {{domxref("RTCStatsReport")}} to find the statistics objects where `RTCRemoteInboundRtpStreamStats.transportId` is equal to {{domxref("RTCTransportStats.id")}}. + +## Value + +A string that contains the {{domxref("RTCTransportStats.id","id")}} of the object that was inspected to produce the {{domxref("RTCTransportStats")}} object associated with this RTP stream. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/web/api/rtcremoteinboundrtpstreamstats/type/index.md b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/type/index.md new file mode 100644 index 000000000000000..b9c3bed35ace768 --- /dev/null +++ b/files/en-us/web/api/rtcremoteinboundrtpstreamstats/type/index.md @@ -0,0 +1,27 @@ +--- +title: "RTCRemoteInboundRtpStreamStats: type property" +short-title: type +slug: Web/API/RTCRemoteInboundRtpStreamStats/type +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-inbound-rtp.type +--- + +{{APIRef("WebRTC")}} + +The **`type`** property of the {{domxref("RTCRemoteInboundRtpStreamStats")}} dictionary is a string with the value `"remote-inbound-rtp"`. + +Different statistics are obtained by iterating the {{domxref("RTCStatsReport")}} object returned by a call to {{domxref("RTCPeerConnection.getStats()")}}. +The type indicates the set of statistics available through the object in a particular iteration step. +A value of `"inbound-rtp"` indicates that the statistics available in the current step are those defined in {{domxref("RTCRemoteInboundRtpStreamStats")}}. + +## Value + +A string with the value `"inbound-rtp"`. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/codecid/index.md b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/codecid/index.md index f4917e19cb6e3d1..64ca2aa453954d9 100644 --- a/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/codecid/index.md +++ b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/codecid/index.md @@ -10,9 +10,11 @@ browser-compat: api.RTCStatsReport.type_remote-outbound-rtp.codecId The **`codecId`** property of the {{domxref("RTCRemoteOutboundRtpStreamStats")}} dictionary is a string that uniquely identifies the object that was inspected to produce the data in the {{domxref("RTCCodecStats")}} for the {{Glossary("RTP")}} stream. +`RTCRemoteOutboundRtpStreamStats` and `RTCCodecStats` objects are correlated by iterating the {{domxref("RTCStatsReport")}} to find the statistics objects where `RTCRemoteOutboundRtpStreamStats.codecId` is equal to {{domxref("RTCCodecStats.id")}}. + ## Value -A string which uniquely identifies the object from which the contents of the stream's {{domxref("RTCCodecStats")}} are derived. +A string that contains the {{domxref("RTCCodecStats.id","id")}} of the object that was inspected to produce the {{domxref("RTCCodecStats")}} object associated with this RTP stream. ## Specifications diff --git a/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/index.md b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/index.md index 067770678662cc0..8ee76caf6251566 100644 --- a/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/index.md +++ b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/index.md @@ -7,64 +7,46 @@ browser-compat: api.RTCStatsReport.type_remote-outbound-rtp {{APIRef("WebRTC")}} -The **`RTCRemoteOutboundRtpStreamStats`** dictionary of the [WebRTC API](/en-US/docs/Web/API/WebRTC_API) is used to report statistics from remote endpoint of its outbound RTP stream, which corresponds to an inbound stream that is currently received by an {{domxref("RTCPeerConnection")}} object. +The **`RTCRemoteOutboundRtpStreamStats`** dictionary of the [WebRTC API](/en-US/docs/Web/API/WebRTC_API) is used to report statistics from a remote endpoint about its outbound RTP stream. +This will correspond to an inbound stream that is currently being received by the local {{domxref("RTCPeerConnection")}} object. The statistics can be obtained by iterating the {{domxref("RTCStatsReport")}} returned by {{domxref("RTCPeerConnection.getStats()")}} until you find a report with the [`type`](#type) of `remote-outbound-rtp`. ## Instance properties -### Remote outbound specific properties +### Remote outbound specific statistics - {{domxref("RTCRemoteOutboundRtpStreamStats.localId", "localId")}} {{optional_inline}} - - - : A string which is used to find the local {{domxref("RTCInboundRtpStreamStats")}} object which shares the same Synchronization Source (SSRC). - + - : A string which is used to find the local {{domxref("RTCInboundRtpStreamStats")}} object that shares the same [synchronization source (SSRC)](/en-US/docs/Web/API/RTCRemoteOutboundRtpStreamStats/ssrc). - {{domxref("RTCRemoteOutboundRtpStreamStats.remoteTimestamp", "remoteTimestamp")}} {{optional_inline}} - - : A {{domxref("DOMHighResTimeStamp")}} specifying the timestamp (on the remote device) at which the statistics in the `RTCRemoteOutboundRtpStreamStats` object were sent by the remote endpoint. This is different from the {{domxref("RTCRemoteOutboundRtpStreamStats.timestamp", "timestamp")}}; it represents the time at which the object's statistics were received or generated by the local endpoint. - - `reportsSent` {{optional_inline}} {{experimental_inline}} + - : A positive integer indicating the total number of {{glossary("RTCP")}} Sender Report (SR) blocks sent for this [synchronization source (SSRC)](#ssrc). +- {{domxref("RTCRemoteOutboundRtpStreamStats.roundTripTimeMeasurements", "roundTripTimeMeasurements")}} {{optional_inline}} {{experimental_inline}} + - : A positive number that represents the total number of valid round trip time measurements received for this [synchronization source (SSRC)](#ssrc). +- {{domxref("RTCRemoteOutboundRtpStreamStats.totalRoundTripTime", "totalRoundTripTime")}} {{optional_inline}} {{experimental_inline}} + - : A number indicating the cumulative sum of all round trip time measurements since the beginning of the session, in seconds. + The average round trip time can be computed by dividing `totalRoundTripTime` by [`roundTripTimeMeasurements`](#roundtriptimemeasurements). - - : A positive integer indicating the total number of {{glossary("RTCP")}} Sender Report (SR) blocks sent for this synchronization source (SSRC). - -- `roundTripTimeMeasurements` {{optional_inline}} {{experimental_inline}} - - - : A positive integer indicating the total number of {{glossary("RTCP")}} Sender Report (SR) blocks received for this synchronization source (SSRC) that contain a DLRR (Delay Since last Receiver Report) block that can be used to derive a valid round trip time. - This counter will not increment if the round trip time cannot be calculated. - -- `totalRoundTripTime` {{optional_inline}} {{experimental_inline}} - - : A real number indicating the cumulative sum of all round trip time measurements since the beginning of the session, in seconds. - The average round trip time can be computed by dividing `totalRoundTripTime` by `roundTripTimeMeasurements`. - -### RTP sent-stream stat properties +### Sent RTP stream statistics - `bytesSent` {{optional_inline}} - - : A positive integer indicating the total number of bytes sent for this SSRC, including retransmissions. - - `packetsSent` {{optional_inline}} - : A positive integer indicating the total number of RTP packets sent for this SSRC, including retransmissions. -### RTP stream-stat properties +### Common RTP stream statistics - {{domxref("RTCRemoteOutboundRtpStreamStats.codecId", "codecId")}} {{optional_inline}} - - : A string that uniquely identifies the object that was inspected to produce the {{domxref("RTCCodecStats")}} report associated with this {{Glossary("RTP")}} stream. - - {{domxref("RTCRemoteOutboundRtpStreamStats.kind", "kind")}} - - - : A string whose value is `"audio"` if the associated {{domxref("MediaStreamTrack")}} is audio-only or `"video"` if the track contains video. - This value will match that of the media type indicated by {{domxref("RTCCodecStats.codec")}}, as well as the track's {{domxref("MediaStreamTrack.kind", "kind")}} property. Previously called `mediaType`. - + - : A string indicating whether the {{domxref("MediaStreamTrack")}} associated with the stream is an audio or a video track. - {{domxref("RTCRemoteOutboundRtpStreamStats.ssrc", "ssrc")}} - - - : A positive integer that identifies the synchronization source (SSRC) of the RTP stream that is being sent to the remote endpoint. - This value is generated per the {{RFC(3550)}} specification. - + - : A positive integer that identifies the synchronization source (SSRC) of the RTP packets in this stream. - {{domxref("RTCRemoteOutboundRtpStreamStats.transportId", "transportId")}} {{optional_inline}} - : A string that uniquely identifies the object that was inspected to produce the {{domxref("RTCTransportStats")}} report associated with this RTP stream. diff --git a/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/kind/index.md b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/kind/index.md index 1b1d661701ec7c4..83138397b813284 100644 --- a/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/kind/index.md +++ b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/kind/index.md @@ -10,17 +10,17 @@ browser-compat: api.RTCStatsReport.type_remote-outbound-rtp.kind The **`kind`** property of the {{domxref("RTCRemoteOutboundRtpStreamStats")}} dictionary is a string indicating whether the described {{Glossary("RTP")}} stream contains audio or video media. +This string will always be the same as the {{domxref("MediaStreamTrack.kind", "kind")}} of the {{domxref("MediaStreamTrack")}} object carried by the stream. +It will also match the statistics object's {{domxref("RTCCodecStats.codec")}} property's media type. + ## Value The kinds is always one of: - `"audio"` - - : The track contains audio media. + - : The stream contains audio media. - `"video"` - - : The track contains video media. - -This string will always be the same as the one provided by the associated {{domxref("MediaStreamTrack")}} object's {{domxref("MediaStreamTrack.kind", "kind")}} property. -It will also match the statistics object's {{domxref("RTCCodecStats.codec")}} property's media type. + - : The stream contains video media. ## Specifications diff --git a/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/localid/index.md b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/localid/index.md index 784cbc9bba323e7..67dcc050b700728 100644 --- a/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/localid/index.md +++ b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/localid/index.md @@ -21,8 +21,8 @@ A string which can be compared to the value of an {{domxref("RTCInboundRtpStream You can think of the local and remote views of the same RTP stream as pairs, each of which has a reference back to the other one. Thus, if an {{domxref("RTCStatsReport")}} includes an `remote-outbound-rtp` statistics object (of type `RTCRemoteOutboundRtpStreamStats`), it should also have a corresponding `inbound-rtp` object. Both of these provide information about the same batch of packets being transmitted from the remote peer to the local device. -The difference is -that `remote-outbound-rtp` describes statistics about the transmission(s) from the perspective of the remote peer, while `inbound-rtp` offers statistics about the incoming data from the local peer's perspective. + +The difference is that `remote-outbound-rtp` describes statistics about data sent by the remote peer from the perspective of the remote peer, while `inbound-rtp` offers statistics about the incoming data from the local peer's perspective. You can [examine, try out, and experiment](#try_it_and_fork_it) with this example on Glitch. diff --git a/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/roundtriptimemeasurements/index.md b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/roundtriptimemeasurements/index.md new file mode 100644 index 000000000000000..2108b812cd5da3c --- /dev/null +++ b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/roundtriptimemeasurements/index.md @@ -0,0 +1,27 @@ +--- +title: "RTCRemoteOutboundRtpStreamStats: roundTripTimeMeasurements property" +short-title: roundTripTimeMeasurements +slug: Web/API/RTCRemoteOutboundRtpStreamStats/roundTripTimeMeasurements +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-outbound-rtp.roundTripTimeMeasurements +--- + +{{APIRef("WebRTC")}} + +The **`roundTripTimeMeasurements`** property of the {{domxref("RTCRemoteOutboundRtpStreamStats")}} dictionary is a positive integer value that represents the total number valid round of trip time measurements received for this [synchronizing source (SSRC)](/en-US/docs/Web/API/RTCRemoteOutboundRtpStreamStats/ssrc). + +The count can be used as a measure of the availability and reliability of round trip time measurement data. + +## Value + +A positive number indicating the number of valid round trip time measurements. + +This is the number of _RTCP Sender Reports (SR)_ received for this SSRC that contain a "delay since last RR (DLRR)" field from which a valid round trip time can be derived (according to {{rfc("3611","DLRR Report Block", "4.5")}}). + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} diff --git a/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/ssrc/index.md b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/ssrc/index.md index e732cc36f16eb9f..4555f71d001a144 100644 --- a/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/ssrc/index.md +++ b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/ssrc/index.md @@ -8,13 +8,17 @@ browser-compat: api.RTCStatsReport.type_remote-outbound-rtp.ssrc {{APIRef("WebRTC")}} -The **`ssrc`** property of the {{domxref("RTCRemoteOutboundRtpStreamStats")}} dictionary provides the Synchronization Source (SSRC), an integer which uniquely identifies the source of the {{Glossary("RTP")}} packets whose statistics are covered by the {{domxref("RTCStatsReport")}} that includes this `RTCRemoteOutboundRtpStreamStats` dictionary. +The **`ssrc`** property of the {{domxref("RTCRemoteOutboundRtpStreamStats")}} dictionary contains a positive integer value that identifies the synchronization source (SSRC) of this stream of {{Glossary("RTP")}} packets. + +A source might be something like a microphone, or a mixer application that combines multiple sources. +All packets from the same source share the same time source and sequence space, and so can be ordered relative to each other. +Note that two streams with the same `ssrc` value refer to the same source. ## Value -The Synchronization Source (SSRC) is a 32-bit integer uniquely identifying the source of the RTP packets whose statistics are covered by the {{domxref("RTCStatsReport")}} object of which this `RTCRtpStreamStats` object is a component. +A positive 32-bit integer uniquely identifying the SSRC of the RTP packets whose statistics are covered by this {{domxref("RTCRemoteOutboundRtpStreamStats")}} object. -The manner in which these values are generated is not mandated by the specification, although it does make recommendations. +The manner in which SSRC values are generated is not mandated by the specification, although it does make recommendations. You should not make any assumptions based on the value of `ssrc` other than that any two objects with the same `ssrc` value refer to the same source. See {{RFC("3550", "", "8")}} for additional information about `ssrc`. @@ -30,3 +34,8 @@ See {{RFC("3550", "", "8")}} for additional information about `ssrc`. ## Browser compatibility {{Compat}} + +## See also + +- {{domxref("RTCRtpReceiver.getSynchronizationSources()")}} +- {{domxref("RTCEncodedAudioFrame.getMetadata()")}} diff --git a/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/totalroundtriptime/index.md b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/totalroundtriptime/index.md new file mode 100644 index 000000000000000..52f306b0e0817da --- /dev/null +++ b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/totalroundtriptime/index.md @@ -0,0 +1,30 @@ +--- +title: "RTCRemoteOutboundRtpStreamStats: totalRoundTripTime property" +short-title: totalRoundTripTime +slug: Web/API/RTCRemoteOutboundRtpStreamStats/totalRoundTripTime +page-type: web-api-instance-property +browser-compat: api.RTCStatsReport.type_remote-outbound-rtp.totalRoundTripTime +--- + +{{APIRef("WebRTC")}} + +The **`totalRoundTripTime`** property of the {{domxref("RTCRemoteOutboundRtpStreamStats")}} dictionary indicates the sum of all round trip time (RTT) measurements since the beginning of the session, in seconds. + +The individual round trip time is calculated based on RTCP timestamps in the DLRR report block of RTCP Sender Reports (SR). +The average RTT can be computed by dividing `totalRoundTripTime` by {{domxref("RTCRemoteOutboundRtpStreamStats.roundTripTimeMeasurements","roundTripTimeMeasurements")}}. + +## Value + +A number indicating the total round trip time for the session, in seconds. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- {{rfc("3611","DLRR Report Block", "4.5")}} diff --git a/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/transportid/index.md b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/transportid/index.md index 082733e035783dd..92e570f8b770183 100644 --- a/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/transportid/index.md +++ b/files/en-us/web/api/rtcremoteoutboundrtpstreamstats/transportid/index.md @@ -8,11 +8,13 @@ browser-compat: api.RTCStatsReport.type_remote-outbound-rtp.transportId {{APIRef("WebRTC")}} -The **`transportId`** property of the {{domxref("RTCRemoteOutboundRtpStreamStats")}} dictionary is a string that uniquely identifies the object from which the statistics contained in the {{domxref("RTCTransportStats")}} properties in the {{domxref("RTCStatsReport")}}. +The **`transportId`** property of the {{domxref("RTCRemoteOutboundRtpStreamStats")}} dictionary is a string that uniquely identifies the associated {{domxref("RTCTransportStats")}} statistics object for this RTP stream's underlying transport. + +`RTCRemoteOutboundRtpStreamStats` and `RTCTransportStats` objects are correlated by iterating the {{domxref("RTCStatsReport")}} to find the statistics objects where `RTCRemoteOutboundRtpStreamStats.transportId` is equal to {{domxref("RTCTransportStats.id")}}. ## Value -A string uniquely identifying the source of the statistics contained the {{domxref("RTCTransportStats")}} properties in the {{domxref("RTCStatsReport")}}. +A string that contains the {{domxref("RTCTransportStats.id","id")}} of the object that was inspected to produce the {{domxref("RTCTransportStats")}} object associated with this RTP stream. ## Specifications diff --git a/files/jsondata/GroupData.json b/files/jsondata/GroupData.json index b0b05cc15eff5f4..20d17e7b819fd14 100644 --- a/files/jsondata/GroupData.json +++ b/files/jsondata/GroupData.json @@ -2174,6 +2174,7 @@ "RTCDataChannelStats", "RTCOutboundRtpStreamStats", "RTCPeerConnectionStats", + "RTCRemoteInboundRtpStreamStats", "RTCRemoteOutboundRtpStreamStats" ], "methods": ["MediaDevices.getUserMedia()"],