Here is how to setup a relay server that should centralize all the video streaming flux of your
organization/school/company/etc.

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 streaming@nosuchcon.org so that the connexion gets authorized


Install:

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 http://nginx.org/download/nginx-1.7.5.tar.gz 4) wget --no-check-certificate https://github.com/arut/nginx-rtmp-module/archive/master.zip 5) tar zxvf nginx-1.7.5.tar.gz 6) unzip master.zip 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 http://46.105.42.29/player.tar.gz 14) tar zxvf player.tar.gz -C /var/www/ 15) sed -e 's/0.0.0.0/192.168.1.1/g' -i /var/www/player/index.html (you should of course replace 192.168.1.1 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://46.105.42.29/hls/live_low name=live_low static; pull rtmp://46.105.42.29/hls/live_mid name=live_mid static; pull rtmp://46.105.42.29/hls/live_hi name=live_hi static; hls_variant _low BANDWIDTH=512000; hls_variant _mid BANDWIDTH=1024000; hls_variant _hi BANDWIDTH=2048000; allow publish 127.0.0.1; 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/vnd.apple.mpegurl 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: streaming@nosuchcon.org