Ask Your Question

ip camera with opencv c++

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

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("");
while (cap.isOpened())
    cap >> frame;
    if (frame.empty()) break;

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


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

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

1 answer

Sort by ยป oldest newest most voted

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

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


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

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

Question Tools

1 follower


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

Seen: 1,919 times

Last updated: Mar 25 '15