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

Clarify that all VideoFrameMetadata members are optional #879

Open
jan-ivar opened this issue Feb 5, 2025 · 1 comment
Open

Clarify that all VideoFrameMetadata members are optional #879

jan-ivar opened this issue Feb 5, 2025 · 1 comment

Comments

@jan-ivar
Copy link
Member

jan-ivar commented Feb 5, 2025

The spec says:

dictionary VideoFrameMetadata {
  // Possible members are recorded in the VideoFrame Metadata Registry.
};

But the [webcodecs-video-frame-metadata-registry] does not say whether members are optional or required.

Since dictionary members are optional by default, readers will hopefully infer (correctly) that they're optional, since neither spec mentions required.

Readers might also infer this from VideoFrameInit where metadata is not required, if I'm not mistaken.

Still, it might be good to call this out, since a single required member would mean the VideoFrame constructor would suddenly require this input and no longer be backwards compatible.

@jan-ivar
Copy link
Member Author

jan-ivar commented Feb 5, 2025

This also becomes important as we specify members and their rules for when they should be present or not. VideoFrames can come from different sources, and it currently seems unclear whether all VideoFrames regardless of source are to present with the same metadata members or not.

Since the VideoFrame constructor already lets JS create frames with a subset of metadata, should we suggest a model where each source only provides the metadata relevant to it?

To me, this seems likely to happen anyways. E.g. VideoFrames from cameras might have {backgroundBlur: true|false}, but VideoFrames created from canvas might not.

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