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

Could not connect to server #2

Closed sigvenss closed 8 years ago

sigvenss commented 8 years ago

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

sigvenss commented 8 years ago

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

sigvenss commented 8 years ago

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

Noxalus commented 8 years ago

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 ;)

Noxalus commented 8 years ago

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

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

sigvenss commented 8 years ago

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?

Noxalus commented 8 years ago

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.

sigvenss commented 8 years ago

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

Noxalus commented 8 years ago

You're welcome ;)