Make error

Support and queries relating to all previous versions of ZoneMinder
decibel83
Posts: 80
Joined: Tue Dec 06, 2005 5:22 pm

Make error

Post by decibel83 »

I get this error during the compilation process of ZoneMinder 1.23.0 on a Debian Stable (Etch):

mv -f .deps/zm_file_camera.Tpo .deps/zm_file_camera.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -g -O2 -MT zm_monitor.o -MD -MP -MF .deps/zm_monitor.Tpo -c -o zm_monitor.o zm_monitor.cpp
mv -f .deps/zm_monitor.Tpo .deps/zm_monitor.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -g -O2 -MT zm_user.o -MD -MP -MF .deps/zm_user.Tpo -c -o zm_user.o zm_user.cpp
mv -f .deps/zm_user.Tpo .deps/zm_user.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -g -O2 -MT zm_mpeg.o -MD -MP -MF .deps/zm_mpeg.Tpo -c -o zm_mpeg.o zm_mpeg.cpp
zm_mpeg.cpp: In destructor âVideoStream::~VideoStream()â:
zm_mpeg.cpp:281: error: cannot convert âByteIOContextâ to âByteIOContext*â for argument â1â to âint url_fclose(ByteIOContext*)â
make[1]: *** [zm_mpeg.o] Error 1
make[1]: Leaving directory `/usr/local/src/ZoneMinder-1.23.0/src'
make: *** [install-recursive] Error 1
venere:/usr/local/src/ZoneMinder-1.23.0#

I can't fix it, could you help me please?

Thank you very much!
Bye.
MILxDOT
Posts: 64
Joined: Wed Mar 29, 2006 5:12 am

Post by MILxDOT »

All went well till I tried to make. I had to modify line 281 of the src/zm_mpeg.cpp to look like:
url_fclose(&ofc->pb);
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Note this comment from the change history.
# FEATURE : Updated to support latest ffmpeg. This update is not compatible with previous svn versions so you should update your ffmpeg to the latest version prior to building ZM. Other 'released' versions of ffmpeg should be fine though these are very out of date nowadays. Also added libswscale support to avoid using deprecated img_convert function. The ffmpeg configure line should be ./configure --enable-gpl --enable-swscaler to enable this support.
So you need to update to the latest ffmpeg as it's too tricky to track each API diff that they make and support them all. ZoneMinder now will only support official ffmpeg releases (which haven't happened for a while) or the latest svn release at the time of ZM release.
Phil
onina
Posts: 18
Joined: Tue May 06, 2008 3:46 pm
Location: New Orleans

I get this error during the compilation process

Post by onina »

I get the below error during the compilation process of ZoneMinder Release 1.23.3
I am running it on on a CentOS 5 box.

I believe I have the latest ffmpeg as I ran
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
Then did ./configure, make, and make install for ffmpeg all seemed to go well.
Then I ran ./configure and make for Zoneminder

Can anyone please help me?

Here is the error I am receiving when running make install on Zoneminder:

make install
Making install in src
make[1]: Entering directory `/root/ZoneMinder-1.23.2/src'
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include/ffmpeg/include -g -O2 -MT zm_mpeg.o -MD -MP -MF .deps/zm_mpeg.Tpo -c -o zm_mpeg.o zm_mpeg.cpp
zm_mpeg.cpp: In destructor âVideoStream::~VideoStream()â:
zm_mpeg.cpp:281: error: cannot convert âByteIOContextâ to âByteIOContext*â for argument â1â to âint url_fclose(ByteIOContext*)â
zm_mpeg.cpp: In member function âdouble VideoStream::EncodeFrame(uint8_t*, int, bool, unsigned int)â:
zm_mpeg.cpp:325: warning: âimg_convertâ is deprecated (declared at /usr/include/ffmpeg/avcodec.h:2648)
zm_mpeg.cpp:325: warning: âimg_convertâ is deprecated (declared at /usr/include/ffmpeg/avcodec.h:2648)
make[1]: *** [zm_mpeg.o] Error 1
make[1]: Leaving directory `/root/ZoneMinder-1.23.2/src'
make: *** [install-recursive] Error 1
betulichergutmensch
Posts: 9
Joined: Sat Jan 26, 2008 12:26 pm
Location: Berlin, Germany
Contact:

Post by betulichergutmensch »

this failure is indeed a problem concerning ffmpeg...

svn ffmpeg is right, but then see ./configure --help and for example use another prefix --prefix=/opt, then when compiling zoneminder, use ./configure --with-ffmpeg=/opt, that should do it.

without that i always had troubles like this, when i had ffmpeg installed from another package repos instead of compiling it first...

i believe your compile also tries an old version and not the new one. otherwise the hint above with changing that special line might help
onina
Posts: 18
Joined: Tue May 06, 2008 3:46 pm
Location: New Orleans

Post by onina »

I really appreciate your help. But I am a little confused in what your suggesting. Are you saying that when I run ./configure for ffmpeg I should append the ./configure with --prefix=/opt, like so:
./configure --prefix=/opt

And when I run ./configure for Zoneminder I should run it appended with --with-ffmpeg=/opt, like so:
./configure --with-ffmpeg=/opt

Also why would Zoneminder try an older version of ffmpeg and not the new one, and what can I possibly do about this?

Also what is 'opt'?

Please excuse my igronance as I have been out of the Linux world for a little while and again really appreciate the help.
betulichergutmensch
Posts: 9
Joined: Sat Jan 26, 2008 12:26 pm
Location: Berlin, Germany
Contact:

Post by betulichergutmensch »

to use /opt just means you give another root-path for ffmpeg to work, if you only need it for zoneminder... i cannot exactly tell you what is going wrong, when using the standard path, but i had these problems too. maybe there are some conflicts with old libraries, sources, etc.

blame it on the ffmpeg programmers, who obviously change the api like their pants every day. i really don't want to know, what is going wrong there ;-)
onina
Posts: 18
Joined: Tue May 06, 2008 3:46 pm
Location: New Orleans

Post by onina »

I tried to run what you suggested and got this. Any and all help is greatly appreciated.


[root@IH ffmpeg]# ./configure --with-ffmpeg=/opt
Unknown option "--with-ffmpeg=/opt".
See ./configure --help for available options.
onina
Posts: 18
Joined: Tue May 06, 2008 3:46 pm
Location: New Orleans

Post by onina »

Here are the options I am offered when running --help


Standard options:
--help print this message
--logfile=FILE log tests and output to FILE [config.err]
--disable-logging do not log configure debug information
--prefix=PREFIX install in PREFIX [/usr/local]
--libdir=DIR install libs in DIR [PREFIX/lib]
--shlibdir=DIR install shared libs in DIR [PREFIX/lib]
--incdir=DIR install includes in DIR [PREFIX/include]
--mandir=DIR install man page in DIR [PREFIX/share/man]
--enable-static build static libraries [default=yes]
--disable-static do not build static libraries [default=no]
--enable-shared build shared libraries [default=no]
--disable-shared do not build shared libraries [default=yes]
--enable-gpl allow use of GPL code, the resulting libav*
and ffmpeg will be under GPL [default=no]
--enable-nonfree allow use of nonfree code, the resulting libav
and ffmpeg will be unredistributable [default=
--enable-postproc enable GPLed postprocessing support [default=n
--enable-swscale software scaler support [default=no]
--enable-avfilter video filter support (replaces vhook) [default
--enable-avfilter-lavf video filters dependant on avformat [default=n
--enable-beosthreads use BeOS threads [default=no]
--enable-os2threads use OS/2 threads [default=no]
--enable-pthreads use pthreads [default=no]
--enable-w32threads use Win32 threads [default=no]
--enable-x11grab enable X11 grabbing [default=no]

External library support:
--enable-mlib use Sun medialib [default=no]
--enable-liba52 enable GPLed liba52 support [default=no]
--enable-liba52bin open liba52.so.0 at runtime [default=no]
--enable-avisynth allow reading AVISynth script files [default=no]
--enable-libamr-nb enable libamr-nb floating point audio codec
--enable-libamr-wb enable libamr-wb floating point audio codec
--enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
and libraw1394 [default=no]
--enable-libdirac enable Dirac support via libdirac [default=no]
--enable-libfaac enable FAAC support via libfaac [default=no]
--enable-libfaad enable FAAD support via libfaad [default=no]
--enable-libfaadbin open libfaad.so.0 at runtime [default=no]
--enable-libgsm enable GSM support via libgsm [default=no]
--enable-libmp3lame enable MP3 encoding via libmp3lame [default=no]
--enable-libnut enable NUT (de)muxing via libnut,
native demuxer exists [default=no]
--enable-libschroedinger enable Dirac support via libschroedinger [default=no]
--enable-libtheora enable Theora encoding via libtheora [default=no]
--enable-libvorbis enable Vorbis encoding via libvorbis,
native implementation exists [default=no]
--enable-libx264 enable H.264 encoding via x264 [default=no]
--enable-libxvid enable Xvid encoding via xvidcore,
native MPEG-4/Xvid encoder exists [default=no]

Advanced options (experts only):
--source-path=PATH path to source code [/root/ffmpeg]
--cross-prefix=PREFIX use PREFIX for compilation tools []
--enable-cross-compile assume a cross-compiler is used
--target-os=OS compiler targets OS [linux]
--cc=CC use C compiler CC [gcc]
--extra-cflags=ECFLAGS add ECFLAGS to CFLAGS []
--extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS []
--extra-libs=ELIBS add ELIBS []
--build-suffix=SUFFIX suffix for application specific build []
--arch=ARCH select architecture [i686]
--cpu=CPU selects the minimum cpu required (affects
instruction selection, may crash on older CPUs)
--enable-powerpc-perf enable performance report on PPC
(requires enabling PMC)
--disable-mmx disable MMX usage
--disable-mmx2 disable MMX2 usage
--disable-ssse3 disable SSSE3 usage
--disable-armv5te disable armv5te usage
--disable-armv6 disable armv6 usage
--disable-armvfp disable ARM VFP usage
--disable-iwmmxt disable iwmmxt usage
--disable-altivec disable AltiVec usage
--disable-network disable network support [default=no]
--disable-ipv6 disable ipv6 support [default=no]
--disable-zlib disable zlib [default=no]
--disable-vhook disable video hooking support
--disable-debug disable debugging symbols
--disable-mpegaudio-hp faster (but less accurate)
MPEG audio decoding [default=no]
--enable-gray enable full grayscale support (slower color)
--disable-ffmpeg disable ffmpeg build
--disable-ffserver disable ffserver build
--disable-ffplay disable ffplay build
--enable-small optimize for size instead of speed
--enable-hardcoded-tables use hardcoded tables instead of runtime gener
--enable-memalign-hack emulate memalign, interferes with memory debug
--disable-encoder=NAME disables encoder NAME
--enable-encoder=NAME enables encoder NAME
--disable-decoder=NAME disables decoder NAME
--enable-decoder=NAME enables decoder NAME
--disable-encoders disables all encoders
--disable-decoders disables all decoders
--disable-muxer=NAME disables muxer NAME
--enable-muxer=NAME enables muxer NAME
--disable-muxers disables all muxers
--disable-demuxer=NAME disables demuxer NAME
--enable-demuxer=NAME enables demuxer NAME
--disable-demuxers disables all demuxers
--enable-parser=NAME enables parser NAME
--disable-parser=NAME disables parser NAME
--disable-parsers disables all parsers
--enable-bsf=NAME enables bitstream filter NAME
--disable-bsfs disables all bitstream filters
--enable-protocol=NAME enables protocol NAME
--disable-protocol=NAME disables protocol NAME
--disable-protocols disables all protocols
--disable-devices disables all devices
--list-decoders show all available decoders
--list-encoders show all available encoders
--list-muxers show all available muxers
--list-demuxers show all available demuxers
--list-parsers show all available parsers
--list-protocols show all available protocols
--list-bsfs show all available bitstream filters
--list-indevs show all available input devices
--list-outdevs show all available output devices

Developer options (useful when working on FFmpeg itself):
--enable-gprof enable profiling with gprof []
--disable-optimizations disable compiler optimizations
--enable-extra-warnings enable more compiler warnings
--disable-stripping disable stripping of executables and shared li
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

betulichergutmensch wrote:this failure is indeed a problem concerning ffmpeg...

svn ffmpeg is right, but then see ./configure --help and for example use another prefix --prefix=/opt, then when compiling zoneminder, use ./configure --with-ffmpeg=/opt, that should do it.

without that i always had troubles like this, when i had ffmpeg installed from another package repos instead of compiling it first...

i believe your compile also tries an old version and not the new one. otherwise the hint above with changing that special line might help
This may work but it's not a fix, it's a crutch. If you have the original ffmpeg source that was installed, You should change into its directory and run "make uninstall" and remove the ffmpeg. Otherwise you still have a conflicting ffmpeg installed and always have to remember that you installed your working version in /opt and that you have a delapitated version installed in prefix=/usr or /usr/local.

If you don't have the original source, you will have to delete the files by hand.

Either way you don't really want two versions of ffmpeg, especaily if you don't understand how or why to deal with it, you also have to remember it for the life span of the install.
onina
Posts: 18
Joined: Tue May 06, 2008 3:46 pm
Location: New Orleans

Post by onina »

I can't seem to find the original ffmpeg source.
What files do I need to remove? My ffmpeg binary is in /usr/bin/
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

I posted the file list in hints and tips:
http://www.zoneminder.com/forums/viewtopic.php?p=42242

Of coarse my system is AMD64 so if your on a x86 files would be in /usr/lib instead of /usr/lib64.
Another difference could also be by default I think ffmpeg source installs to a prefix of /usr/local, in which case you would find the files under:
/usr/local/bin
and
/usr/local/lib

But in your case all should be in /usr/bin and /usr/lib if the ffmpeg binary is in /usr/bin :wink:
onina
Posts: 18
Joined: Tue May 06, 2008 3:46 pm
Location: New Orleans

Post by onina »

I am still somewhat confused. The command
./configure --with-ffmpeg=/opt
does not seem to be valid.

This is what I get when I try to
./configure --with-ffmpeg=/opt

./configure --with-ffmpeg=/opt
Unknown option "--with-ffmpeg=/opt".
See ./configure --help for available options.

I am not sure if this is a syntax problem or --with-ffmpeg=/opt option simply does not exist.

Do you know where and what files I should delete to remove ffmpeg from my sytem.

What files exactly do I need to remove? I am sure /usr/bin/ffmpeg has to go.

but do I also need to remove ffplay and ffserver from /usr/bin?

And what other files do I need to remove from other directorys on my system in order to re-install ffmpeg.
badone
Posts: 16
Joined: Thu Apr 03, 2008 1:16 am

Post by badone »

zoneminder wrote:The ffmpeg configure line should be ./configure --enable-gpl --enable-swscaler to enable this support.

So you need to update to the latest ffmpeg as it's too tricky to track each API diff that they make and support them all. ZoneMinder now will only support official ffmpeg releases (which haven't happened for a while) or the latest svn release at the time of ZM release.
svn co svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg

./configure --enable-gpl --enable-swscaler
Unknown option "--enable-swscaler".
See ./configure --help for available options.

Turns out the actual option is --enable-swscale so the configure looks like this:

./configure --enable-gpl --enable-swscale

Unfortunately I then got the following errors:
zm_mpeg.h:29:29: error: ffmpeg/avformat.h: No such file or directory
zm_mpeg.h:31:28: error: ffmpeg/swscale.h: No such file or directory

Changing the relevant lines to include libavformat/avformat.h and libswscale/swscale.h respectively fixed the problem. i can see why you say ffmpeg is problematic Phil.

Cheers,
Brad
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

onina wrote:I am still somewhat confused. The command
./configure --with-ffmpeg=/opt
does not seem to be valid.

This is what I get when I try to
./configure --with-ffmpeg=/opt

./configure --with-ffmpeg=/opt
Unknown option "--with-ffmpeg=/opt".
See ./configure --help for available options.

I am not sure if this is a syntax problem or --with-ffmpeg=/opt option simply does not exist.

Do you know where and what files I should delete to remove ffmpeg from my sytem.

What files exactly do I need to remove? I am sure /usr/bin/ffmpeg has to go.

but do I also need to remove ffplay and ffserver from /usr/bin?

And what other files do I need to remove from other directorys on my system in order to re-install ffmpeg.
First you want to remove all previous versions of ffmpeg, so yes all files listed in the link I gave you should be removed.
Second, --with-ffmpeg= is looking for the prefix path of where ffmpeg is installed. If your ffmpeg installs to /usr/bin then /usr is your prefix path, else if it is in /usr/local/bin then /usr/local is your prefix path or, if you configure ffmpeg with a prefix path of /opt you would use the same in ZM configure script, but putting it in opt places it out side the sytem path so it may not be preferable for you as you would need to add the shared libraries to the system path. Till you understand more of what your are doing, you might want to stay away from installing outside of /usr.
Third, --with-ffmpeg is for the zoneminder configure script, not ffmpeg configure script.
Locked