Cmake 编译opencv缺少出现下载ffmpeg

5 篇文章 0 订阅

编译opencv源码出现以下问题:

CMake Warning at cmake/OpenCVDownload.cmake:190 (message):
FFMPEG: Download failed: 6;"Couldn't resolve host name"
For details please refer to the download log file:
F:/opencv3.4.10/newbuild/CMakeDownloadLog.txt
Call Stack (most recent call first):
3rdparty/ffmpeg/ffmpeg.cmake:20 (ocv_download)
cmake/OpenCVFindLibsVideo.cmake:218 (download_win_ffmpeg)
CMakeLists.txt:602 (include)

 

如下CMakeDownloadLog.txt

#use_cache "E:/Install/opencv/opencv-3.4.10/.cache"
#do_copy "opencv_ffmpeg.dll" "301ae2000e25f800ab8e0065f277ad28" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/e81ccda615672833b578c6cefdb859ad69c560ba/ffmpeg/opencv_ffmpeg.dll" "Z:/opencv/x64/3rdparty/ffmpeg"
#missing "Z:/opencv/x64/3rdparty/ffmpeg/opencv_ffmpeg.dll"
#check_md5 "E:/Install/opencv/opencv-3.4.10/.cache/ffmpeg/301ae2000e25f800ab8e0065f277ad28-opencv_ffmpeg.dll"
#mismatch_md5 "E:/Install/opencv/opencv-3.4.10/.cache/ffmpeg/301ae2000e25f800ab8e0065f277ad28-opencv_ffmpeg.dll" "d41d8cd98f00b204e9800998ecf8427e"
#delete "E:/Install/opencv/opencv-3.4.10/.cache/ffmpeg/301ae2000e25f800ab8e0065f277ad28-opencv_ffmpeg.dll"
#cmake_download "E:/Install/opencv/opencv-3.4.10/.cache/ffmpeg/301ae2000e25f800ab8e0065f277ad28-opencv_ffmpeg.dll" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/e81ccda615672833b578c6cefdb859ad69c560ba/ffmpeg/opencv_ffmpeg.dll"
#try 1
# timeout on name lookup is not supported
# getaddrinfo(3) failed for raw.githubusercontent.com:443
# Couldn't resolve host 'raw.githubusercontent.com'
# Closing connection 0

#do_copy "opencv_ffmpeg_64.dll" "d87ce032289c3f811d02f0c3d8dbe366" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/e81ccda615672833b578c6cefdb859ad69c560ba/ffmpeg/opencv_ffmpeg_64.dll" "Z:/opencv/x64/3rdparty/ffmpeg"
#missing "Z:/opencv/x64/3rdparty/ffmpeg/opencv_ffmpeg_64.dll"
#check_md5 "E:/Install/opencv/opencv-3.4.10/.cache/ffmpeg/d87ce032289c3f811d02f0c3d8dbe366-opencv_ffmpeg_64.dll"
#mismatch_md5 "E:/Install/opencv/opencv-3.4.10/.cache/ffmpeg/d87ce032289c3f811d02f0c3d8dbe366-opencv_ffmpeg_64.dll" "d41d8cd98f00b204e9800998ecf8427e"
#delete "E:/Install/opencv/opencv-3.4.10/.cache/ffmpeg/d87ce032289c3f811d02f0c3d8dbe366-opencv_ffmpeg_64.dll"
#cmake_download "E:/Install/opencv/opencv-3.4.10/.cache/ffmpeg/d87ce032289c3f811d02f0c3d8dbe366-opencv_ffmpeg_64.dll" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/e81ccda615672833b578c6cefdb859ad69c560ba/ffmpeg/opencv_ffmpeg_64.dll"
#try 1
# timeout on name lookup is not supported
# getaddrinfo(3) failed for raw.githubusercontent.com:443
# Couldn't resolve host 'raw.githubusercontent.com'
# Closing connection 0

#do_copy "ffmpeg_version.cmake" "3b90f67f4b429e77d3da36698cef700c" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/e81ccda615672833b578c6cefdb859ad69c560ba/ffmpeg/ffmpeg_version.cmake" "Z:/opencv/x64/3rdparty/ffmpeg"
#missing "Z:/opencv/x64/3rdparty/ffmpeg/ffmpeg_version.cmake"
#check_md5 "E:/Install/opencv/opencv-3.4.10/.cache/ffmpeg/3b90f67f4b429e77d3da36698cef700c-ffmpeg_version.cmake"
#mismatch_md5 "E:/Install/opencv/opencv-3.4.10/.cache/ffmpeg/3b90f67f4b429e77d3da36698cef700c-ffmpeg_version.cmake" "d41d8cd98f00b204e9800998ecf8427e"
#delete "E:/Install/opencv/opencv-3.4.10/.cache/ffmpeg/3b90f67f4b429e77d3da36698cef700c-ffmpeg_version.cmake"
#cmake_download "E:/Install/opencv/opencv-3.4.10/.cache/ffmpeg/3b90f67f4b429e77d3da36698cef700c-ffmpeg_version.cmake" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/e81ccda615672833b578c6cefdb859ad69c560ba/ffmpeg/ffmpeg_version.cmake"
#try 1
# timeout on name lookup is not supported
# getaddrinfo(3) failed for raw.githubusercontent.com:443
# Couldn't resolve host 'raw.githubusercontent.com'
# Closing connection 0

#do_unpack "ippicv_2020_win_intel64_20191018_general.zip" "879741a7946b814455eee6c6ffde2984" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_win_intel64_20191018_general.zip" "Z:/opencv/x64/3rdparty/ippicv"
#check_md5 "E:/Install/opencv/opencv-3.4.10/.cache/ippicv/879741a7946b814455eee6c6ffde2984-ippicv_2020_win_intel64_20191018_general.zip"
#mismatch_md5 "E:/Install/opencv/opencv-3.4.10/.cache/ippicv/879741a7946b814455eee6c6ffde2984-ippicv_2020_win_intel64_20191018_general.zip" "d41d8cd98f00b204e9800998ecf8427e"
#delete "E:/Install/opencv/opencv-3.4.10/.cache/ippicv/879741a7946b814455eee6c6ffde2984-ippicv_2020_win_intel64_20191018_general.zip"
#cmake_download "E:/Install/opencv/opencv-3.4.10/.cache/ippicv/879741a7946b814455eee6c6ffde2984-ippicv_2020_win_intel64_20191018_general.zip" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/a56b6ac6f030c312b2dce17430eef13aed9af274/ippicv/ippicv_2020_win_intel64_20191018_general.zip"
#try 1
# timeout on name lookup is not supported
# getaddrinfo(3) failed for raw.githubusercontent.com:443
# Couldn't resolve host 'raw.githubusercontent.com'
# Closing connection 0

原因是https://raw.githubusercontent.com网站访问不了。

解决方案以win10为例子

1:进入 IPAddress.com 网站查询raw.githubusercontent.com真实地址。

 

2:打开C:\Windows\System32\drivers\etc\hosts,(需要使用管理员权限打开)

追加199.232.68.133 raw.githubusercontent.com如下:

3:再次打开cmake如下即可:

 

参考信息如下:

https://www.ioiox.com/archives/62.html

  • 8
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 11
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值