报错信息:
FFMPEG: Downloading ffmpeg_version.cmake from https://raw.githubusercontent.com/opencv/opencv_3rdparty/7dd0d4f1d6fe75f05f3d3b5e38cbc96c1a2d2809/ffmpeg/ffmpeg_version.cmake
Try 1 failed
=======================================================================
Couldn't download files from the Internet.
Please check the Internet access on this host.
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:250 (message):
FFMPEG: Download failed: 6;"Couldn't resolve host name"
For details please refer to the download log file:
C:/Apps/opencv-4.7.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
3rdparty/ffmpeg/ffmpeg.cmake:20 (ocv_download)
modules/videoio/cmake/detect_ffmpeg.cmake:17 (download_win_ffmpeg)
modules/videoio/cmake/init.cmake:7 (include)
modules/videoio/cmake/init.cmake:11 (add_backend)
cmake/OpenCVModule.cmake:298 (include)
cmake/OpenCVModule.cmake:361 (_add_modules_1)
cmake/OpenCVModule.cmake:385 (ocv_glob_modules)
CMakeLists.txt:951 (ocv_register_modules)
解决思路:
更改cmake文件,使用GitHub Proxy 代理加速 (ghproxy.com)对网址进行转发。、
解决步骤:
① 打开opencv-4.7.0\cmake\OpenCVDownload.cmake,在157行下方增加两行:
(opencv-4.7.0为源码文件夹,不同版本的名称会不一样,如opencv-4.6.0等等)
set(MYPROXY "https://mirror.ghproxy.com/")
set(DL_URL "${MYPROXY}${DL_URL}")
② 修改完如下图所示(修改完记得保存文件!)
③ 修改完保存文件,用cmake再次configure,成功!文章来源:https://www.toymoban.com/news/detail-775713.html
文章来源地址https://www.toymoban.com/news/detail-775713.html
到了这里,关于(不用手动下文件)opencv用CMake编译下载失败解决的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!