Spaces:
Sleeping
Sleeping
Update video_processing.py
Browse files- video_processing.py +3 -0
video_processing.py
CHANGED
@@ -79,6 +79,9 @@ def extract_frames(video_path, scene):
|
|
79 |
return frames
|
80 |
|
81 |
def extract_best_scene(video_path, scene):
|
|
|
|
|
|
|
82 |
start_time = scene[0].get_seconds()
|
83 |
end_time = scene[1].get_seconds()
|
84 |
video_clip = VideoFileClip(video_path).subclip(start_time, end_time)
|
|
|
79 |
return frames
|
80 |
|
81 |
def extract_best_scene(video_path, scene):
|
82 |
+
if scene is None:
|
83 |
+
return VideoFileClip(video_path) # Return the entire video if no scene is found
|
84 |
+
|
85 |
start_time = scene[0].get_seconds()
|
86 |
end_time = scene[1].get_seconds()
|
87 |
video_clip = VideoFileClip(video_path).subclip(start_time, end_time)
|