You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: public/realtime/static/calls-api-2024-05-21.yaml
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -150,7 +150,7 @@ paths:
150
150
simulcast:
151
151
preferredRid: "h"
152
152
priorityOrdering: "asciibetical"
153
-
ridUnavailableStrategy: "nextPriority"
153
+
ridNotAvailabl: "asciibetical"
154
154
security:
155
155
- secret: []
156
156
parameters:
@@ -228,7 +228,7 @@ paths:
228
228
simulcast:
229
229
preferredRid: "h"
230
230
priorityOrdering: "asciibetical"
231
-
ridUnavailableStrategy: "nextPriority"
231
+
ridNotAvailabl: "asciibetical"
232
232
sessionDescription:
233
233
sdp: |
234
234
v=0
@@ -396,7 +396,7 @@ paths:
396
396
simulcast:
397
397
preferredRid: "h"
398
398
priorityOrdering: "asciibetical"
399
-
ridUnavailableStrategy: "nextPriority"
399
+
ridNotAavailable: "asciibetical"
400
400
security:
401
401
- secret: []
402
402
parameters:
@@ -530,13 +530,13 @@ components:
530
530
- asciibetical
531
531
default: none
532
532
description: Controls what happens if there is not enough network resources available to send the preferredRid. 'none' means keep sending even if not enough bandwidth, 'asciibetical' uses a-z order to determine priority where a is most desirable and z is least desirable.
533
-
ridUnavailableStrategy:
533
+
ridNotAvailable:
534
534
type: string
535
535
enum:
536
536
- none
537
-
- nextPriority
537
+
- asciibetical
538
538
default: none
539
-
description: Controls what happens when the rid currently being used or preferredRid is no longer being sent by the publisher. 'none' means do nothing, 'nextPriority' uses the next on the priorityOrdering.
539
+
description: Controls what happens when the rid currently being used or preferredRid is no longer being sent by the publisher. 'none' means do nothing, 'asciibetical' uses the next available layer after sorting the layers a-z.
Copy file name to clipboardExpand all lines: src/content/docs/realtime/simulcast.mdx
+23-24Lines changed: 23 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,11 @@ sidebar:
5
5
order: 8
6
6
---
7
7
8
-
Simulcast is a feature of WebRTC that allows a publisher to send multiple streams of the same media at different qualities. For example, this is useful for scenarios where you want to send a high quality stream for desktop users and a lower quality stream for mobile users.
8
+
Simulcast is a feature of WebRTC that allows a publisher to send multiple video streams of the same media at different qualities. For example, this is useful for scenarios where you want to send a high quality stream for desktop users and a lower quality stream for mobile users.
Simulcast in WebRTC allows a single media source, like a camera or screen share, to be encoded at multiple quality levels and sent simultaneously, which is beneficial for subscribers with varying network conditions and device capabilities. The media source is encoded into multiple streams, each identified by RIDs (RTP Stream Identifiers) for different quality levels, such as low, medium, and high. These simulcast streams are described in the SDP you send to Cloudflare Calls SFU. It's the responsibility of the Cloudflare Calls SFU to ensure that the appropriate quality stream is delivered to each subscriber based on their network conditions and device capabilities.
23
+
Simulcast in WebRTC allows a single video source, like a camera or screen share, to be encoded at multiple quality levels and sent simultaneously, which is beneficial for subscribers with varying network conditions and device capabilities. The video source is encoded into multiple streams, each identified by RIDs (RTP Stream Identifiers) for different quality levels, such as low, medium, and high. These simulcast streams are described in the SDP you send to Cloudflare Realtime SFU. It's the responsibility of the Cloudflare Realtime SFU to ensure that the appropriate quality stream is delivered to each subscriber based on their network conditions and device capabilities.
24
24
25
-
Cloudflare Calls SFU will automatically handle the simulcast configuration based on the SDP you send to it from the publisher. The SFU will then automatically switch between the different quality levels based on the subscriber's network conditions. You can control the quality switching behavior using the `simulcast` configuration object when you send an API call to start pulling a remote track.
25
+
Cloudflare Realtime SFU will automatically handle the simulcast configuration based on the SDP you send to it from the publisher. The SFU will then automatically switch between the different quality levels based on the subscriber's network conditions, or the qaulity level can be controlled manually via the API. You can control the quality switching behavior using the `simulcast` configuration object when you send an API call to start pulling a remote track.
26
26
27
27
### Quality Control
28
28
29
29
The `simulcast` configuration object in the API call when you start pulling a remote track allows you to specify:
30
30
31
-
-`preferredRid`: The preferred stream (RID for the simulcast stream. [RIDs can be specified by the publisher.](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/setParameters#encodings))
32
-
-`priorityOrdering`: Controls how the SFU handles bandwidth constraints
33
-
-`none`: Keep sending the preferred layer even if there's not enough bandwidth
34
-
-`asciibetical`: Use alphabetical ordering (a-z) to determine priority, where 'a' is most desirable and 'z' is least desirable
35
-
-`ridUnavailableStrategy`: Controls what happens when the preferred RID is no longer available, for example when the publisher stops sending it
36
-
37
-
-`none`: Do nothing
38
-
-`nextPriority`: Switch to the next available RID based on the priority ordering
31
+
-`preferredRid`: The preferred quality level for the video stream (RID for the simulcast stream. [RIDs can be specified by the publisher.](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/setParameters#encodings))
32
+
-`priorityOrdering`: Controls how the SFU handles bandwidth constraints.
33
+
-`none`: Keep sending the preferred layer, set via the preferredRid, even if there's not enough bandwidth.
34
+
-`asciibetical`: Use alphabetical ordering (a-z) to determine priority, where 'a' is most desirable and 'z' is least desirable.
35
+
-`ridNotAvailable`: Controls what happens when the preferred RID is no longer available, for example when the publisher stops sending it.
36
+
-`none`: Do nothing.
37
+
-`asciibetical`: Switch to the next available RID based on the priority ordering, where 'a' is most desirable and 'z' is least desirable.
39
38
40
39
You will likely want to order the asciibetical RIDs based on your desired metric, such as higest resoltion to lowest or highest bandwidth to lowest.
41
40
42
41
### Bandwidth Management across media tracks
43
42
44
-
Cloudflare Calls treats all media tracks equally at the transport level. For example, if you have multiple video tracks (cameras, screen shares, etc.), they all have equal priority for bandwidth allocation. This means:
43
+
Cloudflare Realtime treats all media tracks equally at the transport level. For example, if you have multiple video tracks (cameras, screen shares, etc.), they all have equal priority for bandwidth allocation. This means:
45
44
46
45
1. Each track's simulcast configuration is handled independently
47
46
1. The SFU performs automatic bandwidth estimation and layer switching based on network conditions independently for each track
@@ -50,9 +49,8 @@ Cloudflare Calls treats all media tracks equally at the transport level. For exa
50
49
51
50
When a layer switch is requested (through updating `preferredRid`) with the `/tracks/update` API:
52
51
53
-
1. The SFU will automatically generate a Picture Loss Indication (PLI)
54
-
2. Layer switching only occurs when a keyframe arrives on the target layer
55
-
3. PLI generation is debounced to prevent excessive requests
52
+
1. The SFU will automatically generate a Full Intraframe Request (FIR)
53
+
2. PLI generation is debounced to prevent excessive requests
56
54
57
55
### Publisher Configuration
58
56
@@ -65,23 +63,24 @@ a=rid:h send
65
63
a=rid:q send
66
64
```
67
65
68
-
You can include these by specifying `sendEncodings` when creating the transceiver:
66
+
If the publisher endpoint is a browser you can include these by specifying `sendEncodings` when creating the transceiver like this:
Here's an example of how to use simulcast with Cloudflare Calls:
80
+
Here's an example of how to use simulcast with Cloudflare Realtime:
82
81
83
82
1. Create a new local track with simulcast configuration. There should be a section in the SDP with `a=simulcast:send`.
84
-
2. Use the [Cloudflare Calls API](/calls/https-api) to push this local track, by calling the /tracks/new endpoint.
85
-
3. Use the [Cloudflare Calls API](/calls/https-api) to start pulling a remote track (from another browser or device), by calling the /tracks/new endpoint and specifying the `simulcast` configuration object along with the remote track ID you get from step 2.
83
+
2. Use the [Cloudflare Realtime API](/realtime/https-api) to push this local track, by calling the /tracks/new endpoint.
84
+
3. Use the [Cloudflare Realtime API](/realtime/https-api) to start pulling a remote track (from another browser or device), by calling the /tracks/new endpoint and specifying the `simulcast` configuration object along with the remote track ID you get from step 2.
86
85
87
-
For more examples, check out the [Calls Examples GitHub repository](https://github.com/cloudflare/calls-examples/tree/main/simulcast).
86
+
For more examples, check out the [Realtime Examples GitHub repository](https://github.com/cloudflare/calls-examples/tree/main/simulcast).
0 commit comments