Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Support a local working directory copy of ffmpeg. Closes #276

Gabe Kangasfc436a92ea71
diff --git a/config/defaults.go b/config/defaults.go
index eb7545a7d4..32b451d06f 100644
--- a/config/defaults.go
+++ b/config/defaults.go
@@ -28,6 +28,14 @@ func getDefaults() config {
}
func getDefaultFFMpegPath() string {
+ // First look to see if ffmpeg is in the current working directory
+ localCopy := "./ffmpeg"
+ hasLocalCopyError := verifyFFMpegPath(localCopy)
+ if hasLocalCopyError == nil {
+ // No error, so all is good. Use the local copy.
+ return localCopy
+ }
+
cmd := exec.Command("which", "ffmpeg")
out, err := cmd.CombinedOutput()
if err != nil {
diff --git a/core/ffmpeg/verifyInstall.go b/config/verifyInstall.go
similarity index 80%
rename from core/ffmpeg/verifyInstall.go
rename to config/verifyInstall.go
index 1b8e212a93..4c045ba922 100644
--- a/core/ffmpeg/verifyInstall.go
+++ b/config/verifyInstall.go
@@ -1,4 +1,4 @@
-package ffmpeg
+package config
import (
"errors"
@@ -6,8 +6,8 @@ import (
"os"
)
-//VerifyFFMpegPath verifies that the path exists, is a file, and is executable
-func VerifyFFMpegPath(path string) error {
+//verifyFFMpegPath verifies that the path exists, is a file, and is executable
+func verifyFFMpegPath(path string) error {
stat, err := os.Stat(path)
if os.IsNotExist(err) {