Update app.py
Browse files
app.py
CHANGED
@@ -9,14 +9,13 @@ SRT_FILE = "output.srt"
|
|
9 |
FONT_SIZE = 40
|
10 |
|
11 |
ffmpeg_command = [
|
12 |
-
"ffmpeg",
|
13 |
-
"-
|
14 |
-
"-
|
15 |
-
"-i",
|
16 |
-
"-
|
17 |
-
"-
|
18 |
-
|
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):
|