Make ffmpeg version detection more robust

This commit is contained in:
Ingo Oppermann 2026-03-10 15:38:19 +01:00
parent 3535f527fb
commit 28a75f23f7
No known key found for this signature in database
GPG Key ID: 2AB32426E9DD229E

View File

@ -310,7 +310,7 @@ func version(binary string) (ffmpeg, error) {
func parseVersion(data []byte) ffmpeg {
f := ffmpeg{}
reVersion := regexp.MustCompile(`(?m)^ffmpeg version ([0-9]+\.[0-9]+(\.[0-9]+)?)`)
reVersion := regexp.MustCompile(`(?m)^ffmpeg version (?:ffmpeg-)?([0-9]+\.[0-9]+(\.[0-9]+)?)`)
reCompiler := regexp.MustCompile(`(?m)^\s*built with (.*)$`)
reConfiguration := regexp.MustCompile(`(?m)^\s*configuration: (.*)$`)
reLibrary := regexp.MustCompile(`(?m)^\s*(lib(?:[a-z]+))\s+([0-9]+\.\s*[0-9]+\.\s*[0-9]+) /\s+([0-9]+\.\s*[0-9]+\.\s*[0-9]+)`)