CMake opencv时Download: opencv_ffmpeg.dll、ippicv等失败的解决方法

    最近OpenCV更新到了3.4.1,下载了OpenCV3.4.1的源码,想编译一个VS2013X64的SDK,在CMake的时候一般会下载一些依赖(ffmpeg*.dll,ippicv*.zip)等。但是现在宿主机没有网络,CMake-Configure就会失败···,或者有时候网络很差,下载速度极慢或者干脆一直下载失败···CMake-Configure也会失败。失败提示如下图:

    

这几个错误是类似的就是Download failed。那只能手动下载了(没网络的换个有网的下载,下载一直失败也直接手动下载),那么问题来了。

    去哪里下载?

    下载后放哪里?

仔细看错误信息,可以打开download log file看看,如提示,我的在D:/Kits/OpenCV/opencv-source/opencv-3.4.1/build/CMakeDownloadLog.txt,打开可以看到如下内容:

# 下载获取opencv_ffmpeg.dll的过程
use_cache "D:/Kits/OpenCV/opencv-source/opencv-3.4.1/.cache"
do_copy "opencv_ffmpeg.dll" "b8120c07962d591e2e9071a1bf566fd0" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/0a0e88972a7ea97708378d0488a65f83e7cc5e69/ffmpeg/opencv_ffmpeg.dll" "D:/Kits/OpenCV/opencv-source/opencv-3.4.1/build/3rdparty/ffmpeg"
#missing "D:/Kits/OpenCV/opencv-source/opencv-3.4.1/build/3rdparty/ffmpeg/opencv_ffmpeg.dll"
#cmake_download "D:/Kits/OpenCV/opencv-source/opencv-3.4.1/.cache/ffmpeg/b8120c07962d591e2e9071a1bf566fd0-opencv_ffmpeg.dll" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/0a0e88972a7ea97708378d0488a65f83e7cc5e69/ffmpeg/opencv_ffmpeg.dll"
# timeout on name lookup is not supported
#   Trying 151.101.0.133...
# TCP_NODELAY set
# Connected to raw.githubusercontent.com (151.101.0.133) port 443 (#0)
# schannel: SSL/TLS connection with raw.githubusercontent.com port 443 (step 1/3)
# schannel: disabled server certificate revocation checks
# schannel: sending initial handshake data: sending 199 bytes...
# schannel: sent initial handshake data: sent 199 bytes
# schannel: SSL/TLS connection with raw.githubusercontent.com port 443 (step 2/3)
# schannel: failed to receive handshake, need more data
# schannel: SSL/TLS connection with raw.githubusercontent.com port 443 (step 2/3)
# schannel: failed to receive handshake, SSL/TLS connection failed
# Closing connection 0
# schannel: shutting down SSL/TLS connection with raw.githubusercontent.com port 443
# Send failure: Connection was reset
# schannel: failed to send close msg: Failed sending data to the peer (bytes written: 4294967295)
# schannel: clear security context handle
# 

# 下载获取opencv_ffmpeg_64.dll的过程
do_copy "opencv_ffmpeg_64.dll" "dc9c50e7b05482acc25d6ce0ac61bf1d" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/0a0e88972a7ea97708378d0488a65f83e7cc5e69/ffmpeg/opencv_ffmpeg_64.dll" "D:/Kits/OpenCV/opencv-source/opencv-3.4.1/build/3rdparty/ffmpeg"
#missing "D:/Kits/OpenCV/opencv-source/opencv-3.4.1/build/3rdparty/ffmpeg/opencv_ffmpeg_64.dll"
#cmake_download "D:/Kits/OpenCV/opencv-source/opencv-3.4.1/.cache/ffmpeg/dc9c50e7b05482acc25d6ce0ac61bf1d-opencv_ffmpeg_64.dll" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/0a0e88972a7ea97708378d0488a65f83e7cc5e69/ffmpeg/opencv_ffmpeg_64.dll"
# timeout on name lookup is not supported
#   Trying 151.101.0.133...
# TCP_NODELAY set
# Connected to raw.githubusercontent.com (151.101.0.133) port 443 (#0)
# schannel: SSL/TLS connection with raw.githubusercontent.com port 443 (step 1/3)
# schannel: disabled server certificate revocation checks
# schannel: sending initial handshake data: sending 199 bytes...
# schannel: sent initial handshake data: sent 199 bytes
# schannel: SSL/TLS connection with raw.githubusercontent.com port 443 (step 2/3)
# schannel: failed to receive handshake, need more data
# schannel: SSL/TLS connection with raw.githubusercontent.com port 443 (step 2/3)
# schannel: failed to receive handshake, SSL/TLS connection failed
# Closing connection 0
# schannel: shutting down SSL/TLS connection with raw.githubusercontent.com port 443
# Send failure: Connection was reset
# schannel: failed to send close msg: Failed sending data to the peer (bytes written: 4294967295)
# schannel: clear security context handle
# 

