1、安装ffmpeg2.1.8
1.1 到官网下载对应版本的ffmpeg2.1.8,http://www.ffmpeg.org/olddownload.html去相应界面下载
下面的所有安装基于已经将$HOME/local/bin和$HOME/local/lib加入到环境变量中了
1.2安装ffmpeg2.1.8
具体步骤:tar -jxvf ffmpeg-2.1.8.tar.bz2
cd ./ffmpeg-2.1.8
./configure --enable-shared --enable-swscale --enable-gpl --prefix = $HOME/local
此时如果出错(yasm/nasm not found or too old. Use --disable-yasm for a crippled build.),需要安装yasm
安装步骤:
(tar zxvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure --prefix=$HOME/local
make
make install )
make -j8
make install -j8
1.3 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/local/lib/pkgconfig
1.4 opencv2.4.8
tar zxvf opencv-2.4.8.tar.gz
cd opencv-2.4.8
mkdir release && cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=$HOME/local -D BUILD_opencv_gpu=OFF -D CUDA_GENERATION=Kepler -D PYTHON_LIBRARY=$HOME/local/anaconda/bin ..
(运行完之后是这样的信息才可以保证安装成功)
make -j8
make install
1.5安装完毕,如果安装有错,可能是安装包版本不匹配