test script to send and recieve tcp messages to controll obs
- Install
OBSandOBS Websocketand start it. - Create some scenes in obs
- Download
OBSCommandand unzip the archive. For Examplec:\scratch\OBSCommand - Clone the git repo https://github.com/globi84/TCPmessage4OBS
- Check the path to the
OBSCommand.exeatTCPMessage4OBS_server.ps1and run it from the command line. - Run now
TCPMessages4OBS_testclient.ps1from the command line. - Now you should be ready to remote controll your OBS.
#Start VirtualCam
Send-TCPMessage -Port 29800 ` -Endpoint 127.0.0.1 -message "=StartVirtualCam"
#Stop VirtualCam
Send-TCPMessage -Port 29800 ` -Endpoint 127.0.0.1 -message "=StopVirtualCam"
#Switch to Scene "Speaker"
Send-TCPMessage -Port 29800 ` -Endpoint 127.0.0.1 -message "=SetCurrentScene,scene-name=Speaker"It should work with every command, that are defined at https://github.com/obsproject/obs-websocket/blob/4.x-current/docs/generated/protocol.md
If you get an error, when you start the powershell script, then you need enable to run it.
c:\temp\TCPMessage4OBS_server.ps1 : File C:\temp\TCPMessage4OBS_server.ps1 cannot be loaded because running scripts
is disabled on this system. For more information, see about_Execution_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ c:\temp\TCPMessage4OBS_server.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccessthen you sould run the following command on a elavated console.
Set-ExecutionPolicy RemoteSignedafter this. should everything work.