Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -139,18 +139,20 @@ def dl(inp):
|
|
139 |
|
140 |
def trim_vid(vid,start_time,end_time):
|
141 |
print (vid)
|
142 |
-
start_hr=
|
143 |
start_min=int(start_time.split(":",2)[1])*60
|
144 |
start_sec=int(start_time.split(":",2)[2])
|
145 |
end_hr=int(end_time.split(":",2)[0])*360
|
146 |
end_min=int(end_time.split(":",2)[1])*60
|
147 |
-
end_sec=
|
148 |
start=start_hr+start_min+start_sec
|
149 |
end=end_hr+end_min+end_sec
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
|
|
|
|
154 |
frame_count = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
|
155 |
capture.release()
|
156 |
return out,out,frame_count
|
|
|
139 |
|
140 |
def trim_vid(vid,start_time,end_time):
|
141 |
print (vid)
|
142 |
+
start_hr=float(start_time.split(":",2)[0])*360
|
143 |
start_min=int(start_time.split(":",2)[1])*60
|
144 |
start_sec=int(start_time.split(":",2)[2])
|
145 |
end_hr=int(end_time.split(":",2)[0])*360
|
146 |
end_min=int(end_time.split(":",2)[1])*60
|
147 |
+
end_sec=float(end_time.split(":",2)[2])
|
148 |
start=start_hr+start_min+start_sec
|
149 |
end=end_hr+end_min+end_sec
|
150 |
+
|
151 |
+
|
152 |
+
|
153 |
+
#ffmpeg_extract_subclip(vid, start, end, targetname=f"{uid}-clip.mp4")
|
154 |
+
#out= f"{uid}-clip.mp4"
|
155 |
+
#capture = cv2.VideoCapture(out)
|
156 |
frame_count = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
|
157 |
capture.release()
|
158 |
return out,out,frame_count
|