Merge fc559e28626baac0f322d15f88db46dcaef52f44 into df129c7ba30aaa9ffffb81a48f53aa7253b0b4e6

This commit is contained in:
Antonio Mamić 2024-02-09 11:18:03 +00:00 committed by GitHub
commit 7297f185fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -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,
)