OvenMediaEngine(OME) is a streaming engine for real-time live broadcasting with Ultra-low latency. It receives the RTMP stream from general broadcasting studios such as OBS, XSplit and transmit it on WebRTC. Video streams with Ultra-low latency can be played in a browser without plug-ins. To make it easier to play WebRTC streams in browsers, we are working on another HTML5 player project OvenPlayer.
Our goal is to make it easier for you to build a stable real-time broadcasting service.
- RTMP Input, Webrtc Output
- Live transcoding (VP8, Opus)
- Embedded WebRTC signalling server (Websocket based server)
- DTLS (Datagram Transport Layer Security)
- SRTP (Secure Real-time Transport Protocol)
- Configuration
We support the following platforms:
- Ubuntu 18
- Centos 7
- Fedora 28
We will support the following platforms in the future:
- macOS
- Windows
- [CentOS only] devtoolset (gcc 6.0+ for compile, 7.0+ is recommended)
$ sudo yum install centos-release-scl $ sudo yum install devtoolset-7 # Execute this command $ source scl_source enable devtoolset-7 # and append above command to ~/.bashrc using text editors
- [Ubuntu only] build-essential
$ sudo apt install build-essential
- bc (An arbitrary precision calculator language)
- CentOS/Fedora
$ sudo yum install bc
- Ubuntu
$ sudo apt install bc
- CentOS/Fedora
- gcc-c++
- CentOS/Fedora
$ sudo yum install gcc-c++
- CentOS/Fedora
- nasm (Netwide Assembler)
- CentOS/Fedora
$ sudo yum install nasm
- Ubuntu
$ sudo apt install nasm
- CentOS/Fedora
- autoconf
- CentOS/Fedora
$ sudo yum install autoconf
- Ubuntu
$ sudo apt install autoconf
- CentOS/Fedora
- libtool
- CentOS/Fedora
$ sudo yum install libtool
- Ubuntu
$ sudo apt install libtool
- CentOS/Fedora
- glibc-static
- CentOS
$ sudo yum install glibc-static
- CentOS
- zlib-devel
- CentOS/Fedora
$ sudo yum install zlib-devel
- Ubuntu
$ sudo apt install zlib1g-dev
- CentOS/Fedora
- pkg-config
- CentOS/Fedora
$ sudo yum install pkg-config
- Ubuntu
$ sudo apt install pkg-config
- CentOS/Fedora
- OpenSSL 1.1.0g [Download]
$ curl -OL https://www.openssl.org/source/openssl-1.1.0g.tar.gz $ tar xvfz openssl-1.1.0g.tar.gz $ cd openssl-1.1.0g $ ./config shared no-idea no-mdc2 no-rc5 no-ec2m no-ecdh no-ecdsa && make && make install
- libvpx 1.7.0 [Download]
$ curl -OL https://chromium.googlesource.com/webm/libvpx/+archive/v1.7.0.tar.gz $ mkdir libvpx-1.7.0 $ cd libvpx-1.7.0 $ tar xvfz ../v1.7.0.tar.gz $ ./configure --enable-shared --disable-static --disable-examples && make && make install
- Opus 1.1.3 [Download]
$ curl -OL https://archive.mozilla.org/pub/opus/opus-1.1.3.tar.gz $ tar xvfz opus-1.1.3.tar.gz $ cd opus-1.1.3 $ autoreconf -f -i $ ./configure --enable-shared --disable-static && make && make install
- libSRTP 2.2.0 [Download]
$ curl -OL https://github.com/cisco/libsrtp/archive/v2.2.0.tar.gz $ tar xvfz v2.2.0.tar.gz $ cd libsrtp-2.2.0 $ ./configure && make && make install
- FFmpeg 3.4.2 [Download]
$ curl -OL https://www.ffmpeg.org/releases/ffmpeg-3.4.2.tar.xz $ xz -d ffmpeg-3.4.2.tar.xz $ tar xvf ffmpeg-3.4.2.tar $ cd ffmpeg-3.4.2 $ ./configure \ --enable-shared \ --disable-static \ --extra-libs=-ldl \ --disable-ffplay \ --enable-ffprobe \ --disable-ffserver \ --disable-avdevice \ --disable-doc \ --disable-symver \ --disable-debug \ --disable-indevs \ --disable-outdevs \ --disable-devices \ --disable-hwaccels \ --disable-encoders \ --enable-zlib \ --disable-filters \ --disable-vaapi \ --enable-libopus \ --enable-libvpx \ --enable-encoder=libvpx_vp8,libvpx_vp9,libopus \ --disable-decoder=tiff \ --enable-filter=aresample,aformat,channelmap,channelsplit,scale,transpose,fps,settb,asettb && make && make install
You can build OME source with the following command. The built binary can be found in the bin/DEBUG
or bin/RELEASE
directory.
$ cd [OME_PATH]/src
$ make
When you launch it for the first time, you must create configuration files to the location where the binary exists. The default configuration files are located at conf
directory, so you can copy and use them.
$ cd [OME_PATH]/src/bin/DEBUG
$ cp -R ../../../docs/conf_examples conf
$ cat conf/Server.xml
<?xml version="1.0" encoding="UTF-8"?>
<Server>
<Name>OvenMediaEngine</Name>
<Hosts>
<Host>
<Name>default</Name>
<!-- TODO: NEED TO CHANGE THIS IP ADDRESS -->
<IPAddress>127.0.0.1</IPAddress>
<MaxConnection>0</MaxConnection>
<!--
<WebConsole>
<Port>8080</Port>
<MaxConnection>10</MaxConnection>
</WebConsole>
<OpenAPI>
<Port>8081</Port>
<MaxConnection>10</MaxConnection>
</OpenAPI>
-->
<Provider>
<Port>1935/tcp</Port>
<MaxConnection>10</MaxConnection>
</Provider>
<Publisher>
<!-- TODO: NEED TO CHANGE THIS IP ADDRESS -->
<IPAddress>127.0.0.1</IPAddress>
<Port>1936/udp</Port>
<MaxConnection>10</MaxConnection>
<WebRTC>
<!-- millisecond -->
<SessionTimeout>30000</SessionTimeout>
<!-- port[/protocol], port[/protocol], ... -->
<CandidatePort>45050/udp</CandidatePort>
<SignallingPort>3333/tcp</SignallingPort>
</WebRTC>
</Publisher>
<Applications-Ref>${ome.AppHome}/conf/Applications.xml</Applications-Ref>
</Host>
</Hosts>
</Server>
The first <IPAddress>
in the Server.xml
configuration file uses the IP address to listen to the RTMP stream being published, otherwise it uses the IP of the system. If the value of this item is not set correctly, the encoder may not be connected.
The second <IPAddress>
in <Publisher>
is used to specify the IP address that the WebSocket server uses to listen to WebRTC Signaling, otherwise it uses the first <IPAddress>
in the 'Server.xml' file. If the value of this item is not set correctly, playback may not be performed normally.
$ ./main
[07-03 12:29:20.705] I 18780 OvenMediaEngine | main.cpp:22 | OvenMediaEngine v0.1.1 (build: 18062600) is started on [Dim-Ubuntu] (Linux x86_64 - 4.15.0-23-generic, #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018)
...
If the server is running normally, you can use an encoder such as OBS or XSplit to publish a live stream. To publish a live stream on the encoder, you need to set the RTMP URL as it is below.
rtmp://<OME Server IP>[:<OME RTMP Port>]/<Application name>/<Stream name>
Here's what each item means:
<OME Server IP>
: It is related to the first<IPAddress>
in theServer.xml
file above. Normally, you can use<IPAddress>
as is.<OME RTMP Port>
: You can use<Port>
of<Provider>
inServer.xml
file above. If you are using the default settings, RTMP default port (1935) is used. (If you set the default port (1935), the port can be omitted.)<Application name>
: This value corresponds to<Name>
of<Application>
inconf/Applications.xml
file. If you are using the default settings, you can useapp
.<Stream name>
: Name to distinguish the live stream, which can be determined by the publisher. The determinedstream name
will affect the URL to be played later on the player side.
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 live stream being published can be played on the latest browsers that support WebRTC, such as Chrome. When playing over WebRTC, you need a special step called Signaling. These steps are processed automatically so you can easily make it work together if you are using 'OvenPlayer', which implements OvenMediaEngine's Signaling specification. Please refer to the following source code to create an HTML page that is linked with [OvenPlayer] (https://github.com/AirenSoft/OvenPlayer). When you open this HTML page in your browser, the live stream you are publishing will play. (For more information on how to work with OvenPlayer, please refer to OvenPlayer Quick Start.)
<!-- import OvenPlayer css -->
<link rel="stylesheet" href="ovenplayer/css/player.css">
<!-- import OvenPlayer javascript -->
<script src="ovenplayer/ovenplayer.js"></script>
<!-- OvenPlayer will be added this area. -->
<div id="player_id"></div>
<script>
// Initialize OvenPlayer.
var player = OvenPlayer.create("player_id", {
sources: [{type : "webrtc", file : "<WebRTC Signalling URL>", label : "1080"}]
});
</script>
Please note that the WebRTC Signaling URL in the sample code above is similar to an RTMP URL and consists of the following:
ws://<OME Server IP>:[<OME Signalling Port>/<Application name>/<Stream name>
<OME Server IP>
: This is related to the second<IPAddress>
element inServer.xml
set up above. Normally, you can use the value of<IPAddress>
.<OME Signaling Port>
: You can use the value of<SignalingPort>
inServer.xml
above. If you using the default settings, it will be the Signaling Default Port (3333).<Application name>
: Enter the value of<Application name>
in the encoder as the value corresponding to<Name>
in the<Application>
inconf/Applications.xml
.<Stream name>
: This is the name to distinguish the live stream. OvenMediaEngine uses the_o
suffix to distinguish it from the output of<Stream name>
in the encoder.
For example, if the RTMP URL is rtmp://192.168.0.1:1935/app/stream
, the WebRTC Signaling URL will be ws://192.168.0.1:3333/app/stream_o
.
Please read Guidelines and our Rules.
The following features will be supported, and check the milestones for more details.
- Audio support
- Various input stream
- file, webrtc, mpeg-ts
- Various output protocols
- hls, mpeg-dash, ...
- Various encoding profiles
- h.264, vp9, av1, ...
- Clustering
- Origin-Edge architecture
- Virtual host
- Web console
- Statistics
- Recording live streams
- Webrtc extensions
OvenMediaEngine is licensed under the GPLv2 license.