RTCRtpSendParameters.encodings - Web APIs 编辑
The RTCRtpSendParameters
dictionary's encodings
property is an RTCRtpEncodingParameters
object providing configuration settings for the encoder being used for the RTCRtpSender
's track
.
Syntax
sendParameters.encodings = encodingParameterList; encodingParameterList = sendParameters.encodings;
Value
An array of objects conforming to the RTCRtpEncodingParameters
dictionary, each of which contains properties which provide settings and parameters that describe and configure the codec used for a single destination. Each object's properties are:
active
- If
true
, the described encoding is currently actively being used. That is, for RTP senders, the encoding is currently being used to send data, while for receivers, the encoding is being used to decode received data. The default value istrue
. codecPayloadType
- When describing a codec for an
RTCRtpSender
,codecPayloadType
is a single 8-bit byte (or octet) specifying the codec to use for sending the stream; the value matches one from the owningRTCRtpParameters
object'scodecs
parameter. This value can only be set when creating the transceiver; after that, this value is read only. dtx
- Only used for an
RTCRtpSender
whosekind
isaudio
, this property indicates whether or not to use discontinuous transmission (a feature by which a phone is turned off or the microphone muted automatically in the absence of voice activity). The value is taken from the enumerated string typeRTCDtxStatus
. maxBitrate
- An unsigned long integer indicating the maximum number of bits per second to allow for this encoding. Other parameters may further constrain the bit rate, such as the value of
maxFramerate
or transport or physical network limitations. maxFramerate
- A double-precision floating-point value specifying the maximum number of frames per second to allow for this encoding.
ptime
- An unsigned long integer value indicating the preferred duration of a media packet in milliseconds. This is typically only relevant for audio encodings. The user agent will try to match this as well as it can, but there is no guarantee.
rid
- A
DOMString
which, if set, specifies an RTP stream ID (RID) to be sent using the RID header extension. This parameter cannot be modified usingsetParameters()
. Its value can only be set when the transceiver is first created. scaleResolutionDownBy
- Only used for senders whose track's
kind
isvideo
, this is a double-precision floating-point value specifying a factor by which to scale down the video during encoding. The default value, 1.0, means that the sent video's size will be the same as the original. A value of 2.0 scales the video frames down by a factor of 2 in each dimension, resulting in a video 1/4 the size of the original. The value must not be less than 1.0 (you can't use this to scale the video up).
Description
In a connection in which there's only one remote peer, the encodings
array will have just one object in it, describing the encoding to use when transmitting to that peer. For each peer you add the RTCRtpSender
to, another entry is added to encodings
to describe its configuration.
Specifications
Specification | Status | Comment |
---|---|---|
WebRTC 1.0: Real-time Communication Between Browsers The definition of 'RTCRtpSendParameters.encodings' in that specification. | Candidate Recommendation | Initial definition. |
Browser compatibility
BCD tables only load in the browser
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论