Re: [mediacapture-record] mimeType ambiguity: "video/webm;codecs=vp8" means? (#194)

> But does it mean:
> 
> 1. Don't record audio, or

Yes. When affirmative effort is put forth in code to set a `mimeType` at `MediaRecorder` that setting must be controlling, not up to the application to decide what to do. Otherwise `mimeType` could be omitted from the code altogether, which requires less effort than taking the time to set specific properties at the options object.

Firefox can set the [`MediaStreamTrack`](https://www.w3.org/TR/mediacapture-streams/#mediastream) of `kind` `"audio"` internally to `muted` or [`enabled`](https://www.w3.org/TR/mediacapture-streams/#dom-mediastreamtrack-enabled) to `false` for the case of `"video/webm;codecs=vp8"` 

> If any Track within the MediaStream is [muted](https://www.w3.org/TR/mediacapture-streams/#dom-mediastreamtrack-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.

> Chrome fails to include `opus` in the resulting blob type, so that's a bug for sure I think.

Chromium 81 includes `"opus"` in the `Blob` type. 

`Blob`s can  have no type set yet still reference the same underlying data. Would not rely on a `Blob` or `File` type for accurate reflection of the contents of the file at the time of the getting `Blob.type`.

Should Chrome record audio when the author of the code explicitly set `mimeType` omitting an audio codec? From perspective here, no. Should Firefox throw an error when the `MediaStream` set at `MediaRecorder` contains video codec and both video and audio `MediaStreamTrack`s? No. The specification section above provides a means to record the explicitly set codecs, by treating the track as mute or not enabled. 

One case for not treating `mimeType` as explicit and nothing more or less is if the codec were not VP8 (default), but VP9, where the user might have the requirement to use `VP9` instead of VP8, for example, to reduce file size by the difference between the two codecs, while still expecting audio to be default Opus. 

One approach to resolve the potential for ambiguity and opposite yet equally reasonable expectations is to implement constraints similar to `{mimeType:video/webm;codecs=vp8, codecs:"exact /* audio track not recorded */|default/* audio track recorded */"}`. If the tracks are not present, e.g., `{audio:true, video:false}`, `{mimeType:"video/webm;codecs=vp8"}` set to default without an error. Basically, provide some very simple means for the code author to indicate if settings are explicit and not anything else or should revert to default if one or more track and codecs setting and `MediaStreamTrack`s in the `MediaStream` are not uniform.

-- 
GitHub Notification of comment by guest271314
Please view or discuss this issue at https://github.com/w3c/mediacapture-record/issues/194#issuecomment-587319600 using your GitHub account

Received on Tuesday, 18 February 2020 07:29:18 UTC