1 下載所需要的軟體
mkdir /usr/local/soft
cd /usr/local/soft
wget https://www.ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
freetype 下載地址 http://www.linuxfromscratch.org/blfs/view/svn/general/freetype2.html
fribidi 下載地址
http://www.linuxfromscratch.org/blfs/view/svn/general/fribidi.html
fontconfig 下載地址
http://www.linuxfromscratch.org/blfs/view/svn/general/fontconfig.html
harfbuzz 下載地址
https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.2.7.tar.bz2
https://www.octfgroup.com/
2 軟體安裝
yasm 安裝
tar -zxvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure --prefix=/usr/local/yasm
make
make install
配置環境變數
vim /etc/profile
export YASM=/usr/local/yasm
export PATH=${YASM}/bin:${PATH}
source /etc/profile
#檢視版本 測試是否安裝成功
yasm --version
nasm 安裝
wget http://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2
tar -jxvf nasm-2.14.02.tar.bz2
cd nasm-2.14.02
./configure --prefix=/usr/local/nasm
make
make install
#配置環境變數
export NASM=/usr/local/nasm
export PATH=${NASM}/bin:${PATH}
source /etc/profile
x264 安裝
下載地址 https://code.videolan.org/videolan/x264
wget https://code.videolan.org/videolan/x264/-/archive/master/x264-master.tar.gz
tar -zxvf x264-master.tar.gz
cd x264-master
./configure --prefix=/usr/local/x264 --enable-shared
make
# 配置環境變數
export PKG_CONFIG_PATH=/usr/local/x264/lib/pkgconfig
export PATH=${PKG_CONFIG_PATH}/bin:${PATH}
source /etc/profile
harfbuzz 安裝
tar -jxvf harfbuzz-1.2.7.tar.bz2
cd harfbuzz-1.2.7
./configure --prefix=/usr/local/harfbuzz
make
make install
freetype 安裝
tar -xvf freetype-2.10.4.tar.xz
cd freetype-2.10.4
./configure --prefix=/usr/local/freetype --disable-static
make
make install
fribidi 安裝
tar -xvf fribidi-1.0.9.tar.xz
cd fribidi-1.0.9
./configure --prefix=/usr/local/fribidi
make
make install
fontconfig 安裝
tar -jxvf fontconfig-2.13.1.tar.bz2
cd fontconfig-2.13.1
./configure --prefix=/usr/local/fontconfig
make
make install
libass 安裝
https://www.linuxfromscratch.org/blfs/view/svn/multimedia/libass.html
tar -xvf libass-0.15.1.tar.xz
cd libass-0.15.1
./configure --prefix=/usr/local/libass --disable-static
make
make install
配置環境變數
vim /etc/profile
export PKG_CONFIG_PATH=/usr/local/x264/lib/pkgconfig:/usr/local/freetype/lib/pkgconfig:/usr/local/harfbuzz/lib/pkgconfig:/usr/local/fribidi/lib/pkgconfig:/usr/local/libass/lib/pkgconfig
export PATH=${PKG_CONFIG_PATH}/bin:${PATH}
#生效
source /etc/profile
ld.so.conf 配置
vim /etc/ld.so.conf
#新增一下內容
/usr/local/ffmpeg/lib
/usr/local/x264/lib
/usr/local/freetype/lib
/usr/local/firbidi/lib
/usr/local/harfbuzz/lib
/usr/local/libass/lib
#生效
ldconfig
3 ffmpeg 安裝
tar -jxvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
./configure --prefix=/usr/local/ffmpeg --enable-libx264 --enable-gpl --enable-libass --enable-fontconfig --enable-openssl --enable-nonfree
make
make install
#配置環境變數
export FFMPEG=/usr/local/ffmpeg
export PATH=${FFMPEG}/bin:${PATH}
source /etc/profile
ffmpeg --version
安裝好 x264
vim /etc/ld.so.conf
在該資料夾中新增
/usr/local/ffmpeg/lib
/usr/local/x264/lib
#配置生效
ldconfig
字型檔案新增
商用免費下載
下載地址:https://izihun.com/shangyongziti/r2/
linux 新增字型
以宋體為例,新建 songti 資料夾,將字型檔案放入該資料夾中
cd /usr/share/fonts/songti
mkfontscale
mkfontdir
fc-cache-fv