To properly label VP9 and AV1 video types (bug T382193) and perform tone-mapping for HDR videos (bug T362831) we need to be able to extract additional video metadata that's not always available at the WebM/Matroska level that GetID3's implementation currently checks.
Getting bit depth, colorspace, color matrix, transfer function, and chroma subsampling may require decoding the codec private data field, which is specific to each codec. We need to handle VP9 and AV1 to cover our current set of accepted inputs properly, and should probably consider ensuring that H.264/AVC and H.265/HEVC are also handled for the future (and that these can be handled in MP4/MOV containers).
This work probably belongs upstream in the GetID3 library and I recommend working with upstream to get suitable code placed to return suitable data in the existing code, then we can simply update to using it once released.
Examples: in TimedMediaHandler's tests/phpunit/media should return:
- av1-sdr.webm - 8 bits, 4:2:0, bt709/bt709/bt709
- av1-hdr.webm - 10 bits, 4:2:0, bt2020nc/bt2020/smpte2084
and if the test case for av1-hdr.webm's type detection is enabled, it should return the correct extended codec type (which currently fails if enabled)