TIMBOVILL commited on
Commit
22b864c
·
verified ·
1 Parent(s): 73594ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -37,7 +37,7 @@ def process_video(text):
37
  # Resize the video to have a width of 1080 while keeping the aspect ratio
38
  new_width = 1080
39
  new_height = int(video.h * (new_width / video.w))
40
- video = video.resize(width=new_width)
41
 
42
  # Crop the video to a 9:16 aspect ratio
43
  target_height = 1920
@@ -47,7 +47,7 @@ def process_video(text):
47
  text = "\n".join([" ".join(text_lines[i:i+8]) for i in range(0, len(text_lines), 8)])
48
 
49
  text_img = create_text_clip(text, fontsize=70, color='white', size=video.size)
50
- text_clip = ImageClip(text_img).set_duration(video.duration).set_position(('center', 'center')).set_opacity(0.5)
51
 
52
  final_clip = CompositeVideoClip([video, text_clip])
53
 
 
37
  # Resize the video to have a width of 1080 while keeping the aspect ratio
38
  new_width = 1080
39
  new_height = int(video.h * (new_width / video.w))
40
+ video = video.resize(width=new_width, resample=Image.LANCZOS)
41
 
42
  # Crop the video to a 9:16 aspect ratio
43
  target_height = 1920
 
47
  text = "\n".join([" ".join(text_lines[i:i+8]) for i in range(0, len(text_lines), 8)])
48
 
49
  text_img = create_text_clip(text, fontsize=70, color='white', size=video.size)
50
+ text_clip = ImageClip(text_img).set_duration(video.duration).set_position(('center', 'center')).set_opacity(1)
51
 
52
  final_clip = CompositeVideoClip([video, text_clip])
53