openCV_FFMPEG **.opencv 2.4.11中的dll错误,用于IP摄像机访问

opencv_ffmpeg**.dll error in OpenCV 2.4.11 for IP Camera Access?

本文关键字:错误 用于 IP 摄像机 dll 访问 FFMPEG opencv openCV 中的      更新时间:2023-10-16

我尝试通过Windows上使用OpenCV 2.4.11从IP摄像机中获取实时流。但是,它会引起错误,当我调试A访问时, Unhandled exception at 0x0000000066E5377F (opencv_ffmpeg2411_64.dll) in opencvAxisExp.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

我使用下面的代码来做到;

#include <stdio.h>
#include <opencv2/opencv.hpp>
#include <iostream>
int main(int, char**) {
    cv::VideoCapture vcap;
    cv::Mat image;
    // This works on a D-Link CDS-932L
    //const std::string videoStreamAddress = "http://user:pass@ip_address:port/axis-cgi/jpg/image.cgi?camera=1&resolution=320x240&compression=25 ";
    const std::string videoStreamAddress = "http:/user:pass@ip_address:port/axis-cgi/mjpg/video.cgi";
    //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;
    }
}

这是DLL错误还是这里缺少什么?你有什么建议吗?感谢您的任何评论。

我想您可能会缺少mjpg后缀。请参阅此答案。

相关文章: