ZoneMinder \\ ====== Installation on Ubuntu ====== Original article at: [[https://wiki.zoneminder.com/Ubuntu_Server_18.04_64-bit_with_Zoneminder_1.30.4_the_easy_way]] \\ * Install Ubuntu * Set up storage ... * MariaDB storage at ''/var/lib/mysql'' * Apache storage at ''/var/www'' // (or ''/var/www/html'') // * ZoneMinder data/video storage under ''/var/cache/zoneminder'' * Configure PPA for ZoneMinder: [[https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder]] \\ // Not up-to-date // sudo add-apt-repository ppa:iconnor/zoneminder sudo apt-get update * Instead, get this package: ''wget --no-check-certificate https://173.163.189.225/zoneminder-1.30.4-bionic-amd64.deb'' * Install MariaDB: ''apt install mariadb-server'' * Add to ''[mysqld]'' section in /etc/mysql/mariadb.conf.d: ''sql_mode = NO_ENGINE_SUBSTITUTION'' * Install Apache: ''apt install apache2'' * Install Zoneminder: ''apt install ./zoneminder-1.30.4-bionic-amd64.deb'' * Enable Zoneminder service to start at boot: ''systemctl enable zoneminder.service'' * Add ''www-data'' to the sudo group (to enable use of local video devices): ''adduser www-data video'' * Start Zoneminder: ''systemctl start zoneminder.service'' * Enable CGI and Zoneminder configuration in Apache:a2enmod cgi a2enmod rewrite a2enconf zoneminder * Add timezone to PHP: ''vim /etc/php/7.2/apache2/php.ini'' \\ Find [Date] and add timezone spec entry * Change permissions in /usr/share/zoneminder/: ''chown -R www-data:www-data /usr/share/zoneminder/'' * Restart Apache: ''service apache2 restart'' * **IMPORTANT FINAL STEP:** * Open Zoneminder in a web browser (http://server-ip/zm) * Click on Options - Paths * Change ''PATH_ZMS'' to ''/zm/cgi-bin/nph-zms'' ====== Resources ====== [[:tech:zoneminder:cameras:start|Camera Information]] ====== Troubleshooting ====== ==== Auto-Upgrade Failure on Ubuntu ==== Post-install script is at ''/var/lib/dpkg/info/zoneminder.postinst'' ==== Video Playback in Browser not working ==== ZoneMinder uses a CGI program called ''nph-zms'' as a vehicle for the browser to hook up to and update the video stream(s). If a message like this appears in the apache log: [Thu Aug 04 02:03:02.420973 2016] [:error] [pid 12461:tid 139862547818240] [client 192.168.0.220:53274] ERR [socket_sendto( /home/zm/tmp/zms-296737s.sock ) failed: No such file or directory], referer: http://192.168.0.11:8080/zm/index.php?view=watch&mid=1 ... this probably means that the ZoneMinder CGI program(s) can't be executed, due to either apache config, actual file locations, etc ... * Make sure a CGI module is enabled for apache * Make sure the apache config addresses directory setup for ZoneMinder's CGI programs/location * Make sure the ZoneMinder CGI location is accessible inside the web site's space * Make sure the ZoneMinder settings, under the "Paths" section, have the right path to the ''nph-zms'' program ==== Montage View Issues ==== === Layout Selection Doesn't Take Effect === The layout selection won't take effect if Firefox's zoom setting isn't at 100% \\ === Camera Monitors Have Intermittent Display Failures === Firefox only allows a low number of connections by default, and if more than just a small handful of cameras ( perhaps, more than 6 ) are being monitored, there won't be enough connections allowed for all the required activity. The solution for this is to change some settings in Firefox to allow more connections, which is done by visiting the ''about:config'' URL, and changing these settings: browser.cache.check_doc_frequency 1 browser.cache.disk.enable False network.http.max-connections 100 network.http.max-persistent-connections-per-proxy 100 network.http.max-persistent-connections-per-server 100 ==== Video Devices ==== Make sure that the ''apache'' login is in the ''video'' group, so that typical ownership/permissions on video devices allows the apache login to access them ===== ZoneMinder Installation for Slackware ===== === Perl modules need to be installed === * cpan LWP * cpan LWP::Protocol::https * cpan Date::Manip - cpan HTML::Tagset - cpan HTML::Parser - cpan Encode::Locale * cpan URI::Escape - cpan HTTP::Date - cpan LWP::MediaTypes - cpan File::Listing - cpan Net::HTTP - cpan WWW::RobotRules - cpan HTTP::Message - cpan HTTP::Negotiate - cpan HTTP::Cookies - cpan HTTP::Daemon ... at this point, install from libwww-perl.SlackBuild, then continue with perl modules: * cpan PHP::Serialization * cpan Sys::Mmap * cpan Archive::Zip * cpan X10 * cpan Device::SerialPort * cpan MIME::Lite * cpan MIME::Entity The ZoneMinder.SlackBuild should be installed next If a USB webcam is desired, alot of them provide an mjpg stream, and these steps would be appropriate * Install from mjpg-streamer.SlackBuild * modprobe usbvideo The q4vl2 program can be used to verify some cameras (attached to capture cards, etc...) To start ZoneMinder manually: zmpkg.pl start === Re-building libjpeg is advised - OR, use libjpeg-turbo === Sample retrieval: wget http://www.ijg.org/files/jpegsrc.v8d.tar.gz After unpacking the source: ./configure --prefix=/usr Edit jdmarker.c an comment out line with JWRN_EXTRANEOUS_DATA, then export ARCH=x86_64 ; export DESTDIR=/root/build ; make install cd /root/build ; makepkg ../libjpeg-v8d-x86_64-rk4n3.tgz === 1.25.0 and earlier === Change in configure: CPPFLAGS="${CFLAGS} -D__STDC_CONSTANT_MACROS" ... and then: ./configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc --localstatedir=/var --with-webdir=/var/www/htdocs/zm --with-cgidir=/var/www/cgi-bin --with-webuser=apache --with-webgroup=apache ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser ZM_DB_PASS=zmpass ZM_SSL_LIB=openssl === After 1.26 ... === cmake -DCMAKE_INSTALL_PREFIX="/usr" -DZM_DB_PASS="h0ckeypuck" DESTDIR=/root/build make DESTDIR=/root/build make install ... The Default DB user=zmuser and default DB name=zm === ZM has streaming disabled for Chrome - fix with ... === Edit /srv/www/htdocs/zm/includes/functions.php In function canStreamNative() remove the !isChrome() call === Apache ... === Starting with slackware 14.0, apache config needs tweak ... uncomment: LoadModule cgi_module lib64/httpd/modules/mod_cgi.so ==== Blue Cherry H.264 hardware compression capture card driver ==== [[http://docs.bluecherrydvr.com/article/116-using-the-bluecherry-hardware-compression-open-source-linux-drivers-mpeg-4-h264|http://docs.bluecherrydvr.com/article/116-using-the-bluecherry-hardware-compression-open-source-linux-drivers-mpeg-4-h264]] git clone git://github.com/bluecherrydvr/solo6x10.git === Old Patch ... === diff --git a/solo6010-v4l2-enc.c b/solo6010-v4l2-enc.c index 4b2fbdc..b7ba954 100644 --- a/solo6010-v4l2-enc.c +++ b/solo6010-v4l2-enc.c @@ -949,7 +949,7 @@ static int solo_enc_open(struct inode *ino, struct file *file) fh->fmt = V4L2_PIX_FMT_MPEG; fh->type = SOLO_ENC_TYPE_STD; -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,37) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36) videobuf_queue_sg_init(&fh->vidq, &solo_enc_video_qops, &solo_dev->pdev->dev, &fh->av_lock, diff --git a/solo6010-v4l2.c b/solo6010-v4l2.c index 4a955eb..e3077c2 100644 --- a/solo6010-v4l2.c +++ b/solo6010-v4l2.c @@ -437,7 +437,7 @@ static int solo_v4l2_open(struct inode *ino, struct file *file) return ret; } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,37) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36) videobuf_queue_dma_contig_init(&fh->vidq, &solo_video_qops, &solo_dev->pdev->dev, &fh->slock, V4L2_BUF_TYPE_VIDEO_CAPTURE, ... then: make rm /lib/modules/2.6.37.6/kernel/drivers/staging/solo6x10/* make install depmod \\ // Links: [[:tech:zoneminder:start|ZoneMinder Info]] ... [[:tech:start|Tech Info]] //