Insert AMF0 messages in RTMP Push Publisher | 0.17.3.0+
OvenMediaEngine Enterprise supports AMF0 messgaes insertion starting from version 0.17.3.0-1.
When re-streaming (Push Publishing) a live stream to another system using the RTMP protocol, you can insert AMF0 messages. Utilizing this feature, you can deliver messages such as subtitle insertions and advertisement markers to another system. The method for inserting messages is as follows:
If the Media Source received through the RTMP Provider includes a message, it will be automatically inserted.
You can insert messages dynamically through the OvenMediaEngine's Send Event API or continuously through XML configuration.
Inserting the onTextData message via the Send Event API
The onTextData
message is used for various purposes, such as subtitle insertion and ad marker insertion.
API Interface
Request
Responses
Inserting the onTextData message through XML Configuration | 0.18.2.0+
For scenarios requiring continuous onTextData
message insertion, you can configure this behavior through XML configuration. Create an XML file defining the onTextData
message insertion events and enable EventGenerator
in Server.xml
.
Configuration Example
Server.xml: You can enable the EventGenerator functionality for the onTextData
message insertion by adding <Application><EventGenerator>
.
<Enable>
Y
Sets activation status to true
or false
.
Default:
false
<Path>
Y
Sets the path to the XML file defining the onTextData
message insertion details. If a relative path is specified, the directory containing the Server.xml
file is used as the base.
XML Defining the onTextData message Insertion Events: Create an XML file defining onTextData
message insertion events at the path specified in Server.xml
. In this example, it's send_event_info.xml
.
<Enable>
Y
Sets activation status to true
or false
.
Default:
false
<SourceStreamName>
Y
Specifies the target stream name.
It supports wildcards (
*
) for pattern matching.
<Interval>
Y
Sets event occurrence interval in milliseconds (ms).
<EventFormat>
Y
Specifies event format (use amf
format).
<EventType>
N
Specifies the event type.
Default:
video
<Values>
Y
Contains the value of the event data.
<Values><amfType>
N
Specifies message type (use onTextData
format).
<Values><Data>
Y
Specifies the array of data to be transmitted
You can use the
<key>
tag, and if the type attribute is not specified, it defaults to string.It supports the macro
${EpochTime}
, which is replaced with the server's current epoch time in milliseconds when transmitted (e.g., 1747147513056).
Payload Example
Here’s an example of an onTextData
message payload encoded in AMF0. A Common Object (ECMA Array) consists of a list of key and value, where the value type can be String, Number, or Boolean.
Last updated