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=${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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南