Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scene switching to [Offline] offline and stays there. #119

Open
moen1989 opened this issue Sep 14, 2022 · 18 comments
Open

Scene switching to [Offline] offline and stays there. #119

moen1989 opened this issue Sep 14, 2022 · 18 comments

Comments

@moen1989
Copy link

moen1989 commented Sep 14, 2022

Hello.

As the title says, NOALBS v2.7.2 working as intended, except the part where it auto switches to my offline scene and stays there, even when im live and have no issues with bitrate. I try to force it back to the live and/or brb scene, both with my Twitch bot chat command !live and !brb and physically in OBS. It switches to the scene i prefer, but "instantly" switches back to offline scene and stays there.

EDIT: For the record, my camera is sending its feed to AWS RTMP, which OBS Media Source is receiving. Dont know if that has something to do with it?

EDIT 2: I have also disabled / set all "streamServers" to "enabled": false. Thats because i do not have any servers to show stats. Shouldnt be a problem? Its not required to have stats enabled?

Any ideas?

@DigibitDK
Copy link
Contributor

DigibitDK commented Sep 14, 2022

You need to have a stats-page for Noalbs to auto-switch scenes. If you have no stats-page, then you cant use offline-scene, lowbitrate-scene etc. the way its intended.
You should just have a default scene with whatever name you want, and put your RTMP-feed there :) Dont mind all switcher-scenes if you dont have a stats-page available.

@moen1989
Copy link
Author

You need to have a stats-page for Noalbs to auto-switch scenes. If you have no stats-page, then you cant use offline-scene, lowbitrate-scene etc. the way its intended.
You should just have a default scene with whatever name you want, and put your RTMP-feed there :) Dont mind all switcher-scenes if you dont have a stats-page available.

Thank you! I will set up a stats-page then. Im in the early phases of testing this for IRL motorcycle streaming, so im trying to keep it cost-free for now.

Can i host my own stats-page with Nginx on my computer which has OBS and receive the AWS rtmp feed, or do i need to create that stats-page with Nginx server side(on AWS)?

Thank you for your assist so far!

@DigibitDK
Copy link
Contributor

If your NGINX-server is on AWS, then your stats-page will be there as well.
Something like: http://nginxserver:8085/stats (Or whatever port your stats-page is)

Your can run your NIGNX-RTMP on your PC as well, yes. Then your stats-page will be there as well. Your stats-page will always be where your RTMP-server is :)

@moen1989
Copy link
Author

If your NGINX-server is on AWS, then your stats-page will be there as well. Something like: http://nginxserver:8085/stats (Or whatever port your stats-page is)

Your can run your NIGNX-RTMP on your PC as well, yes. Then your stats-page will be there as well. Your stats-page will always be where your RTMP-server is :)

Thank you so much! I will try it out and post an update👍

@moen1989
Copy link
Author

moen1989 commented Sep 15, 2022

How is NOALBS going to work when my Nginx-RTMP server on AWS is not running OBS? OBS is running on my own PC and pulling the RTMP feed from my AWS. NOALBS needs access to obs-websocket right?

EDIT: I think i cracked the code! Hold on, i will test and update post about latest status.

@moen1989
Copy link
Author

NOALBS "spamming" this:

2022-09-15T18:11:58.510055Z INFO NOALBS{user=moenttv}:Switcher: noalbs::switcher: Switcher running
2022-09-15T18:12:00.860180Z ERROR NOALBS{user=moenttv}:Switcher: noalbs::stream_servers::nginx: Stats page (http://localhost:8000/stat.xsl) is unreachable
2022-09-15T18:12:01.875839Z ERROR NOALBS{user=moenttv}:Switcher: noalbs::stream_servers::sls: Stats page (http://127.0.0.1:8181/stats) is unreachable
2022-09-15T18:12:02.907190Z ERROR NOALBS{user=moenttv}:Switcher: noalbs::stream_servers::sls: Stats page (http://127.0.0.1:8181/stats) is unreachable
2022-09-15T18:12:03.220291Z ERROR NOALBS{user=moenttv}:Switcher: noalbs::stream_servers::nginx: Error accessing stats page (http://localhost/stats)
2022-09-15T18:12:05.563374Z ERROR NOALBS{user=moenttv}:Switcher: noalbs::stream_servers::nginx: Stats page (http://localhost:8000/stat.xsl) is unreachable
2022-09-15T18:12:06.578934Z ERROR NOALBS{user=moenttv}:Switcher: noalbs::stream_servers::sls: Stats page (http://127.0.0.1:8181/stats) is unreachable
2022-09-15T18:12:07.594641Z ERROR NOALBS{user=moenttv}:Switcher: noalbs::stream_servers::sls: Stats page (http://127.0.0.1:8181/stats) is unreachable
2022-09-15T18:12:07.596957Z ERROR NOALBS{user=moenttv}:Switcher: noalbs::stream_servers::nginx: Error accessing stats page (http://localhost/stats)
2022-09-15T18:12:08.610053Z INFO NOALBS{user=moenttv}:Switcher: noalbs::switcher: Waiting till OBS starts streaming

This is how my NOALBS config.json looks like in the "streamServers" section. Can anyone help me realise whats wrong? =/

"streamServers": [ { "streamServer": { "type": "Nginx", "statsUrl": "http://xxx.xx.xx.xxx:80/stat.xsl", "application": "publish", "key": "live", "auth": { "username": "admin", "password": "admin" } }, "name": "Nginx Stats Server", "priority": 0, "overrideScenes": null, "dependsOn": null, "enabled": true }, { "streamServer": { "type": "Nginx", "statsUrl": "http://xxx.xx.xx.xxx/stats", "application": "publish", "key": "live" }, "name": "nginx", "priority": 1, "overrideScenes": { "normal": "live", "low": "low", "offline": "offline" }, "dependsOn": null, "enabled": true } ] },

@moen1989
Copy link
Author

Seems like this is the last issue. Everything seems to be working, except the scene switching. Because of the stats page error.

@DigibitDK
Copy link
Contributor

DigibitDK commented Sep 16, 2022

How is NOALBS going to work when my Nginx-RTMP server on AWS is not running OBS? OBS is running on my own PC and pulling the RTMP feed from my AWS. NOALBS needs access to obs-websocket right?

You need to keep in mind, that this i a 3-part setup. You have OBS. Your have NGINX. And you have Noalbs. 3 different systems.
Your OBS have a websocket that is connected to Noalbs. Noalbs is in this case client, and will connect to OBS. So the easy solution is to have OBS and Noalbs on same system.
If you want Noalbs to auto-switch on low-bitrate, Noalbs needs to be able to read the stats from NGINX. And then take action in your OBS.

If you have RTMP-NGINX running on AWS, then localhost or 127.0.0.1 will not work. You need to open your stats-page port on AWS so that your local Noalbs will be able to get the stats-page.
Something like http://YourAWSServer:8181/stats - It seems to be the last thing you need :)

@moen1989
Copy link
Author

Thanks for that input DigibitDK! I moved NOALBS over to local computer that runs OBS.
I have opened port 80,443,1935,8080,8181,4444,4455,3389 on AWS.

Error in NOALBS now:
2022-09-16T14:47:48.999219Z ERROR NOALBS{user=moenttv}:Switcher: noalbs::stream_servers::nginx: Error parsing stats (http://xx.xxx.xxx.xx:80/stat.xsl) missing field server

@DigibitDK
Copy link
Contributor

Is your stats-page on port 80?
Can you see your stats-page with a browser using http://xx.xxx.xxx.xx:80/stats ? If you cant see the page, Noalbs can't either.

@moen1989
Copy link
Author

moen1989 commented Sep 16, 2022

I have no idea, how can i figure that out? I have tried so many different options, im at a point where im just lost in everything lol. All i have done is adding stat.xsl to html folder in Nginx and followed a video guide on how to install Nginx-rtmp and noalbs on Windows. There is no mention of this stat.xsl, other then where to put it.

@DigibitDK
Copy link
Contributor

If you install something like this: https://github.com/arut/nginx-rtmp-module - you should have your stats-page on http://serverip:8080/stats

@DigibitDK
Copy link
Contributor

DigibitDK commented Sep 16, 2022

But ... For Noalbs to work as a remote-control tool, you dont need auto-scene-switching. You can just use it as a chat-remote-tool, and ignore the auto-switch path. That will make your setup a lot more simple.

@moen1989
Copy link
Author

Thanks! I have Nginx 1.7.11.13 Gryphon for windows 64 on my AWS and then followed this noalbs instruction to have websocket and auto-scene-switching.

The reason i want auto-switching, is because this RTMP server is only going to be used for IRL streams when riding a motorcycle, so access to writing in chat is pretty limited. therefor, it would be amazing to have it switch when my bitrate falls during the trip.

@moen1989
Copy link
Author

moen1989 commented Sep 16, 2022

This is nginx.conf, which is added from this git, together with the stat.xsl file in nginx/html/stat.xsl.
I cannot see anything that tells me where this file is supposed to be read/accessed from.

`
http {
sendfile off;
tcp_nopush on;
directio 512;
include mime.types;
default_type application/octet-stream;
ignore_invalid_headers on;
log_format compression '';

server {
    listen      80;
    server_name localhost;
	gzip on;
    access_log logs/http-access.log compression;

# These headers will help with Access Control Origin Errors, it might be overkill but it works.
    location / {
        add_header 'Cache-Control' 'no-cache';

        if ($request_method = 'OPTIONS') {
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
            add_header 'Access-Control-Max-Age' 1728000;
            add_header 'Content-Type' 'text/plain; charset=utf-8';
            add_header 'Content-Length' 0;
            return 204;
        }

        if ($request_method = 'POST') {
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
            add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
            add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
        }

        if ($request_method = 'GET') {
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
            add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
            add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
        }
    }

# Location of your RTMP Stats page.
    location /stat {
        if ($request_method = "GET") {
            add_header "Access-Control-Allow-Origin"  *;
        }

        rtmp_stat all;
    # The name of the stats page stylesheet.
        rtmp_stat_stylesheet /stat.xsl;
    }

    location /stat.xsl {
        root html; # Location of stat.xsl
    }

    location /control {
        rtmp_control all;
    }
}

}`

@DigibitDK
Copy link
Contributor

I understand. But even so, if you just use a default scene with a picture underneath your media-source, that picture will be shown if you loose connection, AND when your NGINX-server hits timeout. (timeout 20s;)

@DigibitDK
Copy link
Contributor

But to be fair, its not easy to make everything work perfect. It takes a lot of trying and testing. I cant help you out with NGINX-RTMP setup, im only here to support the Noalbs-guys with the project. But sounds like that you are pretty close to making it work after all.

@moen1989
Copy link
Author

moen1989 commented Sep 16, 2022

I understand that and I appreciate all your replies and clarifications, no doubt about that! Thank you very much!
Indeed, I am very close, its just the final touches and fixing errors regarding the stat.xsl file. Im not giving up untill I have it figured out! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants