WSL Opencv with_ffmpeg conan1.60.0

我是ubuntu18.

self.options"opencv".with_ffmpeg = True

关键是gcc版本需要conan支持,比如我的是:

compiler=gcc

compiler.version=7.5

此外还需要安装系统所需库:
https://qq742971636.blog.csdn.net/article/details/132559789

甚至来说,可以装一些系统编译好的,免得没有系统文件:

复制代码
sudo apt-get install build-essential
sudo apt install ffmpeg --fix-missing
sudo apt-get install pkg-config
sudo apt install libopencv-dev

conanfile.py

复制代码
from conans import ConanFile, CMake


class PhotoTranslateConan(ConanFile):
    name = "video_deidentification"
    license = ""
    url = "https://gitlab.upuphone.com/ai-group/client/sdk/public/computer_vision/video_deidentification.git"
    description = "video_deidentification"
    topics = ("video_deidentification")
    settings = "os", "compiler", "build_type", "arch"
    options = {"shared": [True, False], "fPIC": [True, False]}
    default_options = {"shared": True, "fPIC": True}
    generators = "cmake", "virtualenv"

    _cmake = None

    def requirements(self):
        self.requires("fmt/9.1.0") # spdlog需求
        self.requires("jsoncpp/1.9.5")
        self.requires("spdlog/1.11.0")
        self.requires("eigen/3.3.9")
        # self.requires("gtest/cci.20210126")
        # self.requires("boost/1.70.0")
        # self.requires("cpp-httplib/0.11.3")
        # self.requires("openssl/3.0.7")
        if self.settings.os != "Android":
            self.requires("opencv/4.5.5")

    def configure(self):
        if self.settings.os == "Windows":
            del self.options.fPIC

        if self.settings.os == "Windows":
            self.options["opencv"].with_ffmpeg = False

        if self.settings.os == "Linux":
            # print("######################", self.options["opencv"].with_ffmpeg)
            self.options["opencv"].with_ffmpeg = True
            self.options["opencv"].shared = False
            self.options["opencv"].contrib = False
            self.options["opencv"].contrib_freetype = False
            self.options["opencv"].with_gtk = False

    def build(self):
        cmake = self._configure_cmake()
        cmake.build()
        cmake.install()

    def _configure_cmake(self):
        if self._cmake:
            return self._cmake
        self._cmake = CMake(self)
        # 判断arch是否为armv7、x86
        if self.settings.arch == "armv7" or self.settings.arch == "x86":
            self._cmake.definitions["USE_32BIT"] = True
        self._cmake.configure()
        return self._cmake

conan profile

复制代码
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=7.5
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]

编译完成:

相关推荐
小鹿研究点东西1 天前
直播带货长视频AI自动剪辑开播:一场直播如何反复利用?
ffmpeg·自动化·音视频·语音识别
_李小白1 天前
【android opencv学习笔记】Day 32:直线检测之霍夫变换
android·opencv·学习
程序员正茂2 天前
EasyAR使用OpenCV下USB摄像头作为自定义相机
opencv·unity·easyar
_李小白2 天前
【android opencv学习笔记】Day 31:提取轮廓之Canny算法
android·opencv·学习
luoyayun3612 天前
Qt + FFmpeg 实战:获取音视频文件基础属性、流信息和元数据
qt·ffmpeg·音视频·元数据·获取音视频文件属性
Rudon滨海渔村2 天前
ffmpeg裁剪视频黑屏、不准时等处理方式 - ffmpeg基本操作
ffmpeg·音视频
点云兔子2 天前
舱口检测:从点云到矩形定位的射线投影算法
opencv·算法·点云·舱口检测
蝈蝈Tjguo2 天前
opencv 与摄影测量 相机坐标系的区别
人工智能·数码相机·opencv
盼小辉丶2 天前
OpenCV-Python实战(26)——复杂场景下的实时物体检测与跟踪
python·opencv·计算机视觉
咸鱼翻身小阿橙2 天前
在VScode使用C#并且调用opencv库
vscode·opencv·c#