Skip to content

Coding Tool configuration #478

Closed

Description

@aboba

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.

Activity

  1. sandersdan commented on Mar 31, 2022

    @sandersdan
    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.

  2. chcunningham commented on Apr 6, 2022

    @chcunningham
    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

  3. added
    extension
    on Apr 6, 2022
  4. aboba commented on Apr 6, 2022

    @aboba
    CollaboratorAuthor

    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.

  5. marco99zz commented on Apr 6, 2022

    @marco99zz
  6. Djuffin commented on May 11, 2023

    @Djuffin
    Contributor

    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.

  7. aboba commented on May 11, 2023

    @aboba
    CollaboratorAuthor

    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?

  8. self-assigned this
    on Jun 13, 2023
  9. added
    PR exists
    on Jun 13, 2023
  10. chrisn commented on Jun 14, 2023

    @chrisn
    Member

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

  11. added and removed
    PR exists
    on Jul 19, 2023
  12. self-assigned this
    on Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Ready for PRextension

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions