1.修改安装源:
sudo vim /etc/apt/sources.list
改为
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
更新
apt upgrade
2.安装必要库
apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libfaad-dev libMP3lame-dev libsdl1.2-dev libtheora-dev libx11-dev zlib1g-dev
3.安装SDL
apt-get install libsdl1.2-dev
apt-get install libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl-gfx1.2-dev
4.安装YASM
git clone git://github.com/yasm/yasm.git
cd yasm-1.2.0
./configure
make
make install
5.安装x264
1)首先安装nasm
wget https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.gz
tar -zxvf nasm-2.13.03.tar.gz
cd nasm-2.13.03
./configure
make
make install
2)安装x264
git clone https://code.videolan.org/videolan/x264.git
cd x264
./configure --enable-static --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib
make
make install
6.安装FFMpeg
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./configure --enable-static --enable-gpl --enable-libx264 --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib
make
make install
正常情况下,可以成功安装了。