Get Frame Over RTSP using Opencv and gStreamer [closed]
My aim is to get frame from ip camera over rtsp and apply motion detection. I had OpenCV 2.4.9 in my machine and I tried to get frames from the ipcam by using VideoCapture class. But I get "error while decoding MB" error .I was able to grab frames but they were corruped. I google the error and find this topic.
After that, I have downloaded and and build OpenCV 3.0 with gStreamer and without ffmpeg support as suggested. Again I tried to get frame with this straight forward code, but I cannot open the stream.
VideoCapture cap;
cap.open("rtsp://admin:[email protected]:554/Streaming/Channels/1?transportmode=unicast&profile=Profile_1");
Mat frame;
if (!cap.isOpened())
cout << "Cannot open video frame" << endl;
cvNamedWindow("camera", CV_WINDOW_AUTOSIZE);
while (true)
{
if (!cap.read(frame))
break;
imshow("ARH camera", frame);
cvWaitKey(50);
}
I think, I am missing something but I cannot solve the problem. What is the problem here? Any ideas?
Regards.