# 下载获取ffmpeg_version.cmake的过程
do_copy "ffmpeg_version.cmake" "3b90f67f4b429e77d3da36698cef700c" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/0a0e88972a7ea97708378d0488a65f83e7cc5e69/ffmpeg/ffmpeg_version.cmake" "D:/Kits/OpenCV/opencv-source/opencv-3.4.1/build/3rdparty/ffmpeg"
#missing "D:/Kits/OpenCV/opencv-source/opencv-3.4.1/build/3rdparty/ffmpeg/ffmpeg_version.cmake"
#cmake_download "D:/Kits/OpenCV/opencv-source/opencv-3.4.1/.cache/ffmpeg/3b90f67f4b429e77d3da36698cef700c-ffmpeg_version.cmake" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/0a0e88972a7ea97708378d0488a65f83e7cc5e69/ffmpeg/ffmpeg_version.cmake"
# timeout on name lookup is not supported
#   Trying 151.101.0.133...
# TCP_NODELAY set
# Connected to raw.githubusercontent.com (151.101.0.133) port 443 (#0)
# schannel: SSL/TLS connection with raw.githubusercontent.com port 443 (step 1/3)
# schannel: disabled server certificate revocation checks
# schannel: sending initial handshake data: sending 199 bytes...
# schannel: sent initial handshake data: sent 199 bytes
# schannel: SSL/TLS connection with raw.githubusercontent.com port 443 (step 2/3)
# schannel: failed to receive handshake, need more data
# schannel: SSL/TLS connection with raw.githubusercontent.com port 443 (step 2/3)
# schannel: failed to receive handshake, SSL/TLS connection failed
# Closing connection 0
# schannel: shutting down SSL/TLS connection with raw.githubusercontent.com port 443
# Send failure: Connection was reset
# schannel: failed to send close msg: Failed sending data to the peer (bytes written: 4294967295)
# schannel: clear security context handle
# 

# 下载获取ippicv_2017u3_win_intel64_general_20170822.zip的过程
do_unpack "ippicv_2017u3_win_intel64_general_20170822.zip" "0421e642bc7ad741a2236d3ec4190bdd" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/dfe3162c237af211e98b8960018b564bc209261d/ippicv/ippicv_2017u3_win_intel64_general_20170822.zip" "D:/Kits/OpenCV/opencv-source/opencv-3.4.1/build/3rdparty/ippicv"
#cmake_download "D:/Kits/OpenCV/opencv-source/opencv-3.4.1/.cache/ippicv/0421e642bc7ad741a2236d3ec4190bdd-ippicv_2017u3_win_intel64_general_20170822.zip" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/dfe3162c237af211e98b8960018b564bc209261d/ippicv/ippicv_2017u3_win_intel64_general_20170822.zip"
# timeout on name lookup is not supported
#   Trying 151.101.0.133...
# TCP_NODELAY set
# Connected to raw.githubusercontent.com (151.101.0.133) port 443 (#0)
# schannel: SSL/TLS connection with raw.githubusercontent.com port 443 (step 1/3)
# schannel: disabled server certificate revocation checks
# schannel: sending initial handshake data: sending 199 bytes...
# schannel: sent initial handshake data: sent 199 bytes
# schannel: SSL/TLS connection with raw.githubusercontent.com port 443 (step 2/3)
# schannel: failed to receive handshake, need more data
# schannel: SSL/TLS connection with raw.githubusercontent.com port 443 (step 2/3)
# schannel: failed to receive handshake, SSL/TLS connection failed
# Closing connection 0
# schannel: shutting down SSL/TLS connection with raw.githubusercontent.com port 443
# Send failure: Connection was reset
# schannel: failed to send close msg: Failed sending data to the peer (bytes written: 4294967295)
# schannel: clear security context handle
#

