大网数据广告活动
Web 标准与前端开发

RTCOutboundRtpStreamStats

· 52CE 我爱测

The **`RTCOutboundRtpStreamStats`** dictionary of the WebRTC API is used to report metrics and statistics related to an outbound RTP stream being sent by an RTCRtpSender.

WebRTC

The RTCOutboundRtpStreamStats dictionary of the WebRTC API is used to report metrics and statistics related to an outbound RTP stream being sent by an RTCRtpSender.

The statistics can be obtained by iterating the RTCStatsReport returned by RTCPeerConnection.getStats() or RTCRtpSender.getStats() until you find a report with the type of outbound-rtp.

Instance properties

  • RTCOutboundRtpStreamStats.active
    • : A boolean that indicates whether this RTP stream is configured to be sent, or is disabled.
  • RTCOutboundRtpStreamStats.frameHeight
    • : An integer indicating the height of the last encoded frame, in pixels. Undefined for audio streams.
  • RTCOutboundRtpStreamStats.frameWidth
    • : An integer indicating the width of the last encoded frame, in pixels. Undefined for audio streams.
  • RTCOutboundRtpStreamStats.framesEncoded
    • : The number of frames that have been successfully encoded so far for sending on this RTP stream. Undefined for audio streams.
  • RTCOutboundRtpStreamStats.framesPerSecond
    • : A number that represents the encoded frames sent in the last second. Undefined for audio streams.
  • RTCOutboundRtpStreamStats.framesSent
    • : A positive integer that represents the total number of encoded frames sent on this RTP stream. Undefined for audio streams.
  • RTCOutboundRtpStreamStats.headerBytesSent
    • : A positive integer that represents the total number of RTP header and padding bytes sent for this SSRC.
  • RTCOutboundRtpStreamStats.keyFramesEncoded
    • : A positive integer that represents the total number of key frames successfully encoded in this RTP media stream. Undefined for audio streams.
  • RTCOutboundRtpStreamStats.mediaSourceId
    • : A string that represents the id of the stats object of the track currently attached to the sender of this stream.
  • RTCOutboundRtpStreamStats.mid
    • : A string that uniquely identifies the pairing of source and destination of the transceiver's stream. This is the value of the corresponding RTCRtpTransceiver.mid unless that is null, in which case the statistic property is not present.
  • RTCOutboundRtpStreamStats.nackCount
    • : An integer value indicating the total number of Negative ACKnowledgement (NACK) packets this RTCRtpSender has received from the remote RTCRtpReceiver. This locally-computed value provides an indication of the error resiliency of the connection.
  • RTCOutboundRtpStreamStats.qpSum
    • : A 64-bit value containing the sum of the QP values for every frame encoded by this RTCRtpSender. This locally-computed value provides an indication of how heavily compressed the data is. Undefined for audio streams.
  • RTCOutboundRtpStreamStats.qualityLimitationDurations
    • : A map of the reasons that a media stream's resolution or framerate has been reduced, and the time that the quality was reduced for each reason. Undefined for audio streams.
  • RTCOutboundRtpStreamStats.qualityLimitationReason
    • : A string indicating the reason why the stream is being quality-limited. One of: none, cpu, bandwidth, or other. Undefined for audio streams.
  • RTCOutboundRtpStreamStats.remoteId
    • : A string which identifies the RTCRemoteInboundRtpStreamStats object that provides statistics for the remote peer for this same SSRC. This ID is stable across multiple calls to getStats().
  • RTCOutboundRtpStreamStats.retransmittedBytesSent
    • : A positive integer that represents the total number of payload bytes retransmitted for the source associated with this stream.
  • RTCOutboundRtpStreamStats.retransmittedPacketsSent
    • : A positive integer that represents the total number of packets retransmitted for the source associated with this stream.
  • RTCOutboundRtpStreamStats.rid
    • : A string that indicates the RTP stream ID for a corresponding video stream.
  • RTCOutboundRtpStreamStats.scalabilityMode
    • : A string that represents the scalability mode for the RTP stream, if one has been configured.
  • RTCOutboundRtpStreamStats.targetBitrate
    • : A number that represents the bit rate that the RTCRtpSender's codec is currently attempting to achieve for the stream.
  • RTCOutboundRtpStreamStats.totalEncodeTime
    • : A number that represents the total number of seconds that have been spent encoding the frames encoded for this stream RTCRtpSender. Undefined for audio streams.
  • RTCOutboundRtpStreamStats.totalEncodedBytesTarget
    • : A cumulative sum of the target frame sizes for all of the frames encoded so far. This will likely differ from the total of the actual frame sizes. Undefined for audio streams.
  • RTCOutboundRtpStreamStats.totalPacketSendDelay
    • : A number that represents the total time in seconds that packets have spent buffered locally before being transmitted.

Sent RTP stream statistics

  • RTCOutboundRtpStreamStats.bytesSent
    • : A positive integer indicating the total number of bytes sent for this SSRC, including retransmissions.
  • RTCOutboundRtpStreamStats.packetsSent
    • : A positive integer indicating the total number of RTP packets sent for this SSRC, including retransmissions.

Common RTP stream statistics

  • RTCOutboundRtpStreamStats.codecId
    • : A string that uniquely identifies the object that was inspected to produce the RTCCodecStats object associated with this RTP stream.
  • RTCOutboundRtpStreamStats.kind
    • : A string indicating whether the MediaStreamTrack associated with the stream is an audio or a video track.
  • RTCOutboundRtpStreamStats.ssrc
    • : A positive integer that identifies the SSRC of the RTP packets in this stream.
  • RTCOutboundRtpStreamStats.transportId
    • : A string that uniquely identifies the object which was inspected to produce the RTCTransportStats object associated with this RTP stream.

Common instance properties

The following properties are common to all WebRTC statistics objects.

  • RTCOutboundRtpStreamStats.id
    • : A string that uniquely identifies the object that is being monitored to produce this set of statistics.
  • RTCOutboundRtpStreamStats.timestamp
    • : A DOMHighResTimeStamp object indicating the time at which the sample was taken for this statistics object.
  • RTCOutboundRtpStreamStats.type
    • : A string with the value "outbound-rtp", indicating the type of statistics that the object contains.

Specifications

Browser compatibility

See also

  • RTCStatsReport

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。