Simple app to automatically switch scenes in OBS Studio/OBS.Live based on the current bitrate fetched from the server stats.
NOALBS is used as a DIY tool to have your OBS Studio/OBS.Live auto switch scenes when you are either in a LOW bitrate situation or if your source disconnects completely.
Don't feel like setting this all up by yourself? Check out these links for similar solutions/paid services:
- IRLToolkit
- psynapticmedia.com
- norip.io
- IRL Media Solutions
- U3 -Coming Soon-
- Do you offer a similar solution or paid service? Want your link here? Message b3ck#3517 on Discord
- Download the latest binary from releases
- Have OBS-Studio and OBS-WebSocket installed
- Configure NOALBS
- Run the executable
This script gives you the option to enable some simple chat commands to help you manage your stream from your own Twitch chat, here is how to use them:
Please note: Admins are all the users in the
admins
array inchat
config section, MODs are all of your MODs, and Public is anyone in your chat.
Default Role | Command | Description | Example |
---|---|---|---|
Admins | !start | on-demand command to start streaming in OBS. | !start |
Admins | !stop | on-demand command to stop streaming in OBS. | !stop |
Admins | !record | on-demand command to toggle recording in OBS. | !record |
Admins | !alias (alias) (command) | add an alias for a command. | !alias ss switch |
Admins | !alias rem (alias) | removes an alias for a command. | !alias rem ss |
Admins | !switch (scene) | switches to the provided SCENE (fuzzy match). | !switch INTRO |
Admins | !live | switch to the live scene. | !live |
Admins | !privacy | switch to the privacy scene. | !privacy |
Admins | !starting | switch to the starting scene. | !starting |
Admins | !ending | switch to the ending scene. | !ending |
Admins | !noalbs prefix (prefix) | change noalbs command prefix. | !noalbs prefix # |
Admins | !noalbs retry (value) | changes the retry value for the switcher. | !noalbs retry 5 |
Admins | !noalbs lang (value) | changes the chat response language. | !noalbs lang zh_tw |
MODs | !trigger (value) | changes the low bitrate threshold to the defined value. | !trigger 800 |
MODs | !otrigger (value) | changes the offline bitrate threshold to the defined value. | !otrigger 200 |
MODs | !rtrigger (value) | changes the RTT threshold to the defined value. | !rtrigger 2000 |
MODs | !sourceinfo | gives you details about the SOURCE in chat. | !sourceinfo |
MODs | !fix | tries to fix the stream. | !fix |
MODs | !refresh | tries to fix the stream. | !refresh |
Public | !bitrate | returns the current bitrate. | !bitrate |
You can also enable/disable certain features from chat, see below:
Default Role | Command | Description | Example |
---|---|---|---|
Admins | !public (on/off) | enables/disables the use of Public commands. | !public off |
Admins | !mod (on/off) | enables/disables the use of MOD commands. | !mod on |
Admins | !notify (on/off) | enables/disables the notifications in chat. | !notify off |
Admins | !autostop (on/off) | enables/disables the auto stop feature when you host/raid. | !autostop on |
Admins | !noalbs (start/stop) | NOALBS start/stop switching scenes. | !noalbs stop |
Admins | !noalbs instant | toggle instant switching from offline scene. | !noalbs instant |
Rename .env.example
to .env
. Fill in your bot username and oauth.
Use https://twitchapps.com/tmi to get your oauth from Twitch.
We recommend using your main Twitch BOT account for this, but if you do not have a Twitch Bot account just use your Main Twitch Account.
The config.json
file holds all the user configurations.
Currently NOALBS supports NGINX, Nimble, Node Media Server, SRT Live Server and BELABOX. You can have as many servers as you want to use in the config.
Example stream server object:
{
"streamServer": {
"type": "Nginx",
"statsUrl": "http://localhost/stats",
"application": "publish",
"key": "live"
},
"name": "nginx",
"priority": 0,
"overrideScenes": {
"normal": "normal",
"low": "low",
"offline": "offline"
},
"dependsOn": null
}
streamServer
: Replace this with the server you would like to usename
: A unique name to distinguish the serverpriority
: Decides which stream server to monitor when multiple are online. 0 is consired the highest.overrideScenes
: Optional field to override the default scenesdependsOn
: Optional field explained here
"streamServer": {
"type": "Nginx",
"statsUrl": "http://localhost/stats",
"application": "publish",
"key": "live"
},
"streamServer": {
"type": "NodeMediaServer",
"statsUrl": "http://localhost:8000/api/streams",
"application": "publish",
"key": "live",
"auth": {
"username": "admin",
"password": "admin"
}
},
auth
: Optional field
Nimble must have API access enabled and be configured as a SRT receiver - see "Set up receiving of SRT" and have an outgoing stream ("Add outgoing stream" on same page)
"streamServer": {
"type": "Nimble",
"statsUrl": "http://nimble:8082",
"id": "0.0.0.0:1234",
"application": "live",
"key": "srt",
},
statsUrl
: URL to nimble APIid
: UDP listener ID (Usually IP:Port)application
: Outgoing stream "Application Name"key
: Outgoing stream "Stream Name"
Switches on low bitrate or high RTT (high RTT seems to be a more accurate way of determining if the stream is bad with this) You can change the high RTT trigger value inside config.json
Big Thanks to oozebrood, matthewwb2, and kyle___d for all of the hard work they've put into getting SRT to the masses! If you're using either Matt's modified version or my edit of Matt's version of SLS then follow this section;
"streamServer": {
"type": "SrtLiveServer",
"statsUrl": "http://localhost:8181/stats",
"publisher": "publish/live/feed1"
},
-
stats
: URL to SLS stats page (ex; http://localhost:8181/stats ) -
publisher
: StreamID of the where you are publishing the feed. (ex; publish/live/feed1 ) -
Publisher, what is a publisher? it's a combination of
domain_publisher
/app_publisher
/<whatever-you-want>
.- So if your
domain_publisher
was "uplive.sls.com", and yourapp_publisher
was "live", it would beuplive.sls.com/live/<whatever-you-want>
. - You could literally call you domain_publisher 'billy', app_publisher 'bob', and then set your streamid (publisher) to 'billy/bob/thorton' if you wanted to.
- Publisher is also what you entered in the config under
default_sid
. Unless you are streaming to a different 'StreamID' of course, ex;publish/live/tinkerbell
.
- So if your
See Example Below from the sls.conf
file in the SLS main directory:
So in actuality your 'publisher' is your default StreamID
, like in the example above it's billy/bob/thorton
.
Switches on low bitrate or high RTT (high RTT seems to be a more accurate way of determining if the stream is bad with this) You can change the high RTT trigger value inside config.json:
see HERE
- Add Media Source
- Un-check
Local File
- Make sure
Restart playback when source becomes active
is checked. - Change Network Buffering to
1 MB
- In the "Input" field enter in:
srt://<SERVER-IP>:<PORT>/?streamid=<PUBLISHER>
- Using the example from the above image, it would be something like this if you are using SLS on the same machine:
srt://localhost:30000/?streamid=jojo/bob/thorton
- Using the example from the above image, it would be something like this if you are using SLS on the same machine:
- In the
Input Format
field enter in:mpegts
- Change
Reconnect Delay
to3S
(Three Seconds) - Make sure
Show nothing when playback ends
is checked. - Check
Close file when inactive
- Optional: If your streams color looks washed out change your
YUV Color Range
toPartial
- Sidenote: Do not Use
Use hardware decoding when available
,Apply alpha in linear space
, orSeekable
, As I have only ran into issues with these options enabled.
Below is an example when used with a BelaBox Reciever:
Remember this is just an example, your ports and streamid may differ.
"streamServer": {
"type": "Belabox",
"statsUrl": "http://belabox-stats-url/yourkey",
"publisher": "yourkey"
},
You should be able to find the details in your BELABOX cloud account.
When a dependsOn
field is found, monitor the status of the given server. If that server goes offline the backupScenes
will be used.
"dependsOn": {
"name": "nginx",
"backupScenes": {
"normal": "Scene 3",
"low": "low",
"offline": "Scene 2"
}
}
name
: The exact name this stream server depends onbackupScenes
: Scenes that will be used when the depended on server is offline
Download and install:
Then:
git clone <repository-url>
or download from GitHub.cd <repository-name>
cargo run
orcargo run --release
You can always contact us on discord @ b3ck#3517 or 715209#0600 and we'll do our best to help out.
You can find the old NOALBS version in the master branch.
If you already have NGINX-RTMP server
- Replace your
nginx.conf
with the one given here. - Put
stat.xsl
in your nginxhtml
folder.
Otherwise here is a Windows version of NGINX+RTMP Server
- Hosted on Github
- Everything is ready to go inside this zip, just extract and click on the
nginx_start.bat
file to start NGINX, you can usenginx_stop.bat
to stop NGINX. HTTP server runs on Port80
, RTMP server runs on1935
, if you need to edit the config file it's in the/conf
folder, namednginx.conf
.
Using the default config where the server is listening on port 1935
and the name of the application in NGINX is publish
;
(example config, do not copy)
rtmp {
server {
listen 1935;
(...)
# Stream to "rtmp://IPHERE/publish/live".
application publish {
live on;
(...)
}
}
}
- If the app or device requires the key separately put
rtmp://(SERVER-IP):1935/publish
in the RTMP URL andlive
in the key. - Otherwise if the app or device doesn't require the key separately put
rtmp://(SERVER-IP):1935/publish/live
in the RTMP URL.
Most of these rules apply to the rest of the other types of servers;
- RTMP will usually have an
application
and akey
. - SRT will use a
publisher
ID orstreamid
, some applications or devices will only require your server IP and PORT;- Example;
srt://(SERVER-IP):30000
but if it the app or device supportsstreamid
it will always be separate.
- Example;
Either way, pay close attention to your app or device requirements, as you will need to setup accordingly to them and your configuration on the server.
Update your OBS to v26+ and follow the steps below:
1.) In OBS create the following scenes:
LIVE
,LOW
,BRB
,REFRESH
- I highly recommend creating a
STARTUP
&PRIVACY
scene, theSTARTUP
scene can contain whatever you want to start your stream on and then switch toLIVE
when you're ready, thePRIVACY
scene can be whatever you want to put the stream on when you need privacy, the main thing is that it's out of NOALBS scope and won't automatically switch scenes. - The normal flow is to have your OBS on
STARTUP
when you start stream and when you're ready either you or an instructed MOD can !switch LIVE, when you need privacy use !switch PRIVACY.
2.) In your LIVE
scene, add a 'Media Source', match the image below:
- Right click on the 'Media Source' > Transform > Stretch to screen (this will stretch the video source no matter the resolution, ex; 480p, 720p, 1080p etc.)
3.) Copy and Paste(Reference) the 'Media Source' from the LIVE
scene into your LOW
scene.
- Do the same transformation procedure from step (2).
4.) Go over all of your scenes and make them your own.
In the .env
file add the line CONFIG_DIR=configs
where configs
is the folder that holds all the config files. The name of the config is ignored so you can name it anything you want.
It will only change scenes when OBS is set on a scene that's in the config.
(This is so that it wont change when you are on for example your 'intro' or 'locked-brb' scene)