diff --git a/av1-transfer/main.py b/av1-transfer/main.py index c7ba88b..6c021e2 100644 --- a/av1-transfer/main.py +++ b/av1-transfer/main.py @@ -21,6 +21,7 @@ import ctypes import ctypes.util import queue import shlex +import shutil import subprocess import sys from concurrent.futures import ThreadPoolExecutor, as_completed @@ -133,9 +134,11 @@ def transcode_one_file(file_info, overall_bar, slot_bars, slot_queue, process_na # 用 bash 的 exec -a 重命名 ffmpeg 进程的 argv[0] # ffmpeg 通过 PATH 查找,避免 execve 直接调用 symlink 的兼容问题 shell_args = " ".join(shlex.quote(str(a)) for a in ffmpeg_args) + sh = shutil.which("sh") or shutil.which("bash") or "/usr/bin/sh" proc = subprocess.Popen( f"exec -a {shlex.quote(process_name)} ffmpeg {shell_args}", shell=True, + executable=sh, stdout=subprocess.PIPE, stderr=subprocess.PIPE, )