From b077aac350e6b32aceabcc29ec0b93e8ebe8b64b Mon Sep 17 00:00:00 2001 From: DarkLord76865 Date: Fri, 25 Aug 2023 16:55:06 +0200 Subject: [PATCH 1/2] disabled window creation on windows --- ffmpeg/_run.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ffmpeg/_run.py b/ffmpeg/_run.py index f42d1d7..dcf14a8 100644 --- a/ffmpeg/_run.py +++ b/ffmpeg/_run.py @@ -6,6 +6,7 @@ from functools import reduce import copy import operator import subprocess +import sys from ._ffmpeg import input, output from .nodes import ( @@ -284,6 +285,11 @@ def run_async( stdin_stream = subprocess.PIPE if pipe_stdin else None stdout_stream = subprocess.PIPE if pipe_stdout else None stderr_stream = subprocess.PIPE if pipe_stderr else None + + creation_flags = 0 + if sys.platform == "win32": + creation_flags = subprocess.CREATE_NO_WINDOW + if quiet: stderr_stream = subprocess.STDOUT stdout_stream = subprocess.DEVNULL @@ -293,6 +299,7 @@ def run_async( stdout=stdout_stream, stderr=stderr_stream, cwd=cwd, + creationflags=creation_flags, ) From fc559e28626baac0f322d15f88db46dcaef52f44 Mon Sep 17 00:00:00 2001 From: DarkLord76865 Date: Fri, 9 Feb 2024 12:17:56 +0100 Subject: [PATCH 2/2] 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