TIMBOVILL commited on
Commit
9bb0840
·
verified ·
1 Parent(s): ddde924

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -55,15 +55,14 @@ def process_video(text):
55
 
56
  selected_video = random.choice(video_files)
57
  video = VideoFileClip(selected_video)
58
-
59
  start_time = random.uniform(0, max(0, video.duration - 60))
60
  video = video.subclip(start_time, min(start_time + 60, video.duration))
61
  video = video.resize(height=1920).crop(x1=video.w // 2 - 540, x2=video.w // 2 + 540)
62
 
63
  text_lines = text.split()
64
- formatted_text = "".join([" ".join(text_lines[i:i + 8]) for i in range(0, len(text_lines), 8)])
65
-
66
- text_clip = TextClip(formatted_text, fontsize=70, color='white', size=video.size, method='caption')
67
  text_clip = text_clip.set_position('center').set_duration(video.duration)
68
 
69
  final = CompositeVideoClip([video, text_clip])
 
55
 
56
  selected_video = random.choice(video_files)
57
  video = VideoFileClip(selected_video)
 
58
  start_time = random.uniform(0, max(0, video.duration - 60))
59
  video = video.subclip(start_time, min(start_time + 60, video.duration))
60
  video = video.resize(height=1920).crop(x1=video.w // 2 - 540, x2=video.w // 2 + 540)
61
 
62
  text_lines = text.split()
63
+ text = "\n".join([" ".join(text_lines[i:i+8]) for i in range(0, len(text_lines), 8)])
64
+
65
+ text_clip = TextClip(text, fontsize=70, color='white', size=video.size, method='caption')
66
  text_clip = text_clip.set_position('center').set_duration(video.duration)
67
 
68
  final = CompositeVideoClip([video, text_clip])