Allow to override ffmpeg binary

This commit is contained in:
Ingo Oppermann
2025-03-03 17:13:39 +01:00
parent ba28cf3d20
commit be9e0d4c5d
4 changed files with 15 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ type FFmpeg interface {
}
type ProcessConfig struct {
Binary string // Override the default binary
Reconnect bool // Whether to reconnect
ReconnectDelay time.Duration // Duration until next reconnect
StaleTimeout time.Duration // Duration to wait until killing the process if there is no progress in the process
@@ -150,8 +151,13 @@ func (f *ffmpeg) New(config ProcessConfig) (process.Process, error) {
limitMode = process.LimitModeSoft
}
binary := f.binary
if len(config.Binary) != 0 {
binary = config.Binary
}
ffmpeg, err := process.New(process.Config{
Binary: f.binary,
Binary: binary,
Args: config.Args,
Reconnect: config.Reconnect,
ReconnectDelay: config.ReconnectDelay,