From c12e8890ad9314dd29162c2bb51e876972d60e65 Mon Sep 17 00:00:00 2001 From: Tercio Gaudencio Filho Date: Tue, 15 Sep 2020 22:08:51 -0300 Subject: [PATCH 1/2] 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 ) From 0ec6e69d885f9f75a3220f94b79273f288005049 Mon Sep 17 00:00:00 2001 From: Tercio Gaudencio Filho Date: Fri, 30 Oct 2020 17:29:44 -0300 Subject: [PATCH 2/2] Redirect stderr to stdout and stdout to DEVNULL when quiet is requested. --- ffmpeg/_run.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ffmpeg/_run.py b/ffmpeg/_run.py index 559a0f4..c3d5550 100644 --- a/ffmpeg/_run.py +++ b/ffmpeg/_run.py @@ -282,7 +282,8 @@ def run_async( 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 + stderr_stream = subprocess.STDOUT + stdout_stream = subprocess.DEVNULL return subprocess.Popen( args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream )