Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2 as cv
- import random
- cap = cv.VideoCapture('file_name.avi')
- random_frame = random.randint(1,99999)
- cap.set(cv.CAP_PROP_POS_FRAMES,random_frame)
- ret, frame = cap.read()
- cv.imshow("random_frame",frame)
- while cap.isOpened():
- if cv.waitKey(1) == ord('q'):
- break
- cap.release()
- cv.destroyAllWindows()
Add Comment
Please, Sign In to add comment