Noxalus/Multi-Streaming-Server

Could not connect to server

sigvenss opened this issue · 8 comments

Hello, im having an issue when trying to stream through OBS. I get this message: Could not connnect to server 192.168.42.42:1935/live is offline. Try a different server (10061).

I am able to ping the VM from my PC.

here is my nginx.conf file:
test.txt

Also, i dont understand what the "application live" does. Can i remove this if im going to stream to for example streamup.com ?

Only thing i did with this config was remove the streaming services im not using, and removing the 2 lines that was the problem in the previous issue.

Thanks

Alright after googling around i realized i did many mistakes in my config.
Now it works when i use this config:
test.txt

Hello,

I think you have errors in your Nginx configuration file, and it's related to your second question.

application live part contains the instruction to execute if you stream to rtmp://192.168.42.42:1935/live. If you want to stream to streamup.com directly, you need to change the RTMP URL in OBS by this: rtmp://192.168.42.42:1935/streamup.

In your conf, you let the the push to the applications that you removed in the live application:

application live {
    live on;
    record off;

    push rtmp://localhost/youtube/${name};

    exec ffmpeg -i rtmp://localhost/$app/$name -c:v libx264 -preset veryfast -c:a copy 
        -b:v 3500k 
        -bufsize 3500k
        -maxrate 3500k 
        -s 1280x720 -r 30
        -f flv rtmp://localhost/twitch/$name;

    push rtmp://localhost/dailymotion/${name};
    push rtmp://localhost/hitbox/${name};
}

In your configuration, youtube, twitch, dailymotion and hitbox application blocks didn't exist anymore. You should replace the live application by something like that:

application live {
    live on;
    record off;

    push rtmp://localhost/streamup/${name};
}

But if you have only one push in your live application, you should call rtmp://192.168.42.42:1935/streamup directly instead. But it would be easier to call rtmp://origin.streamuplive.com/app{{ my_key }} :D But I suppose that you want to stream to more services (if not, you you would not be here :p), so create an application for each services that you want and add a push command into your live application to this new applications like I did for streamup application above.

To check if you have an error in your Nginx configuration file, you can access to the VM through SSH (using vagrant ssh in a command prompt at the project's root folder) and launch this command: nginx -s stop && nginx.

I hope that it will help you. Let me know when you resolved your problems ;)

Oops, didn't see your message 5 minutes ago :s

So it's good for you now? Any questions? Can I close the issue?

Alright, right now im streaming with this config:

rtmp {
    server {
        listen 1935;
        chunk_size 8192;

        application live {
            live on;
            record off;

        push rtmp://origin.streamuplive.com/app/KEY;
    push rtmp://streamboat.tv/app/KEY;
    push rtmp://streamifypublisher.com/live/KEY;    
        }       
            }
}

Any special reason you have not done it this way? Or is it possible to stream with different settings using your config?

Yes, doing like that will work, but having separated applications allows you to add specific commands for a specific service. Moreover, with this conf, you can't test each services individually.

Keeping the original Nginx config file that I provide with this project, but with some changes to adapt it to your case, you should have something like that:

rtmp
{
    server
    {
        listen 1935;
        chunk_size 8192;

        application live {
            live on;
            record off;

            push rtmp://localhost/streamup/${name};
            push rtmp://localhost/streamboat/${name};
            push rtmp://localhost/streamifypublisher/${name}; 
        }

        application streamup {
            live on;
            record off;

            push rtmp://origin.streamuplive.com/app/KEY;
        }

        application streamboat {
            live on;
            record off;

            push rtmp://streamboat.tv/app/KEY;
        }

        application streamifypublisher {
            live on;
            record off;

            push rtmp://streamifypublisher.com/live/KEY;
        }
    }
}

With this conf, you can stream to rtmp://192.168.42.42:1935/live to broadcast your stream over the 3 services at the same time, but you can also stream to rtmp://192.168.42.42:1935/streamup if you want to broadcast to streamuplive.com only for instance.

Okey now i get it!
I really appreciate your help and dedication.
Thank you so much!

You're welcome ;)