firofame commited on
Commit
dadc169
·
verified ·
1 Parent(s): d0ade3e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -9,14 +9,13 @@ SRT_FILE = "output.srt"
9
  FONT_SIZE = 40
10
 
11
  ffmpeg_command = [
12
- "ffmpeg",
13
- "-y",
14
- "-stream_loop", "1",
15
- "-i", "background.mp4",
16
- "-i", AUDIO_FILE,
17
- "-vf", f"subtitles={SRT_FILE}:force_style='FontSize={FONT_SIZE}'",
18
- "-shortest",
19
- VIDEO_FILE
20
  ]
21
 
22
  async def text2video(TEXT):
 
9
  FONT_SIZE = 40
10
 
11
  ffmpeg_command = [
12
+ "ffmpeg",
13
+ "-f", "lavfi", # Generate video using lavfi filter
14
+ "-i", "color=size=720x120:rate=25:color=black", # Black background video
15
+ "-i", AUDIO_FILE, # Audio file
16
+ "-vf", f"subtitles={SRT_FILE}:force_style='Fontsize=70'", # Add subtitles with font size
17
+ "-shortest", # Ensure the output video length matches the shortest input (audio or video)
18
+ VIDEO_FILE # Output video file
 
19
  ]
20
 
21
  async def text2video(TEXT):