Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import random
|
|
7 |
import moviepy
|
8 |
from transformers import pipeline
|
9 |
from transformers.pipelines.audio_utils import ffmpeg_read
|
10 |
-
from moviepy import (
|
11 |
VideoFileClip,
|
12 |
TextClip,
|
13 |
CompositeVideoClip,
|
@@ -312,12 +312,12 @@ def process_entry(entry, i, video_width, video_height, add_voiceover, target_lan
|
|
312 |
|
313 |
# Create text clip for subtitles
|
314 |
txt_clip = TextClip(
|
315 |
-
|
316 |
font="./NotoSansSC-Regular.ttf",
|
317 |
color='yellow',
|
318 |
stroke_color='black',
|
319 |
stroke_width=2,
|
320 |
-
|
321 |
).with_start(entry["start"]).with_duration(entry["end"] - entry["start"]).with_position(('bottom')).with_opacity(0.8)
|
322 |
|
323 |
audio_segment = None
|
|
|
7 |
import moviepy
|
8 |
from transformers import pipeline
|
9 |
from transformers.pipelines.audio_utils import ffmpeg_read
|
10 |
+
from moviepy.editor import (
|
11 |
VideoFileClip,
|
12 |
TextClip,
|
13 |
CompositeVideoClip,
|
|
|
312 |
|
313 |
# Create text clip for subtitles
|
314 |
txt_clip = TextClip(
|
315 |
+
txt=entry["translated"],
|
316 |
font="./NotoSansSC-Regular.ttf",
|
317 |
color='yellow',
|
318 |
stroke_color='black',
|
319 |
stroke_width=2,
|
320 |
+
fontsize=int(video_height // 20),
|
321 |
).with_start(entry["start"]).with_duration(entry["end"] - entry["start"]).with_position(('bottom')).with_opacity(0.8)
|
322 |
|
323 |
audio_segment = None
|