Skip to content
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

Adopt feedback streams in RTCRtpScriptTransformer #90

Open
alvestrand opened this issue Mar 19, 2021 · 6 comments
Open

Adopt feedback streams in RTCRtpScriptTransformer #90

alvestrand opened this issue Mar 19, 2021 · 6 comments
Labels
TPAC 2022 For discussion at TPAC

Comments

@alvestrand
Copy link
Contributor

In some applications, especially those that have the input or output to a transform go somewhere other than the normal path, it is vital that the upstream frame source be informed of other events than just frames being consumed. This may include bandwidth adaptation signals, frame size adaptation signals, or other signals.

In mediacapture-transform, this need is satisfied by control channels.

I propose that we add two more attributes to the ScriptTransformer interface: ReadableStream readableControl and WritableStream writableControl.

@youennf
Copy link
Collaborator

youennf commented Mar 19, 2021

The main use case of the transform API so far is end-to-end encryption. I could see other use cases like appending additional data to a frame. In both cases, we are talking of media being transformed by a sender, sent to a receiver that does the inverse transform to render the (potentially augmented) media.

It would be good to better understand the use cases you have in mind so that we break them down in requirements.
For instance, the use cases I mentioned above do not need 'the input or output to a transform go somewhere other than the normal path'. It would also help understanding what signals we are talking about and the best way to handle them.

Can you share more of the use cases?

@alvestrand
Copy link
Contributor Author

The most obvious exampe is an outgoing stream that is encoded using a WASM or WebCodec encoder, and needs to be decoded using a WASM or WebCodec decoder.
This is an use case that is important for codec agiity - it permits both the introduction of new codecs outside of the global browser release cycle and the support of legacy codecs after browsers have dropped support for them.

In addition to feedback streams, this needs the capacity for telling the browser "don't bother with instantiating encoders/decoders, I'm doing this myself".

@youennf
Copy link
Collaborator

youennf commented Mar 20, 2021

In addition to feedback streams, this needs the capacity for telling the browser "don't bother with instantiating encoders/decoders, I'm doing this myself".

Indeed, the pluggable codec use case seems like an additional API to me which would run prior WebRTC encoded transform in senders, and after in receivers.
For instance, WebRTC encoded transform API is solely based on RTCEncodedVideoFrame/RTCEncodedAudioFrame.
Pluggable codecs will probably also rely on AudioFrame/VideoFrame objects.

I could see some requirements derived for WebRTC encoded transform API from the pluggable codec use case.
For instance, it might be beneficial for encoded transform API to provide ways to read/write RTP headers.

@youennf
Copy link
Collaborator

youennf commented Mar 20, 2021

Also, how would packetizer/depacketizer be handled for new or deprecated codecs? Codec-agnostic packetization?

@alvestrand
Copy link
Contributor Author

Yes, we may have to design a completely new API rather than trying to merge this into the transform-supporting one. Would be great to have some commonality, though.
(There is an AI to merge the WebRTC encoded frame IDL with the webcodec encoded frame IDL. But the sequence of landings didn't let us depend on them at the time.)

@aboba
Copy link
Contributor

aboba commented Jul 11, 2021

@youennf "It would be good to better understand the use cases you have in mind so that we break them down in requirements."

[BA] The uses cases are described in WEBRTC-NV Use Cases. The VR/AR use case may involve substantial additions to the frame size, which is why adaptation to bandwidth or frame size is important.

@aboba aboba added the TPAC 2022 For discussion at TPAC label Sep 2, 2022
alvestrand added a commit that referenced this issue Feb 15, 2024
This rescues the proposal for congestion control that was removed
from the PR that became the keyframe request indication interface.

Partial fix for #90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TPAC 2022 For discussion at TPAC
Projects
None yet
Development

No branches or pull requests

3 participants