ffmpeg opencv 指定,配置和构建OpenCV以自定义FFMPEG安装

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

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

Additionally, I've configured pkgconfig as:

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

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).

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).

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).

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

解决方案

Something like

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/

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值