Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -43,6 +43,7 @@ def find_scenes(video_path, threshold=27.0):
|
|
43 |
gradio_components_outputs.append("json")
|
44 |
#print(scene_list)
|
45 |
|
|
|
46 |
shots = []
|
47 |
stills = []
|
48 |
|
@@ -58,7 +59,10 @@ def find_scenes(video_path, threshold=27.0):
|
|
58 |
shot_out = shot[1].get_frames() / framerate
|
59 |
|
60 |
tc_in = shot[0].get_timecode()
|
61 |
-
|
|
|
|
|
|
|
62 |
|
63 |
# Set name template for each shot
|
64 |
target_name = "shot_" + str(i+1) + "_" + filename + ".mp4"
|
@@ -112,7 +116,7 @@ def find_scenes(video_path, threshold=27.0):
|
|
112 |
# Would be nice to be able to return my results tuple as outputs,
|
113 |
# while number of chunks found is not fixed:
|
114 |
# return results
|
115 |
-
return
|
116 |
|
117 |
# —————————————————————————————————————————————————
|
118 |
|
|
|
43 |
gradio_components_outputs.append("json")
|
44 |
#print(scene_list)
|
45 |
|
46 |
+
timecodes = []
|
47 |
shots = []
|
48 |
stills = []
|
49 |
|
|
|
59 |
shot_out = shot[1].get_frames() / framerate
|
60 |
|
61 |
tc_in = shot[0].get_timecode()
|
62 |
+
tc_out = shot[1].get_timecode()
|
63 |
+
|
64 |
+
timecode = ["shot " + str(i+1) + " " + str(tc_in) + " -› " + str(tc_out) ]
|
65 |
+
timecodes.append(timecode)
|
66 |
|
67 |
# Set name template for each shot
|
68 |
target_name = "shot_" + str(i+1) + "_" + filename + ".mp4"
|
|
|
116 |
# Would be nice to be able to return my results tuple as outputs,
|
117 |
# while number of chunks found is not fixed:
|
118 |
# return results
|
119 |
+
return timecodes, shots, stills
|
120 |
|
121 |
# —————————————————————————————————————————————————
|
122 |
|