✨ feat(av1-transfer): use setproctitle to rename Python main process
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ AV1 视频批量转码脚本
|
|||||||
-i, --input 输入目录路径(必需)
|
-i, --input 输入目录路径(必需)
|
||||||
-o, --output 输出目录路径(必需)
|
-o, --output 输出目录路径(必需)
|
||||||
-w, --workers 并行任务数,默认为 4
|
-w, --workers 并行任务数,默认为 4
|
||||||
-n, --process-name ffmpeg 进程别名(混淆进程名,等效于 exec -a <别名> ffmpeg)
|
-n, --process-name 进程别名(同时重命名 Python 主进程和 ffmpeg 子进程)
|
||||||
|
|
||||||
示例:
|
示例:
|
||||||
python main.py -i /path/to/input -o /path/to/output
|
python main.py -i /path/to/input -o /path/to/output
|
||||||
@@ -23,6 +23,7 @@ import subprocess
|
|||||||
from concurrent.futures import ThreadPoolExecutor, as_completed
|
from concurrent.futures import ThreadPoolExecutor, as_completed
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
import setproctitle
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
# ================= 配置区域 =================
|
# ================= 配置区域 =================
|
||||||
@@ -202,6 +203,7 @@ def main():
|
|||||||
|
|
||||||
print(f"共发现 {len(tasks)} 个文件,准备使用 {max_workers} 个并行任务进行转码...")
|
print(f"共发现 {len(tasks)} 个文件,准备使用 {max_workers} 个并行任务进行转码...")
|
||||||
if process_name:
|
if process_name:
|
||||||
|
setproctitle.setproctitle(process_name)
|
||||||
print(f"进程别名: {process_name}")
|
print(f"进程别名: {process_name}")
|
||||||
|
|
||||||
# 初始化进度条
|
# 初始化进度条
|
||||||
|
|||||||
Reference in New Issue
Block a user