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.mdCreating the Dockerfile
Create a Dockerfile for OvenMediaEngine:
FROM airensoft/ovenmediaengine:latest
# Create directories for persistent dataRUN mkdir -p /opt/ovenmediaengine/recordsRUN mkdir -p /opt/ovenmediaengine/logs
# Copy custom configurationCOPY Server.xml /opt/ovenmediaengine/bin/origin_conf/Server.xml
# Expose ports# RTMP ingestEXPOSE 1935/tcp
# SRT ingestEXPOSE 9999/udp
# WebRTC signaling and ICEEXPOSE 3333/tcpEXPOSE 3334/tcpEXPOSE 10000-10005/udp
# HLS/DASH deliveryEXPOSE 80/tcpEXPOSE 443/tcp
# API portEXPOSE 8081/tcp
# Use default entrypointServer 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
| Port | Protocol | Description |
|---|---|---|
| 1935 | TCP | RTMP ingest |
| 9999 | UDP | SRT ingest |
| 3333 | TCP | WebRTC signaling (HTTP) |
| 3334 | TCP | WebRTC signaling (HTTPS) |
| 10000-10005 | UDP | WebRTC ICE candidates |
| 80 | TCP | HLS/DASH delivery (HTTP) |
| 443 | TCP | HLS/DASH delivery (HTTPS) |
| 8081 | TCP | REST API |
Deploying OvenMediaEngine on Klutch.sh
Follow these steps to deploy your streaming server:
- 1935 TCP: RTMP ingest
- 3333-3334 TCP: WebRTC signaling
- 80/443 TCP: HLS/DASH delivery
- UDP ports: May require special configuration for WebRTC
- Check deployment logs for startup messages
- Access the API endpoint for server status
- Test with a simple RTMP stream
Push Your Repository to GitHub
Initialize and push your repository:
git initgit add Dockerfile Server.xml .dockerignore README.mdgit commit -m "Initial OvenMediaEngine configuration"git remote add origin https://github.com/yourusername/ome-deploy.gitgit push -u origin mainCreate 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:
Attach Persistent Volumes
Add persistent storage:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/opt/ovenmediaengine/records | 100 GB | Stream recordings |
/opt/ovenmediaengine/logs | 10 GB | Application logs |
Deploy Your Application
Click Deploy to start the build process.
Verify Deployment
After deployment, verify the server is running:
Streaming Workflows
RTMP Ingest to WebRTC Playback
Ultra-low latency workflow:
- Stream from OBS to RTMP endpoint
- OME transcodes and packages
- Viewers watch via WebRTC with sub-second latency
OBS Settings:
Server: rtmp://your-app-name.klutch.sh/appStream Key: streamPlayback URL:
wss://your-app-name.klutch.sh:3334/app/streamRTMP to HLS for Compatibility
Broad compatibility workflow:
- Stream via RTMP
- OME creates HLS segments
- Viewers watch on any device
Playback URL:
https://your-app-name.klutch.sh/app/stream/playlist.m3u8WebRTC Ingest and Playback
Lowest latency workflow:
- Broadcast from browser via WebRTC
- OME relays to viewers via WebRTC
- 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:
# Start recordingcurl -X POST "http://your-app-name.klutch.sh:8081/v1/vhosts/default/apps/app/streams/stream:startRecord"
# Stop recordingcurl -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:
curl "http://your-app-name.klutch.sh:8081/v1/vhosts/default/apps/app/streams"Server Statistics
Get server metrics:
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
- OvenMediaEngine Documentation
- OvenMediaEngine GitHub Repository
- OvenPlayer GitHub Repository
- OvenMediaEngine Docker Image
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
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.