Page 1 of 1
Integrating PTZ with ioctl controlled camera
Posted: Wed Mar 30, 2005 10:42 pm
by bzo
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?
Posted: Fri Apr 01, 2005 7:18 pm
by zoneminder
This is tricky as the PTZ control is entirely separate from video capture (nothing is allowed to interfere with that). If there no way to open the device in a shared mode?
Phil
Posted: Sun Apr 03, 2005 1:49 am
by bzo
Looking at the code for setpwc, I see that to open the device, it does:
then to issue a pan/tilt, calls:
Code: Select all
ioctl(fd, VIDIOCPWCMPTGANGLE, &pma)
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.
Posted: Sun Apr 03, 2005 3:53 am
by bzo
ok, I think I've found a clean solution to this, but it will have to wait until I upgrade to a 2.6 kernel. It looks like the new version of pwc has a sysfs interface to the pan/tilt calls which will make scripting a piece of cake!
Posted: Sun Apr 03, 2005 7:49 pm
by zoneminder
Excellent. Good luck!
Phil
Posted: Wed Oct 26, 2005 2:50 pm
by KaZeR
Any progress here?
I have the same device, and i'd love to use its PTZ features..
pqm tilt orbit
Posted: Mon Dec 05, 2005 8:42 pm
by toozie
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 ????
Posted: Mon Dec 05, 2005 9:43 pm
by zoneminder
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
url from active webcam software
Posted: Sun Jan 22, 2006 2:55 pm
by toozie
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
Posted: Sun Jan 22, 2006 7:47 pm
by zoneminder
Yes. You will have to create a custom script, look at zmcontrol-axis-v2.pl for an example. You will also have to create a control capability entry in the database, or copy and edit one of the existing ones.
Posted: Sun Jul 15, 2007 8:33 am
by zylantha
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