Skip to main content

Multicast

OvenMediaEngine can pull MPEG-2 TS input delivered over UDP multicast. The Multicast Provider uses the multicast:// URL scheme and creates streams through StreamMap or the Stream Creation API.

ItemDescription
ContainerMPEG-2 TS
TransportUDP Multicast
CodecH.264, H.265, AAC
Additional FeaturesSCTE-35 event forwarding

Configuration​

To use Multicast, enable the <Provider> in the <Application>.

Bind​

Bind settings are optional and are used only when you need to tune input socket processing or the UDP receive buffer size:

<!-- /Server/Bind -->
<Bind>
<Providers>
...
<Multicast>
<WorkerCount>1</WorkerCount>
<ThreadPerSocket>false</ThreadPerSocket>
<ReceiveBufferSize>8388608</ReceiveBufferSize>
</Multicast>
...
</Providers>
</Bind>
PropertyDescription
WorkerCountNumber of worker threads used to process input sockets.
ThreadPerSocketWhether to use a dedicated thread for each socket. If set to true, socket-specific threads are used instead of WorkerCount.
ReceiveBufferSizeSize of the UDP receive buffer. Adjust this in environments with high bitrate input or large bursts.

Application​

Enable the Multicast Provider per Application:

<!-- /Server/VirtualHosts/VirtualHost/Applications/Application -->
<Providers>
...
<Multicast>
...
</Multicast>
...
</Providers>

StreamMap​

Multicast streams declared in StreamMap are created automatically when the Application starts:

<!-- /Server/VirtualHosts/VirtualHost/Applications/Application -->
<Providers>
<Multicast>
<StreamMap>
<Stream>
<Name>news_hd</Name>
<source />multicast://239.1.1.10:5000</Source>
<ProbeTimeoutMsec>3000</ProbeTimeoutMsec>
</Stream>
<Stream>
<Name>sports_hd</Name>
<source />multicast://239.1.1.11:5000?interface=eth1</Source>
<ProbeTimeoutMsec>5000</ProbeTimeoutMsec>
</Stream>
</StreamMap>
</Multicast>
</Providers>
PropertyDescription
NameStream name to be created inside OvenMediaEngine.
SourceMulticast input URL.
ProbeTimeoutMsec

Maximum time, in milliseconds, to wait for input metadata.

  • Default: 3000.

Multiple streams in the same Application can reference the same multicast source.

Pull timeout and retry​

Input timeout and retry count are configured in Origins/Properties:

<!-- /Server/VirtualHosts/VirtualHost -->
<Origins>
<Properties>
<NoInputFailoverTimeout>3000</NoInputFailoverTimeout>
<RetryCount>3</RetryCount>
</Properties>
</Origins>
PropertyDescription
NoInputFailoverTimeoutIf no input packets arrive for the configured time, the stream is stopped and a reconnect is attempted.
RetryCountMaximum number of reconnect attempts.

Source URL format​

The following URL formats are supported:

multicast://239.1.1.1:5000
multicast://239.1.1.1:5000?interface=eth0
multicast://[ff05::111]:5000
multicast://[ff05::111]:5000?interface=eth0

The only supported query parameter is interface:

PropertyDescription
interfaceNIC name to use when joining the multicast group. If omitted, the OS selects the interface automatically.

Limitations:​

  • Paths are not supported. The URL path must be empty or /.
  • Hostnames can be used. In that case, OvenMediaEngine resolves the hostname and uses the first result.
  • The resolved hostname result must be in the multicast IP range.

Pulling streams using the Stream Creation API​

Multicast streams can also be created through the Stream Creation API.

{
"name": "channel1",
"urls": [
"multicast://239.1.1.1:5000"
],
"properties": {
"persistent": false
}
}

For more information, see the REST API documentation.

Notes​

  • If a new sender starts on the same group and port, the provider detects it and attempts a reconnect.
  • During reconnect, the new input track layout is compared against the previously published layout.
  • The input metadata must be available within ProbeTimeoutMsec for the stream to be published.