Installing OpenCV 2.0 on Ubuntu 9.10 Karmic Koal
时间:2010-04-10 来源:pizi98
OpenCV is a widely used computer vision library for research and development. I’ve tried using instructions for installing it from the official manual, but it failed miserably. It seems that 2.0 code is incompatible with the latest incarnation of ffmpeg. Couple minutes in googling and I had it working.
UPDATE: The following process describes building the latest stable version from the sources. There is a binary version now in a third-party repository that you can install with apt-get.
Here is what needs to be done if you want to build one from sources:
- Get all the prerequisites:
sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg62-dev libtiff4-dev
sudo apt-get build-dep libswscale-dev swig - Get OpenCV 2.0, and unpack it somewhere
- Fix ffmpeg links. Make sure you are root (sudo -s) and do the following:
mkdir /usr/include/ffmpeg
ln -s /usr/include/libavcodec/avcodec.h /usr/include/ffmpeg/avcodec.h
ln -s /usr/include/libavformat/avformat.h /usr/include/ffmpeg/avformat.h
ln -s /usr/include/libavformat/avio.h /usr/include/ffmpeg/avio.h
ln -s /usr/include/libavutil/avutil.h /usr/include/ffmpeg/avutil.h
- Configure OpenCV. In the folder you’ve unpacked it to run:
./configure --prefix=/usr/local/opencv --enable-apps --enable-shared --enable-swscale --enable-gpl --with-swig
sudo ln -s /usr/include/libswscale/swscale.h /usr/include/ffmpeg/swscale.h - Make and install it
make
sudo make installYou could also test it by running make test - Configure your system to look for opencv libraries
echo /usr/local/opencv/lib > /etc/ld.so.conf.d/opencv.confReload the libraries and make sure opencv shows up now
ldconfig -v | grep opencvYou may get warnings on unaccessible lib paths, that is ok. You are looking for a line that says “/usr/local/opencv/lib” - Set-up pkg-config
echo 'export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/opencv/lib/pkgconfig' >> /etc/bash.bashrc
echo 'export PYTHONPATH=/usr/local/opencv/lib/python2.6/site-packages/opencv' >> /etc/bash.bashrcRestart your terminal to get the new paths - Test by building samples
cd ~/Programs/OpenCV-2.0.0/samples/c
. build_all.sh
You’re done.
Tagged with: computer vision, tech, ubuntu.
44 Comments
-
ABC says:
November 8, 2009 at 2:31 pm
This still gives me the error:
make[2]: *** [lib_highgui_la-cvcap_ffmpeg.lo] Error 1
Reply-
alex says:
November 10, 2009 at 7:28 pm
hmm…I’ve expanded the post a bit. try to see if it helps.
Reply-
ROBSON DA SILVA SIQUEIRA says:
April 3, 2010 at 8:52 am
Verify if one of the links in /usr/include/ffmpeg are broken.
ls -l /usr/include/ffmpegIm my case, one of the librarys was not installed, and the link become broke.
I resinstall and it’s ok.
Reply
-
ROBSON DA SILVA SIQUEIRA says:
April 3, 2010 at 8:52 am
-
alex says:
November 10, 2009 at 7:28 pm
-
Shern Shiou says:
November 9, 2009 at 2:18 am
Hi there, thanks for the guide.
I found 2 confused statement there.
1. sudo mkdir /usr/include/ffmpegsudo apt-get install libswscale-dev swig
Can you put a space between ffmpeg and sudo?2. sudo ln -s /usr/include/libavformat/avutil.h /usr/include/ffmpeg/avutil.h
Reply
avutil.h resides in libavutil not libavformat. -
Artur says:
November 14, 2009 at 8:36 am
Thanks!It works for me.
Reply -
Jiang says:
November 14, 2009 at 11:32 am
Met the sample problem! Can’t cmake following the OpenCV instructions as the declaration of “img_convert” has been removed from “avcodec.h”.
Thank you, Alex!
Reply -
zorooo says:
November 20, 2009 at 4:09 am
hello,
i think “mkdir /usr/include/ffmpegsudo” should be “mkdir /usr/include/ffmpeg/”.
thanks a lot for your manual!
greets zorooo
Reply -
Mario says:
November 27, 2009 at 3:41 am
I got this error on Step 6.. I am kind of new in Linux so I dont know what should I do…
root@mario-laptop:~/Dokumente/OpenCV-2.0.0# ldconfig -v | grep opencv
Reply
/sbin/ldconfig.real: Can’t stat /lib/i486-linux-gnu: No such file or directory
/sbin/ldconfig.real: Can’t stat /lib64: No such file or directory
/sbin/ldconfig.real: Cannot stat /usr/local/lib/libhighgui.so: No such file or directory
/sbin/ldconfig.real: Cannot stat /usr/local/lib/libcxcore.so: No such file or directory
/sbin/ldconfig.real: Cannot stat /usr/local/lib/libcv.so: No such file or directory
/sbin/ldconfig.real: Cannot stat /usr/local/lib/libcvaux.so: No such file or directory
/sbin/ldconfig.real: Cannot stat /usr/local/lib/libml.so: No such file or directory
/usr/local/opencv/lib:-
alex says:
November 27, 2009 at 12:35 pm
You’re good, the warnings are unrelated to opencv
Reply
-
alex says:
November 27, 2009 at 12:35 pm
-
Silveira Neto says:
November 27, 2009 at 10:48 am
I got some errors too on make:
Reply
highgui/cvcap_ffmpeg.cpp: In member function ‘virtual IplImage* CvCapture_FFMPEG::retrieveFrame(int)’:
highgui/cvcap_ffmpeg.cpp:578: error: ‘img_convert’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvVideoWriter_FFMPEG::writeFrame(const IplImage*)’:
highgui/cvcap_ffmpeg.cpp:1077: error: ‘img_convert’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvVideoWriter_FFMPEG::open(const char*, int, double, CvSize, bool)’:
highgui/cvcap_ffmpeg.cpp:1213: warning: ‘AVFormatContext* av_alloc_format_context()’ is deprecated (declared at /usr/include/ffmpeg/avformat.h:873)
highgui/cvcap_ffmpeg.cpp:1213: warning: ‘AVFormatContext* av_alloc_format_context()’ is deprecated (declared at /usr/include/ffmpeg/avformat.h:873)-
alex says:
November 27, 2009 at 12:39 pm
Looks like your ffmpeg is still incompatible. Did you link it per step 3?
Reply-
Silveira Neto says:
November 27, 2009 at 4:25 pm
This time I’m archiving compiling it. But on step 6, something like:
/sbin/ldconfig.real: Cannot stat /lib/i486-linux-gnu: No such file or directory
/sbin/ldconfig.real: Cannot stat /lib64: No such file or directory
/usr/local/opencv/lib:(yes, in last line after : was in blank).
Reply-
Silveira Neto says:
November 27, 2009 at 4:45 pm
It seems to work now. I just had to close and open my terminal. But anyway, what should be the output on the grep at step 6?
Reply -
Alex says:
November 30, 2009 at 3:13 am
I am having the same issue however closing and re-opening terminal is not fixing the issue, any ideas? Great guide tho! Much thanks
Reply-
alex says:
December 2, 2009 at 7:45 pm
A line starting with /usr/local/opencv/lib is a correct output. Fixed the guide.
-
alex says:
December 2, 2009 at 7:45 pm
-
Silveira Neto says:
November 27, 2009 at 4:45 pm
-
Silveira Neto says:
November 27, 2009 at 4:25 pm
-
Sebastian says:
December 15, 2009 at 3:18 pm
Just in case anyone is still stuck on this error: It showed up for me because I did not have the packages libswscale-dev and swig installed. Appearantly there is no package called “build-dep” in as mentioned in the first command so apt-get install just stopped there and did not install the two successive packages.
Reply-
alex says:
December 15, 2009 at 7:57 pm
Thanks, I’ve fixed the post to reflect the correct command.
Reply
-
alex says:
December 15, 2009 at 7:57 pm
-
alex says:
November 27, 2009 at 12:39 pm
-
Problems Installing OpenCV in Ubuntu Karmic (9.10) - Alex Sleat says:
December 1, 2009 at 6:47 am
[...] I found a great guide on getting OpenCV to install on Ubuntu Karmic (9.10) – http://ivkin.net/2009/11/installing-opencv-2-0-on-ubuntu-9-10-karmic-koala/ [...]
Reply -
Io-oI says:
December 2, 2009 at 6:55 pm
Man, I just installed Ubuntu yesterday so im newbie. I get error when I “sudo make install”.
The errors are:
libtool: install: error: cannot install `libcv.la’ to a directory not ending in /usr/local/lib
Reply
make[2]: *** [install-libLTLIBRARIES] Error 1
make[2]: Leaving directory `/media/42981C43981C37BD/OpenCV-2.0.0/src’
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/media/42981C43981C37BD/OpenCV-2.0.0/src’
make: *** [install-recursive] Error 1-
alex says:
December 2, 2009 at 7:44 pm
Your libtool might be too old. Try running
Reply
make DESTDIR= install
instead. Otherwise I don’t know.-
Io-oI says:
December 2, 2009 at 10:34 pm
I try but no, same error. Also I verify and I got the latest libtool version.
Reply
-
Io-oI says:
December 2, 2009 at 10:34 pm
-
alex says:
December 2, 2009 at 7:44 pm
-
Pramod says:
December 3, 2009 at 11:35 pm
Evertything went fine until running sudo make install. Though it tells that libraries have been installed, at the end it gives this error message :
/usr/bin/install -c -m 644 opencv/cv.h opencv/cv.hpp opencv/cvaux.h opencv/cvaux.hpp opencv/cvcompat.h opencv/cvstreams.h opencv/cxmat.hpp opencv/cvtypes.h opencv/cvver.h opencv/cvvidsurv.hpp opencv/cvwimage.h opencv/cxcore.h opencv/cxcore.hpp opencv/cxerror.h opencv/cxflann.h opencv/cxmisc.h opencv/cxoperations.hpp opencv/cxtypes.h opencv/highgui.h opencv/highgui.hpp opencv/ml.h ‘/usr/local/OpenCV-2.0.0/include/opencv’
/usr/bin/install: `opencv/cv.h’ and `/usr/local/OpenCV-2.0.0/include/opencv/cv.h’ are the same file
/usr/bin/install: `opencv/cv.hpp’ and `/usr/local/OpenCV-2.0.0/include/opencv/cv.hpp’ are the same file
/usr/bin/install: `opencv/cvaux.h’ and `/usr/local/OpenCV-2.0.0/include/opencv/cvaux.h’ are the same file
/usr/bin/install: `opencv/cvaux.hpp’ and `/usr/local/OpenCV-2.0.0/include/opencv/cvaux.hpp’ are the same file
/usr/bin/install: `opencv/cvcompat.h’ and `/usr/local/OpenCV-2.0.0/include/opencv/cvcompat.h’ are the same file
/usr/bin/install: `opencv/cvstreams.h’ and `/usr/local/OpenCV-2.0.0/include/opencv/cvstreams.h’ are the same file
/usr/bin/install: `opencv/cxmat.hpp’ and `/usr/local/OpenCV-2.0.0/include/opencv/cxmat.hpp’ are the same file
/usr/bin/install: `opencv/cvtypes.h’ and `/usr/local/OpenCV-2.0.0/include/opencv/cvtypes.h’ are the same file
/usr/bin/install: `opencv/cvver.h’ and `/usr/local/OpenCV-2.0.0/include/opencv/cvver.h’ are the same file
/usr/bin/install: `opencv/cvvidsurv.hpp’ and `/usr/local/OpenCV-2.0.0/include/opencv/cvvidsurv.hpp’ are the same file
/usr/bin/install: `opencv/cvwimage.h’ and `/usr/local/OpenCV-2.0.0/include/opencv/cvwimage.h’ are the same file
/usr/bin/install: `opencv/cxcore.h’ and `/usr/local/OpenCV-2.0.0/include/opencv/cxcore.h’ are the same file
/usr/bin/install: `opencv/cxcore.hpp’ and `/usr/local/OpenCV-2.0.0/include/opencv/cxcore.hpp’ are the same file
/usr/bin/install: `opencv/cxerror.h’ and `/usr/local/OpenCV-2.0.0/include/opencv/cxerror.h’ are the same file
/usr/bin/install: `opencv/cxflann.h’ and `/usr/local/OpenCV-2.0.0/include/opencv/cxflann.h’ are the same file
/usr/bin/install: `opencv/cxmisc.h’ and `/usr/local/OpenCV-2.0.0/include/opencv/cxmisc.h’ are the same file
/usr/bin/install: `opencv/cxoperations.hpp’ and `/usr/local/OpenCV-2.0.0/include/opencv/cxoperations.hpp’ are the same file
/usr/bin/install: `opencv/cxtypes.h’ and `/usr/local/OpenCV-2.0.0/include/opencv/cxtypes.h’ are the same file
/usr/bin/install: `opencv/highgui.h’ and `/usr/local/OpenCV-2.0.0/include/opencv/highgui.h’ are the same file
/usr/bin/install: `opencv/highgui.hpp’ and `/usr/local/OpenCV-2.0.0/include/opencv/highgui.hpp’ are the same file
/usr/bin/install: `opencv/ml.h’ and `/usr/local/OpenCV-2.0.0/include/opencv/ml.h’ are the same file
make[2]: *** [install-pkgincludeHEADERS] Error 1
make[2]: Leaving directory `/usr/local/OpenCV-2.0.0/include’
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/usr/local/OpenCV-2.0.0/include’
make: *** [install-recursive] Error 1
root@pramod-laptop:/usr/local/OpenCV-2.0.0# make test
make: *** No rule to make target `test’. Stop.Any hunch as to what the problem could be?
Regards
Reply
Pramod -
Gijs Molenaar says:
December 11, 2009 at 4:14 am
I’ve made OpenCV 2.0 packages for Ubuntu karmic and uploaded them to a PPA:
http://gijs.pythonic.nl/blog/2009/dec/11/ubuntu-karmic-packages-opencv-20/
Reply -
eton says:
December 15, 2009 at 3:25 am
I installed but i cant configure it?
eton@ubuntu:~/OpenCV-2.0.0$ sudo echo /usr/local/opencv/lib > /etc/ld.so.conf.d/opencv.conf
bash: /etc/ld.so.conf.d/opencv.conf: Permission deniedwhat i have to do now?
Reply-
alex says:
December 15, 2009 at 10:56 am
This is a known quirk of sudo – pipe and redirect is not interpreted under sudo command. I.e. you’re essentially running ’sudo echo blah’ then sending it out to opencv.conf fails because you are doing the redirect as yourself, not super user. To solve it either first run sudo -s, then echo… or run sudo sh -c ‘echo /usr/local/opencv/lib > /etc/ld.so.conf.d/opencv.conf’
Reply
-
alex says:
December 15, 2009 at 10:56 am
-
Sebastian says:
December 15, 2009 at 3:32 pm
Does the python interface work for you guys?
The example gives me the following error message:
AttributeError: ‘module’ object has no attribute ‘CaptureFromCAM’It’s the same when I try all the other methods that are supposed to be found in the module cv.
Reply -
clinton says:
December 24, 2009 at 12:58 pm
Thank You for forwarding the Launchpad link to the OpenCV 2.0 for Karmic.
Reply -
Mohamed says:
December 26, 2009 at 10:02 am
I get these errors at make :
==============
In file included from highgui/cvcap_ffmpeg.cpp:97:
/usr/local/include/libavformat/avformat.h:148: error: ‘AVPacket’ has not been declared
/usr/local/include/libavformat/avformat.h:227: error: ‘AVPacket’ has not been declared
/usr/local/include/libavformat/avformat.h:233: error: ‘AVPacket’ has not been declared
/usr/local/include/libavformat/avformat.h:234: error: ‘AVPacket’ has not been declared
/usr/local/include/libavformat/avformat.h:278: error: ‘AVPacket’ has not been declared
In file included from highgui/cvcap_ffmpeg.cpp:97:
/usr/local/include/libavformat/avformat.h:457: error: ‘AVPacket’ does not name a type
/usr/local/include/libavformat/avformat.h:581: error: ‘AVPacket’ does not name a type
/usr/local/include/libavformat/avformat.h:684: error: ‘AVPacket’ does not name a type
/usr/local/include/libavformat/avformat.h:761: error: ‘AVPacket’ has not been declared
/usr/local/include/libavformat/avformat.h:773: error: ‘AVPacket’ has not been declared
/usr/local/include/libavformat/avformat.h:869: error: ‘AVPacket’ has not been declared
/usr/local/include/libavformat/avformat.h:890: error: ‘AVPacket’ has not been declared
/usr/local/include/libavformat/avformat.h:1095: error: ‘AVPacket’ has not been declared
/usr/local/include/libavformat/avformat.h:1112: error: ‘AVPacket’ has not been declared
/usr/local/include/libavformat/avformat.h:1129: error: ‘AVPacket’ has not been declared
/usr/local/include/libavformat/avformat.h:1130: error: ‘AVPacket’ has not been declared
highgui/cvcap_ffmpeg.cpp:335: error: ‘AVPacket’ does not name a type
highgui/cvcap_ffmpeg.cpp: In member function ‘void CvCapture_FFMPEG::init()’:
highgui/cvcap_ffmpeg.cpp:361: error: ‘packet’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp: In member function ‘virtual void CvCapture_FFMPEG::close()’:
highgui/cvcap_ffmpeg.cpp:393: error: ‘packet’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp:394: error: ‘av_free_packet’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvCapture_FFMPEG::grabFrame()’:
highgui/cvcap_ffmpeg.cpp:527: error: ‘packet’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp:534: error: ‘packet’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp:535: error: ‘av_free_packet’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp:539: error: ‘packet’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp:541: error: ‘av_free_packet’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp: In member function ‘virtual IplImage* CvCapture_FFMPEG::retrieveFrame(int)’:
highgui/cvcap_ffmpeg.cpp:578: error: ‘img_convert’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp: In function ‘int icv_av_write_frame_FFMPEG(AVFormatContext*, AVStream*, uint8_t*, uint32_t, AVFrame*)’:
highgui/cvcap_ffmpeg.cpp:979: error: ‘AVPacket’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp:979: error: expected ‘;’ before ‘pkt’
highgui/cvcap_ffmpeg.cpp:980: error: ‘pkt’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp:980: error: ‘av_init_packet’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp:982: error: ‘PKT_FLAG_KEY’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp:993: error: ‘AVPacket’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp:993: error: expected ‘;’ before ‘pkt’
highgui/cvcap_ffmpeg.cpp:994: error: ‘pkt’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp:994: error: ‘av_init_packet’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp:1002: error: ‘PKT_FLAG_KEY’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvVideoWriter_FFMPEG::writeFrame(const IplImage*)’:
highgui/cvcap_ffmpeg.cpp:1077: error: ‘img_convert’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvVideoWriter_FFMPEG::open(const char*, int, double, CvSize, bool)’:
highgui/cvcap_ffmpeg.cpp:1213: warning: ‘AVFormatContext* av_alloc_format_context()’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:834)
highgui/cvcap_ffmpeg.cpp:1213: warning: ‘AVFormatContext* av_alloc_format_context()’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:834)
make[2]: *** [lib_highgui_la-cvcap_ffmpeg.lo] Error 1==============
Reply-
Sam says:
January 27, 2010 at 8:14 am
I get these errors too, does anyone know how to fix it? I’ve spent all day trying to get this to install!
Reply-
alex says:
January 27, 2010 at 9:12 am
Try adding the following to local/include/ffmpeg/avformat.h:
Reply
#define INT64_C
#define __STDC_CONSTANT_MACROS
#include
This a is very ugly, temporary hack just to make it compile.
-
alex says:
January 27, 2010 at 9:12 am
-
Sam says:
January 27, 2010 at 8:14 am
-
Bayana says:
January 12, 2010 at 3:27 am
1. root@bayana-desktop:/home/bayana/OpenCV-2.0.0# ./configure –prefix=/usr/local/opencv –enable-apps –enable-shared –enable-swscale –enable-gpl –with-swig
configure: WARNING: unrecognized options: –enable-swscale, –enable-gpl2. root@bayana-desktop:/home/bayana/OpenCV-2.0.0# make
make all-recursive
make[1]: Entering directory `/home/bayana/OpenCV-2.0.0′
Making all in 3rdparty
make[2]: Entering directory `/home/bayana/OpenCV-2.0.0/3rdparty’
make[2]: Nothing to be done for `all’.
make[2]: Leaving directory `/home/bayana/OpenCV-2.0.0/3rdparty’
Making all in src
make[2]: Entering directory `/home/bayana/OpenCV-2.0.0/src’
/bin/bash ../libtool –tag=CXX –mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -DNDEBUG -I../include/opencv -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -O3 -g -march=pentium4 -ffast-math -fomit-frame-pointer -MT lib_highgui_la-cvcap_ffmpeg.lo -MD -MP -MF .deps/lib_highgui_la-cvcap_ffmpeg.Tpo -c -o lib_highgui_la-cvcap_ffmpeg.lo `test -f ‘highgui/cvcap_ffmpeg.cpp’ || echo ‘./’`highgui/cvcap_ffmpeg.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -DNDEBUG -I../include/opencv -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -O3 -g -march=pentium4 -ffast-math -fomit-frame-pointer -MT lib_highgui_la-cvcap_ffmpeg.lo -MD -MP -MF .deps/lib_highgui_la-cvcap_ffmpeg.Tpo -c highgui/cvcap_ffmpeg.cpp -fPIC -DPIC -o .libs/lib_highgui_la-cvcap_ffmpeg.o
highgui/cvcap_ffmpeg.cpp: In member function ‘virtual IplImage* CvCapture_FFMPEG::retrieveFrame(int)’:
highgui/cvcap_ffmpeg.cpp:578: error: ‘img_convert’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvVideoWriter_FFMPEG::writeFrame(const IplImage*)’:
highgui/cvcap_ffmpeg.cpp:1077: error: ‘img_convert’ was not declared in this scope
highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvVideoWriter_FFMPEG::open(const char*, int, double, CvSize, bool)’:
highgui/cvcap_ffmpeg.cpp:1213: warning: ‘AVFormatContext* av_alloc_format_context()’ is deprecated (declared at /usr/include/ffmpeg/avformat.h:873)
highgui/cvcap_ffmpeg.cpp:1213: warning: ‘AVFormatContext* av_alloc_format_context()’ is deprecated (declared at /usr/include/ffmpeg/avformat.h:873)
make[2]: *** [lib_highgui_la-cvcap_ffmpeg.lo] Error 1
make[2]: Leaving directory `/home/bayana/OpenCV-2.0.0/src’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/bayana/OpenCV-2.0.0′
make: *** [all] Error 2Please help me
Reply-
alex says:
January 12, 2010 at 9:23 am
Make sure you’ve downloaded and unpacked the right code.
Reply
Also make sure all prereqs are satisfied (step 1)
-
alex says:
January 12, 2010 at 9:23 am
-
Will Qawasmi says:
January 18, 2010 at 11:34 am
Oh My God.
I have spent all fucking day trying to get this to work, and I finally found a source that helped me.
I take my hat off to you… *takes hat off*
<3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3
Reply -
Will Qawasmi says:
January 18, 2010 at 12:07 pm
Woops,
It seems as if I spoke to soon =\
I am also getting the:
make[2]: *** [lib_highgui_la-cvcap_ffmpeg.lo] Error 1
make[2]: Leaving directory `/home/will/OpenCV-2.0.0/src’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/will/OpenCV-2.0.0′
make: *** [all] Error 2At least this tut got me much farther then I was before… now another problem to deal with…
Reply-
alex says:
January 18, 2010 at 12:36 pm
Try this (found on the net, has not tried myself)
Reply
“Add to local/include/ffmpeg/avformat.h:
#define INT64_C
#define __STDC_CONSTANT_MACROS
#include
This a is very ugly, temporary hack just to make it compile.”-
Will Qawasmi says:
January 19, 2010 at 3:58 am
Wow it worked! (this time for sure
Thank You!
Now I feel embarrassed asking this but, I cannot get Code::Blocks to work with OpenCV… any tips? If not what IDE do you use and how did you configure it?
Either Way, Thank You for getting me this far!
Reply
-
Will Qawasmi says:
January 19, 2010 at 3:58 am
-
alex says:
January 18, 2010 at 12:36 pm
-
manueldavid says:
January 25, 2010 at 7:15 am
Hello, I try to install OpenCV 2.0 on Ubuntu 9.04..
I do:
$./configure
$make
$make installbut just do make install, I get the following:
../src/.libs/libhighgui.so: undefined reference to `av_get_bits_per_pixel’
../src/.libs/libhighgui.so: undefined reference to `av_pix_fmt_descriptors’
collect2: ld returned 1 exit status
make[1]: *** [opencv-haartraining] Error 1Help me, please.
Reply-
santosh says:
February 27, 2010 at 11:44 am
Hi manueldavid, I am trying to install opencv in ubuntu 9.10 and having exactly the same problem as you. I would like to know if you have managed to find a solution. I am very new to linux and opencv (installed it a week ago) and do not have a clue what the error message means and where to look for further details.
thanks,
Reply
Santosh
-
santosh says:
February 27, 2010 at 11:44 am
-
Chris says:
February 19, 2010 at 8:38 am
Alex,
Are you using the 64-bit AMD install of Ubuntu by chance? I’ve been having many of the same issues getting it to work, and someone mentioned that 64-bit systems have their own set of issues with the install.
Reply-
Alex says:
February 19, 2010 at 9:11 am
It was a 64 bit system. Most of the issues could be solved by updating the dependencies or fixing the source code as above
Reply
-
Alex says:
February 19, 2010 at 9:11 am
-
Chris says:
February 25, 2010 at 3:32 pm
Alex,
Your first step still says:
“sudo apt-get build-dep libswscale-dev swig”
I think this should be
“sudo apt-get build-dep python-opencv
Reply
sudo apt-get install libswscale-dev swig” -
Jesse says:
March 23, 2010 at 11:17 pm
I’ve tried installing from the PPA site as well as using your directions and each time I seem to get a different version of the python wrapper – neither match the willowgarage wiki.
Does anyone know what is up with this?
Many thanks,
Jesse
Reply -
sarang says:
March 31, 2010 at 10:31 pm
while installing i also got the following problem:
make[2]: *** [lib_highgui_la-cvcap_ffmpeg.lo] Error 1
make[2]: Leaving directory `/home/sarang/OpenCV-2.0.0/src’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/sarang/OpenCV-2.0.0′
make: *** [all] Error 2as you said i did following changes to
local/include/ffmpeg/avformat.h:
#define INT64_C
#define __STDC_CONSTANT_MACROS
#includebut still its not working giving the same error.plz help.thnx.
Reply -
Gijs Molenaar says:
April 7, 2010 at 5:50 am
Opencv 2.1 packages for ubuntu 9.10 (karmic) and 10.04 (lucid):
http://gijs.pythonic.nl/blog/2010/apr/7/opencv-21-ubuntu-packages/
Reply