Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,19 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
def generate_video_segments(video_path, segment_length=5):
|
5 |
"""Splits the video into segments and returns their paths."""
|
6 |
-
video =
|
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)):
|