Update app.py
Browse files
app.py
CHANGED
@@ -16,21 +16,21 @@ def find_scenes(video_path, threshold=27.0):
|
|
16 |
scene_manager.detect_scenes(video, show_progress=True)
|
17 |
scene_list = scene_manager.get_scene_list()
|
18 |
|
19 |
-
outputs = [scene_list]
|
20 |
#print(scene_list)
|
21 |
-
|
22 |
|
23 |
for i, scene in enumerate(scene_list):
|
24 |
shot_in = scene[0].get_frames() / scene[0].get_framerate()
|
25 |
shot_out = (scene[1].get_frames() - 1) / scene[0].get_framerate()
|
26 |
target_name = str(i)+"_cut.mp4"
|
27 |
ffmpeg_extract_subclip(video_path, shot_in, shot_out, targetname=target_name)
|
28 |
-
|
29 |
#shot_in = scene_list[1][0].get_frames() / scene_list[1][0].get_framerate()
|
30 |
#shot_out = (scene_list[1][1].get_frames() - 1) / scene_list[1][0].get_framerate()
|
31 |
#print(shot_in, shot_out)
|
32 |
|
33 |
-
print(outputs)
|
34 |
|
35 |
#ffmpeg_extract_subclip(video_path, shot_in, shot_out, targetname="cut.mp4")
|
36 |
|
|
|
16 |
scene_manager.detect_scenes(video, show_progress=True)
|
17 |
scene_list = scene_manager.get_scene_list()
|
18 |
|
19 |
+
#outputs = [scene_list]
|
20 |
#print(scene_list)
|
21 |
+
shots = []
|
22 |
|
23 |
for i, scene in enumerate(scene_list):
|
24 |
shot_in = scene[0].get_frames() / scene[0].get_framerate()
|
25 |
shot_out = (scene[1].get_frames() - 1) / scene[0].get_framerate()
|
26 |
target_name = str(i)+"_cut.mp4"
|
27 |
ffmpeg_extract_subclip(video_path, shot_in, shot_out, targetname=target_name)
|
28 |
+
shots.append(target_name)
|
29 |
#shot_in = scene_list[1][0].get_frames() / scene_list[1][0].get_framerate()
|
30 |
#shot_out = (scene_list[1][1].get_frames() - 1) / scene_list[1][0].get_framerate()
|
31 |
#print(shot_in, shot_out)
|
32 |
|
33 |
+
print(scene_list, *tuple(outputs), sep=', ')
|
34 |
|
35 |
#ffmpeg_extract_subclip(video_path, shot_in, shot_out, targetname="cut.mp4")
|
36 |
|