Multiple Instances websocket

Backseat Nick

New Member
HI I'm running multiple instances of OBS on a mac and want to control each with websocket but I can only control one, any advice?
 

uuoocl

Member
Open each instance of OBS with a unique webSocket Port. The terminal can be used set the Port and Password for each instance.
Running these commands will set the first instance of OBS to Port "4455" and the second instance to Port "4466". With the instances on separate ports, each instance can be controlled individually.

Code:
open -n -a "OBS" --args --profile "Profile Name" --collection "Collection Name" --multi --websocket_port "4455" --websocket_password "WebSocket-Password"

Code:
open -n -a "OBS" --args --profile "Profile Name" --collection "Collection Name" --multi --websocket_port "4466" --websocket_password "WebSocket-Password"

Apple shortcuts can be used to open OBS too. Open OBS with specific Profile, Collection, WebSocket Port and Password
 

AaronD

Active Member
HI I'm running multiple instances of OBS on a mac and want to control each with websocket but I can only control one, any advice?
In my multi-instance rigs, I've always been able to just have one WS server active in total. Whichever instance of OBS has it, becomes the "Master" for all other communication, and everything else of course connects to that.

To communicate between instances of OBS, and do a TON of other automation as well, I use the Advanced Scene Switcher plugin:
Among countless other things that it can watch for and do, it can communicate with other instances of itself through OBS's server. The Master one simply uses that with nothing more to set up, and all the "Slave" instances of Adv. SS connect to that Master server. Slaves don't talk to each other; only to the Master. Then I run the Master alone, as if it were the entire rig, and all the Slaves follow according to the messages that they receive from it.
 

Backseat Nick

New Member
These are three great answers, all better than the working solution I found which was if you open a second instance of obs, you can't open the websocket settings, but if you close it and open it again, sometimes you can open the websocket settings, when you do get it open you can change the port so eventually each instance has the same ip but different port and can be interfaced with independently.

But moving forward I'm going to use the solutions listed here as they are more elegant. Thank you all for your help.

Aaron , I didn't have that same experience with that plugin, what method / settings do you use to communicate between the instances?
 

AaronD

Active Member
Aaron , I didn't have that same experience with that plugin, what method / settings do you use to communicate between the instances?
First, I do (somewhat) like @uuoocl showed, but in a script that does a LOT of other things too, to set up the environment and other apps. Here's just the OBS part of that script:
Bash:
obs --verbose --unfiltered_log --disable-updater --disable-shutdown-check --multi --studio-mode --profile "$OBS_PROFILE" --collection "$OBS_PROFILE" --startvirtualcam > /dev/null &
obs --verbose --unfiltered_log --disable-updater --disable-shutdown-check --multi --studio-mode --profile "Meeting_Slave" --collection "Meeting_Slave" > /dev/null &
"$OBS_PROFILE" is a variable, so I can use the same script for several different things. That's the Master instance. The Slave is simple enough that it can use the same settings regardless, so that one is hard-coded.

Now that we have OBS starting with different settings right off the bat, without having to change them manually after running over itself, we can have the WS server active in the Master and not in the Slave.

Adv. SS also has different settings along with OBS (they're stored in the scene collection), so I do this in the Slave:

1740683684510.png


and this in the Master:
1740683869171.png

(notice that Request and Event are swapped)

If your communication is limited to between instances of Adv. SS, then all that matters is that the text to send or look for, matches. (replace the --enter text-- part) If you're also communicating with something else, then you'll need to know a bit more about how it all works, which would be a question for Adv. SS's discussion thread:
 
Top