How to setup an rtmp server using nginx on OMV

  • This took me a while to figure out, so I thought I would share, in case this helps anybody else. I wanted a free way to re-stream my church's services to Facebook, YouTube, and SermonAudio. I was using Mobcrush, but there is an issue between Mobcrush and SermonAudio where SA can't receive the stream from Mobcrush for some reason. So I decided to create my own server using our Odroid HC2 which we use as a storage backup for all the sermons.


    I followed this tutorial exactly, but with a few modifications for my own system.


    I used PuTTY to SSH into the Odroid with root, and then typed cd /home
    Then I continued on with the instructions to install the tools to build nginx.
    However, before the section "Now we build nginx:" with the command line ./configure I had to type this in: apt-get install zlib1g-dev and then afterwards continued with building and installing nginx.


    Now, the default for this nginx server is port 80, which means it wants to use the port that my Odroid HC2 uses. Like, if I access my Odroid internally with 192.168.1.54, then that's technically 192.168.1.54:80. So I need to use a different port.


    I navigated to the nginx.conf by typing in: cd /usr/local/nginx/conf
    Then nano nginx.conf


    I then found this section:

    Code
    server {
            listen        80;
            server_name   localhost;


    And I changed port 80 to port 8275 (or whatever port of my choice; I just made that up), so it looked like this:



    Code
    server {
            listen        8275;
            server_name   localhost;

    Now to test the server, first I need to save, so I pressed ctrl + o and hit enter, and then ctrl + x to exit.


    I started the server by typing in (after I exited nano) /usr/local/nginx/sbin/nginx
    If I enter into my browser 192.168.1.54:8275 (whatever my Odroid internal IP is and the port I chose while editing the .conf file) and I see "Welcome to nginx!" I know that everything has installed correctly and is set up.


    I opened the config file again, and at the bottom, pasted this as my basic template (shift + insert pastes into Nano):

    Where rtmp://webcast.streamingplatform.com/streamingkey; is the streaming platform that I want to push my stream to. Underneath, I can add more platforms (like YouTube, Facebook, etc). I have to make sure that there is a ; after each line. This video is helpful and has more details.


    After I saved with Nano, I restarted nginx first with /usr/local/nginx/sbin/nginx -s stop then /usr/local/nginx/sbin/nginx


    The last modification from the tutorial is setting up my server with port forwarding. I forward the external port 1935 to whatever the port is that I picked in one of my earlier steps (ie 8275) for the internal port.


    So my server that I would put in OBS is rtmp://192.168.1.54/live


    I tested this out, and it worked perfectly! I also changed my Odroid internal IP to my dynamic dns instead (so, rtmp://dynamicdns.user.com/live) as well.
    Also, Facebook restreaming is apparently different (because it's rtmps instead of rtmp) so this explains, and this YouTube video explains.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!