致电
cmd := exec.Command("ffmpeg", "-i", "mic.aac", "-i",
"speaker.aac",
"-filter_complex", "[0:a][1:a]amerge=inputs=2[a]", "-map", "
[a]", "output.aac")
不执行任何操作,打印错误:退出状态1 命令输出:“”
从终端运行以下命令可以实现我想要的:
ffmpeg -i mic.aac -i speaker.aac -filter_complex "[0:a][1:a]amerge=inputs=2[a]" -map "[a]" output.aac
尝试使用cmd:= exec.Command(“ tr”,cmdArguments ...)做同样的事情。
还尝试将完整路径用于FFMPEG。
相关代码:
cmd := exec.Command("ffmpeg", "-i", "mic.aac", "-i", "speaker.aac", "-filter_complex", "[0:a][1:a]amerge=inputs=2[a]", "-map", "[a]", "output.aac")
err = cmd.Run()
err = c.Wait()
var out bytes.Buffer
cmd.Stdout = &out
if err != nil {
fmt.Println(err)
}
fmt.Printf("command output: %q\n", out.String())