Page 1 of 1

HDR Metadata output on Decklink 4K Extreme 12G HDMI

PostPosted: Tue Aug 23, 2016 2:14 am
by Siu-Wai Wu
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

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

PostPosted: Mon Aug 29, 2016 10:01 pm
by Matt Jefferson
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.

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

PostPosted: Tue Jun 13, 2017 3:09 pm
by TimLegrand
+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.

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

PostPosted: Wed Jul 12, 2017 3:44 am
by Nicholas Gill
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

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

PostPosted: Mon Mar 26, 2018 8:29 pm
by streambox
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

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

PostPosted: Fri Aug 24, 2018 8:48 am
by hyongmin
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

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

PostPosted: Mon Aug 27, 2018 1:09 am
by Cameron Nichols
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

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

PostPosted: Mon Aug 27, 2018 8:05 am
by hyongmin
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

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

PostPosted: Wed Aug 29, 2018 12:19 am
by Cameron Nichols
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

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

PostPosted: Wed Aug 29, 2018 3:04 am
by hyongmin
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

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

PostPosted: Thu Aug 30, 2018 5:50 am
by hyongmin
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

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

PostPosted: Thu Aug 30, 2018 8:37 am
by Cameron Nichols
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

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

PostPosted: Thu Aug 30, 2018 9:06 am
by hyongmin
Hi Cameron,

Thanks.

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




Yongmin Hou

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

PostPosted: Mon Jun 29, 2020 3:02 am
by wisechoice
Perhaps this has been addressed in an update, because the tech specs for the Mini Monitor 4K now list Rec.2020 as a supported colour space:

Color Space
REC 601, REC 709, REC 2020