RTCRtpStreamStats
dictionary is returned by the
RTCPeerConnection.getStats()
,
RTCRtpSender.getStats()
,和
RTCRtpReceiver.getStats()
methods to provide detailed statistics about WebRTC connectivity.
While the dictionary has a base set of properties that are present in each of these cases, there are also additional properties added depending on which interface the method is called on.
RTCRtpStreamStats
is the base class for all RTP-related statistics reports. It's based on
RTCStats
and adds the following additional fields.
注意:
This interface was called
RTCRTPStreamStats
until a specification update in the spring of 2017. Check the
浏览器兼容性
table to know if and when the name change was implemented in specific browsers.
RTCRtpStreamStats
dictionary is based on
RTCStats
, and inherits its properties. In addition, some or all of the following properties are available.
codecId
DOMString
which uniquely identifies the object which was inspected to produce the
RTCCodecStats
object associated with this
RTP
流。
kind
DOMString
whose value is
"audio"
if the associated
MediaStreamTrack
is audio-only or
"video"
if the track contains video. This value will match that of the media type indicated by
RTCCodecStats.codec
, as well as the track's
kind
property. Previously called
mediaType
.
ssrc
RTCRtpStreamStats
object covers. This value is generated per the
RFC 3550
规范。
trackId
DOMString
which uniquely identifies the
RTCMediaStreamTrackStats
object representing the associated
MediaStreamTrack
. This is
not
the same as the value of
MediaStreamTrack.id
.
transportId
DOMString
uniquely identifying the object which was inspected to produce the
RTCTransportStats
object associated with this RTP stream.
mediaType
kind
in the specification in February 2018. See
浏览器兼容性
in
RTCRtpStreamStats.kind
to determine when browsers made the transition.
These properties are computed locally, and are only available to the device receiving the media stream. Their primary purpose is to examine the error resiliency of the connection, as they provide information about lost packets, lost frames, and how heavily compressed the data is.
firCount
A count of the total number of Full Intra Request (FIR) packets received by the sender. This statistic is only available to the device which is receiving the stream and is only available for video tracks. A FIR packet is sent by the receiving end of the stream when it falls behind or has lost packets and is unable to continue decoding the stream; the sending end of the stream receives the FIR packet and responds by sending a full frame instead of a delta frame, thereby letting the receiver "catch up." The higher this number is, the more often a problem of this nature arose, which can be a sign of network congestion or an overburdened receiving device.
nackCount
The number of times the receiver notified the sender that one or more RTP packets has been lost by sending a Negative ACKnowledgement (NACK, also called "Generic NACK") packet to the sender. This value is only available to the receiver.
pliCount
The number of times the receiving end of the stream sent a Picture Loss Indiciation (PLI) packet to the sender, indicating that it has lost some amount of encoded video data for one or more frames. Only the receiver has this value, and it's only valid for video tracks.
qpSum
RTCRtpStreamStats
object. In general, the higher this number is, the more heavily compressed the video track was. Combined with
RTCReceivedRtpStreamStats.framesDecoded
or
RTCSentRtpStreamStats.framesEncoded
, you can approximate the average QP over those frames, keeping in mind that codecs often vary the quantizer values even within frames. Also keep in mind that the values of QP can vary from codec to codec, so this value is only potentially useful when compared against the same codec.
sliCount
The number of times the receiver notified the sender that one or more consecutive (in scan order) encoded video macroblocks have been lost or corrupted; this notification is sent by the receiver to the sender using a Slice Loss Indication (SLI) packet. This is a fairly technical part of how codecs work and while the higher this value is, the more errors occurred in the stream, generally most of the time this value is only interesting to very intensively hardcore media developers.
| 规范 | 状态 | 注释 |
|---|---|---|
|
Identifiers for WebRTC's Statistics API
The definition of 'RTCRtpStreamStats' in that specification. |
候选推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
RTCRtpStreamStats
|
Chrome No | Edge No |
Firefox
63
|
IE No | Opera No | Safari ? | WebView Android No | Chrome Android No |
Firefox Android
63
|
Opera Android No | Safari iOS ? | Samsung Internet Android No |
codecId
|
Chrome No | Edge No | Firefox 27 | IE No | Opera No | Safari ? | WebView Android No | Chrome Android No | Firefox Android 27 | Opera Android No | Safari iOS ? | Samsung Internet Android No |
firCount
|
Chrome No | Edge No | Firefox 55 | IE No | Opera No | Safari ? | WebView Android No | Chrome Android No | Firefox Android 55 | Opera Android No | Safari iOS ? | Samsung Internet Android No |
isRemote
弃用
|
Chrome No | Edge No |
Firefox
27
|
IE No | Opera No | Safari ? | WebView Android No | Chrome Android No |
Firefox Android
27
|
Opera Android No | Safari iOS ? | Samsung Internet Android No |
kind
|
Chrome No | Edge No | Firefox 63 | IE No | Opera No | Safari ? | WebView Android No | Chrome Android No | Firefox Android 63 | Opera Android No | Safari iOS ? | Samsung Internet Android No |
mediaTrackId
弃用
|
Chrome No | Edge No | Firefox 27 | IE No | Opera No | Safari ? | WebView Android No | Chrome Android No | Firefox Android 27 | Opera Android No | Safari iOS ? | Samsung Internet Android No |
mediaType
弃用
|
Chrome No | Edge No | Firefox 34 | IE No | Opera No | Safari ? | WebView Android No | Chrome Android No | Firefox Android 34 | Opera Android No | Safari iOS ? | Samsung Internet Android No |
nackCount
|
Chrome No | Edge No | Firefox 55 | IE No | Opera No | Safari ? | WebView Android No | Chrome Android No | Firefox Android 55 | Opera Android No | Safari iOS ? | Samsung Internet Android No |
pliCount
|
Chrome No | Edge No | Firefox 55 | IE No | Opera No | Safari ? | WebView Android No | Chrome Android No | Firefox Android 55 | Opera Android No | Safari iOS ? | Samsung Internet Android No |
qpSum
|
Chrome No | Edge No | Firefox 66 | IE No | Opera No | Safari ? | WebView Android No | Chrome Android No | Firefox Android 66 | Opera Android No | Safari iOS ? | Samsung Internet Android No |
remoteId
弃用
|
Chrome No | Edge No | Firefox 27 | IE No | Opera No | Safari ? | WebView Android No | Chrome Android No | Firefox Android 27 | Opera Android No | Safari iOS ? | Samsung Internet Android No |
sliCount
|
Chrome No | Edge No | Firefox No | IE No | Opera No | Safari ? | WebView Android No | Chrome Android No | Firefox Android No | Opera Android No | Safari iOS ? | Samsung Internet Android No |
ssrc
|
Chrome No | Edge No | Firefox 27 | IE No | Opera No | Safari ? | WebView Android No | Chrome Android No | Firefox Android 27 | Opera Android No | Safari iOS ? | Samsung Internet Android No |
transportId
|
Chrome No | Edge No | Firefox 27 | IE No | Opera No | Safari ? | WebView Android No | Chrome Android No | Firefox Android 27 | Opera Android No | Safari iOS ? | Samsung Internet Android No |
完整支持
不支持
兼容性未知
弃用。不要用于新网站。
见实现注意事项。
使用非标名称。
RTCRtpStreamStats
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannel
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceCandidate
RTCIceTransport
RTCPeerConnection
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent