Ask Your Question
0

ip camera with opencv c++

asked 2015-03-25 13:49:19 -0600

antithing gravatar image

Hi all, I know this has been asked before, but i can't get it to work despite that...

I have a foscam FI9821EP ip camera that i am trying to use inside opencv.

this code pops up a window, then closes it instantly. Driving me mad! Any help greatly appreciated.

Mat frame;
namedWindow("video", 1);
VideoCapture cap("http://192.168.1.90:88/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=xxx&pwd=xxx&.mjpg");
while (cap.isOpened())
{
    cap >> frame;
    if (frame.empty()) break;

    imshow("video", frame);
    if (waitKey(30) >= 0) break;
}
edit retag flag offensive close merge delete

Comments

url works in firefox, but not in opencv...

antithing gravatar imageantithing ( 2015-03-25 13:49:58 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-03-26 02:49:42 -0600

Subba Rao gravatar image

I ran your code and it works for me. So the issue has to be with your url for the camera.

edit flag offensive delete link more

Comments

thanks! turns out my ffmpeg wasn't installed properly. Anyone having the same problem, follow these instructions:

http://stackoverflow.com/questions/70...

antithing gravatar imageantithing ( 2015-03-26 13:44:13 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-03-25 13:49:19 -0600

Seen: 2,146 times

Last updated: Mar 25 '15