This commit is contained in:
2024-10-23 04:39:10 +08:00
commit 60fca41864
9 changed files with 589 additions and 0 deletions

8
utils/has_ffmpeg.go Normal file
View File

@@ -0,0 +1,8 @@
package utils
import "os/exec"
func HasFFMPEG() bool {
_, err := exec.LookPath("ffmpeg")
return err == nil
}

View File

@@ -0,0 +1,13 @@
package utils
import (
"live-streamer/constant"
"path/filepath"
"slices"
"strings"
)
func IsSupportedVideo(filename string) bool {
ext := strings.ToLower(filepath.Ext(filename))
return slices.Contains(constant.SupportedStreamingFormats, strings.TrimPrefix(ext, "."))
}