RTP parameters
RTP parameters and capabilities of senders, receivers and transceivers.
- class webrtc.models.rtp_parameters.RTCRtpCodec(mime_type, clock_rate, channels=None, sdp_fmtp_line=None)
A codec a sender or a receiver supports, or the one an encoding sends with.
Codecs given to the library match a supported one by MIME type (ignoring case), clock rate, channels and fmtp parameters (in any order).
See MDN: RTCRtpSender/getCapabilities_static.
- Parameters:
mime_type (
str) β The type and subtype of the codec, like'audio/opus'.clock_rate (
int) β The RTP clock rate in Hz.channels (
int, optional) β The number of audio channels. ItβsNonefor video.sdp_fmtp_line (
str, optional) β The codec parameters, as in thea=fmtpline of SDP, like'minptime=10;useinbandfec=1'.
- class webrtc.models.rtp_parameters.RTCRtpCodecParameters(payload_type, mime_type, clock_rate, channels=None, sdp_fmtp_line=None)
A codec negotiated for a sender or a receiver, with its payload type.
See MDN: RTCRtpSender/getParameters.
- Parameters:
payload_type (
int) β The RTP payload type the codec is negotiated with.mime_type (
str) β The type and subtype of the codec, like'audio/opus'.clock_rate (
int) β The RTP clock rate in Hz.channels (
int, optional) β The number of audio channels. ItβsNonefor video.sdp_fmtp_line (
str, optional) β The codec parameters, as in thea=fmtpline of SDP.
- class webrtc.models.rtp_parameters.RTCRtpHeaderExtensionParameters(uri, id, encrypted=False)
An RTP header extension negotiated for a sender or a receiver.
- class webrtc.models.rtp_parameters.RTCRtcpParameters(cname=None, reduced_size=None)
The RTCP parameters of a sender or a receiver.
- class webrtc.models.rtp_parameters.RTCRtpCodingParameters(rid=None)
The member of an encoding that identifies it.
See MDN: RTCRtpSender/getParameters.
- Parameters:
rid (
str, optional) β The RTP stream id of a simulcast layer. It canβt be changed once set.
- class webrtc.models.rtp_parameters.RTCRtpEncodingParameters(rid=None, active=True, max_bitrate=None, max_framerate=None, scale_resolution_down_by=None, priority=RTCPriorityType.low, network_priority=RTCPriorityType.low, scalability_mode=None, adaptive_ptime=False, codec=None)
An encoding of a sender. A sender has one per simulcast layer, or a single one.
For audio senders,
max_framerateandscale_resolution_down_byare ignored.See MDN: RTCRtpSender/setParameters.
- Parameters:
rid (
str, optional) β The RTP stream id of a simulcast layer. It canβt be changed once set.active (
bool, optional) β Whether the encoding is sent.max_bitrate (
int, optional) β The bitrate cap in bits per second.max_framerate (
float, optional) β The frame rate cap of video.scale_resolution_down_by (
float, optional) β The factor video is scaled down by, at least 1.priority (
webrtc.RTCPriorityType, optional) β The relative share of the bitrate the encoding gets. Itβs read back as the level closest to what the encoder uses.network_priority (
webrtc.RTCPriorityType, optional) β The DSCP marking of its packets.scalability_mode (
str, optional) β The SVC mode of video, like'L1T3'.adaptive_ptime (
bool, optional) β Whether audio may use longer packets when bandwidth is low.codec (
webrtc.RTCRtpCodec, optional) β The codec to send with. The first negotiated one is used by default.
- class webrtc.models.rtp_parameters.RTCRtpParameters(header_extensions, rtcp, codecs)
The parameters a sender and a receiver share.
See MDN: RTCRtpSender/getParameters.
- Parameters:
header_extensions (
listofwebrtc.RTCRtpHeaderExtensionParameters) β The header extensions.rtcp (
webrtc.RTCRtcpParameters) β The RTCP parameters.codecs (
listofwebrtc.RTCRtpCodecParameters) β The negotiated codecs.
- class webrtc.models.rtp_parameters.RTCRtpReceiveParameters(header_extensions, rtcp, codecs)
The parameters a receiver receives with, from
webrtc.RTCRtpReceiver.get_parameters().See MDN: RTCRtpReceiver/getParameters.
- Parameters:
header_extensions (
listofwebrtc.RTCRtpHeaderExtensionParameters) β The header extensions.rtcp (
webrtc.RTCRtcpParameters) β The RTCP parameters.codecs (
listofwebrtc.RTCRtpCodecParameters) β The codecs it can receive.
- class webrtc.models.rtp_parameters.RTCRtpSendParameters(header_extensions, rtcp, codecs, transaction_id, encodings, degradation_preference=None)
The parameters a sender sends with, from
webrtc.RTCRtpSender.get_parameters().Only
encodings(all but theirrid) anddegradation_preferencecan be changed withwebrtc.RTCRtpSender.set_parameters().See MDN: RTCRtpSender/getParameters.
- Parameters:
header_extensions (
listofwebrtc.RTCRtpHeaderExtensionParameters) β The header extensions.rtcp (
webrtc.RTCRtcpParameters) β The RTCP parameters.codecs (
listofwebrtc.RTCRtpCodecParameters) β The negotiated codecs.transaction_id (
str) β Identifies theget_parameterscall the parameters come from.encodings (
listofwebrtc.RTCRtpEncodingParameters) β The encodings.degradation_preference (
webrtc.RTCDegradationPreference, optional) β Whether video drops frame rate or resolution first when bandwidth or CPU is short.
- class webrtc.models.rtp_parameters.RTCRtpHeaderExtensionCapability(uri, direction=RTCRtpTransceiverDirection.sendrecv)
An RTP header extension that can be negotiated.
In
webrtc.RTCRtpCapabilitiesonly the URI is meaningful, since the direction is set per transceiver.See MDN: RTCRtpSender/getCapabilities_static.
- Parameters:
uri (
str) β The URI that names the extension.direction (
webrtc.RTCRtpTransceiverDirection, optional) β The directions itβs negotiated in. Itβswebrtc.RTCRtpTransceiverDirection.stoppedfor none.
- class webrtc.models.rtp_parameters.RTCRtpCapabilities(codecs, header_extensions)
The codecs and header extensions a sender or a receiver supports.
See MDN: RTCRtpSender/getCapabilities_static.
- Parameters:
codecs (
listofwebrtc.RTCRtpCodec) β The codecs.header_extensions (
listofwebrtc.RTCRtpHeaderExtensionCapability) β The header extensions.
- class webrtc.models.rtp_parameters.RTCEncodingOptions(key_frame=False)
How
webrtc.RTCRtpSender.set_parameters()changes one encoding, from WebRTC Extensions.- Parameters:
key_frame (
bool, optional) β Whether the encoding sends a key frame right away.
- class webrtc.models.rtp_parameters.RTCSetParameterOptions(encoding_options=<factory>)
The options of
webrtc.RTCRtpSender.set_parameters(), from WebRTC Extensions.- Parameters:
encoding_options (
listofwebrtc.RTCEncodingOptions, optional) β One per encoding, in order, or empty for none.