A few days ago. I watch movies with friend. And she say. Your "RTMP" server is so sucks.

let's build new server for RTMP

Prerequisites

  • Ubuntu Server 18.04+

Step 1 

Install nginx

sudo apt update
sudo apt install nginx

 

Step 2

Install libnginx-mod-rtmp

sudo apt install libnginx-mod-rtmp

 

Step 3

Add to configure file /etc/nginx/nginx.conf

sudo vi /etc/nginx/nginx.conf

Put to last of file

rtmp {
        server {
                listen 1935;
                chunk_size 4096;
                application live {
                        live on;
                        record off;
                }
        }
}

 

Step 4

Restart nginx service

sudo service nginx reload

 

Last step

open 1935 port in your firewall

sudo ufw allow 1935/tcp