Installing OpenCV and ffmpeg (in Fedora Core 5)
(Updated on: June 19 2008)
First of all, it is a pain in the ass to start using Linux. It took me at least three days to get the development environment set up.
It might be very useful to write this down, just in case if I need to do this thing again someday.
There ARE some references on the web for installation instruction. Yet, they are making some assumption that the readers are somehow acquainted with Linux. Obveriously, I am not. Any way.
The two references are:
http://www.comp.leeds.ac.uk/vision/opencv/install-lin-ffmpeg.html
http://opencvlibrary.sourceforge.net/InstallGuide_Linux
http://www.rainsoft.de/projects/ffmpeg_opencv.html
1. Log in as root. Follow the instructions in the first link. However, there is a minor mistake there.
Instead of “CFLAGS=-I/tmp/ffmpeg-bin/include CPPFLAGS=-I/tmp/ffmpeg-bin/include LDFLAGS=-L/tmp/ffmpeg-bin/lib”, use the installation folder.
2. Then continue installation of OpenCV.
3. If errors arise in “cvcap_ffmpeg.cpp” like “cvcap_ffmpeg.cpp:250: error: integer constant is too large for ‘long’ type” while executing the makefile of OpenCV you will have to add the following 2 lines of code to the top of file “otherlibs/highgui/cvcap_ffmpeg.cpp”:
#define INT64_C
#define __STDC_CONSTANT_MACROS
build again! If there is still a problem with a pointer (in newer versions of ffmpeg), try to change the line containing
url_fclose(&mywriter->oc->pb);
to:
url_fclose(mywriter->oc->pb);
4. After that, make a symbolic link with “ln -s opencv-1.0.0 opencv”.
5. Do Path Configuration as shown in the second link for both ffmpeg and opencv. Note: if “ldconfig -v” does not work, try “/sbin/ldconfig -v”.
It is done.