OvenMediaEngine Enterprise supports the Image Overlay feature starting with version 0.19.1.0-1.
The Image Overlay feature lets you superimpose visual elements such as logos, watermarks, and banners on top of a stream in real-time. You can add, modify, or clear overlays through the REST API or XML configuration, and precisely control each element’s position, size, and opacity. It provides a simple way to handle scenarios like campaign swaps, emergency notices, brand reinforcement, on-screen information, and more.
Supported formats:PNG (with alpha), JPEG
Image source URI schemes:http, https, file
Image Overlay Configuration (XML)
When the Image Overlay feature is enabled in Server.xml, changes are applied automatically to new streams without restarting OvenMediaEngine Enterprise. Configure the XML as follows.
Configuring Image Overlays in Server.xml
In Server.xml, configure <Application><OutputProfiles><MediaOptions><Overlays> as below:
Specifies the path to the XML file that contains the overlay settings.
* Please see the OverlayInfo.xml example below.
OverlayInfo.xml Configuration Example:
Element
Value
Description
Enable
true | false
Enables or disables the imgae overlay feature.
OutputStreamName
-
Specifies the output stream that will use the image overlay.
* Select streams using the wildcard character (*).
VariantNames
-
Option to select one or more tracks within the output stream for the image overlay. If omitted, the overlay applies to all video tracks in the output stream.
* Select tracks using the wildcard character (*).
* Separate multiple tracks with commas (,).
Url
-
URL (path) of the image file to render as the overlay.
* Supported URI schemes: http, https, file
* Relative paths are supported and are resolved relative to the configuration file’s location.
Left, Top, Width, Height
-
Sets the position and size of the overlay image.
* Original frame size macros: MAIN_W, MAIN_H
Sets the opacity of the overlay image.
* Closer to 0 means more transparent; closer to 100 means more opaque.
Using Image Overlay in Real-Time (REST API)
You can use the REST API to add, update, or clear overlays on a specific stream or on a track(s) within the stream in real-time. The available options and parameters are identical to those in the XML configuration above.
Add Image Overlay
Request
POST /v1/vhosts{vhost}/apps/{app}/streams/{stream}:startOverlay
Configuration Parameters (same as in the XML configuration)
Element
Value
Description
Enable
true | false
Enables or disables the imgae overlay feature.
OutputStreamName
-
Specifies the output stream that will use the image overlay.
* Select streams using the wildcard character (*).
VariantNames
array
Option to select one or more tracks within the output stream for the image overlay. If omitted, the overlay applies to all video tracks in the output stream.
* Select tracks using the wildcard character (*).
* Separate multiple tracks with commas (,).
Url
-
URL (path) of the image file to render as the overlay.
* Supported URI schemes: http, https, file
* Relative paths are supported and are resolved relative to the configuration file’s location.
Left, Top, Width, Height
-
Sets the position and size of the overlay image.
* Original frame size macros: MAIN_W, MAIN_H
Sets the opacity of the overlay image.
* Closer to 0 means more transparent; closer to 100 means more opaque.
Responses
200 OK
Header
Body
400 Bad Request
Header
Body
404 Not Found
Header
Body
Clear Image Overlay
You can clear all overlays applied to a specific stream or to a track(s) within that stream using the REST API.
Request
POST /v1/vhosts{vhost}/apps/{app}/streams/{stream}:stopOverlay
Configuration Parameters (same as in the XML configuration)
Element
Value
Description
OutputStreamName
-
Specifies the output stream for which to disable the image overlay.
* Select streams using the wildcard character (*).
VariantNames
array
Option to select one or more tracks within the specified output stream for which to disable the image overlay. If omitted, the overlay applies to all video tracks in the output stream.
* Select tracks using the wildcard character (*).
* Separate multiple tracks with commas (,).
Responses
200 OK
Header
Body
400 Bad Request
Header
Body
404 Not Found
Header
Body
Image Overlay Usage Examples
The examples below either use explicit values or leverage macros and expressions.
#01. Overlay an image with a fixed size at the top-left of the screen.
Size: 500*250
Opacity: 70
#02. Overlay the original image centered on the screen.
Size: Original
Opacity: 100
#03. Overlay the image at 50% size at the top-right of the screen.