Hello Guys, I’m trying to run a code to show image and get motion detect but when I set to main stream my CPU usage goes to 100% and the image starts freezing frequently but when I set to extra stream, the images runs normally, what could I doing wrong ? I’m trying to run using a Pentium(R) Dual-Core CPU E6700 @ 3.20GHz 3.20 GHz, 6,00 GB, NVIDIA Quadro K660, Windows 10 x64, protocol RTSP. Thanks.
import cv2
cap = cv2.VideoCapture(“rtsp://admin:a10b20c30d40@192.168.0.116:554/cam/realmonitor?channel=1&subtype=0”)
while cap.isOpened():
ret, frame = cap.read()
resized = cv2.resize(frame, (600,400))
cv2.imshow(‘frame’, resized)
if cv2.waitKey(1) & 0xFF == ord(‘q’):
break