Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -414,11 +414,13 @@ def create_subtitle_clip_pil(text, start_time, end_time, video_width, video_heig
|
|
414 |
|
415 |
img_np = np.array(img)
|
416 |
margin = int(video_height * 0.05)
|
|
|
|
|
417 |
txt_clip = (
|
418 |
-
|
419 |
.set_start(start_time)
|
420 |
.set_duration(end_time - start_time)
|
421 |
-
.set_position(
|
422 |
.set_opacity(0.9)
|
423 |
)
|
424 |
|
|
|
414 |
|
415 |
img_np = np.array(img)
|
416 |
margin = int(video_height * 0.05)
|
417 |
+
img_clip = ImageClip(img_np) # Create the ImageClip first
|
418 |
+
image_height = img_clip.size[1]
|
419 |
txt_clip = (
|
420 |
+
img_clip # Use the already created clip
|
421 |
.set_start(start_time)
|
422 |
.set_duration(end_time - start_time)
|
423 |
+
.set_position(("center", video_height - image_height - margin))
|
424 |
.set_opacity(0.9)
|
425 |
)
|
426 |
|