Integrating PTZ with ioctl controlled camera
Integrating PTZ with ioctl controlled camera
I have this Logitech Orbit I've been looking into integrating with the the PTZ functionality in 1.21.
The control of the pan/tilt is through ioctl calls specific to the pwc driver. The problem is that only one device can have control of the device at the same time. There is a command line utility called setpwc that allows you to set all the params of the device, including pan/tilt. However, if you run it while zmc is using the camera, it will error out with a device busy.
I guess at a first pass, a script could be created that first stopped zmc on the device, ran the setpwc utility to set the pan/tilt, then restarted zmc. But to do it right, how hard would it be to modify zmc to make the ioctl calls itself?
The control of the pan/tilt is through ioctl calls specific to the pwc driver. The problem is that only one device can have control of the device at the same time. There is a command line utility called setpwc that allows you to set all the params of the device, including pan/tilt. However, if you run it while zmc is using the camera, it will error out with a device busy.
I guess at a first pass, a script could be created that first stopped zmc on the device, ran the setpwc utility to set the pan/tilt, then restarted zmc. But to do it right, how hard would it be to modify zmc to make the ioctl calls itself?
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
Looking at the code for setpwc, I see that to open the device, it does:
then to issue a pan/tilt, calls:
I see that zm opens the device the same way in zm_local_camera.cpp, so I'm guessing that v4l doesn't allow shared opens of the device.
Perhaps the most feasible way to implement this is the same way that ZM communicates brightness/contrast requests from the UI to the camera via shared memory? I'm just not sure if it could be done in a generic enough of a way so that you would want to incorporate those changes into zm_local_camera though.
Code: Select all
*fd = open(device, O_RDWR);
Code: Select all
ioctl(fd, VIDIOCPWCMPTGANGLE, &pma)
Perhaps the most feasible way to implement this is the same way that ZM communicates brightness/contrast requests from the UI to the camera via shared memory? I'm just not sure if it could be done in a generic enough of a way so that you would want to incorporate those changes into zm_local_camera though.
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
pqm tilt orbit
here about sphere / orbit ptz pan tilt on linux
http://www.lavrsen.dk/twiki/bin/view/PW ... gInterface
howto install whith zoneminder i dont now..
can some help with this ????
http://www.lavrsen.dk/twiki/bin/view/PW ... gInterface
howto install whith zoneminder i dont now..
can some help with this ????
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
There is a pwc driver which let's you use Philips camera with the normal v4l interface. It presumably doesn't let you control the other enhanced features listed in the page you are referring to, at least not in applications like ZM that just use a common v4l feature set. If you want to use the PTZ features it's just a case of writing a control application that takes the standard set of control parameters that ZM uses and which uses those ioctls. As far as I know one doesn't exist yet though.
Phil
Phil
url from active webcam software
http://{USER_ID}:{PASSWORD}@{CAMERA_IP}/command/ptzf.cgi?Move=left,10
http://{USER_ID}:{PASSWORD}@{CAMERA_IP}/command/ptzf.cgi?Move=right,10
this is the call be used in active webcam software to move this camera left and right.
can this call be used in zoneminder
http://{USER_ID}:{PASSWORD}@{CAMERA_IP}/command/ptzf.cgi?Move=right,10
this is the call be used in active webcam software to move this camera left and right.
can this call be used in zoneminder
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
There is another way to control the Orbit using sysfs calls, now implemented and basically working.
http://www.zoneminder.com/forums/viewtopic.php?t=9788
http://www.zoneminder.com/forums/viewtopic.php?t=9788