我已经处理这个问题很长时间了。我编译了一个由这个提供的 ffmpeg 补丁版本公司。
每当我通过 apt-get 安装 mplayer 时,就会出现问题。在安装之前,ffmpeg 可以正常工作,这里我为您提供正常的 ffmpeg 输出以及一些编译详细信息:
FFmpeg version git-N-28463-gc5dcb3d, Copyright (c) 2000-2011 the FFmpeg developers
built on Mar 1 2012 17:09:15 with gcc 4.5.2
configuration: --enable-libfmp4 --enable-nonfree --enable-librtmp --enable-libx264 --enable-gpl --enable-version3 --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libxvid --enable-x11grab --enable-swscale --enable-shared
libavutil 50. 39. 0 / 50. 39. 0
libavcodec 52.114. 0 / 52.114. 0
libavformat 52.103. 0 / 52.103. 0
libavdevice 52. 3. 0 / 52. 3. 0
libavfilter 1. 76. 0 / 1. 76. 0
libswscale 0. 12. 0 / 0. 12. 0
libpostproc 51. 2. 0 / 51. 2. 0
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Use -h to get full help or, even better, run 'man ffmpeg'
现在如果我安装 mplayer:
$ sudo apt-get install mplayer
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libtorque2 libgdcm2.0 libxcb-keysyms1 libopenmpi1.3 libgl2ps0 libcddb2 libdvbpsi6 libupnp3 libxcb-randr0 libiso9660-7 libnuma1 libibverbs1 libtar
libvcdinfo0 libebml3 libmatroska3 libsdl-image1.2
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libavcodec52 libavformat52 libavutil50 libpostproc51 libswscale0
Suggested packages:
mplayer-doc netselect fping
The following NEW packages will be installed:
libavcodec52 libavformat52 libavutil50 libpostproc51 libswscale0 mplayer
0 upgraded, 6 newly installed, 0 to remove and 45 not upgraded.
Need to get 0 B/8,592 kB of archives.
After this operation, 19.0 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Selecting previously deselected package libavutil50.
(Reading database ... 229546 files and directories currently installed.)
Unpacking libavutil50 (from .../libavutil50_4%3a0.6.4-0ubuntu0.11.04.1_i386.deb) ...
Selecting previously deselected package libavcodec52.
Unpacking libavcodec52 (from .../libavcodec52_4%3a0.6.4-0ubuntu0.11.04.1_i386.deb) ...
Selecting previously deselected package libavformat52.
Unpacking libavformat52 (from .../libavformat52_4%3a0.6.4-0ubuntu0.11.04.1_i386.deb) ...
Selecting previously deselected package libpostproc51.
Unpacking libpostproc51 (from .../libpostproc51_4%3a0.6.4-0ubuntu0.11.04.1_i386.deb) ...
Selecting previously deselected package libswscale0.
Unpacking libswscale0 (from .../libswscale0_4%3a0.6.4-0ubuntu0.11.04.1_i386.deb) ...
Selecting previously deselected package mplayer.
Unpacking mplayer (from .../mplayer_2%3a1.0~rc4.dfsg1-1ubuntu3_i386.deb) ...
Processing triggers for man-db ...
Setting up libavutil50 (4:0.6.4-0ubuntu0.11.04.1) ...
Setting up libavcodec52 (4:0.6.4-0ubuntu0.11.04.1) ...
Setting up libavformat52 (4:0.6.4-0ubuntu0.11.04.1) ...
Setting up libpostproc51 (4:0.6.4-0ubuntu0.11.04.1) ...
Setting up libswscale0 (4:0.6.4-0ubuntu0.11.04.1) ...
Setting up mplayer (2:1.0~rc4.dfsg1-1ubuntu3) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Mplayer 现已正确安装,但调用 ffmpeg 可执行文件时我得到:
ffmpeg
ffmpeg: relocation error: /usr/local/lib/libavfilter.so.1: symbol av_expr_free, version LIBAVUTIL_50 not defined in file libavutil.so.50 with link time reference
经过谷歌搜索,我发现删除一些库可以解决问题,所以我这样做:
$ sudo apt-get purge libavutil-dev libavutil50 libavutil-extra-50
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libavutil-dev is not installed, so not removed
Package libavutil-extra-50 is not installed, so not removed
The following packages were automatically installed and are no longer required:
libopenal1 libtorque2 libgdcm2.0 libxcb-keysyms1 libbluray0 libsvga1 libopenmpi1.3 libgl2ps0 libcddb2 libdvbpsi6 libupnp3 liblzo2-2 libxcb-randr0
libiso9660-7 libnuma1 libibverbs1 libtar libvcdinfo0 libebml3 libmatroska3 libsdl-image1.2
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
libavcodec52* libavformat52* libavutil50* libpostproc51* libswscale0* mplayer*
0 upgraded, 0 newly installed, 6 to remove and 45 not upgraded.
After this operation, 19.0 MB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 229649 files and directories currently installed.)
Removing mplayer ...
Purging configuration files for mplayer ...
Removing libavformat52 ...
Purging configuration files for libavformat52 ...
Removing libavcodec52 ...
Purging configuration files for libavcodec52 ...
Removing libswscale0 ...
Purging configuration files for libswscale0 ...
Removing libpostproc51 ...
Purging configuration files for libpostproc51 ...
Removing libavutil50 ...
Purging configuration files for libavutil50 ...
Processing triggers for man-db ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
但当然,这会删除 mplayer。所以看起来我必须在两者之间做出选择,而且我实际上需要同时使用这两种工具。有办法解决这个问题吗?有人能给我解释一下这个问题吗?
提前致谢
纳尔逊·R·佩雷斯
答案1
您是否尝试过先安装 mplayer,然后再安装 ffmpeg?看起来 mplayer 使用的共享库版本与 ffmpeg 不同,设置这些依赖关系的聪明人可能已经解决了这个问题!
如果失败了,我会先安装你的 mplayer,然后从源代码构建 ffmpeg 以确保它们都能正常工作。