From fc559e28626baac0f322d15f88db46dcaef52f44 Mon Sep 17 00:00:00 2001 From: DarkLord76865 Date: Fri, 9 Feb 2024 12:17:56 +0100 Subject: [PATCH] disable ffprobe window creation on windows --- ffmpeg/_probe.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ffmpeg/_probe.py b/ffmpeg/_probe.py index 090d7ab..ac3342a 100644 --- a/ffmpeg/_probe.py +++ b/ffmpeg/_probe.py @@ -1,4 +1,5 @@ import json +import sys import subprocess from ._run import Error from ._utils import convert_kwargs_to_cmd_line_args @@ -17,7 +18,11 @@ def probe(filename, cmd='ffprobe', timeout=None, **kwargs): args += convert_kwargs_to_cmd_line_args(kwargs) args += [filename] - p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + creation_flags = 0 + if sys.platform == "win32": + creation_flags = subprocess.CREATE_NO_WINDOW + + p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, creationflags=creation_flags) communicate_kwargs = {} if timeout is not None: communicate_kwargs['timeout'] = timeout