Skip to content

Deploying OvenMediaEngine

Introduction

OvenMediaEngine (OME) is an open-source, enterprise-grade streaming media server that enables ultra-low latency live streaming. Developed by AirenSoft, OME provides sub-second latency using WebRTC while supporting traditional protocols like RTMP for ingest and HLS/DASH for delivery.

Unlike traditional streaming servers that focus on one protocol, OvenMediaEngine acts as a universal streaming hub. It can receive streams via RTMP, SRT, or WebRTC, then simultaneously deliver to viewers using WebRTC (sub-second latency), LLHLS/LLDASH (low latency), or standard HLS/DASH (compatibility). This makes it ideal for interactive streaming, live sports, auctions, and gaming.

Key highlights of OvenMediaEngine:

  • Ultra-Low Latency: Sub-second latency with WebRTC streaming
  • Multiple Ingest Protocols: Accept streams via RTMP, SRT, WHIP, MPEG-TS, or WebRTC
  • Adaptive Bitrate: Automatic ABR ladder generation for multiple quality levels
  • WebRTC Delivery: Native WebRTC output for real-time streaming
  • HLS/DASH Output: Standard protocols for broad device compatibility
  • LLHLS/LLDASH: Low-latency variants for reduced delay
  • Transcoding: Built-in hardware and software transcoding
  • Recording: Record live streams to files
  • Thumbnail Generation: Create preview images from streams
  • Clustering: Scale horizontally for large audiences
  • API Control: REST API for stream management

This guide walks through deploying OvenMediaEngine on Klutch.sh using Docker, configuring streaming protocols, and setting up production streaming.

Why Deploy OvenMediaEngine on Klutch.sh

Deploying OvenMediaEngine on Klutch.sh provides several advantages:

Simplified Deployment: Klutch.sh automatically builds and deploys your streaming server. Push to GitHub, and your server deploys without manual intervention.

Persistent Configuration: Attach persistent volumes for recordings and configuration. Your streaming setup survives container restarts.

HTTPS by Default: Klutch.sh provides automatic SSL certificates, essential for WebRTC and secure streaming.

Scalable Resources: Allocate CPU and memory based on transcoding needs and viewer count.

Always-On Streaming: Your streaming server runs 24/7, ready for live broadcasts.

Custom Domains: Use professional domains for your streaming endpoints.

Low Latency: Cloud infrastructure provides low-latency connections for real-time streaming.

Prerequisites

Before deploying OvenMediaEngine on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your OME configuration
  • Basic familiarity with Docker and containerization concepts
  • Streaming software (OBS, FFmpeg) for testing
  • Understanding of streaming protocols (RTMP, WebRTC, HLS)

Understanding OvenMediaEngine Architecture

OvenMediaEngine processes streams through several stages:

Providers: Accept incoming streams via RTMP, SRT, MPEG-TS, WebRTC/WHIP, or file input.

Media Router: Routes streams between components, handling protocol translation.

Transcoder: Encodes streams to different bitrates and resolutions for ABR.

Publishers: Deliver streams via WebRTC, HLS, DASH, LLHLS, or LLDASH.

API Server: REST API for stream management and monitoring.

Preparing Your Repository

Create a GitHub repository containing your Dockerfile and configuration.

Repository Structure

ome-deploy/
├── Dockerfile
├── Server.xml
├── .dockerignore
└── README.md

Creating the Dockerfile

Create a Dockerfile for OvenMediaEngine:

FROM airensoft/ovenmediaengine:latest
# Create directories for persistent data
RUN mkdir -p /opt/ovenmediaengine/records
RUN mkdir -p /opt/ovenmediaengine/logs
# Copy custom configuration
COPY Server.xml /opt/ovenmediaengine/bin/origin_conf/Server.xml
# Expose ports
# RTMP ingest
EXPOSE 1935/tcp
# SRT ingest
EXPOSE 9999/udp
# WebRTC signaling and ICE
EXPOSE 3333/tcp
EXPOSE 3334/tcp
EXPOSE 10000-10005/udp
# HLS/DASH delivery
EXPOSE 80/tcp
EXPOSE 443/tcp
# API port
EXPOSE 8081/tcp
# Use default entrypoint

Server Configuration

