Skip to content

Coding Tool configuration #478

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

Closed
aboba opened this issue Mar 31, 2022 · 7 comments · Fixed by #659 or #729
Closed

Coding Tool configuration #478

aboba opened this issue Mar 31, 2022 · 7 comments · Fixed by #659 or #729
Assignees
Labels
extension Interface changes that extend without breaking. Ready for PR

Comments

@aboba
Copy link
Collaborator

aboba commented Mar 31, 2022

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.

@sandersdan
Copy link
Contributor

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
Copy link
Collaborator

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.

unnamed

@chcunningham chcunningham added the extension Interface changes that extend without breaking. label Apr 6, 2022
@aboba
Copy link
Collaborator Author

aboba commented 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
Copy link

marco99zz commented Apr 6, 2022 via email

@Djuffin
Copy link
Contributor

Djuffin commented 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
Copy link
Collaborator Author

aboba commented 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_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?

@aboba aboba self-assigned this Jun 13, 2023
@aboba aboba added the PR exists A PR has been submitted that addresses this issue label Jun 13, 2023
@chrisn
Copy link
Member

chrisn commented Jun 14, 2023

Discussion from Media WG meeting on 13 Jun 2023: minutes and slides.

@Djuffin Djuffin added Ready for PR and removed PR exists A PR has been submitted that addresses this issue labels Jul 19, 2023
@Djuffin Djuffin self-assigned this Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension Interface changes that extend without breaking. Ready for PR
Projects
None yet
6 participants