You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In codecs such as AV1 there are screen content coding tools that can offer very effective compression for appropriate content.
The question is how these tools can be configured to be used. Screen content coding cannot be on by default since it isn't generally useful. Dynamically recognizing when screen content coding would be helpful seems like it would be complex.
The Content-Hints specification is one way to activate screen content coding (or other encoding optimizations), but the hint is currently not passed along when a MediaStreamTrack is used as input to create a stream of VideoFrames.
Another possibility is to add an attribute to configuration.
Another possibility is to add an attribute to configuration.
Editors call: We favor this option for its simplicity.
I grabbed this screenshot of AV1 coding tools from @marco99zz's RTC@Scale talk. @aboba are these what you had in mind? @marco99zz, can you help me prioritize this list in terms of what should be added to WebCodecs.
We went with per-codec configuration (see #646 )
But I'm thinking that we might want a generic content type hint in the VideoEncoderConfig.
At least OpenH264 and libvpx support such hints.
Within the Screen Content Community Group (SCCG) we had a discussion of what libwebrtc does to optimize screen sharing. It varies quite a bit depending on the codec, but doesn't take Content Hints into account. For video, content hints include "motion", "detail" and "text".
For example, if the track came from a screen share, SCREEN_CONTENT_REAL_TIME is set in Open H.264.
This kind of optimization is implementation-specific, and not defined in the codec specification, so it's not something that we can add to a WebCodecs Codec registry. Would it make sense for WebCodecs to consume "Content Hints" to make this kind of adjustment? Note that this may also be an issue for audio, where "speech" and "music" content-hints are defined.
Maybe this is a subject that we should discuss in the MEDIA WG?
Activity
sandersdan commentedon Mar 31, 2022
This sounds like something I would expect to be a codec-specific configuration parameter.
We also do not currently have a way to request 4:4:4 and RGB encoding, which applies more generally to other codecs.
chcunningham commentedon Apr 6, 2022
Editors call: We favor this option for its simplicity.
I grabbed this screenshot of AV1 coding tools from @marco99zz's RTC@Scale talk. @aboba are these what you had in mind? @marco99zz, can you help me prioritize this list in terms of what should be added to WebCodecs.
aboba commentedon Apr 6, 2022
We have added support for common encoding controls used with screen capture.
PR 662 (merged) turns on Palette mode & Intra BC tools for AV1.
PR 659 (merged) enables per-frame QP for AV1.
Being able to control other coding tools would also be useful.
marco99zz commentedon Apr 6, 2022
Djuffin commentedon May 11, 2023
We went with per-codec configuration (see #646 )
But I'm thinking that we might want a generic content type hint in the VideoEncoderConfig.
At least OpenH264 and libvpx support such hints.
aboba commentedon May 11, 2023
Within the Screen Content Community Group (SCCG) we had a discussion of what libwebrtc does to optimize screen sharing. It varies quite a bit depending on the codec, but doesn't take Content Hints into account. For video, content hints include "motion", "detail" and "text".
For example, if the track came from a screen share,
SCREEN_CONTENT_REAL_TIMEis set in Open H.264.This kind of optimization is implementation-specific, and not defined in the codec specification, so it's not something that we can add to a WebCodecs Codec registry. Would it make sense for WebCodecs to consume "Content Hints" to make this kind of adjustment? Note that this may also be an issue for audio, where "speech" and "music" content-hints are defined.
Maybe this is a subject that we should discuss in the MEDIA WG?
chrisn commentedon Jun 14, 2023
Discussion from Media WG meeting on 13 Jun 2023: minutes and slides.