Maygion IPCamera - ZM Crashing
Posted: Mon Nov 23, 2009 10:05 am
I have started this thread to post my findings with the Maygion IP Camera and hope that with help from others I can get this camera working.
The camera appears to be a clone of a Foscam FI8908, though it has a different firmware and I'm told that if I flash it with the Foscam firmware it's likely to brick it.
It has pan/tilt and appears to support either MJPEG or some sort of stream (though the seller I bought it off on eBay said MJPEG, I'm not sure I can trust this info) as well as still JPEGs.
I can't find the URL for MJPEG but after some analysis of the camera's own webpage the still JPEGs can be pulled off using http://x.x.x.x/snap.jpg?usr=admin&pwd=admin.
The problem I am having (also reported by sfpeter here) is that when I use this in ZoneMinder, it crashes quite regularly with:
ZM will then restart, grab a few more images, and then crash again.
sfpeter claimed in the other thread that he did not have this problem in 1.22 but does have it in 1.24.2 - I was experiencing the problem in 1.24.2 so downgraded to 1.23.3 but am still experiencing the problem here. Is there anything that has changed between 1.22 and 1.23 that could cause this?
I've also noticed two things:
1) When ZM connects to the camera to grab the image, the HTTP Connection is "Keep-Alive":
Should it be? Is there any way to change this?
2) When connecting to the camera's webpage (at http://x.x.x.x) it displays the stream using an OCX control (which is why I can't get the URL for the MJPEG stream, even if I try to sniff for the request using Wireshark) but it also has a Javascript page for non-IE browsers that pulls the snap.jpg file continuously in an attempt to display a "stream".
There are a couple of interesting points about this page: It's able to continuously pull images down without any errors, and more importantly, it adds an extra parameter to the JPEG image of "uniq" which is a value that changes each time and is generated by using a Javascript Math.Random(); function.
I can only assume from this that the camera has some sort of "protection" (?) to stop you pulling the same URL from it constantly. There must be a reason the camera's javascript-based webpage changes the URL it requests each time by use of the "uniq" parameter.
I can't see how this can be replicated in zoneminder, unless I write a bash script to wget the image and use a similar random number feature. This is going to be my next port of call.
However using the MJPEG stream would be better. I have mailed the contact at http://www.maygion.com about how to get it (since I've read on other forums they're planning on releasing an SDK soon) but I haven't had a reply yet.
The camera appears to be a clone of a Foscam FI8908, though it has a different firmware and I'm told that if I flash it with the Foscam firmware it's likely to brick it.
It has pan/tilt and appears to support either MJPEG or some sort of stream (though the seller I bought it off on eBay said MJPEG, I'm not sure I can trust this info) as well as still JPEGs.
I can't find the URL for MJPEG but after some analysis of the camera's own webpage the still JPEGs can be pulled off using http://x.x.x.x/snap.jpg?usr=admin&pwd=admin.
The problem I am having (also reported by sfpeter here) is that when I use this in ZoneMinder, it crashes quite regularly with:
Code: Select all
11/23/09 09:02:35.137393 zmc_m1[17575].DB3-zm_remote_camera.cpp/739 [Got status '200' (OK), http version 1.1]
11/23/09 09:02:35.137406 zmc_m1[17575].DB3-zm_remote_camera.cpp/752 [Got content length '41793']
11/23/09 09:02:35.137419 zmc_m1[17575].DB3-zm_remote_camera.cpp/780 [Got content type 'image/jpeg']
11/23/09 09:02:35.151553 zmc_m1[17575].DB3-zm_remote_camera.cpp/225 [Expecting 31856 bytes]
11/23/09 09:02:35.151705 zmc_m1[17575].DB3-zm_remote_camera.cpp/250 [Read 31856 bytes]
11/23/09 09:02:35.151969 zmc_m1[17575].DB3-zm_remote_camera.cpp/225 [Expecting 2896 bytes]
11/23/09 09:02:35.151999 zmc_m1[17575].DB3-zm_remote_camera.cpp/250 [Read 2896 bytes]
11/23/09 09:02:35.153373 zmc_m1[17575].DB3-zm_remote_camera.cpp/225 [Expecting 1448 bytes]
11/23/09 09:02:35.153423 zmc_m1[17575].DB3-zm_remote_camera.cpp/250 [Read 1448 bytes]
11/23/09 09:02:35.153550 zmc_m1[17575].DB3-zm_remote_camera.cpp/225 [Expecting 1448 bytes]
11/23/09 09:02:35.153570 zmc_m1[17575].DB3-zm_remote_camera.cpp/250 [Read 1448 bytes]
11/23/09 09:02:35.155245 zmc_m1[17575].DB3-zm_remote_camera.cpp/225 [Expecting 1448 bytes]
11/23/09 09:02:35.155305 zmc_m1[17575].DB3-zm_remote_camera.cpp/250 [Read 1448 bytes]
11/23/09 09:02:35.155641 zmc_m1[17575].DB3-zm_remote_camera.cpp/225 [Expecting 1448 bytes]
11/23/09 09:02:35.155670 zmc_m1[17575].DB3-zm_remote_camera.cpp/250 [Read 1448 bytes]
11/23/09 09:02:35.156174 zmc_m1[17575].DB3-zm_remote_camera.cpp/225 [Expecting 660 bytes]
11/23/09 09:02:35.156214 zmc_m1[17575].DB3-zm_remote_camera.cpp/250 [Read 660 bytes]
11/23/09 09:02:35.156230 zmc_m1[17575].DB3-zm_remote_camera.cpp/990 [Got end of image by length, content-length = 41793]
11/23/09 09:02:35.156274 zmc_m1[17575].DB3-zm_remote_camera.cpp/1057 [Returning 41793 (41793) bytes of captured content]
11/23/09 09:02:35.625003 zmc_m1[17575].DB3-zm_remote_camera.cpp/159 [Connected to host, socket = 3]
11/23/09 09:02:35.625065 zmc_m1[17575].DB3-zm_remote_camera.cpp/180 [Request sent]
11/23/09 09:02:35.634349 zmc_m1[17575].DB3-zm_remote_camera.cpp/220 [Socket closed]
11/23/09 09:02:35.634431 zmc_m1[17575].DB6-zm_remote_camera.cpp/667 []
11/23/09 09:02:35.634447 zmc_m1[17575].DB3-zm_remote_camera.cpp/828 [Unable to extract entire header from stream, continuing]
11/23/09 09:02:35.634542 zmc_m1[17575].ERR-zm_signal.cpp/77 [Got signal (Segmentation fault), crashing]
sfpeter claimed in the other thread that he did not have this problem in 1.22 but does have it in 1.24.2 - I was experiencing the problem in 1.24.2 so downgraded to 1.23.3 but am still experiencing the problem here. Is there anything that has changed between 1.22 and 1.23 that could cause this?
I've also noticed two things:
1) When ZM connects to the camera to grab the image, the HTTP Connection is "Keep-Alive":
Code: Select all
11/23/09 09:02:34.480394 zmc_m1[17575].DB2-zm_remote_camera.cpp/124 [Request: GET /snap.jpg?usr=admin&pwd=admin HTTP/1.1^M
User-Agent: ZoneMinder/1.23.3^M
Host: 192.168.2.103^M
Connection: Keep-Alive^M
2) When connecting to the camera's webpage (at http://x.x.x.x) it displays the stream using an OCX control (which is why I can't get the URL for the MJPEG stream, even if I try to sniff for the request using Wireshark) but it also has a Javascript page for non-IE browsers that pulls the snap.jpg file continuously in an attempt to display a "stream".
There are a couple of interesting points about this page: It's able to continuously pull images down without any errors, and more importantly, it adds an extra parameter to the JPEG image of "uniq" which is a value that changes each time and is generated by using a Javascript Math.Random(); function.
I can only assume from this that the camera has some sort of "protection" (?) to stop you pulling the same URL from it constantly. There must be a reason the camera's javascript-based webpage changes the URL it requests each time by use of the "uniq" parameter.
I can't see how this can be replicated in zoneminder, unless I write a bash script to wget the image and use a similar random number feature. This is going to be my next port of call.
However using the MJPEG stream would be better. I have mailed the contact at http://www.maygion.com about how to get it (since I've read on other forums they're planning on releasing an SDK soon) but I haven't had a reply yet.