【转载】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就成功通过了!

————————————————
版权声明:本文为CSDN博主「KayChanGeek」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/KayChanGEEK/article/details/79919417

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 204,445评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,889评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,047评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,760评论 1 276
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,745评论 5 367
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,638评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,011评论 3 398
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,669评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,923评论 1 299
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,655评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,740评论 1 330
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,406评论 4 320
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,995评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,961评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,197评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,023评论 2 350
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,483评论 2 342