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
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.
Video decoders can be given via
configurea color space that is used to override the decoder detected color space, as defined in https://w3c.github.io/webcodecs/#output-videoframes.That said:
[[active decoder config]]which is only assigned in constructor to null.VideoColorSpaceInithas undefined members.Wrt point 2, locally testing on a VP9 stream, overriding the whole colorSpace to
bt2020/pq/bt2020-nclleads to consistent results in Chrome and Firefox.Passing just the transfer with 'PQ' gives
bt2020/pq/bt2020-nclin Chrome butbt709/bt709/bt709in 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.