I am getting the following error with compiling Zoneminder on CentOS 6 with ffmpeg 0.10 Jan 2012:
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/local/share/ffmpeg/include -Wall -Wno-sign-compare -fno-inline -I/usr/local/share/ffmpeg/include -D__STDC_CONSTANT_MACROS -MT zm_ffmpeg_camera.o -MD -MP -MF .deps/zm_ffmpeg_camera.Tpo -c -o zm_ffmpeg_camera.o zm_ffmpeg_camera.cpp
zm_ffmpeg_camera.cpp:105:44: error: missing binary operator before token "("
In file included from zm_ffmpeg_camera.cpp:24:
zm_ffmpeg_camera.h:39: error: ISO C++ forbids declaration of âAVFormatContextâ with no type
zm_ffmpeg_camera.h:39: error: expected â;â before â*â token
zm_ffmpeg_camera.h:41: error: ISO C++ forbids declaration of âAVCodecContextâ with no type
zm_ffmpeg_camera.h:41: error: expected â;â before â*â token
zm_ffmpeg_camera.h:42: error: ISO C++ forbids declaration of âAVCodecâ with no type
zm_ffmpeg_camera.h:42: error: expected â;â before â*â token
zm_ffmpeg_camera.h:44: error: ISO C++ forbids declaration of âAVFrameâ with no type
zm_ffmpeg_camera.h:44: error: expected â;â before â*â token
zm_ffmpeg_camera.h:45: error: ISO C++ forbids declaration of âAVFrameâ with no type
zm_ffmpeg_camera.h:45: error: expected â;â before â*â token
zm_ffmpeg_camera.cpp: In constructor âFfmpegCamera::FfmpegCamera(int, const std::string&, int, int, int, int, int, int, int, bool)â:
zm_ffmpeg_camera.cpp:35: error: âmFormatContextâ was not declared in this scope
zm_ffmpeg_camera.cpp:37: error: âmCodecContextâ was not declared in this scope
zm_ffmpeg_camera.cpp:38: error: âmCodecâ was not declared in this scope
zm_ffmpeg_camera.cpp:40: error: âmRawFrameâ was not declared in this scope
zm_ffmpeg_camera.cpp:41: error: âmFrameâ was not declared in this scope
zm_ffmpeg_camera.cpp: In destructor âvirtual FfmpegCamera::~FfmpegCamera()â:
zm_ffmpeg_camera.cpp:46: error: âmFrameâ was not declared in this scope
zm_ffmpeg_camera.cpp:46: error: âav_freepâ was not declared in this scope
zm_ffmpeg_camera.cpp:47: error: âmRawFrameâ was not declared in this scope
zm_ffmpeg_camera.cpp:51: error: âsws_freeContextâ was not declared in this scope
zm_ffmpeg_camera.cpp:54: error: âmCodecContextâ was not declared in this scope
zm_ffmpeg_camera.cpp:56: error: âavcodec_closeâ was not declared in this scope
zm_ffmpeg_camera.cpp:59: error: âmFormatContextâ was not declared in this scope
zm_ffmpeg_camera.cpp:61: error: âav_close_input_fileâ was not declared in this scope
zm_ffmpeg_camera.cpp: In member function âvoid FfmpegCamera::Initialise()â:
zm_ffmpeg_camera.cpp:78: error: âAV_LOG_DEBUGâ was not declared in this scope
zm_ffmpeg_camera.cpp:78: error: âav_log_set_levelâ was not declared in this scope
zm_ffmpeg_camera.cpp:80: error: âAV_LOG_QUIETâ was not declared in this scope
zm_ffmpeg_camera.cpp:80: error: âav_log_set_levelâ was not declared in this scope
zm_ffmpeg_camera.cpp:82: error: âav_register_allâ was not declared in this scope
zm_ffmpeg_camera.cpp: In member function âvirtual int FfmpegCamera::PrimeCapture()â:
zm_ffmpeg_camera.cpp:94: error: âmFormatContextâ was not declared in this scope
zm_ffmpeg_camera.cpp:94: error: âav_open_input_fileâ was not declared in this scope
zm_ffmpeg_camera.cpp:95: error: âerrnoâ was not declared in this scope
zm_ffmpeg_camera.cpp:98: error: âmFormatContextâ was not declared in this scope
zm_ffmpeg_camera.cpp:98: error: âav_find_stream_infoâ was not declared in this scope
zm_ffmpeg_camera.cpp:99: error: âerrnoâ was not declared in this scope
zm_ffmpeg_camera.cpp:103: error: âmFormatContextâ was not declared in this scope
zm_ffmpeg_camera.cpp:108: error: âAVMEDIA_TYPE_VIDEOâ was not declared in this scope
zm_ffmpeg_camera.cpp:118: error: âmCodecContextâ was not declared in this scope
zm_ffmpeg_camera.cpp:118: error: âmFormatContextâ was not declared in this scope
zm_ffmpeg_camera.cpp:121: error: âmCodecâ was not declared in this scope
zm_ffmpeg_camera.cpp:121: error: âavcodec_find_decoderâ was not declared in this scope
zm_ffmpeg_camera.cpp:125: error: âmCodecâ was not declared in this scope
zm_ffmpeg_camera.cpp:125: error: âavcodec_openâ was not declared in this scope
zm_ffmpeg_camera.cpp:129: error: âmRawFrameâ was not declared in this scope
zm_ffmpeg_camera.cpp:129: error: âavcodec_alloc_frameâ was not declared in this scope
zm_ffmpeg_camera.cpp:132: error: âmFrameâ was not declared in this scope
zm_ffmpeg_camera.cpp:135: error: âPIX_FMT_RGB24â was not declared in this scope
zm_ffmpeg_camera.cpp:135: error: âavpicture_get_sizeâ was not declared in this scope
zm_ffmpeg_camera.cpp:138: error: âAVPictureâ was not declared in this scope
zm_ffmpeg_camera.cpp:138: error: expected primary-expression before â)â token
zm_ffmpeg_camera.cpp:138: error: âavpicture_fillâ was not declared in this scope
zm_ffmpeg_camera.cpp:141: error: âSWS_BICUBICâ was not declared in this scope
zm_ffmpeg_camera.cpp:141: error: âsws_getCachedContextâ was not declared in this scope
zm_ffmpeg_camera.cpp: In member function âvirtual int FfmpegCamera::Capture(Image&)â:
zm_ffmpeg_camera.cpp:159: error: âAVPacketâ was not declared in this scope
zm_ffmpeg_camera.cpp:159: error: expected â;â before âpacketâ
zm_ffmpeg_camera.cpp:163: error: âmFormatContextâ was not declared in this scope
zm_ffmpeg_camera.cpp:163: error: âpacketâ was not declared in this scope
zm_ffmpeg_camera.cpp:163: error: âav_read_frameâ was not declared in this scope
zm_ffmpeg_camera.cpp:172: error: âmCodecContextâ was not declared in this scope
zm_ffmpeg_camera.cpp:172: error: âmRawFrameâ was not declared in this scope
zm_ffmpeg_camera.cpp:172: error: âavcodec_decode_video2â was not declared in this scope
zm_ffmpeg_camera.cpp:182: error: âmRawFrameâ was not declared in this scope
zm_ffmpeg_camera.cpp:182: error: âmCodecContextâ was not declared in this scope
zm_ffmpeg_camera.cpp:182: error: âmFrameâ was not declared in this scope
zm_ffmpeg_camera.cpp:182: error: âsws_scaleâ was not declared in this scope
zm_ffmpeg_camera.cpp:188: error: âmCodecContextâ was not declared in this scope
zm_ffmpeg_camera.cpp:188: error: âmFrameâ was not declared in this scope
zm_ffmpeg_camera.cpp:193: error: âav_free_packetâ was not declared in this scope
make[2]: *** [zm_ffmpeg_camera.o] Error 1
make[2]: Leaving directory `/usr/local/src/ZoneMinder-1.25.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/ZoneMinder-1.25.0'
make: *** [all] Error 2
This same error was reporting in the following thread:
"Board index » Support » ZoneMinder 1.25.x » Trouble Installing ZoneMinder on CentOS5."
http://www.zoneminder.com/forums/viewto ... tos#p74510
That thread remains unresolved, other than to down grade to 1.24.4.
Rather than re-posting the all the minutia, I'll just say I have tried and re-tried every step presented in that thread and I have also referenced several other items such as:
http://www.zoneminder.com/wiki/index.ph ... OS_6_Notes
and
http://www.mindcryme.com/2012/02/02/ins ... -centos-6/
Has anyone else seen this error and developed a work around?
Thanks.
CentOS 6 - Zoneminder compile error
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: CentOS 6 - Zoneminder compile error
I'm running a recent svn build of zm 1.25 on CentOS 6. I did not have any problems compiling zoneminder.
This go around I did not compile my own ffmpeg. I am using this version of ffmpeg from the rpmforge repositories:
If you are interested, you are welcome to try the RPM I custom rolled. 64bit only.
Let me know.
This go around I did not compile my own ffmpeg. I am using this version of ffmpeg from the rpmforge repositories:
Code: Select all
[abauer@bauerhaus ~]$ rpm -qa |grep ffmpeg
ffmpeg-libpostproc-0.6.5-1.el6.rf.x86_64
ffmpeg-0.6.5-1.el6.rf.x86_64
Let me know.
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/
All of these can be found at https://zoneminder.blogspot.com/
Re: CentOS 6 - Zoneminder compile error
Absolutely. The ffmpeg compiles fine and runs in both 32 and 64 bit. Actually I get the same error for i686 and for x86_64. I also tried to downgrade to 1.24.4, same problem. I tried deleting the ffmpeg and zoneminder installs then started over, same error.
I have been working my way through the c++ code and include files trying to figure out exactly what the problem is, but so far I have not had any luck. It would be nice to be able to post what the problem is because I'm obviously not the only one having this issue, but on the other hand, I would be happy to have a working ZoneMinder too!
It occurs to me that the issue could be that I started with a fully upgraded CentOS 6 which actually calls itself CentOS 6.2. Never the less, ZM should compile.
What is your suggested way to exchange the RPM?
Thanks.
I have been working my way through the c++ code and include files trying to figure out exactly what the problem is, but so far I have not had any luck. It would be nice to be able to post what the problem is because I'm obviously not the only one having this issue, but on the other hand, I would be happy to have a working ZoneMinder too!
It occurs to me that the issue could be that I started with a fully upgraded CentOS 6 which actually calls itself CentOS 6.2. Never the less, ZM should compile.
What is your suggested way to exchange the RPM?
Thanks.
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: CentOS 6 - Zoneminder compile error
You either have a version of ffmpeg installed that Zoneminder does not like, or your ffmpeg files are either missing or not in the right spot (when you compiled ffmpeg did you do a make install and a make install-libs?). Maybe you know this already.
To use the rpm listed below you need to do a couple of things first:
http://bauerhaus.dyndns.org/filebrowser/download/2267
I like to use "yum localinstall --nogpgcheck" rather than rpm -i because yum should download any missing prereqs (e.g. ffmpeg) for you automatically as long as you've added the above repositories first.
IMPORTANT: This rpm is based on a Fedora spec file. Your Zoneminder files will be placed under the following folders:
Good idea to look at it and verify its contents are appropriate for your system.
Don't forget to restart httpd after all this is done.
To use the rpm listed below you need to do a couple of things first:
- Get your system back to clean state. Uninstall both ffmpeg and zoneminder. Verify your previous ffmpeg files are gone (ls /usr/binffmpeg ; ls /usr/local/bin/ffmpeg).
- Add the EPEL repository
- Add the RPMforge repository
http://bauerhaus.dyndns.org/filebrowser/download/2267
I like to use "yum localinstall --nogpgcheck" rather than rpm -i because yum should download any missing prereqs (e.g. ffmpeg) for you automatically as long as you've added the above repositories first.
IMPORTANT: This rpm is based on a Fedora spec file. Your Zoneminder files will be placed under the following folders:
- events- /var/lib/zoneminder
- html - /usr/share/zoneminder/www
- pretty sure there are other folders I can't think of at the moment
Good idea to look at it and verify its contents are appropriate for your system.
Don't forget to restart httpd after all this is done.
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/
All of these can be found at https://zoneminder.blogspot.com/
Re: CentOS 6 - Zoneminder compile error
Thank you. I have pulled down your RPM.
As far as making ffmpeg goes. ffmpeg makes and installs find with all the libraries. As near as I can tell "make install-libs" is a subset of "make install". I did a "make install-libs", but that doesn't change the issue. I sifted through enough of zm_ffmpeg_camera.cpp to know all the files that it needs should be there. The problem line is 105, char 44 and that is the '(' below:
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1)
I can find everything included to make this condition work, but clearly some define or include is not registering as it should be.
Anyway, thank you for your help. I'll test your RPM install. It would be nice to be able to compile ZM for the future.
As far as making ffmpeg goes. ffmpeg makes and installs find with all the libraries. As near as I can tell "make install-libs" is a subset of "make install". I did a "make install-libs", but that doesn't change the issue. I sifted through enough of zm_ffmpeg_camera.cpp to know all the files that it needs should be there. The problem line is 105, char 44 and that is the '(' below:
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1)
I can find everything included to make this condition work, but clearly some define or include is not registering as it should be.
Anyway, thank you for your help. I'll test your RPM install. It would be nice to be able to compile ZM for the future.
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: CentOS 6 - Zoneminder compile error
I was able to compile Zoneminder from the machine I created the rpm from. It is essentially a vanilla 64bit Centos 6.x (virtual) machine. I only use it for development, and I have not run into the issue you are experiencing.
I've been using Zoneminder quite some time and compile problems, caused by different versions of ffmpeg, are common. One week everything will be fine, but the next those crazy ffmpeg developers will decide to change the names of all their function calls.
Surprisingly with version 1.25, zm compiled just fine for me the first time. This is also the first time I didn't have to compile a specific version of ffmpeg just to get Zoneminder to compile.
I'm sure you are right on with respect to that line code causing your problem. However, rather than modify the Zoneminder source code to work for the version of ffmpeg you currently have, try using the source code from the exact version of ffmpeg I mentioned previously. If you are still having issues (and you still want to compile from source), we can compare how your compile options versus the spec file I used to build the rpm.
I've been using Zoneminder quite some time and compile problems, caused by different versions of ffmpeg, are common. One week everything will be fine, but the next those crazy ffmpeg developers will decide to change the names of all their function calls.
Surprisingly with version 1.25, zm compiled just fine for me the first time. This is also the first time I didn't have to compile a specific version of ffmpeg just to get Zoneminder to compile.
I'm sure you are right on with respect to that line code causing your problem. However, rather than modify the Zoneminder source code to work for the version of ffmpeg you currently have, try using the source code from the exact version of ffmpeg I mentioned previously. If you are still having issues (and you still want to compile from source), we can compare how your compile options versus the spec file I used to build the rpm.
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/
All of these can be found at https://zoneminder.blogspot.com/
Re: CentOS 6 - Zoneminder compile error - Resolved
With the help of knnniggett I was able to get a clean compile. What I had to do was to get the matching version of ffmpeg, 6.5.
After doing a git clone, I did "git checkout n0.6.5". Then I built ffmpeg and zm compiled just fine.
It would seem that the instructions for compiling a particular version of zm should come with matching/required ffmpeg, rather than providing instructions that say "git clone git://git.videolan.org/ffmpeg.git" then configure and make.
Thanks.
After doing a git clone, I did "git checkout n0.6.5". Then I built ffmpeg and zm compiled just fine.
It would seem that the instructions for compiling a particular version of zm should come with matching/required ffmpeg, rather than providing instructions that say "git clone git://git.videolan.org/ffmpeg.git" then configure and make.
Thanks.