Create a Server.xml configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<Server version="8">
<Name>OvenMediaEngine</Name>
<Type>origin</Type>
<IP>*</IP>
<Bind>
<Providers>
<RTMP>
<Port>1935</Port>
</RTMP>
<SRT>
<Port>9999</Port>
</SRT>
<WebRTC>
<Signalling>
<Port>3333</Port>
<TLSPort>3334</TLSPort>
</Signalling>
<IceCandidates>
<IceCandidate>*:10000-10005/udp</IceCandidate>
</IceCandidates>
</WebRTC>
</Providers>
<Publishers>
<HLS>
<Port>80</Port>
<TLSPort>443</TLSPort>
</HLS>
<DASH>
<Port>80</Port>
<TLSPort>443</TLSPort>
</DASH>
<WebRTC>
<Signalling>
<Port>3333</Port>
<TLSPort>3334</TLSPort>
</Signalling>
<IceCandidates>
<IceCandidate>*:10000-10005/udp</IceCandidate>
</IceCandidates>
</WebRTC>
</Publishers>
</Bind>
<VirtualHosts>
<VirtualHost>
<Name>default</Name>
<Applications>
<Application>
<Name>app</Name>
<Type>live</Type>
<Providers>
<RTMP/>
<SRT/>
<WebRTC/>
</Providers>
<Publishers>
<HLS>
<SegmentDuration>5</SegmentDuration>
<SegmentCount>3</SegmentCount>
</HLS>
<DASH>
<SegmentDuration>5</SegmentDuration>
<SegmentCount>3</SegmentCount>
</DASH>
<WebRTC>
<Timeout>30000</Timeout>
</WebRTC>
<LLHLS>
<SegmentDuration>5</SegmentDuration>
<PartDuration>0.5</PartDuration>
</LLHLS>
</Publishers>
</Application>
</Applications>
</VirtualHost>
</VirtualHosts>
</Server>

Port Reference

PortProtocolDescription
1935TCPRTMP ingest
9999UDPSRT ingest
3333TCPWebRTC signaling (HTTP)
3334TCPWebRTC signaling (HTTPS)
10000-10005UDPWebRTC ICE candidates
80TCPHLS/DASH delivery (HTTP)
443TCPHLS/DASH delivery (HTTPS)
8081TCPREST API

Deploying OvenMediaEngine on Klutch.sh

Follow these steps to deploy your streaming server:

    Push Your Repository to GitHub

    Initialize and push your repository:

    Terminal window
    git init
    git add Dockerfile Server.xml .dockerignore README.md
    git commit -m "Initial OvenMediaEngine configuration"
    git remote add origin https://github.com/yourusername/ome-deploy.git
    git push -u origin main

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project named “ome” or “streaming”.

    Create a New App

    Within your project, create a new app. Connect your GitHub account and select the repository containing your OME Dockerfile.

    Configure Network Traffic

    Configure the necessary ports for your deployment:

    • 1935 TCP: RTMP ingest
    • 3333-3334 TCP: WebRTC signaling
    • 80/443 TCP: HLS/DASH delivery
    • UDP ports: May require special configuration for WebRTC

    Attach Persistent Volumes

    Add persistent storage:

    Mount PathRecommended SizePurpose
    /opt/ovenmediaengine/records100 GBStream recordings
    /opt/ovenmediaengine/logs10 GBApplication logs

    Deploy Your Application

    Click Deploy to start the build process.

    Verify Deployment

    After deployment, verify the server is running:

    1. Check deployment logs for startup messages
    2. Access the API endpoint for server status
    3. Test with a simple RTMP stream

Streaming Workflows

RTMP Ingest to WebRTC Playback

Ultra-low latency workflow:

  1. Stream from OBS to RTMP endpoint
  2. OME transcodes and packages
  3. Viewers watch via WebRTC with sub-second latency

OBS Settings:

Server: rtmp://your-app-name.klutch.sh/app
Stream Key: stream

Playback URL:

wss://your-app-name.klutch.sh:3334/app/stream

RTMP to HLS for Compatibility

Broad compatibility workflow:

  1. Stream via RTMP
  2. OME creates HLS segments
  3. Viewers watch on any device

Playback URL:

https://your-app-name.klutch.sh/app/stream/playlist.m3u8

WebRTC Ingest and Playback

Lowest latency workflow:

  1. Broadcast from browser via WebRTC
  2. OME relays to viewers via WebRTC
  3. Sub-second end-to-end latency

Client Integration

OvenPlayer

Use OvenPlayer for playback:

<div id="player"></div>
<script src="https://cdn.jsdelivr.net/npm/ovenplayer/dist/ovenplayer.js"></script>
<script>
var player = OvenPlayer.create("player", {
sources: [
{
type: "webrtc",
file: "wss://your-app-name.klutch.sh:3334/app/stream"
},
{
type: "hls",
file: "https://your-app-name.klutch.sh/app/stream/playlist.m3u8"
}
]
});
</script>

Video.js with WebRTC

Use Video.js for broader compatibility:

<video id="player" class="video-js"></video>
<script>
var player = videojs('player');
player.src({
src: 'https://your-app-name.klutch.sh/app/stream/playlist.m3u8',
type: 'application/x-mpegURL'
});
</script>

Transcoding Configuration

ABR Ladder

Configure multiple quality levels in Server.xml:

<OutputProfiles>
<OutputProfile>
<Name>bypass</Name>
<OutputStreamName>${OriginStreamName}</OutputStreamName>
<Encodes>
<Video>
<Bypass>true</Bypass>
</Video>
<Audio>
<Bypass>true</Bypass>
</Audio>
</Encodes>
</OutputProfile>
<OutputProfile>
<Name>720p</Name>
<OutputStreamName>${OriginStreamName}_720p</OutputStreamName>
<Encodes>
<Video>
<Codec>h264</Codec>
<Width>1280</Width>
<Height>720</Height>
<Bitrate>2500000</Bitrate>
</Video>
<Audio>
<Codec>aac</Codec>
<Bitrate>128000</Bitrate>
</Audio>
</Encodes>
</OutputProfile>
</OutputProfiles>

Hardware Acceleration

Enable GPU transcoding (if available):

<Encodes>
<Video>
<Codec>h264_nvenc</Codec>
<!-- or h264_qsv for Intel -->
</Video>
</Encodes>

Recording

Enabling Recording

Configure recording in Server.xml:

<Publishers>
<FILE>
<FilePath>/opt/ovenmediaengine/records/${Stream}/${StartTime}.mp4</FilePath>
<FileInfoPath>/opt/ovenmediaengine/records/${Stream}/${StartTime}.xml</FileInfoPath>
</FILE>
</Publishers>

Recording API

Control recording via API:

Terminal window
# Start recording
curl -X POST "http://your-app-name.klutch.sh:8081/v1/vhosts/default/apps/app/streams/stream:startRecord"
# Stop recording
curl -X POST "http://your-app-name.klutch.sh:8081/v1/vhosts/default/apps/app/streams/stream:stopRecord"

Monitoring and API

Stream Status

Check active streams:

Terminal window
curl "http://your-app-name.klutch.sh:8081/v1/vhosts/default/apps/app/streams"

Server Statistics

Get server metrics:

Terminal window
curl "http://your-app-name.klutch.sh:8081/v1/stats/current"

Troubleshooting Common Issues

Stream Not Publishing

Symptoms: RTMP stream fails to connect.

Solutions:

  • Verify port 1935 is accessible
  • Check stream key matches configuration
  • Review server logs for errors
  • Test with simple FFmpeg command

WebRTC Playback Failing

Symptoms: WebRTC player cannot connect.

Solutions:

  • Ensure HTTPS is configured for signaling
  • Verify ICE candidate ports are open
  • Check STUN/TURN configuration
  • Review browser console for errors

High Latency

Symptoms: Stream delay is higher than expected.

Solutions:

  • Use WebRTC for lowest latency
  • Reduce segment duration for HLS
  • Enable LLHLS for low-latency HLS
  • Check network path latency

Transcoding Errors

Symptoms: Transcoded outputs not available.

Solutions:

  • Verify encoder configuration
  • Check server has sufficient CPU
  • Review transcoder logs
  • Test with bypass mode first

Additional Resources

Conclusion

Deploying OvenMediaEngine on Klutch.sh provides a powerful, flexible streaming solution with ultra-low latency capabilities. With support for multiple ingest and delivery protocols, OME serves as a complete streaming platform.

The combination of persistent storage for recordings, reliable uptime, and scalable resources makes Klutch.sh well-suited for hosting OvenMediaEngine. Whether streaming live events, gaming content, or interactive broadcasts, your self-hosted streaming server delivers professional-grade performance.

Start with RTMP ingest and HLS delivery, then add WebRTC for ultra-low latency as your needs grow. With OvenMediaEngine on Klutch.sh, you own your streaming infrastructure.