obs-websocket - Remote-control OBS Studio using WebSockets

obs-websocket - Remote-control OBS Studio using WebSockets 5.0.1

dorian111

New Member
Oh boy, that was it. Thanks so much for the help.

I think your answer is that true and false are not strings and therefore not quoted. Numbers are not quoted, along with boolean.Very subtle at times .
this is what I send and it works fine, notice the false is not quoted.:
{"request-type":"SetSceneItemProperties","message-id":"69,OVERLAY_LOGO,False","scene-name":"OVERLAY_DESIGNER","item":"OVERLAY_LOGO","visible":false}
 

bcoyle

Member
Oh boy, that was it. Thanks so much for the help.
You are very welcome. But a word to the wise. They are changing the obs-websocket format going from 4 to v5. Really different. So since you are just starting your app, you might want to go with v5. By spring it will be the official standard, and built into obs. Here are some urls that deal with v5. There is also a discord channel for v5.

https://github.com/Palakis/obs-websocket/blob/master/docs/generated/protocol.md version 5 spec plus error list
'https://docs.google.com/spreadsheets/d/1LfCZrbT8e7cSaKo_TuPDd-CJiptL7RSuo8iE63vMmMs/edit#gid=0 requests
'https://docs.google.com/spreadsheets/d/1XPVDRFwC2DNAnIBo8zKyxjG_Cnun04M4w5RwE0-JHG8/edit#gid=0 events
'https://github.com/Palakis/obs-websocket/releases - releases
 

dorian111

New Member
Excellent - Thanks.

One additional question - is there a method to change the visibility of nested sources? For example, I've got a source inside a switcher that is in a scene that I would like to change the visibility of. So the nest is like this:

Scene 1 >
Switcher 1 >
camera 1
camera 2
camera 3
camera 4

I'd like to be able to change the visibility of cameras 1 through 4; I'm not seeing a readily available way to do this.

Any help is again, most appreciated.
 

bcoyle

Member
Excellent - Thanks.

One additional question - is there a method to change the visibility of nested sources? For example, I've got a source inside a switcher that is in a scene that I would like to change the visibility of. So the nest is like this:

Scene 1 >
Switcher 1 >
camera 1
camera 2
camera 3
camera 4

I'd like to be able to change the visibility of cameras 1 through 4; I'm not seeing a readily available way to do this.

Any help is again, most appreciated.
Well, if "Switcher 1" is a group then the scene is still "Scene 1" and the source is "camera 2". i.e if you select a scene and you can see the source "camera 2" then you can turn on and off directly. If "switcher 1" is a scene and you can't see camera "camera 2" in the scene list, this is what I do. In my app, I have one scene called "OVERLAY_DESIGNER" in it I would have a group called "Switcher 1" with cameras 1-4 in it. I put this same group (copy and dup) in scene 1 and scene 2 etc. If you turn on or off a source in a group, it is turned on and off in all other scenes that have that group. So I would use SCENE = OVERLAY_DESIGNER or whatever you wish to name it and use "Camera 2" as the source.

{"request-type":"SetSceneItemProperties","message-id":"3025","scene-name":"OVERLAY_DESIGNER","item":"camera 2","visible":"true"}

If you copy this same group to other scenes, you would have total control over camera 2 by talking to the designer scene, even if the designer screen is not active.


So scene DESIGNER >
Group Switcher 1 >
camera 1
camera 2


if you have
"scene 1" >
Group Switcher 1>
cameras x .....

"scene 2 >
Group Switcher 1>
cameras x .....


So if you are showing scene 1
and change DESIGNER > camera 1 to invisible and >camera 2 to visible then you would change camera 1 & 2 in all other scenes and scene 1 would have camera 1 go off and 2 on. Does this make scent? Groups are really handy this way.
 

Jaxel

Member
It is indeed a superfluous function. I want to get rid of it, but I don't want to break compatibility with existing applications. I'll get rid of it in 5.0.
Since the release of more recent versions of OBS, the `Heartbeat` function has become more and more essential. This is because you can have heartbeats without needing to be live, for `StreamStatus`. Previously, we were saying that `Heartbeat` doesn't need to exist, because everything could be moved to `StreamStatus`; this is no longer the case.

Recording, Replay Buffer and Virtual Camera can now be accessed and used independently of streaming. So instead of `StreamStatus` becoming the main status function, `Heartbeat` should become the main function; with sub-arrays for stream status, recording status, replay buffer status and virtual camera status. `Heartbeat` should be an all-encompassing status function.

I also have another request... Currently `GetSceneList` returns not only the list of scenes, but also defines the currently active scene. however, `GetCurrentSceneCollection` will return the list of current collections, but it will NOT define the currently active collection. It should.
 

dorian111

New Member
Well, if "Switcher 1" is a group then the scene is still "Scene 1" and the source is "camera 2". i.e if you select a scene and you can see the source "camera 2" then you can turn on and off directly. If "switcher 1" is a scene and you can't see camera "camera 2" in the scene list, this is what I do. In my app, I have one scene called "OVERLAY_DESIGNER" in it I would have a group called "Switcher 1" with cameras 1-4 in it. I put this same group (copy and dup) in scene 1 and scene 2 etc. If you turn on or off a source in a group, it is turned on and off in all other scenes that have that group. So I would use SCENE = OVERLAY_DESIGNER or whatever you wish to name it and use "Camera 2" as the source.

