Compile ZM 1.25.0 + Fedora 18 32-bit = ffmpeg trouble

Forum for questions and support relating to the 1.25.x releases only.
Locked
cgutierrez
Posts: 24
Joined: Fri Aug 14, 2009 6:30 am
Location: Puerto Rico (Various Locations)

Compile ZM 1.25.0 + Fedora 18 32-bit = ffmpeg trouble

Post by cgutierrez »

I am trying to compile ZoneMinder 1.25.0 on the latest Fedora 18 32-bit. It seems the format of the ffmpeg libraries has changed:

CXXFLAGS=-D__STDC_CONSTANT_MACROS ./configure \
--with-webdir=/var/www/docs/zm \
--with-cgidir=/var/www/cgi-bin \
--with-ffmpeg=/usr/include/ffmpeg \
--with-webuser=apache \
--with-webgroup=apache \
--enable-debug=no \
--enable-mmap=yes \
ZM_SSL_LIB=openssl \
ZM_DB_HOST=localhost \
ZM_DB_NAME=zm \
ZM_DB_USER=myuser \
ZM_DB_PASS=mypasswd \
CFLAGS="-D__STDC_CONSTANT_MACROS -O2" \
CXXFLAGS="-D__STDC_CONSTANT_MACROS -O2"

make


PROBLEM #1
==========


g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include/ffmpeg/include -Wall -Wno-sign-compare -fno-inline -I/usr/include/ffmpeg/include -D__STDC_CONSTANT_MACROS -O2 -MT zm_logger.o -MD -MP -MF .deps/zm_logger.Tpo -c -o zm_logger.o zm_logger.cpp
zm_logger.cpp: In constructor ‘Logger::Logger()’:
zm_logger.cpp:112:49: error: ‘isatty’ was not declared in this scope
zm_logger.cpp: In member function ‘void Logger::logFile(const string&)’:
zm_logger.cpp:444:69: error: ‘getpid’ was not declared in this scope
zm_logger.cpp: In member function ‘void Logger::logPrint(bool, const char*, int, int, const char*, ...)’:
zm_logger.cpp:519:32: error: ‘syscall’ was not declared in this scope
zm_logger.cpp:521:22: error: ‘getpid’ was not declared in this scope
zm_logger.cpp: At global scope:
zm_logger.cpp:43:13: warning: ‘void subtractTime(timeval*, timeval*)’ defined but not used [-Wunused-function]
make[2]: *** [zm_logger.o] Error 1


SOLUTION #1
===========


Must include the following header at the top of zm_logger.cpp:

#include <unistd.h>


PROBLEM #2
==========


g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include/ffmpeg/include -Wall -Wno-sign-compare -fno-inline -I/usr/include/ffmpeg/include -D__STDC_CONSTANT_MACROS -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:105:44: error: missing binary operator before token "("
In file included from zm_ffmpeg_camera.cpp:24:0:
zm_ffmpeg_camera.h:39:5: error: ‘AVFormatContext’ does not name a type
zm_ffmpeg_camera.h:41:5: error: ‘AVCodecContext’ does not name a type
zm_ffmpeg_camera.h:42:5: error: ‘AVCodec’ does not name a type
zm_ffmpeg_camera.h:44:5: error: ‘AVFrame’ does not name a type
zm_ffmpeg_camera.h:45:5: error: ‘AVFrame’ does not name a type

SOLUTION #2
===========


I have libavutil.so.54 so:

Temporarily removed the #else - #endif segment from the following block:

#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1)
if ( mFormatContext->streams->codec->codec_type == AVMEDIA_TYPE_VIDEO )
#else
if ( mFormatContext->streams->codec->codec_type == CODEC_TYPE_VIDEO )
#endif


PROBLEM #3
==========

g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include/ffmpeg/include -Wall -Wno-sign-compare -fno-inline -I/usr/include/ffmpeg/include -D__STDC_CONSTANT_MACROS -O2 -MT zm_ffmpeg_camera.o -MD -MP -MF .deps/zm_ffmpeg_camera.Tpo -c -o zm_ffmpeg_camera.o zm_ffmpeg_camera.cpp
In file included from zm_ffmpeg_camera.cpp:24:0:
zm_ffmpeg_camera.h:39:5: error: ‘AVFormatContext’ does not name a type
zm_ffmpeg_camera.h:41:5: error: ‘AVCodecContext’ does not name a type
zm_ffmpeg_camera.h:42:5: error: ‘AVCodec’ does not name a type
zm_ffmpeg_camera.h:44:5: error: ‘AVFrame’ does not name a type
zm_ffmpeg_camera.h:45:5: error: ‘AVFrame’ does not name a type

I know nothing about programming the ffmpeg libraries and any API changes that may have occurred. Any suggestions to get this to compile?
Locked