I'm trying to connect to a ip camera by rtsp protocoll to solve a object detection task, my issue is the access to the camera. I use the rtsp protocoll, and when I launch the system in release mode, after few minutes it gives me a bad memory access exception:
I access the camera using the following code:
VideoCapture cap;
Mat src;
cap.open("rtsp://<xxx>:<xxx>@ip_adress:554");
while(true){
cap.copyTo(src);
resize(src, src, Size(640, 480));
imshow("source", src);
char k = (char)cv::waitKey(25);
if (k == 27)
break;
}
I process the frame to apply a neural network, and I don't figure why the system give me this exception, after 4/5 minutes.
Thank's.