PTZOptics
Control PTZOptics cameras with full support for pan, tilt, zoom, focus, presets, and power management via VISCA over IP.
Overview
FaustBot integrates with PTZOptics cameras using the VISCA protocol over IP, giving you complete control over your PTZ cameras during streams:
Pan/Tilt Control
Smooth camera movement with variable speed control.
Zoom Control
Zoom in and out with adjustable speed settings.
Focus Control
Auto/manual focus modes with fine adjustment.
Presets
Save and recall up to 255 camera positions.
Power Control
Remote power on/off for camera management.
Multi-Camera
Control multiple PTZ cameras independently.
Setup
Camera Network Configuration
Ensure your PTZOptics camera is connected to your network and has a static IP address configured. You can set this via the camera's web interface or OSD menu.
Find Your Camera IP
Access your camera's web interface or check the OSD menu to find its IP address.
The default VISCA port is 5678.
Add Camera in FaustBot
In FaustBot, go to PTZOptics in the sidebar. Click Add Camera and enter a name, IP address, and port for your camera.
Test Connection
Click Connect to verify the connection. Once connected, you can test movement using the on-screen controls or by creating actions.
Network Tips
For best performance, use a wired ethernet connection for your PTZ cameras. Assign static IP addresses to avoid connection issues after network changes.
Multiple Cameras
FaustBot supports controlling multiple PTZOptics cameras simultaneously. This is ideal for multi-camera productions where you need to switch between different angles.
Add Multiple Cameras
Click Add Camera for each PTZ camera in your setup. Give each a descriptive name like "Main Cam", "Overhead", or "Guest Cam".
Set Default Camera
Mark one camera as the default. Effects and API calls without a specific camera ID will target this camera.
Target Specific Cameras
In effects and scripts, specify the camera ID to control a specific camera. This allows you to create actions that control multiple cameras at once.
Camera IDs
Each camera is assigned a unique ID based on the name you give it. Use these IDs in your scripts to target specific cameras in multi-camera setups.
Effects
Pan/Tilt Movement
Pan Left
Pan camera left at specified speed (1-24).
Pan Right
Pan camera right at specified speed (1-24).
Tilt Up
Tilt camera up at specified speed (1-20).
Tilt Down
Tilt camera down at specified speed (1-20).
Pan/Tilt Combined
Diagonal movement with independent speeds.
Stop Movement
Stop all pan/tilt movement.
Go Home
Return to home position.
Zoom Control
Zoom In
Zoom in at specified speed (0-7).
Zoom Out
Zoom out at specified speed (0-7).
Stop Zoom
Stop zoom movement.
Focus Control
Auto Focus
Enable automatic focus mode.
Manual Focus
Switch to manual focus mode.
Focus Near
Focus on closer objects.
Focus Far
Focus on distant objects.
Stop Focus
Stop focus adjustment.
Presets
Recall Preset
Move camera to saved preset position (0-254).
Save Preset
Save current position to preset slot (0-254).
Power Control
Power On
Turn on the camera remotely.
Power Off
Turn off the camera remotely.
Scripting API
Control PTZOptics cameras from your scripts using the CPH API:
Pan/Tilt Movement
# Pan left at speed 12 (range: 1-24)
CPH.PTZOpticsPanLeft(12)
# Pan right at speed 18
CPH.PTZOpticsPanRight(18)
# Tilt up at speed 10 (range: 1-20)
CPH.PTZOpticsTiltUp(10)
# Tilt down at speed 15
CPH.PTZOpticsTiltDown(15)
# Stop all movement
CPH.PTZOpticsStop()
# Return to home position
CPH.PTZOpticsHome()Zoom Control
# Zoom in at speed 4 (range: 0-7)
CPH.PTZOpticsZoomIn(4)
# Zoom out at speed 6
CPH.PTZOpticsZoomOut(6)
# Stop zoom movement
CPH.PTZOpticsZoomStop()Focus Control
# Enable auto focus
CPH.PTZOpticsFocusAuto()
# Switch to manual focus
CPH.PTZOpticsFocusManual()
# Manual focus adjustments
CPH.PTZOpticsFocusNear() # Focus on closer objects
CPH.PTZOpticsFocusFar() # Focus on distant objects
CPH.PTZOpticsFocusStop() # Stop focus adjustmentPresets
# Recall preset 1 (Wide shot)
CPH.PTZOpticsRecallPreset(1)
# Recall preset 2 (Close-up)
CPH.PTZOpticsRecallPreset(2)
# Save current position to preset 5
CPH.PTZOpticsSavePreset(5)
# Dynamic preset based on user input
preset_num = int(args.get("input0", "1"))
CPH.PTZOpticsRecallPreset(preset_num)
CPH.SendMessage(f"Camera moved to preset {preset_num}")Multi-Camera Control
# Get list of configured cameras
cameras = CPH.PTZOpticsGetCameraIds()
# Get the default camera ID
default_cam = CPH.PTZOpticsGetDefaultCameraId()
# Target a specific camera by ID
CPH.PTZOpticsRecallPreset(1, cameraId="studio-cam")
CPH.PTZOpticsZoomIn(4, cameraId="overhead-cam")
# Check connection status
if CPH.PTZOpticsIsConnected("studio-cam"):
CPH.PTZOpticsPanLeft(10, cameraId="studio-cam")See the full API reference for all available PTZOptics methods.