CMake后会发现opencv-source根目录下会出现一个.cache的文件夹,里面有需要下载的内容,如果下载失败所有的内容都是0KB如下图:




再看看CMakeDownloadLog.txt的第一句:use_cache "D:/Kits/OpenCV/opencv-source/opencv-3.4.1/.cache"说的就是这个意思。在看看第二句:do_copy "opencv_ffmpeg.dll" "b8120c07962d591e2e9071a1bf566fd0" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/0a0e88972a7ea97708378d0488a65f83e7cc5e69/ffmpeg/opencv_ffmpeg.dll" "D:/Kits/OpenCV/opencv-source/opencv-3.4.1/build/3rdparty/ffmpeg",说的是从https://raw.githubusercontent.com/opencv/opencv_3rdparty/0a0e88972a7ea97708378d0488a65f83e7cc5e69/ffmpeg/opencv_ffmpeg.dll这个网址下载opencv_ffmpeg.dll到D:/Kits/OpenCV/opencv-source/opencv-3.4.1/build/3rdparty/ffmpeg,其MD值为b8120c07962d591e2e9071a1bf566fd0,然后拷贝到.cache对应的文件夹下(该文件名为MD值+'-'+下载的文件名)。那么这个文件就类似脚本进行自动化下载,那么我们就知道手动要怎么搞了。

回答-去哪里下载:

    https://raw.githubusercontent.com/opencv/opencv_3rdparty/0a0e88972a7ea97708378d0488a65f83e7cc5e69/ffmpeg/opencv_ffmpeg.dll

回答-下载后放哪里:

    很显然下载后放.cache下对应的地方,然后改其名字为MD值+'-'+下载的文件名。比如opencv_ffmpeg.dll这个文件下载后凡在.cache下的ffmpeg下,然后改名为b8120c07962d591e2e9071a1bf566fd0-opencv_ffmpeg.dll替换原来0KB的那个文件。

    好了,接下来就是重复以上步骤,将opencv_ffmpeg_64.dll,ffmpeg_version.cmake,ippicv_2017u3_win_intel64_general_20170822.zip到对应的网址下载并放到.cache下对应的文件夹下然后改名字。最终效果如下图:



    最后再次CMake-Configure就成功通过了



  • 96
    点赞
  • 182
    收藏
    觉得还不错? 一键收藏
  • 69
    评论
CMake是一个跨平台的开源构建工具,可用于自动化管理项目的编译过程。FFmpeg是一个开源的音视频处理库,可以用来处理多种格式的音视频文件。而最后的下载的文件opencv_ffmpeg_64.dllOpenCV库所需的FFmpeg动态链接库。 当我们在使用CMake构建一个项目,可能会用到FFmpeg库来进行音视频处理。其中,OpenCV是一个广泛使用的计算机视觉库,它也能够使用FFmpeg进行音视频的编解码与处理。而opencv_ffmpeg_64.dllOpenCV库所需的FFmpeg依赖库,这个库在运行OpenCV相关功能需要被加载。 如果在使用CMake构建一个依赖于OpenCVFFmpeg的项目,若缺少opencv_ffmpeg_64.dll文件,可以通过下载获得该文件。可以通过在网上搜索opencv_ffmpeg_64.dll文件的下载链接,并将其下载到本地。下载完成后,将该文件放置在项目中指定的位置,一般来说是与其他的动态链接库(.dll文件)放在一起的。然后重新进行CMake构建,以确保项目能够正确加载该库文件。 需要注意的是,下载的文件必须与你的系统和项目的架构相匹配。例如,如果你的系统是64位的,那么你需要下载64位的opencv_ffmpeg_64.dll文件,而不是32位的。如果下载的文件与你的系统不匹配,可能会导致项目构建失败或运行错误。 总结来说,下载opencv_ffmpeg_64.dll文件是为了满足OpenCV库在进行音视频处理所依赖的FFmpeg库的加载需求。在使用CMake构建项目,下载并正确放置该文件,可以确保项目能够正确运行。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 69
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值