Noxalus / Multi-Streaming-Server

A NGINX server with RTMP module to send video streaming to multiple services simultaneously (Youtube, Twitch, Dailymotion, Hitbox, Beam, etc...).
173 stars 41 forks source link

Obs restart loop #14

Closed psegovias closed 6 years ago

psegovias commented 6 years ago

Fresh install i got the server running, but obs go into restart loop.

Here my log files

ACCESS

MY-IP [13/Mar/2018:21:39:07 -0300] PUBLISH "live" "" "" - 341 409 "" "FMLE/3.0 (compatible; FMSc/1.0)" (0s)
MY-IP [13/Mar/2018:21:39:18 -0300] PUBLISH "live" "" "" - 341 409 "" "FMLE/3.0 (compatible; FMSc/1.0)" (0s)
MY-IP [13/Mar/2018:21:39:30 -0300] PUBLISH "live" "" "" - 341 409 "" "FMLE/3.0 (compatible; FMSc/1.0)" (0s)
MY-IP [13/Mar/2018:21:39:41 -0300] PUBLISH "live" "" "" - 341 409 "" "FMLE/3.0 (compatible; FMSc/1.0)" (0s)
MY-IP [13/Mar/2018:21:39:52 -0300] PUBLISH "live" "" "" - 341 409 "" "FMLE/3.0 (compatible; FMSc/1.0)" (0s)
MY-IP [13/Mar/2018:21:40:06 -0300] PUBLISH "live" "" "" - 341 409 "" "FMLE/3.0 (compatible; FMSc/1.0)" (0s)

ERROR

2018/03/13 21:39:29 [info] 25079#0: *256 client connected 'MY-IP'
2018/03/13 21:39:29 [info] 25079#0: *256 client connected 'MY-IP'
2018/03/13 21:39:29 [info] 25079#0: *256 connect: app='live' args='' flashver='FMLE/3.0 (compatible; FMSc/1.0)' swf_url='rtmp://DEDICATED-IP:1935/live' tc_url='rtmp://DEDICATED-IP:1935/live' page_url='' acodecs=0 vcodecs=0 object_encoding=0, client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:29 [info] 25079#0: *256 connect: app='live' args='' flashver='FMLE/3.0 (compatible; FMSc/1.0)' swf_url='rtmp://DEDICATED-IP:1935/live' tc_url='rtmp://DEDICATED-IP:1935/live' page_url='' acodecs=0 vcodecs=0 object_encoding=0, client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 createStream, client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 createStream, client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 publish: name='' args='' type=live silent=0, client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 publish: name='' args='' type=live silent=0, client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 exec: starting managed child 'ffmpeg', client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 exec: starting managed child 'ffmpeg', client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 relay: create push name='' app='' playpath='' url='localhost/youtube/${name}', client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 relay: create push name='' app='' playpath='' url='localhost/youtube/${name}', client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 relay: create push name='' app='' playpath='' url='localhost/dailymotion/${name}', client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 relay: create push name='' app='' playpath='' url='localhost/dailymotion/${name}', client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 relay: create push name='' app='' playpath='' url='localhost/hitbox/${name}', client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 relay: create push name='' app='' playpath='' url='localhost/hitbox/${name}', client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [error] 25079#0: *256 access forbidden by rule, client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [error] 25079#0: *256 access forbidden by rule, client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [error] 25079#0: *256 access forbidden by rule, client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 disconnect, client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 disconnect, client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 deleteStream, client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 deleteStream, client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 exec: terminating child 27861, client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *256 exec: terminating child 27861, client: MY-IP, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *259 disconnect, client: localhost/hitbox/${name}, server: ngx-relay
2018/03/13 21:39:30 [info] 25079#0: *259 disconnect, client: localhost/hitbox/${name}, server: ngx-relay
2018/03/13 21:39:30 [info] 25079#0: *259 deleteStream, client: localhost/hitbox/${name}, server: ngx-relay
2018/03/13 21:39:30 [info] 25079#0: *259 deleteStream, client: localhost/hitbox/${name}, server: ngx-relay
2018/03/13 21:39:30 [info] 25079#0: *258 disconnect, client: localhost/dailymotion/${name}, server: ngx-relay
2018/03/13 21:39:30 [info] 25079#0: *258 disconnect, client: localhost/dailymotion/${name}, server: ngx-relay
2018/03/13 21:39:30 [info] 25079#0: *258 deleteStream, client: localhost/dailymotion/${name}, server: ngx-relay
2018/03/13 21:39:30 [info] 25079#0: *258 deleteStream, client: localhost/dailymotion/${name}, server: ngx-relay
2018/03/13 21:39:30 [info] 25079#0: *257 disconnect, client: localhost/youtube/${name}, server: ngx-relay
2018/03/13 21:39:30 [info] 25079#0: *257 disconnect, client: localhost/youtube/${name}, server: ngx-relay
2018/03/13 21:39:30 [info] 25079#0: *257 deleteStream, client: localhost/youtube/${name}, server: ngx-relay
2018/03/13 21:39:30 [info] 25079#0: *257 deleteStream, client: localhost/youtube/${name}, server: ngx-relay
2018/03/13 21:39:30 [info] 25079#0: *260 client connected '127.0.0.1'
2018/03/13 21:39:30 [info] 25079#0: *260 client connected '127.0.0.1'
2018/03/13 21:39:30 [info] 25079#0: *260 disconnect, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *260 disconnect, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *260 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *260 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *261 client connected '127.0.0.1'
2018/03/13 21:39:30 [info] 25079#0: *261 client connected '127.0.0.1'
2018/03/13 21:39:30 [info] 25079#0: *261 disconnect, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *261 disconnect, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *261 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *261 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *262 client connected '127.0.0.1'
2018/03/13 21:39:30 [info] 25079#0: *262 client connected '127.0.0.1'
2018/03/13 21:39:30 [info] 25079#0: *262 disconnect, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *262 disconnect, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *262 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/13 21:39:30 [info] 25079#0: *262 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/13 21:39:30 [notice] 25079#0: signal 17 (SIGCHLD) received
2018/03/13 21:39:30 [notice] 25079#0: signal 17 (SIGCHLD) received
2018/03/13 21:39:30 [notice] 25079#0: signal 17 (SIGCHLD) received
2018/03/13 21:39:30 [alert] 25079#0: unknown process 27861 exited on signal 9
2018/03/13 21:39:30 [alert] 25079#0: unknown process 27861 exited on signal 9
2018/03/13 21:39:30 [alert] 25079#0: unknown process 27861 exited on signal 9
2018/03/13 21:39:30 [info] 25079#0: epoll_wait() failed (4: Interrupted system call)
2018/03/13 21:39:30 [info] 25079#0: epoll_wait() failed (4: Interrupted system call)
Noxalus commented 6 years ago

