You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
491 B
Python
18 lines
491 B
Python
|
|
import cv2
|
|
url = 'rtsp://admin:我的密码@我的摄像头IP如169.254.115.55:554/h264/ch1/main/av_stream'
|
|
cap = cv2.VideoCapture(url)
|
|
while(cap.isOpened()):
|
|
# Capture frame-by-frame
|
|
ret, frame = cap.read()
|
|
# Display the resulting frame
|
|
|
|
# 读图保存图
|
|
cv2.imwrite("path",frame)
|
|
cv2.imshow('frame',frame)
|
|
|
|
if cv2.waitKey(1) & 0xFF == ord('q'):
|
|
break
|
|
# When everything done, release the capture
|
|
cap.release()
|
|
cv2.destroyAllWindows() |