Page 1 of 1

Setting up a camera not working with Debian.

Posted: Sun Jun 09, 2013 12:32 pm
by svennb
Hi,
I am in the process of setting up zoneminder on a Debian box.
I am installing the zoneminder package from the repository, version 1.25.0-4 is picked up.

So far I have copied the zm/apache2.conf to sites-available/zoneminder.conf and enabled it with
a2ensite zoneminder. I got rid of the 404 page not found, but page was blank. See next

I have also changed to short_open_tag=On in apache2/php.ini to get the index.php to show.

Now I am trying to attach a web camera to the system. Problem is that "Add new monitor" button is not active.
If I just hardcode ?view=monitor into the URL, I get to a monitor setup, but here I cannot attach /dev/video0, those fields are simply not there.

All in all, many of the linked buttons are not working. Since I had to set short_open_tag, I thought maybe more tuning of my configs are necessary.

Here is what zmu gives me:
# zmu -d /dev/video0 -q -v
Video Device: /dev/video0
General Capabilities
Driver: uvcvideo
Card: USB 2.0 Camera
Bus: usb-0000:00:1d.7-3
Version: 3.1.4
Type: 0x4000001
Supports video capture (X)
Does not support video output
Does not support frame buffer overlay
Does not support VBI capture
Does not support VBI output
Does not support sliced VBI capture
Does not support sliced VBI output
Does not support video output overlay
Does not have tuner
Does not have audio in and/or out
Does not have radio
Does not support read/write i/o (X)
Does not support async i/o
Supports streaming i/o (X)
Standards:
Formats:
YUV 4:2:2 (YUYV) (YUYV)
Crop Capabilities
Bounds: 640 x 480
Default: 640 x 480
Inputs: 1
Input 0
Name: Camera 1
Type: Camera
Audioset: 00000000
Standards: 0x0
Power on (X)
Signal detected (X)
Colour Signal detected
Horizontal Lock detected
Anything wrong with that camera?

Re: Setting up a camera not working with Debian.

Posted: Sun Jun 09, 2013 4:25 pm
by gedger
What version of Debian, I've just set-up on Wheezy and I didn't have to do the a2ensite or change the short_open_tag option to get the basics working, was there a reason to make these changes?

You mention webcam, do you have a video capture card or are you using a USB webcam? Either way can you see video using xawtv or similar?

Richard

Re: Setting up a camera not working with Debian.

Posted: Sun Jun 09, 2013 7:38 pm
by svennb
gedger wrote: What version of Debian, I've just set-up on Wheezy and I didn't have to do the a2ensite or change the short_open_tag option to get the basics working, was there a reason to make these changes?

You mention webcam, do you have a video capture card or are you using a USB webcam? Either way can you see video using xawtv or similar?

Richard
I am using Debian Sid, and from apt-cache policy apache2, I see that Sid has apache2 2.4.4-6 while testing has 2.2.22-13. I call my entries in sources.list sid, testing and stable, so I don't know which version of apache2 Wheezy has. It looks as if my version of apache2 (2.4.4) is getting picky about the opening and closing php5 tags. The php.ini file I mentioned has a short comment about short opening tags for php5 not being recommended anymore, but enabling the short_open_tag gave me the index.php file. Zoneminder will probably have to modify when apache2 2.4.4 becomes mainstream in Debian. I guess my version of apache2 is a bit newer than most other zoneminder users.

Nevertheless, I have been playing around with Firebug since my first post, and this has turned out to give me very valuable information. Among the things that Firebug told me was that calls to scripts in /javascript was not found. I found the apache config file for javascript in the conf.d directory of apache2. That file was not read by apache. I copied javascript-common.conf to conf-available and enabled it with

#> a2enconf javascript-common

After restarting apache2 the "Add new monitor" works. Without Firebug I would not have had the slightest clue as I have not been able to find any log files giving me that type of feedback. I don't know which package put javascript-common.conf into conf.d, but I guess this is the kind of regression a typical Sid user gets when major changes are incorporated into important packages like apache2.

As for the camera, I am using a USB camera. It may be that it is not directly supported by zoneminder, but I have streamed data from it through ffmpeg and ffserver to vlc. I am building a headless access point with camera so I have some difficulty to have a GUI run directly on the box. Now that I have got the zoneminder user interface running the way it is supposed to do, I can go on with experimenting. I can get a yellow text version of /dev/video0 in the monitor list, but when trying to look at the stream, there is no video.

Re: Setting up a camera not working with Debian.

Posted: Sun Jun 09, 2013 7:58 pm
by svennb
svennb wrote:
As for the camera, I am using a USB camera. It may be that it is not directly supported by zoneminder, but I have streamed data from it through ffmpeg and ffserver to vlc. I am building a headless access point with camera so I have some difficulty to have a GUI run directly on the box. Now that I have got the zoneminder user interface running the way it is supposed to do, I can go on with experimenting. I can get a yellow text version of /dev/video0 in the monitor list, but when trying to look at the stream, there is no video.
Firebug is really helpful. I just realized that zoneminder could not get video from the socket in /tmp. Turned out that cgi was not enabled in apache2.

#> a2enmod cgi

restart apache and I can watch the monitor video stream in a separate window.

Re: Setting up a camera not working with Debian.

Posted: Mon Jun 10, 2013 7:32 pm
by gedger
Good to get it working and the heads up for future issues with later versions of Apache. For info Wheezy is at Apache version 2.2.22.

Can you view events on your system, I'm struggling to get the streaming working although the stills are visible.

Richard

Re: Setting up a camera not working with Debian.

Posted: Sun Jun 16, 2013 6:35 pm
by svennb
I haven't tested events so far. I got stuck solving a problem with two webcams of exactly same VID/PID. After reading myself up on the uvcvideo driver and possible problems, I found that I probably have a bandwidth problem on USB.