Did you allow your IP address from the Nginx configuration?

Make sure you replaced {{ my_ip_address }} here by the one specified in the error log:

*256 access forbidden by rule, client: MY-IP, server: 0.0.0.0:1935

psegovias commented 6 years ago

This way?

allow publish X.X.X.X;

OR ?

allow publish {{ X.X.X.X }};

Noxalus commented 6 years ago

This way:

allow publish X.X.X.X;

I should post a real Nginx config file example in the Wiki, it would be clearer.

psegovias commented 6 years ago

Stream working perfect on Twitch, but not /LIVE on dedicated server site here's my log:

2018/03/14 22:07:00 [info] 10190#0: *3 relay: create push name='' app='' playpath='' url='localhost/youtube/${name}', client: MY-IP, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *3 relay: create push name='' app='' playpath='' url='localhost/youtube/${name}', client: MY-IP, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *3 relay: create push name='' app='' playpath='' url='localhost/dailymotion/${name}', client: MY-IP, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *3 relay: create push name='' app='' playpath='' url='localhost/dailymotion/${name}', client: MY-IP, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *3 relay: create push name='' app='' playpath='' url='localhost/hitbox/${name}', client: MY-IP, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *3 relay: create push name='' app='' playpath='' url='localhost/hitbox/${name}', client: MY-IP, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *468 client connected '127.0.0.1'
2018/03/14 22:07:00 [info] 10190#0: *468 client connected '127.0.0.1'
2018/03/14 22:07:00 [info] 10190#0: *469 client connected '127.0.0.1'
2018/03/14 22:07:00 [info] 10190#0: *469 client connected '127.0.0.1'
2018/03/14 22:07:00 [info] 10190#0: *470 client connected '127.0.0.1'
2018/03/14 22:07:00 [info] 10190#0: *470 client connected '127.0.0.1'
2018/03/14 22:07:00 [info] 10190#0: *470 connect: app='hitbox' args='' flashver='LNX.11,1,102,55' swf_url='' tc_url='rtmp://localhost/hitbox' page_url='' acodecs=3575 vcodecs=252 object_encoding=0, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *470 connect: app='hitbox' args='' flashver='LNX.11,1,102,55' swf_url='' tc_url='rtmp://localhost/hitbox' page_url='' acodecs=3575 vcodecs=252 object_encoding=0, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *470 connect: application not found: 'hitbox', client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *470 connect: application not found: 'hitbox', client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *469 connect: app='dailymotion' args='' flashver='LNX.11,1,102,55' swf_url='' tc_url='rtmp://localhost/dailymotion' page_url='' acodecs=3575 vcodecs=252 object_encoding=0, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *469 connect: app='dailymotion' args='' flashver='LNX.11,1,102,55' swf_url='' tc_url='rtmp://localhost/dailymotion' page_url='' acodecs=3575 vcodecs=252 object_encoding=0, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *469 connect: application not found: 'dailymotion', client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *469 connect: application not found: 'dailymotion', client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *468 connect: app='youtube' args='' flashver='LNX.11,1,102,55' swf_url='' tc_url='rtmp://localhost/youtube' page_url='' acodecs=3575 vcodecs=252 object_encoding=0, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *468 connect: app='youtube' args='' flashver='LNX.11,1,102,55' swf_url='' tc_url='rtmp://localhost/youtube' page_url='' acodecs=3575 vcodecs=252 object_encoding=0, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *468 connect: application not found: 'youtube', client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *468 connect: application not found: 'youtube', client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *470 disconnect, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *470 disconnect, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *470 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *470 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *469 disconnect, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *469 disconnect, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *469 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *469 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *468 disconnect, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *468 disconnect, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *468 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *468 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
2018/03/14 22:07:00 [info] 10190#0: *467 disconnect, client: localhost/hitbox/${name}, server: ngx-relay
2018/03/14 22:07:00 [info] 10190#0: *467 disconnect, client: localhost/hitbox/${name}, server: ngx-relay
2018/03/14 22:07:00 [info] 10190#0: *467 deleteStream, client: localhost/hitbox/${name}, server: ngx-relay
2018/03/14 22:07:00 [info] 10190#0: *467 deleteStream, client: localhost/hitbox/${name}, server: ngx-relay
2018/03/14 22:07:00 [info] 10190#0: *466 disconnect, client: localhost/dailymotion/${name}, server: ngx-relay
2018/03/14 22:07:00 [info] 10190#0: *466 disconnect, client: localhost/dailymotion/${name}, server: ngx-relay
2018/03/14 22:07:00 [info] 10190#0: *466 deleteStream, client: localhost/dailymotion/${name}, server: ngx-relay
2018/03/14 22:07:00 [info] 10190#0: *466 deleteStream, client: localhost/dailymotion/${name}, server: ngx-relay
2018/03/14 22:07:00 [info] 10190#0: *465 disconnect, client: localhost/youtube/${name}, server: ngx-relay
2018/03/14 22:07:00 [info] 10190#0: *465 disconnect, client: localhost/youtube/${name}, server: ngx-relay
2018/03/14 22:07:00 [info] 10190#0: *465 deleteStream, client: localhost/youtube/${name}, server: ngx-relay
2018/03/14 22:07:00 [info] 10190#0: *465 deleteStream, client: localhost/youtube/${name}, server: ngx-relay
Noxalus commented 6 years ago

