stash/pkg/ffmpeg/downloader.go
WithoutPants 7086109d78
Change ffmpeg handling (#4688)
* Make ffmpeg/ffprobe settable and remove auto download
* Detect when ffmpeg not present in setup
* Add download ffmpeg task
* Add download ffmpeg button in system settings
* Download ffmpeg during setup
2024-03-21 12:43:40 +11:00

41 lines
1.4 KiB
Go

package ffmpeg
import (
"runtime"
)
func GetFFmpegURL() []string {
var urls []string
switch runtime.GOOS {
case "darwin":
urls = []string{"https://evermeet.cx/ffmpeg/getrelease/zip", "https://evermeet.cx/ffmpeg/getrelease/ffprobe/zip"}
case "linux":
switch runtime.GOARCH {
case "amd64":
urls = []string{"https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v4.2.1/ffmpeg-4.2.1-linux-64.zip", "https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v4.2.1/ffprobe-4.2.1-linux-64.zip"}
case "arm":
urls = []string{"https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v4.2.1/ffmpeg-4.2.1-linux-armhf-32.zip", "https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v4.2.1/ffprobe-4.2.1-linux-armhf-32.zip"}
case "arm64":
urls = []string{"https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v4.2.1/ffmpeg-4.2.1-linux-arm-64.zip", "https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v4.2.1/ffprobe-4.2.1-linux-arm-64.zip"}
}
case "windows":
urls = []string{"https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip"}
default:
urls = []string{""}
}
return urls
}
func getFFMpegFilename() string {
if runtime.GOOS == "windows" {
return "ffmpeg.exe"
}
return "ffmpeg"
}
func getFFProbeFilename() string {
if runtime.GOOS == "windows" {
return "ffprobe.exe"
}
return "ffprobe"
}