feat: 优化下载 ffmpeg 脚本,尝试解决 armv7 环境问题
This commit is contained in:
parent
3b720b7367
commit
0f3f2e47f5
@ -9,37 +9,42 @@ arch=$(uname -m)
|
||||
# 输出架构信息
|
||||
echo "当前系统架构是:$arch"
|
||||
|
||||
install_from_build() {
|
||||
install_from_github() {
|
||||
pkg=$1
|
||||
wget https://github.com/yt-dlp/FFmpeg-Builds/releases/download/latest/$pkg.tar.xz
|
||||
tar -xvJf $pkg.tar.xz
|
||||
mv $pkg ffmpeg
|
||||
mkdir -p ffmpeg/bin
|
||||
mv $pkg/bin/ffmpeg ffmpeg/bin/
|
||||
mv $pkg/bin/ffprobe ffmpeg/bin/
|
||||
}
|
||||
|
||||
install_from_apt() {
|
||||
apt-get update
|
||||
apt-get install -y ffmpeg
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
mkdir -p /app/ffmpeg/bin
|
||||
ln -s /usr/bin/ffmpeg /app/ffmpeg/bin/ffmpeg
|
||||
ln -s /usr/bin/ffprobe /app/ffmpeg/bin/ffprobe
|
||||
install_from_ffmpeg() {
|
||||
pkg=$1
|
||||
wget https://johnvansickle.com/ffmpeg/builds/$pkg.tar.xz
|
||||
mkdir -p $pkg
|
||||
tar -xvJf $pkg.tar.xz -C $pkg
|
||||
mkdir -p ffmpeg/bin
|
||||
mv $pkg/*/ffmpeg ffmpeg/bin/
|
||||
mv $pkg/*/ffprobe ffmpeg/bin/
|
||||
}
|
||||
|
||||
# 基于架构执行不同的操作
|
||||
case "$arch" in
|
||||
x86_64)
|
||||
echo "64位 x86 架构"
|
||||
pkg=ffmpeg-master-latest-linux64-gpl
|
||||
#install_from_build "$pkg"
|
||||
install_from_apt
|
||||
install_from_github ffmpeg-master-latest-linux64-gpl
|
||||
#install_from_ffmpeg ffmpeg-git-amd64-static
|
||||
;;
|
||||
arm64 | aarch64)
|
||||
echo "64位 ARM 架构"
|
||||
pkg=ffmpeg-master-latest-linuxarm64-gpl
|
||||
install_from_build "$pkg"
|
||||
install_from_github ffmpeg-master-latest-linuxarm64-gpl
|
||||
#install_from_ffmpeg ffmpeg-git-arm64-static
|
||||
;;
|
||||
armv7l)
|
||||
echo "armv7l 架构"
|
||||
install_from_ffmpeg ffmpeg-git-armhf-static
|
||||
;;
|
||||
*)
|
||||
echo "未知架构 $arch"
|
||||
install_from_apt
|
||||
;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user