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]

编译完成:

相关推荐
jndingxin6 分钟前
OpenCV相机标定与3D重建(1)概述
数码相机·opencv·3d
hunandede2 小时前
FFmpeg 4.3 音视频-多路H265监控录放C++开发十三:将AVFrame转换成AVPacket。视频编码,AVPacket 重要函数,结构体成员学习
c++·ffmpeg·音视频
橘子味的茶二2 小时前
SDL读取PCM音频
ffmpeg·音视频·pcm
凤枭香17 小时前
Python OpenCV 傅里叶变换
开发语言·图像处理·python·opencv
ctrey_18 小时前
2024-11-4 学习人工智能的Day21 openCV(3)
人工智能·opencv·学习
可均可可19 小时前
C++之OpenCV入门到提高004:Mat 对象的使用
c++·opencv·mat·imread·imwrite
EasyCVR19 小时前
EHOME视频平台EasyCVR视频融合平台使用OBS进行RTMP推流,WebRTC播放出现抖动、卡顿如何解决?
人工智能·算法·ffmpeg·音视频·webrtc·监控视频接入
蒙娜丽宁19 小时前
《Python OpenCV从菜鸟到高手》——零基础进阶,开启图像处理与计算机视觉的大门!
python·opencv·计算机视觉
plmm烟酒僧20 小时前
Windows下QT调用MinGW编译的OpenCV
开发语言·windows·qt·opencv
AI小杨20 小时前
【车道线检测】一、传统车道线检测:基于霍夫变换的车道线检测史诗级详细教程
人工智能·opencv·计算机视觉·霍夫变换·车道线检测