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]

编译完成:

相关推荐
xmRao6 小时前
Qt+FFmpeg 实现 PCM 音频转 AAC 编码
qt·ffmpeg·pcm
xmRao6 小时前
Qt+FFmpeg 实现录音程序(pcm转wav)
qt·ffmpeg
勾股导航6 小时前
OpenCV图像坐标系
人工智能·opencv·计算机视觉
格林威6 小时前
Baumer相机玻璃制品裂纹自动检测:提高透明材质检测精度的 6 个关键步骤,附 OpenCV+Halcon 实战代码!
人工智能·opencv·视觉检测·材质·工业相机·sdk开发·堡盟相机
没有不重的名么1 天前
Multiple Object Tracking as ID Prediction
深度学习·opencv·计算机视觉·目标跟踪
愚者游世1 天前
Opencv知识点大纲
人工智能·opencv·计算机视觉
格林威1 天前
Baumer相机电池极耳对齐度检测:提升叠片工艺精度的 5 个实用方案,附 OpenCV+Halcon 实战代码!
人工智能·opencv·机器学习·计算机视觉·视觉检测·工业相机·堡盟相机
403240731 天前
【Jetson开发避坑】虚拟环境(Conda/Venv)调用系统底层OpenCV与TensorRT的终极指南
人工智能·opencv·conda
格林威1 天前
Baumer相机电机转子偏心检测:实现动平衡预判的 5 个核心方法,附 OpenCV+Halcon 实战代码!
人工智能·深度学习·opencv·机器学习·计算机视觉·视觉检测·工业相机
侯孟禹1 天前
Gemini写的抠图工具
qt·opencv