Skip to content

WebRTC Server

Daniel Neto edited this page Aug 30, 2021 · 16 revisions

This server is based on OvenMediaEngine, we use this server to be able to digest the WebRTC webcam and restream it to our Nginx RTMP server.

Requirements

  • Docker Engine
  • Letsencrypt SSL Certificate or the following files
    'CertPath'=>'/etc/letsencrypt/live/'.$ServerHost.'/cert.pem', 
    'KeyPath'=>'/etc/letsencrypt/live/'.$ServerHost.'/privkey.pem', 
    'ChainCertPath'=>'/etc/letsencrypt/live/'.$ServerHost.'/chain.pem'

Requiriments to a separated server

If you are using a separate server for Livestream you will need to copy the standAloneFiles/WebRTCServer into your live server, and you will need to create the file standAloneFiles/WebRTCServer/configuration.php with the following content

<?php
$ServerHost = 'live.yourdomain.com';
$OME_API_PORT = 77771;
$OME_SOCKET_PORT = 77772;
$OME_STREAM_PORT_TLS = 77773;
$OME_TCP_RELAY_ADDRESS = 77774;
$OME_ICE_CANDIDATES = '77775-77779';
$akey = 'secretstring';
$pushRTMP = false;

Parameters

make sure you open all ports on your firewall

$ServerHost = 'live.yourdomain.com';

The hostname of your live server

$akey = 'secretstring';

Choose a secure key to allow your Streamer to communicate with your WebRTC server

$pushRTMP

OvenMediaEngine supports Push Publishing function that can retransmit live streams to other systems.

If it is equal to false we will restream the Webcam instead of push it, you should keep it false, We have notice better performance on the restream feature

Clone this wiki locally