mirror of
https://github.com/u2takey/ffmpeg-go.git
synced 2025-10-08 09:20:04 +08:00
U In version 1.19, ffmpeg in the current directory cannot be used automatically, and the path of ffmpeg can be customized
This commit is contained in:
7
run.go
7
run.go
@@ -248,10 +248,15 @@ func SeparateProcessGroup() CompilationOption {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Stream) SetFfmpegPath(path string) *Stream {
|
||||
s.FfmpegPath = path
|
||||
return s
|
||||
}
|
||||
|
||||
// for test
|
||||
func (s *Stream) Compile(options ...CompilationOption) *exec.Cmd {
|
||||
args := s.GetArgs()
|
||||
cmd := exec.CommandContext(s.Context, "ffmpeg", args...)
|
||||
cmd := exec.CommandContext(s.Context, s.FfmpegPath, args...)
|
||||
if a, ok := s.Context.Value("Stdin").(io.Reader); ok {
|
||||
cmd.Stdin = a
|
||||
}
|
||||
|
Reference in New Issue
Block a user