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

Should a muted video track be allowed to deliver black frames to its sinks? #1011

Open
youennf opened this issue Aug 29, 2024 · 1 comment
Open

Comments

@youennf
Copy link
Contributor

youennf commented Aug 29, 2024

The specification is describing what mute means here:
Live samples MUST NOT be made available to a [MediaStreamTrack](https://w3c.github.io/mediacapture-main/#dom-mediastreamtrack) while it is [muted](https://w3c.github.io/mediacapture-main/#track-muted).

From this definition, it is clear that, whenever a track is said to be muted, it is not expected to provide black frames to any of its sink.
This is JS observable, for instance via rvfc or MediaStreamTrackProcessor.

But the specification also says that:
The result for the consumer is the same in the sense that whenever [MediaStreamTrack](https://w3c.github.io/mediacapture-main/#dom-mediastreamtrack) is muted or disabled (or both) the consumer gets zero-information-content, which means silence for audio and black frames for video.

This might have confused some readers/implementors to think that it is ok to have a live muted track provide black frames to its sinks.
My understanding of the intent of the spec is that sinks should handle the muted signal themselves.
For instance:

  1. video elements should render black. No need for the track to provide black frames.
  2. peer connection should periodically send black frames. Again no need for the the track to provide black frames to the peer connection.

That would mean rvfc or MediaStreamTrackProcessor would not receive any black frame from a muted track.

@youennf
Copy link
Contributor Author

youennf commented Aug 29, 2024

The same question can be asked for enabled=false tracks.
Testing on Chrome and Safari with https://jsfiddle.net/9o57mxg8/, it seems both expose that frames are delivered to the video elements on rvfc (drawing to canvas and probably creation of video frames lead to black).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant