Make ffmpeg version parsing more resilient
This commit is contained in:
parent
5dc8fc5ff1
commit
7349b8f2e3
@ -310,7 +310,7 @@ func version(binary string) (ffmpeg, error) {
|
||||
func parseVersion(data []byte) ffmpeg {
|
||||
f := ffmpeg{}
|
||||
|
||||
reVersion := regexp.MustCompile(`^ffmpeg version ([0-9]+\.[0-9]+(\.[0-9]+)?)`)
|
||||
reVersion := regexp.MustCompile(`(?m)^ffmpeg version ([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]+)`)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user