Browse Source

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

pull/280/head
Gabe Kangas 5 years ago
parent
commit
2b8aea8797
  1. 8
      config/defaults.go
  2. 6
      config/verifyInstall.go

8
config/defaults.go

@ -28,6 +28,14 @@ func getDefaults() config { @@ -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 {

6
core/ffmpeg/verifyInstall.go → config/verifyInstall.go

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
package ffmpeg
package config
import (
"errors"
@ -6,8 +6,8 @@ import ( @@ -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) {
Loading…
Cancel
Save