Also, is there anything against adding regex'es to the Network tab, so that the names don't have to match across multiple instances? Essentially make it the same as the File tab, in terms of sending the currently active scene name "somewhere" that another instance can pick up, and then using regex'es on the received name to trigger arbitrary scenes, except that it goes through the network instead of a file.
---
My first attempt to automate the recording of a live presentation - with the recording being slightly different from live, and so it required a second instance of OBS - was to use the Network tab, until I realized that it required an exact match between the scene names. Technically, I could make that work with a bunch of duplicate scenes on the receiving end,* but it's way too unwieldy to keep that in sync manually when adding new scenes and cleaning up old ones!
* At that point in the rig, all the videos and all the cameras come through the same source and work the same way, so I really only need about 2 or 3 scenes there in total, while the sending end has a lot more.
The File tab worked - Master writes the current scene to a file, Slave has a bunch of file-content triggers using the same file and a different regex for each - until I rebuilt that rig on Linux. It still works on the Windows machine that I initially set it up on, but I've forgotten now what the problem was on Linux. (might have something to do with snap permissions???)
Anyway, the Linux version ended up with a Python script and websockets, but it would be nice if ASS could do this directly on any platform:
Python:
#!/usr/bin/env python
import re
from obswebsocket import obsws, events, requests
wsSlv = obsws("localhost", 4445, "********")
wsSlv.connect()
def on_switch(message):
name = message.getSceneName()
if re.match("Camera.*", name):
wsSlv.call(requests.SetCurrentScene("Meeting"))
if re.match("Feature.*", name):
wsSlv.call(requests.SetCurrentScene("Feature"))
if re.match("Voiceover.*", name):
wsSlv.call(requests.SetCurrentScene("Voiceover"))
wsMst = obsws("localhost", 4444, "********")
wsMst.register(on_switch, events.SwitchScenes)
wsMst.connect()
############################################
# ADD SOMETHING TO BLOCK HERE, #
# UNTIL THE CONNECTION IS NO LONGER NEEDED #
############################################
# Disconnect from both, if possible
# If not, don't worry about it; it probably is already
try:
wsMst.disconnect()
except:
pass
try:
wsSlv.disconnect()
except:
pass
The
on_switch
function does all the work there, and is essentially just a set of regex'es on the same incoming scene name, that each trigger their own arbitrary scenes.
Can the Network tab also have that functionality? Regex'es and GUI like the File tab, but using the received name from the network instead of a file?