Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LD_PRELOAD in Windows? #1

Open
baesek opened this issue Aug 11, 2021 · 10 comments
Open

LD_PRELOAD in Windows? #1

baesek opened this issue Aug 11, 2021 · 10 comments

Comments

@baesek
Copy link

baesek commented Aug 11, 2021

How or can i use this script for OBS running on Windows 10?
I tried to follow your instructions, but I don't know how to start OBS with LD_PRELOAD.
I assume I somehow have to put the line C:/Program Files/Python37/python37.dll somewhere.

@MarioMey
Copy link
Owner

I use Debian and I have a Windows 10 partition to test... but, before rebooting my computer and test it by myself, try this: https://support.shotgunsoftware.com/hc/en-us/articles/114094235653-Setting-global-environment-variables-on-Windows. If it doesn't work, tell me: we gonna find the way.

@baesek
Copy link
Author

baesek commented Aug 11, 2021 via email

@MarioMey
Copy link
Owner

What screenshot?

@baesek
Copy link
Author

baesek commented Aug 11, 2021 via email

@MarioMey
Copy link
Owner

MarioMey commented Aug 11, 2021

Someone from Python Argentina Telegram channel told me what to do: in OBS, go to Tools -> Scripts -> Python Settings and configure path there.

@baesek
Copy link
Author

baesek commented Aug 12, 2021

(changed my username...) Okay I found out, that I have to install Python 3.6 instead of 3.7. After adding the path (C:/Program Files/Python36/) to the Tools -> Scripts -> Python Settings, I get a Scripting log which says:

[obs_osc_pythonscript.py] Traceback (most recent call last):
[obs_osc_pythonscript.py] File "C:/Users/User/automat-display/obs/obs-osc/obs-osc-pythonscript-main\obs_osc_pythonscript.py", line 36, in
[obs_osc_pythonscript.py] from obs_osc_api import (
[obs_osc_pythonscript.py] ModuleNotFoundError: No module named 'obs_osc_api'

@baesek
Copy link
Author

baesek commented Aug 12, 2021

I could somehow get it working now by changing some lines in obs_osc_pythonscript.py

"""
from obs_osc_api import (
	scene_change, 
	consola, 
	consola_hslider, 
	c1, c2, c3, 
	c, 
	th
)
"""

from obs_api import (
	# I inserted these 5 from the obs_osc_api import above
	consola, 
	consola_hslider, 
	c1, c2, c3, 
	c, 
	th,

	scene_change, 
	item_set_visible,
	item_remove, 
	item_duplicate,
	item_reference,
	item_set_transform,
	item_get_transform,
	item_set_pos,
	item_set_scl,
	item_set_rot,
	item_set_alignment,
	item_set_visible,
	item_set_crop,
	item_set_scl_filter,
	item_get_order_index,
	item_set_order_index,
	item_swap_order_index,
	item_set_private_setting,
	item_create_group,
	item_create_text,
	item_create_image,
	item_create_video,
)

After that i had to install two python packages for my python36 installation to get it working by entering the following lines into a powershell which was run as an administrator

C:/Program Files/Python36/python.exe -m pip install requests
C:/Program Files/Python36/python.exe -m pip install pillow

I also removed LD_PRELOAD from my windows environment variables and it still worked...

@MarioMey
Copy link
Owner

So... does it work? Congratulations!

@baesek
Copy link
Author

baesek commented Aug 13, 2021

Yes! Super cool script and super fast! Thank you for this. I am just wondering how to find out what commands are possible. For example setting the projector the fullscreen via an osc message.

@MarioMey
Copy link
Owner

MarioMey commented Aug 13, 2021

Well... no, I didn't do that. My scripts (you can see in action in IG @videoconfestejo) are for treat OBS as a game engine: almost all the functions are for manipulate sceneitems and scources. Creating them, transforming them, removing them, etc.

Check https://github.com/upgradeQ/OBS-Studio-Python-Scripting-Cheatsheet-obspython-Examples-of-API for more commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants