From b7636d96bdb6f6b421c38b9b67806f1c9f45b244 Mon Sep 17 00:00:00 2001 From: Grzegorz Klimaszewski <2612193+grzegorzk@users.noreply.github.com> Date: Fri, 12 Feb 2021 13:48:44 +0100 Subject: [PATCH] Log ffprobe stdout when running in verbose mode --- stream_bitrate_stats/__main__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stream_bitrate_stats/__main__.py b/stream_bitrate_stats/__main__.py index 5df6ce4..75c1170 100644 --- a/stream_bitrate_stats/__main__.py +++ b/stream_bitrate_stats/__main__.py @@ -33,7 +33,11 @@ def run_command(cmd, dry_run=False, verbose=False): process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = process.communicate() + if verbose: + print_stderr(stdout.decode("utf-8")) + if process.returncode == 0: + print_stderr(stderr.decode("utf-8")) return stdout.decode("utf-8"), stderr.decode("utf-8") else: print_stderr("[error] running command: {}".format(" ".join(cmd)))