Anyone got ZoneMinder working on CentOS 7?

Forum for questions and support relating to the 1.28.x releases only.
philipt
Posts: 37
Joined: Sat Jun 11, 2005 8:29 am
Location: North East England

Anyone got ZoneMinder working on CentOS 7?

Post by philipt » Mon Nov 10, 2014 10:20 am

Just wondering if anyone has ZoneMinder working on CentOS 7? I've spent the last couple of days wrestling with a variety of errors, mainly FFMPEG and Perl which are preventing ZoneMinder building completely. As CentOS 7 has changed so much from CentOS 6 I'm suspecting it's incompatibilities there rather than ZoneMinder issues. So I thought I'd see if anyone else has it working before I spend any more time, or list any specifics! I've had ZoneMinder 1.25 working on previous CentOS versions up to 6 for a while. Thanks.
Philip

chrisn0123
Posts: 28
Joined: Sun Feb 16, 2014 3:10 pm

Re: Anyone got ZoneMinder working on CentOS 7?

Post by chrisn0123 » Mon Nov 10, 2014 10:48 am

Not tried CentOS 7 yet with ZM.. but here are my notes for CentOS 6.5 64 bit if they help and to compare to yours. Hopefully these work with CentOS 7..
Maybe some annoying dependency or something hopefully!!


ZoneMinder Install Guide Centos 6.5 (ZM v1.27+) 64bit - Guide - Updated 18-06-2014

disable selinux

install rpm forge repo

yum -y install mysql mysql-server mysql-devel php php-gd php-mysql httpd gcc pcre-devel gd mod_ssl glib2-devel gcc-c++ ntp gnutls-devel ImageMagick libjpeg-devel perl-Archive-Tar perl-MIME-Lite perl-MIME-tools perl-Date-Manip perl-LWP-UserAgent-Determined perl-PHP-Serialization perl-Device-SerialPort perl-Archive-Zip perl-Sys-Mmap perl-Module-Load subversion git screen yasm openssl perl-Sys-Mmap perl-User-Identity wget php-pear php-pear-DB php-mbstring bison bison-devel make ncurses ncurses-devel libtermcap-devel sendmail sendmail-cf caching-nameserver sox newt-devel libxml2-devel libtiff-devel audiofile-devel gtk2-devel libv4l-devel ffmpeg ffmpeg-devel zlib zlib-devel openssl-devel php-process perl-Time-HiRes perl-CPAN pcre-devel perl-libwww-perl perl-Net-SFTP-Foreign perl-Expect ant ant-nodeps cmake automake bzip2-devel ffmpeg ffmpeg-devel gnutls-devel httpd libjpeg-turbo libjpeg-turbo-devel mysql-devel mysql-server pcre-devel perl-Archive-Tar perl-Archive-Zip perl-Convert-BinHex perl-Date-Manip perl-DBD-MySQL perl-DBI perl-Device-SerialPort perl-Email-Date-Format perl-IO-stringy perl-IO-Zlib perl-MailTools perl-MIME-Lite perl-MIME-tools perl-MIME-Types perl-Module-Load perl-Package-Constants perl-Sys-Mmap perl-Time-HiRes perl-TimeDate perl-YAML-Syck php php-cli php-mysql x264 vlc-devel vlc-core libcurl libcurl-devel polkit polkit-devel



perl -MCPAN -e 'install Sys::Mmap'
perl -MCPAN -e 'install MIME::Entity'
perl -MCPAN -e 'install X10::ActiveHome'

yum -y update

Turn on services

chkconfig httpd on
chkconfig mysqld on
chkconfig ntpd on
ntpdate pool.ntp.org
service httpd start
service mysqld start
service ntpd start

Setup mysql...

/usr/bin/mysql_secure_installation
(default is no pass, then add local root password)

Extract ZM files

cd /root
tar -zxvf ZoneMinder-*.tar.gz
cd /ZoneMinder-*


cmake -DZM_DB_HOST="localhost" -DZM_DB_NAME="zm" -DZM_DB_USER="root" -DZM_DB_PASS="zm-password-change-me" -DZM_WEBDIR="/var/www/html/zm" -DZM_CGIDIR="/var/www/cgi-bin" -DZM_CONTENTDIR="/var/www/html/zm/data" -DZM_EXTRA_LIBS="ssl" -DCMAKE_VERBOSE_MAKEFILE="ON" -DCMAKE_INSTALL_PREFIX="/usr" -DCMAKE_CXX_FLAGS_RELEASE="-D__STDC_CONSTANT_MACROS"

./zmlinkcontent.sh /var/www/html/zm/data (or to a large hdd elsewhere as this is the file storage)
chown -R apache:apache /var/www/html/zm/data

in /etc/php.ini set short_open_tag to On

make
make install

mysql -u root -p
create database zm;
exit

mysql -u root -p zm < /usr/share/zoneminder/db/zm_create.sql

cp scripts/zm /etc/init.d/
chmod +x /etc/init.d/zm
chkconfig zm on
cd ..
download/compile cambozola
http://www.charliemouse.com/code/cambozola/index.html


cp cambozola.jar /var/www/html/zm/
chown apache:apache /var/www/html/zm/cambozola.jar

# from the ZoneMinder-1.25 source directory
cp scripts/zm /etc/init.d/
chmod +x /etc/init.d/zm


chkconfig zm on
service zm start



Enable Cambozola

tick the box for support for the Cambozola addon within your ZoneMinder installation: http://ip-address/zm (Options->Images tab->OPT_CAMBOZOLA)

Set JPG quality to 80...Options -> Image

Set appropriate ffmpeg quality settings for exporting video using this guide...http://ffmpeg.org/ffmpeg-doc.html (Options -> Images -> ffmpeg_output_options)

Options -> Images -> PATH_FFMPEG change to /usr/bin/ffmpeg

philipt
Posts: 37
Joined: Sat Jun 11, 2005 8:29 am
Location: North East England

Re: Anyone got ZoneMinder working on CentOS 7?

Post by philipt » Mon Nov 10, 2014 12:52 pm

Thanks, Chris, the instructions are useful, particularly the cmake bits; I'd always configured manually before and was scratching my head there a bit! The issue with CentOS 7 is that lots of stuff has changed by default. For example 'service httpd start' is replaced by 'systemctl start httpd' and mysql has been replaced by mariadb; although there are compatibility options there are quirks to find and debug. I will plug away, your help is appreciated.
Philip

User avatar
knight-of-ni
Posts: 2355
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Anyone got ZoneMinder working on CentOS 7?

Post by knight-of-ni » Mon Nov 10, 2014 1:10 pm

I haven't rolled out any rpms for CentOS 7 because the RPMFusion repo doesn't support CentOS 7 yet.

However, building Zoneminder from source on CentOS 7 shouldn't be too bad with the understanding that Fedora can be thought of as CentOS Beta.

In this case the instructions for installing ZoneMinder will more closely follow the instructions we already have developed for Fedora.
https://github.com/ZoneMinder/ZoneMinde ... DME.Fedora

MariaDB is suppossed to be a drop in replacement for mysql so, fingers crossed, it should not cause any issues.

CentOS 7 uses systemd so you've got to use the zoneminder systemd unit file, instead of the old sys v init script. Here is the template.
https://github.com/ZoneMinder/ZoneMinde ... service.in

When you build from source, make will populate the macros in the template for you. Just copy it out of the /misc folder to /var/lib/systemd/system/.

Naturally, once I do release RPM's for CentOS 7, these steps will be automated.

You will also need to use tmpfiles.d to auto-create the /run/zoneminder folder at boot. Template is here:
https://github.com/ZoneMinder/ZoneMinde ... r.tmpfiles

Put that file under /etc/tmplfiles.d/

Good Luck!
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

chrisn0123
Posts: 28
Joined: Sun Feb 16, 2014 3:10 pm

Re: Anyone got ZoneMinder working on CentOS 7?

Post by chrisn0123 » Mon Nov 10, 2014 1:14 pm

No probs phillipt!

I'm now running a test CentOS 7 vm to see if I can get it going.

I managed to get ffmpeg installed without problems using this repo;
yum -y install http://li.nux.ro/download/nux/dextop/el ... noarch.rpm

Got up to compiling, but got some errors with something else. Now working on it and will post my updated notes if I get it going! :)

chrisn0123
Posts: 28
Joined: Sun Feb 16, 2014 3:10 pm

Re: Anyone got ZoneMinder working on CentOS 7?

Post by chrisn0123 » Mon Nov 10, 2014 1:39 pm

Get stuck here on make :)

In file included from /root/zm/ZoneMinder/src/zm_event.cpp:34:0:
/root/zm/ZoneMinder/src/zm_mpeg.h:45:7: error: use of enum ‘PixelFormat’ without previous declaration
enum PixelFormat pf;
^
/root/zm/ZoneMinder/src/zm_mpeg.h:46:2: error: ‘AVOutputFormat’ does not name a type
AVOutputFormat *of;
^
/root/zm/ZoneMinder/src/zm_mpeg.h:47:2: error: ‘AVFormatContext’ does not name a type
AVFormatContext *ofc;
^
/root/zm/ZoneMinder/src/zm_mpeg.h:48:2: error: ‘AVStream’ does not name a type
AVStream *ost;
^
/root/zm/ZoneMinder/src/zm_mpeg.h:49:2: error: ‘AVCodec’ does not name a type
AVCodec *codec;
^
/root/zm/ZoneMinder/src/zm_mpeg.h:50:2: error: ‘AVFrame’ does not name a type
AVFrame *opicture;
^
/root/zm/ZoneMinder/src/zm_mpeg.h:51:2: error: ‘AVFrame’ does not name a type
AVFrame *tmp_opicture;
^
/root/zm/ZoneMinder/src/zm_mpeg.h:64:5: error: ‘AVPacket’ does not name a type
AVPacket** packet_buffers;
^
/root/zm/ZoneMinder/src/zm_mpeg.h:66:20: error: ‘AVPacket’ has not been declared
int SendPacket(AVPacket *packet);
^
/root/zm/ZoneMinder/src/zm_event.cpp: In member function ‘virtual void EventStream::processCommand(const StreamBase::CmdMsg*)’:
/root/zm/ZoneMinder/src/zm_event.cpp:882:66: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if ( (mode == MODE_SINGLE) && (curr_frame_id == event_data->frame_count) )
^
make[2]: *** [src/CMakeFiles/zm.dir/zm_event.cpp.o] Error 1
make[2]: Leaving directory `/root/zm/ZoneMinder'
make[1]: *** [src/CMakeFiles/zm.dir/all] Error 2
make[1]: Leaving directory `/root/zm/ZoneMinder'
make: *** [all] Error 2

philipt
Posts: 37
Joined: Sat Jun 11, 2005 8:29 am
Location: North East England

Re: Anyone got ZoneMinder working on CentOS 7?

Post by philipt » Mon Nov 10, 2014 1:58 pm

Making progress! cmake completes successfully, everything else set up OK but i've now got these errors which I think are ffmpeg related - any ideas welcome please! :

[ 22%] Building CXX object src/CMakeFiles/zm.dir/zm_event.cpp.o
cd /opt/ZoneMinder-1.27.0/src && /bin/c++ -Wall -D__STDC_CONSTANT_MACROS -O2 -I/opt/ZoneMinder-1.27.0/src -I/opt/ZoneMinder-1.27.0 -o CMakeFiles/zm.dir/zm_event.cpp.o -c /opt/ZoneMinder-1.27.0/src/zm_event.cpp
In file included from /opt/ZoneMinder-1.27.0/src/zm_event.cpp:34:0:
/opt/ZoneMinder-1.27.0/src/zm_mpeg.h:43:7: error: use of enum ‘PixelFormat’ without previous declaration
enum PixelFormat pf;
^
/opt/ZoneMinder-1.27.0/src/zm_mpeg.h:44:2: error: ‘AVOutputFormat’ does not name a type
AVOutputFormat *of;
^
/opt/ZoneMinder-1.27.0/src/zm_mpeg.h:45:2: error: ‘AVFormatContext’ does not name a type
AVFormatContext *ofc;
^
/opt/ZoneMinder-1.27.0/src/zm_mpeg.h:46:2: error: ‘AVStream’ does not name a type
AVStream *ost;
^
/opt/ZoneMinder-1.27.0/src/zm_mpeg.h:47:2: error: ‘AVFrame’ does not name a type
AVFrame *opicture;
^
/opt/ZoneMinder-1.27.0/src/zm_mpeg.h:48:2: error: ‘AVFrame’ does not name a type
AVFrame *tmp_opicture;
^
make[2]: *** [src/CMakeFiles/zm.dir/zm_event.cpp.o] Error 1
make[2]: Leaving directory `/opt/ZoneMinder-1.27.0'
make[1]: *** [src/CMakeFiles/zm.dir/all] Error 2
make[1]: Leaving directory `/opt/ZoneMinder-1.27.0'
make: *** [all] Error 2
Philip

philipt
Posts: 37
Joined: Sat Jun 11, 2005 8:29 am
Location: North East England

Re: Anyone got ZoneMinder working on CentOS 7?

Post by philipt » Mon Nov 10, 2014 2:00 pm

Oh - snap! :(
Philip

User avatar
knight-of-ni
Posts: 2355
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Anyone got ZoneMinder working on CentOS 7?

Post by knight-of-ni » Mon Nov 10, 2014 2:33 pm

You are correct. That usually means ZoneMinder can't find your ffmpeg header files.
To fix, you first need to state how you installed ffmpeg. If from source, then did you issue the make command to install the developement libraries? If from pacakge, did you install the ffmpeg-devel package?
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

philipt
Posts: 37
Joined: Sat Jun 11, 2005 8:29 am
Location: North East England

Re: Anyone got ZoneMinder working on CentOS 7?

Post by philipt » Mon Nov 10, 2014 2:47 pm

Thanks for the quick responses to these questions - much appreciated.

I think we both got ffmpeg from the nux-dextop repo and I certainly installed ffmpeg-devel too.

If I run ffmpeg I get the text below displayed. Maybe this isn't a compatible version?

ffmpeg version 2.3.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Aug 25 2014 17:23:07 with gcc 4.8.2 (GCC) 20140120 (Red Hat 4.8.2-16)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-libass --enable-libcdio --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil 52. 92.100 / 52. 92.100
libavcodec 55. 69.100 / 55. 69.100
libavformat 55. 48.100 / 55. 48.100
libavdevice 55. 13.102 / 55. 13.102
libavfilter 4. 11.100 / 4. 11.100
libavresample 1. 3. 0 / 1. 3. 0
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Philip

User avatar
knight-of-ni
Posts: 2355
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Anyone got ZoneMinder working on CentOS 7?

Post by knight-of-ni » Mon Nov 10, 2014 3:19 pm

I think it has more to do with where the header files are located on your drive.
Find where the libavcodec, libavdevice, libavfilter, etc folders that contain the header files are on your local drive.

Are they here?
[abauer@localhost ~]$ ls -l /usr/include/ffmpeg
total 36
drwxr-xr-x. 2 root root 4096 Jul 24 10:46 libavcodec
drwxr-xr-x. 2 root root 4096 Jul 24 10:46 libavdevice
drwxr-xr-x. 2 root root 4096 Jul 24 10:46 libavfilter
drwxr-xr-x. 2 root root 4096 Jul 24 10:46 libavformat
drwxr-xr-x. 2 root root 4096 Jul 24 10:46 libavresample
drwxr-xr-x. 2 root root 4096 Jul 24 10:46 libavutil
drwxr-xr-x. 2 root root 4096 Jul 24 10:46 libpostproc
drwxr-xr-x. 2 root root 4096 Jul 24 10:46 libswresample
drwxr-xr-x. 2 root root 4096 Jul 24 10:46 libswscale
If so, then try creating these symbolic links such that they point to their counterparts under /usr/inlucde/ffmpeg:
/usr/include/libavcodec
/usr/include/libavdevice
/usr/include/libavfilter
/usr/include/libavformat
/usr/include/libavresample
/usr/include/libavutil
/usr/include/libpostproc
/usr/include/libswresample
/usr/include/libswscale

For some reason, zoneminder can't always find the header files when the libav folders are under /usr/include/ffmpeg, rather than just /usr/include. I've never investigated why.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

chrisn0123
Posts: 28
Joined: Sun Feb 16, 2014 3:10 pm

Re: Anyone got ZoneMinder working on CentOS 7?

Post by chrisn0123 » Mon Nov 10, 2014 3:34 pm

Mine are showing in the correct location:

[root@bond-test ZoneMinder]# ls -l /usr/include/ffmpeg
total 8
drwxr-xr-x 2 root root 4096 Nov 10 13:59 libavcodec
drwxr-xr-x 2 root root 39 Nov 10 13:59 libavdevice
drwxr-xr-x 2 root root 135 Nov 10 13:59 libavfilter
drwxr-xr-x 2 root root 52 Nov 10 13:59 libavformat
drwxr-xr-x 2 root root 41 Nov 10 13:59 libavresample
drwxr-xr-x 2 root root 4096 Nov 10 13:59 libavutil
drwxr-xr-x 2 root root 42 Nov 10 13:59 libpostproc
drwxr-xr-x 2 root root 41 Nov 10 13:59 libswresample
drwxr-xr-x 2 root root 38 Nov 10 13:59 libswscale


Is there a command on cmake to tell it to point to here?

Cheers!

User avatar
knight-of-ni
Posts: 2355
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Anyone got ZoneMinder working on CentOS 7?

Post by knight-of-ni » Mon Nov 10, 2014 3:46 pm

No, that's not what I meant.
Do this for all nine folders under /usr/inlclude/ffmpeg/:

Code: Select all

sudo ln -s /usr/inlclude/ffmpeg/libavcodec /usr/include/
I have not found a cmake parameter to get it to build without linking the folders.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

chrisn0123
Posts: 28
Joined: Sun Feb 16, 2014 3:10 pm

Re: Anyone got ZoneMinder working on CentOS 7?

Post by chrisn0123 » Mon Nov 10, 2014 3:56 pm

Thanks.. nah same error this end!!

Did these:

[root@bond-test ffmpeg]# ln -s /usr/include/ffmpeg/libavcodec/ /usr/include/libavcodec
[root@bond-test ffmpeg]# ln -s /usr/include/ffmpeg/libavdevice/ /usr/include/libavdevice
[root@bond-test ffmpeg]# ln -s /usr/include/ffmpeg/libavfilter /usr/include/libavfilter
[root@bond-test ffmpeg]# ln -s /usr/include/ffmpeg/libavformat /usr/include/libavformat
[root@bond-test ffmpeg]# ln -s /usr/include/ffmpeg/libavresample /usr/include/libavresample
[root@bond-test ffmpeg]# ln -s /usr/include/ffmpeg/libavutil /usr/include/libavutil
[root@bond-test ffmpeg]# ln -s /usr/include/ffmpeg/libpostproc /usr/include/libpostproc
[root@bond-test ffmpeg]# ln -s /usr/include/ffmpeg/libswresample /usr/include/libswresample
[root@bond-test ffmpeg]# ln -s /usr/include/ffmpeg/libswscale /usr/include/libswscale

philipt
Posts: 37
Joined: Sat Jun 11, 2005 8:29 am
Location: North East England

Re: Anyone got ZoneMinder working on CentOS 7?

Post by philipt » Mon Nov 10, 2014 3:59 pm

I had already created the symbolic links, having read your post from a few months ago. Sadly it made no difference.

Should I build ffmpeg from source instead of using the version in the nux-dextop.repo version?

Thanks for helping us with this!
Philip

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests