OpenCV-2.3.1 and FFmpeg-2.1.2 compilation and installation on CentOS
Tested environment:
1. CentOS 6.3 32bit
2. CentOS 6.5 64bit
I have installed OpenCV in CentOS 6.3 32bit. For more information, see install OpenCV2.3.1 in CentOS 6.3 (see). Now I have changed the 64 bit system and tried it again.
Check and install related programs to ensure that gtk is successfully installed. Otherwise, the image cannot be displayed.
Yum install gcc-c ++ # g ++ Compilation
Yum install gtk-devel # It is actually gtk-devel, not necessarily gtk-devel. You can use * gtk-devel * to match
Yum install gimp-devel
Yum install gimp-devel-tools
Yum install gimp-help-browser
Yum install zlib-devel
Yum install libtiff-devel # tiff Format Image Support
Yum install libjpeg-devel # jpeg Image Support
Yum install libpng-devel # png Image Support
Yum install gstreamer-devel # process multimedia data in MP3, Ogg, MPEG1, MPEG2, AVI, and other formats
Yum install libavc1394-devel #1394 audio interface control command set
Yum install libraw1394-devel
Yum install libdc1394-devel
Yum install jasper-devel
Yum install jasper-utils
Yum install cmake # A Tool for compiling and building OpenCV
Yum install swig
Yum install python # python Environment Support
Yum install libtool
Yum install nasm # Assembly Tool
Install ffmpeg2.1.2
Ffmpeg does not have ready-made rpm packages for CentOS. Therefore, you must use the source code for compilation and installation,
./Configure -- enable-shared-disable-yasm
Make
Make install
In this case, ffmpeg is installed under/usr/local by default.
Install OpenCV-2.3.1
1.
Use VI to open the cmakelists.txt file, find the following line, and comment it (#)
Set_property (CACHE CMAKE_BUILD_TYPE property strings $ {CMAKE_CONFIGURATION_TYPES })
# Set_property (CACHE CMAKE_BUILD_TYPE property strings $ {CMAKE_CONFIGURATION_TYPES })
2.
Use VI to open the cmakelists.txt file, search for the keyword ffmpeg, and find the corresponding location,
If (EXISTS/usr/include/ffmpeg/libavformat/avformat. hOR HAVE_FFMPEG_SWSCALE)
Make sure that the directory above is/usr/include. If the path is modified when ffmpeg is installed, modify the directory accordingly.
------------------------------------------ Split line ------------------------------------------
Compile FFmpeg in Linux to download and compile the source file
Linux compiling and upgrading FFmpeg
Install FFMPEG on CentOS 5.6
Install FFmpeg in Ubuntu
Install the required OpenCV2.4.1 package in Ubuntu Linux
Install OpenCV2.4.2 on Ubuntu 12.04
OpenCV in CentOS cannot read Video Files
Summary of installing OpenCV 2.4.5 in Ubuntu 12.04
Install OpenCv2.1 in Ubuntu 10.04
------------------------------------------ Split line ------------------------------------------
3.
Go to the main directory of the opencv source code, and execute
Mkdir release
Cd release
Cmake ../
Make
Make install
Wait until the installation is complete. The default installation path is/usr/local /.
For more details, please continue to read the highlights on the next page: