w3c / mediacapture-record

MediaStream Recording
https://w3c.github.io/mediacapture-record/
Other
104 stars 21 forks source link

Describe more precisely the handling of disabled tracks #199

Open youennf opened 4 years ago

youennf commented 4 years ago

The spec currently says: If any Track within the MediaStream is muted or not enabled at any time, the UA will only record black frames or silence since that is the content produced by the Track.

While the intent is clear in terms of rendering of the generated data, it is not clear what the encoder should do. webrtc-pc states that one black video frame should be sent per second, given webrtc transmission might be lossy. No audio is sent at all.

It would be nice to describe what should be done more precisely for MediaRecorder. Given recording is not lossy, a single video black frame might be sufficient to record for instance.

guest271314 commented 3 years ago

Is the expected result a "paused" MediaStreamTrack where the resulting video is a single "black frame" when enabled is set to false following start() no matter how long MediaRecorder records before dataavailable (Chromium 85, potentially due to mute event of MediaStreamTrack of kind "video" fired consistently at ~4 seconds), or the resulting video is a series of "black frames" (Firefox 78)?

guest271314 commented 3 years ago

canvas.captureStream(0) and requestFrame() provide means to record either a single frame or multiple frames with enabled.false, depending on the use case, using the appropriate code.