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

[TrackConfiguration] Why not reuse WebCodec's configuration dictionaries? #98

Open
dalecurtis opened this issue Jun 6, 2023 · 5 comments

Comments

@dalecurtis
Copy link

Instead of implementing new AudioTrackConfiguration and VideoTrackConfiguration dictionaries, can the corresponding AudioDecoderConfig and VideoDecoderConfig dictionaries from WebCodecs be reused?

The top requests we've gotten from developers are:

  • What the heck is a codec string?
  • How do I fill in AVC/HEVC description fields?

As a stop gap to providing a containers API, having this information available via tracks seems helpful.

Thanks for suggesting the API!

@jernoble
Copy link
Contributor

jernoble commented Jun 6, 2023

I considered re-using AudioDecoderConfig and VideoDecoderConfig, but wanted to add framerate and bitrate fields.

The former is useful information to extract from a stream for displaying and validation, and the latter is useful for use with the MediaCapabilities' decodingInfo().

Perhaps rather than specifying this property as an interface, it could just be a dictionary. Then the underlying type matters less.

@jernoble
Copy link
Contributor

jernoble commented Jun 6, 2023

So the one "conflict" between the two dictionaries is width and height in VideoTrackConfiguration vs codedWidth and codedHeight in VideoDecoderConfig. But codedWidth may include non-visible padding, and doesn't account for non-square pixels, whereas width (currently) declares the visible video dimensions. Maybe it's worth exposing both, but I don't think it's a matter of just replacing width with codedWidth.

@jernoble
Copy link
Contributor

jernoble commented Jun 6, 2023

Come to think of it, the VideoTrackConfiguration shares more with visibleRect from VideoFrame than it does with VideoDecoderConfig.

@dalecurtis
Copy link
Author

Ah, yeah I forgot about the visible rect / coded size / aspect ratio. They definitely aren't interchangeable and authors are more likely to want to know the visibleRect rather than being forced to calculate it.

+1 to a dictionary type, but you've convinced me just using the decoder config directly is more trouble than it's worth. Thanks for your consideration! Feel free to close if you're also convinced.

jernoble added a commit to jernoble/explainers that referenced this issue Jun 6, 2023
Partially address Issue WebKit#98 by making the configuration objects `dictionary` types rather than `interfaces.
hober pushed a commit that referenced this issue Jun 7, 2023
Partially address Issue #98 by making the configuration objects `dictionary` types rather than `interfaces.
@jernoble
Copy link
Contributor

jernoble commented Jun 7, 2023

Okay, landed the change to use a dictionary type rather than interface. Given this and @dalecurtis 's comment above, suggest closing this issue as fixed.

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

2 participants