{"request-type":"SetSceneItemProperties","message-id":"3025","scene-name":"OVERLAY_DESIGNER","item":"camera 2","visible":"true"}

If you copy this same group to other scenes, you would have total control over camera 2 by talking to the designer scene, even if the designer screen is not active.


So scene DESIGNER >
Group Switcher 1 >
camera 1
camera 2


if you have
"scene 1" >
Group Switcher 1>
cameras x .....

"scene 2 >
Group Switcher 1>
cameras x .....


So if you are showing scene 1
and change DESIGNER > camera 1 to invisible and >camera 2 to visible then you would change camera 1 & 2 in all other scenes and scene 1 would have camera 1 go off and 2 on. Does this make scent? Groups are really handy this way.
This makes perfect sense - thanks again.

I'm making progress, so I appreciate all teh assistance!
 

PaulBM

New Member
I have been using OBSCommand and AutoHotKey to trigger hotkeys in OBS. Today I added the following Python script to OBS,


The script's hotkeys are appearing in OBS and work with a keypress.

Running the command "TriggerHotkeyByName,hotkeyName=chat_hotkey_0" in a cmd prompt using OBSCommand doesn't work.

Turning on websocket debug I can see the following error in the OBS log. I've checked the hotkey names in twitch.json and the python script itself.

22:45:17.454: [obs-websocket] Request >> '{
22:45:17.454: "request-type": "TriggerHotkeyByName",
22:45:17.454: "message-id": "nVRagEhcs1VDhnkQ",
22:45:17.454: "hotkeyName": "chat_hotkey_0"
22:45:17.454: }'
22:45:17.454: [obs-websocket] Response << '{"error":"hotkey not found","message-id":"nVRagEhcs1VDhnkQ","status":"error"}'

I'm wondering why websocket cannot see those hotkeys but a lua script's hotkeys work perfectly?

Any ideas?
 

PaulBM

New Member
The issue was in the chat_spam python code. The position in list variable wasn't being passed to the hotkey register call. The new line of code is as follows.
Code:
self.hotkey_id = obs.obs_hotkey_register_frontend("chat_hotkey_" + str(self.position), key_description, self.callback)
 
Hey, I have a question about websocket.

I just got it yesterday, had everything working perfectly. then I tried to add triggerfyre, and now everything has just gone to shit.
I've uninstalled it, then reinstalled it and everything. but it won't link back up to touchportal anymore.
it keeps saying the credentials are not correct.

So I did what I read on page two. Clicked Authorize, set my password, went to portal, set the same password. IP's and everything match up, but it's STILL not connecting to it anymore. can someone please help me? I'm new to using plugins in general and just started a few days ago. It's driving me insane lol.
 

RyanMiror

New Member
Hi all, Since I updated my websocket or obs, Lioranboard always loses connection to Obs websocket. I use the whole thing on Mac. what can be the reason...recently I installed a loupedeck. Since then a loupedeck websocket connector has also appeared in the obs tools. Maybe that's the reason.
As soon as i want to activate the wegsacket server, obs crashes on me. I do not know what to do.

Many thanks for your help.
 

dqm

Member
I use Websockets 4.9.1 in an html source dock. Was working great with OBS v27.1. Recently upgraded to v27.2.1 and now have intermittent issues with my source dock (and for that matter, with my Stream Deck which also uses websockets 4.9.1).

Right away, I experiened authentication issues about two-out-of-three times when my dock first connects after opening OBS. But reloading the dock after waiting about a minute usually works. Also, it usually works when I shutdown/restart OBS in quick succession. With authentication disabled, failures aren't as frequent, but they still occur.

It's like: Start OBS->dock fails, reload dock->fail, reload dock->fail, reload dock->success

Anybody else having similar issues with v27.2.1?
 
Last edited:

dqm

Member
I use Websockets 4.9.1 in an html source dock. Was working great with OBS v27.1. Recently upgraded to v27.2.1 and now have intermittent issues with my source dock (and for that matter, with my Stream Deck which also uses websockets 4.9.1).

Right away, I experiened authentication issues about two-out-of-three times when my dock first connects after opening OBS. But reloading the dock after waiting about a minute usually works. Also, it usually works when I shutdown/restart OBS in quick succession. With authentication disabled, failures aren't as frequent, but they still occur.

It's like: Start OBS->dock fails, reload dock->fail, reload dock->fail, reload dock->success

Anybody else having similar issues with v27.2.1?
Upon further investigation, I believe I've narrowed down the problem. My source dock is constructed with one javascript file that provides the ip/port/password settings needed to connect to websockets and another that contains the connection logic. For some reason that I have not yet figured out, the order the javascript files run is no longer consistent as it was in the previous OBS version. If the logic script runs before the settings script then the connection fails.

