赞
踩
系统环境:Ubuntu18.0.4;
本文安装:nasm-2.14.02+x264-master+opencv3.4.12;
下文已附软件下载网址,也可使用文中使用到的所有安装包网盘链接: https://pan.baidu.com/s/13NBcy_0Fuxgua8z7hjmhRw 提取码: lgib
1、下载x264:http://www.videolan.org/developers/x264.html
2、需要先安装nasm,下载地址:https://www.nasm.us/
终端依次执行以下命令:
tar -xvf nasm-2.14.02.tar.gz
cd nasm-2.14.02/
sudo apt-get install gcc
./configure
sudo apt-get install make
make
sudo make install
sudo apt install make-guile
3、安装x264
终端依次执行以下命令:
cd x264-master/
./configure --enable-shared --enable-static
make
sudo make install
下载:https://opencv.org/releases/
终端依次执行以下命令:
##解压
tar xf opencv3.4.12.tar
##进入目录
cd opencv3.4.12/
##安装依赖库
sudo apt-get install gcc g++ cmake pkg-config build-essential
sudo apt install libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev
sudo apt install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
##安装libjasper-dev依赖库
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev
mkdir build
cd build
##根据分配给虚拟机的内核数目,自定义make -j*,提高编译速度;不清楚则执行make
make -j2 ##漫长等待
sudo make install
##打开/etc/ld.so.conf文件
sudo open /etc/ld.so.conf
添加opencv库的路径,在最后一行写入:/usr/local/lib
解决:
参考:https://blog.csdn.net/qq_44830040/article/details/105961295
终端依次执行以下命令:
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev
1、下载的opencv压缩包不完整,最好在官网上下载:https://opencv.org/releases/
2、编译过程中出现网络问题,则需再尝试一次
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。