A couple of weeks ago I implemented support for static HDR10 metadata in the
decklinkvideosink
and decklinkvideosrc
elements for Blackmagic video capture
and playout devices. The culmination of this work is available from
MR 7124 - decklink: add support for HDR output and input
This adds support for both PQ and HLG HDR alongside some improvements in colorimetry negotiation. Static HDR metadata in GStreamer is conveyed through caps.
The first part of this is the 'colorimetry' field in video/x-raw
caps.
decklinkvideosink
and decklinkvideosrc
now support the colorimetry values
'bt601', 'bt709', 'bt2020', 'bt2100-hlg', and 'bt2100-pq' for any resolution.
Previously the colorimetry used was fixed based on the resolution of the video
frames being sent or received. With some glue code, the colorimetry is now
retrieved from the Decklink API and the Decklink API can ask us for the
colorimetry of the submitted video frame. Arbitrary colorimetry support is not
supported on all Decklink devices and we fallback to the previous fixed list
based on frame resolution when not supported.
Support for HDR metadata is a separate feature flag in the Decklink API and may or may not be present independent of Decklink's arbitrary colour space support. If the Decklink device does not support HDR metadata, then the colorimetry values 'bt2100-hlg', and 'bt2100-pq' are not supported.
In the case of HLG, all that is necessary is to provide information that the HLG gamma transfer function is being used. Nothing else is required.
In the case of PQ HDR, in addition to providing Decklink with the correct gamma transfer function, Decklink also needs some other metadata conveyed in the caps in the form of the 'mastering-display-info' and 'light-content-level' fields. With some support from GstVideoMasteringDisplayInfo, and GstVideoContentLightLevel the relevant information signalled to Decklink and can be retrieved from each individual video frame.