CentOS Compile ffmpeg libx264 not found

CentOS Compile ffmpeg libx264 not found

首先 CentOS make install x264时,只将x264可执行文件install到/usr/local/bin,还需要make install-lib-static

此时./configure --disable-yasm --enable-libx264 --enable-gpl --enable-static --enable-shared还是出现

ERROR: libx264 not found

查看config.log发现:

/ Usr/local/lib/libx264.a (opencl.o): In function `x264_opencl_load_library ':
opencl.c: (. text +0 x411): undefined reference to `dlopen '
opencl.c: (. text +0 x42b): undefined reference to `dlsym '
opencl.c: (. text +0 x448): undefined reference to `dlsym '
opencl.c: (. text +0 x465): undefined reference to `dlsym '
opencl.c: (. text +0 x482): undefined reference to `dlsym '
opencl.c: (. text +0 x49f): undefined reference to `dlsym '

### 此时增加--extra-ldflags=-ldl 支持动态链接装入器libdl(它有4个库函数 dlopen, dlerror, dlsym, dlclose)

./configure --disable-yasm --enable-libx264 --enable-gpl --enable-static --enable-shared --extra-ldflags=-ldl
configure成功。
 

使用库时注意顺序(在Mac上没有出现这种引用顺序问题),

LIBS += /usr/local/lib/libavformat.a
LIBS += /usr/local/lib/libavdevice.a
LIBS += /usr/local/lib/libavcodec.a
LIBS += /usr/local/lib/libavutil.a
LIBS += /usr/local/lib/libx264.a


否则会出现错误:

/usr/local/lib/libavformat.a(allformats.o): In function `av_register_all':
allformats.c:(.text+0x1b): undefined reference to `avcodec_register_all'

ac3dec.c:(.text+0x112): undefined reference to `ff_ac3_parse_header'
/usr/local/lib/libavformat.a(adtsenc.o): In function `ff_adts_decode_extradata':
adtsenc.c:(.text+0x68): undefined reference to `ff_mpeg4audio_get_config'
adtsenc.c:(.text+0x175): undefined reference to `ff_copy_pce_data'
/usr/local/lib/libavformat.a(aiffdec.o): In function `aiff_read_header':
aiffdec.c:(.text+0x5de): undefined reference to `av_get_bits_per_sample'

/usr/local/lib/libavformat.a(utils.o): In function `ff_add_index_entry.clone.2':
utils.c:(.text+0x48d8): undefined reference to `av_fast_realloc'
/usr/local/lib/libavformat.a(utils.o): In function `av_new_stream':
utils.c:(.text+0x4c37): undefined reference to `avcodec_alloc_context'
/usr/local/lib/libavformat.a(utils.o): In function `ff_interleave_add_packet.clone.3':
utils.c:(.text+0x553e): undefined reference to `av_dup_packet'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值