MiSTer Streaming Script (OBS/SLOBS) - Update!

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
User avatar
ItalianGrandma
Posts: 211
Joined: Sun May 24, 2020 7:09 pm
Has thanked: 45 times
Been thanked: 52 times
Contact:

MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by ItalianGrandma »

Just an FYI, I did help the author conceptualize and bug test this script, but I am not the author :mrgreen:

———————————

Update 11/13/22:

Alright, the latest release for GameEventHub can be found here: https://github.com/christopher-roelofs/ ... /tag/0.1.3

NOTE: If you are running OBS 28, you’ll need to use the websocket 4.9.1-compat plugin found here: https://discord.com/channels/@me/952828 ... 7131254784

Also, if any devs see this and would be interested in taking a look at upgrading GameEventHub to work with OBS websocket 5.0, please let me know! :)

———————————

Update 2/14/22:

GameEventHub 0.1.1 released https://github.com/christopher-roelofs/ ... b/releases

There is now integration for Retroarch, Steam, and Discord! There is also the ability to run custom scripts and there is a new web dashboard feature that allows you to display Game data, box art, etc. in a browser.

Another nice feature is that you can now trigger OBS events based on when you change cores/games on the MiSTer. I use those events to do things like resizing my game capture window, changing the volume of my capture source and pulling the game details so my viewers on Twitch can use an !info command to see them.

Do read the documentation to get an idea of what you can do!

————————————————-

Update 2/1/22:

MiSTerOBS 1.05 Released! https://github.com/christopher-roelofs/ ... s/tag/1.05

With this new version, you can now automatically pull box art for each game into your OBS/SLOBS scene :D

You can also pull in info like Game Description, Genre, Publisher, Developer, etc. I use a tool called Kruiz Control to make this info available to my viewers https://github.com/Kruiser8/Kruiz-Control

For an example of the new box art functionality in action, go here: https://www.twitch.tv/videos/1273342539


Update 5/10/21:

The script is alive!! :D

An awesome dev in the MiSTer community was kind enough to work with me on this and bring the script to life!

It’s a great tool for streamers that want to show the name of the game and console you are playing without having to do manual updates :)

Go here to check it out: https://github.com/christopher-roelofs/misterobs

If you want to see an example of it in action, go here: https://www.twitch.tv/videos/1000421906


Obligatory NOT A DEV :D

I just wanted to know if something like this is feasible...a script that runs on a PC and "listens" and logs things from a MiSTer connected to the same network.

Use Case: I stream on Twitch using the MiSTer and I'd love to have a way to change a specific text file on my PC when switching Game/Core on the MiSTer. This would be a way to automatically change a game title in my OBS overlay when switching games/cores on the MiSTer

1) Change game on MiSTer
2) Listener script grabs file name and core name
3) Script writes file name and core name to C:\gametitle.txt

Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: MiSTer "Listener" Script on PC (Feasible?)

Unread post by Bas »

The Prometheus node exporter could provide a lot of groundwork for this. The other bit of the puzzle would be making MiSTer output its housekeeping to a text file. That should be doable without too much overhead. Your PC can then poll the node exporter over http.
User avatar
RealLarry
Top Contributor
Posts: 881
Joined: Mon May 25, 2020 4:04 am
Location: San Junipero/DE/Earth
Has thanked: 120 times
Been thanked: 385 times

Re: MiSTer "Listener" Script on PC (Feasible?)

Unread post by RealLarry »

ItalianGrandma wrote: Tue Mar 30, 2021 2:42 pm Obligatory NOT A DEV :D

I just wanted to know if something like this is feasible...a script that runs on a PC and "listens" and logs things from a MiSTer connected to the same network.

Use Case: I stream on Twitch using the MiSTer and I'd love to have a way to change a specific text file on my PC when switching Game/Core on the MiSTer. This would be a way to automatically change a game title in my OBS overlay when switching games/cores on the MiSTer

1) Change game on MiSTer
2) Listener script grabs file name and core name
3) Script writes file name and core name to C:\gametitle.txt
@venice did a very similar thing to display core's title on an OLED. Very flexible code and scripts. Have a look to adapt or as a source for your own ideas.
viewtopic.php?f=9&t=1887&start=50
Contributor of tty2oled, author of tty2tft, tty2rpi and update_tty2xxx
User avatar
aberu
Core Developer
Posts: 1192
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 247 times
Been thanked: 411 times
Contact:

Re: MiSTer "Listener" Script on PC (Feasible?)

Unread post by aberu »

