Tutorial 5 – Joystick PTZing

Tutorial 4 – Center Relative PTZing

In the previous tutorial, we learned how to center relative PTZ.

In this tutorial, we’ll learn how to PTZ in a more continuous way, much like a holding a PTZ joystick at an angle.

Like every PTZ action, a connection to the camera is required:

OCAdapter.OCCamera’s method GetDynamicLiveURL forces a connection to the NVR. A connection to the NVR is required prior to issuing PTZ commands.

Now that we’re connected, let’s do some panning:

Ocularis.ICamera’s method SetPanTiltJoystick, takes three floats, which represent x (pan), y (tilt) and z (zoom) speed respectively; the max speed for any direction is 1000 and its min depends on the deadzone value, which defaults to 100. Negative panning speeds pan left and positive pan right. Negative tilting speeds tilt up and positive tilt down. Negative zooming speeds zoom out and positive zoom in.

Once called, the PTZ camera will continuously PTZ for the direction and speed it was given until another command is received.
Next, let’s do some tilting:

Finally, let’s try zooming:

Movie of the final program:

That’s it, you can now joystick PTZ a camera.

Tutorial 6 – Zoom Box PTZing