deeme commited on
Commit
1409ee0
·
verified ·
1 Parent(s): ac0afbe

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -2
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='Fontname=Noto Sans CJK SC,Alignment=2,FontSize=15,PrimaryColour=&H00E0FFFF,OutlineColour=&H80000000,BackColour=&H40000000,BorderStyle=1,Outline=0.8,Shadow=0.5,MarginV=30,MarginL=40,MarginR=40,LineSpacing=8'"
 
 
 
 
 
 
 
 
 
 
 
 
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='Fontname=Noto Sans CJK SC,Alignment=8,FontSize=15,PrimaryColour=&H00FFFFFF,OutlineColour=&H80000000,BackColour=&H40000000,BorderStyle=1,Outline=0.8,Shadow=0.5,MarginV=30,MarginL=40,MarginR=40,LineSpacing=8'"
 
 
 
 
 
 
 
 
 
 
 
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",