Page 1 of 1

OpenCV 3 installations issues

Posted: Sat Oct 15, 2016 6:20 pm
by obender
Hi,

I'm trying to build OpenCV 3.1 on RPi and facing some compilation issues related to FFMPEG libraries.
I suspect there is a problem in either missing library or the wrong library being used.
Before building OpenCV I've built FFMPEG from source and that worked just fine.
The error is as follows:

Code: Select all

usr/bin/ld: warning: libavutil.so.55, needed by //usr/local/lib/libswresample.so, may conflict with libavutil.so.54
/usr/bin/ld: warning: libavutil.so.55, needed by //usr/local/lib/libswresample.so, may conflict with libavutil.so.54
../../lib/libopencv_videoio.a(cap_ffmpeg.cpp.o): In function `CvVideoWriter_FFMPEG::open(char const*, int, double, int, int, bool)':
cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiib+0x2dc): undefined reference to `avformat_get_mov_video_tags'
collect2: error: ld returned 1 exit status
modules/video/CMakeFiles/opencv_perf_video.dir/build.make:312: recipe for target 'bin/opencv_perf_video' failed
make[2]: *** [bin/opencv_perf_video] Error 1
CMakeFiles/Makefile2:4078: recipe for target 'modules/video/CMakeFiles/opencv_perf_video.dir/all' failed
make[1]: *** [modules/video/CMakeFiles/opencv_perf_video.dir/all] Error 2
Makefile:147: recipe for target 'all' failed
make: *** [all] Error 2
Any suggestions?

Re: OpenCV 3 installations issues

Posted: Sun Oct 16, 2016 1:25 am
by obender
I guess a better question to ask is if you have successfully installed OpenCV 3.1 on RPi what version of FFMpeg did you have?

Re: OpenCV 3 installations issues

Posted: Sun Oct 16, 2016 1:51 am
by stderr
obender wrote:Any suggestions?
Did you build ffmpeg from source? There's probably a conflict between avconv because it is a fork or something of ffmpeg. OpenCV isn't that good at having clear and up to date build/install instructions. I think they lack anything in the source and expect you to find it on their website, just looking, I found instructions for Ubuntu 10.04.

Re: OpenCV 3 installations issues

Posted: Sun Oct 16, 2016 1:56 am
by obender
Yes, build version 2.7.7 of FFMpeg which seems to have close version of the libraries (54) that the RPi (in /usr/lib/arm-linux-gnueabihf) has.
But I'm getting the

Code: Select all

usr/local/lib/libswresample.so: undefined reference to `av_calloc@LIBAVUTIL_54'
error now.

Do you have OpenCV 3 with video support installed in RPi with libav (avconv) instead of FFMpeg?

Re: OpenCV 3 installations issues

Posted: Sun Oct 16, 2016 6:47 pm
by stderr
obender wrote:Yes, build version 2.7.7 of FFMpeg which seems to have close version
Do you have OpenCV 3 with video support installed in RPi with libav (avconv) instead of FFMpeg?
I've had OpenCV 3 on AMD64 but I did want it on the pi, so I did just do that given your question. I have not tested it in any way, so I don't know if it really works right, but it built by first building and installing ffmpeg 3.1.4 from https://ffmpeg.org/download.html#release_3.1 and then opencv from https://github.com/opencv/opencv.git using more or less the ideas at http://docs.opencv.org/3.1.0/d7/d9f/tut ... stall.html . It bombed out for me the first time, opencv did, and then I added in an external flash swap drive and it then completed.

Re: OpenCV 3 installations issues

Posted: Wed Oct 19, 2016 5:43 pm
by mc007ibi
not sure this helps,

i got OpenCV-3 installed after lots of trouble this way:

https://gist.github.com/gbaumgart/99b8f ... ac9fbd2d9d

Re: OpenCV 3 installations issues

Posted: Thu Oct 20, 2016 10:53 am
by obender
Yes, this was the article I've used originally. My problem was (as it turns out) that I installed FFMpeg first and then went on installing OpenCV.
If you don't install FFMpeg at all and go about installation of OpenCV according to the above guid everything works as described in there.