Getting Started

Running with Docker

OvenMediaEngine supports the Docker image from AirenSoft's Docker Hub (airensoft/ovenmediaengine) repository. After installing Docker, you can simply run the following command:

docker run -d \
-p 1935:1935 -p 4000-4005:4000-4005/udp -p 3333:3333 -p 8080:8080 -p 9000:9000 -p 10000-10005:10000-10005/udp \
airensoft/ovenmediaengine:latest

You can set the following environment variables.

Ports

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

Manual Installation and Execution

Install dependencies

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+.

(curl -LOJ https://github.com/AirenSoft/OvenMediaEngine/archive/v0.10.4.tar.gz && tar xvfz OvenMediaEngine-0.10.4.tar.gz)
OvenMediaEngine-0.10.4/misc/prerequisites.sh

If the prerequisites.sh script fails, proceed with the manual installation.

Build & Run

You can build the OvenMediaEngine source using the following command:

Ubuntu 18
Fedora 28
CentOS 7
Ubuntu 18
sudo apt-get update
cd OvenMediaEngine-0.10.4/src
make release
sudo make install
systemctl start ovenmediaengine
# If you want automatically start on boot
systemctl enable ovenmediaengine.serviceĀ 
Fedora 28
sudo dnf update
cd OvenMediaEngine-0.10.4/src
make release
sudo make install
systemctl start ovenmediaengine
# If you want automatically start on boot
systemctl enable ovenmediaengine.service
CentOS 7
sudo yum update
source scl_source enable devtoolset-7
cd OvenMediaEngine-0.10.4/src
make release
sudo make install
systemctl start ovenmediaengine
# If you want automatically start on boot
systemctl enable ovenmediaengine.service

In addition, we recommend that you permanently set environment variables as follows.

$ echo 'source scl_source enable devtoolset-7' >> ~/.bashrc

if systemctl start ovenmediaengine fails in Fedora, SELinux may be the cause. See Check SELinux section of Troubleshooting.

Ports used by default

The default configuration uses the following ports, so you need to open it in your firewall settings.

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

You can open firewall ports as in the following example:

$ sudo firewall-cmd --add-port=80/tcp
$ sudo firewall-cmd --add-port=1935/tcp
$ sudo firewall-cmd --add-port=4000-4005/udp
$ sudo firewall-cmd --add-port=3333/tcp
$ sudo firewall-cmd --add-port=9000/tcp
$ sudo firewall-cmd --add-port=10000-10005/udp

Hello Sub-Second Latency Streaming

Start Streaming

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.

Example of using OBS Encoder

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.

Press "Service" and select "Custom", your OBS is the same as this image.
  • 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:

Play

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.