Ask Your Question
0

OpenCV ip camera

asked 2014-03-01 16:54:03 -0600

I try to obtain the video of an ip cam but I obtain this message each time: WARNING: Couldn't read movie file http://XXX.XXX.XXX.XXX/mjpg/video.mjpg".

#include <opencv2/opencv.hpp>
int main(void)
{
cv::VideoCapture camera;
    camera.open("http://204.248.124.202/mjpg/video.mjpg"); 
    if (camera.isOpened()==true)
    {
        cv::namedWindow("camera");
        int key = 0;
        while (key != 27)
        {
            cv::Mat_<cv::Vec3b> image;        
            camera.grab();
            camera.retrieve(image);
            cv::imshow("camera",image);
            key = cv::waitKey(10);

        }
    }
}

Thanks.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-03-02 22:21:57 -0600

Amit gravatar image

updated 2014-03-02 22:23:30 -0600

hi use port also like this..

camera.open("rtsp://192.168.1.110:554/live.sdp");

use your IP address in place of 192.168.1.110

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-03-01 16:54:03 -0600

Seen: 1,374 times

Last updated: Mar 02 '14