https://github.com/venice1200/MiSTer_tty2oled - the repo has a lot more info btw
birdybro~
dentnz
Core Developer
Posts: 54
Joined: Sun May 24, 2020 10:28 pm
Been thanked: 12 times

Re: MiSTer "Listener" Script on PC (Feasible?)

Unread post by dentnz »

You can run the MiSTer binary and pipe it's console output to a file. You could then quite easily create a tail on that file, parsing it for keywords and performing actions from there. As cores change and roms are loaded, that information is output by the binary, so everything should be there for you to work with. Definitely use that tty2 as a basis...
User avatar
ItalianGrandma
Posts: 211
Joined: Sun May 24, 2020 7:09 pm
Has thanked: 45 times
Been thanked: 52 times
Contact:

Re: MiSTer "Listener" Script on PC (Feasible?)

Unread post by ItalianGrandma »

An update!!!

An awesome guy who goes by the name Bamboozler on Discord was nice enough to work with me on this and make it a reality!!

Any streamers who are interested in giving this a whirl, get the script here: https://github.com/christopher-roelofs/misterobs
User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by venice »

ItalianGrandma wrote: Tue Mar 30, 2021 2:42 pm ...
The script is alive!! :D

An awesome dev in the MiSTer community was kind enough to work with me on this and bring the script to life!
Looks good :)

In total you poll using SSH for the Core/MRA/Console-Game-Name each Second (or whatever is set)?

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

Panda
Posts: 5
Joined: Sun May 24, 2020 6:58 pm
Been thanked: 1 time

Re: MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by Panda »

venice wrote: Sun Jun 06, 2021 5:53 pm
ItalianGrandma wrote: Tue Mar 30, 2021 2:42 pm ...
The script is alive!! :D

An awesome dev in the MiSTer community was kind enough to work with me on this and bring the script to life!
Looks good :)

In total you poll using SSH for the Core/MRA/Console-Game-Name each Second (or whatever is set)?
Yes. By default, it's set to 1s but you could change it in the config. So far 1s seems to work well without impacting anything so I would stick with that.
User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by venice »

Panda wrote: Tue Jun 08, 2021 12:05 am Yes. By default, it's set to 1s but you could change it in the config. So far 1s seems to work well without impacting anything so I would stick with that.
Ok, but how are the console loaded games identified?
Is there anything I need to do on the MISTer side before I get the information out of "get_last_game(core)" function.
I checked my files in "/media/fat/config" but I don't find anything usable.

Many Thanks

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

Panda
Posts: 5
Joined: Sun May 24, 2020 6:58 pm
Been thanked: 1 time

Re: MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by Panda »

venice wrote: Tue Jun 08, 2021 10:12 am
Panda wrote: Tue Jun 08, 2021 12:05 am Yes. By default, it's set to 1s but you could change it in the config. So far 1s seems to work well without impacting anything so I would stick with that.
Ok, but how are the console loaded games identified?
Is there anything I need to do on the MISTer side before I get the information out of "get_last_game(core)" function.
I checked my files in "/media/fat/config" but I don't find anything usable.

Many Thanks
Nope. Every second it runs the following commands via ssh:

"ps aux | grep [r]bf" - Gets the current running core
"ps aux | grep [r]bf" + check if there is an .mra file running - Gets current running mra game
'find /media/fat/config/ -mmin -{timeframe}' - Gets current running non .mra game. Basically this looks for the last touched file in the /media/fat/config/ folder and then reads the last game from the file. {timeframe} is basically 1x poll rate from the config.

It then matches the core in the cores.json file and figures out what it needs to do based on that.
User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by venice »

Panda wrote: Tue Jun 08, 2021 8:09 pm Nope. Every second it runs the following commands via ssh:
...
It then matches the core in the cores.json file and figures out what it needs to do based on that.
I understand :)

But if I start, from my MiSTer, for example an NES Game, I don't find anything related to NES or the loaded Game in /media/fat/config.
I looks to me nothing is written to /media/fat/config :shock:

Could you give me an example?

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

Panda
Posts: 5
Joined: Sun May 24, 2020 6:58 pm
Been thanked: 1 time

Re: MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by Panda »

venice wrote: Wed Jun 09, 2021 11:05 am
Panda wrote: Tue Jun 08, 2021 8:09 pm Nope. Every second it runs the following commands via ssh:
...
It then matches the core in the cores.json file and figures out what it needs to do based on that.
I understand :)

But if I start, from my MiSTer, for example an NES Game, I don't find anything related to NES or the loaded Game in /media/fat/config.
I looks to me nothing is written to /media/fat/config :shock:

Could you give me an example?

