配置和构建OpenCV以自定义FFMPEG安装 [英] Configure and Build OpenCV to Custom FFMPEG Install

查看:848
本文介绍了配置和构建OpenCV以自定义FFMPEG安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法配置OpenCV链接到FFMPEG库的非/usr/lib集.

I cannot seem to configure OpenCV to link to a non-/usr/lib set of FFMPEG libraries.

我的LD_LIBRARY_PATH包含指向该文件夹的直接链接,用于自定义安装FFMPEG:

My LD_LIBRARY_PATH contains a direct link to the folder for the custom install of FFMPEG:

LD_LIBRARY_PATH=/pathto/ffmpeg-0.10.2/lib

此外,我将pkgconfig配置为:

Additionally, I've configured pkgconfig as:

PKG_CONFIG_PATH=/samepathto/ffmpeg-0.10.2/lib/pkgconfig/

但是在CMake中,我找不到FFMPEG路径的任何设置-无论是基本设置还是自定义设置.与FFMPEG有关的唯一设置似乎是WITH_FFMPEG类型设置(设置为ON).

Within CMake however I cannot find any setting for path to FFMPEG - either in basic or custom. The only setting related to FFMPEG appears to be WITH_FFMPEG type setting (set to ON).

我可以构建OpenCV,但它似乎链接到libavcodec的系统库-这会导致冲突,因为系统库的版本是.52,而我安装的FFMPEG的版本是.53.因此,在没有相同系统库的计算机上链接应用程序似乎无法链接到我的OpenCV自定义安装(特别是libavcodec)(因为我正在将这些库安装在共享的网络文件夹中).

I can build OpenCV but it seems to link to the system libraries for libavcodec - this causes a conflict as the system libraries are version .52 and the version in my install of FFMPEG are .53. Linking an app on a machine without the same system libraries seems to NOT link to my custom install of OpenCV (specifically the libavcodec) because of this (I'm installing these libraries on a shared network folder).

我不确定我的问题是构建并链接到错误的FFMPEG版本,还是构建后与我的环境有关(然后链接到错误的ffmpeg).

I am not sure if my problem is with building and linking to the wrong version of FFMPEG or if it is something with my environment after building (and then linking to the wrong ffmpeg).

我正在Linux,Redhat 6,OpenCV 2.3.1上构建.

I am building on Linux, Redhat 6, OpenCV 2.3.1.

推荐答案

类似

export LD_LIBRARY_PATH=/ffmpeg_install_path/lib/
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/ffmpeg_install_path/lib/pkgconfig
export PKG_CONFIG_LIBDIR=$PKG_CONFIG_LIBDIR:/ffmpeg_install_path/lib/

应该工作.至少它在我的Ubuntu上适用于OpenCV 2.4.x.

should work. At least it works for OpenCV 2.4.x on my Ubuntu.

这篇关于配置和构建OpenCV以自定义FFMPEG安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