PTZ (Pan-Tilt-Zoom) Protocols

PTZ Surveillance cameras can be mechanically controlled via remote control using a software protocol over a RS485 link. Ginngi implemented a number of common protocols to support cameras such as Pelco, Samsung, Sony and others.

The target platform was a TI Davinci DM6446 running Linux. The protocol stack was written in C and runs as a Linux process. PTZ commands are sent to the camera via a HTTP based API. They are then parsed and the respective protocol command built prior to it being sent out the RS485 line.

With some PTZ protocols it wasn't enough to just send a command to the camera once but rather the command had to be repeated in order to prevent the camera from timing out and stopping the operation. This was done by using two software threads: one for processing commands and one for interfacing to the camera. The latter was then timed to repeat the operation within the timeout window.