ffmpeg安装报错Unknown encoder 'libmp3lame'

ffmpeg -i inputFile.m4a -c:a libmp3lame -b:a 128k Oufile.mp3
报错:Unknown encoder ‘libmp3lame’
尝试过以下几种方式进行解决,方式三,可行。

方式一:Ubuntu Multimedia for Trusty

sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install ffmpeg

方式二:采用源代码的方式安装

tar -xvf ffmpeg.tar.bz2
./configure --prefix=/usr --enable-gpl --enable-shared --enable-libmp3lame --enable-libvorbis --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-x86asm --enable-version3 --enable-gpl --enable-libx264 --enable-libmp3lam
make
make install

这种方式依然不行。

方式三:直接download a recent static build (scroll down where it says Linux Static Builds),下载网址https://johnvansickle.com/ffmpeg/

cd ~/Downloads
tar xvf ffmpeg-*.tar.xz
cd !$
sudo mkdir -p /usr/local/bin
sudo cp ./ffmpeg ./ffprobe /usr/local/bin/
sudo chmod ugo+x /usr/local/bin/ffmpeg /usr/local/bin/ffprobe

这种方式,最方便,别人直接将编译安装好的文件给你了,不用去安装各种编码格式的包了。另外,想起跟这种方式很接近的一种,Anaconda,与之类似,在深度学习过程中,也是需要安装python的各种环境,而且一些依赖之间可能还会产生冲突,然后Anaconda就将安装好的依赖,以及python,打包提供下载,很方便。
特别说明:此部分,主要来源于https://superuser.com/questions/831473/unknown-encoder-libmp3lame-in-ubuntu-14-04

另外,也有尝试方式四进行,但是没有效果,还是方式三可行。
方式四:

sudo apt-get install libavcodec-extra-53  
sudo aptitude install ubuntu-restricted-extras

来源网页:
https://askubuntu.com/questions/398731/an-error-with-youtube-dl

附:我刚开始是采用源码安装,参考下面两个网页
1.https://www.jianshu.com/p/a5c76a429091
2.https://blog.csdn.net/NCTU_to_prove_safety/article/details/70851575

猜你喜欢

转载自blog.csdn.net/yangyangrenren/article/details/80042419