Jump to content

Video with transparency

From SpinetiX Wiki

Applies to DSOS players, except for HMP300 and DiVA, with SYSTEMS Feature Set.

Introduction

Video with transparency is a special feature that enables unique scenarios of virtual advertisement, where a partially transparent video is displayed on top of a background, which can be an image, another video, a live-streaming video, or even dynamic data-driven content, like shown in the inspirational clips below. This works by combining the source video with a mask video, resulting in a video with transparent areas.

Alpha blending

Alpha blending is the process of combining a translucent foreground color with a background color, thereby producing a new blended color. The degree of the foreground color's translucency may range from completely transparent to completely opaque. If the foreground color is completely transparent, the blended color will be the background color. Conversely, if it is completely opaque, the blended color will be the foreground color. The translucency can range between these extremes, in which case the blended color is computed as a weighted average of the foreground and background colors.

Transparency for images is achieved through by storing additional data in the alpha channel with a value between 0 and 1. A value of 0 means that the pixel is fully transparent; a value of 1 means that the pixel is opaque.

Mask video

Alpha blending on video

We have taken the alpha blending principle and extended it to video rendering. To render specific regions of the source video translucent or fully transparent, it is necessary to generate a black-and-white "mask" video that specifies the pixel transparencies. In this context, black means fully transparent, white means fully opaque, and shades of gray indicate partial transparency. This should be rather easy for someone used to video editing software, like Adobe Premiere.

Upon rendering, the information from the mask video is used to determine the degree of transparency of the pixels from the source video.

Ideally, the mask video should have the same resolution as the main video. However, if the original video is already at the maximum resolution that the player can decode, then the mask video should be at a lower resolution, but the same aspect ratio, otherwise the player may have problems rendering the two videos simultaneously. Moreover, the background layer may also have video content, so you need to make sure that all these videos combined are not exceeding the player specification.

Elementi tutorial

The source video is combined with the mask video via the spx:mask-href attribute, and the result is a new video with transparent areas. The support for this attribute was added in Elementi 2016, respectively the firmware 4.1.0.

To apply the "mask" video on the main video, follow these steps:

Using the spx:mask-href attribute
Using the spx:mask-href attribute
  1. Click the "Projects" tab in the Browse panel.
  2. Create a new Elementi project or open an existing one.
  3. The project's main index file is opened by default. If needed, open the one that should contain the video with transparency.
  4. Import both videos into your Elementi project.
  5. Find the main video in the Browse panel. Drag & drop it into the Edit panel.
  6. Click the button to open the "Layer Properties" dialog.
  7. Go to the "Advanced" tab.
  8. Click twice on the "Click to add..." field under the "Name" column to reveal a selection box.
  9. Open the selection box and select the spx:mask-href attribute from the list.
  10. Click on the column next to it to edit the "Value". Enter the name of the "mask" video in there.
  11. Press the "Enter" key to validate the chosen value. Click 🆗.
  12. Save your project.

Done. You can now publish your project onto a player.

Inspirational clips

See also