Page 1 of 1

Decklink external keying

PostPosted: Sat Dec 15, 2018 1:24 pm
by Mitra Mahmoodzadeh
Hi,

I need to get separate SD Key and Fill signals using a Decklink card with 2 output channels.


I've read 'Blackmagic Decklink SDK.pdf' and know these:
...
- Call IDeckLinkAttributes::GetFlag using BMDDeckLinkSupportsInternalKeying or BMDDeckLinkSupportsExternalKeying to determine internal / external keying support - Call IDeckLinkAttributes::GetFlag using BMDDeckLinkSupportsHDKeying to determine if keying is supported with high definition video modes. ‚ Create video frames with pixel formats that have alpha channels (such as bmdFormat8BitARGB or bmdFormat8BitBGRA). ‚ IDeckLinkOutput::EnableVideoOutput ‚ Call IDeckLinkKeyer::Enable with FALSE for internal keying or TRUE for external keying ‚ Set a fixed level of blending using IDeckLinkKeyer::SetLevel
...


But after the steps above, I still have two questions:

1 - Should I write image bytes on the chA buffer and Key bytes on the chB ? ( both on CPU!)

OR Should I write only image bytes on the channel A , then Decklink automatically gives the key signal on B ?

2 - Which Decklink cards can do this?

Please help!

Re: Decklink external keying

PostPosted: Mon Dec 17, 2018 6:57 am
by Dave Johnstone
Hi,

As far as I remember, there is only one buffer. You send the frame data in whatever (32bit) format you have selected and the card outputs the key and fill on the appropriate outputs.

The keying support matrix is in the SDK manual for example:

Screen Shot 2018-12-17 at 5.24.18 pm.png
Screen Shot 2018-12-17 at 5.24.18 pm.png (208.25 KiB) Viewed 3437 times

Regards,

Dave.

Re: Decklink external keying

PostPosted: Mon Dec 17, 2018 2:35 pm
by Mitra Mahmoodzadeh
Hi,

Thank you for the reply

I have 2 cards : 1-DeckLink Studio 4K 2 -DeckLink HD Extreme 3D+ , both are in that table.

I got a bit confused Because, as written in the table, DeckLink Studio 4K supports both internal and external keying , but it has only one output channel !!. How can it get separate Key and Fill signals while it has only one output channel?

Re: Decklink external keying

PostPosted: Thu Dec 20, 2018 4:55 am
by Cameron Nichols
Hi Mitra,

For fill-key output, schedule the video frame with either bmdFormat8BitBGRA or bmdFormat8BitARGB pixel formats. The DeckLink hardware will perform the conversion of RGB to YUV for the fill output, and Alpha to Y for the key output.

Regards
Cameron

Re: Decklink external keying

PostPosted: Thu Dec 20, 2018 3:58 pm
by Mitra Mahmoodzadeh
Hi Cameron,

Thanks for your reply

Some of my questions are answered by dear Dave, but I'm so confused , Please Please answer these my questions and let me to understand the FILL/KEY :


1 - As shown in the table above, 'DeckLink Studio 4K' supports both internal and external keying , but it has only one output channel !!. How can it get separate Key and Fill signals while it has only one output channel?



2 - To get separate Key and Fill signals from a 'DeckLink HD Extreme 3D+' should I write bmdFormat8BitBGRA / bmdFormat8BitARGB Fill bytes on o/p A and Key bytes on o/p B like this :
(note: I found this code here,but I want to implement it in c++)
Code: Select all
FileStream fs = new FileStream(FilenameTGA, FileMode.Open, FileAccess.Read);
byte[] ibuffer = new byte[fs.Length];
int bytesread = fs.Read(ibuffer, 0, ibuffer.Length);
index = 0;
// Verify image is 1280x720 and correct TGA format from header/footer not shown

