Update main.py
Browse files
main.py
CHANGED
@@ -96,8 +96,9 @@ async def create_slideshow(image_paths, audio_path, output_path, duration, zoom=
|
|
96 |
# Add each image with zoompan effect
|
97 |
for i, img in enumerate(image_paths):
|
98 |
inputs.extend(["-loop", "1", "-t", str(duration), "-i", img])
|
99 |
-
# Apply zoom effect
|
100 |
-
|
|
|
101 |
|
102 |
# Concatenate all video segments
|
103 |
for i in range(len(image_paths)):
|
|
|
96 |
# Add each image with zoompan effect
|
97 |
for i, img in enumerate(image_paths):
|
98 |
inputs.extend(["-loop", "1", "-t", str(duration), "-i", img])
|
99 |
+
# Apply zoom effect with custom formula
|
100 |
+
zoompan_params = f"z='1+(0.04*{duration})*on/{duration*25}':x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':d={duration*25}:s=1920x1080"
|
101 |
+
filter_complex += f"[{i}:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1,zoompan={zoompan_params}[v{i}];"
|
102 |
|
103 |
# Concatenate all video segments
|
104 |
for i in range(len(image_paths)):
|