操作前请添加快照!!!
相关环境
apt install nasm
apt install git
apt install gcc
apt install make
apt install make-guile
apt-cdrom add
apt-get update
apt-get install build-essential
apt install pkg-config
apt install cmake-curses-gui
安装 libx264
cd ~
git clone http://git.videolan.org/git/x264.git
cd x264
./configure --enable-shared
#第一次安装执行如下命令:
$ make && sudo make install
#如果安装过执行如下命令:
$ sudo make clean && make && sudo make install
whereis libx264.so
安装 libx265
cd ~
git clone https://gitee.com/zekelu/x265.git
cd x265/build/linux
./make-Makefiles.bash
#第一次安装执行如下命令:
$ make && sudo make install
#如果安装过执行如下命令:
$ sudo make clean && make && sudo make install
安装 libfdk-aac
cd ~
wget https://downloads.sourceforge.net/opencore-amr/fdk-aac-2.0.2.tar.gz
tar zxvf fdk-aac-2.0.2.tar.gz
cd fdk-aac-2.0.2
./configure --disable-static
#第一次安装执行如下命令:
$ make && sudo make install
#如果安装过执行如下命令:
$ sudo make clean && make && sudo make install
whereis libfdk-aac.so
安装 libass
# 安装freetype依赖
apt-get install python3.7
apt install python3-pip
python3 -m pip install docwriter
cd ~
wget https://downloads.sourceforge.net/freetype/freetype-2.12.0.tar.xz
tar -xvJf freetype-2.12.0.tar.xz
cd freetype-2.12.0
./configure --enable-freetype-config --disable-static
make && make install
# 安装FriBidi依赖
cd ~
wget https://github.com/fribidi/fribidi/releases/download/v1.0.11/fribidi-1.0.11.tar.xz
tar -xvJf fribidi-1.0.11.tar.xz
cd fribidi-1.0.11
./configure
make && make install
# 安装Fontconfig依赖
cd ~
wget https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.14.0.tar.xz
tar -xvJf fontconfig-2.14.0.tar.xz
cd fontconfig-2.14.0
./configure -disable-docs
make && make install
# 报错:WARNING: 'gperf' is missing on your system.
apt-get install gperf
# 安装libass
git clone https://github.com/libass/libass.git
cd libass
./autogen.sh
./configure --disable-static
make && make install
# 报错:config.status: error: cannot find input file: `Makefile.in
# libtoolize --automake --copy --debug --force
aclocal
automake --add-missing
make clean
# 参考:https://www.wandouip.com/t5i26269/
安装 ffmpeg
cd ~
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-nonfree --enable-version3 --enable-libass --enable-pic --enable-shared --enable-libx264 --enable-libx265 --enable-libfdk-aac
#第一次安装执行如下命令:
$ make && sudo make install
#如果安装过执行如下命令:
$ sudo make clean && make && sudo make install
whereis ffmpeg
报错:ERROR: libass >= 0.11.0 not found using pkg-config
直接恢复快照!从头安装!
vi /etc/ld.so.conf
/usr/local/lib/ //下方追加并保存
ldconfig
#查看版本
ffmpeg -version
ffmpeg -h encoder=libx264
ffmpeg -h encoder=libx265