Omnibus commited on
Commit
25e162b
·
1 Parent(s): 4c19d70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -116,6 +116,8 @@ def dl(inp):
116
  return out,out,out,out
117
 
118
  def trim_vid(vid,start_time,end_time):
 
 
119
  start_hr=int(start_time.split(":",2)[0])*360
120
  start_min=int(start_time.split(":",2)[1])*60
121
  start_sec=int(start_time.split(":",2)[2])
@@ -125,7 +127,7 @@ def trim_vid(vid,start_time,end_time):
125
  start=start_hr+start_min+start_sec
126
  end=end_hr+end_min+end_sec
127
  #vid = f"{uid}-tmp.mp4"
128
- ffmpeg_extract_subclip(vid, start, end, targetname=f"{uid}-clip.mp4")
129
  out= f"{uid}-clip.mp4"
130
  return out,out
131
 
 
116
  return out,out,out,out
117
 
118
  def trim_vid(vid,start_time,end_time):
119
+ new_video_in = str(vid)
120
+ capture = cv2.VideoCapture(new_video_in)
121
  start_hr=int(start_time.split(":",2)[0])*360
122
  start_min=int(start_time.split(":",2)[1])*60
123
  start_sec=int(start_time.split(":",2)[2])
 
127
  start=start_hr+start_min+start_sec
128
  end=end_hr+end_min+end_sec
129
  #vid = f"{uid}-tmp.mp4"
130
+ ffmpeg_extract_subclip(capture, start, end, targetname=f"{uid}-clip.mp4")
131
  out= f"{uid}-clip.mp4"
132
  return out,out
133