我想在 ubuntu 上安装 ffmpeg。并按照这篇文章http://pasindudps.blogspot.com/2010/12/compiling-ffmpeg-in-ubuntu-1010.html但是当我在配置后做 make 时
Then go to the ffmpeg folder.
cd ffmpeg
Start the installation
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc \
--enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \
--enable-libopencore-amrwb --enable-libtheora --enable-libvorbis \
--enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
make
给出这个错误
/home/reach121/ffmpeg/libavcodec/x86/cabac.h:93: undefined reference to `ff_h264_norm_shift'
/home/reach121/ffmpeg/libavcodec/x86/cabac.h:93: undefined reference to `ff_h264_lps_range'
/home/reach121/ffmpeg/libavcodec/x86/cabac.h:93: undefined reference to `ff_h264_norm_shift'
/home/reach121/ffmpeg/libavcodec/x86/cabac.h:93: undefined reference to `ff_h264_mlps_state'
/home/reach121/ffmpeg/libavcodec/x86/cabac.h:93: undefined reference to `ff_h264_norm_shift'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1
请指出为什么会出现此错误以及如何解决此问题
答案1
Ubuntu 版 ffmpeg 不支持 MP3 等受限格式,但你可以通过安装包含该支持的软件包来解决这个问题。因此,要解决你最初的问题:
清除现有的 ffmpeg 安装(如果有):
sudo apt-get purge ffmpeg
安装 ffmpeg:
sudo apt-get install ffmpeg
要安装受限格式,您需要启用多元宇宙和宇宙存储库。打开文件
/etc/apt/sources.list
:sudo nano /etc/apt/sources.list
并取消注释以
multiverse
和结尾的行universe
。如果没有这样的行,只需将以下内容附加到文件:deb http://archive.ubuntu.com/ubuntu maverick multiverse deb-src http://archive.ubuntu.com/ubuntu maverick multiverse deb http://archive.ubuntu.com/ubuntu maverick-updates multiverse deb-src http://archive.ubuntu.com/ubuntu maverick-updates multiverse deb http://archive.ubuntu.com/ubuntu maverick-security multiverse deb-src http://archive.ubuntu.com/ubuntu maverick-security multiverse deb http://archive.ubuntu.com/ubuntu maverick universe deb-src http://archive.ubuntu.com/ubuntu maverick universe deb http://archive.ubuntu.com/ubuntu maverick-updates universe deb-src http://archive.ubuntu.com/ubuntu maverick-updates universe deb http://archive.ubuntu.com/ubuntu maverick-security universe deb-src http://archive.ubuntu.com/ubuntu maverick-security universe
保存(Ctrl+ o,Enter)并退出(Ctrl+ x)。
现在通过运行以下命令来更新包列表:
sudo apt-get update
安装对 MP3 等受限格式的支持:
sudo apt-get install libavcodec-extra-52
现在就像:
ffmpeg -i in.wav out.mp3
应该管用。