ubuntu20.04自带的ffmpeg不带amr,要自己重新编译加入amr_nb

下载

yasm-1.3.0.tar.gz:The Yasm Modular Assembler Project,
opencore-amr-0.1.5.tar.gz: Audio codecs extracted from Android Open Source Project,
lame-3.99.5.tar.gz:A high quality MP3 encoder,
amrnb-11.0.0.0.tar.bz2,
amrwb-11.0.0.0.tar.bz2
ffmpeg-snapshot.tar.bz2

解压

tar jxvf amrnb-11.0.0.0.tar.bz2
tar jxvf amrwb-11.0.0.0.tar.bz2
tar jxvf ffmpeg-snapshot.tar.bz2
tar -zxvf lame-3.99.5.tar.gz
tar -zxvf opencore-amr-0.1.5.tar.gz
tar -zxvf yasm-1.3.0.tar.gz

安装

# 安装yasm
cd yasm-1.3.0
./configure  && make && make install
cd ..

#安装lame
cd lame-3.99.5
./configure  && make  && make install
cd ..

#安装opencore-amr
cd opencore-amr-0.1.5
./configure  && make  && make install
cd ..

#安装amrwb
cd amrwb-11.0.0.0
./configure  && make  && make install
cd ..

#安装amrnb
cd amrnb-11.0.0.0
./configure  && make  && make install
cd ..

#安装ffmpeg
ldconfig -v
cd ffmpeg
./configure --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-shared --disable-x86asm
make && make install
ln -s /usr/local/bin/ffmpeg /usr/bin/ffmpeg
ldconfig -v


终端输入 ffmpeg 显示下图
image
完事

出现问题&解决

  1. 安装时出现configure: error: C++ compiler cannot create executables:sudo apt install g++
  2. 安装时出现configure: error: C compiler cannot create executables:sudo apt install libc6-dev

其他

git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg/
apt install yasm pkg-config libopencore-amrnb-dev libopencore-amrwb-dev
./configure --enable-gpl --enable-version3 --enable-nonfree --disable-ffplay --disable-ffprobe --enable-libopencore-amrnb --enable-libopencore-amrwb
make
make install