Selfhosted/homelab alerts solution as opensource ?

Filip S

Member
Hi do you know any selfhosted or maybe homelab solution for OBS alerts - if I dont what to use streamlabs etc. ?
 

Filip S

Member
What's an alert? Different people have different definitions.

Whell we have alot of providers that have alerts and pulls etc. and you use browser overlay to show when something happens but maybe someone have made a docker image or selfhosted/homelab solution for this ;) Surely some solution depends on the platform you are streaming to but - maybe the word alert is not the bedst word for making a stream do something or show something depending on users respons.
 

AaronD

Active Member
You mean like, showing or hiding a source in OBS, literally changing the content of the stream itself, when a viewer clicks a button?
 

Filip S

Member
You mean like, showing or hiding a source in OBS, literally changing the content of the stream itself, when a viewer clicks a button?

Yes everything that would like be possible - just like you can get it on some places but as a selfhosted solution - like pools etc, quiz the idea of doing some selfhosting solutions is also to be indepentent and running the free solutions avoiding using youtube and facebook etc. but maybe somebody is allready working on this ;)
 

AaronD

Active Member
Yes everything that would like be possible - just like you can get it on some places but as a selfhosted solution - like pools etc, quiz the idea of doing some selfhosting solutions is also to be indepentent and running the free solutions avoiding using youtube and facebook etc. but maybe somebody is allready working on this ;)
I think you're combining too many ideas and not separating them very well. What are you asking?
 

Filip S

Member
I think its clear and well seperated ;) - lets say I need vps or docker container solution maybe I can put on a server and where the OBS can use this as browser overlay its some how isolated from the OBS production - it maybe just some php script but maybe somebody have already made something opensource that was availble but sure alot of users may use alerts and stuf provided by others and thats not really selfhosted - some code can possible be put on a existing website maybe.
Pool, quiz, smal silly games maybe - just stuf that kan make a livestream interaktive on some level so this where livestream maybe different.
It does exist with some avanced games etc. but mostly for windows - it does not have to include all this but some basic would be cool but strange that you can get alot of nice plugins for OBS but - the solution I am looking for would be usefull for both obs and vmix etc.
 

AaronD

Active Member
Nevermind the use. What are the signals, and where do they come from?

The browser source is an image as far as OBS is concerned. You can interact with it as a user, if you click the "Interact" button, but the rest of OBS still treats it as an image, or a live video source. Dancing pixels and nothing more.

OBS accepts Websocket natively, and it has scripting and plugin API's. One plugin that I really like is Advanced Scene Switcher. It has some additional hooks that you might find useful as well.

Another thing you might be interested in is Node-RED:
It's a free graphical programming language that is based on sending JSON objects between nodes that use Javascript to interpret those messages, modify them, and create new ones. Nodes can also perform some sort of function themselves, which can be almost anything you can imagine. There's also a Dashboard that you can install, which creates its own webpage that can be controlled by the messages that each of its controls receives, and creates its own messages when a user interacts with it. Point any web browser to wherever you've installed the Node-RED server, and that's your user-interface.

So, maybe you have a web-based UI in Node-RED, the backend of which sends Websocket messages to OBS?

Programming all of that to be a quiz, for example, might go something like this:
Just replace the completely-predefined 8-track cartridge with some completely-predefined stuff in OBS.
 

Filip S

Member
Ok, but using websocket is maybe a fancy and possible solution - but that would also be mainly compatible with OBS while browser source solution maybe more isolated and independent with other systems that also use overlays solution.

But it can be a solution maybe - but something that I would be able to put on a host/webserver with php is more what I was looking for ;)
 

jebba

Member
lets say I need vps or docker container solution maybe I can put on a server and where the OBS can use this as browser overlay its some how isolated from the OBS production

I'm not sure I'm following 100% either, but maybe this will help.

I have separate virtual machines (KVMs) that feed OBS Studio content. What I do is create a Debian KVM with a very minimal desktop that then typically launches a web browser on boot. The browser can be in kiosk mode and goes to a specific URL. The KVM then starts ffmpeg server and listens for connections.

The ffmpeg running on the KVM that gets started on boot, looks like this:

Code:
#!/bin/bash

# Set to ethernet IP of the KVM
NETIP="192.168.100.101"
NETPORT="8888"

while true
do \
DISPLAY=:0.0                                \
ffmpeg                                    \
    -loglevel quiet                            \
    -f x11grab                            \
    -draw_mouse 0                            \
    -framerate 30                            \
    -video_size 1920x1080                        \
    -i :0.0+0,0                            \
    -c:v libx264                            \
    -preset ultrafast -crf 28 -refs 4 -qmin 4            \
    -pix_fmt yuv420p -tune zerolatency -ac 2            \
    -profile:v main                            \
    -bufsize 969k                            \
     -f mpegts                            \
    "srt://$NETIP:$NETPORT?mode=listener"
done

If you want to capture audio as well, it would be more like this:
Code:
#!/bin/bash

# Set to ethernet IP of the KVM
NETIP="192.168.100.101"
NETPORT="8888"

while true
do \
DISPLAY=:0.0                                                            \
ffmpeg                                                                  \
        -f x11grab                                                      \
        -draw_mouse 0                                                   \
        -framerate 30                                                   \
        -video_size 1920x1080                                           \
        -i :0.0+0,0                                                     \
        -f pulse                                                        \
        -ac 2                                                           \
        -i default                                                      \
        -c:a aac -c:v libx264                                           \
        -preset ultrafast -crf 28 -refs 4 -qmin 4                       \
        -pix_fmt yuv420p -tune zerolatency -ac 2                        \
        -profile:v main                                                 \
        -bufsize 969k                                                   \
        -f mpegts                                                       \
        "srt://$NETIP:$NETPORT?mode=listener"
done

Then on the OBS Studio side, you would add a "Media Source" or "VLC Video Source" with an URL of the form:
srt://192.168.100.101:8888

This should work for other streams than SRT, but I prefer SRT.

The nice aspect of doing it this way is you don't have to use the OBS Studio browser plugin (which uses an *ancient* browser, likely with many security holes). I don't know of a way the obs-browser plugin can do multiple feeds. Using the above method, you can do as many browsers as you want, just create new KVMs. It allows you to use any browser you want, or even any desktop application. And if the browser should crash, it won't bring down the main OBS Studio stream.

I use this, by way of example, to track aircraft transmitting ADS-B and plot that on a map with dump1090-mutability. The map then gets exported via the SRT feed to OBS Studio. I also used it a lot to export desktops, back in the day, when I was optically tracking satellites.

Happy hacking,

-Jeff
 
Top