Code Examples
These examples are sourced from the public, MIT-licensed PTZOptics Code Examples repository. Use them as starting points for a camera integration, then consult the protocol reference for the specific command, compatibility, and parameters.
| Protocol | Language | Task | Source |
|---|---|---|---|
| HTTP API | Python | Send HTTP API commands with digest authentication | Python HTTP example |
| HTTP API | Node.js | Send HTTP API commands with digest authentication | Node.js HTTP example |
| HTTP API | C# | Recall a camera preset | C# preset recall |
| VISCA over IP | Python | Send VISCA movement commands over TCP | Python VISCA example |
| VISCA over IP | Node.js | Send VISCA commands over TCP | Node.js VISCA example |
| VISCA over IP | Python | Save and restore preset positions | Preset utilities |
Choose the matching protocol guide
- For CGI request construction and camera HTTP Authentication, read HTTP API getting started.
- For VISCA transport, packet termination, and camera responses, read VISCA getting started.
The repository examples include configuration values that must be updated for the target camera. Do not publish camera credentials in application source code or version control.