Skip to content

WebRTC Server

Daniel Neto edited this page Sep 28, 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

'CertPath'=>'/etc/letsencrypt/live/'.$ServerHost.'/cert.pem'
'KeyPath'=>'/etc/letsencrypt/live/'.$ServerHost.'/privkey.pem'
'ChainCertPath'=>'/etc/letsencrypt/live/'.$ServerHost.'/chain.pem'

For example, if your AVideo site is installed on 'myavideosite.com' you MUST have the following files

'CertPath'=>'/etc/letsencrypt/live/myavideosite.com/cert.pem'
'KeyPath'=>'/etc/letsencrypt/live/myavideosite.com/privkey.pem'
'ChainCertPath'=>'/etc/letsencrypt/live/myavideosite.com/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
$webRTCServerURL = 'https://myavideoliveserver.com/liveStandalone/WebRTCServer/';
$OME_HLS_STREAM_PORT = 7770;
$OME_API_PORT = 7771;
$OME_SOCKET_PORT = 7772;
$OME_STREAM_PORT_TLS = 7773;
$OME_TCP_RELAY_ADDRESS = 7774;
$OME_ICE_CANDIDATES = '7775-7779';
$akey = 'mysecretkey';
$pushRTMP = false;

$files = array(
    'CertPath'=>'/etc/ssl/certs/cert.pem', 
    'KeyPath'=>'/etc/ssl/private/privkey.pem', 
    'ChainCertPath'=>'/etc/ssl/certs/chain.pem'
);

$akey

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

$pushRTMP

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

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

Clone this wiki locally