DeckLink SDK - how i supposed to playout sync fill+key?

Do you have questions about Desktop Video, Converters, Routers and Monitoring?
  • Author
  • Message
Offline
User avatar

pal548

  • Posts: 2
  • Joined: Tue Aug 13, 2013 10:13 pm

DeckLink SDK - how i supposed to playout sync fill+key?

PostTue Oct 15, 2013 6:45 am

Hello everyone.

I made an application playing out the image sequences using decklink card. I managed ok with simple playout.

But my goal is to make CG (computer graphics) system, so the keying is nessesary.

SDK pdf gets me confused.
for example it says:

IDecklinkKeyer::SetLevel method
the SetLevel method sets the level that the image is blenden onto the frame.

OK, but which image??? onto what frame??? questions, questions....

i have no idea where to put thе alpha frame?

thx for help, there shoud be simple answer, isn`t it?
Offline
User avatar

Richard Courtney

  • Posts: 347
  • Joined: Wed Aug 22, 2012 2:50 pm

Re: DeckLink SDK - how i supposed to playout sync fill+key?

PostTue Oct 15, 2013 2:41 pm

Depends on what simple really is...
We don't use SD anymore so the example DirectX keyer I have never tried.
If you are intending to key HD video this might help.

You need two channels for HD keying to work with external switchers such as the ATEM.

Separate Key and fill signals from a multichannel Decklink card (such as a DUO) are feed as inputs
to your video production switcher, the ATEM for example.

C# code snipit.....
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++;
}
}
fs.close();
// Loop input stream if an animated TGA sequence

Here each pixel data is read and placed in the fillbuffer. Setting each color value (RGB) to the
alpha makes a grey scale image for the keybuffer.
Offline
User avatar

pal548

  • Posts: 2
  • Joined: Tue Aug 13, 2013 10:13 pm

Re: DeckLink SDK - how i supposed to playout sync fill+key?

PostTue Oct 15, 2013 4:42 pm

rcourtney wrote:Depends on what simple really is...
We don't use SD anymore so the example DirectX keyer I have never tried.
If you are intending to key HD video this might help.

You need two channels for HD keying to work with external switchers such as the ATEM.

Separate Key and fill signals from a multichannel Decklink card (such as a DUO) are feed as inputs
to your video production switcher, the ATEM for example.

C# code snipit.....
.............
Here each pixel data is read and placed in the fillbuffer. Setting each color value (RGB) to the
alpha makes a grey scale image for the keybuffer.

thanks for response, but its not the answer to my qeustion
Separate Key and fill signals from a multichannel Decklink card (such as a DUO) are feed to ATEM ....

NO, i mean there can be both fill and key from one single Decklink HD Extreme. SDK manual says that it`s capable of External HD keying, see page 143.


the question is - i`ve got SDK, i wrote an implementation of ScheduledFrameCompleted callback.
inside this callback i call _IDeckLinkOutput.ScheduleVideoFrame(....) with the frame object with YUV data.
But it is the FILL signal only.

I just dont understand, where a supposed to put the KEY frame each time? :?:

Return to Post Production

Who is online

Users browsing this forum: No registered users and 4 guests