很多大侠写了如何安装,看的头痛,有的装法会发现各种错误。懒人致力于解决头痛,哈哈!
去官网下载 ffmpeg-release-amd64-static.tar.xz 原文件
点击红框 一步 一步 下一步
http://www.ffmpeg.org/download.html#build-linux
shell文件
1.建立个文本,改个扩展名shell.sh,复制下面代码-保存。
打开终端(建议直接root用戶运行)。
2.sudo chmod +x sheell.sh
3.sudo ./shell.sh
4.用法 shell.sh 和 ffmpeg-release-amd64-static.tar.xz 注意这2个文件放在同一个文件夹里
5.测试环境centos7
6.重起系统前,保存好文件!汗
7.完成后输入命令,ffmpeg -i 测试下
#!/bin/bash
##i-bash是标准的shell标头
##i-ffmpeg安装
xz -d ffmpeg-release-amd64-static.tar.xz
tar -xvf ffmpeg-release-amd64-static.tar
mv ffmpeg-4.4-amd64-static ffmpeg
chmod -R 777 ffmpeg
mv ffmpeg /home/ffmpeg
sed -i '$a''export PATH=$PATH:/home/ffmpeg' /etc/profile;
source /etc/profile
touch ffmpeg.sh
echo '#!/bin/bash'>ffmpeg.sh
sed -i '$a''export PATH=$PATH:/home/ffmpeg' ffmpeg.sh;
chmod +x ffmpeg.sh;
cp -rf ffmpeg.sh /etc/profile.d/
rm -rf ffmpeg.sh
read -p "reboot-(y|n)?"
sudo reboot
exit