Problems compiling ZoneMinder on Ubuntu 8.0 [solved]

Forum for questions and support relating to the 1.24.x releases only.
Locked
prupert
Posts: 10
Joined: Mon Mar 02, 2009 3:47 pm
Location: Bristol, UK

Problems compiling ZoneMinder on Ubuntu 8.0 [solved]

Post by prupert »

Hello, first time poster, on and off user.

I've used the deb version of ZoneMinder on my Ubuntu serer for a while, and it works fine, but only recognises one of my 3 WebCams. Since one of them uses the uvc driver, I was hoping to compile 1.24.1 from source to make use of the uvc driver implementation.

I followed the instructions here, linked from the wiki:
http://www.zoneminder.com/forums/viewtopic.php?t=13140

But on sudo make install, I get the following errors:

collect: relinking
collect: recompiling zm_rtsp.cpp
collect: recompiling zm_rtp_ctrl.cpp
collect: recompiling zm_event.cpp
collect: recompiling zm_comms.cpp
collect: relinking
collect: recompiling zm_rtsp.cpp
collect: recompiling zm_rtp_ctrl.cpp
collect: recompiling zm_comms.cpp
collect: relinking
zm_mpeg.o: In function `VideoStream::EncodeFrame(unsigned char*, int, bool, unsigned int)':
/home/server/zm/src/zm_mpeg.cpp:362: undefined reference to `av_init_packet'
/home/server/zm/src/zm_mpeg.cpp:341: undefined reference to `av_init_packet'
zm_rtsp.o: In function `RtspThread':
/home/server/zm/src/zm_rtsp.cpp:183: undefined reference to `avformat_alloc_context'
/home/server/zm/src/zm_rtsp.cpp:183: undefined reference to `avformat_alloc_context'
collect2: ld returned 1 exit status
make[1]: *** [zmc] Error 1
make[1]: Leaving directory `/home/server/zm/src'
make: *** [install-recursive] Error 1

As the instructions said, I am using the latest ffmpeg from svn and the lastest version of zm from svn.

I head read a few other posts about errors similar to this, and they stated that ffmpeg has to be the latest version. Since I guess I have this, I am unsure how to proceed.

Funnily enough, I can still access the ZM console via web interface, but the interface says zm aint running and when I add cameras, there is no link to click on the cameras name, I guess this is all because ZM failed at make install.

Can someone give me pointers where I can go to fix this since I am only use to fixing dependency problems when I compile from source :(

On a side note, I see that the ZM web admin dude is from Bristol. So am I!! Kudos to the cool app. Brizzle seems like the business these days, what with Skins and that BBC 3 program about werewolves etc ;)
Last edited by prupert on Tue Mar 03, 2009 6:57 pm, edited 1 time in total.
newvisionantenna
Posts: 381
Joined: Sat Jan 17, 2009 7:49 pm
Location: Germany

Post by newvisionantenna »

Did you happen try and patch the ffmpeg with Phil's patch? If so I noticed the same exact error yesterday preparing a new DVD build with both WiFi Gator and Zoneminder working hand in hand for wireless CCTV managment/Hotspot management. I just went back and redid ffmpeg both without the patch and with it manually. It then installed without complaint.
prupert
Posts: 10
Joined: Mon Mar 02, 2009 3:47 pm
Location: Bristol, UK

Post by prupert »

I was unaware any patch was necessary.

From what you said, I am not clear which worked. Patching it or not?

Do you mind sharing a link to this patch, maybe that is what I need?

Thanks in advance.
newvisionantenna
Posts: 381
Joined: Sat Jan 17, 2009 7:49 pm
Location: Germany

Post by newvisionantenna »

Sorry for the confusion. When I applied the patch I got the same error as you. I then just deleted the ffmpeg directory and redownloaded from SVN. I put in the same options for configuration and recompiled. The patch I mention fixes the user name and password issue with Axis or Acti cam's, can't remember at the momnet. It's located under the wiki under patches and third party. It requires some manual intervention at the moment to apply because something changed in the ffmpeg code.

You know what, I remember what I did differnet. When I compiled Zonemidner the first time and got that error I used ffmpeg=/usr/
and the second time I put ffmpeg=/usr/local/ and I had no errors at all. I'm away from my notes right now so I might be making a mistake on some wording here, but I think you'll get the idea of what I did to fix it. My ffmpeg is located in /usr/local/bin. The error probably had nothing to do with the patch now that I think about it, it was probably the way I was defining the path for ffmpeg.
prupert
Posts: 10
Joined: Mon Mar 02, 2009 3:47 pm
Location: Bristol, UK

Post by prupert »

That didn't fix it, but I managed to find something that did.

First I followed this post:

http://www.zoneminder.com/forums/viewto ... signed+int

Specifically, this part:

"Hehe hurray.. it seems that ffmpeg's include dir is required Very Happy
I finally managed to compile ZM 1.23.1.

Newest release of ffmpeg from their svn and compile it with:
./configure --enable-shared --enable-pp --enable-swscaler --enable-gpl --prefix=/opt/

I had to define --prefix to be completely different than normally used,
otherwise compile failed with the same errors as above.

and then ZM with options:
./configure --with-webdir=/var/www/html/zm --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --with-ffmpeg=/opt

For some reason ffmpeg didn't update /usr/include/ffmpeg files and thus
the errors...

- wisekki"

That fixed the make errors, but then when I:

sudo zmpkg.pl start

I got a new error:

/usr/local/bin/zmfix: error while loading shared libraries: libswscale.so.0: cannot open shared object file: No such file or directory

On another forum search I found this post:

http://www.zoneminder.com/forums/viewto ... +directory

And I did the part here:

"Solution to the above question/ problem:
zmfix is looking for the ffmpeg libs in /lib. cd /lib and then ln -s /usr/local/lib/libswscale.so.0 . (do the same for libavformat.so.52, libavcodec.so.51 and libavutil.so.49.
run zmfix and it should work."

I had to ln -s one other as well, but if you are following this as a guide, just use the error message:

"/usr/local/bin/zmfix: error while loading shared libraries: XXXXXXXXX.XX.X: cannot open shared object file: No such file or directory"

and use XXXXXXXXX.XX.X when you do:

ln -s /usr/local/lib/XXXXXXXXX.XX.X

And then I ran zmfix and I was good to go. Well, actually, I can get as far as the console and it says ZM is running, so that is as far as I have got ;)

It seems that compiling ffmpeg from source causes problems with ZM since ZM expects the libraries to be in one place and when you compile them from source, they go elsewhere.
Locked