Put suggested ffmpeg version into constants file
This commit is contained in:
parent
4c2144a3fc
commit
0526404d19
@ -3,11 +3,12 @@ package config
|
|||||||
import "path/filepath"
|
import "path/filepath"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
WebRoot = "webroot"
|
WebRoot = "webroot"
|
||||||
PrivateHLSStoragePath = "hls"
|
PrivateHLSStoragePath = "hls"
|
||||||
GeoIPDatabasePath = "data/GeoLite2-City.mmdb"
|
GeoIPDatabasePath = "data/GeoLite2-City.mmdb"
|
||||||
ExtraInfoFile = "data/content.md"
|
ExtraInfoFile = "data/content.md"
|
||||||
StatsFile = "data/stats.json"
|
StatsFile = "data/stats.json"
|
||||||
|
FfmpegSuggestedVersion = "v4.1.5" // Requires the v
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -32,7 +32,6 @@ func verifyFFMpegPath(path string) error {
|
|||||||
return errors.New("ffmpeg path is not executable")
|
return errors.New("ffmpeg path is not executable")
|
||||||
}
|
}
|
||||||
|
|
||||||
suggestedVersion := "v4.1.5"
|
|
||||||
cmd := exec.Command(path)
|
cmd := exec.Command(path)
|
||||||
out, err := cmd.CombinedOutput()
|
out, err := cmd.CombinedOutput()
|
||||||
|
|
||||||
@ -45,8 +44,8 @@ func verifyFFMpegPath(path string) error {
|
|||||||
responseComponents := strings.Split(response, " ")
|
responseComponents := strings.Split(response, " ")
|
||||||
fullVersionString := responseComponents[2]
|
fullVersionString := responseComponents[2]
|
||||||
versionString := "v" + strings.Split(fullVersionString, "-")[0]
|
versionString := "v" + strings.Split(fullVersionString, "-")[0]
|
||||||
if !semver.IsValid(versionString) || semver.Compare(versionString, suggestedVersion) == -1 {
|
if !semver.IsValid(versionString) || semver.Compare(versionString, FfmpegSuggestedVersion) == -1 {
|
||||||
return fmt.Errorf("your %s version of ffmpeg at %s may be older than the suggested version of %s. you may experience issues with video.", versionString, path, suggestedVersion)
|
return fmt.Errorf("your %s version of ffmpeg at %s may be older than the suggested version of %s. you may experience issues with video.", versionString, path, FfmpegSuggestedVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user