python opencv rtsp
# coding: utf-8 # 打开摄像头并灰度化显示 import cv2 as cv camera_id = "rtsp://admin:1222@192.168.0.218:554/jingli/realmonitor?channel=1&subtype=0" # 0表示摄像头的编号 capture = cv.VideoCapture(camera_id) while(True): ret, frame = capture.read() frame = cv.resize(frame,(1280,720)) # cv.imshow('frame', frame) if cv.waitKey(1) == ord('q'): break #
######################
QQ 3087438119