Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How can I view Live stream from IP camera via internet using OPENCV.

I want to create an application which can display video stream from IP camera using Opencv and MFC, c++. I am able to get video from my IP camera over the lan, But wondering if its possible via internet.

How can I view Live stream from IP camera via internet using OPENCV.

I want to create an application which can display video stream from IP camera using Opencv and MFC, c++. I am able to get video from my IP camera over the lan, But wondering if its possible via internet.

Code I tried.

int main(int, char**) { cv::VideoCapture vcap; cv::Mat image;

// This works on a D-Link CDS-932L
const std::string videoStreamAddress =

"http://admin:[email protected]:80/video.cgi?resolution=640x360&req_fps=50&.mjpg"; //const std::string videoStreamAddress = "http://admin:[email protected]:8088/mjpg/video.mjpg";

//open the video stream and make sure it's opened
if(!vcap.open(videoStreamAddress)) {
    std::cout << "Error opening video stream or file" << std::endl;
    return -1;
}

for(;;) {
    if(!vcap.read(image)) {
        std::cout << "No frame" << std::endl;
        cv::waitKey();
    }
    cv::imshow("Output Window", image);

    if(cv::waitKey(1) >= 0) break;
}    }

Get warning "Could not find codec parameter ".

How can I view Live stream from IP camera via internet using OPENCV.opencv?

I want to create an application which can display video stream from IP camera using Opencv and MFC, c++. I am able to get video from my IP camera over the lan, But wondering if its possible via internet.

Code I tried.

int main(int, char**) { cv::VideoCapture vcap; cv::Mat image;

// This works on a D-Link CDS-932L
const std::string videoStreamAddress =

"http://admin:[email protected]:80/video.cgi?resolution=640x360&req_fps=50&.mjpg"; //const std::string videoStreamAddress = "http://admin:[email protected]:8088/mjpg/video.mjpg";

//open the video stream and make sure it's opened
if(!vcap.open(videoStreamAddress)) {
    std::cout << "Error opening video stream or file" << std::endl;
    return -1;
}

for(;;) {
    if(!vcap.read(image)) {
        std::cout << "No frame" << std::endl;
        cv::waitKey();
    }
    cv::imshow("Output Window", image);

    if(cv::waitKey(1) >= 0) break;
}    }

Get warning "Could not find codec parameter ".