-
Notifications
You must be signed in to change notification settings - Fork 32
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
Should width, height, etc be required or optional in VideoConfiguration? #192
Comments
The API provides info on |
Some context for the discussion. In typical video codecs, the definitions of "levels" (which is signaled in the MIME
This means, for example, that at this level, if the width of the image is 8192, the height cannot be greater than 1088, and at this resolution, the display frame rate cannot be greater than 30fps. Obviously, if you decrease width or height, you can increase the maximum frame rate. The same is true for bitrate. Levels define a maximum bitrate. For example, for AV1 level 5.0, the max bitrate for Main tier is 30Mbps (or 100Mbps for High Tier). |
I made this simple web page to test the Media Capabilities API in various browsers. In my tests, like @aboba said, most of the time However, I've seen cases where even |
Hi @cconcolato, thanks for the simple web page. |
As all of you are saying, the reason to have width, height and framerate is to be able to provide a value for smooth and potentially also powerEfficient. Although there is a relation between codec level and these values it's not uniquely defined and it also differs between codecs. Explicitly specifying width, height, and framerate when needed makes the API easier to use in my opinion. From my understanding, the concern that was raised in the WG meeting, which is also in line with @aboba's comment, is if the API should be possible to use without these values if the user only wants to know if a certain codec and scalabilityMode is supported. |
In Chromium powerEfficient is more or less the same as the codec being supported in hardware. |
|
I agree w/ @cconcolato and @drkron. Let me try to answer @aboba's question directly. @aboba wrote
Any of codec profile, width, height, and scalabilityMode/spatialScalability may break support for hardware encoding/decoding (powerEfficient). They may break support entirely in the event that you lack a software fallback for this codec and combination of parameters. Profile, width, height, framerate and bitrate are considered for performance (smooth) predictions (aside: Chrome currently ignores considers bitrate). If we lack any of these pieces we can't provide smoothness/power info, so we throw a TypeError. Given the above, it's important to provide a real width and height alongside scalabilityMode, even if you're not concerned about power efficiency or smoothness. Looking just at 'supported', you could get away with providing arbitrary values for framerate and bitrate. But most folks probably should care about smoothness and power efficiency (optimize the user experience) , so I recommend providing real values for those parameters too. In the WebRTC meeting it was pointed out that bitrate and framerate are not explicitly controlled by the RTC app (the UA adapts), so it was unclear what users should use. I recommend giving values that represent the best-case scenario for your codec and resolution (i.e. assuming no CPU throttling and network congestion). If you find the config is predicted as smooth=false, try a lower resolution or a different codec. realted: @drkron, I think the spec should clarify the meaning of width and height when scalabilityMode involves spatial scalability. My leaning is to say this is the width and height for the highest spatial layer (max). WDYT?
No plans. UAs typically don't have access to this sort of granular power info.
Partially answered earlier up. For display tech, LTE, ... no plans. Basically powerEfficient = "hardware acceleration", but we avoided calling it that because the power draw for hardware acceleration vs software codecs is roughly equal at lower resolutions for well optimized software codecs. For example, Chrome has plans to return powerEfficient=true for software vp9 decode at <= 360p. |
That's the implicit assumption I would do. Sounds good to clarify that. |
It seems possible for |
Summarizing current state here: I think we're all in agreement. Work that remains is minor updates to non-normative parts of spec to clarify the points below. I'll send a PR (or review one if someone beats me to it :)).
Ack. Will do.
I agree. Spec could do a better job of calling this out. |
Related: w3c/webrtc-svc#49 |
Discussed in 12 April 2022 Media WG meeting: https://www.w3.org/2022/04/12-mediawg-minutes.html#t02 |
We've found cases with bluetooth headsets somehow modifying available audio encoder bitrates on macOS, leading to the default MediaRecorder audio bitrate not being accepted sometimes. It should prove a case for impact on |
There are multiple issues being discussed here, meaning it's unclear what milestone to assign to this issue or how to resolve it. I suggest moving the discussion of new features like To close this issue, I will prepare a PR to clarify the spec per #192 (comment) |
Correction to the above. I think the ask is not for a new feature, but for Chrome to consider
Probably better to file in the Chromium tracker to see how feasible that would be for the headset scenario? |
#236 should address width and height. Should we also add text about |
This issue is created to track the discussion of whether width, height, bitrate, and framerate should be optional or required fields of the VideoConfiguration dictionary. This question was raised at the WebRTC WG meeting on Feb 15.
Although the fields are most likely needed to return a correct value for smooth. Supported and powerEfficient are not dependent on these values to the same extent.
The text was updated successfully, but these errors were encountered: