Maygion IPCamera - ZM Crashing

Post here to ask any questions about hardware suitability, configuration in ZoneMinder, or experiences. If you just want to know if something works with ZoneMinder or not, please check the Hardware Compatibility sections in the forum, and the Wiki first. Also search this topic as well.
dolf1966
Posts: 1
Joined: Sun Dec 20, 2009 8:33 am

Post by dolf1966 »

anyone know how the time zone of my maygion camera can change.

Dolf.
bristoldave
Posts: 48
Joined: Thu Mar 05, 2009 9:42 pm

Post by bristoldave »

Nepenthes wrote:Looks like MJPEG support is coming next week by the announcement on the website.
I guess that in combo with the CGI PT commands makes this cam a 'proper' zoneminder option...
Yep, just saw that. I like to think it's down to the mails I sent :P

Hopefully, the MJPEG stream will resolve the problem of crashing, but it'd be good to resolve that anyway :)
bristoldave
Posts: 48
Joined: Thu Mar 05, 2009 9:42 pm

Post by bristoldave »

Update

The Maygion website now has a new firmware that supports RTSP streaming.

I can view this stream in VLC, but not in ZoneMinder as I can't find a way to set the Remote Host Sub Path :x :x :x
Nepenthes
Posts: 11
Joined: Thu Dec 10, 2009 9:30 am

Post by Nepenthes »

Some more progress but not quite there:

I can see the stream on VLC, but not Zoneminder (or firefox) so I used command line vlc to stream it on another port:

(cam at 192.168.1.226, zm at 192.168.1.66)

Code: Select all

vlc --rtsp-tcp rtsp://admin:admin@192.168.1.226:80/0 --sout '#standard{access=http{mime=multipart/x-mixed-replace; boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=192.168.1.66:8082}']
When this is running I can see full motion video in firefox (which is promising) in Zoneminder it works 'sporadically' and the logs mention shared memory problems i.e typical zoneminder problems that may not be related to the camera
bristoldave
Posts: 48
Joined: Thu Mar 05, 2009 9:42 pm

Post by bristoldave »

Nice! Are you running this command line vlc on the same box as zm? What do you put as the source details in zm?
Nepenthes
Posts: 11
Joined: Thu Dec 10, 2009 9:30 am

Post by Nepenthes »

Yes this is the same box as zm - although I suppose that it does not need to be. I'm using vlc-nox on a debian box, but this could all be done on windows with 'normal' vlc

In Zoneminder:
Remote Protocol : HTTP
Remote Method: simple
Remote Host Name : (ip of box running vlc)
Remote Host Port : 8082 - or whatever you specify to vlc
Remote Host Path : [empty]
bristoldave
Posts: 48
Joined: Thu Mar 05, 2009 9:42 pm

Post by bristoldave »

I can't even get it to work occasionally, I just get a constant black screen and this error in the logs:

"Unable to store frame as shared memory invalid"

Even though I'm sure my shmmax is set high enough. Any ideas?
bristoldave
Posts: 48
Joined: Thu Mar 05, 2009 9:42 pm

Post by bristoldave »

New error now:

Code: Select all

02/08/10 17:04:17.093045 zmc_m7[15019].INF-zm_debug.c/296 [New Debug Level = 5, New Debug Log = /tmp/zm_debug.log.15019]
02/08/10 17:04:17.093610 zmc_m7[15019].DB1-zm_monitor.cpp/2273 [Got 1 monitors]
02/08/10 17:04:17.093926 zmc_m7[15019].DB2-zm_remote_camera_http.cpp/70 [Request: GET / HTTP/1.1
User-Agent: ZoneMinder/1.24.2
Host: 192.168.2.104

]
02/08/10 17:04:17.098536 zmc_m7[15019].DB1-zm_monitor.cpp/338 [monitor purpose=1]
02/08/10 17:04:17.098579 zmc_m7[15019].DB1-zm_monitor.cpp/345 [mem.size=36865192]
02/08/10 17:04:17.098668 zmc_m7[15019].DB1-zm_monitor.cpp/369 [Unable to map file /dev/shm/zm.mmap.7 (36865192 bytes) to locked memory, trying unlocked]
02/08/10 17:04:17.194828 zmc_m7[15019].DB1-zm_zone.cpp/50 [Initialised zone 0/All - 1 - 640x480 - Rgb:ff0000, CM:3, MnAT:15, MxAT:0, MnAP:50, MxAP:75000, FB:3x3, MnFP:50, MxFP:50000, MnBS:10, MxBS:0, MnB:0, MxB:0, OF: 0]
02/08/10 17:04:17.209145 zmc_m7[15019].DB1-zm_monitor.cpp/458 [Monitor Drive-Front has function 2]
02/08/10 17:04:17.209199 zmc_m7[15019].DB1-zm_monitor.cpp/459 [Monitor Drive-Front LBF = '%N - %y/%m/%d %H:%M:%S', LBX = 0, LBY = 0]
02/08/10 17:04:17.209215 zmc_m7[15019].DB1-zm_monitor.cpp/460 [Monitor Drive-Front IBC = 40, WUC = 25, pEC = 10, PEC = 10, EAF = 1, FRI = 1000, RBP = 7, FM = 0]
02/08/10 17:04:17.209597 zmc_m7[15019].DB1-zm_zone.cpp/889 [Got 1 zones for monitor Drive-Front]
02/08/10 17:04:17.209641 zmc_m7[15019].DB5-zm_zone.cpp/918 [Parsing polygon 0,0 639,0 639,479 0,479]
02/08/10 17:04:17.209657 zmc_m7[15019].DB3-zm_zone.cpp/758 [Parsing polygon string '0,0 639,0 639,479 0,479']
02/08/10 17:04:17.209674 zmc_m7[15019].DB3-zm_zone.cpp/796 [Got coordinate 0,0 from polygon string]
02/08/10 17:04:17.209693 zmc_m7[15019].DB3-zm_zone.cpp/796 [Got coordinate 639,0 from polygon string]
02/08/10 17:04:17.209711 zmc_m7[15019].DB3-zm_zone.cpp/796 [Got coordinate 639,479 from polygon string]
02/08/10 17:04:17.209727 zmc_m7[15019].DB3-zm_zone.cpp/796 [Got coordinate 0,479 from polygon string]
02/08/10 17:04:17.209751 zmc_m7[15019].DB3-zm_zone.cpp/816 [Successfully parsed polygon string]
02/08/10 17:04:17.209771 zmc_m7[15019].DB1-zm_zone.cpp/50 [Initialised zone 10/All - 1 - 640x480 - Rgb:ff0000, CM:3, MnAT:25, MxAT:0, MnAP:9216, MxAP:230400, FB:3x3, MnFP:9216, MxFP:230400, MnBS:6144, MxBS:0, MnB:1, MxB:0, OF: 0]
02/08/10 17:04:17.224219 zmc_m7[15019].DB1-zm_monitor.cpp/2470 [Loaded monitor 7(Drive-Front), 1 zones]
02/08/10 17:04:17.224278 zmc_m7[15019].INF-zmc.cpp/188 [Starting Capture]
02/08/10 17:04:17.224778 zmc_m7[15019].DB3-zm_remote_camera_http.cpp/106 [Connected to host, socket = 4]
02/08/10 17:04:17.225024 zmc_m7[15019].DB3-zm_remote_camera_http.cpp/127 [Request sent]
02/08/10 17:04:17.252791 zmc_m7[15019].DB3-zm_remote_camera_http.cpp/172 [Expecting 40692 bytes]
02/08/10 17:04:17.253020 zmc_m7[15019].DB3-zm_remote_camera_http.cpp/197 [Read 40692 bytes]
02/08/10 17:04:17.253194 zmc_m7[15019].DB3-zm_remote_camera_http.cpp/687 [Got status '200' (OK), http version 1.0]
02/08/10 17:04:17.253215 zmc_m7[15019].DB3-zm_remote_camera_http.cpp/700 [Got content length '40473']
02/08/10 17:04:17.253230 zmc_m7[15019].DB3-zm_remote_camera_http.cpp/709 [Got content type 'multipart/x-mixed-replace']
02/08/10 17:04:17.253250 zmc_m7[15019].DB3-zm_remote_camera_http.cpp/718 [Got content boundary '--7b3cc56e5f51db803f790dad720ed50a']
02/08/10 17:04:17.253269 zmc_m7[15019].DB3-zm_remote_camera_http.cpp/886 [Unable to extract subheader from stream, retrying]
02/08/10 17:04:17.333242 zmc_m7[15019].DB3-zm_remote_camera_http.cpp/172 [Expecting 40556 bytes]
02/08/10 17:04:17.333344 zmc_m7[15019].DB3-zm_remote_camera_http.cpp/197 [Read 40556 bytes]
02/08/10 17:04:17.333910 zmc_m7[15019].DB4-zm_remote_camera_http.cpp/835 [Got boundary subheader '--7b3cc56e5f51db803f790dad720ed50a
Content-Type: image/jpeg
Content-Length: 40467

<FF><D8><FF><E0>']
02/08/10 17:04:17.333935 zmc_m7[15019].DB3-zm_remote_camera_http.cpp/867 [Got boundary '--7b3cc56e5f51db803f790dad720ed50a']
02/08/10 17:04:17.333953 zmc_m7[15019].ERR-zm_remote_camera_http.cpp/913 [Found unsupported content type '']
02/08/10 17:04:17.334201 zmc_m7[15019].ERR-zm_remote_camera_http.cpp/1044 [Unable to get response]
02/08/10 17:04:17.334374 zmc_m7[15019].ERR-zmc.cpp/260 [Failed to capture image from monitor 7 (0/1)]
Nepenthes
Posts: 11
Joined: Thu Dec 10, 2009 9:30 am

Post by Nepenthes »

I get the same sort of thing - and I've also maxed out the shared memory settings. I have also set the resolution of the cam to 320*240 (which to be honest would be ok with me if it worked) and I've even tried backing off the framerate of the stream from vlc.

I can say that I can reliably show it working, but only for a few seconds. Set the cam to monitor, then restart zm, and show the monitor. Should go for a few seconds.

Looks like there is still something not quite right with the stream from VLC. I don't think it's the VLC stream itself that has gone wrong, as I tried the following:

Code: Select all

vlc a002633.mpg --sout '#transcode{vcodec=MJPG,vb=500,fps=10,scale=1,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=192.168.1.66:8083}'
In other words just streaming a bog standard 320 by 240 Mpeg I downloaded from google, and it worked just fine for as long as you like. Somthing is wrong with the Maygion output.

Perhaps setting VLC to really transcode MJPG=>MJPG would help in the hopes that VLC is more 'forgiving'?
bristoldave
Posts: 48
Joined: Thu Mar 05, 2009 9:42 pm

Post by bristoldave »

Nepenthes wrote:Somthing is wrong with the Maygion output.
I don't find this entirely surprising.

Maybe it's time to go back to looking at getting the static jpg?

This should work but appears to fail because ZM crashes if it recieves a 0-length JPG. This is surely a bug in ZM? Why can't we patch ZM to just try fetching the JPG again if it recieves a 0 length reply?
Nepenthes
Posts: 11
Joined: Thu Dec 10, 2009 9:30 am

Post by Nepenthes »

Actually getting the snap is OK for me, rock solid I have it at 6fps which is just good enough I suppose. Still would be nice if MJPEG worked, when it did work it was getting about 18fps.

Maybe a case of getting what you pay for.
bristoldave
Posts: 48
Joined: Thu Mar 05, 2009 9:42 pm

Post by bristoldave »

Nepenthes wrote:Actually getting the snap is OK for me, rock solid I have it at 6fps which is just good enough I suppose. Still would be nice if MJPEG worked, when it did work it was getting about 18fps.

Maybe a case of getting what you pay for.
I have tried getting the snap but it's still crashing for me, every few seconds or so. Could be the network but I can't see why when the RTSP stream works so well.

It definitely appears to be because the maygion cam appears to send 0-length or corrupt JPEG snaps every now and again. If I put http://admin:admin@192.168.2.103/snapshot.cgi in my Firefox address bar and keep hitting refresh, occasionally it'll show a blank (0-length, I guess) image and sometimes an error that says

Code: Select all

The image "http://admin:admin@192.168.2.103/snapshot.cgi" cannot be displayed, because it contains errors
which I assume is a firefox error.

The problem is the javascript page included on the camera web interface which just reloads the image works fine, and the RTSP stream plays fine in VLC, and also in firefox with the vlc command-line trick you showed above, so whilst I can mail the developer with my problems, I expect he'll just claim that it works fine for him in VLC/Firefox :(

I've tried editing the ZM code to make it more tolerant of crappy images and just try to fetch another (which would be ideal as you'd only lose a frame as opposed to seconds of video as it crashes and restarts the daemon) but it doesn't seem to work :(
Nepenthes
Posts: 11
Joined: Thu Dec 10, 2009 9:30 am

Post by Nepenthes »

Had the same problem myself with the binaries on Ubuntu. Gave up and installed debian and built zm from source. Rev 3007 if that helps.
bristoldave
Posts: 48
Joined: Thu Mar 05, 2009 9:42 pm

Post by bristoldave »

I tried Debian but it doesn't recognise the HDD in the machine I'm using, which is a bit of an issue!

Currently running Ubuntu Server 9.04 (as I've read people here have probs with 9.10) and built Rev 3007 from source, but still getting the problem of zm crashing and restarting causing 5 sec gaps in the feed and the source going eventually red with blank image. I think it's when the Maygion cam sends a 0-length JPEG but I don't see why ZM can't just request another image when it happens rather than crashing, there's definitely a bug in the ZM code but my attempts to fix it have failed.

I think others have stated this doesn't happen in 1.23 so maybe I'll have to downgrade...
coke
Posts: 518
Joined: Wed Jan 30, 2008 5:53 pm
Location: St. Louis, MO, USA

Post by coke »

FYI: All three of my servers are on Ubuntu 9.10, none have any issues. (Only one of them has an analog pvr-149 or 150)
Post Reply