Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,15 +18,15 @@ def find_scenes(video_path, threshold=27.0):
|
|
18 |
|
19 |
#print(scene_list)
|
20 |
|
21 |
-
shot_in = scene_list[0][0].
|
22 |
-
shot_out = scene_list[0][1].
|
23 |
#print(shot_in, shot_out)
|
24 |
|
25 |
#input_video_path = video_path
|
26 |
#output_video_path = 'video_out.mp4'
|
27 |
# ffmpeg_extract_subclip("full.mp4", start_seconds, end_seconds, targetname="cut.mp4")
|
28 |
ffmpeg_extract_subclip(video_path, shot_in, shot_out, targetname="cut.mp4")
|
29 |
-
print(output_video_path)
|
30 |
return scene_list, "cut.mp4"
|
31 |
|
32 |
video_input=gr.Video(source="upload", format="mp4", mirror_webcam="False");
|
|
|
18 |
|
19 |
#print(scene_list)
|
20 |
|
21 |
+
shot_in = scene_list[0][0].get_frames() / scene_list[0][0].get_framerate()
|
22 |
+
shot_out = scene_list[0][1].get_frames() / scene_list[0][0].get_framerate()
|
23 |
#print(shot_in, shot_out)
|
24 |
|
25 |
#input_video_path = video_path
|
26 |
#output_video_path = 'video_out.mp4'
|
27 |
# ffmpeg_extract_subclip("full.mp4", start_seconds, end_seconds, targetname="cut.mp4")
|
28 |
ffmpeg_extract_subclip(video_path, shot_in, shot_out, targetname="cut.mp4")
|
29 |
+
#print(output_video_path)
|
30 |
return scene_list, "cut.mp4"
|
31 |
|
32 |
video_input=gr.Video(source="upload", format="mp4", mirror_webcam="False");
|