0

I'm trying to install OpenCV 3.1.0 with MSVC2015 compiler using CMake. I get an error saying that the file hash is different from the expected hash. I have no access to internet on the PC this needs to be installed on. I tired to install it successfully on a PC with internet to see if I could copy those files to the PC without internet. But that didn't work as CMake deletes the files, and tries to do it it's own way. I also tried this solution, but it didn't work.

Here is the error message:

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)

I would like to be able to install this without internet, but it proves very diffucult. Does anyone have any solutions to this?

Thanks in advance.

Community
  • 1
  • 1
Troppsi
  • 1
  • 1
  • 2
  • There is a quite complete and nice tutorial [here](https://www.youtube.com/watch?v=akAAAvGyLn0) – Nacho Mar 02 '16 at 15:03

1 Answers1

-1
  1. I found sub-string ffmpeg.dll in 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 ...)
    
  2. Download files: https://raw.githubusercontent.com/Itseez/opencv_3rdparty/8aeefc4efe3215de89d8c7e114ae6f7a6091b8eb/ffmpeg/{opencv_ffmpeg.dll,opencv_ffmpeg_64.dll,ffmpeg_version.cmake}

    and copy it to:

    opencv\sources\3rdparty\ffmpeg\downloads\%HASH%\
    
  3. Then cmake.exe -G "CodeBlocks - MinGW Makefiles" . and mingw32-make.exe

jrbedard
  • 3,662
  • 5
  • 30
  • 34
NiMirage
  • 1
  • 1
  • 1
    @MartinGottweis, you can download these binaries from opencv repo: https://github.com/opencv/opencv_3rdparty/tree/ffmpeg/master_20170418 – NiMirage Jun 28 '17 at 13:32