-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calls: Introduce simulcast API #20371
base: production
Are you sure you want to change the base?
Conversation
Preview URL: https://3387b898.preview.developers.cloudflare.com |
Some initial quick points: Example 4 is not what we had been discussing. When you push a track the Should we use /track/change or /track/update? Regarding the open question "I REALLY want the RID I just told you, but if the RID is no longer being published, then downgrade. However I'm okay with packet loss with a higher rid I can't handle":
|
This is an oversight from my side. What I mean was new remote track with simulcast capabilities, not local. When you pull a brand new track, there should be an option to specify simulcast options though. We can't just depend on the change endpoint to handle simulcast.
I'm leaning towards erroring because it's a blatant issue with the API definition, push with simulcast doesn't make sense.
I would also prefer PUT at
What if you wanted to ignore all bandwidth estimation changes but keep the changes when a rid disappears entirely? |
Yes when you pull a new track the /track/new endpoint will support the
Okay.
Great. We already have PUT for
Ahh. Yeah I think that scenario highlights your concern if we need two different parameters:
|
Do you agree we have a consensus about the HTTP method and endpoint? curl -X PUT "https://rtc.live.cloudflare.com/v1/apps/YOUR_APP_ID/sessions/e017a2629c754fedc1f7d8587e06d126/tracks/update" |
Regarding the request body I lean towards having schema/TracksRequest for it OR a subset of it that does not include the sdp and autoDiscover fields. TracksRequest/subset should be updated to have the simulcast field The subset could be look like:
and TrackObject should have the recently added simulcast field |
In relation to the simulcast field:
|
This is a first stab at introducing simulcast into the Cloudflare Calls SFU API.
Examples
Example 1: Using the /tracks/change endpoint to reuse a transceiver
This example shows how to reuse an existing transceiver (with mid "2") to receive a different track from a remote session.
Example 2: Using the /tracks/change endpoint with simulcast preferences
This example demonstrates how to reuse a transceiver while specifying simulcast preferences, requesting the high-quality stream ("h") and falling back to the least bandwidth option if that's not available.
Example 3: Changing multiple tracks simultaneously
This example shows how to change multiple tracks in a single request, reusing different transceivers for different remote tracks.
Example 4: Using the /tracks/new endpoint with simulcast
This example demonstrates adding a new local track with simulcast capabilities, specifying the SDP with simulcast attributes and indicating a preference for the high-quality stream.
Example 5: Using the /tracks/change endpoint with a different fallback strategy
This example shows how to request a specific quality level (in this case, the lowest quality "q") with a fallback strategy of "none", which means no fallback will be attempted if the preferred RID is not available.
Open Questions
The following case is not handled: "I REALLY want the RID I just told you, but if the RID is no longer being published, then downgrade. However I'm okay with packet loss with a higher rid I can't handle", because we are using
preferredRidNotAvailable
for both "RID stopped published" and also "you don't have enough bandwidth for this RID"