Thus, I now doubt that websockets is the culprit.
 
I have OBS 27.0.1 installed on Mint Linux 20. I've d/l'ed 4.9.1-1 but I get this error when I try to install it: "Error: Dependency is not satisfiable: obs-studio (>= 26.1.0)" and I'm at a loss to proceed. Suggestions?
Hi!

I had the same problem as you. I use Linux Mint 19.1 and I'm using the Flatpack version of OBS (you probably do too). When I tried to install the websocket through obs-websocket_4.9.1-1_amd64.deb, the same error appeared. What I did was the following:

1 - I copied the directory "/usr/share/obs/obs-plugins/obs-websocket/" to directory "/var/lib/flatpak/app/com.obsproject.Studio/x86_64/stable/0069ec300ce09337a585acfcefe0f2ecdfa0efcd08d920b2751c844fd026296a/files/share/obs/obs-plugins/"

2 - I copied the lib "/usr/lib/x86_64-linux-gnu/obs-plugins/obs-websocket.so" to the directory "/var/lib/flatpak/app/com.obsproject.Studio/x86_64/stable/active/files /lib/" and also to the "/var/lib/flatpak/app/com.obsproject.Studio/x86_64/stable/active/files/lib/obs-plugins/" directory

After that, it worked normally! I hope it helped you!
 

Conrad_Guiseppe

New Member
Hello, I'm using OBS version 25.0.8 and I just installed the websocket version 4.8 that's supposed to be working for OBS Studio 25 or above. Problem is, I can't seem to find the "Websocket Server Settings" option under "Tools". Did I install a wrong websocket version? Any help would be greatly appreciated!
How to trigger animations using channel points, on a Mac,

Go to triggerfyre, sign up etc. Download obs-websocket.

When you install obs-websocket it won’t show you where its been installed to, you need to open the following folder- copy the .so file, and paste it into OBS:

OBS plugins are located in Library > Application Support > obs-studio > plugins > obs-websocket > bin > obs-websocket.so - copy it.

Applications> right click OBS > show package contents > plugins> paste the .so file here.

Then when you open OBS, tools, select OBS web socket server settings and hit OK.

Go to your triggerfyre, upload your video (or media of choice) Add what your point redeem is called. Hit save. Click the PINK circle at bottom right of your screen on triggerfyre, and copy the link for your browser source.

In OBS paste the link as a browser into your source.

On twitch go to your channel point settings, add the name of your animation as your reward name. Make sure they’re exactly the same, case sensitive.
 

Barabba

Member
Hi, sorry about the OT, I need to create a fullscreen mosaic with OBS, zoom one camera if needed and go back to mosaic. I can create a static http page on an external device and use websockets as a remote, but I would interact with the same PC. Do you have any ideas how can I change scenes int that way? (without the main OBS interface, I mean). Thank you a lot!
 

plrpilot

New Member
Is anyone having issues with websockets on macs?
I'm not able to leave websockets enabled on mine. It randomly crashes OBS -- sometimes after a minute, sometimes after 5-10 mins. I use it pretty heavily with the Companion app and my streamdeck on my windows machine, but not on my mac. I've seen the issue on both ARM and intel-based iMacs (3 computers total). Disabling websockets prevents the crashes, but I'm not sure how to tell what's causing the issue. Pointers on what I can look for would be most appreciated! I'm on the latest versions of OBS and web-sockets, as far as I can tell.
 

tt2468

New Member
Is anyone having issues with websockets on macs?
I'm not able to leave websockets enabled on mine. It randomly crashes OBS -- sometimes after a minute, sometimes after 5-10 mins. I use it pretty heavily with the Companion app and my streamdeck on my windows machine, but not on my mac. I've seen the issue on both ARM and intel-based iMacs (3 computers total). Disabling websockets prevents the crashes, but I'm not sure how to tell what's causing the issue. Pointers on what I can look for would be most appreciated! I'm on the latest versions of OBS and web-sockets, as far as I can tell.
Do you have a crash report?
 

Loopkill2

New Member
I am having trouble with installing websocket on windows. I use the installer and it doesn't show up in tools but it is in the plugin folder. I have tried reinstalling it a couple of times but still nothing. Any help would be good.
 

tt2468

New Member
tt2468 updated obs-websocket - Remote-control OBS Studio using WebSockets with a new update entry:

obs-websocket 5.0.1

Hi everyone,

We're releasing the next version of obs-websocket on the forum, 5.0.1. This version rewrites the whole underlying RPC protocol and brings lots of new features. To use this version, you will need to have a client that supports the new protocol. This version will be included starting OBS v28, so this release is only for users running OBS version 27.x.x.

For more info on the changes to the protocol, see...

Read the rest of this update entry...
 

DJFrANKyEHP

New Member
This plugin is very very useful if you want to manage the 'Streams' with a tablet or any other kind of device and that's the way I use it. It works flawless and I love how easy is to use it and secure it.

Thanks a lot to all the people involved in its design.

NOTE: All creators are credited as 'Plug-ins Creator' at the credits of my 'Streams' at the end of them. ;)
 
Top