Get Frame Over RTSP using Opencv and gStreamer [closed]

asked 2015-08-26 03:49:13 -0600

SAyser gravatar image

updated 2017-09-02 21:49:29 -0600

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.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2017-09-02 21:49:41.593475