Python代码库OpenCV之04读取和播放视频(含代码)
代码
import cv2
import numpy as np
mountains_video = cv2.VideoCapture("D:\\pythondev\\dev\\opencv\\video\\tu.mp4")
while True:
ret, frame = mountains_video.read()
if not ret:break
cv2.imshow("frame", frame)
key=cv2.waitKey(25)
if key == 10 :
break
mountains_video.release()
cv2.destroyAllWindows()