ZoneMinder: 1.20.1
FFMPEG: 0.4.9-pre1
I'm having a compilation issue that I've tried numerous things to fix with no luck at all. I've searched and can't seem to find anything that helps, so this will be long but I'll try to make it straight forward. Here's what I do.
# cd /opt/Software/ffmpeg/ffmpeg-0.4.9-pre1
# make
# make install
That goes off without a hitch. Then:
# cd /opt/Software/ZoneMinder/zm-1.20.1
# ./configure --with-ffmpeg=/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1 --with-mysql=/usr --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin --with-webuser=apache --with-webgroup=apache
This results in:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
configure: WARNING: You can call configure with the --with-lame option.
This tells configure where to find the Lame library which can be used by the ffmpeg libraries
to generate IE compatible MPEG audio streams. This option is only necessary if you have built
the ffmpeg package itself with the --enable-mp3lame option and if the normal link cannot
find the library. Using mp3lame is not necessary or of any benefit to ZoneMinder per se.
e.g. --with-lame=/use/local/lib
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... (cached) yes
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking how to run the C++ preprocessor... g++ -E
checking pcre/pcre.h usability... yes
checking pcre/pcre.h presence... yes
checking for pcre/pcre.h... yes
checking pcre.h usability... no
checking pcre.h presence... no
checking for pcre.h... no
checking whether round is declared... yes
checking whether strsignal is declared... yes
checking whether MD5 is declared... yes
checking for jpeg_start_compress in -ljpeg... yes
checking for compress in -lz... yes
checking for dlsym in -ldl... yes
checking for mysql_init in -lmysqlclient... yes
checking for MD5 in -lcrypto... yes
checking for pcre_compile in -lpcre... yes
checking for avcodec_init in -lavcodec... yes
checking for av_new_stream in -lavformat... no
configure: WARNING: libavformat.a is required for MPEG streaming
checking for lame_init in -lmp3lame... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating web/Makefile
config.status: creating scripts/Makefile
config.status: creating db/Makefile
config.status: creating zmconfig.pl
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
checking for zmconfig.txt... no
configure: WARNING: Now run 'perl zmconfig.pl' to create your ZoneMinder configuration
Notice the bold warning above? I've tried to fix this in some other steps as well. So, I went ahead and ran:
# perl zmconfig.pl
And answered all the questions appropriatly. I tried saying yes and no to the ffmpeg question, no difference seemed to occur. I then created the db:
# cd db
# mysql < zmschema.sql
# cd ..
I then granted my user permissions in mysql, and ran:
# perl zmconfig.pl -noi
And the output was normal. So I tried `make`, and got this error at the end:
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include -g -O2 -MT zm_event.o -MD -MP -MF ".deps/zm_event.Tpo" -c -o zm_event.o zm_event.cpp; \
then mv -f ".deps/zm_event.Tpo" ".deps/zm_event.Po"; else rm -f ".deps/zm_event.Tpo"; exit 1; fi
In file included from zm_event.cpp:29:
zm_mpeg.h:27:29: ffmpeg/avformat.h: No such file or directory
In file included from zm_event.cpp:29:
zm_mpeg.h:37: use of enum `PixelFormat' without previous declaration
zm_mpeg.h:37: field `pf' has incomplete type
zm_mpeg.h:38: syntax error before `*' token
zm_mpeg.h:39: syntax error before `*' token
zm_mpeg.h:40: syntax error before `*' token
zm_mpeg.h:41: syntax error before `*' token
zm_mpeg.h:42: syntax error before `*' token
zm_mpeg.h:43: syntax error before `*' token
zm_mpeg.h:58: `uint8_t' was not declared in this scope
zm_mpeg.h:58: `buffer' was not declared in this scope
zm_mpeg.h:58: parse error before `,' token
make[2]: *** [zm_event.o] Error 1
make[2]: Leaving directory `/opt/Software/ZoneMinder/zm-1.20.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/Software/ZoneMinder/zm-1.20.1'
make: *** [all] Error 2
So, since it was trying to find the /opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h file, and there is no include directory in the ffmpeg release, I tried this:
# cd /opt/Software/ffmpeg/ffmpeg-0.4.9-pre1
# mkdir include
# cd include
# ln -s ../libavformat ffmpeg
That way, it would find the missing file. I ran through the whole process of configure and zmconfig.pl and make again, after deleting and re-extracting ZM and dropping the database, and `make` outputted this error:
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include -g -O2 -MT zm_event.o -MD -MP
then mv -f ".deps/zm_event.Tpo" ".deps/zm_event.Po"; else rm -f ".deps/zm_event.Tpo"; exit 1; fi
In file included from zm_mpeg.h:27,
from zm_event.cpp:29:
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:16:21: avcodec.h: No such file or directory
In file included from /opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:18,
from zm_mpeg.h:27,
from zm_event.cpp:29:
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:72: type specifier
omitted for parameter `uint8_t'
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:72: parse error
before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:73: type specifier
omitted for parameter `uint8_t'
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:73: parse error
before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:83: parse error
before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:91: type specifier
omitted for parameter `uint8_t'
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:91: parse error
before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:92: type specifier
omitted for parameter `uint8_t'
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:92: parse error
before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:97: type specifier
omitted for parameter `uint64_t'
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:97: parse error
before `)' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:98: type specifier
omitted for parameter `uint64_t'
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:98: parse error
before `)' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:128: parse error
before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:135: parse error
before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:149: type
specifier omitted for parameter `uint8_t'
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:149: parse error
before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:154: type
specifier omitted for parameter `uint8_t'
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:154: parse error
before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:157: parse error
before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avio.h:158: parse error
before `*' token
In file included from zm_mpeg.h:27,
from zm_event.cpp:29:
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:35: syntax
error before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h: In function
`void av_init_packet(AVPacket*)':
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:48: `
AV_NOPTS_VALUE' undeclared (first use this function)
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:48: (Each
undeclared identifier is reported only once for each function it appears
in.)
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h: At global
scope:
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:104: use of
enum `PixelFormat' without previous declaration
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:104: field `
pix_fmt' has incomplete type
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:131: use of
enum `CodecID' without previous declaration
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:131: field `
audio_codec' has incomplete type
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:132: field `
video_codec' has incomplete type
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:206: '
AVCodecContext' is used as a type, but is not defined as a type.
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:215: '
AVRational' is used as a type, but is not defined as a type.
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:250: syntax
error before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:294: ISO C++
forbids declaration of `uint8_t' with no type
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:294: parse
error before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:316: field `
pix_fmt' has incomplete type
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:320: '
AVPicture' is used as a type, but is not defined as a type.
In file included from /opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:487,
from zm_mpeg.h:27,
from zm_event.cpp:29:
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/rtp.h:42: `AVCodecContext
' was not declared in this scope
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/rtp.h:42: `codec' was not
declared in this scope
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/rtp.h:42: parse error
before `)' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/rtp.h:43: `AVCodecContext
' was not declared in this scope
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/rtp.h:43: `codec' was not
declared in this scope
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/rtp.h:49: parse error
before `*' token
In file included from /opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:489,
from zm_mpeg.h:27,
from zm_event.cpp:29:
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/rtsp.h:45: 'uint32_t' is
used as a type, but is not defined as a type.
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/rtsp.h:69: 'uint32_t' is
used as a type, but is not defined as a type.
In file included from zm_mpeg.h:27,
from zm_event.cpp:29:
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:502: type
specifier omitted for parameter `uint8_t'
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:502: parse
error before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:508: syntax
error before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:509: syntax
error before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:514: type
specifier omitted for parameter `uint8_t'
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:514: parse
error before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:515: type
specifier omitted for parameter `uint8_t'
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:515: parse
error before `*' token
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:516: type
specifier omitted for parameter `uint8_t'
/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include/ffmpeg/avformat.h:516: parse
error before `*' token
In file included from zm_event.cpp:29:
zm_mpeg.h:37: field `pf' has incomplete type
zm_mpeg.h:41: syntax error before `*' token
zm_mpeg.h:42: syntax error before `*' token
zm_mpeg.h:43: syntax error before `*' token
zm_mpeg.h:58: `uint8_t' was not declared in this scope
zm_mpeg.h:58: `buffer' was not declared in this scope
zm_mpeg.h:58: parse error before `,' token
make[2]: *** [zm_event.o] Error 1
make[2]: Leaving directory `/opt/Software/ZoneMinder/zm-1.20.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/Software/ZoneMinder/zm-1.20.1'
make: *** [all] Error 2
So this time it couldn't find avcodec.h, so I tried one final attempt:
# cd /opt/Software/ffmpeg/ffmpeg-0.4.9-pre1
# rm -rf include
# mkdir include
# cd include
# mkdir ffmpeg
# cd ffmpeg
# cp -ar ../../libavformat/* .
# cp -ar ../../libavcodec/* .
This would force it to find all the missing files. I ran through everything again and `make` outputted:
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/include -g -O2 -MT zm_debug.o -MD -MP -MF ".deps/zm_debug.Tpo" -c -o zm_debug.o zm_debug.c; \
then mv -f ".deps/zm_debug.Tpo" ".deps/zm_debug.Po"; else rm -f ".deps/zm_debug.Tpo"; exit 1; fi
g++ -g -O2 -L -L/opt/Software/ffmpeg/ffmpeg-0.4.9-pre1/lib -L/usr/lib/mysql -o zmc zmc.o zm.o zm_db.o zm_config.o zm_coord.o zm_box.o zm_image.o zm_event.o zm_zone.o zm_camera.o zm_local_camera.o zm_remote_camera.o zm_monitor.o zm_user.o zm_mpeg.o zm_jpeg.o zm_regexp.o zm_buffer.o zm_debug.o -L/usr/lib/mysql -lmp3lame -lavcodec -lpcre -lcrypto -lmysqlclient -ldl -lz -ljpeg
zm_mpeg.o(.text+0x7): In function `VideoStream::Initialise()':
/opt/Software/ZoneMinder/zm-1.20.1/src/zm_mpeg.cpp:32: undefined reference to `av_register_all'
zm_mpeg.o(.text+0x31): In function `VideoStream::SetupFormat(char const*, char const*)':
/opt/Software/ZoneMinder/zm-1.20.1/src/zm_mpeg.cpp:42: undefined reference to `guess_format'
zm_mpeg.o(.text+0x71):/opt/Software/ZoneMinder/zm-1.20.1/src/zm_mpeg.cpp:46: undefined reference to `guess_format'
zm_mpeg.o(.text+0x155): In function `VideoStream::SetupCodec(int, int, int, int, int)':
/opt/Software/ZoneMinder/zm-1.20.1/src/zm_mpeg.cpp:72: undefined reference to `av_new_stream'
zm_mpeg.o(.text+0x1ef): In function `VideoStream::SetParameters()':
/opt/Software/ZoneMinder/zm-1.20.1/src/zm_mpeg.cpp:107: undefined reference to `av_set_parameters'
zm_mpeg.o(.text+0x2f9): In function `VideoStream::OpenStream()':
/opt/Software/ZoneMinder/zm-1.20.1/src/zm_mpeg.cpp:175: undefined reference to `url_fopen'
zm_mpeg.o(.text+0x666): In function `VideoStream::~VideoStream [not-in-charge]()':
/opt/Software/ZoneMinder/zm-1.20.1/src/zm_mpeg.cpp:232: undefined reference to `av_write_trailer'
zm_mpeg.o(.text+0x69f):/opt/Software/ZoneMinder/zm-1.20.1/src/zm_mpeg.cpp:243: undefined reference to `url_fclose'
zm_mpeg.o(.text+0x6b5):/opt/Software/ZoneMinder/zm-1.20.1/src/zm_mpeg.cpp:237: undefined reference to `av_freep'
zm_mpeg.o(.text+0x736): In function `VideoStream::~VideoStream [in-charge]()':
/opt/Software/ZoneMinder/zm-1.20.1/src/zm_mpeg.cpp:232: undefined reference to `av_write_trailer'
zm_mpeg.o(.text+0x76f):/opt/Software/ZoneMinder/zm-1.20.1/src/zm_mpeg.cpp:243: undefined reference to `url_fclose'
zm_mpeg.o(.text+0x785):/opt/Software/ZoneMinder/zm-1.20.1/src/zm_mpeg.cpp:237: undefined reference to `av_freep'
zm_mpeg.o(.text+0x91b): In function `VideoStream::EncodeFrame(unsigned char*, int, bool, unsigned)':
/opt/Software/ZoneMinder/zm-1.20.1/src/zm_mpeg.cpp:314: undefined reference to `av_write_frame'
zm_mpeg.o(.text+0x28f): In function `VideoStream::OpenStream()':
/opt/Software/ZoneMinder/zm-1.20.1/src/zm_mpeg.cpp:199: undefined reference to `av_write_header'
collect2: ld returned 1 exit status
make[2]: *** [zmc] Error 1
make[2]: Leaving directory `/opt/Software/ZoneMinder/zm-1.20.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/Software/ZoneMinder/zm-1.20.1'
make: *** [all] Error 2
This time, no missing files, so I'm at a total loss. Any ideas?