for (uint y = 0; y < 720; y++)
{
for (uint x = 0; x < 1280; x++)
{
pixelindex = (((y * 1280) + x) * 4);
pixel[0] = (byte) ibuffer[pixelindex + 18]; // Blue
pixel[1] = (byte) ibuffer[pixelindex + 19]; // Green
pixel[2] = (byte) ibuffer[pixelindex + 20]; // Red
pixel[3] = (byte) ibuffer[pixelindex + 21]; // Alpha
Marshal.WriteInt32(fillbuffer, index * 4, (Int32)BitConverter.ToInt32(pixel, 0));
// use input's Alpha to generate grey scale
pixel[0] = pixel[3]; // Blue
pixel[1] = pixel[3]; // Green
pixel[2] = pixel[3]; // Red
pixel[3] = (byte) 0xff; // Solid key
Marshal.WriteInt32(keybuffer, index * 4, (Int32)BitConverter.ToInt32(pixel, 0));
index++;
}
}


,Or should I write Fill bytes on o/p A only and the card automatically gives the key signal on o/p B?




3 - Can I use IDeckLinkOutput::ScheduleVideoFrame method instead of IDeckLinkOutput::ScheduleVideoFrame to get fill-key output?

Re: Decklink external keying

PostPosted: Fri Dec 21, 2018 12:34 am
by Dave Johnstone
Hi,

Just create the 32bit bmdFormat8BitBGRA or bmdFormat8BitARGB frame and fill it with the pixel data from your Targa file (remembering to map the TGA pixels as appropriate to your selected format).

As Cameron says, the card will perform the RGBA to YUVA conversion and route the key/fill channels to the hardware outputs.

I think the Decklink Studio 4k being able to output key/fill is a furphy.

Regards,

Dave.

Re: Decklink external keying

PostPosted: Sun Dec 23, 2018 4:16 pm
by Mitra Mahmoodzadeh
Hi Dave ,

Thanks for the reply.

Do you know the answer to my third above question?



I think the Decklink Studio 4k being able to output key/fill is a furphy

My English is not very good (my language is not English) and I do not know the meaning of 'furphy' , you mean that is a rumor? and the Decklink Studio 4k does not support external key? (Are you kidding?) :o

If so, why is it written in the SDK manual?

Re: Decklink external keying

PostPosted: Tue Dec 25, 2018 6:18 pm
by mkhaled
please can someone give a minimal code to output FILL+KEY on DUO2 card ?

Re: Decklink external keying

PostPosted: Wed Dec 26, 2018 11:01 pm
by Dave Johnstone
Hi,

I don't have a Studio 4K card so I can't answer whether it can do key and fill or not. Seeing as it only has one output, I don't see how it can send key/fill separately in the traditional way, perhaps the key is on the second link in 3G Level B.

Maybe someone from BMD can elucidate.

Regards,

Dave.

Re: Decklink external keying

PostPosted: Fri Jan 11, 2019 4:23 am
by Cameron Nichols
Hi Mitra,

External keying is supported on the DeckLink Studio 4K, but as stated in the SDK manual, only SD modes are supported. The connector mapping is
  • Fill - 6G-SDI Output
  • Key - SD-SDI Output (with breakout cable)
Hi Khaled,

Please have a look at the GdiKeyer (Windows) or DeckLinkKeyer (Mac) samples in the DeckLink SDK download.

Regards
Cameron

Re: Decklink external keying

PostPosted: Wed Feb 06, 2019 2:29 pm
by Mitra Mahmoodzadeh
@Cameron,

Thank you very much.

Re: Decklink external keying

PostPosted: Thu Mar 28, 2019 3:39 pm
by dbucha
Hello, witch boards support 4k external keying?

best regards

Re: Decklink external keying

PostPosted: Sun Mar 31, 2019 10:39 pm
by Cameron Nichols
Hi Diego,

In SDK manual, refer to section 2.5.19.1 IDeckLinkKeyer::Enable method for list of devices that support
(a) external keying
(b) keying up to UHD modes

To check which keying display modes are supported by an installed device, you can run DeviceList sample. The sample in the Desktop Video SDK 11.0 release also displays keying modes as a seperate table.

Regards
Cameron