chore: remove dead code from gui.py, fix burn_only.py compatibility
This commit is contained in:
+14
-7
@@ -4,18 +4,17 @@
|
|||||||
直接用已有的 clips + title.srt + content.srt 合并烧录
|
直接用已有的 clips + title.srt + content.srt 合并烧录
|
||||||
|
|
||||||
用法:
|
用法:
|
||||||
python burn_only.py
|
|
||||||
python burn_only.py "D:\\path\\to\\output_dir"
|
python burn_only.py "D:\\path\\to\\output_dir"
|
||||||
"""
|
"""
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
# 导入统一配置
|
# 必须指定输出目录
|
||||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
if len(sys.argv) < 2:
|
||||||
import config
|
print("用法: python burn_only.py <output_dir>")
|
||||||
|
print("示例: python burn_only.py \"D:\\path\\to\\output_dir\"")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
OUTPUT = config.OUTPUT
|
|
||||||
if len(sys.argv) > 1:
|
|
||||||
OUTPUT = sys.argv[1]
|
OUTPUT = sys.argv[1]
|
||||||
|
|
||||||
TITLE_SRT = os.path.join(OUTPUT, "subs", "v1_title.srt")
|
TITLE_SRT = os.path.join(OUTPUT, "subs", "v1_title.srt")
|
||||||
@@ -40,7 +39,15 @@ src_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "src")
|
|||||||
sys.path.insert(0, src_dir)
|
sys.path.insert(0, src_dir)
|
||||||
from core import Pipeline
|
from core import Pipeline
|
||||||
|
|
||||||
# 构造 minimal config(只需要 output_dir 和 video_params)
|
# 尝试从 generated_config.yaml 加载配置
|
||||||
|
config_path = os.path.join(OUTPUT, 'generated_config.yaml')
|
||||||
|
if os.path.exists(config_path):
|
||||||
|
import yaml
|
||||||
|
with open(config_path, 'r', encoding='utf-8') as f:
|
||||||
|
pipeline_config = yaml.safe_load(f) or {}
|
||||||
|
pipeline_config['output_dir'] = OUTPUT
|
||||||
|
else:
|
||||||
|
# 构造 minimal config
|
||||||
pipeline_config = {
|
pipeline_config = {
|
||||||
'output_dir': OUTPUT,
|
'output_dir': OUTPUT,
|
||||||
'clips': [],
|
'clips': [],
|
||||||
|
|||||||
Reference in New Issue
Block a user