files/en-us/web/api/rtcremoteinboundrtpstreamstats/index.md
{{APIRef("WebRTC")}}
The RTCRemoteInboundRtpStreamStats dictionary of the 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 of remote-inbound-rtp.
totalRoundTripTime by roundTripTimeMeasurements.The following properties are common to all WebRTC statistics objects.
<!-- RTCStats -->"inbound-rtp", indicating the type of statistics that the object contains.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.
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}}
{{Compat}}