Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
OvenMediaEngine supports multiple protocols that can be input from various live sources, without compromising basic usability. This allows you to publish a variety of live sources with sub-second latency. See the sub-page for more information.
OvenMediaEngine supports the Docker image from AirenSoft's Docker Hub (airensoft/ovenmediaengine) repository. After installing Docker, you can simply run the following command:
You can set the following environment variables.
OvenMediaEngine can work with a variety of open-sources and libraries. First, install them on your clean Linux machine as described below. We think that OME can support most Linux packages, but the tested platforms we use are Ubuntu 18+, Fedora 28+, and CentOS 7+.
If the prerequisites.sh script fails, proceed with the manual installation.
You can build the OvenMediaEngine source using the following command:
In addition, we recommend that you permanently set environment variables as follows.
if systemctl start ovenmediaengine
fails in Fedora, SELinux may be the cause. See Check SELinux section of Troubleshooting.
The default configuration uses the following ports, so you need to open it in your firewall settings.
You can open firewall ports as in the following example:
You can live streaming using live encoders such as OBS, XSplit, and OvenStreamEncoder. Please set the RTMP URL as below:
rtmp://<Server IP>[:<RTMP Port>]/<Application name>/<Stream name>
The meanings of each item are as follows:
<Server IP>
: IP address or domain of the OvenMediaEngine server.
<RTMP Port>
: You can use <Port>
of <Provider>
in the above Server.xml
file. With the default configuration, the RTMP default port (1935) is used. Also, by setting the default port, you can omit the port.
<Application name>
: This value corresponds to <Name>
of <Application>
in conf/Server.xml
. If you use the default configuration, you can use the app
.
<Stream name>
: Name of the stream you defined.
After you enter the above RTMP URL into the encoder and start publishing, you will have an environment in which the player can view the live stream.
The server address in OBS needs to use <Application name>
generated in Server.xml
. If you use the default configuration, the app is already created and ready to use.
Install OBS on your PC and run it.
Click "File" in the top menu, then click "Settings" (or press "Settings" on the lower right).
Select the "Stream" tab and enter your stream information.
Go to the "Output" tab.
Set the following entries.
For lower latency, we recommend using the Hardware Encoder as follows: "NVENC" provides a Low-Latency preset. It's also important to set "MAX B-frame = 0" to reduce latency.
If Hardware Encoder isn't installed on your PC, it's recommended to set x264 as follows: We highly recommend setting "bframes = 0" to reduce latency. Then set the "threads" option to 8 or less. Chrome doesn't handle more than 10 Nal Units. The best way to avoid this is to set "thread = 8".
We recommend checking "Enable new networking code" and "Low latency mode" on Network in Advanced Settings as follows:
We have prepared a test player so that you can easily check if OvenMediaEngine is working properly. Please see the chapter on Test Player for more information.
Please note that WebRTC Signalling URL is similar to the RTMP URL and consists of the following:
ws://<Server IP>:[<Signalling Port>/<Application name>/<Output Stream name>
<Server IP>
: IP address or domain of the OvenMediaEngine server.
<Signalling Port>
: You can use the value of <Signalling><ListenPort>
in Server.xml
above. If you use the default configuration, the WebRTC Signalling default port (3333) is used.
<Application name>
: This value corresponds to <Name>
of <Application>
in conf/Server.xml
. If you use the default configuration, you can use the app
.
<Output Stream name>
: You have to use an output stream name for streaming. If you use the default configuration, an output stream named <Stream Name>
is automatically generated when the stream is input.
As of version 0.10.4, the default output stream name has been changed from <Input Stream Name>_o to <Input Stream Name>, and has been updated to use the input stream name as the output stream name for convenience.
If you use the default configuration, the RTMP publishing URL is rtmp://192.168.0.1:1935/app/stream
Then the WebRTC URL will bews://192.168.0.1:3333/app/stream
In addition,
HLS streaming URL will behttp://192.168.0.1:8080/app/stream/playlist.m3u8
MPEG-DASH streaming URL will behttp://192.168.0.1:8080/app/stream/manifest.mpd
Low-Latency MPEG-DASH streaming URL will be http://192.168.0.1:8080/app/stream/manifest_ll.mpd
If you want to build OvenPlayer in your environment, see OvenPlayer QuickStart.
OvenMediaEngine has a built-in live transcoder. The live transcoder can decode the incoming live source and re-encode it with the set codec or adjust the quality to encode at multiple bitrates.
OvenMediaEngine currently supports the following codecs:
You can re-encode the incoming video source through the <Encode>
setting and make the encoded video and audio into a new stream. The newly created stream can be used according to the streaming URL format.
By the above setting, Video and Audio encoded with <Encode><Name>
of FHD and HD are newly created and included in <Stream><Name>
named ${OriginStreamName}_o
. In other words, if a stream inputted as app/stream
is transcoded, <Stream><Name>
named stream_o
is created.
Also, the newly created stream is used in the following URL format:
WebRTC
ws://192.168.0.1:3333/app/stream_o
HLS
http://192.168.0.1:8080/app/stream_o
/playlist.m3u8
MPEG-DASH
http://192.168.0.1:8080/app/stream_o
/manifest.mpd
Low-Latency MPEG-DASH
http://192.168.0.1:8080/app/stream_o
/manifest_ll.mpd
You can set the video profile as below:
The meaning of each property is as follows:
You can set the audio profile as below:
The meaning of each property is as follows:
You can configure Video and Audio to bypass transcoding as follows:
You need to consider codec compatibility with some browsers. For example, chrome only supports OPUS codec for audio to play WebRTC stream. If you set to bypass incoming audio, it can't play on chrome.
WebRTC doesn't support AAC, so if video bypasses transcoding, audio must be encoded in OPUS.
Even if you set up multiple codecs, there is a codec that matches each streaming protocol supported by OME, so it can automatically select and stream codecs that match the protocol. However, if you don't set a codec that matches the streaming protocol you want to use, it won't be streamed.
The following is a list of codecs that match each streaming protocol:
Therefore, you set it up as shown in the table. If you want to stream using HLS or MPEG-DASH, you need to set up H.264 and AAC, and if you want to stream using WebRTC, you need to set up Opus.
Also, if you are going to use WebRTC on all platforms, you need to configure both VP8 and H.264. This is because different codecs are supported for each browser, for example, VP8 only, H264 only, or both.
However, don't worry. If you set the codecs correctly, OME automatically sends the stream of codecs requested by the browser.
Currently, OME doesn't support adaptive streaming on HLS, MPEG-DASH. However, it will be updated soon.
Env
Default Value
OME_ORIGIN_PORT
9000
OME_RTMP_PROV_PORT
1935
OME_MPEGTS_PROV_PORT
4000-4005/udp
OME_HLS_PUB_PORT
8080
OME_DASH_PUB_PORT
8080
OME_ICE_CANDIDATES
*:10000-10005/udp
OME_SIGNALLING_PORT
3333
Port
Purpose
1935/TCP
RTMP Input
4000-4005/UDP
MPEG-2 TS Input
9000/TCP
Origin Server (OVT)
80/TCP
HLS & MPEG-Dash Streaming
3333/TCP
WebRTC Signalling
10000 - 10005/UDP
WebRTC Ice candidate
Video Decoding | Audio Decoding | Video Encoding | Audio Encoding |
H.264 (Baseline) | AAC | H.264 (Baseline) | AAC |
VP8 | Opus |
Property | Description |
Codec | Specifies the |
Width | Width of resolution |
Height | Height of resolution |
Bitrate | Bit per second |
Framerate | Frames per second |
Property | Description |
Codec | Specifies the |
Bitrates | Bits per second |
Samplerate | Samples per second |
Channel | The number of audio channels |
Protocol | Supported Codec |
WebRTC | VP8, H.264, Opus |
HLS | H.264, AAC |
Low-Latency MPEG-Dash | H.264, AAC |
OvenMediaEngine supports HTTP based streaming protocols such as HLS, MPEG-DASH (Hereafter DASH), and Low-Latency MPEG-DASH with CMAF (Hereafter LLDASH).
OvenMediaEngine will support Low-Latency HLS in the near future. We are always keeping an eye on the decision from Apple inc.
To use HLS, Dash and LLDash, you need to add the <HLS>
and<DASH>
elements to the <Publishers>
in the configuration as shown in the following example.
Most browsers and players prohibit accessing other domain resources in the currently running domain. You can control this situation through Cross-Origin Resource Sharing (CORS) or Cross-Domain (CrossDomain). You can set CORS and Cross-Domain as <CrossDomain>
element.
You can set it using the <Url>
element as shown above, and you can use the following values:
LLDASH, DASH, and HLS Streaming are ready when a live source is inputted and a stream is created. Viewers can stream using OvenPlayer or other players.
Also, you need to set H.264 and AAC in the Transcoding profile because MPEG-DASH and HLS use these codecs.
When you create a stream, as shown above, you can play LLDASH, DASH, and HLS through OvenPlayer with the following URL:
If you use the default configuration, you can start streaming with the following URL:
https://[OvenMediaEngine IP]:80/app/<stream name>_o/playlist.m3u8
http://[OvenMediaEngine IP]:80/app/<stream name>_o/playlist.m3u8
https://[OvenMediaEngine IP]:80/app/<stream name>_o/manifest.mpd
http://[OvenMediaEngine IP]:80/app/<stream name>_o/manifest.mpd
https://[OvenMediaEngine IP]:80/app/<stream name>_o/manifest_ll.mpd
http://[OvenMediaEngine IP]:80/app/<stream name>_o/manifest_ll.mpd
We have prepared a test player that you can quickly see if OvenMediaEngine is working. Please refer to the for more information.
Title | Functions |
Delivery | HTTP for HLS and DASH HTTP 1.1 chunked transfer for LLDash |
Security | TLS (HTTPS) |
Format | TS for HLS ISOBMFF for DASH CMAF for LLDASH |
Codec | H.264, AAC |
Url Value | Description |
* | Allows requests from all Domains |
domain | Allows both HTTP and HTTPS requests from the specified Domain |
http://domain | Allows HTTP requests from the specified Domain |
https://domain | Allows HTTPS requests from the specified Domain |
Protocol | URL format |
LLDASH |
|
Secure LLDASH |
|
DASH |
|
Secure DASH |
|
HLS |
|
Secure HLS |
|
Element | Description |
Bind | Set the HTTP port to provide HLS and DASH. LLDASH and DASH are provided on the same port, and DASH and HLS can be set to the same port. |
SegmentDuration | Set the length of the segment in seconds. The shorter the |
SegmentCount | Set the number of segments to be exposed to It doesn't need to set SegmentCount for LLDASH because LLDASH only has one segment on OvenMediaEngine. |
CrossDomain |
OvenMediaEngine uses WebRTC to provide sub-second latency streaming. WebRTC uses RTP for media transmission and provides various extensions.
OvenMediaEngine provides the following features:
If you want to use the WebRTC feature, you need to add <WebRTC>
element to the <Publishers>
and <Ports> in the Server.xml
configuration file, as shown in the example below.
WebRTC uses ICE for connections and specifically NAT traversal. The web browser or player exchanges the Ice Candidate with each other in the Signalling phase. Therefore, OvenMediaEngine provides an ICE for WebRTC connectivity.
If you set IceCandidate to *: 10000-10005/udp
, as in the example above, OvenMediaEngine automatically gets IP from the server and generates IceCandidate
using UDP ports from 10000 to 10005. If you want to use a specific IP as IceCandidate, specify a specific IP. You can also use only one 10000 UDP Port, not a range, by setting it to *: 10000.
OvenMediaEngine has embedded a WebSocket-based signalling server and provides our defined signalling protocol. Also, OvenPlayer supports our signalling protocol. WebRTC requires signalling to exchange Offer SDP and Answer SDP, but this part isn't standardized. If you want to use SDP, you need to create your exchange protocol yourself.
If you want to change the signaling port, change the value of <Ports><WebRTC><Signalling>
.
The Signalling protocol is defined in a simple way:
If you want to use a player other than OvenPlayer, you need to develop the signalling protocol as shown above and can integrate OvenMediaEngine.
Add WebRTC
element to Publisher to provide streaming through WebRTC.
WebRTC Streaming starts when a live source is inputted and a stream is created. Viewers can stream using OvenPlayer or players that have developed or applied the OvenMediaEngine Signalling protocol.
Also, the codecs supported by each browser are different, so you need to set the Transcoding profile according to the browser you want to support. For example, Safari for iOS supports H.264 but not VP8. If you want to support all browsers, please set up VP8, H.264, and Opus codecs in all transcoders.
WebRTC doesn't support AAC, so when trying to bypass transcoding RTMP input, audio must be encoded as opus. See the settings below.
Some browsers support both H.264 and VP8 to send Answer SDP to OvenMediaEngine, but sometimes H.264 can't be played. In this situation, if you write the VP8 above the H.264 code line in the Transcoding profile setting, you can increase the priority of the VP8.
Using this manner so that some browsers, support H.264 but can't be played, can stream smoothly using VP8. This means that you can solve most problems with this method.
If you created a stream as shown in the table above, you can play WebRTC on OvenPlayer via the following URL:
If you use the default configuration, you can stream to the following URL:
ws://[OvenMediaEngine IP]:3333/app/stream_o
wss://[OvenMediaEngine IP]:3333/app/stream_o
We have prepared a test player to make it easy to check if OvenMediaEngine is working. Please see the Test Player chapter for more information.
Control the domain in which the player works through <CorssDomain>
. For more information, please refer to the section.
Title
Functions
Delivery
RTP / RTCP
Security
DTLS, SRTP
Connectivity
ICE
Error Correction
ULPFEC (VP8, H.264), In-band FEC (Opus)
Codec
VP8, H.264, Opus
Signalling
Self-Defined Signalling Protocol and Embedded Web Socket-Based Server
Protocol
URL format
WebRTC Signalling
http://<Server IP>[:<Signalling Port]/<Application name>/<Stream name>
Secure WebRTC Signalling
https://<Server IP>[:<Signalling Port]/<Application name>/<Stream name>
To monitor the OvenMediaEngine, you can view in real-time the log files generated by itself. You can configure a log type and level by creating the Logger.xml
configuration file in the same location as Server.xml.
You can set up Logger.xml as shown in the following example: OvenMediaEngine prints logs separated by many tag names and levels. Set <Tag name=".*" level="debug">
to have OvenMediaEngine print all logs and read the logs. And then it's better to disable tags that you don't need.
OvenMediaEngine generates log files. If you start OvenMediaEngine by systemctl start ovenmediaengine
, the log file is generated to the following path.
If you run it directly from the command line, it will be generated to the following location:
If you run it in the Docker container, the log file is in the following path:
Following is the example of real logs.
OvenMediaEngine collects the following metrics for each host, application, and stream.
Bytes in/out by protocol
Connections by protocol
Maximum connections and time
Time is taken to connect to origin
This is available through the Monitoring class, and we use this information to generate various log files. OvenMediaEngine outputs various statistics through log files. OvenMediaEngine now prints logs for WebRTC and HTTP based streamings, but its format is for a specific purpose and isn't standardized. This will be standardized in future 1.0 and will be published throughout this manual.
Currently, OvenMediaEngine outputs statistics like this:
The statistics logs are mostly different because they are collected from Bigdata's collection system and output for various purposes. OvenMediaEngine is open-source, so you have the flexibility to respond in such situations. OME keeps all the metrics for Vhost, App, and Stream in the Monitoring Class, so anyone can use them.
OvenMediaEngine provides P2P Delivery to be able to distribute Edge Traffic to Player. This feature is currently the Preview version, and if you want to use it, you need only to use OvenPlayer. Moreover, we plan to perform more experiments in various real-world and then upgrade it to the full version in OvenMediaEngine.
First of all, we have rules. The peer that sends the Traffic in the P2P network is called a Host Peer, and the peer that receives the Traffic from the Host Peer is called a Client Peer. Also, P2P Delivery in OvenMediaEngine doesn't designate the Client Peer as the Host Peer again. In other words, it only operates as 1 Depth.
According to our experiments so far, P2P Delivery provides the best performance and stability when using 1 Depth to connect between Players and connecting up to two Players to one Player.
In other words, P2P Delivery has distributed two-thirds of existing Traffic. So, this means that it can expand the Capacity of the Edge Network by three times and reduce Traffic costs by two-thirds.
You can use the P2P function of OvenMediaEngine by adding the <P2P>
element as the following settings:
Also, If you want to use P2P Delivery when your OvenMediaEngine is running in Origin-Edge Cluster-Mode, you need to apply this setting to all the Edges. You can instantly test P2P Delivery with OvenPlayer.
<MaxClientPeersPerHostPeer>
sets the number of Client Peers connecting to one Host Peer.
When OvenMediaEngine receives a WebRTC connection request from a new player, it determines the Host Peer or Client Peer according to the following rules:
When any Host Peer is disconnected, OvenMediaEngine detects this situation and immediately reconnects the Client Peer connected to that Host Peer to the Edge to ensure stability.
Also, we are preparing a smarter algorithm based on user location, platform performance, and network statistical information for classifying Host Peers or Client Peers.
If you have a better idea, we hope that you improve our code and contribute to our project. Please visit OvenMediaEngine GitHub.
Qualification for Host Peer
Qualification for Client Peer
The device isn't Mobile
OS isn't Linux
Browser isn't MS Edge Browser
Browser isn't Unknown Browser
One of the Host Peers uses the same kind of browser
Host Peer is vacant
OvenMediaEngine (OME) is an open-source and streaming server with sub-second latency. OME receives video via RTMP, MPEG-TS, and RSTP Pull from live encoders such as OBS, FFMPEG, and more. And then, OME transmits video using WebRTC, Low-Latency HTTP (DASH), MPEG-DASH, and HLS. So, sub-second latency streaming from OME can work seamlessly in your browser without plug-ins. Also, we provide OvenPlayer, the most optimized HTML5 player for OME, as an open-source.
Our goal is to make it easier for you to build a stable broadcasting/streaming service with sub-second latency.
RTMP Push, MPEG2-TS Push, RTSP Pull Input
WebRTC sub-second streaming
Embedded WebRTC Signalling Server (WebSocket based)
ICE (Interactive Connectivity Establishment)
DTLS (Datagram Transport Layer Security)
SRTP (Secure Real-time Transport Protocol)
ULPFEC (Forward Error Correction) with VP8, H.264
In-band FEC (Forward Error Correction) with Opus
Low-Latency MPEG-DASH streaming (Chunked CMAF)
Legacy HLS/MPEG-DASH streaming
Embedded Live Transcoder (VP8, H.264, Opus, AAC, Bypass)
Origin-Edge structure
Monitoring
Experiment
P2P Traffic Distribution
RTSP Pull, MPEG-TS Push Input
We have tested OvenMediaEngine on platforms, listed below. However, we think it can work with other Linux packages as well:
Ubuntu 18
CentOS 7
Fedora 28
Please read Getting Started chapter in tutorials.
Basic Information, FAQ, and Benchmark
Getting Started, Install, and Configuration
Test Player
Without TLS
: http://demo.ovenplayer.com
Based on TLS
: https://demo.ovenplayer.com
Please see our Guidelines and Rules.
OvenMediaEngine is under the GPLv2 license.
From version 0.10.4, MPEG-2 TS input is supported as a beta version. The supported codecs are H.264, AAC(ADTS). Supported codecs will continue to be added. And the current version only supports basic MPEG-2 TS with 188 bytes packet size. Since the information about the input stream is obtained using PAT and PMT, the client must send this table information as required.
This version supports MPEG-2 TS over UDP. MPEG-2 TS over TCP or MPEG-2 TS over SRT will be supported soon.
To enable MPEG-2 TS, you must bind the ports fist and map the bound ports and streams.
To use multiple streams, it is necessary to bind multiple ports, so we provide a way to bind multiple ports as in the example below. You can use the dash to specify the port as a range, such as Start port-End port
, and multiple ports using commas.
First, name the stream and map the port bound above. The macro ${Port} is provided to map multiple streams at once. Check out the example below.
This is an example of publishing using FFMPEG.
Giving the -pes_payload_size 0 option to the AAC codec is very important for AV synchronization and low latency. If this option is not given, FFMPEG bundles several ADTSs and is transmitted at once, which may cause high latency and AV synchronization errors.
If you use the default configuration, you can stream with the following streaming URLs when you start broadcasting to OBS:
WebRTC
ws://192.168.0.1:3333/app/stream_4000
HLS
http://192.168.0.1:8080/app/stream_4000/playlist.m3u8
MPEG-DASH
http://192.168.0.1:8080/app/stream_4000/manifest.mpd
OvenMediaEngine has an XML configuration file. If you start OvenMediaEngine with systemctl start ovenmediaengine
, the config file is loaded from the following path.
If you run it directly from the command line, it loads the configuration file from:
If you run it in Docker container, the path to the configuration file is:
The Server
is the root element of the configuration file. The version
attribute indicates the version of the configuration file. OvenMediaEngine uses this version information to check if the config file is a compatible version.
The IP address
is OvenMediaEngine will bind to. If you set *, all IP addresses of the system are used. If you enter a specific IP, the Host uses that IP only.
The Bind
is the configuration for the server port that will be used. Bind consists of Providers
and Publishers
. The Providers are the server for stream input, and the Publishers are the server for streaming.
The meaning of each element is shown in the following table:
HLS and DASH can be set to the same port, but all other protocols have to use different ports. The ability for all protocols to use the same port will be updated in the future.
VirtualHosts
are a way to run more than one streaming server on a single machine. OvenMediaEngine supports IP-based virtual host and Domain-based virtual host. "IP-based" means that you can separate streaming servers into multiples by setting different IP addresses, and "Domain-based" means that even if the streaming servers use the same IP address, you can split the streaming servers into multiples by setting different domain names.
VirtualHosts
consist of Domain
, Origins
, and Applications
.
The Domain has Names
and TLS. Names can be either a domain address or an IP address. Setting * means it allows all domains and IP addresses.
Origins (also we called OriginMap) are a feature to pull streams from external servers. It now supports OVT and RTSP for the pulling protocols. OVT is a protocol defined by OvenMediaEngine for Origin-Edge communication. It allows OvenMediaEngine to relay a stream from other OvenMediaEngines that have OVP Publisher turned on. Using RTSP, OvenMediaEngine pulls a stream from an RTSP server and creates a stream. RTSP stream from external servers can stream by WebRTC, HLS, and MPEG-DASH.
The Origin has Location
and Pass
elements. Location is a URI pattern for incoming requests. If the incoming URL request matches Location, OvenMediaEngine pulls the stream according to a Pass element. In the Pass element, you can set the origin stream's protocol and URLs.
<Application>
consists of various elements that can define the operation of the stream, including Stream input, Encoding, and Stream output. In other words, you can create as many <Application>
as you like and build various streaming environments.
<Application>
needs to set <Name>
and <Type>
as follows:
<Name>
is used to configure the Streaming URL.
<Type>
defines the operation of <Application>
. Currently, there is only a live
type.
Providers
ingest streams that come from a media source.
<Encode>
has a profile that encodes the input stream coming through <Providers>
. You can set up multiple profiles in <Encode>
.
You can create a new Output Stream by grouping the encoded results in the <Stream>
setting.
<Name>
is the Stream Name when using to configure the Streaming URL.
<Stream>
can be combined with multiple <Profile>
and output as Multi Codec or Adaptive.
<Profile>
is <Encode><Name>
and maps the Transcoding profile.
You can configure the Output Stream operation in <Publishers>
. <ThreadCount>
is the number of threads used by each component responsible for the <Publishers>
protocol.
You need many threads to transmit streams to a large number of users at the same time. So it's better to use a higher core CPU and set <ThreadCount>
equal to the number of CPU cores.
​OvenMediaEngine currently supports WebRTC, Low-Latency DASH, MEPG-DASH, and HLS. If you don't want to use any protocol then you can delete that protocol setting, the component for that protocol isn't initialized. As a result, you can save system resources by deleting the settings of unused protocol components.
Finally, Server.xml
is configured as follows:
To run the Edge server, Origin creates application and stream if there isn't those when user request. For more learn about Origin-Edge, see the chapter.
If you want to get more information about the <Providers>
, please refer to the chapter.
For more information about the Encodes and Streams, please see the chapter.
If you want to learn more about WebRTC, visit the chapter. And if you want to get more information on Low-Latency DASH, MPEG-DASH, and HLS, refer to the chapter on .
Element | Description |
RTMP | RTMP port for incoming RTMP stream. |
MPEG-TS | MPEGTS ports for incoming MPEGTS/UDP stream. |
OVT | OVT port for an origin server. |
HLS | HTTP(s) port for HLS streaming. |
DASH | HTTP(s) port for MPEG-DASH streaming including Low-Latency MPEG-DASH. |
WebRTC |
Providers
ingest streams that come from a media source. OvenMediaEngine supports RTMP protocol. You can set it in the configuration as follows:
When a live source inputs to <Application>
, a stream is automatically created in the <Application>
. The generated stream is passed to Encoder and Publisher.
If you set up a live stream using RTMP-based encoder, you need to set the following in Server.xml
:
<BlockDuplicateStreamName>
is a policy for streams that are inputted as overlaps.
<BlockDuplicateStreamName>
works with the following rules:
Allowing the duplicated stream name feature can cause several problems. Player connections may be lost when a new stream is inputted. Most encoders can automatically reconnect when it is disconnected from the server. As a result, the two encoders can compete and disconnect from each other, causing serious problems with streaming.
If you want to publish the source stream, you need to set the following in the Encoder:
URL
RTMP://<OvenMediaEngine IP>[:<RTMP Listen Port>]/<App Name]>
Stream Key
Stream Name
If you use the default configuration, <RTMP><ListenPort>
is 1935, which is the default port for RTMP. So it can be omitted. Also, since the Application named app
is created by default in the default configuration, you can enter the app
in the [App Name]
. You can define a Stream Key and use it in the Encoder, and the Streaming URL will change according to the Stream Key.
Moreover, some encoders may include a stream key in the URL, and if you use these encoders, you need to set it as follows:
URL
RTMP://<OvenMediaEngine IP>[:<RTMP Listen Port>/<App Name>/<Stream Name>
If you use the default configuration, set up OBS as follows:
You can set the Stream Key that can be set to any name, you like, at any time.
If you use the default configuration, you can stream with the following streaming URLs when you start broadcasting to OBS:
WebRTC
ws://192.168.0.1:3333/app/stream
HLS
http://192.168.0.1:8080/app/stream/playlist.m3u8
MPEG-DASH
http://192.168.0.1:8080/app/stream/manifest.mpd
Most browsers can't load resources via HTTP and WS (WebSocket) from HTTPS web pages secured with TLS. Therefore, if the player is on an HTTPS page, the player must request streaming through "https" and "wss" URLs secured with TLS. In this case, you must apply the TLS certificate to the OvenMediaEngine.
You can set the port for TLS in TLSPort
. Currently, only HLS, DASH, and WebRTC Signaling support TLS.
Add your certificate files to as follows:
To configure HTTPs for HLS, DASH, and WebRTC Signalling servers, the TLS element must be enabled. The CertPath has to indicate a server certificate and the KeyPath has to indicate a private key file. They can be set to absolute paths or relative paths from the executable. If the server certificate is issued using an intermediate certificate, some browsers may complain about a certificate. In this case, you should set a bundle of chained certificates provided by a Certificate Authority in ChainCertPath.
If you set up TLS, you can't set IP or * into <Name>. You can only set Domains that the certificate contains. If you have a certificate for *.host.com
, it means you can set domains such as aaa.host.com
, bbb.host.com
, and *.host.com
.
If the certificate settings are completed correctly, WebRTC streaming can be played wss://url
with HLS and DASH streaming https://url
.
The current version of OvenMediaEngine doesn't yet support SNI. This means that you can't set multiple TLS. So currently OvenMediaEngine can only set TLS on the first VirtualHost. We will support SNI in the next version.
We provide you our test player to make sure that OvenMediaEngine works well. Most browsers prohibit access to the TLS-based HTTPS site through unsecured HTTP or WebSocket (WS) for security reasons. Thus, we have prepared the HTTP or HTTPS based player as follows:
When playing Low-Latency DASH, you can control the delay time in the player as shown below. Delay time is closely related to the buffering size. The smaller the value, the shorter the latency, but if it is too small, there is no buffer and playback may not be smooth. In a typical network environment, it is most stable to give 2 as the delay value.
OvenMediaEngine supports clustering and ensures High Availability (HA) and scalability.
OvenMediaEngine supports the Origin-Edge structure for cluster configuration and provides scalability. Also, you can set Origin as Primary
and Secondary
in OvenMediaEngine for HA.
The OvenMediaEngine running as edge pulls a stream from an external server when a user requests it. The external server could be another OvenMediaEngine with OVT enabled or another stream server that supports RTSP.
OvenMediaEngine provides OVT protocol for passing streams from the origin to the edge. To run OvenMediaEngine as Origin, OVT port, and OVT Publisher must be enabled as follows :
The role of the edge is to receive and distribute streams from an origin. You can configure hundreds of Edge to distribute traffic to your players. As a result of testing, a single edge can stream 4-5Gbps traffic by WebRTC based on AWS C5.2XLarge. If you need to stream to thousands of people, you can configure and use multiple edges.
The edge supports OVT and RTSP to pull stream from an origin. In the near future, we will support more protocols. The stream pulled through OVT or RTSP is bypassed without being encoded.
In order to re-encode the stream created by OVT and RTSP, the function to put into an existing application will be supported in the future.
To run OvenMediaEngine as Edge, you need to add Origins elements to the configuration file as follows:
The <Origin>
is a rule about where to pull a stream from for what request.
The <Origin>
has the ability to automatically create an application with that name if the application you set in <Location>
doesn't exist on the server. If an application exists in the system, a stream will be created in the application.
The automatically created application by <Origin>
enables all providers but if you create an application yourself, you must enable the provider that matches the setting as follows.
For a detailed description of Origin's elements, see:
Origin is already filtered by domain because it belongs to VirtualHost. Therefore, in Location, set App, Stream, and File to match except domain area. If a request matches multiple Origins, the top of them runs.
Pass consists of Scheme and Url.
<Scheme>
is the protocol that will use to pull from the Origin Stream. It currently can be configured as OVT
or RTSP
.
If the origin server is OvenMediaEngine, you have to set OVT
into the <Scheme>
.
You can pull the stream from the RTSP server by setting RTSP
into the<Scheme>
. In this case, the <RTSPPull>
provider must be enabled. The application automatically generated by Origin doesn't need to worry because all providers are enabled.
Urls
is the address of origin stream and can consist of multiple URLs.
The final address to be requested by OvenMediaEngine is generated by combining the configured Url and user's request except for Location. For example, if the following is set
OVT is a protocol defined by OvenMediaEngine for Origin-Edge communication. For more information about Origin-Edge, see the chapter.
Port for WebRTC. If you want more information on the WebRTC port, see the chapter.
The OVT is a protocol defined by OvenMediaEngine to relay stream between Origin-Edge and OVT can be run over SRT and TCP. For more information on the SRT Protocol, please visit the site.
If a user requests , OvenMediaEngine makes an address to ovt: //origin.com: 9000/origin_app/stream.
When you are configuring Load Balancer, you need to use third-party solutions such as L4 Switch, LVS, or GSLB, but we recommend using DNS Round Robin. Also, services such as cloud-based , , or can be a good alternative.
Value
Description
true
Default
rejects a new stream inputted as overlap, and it maintains the existing stream.
false
Accepts a new stream inputted as overlap, and it disconnects the existing stream.
Site URL | Description |
A player without TLS that can test all streaming URLs such as |
A player with TLS that can only test |
From version 0.10.4, RTSP Pull input is supported as a beta version. The supported codecs are H.264, AAC(ADTS). Supported codecs will continue to be added.
This function pulls a stream from an external RTSP server and operates as an RTSP client.
For example, in the above setup, when a player requests "ws://ome.com/app_name/rtsp_stream_name" to stream WebRTC, it pulls the stream from "rtsp://192.168.0.200:554" and publishes it to WebRTC.
If the app name set in Location isn't created, OvenMediaEngine creates the app with default settings. The default generated app doesn't have an OPUS encoding profile, so to use WebRTC streaming, you need to add the app to your configuration.
The pull-type provider is activated by the publisher's streaming request. And if there is no client playing for 30 seconds, the provider is automatically disabled.
According to the above setting, the RTSP pull provider operates for the following streaming URLs.
RTSP Pull is provided through OriginMap configuration. OriginMap is the rule that the Edge server pulls the stream of the Origin server. Edge server can pull a stream of origin with RTSP and OVT (protocol defined by OvenMediaEngine for Origin-Edge) protocol. See the section for more information about OVT.
Protocol | URL |
WebRTC | ws:://ome.com:3333/app_name/rtsp_stream_name |
HLS | http://ome.com:8080/app_name/rtsp_stream_name/playlist.m3u8 |
DASH | http://ome.com:8080/app_name/rtsp_stream_name/manifest.mpd |
LL DASH | http://ome.com:8080/app_name/rtsp_stream_name/manifest_ll.mpd |
prerequisites.sh
Script FailedIf you have problems with the prerequisites.sh
script we have provided, please install it manually as follows.
systemctl start ovenmediaengine
failedIf SELinux is running on your system, SELinux can deny the execution of OvenMediaEngine.
You can choose between two methods of adding a policy to SELinux or setting SELinux to permissive mode. To add a policy, you must apply the SELinux policy file for the OvenMediaEngine service to your system as follows:
Setting SELinux to permissive mode is as simple as follows. But we don't recommend this method.