How to Install ZoneMinder under Ubuntu 12.04 Server
From steamWiki
- These are just notes for myself to improve this page later. In the meantime. Use them if you can!
- My PC is Eee PC 900HA (http://www.newegg.com/Product/Product.aspx?Item=N82E16834220441)
- My Webcam is a Rosewill RCM-8164V (http://www.newegg.com/Product/Product.aspx?Item=N82E16826193057)
- My OS is Ubuntu 12.04.1 LTS Server
INSTALL ZONEMINDER + MJPG_STREAMER
- become root
- Download & Install ZoneMinder
- apt-get install zoneminder
- Install mjpg_streamer
- apt-get install libjpeg-dev subversion imagemagick make
- svn co https://mjpg-streamer.svn.sourceforge.net/svnroot/mjpg-streamer mjpg-streamer
- cd mjpg-streamer/mjpg-streamer
- make
- make install
- Test mjpg_streamer
- export LD_LIBRARY_PATH=.
- mjpg_streamer -i "input_uvc.so -d /dev/video1 -r 320x240" -o "output_http.so -p 8080 -w ./www"
- point a browser to http://ip.address.of.your.machine:8080/stream.html
- Setup Monitor in ZoneMinder
- General
- Source Type = "Remote"
- Source
- Remote Protocol = "HTTP"
- Remote Method = "Simple"
- Remote Host Name = "localhost"
- Remote Host Port = "8080"
- Remote Host Path = "/?action=stream"
- Remote Image Colors = "24 bit color"
- Capture Width (pixels) = "320"
- Capture Height (pixels) = "240"
- General
- Check your Monitor & Hopefully it works now!
- Setup mjpg_streamer to start automatically on boot using upstart
- nano /etc/init/mjpg_streamer.conf
- copy paste the following in
description "mjpg_streamer /dev/video1" start on runlevel [2345] stop on runlevel [016] script export LD_LIBRARY_PATH=/usr/src/mjpg-streamer/mjpg-streamer mjpg_streamer -i "input_uvc.so -d /dev/video1 -r 320x240" -o "output_http.so -p 8080 -w /usr/src/mjpg-streamer/mjpg-streamer/www" >> /var/log/mjpg_streamer_upstart.log 2>&1 end script
- save
- chmod u+x /etc/init/mjpg_streamer.conf
NOTES
- I was unable to get my webcam to work without mjpg_streamer
- Host Port should be whatever you set it to in the mjpg_streamer call
- I had to set mjpg_streamer & zoneminder to 320x240 to get it to work
- I had to chose /dev/video1 because the default (/dev/video0) was the built in webcam on my laptop
ERRORS
- 2012-09-17 20:57:30.000889 zms 3684 ERR Terminating, last frame sent time 10.011587 secs more than maximum of 10.000000 zm_monitor.cpp 3639
- This seems to be caused by incorrect resolution (or possibly other settings) in mjpg_streamer+zoneminder (ie: a resolution it can't handle... try 320 x 240)
- 2012-09-17 20:16:33.085866 zms 2484 ERR Got unexpected memory map file size 9217192, expected 36865192 zm_monitor.cpp 364
- This seems to be caused by having a resolution that is wrong and/or by having some memory settings wrong.
- edit /etc/sysctl.conf and type "kernel.shmall = 167772160" and "kernel.shmmax = 167772160" at the bottom of the file. This appears to fix the memory map issue. Error may still occur if some ZoneMinder settings are wrong.
REFERENCES
- http://ubuntuforums.org/showthread.php?t=1566970
- http://blog.philippklaus.de/blog/2012/01/09/compile-mjpg-streamer-from-source-on-ubuntu-11-10/
- http://www.zoneminder.com/wiki/index.php/Uvc
- http://siripong-computer-tips.blogspot.com/2011/10/zoneminder-troubleshooting-guide.html
- http://sourceforge.net/projects/mjpg-streamer/forums/forum/739917/topic/3471637\
- http://kevin.vanzonneveld.net/techblog/article/run_nodejs_as_a_service_on_ubuntu_karmic/