Decklink external keying

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

Mitra Mahmoodzadeh

  • Posts: 21
  • Joined: Wed Sep 02, 2015 2:45 pm

Decklink external keying

PostSat Dec 15, 2018 1:24 pm

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!
Offline

Dave Johnstone

  • Posts: 220
  • Joined: Mon Dec 08, 2014 11:12 am
  • Location: Adelaide

Re: Decklink external keying

PostMon Dec 17, 2018 6:57 am

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 2385 times

Regards,

Dave.
Freelance Television Broadcast Engineer
and Software Programmer.
Offline

Mitra Mahmoodzadeh

  • Posts: 21
  • Joined: Wed Sep 02, 2015 2:45 pm

Re: Decklink external keying

PostMon Dec 17, 2018 2:35 pm

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?
Offline

Cameron Nichols

Blackmagic Design

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

Re: Decklink external keying

PostThu Dec 20, 2018 4:55 am

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
Offline

Mitra Mahmoodzadeh

  • Posts: 21
  • Joined: Wed Sep 02, 2015 2:45 pm

Re: Decklink external keying

PostThu Dec 20, 2018 3:58 pm

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?
Offline

Dave Johnstone

  • Posts: 220
  • Joined: Mon Dec 08, 2014 11:12 am
  • Location: Adelaide

Re: Decklink external keying

PostFri Dec 21, 2018 12:34 am

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.
Freelance Television Broadcast Engineer
and Software Programmer.
Offline

Mitra Mahmoodzadeh

  • Posts: 21
  • Joined: Wed Sep 02, 2015 2:45 pm

Re: Decklink external keying

PostSun Dec 23, 2018 4:16 pm

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?
Offline

mkhaled

  • Posts: 1
  • Joined: Tue Dec 25, 2018 6:15 pm
  • Real Name: khaled moussa

Re: Decklink external keying

PostTue Dec 25, 2018 6:18 pm

please can someone give a minimal code to output FILL+KEY on DUO2 card ?
Offline

Dave Johnstone

  • Posts: 220
  • Joined: Mon Dec 08, 2014 11:12 am
  • Location: Adelaide

Re: Decklink external keying

PostWed Dec 26, 2018 11:01 pm

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.
Freelance Television Broadcast Engineer
and Software Programmer.
Offline

Cameron Nichols

Blackmagic Design

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

Re: Decklink external keying

PostFri Jan 11, 2019 4:23 am

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
Offline

Mitra Mahmoodzadeh

  • Posts: 21
  • Joined: Wed Sep 02, 2015 2:45 pm

Re: Decklink external keying

PostWed Feb 06, 2019 2:29 pm

@Cameron,

Thank you very much.
Offline

dbucha

  • Posts: 1
  • Joined: Thu Mar 28, 2019 3:38 pm
  • Real Name: Diego Ucha

Re: Decklink external keying

PostThu Mar 28, 2019 3:39 pm

Hello, witch boards support 4k external keying?

best regards
Offline

Cameron Nichols

Blackmagic Design

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

Re: Decklink external keying

PostSun Mar 31, 2019 10:39 pm

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

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 2 guests