Update main.py
Browse files
main.py
CHANGED
@@ -69,6 +69,7 @@ async def create_slideshow(image_paths, audio_path, output_path, duration):
|
|
69 |
await f.write(f"file '{image_paths[-1]}'\n")
|
70 |
|
71 |
# Run ffmpeg command to create slideshow with audio
|
|
|
72 |
cmd = [
|
73 |
"ffmpeg",
|
74 |
"-f", "concat",
|
@@ -80,6 +81,7 @@ async def create_slideshow(image_paths, audio_path, output_path, duration):
|
|
80 |
"-c:a", "aac",
|
81 |
"-shortest",
|
82 |
"-y",
|
|
|
83 |
output_path
|
84 |
]
|
85 |
|
|
|
69 |
await f.write(f"file '{image_paths[-1]}'\n")
|
70 |
|
71 |
# Run ffmpeg command to create slideshow with audio
|
72 |
+
total_duration = len(image_paths) * duration
|
73 |
cmd = [
|
74 |
"ffmpeg",
|
75 |
"-f", "concat",
|
|
|
81 |
"-c:a", "aac",
|
82 |
"-shortest",
|
83 |
"-y",
|
84 |
+
"-t", str(total_duration),
|
85 |
output_path
|
86 |
]
|
87 |
|