From: Kenneth L. <ke...@la...> - 2010-02-09 06:53:59
|
When I wrote mj-grab I did it for my own purpose and offered it for others to play with. I run a moderate setting for the image size: 320 x 240 If you run with larger size or very high quality setting for the jpeg the mj-grab may buffer overflow as it is per default only able to handle a jpeg of 40 kbytes It is simple to change. Look for the line char chbuffer[40000] = ""; And change the 40000 to a number you are sure is larger than the jpeg images when they contain a lot of information. The default image that Motion produces when the video feed is lost is very simple and can be packed a lot even if the image size is big. So this would match your observation that it works when camera is disconnected. It also fits with the *** buffer overflow detected ***: nph-mjgrab terminated So try char chbuffer[80000] = ""; or maybe even higher like char chbuffer[200000] = ""; And then recompile mj-grab Remember that the number will also be the amount of memory the program reserves in RAM so don't be too smart and put a gigantic number. Kenneth mo...@re... wrote: > I see a pattern now. > > All 5 camera images show an image placeholder on my multi-cam viewer mjgrab page (set to refresh with a new image every 20 seconds) when Motion is running and all the cameras are working property. Point is that mjgrab doesn't work when Motion is working fine and all the cameras are up. > > When I have the Motion not starting properly problem (different problem), my multicam mjgrab page gives a green video screen on just one BTTV camera, but all the others show nothing (broken image). > > I had one of the cameras on an Axis 4-port network video server go down today. To my surprise, all showed the (now) usual placeholders on the multi-cam mjgrab page, except the camera that was down showed a black image with a time stamp and a NO VIDEO label in the top left corner. > > So, mjgrab works when the video feed does not, or is lost. Maybe that means something to someone who knows more about how Motion deals with lost video feeds? - thanks > > ----- Original Message ----- > From: mo...@re... > To: "Gordon" <mo...@re...>, "Motion discussion list" <mot...@li...> > Sent: Friday, February 5, 2010 12:03:51 AM GMT -05:00 US/Canada Eastern > Subject: Re: [Motion-user] MJGrab + Lighttpd Problems on Ubuntu 9.10 + Motion Starting Problem > > Compiled Motion to replace the Ubuntu version to see if that might help, but still have the same problems. > > I did install thttpd and disabled lighttpd to try to eliminate lighttpd as the source of mjgrab not working. Same problem. Lighttpd generated a less-than-helpful "server error 500" message, but thttpd provides a backtrace. Does this mean anything to anyone? > > *** buffer overflow detected ***: nph-mjgrab terminated > ======= Backtrace: ========= > /lib/libc.so.6(__fortify_fail+0x37)[0x7f91a24ae647] > /lib/libc.so.6[0x7f91a24ad5f0] > /lib/libc.so.6(__fread_chk+0x15b)[0x7f91a24addcb] > nph-mjgrab[0x400c28] > /lib/libc.so.6(__libc_start_main+0xfd)[0x7f91a23d5abd] > nph-mjgrab[0x4009a9] > ======= Memory map: ======== > 00400000-00401000 r-xp 00000000 08:02 262275 /var/www/cgi-bin/nph-mjgrab > 00601000-00602000 r--p 00001000 08:02 262275 /var/www/cgi-bin/nph-mjgrab > 00602000-00603000 rw-p 00002000 08:02 262275 /var/www/cgi-bin/nph-mjgrab > 00887000-008a8000 rw-p 00000000 00:00 0 [heap] > 7f91a21a0000-7f91a21b6000 r-xp 00000000 08:01 562 /lib/libgcc_s.so.1 > 7f91a21b6000-7f91a23b5000 ---p 00016000 08:01 562 /lib/libgcc_s.so.1 > 7f91a23b5000-7f91a23b6000 r--p 00015000 08:01 562 /lib/libgcc_s.so.1 > 7f91a23b6000-7f91a23b7000 rw-p 00016000 08:01 562 /lib/libgcc_s.so.1 > 7f91a23b7000-7f91a251d000 r-xp 00000000 08:01 179 /lib/libc-2.10.1.so > 7f91a251d000-7f91a271c000 ---p 00166000 08:01 179 /lib/libc-2.10.1.so > 7f91a271c000-7f91a2720000 r--p 00165000 08:01 179 /lib/libc-2.10.1.so > 7f91a2720000-7f91a2721000 rw-p 00169000 08:01 179 /lib/libc-2.10.1.so > 7f91a2721000-7f91a2726000 rw-p 00000000 00:00 0 > 7f91a2726000-7f91a2745000 r-xp 00000000 08:01 176 /lib/ld-2.10.1.so > 7f91a2939000-7f91a293b000 rw-p 00000000 00:00 0 > 7f91a2940000-7f91a2944000 rw-p 00000000 00:00 0 > 7f91a2944000-7f91a2945000 r--p 0001e000 08:01 176 /lib/ld-2.10.1.so > 7f91a2945000-7f91a2946000 rw-p 0001f000 08:01 176 /lib/ld-2.10.1.so > 7fffba992000-7fffba9a7000 rw-p 00000000 00:00 0 [stack] > 7fffba9ff000-7fffbaa00000 r-xp 00000000 00:00 0 [vdso] > ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] > > Mjprox works perfectly with thttpd and lighttpd, but mjgrab won't work on either. > > > ----- Original Message ----- > From: mo...@re... > To: "Motion User" <mot...@li...> > Sent: Tuesday, January 12, 2010 12:55:05 PM GMT -05:00 US/Canada Eastern > Subject: [Motion-user] MJGrab + Lighttpd Problems on Ubuntu 9.10 + Motion Starting Problem > > Having some problems with Motion, and MJ-Grab with Lighttpd on Ubuntu 9.10. > > 1. Problem getting mj-grab working, but mj-prox is working OK. > > System is a Core 2 Dell Vostro 200. It was running either Ubuntu server 8.04 LTS or 8.10 (can't remember, and it may have been 32-bit version) with no problems for over a year; Motion version was from the repositories. I upgraded the system to 9.10 in steps over a couple of days. > > CGI on Lighttpd is broken on 9.10, but I found a work-around for that (http://ubuntuforums.org/showthread.php?p=8601210). Once I got CGI working again, the mj-prox + cambozola worked fine, but mj-grab did not. I recompiled the programs, but that didn't help. I've checked every possible permissions problem I could think of, comparing it to an older working server side-by-side, but found nothing. > > I can view the camera feeds directly in Firefox, so that's OK (makes sense, as mj-prox works). I try to access the mj-grab program directly with http://192.168.67.4/cgi-bin/mj-grab?1 and get "500 - Internal Server Error." Accessing mj-prox the same way works fine. > > I eventually did a fresh install of 9.10 (64-bit) and reinstalled everything, only to find the same problem occurs. The Motion version in Ubuntu 9.10 is 3.2.11, and it recently was updated, probably to include the fixes in 3.2.11.1. I can get mj-grab to work on a similarly configured 64-bit Core i5 with Kubuntu 9.10 Desktop and a bttv camera, so the problem must not be present in all 9.10 Ubuntu 64-bit installs. > > On the webpage I use to show the camera images wtih mj-grab, it *will* show a green screen on only the one bttv camera when Motion does not start properly (see problem #2 below). The other image places show the usual broken image graphic. Once I restart Motion to get it running properly, the bttv camera green image turns into the same broken graphic image placeholder just like the other cameras. > > 2. Motion shows green screen on BTTV cameras when first started > > Motion shows a green screen for BTTV cameras (generic eBay card) when it is started by the start-up scripts on reboot. If I issue sudo /etc/init.d/motion restart once, it will start viewing the camera properly. This problem I observe on both the Core 2 system and the Core i5 system mention above. Motion will also show a green screen the first time after a reboot even if Motion is started interactively, with daemon mode disabled; stopping and restarting gets it running properly. > > Maybe both of these problems are unique to Ubuntu 9.10, but I thought it made sense to ask about them here first. Is the PPA mentioned under the bug fix section (http://www.lavrsen.dk/foswiki/bin/view/Motion/BugReport2008x07x20x094957) something I should try? It looks like the current Ubuntu 9.10 Motion package would include any fixes mentioned there, so I would guess not. thanks, Gordon > > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Motion-user mailing list > Mot...@li... > https://lists.sourceforge.net/lists/listinfo/motion-user > http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Motion-user mailing list > Mot...@li... > https://lists.sourceforge.net/lists/listinfo/motion-user > http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome > |