|
@@ -202,7 +202,7 @@ class VideoStitching():
|
|
# /System/Library/Fonts/Hiragino Sans GB.ttc 本地字体
|
|
# /System/Library/Fonts/Hiragino Sans GB.ttc 本地字体
|
|
# /usr/share/fonts/truetype/wqy/wqy-zenhei.ttc 服务器地址
|
|
# /usr/share/fonts/truetype/wqy/wqy-zenhei.ttc 服务器地址
|
|
Common.logger().info(f"字幕:{text}")
|
|
Common.logger().info(f"字幕:{text}")
|
|
- sub = editor.TextClip(text, font="/System/Library/Fonts/Hiragino Sans GB.ttc",
|
|
|
|
|
|
+ sub = editor.TextClip(text, font="/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc",
|
|
fontsize=18, color="black").set_duration(end - start).set_start(
|
|
fontsize=18, color="black").set_duration(end - start).set_start(
|
|
start).set_position(
|
|
start).set_position(
|
|
("center", final_height - 60)).set_opacity(0.8)
|
|
("center", final_height - 60)).set_opacity(0.8)
|
|
@@ -213,7 +213,7 @@ class VideoStitching():
|
|
else:
|
|
else:
|
|
Common.logger().info(f"添加固定字幕")
|
|
Common.logger().info(f"添加固定字幕")
|
|
text_clip = (
|
|
text_clip = (
|
|
- editor.TextClip("分享、转发给群友", font="/System/Library/Fonts/Hiragino Sans GB.ttc",
|
|
|
|
|
|
+ editor.TextClip("分享、转发给群友", font="/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc",
|
|
fontsize=30, color="black").
|
|
fontsize=30, color="black").
|
|
set_position(("center", final_height - 70)).
|
|
set_position(("center", final_height - 70)).
|
|
set_duration(duration_limit).
|
|
set_duration(duration_limit).
|
|
@@ -222,7 +222,7 @@ class VideoStitching():
|
|
# 把 `文本剪贴板` 贴在视频上
|
|
# 把 `文本剪贴板` 贴在视频上
|
|
video_with_subtitles = editor.CompositeVideoClip([final_clip, text_clip])
|
|
video_with_subtitles = editor.CompositeVideoClip([final_clip, text_clip])
|
|
# 生成视频
|
|
# 生成视频
|
|
- video_with_subtitles.write_videofile(output_path)
|
|
|
|
|
|
+ video_with_subtitles.write_videofile(output_path, fps=35)
|
|
if os.path.isfile(output_path):
|
|
if os.path.isfile(output_path):
|
|
Common.logger().info("视频生成成功!生成路径为:", output_path)
|
|
Common.logger().info("视频生成成功!生成路径为:", output_path)
|
|
return included_videos, video_with_subtitles
|
|
return included_videos, video_with_subtitles
|