Update main.py
Browse files
main.py
CHANGED
@@ -99,9 +99,9 @@ async def create_slideshow(image_paths, audio_path, output_path, duration, zoom=
|
|
99 |
filter_complex = ""
|
100 |
for i in range(len(image_paths)):
|
101 |
# Each input's video stream is processed with zoompan.
|
102 |
-
# The zoom increases by zoom_ratio per frame (starting at 1.0).
|
103 |
filter_complex += (
|
104 |
-
f"[{i}:v]zoompan=z='if(eq(on,0),1,zoom+{zoom_ratio})':"
|
105 |
f"d={duration*fps}:s=hd720, setpts=PTS-STARTPTS[v{i}];"
|
106 |
)
|
107 |
# Concatenate all processed video segments.
|
@@ -127,7 +127,7 @@ async def create_slideshow(image_paths, audio_path, output_path, duration, zoom=
|
|
127 |
stdout=asyncio.subprocess.PIPE,
|
128 |
stderr=asyncio.subprocess.PIPE
|
129 |
)
|
130 |
-
|
131 |
|
132 |
# Remove temporary concat file if it exists
|
133 |
if not zoom and os.path.exists("temp_concat.txt"):
|
|
|
99 |
filter_complex = ""
|
100 |
for i in range(len(image_paths)):
|
101 |
# Each input's video stream is processed with zoompan.
|
102 |
+
# The zoom increases by zoom_ratio per frame (starting at 1.0) and centers the image.
|
103 |
filter_complex += (
|
104 |
+
f"[{i}:v]zoompan=z='if(eq(on,0),1,zoom+{zoom_ratio})':x='iw/2-(iw/zoom)/2':y='ih/2-(ih/zoom)/2':"
|
105 |
f"d={duration*fps}:s=hd720, setpts=PTS-STARTPTS[v{i}];"
|
106 |
)
|
107 |
# Concatenate all processed video segments.
|
|
|
127 |
stdout=asyncio.subprocess.PIPE,
|
128 |
stderr=asyncio.subprocess.PIPE
|
129 |
)
|
130 |
+
_, stderr = await process.communicate()
|
131 |
|
132 |
# Remove temporary concat file if it exists
|
133 |
if not zoom and os.path.exists("temp_concat.txt"):
|