Update app.py
Browse files
app.py
CHANGED
@@ -184,9 +184,11 @@ def create_subtitle_clips(subtitles, videosize, fontsize, font, color, debug):
|
|
184 |
end_time = time_to_seconds(subtitle.end)
|
185 |
duration = end_time - start_time
|
186 |
video_width, video_height = videosize
|
|
|
|
|
187 |
#reshaped_text = arabic_reshaper.reshape(subtitle.text)
|
188 |
#bidi_text = get_display(reshaped_text)
|
189 |
-
text_clip = TextClip(font, subtitle.text, font_size=fontsize, size=(int(video_width * 0.8),
|
190 |
subtitle_x_position = 'center'
|
191 |
subtitle_y_position = video_height * 0.8
|
192 |
text_position = (subtitle_x_position, subtitle_y_position)
|
|
|
184 |
end_time = time_to_seconds(subtitle.end)
|
185 |
duration = end_time - start_time
|
186 |
video_width, video_height = videosize
|
187 |
+
max_width = video_width * 0.8
|
188 |
+
max_height = video_height * 0.2
|
189 |
#reshaped_text = arabic_reshaper.reshape(subtitle.text)
|
190 |
#bidi_text = get_display(reshaped_text)
|
191 |
+
text_clip = TextClip(font, subtitle.text, font_size=fontsize, size=(int(video_width * 0.8), int(video_height * 0.2)) ,text_align="center" ,color=color, bg_color='black', method='caption').with_start(start_time).with_duration(duration)
|
192 |
subtitle_x_position = 'center'
|
193 |
subtitle_y_position = video_height * 0.8
|
194 |
text_position = (subtitle_x_position, subtitle_y_position)
|