Push Publishing
OvenMediaEngine supports Push Publishing function that can restreaming live streams to other systems. The protocol supports widely used protocols such as SRT, RTMP, and MPEG-2 TS.
The StreamMap
feature has been added, and it now automatically re-streaming based on predefined conditions. You can also use the Rest API to control and monitor it.
Configuration
Push Publisher
To use Push Publishing, you need to declare the <Push>
publisher in the configuration. <StreamMap>
is optional. It is used when automatic push is needed.
<Applications>
<Application>
...
<Publishers>
...
<Push>
<!-- [Optional] -->
<StreamMap>
<Enable>false</Enable>
<Path>path/to/map.xml</Path>
</StreamMap>
</Push>
...
</Publishers>
</Application>
</Applications>
StreamMap
<StreamMap>
is used for automatically pushing content based on user-defined conditions. The XML file path should be specified relative to <ApplicationPath>/conf
.
<StreamName>
is used to match output stream names and supports the use of wildcard characters. <VariantNames>
can be used to select specific tracks. Multiple variants can be specified using commas (','). The <Protocol>
supports rtmp
, mpegts
, and srt
. You enter the destination address in the <Url>
and <StreamKey>
field, where macros can also be used.
<?xml version="1.0" encoding="UTF-8"?>
<PushInfo>
<Push>
<!-- [Must] -->
<Enable>true</Enable>
<!-- [Must] -->
<StreamName>stream_a_*</StreamName>
<!-- [Optional] -->
<VariantNames>video_h264,audio_aac</VariantNames>
<!-- [Must] -->
<Protocol>rtmp</Protocol>
<!-- [Must] -->
<Url>rtmp://1.2.3.4:1935/app/${SourceStream}</Url>
<!-- <Url>rtmp://1.2.3.4:1935/app/${Stream}</Url> -->
<!-- [Optional] -->
<StreamKey></StreamKey>
<!-- <StreamKey>some-stream-key</StreamKey> -->
</Push>
<Push>
<!-- [Must] -->
<Enable>true</Enable>
<!-- [Must] -->
<StreamName>stream_b_*</StreamName>
<!-- [Optional] -->
<VariantNames></VariantNames>
<!-- [Must] -->
<Protocol>srt</Protocol>
<!-- [Must] -->
<Url>srt://1.2.3.4:9999?streamid=srt%3A%2F%2F1.2.3.4%3A9999%2Fapp%2Fstream</Url>
</Push>
<Push>
<!-- [Must] -->
<Enable>false</Enable>
<!-- [Must] -->
<StreamName>stream_c_*</StreamName>
<!-- [Optional] -->
<VariantNames></VariantNames>
<!-- [Must] -->
<Protocol>mpegts</Protocol>
<!-- [Must] -->
<Url>udp://1.2.3.4:2400</Url>
</Push>
</PushInfo>
${Application}
Application name
${SourceStream}
Source stream name
${Stream}
Output stream name
REST API
Push can be controlled using the REST API. Please refer to the documentation below for more details.
PushLast updated
Was this helpful?