Medialooks Knowledge Base Support Center

Contact Us

Keying support

There are 2 types of keying supported by output devices: internal keying and external keying.

In internal keying mode, an external software or stream will set the Blackmagic card to superimpose the graphics over incoming signal:

To add graphic overlays in internal keying mode you should:

  1. Set color space of playlist to ARGB32,
  2. Set your output resolution equal to your input resolution,
  3. Make your frames transparent either by setting a source object background to "transparent" (for MPlatform SDK) or by converting them to ARGB32 color space (for MFormats SDK).
  4. Set internal keying mode for MRenderer or MFRenderer object.

In external keying mode, an external software or stream sets the Blackmagic card to generate video and key SDI signals and the keying is made by an external keyer:

Requirements for external keying are the same: transparent background, equal input and output resolutions, and ARGB32 color space.

Fill and Key modes

We added a couple of extra modes for output devices - 'fill' and 'key' to emulate keying modes on devices that do not support this feature by design.

When you set "keying" to "fill" a device outputs only RGB component of the original image. With "key" it outputs only alpha component.

Configuring keying with code

MFormats SDK

// specify FCC for MFFrames
m_avProps.vidProps.fccType = eMFCC.eMFCC_ARGB32

// grab a frame from a source
MFFrame frame;
m_objReader.SourceFrameConvertedGetByNumber(ref m_avProps, -1, -1, out frame, "");
                   

//Create new instance for a renderer
MFRendererClass pDevice = new MFRendererClass();
//Configure new renerer and set it to the 1st available
pDevice.DeviceSet(eMFDeviceType.eMFDT_Video, 0, "");

// Get amount of keying options for the device
string strNameKeying;
string value;
int nCount;
pDevice.PropsOptionGetCount(_type, out nCount);
for (int i = 0; i < nCount; i++)
{
    string strXML = string.Empty;
    try
    {
        pDevice.PropsOptionGetByIndex("keying", i, out strNameKeying, out strXML);
        if (strNameKeying == "internal")
        {
        pDevice.PropsOptionSetByIndex("keying", i);
        break;
        }
    }
    catch (Exception)
    {
    }
}

// output the frame to the device
pDevice.ReceiverFramePut(frame, -1, "");

MPlatform SDK

// Specify ARGB32 color space
M_VID_PROPS vidProps = new M_VID_PROPS();
string strFormat;
myPlaylist.FormatVideoGetByIndex(eMFormatType.eMFT_Convert, 15, out vidProps, out strFormat);
//Set output format
vidProps.fccType = eMFCC.eMFCC_ARGB32;
myPlaylist.FormatVideoSet(eMFormatType.eMFT_Convert, ref vidProps);

// Set "transparent" background for a playlist object
MItem bgItem;
myPlaylist.PlaylistBackgroundSet(null, "transparent", "", out bgItem);

//Initialize object
MRendererClass pRender = new MRendererClass();

//Set required device name for rendering
pRender.DeviceSet("renderer", "DeckLink SDI", "");

//Set internal keying feature
pRenderer.DeviceSet("renderer::keying", "internal", "");

//start output
pRenderer.ObjectStart(myPlaylist);

Which devices support keying

Blackmagic Design

  Device
  Internal
  External
  HD Keying
 4K Keying
Intensity Extreme
No
No
No
No
Intensity Pro
No
No
No
No
Intensity Shuttle
No
No
No
No
Decklink 4K Extreme
Yes
Yes
Yes
No
Decklink 4K Extreme 12G
Yes
Yes
Yes
Yes
Decklink 4K Pro
Yes
Yes
Yes
Yes
Decklink Duo
Yes
No
No
No
Decklink Duo 2
Yes
Yes
Yes
No
Decklink HD Extreme
Yes
Yes
Yes
No
Decklink HD Extreme 3D
Yes
Yes
Yes
No
Decklink Mini Monitor
No
No
No
No
Decklink Mini Recorder
No
No
No
No
Decklink Optical Fibre
Yes
No
No
No
Decklink Quad
Yes
No
No
No
Decklink Quad 2
Yes
Yes
Yes
No
Decklink SDI 4K
Yes
No
Yes
No
Decklink SDI
Yes
No
No
No
Decklink Studio 4K
Yes
Yes
Yes
No
UltraStudio 3D
Yes
Yes
Yes
No
UltraStudio 4K
Yes
Yes
Yes
No
UltraStudio 4K Extreme (12G)
Yes
Yes
Yes
Yes
UltraStudio Express
No
No
No
No
UltraStudio Mini Monitor
No
No
No
No
UltraStudio Mini Recorder
No
No
No
No
UltraStudio Pro
Yes
Yes
No
No
UltraStudio SDI
No
No
No
No