I have a complex ffmpeg
command to execute and I need to execute using Go. The command is working, the problem is coming when I try to hide the output of command using > /dev/null 2>&1
This is my code:
cmd := exec.Command(
"ffmpeg",
"-y",
"-loglevel", "warning",
"-i", ConvertImage,
"-i", videoInput,
"-c:v", cv,
"-c:a", audioCodec,
"-crf", fmt.Sprintf("%d", crf),
"-map", "[v]",
"-map", "1:a?",
"-r", fmt.Sprintf("%d", Res.FrameRate),
"-strict",
"-2",
outputFile,
"> /dev/null 2>&1",
)
Without last field "> /dev/null 2>&1",
code is working ok when I try to hide the output of command, command skip without the run.
What did I do wrong? How can I fix it?