compile error on centos 5.4 using zm 1.24.2

Forum for questions and support relating to the 1.24.x releases only.
butlerm1977
Posts: 36
Joined: Wed Sep 09, 2009 4:47 pm

compile error on centos 5.4 using zm 1.24.2

Post by butlerm1977 »

Following the directions of this URL for 32bit install (on a P3 processor)...

http://www.zoneminder.com/wiki/index.php/CentOS

All goes smooth until I run...

Code: Select all

./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin --with-webuser=apache --with-webgroup=apache ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=admin ZM_DB_PASS=123456
I get the following....

Code: Select all

checking libavutil/avutil.h usability... no
checking libavutil/avutil.h presence... yes
configure: WARNING: libavutil/avutil.h: present but cannot be compiled
configure: WARNING: libavutil/avutil.h:     check for missing prerequisite headers?
configure: WARNING: libavutil/avutil.h: see the Autoconf documentation
configure: WARNING: libavutil/avutil.h:     section "Present But Cannot Be Compiled"
configure: WARNING: libavutil/avutil.h: proceeding with the preprocessor's result
configure: WARNING: libavutil/avutil.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------- ##
configure: WARNING:     ## Report this to support@zoneminder.com ##
configure: WARNING:     ## ------------------------------------- ##
checking for libavutil/avutil.h... yes
checking ffmpeg/avutil.h usability... no
checking ffmpeg/avutil.h presence... no
checking for ffmpeg/avutil.h... no
checking libavcodec/avcodec.h usability... no
checking libavcodec/avcodec.h presence... yes
configure: WARNING: libavcodec/avcodec.h: present but cannot be compiled
configure: WARNING: libavcodec/avcodec.h:     check for missing prerequisite headers?
configure: WARNING: libavcodec/avcodec.h: see the Autoconf documentation
configure: WARNING: libavcodec/avcodec.h:     section "Present But Cannot Be Compiled"
configure: WARNING: libavcodec/avcodec.h: proceeding with the preprocessor's result
configure: WARNING: libavcodec/avcodec.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------- ##
configure: WARNING:     ## Report this to support@zoneminder.com ##
configure: WARNING:     ## ------------------------------------- ##
checking for libavcodec/avcodec.h... yes
checking ffmpeg/avcodec.h usability... no
checking ffmpeg/avcodec.h presence... no
checking for ffmpeg/avcodec.h... no
checking libavformat/avformat.h usability... no
checking libavformat/avformat.h presence... yes
configure: WARNING: libavformat/avformat.h: present but cannot be compiled
configure: WARNING: libavformat/avformat.h:     check for missing prerequisite headers?
configure: WARNING: libavformat/avformat.h: see the Autoconf documentation
configure: WARNING: libavformat/avformat.h:     section "Present But Cannot Be Compiled"
configure: WARNING: libavformat/avformat.h: proceeding with the preprocessor's result
configure: WARNING: libavformat/avformat.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------- ##
configure: WARNING:     ## Report this to support@zoneminder.com ##
configure: WARNING:     ## ------------------------------------- ##
checking for libavformat/avformat.h... yes
checking ffmpeg/avformat.h usability... no
checking ffmpeg/avformat.h presence... no
checking for ffmpeg/avformat.h... no
checking libswscale/swscale.h usability... no
checking libswscale/swscale.h presence... yes
configure: WARNING: libswscale/swscale.h: present but cannot be compiled
configure: WARNING: libswscale/swscale.h:     check for missing prerequisite headers?
configure: WARNING: libswscale/swscale.h: see the Autoconf documentation
configure: WARNING: libswscale/swscale.h:     section "Present But Cannot Be Compiled"
configure: WARNING: libswscale/swscale.h: proceeding with the preprocessor's result
configure: WARNING: libswscale/swscale.h: in the future, the compiler will take precedence
configure: WARNING:     ## ------------------------------------- ##
configure: WARNING:     ## Report this to support@zoneminder.com ##
configure: WARNING:     ## ------------------------------------- ##
checking for libswscale/swscale.h... yes
checking ffmpeg/swscale.h usability... no
checking ffmpeg/swscale.h presence... no
checking for ffmpeg/swscale.h... no
Then if I try to run make or make install i get the following....

Code: Select all

make  all-recursive
make[1]: Entering directory `/root/ZoneMinder-1.24.2'
Making all in src
make[2]: Entering directory `/root/ZoneMinder-1.24.2/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I..  -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include  -frepo -g -O2 -MT zmc.o -MD -MP -MF ".deps/zmc.Tpo" -c -o zmc.o zmc.cpp; \
        then mv -f ".deps/zmc.Tpo" ".deps/zmc.Po"; else rm -f ".deps/zmc.Tpo"; exit 1; fi
