diff --git a/scripts/tracks.py b/scripts/tracks.py index ab8e1bf..1f39bc2 100644 --- a/scripts/tracks.py +++ b/scripts/tracks.py @@ -43,6 +43,8 @@ import json import os import subprocess +NOWIN = getattr(subprocess, "CREATE_NO_WINDOW", 0) + # The supervisor hands every engine child its OWN resolved ffmpeg/ffprobe # (`rt.config.engine_child_env` → TRANSCODE_FFMPEG/TRANSCODE_FFPROBE, mirroring # `transcode.py:36-37`). Honour them here as well: this module used to call the bare @@ -87,7 +89,7 @@ def probe(path, timeout=180): r = subprocess.run([FFPROBE, "-v", "error", "-print_format", "json", "-show_streams", "-show_format", "-show_chapters", path], capture_output=True, text=True, encoding="utf-8", errors="replace", - timeout=timeout) + timeout=timeout, creationflags=NOWIN) if r.returncode != 0: return None try: @@ -450,7 +452,7 @@ def stream_signature(path, sel, timeout=1800): r = subprocess.run([FFPROBE, "-v", "error", "-select_streams", sel, "-count_packets", "-show_entries", "stream=nb_read_packets", "-of", "csv=p=0", path], capture_output=True, text=True, encoding="utf-8", errors="replace", - timeout=timeout) + timeout=timeout, creationflags=NOWIN) if r.returncode != 0: return None try: @@ -458,7 +460,8 @@ def stream_signature(path, sel, timeout=1800): except Exception: # noqa: BLE001 return None p = subprocess.Popen([FFMPEG, "-v", "error", "-i", path, "-map", "0:" + sel, "-c", "copy", - "-f", "data", "-"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + "-f", "data", "-"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, + creationflags=NOWIN) h = hashlib.md5() try: while True: