HDR Metadata output on Decklink 4K Extreme 12G HDMI

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

Siu-Wai Wu

  • Posts: 1
  • Joined: Tue Aug 23, 2016 1:38 am

HDR Metadata output on Decklink 4K Extreme 12G HDMI

PostTue Aug 23, 2016 2:14 am

Hi,

Can anyone tell me if I can output HDR Metadata (HDR10) on Decklink 4K Extreme 12G HDMI output using Decklink SDK 10.7 (latest)?
In the SDK documentation, I found the interface IDeckLinkVideoFrameMetadataExtensions, but it only has Get methods to query the metadata. I cannot find any "Set" method to set the metadata.
How do I set the HDR metadata to output on HDMI2.0 ?

Thanks,
Siu-Wai Wu
Offline

Matt Jefferson

Blackmagic Design

  • Posts: 130
  • Joined: Fri Aug 31, 2012 12:50 am

Re: HDR Metadata output on Decklink 4K Extreme 12G HDMI

PostMon Aug 29, 2016 10:01 pm

Here is our normal developer support response to HDR output questions using above board.

In order to output HDR metadata, the application will have to implement the IDeckLinkVideoFrame, and additionally IDeckLinkVideoFrameMetadataExtensions interfaces, in a similar way as 3D support requires an application to implement IDeckLinkVideoFrame3DExtensions.

This video frame class which implements the IDeckLinkVideoFrameMetadataExtensions interface may implement additional methods to set the HDR metadata fields as needed.

When scheduling instances of the custom IDeckLinkVideoFrame for playback, the DeckLinkAPI will query the IDeckLinkVideoFrame implementation (via QueryInterface) to determine if it supports the IDeckLinkVideoFrameMetadataExtensions interface, and if QueryInterface is successful (and IDeckLinkVideoFrame::GetFlags reports bmdFrameContainsHDRMetadata), IDeckLinkVideoFrameMetadataExtensions::Get* will be called by the DeckLinkAPI to retrieve the HDR metadata from the IDeckLinkVideoFrame implementation.
Offline

TimLegrand

  • Posts: 3
  • Joined: Wed Apr 27, 2016 3:45 pm

Re: HDR Metadata output on Decklink 4K Extreme 12G HDMI

PostTue Jun 13, 2017 3:09 pm

+1
The documentation seems to deal with getting metadata from video frame objects, not with how to set them.
Please provide an example of output video frame creation with HDR metadata.
Offline

Nicholas Gill

Blackmagic Design

  • Posts: 169
  • Joined: Mon May 04, 2015 10:28 pm

Re: HDR Metadata output on Decklink 4K Extreme 12G HDMI

PostWed Jul 12, 2017 3:44 am

Hi Tim,

As detailed in the response from Matt, an application wanting to generate HDR metadata must implement the required interfaces, IDeckLinkVideoFrame for the general video frame interface, and IDeckLinkVideoFrameMetadataExtensions for the interface which allows the DeckLink API to read HDR metadata from the frame.

This type implemented by the application may provide any interface it desires to the rest of the application to set the HDR metadata, e.g. it could implement a complementary SetInt method, or a struct which encapsulates all the available metadata items, return hard-coded values, etc.

Hope that helps clarify,

-nick
Offline

streambox

  • Posts: 1
  • Joined: Mon Mar 26, 2018 7:31 pm
  • Real Name: Alex Telitsine

Re: HDR Metadata output on Decklink 4K Extreme 12G HDMI

PostMon Mar 26, 2018 8:29 pm

Nicholas Gill wrote:Hi Tim,

This type implemented by the application may provide any interface it desires to the rest of the application to set the HDR metadata, e.g. it could implement a complementary SetInt method, or a struct which encapsulates all the available metadata items, return hard-coded values, etc.

-nick


Nick,
Looking at API 10.9 IDeckLinkVideoFrameMetadataExtensions class
is missing SetInt "complementary SetInt method"

Also, should we be setting bmdFrameContainsHDRMetadata via SetFlags
before we schedule frame for playback or is it for Input only?

Since Resolve has "Enable meta data over HDMI", I assume this interface exists somewhere?

Thanks!
Alex
Offline

hyongmin

  • Posts: 6
  • Joined: Thu Aug 23, 2018 8:22 am
  • Real Name: Hou Yongmin

Re: HDR Metadata output on Decklink 4K Extreme 12G HDMI

PostFri Aug 24, 2018 8:48 am

Hi Nick,

Have you solved your problem?

I have encountered the same problem. I don't know how to enable HDR meta in DeckLink Mini 4K Monitor card.

And I only found the following code in the DeckLinkAPI.h
/* Interface IDeckLinkVideoFrameMetadataExtensions - Optional interface implemented on IDeckLinkVideoFrame to support frame metadata such as HDMI HDR information */

class BMD_PUBLIC IDeckLinkVideoFrameMetadataExtensions : public IUnknown
{
public:
virtual HRESULT GetInt (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ int64_t *value) = 0;
virtual HRESULT GetFloat (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ double *value) = 0;
virtual HRESULT GetFlag (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ bool* value) = 0;
virtual HRESULT GetString (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ const char **value) = 0;

protected:
virtual ~IDeckLinkVideoFrameMetadataExtensions () {} // call Release method to drop reference count
};


I think BM should provide API like SetInt() SetString etc..


Yongmin Hou
Offline

Cameron Nichols

Blackmagic Design

  • Posts: 103
  • Joined: Mon Sep 04, 2017 4:05 am

Re: HDR Metadata output on Decklink 4K Extreme 12G HDMI

PostMon Aug 27, 2018 1:09 am

Hi Yongmin,

The setting of HDR metadata is application defined, so functions such as SetInt, SetFloat are not defined by the DeckLinkAPI. You will need to have HDR metadata available when requested by the DeckLinkAPI via the GetInt/GetFloat functions. The DeckLinkAPI will call these functions in response to IDeckLinkOutput::ScheduleVideoFrame or IDeckLinkOutput::DisplayVideoFrameSync method call. The full list of metadata IDs can be found in the SDK Manual, under 2.7.63 Frame Metadata ID. You should return values for all HDR metadata IDs (excluding Cintel related IDs).

Please refer to Desktop Video developer FAQ page, under topic "How to Output HDR Metadata"
https://www.blackmagicdesign.com/support/faq/59024

We plan to include HDR output samples in a future Desktop Video SDK release.

Regards
Cameron
Offline

hyongmin

  • Posts: 6
  • Joined: Thu Aug 23, 2018 8:22 am
  • Real Name: Hou Yongmin

Re: HDR Metadata output on Decklink 4K Extreme 12G HDMI

PostMon Aug 27, 2018 8:05 am

Hi Cameron,

Thanks to your reply.

Now I implement
1. implemented the IDeckLinkVideoFrameMetadataExtensions 's GetInt() GetFloat() functions which will return correct value of my HDR metadata.
2. implemented the IDeckLinkVideoFrame::GetFlags() which will return "bmdFrameContainsHDRMetadata".
3. implemented QueryInterface(REFIID iid, LPVOID *ppv)
virtual ULONG STDMETHODCALLTYPE AddRef(void) { return ++_refs; }

virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv)
{
//memcmp(&ref1, &ref2, sizeof(REFIID)) == 0;
REFIID HH_Unkown = IID_IUnknown;
REFIID HH_VideoFrame = IID_IDeckLinkVideoFrame;
REFIID HH_Metadata = IID_IDeckLinkVideoFrameMetadataExtensions;

// if (memcmp(&iid, &HH_Unkown,sizeof(REFIID))==0)
// *ppv = static_cast<IDeckLinkVideoFrame*>(this);
// else if (memcmp(&iid, &HH_VideoFrame,sizeof(REFIID))==0)
// *ppv = static_cast<IDeckLinkVideoFrame*>(this);
// else
if (memcmp(&iid, &HH_Metadata,sizeof(REFIID))==0)
*ppv = static_cast<IDeckLinkVideoFrameMetadataExtensions*>(this);
else
{
*ppv = NULL;
return E_NOINTERFACE;
}

this->AddRef();

return S_OK;


}



