Here is how to setup a relay server that should centralize all the video streaming flux of your

This way, you will be able to save on bandwidth, using only one external connexion for all the users of
your internal network.

The following procedure will guide you through the configuration of your relay server. It will broadcast the flux using the HLS protocol over HTTP.

- Tests were conducted on an up-to-date Debian stable distribution,
- The relay doesn't have to be powerful. The determining factor is the network's bandwidth.

					     /!\ Warning /!\
You shall declare your relay's public IP at so that the connexion gets authorized


1) Install Debian Wheezy on the server and make sure it is up-to-date (apt-get update && apt-get upgrade). 2) apt-get install build-essential libpcre3 libpcre3-dev libssl-dev unzip 3) wget 4) wget --no-check-certificate 5) tar zxvf nginx-1.7.5.tar.gz 6) unzip 7) cd nginx-1.7.5 8) ./configure --add-module=../nginx-rtmp-module-master --with-http_ssl_module 9) make && make install 10) mkdir -p /var/www/stat /var/www/hls /var/www/player 11) cp ../nginx-rtmp-module-master/stat.xsl /var/www/stat/ 12) cd - 13) wget 14) tar zxvf player.tar.gz -C /var/www/ 15) sed -e 's/' -i /var/www/player/index.html (you should of course replace with the IP address or hostname that you will have given to your relay server)

Nginx is installed in /usr/local/nginx/. The config file is in /usr/local/nginx/conf/nginx.conf.
To launch the server: /usr/local/nginx/sbin/nginx To stop the server : /usr/local/nginx/sbin/nginx -s stop Statistics are avalable at: http://IP/stat The config file you should copy in /usr/local/nginx/conf/nginx.conf is:

#user nobody; worker_processes 1; events { worker_connections 1024; } rtmp { server { listen 1935; chunk_size 8192; application hls { live on; hls on; hls_path /var/www/hls; hls_nested on; pull rtmp:// name=live_low static; pull rtmp:// name=live_mid static; pull rtmp:// name=live_hi static; hls_variant _low BANDWIDTH=512000; hls_variant _mid BANDWIDTH=1024000; hls_variant _hi BANDWIDTH=2048000; allow publish; deny publish all; allow play all; } } } # HTTP can be used for accessing RTMP stats http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; # This URL provides RTMP statistics in XML location /stat { rtmp_stat all; rtmp_stat_stylesheet stat.xsl; } location /stat.xsl { root /var/www/stat/; } location /hls { # Serve HLS fragments types { application/ m3u8; video/mp2t ts; } root /var/www; add_header Cache-Control no-cache; } location / { root /var/www/player; add_header Cache-Control no-cache; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } } Send all your questions to: