Is there a way to suppress the output from popen() without losing Wait ().
Test 1:
FILE * stream = NULL; char buffer [120]; stream = popen ("ffmpeg -y -i test.amr -ar 16000 test.wav -v quiet", "r"); while (fgets (buffer, sizeof(buffer), stream)) { } pclose (stream);
Test 2:
FILE * stream = NULL; char buffer [120]; stream = popen ("ffmpeg -y -i test.amr -ar 16000 test.wav -v quiet &> /dev/null", "r"); while (fgets (buffer, sizeof(buffer), stream)) { } pclose (stream);
The problem with Test 2 is that pclose() does not wait for the pipe to complete processing. I donβt want to have a bunch of FFMPEG output every time I have to make a call.
user548266
source share