Page 1 of 1

Unable to compile ZoneMinder 1.25 in CentOS 5.4 :(

Posted: Fri Mar 30, 2012 11:41 pm
by babblo
Configure Options:

Code: Select all

./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin ZM_DB_HOST=localhost ZM_DB_NAME=*** ZM_DB_USER=*** ZM_DB_PASS=*** --enable-debug=no --with-webgroup=apache --with-webuser=apache --enable-mmap CPPFLAGS="-D__STDC_CONSTANT_MACROS ${CPPFLAGS}"


When I try to compile:

Code: Select all

g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/include -I/usr/include -Wall -Wno-sign-compare -finline-functions -I/usr/include -D__STDC_CONSTANT_MACROS   -g -O2 -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:122:44: error: missing binary operator before token "("
zm_mem_utils.h: In function 'void* zm_mallocaligned(unsigned int, size_t)':
zm_mem_utils.h:29: warning: dereferencing type-punned pointer will break strict-aliasing rules
zm_ffmpeg_camera.h: At global scope:
zm_ffmpeg_camera.h:41: error: ISO C++ forbids declaration of 'AVFormatContext' with no type
zm_ffmpeg_camera.h:41: error: expected ';' before '*' token
zm_ffmpeg_camera.h:43: error: ISO C++ forbids declaration of 'AVCodecContext' with no type
zm_ffmpeg_camera.h:43: error: expected ';' before '*' token
zm_ffmpeg_camera.h:44: error: ISO C++ forbids declaration of 'AVCodec' 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.h:46: error: ISO C++ forbids declaration of 'AVFrame' with no type
zm_ffmpeg_camera.h:46: error: expected ';' before '*' token
zm_ffmpeg_camera.h:47: error: 'PixelFormat' does not name a type
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:39: error: 'mRawFrame' was not declared in this scope
zm_ffmpeg_camera.cpp:40: error: 'mFrame' was not declared in this scope
zm_ffmpeg_camera.cpp:49: error: 'imagePixFormat' was not declared in this scope
zm_ffmpeg_camera.cpp:49: error: 'PIX_FMT_RGBA' was not declared in this scope
zm_ffmpeg_camera.cpp:52: error: 'imagePixFormat' was not declared in this scope
zm_ffmpeg_camera.cpp:52: error: 'PIX_FMT_RGB24' was not declared in this scope
zm_ffmpeg_camera.cpp:55: error: 'imagePixFormat' was not declared in this scope
zm_ffmpeg_camera.cpp:55: error: 'PIX_FMT_GRAY8' was not declared in this scope
zm_ffmpeg_camera.cpp: In destructor 'virtual FfmpegCamera::~FfmpegCamera()':
zm_ffmpeg_camera.cpp:64: error: 'mFrame' was not declared in this scope
zm_ffmpeg_camera.cpp:64: error: 'av_freep' was not declared in this scope
zm_ffmpeg_camera.cpp:65: error: 'mRawFrame' was not declared in this scope
zm_ffmpeg_camera.cpp:70: error: 'sws_freeContext' was not declared in this scope
zm_ffmpeg_camera.cpp:75: error: 'mCodecContext' was not declared in this scope
zm_ffmpeg_camera.cpp:77: error: 'avcodec_close' was not declared in this scope
zm_ffmpeg_camera.cpp:80: error: 'mFormatContext' was not declared in this scope
zm_ffmpeg_camera.cpp:82: 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:95: error: 'AV_LOG_DEBUG' was not declared in this scope
zm_ffmpeg_camera.cpp:95: error: 'av_log_set_level' was not declared in this scope
zm_ffmpeg_camera.cpp:97: error: 'AV_LOG_QUIET' was not declared in this scope
zm_ffmpeg_camera.cpp:97: error: 'av_log_set_level' was not declared in this scope
zm_ffmpeg_camera.cpp:99: 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:111: error: 'mFormatContext' was not declared in this scope
zm_ffmpeg_camera.cpp:111: error: 'av_open_input_file' was not declared in this scope
zm_ffmpeg_camera.cpp:115: error: 'mFormatContext' was not declared in this scope
zm_ffmpeg_camera.cpp:115: error: 'av_find_stream_info' was not declared in this scope
zm_ffmpeg_camera.cpp:120: error: 'mFormatContext' was not declared in this scope
zm_ffmpeg_camera.cpp:125: error: 'CODEC_TYPE_VIDEO' was not declared in this scope
zm_ffmpeg_camera.cpp:135: error: 'mCodecContext' was not declared in this scope
zm_ffmpeg_camera.cpp:135: error: 'mFormatContext' was not declared in this scope
zm_ffmpeg_camera.cpp:138: error: 'mCodec' was not declared in this scope
zm_ffmpeg_camera.cpp:138: error: 'avcodec_find_decoder' was not declared in this scope
zm_ffmpeg_camera.cpp:142: error: 'mCodec' was not declared in this scope
zm_ffmpeg_camera.cpp:142: error: 'avcodec_open' was not declared in this scope
zm_ffmpeg_camera.cpp:146: error: 'mRawFrame' was not declared in this scope
zm_ffmpeg_camera.cpp:146: error: 'avcodec_alloc_frame' was not declared in this scope
zm_ffmpeg_camera.cpp:149: error: 'mFrame' was not declared in this scope
zm_ffmpeg_camera.cpp:154: error: 'imagePixFormat' was not declared in this scope
zm_ffmpeg_camera.cpp:154: error: 'avpicture_get_size' was not declared in this scope
zm_ffmpeg_camera.cpp:160: error: 'sws_isSupportedInput' was not declared in this scope
zm_ffmpeg_camera.cpp:164: error: 'sws_isSupportedOutput' was not declared in this scope
zm_ffmpeg_camera.cpp: In member function 'virtual int FfmpegCamera::Capture(Image&)':
zm_ffmpeg_camera.cpp:183: error: 'AVPacket' was not declared in this scope
zm_ffmpeg_camera.cpp:183: error: expected `;' before 'packet'
zm_ffmpeg_camera.cpp:196: error: 'mFormatContext' was not declared in this scope
zm_ffmpeg_camera.cpp:196: error: 'packet' was not declared in this scope
zm_ffmpeg_camera.cpp:196: error: 'av_read_frame' was not declared in this scope
zm_ffmpeg_camera.cpp:205: error: 'mCodecContext' was not declared in this scope
zm_ffmpeg_camera.cpp:205: error: 'mRawFrame' was not declared in this scope
zm_ffmpeg_camera.cpp:205: error: 'avcodec_decode_video2' was not declared in this scope
zm_ffmpeg_camera.cpp:214: error: 'AVPicture' was not declared in this scope
zm_ffmpeg_camera.cpp:214: error: expected primary-expression before ')' token
zm_ffmpeg_camera.cpp:214: error: 'imagePixFormat' was not declared in this scope
zm_ffmpeg_camera.cpp:214: error: 'avpicture_fill' was not declared in this scope
zm_ffmpeg_camera.cpp:219: error: 'mCodecContext' was not declared in this scope
zm_ffmpeg_camera.cpp:219: error: 'SWS_BICUBIC' was not declared in this scope
zm_ffmpeg_camera.cpp:219: error: 'SWS_CPU_CAPS_SSE2' was not declared in this scope
zm_ffmpeg_camera.cpp:219: error: 'sws_getContext' was not declared in this scope
zm_ffmpeg_camera.cpp:221: error: 'mCodecContext' was not declared in this scope
zm_ffmpeg_camera.cpp:221: error: 'SWS_BICUBIC' was not declared in this scope
zm_ffmpeg_camera.cpp:221: error: 'sws_getContext' was not declared in this scope
zm_ffmpeg_camera.cpp:227: error: 'mRawFrame' was not declared in this scope
zm_ffmpeg_camera.cpp:227: error: 'mCodecContext' was not declared in this scope
zm_ffmpeg_camera.cpp:227: error: 'mFrame' was not declared in this scope
zm_ffmpeg_camera.cpp:227: error: 'sws_scale' was not declared in this scope
zm_ffmpeg_camera.cpp:236: error: 'av_free_packet' was not declared in this scope
ffmpeg v. 0.10 installed by source

Any idea?

Thanks in advance.

Re: Unable to compile ZoneMinder 1.25 in CentOS 5.4 :(

Posted: Sat Mar 31, 2012 10:25 pm
by knight-of-ni
Not sure why you are running an obsolete version of CentOS, but I don't believe that is causing the issue.
I would not expect Zoneminder 1.25 to work with such an old version of ffmpeg.

Try this version of ffmpeg as it is known to work:

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
Easiest thing to do would be to add the rpmforge repositories and just do a yum install, but you can also get the source via git if you prefer to compile it yourself.

Re: Unable to compile ZoneMinder 1.25 in CentOS 5.4 :(

Posted: Mon Apr 02, 2012 1:22 pm
by babblo
Old version of ffmpeg?? Donwloaded on Mar 30 2012 from git!

Code: Select all

# ffmpeg -V
ffmpeg version 0.10.2.git Copyright (c) 2000-2012 the FFmpeg developers

Re: Unable to compile ZoneMinder 1.25 in CentOS 5.4 :(

Posted: Mon Apr 02, 2012 1:34 pm
by knight-of-ni
babblo wrote:Old version of ffmpeg?? Donwloaded on Mar 30 2012 from git!

Code: Select all

# ffmpeg -V
ffmpeg version 0.10.2.git Copyright (c) 2000-2012 the FFmpeg developers
Oh, got it. I missed the trailing zero on the version you reported.

The problem is essentially the same however... you are using a version of ffmpeg that doesn't play nicely with Zoneminder 1.25. This is a common problem largely due to the dynamic nature of ffmpeg. The developers like to make significant changes to their code at a moment's notice... makes it difficult to compile third party software that depends on it.

Try using git to retrieve the version of ffmpeg I mentioned earlier as it is known to work. Or you could just yum install the copy sitting the rpmforge repository.