Shared memory id issue with ,jpg images

Forum for questions and support relating to the 1.24.x releases only.
Locked
foxtroop11
Posts: 41
Joined: Thu Jan 01, 2009 8:11 am

Shared memory id issue with ,jpg images

Post by foxtroop11 »

I'll try and explain this the best I can,

I'm trying both 1.23 and 1.24 to connect to a usb camera connected to a device serving up .jpg images on a crude web server. I can view the images with any web browser by going to the device's ip address /user/webcam.jpg, and if I go to webcam.html it has a web page that auto refreshes.

The picture is 320x240 and I set it up in Zoneminder as a remote camera with correct ip address and path /user/webcam.jpg. To my surprise zoneminder is able to connect and show the picture but for only about 5-7 seconds on the dot, then it just dies. I'll have to restart zoneminder, play with regexp on and off and sometimes I'll be able to get the picture back for 5-7 seconds then it just dies again. I have another camera that's running on a similar device with a usb web cam using the newer mjpg_streamer app and it serves up a stream which zoneminder never bombs out on.

The only thing I notice is in zmwatch.log is ton's of errors about "can't get shared memory id 7a6d0002 which started at the exact time I put in this new webcam entry. The camera entry was there all night but not working and the logs are just full of the error, anyone have any idea's?
foxtroop11
Posts: 41
Joined: Thu Jan 01, 2009 8:11 am

Post by foxtroop11 »

I'm only trying to provide new ways of using Zoneminder, so hopefully someone can help me.

I'm using a custom version of DD-WRT firmware on the ASUS router with usb ports. This firmware I'm using has about 3 drivers in it for usb webcams' that support a wide range of cameras. This will allow you to have a usb webcam plugged into a wireless router that can be in repeater mode and attached to your home network. The router will automatically detect the webcam and start up a server that outputs in a format like 192.168.1.100/user/webcam.jpg or .html for an auto refreshing page.

I got the bright idea to try and input the camera into Zoneminder as a remote camera which I thought was going to work. I scaled back the output from dd-wrt to 320x240 and Zoneminder connected and would show the image at a couple frams per second for about 5-7 seconds and then the picture would go black, sometimes Zoneminder would close the webpage and then I would go back and no picture. I would fool around with restarting, putting the camera function to none and then back to motion, this would get the picture back for a couple seconds before it crashed again.

I would check the router web page direct and the picture was still there. If someone can let me know what might be happening or if you want to connect to my router stream and see for yourself, just let me know. This could provide a cheap wireless webcam to everyone in Zoneminder.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Might try turning on debug and checking the resulting logs.
cphjst
Posts: 3
Joined: Sun Dec 28, 2008 11:10 pm
Location: Denmark

Re: Shared memory id issue with ,jpg images

Post by cphjst »

foxtroop11 wrote: The only thing I notice is in zmwatch.log is ton's of errors about "can't get shared memory id 7a6d0002 which started at the exact time I put in this new webcam entry. The camera entry was there all night but not working and the logs are just full of the error, anyone have any idea's?
Try to look at:
http://sidrit.wordpress.com/2008/08/04/ ... oneminder/

It solved my problem
/Johnny
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Re: Shared memory id issue with ,jpg images

Post by cordel »

cphjst wrote:
foxtroop11 wrote: The only thing I notice is in zmwatch.log is ton's of errors about "can't get shared memory id 7a6d0002 which started at the exact time I put in this new webcam entry. The camera entry was there all night but not working and the logs are just full of the error, anyone have any idea's?
Try to look at:
http://sidrit.wordpress.com/2008/08/04/ ... oneminder/

It solved my problem
You will get that error any time zmc is not able to capture an image and put it in shared memory, for any reason. This error does not mean that your short on shared memory, there is an error as described in the FAQ for when your short on shared memory. He needs to turn up debug and verify what is creating the issue before just throwing solutions at it.
foxtroop11
Posts: 41
Joined: Thu Jan 01, 2009 8:11 am

Post by foxtroop11 »

I turned up debug, but I'm not really understanding what is causing the issue. I can see ton's of lines where it looks like it's connecting to the remote html feed that the router is outputting in a webcam.jpg format. I'm thinking maybe it's something to do with the fact the webcam is actually just taking pictures ever 4000ms or something and Zoneminder loses track of what's going on. I'm sory, can't really explain it. I just thought it would be a cheap way to make wireless camera's for Zoneminder but with my limited knowlegde that's probably not going to happen.

I'll look throught the debug logs again and copy/paste the error here and maybe someone could shed some light on it.

Here is a sample of the debug log. I'm looking through all the output to find anything,

01/22/09 18:30:01.306365 zmc_m3[17382].DB3-zm_remote_camera_http.cpp/266 [Got status '200' (Ok), http version 1.0]
01/22/09 18:30:01.306387 zmc_m3[17382].DB3-zm_remote_camera_http.cpp/273 [Got connection 'close']
01/22/09 18:30:01.306410 zmc_m3[17382].DB3-zm_remote_camera_http.cpp/289 [Got content type 'image/jpeg'
]
01/22/09 18:30:01.306566 zmc_m3[17382].DB3-zm_remote_camera_http.cpp/170 [Expecting 835 bytes]
01/22/09 18:30:01.306598 zmc_m3[17382].DB3-zm_remote_camera_http.cpp/195 [Read 835 bytes]
01/22/09 18:30:01.306864 zmc_m3[17382].DB3-zm_remote_camera_http.cpp/165 [Socket closed]
01/22/09 18:30:01.306962 zmc_m3[17382].DB3-zm_remote_camera_http.cpp/459 [Got end of image by closure, content-length = 2167]
01/22/09 18:30:01.307292 zmc_m3[17382].DB3-zm_remote_camera_http.cpp/484 [Returning 2167 (2167) bytes of captured content]
01/22/09 18:30:01.310852 zmc_m3[17382].WAR-zm_jpeg.c/62 [Corrupt JPEG data: premature end of data segment]
01/22/09 18:30:01.314684 zmc_m3[17382].DB3-zm_remote_camera_http.cpp/104 [Connected to host, socket = 6]
01/22/09 18:30:01.314788 zmc_m3[17382].DB3-zm_remote_camera_http.cpp/125 [Request sent]
01/22/09 18:30:01.331745 zmc_m3[17382].DB3-zm_remote_camera_http.cpp/170 [Expecting 2283 bytes]
01/22/09 18:30:01.331797 zmc_m3[17382].DB3-zm_remote_camera_http.cpp/195 [Read 2283 bytes]
01/22/09 18:30:01.331844 zmc_m3[17382].DB4-zm_remote_camera_http.cpp/248 [Captured header (116 bytes):
'HTTP/1.0 200 Ok
Server: httpd
Date: Thu, 22 Jan 2009 18:29:54 GMT
Content-Type: image/jpeg
Connection: close
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

In your options under the network tab.
Try turning ZM_NETCAM_REGEXPS off.
You might also try different combination of ZM_HTTP_VERSION and ZM_NETCAM_REGEXPS

Slowing down the capture rate might help as well.
foxtroop11
Posts: 41
Joined: Thu Jan 01, 2009 8:11 am

Post by foxtroop11 »

Just curious, if I were to run make uninstall after stopping zoneminder within the /usr/src Zoneminder folder, would that properly uninstall Zoneminder?

It appears it did, because I did just that and then downloaded the newest 1.24 release again, compiled it with apportaite settings, wiped out the mysql database and reinstalled the newest one and then ran make install. I was then presented with the newest Zoneminder and now for some reason the webcam.jpg image from the dd-wrt webcam server is working inside Zoneminder. I have to switch from http to regexp sometimes as it will go red and then I just switch to the other and it works.

So basically I have a super cheap wireless webcam repeater for Zoneminder. Don't expect it to run like 30 frames a second, but it works and can allow anyone with ASUS usb routers to copy what I have done.
Locked