Upload app.py
Browse files
app.py
CHANGED
|
@@ -282,7 +282,19 @@ def create_video(project_dir, image_paths, caption_subtitle_file, speech_subtitl
|
|
| 282 |
|
| 283 |
subtitle_path = caption_subtitle_file.replace(os.sep, '/')
|
| 284 |
subtitle_path = subtitle_path.replace(':', '\\:')
|
| 285 |
-
caption_filter = f"subtitles='{subtitle_path}':force_style='
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 286 |
|
| 287 |
cmd2 = [
|
| 288 |
"ffmpeg", "-y",
|
|
@@ -297,7 +309,18 @@ def create_video(project_dir, image_paths, caption_subtitle_file, speech_subtitl
|
|
| 297 |
# 再添加speech字幕(顶部)
|
| 298 |
subtitle_path = speech_subtitle_file.replace(os.sep, '/')
|
| 299 |
subtitle_path = subtitle_path.replace(':', '\\:')
|
| 300 |
-
speech_filter = f"subtitles='{subtitle_path}':force_style='
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 301 |
|
| 302 |
cmd3 = [
|
| 303 |
"ffmpeg", "-y",
|
|
|
|
| 282 |
|
| 283 |
subtitle_path = caption_subtitle_file.replace(os.sep, '/')
|
| 284 |
subtitle_path = subtitle_path.replace(':', '\\:')
|
| 285 |
+
caption_filter = f"subtitles='{subtitle_path}':force_style='\
|
| 286 |
+
Fontname=Noto Sans CJK SC,\
|
| 287 |
+
FontSize=15,\
|
| 288 |
+
Alignment=2,\
|
| 289 |
+
MarginL=30,\
|
| 290 |
+
MarginR=30,\
|
| 291 |
+
MarginV=30,\
|
| 292 |
+
WrapStyle=1,\
|
| 293 |
+
Outline=1.5,\
|
| 294 |
+
Shadow=0.5,\
|
| 295 |
+
PrimaryColour=&H00FFFFFF,\
|
| 296 |
+
OutlineColour=&H80000000,\
|
| 297 |
+
Bold=0'"
|
| 298 |
|
| 299 |
cmd2 = [
|
| 300 |
"ffmpeg", "-y",
|
|
|
|
| 309 |
# 再添加speech字幕(顶部)
|
| 310 |
subtitle_path = speech_subtitle_file.replace(os.sep, '/')
|
| 311 |
subtitle_path = subtitle_path.replace(':', '\\:')
|
| 312 |
+
speech_filter = f"subtitles='{subtitle_path}':force_style='\
|
| 313 |
+
Fontname=Noto Sans CJK SC,\
|
| 314 |
+
FontSize=15,\
|
| 315 |
+
Alignment=8,\
|
| 316 |
+
MarginL=30,\
|
| 317 |
+
MarginR=30,\
|
| 318 |
+
MarginB=30,\
|
| 319 |
+
WrapStyle=1,\
|
| 320 |
+
Outline=1.0,\
|
| 321 |
+
Shadow=0.3,\
|
| 322 |
+
PrimaryColour=&H00FFCCE6,\
|
| 323 |
+
Bold=1'"
|
| 324 |
|
| 325 |
cmd3 = [
|
| 326 |
"ffmpeg", "-y",
|