-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVideoPlayer.py
More file actions
35 lines (23 loc) · 778 Bytes
/
VideoPlayer.py
File metadata and controls
35 lines (23 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import cv2
def emptyFunc():
pass
def main():
windowName = "OpenCV Video Player"
cv2.namedWindow(windowName)
cv2.createTrackbar('speed', windowName, 15, 60, emptyFunc)
filename = 'D:\\CODES\\OpenCV3\\OUTPUT\\WebcamVidRec.avi'
cap = cv2.VideoCapture(filename)
while (cap.isOpened()):
ret, frame = cap.read()
#print(ret)
if ret:
cv2.imshow(windowName, frame)
speed=cv2.getTrackbarPos('speed', windowName)
if cv2.waitKey(speed) == 27:
break
else :
break
cv2.destroyAllWindows()
cap.release()
if __name__ == "__main__":
main()