在 Windows 7 上安装 OpenCV 3.1.0 with CMake,opencv_ffmpeg.dll无效的

Installing OpenCV 3.1.0 with CMake on Windows 7, opencv_ffmpeg.dll invalid hash

本文关键字:opencv CMake ffmpeg 无效 dll with Windows 安装 OpenCV      更新时间:2023-10-16

我正在尝试使用 CMake 安装带有MSVC2015编译器的 OpenCV 3.1.0。我收到一个错误,指出文件哈希与预期的哈希不同。我在需要安装的PC上无法访问互联网。我厌倦了在有互联网的PC上成功安装它,看看我是否可以在没有互联网的情况下将这些文件复制到PC。但这不起作用,因为 CMake 会删除文件,并尝试以自己的方式进行操作。我也尝试了这个解决方案,但没有用。

以下是错误消息:

CMake Warning at cmake/OpenCVUtils.cmake:872 (message):
  Download: Local copy of opencv_ffmpeg.dll has invalid MD5 hash:
  d41d8cd98f00b204e9800998ecf8427e (expected:
  89c783eee1c47bfc733f08334ec2e31c)
Call Stack (most recent call first):
  3rdparty/ffmpeg/ffmpeg.cmake:10 (ocv_download)
  cmake/OpenCVFindLibsVideo.cmake:206 (include)
  CMakeLists.txt:536 (include)
Downloading opencv_ffmpeg.dll...
CMake Error at cmake/OpenCVUtils.cmake:895 (file):
  file DOWNLOAD HASH mismatch
    for file: [C:/OpenCV/opencv/sources/3rdparty/ffmpeg/downloads/89c783eee1c47bfc733f08334ec2e31c/opencv_ffmpeg.dll]
      expected hash: [89c783eee1c47bfc733f08334ec2e31c]
        actual hash: [d41d8cd98f00b204e9800998ecf8427e]
             status: [6;"Couldn't resolve host name"]
Call Stack (most recent call first):
  3rdparty/ffmpeg/ffmpeg.cmake:10 (ocv_download)
  cmake/OpenCVFindLibsVideo.cmake:206 (include)
  CMakeLists.txt:536 (include)

CMake Error at cmake/OpenCVUtils.cmake:899 (message):
  Failed to download opencv_ffmpeg.dll.  Status=6;"Couldn't resolve host
  name"
Call Stack (most recent call first):
  3rdparty/ffmpeg/ffmpeg.cmake:10 (ocv_download)
  cmake/OpenCVFindLibsVideo.cmake:206 (include)
  CMakeLists.txt:536 (include)

我希望能够在没有互联网的情况下安装它,但事实证明它非常困难。有人对此有任何解决方案吗?

提前谢谢。

  1. 我在opencvsources3dpartyffmpegffmpeg.cmake中找到了子字符串ffmpeg.dll

    set(FFMPEG_BINARIES_COMMIT "8aeefc4efe3215de89d8c7e114ae6f7a6091b8eb")
    set(FFMPEG_FILE_HASH_BIN32 "89c783eee1c47bfc733f08334ec2e31c")
    set(FFMPEG_FILE_HASH_BIN64 "35fe6ccdda6d7a04e9056b0d73b98e76")
    set(FFMPEG_FILE_HASH_CMAKE "8606f947a780071f8fcce8cbf39ceef5")
    set(FFMPEG_DOWNLOAD_URL https://raw.githubusercontent.com/Itseez/opencv_3rdparty/${FFMPEG_BINARIES_COMMIT}/ffmpeg/)
    ocv_download(PACKAGE ...)
    
  2. 下载文件:https://raw.githubusercontent.com/Itseez/opencv_3rdparty/8aeefc4efe3215de89d8c7e114ae6f7a6091b8eb/ffmpeg/{opencv_ffmpeg.dll,opencv_ffmpeg_64.dll,ffmpeg_version.cmake}

    并将其复制到:

    opencvsources3rdpartyffmpegdownloads%HASH%
    
  3. 然后cmake.exe -G "CodeBlocks - MinGW Makefiles" .mingw32-make.exe