From 8e07e0e32be02028ca25f4bd19cb6c0caa8a2be9 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 19 Nov 2021 18:25:58 +0100 Subject: [PATCH] use list of arguments for ffprobe instead of running string with shell=True --- openpype/lib/vendor_bin_utils.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/openpype/lib/vendor_bin_utils.py b/openpype/lib/vendor_bin_utils.py index a8c75c20da..42f2b34bb2 100644 --- a/openpype/lib/vendor_bin_utils.py +++ b/openpype/lib/vendor_bin_utils.py @@ -71,18 +71,24 @@ def ffprobe_streams(path_to_file, logger=None): "Getting information about input \"{}\".".format(path_to_file) ) args = [ - "\"{}\"".format(get_ffmpeg_tool_path("ffprobe")), - "-v quiet", - "-print_format json", + get_ffmpeg_tool_path("ffprobe"), + "-hide_banner", + "-loglevel", "fatal", + "-show_error", "-show_format", "-show_streams", - "\"{}\"".format(path_to_file) + "-show_programs", + "-show_chapters", + "-show_private_data", + "-print_format", "json", + path_to_file ] - command = " ".join(args) - logger.debug("FFprobe command: \"{}\"".format(command)) + + logger.debug("FFprobe command: {}".format( + subprocess.list2cmdline(args) + )) popen = subprocess.Popen( - command, - shell=True, + args, stdout=subprocess.PIPE, stderr=subprocess.PIPE )