TIMBOVILL commited on
Commit
c937835
·
verified ·
1 Parent(s): 94d7c4b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -26,7 +26,8 @@ def create_text_clip(text, fontsize=70, color='white', size=(1080, 1920)):
26
  draw.text(((size[0] - w) / 2, (size[1] - h) / 2), text, font=font, fill=color)
27
  return img
28
 
29
- def process_video(video_path, text):
 
30
  if not os.path.isfile(video_path):
31
  raise FileNotFoundError(f"The file {video_path} does not exist.")
32
 
@@ -48,7 +49,7 @@ def process_video(video_path, text):
48
  final_clip = CompositeVideoClip([video, text_clip])
49
 
50
  # Save the final video
51
- output_path = "output_video.mp4"
52
  final_clip.write_videofile(output_path, codec="libx264", fps=24)
53
 
54
  return output_path
 
26
  draw.text(((size[0] - w) / 2, (size[1] - h) / 2), text, font=font, fill=color)
27
  return img
28
 
29
+ def process_video(video_file, text):
30
+ video_path = video_file.name
31
  if not os.path.isfile(video_path):
32
  raise FileNotFoundError(f"The file {video_path} does not exist.")
33
 
 
49
  final_clip = CompositeVideoClip([video, text_clip])
50
 
51
  # Save the final video
52
+ output_path = "/mnt/data/output_video.mp4"
53
  final_clip.write_videofile(output_path, codec="libx264", fps=24)
54
 
55
  return output_path