w3c / w3c/webcodecs

ColorSpace override is not well defined

Open
#940 16 comments 0 reactions 1 assignee View on GitHub

@dalecurtis is already working on this.

Since Sep 3, 2026.

agenda CR Blocking
Dominant language
HTML
Stars
1.3k
Forks
194
Avg merge
1d 13h
Merged PRs (30d)
3

Description

Video decoders can be given via configure a color space that is used to override the decoder detected color space, as defined in https://w3c.github.io/webcodecs/#output-videoframes.

That said:

  1. The algorithm refers to [[active decoder config]] which is only assigned in constructor to null.
  2. UA support is not very consistent when the provided VideoColorSpaceInit has undefined members.

Wrt point 2, locally testing on a VP9 stream, overriding the whole colorSpace to bt2020/pq/bt2020-ncl leads to consistent results in Chrome and Firefox.
Passing just the transfer with 'PQ' gives bt2020/pq/bt2020-ncl in Chrome but bt709/bt709/bt709 in Firefox.
According my reading of the spec, I would have expected null/pq/null.

I haven't checked funky color space combos, I wonder whether UAs may sanitise somehow these values to meaningful combos.
It would be good to improve the spec and give guidance if we cannot provide mandatory wording.

One possibility is to allow overriding just the fields that are defined in the configure config.
For instance, to support overriding only fullRange.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.