2020年9月

OpenVC 4.4 on CentOS7

yum groupinstall "Development Tools" -y
yum install cmake gcc gtk2-devel numpy pkconfig cmake3 -y
wget https://github.com/opencv/opencv/archive/4.4.0.zip
unzip 4.4.0.zip
cd opencv-4.4.0
mkdir build
cd build
cmake3 -D CMAKE_BUILD_TYPE=DEBUG -D WITH_FFMPEG=ON -D OPENCV_GENERATE_PKGCONFIG=ON -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j 8 && make install
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib64/pkgconfig/
echo '/usr/local/lib64/' >> /etc/ld.so.conf.d/opencv.conf
ldconfig

如果ffmpeg从源码编译 需要在编译时开启--enable-shared参数