Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -175,7 +175,12 @@ def trim_vid(vid,start_time,end_time):
|
|
| 175 |
end_sec=float(end_time.split(":",2)[2])
|
| 176 |
start=start_hr+start_min+start_sec
|
| 177 |
end=end_hr+end_min+end_sec
|
| 178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
out= f"{uid}-clip.mp4"
|
| 180 |
capture = cv2.VideoCapture(out)
|
| 181 |
frame_count = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
|
|
|
|
| 175 |
end_sec=float(end_time.split(":",2)[2])
|
| 176 |
start=start_hr+start_min+start_sec
|
| 177 |
end=end_hr+end_min+end_sec
|
| 178 |
+
|
| 179 |
+
clip = VideoFileClip(vid)
|
| 180 |
+
mod_fps=clip.fps
|
| 181 |
+
clip = clip.subclip(start, end)
|
| 182 |
+
clip.write_videofile(f"{uid}-clip.mp4", fps=mod_fps)
|
| 183 |
+
#ffmpeg_extract_subclip(vid, start, end, targetname=f"{uid}-clip.mp4")
|
| 184 |
out= f"{uid}-clip.mp4"
|
| 185 |
capture = cv2.VideoCapture(out)
|
| 186 |
frame_count = int(capture.get(cv2.CAP_PROP_FRAME_COUNT))
|