relocation error: /usr/lib/libswresample.so.1: symbol av_calloc, version LIBAVUTIL_54 not defined i

来源:互联网 发布:java中的设计模式ppt 编辑:程序博客网 时间:2024/05/29 11:47
* 下载ffmpeg和x264的源码

这个自己google

* 配置文件选项

./configure --enable-shared --enable-shared --enable-gpl --enable-nonfree --enable-x11grab --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid

错误列表及解决:

* 缺少libXXX的错误

查找并安装apt-get install libXXX
* 更新libx264的版本
Ubuntu默认安装的libx264-dev的版本不能在最新的ffmpeg中使用,因此需要更新libx264的版本。
** 删除libx264-dev 
sudo apt-get remove x264 libx264-dev
** 下载最新的x264源代码并编译
./configure --enable-static
make
**  安装x264的过程将会安装相应的库
make install

* 其他错误
** error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory
this error usually comes when ldconfig does not know where to search for the libraries, so, in order to help it out,  on my fedora/centos systems, i did the following:
cd /etc/ld.so.conf.d
add another file:  custom-libs.conf
inside, put :
/usr/local/lib
save,
then do ldconfig

** "ffmpeg: relocation error: /usr/local/lib/libswresample.so.0: symbol av_get_default_channel_layout, version LIBAVUTIL_51 not defined in file libavutil.so.51 with link time reference"

通过locate libavutil.so.51可以知道系统中不止存在一个此库,并使用ldd `which ffmpeg`查看ffmpeg使用了哪一个库文件,猜想是由于没有加载正确的库文件造成的,因此采用上一个错误的解决方法,问题解决。

version LIBAVUTIL_51 not defined in file

通过locate libavutil.so.51可以知道系统中不止存在一个此库,并使用ldd `which ffmpeg` | grep 
libavutil.so.51
查看ffmpeg使用了哪一个库文件,
猜想是由于没有加载正确的库文件造成的,因此采用上一个错误的解决方法,问题解决。删掉指向错误的so文件,将编译出的so文件拷贝至该地方。

 

解决linux下so loading error

 

./tests: error while loading shared libraries: xxx.so.0:cannot open shared object file: No such file or directory那就表示系統不知道xxx.so 放在哪個目錄下。這個時候就要在/etc/ld.so.conf中加入xxx.so所在的目錄。 一般而言,有很多so檔會在/usr/local/lib這個目錄下,所以在/etc/ld.so.conf中加入/usr/local/lib這一行,可以解決此問題。將 /etc/ld.so.conf存檔後,還要執行「/sbin/ldconfig –v」來更新一下才會生效。

0 0
原创粉丝点击