Resource icon

OBS Python OSC Sender for OBS 0.2

noisetteofaddedia submitted a new resource:

OSC Sender for OBS - Send OSC from OBS to control other apps

Allows you to send OSC commands from OBS to control other apps with OBS transitions

How to install it :
- install or download pythonOsc (https://pypi.org/project/python-osc/)
- load the script in OBS

How to use it :
- in the script settings, choose the IP adress and port of the target software
- add a source with a name beginning with "/"
and that's all, when the source is displayed, the message is sent

You can view sent messages with the checkbox in the settings

Read more about this resource...
 

Stach

New Member
I managed to send the commands. but I can not create an OSC server over OBS.

Did you find a solution to your problem? I couldn’t get the server to start via obs. I ended up doing it manually. And I don’t think it’s even trying to send commands. Clicking the checkbox for viewing sent messages does nothing. Also do you know how to change what command is sent? I’m running windows 10 ,obs 24.0.1 and python 3.6 I think. I’m trying to send a command from obs to Casper Cg server to press play when i go live to a specific scene.
 

INS4NITY

Member
Are there any plans to support going the other way? As in, configure so that on an OSC command, a scene is sent to program? It would be huge for using OBS as a PTZ visualizer using control surfaces like the SKAARHOJ PTZ Pro, which has an OSC core
 

Mario Mey

New Member
Did anybody find a way to do what you (and me) want? It would be great to send and receive messages. I checked the code inside and the receiving part is all commented. Would it work? I don't try it yet... but I'll do it when I have time.

I want to control volume of the music with my tablet. I would use MobMuPlat there ;).
 

Mario Mey

New Member
I uncommented every server part, and I get this error:
Code:
[OSCOBS_videoconfestejo.py] Traceback (most recent call last):
[OSCOBS_videoconfestejo.py]   File "/home/mario/videoconfestejo/obs-scripts/OSCOBS_videoconfestejo.py", line 15, in <module>
[OSCOBS_videoconfestejo.py]     from pythonosc import osc_server
[OSCOBS_videoconfestejo.py]   File "/home/mario/videoconfestejo/obs-scripts/pythonosc/osc_server.py", line 4, in <module>
[OSCOBS_videoconfestejo.py]     import asyncio
[OSCOBS_videoconfestejo.py]   File "/usr/lib/python3.7/asyncio/__init__.py", line 8, in <module>
[OSCOBS_videoconfestejo.py]     from .base_events import *
[OSCOBS_videoconfestejo.py]   File "/usr/lib/python3.7/asyncio/base_events.py", line 39, in <module>
[OSCOBS_videoconfestejo.py]     from . import events
[OSCOBS_videoconfestejo.py]   File "/usr/lib/python3.7/asyncio/events.py", line 14, in <module>
[OSCOBS_videoconfestejo.py]     import contextvars
[OSCOBS_videoconfestejo.py]   File "/usr/lib/python3.7/contextvars.py", line 1, in <module>
[OSCOBS_videoconfestejo.py]     from _contextvars import Context, ContextVar, Token, copy_context
[OSCOBS_videoconfestejo.py] ImportError: /usr/lib/python3.7/lib-dynload/_contextvars.cpython-37m-x86_64-linux-gnu.so: undefined symbol: PyContext_Type

I'm not a great Python programer, but I read that it seems to be a issue related to a lib compiled in Python 2 or something ¯\_(ツ)_/¯.

If anyone knows how to make this script to work receiving messages... it would be great to the world.
 

Mario Mey

New Member
Here is a pull request request that fixes this bug: "libobs/util: Fix loading Python binary modules on *nix #3335". With this fix, I can import osc_server correctly. Even I can't make this OSC code work as it should (it receives OSC messages, but for now, OBS is inoperable XD), OBS can do import osc_server with no errors.

Now, I would like to solve this problem:

To make this code work to receive OSC, I need to do server.serve_forever() at the end of the python file. The problem is that this code freeze OBS completly, waiting for OSC messages. I can send these messages and I can print content... but OBS is inoperable.

By doing this, I get:
Code:
print(server.serve_forever.__doc__)
Handle one request at a time until shutdown.
         Polls for shutdown every poll_interval seconds. Ignores
         self.timeout. If you need to do periodic tasks, do them in
         another thread.

So, it seems that I have to run server.serve_forever() in another thread. How should I do it?
 

vinobastin

New Member
Did anybody find a way to do what you (and me) want? It would be great to send and receive messages. I checked the code inside and the receiving part is all commented. Would it work? I don't try it yet... but I'll do it when I have time.

I want to control volume of the music with my tablet. I would use MobMuPlat there ;).
i have to see the code at github what's that from?
 

vinobastin

New Member
Screenshot_2020-06-26-06-56-26-069_org.telegram.messenger.jpg
Screenshot_2020-06-26-06-56-26-069_org.telegram.messenger.jpg
 

Mario Mey

New Member
i have to see the code at github what's that from?

Github is here, but most important, here are the docs :D . It has a Threading Server section where it says how to run server in a thread. I didn't test it, but I think it is what I was looking for.

What is your last message? :thinking:
 

DangerOpps

New Member
Did you find a solution to your problem? I couldn’t get the server to start via obs. I ended up doing it manually. And I don’t think it’s even trying to send commands. Clicking the checkbox for viewing sent messages does nothing. Also do you know how to change what command is sent? I’m running windows 10 ,obs 24.0.1 and python 3.6 I think. I’m trying to send a command from obs to Casper Cg server to press play when i go live to a specific scene.
Did you get it working? How do you start the server manually? I'm probably in over my head but I'd love to send OSC messages from withing OBS.
 

tkishawi

New Member
noisetteofaddedia submitted a new resource:

OSC Sender for OBS - Send OSC from OBS to control other apps



Read more about this resource...
Hi, I don't know what I am looking for but I think that your script might do what I need. I want to send a notification to an App when we go live. The App then sends out a message to all its members that there is a live OBS broadcast. Can you help me with the install as I don't know how to do an install to OBS, or know anyone who can help. thanks.
 

Mario Mey

New Member
Here is my script that was born from your script . But the main target is to receive OSC messages to control OBS.
Please, read the text, because this script needs OBS to run in a particular way (it uses Python 3.7).

 
Top