南昌企业网站设计公司,官网站站,南昌网站建设推广专家,网络推广网站怎么做项目中涉及给视频添加水印#xff0c;使用到了ffmpeg#xff0c;windows系统可直接使用#xff0c;Linux需要手动编译完成ffmpeg后才可正常使用。
配置yum源:
备份原repo文件
cd /etc/yum.repos.d/mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.r…项目中涉及给视频添加水印使用到了ffmpegwindows系统可直接使用Linux需要手动编译完成ffmpeg后才可正常使用。
配置yum源:
备份原repo文件
cd /etc/yum.repos.d/mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
下载阿里yum配置文件
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
重建缓存
yum clean allyum makecache
如果重建缓存中提示
file:///mnt/cdrom/repodata/repomd.xml: [Errno 14] curl#37 - Couldnt open file /mnt/cdrom/repodata/repomd.xml则将系统镜像挂载至对应路径如/mnt下或/mnt/cdrom下再重新重建缓存
#卸载挂载
#umount /mnt#将系统镜像挂载至/mnt/cdrom
mount /dev/sr0 /mnt/cdrom安装依赖
yum -y install epel-releaseyum -y install git gcc gcc-c cmake3
安装yasm:
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gztar zxvf yasm-1.3.0.tar.gzcd yasm-1.3.0./configuremakemake install
安装ffmpeg时间较久
wget http://www.ffmpeg.org/releases/ffmpeg-4.2.tar.gztar -zxvf ffmpeg-4.2.tar.gzcd ffmpeg-4.2/./configure --prefix/usr/local/ffmpeg-4.2make make install
配置环境变量
vi /etc/profile
在文件最后添加
export PATH$PATH:/usr/local/ffmpeg-4.2/bin
保存后执行
source /etc/profile
检查依赖库路径
ldd ffmpeg vim /etc/ld.so.conf
文件最后添加
/usr/local/ffmpeg-4.2/lib
保存后执行
ldconfig
再次检查就正常了。