From c12e8890ad9314dd29162c2bb51e876972d60e65 Mon Sep 17 00:00:00 2001 From: Tercio Gaudencio Filho Date: Tue, 15 Sep 2020 22:08:51 -0300 Subject: [PATCH] Fix issue #195. Redirect stdout/stderr to DEVNULL when quiet is requested. --- ffmpeg/_run.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ffmpeg/_run.py b/ffmpeg/_run.py index c9cbb7c..559a0f4 100644 --- a/ffmpeg/_run.py +++ b/ffmpeg/_run.py @@ -279,8 +279,10 @@ def run_async( """ args = compile(stream_spec, cmd, overwrite_output=overwrite_output) stdin_stream = subprocess.PIPE if pipe_stdin else None - stdout_stream = subprocess.PIPE if pipe_stdout or quiet else None - stderr_stream = subprocess.PIPE if pipe_stderr or quiet else None + stdout_stream = subprocess.PIPE if pipe_stdout else None + stderr_stream = subprocess.PIPE if pipe_stderr else None + if quiet: + stdout_stream = stderr_stream = subprocess.DEVNULL return subprocess.Popen( args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream )