Stream to Multiple Streaming services

In this guide we will make a service similar to restream.io 

You will need a Ubuntu 16.04 (or newer) Linux VPS with 1 core and 1GB ram.

Once you have that VPS up and running connect to it via SSH with root credentials

Then type:

  • apt-get update
  • apt-get upgrade
  • apt-get install git libpcre3 libpcre3-dev build-essential libssl-dev

There is chance some extra packages are needed in latest version if you get errors at the ./configure command below then give this command as well

  • apt-get install zlibc zlib1g zlib1g-dev

Then get the latest versions:

  • wget http://nginx.org/download/nginx-1.15.6.tar.gz
  • tar xzf nginx-1.15.6.tar.gz
  • git clone https://github.com/arut/nginx-rtmp-module.git

Then enter the dir of nginx

  • cd nginx-1.15.6
  • ./configure --add-module=/root/nginx-rtmp-module --with-http_ssl_module 
  • make
  • make install

Once it is finished you need to edit the nginx.conf to look something like this:

  • nano /usr/local/nginx/conf/nginx.conf

 

#user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;

events {
worker_connections 1024;
}

rtmp {
server {
listen 1935;
chunk_size 4096;
application live {
record off;
live on;
push rtmp://live-cdg.twitch.tv/app/live_your_key;
push rtmp://ingest-osl.mixer.com:1935/beam/your_key;
push rtmp://live.hitbox.tv/push/your_user?key=your_key;
push rtmp://a.rtmp.youtube.com/live2/your_key;
push rtmp://de.pscp.tv:80/x/your_key;
}
}
}

http {
include mime.types;
default_type application/octet-stream;

#log_format main ‘$remote_addr – $remote_user [$time_local] “$request” ‘
# ‘$status $body_bytes_sent “$http_referer” ‘
# ‘”$http_user_agent” “$http_x_forwarded_for”‘;

#access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

server {
listen 80;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

location / {
root html;
index index.html index.htm;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}

# deny access to .htaccess files, if Apache’s document root
# concurs with nginx’s one
#
#location ~ /\.ht {
# deny all;
#}

}

# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;

# location / {
# root html;
# index index.html index.htm;
# }
#}

# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;

# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;

# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;

# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;

# location / {
# root html;
# index index.html index.htm;
# }
#}

}

You can save your config file by pressing CTRL + X, then Y and Enter

Then give this command:

  • /usr/local/nginx/sbin/nginx

and everything should be working!
Open your OBS software and point your stream url to the IP of your VPS /live (or whatever you chose in the config above) example rtmp://1.2.3.4/live

You can stop the nginx by giving this command:

  • /usr/local/nginx/sbin/nginx -s stop

Written by: Μονομάχος

Comfuzio is a gamer since very young age, ahead of his era and Hellenic society in general. Fun and informative!

No comments yet.

E-Arena

Ηλεκτρονική Αρένα.

Παρουσιάσεις παιχνιδιών,

cheats, guides

Twitter

Radeon Software Crimson ReLive Edition 19.3.3 Adrenalin Edition Release Notes https://t.co/MLcBpFnsZd https://t.co/IoP4RHCvmd
Radeon Software Crimson ReLive Edition 19.3.2 Adrenalin Edition Release Notes https://t.co/Lc9L8yawat https://t.co/q2uLKsXs8o
XBOX ONE FIRMWARE UPDATE 5/3/2019 https://t.co/yMJSdOTqjw https://t.co/MbSOenOkz1

Flickr Widget