linux下ffmpeg安装时ERROR: libx264 not found 错误解决

一、下图是产生错误的,命令:

[root@CentOS7 ffmpeg]# ./configure --prefix=/usr/ffmpeg --enable-shared --enable-yasm --enable-libx264 --enable-gpl --extra-cflags=-l/usr/x264/include --extra-ldflags=-L/usr/x264/lib

报出的错误:

ERROR: libx264 not found

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 "ffbuild/config.log" produced by configure as this will help
solve the problem.

根据提示去查看错误的日志,日志存放的地址如上已经指出ffbuild/config.log。
二、查看具体的错误信息:
在这里插入图片描述如图:

check_pkg_config libx264 x264 stdint.h x264.h x264_encoder_encode
test_pkg_config libx264 x264 stdint.h x264.h x264_encoder_encode
pkg-config --exists --print-errors x264
Package x264 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x264.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x264' found

以上告诉你没有找到pkg-config这个文件夹,所以也就不存在x264.pc这个命令。
接下来我们看一下为什么找不到这个文件夹,明明参数–extra-ldflags=-L/usr/x264/lib都指定了,到x264下看看;
在这里插入图片描述
发现安装x264的pkgconfig不叫pkg-config,由于不知道什么原因也不敢乱改怕有不可知的影响,仔细读报错发现一个变量名PKG_CONFIG_PATH,这就好办了,编辑/etc/profile这个文件添加这个变量:

export PKG_CONFIG_PATH=$X264_HOME/lib/pkgconfig

然后保存,执行

source /etc/profile

再次切换到ffmpeg下执行./configure…那些命令,发现好了!

  • 10
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值