在OBS中,进入“工具” -> “WebSockets服务器设置”。勾选“启用WebSocket服务器”。设置一个密码(可选),并记下端口号(默认是4444)。4. 编写Python代码,通过obs-websocket连接到OBS 以下是一个示例Python脚本,用于连接到OBS并控制推流。 python import obswebsocket from obswebsocket import obsws, requests # 配...
我们假设已经在 OBS 中创建了一个名为 “MyMediaSource” 的媒体源。 importwebsocketimportjsonimporttime# OBS WebSocket 服务器地址和端口obs_ws_url="ws://localhost:4455"obs_password="your_password"# 根据你设置的密码defon_message(ws,message):print(f"Received message:{message}")defon_error(ws,error...
importobswebsocketfromobswebsocketimportobsws,requests# 创建 OBS WebSocket 客户端client=obsws("localhost",4455,"你的密码")# 连接到 OBSclient.connect()# 设置推流参数stream_settings=requests.SetStreamSettings("你的流名","rtmp://你的推流地址",True)client.call(stream_settings)# 开始推流client.call(r...
import pyperclip from obswebsocket import obsws, requests from obswebsocket.exceptions import ConnectionFailure #就是读取DY直播伴侣的日志文件并提取出直播推流地址和推流码而已手工打开也搜索找也是一样的,别花冤枉钱买了! #Python 3.10 #需要pyperclip obswebsocket # 配置参数 LOG_DIR = os.path.join(os.env...
importobsws_pythonasobs# pass conn info if not in config.tomlcl=obs.ReqClient(host='localhost',port=4455,password='mystrongpass',timeout=3)# Toggle the mute state of your Mic inputcl.toggle_input_mute('Mic/Aux') Requests Method names for requests match the API calls but snake cased. ...
Hello, I am using Python and obsws SDK. How can i mute and unmute mikrofones? For toogle there ist an example. Is there a way to change the text of a text...
A Python library for interacting with OBS Studio through its WebSocket protocol (v5.x.x). This client provides a simple async interface to control OBS Studio programmatically.暂无标签 Python MIT 发行版 暂无发行版 贡献者 (1) 全部
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.
A Python library for interacting with OBS Studio through its WebSocket protocol (v5.x.x). This client provides a simple async interface to control OBS Studio programmatically.
使用OBS 的控制命令 OBS 提供了多种控制命令,可以通过 WebSocket 发送请求,例如切换场景、开始/停止录制等。 切换场景 切换场景的命令如下: defswitch_scene(ws,scene_name):switch_request={"op":6,# Switch scene"d":{"sceneName":scene_name}}ws.send(json.dumps(switch_request)) ...