/usr/local/include/libavutil/common.h: In function âint32_t av_clipl_int32(int64_t)â:
/usr/local/include/libavutil/common.h:154: error: âUINT64_Câ was not declared in this scope
make[2]: *** [zmc.o] Error 1
make[2]: Leaving directory `/root/ZoneMinder-1.24.2/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/ZoneMinder-1.24.2'
make: *** [all] Error 2
Any ideas?[/code]
SkyShark2
Posts: 3
Joined: Wed Apr 28, 2010 3:03 pm

Post by SkyShark2 »

I am having the same issue on an Ubuntu Server (9.10) install. It seems to be related to the current version of ffmpeg. I did this exact install last week and it worked fine. The only difference is when checking out ffmpeg from subversion the current output is:

Code: Select all

Checked out external at revision 31105. Checked out revision 22986.
The build that worked (last week) was:

Code: Select all

Checked out external at revision 30827. Checked out revision 22195.
I am guessing that something has changed in the latest ffmpeg (some libraries were moved around or not included) which is causing the issue.

Does anyone have any ideas for a work-a-round on this?
SkyShark2
Posts: 3
Joined: Wed Apr 28, 2010 3:03 pm

Post by SkyShark2 »

There is a difference in the error(s) I get when running make however (it can't find the ffmpeg includes):

Code: Select all

g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include  -frepo -g -O2 -MT zmc.o -MD -MP -MF .deps/zmc.Tpo -c -o zmc.o zmc.cpp
In file included from zm_mpeg.h:23,
                 from zm_stream.h:27,
                 from zm_event.h:39,
                 from zm_zone.h:27,
                 from zm_monitor.h:26,
                 from zmc.cpp:28:
zm_ffmpeg.h:33:2: error: #error "No location for avutils.h found"
zm_ffmpeg.h:40:2: error: #error "No location for avcodec.h found"
zm_ffmpeg.h:47:2: error: #error "No location for avformat.h found"
zm_ffmpeg.h:55:2: error: #error "No location for swscale.h found"
In file included from zm_stream.h:27,
                 from zm_event.h:39,
                 from zm_zone.h:27,
                 from zm_monitor.h:26,
                 from zmc.cpp:28:
sip83
Posts: 1
Joined: Wed Apr 28, 2010 5:23 pm

Same problem here

Post by sip83 »

I am having the same problem... I did a fresh install of CentOS 5.4, an upgrade (yum -y upgrade) and then followed all of the commands on the wiki for CentOS.

Does anyone have a solution?

How can we use the older version of ffmpeg?
paabloop
Posts: 2
Joined: Wed Apr 28, 2010 7:14 pm

Post by paabloop »

me too, i have the same problem, please post a solution.

thanks

Best Regards
jhetrick62
Posts: 24
Joined: Thu Jun 04, 2009 2:43 am

Post by jhetrick62 »

I had the same errors. I uninstalled the compiled version that I built from the git tree, then installed the stock ffmpeg from yum.

I then tossed out the initial attempt at building and compiling ffmpeg, un-tared it again and rebuilt it, no problems.

NOW, I haven't loaded cameras and tested yet, so I will re-post after I do. I did have to modify ffmpeg path in the config settings and the compiled version would have been at /usr/local/bin/ffmpeg and the yum installed at /usr/bin/ffmpeg

Jeff
jhetrick62
Posts: 24
Joined: Thu Jun 04, 2009 2:43 am

Post by jhetrick62 »

Ok, that did not work. It built fine as I said earlier, but the video it produced was un-viewable. I will now re-think this!

If anyone else finds the answer, please post. I believe it needs to be complied against an older version of ffmpeg.
butlerm1977
Posts: 36
Joined: Wed Sep 09, 2009 4:47 pm

Post by butlerm1977 »

Possible solution if you've already got a working system in production.

First, do a make uninstall from the /ffmpeg and /libswscale directories (if you've already installed from git. I confirmed the uninstall by trying to run ffmpeg -version.

Next delete the /ffmpeg directory.

On the "working" machine tar the complete /ffmpeg directory, copy and extract it to the new machine. My older working machine was using git-svn-r21602.

./configure, make, make install, make install-libs

I haven't tested video recording / playback yet. But at least I know zm itself will install.
SkyShark2
Posts: 3
Joined: Wed Apr 28, 2010 3:03 pm

Post by SkyShark2 »

As butlerm1977 suggested, pulling from a known working version of ffmpeg is a work-a-round. I copied the /usr/src/ffmpeg from a working ZM machine (the one I mentioned above, dated 2010-04-19, subversion info: Checked out external at revision 30827. Checked out revision 22195.). I rebuilt it (had some minor tweaks from the previous build) and ZM was then able to build and install without issue.

I previously tried to pull that version down via subversion but it checked out the wrong external revision. As such, I was unable to successfully build it. Then again, a subversion guru I am not. Does anyone know how to check out the appropriate external revision and revision with subversion?
paabloop
Posts: 2
Joined: Wed Apr 28, 2010 7:14 pm

Post by paabloop »

i found it, i download this version http://www.ffmpeg.org/releases/ffmpeg-0.5.1.tar.gz and work :D

Regards,

From Chile!!!
jhetrick62
Posts: 24
Joined: Thu Jun 04, 2009 2:43 am

Post by jhetrick62 »

Thank you very much all! I will try the tar.gz build as it will be easier than one of my production copies as I installed them from ubuntu repo directly so no build involved.

I wanted to build this one on Centos if I could for the longer support time and the much less frequent updates necessary.

Jeff
jhetrick62
Posts: 24
Joined: Thu Jun 04, 2009 2:43 am

Post by jhetrick62 »

This did not work for me. I attempted to pull ffmpeg in from other working servers to no avail. I'm not sure if ffmpeg or zoneminder is the issue, but it will not build.

Jeff
fruitysoup
Posts: 1
Joined: Wed Jun 02, 2010 12:09 pm

compile error on centos 5.4 using zm 1.24.2

Post by fruitysoup »

Hi All

I was experiencing very similar issues getting zm to compile against both the current git ffmpeg and 0.5.1 (Centos 5.5 on i386), but found that there are prebuilt ffmpeg and ffmpeg-devel libraries available from rpmforge :

rpm -Uvh http://apt.sw.be/redhat/el5/en/i386/rpm ... f.i386.rpm

yum -y ffmpeg ffmpeg-devel

I've managed to get ZM to compile without issues against the current version from rf (0.5-3) , although I haven't got as far as checking it works with our cameras yet.
timcraig
Posts: 195
Joined: Mon Dec 10, 2007 5:53 pm
Location: San Jose, CA

Post by timcraig »

I ran into the same problem today. There are new updates in the ZM svn so I updated ffmpeg and tried to reinstall Zoneminder. There are changes in the latest ffmpeg that break's Zoneminder's build process. We need to install an older version of ffmpeg.

I switched to an older svn revision of ffmpeg. I couldn't get previous revisions of ffmpeg to complile, there was always a compile error with libswscale. I then noticed that libswscale is an external definition in the ffmpeg repository, meaning that its not part of the same tree. Any checkout of ffmpeg from the SVN at any revision will always checkout the latest version of libswscale. This is troublesome as olders version ffmpeg will surly not work against the latest version of libswscale. So in order to compile ffmpeg, I had to search for a libswscale revision that was close to the date of my ffmpeg revision, revert libswcale to the older version and then build ffmpeg.

Here is what I did:
The last time I did a working source install of Zoneminder, my ffmpeg svn revision was 21010, so I checked that version out.

Code: Select all

svn co svn://svn.ffmpeg.org/ffmpeg -r 21010 ffmpeg
cd ffmpeg
svn info
I look at the "Last Changed Date:" field and saw that the date was 2010-01-03

Code: Select all

cd  libswscale
svn log -r {2010-01-03}:{2010-01-01}
I saw that the latest revision was r30172 .

Code: Select all

svn switch svn://svn.ffmpeg.org/mplayer/trunk/libswscale -r 30172
Then I was able to compile ffmpeg and then finally Zoneminder.
skitz
Posts: 2
Joined: Fri Jun 18, 2010 8:08 am
Location: Santa Clara, CA

Post by skitz »

I had the same issue a few weeks back with Centos 5.5 install. Final magic to get everything compiled was:

latest ffmpeg:

git clone http://git.ffmpeg.org/ffmpeg/
cd ffmpeg
git clone http://git.ffmpeg.org/libswscale/
./configure --enable-gpl --enable-swscale --prefix=/usr
(note configure is slightly different than Centos/zm wiki page)

zm config command:

./configure --with-webdir=/var/www/html/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 --with-mysql=/usr/lib64/mysql --with-extralibs="-L/usr/lib64 -L/usr/lib64/mysql" CPPFLAGS="-D__STDC_CONSTANT_MACROS"

(note added CPPFLAGS)

Above is for 64 bit, so adjust accordingly for 32.

One more thing different than the wiki page is I installed yum-priorities and rpmforge to update the base install.

Don't know if this will give some clues -- hope it helps.

One caveat... I'm a newb (first post) and have no idea what I'm doing! ;)


.
Locked