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
{{ message }}
Repository navigation
Commit 0b8b0e6
Browse filesBrowse the repository at this point in the historyBrowse files
The characters 0 to 9, A to D, `#` and `*` are tones, and a comma is a pause of 2 seconds. What happens to queued and stopped tones is described under [Details](#dtmf-tones), and the [DTMF Sender](/guide/audio/dtmf-sender) guide has more.
136
136
137
+
## Simulcast
138
+
139
+
With simulcast, a video track is sent in several layers at once, each at its own resolution and bitrate. A server that forwards the stream, such as an SFU, then gives each receiver the layer its connection takes. Each layer has an RTP stream id, its `rid`:
`Simulcast.standard()` gives three layers in full, half and quarter resolution, with the rids `f`, `h` and `q`.
150
+
151
+
`configure(rid, encoding)` changes one layer, and `configure(encoding)` every layer alike. A server may ask the sender to pause the layers no receiver wants:
152
+
153
+
```java
154
+
sender.configure("f", Encoding.builder().active(false).build()); // stop sending full resolution
155
+
sender.configure("f", Encoding.builder().active(true).build()); // and start again
156
+
```
157
+
158
+
`rids()` lists the layers of a sender, in their order.
159
+
137
160
## Switching Cameras
138
161
139
162
A `LocalCamera` switches to another camera without renegotiating. Every peer that sends it keeps sending it, and preview handlers keep getting frames:
@@ -184,6 +207,14 @@ If the thread stalls, as in a long garbage collection pause, it makes up for at
184
207
- A video sender, or a sender whose remote peer accepts no telephone events, fails the future with an `IllegalStateException`.
185
208
- So do tones that WebRTC stops sending midway, for example because the sender was paused with `configure`. The future then fails a few seconds after their planned end.
186
209
210
+
### Simulcast Layers
211
+
212
+
- A simulcast takes two or three layers, the most WebRTC sends.
213
+
- A rid has 1 to 16 letters and digits, and is unique among the layers. It cannot change once the track is added.
214
+
- Only video tracks take simulcast. `addTrack` throws an `IllegalArgumentException` for an audio track.
215
+
- A remote peer without simulcast leaves it out of its answer and gets only the first layer. A plain WebRTC peer, such as another `Peer`, is one of them.
216
+
-`configure(rid, encoding)` throws an `IllegalArgumentException` for a rid the sender does not have.
217
+
187
218
### When a Camera Switch Fails
188
219
189
220
- If the new camera cannot be opened, the future fails with a `MediaException`, and the track keeps sending the camera it had.
Copy file name to clipboardExpand all lines: docs/guide/client/whip-whep.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,7 @@ Whip.Session live = Whip.to(URI.create("https://example.com/live/whip"))
95
95
.get(15, TimeUnit.SECONDS);
96
96
```
97
97
98
-
Simulcast needs a video track. `Sender.configure` on its sender changes every layer alike.
98
+
Simulcast needs a video track. `Sender.configure(Encoding)` on its sender changes every layer alike, and `configure(rid, Encoding)` one layer. Simulcast outside WHIP is described under [Simulcast](/guide/client/sending-media#simulcast).
0 commit comments