# RTCRtpReceiver

The receiver that receives and decodes remote media.

### *class* webrtc.interfaces.rtc_rtp_receiver.RTCRtpReceiver(native_obj=None)

Receives and decodes remote media into a [`webrtc.MediaStreamTrack`](media_stream_track.md#webrtc.interfaces.media_stream_track.MediaStreamTrack).

Each [`webrtc.RTCRtpTransceiver`](rtc_rtp_transceiver.md#webrtc.interfaces.rtc_rtp_transceiver.RTCRtpTransceiver) of an [`webrtc.RTCPeerConnection`](rtc_peer_connection.md#webrtc.interfaces.rtc_peer_connection.RTCPeerConnection) has one.

See [MDN: RTCRtpReceiver](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver).

#### *property* track *: [MediaStreamTrack](media_stream_track.md#webrtc.interfaces.media_stream_track.MediaStreamTrack)*

The track the received media plays on. It exists from the start.

See [MDN: RTCRtpReceiver/track](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/track).

* **Type:**
  [`webrtc.MediaStreamTrack`](media_stream_track.md#webrtc.interfaces.media_stream_track.MediaStreamTrack)

#### *property* transport *: [RTCDtlsTransport](rtc_dtls_transport.md#webrtc.interfaces.rtc_dtls_transport.RTCDtlsTransport) | [None](https://docs.python.org/3/builtins/constants.html#None)*

The transport the packets come over.

It’s [`None`](https://docs.python.org/3/builtins/constants.html#None) until there’s one.
See [MDN: RTCRtpReceiver/transport](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/transport).

* **Type:**
  [`webrtc.RTCDtlsTransport`](rtc_dtls_transport.md#webrtc.interfaces.rtc_dtls_transport.RTCDtlsTransport), optional

#### *property* transform *: [RTCRtpScriptTransform](rtc_rtp_script_transform.md#webrtc.interfaces.rtc_rtp_script_transform.RTCRtpScriptTransform) | [RTCRtpSFrameDecryptor](sframe_transform.md#webrtc.interfaces.sframe_transform.RTCRtpSFrameDecryptor) | [None](https://docs.python.org/3/builtins/constants.html#None)*

The frame transform.

It changes the encoded frames before they’re decoded. With [`None`](https://docs.python.org/3/builtins/constants.html#None), frames are decoded as received.
A transform serves one sender or receiver for its lifetime, so once attached it can’t be set elsewhere.

See [MDN: RTCRtpReceiver/transform](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/transform).

* **Raises:**
  * [**TypeError**](https://docs.python.org/3/builtins/exceptions.html#TypeError) – If the value set isn’t a transform of a receiver.
  * [**webrtc.InvalidStateError**](../exceptions.md#webrtc.exceptions.InvalidStateError) – If the transform set had a sender or receiver.
* **Type:**
  [`webrtc.RTCRtpScriptTransform`](rtc_rtp_script_transform.md#webrtc.interfaces.rtc_rtp_script_transform.RTCRtpScriptTransform) or [`webrtc.RTCRtpSFrameDecryptor`](sframe_transform.md#webrtc.interfaces.sframe_transform.RTCRtpSFrameDecryptor), optional

#### *property* jitter_buffer_target *: [float](https://docs.python.org/3/builtins/functions.html#float) | [None](https://docs.python.org/3/builtins/constants.html#None)*

The target delay of the jitter buffer in milliseconds, from 0 to 4000.

A higher value adds latency for smoother playback. [`None`](https://docs.python.org/3/builtins/constants.html#None) leaves it to the receiver.

See [MDN: RTCRtpReceiver/jitterBufferTarget](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/jitterBufferTarget).

* **Raises:**
  * [**TypeError**](https://docs.python.org/3/builtins/exceptions.html#TypeError) – If the value set is NaN or infinite.
  * [**webrtc.InvalidRangeError**](../exceptions.md#webrtc.exceptions.InvalidRangeError) – If the value set is outside 0 to 4000.
* **Type:**
  [`float`](https://docs.python.org/3/builtins/functions.html#float), optional

#### get_parameters()

Returns the parameters the receiver receives with.

See [MDN: RTCRtpReceiver/getParameters](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/getParameters).

* **Returns:**
  [`webrtc.RTCRtpReceiveParameters`](../models/rtp_parameters.md#webrtc.models.rtp_parameters.RTCRtpReceiveParameters) – The parameters.
* **Return type:**
  [*RTCRtpReceiveParameters*](../models/rtp_parameters.md#webrtc.models.rtp_parameters.RTCRtpReceiveParameters)

#### *static* get_capabilities(kind)

Returns the codecs and header extensions receivers of a kind support.

See [MDN: RTCRtpReceiver/getCapabilities_static](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/getCapabilities_static).

* **Parameters:**
  **kind** ([`webrtc.MediaType`](../enums.md#webrtc.enums.MediaType)) – Audio or video.
* **Returns:**
  [`webrtc.RTCRtpCapabilities`](../models/rtp_parameters.md#webrtc.models.rtp_parameters.RTCRtpCapabilities), optional – The capabilities, or [`None`](https://docs.python.org/3/builtins/constants.html#None) for another kind.
* **Return type:**
  [*RTCRtpCapabilities*](../models/rtp_parameters.md#webrtc.models.rtp_parameters.RTCRtpCapabilities) | None

#### *async* get_stats()

Collects the stats of the receiver and of the objects they refer to.

Calls in the same loop iteration, like those one [`asyncio.gather()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.gather) starts, share one collection.

See [MDN: RTCRtpReceiver/getStats](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/getStats).

* **Returns:**
  [`webrtc.RTCStatsReport`](../models/rtc_stats.md#webrtc.models.rtc_stats.RTCStatsReport) – The stats.
* **Raises:**
  [**webrtc.InvalidStateError**](../exceptions.md#webrtc.exceptions.InvalidStateError) – If the connection is closed.
* **Return type:**
  [*RTCStatsReport*](../models/rtc_stats.md#webrtc.models.rtc_stats.RTCStatsReport)

#### get_synchronization_sources()

Returns the synchronization sources (SSRCs) of the media received in the last 10 seconds.

Calls in the same loop iteration, of this method and [`get_contributing_sources()`](#webrtc.interfaces.rtc_rtp_receiver.RTCRtpReceiver.get_contributing_sources), see the same sources.

See [MDN: RTCRtpReceiver/getSynchronizationSources](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/getSynchronizationSources).

* **Returns:**
  [`list`](https://docs.python.org/3/builtins/stdtypes.html#list) of [`webrtc.RTCRtpSynchronizationSource`](../models/rtp_source.md#webrtc.models.rtp_source.RTCRtpSynchronizationSource) – The sources, the most recent first.
* **Return type:**
  [list](https://docs.python.org/3/builtins/stdtypes.html#list)[[*RTCRtpSynchronizationSource*](../models/rtp_source.md#webrtc.models.rtp_source.RTCRtpSynchronizationSource)]

#### get_contributing_sources()

Returns the contributing sources (CSRCs) of the media received in the last 10 seconds.

These are the original streams a mixer, like a conference server, combined into the received one.
Calls in the same loop iteration, of this method and [`get_synchronization_sources()`](#webrtc.interfaces.rtc_rtp_receiver.RTCRtpReceiver.get_synchronization_sources), see the same sources.

See [MDN: RTCRtpReceiver/getContributingSources](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpReceiver/getContributingSources).

* **Returns:**
  [`list`](https://docs.python.org/3/builtins/stdtypes.html#list) of [`webrtc.RTCRtpContributingSource`](../models/rtp_source.md#webrtc.models.rtp_source.RTCRtpContributingSource) – The sources, the most recent first.
* **Return type:**
  [list](https://docs.python.org/3/builtins/stdtypes.html#list)[[*RTCRtpContributingSource*](../models/rtp_source.md#webrtc.models.rtp_source.RTCRtpContributingSource)]
