Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disabled window creation on windows #790

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ffmpeg/_probe.py
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions ffmpeg/_run.py
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
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,
)