From 0f3f2e47f5cd1ac169260fa07d961bbd837d003c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=B5=E6=9B=A6?= Date: Tue, 2 Jul 2024 05:24:29 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=B8=8B=E8=BD=BD=20?= =?UTF-8?q?ffmpeg=20=E8=84=9A=E6=9C=AC=EF=BC=8C=E5=B0=9D=E8=AF=95=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=20armv7=20=E7=8E=AF=E5=A2=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install_dependencies.sh | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/install_dependencies.sh b/install_dependencies.sh index c0b86e5ce..6781402d1 100644 --- a/install_dependencies.sh +++ b/install_dependencies.sh @@ -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