From 692acc8dd0436b11a4a1fbe54007262fcbc06e5b Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Fri, 7 Oct 2022 20:01:29 +0100 Subject: [PATCH] assume vban.toml in obs example update README for obs example --- examples/obs/README.md | 26 ++++++++++++++++++++------ examples/obs/__main__.py | 9 +-------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/examples/obs/README.md b/examples/obs/README.md index 7d21148..f57044b 100644 --- a/examples/obs/README.md +++ b/examples/obs/README.md @@ -8,8 +8,9 @@ Perhaps you have a streaming setup but you want to control OBS and Voicemeeter from a remote location with python installed. With the vban-cmd and obsws-python packages you may sync a distant Voicemeeter with a distant OBS over LAN. -The script assumes you have OBS connection info saved in a config file named `config.toml` placed next to `__main__.py`. -It also assumes you have scenes named `START` `BRB` `END` and `LIVE`. +## Configure + +This script assumes you have your OBS connection info saved in a config file named `config.toml`. A valid `config.toml` file might look like this: @@ -20,13 +21,26 @@ port = 4455 password = "mystrongpass" ``` -## Use +It also assumes you have your VBAN connection info saved in a config file named `vban.toml`. -Simply fill in the OBS websocket details into `config.toml` and your VBAN text request settings in the script (`ip`, `streamname` and `port`). +A valid `vban.toml` file might look like this: + +```toml +[connection] +ip = "gamepc.local" +port = 6980 +streamname = "Command1" +``` + +Both configs should be placed next to `__main__.py`. + +The script also assumes four OBS scenes names "START", "BRB", "END" and "LIVE". + +## Use Make sure you have established a working connection to OBS and the remote Voicemeeter. -Change OBS scenes and watch Voicemeeter parameters change. +Run the script, change OBS scenes and watch Voicemeeter parameters change. Pressing `` will exit. @@ -34,6 +48,6 @@ Pressing `` will exit. This script can be run from a Linux host since the vban-cmd interface relies on UDP packets and obsws-python runs over websockets. -You could for exmaple, set this up to run in the background on a home server such as a Raspberry Pi. +You could for example, set this up to run in the background on a home server such as a Raspberry Pi. It requires Python 3.10+. diff --git a/examples/obs/__main__.py b/examples/obs/__main__.py index dd8e55b..72435a0 100644 --- a/examples/obs/__main__.py +++ b/examples/obs/__main__.py @@ -52,15 +52,8 @@ if __name__ == "__main__": logging.basicConfig(level=logging.INFO) kind_id = "potato" - opts = { - "ip": "gamepc.local", - "streamname": "Command1", - "port": 6980, - "subs": {"pdirty": False}, - "sync": True, - } - with vban_cmd.api(kind_id, **opts) as vban: + with vban_cmd.api(kind_id, sync=True) as vban: cl = obs.EventClient() cl.callback.register(on_current_program_scene_changed)