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 ".
Is it just a warning or does it fails to work due to that warning? Sometimes warnings are just parameters that could not be read to supply optimal performance, but it does actually work then.