Page 1 of 1

Unable to see mjpeg feed from IP Cam

Posted: Mon Jul 17, 2006 8:48 pm
by rwalker
I have an Airlink AIC250W wireless IP cam. Apparently it is the same as a D-Link DCS-900W. When I pull up the video.cgi in a web browser I get the mjpeg stream, but in ZoneMinder (1.22.2) I don't get an image. Only works if I use the static image page (/image.jpg) which is like 2 fps, so not really useful.

If I set it to the video.cgi the CPU load goes through the roof and I get log messages like this:

Jul 17 12:46:09 sentinel zmdc[20173]: INF ['zmc -m 1' started at 06/07/17 12:46:09]
Jul 17 12:46:10 sentinel zmdc[9780]: INF ['zmc -m 1' starting at 06/07/17 12:46:10, pid = 20173]
Jul 17 12:46:10 sentinel zmdc[9780]: WAR [Can't find process with command of 'zma -m 1']
Jul 17 12:46:10 sentinel zmc_m1[20173]: INF [Debug Level = 0, Debug Log = <none>]
Jul 17 12:46:11 sentinel zmwatch[9829]: INF [Restarting capture daemon for Test, shared memory not valid]
Jul 17 12:46:11 sentinel zmdc[9780]: INF ['zmc -m 1' stopping at 06/07/17 12:46:11]
Jul 17 12:46:11 sentinel zmdc[9780]: INF ['zmc -m 1' crashed, signal 14]

Any ideas?

Posted: Mon Jul 17, 2006 8:53 pm
by jameswilson
not all cameras are stable but if you can get a raw mjpeg of it it should work.

ps i usually only use 2 fps how much were you after as you have to store it and process it

Posted: Mon Jul 17, 2006 9:04 pm
by rwalker
Well after playing with it some more, it will only give me a static image at 320x240. If I set the resolution to 640x480 it will not pull even the static image (although it does not show red).

I was trying to get 5 fps and 10 fps on alarm. Which the camera is supposed to do at 640x480.

Posted: Mon Jul 17, 2006 9:11 pm
by jameswilson
you might be getting bitten by the cannot shmget error, check the faq. ALso if you use mjpeg this is a stream sent by the camera so cannot be throttled by zm, if you try you will get issues with the camera. if yoiu want to change framrate when zm wants to you will have to use single mode. THe only ip camera that i have success with in this mode is axis, and i have tried a dlink, and panasonic. if you use mjpeg you have to run at full frame rate all the time. and you have to limit the framerate at the camera, again not all cams allow this

Still having issues

Posted: Mon Jul 17, 2006 9:38 pm
by rwalker
Ok. I got the still frame grab to work at 640x480 by reducing the image buffer size from 40 frames to 10 and the WarmUp frames from 25 to 10.

I have the kernel memory allocation settings in my sysctl.conf from the FAQ. There is 560MBs of free ram on the machine, so I don't think it is a memory issue. I honestly have no idea why reducing the number of frames it is buffering would matter, since there is so much free memory.

I can pull the mjpeg stream in Firefox or wget with no problems, I have no way of knowing exactly how many frames it is giving. I tried setting max and alarm fps to 10, which is what the camera is supposed to output. That didn't seem to change anything. The still capture is really slow at 640x480, only 2 fps. So have to find a way to get the mjpeg working.

Does anyone have the mjpeg working off any of the following (as they are apparently all the same):
D-Link DCS-900W
Hawking HNC320W
Trendnet IP-200

FIXED!

Posted: Tue Jul 18, 2006 1:56 am
by rwalker
Just had to go turn off ZM_NETCAM_REGEXPS under the Options > Network section. This disables PCRE processing of the page which is apparently not needed on these cameras, since video.cgi feeds a raw mjpeg.

Someone might want to add this to the wiki.

Posted: Thu Jul 20, 2006 2:03 pm
by zoneminder
Thanks for posting back. The Wiki is open contributions now, so anyone registered on these forums can add or edit.

Shouldn't the PCRE option be per camera?

Posted: Thu Jul 20, 2006 5:36 pm
by rwalker
What happens if you have 2 different cameras, one that needs PCRE to pull the image and one that doesn't? Seems like this needs to be an option per network camera.

Posted: Fri Aug 28, 2009 5:31 pm
by nunu
There does not seem to be a PCRE processing option in Zoneminder 1.2.4.2. I looked everywhere for it, thinking this might stabilize my aic250w camera, but the settings below eventually did the trick.

After troubles and tribulations, here's what I had to do to get my tvip100w-n wireless camera working. Using Zoneminder 1.24.2 with Debian Lenny. (These are the exact same settings for the airlink 101 aic250w, look at #6.)

1. First thing is first, memory settings are important, I have a P4 3.ghz machine with 2 gb of memory. I am running virtual box and install Debian Lenny, and dedicated 1gb of memory to this vm. I tried so many settings in /etc/sysctl.conf, then finally found a number that works well, which is kernel.shmmax = 256000000, I did not put in kernel.shmall in the sysctl.conf file. Previously, I had set kernel.shmmax to 128000000, which worked fine for the camera at resolution 320x240, but when I bumped it up to 640x480, it displayed a black screen or a blank screen. Make sure you restart your machine when making any memory changes.

2. Since this is a wireless camera, interference plays a great deal. I had the camera set outside the house where there was a lot more interference and the camera would stop responding after a while, I had to hard reset it. I also experience lots of camera crashes when tweaking the settings constantly, once you get settings that work for you, you should not need to tweak it much. Basically plan out your wireless channels configurations so that you get the least amount of interference with your neighbors Access Points. I brought the camera inside the house and is looking out of a window, and reconfigured my wireless channels (1,6 or 11) are the ones you should use, the wireless has been pretty flawless, getting a 70-80 percent strength signal on it. What also helped is using the tomato router firmware on my wt54g router, where I could increase the power of the antennae.

3. Here are my camera settings:
640x480
medium compression
auto frame rate
With these settings, I get a decent 5-12 fps

320x240
medium compression
auto frame rate
With these settings, I get a pretty solid 15-27 fps

4. The zoneminder camera settings were quite tricky, but I found something that eluded me for awhile. Here are the key settings below.

Source Tab/remote host path:/video/cgi
Buffers Tab/Image buffer size: 150
Buffers Tab/Warmup frames: 30
Buffers Tab/Stream image replay image buffer: 20000

One of these settings makes the viewing stable, and got rid of memory issue messages in the /var/log/messages. Not sure which one did the trick, and I might have these settings bloated, but I left these alone anyways, it may eat up memory, but at least it's stable, you can tweak these til you find a happy medium.

5. One last thing I did was to tweak the Options/Network setting in Zoneminder. I upped the http_timeout setting to 100000. Probably don't need a number that high, not exactly sure what it really does, but a setting to be experimented with. The combination of the source/buffers/options/network configurations have left my system very stable.

6. I also bought a airlink101 aic250w camera, and is basically the same camera as the tvip100w-n, but the image in lowlight is very fuzzy, but the cost was less than half ($69) of what the tvip100w-n was ($140). Configurations were the exact same, except the frame rate at 640x480 isn't as good as the tvip100w-n. Overall though, it is as stable as the tvip100w-n.