-
Notifications
You must be signed in to change notification settings - Fork 16
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
Face Detection: How metadata should be tied to MediaStreamTrack video frames #70
Comments
1 is probably the easiest approach compared to 2 and is more natural than 3 and 4. |
The current situation with generic metadata in WebCodecs
Absent such a proposal, we are still recommending (3) or (4), passing the metadata out-of-band. I don't think there is strong support for handling face metadata specially, but doing so would be the shortest path to in-band metadata. |
Agreed we need support to clone/postMessage metadata. For instance, we could add steps in the constructor to structure clone the metadata input parameter and the result would be stored in a VideoFrame object slot.
Good point. In terms of spec editing, web codec could define a WebCodecMetadata dictionary, either without any member or containing something like a
+1 @sandersdan , how does this look to you? |
Structured clone by itself doesn't work because it assumes there can be side data (such as ports) in addition to the raw bytes. The It might actually make sense to just drop down to JSON here. I don't think metadata should need to be self-referential, for example.
Yes, this is about the best I was able to come up with as well, and I think it meets the requirements. I like that unlike a partial for VideoFrame, a partial for VideoFrameMetadata would be straightforward to splat.
I think the serialization part needs work before becoming a PR, but it could be at least proposed in the existing bug. Edit: The existing bug is w3c/webcodecs#189. There is a separate bug for |
I could see metadata be an array buffer, in which case JSON is not great.
I think https://html.spec.whatwg.org/multipage/structured-data.html#structuredserialize is what we want.
I do not think we need to expose this to web pages, at least initially. It should be reasonably simple for the web app to set metadata from a VideoFrame to its corresponding chunk. |
Following on #69 and media capture transform, face detection metadata could be made available to mediastreamtrack transforms.
There are a few possibilities we could envision. The following come to mind:
The text was updated successfully, but these errors were encountered: