vericudebuget commited on
Commit
e971c05
·
verified ·
1 Parent(s): 7d7426a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -42,7 +42,7 @@ def get_video_length(video_path):
42
  video = cv2.VideoCapture(video_path)
43
  fps = video.get(cv2.CAP_PROP_FPS) # Frames per second
44
  total_frames = int(video.get(cv2.CAP_PROP_FRAME_COUNT)) # Total frames in the video
45
- duration = total_frames / fps if fps > 0 else 0 # Duration in seconds
46
  video.release()
47
  return duration
48
 
 
42
  video = cv2.VideoCapture(video_path)
43
  fps = video.get(cv2.CAP_PROP_FPS) # Frames per second
44
  total_frames = int(video.get(cv2.CAP_PROP_FRAME_COUNT)) # Total frames in the video
45
+ duration = int(total_frames / fps) if fps > 0 else 0 # Duration in seconds, as an integer
46
  video.release()
47
  return duration
48