hide console in extract burnin

This commit is contained in:
Jakub Trllo 2023-02-22 10:43:21 +01:00 committed by Jakub Trllo
parent cf17ff50b5
commit 79eb375c06

View file

@ -52,7 +52,16 @@ def _get_ffprobe_data(source):
"-show_streams", "-show_streams",
source source
] ]
proc = subprocess.Popen(command, stdout=subprocess.PIPE) kwargs = {
"stdout": subprocess.PIPE,
}
if platform.system().lower() == "windows":
kwargs["creationflags"] = (
subprocess.CREATE_NEW_PROCESS_GROUP
| getattr(subprocess, "DETACHED_PROCESS", 0)
| getattr(subprocess, "CREATE_NO_WINDOW", 0)
)
proc = subprocess.Popen(command, **kwargs)
out = proc.communicate()[0] out = proc.communicate()[0]
if proc.returncode != 0: if proc.returncode != 0:
raise RuntimeError("Failed to run: %s" % command) raise RuntimeError("Failed to run: %s" % command)
@ -331,12 +340,18 @@ class ModifiedBurnins(ffmpeg_burnins.Burnins):
) )
print("Launching command: {}".format(command)) print("Launching command: {}".format(command))
proc = subprocess.Popen( kwargs = {
command, "stdout": subprocess.PIPE,
stdout=subprocess.PIPE, "stderr": subprocess.PIPE,
stderr=subprocess.PIPE, "shell": True,
shell=True }
if platform.system().lower() == "windows":
kwargs["creationflags"] = (
subprocess.CREATE_NEW_PROCESS_GROUP
| getattr(subprocess, "DETACHED_PROCESS", 0)
| getattr(subprocess, "CREATE_NO_WINDOW", 0)
) )
proc = subprocess.Popen(command, **kwargs)
_stdout, _stderr = proc.communicate() _stdout, _stderr = proc.communicate()
if _stdout: if _stdout: