路径跨平台兼容优化 - 修改相对路径,兼容Windows/Linux/Mac

This commit is contained in:
Tony Zhang
2025-12-15 16:58:44 +08:00
parent 54fff30ee0
commit da721ad8e2
5 changed files with 39 additions and 28 deletions

View File

@@ -146,7 +146,7 @@ class VideoComposer:
style=style if isinstance(style, str) else "subtitle",
custom_style={
**(custom_style or {}),
"font_name": "/System/Library/Fonts/PingFang.ttc",
"font_name": config.DEFAULT_FONT,
},
cache=False
)
@@ -156,7 +156,7 @@ class VideoComposer:
text=text,
style=style if isinstance(style, str) else "subtitle",
custom_style={
"font_name": "/System/Library/Fonts/PingFang.ttc",
"font_name": config.DEFAULT_FONT,
},
cache=False
)
@@ -662,7 +662,7 @@ def quick_compose(
def example_hairclip_video():
"""示例:发夹商品视频合成"""
素材目录 = Path("/Volumes/Tony/video-flow/素材/发夹/合成图拆分镜")
素材目录 = config.BASE_DIR / "素材" / "发夹" / "合成图拆分镜"
video_paths = [
str(素材目录 / "视频-分镜1.mp4"),
@@ -706,7 +706,7 @@ def example_hairclip_video():
output = quick_compose(
video_folder=str(素材目录),
script=script,
output_path="/Volumes/Tony/video-flow/output/发夹_合成视频.mp4",
output_path=str(config.OUTPUT_DIR / "发夹_合成视频.mp4"),
voice_type="sweet_female"
)