ffmpeg安装教程

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

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= Y A S M / b i n : {YASM}/bin: 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= N A S M / b i n : {NASM}/bin: 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= P K G C O N F I G P A T H / b i n : {PKG_CONFIG_PATH}/bin: PKGCONFIGPATH/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= P K G C O N F I G P A T H / b i n : {PKG_CONFIG_PATH}/bin: PKGCONFIGPATH/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= F F M P E G / b i n : {FFMPEG}/bin: 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

https://www.octfgroup.com/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值