Omnibus commited on
Commit
a928efe
·
1 Parent(s): 24ad4e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
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=int(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=int(end_time.split(":",2)[2])
148
  start=start_hr+start_min+start_sec
149
  end=end_hr+end_min+end_sec
150
- #vid = f"{inp_out}.mp4"
151
- ffmpeg_extract_subclip(vid, start, end, targetname=f"{uid}-clip.mp4")
152
- out= f"{uid}-clip.mp4"
153
- capture = cv2.VideoCapture(out)
 
 
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