What does keying mean ?
Linear keying is the process of mixing two pictures with a key to obtain a resulting combined picture.
It is also called compositing, mixing, or alpha blending.
A picture is composed of pixels, each one having its own color information stored as RGB or YUV components.
To mix an overlay picture over a background picture, one needs an additional information defining, for each pixel, which quantity of the overlay picture color to take and which quantity of the background picture color to keep. This information is called the key.
In other words, the key also express the opacity of each pixel of the overlay picture. It can also be name the alpha channel.
The key, or alpha information, is often carried on as a grey levels picture, or luminance information, where pure white means opaque and pure black means transparent.
Linear keying is achieved using the following formula applied over each of the color components :
result = background * (1 – alpha) + overlay * alpha
There is second commonly adopted mixing method named the additive mode, in which the alpha information defines how the overlay obscures the background picture.
To use additive blending, the overlay color information must be premultiplied with the key information before being fed to the following formula :
result = overlay + background * (1 – alpha)
Why a hardware keyer is useful?
In video applications using interface cards in a PC, video mixing can be done in software on the CPU or accelerated on the GPU.
There are several drawbacks doing so :
- First, video mixing can be a costly operation in terms of CPU cycles. As a rough figure, processing a UHD (4K60) picture requires handling 530 millions of pixels a second.
- Then, achieving video mixing on the CPU or on the GPU requires to move all that bunch of data from the I/O card to the host memory, to process it, then to move it back to the I/O card. In nowadays video formats, this consumes critical bandwidth on all involved buses.
- And last but not least, all these data travelling though the PC implies several frames of latency between the input and the output, what is not acceptable in most use cases.
Using a hardware keyer, background video is processed onboard with an end-to-end latency shortened to a few dozens of pixels. The host PC only handles the overlay graphics and hence saves lots of CPU cycles and PCIe bandwidth.
The most common use case of a hardware keyer card is obvisouly to perform internal keying, where the card overlays computer graphics over a live video feed.
An important requirement in this use case are the fact that the card implements a failover protection to loop input to output in case of power outage or of application crash, what is typically achieved using bypass relays.
Another typical use case of such a card is where it outputs a fill and a key signal to feed a downstream video mixer.
In both cases, it is important that the card accepts resources formatted in either RGBA 4:4:4:4, the color space commonly adopted in computer graphics, or in YUVK 4:2:2:4, an alternative buffer format requesting less bandwidth and particularly interesting for high resolutions such as 4K.
Besides this, some Deltacast cards support addition use cases, such as acting as a video mixer :
Deltacast hardware keyer cards support additional features to fulfill complex live video mixing applications requirements.
One of them is call the ANC mixer, and is used in conjunction with the video keyer to override ANC and VBI data present in the live feed with other ANC and VBI data coming from the caller application, on a line per line basis. This is particularly useful to implement audio routing, for example.
Another feature dedicated to keyer-based applications is the delay line, which is used to delay the background feed of the keyer by several frames, to allow the application building up overlay graphics or ancillary data (audio or other) based on this feed.
Deltacast cards hosting onboard keyer
|Part number||#inputs||#outputs||#keyers||Max format||Delay line||Bypass relays|
|DELTA-3G-elp-key-d 2K||2||4||2||4K30||yes *||yes **|
|DELTA-3G-elp-key-d 4K||4||8||4||4K60||yes *||yes **|
|DELTA-3G-elp-key-d 22 ***||2||4||2||1080p60||yes||yes|
|DELTA-3G-elp-key-d 44 ***||4||8||4||1080p60||yes||yes|
* Upon VideoMaster version 6.03
** Upon card revision 3.0
*** Q4 2017