【FFMPEG系列】FFMPEG linux下集成x264

FFMPEG集成x264

1.x264下載地址:
http://download.videolan.org/pub/videolan/x264/snapshots/
2. FFMPEG引入外部庫x264方法
https://www.cnblogs.com/wanggang123/p/8660435.html

FFMPEG引入x264時出現的問題
FFMPEG引入外部x264在./configure時出現以下問題:
gcc -L./x264 -Wl,–as-needed -o /tmp/ffconf.ZNG31130 /tmp/ffconf.xCt31136.o -lx264 -lm -lbz2 -lz -pthread -lrt
./x264/libx264.a(opencl.o): In function x264_opencl_close_library': opencl.c:(.text+0x572): undefined reference todlclose’
./x264/libx264.a(opencl.o): In function x264_opencl_load_library': opencl.c:(.text+0x5d7): undefined reference todlopen’
opencl.c:(.text+0x5f1): undefined reference to dlsym' opencl.c:(.text+0x60e): undefined reference todlsym’
opencl.c:(.text+0x62b): undefined reference to dlsym' opencl.c:(.text+0x648): undefined reference todlsym’
opencl.c:(.text+0x665): undefined reference to dlsym' ./x264/libx264.a(opencl.o):opencl.c:(.text+0x682): more undefined references todlsym’ follow
./x264/libx264.a(opencl.o): In function x264_opencl_load_library': opencl.c:(.text+0x8fd): undefined reference todlclose’
./x264/libx264.a(opencl.o): In function x264_opencl_lookahead_init': opencl.c:(.text+0x1841): undefined reference todlopen’
opencl.c:(.text+0x185b): undefined reference to dlsym' opencl.c:(.text+0x186d): undefined reference todlsym’
opencl.c:(.text+0x1881): undefined reference to dlsym' opencl.c:(.text+0x1895): undefined reference todlsym’
opencl.c:(.text+0x18d4): undefined reference to `dlclose’
collect2: ld returned 1 exit status

解決方法
在GUI配置相應項或makefile裏面的gcc命令行中添加-ldl,如:

../configure --enable-static --enable-libx264 --enable-gpl --disable-x86asm --prefix=/home/wgg/compile/ffmpeg/static --extra-cflags="-I/home/wgg/work/compile/x264/static/include" --extra-ldflags="-L/home/wgg/work/compile/x264/static/lib -ldl" 

參考網址:https://bbs.csdn.net/topics/390842477

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章