Update app.py
Browse files
app.py
CHANGED
|
@@ -37,16 +37,15 @@ def generate_video():
|
|
| 37 |
for l in range((int(len(words)/word_count))*word_count,len(words)):
|
| 38 |
line=line+words[l]+" "
|
| 39 |
lines.append(line)
|
|
|
|
| 40 |
image_olst=[]
|
| 41 |
for id in range(len(lines)):
|
| 42 |
create_text_image(lines[id],id*2,image_olst)
|
| 43 |
-
print(image_olst)
|
| 44 |
-
print(lines)
|
| 45 |
image_files = sorted(glob.glob(os.path.join(image_folder, "*.png")))
|
| 46 |
if not image_files:
|
| 47 |
raise ValueError("No images found in folder!")
|
| 48 |
|
| 49 |
-
clips = [ImageClip(m).set_duration(
|
| 50 |
video = concatenate_videoclips(clips, method="compose")
|
| 51 |
video_path = f"/tmp/video_{uuid.uuid4().hex}.mp4"
|
| 52 |
video.write_videofile(video_path, fps=24)
|
|
|
|
| 37 |
for l in range((int(len(words)/word_count))*word_count,len(words)):
|
| 38 |
line=line+words[l]+" "
|
| 39 |
lines.append(line)
|
| 40 |
+
print(lines)
|
| 41 |
image_olst=[]
|
| 42 |
for id in range(len(lines)):
|
| 43 |
create_text_image(lines[id],id*2,image_olst)
|
|
|
|
|
|
|
| 44 |
image_files = sorted(glob.glob(os.path.join(image_folder, "*.png")))
|
| 45 |
if not image_files:
|
| 46 |
raise ValueError("No images found in folder!")
|
| 47 |
|
| 48 |
+
clips = [ImageClip(m).set_duration(3) for m in image_files]
|
| 49 |
video = concatenate_videoclips(clips, method="compose")
|
| 50 |
video_path = f"/tmp/video_{uuid.uuid4().hex}.mp4"
|
| 51 |
video.write_videofile(video_path, fps=24)
|