qqwjq1981 commited on
Commit
e6f30c7
·
verified ·
1 Parent(s): 5e02fb0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -1,9 +1,19 @@
1
  import gradio as gr
2
- import moviepy.editor as mp
 
 
 
 
 
 
 
 
 
 
3
 
4
  def generate_video_segments(video_path, segment_length=5):
5
  """Splits the video into segments and returns their paths."""
6
- video = mp.VideoFileClip(video_path)
7
  segment_paths = []
8
 
9
  for i, start in enumerate(range(0, int(video.duration), segment_length)):
 
1
  import gradio as gr
2
+ from datetime import datetime
3
+ import random
4
+ from transformers.pipelines.audio_utils import ffmpeg_read
5
+ from moviepy import (
6
+ ImageClip,
7
+ VideoFileClip,
8
+ TextClip,
9
+ CompositeVideoClip,
10
+ AudioFileClip,
11
+ concatenate_videoclips
12
+ )
13
 
14
  def generate_video_segments(video_path, segment_length=5):
15
  """Splits the video into segments and returns their paths."""
16
+ video = VideoFileClip(video_path)
17
  segment_paths = []
18
 
19
  for i, start in enumerate(range(0, int(video.duration), segment_length)):