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

add mimeType to metadata #140

Merged
merged 1 commit into from
Oct 12, 2023
Merged

add mimeType to metadata #140

merged 1 commit into from
Oct 12, 2023

Conversation

fippo
Copy link
Collaborator

@fippo fippo commented Jul 26, 2022

since they mapping from payload type to the codec mime type
is nontrivial in environments like workers.

Defined similar to webrtc-stats:
https://w3c.github.io/webrtc-stats/#dom-rtccodecstats-mimetype

Fixes #158


Preview | Diff

@youennf
Copy link
Collaborator

youennf commented Jul 26, 2022

since they mapping from payload type to the codec mime type
is nontrivial in environments like workers.

The mapping should be quite stable so it is reasonably straightforward for web applications to postMessage SDP to script transforms.
Which cases are you thinking of for this API? Or is it just to avoid sending the SDP?

@fippo
Copy link
Collaborator Author

fippo commented Jul 26, 2022

The use-case is codec-adaptive encryption schemes that can differentiate between VP8, VP9 and H264 for example, you will remember this long-standing issue.

Doing a mapping in JS requires parsing SDP and keeping a copy of the SDP around and synchronized in the worker at all times. And would be nontrivial for unbundled cases where you can have more than one codec associated with a payload type (even though I bet this case isn't well defined in stats mimeType).

At the sender side the information what encoder was used is readily available since the frame comes from there. At the receiver side one would assume the same but it turned out to be a bit more complicated to implement.

@alvestrand
Copy link
Contributor

Needs a bug and resolution in the WG.

@fippo
Copy link
Collaborator Author

fippo commented Oct 13, 2022

added a slide to the deck

@alvestrand
Copy link
Contributor

Filed #158 in order to have a corresponding issue.

@fippo
Copy link
Collaborator Author

fippo commented Oct 23, 2022

definition added. Now the definition is rather vague but we can improve that both here and in -stats later.

@aboba
Copy link
Contributor

aboba commented Nov 5, 2022

Resolution from 10-18-2022 WG meeting: "Add mimeType to Metadata".

@solmaks
Copy link

solmaks commented Nov 30, 2022

@youennf , @alvestrand , seems that WG agreed to add mimeType to metadata. Anything preventing from merging this PR?

@alvestrand
Copy link
Contributor

alvestrand commented Dec 1, 2022

biggest hole in spec is whether this is audio/opus (naked mime type) or audio/opus;channels=2;rate=16000;stereo=1 (full mime type, including the info from a=fmtp).

Since I've been in the camp of "naked mime type is incomplete" since forever, I'm of course in the camp of the second option.

@fippo
Copy link
Collaborator Author

fippo commented Dec 1, 2022

At least for use-cases like end-to-end encryption the "raw" mimeType is sufficient, you want to know whether to expect VP8 or H264 (not that we have any specification of the actual behavior of current implementations)

I do agree that having the fmtp would be good in addition.

@alvestrand
Copy link
Contributor

Discussion at December interim was inconclusive on whether we want alignment with WebCodecs (string with parameters), with PeerConnection (base type + fmtp line), or something else.

@alvestrand
Copy link
Contributor

alvestrand commented Jan 26, 2023

Suggestion: Use the same format as RTCRtpCodecCapability (consistency with webrtc-pc).

@fippo
Copy link
Collaborator Author

fippo commented Jan 27, 2023

In that case I suggest not merging this until there is an implementation.

While I understand the desire for consistency I do not see how to satisfy this additional requirement nor do I know what additional problem this solves.

@youennf
Copy link
Collaborator

youennf commented Jan 27, 2023

The suggestion is to stick with a raw mimeType for now, which is what this PR is proposing.
If we later want to expose the fmtp information, we would add a separate sdpFmtpLine member.
How about proposing this at next interim to see whether that reaches consensus?

@fippo fippo force-pushed the mimetype branch 2 times, most recently from c0f1281 to 0e87d9d Compare March 16, 2023 13:03
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
@fippo fippo force-pushed the mimetype branch 2 times, most recently from 2cb275c to 248bee3 Compare April 28, 2023 16:44
@fippo
Copy link
Collaborator Author

fippo commented Apr 28, 2023

Updated.

@alvestrand
Copy link
Contributor

@fippo can you rebase again?

@fippo
Copy link
Collaborator Author

fippo commented Oct 5, 2023

see #204 for validation failures which seem unrelated.

@dontcallmedom
Copy link
Member

#208 would fix the validation error reported by the CI on this PR

@alvestrand
Copy link
Contributor

Somehow this PR now touches "timestamp" in a way that causes the builder to fail.

@dontcallmedom
Copy link
Member

@alvestrand you would have to rebase to get the CI error to disappear

since the mapping from payload type to the codec mime type
is nontrivial in environments like workers.

Defined similar to webrtc-stats:
  https://w3c.github.io/webrtc-stats/#dom-rtccodecstats-mimetype
@fippo
Copy link
Collaborator Author

fippo commented Oct 10, 2023

squashed and rebased

@alvestrand alvestrand merged commit 32f00c2 into w3c:main Oct 12, 2023
2 checks passed
github-actions bot added a commit that referenced this pull request Oct 12, 2023
SHA: 32f00c2
Reason: push, by alvestrand

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@fippo fippo deleted the mimetype branch October 12, 2023 15:03
@fippo fippo mentioned this pull request Nov 14, 2023
fippo added a commit to fippo/webrtc-media-streams that referenced this pull request Nov 14, 2023
With w3c#140 merged it is now actually possible to describe what data is
for a number of codecs that may be supported.
fippo added a commit to fippo/webrtc-media-streams that referenced this pull request Nov 14, 2023
With w3c#140 merged it is now actually possible to describe what data is
for a number of codecs that may be supported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose MIME type as frame metadata
7 participants