Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -186,13 +186,14 @@ def create_subtitle_clips(subtitles, videosize, fontsize=32, color='yellow', deb
|
|
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(bidi_text, fontsize=fontsize, font='Arial Unicode MS
|
190 |
subtitle_x_position = 'center'
|
191 |
subtitle_y_position = video_height * 4 / 5
|
192 |
text_position = (subtitle_x_position, subtitle_y_position)
|
193 |
subtitle_clips.append(text_clip.set_position(text_position))
|
194 |
return subtitle_clips
|
195 |
|
|
|
196 |
def process_video(url):
|
197 |
|
198 |
input_video, input_audio = one_youtube(url)
|
|
|
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(bidi_text, fontsize=fontsize, font='Arial Unicode MS', color=color, bg_color='black', size=(video_width*3/4, None), method='label', align='West').set_start(start_time).set_duration(duration)
|
190 |
subtitle_x_position = 'center'
|
191 |
subtitle_y_position = video_height * 4 / 5
|
192 |
text_position = (subtitle_x_position, subtitle_y_position)
|
193 |
subtitle_clips.append(text_clip.set_position(text_position))
|
194 |
return subtitle_clips
|
195 |
|
196 |
+
|
197 |
def process_video(url):
|
198 |
|
199 |
input_video, input_audio = one_youtube(url)
|