Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

RTCRemoteInboundRtpStreamStats

BaselineWidely available *

TheRTCRemoteInboundRtpStreamStats dictionary of theWebRTC 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 theRTCPeerConnection.

The statistics can be obtained by iterating theRTCStatsReport returned byRTCPeerConnection.getStats() orRTCRtpReceiver.getStats() until you find a report with thetype ofremote-inbound-rtp.

Instance properties

Remote inbound specific statistics

fractionLostOptional

A number indicating the fraction of packets lost for this SSRC since the last sender or receiver report.

localIdOptional

A string that is used to find the localRTCOutboundRtpStreamStats object that shares the samesynchronization source (SSRC).

roundTripTimeOptional

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.

roundTripTimeMeasurementsOptional

A positive integer indicating the total number of valid round trip time measurements received for thissynchronization source (SSRC).

totalRoundTripTimeOptional

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 dividingtotalRoundTripTime byroundTripTimeMeasurements.

Received RTP stream statistics

jitterOptional

A number indicating thepacket jitter for this synchronization source, measured in seconds.

packetsLostOptional

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.

packetsReceivedOptionalExperimental

A positive integer indicating the total number of RTP packets received for this SSRC, including retransmissions.

Common RTP stream statistics

codecIdOptional

A string that uniquely identifies the object that was inspected to produce theRTCCodecStats object associated with thisRTP stream.

kind

A string indicating whether theMediaStreamTrack associated with the stream is an audio or a video track.

ssrc

A positive integer that identifies the SSRC of the RTP packets in this stream.

transportIdOptional

A string that uniquely identifies the object which was inspected to produce theRTCTransportStats object associated with this RTP stream.

Common instance properties

The following properties are common to all WebRTC statistics objects.

id

A string that uniquely identifies the object that is being monitored to produce this set of statistics.

timestamp

ADOMHighResTimeStamp object indicating the time at which the sample was taken for this statistics object.

type

A string with the value"inbound-rtp", indicating the type of statistics that the object contains.

Examples

Given a variablepeerConnection that is an instance of anRTCPeerConnection, the code below usesawait to wait for the statistics report, and then iterates it usingRTCStatsReport.forEach().It then filters the dictionaries for just those reports that have the type ofremote-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

Specification
Identifiers for WebRTC's Statistics API
# dom-rtcstatstype-remote-inbound-rtp

Browser compatibility

See also

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp