带opencv的IP摄像机:错误ffmpeg

带opencv的IP摄像机:错误ffmpeg,opencv,ip-camera,Opencv,Ip Camera,我用的是VIVOTEK IP摄像头。我正在尝试将其与OPENCV接口。在输入用户名和密码后,internet explorer在此url处显示精细视频 代码如下所示 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 //resul

我用的是VIVOTEK IP摄像头。我正在尝试将其与OPENCV接口。在输入用户名和密码后,internet explorer在此url处显示精细视频

代码如下所示

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;


    }
const std::string videoStreamAddress=”http://192.168.100.128/main.html";
//我也试过”http://username:pasword@192.168.100.128/main.html“但相同
//结果
//而且还试过“http://192.168.100.128即不带“main.html”
如果(!vcap.open(videoStreamAddress))
{

std::cout您给出的URL就是问题所在。您可以使用如下URL

"http://username:password@ipOfCamera/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=30&.mjpg" 
或者另一种选择是下载iSpy软件并使用IP摄像头向导,它会为您找到URL,并为您正在使用的摄像头提供最佳选择。我确实使用了这种方法。 只要你想从IP摄像机获取实时视频。

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