mirror of
https://github.com/kkroening/ffmpeg-python.git
synced 2025-04-06 04:15:44 +08:00
Merge fc559e28626baac0f322d15f88db46dcaef52f44 into df129c7ba30aaa9ffffb81a48f53aa7253b0b4e6
This commit is contained in:
commit
7297f185fb
@ -1,4 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
from ._run import Error
|
from ._run import Error
|
||||||
from ._utils import convert_kwargs_to_cmd_line_args
|
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 += convert_kwargs_to_cmd_line_args(kwargs)
|
||||||
args += [filename]
|
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 = {}
|
communicate_kwargs = {}
|
||||||
if timeout is not None:
|
if timeout is not None:
|
||||||
communicate_kwargs['timeout'] = timeout
|
communicate_kwargs['timeout'] = timeout
|
||||||
|
@ -6,6 +6,7 @@ from functools import reduce
|
|||||||
import copy
|
import copy
|
||||||
import operator
|
import operator
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
from ._ffmpeg import input, output
|
from ._ffmpeg import input, output
|
||||||
from .nodes import (
|
from .nodes import (
|
||||||
@ -284,6 +285,11 @@ def run_async(
|
|||||||
stdin_stream = subprocess.PIPE if pipe_stdin else None
|
stdin_stream = subprocess.PIPE if pipe_stdin else None
|
||||||
stdout_stream = subprocess.PIPE if pipe_stdout else None
|
stdout_stream = subprocess.PIPE if pipe_stdout else None
|
||||||
stderr_stream = subprocess.PIPE if pipe_stderr 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:
|
if quiet:
|
||||||
stderr_stream = subprocess.STDOUT
|
stderr_stream = subprocess.STDOUT
|
||||||
stdout_stream = subprocess.DEVNULL
|
stdout_stream = subprocess.DEVNULL
|
||||||
@ -293,6 +299,7 @@ def run_async(
|
|||||||
stdout=stdout_stream,
|
stdout=stdout_stream,
|
||||||
stderr=stderr_stream,
|
stderr=stderr_stream,
|
||||||
cwd=cwd,
|
cwd=cwd,
|
||||||
|
creationflags=creation_flags,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user