nginx-rtmp – Admin and Statistics page

RobinJack0r

Checkout: youtube.com/RobinJack0r | twitter.com/RobinJack0r | twitch.tv/Jack0r

You may also like...

17 Responses

  1. Miguel Granados says:

    Hi, excuse me, can you confirm that the stat page is a static page? Are there any way to make it update de data in real time? For example, like this: http://demo.nginx.com/status.html

    • RobinJack0r says:

      Yea, the rtmp stats are static. You can add a script to reload it every few seconds for example. But a real time update would probably involve quite some work :)

  2. Aztechnology says:

    First off, thank you for doing these videos, after looking for a way to do a picture in picture stream I eventually found your site and knew this was my best option. That being said, it’s pretty apparent I’m in over my head, I managed to set up a rudimentary server of my own after looking through your guides. But unfortunately things aren’t going smoothly for me :/ What I’m looking to do, is have me and my buddy stream to a single RTMP server that we can both access , then be able to watch them with an embedded JW player so we can create a PIP stream using OBS/Xsplit to upload to twitch/hitbox.

    I have created a HTML doc with parameters for the site and edited the nginx config. However, When I start the server, I am able to view the statistics page and stream to the server. But when I attempt to view the server all I see is
    http://i.imgur.com/OhFLeHm.png

    here are my files in pastebin, sorry to ask for extensive help, but if you could point me in the right direction I would be extremely
    grateful.

    [url=http://pastebin.com/weQf5QXD]RTMP server config[/url]
    [url=http://pastebin.com/viK0WepG]HTML config[/url]

    • RobinJack0r says:

      Hey, I have two ideas:
      make sure the stat.xsl is in your html folder and your jwplayer.js is in the assets folder (assets folder of course in the html folder). Then I noticed in your html file you use
      rtmp://192.168.1.231:1935/live1/flv:1080
      rtmp://72.219.133.114/live2/flv:720
      that should be
      rtmp://your.servers.ip:1935/live1/flv:1080
      rtmp://your.servers.ip:1935/live2/flv:720
      since both streams come from your server (thats the IP address you used for the stat file). In this case your.server.ip means the internet IP address of your server. If its located at home, your Internet Ip address. If you use a local network address, your friend could not watch it from the page. Now assuming he would use vlc player or a different software for playback anyway, and you want the page only for you, you could use your network IP of the server, the one you used for your stat file: rtmp//192.168.1.141:1935/…

      After you got the stat file and the jwplayer working I would also do a little change to the nginx.conf, which is my second idea. If I understood you correct, you both want to stream a Picture in Picture stream, so you both want to watch the stream of the other. In this case:
      application live1 {
      allow publish 192.168.1.231;
      deny publish all;
      allow play 192.168.0.0/24;
      allow play 72.219.133.114;
      deny play all;
      live on;
      meta copy;

      }
      application live2 {
      allow publish 72.219.133.114;
      deny publish all;
      allow play 192.168.0.0/24
      allow play 72.219.133.114;
      deny play all;
      live on;
      meta copy;
      }
      This allows your friend to playback both streams if he wants to check them or to see yours of course, and you can also check both as long as you use a PC/Tablet in your local network.

      • Aztechnology says:

        Thanks for the quick response, I’ve updated the files in accordance to what you said. For the server IP that absolutely made sense, I just wasn’t thinking clearly XD. unfortunately I’m still seeing the same thing when I load the page. I’m thinking it must have something to do with my HTML folder setup. I was watching the compiling for windows video (my friend doesn’t want to use a linux distro :/) and was following what I thought your HTML folder setup was.

        Here is what my html folder inside my nginx folder looks like, maybe I simply haven’t installed something properly?
        http://i.imgur.com/tuoAYt2.png

        • RobinJack0r says:

          Ahh, I think for the stat file to work correctly, you have to add port :8080 to the address, as you set the http server to use that port.
          For Jwplayer you should move the jwplayer files to a subfolder called “assets” in the html folder.
          (Or you change the html file to …script src=”jwplayer.js”… if you dont want a subfolder) Then the jwplayer should work.

          • Aztechnology says:

            Awesome, I got everything working, and now that I have a slightly better understanding of the file structure for this I can easily change it to handle video files etc.

            Now, simply put, what do I need to change in order for someone not on my LAN to upload and access my stream page? Above it seemed like you were saying I would need to use my public ip to host the server instead of a local one correct? Forgive my ignorance, I have very little experience with this.

          • Aztechnology says:

            Ignore my other post, you already answered this before, I’m just having a hard time understanding where my friend is streaming to using
            application live1 {
            allow publish 192.168.1.231;
            deny publish all;
            allow play 192.168.0.0/24;
            allow play 72.219.133.114;
            deny play all;
            live on;
            meta copy;

            }
            application live2 {
            allow publish 72.219.133.114;
            deny publish all;
            allow play 192.168.0.0/24
            allow play 72.219.133.114;
            deny play all;
            live on;
            meta copy;
            }

            I get that the server will recognize his stream and allow him to tap into my it, but obviously he can’t access my local IP when he isn’t on my LAN network. Can you elaborate a little? Or is my configuration only good for LAN streaming. If so, what can I do to open it to a defined outside IP? Do I just publish from my public IP instead?

          • RobinJack0r says:

            Oh, isnt the 72.219.. IP his? I thought you wanted him to stream to your live2 application with the streamkey “720” as set in the html file.
            So you would have to get your external/Internet IP (for example from whatsmyip.com) and give this to your friend, he would setup a Custom Server in OBS or Custom RTMP Stream in XSplit and use this ip for the server part: rtmp://internet.ip/live2
            And for the stream key 720 as mentioned.
            If the 72. IP in the config is not his internet IP you would have to change it in the nginx.conf so he is allowed to play both streams and publish to live2.

          • Aztechnology says:

            No the 72.219.etc IP is his, I’m just unaware of how he is supposed to stream to my server. He can’t use 192.168.1.141:1935/live2/720 can he? because that would entail he would be within my local network (which he is not). Or am I missing something? I do wan’t him to stream to my live2 app and be able to view the server and streams himself. To do this I need to use my external IP then correct? Do I need to change my html and nginx config to include my external IP instead of internal IP address then?

          • RobinJack0r says:

            No the nginx.conf just has to allow his IP access, so our configuration was fine. He just needs to stream to your servers internet/external ip. As mentioned, if the server is on your local network it should have the same IP as you if you check on whatsmyip or a similar site :)
            So if your external ip is for example 95.50.20.1 he would stream to rtmp://95.50.20.1/live2 with streamkey 720.

  3. Shihan Ali Khan says:

    Thanks for all tutorials

    sir i need some idea regarding hls streaming and how can i play stream on android and iphone
    (sorry for bad english)

  4. LevelPulse says:

    Hey,

    Thanks for the tutorial but i can’t seem to get JWPlayer working, i can fetch the stream via VLC but not JWplayer. Could it be because in VLC i can fetch the stream with 127.0.0.1/live/ but in JWPlayer it can’t do that but only do 127.0.0.1/live/flv