2.4.12 HDR Functionality¶
HDR capture and playback is supported by certain DeckLink devices such as the DeckLink 4K Extreme 12G. The IDeckLinkVideoFrameMetadataExtensions
object interface provides methods to query metadata associated with a video frame. The IDeckLinkVideoFrameMutableMetadataExtensions
object interface provides methods to set metadata items associated with a video frame.
2.4.12.1 CEA/SMPTE Static HDR Capture¶
When capturing CEA Static HDR Metadata from an HDMI source, an application should first write to the HDMI EDID with the supported dynamic range standards. This can be achieved with the following steps:
Obtain a reference to the
IDeckLinkHDMIInputEDID
interface fromIDeckLink
viaIUnknown::QueryInterface()
.Configure the supported dynamic range standards by calling
IDeckLinkHDMIInputEDID::SetInt()
with configuration itembmdDeckLinkHDMIInputEDIDDynamicRange
with one or more values defined byBMDDynamicRange
.Write the supported dynamic range EDID value to DeckLink hardware by calling
IDeckLinkHDMIInputEDID::WriteToEDID()
.
An application performing capture of video frames with CEA/SMPTE Static HDR Metadata should perform the following steps:
Check that CEA/SMPTE Static HDR metadata is supported by the target by calling
IDeckLinkProfileAttributes::GetFlag()
with attributeBMDDeckLinkSupportsHDRMetadata
.
While streams are running:
Receive calls to
IDeckLinkInputCallback::VideoInputFrameArrived()
.
Inside the callback:
Check that video frame has HDR Metadata by ensuring
IDeckLinkVideoFrame::GetFlags()
hasbmdFrameContainsHDRMetadata
flag.Call
IUnknown::QueryInterface()
on theIDeckLinkVideoInputFrame
object with IID_IDeckLinkVideoFrameMetadataExtensions.IDeckLinkVideoFrameMetadataExtensions::Get* methods can be called to access HDR Metadata items. See
BMDDeckLinkFrameMetadataID
enumerator for a full list of supported HDR Metadata items.The
IDeckLinkVideoFrameMetadataExtensions
object must be released by the caller when no longer required.
2.4.12.2 CEA/SMPTE Static HDR Playback¶
In order to output CEA/SMPTE Static HDR metadata, your application can either provide the API with a custom video frame metadata object which implements the IDeckLinkVideoFrameMetadataExtensions
interface, or by setting each metadata item on the IDeckLinkVideoFrameMutableMetadataExtensions
interface associated with the IDeckLinkVideoFrame
interface.
An application performing output with CEA/SMPTE Static HDR metadata should perform the following steps:
Check that CEA/SMPTE Static HDR metadata is supported by the target by calling
IDeckLinkProfileAttributes::GetFlag()
with attributeBMDDeckLinkSupportsHDRMetadata
.
Create a video frame for output:
Call either
IDeckLinkOutput::CreateVideoFrame()
orIDeckLinkOutput::CreateVideoFrameWithBuffer()
, revealing the presence of HDR metadata by setting frame flagbmdFrameContainsHDRMetadata
.
An application can set frame metadata directly to the output frame with the following steps:
Obtain a reference to the
IDeckLinkVideoFrameMutableMetadataExtensions
interface fromIDeckLinkMutableVideoFrame
viaIUnknown::QueryInterface()
.Call IDeckLinkVideoFrameMutableMetadataExtensions::Set* methods to set HDR metadata items. See
BMDDeckLinkFrameMetadataID
enumerator for a full list of supported HDR metadata items.
While more frames or audio need to be pre-rolled:
Output the video frame with
IDeckLinkOutput::ScheduleVideoFrame()
.
When sufficient frames have been pre-rolled:
While playback is running:
Schedule more custom video frames from
IDeckLinkVideoOutputCallback::ScheduledFrameCompleted()
.
Tip
Instead of accessing the IDeckLinkVideoFrameMutableMetadataExtensions
interface, applications can provide queryable frame metadata to the API by implementing the IDeckLinkVideoFrameMetadataExtensions
interface and associating to the output video frame by calling IDeckLinkMutableVideoFrame::SetInterfaceProvider()
.
2.4.12.3 Dolby Vision® Playback¶
In order to output Dolby Vision, applications must provide video frames that specify Dolby Vision metadata. This can be achieved with the following steps:
Call either
IDeckLinkOutput::CreateVideoFrame()
orIDeckLinkOutput::CreateVideoFrameWithBuffer()
, revealing the presence of Dolby Vision metadata by setting frame flagbmdFrameContainsDolbyVisionMetadata
.Obtain a reference to the
IDeckLinkVideoFrameMutableMetadataExtensions
interface fromIDeckLinkMutableVideoFrame
viaIUnknown::QueryInterface()
.Provide the Dolby Vision metadata by calling
IDeckLinkVideoFrameMutableMetadataExtensions::SetBytes()
with the metadata ID parameterbmdDeckLinkFrameMetadataDolbyVision
. Desktop Video implements Dolby Vision HDMI Transmission, it does not however depend upon the structure of this data. Details concerning the structure can be found in the Dolby Vision Display Management metadata specification by contacting Dolby.Provides the frame colorspace by calling
IDeckLinkVideoFrameMutableMetadataExtensions::SetInt()
with the metadata ID parameterbmdDeckLinkFrameMetadataColorspace
.
An application performing output with Dolby Vision should perform the following steps:
Check that the supported Dolby Vision version of the connected HDMI sink is compatible with the Dolby Vision metadata by calling
IDeckLinkStatus::GetFloat()
with status itembmdDeckLinkStatusSinkSupportsDolbyVision
.Check if Dolby Vision is supported for the desired video mode with
IDeckLinkOutput::DoesSupportVideoMode()
called withbmdSupportedVideoModeDolbyVision
.Configure the source colorspace of the output conversion pipeline by calling
IDeckLinkConfiguration::SetInt()
with configuration itembmdDeckLinkConfigVideoOutputConversionColorspaceSource
with aBMDColorspace
value that matches the colorspace of the output frame.Configure the destination colorspace of the output conversion pipeline by calling
IDeckLinkConfiguration::SetInt()
with configuration itembmdDeckLinkConfigVideoOutputConversionColorspaceDestination
withbmdColorspaceDolbyVisionNative
.Configure the Dolby Vision Content Mapping version by calling
IDeckLinkConfiguration::SetFloat()
with configuration itembmdDeckLinkConfigDolbyVisionCMVersion
.Configure the Dolby Vision mastering monitor luminance by calling
IDeckLinkConfiguration::SetFloat()
with configuration itemsbmdDeckLinkConfigDolbyVisionMasterMinimumNits
andbmdDeckLinkConfigDolbyVisionMasterMaximumNits
.Call
IDeckLinkOutput::EnableVideoOutput()
with video output flagbmdVideoOutputDolbyVision
. The output will switch to Dolby Vision once the first frame is displayed.If output callbacks are required, call
IDeckLinkOutput::SetScheduledFrameCompletionCallback()
with a class that implementsIDeckLinkVideoOutputCallback
.
While more frames or audio need to be pre-rolled:
Output the created video frames with
IDeckLinkOutput::ScheduleVideoFrame()
.
When sufficient frames have been pre-rolled:
While playback is running:
Schedule more video frames with
IDeckLinkOutput::ScheduleVideoFrame()
. This can be called within theIDeckLinkVideoOutputCallback::ScheduledFrameCompleted()
callback context or otherwise.
Dolby, Dolby Vision, and the double-D symbol are registered trademarks of Dolby Laboratories Licensing Corporation.