websocket ptz camera support

HAHOBSON

New Member
Hello, I found that OBS Studio's websocket switching of cameras really easy to get working. Can I also control a PTZ camera as well using websockets? Thank you!
 

norihiro

Member
Current obs-websocket cannot communicate with obs-ptz.
What protocol does your PTZ camera support? Depending on the protocol, you might be able to send PTZ control command directly to the camera without going through obs-ptz.
 

HAHOBSON

New Member
Current obs-websocket cannot communicate with obs-ptz.
What protocol does your PTZ camera support? Depending on the protocol, you might be able to send PTZ control command directly to the camera without going through obs-ptz.
Thanks for your reply. I was thinking of just writing my own in Python. Have not chosen a PTZ camera yet, but think the client may want one. We would need an outdoor rated device.
 

norihiro

Member
There are some python libraries for PTZ cameras. VISCA is one of the famous protocol.
  • https://github.com/Sciguymjm/python-visca
    This is a library for VISCA over serial port. If you use this library, you cannot use obs-ptz plugin at the same time because two softwares cannot open the same serial port device at once.
  • https://github.com/misterhay/VISCA-IP-Controller/ (I tried this and it works with my camera SRG-120DH.)
    VISCA over IP is a weird protocol that only one software can connect to the camera from one host. If running this library, you cannot use obs-ptz plugin on OBS Studio at the same time. If your python code is running on another host, both can work at once.
  • Another idea is using `PTZ Action` source. When the scene having the PTZ Action source became active or go to preview, it can define what PTZ action to do such as recalling preset, start/stop pan and tilt. To use this through obs-websocket, you have to create and enable/disable the source and send the scene to program (if you are using studio-mode).
 
Top