Difference between revisions of "How to Install ZoneMinder under Ubuntu 12.04 Server"

From steamWiki
Jump to: navigation, search
 
Line 33: Line 33:
 
#Setup mjpg_streamer to start automatically on boot using [http://upstart.ubuntu.com/ upstart]
 
#Setup mjpg_streamer to start automatically on boot using [http://upstart.ubuntu.com/ upstart]
 
##nano /etc/init/mjpg_streamer.conf
 
##nano /etc/init/mjpg_streamer.conf
##copy paste the following in
+
##copy paste the following in <pre>description "mjpg_streamer /dev/video1"&#10;start on runlevel [2345]&#10;stop on runlevel [016]&#10;script&#10;export LD_LIBRARY_PATH=/usr/src/mjpg-streamer/mjpg-streamer&#10;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&#10;end script</pre>
        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
 
##save
 
##chmod u+x /etc/init/mjpg_streamer.conf
 
##chmod u+x /etc/init/mjpg_streamer.conf

Latest revision as of 11:09, 9 July 2019

INSTALL ZONEMINDER + MJPG_STREAMER

  1. become root
  2. Download & Install ZoneMinder
    1. apt-get install zoneminder
  3. Install mjpg_streamer
    1. apt-get install libjpeg-dev subversion imagemagick make
    2. svn co https://mjpg-streamer.svn.sourceforge.net/svnroot/mjpg-streamer mjpg-streamer
    3. cd mjpg-streamer/mjpg-streamer
    4. make
    5. make install
  4. Test mjpg_streamer
    1. export LD_LIBRARY_PATH=.
    2. mjpg_streamer -i "input_uvc.so -d /dev/video1 -r 320x240" -o "output_http.so -p 8080 -w ./www"
    3. point a browser to http://ip.address.of.your.machine:8080/stream.html
  5. Setup Monitor in ZoneMinder
    1. General
      1. Source Type = "Remote"
    2. Source
      1. Remote Protocol = "HTTP"
      2. Remote Method = "Simple"
      3. Remote Host Name = "localhost"
      4. Remote Host Port = "8080"
      5. Remote Host Path = "/?action=stream"
      6. Remote Image Colors = "24 bit color"
      7. Capture Width (pixels) = "320"
      8. Capture Height (pixels) = "240"
  6. Check your Monitor & Hopefully it works now!
  7. Setup mjpg_streamer to start automatically on boot using upstart
    1. nano /etc/init/mjpg_streamer.conf
    2. 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
    3. save
    4. 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

  1. http://ubuntuforums.org/showthread.php?t=1566970
  2. http://blog.philippklaus.de/blog/2012/01/09/compile-mjpg-streamer-from-source-on-ubuntu-11-10/
  3. http://www.zoneminder.com/wiki/index.php/Uvc
  4. http://siripong-computer-tips.blogspot.com/2011/10/zoneminder-troubleshooting-guide.html
  5. http://sourceforge.net/projects/mjpg-streamer/forums/forum/739917/topic/3471637\
  6. http://kevin.vanzonneveld.net/techblog/article/run_nodejs_as_a_service_on_ubuntu_karmic/