How to Install ZoneMinder under Ubuntu 12.04 Server
Revision as of 11:09, 9 July 2019 by Sean
- 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 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
- Source Type = "Remote"
- 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"
- 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  stop on runlevel  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
- chmod u+x /etc/init/mjpg_streamer.conf
- 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
- 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.