Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -45,9 +45,13 @@ def find_scenes(video_path, threshold=27.0):
|
|
45 |
ffmpeg_extract_subclip(video_path, shot_in, shot_out, targetname=target_name)
|
46 |
data_outputs.append(target_name)
|
47 |
shots.append(target_name)
|
48 |
-
img = save_frame(video_path, scene[0].get_frames())
|
49 |
-
images_outputs.append(img)
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
#outputs.append("video")
|
52 |
#shot_in = scene_list[1][0].get_frames() / scene_list[1][0].get_framerate()
|
53 |
#shot_out = (scene_list[1][1].get_frames() - 1) / scene_list[1][0].get_framerate()
|
|
|
45 |
ffmpeg_extract_subclip(video_path, shot_in, shot_out, targetname=target_name)
|
46 |
data_outputs.append(target_name)
|
47 |
shots.append(target_name)
|
|
|
|
|
48 |
|
49 |
+
vid = cv2.VideoCapture(video_path)
|
50 |
+
for i in range(scene[0].get_frames(), 1):
|
51 |
+
vid.set(1, i)
|
52 |
+
ret, still = vid.read()
|
53 |
+
output_image = cv2.imwrite(f'{video_path}_frame{i}.jpg', still)
|
54 |
+
images_outputs.append(output_image)
|
55 |
#outputs.append("video")
|
56 |
#shot_in = scene_list[1][0].get_frames() / scene_list[1][0].get_framerate()
|
57 |
#shot_out = (scene_list[1][1].get_frames() - 1) / scene_list[1][0].get_framerate()
|