警告:打开错误文件(/build/opencv/modules/videoio/src/cap_ffmpeg_impl.



我无法在OpenCV上访问ipcamera,我使用ipcctrl应用程序来查看相机预览,但是当我尝试将URL粘贴到我的代码中时,它会显示警告警告:打开错误打开文件(/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:578)在这里有什么问题?这是在IPCCTRL中工作正常的证明

cv::Mat imgFrame1;
cv::Mat imgFrame2;
cv::VideoCapture capVideo;
const std::string videoStreamAddress = "http://admin:admin@192.168.8.50:8088/mjpeg.cgi?user=USERNAME&password=PWD&channel=0&.mjpg";
std::vector<Blob> blobs;
cv::Point crossingLine[2];
int carCount = 0;
std::ofstream writer;
writer.open("cars.txt");
writer.close();
capVideo.open(videoStreamAddress);
if (!capVideo.open(videoStreamAddress)) {                                                 // if unable to open video file
    std::cout << "error reading video file" << std::endl << std::endl;      // show error message
    _getch();                   // it may be necessary to change or remove this line if not using Windows
    return(0);                                                              // and exit program
}

我已经解决了这个问题,事实证明我对视频流的地址有不正确的URL,困难的部分是我的相机不知道,并且有一些有关如何配置它的文档。我使用ISPY应用程序为我的Kedacom相机生成适当的URL,并在VLC和应用程序和中提琴上对其进行了测试!它起作用。

最新更新