Ask Your Question
0

ip camera with opencv c++

asked Mar 25 '15

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;
}
Preview: (hide)

Comments

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

antithing gravatar imageantithing (Mar 25 '15)edit

1 answer

Sort by » oldest newest most voted
0

answered Mar 26 '15

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.

Preview: (hide)

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 (Mar 26 '15)edit

Question Tools

1 follower

Stats

Asked: Mar 25 '15

Seen: 2,200 times

Last updated: Mar 25 '15