What do you mean by /LIVE?

The live application in the Nginx configuration file is just here to transmit your stream to other services.

Can you show me you nginx.conf file (without your stream keys or your ip address), it seems you removed application blocks for Hitbox, Youtube and Dailymotion but you still push the RTMP stream to them in the live application.

psegovias commented 6 years ago

Sorry I misunderstood the /live link on readme.

Here's my config file:

#user  nobody;
worker_processes  1;

error_log  logs/error.log  debug;
error_log  logs/error.log  notice;
error_log  logs/error.log  info;
pid        logs/nginx.pid;

events {
    worker_connections  1024;
}

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

    sendfile            on;
    keepalive_timeout   65;

    server {
        listen          8080;
        server_name     localhost;

        # rtmp stat
        location /stat {
            rtmp_stat all;
            rtmp_stat_stylesheet stat.xsl;
        }
        location /stat.xsl {
            # you can move stat.xsl to a different location
            root html;
        }

        # rtmp control
        location /control {
            rtmp_control all;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

rtmp {
    server {
        listen 1935;
        chunk_size 8192;

        application live {
            live on;
            record off;

            allow publish X.X.X.X;
            deny publish all;
            push rtmp://localhost/facebook/${name};

            exec ffmpeg -i rtmp://localhost/$app/$name -c:v libx264 -preset veryfast -c:a copy 
                -threads 2
                -c:v libx264
                -profile:v main
                -preset:v veryfast
                -level 4.2
                -b:v 2000k
                -bufsize 2000k
                -maxrate 2000k
                -s 1280x720 -r 30
                -g 120 -keyint_min 60 -x264opts "keyint=120:min-keyint=120:no-scenecut"
                -tune zerolatency
                -c:a copy
                -f flv 
                rtmp://localhost/twitch/${name};

        }

        application twitch {
            live on;
            record off;

            allow publish 127.0.0.1;
            deny publish all;

            push rtmp://live-cdg.twitch.tv/app/XXXXt;
        }

        application facebook {
            live on;
            record off;

            allow publish 127.0.0.1;
            deny publish all;

            push rtmp://live-api.facebook.com:80/rtmp/XXXXX;
        }       

    }
}
Noxalus commented 6 years ago

Nothing wrong in your nginx.conf, are you sure that is this one that Nginx uses? (I don't see any references to Hitbox, Youtube and Dailymotion as mentionned by the log file)

So, when you say Twitch stream is working well, it's using its RTMP URL directly into OBS?

Make sure that the RTMP URL contains the IP of your dedicated server: rtmp://X.X.X.X:1935/live

You can also try to restart Nginx to make sure the configuration file are reloaded: /etc/init.d/nginx start

psegovias commented 6 years ago

Config works fine, last night i test twitch and facebook at the same time, no problem at all, is weird the references to hitbox or youtube, im using the nginx.conf from nginx/conf on the projects folder.

Noxalus commented 6 years ago

So you don't have any problem anymore? What did you change?

Can I close this issue?

psegovias commented 6 years ago

i only restart the server and works.... Thanks for your time @Noxalus now i go for https://github.com/Noxalus/Live-Stream-Chat-Retriever 👍