我正在尝试使用CMake安装带有MSVC2015编译器的OpenCV 3.1.0。我收到一个错误,说文件哈希与预期的哈希不同。我无法在PC上访问互联网,这需要安装。我厌倦了在有互联网的PC上成功安装它,看看我是否可以将这些文件复制到没有互联网的PC上。但这不起作用,因为CMake删除了文件,并试图以自己的方式做到这一点。我也尝试了this解决方案,但它没有用。
以下是错误消息:
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)
我希望能够在没有互联网的情况下安装它,但它证明非常难以实现。有没有人对此有任何解决方案?
提前致谢。
答案 0 :(得分:-1)
我在ffmpeg.dll
中找到了子字符串opencv\sources\3dparty\ffmpeg\ffmpeg.cmake
:
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 ...)
下载文件: https://raw.githubusercontent.com/Itseez/opencv_3rdparty/8aeefc4efe3215de89d8c7e114ae6f7a6091b8eb/ffmpeg/ {opencv_ffmpeg.dll,opencv_ffmpeg_64.dll,ffmpeg_version.cmake}
并将其复制到:
opencv\sources\3rdparty\ffmpeg\downloads\%HASH%\
然后cmake.exe -G "CodeBlocks - MinGW Makefiles" .
和mingw32-make.exe