linux下Intel-FFmpeg-Plugin遇到libmfx not found using pkg-config问题

80 篇文章 1 订阅
46 篇文章 0 订阅

https://www.jianshu.com/p/a243afcdeec1

参照https://github.com/Intel-FFmpeg-Plugin/Intel_FFmpeg_plugins/wiki, 在linux下编译intel版本的ffmpeg时,

[root@localhost project]# git clone https://github.com/Intel-FFmpeg-Plugin/Intel_FFmpeg_plugins.git
Cloning into 'Intel_FFmpeg_plugins'...
remote: Counting objects: 527303, done.
remote: Total 527303 (delta 0), reused 0 (delta 0), pack-reused 527303
Receiving objects: 100% (527303/527303), 193.22 MiB | 214.00 KiB/s, done.
Resolving deltas: 100% (410506/410506), done.

[root@localhost project]# cd Intel_FFmpeg_plugins/

[root@localhost Intel_FFmpeg_plugins]# git checkout origin/qsv-3.2.2 -b 3.2.2
Branch 3.2.2 set up to track remote branch qsv-3.2.2 from origin.
Switched to a new branch '3.2.2'

FFMPEG 中使用 libmfx 实现 intel qsv 的硬件编码器,如果想要编译它的硬件编码器,所以如果想要编译这个硬件编码器,你需要在加入如下的配置选项:

./configure --enable-libmfx

执行configure时遇到了以下问题:

[root@localhost Intel_FFmpeg_plugins]# ./configure --enable-libmfx
ERROR: libmfx not found using pkg-config

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solve the problem.

如何解决呢?

(1) /opt/intel/mediasdk/include中新建文件夹mfx,并把所有.h拷贝到该文件夹中。
(2) mkdir -p /opt/intel/mediasdk/lib64/pkgconfig
(3) 建立libmfx.pc文件,内容如下:

prefix=/opt/intel/mediasdk
exec_prefix=/opt/intel/mediasdk/
libdir=${prefix}/lib/lin_x64/
includedir=${prefix}/include/
Name: libmfx
Description: mfx
Version: 1.0.0
Cflags: -I${includedir} 
Libs: -L${libdir} -lmfx -ldl -lstdc++ -lrt -lva -lva-drm
Libs.private: -lstdc++ -ldl

并将其拷贝到以下目录:

cp libmfx.pc /opt/intel/mediasdk/lib64/pkgconfig
cp libmfx.pc /usr/lib64/pkgconfig

(4) 添加环境变量。

在.bashrc中添加
export MFX_HOME=/opt/intel/mediasdk/
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig/

然后再去执行configure即可。
然后make,接着make install。

可用以下语句验证是否成功。

[root@localhost Intel_FFmpeg_plugins]# ffmpeg -codecs | grep qsv
ffmpeg version n3.2.2-59-g94c76be Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11)
  configuration: --enable-libmfx
  libavutil      55. 34.100 / 55. 34.100
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.100 / 57. 56.100
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
 DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_qsv ) (encoders: h264_nvenc h264_qsv h264_vaapi nvenc nvenc_h264 )
 DEV.L. hevc                 H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_qsv ) (encoders: nvenc_hevc hevc_nvenc hevc_qsv hevc_vaapi )
 DEVIL. mjpeg                Motion JPEG (decoders: mjpeg mjpeg_qsv ) (encoders: mjpeg mjpeg_qsv mjpeg_vaapi )
 DEV.L. mpeg2video           MPEG-2 video (decoders: mpeg2video mpegvideo mpeg2_qsv ) (encoders: mpeg2video mpeg2_qsv )
 D.V.L. vc1                  SMPTE VC-1 (decoders: vc1 vc1_qsv )

References:

https://github.com/Intel-FFmpeg-Plugin/Intel_FFmpeg_plugins/wiki
https://blog.csdn.net/LeoChen1983/article/details/72742656



作者:FlyingPenguin
链接:https://www.jianshu.com/p/a243afcdeec1
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值