You should see .cfg files like GBA_recent_1.cfg, Genesis_recent_1.cfg etc. Do you have the recents setting enabled in your MiSTer.ini file?

recents=1 ; set to 1 to show recently played games
User avatar
venice
Top Contributor
Posts: 788
Joined: Tue Jun 16, 2020 9:29 am
Location: Germany
Has thanked: 278 times
Been thanked: 278 times

Re: MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by venice »

Panda wrote: Wed Jun 09, 2021 12:00 pm You should see .cfg files like GBA_recent_1.cfg, Genesis_recent_1.cfg etc.
Nope
Panda wrote: Wed Jun 09, 2021 12:00 pm ...
Do you have the recents setting enabled in your MiSTer.ini file?
No, but now ;)
And it works perfectly.

My MiSTer Add-On-Projects tty2oled, i2c2oled, SNAC2IEC
You can donate by sending a Postcard (Cardwarez) to me.

PixelPeZ
Posts: 2
Joined: Thu Jul 29, 2021 12:54 pm
Has thanked: 1 time

Re: MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by PixelPeZ »

Hey, is there a step-by-step on adding this to OBS somewhere?
I think I have everything installed correctly but... how do I display anything in OBS?
cory.a.shilling
Posts: 1
Joined: Tue Dec 21, 2021 2:59 pm

Re: MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by cory.a.shilling »

How do I connect this script to OBS correctly so that it works properly? I think I got the solutions in this article - https://beststreamerguides.com/how-to-s ... ers-guide/. Thanks to it I understood how to connect everything correctly so that everything would work perfectly.
Panda
Posts: 5
Joined: Sun May 24, 2020 6:58 pm
Been thanked: 1 time

Re: MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by Panda »

There is no step by step guide but the github page has some details on the setup. Basically, the "scene" name in the cores.json for a core needs to be created as scene in OBS. In the scene, you also need a text source with the same name as the "custom_text_sources" in the same file or default of GameName. You also have to have the websocket plugin installed and the port/password set in the configjson file.
User avatar
ItalianGrandma
Posts: 211
Joined: Sun May 24, 2020 7:09 pm
Has thanked: 45 times
Been thanked: 52 times
Contact:

Re: MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by ItalianGrandma »

PixelPeZ wrote: Fri Aug 06, 2021 4:07 pm Hey, is there a step-by-step on adding this to OBS somewhere?
I think I have everything installed correctly but... how do I display anything in OBS?
I’ll be glad to help you if still needed (or anyone reading this). Sorry for the waaayyyy late reply! Just shoot me a private message!
User avatar
ItalianGrandma
Posts: 211
Joined: Sun May 24, 2020 7:09 pm
Has thanked: 45 times
Been thanked: 52 times
Contact:

Re: MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by ItalianGrandma »

MiSTerOBS 1.05 has been released (https://github.com/christopher-roelofs/ ... s/tag/1.05) and you can now pull box art for each game into your OBS/SLOBS scenes!

You can also pull info such as Game Description, Publisher, Developer, Genre, etc. as well. I utilize a tool called Kruiz Control (https://github.com/Kruiser8/Kruiz-Control) to make this info available to my viewers in chat.

For an example of this running, check it out here: https://www.twitch.tv/videos/1273342539
User avatar
ItalianGrandma
Posts: 211
Joined: Sun May 24, 2020 7:09 pm
Has thanked: 45 times
Been thanked: 52 times
Contact:

Re: MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by ItalianGrandma »

Alright, the latest release for GameEventHub can be found here: https://github.com/christopher-roelofs/ ... /tag/0.1.3

NOTE: If you are running OBS 28, you’ll need to use the websocket 4.9.1-compat plugin found here: https://discord.com/channels/@me/952828 ... 7131254784

Also, if any devs see this and would be interested in taking a look at upgrading GameEventHub to work with OBS websocket 5.0, please let me know! :)
User avatar
Longtime4321
Posts: 116
Joined: Fri Aug 12, 2022 5:17 am
Has thanked: 9 times
Been thanked: 17 times

Re: MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by Longtime4321 »

Would you consider making a compiled version for mac? I have no idea how to compile it on my own :/
User avatar
ItalianGrandma
Posts: 211
Joined: Sun May 24, 2020 7:09 pm
Has thanked: 45 times
Been thanked: 52 times
Contact:

Re: MiSTer Streaming Script (OBS/SLOBS) - Update!

Unread post by ItalianGrandma »

Longtime4321 wrote: Mon Nov 21, 2022 1:10 am Would you consider making a compiled version for mac? I have no idea how to compile it on my own :/
The original script author is done updating it and unfortunately I’m not a dev :/
Post Reply