When I run this Python 2.7 code I get the output "k" immediately . Shouldn't "k" be printed after 5 seconds?

40 Views Asked by At
import numpy
import cv2

vid=cv2.VideoCapture("katy.avi")
cv2.waitKey(5000)
if vid.isOpened():
    print "k"

I am running this code on windows 8.1, Python 2.7 and numpy 1.9.1.

1

There are 1 best solutions below

2
On

I think I remember that pressing a key will trigger the end of waitKey(), thus skipping the 5s