#912: WebCodecs support for AV1 screen content coding tools

Visit on Github.

Opened Oct 26, 2023

Moin moin TAG!

I'm requesting a TAG review of a WebCodecs extension to add support for AV1 screen content coding tools (asked here)

This adds AV1EncoderConfig (a dictionary containing a boolean forceScreenContentTools (a term from the AV1 bitstream spec)) to the VideoEncoderConfig along these lines:

encoder.configure({
  codec: 'av01.0.04M.08',
  width: 1920, height: 1080, bitrate: 2_000_000, framerate: 5, 
  av1: { forceScreenContentTools: true},
}); 

This allows an application to encode “screen content”, in particular presentation slides, in a more efficient way supported by the AV1 codec. This material is typically static, often includes text, a limited set of colors, lots of repetitive content (e.g. straight lines, shapes) for which the encoder can optimize.

See the explainer for a lot of visual examples. This AV1 feature is already supported by WebRTC and enabled for screen sharing MediaStreamTracks so this increases platform consistency.

You should also know that...

How extensibility is handled is probably the more interesting thing to review!

We'd prefer the TAG provide feedback as (please delete all but the desired option): 💬 leave review feedback as a comment in this issue and @-notify @fippo

Discussions

2023-11-13

Minutes

Sangwhan: the codec is there - this adds a feature config dictionary that's specific to AV1...

Yves: secreen content tools...

Sangwhan: screen content coding... and extension for av1?

Yves: if the wg is ok with this then there is no reason to say no.

Sangwhan: only part where we might have comments is ... screen content coding is also available on H.265. What if at some point that were to be supported? That's the point I'm not getting.

Yves: adding a dictionary as paremeters seems good to me...

Yves: also - if you're not supporing screen content tools are you supposed to default to the regular settings or should you "bail out"? It should be the first one - graceful degradation. If you leave the next comment -

sangwhan to leave comment and we'll come back to it at the plenary

2023-11-20

Minutes

Dan: can we close this?

Sangwhan: contenthint is fine - but there seems to be an antipattern -- worried about developer copy-pasting a config from somewhere - which would result in a contradicting set-up. The counter-argument would be "everyone who works on web codecs would know what they're doing" - i think it's bad ergonomics. Force screen content tools. It does an optimization specific for static content... only certain parts get updates... shooting over a presentation... the naming does not tell you that at all. If you say "i am optimizing for smoothness" and for some reason you opt for screen content tools ... Maybe it should at least show a warning - in the developer console?

... Screen content optimizations are also available in other codecs but this terminology is very specific to AV1... I'll write a comment.

Yves: it's fair to have specific optimnization for specific codecs but maybe prefixed?

Sangwhan: maybe an enum? codec config and an enum of possible values... This feature is similar enough between AV1 and HEVC...

Yves: would it do nothing if not supported?

Sangwhan: yes.

Yves: graceful degredation is better than failing.