ColorSpace override is not well defined
@dalecurtis is already working on this.
Since Sep 3, 2026.
- 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:
- The algorithm refers to
[[active decoder config]]which is only assigned in constructor to null. - UA support is not very consistent when the provided
VideoColorSpaceInithas 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.