Update app.py
Browse files
app.py
CHANGED
@@ -123,7 +123,7 @@ def add_transcript_to_video(video_path, translated_json, output_path):
|
|
123 |
if isinstance(entry, dict) and "translated" in entry:
|
124 |
txt_clip = TextClip(
|
125 |
text=entry["translated"], font=font_path, method='caption', color='white', bg_color='black', size=video.size
|
126 |
-
).with_start(entry["start"]).
|
127 |
text_clips.append(txt_clip)
|
128 |
else:
|
129 |
raise ValueError(f"Invalid entry format: {entry}")
|
|
|
123 |
if isinstance(entry, dict) and "translated" in entry:
|
124 |
txt_clip = TextClip(
|
125 |
text=entry["translated"], font=font_path, method='caption', color='white', bg_color='black', size=video.size
|
126 |
+
).with_start(entry["start"]).with_duration(entry["end"] - entry["start"]).with_position(('bottom')).with_opacity(0.7)
|
127 |
text_clips.append(txt_clip)
|
128 |
else:
|
129 |
raise ValueError(f"Invalid entry format: {entry}")
|