带opencv的IP摄像头:错误ffmpeg

时间:2013-05-09 05:57:32

标签: opencv ip-camera

我正在使用VIVOTEK IP摄像头。我正在尝试将其与OPENCV连接。输入用户名和密码后,Internet Explorer会在此网址上显示精美视频。

代码如下:

const std::string videoStreamAddress ="http://192.168.100.128/main.html";

//i have also tried "http://username:pasword@192.168.100.128/main.html" but the same
//result 
//and also tried ""http://192.168.100.128" i.e without "main.html"

if(!vcap.open(videoStreamAddress))
{

    std::cout << "Error opening video stream or file" << std::endl;


    }

我收到以下错误

 warning: Error openong file <../../modules/highgui/src/cap_ffmpeg_impl.hpp:529>
 Error opening video stream or file 

可能是什么问题?

1 个答案:

答案 0 :(得分:0)

您提供的URL是问题所在。您可以使用类似这样的网址

"http://username:password@ipOfCamera/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=30&.mjpg" 

或者另一个选择是下载iSpy软件并使用IP摄像头向导找到您的URL,并为您正在使用的摄像头提供最佳选择。我确实使用过这种方法。 Heres the code which worked for me.只要您想从IP摄像头获取实时信息。 Here's the list of URL which can be used to get the video from your IP Camera.