2.4.8 Keying¶
Alpha keying allows an application to either superimpose a key frame over an incoming video feed (internal keying) or to send fill and key to an external keyer (external keying). The alpha keying functionality is supported on certain DeckLink models.
For an example of using the keying functionality please refer to GdiKeyer sample application in the DeckLink SDK.
An application performing keying should use the following steps:
Call
IDeckLinkProfileAttributes::GetFlag()
usingBMDDeckLinkSupportsInternalKeying
orBMDDeckLinkSupportsExternalKeying
to check that the DeckLink hardware supports internal/external keying.Call
IDeckLinkOutput::DoesSupportVideoMode()
with supported video mode flagbmdSupportedVideoModeKeying
to check if the combination of the video mode and pixel format is supported for keying.Create video frames with pixel formats that have alpha channels (such as
bmdFormat8BitARGB
,bmdFormat8BitBGRA
orbmdFormat10BitYUVA
).Call
IDeckLinkKeyer::Enable()
with FALSE for internal keying or TRUE for external keying.Set a fixed level of blending using
IDeckLinkKeyer::SetLevel()
.Alternatively set ramp up or down blending using
IDeckLinkKeyer::RampUp()
orIDeckLinkKeyer::RampDown()
.The level of blending of each pixel will depend on the value in the alpha channel and the keying level setting.
Pre-roll video frames using
IDeckLinkOutput::ScheduleVideoFrame()
.While playback is running schedule video frames from
DeckLinkVideoOutputCallback::ScheduledFrameCompleted()
.
When playback has finished: