how to get duration/length video.webm video file ..

asked 2020-07-10 11:08:46 -0600

updated 2020-07-11 02:29:02 -0600

berak gravatar image

hey , this is murugan . i am not getting video duration/length for my .webm file. its gives negative number pls help me:

video = cv2.VideoCapture("TEST000008.webm")
duration = video.get(cv2.CAP_PROP_POS_MSEC)
frame_count = video.get(cv2.CAP_PROP_FRAME_COUNT)
fps = video.get(cv2.CAP_PROP_FPS)
durationn = frame_count / fps

print("duration:",duration)
print("frame_count:",frame_count)
print("fps:",fps)
print("durationn:",durationn)

output is :

duration: 0.0
frame_count: -7.148113328562451e+16
fps: 7.75
durationn: -9223372036854776.0
edit retag flag offensive close merge delete