But when I run my my application it shows that:
"Could not schedule video frame. error 80000003."


What's wrong?


Yongmin Hou
Offline

Cameron Nichols

Blackmagic Design

  • Posts: 103
  • Joined: Mon Sep 04, 2017 4:05 am

Re: HDR Metadata output on Decklink 4K Extreme 12G HDMI

PostWed Aug 29, 2018 12:19 am

Hi Yongmin,

HRESULT = 80000003 translates to E_INVALIDARG. For a video frame implementing IDeckLinkVideoFrameMetadataExtensions, the two most likely reasons for this are:

1) You have not implemented all HDR Metadata IDs as listed in the SDK Manual.

2) The setting for bmdDeckLinkFrameMetadataColorspace ID does not match the video frame.

I would begin by putting a breakpoint inside each of GetInt and GetFloat to determine which BMDDeckLinkFrameMetadataID causes the E_INVALIDARG

Regards
Cameron
Offline

hyongmin

  • Posts: 6
  • Joined: Thu Aug 23, 2018 8:22 am
  • Real Name: Hou Yongmin

Re: HDR Metadata output on Decklink 4K Extreme 12G HDMI

PostWed Aug 29, 2018 3:04 am

Hi Cameron,


Thank you again for your patient.

I found the problem:
when I set the colorspace to "0x32303230" ('2020') it can NOT work.
when I set the colorspace to "0x72373039" ('r709') it works, and my TV can recognize the source is a HDR source.

My question is why '2020' don't work. My data's color space is bt2020.

And I tried to set the bmdDeckLinkConfigRec2020Output to true, but it return failed.

My understanding is that if this Flag is assert the BM card will automatically convert my data's color space from 709 to 2020, is it right?


Yongmin Hou
Offline

hyongmin

  • Posts: 6
  • Joined: Thu Aug 23, 2018 8:22 am
  • Real Name: Hou Yongmin

Re: HDR Metadata output on Decklink 4K Extreme 12G HDMI

PostThu Aug 30, 2018 5:50 am

Hi Cameron,

Any update?

I seems that I am very closing to succeed to output HDR10 metadata through HDMI.

I need to set the colorspace to "0x32303230" ('2020') , but unfortunately it return 0x8000003.

My data is YUV42210 bit, colorspace 2020, EOTF is 2084.


Thanks.

Yongmin Hou
Offline

Cameron Nichols

Blackmagic Design

  • Posts: 103
  • Joined: Mon Sep 04, 2017 4:05 am

Re: HDR Metadata output on Decklink 4K Extreme 12G HDMI

PostThu Aug 30, 2018 8:37 am

Hi Yongmin,

The DeckLink Mini Monitor 4K does not support Rec.2020 colorspace. Please refer to the technical specs from https://www.blackmagicdesign.com/produc ... s/W-DLK-32

You should test attribute BMDDeckLinkSupportsColorspaceMetadata to whether device supports Rec.2020 colorspace output.

Regards
Cameron
Offline

hyongmin

  • Posts: 6
  • Joined: Thu Aug 23, 2018 8:22 am
  • Real Name: Hou Yongmin

Re: HDR Metadata output on Decklink 4K Extreme 12G HDMI

PostThu Aug 30, 2018 9:06 am

Hi Cameron,

Thanks.

It seems we need to buy a "DeckLink 8K Pro" card which is only one support 2020.




Yongmin Hou

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 2 guests