0
votes

I'm trying to build OpenCV with opencv-contrib modules as extra modules using CMake-gui in order to get Cuda DNN to work with my GPU, but I got this error :

CMake Error at modules/videoio/cmake/detect_ffmpeg.cmake:16 (include): include could not find load file: C:/opencv_4/build/3rdparty/ffmpeg/ffmpeg_version.cmake

How can I fix this error?

  • OpenCV: 4.4.0 ( installed from source )
  • Cuda: 10.0
  • Cudnn:7.5
  • python 3.6
1
Can you please provide the full CMake output that contains this error? Some additional context would be helpful. What version of OpenCV are you using? Did all of the 3rdparty components get downloads properly? I.e. Is this C:/opencv_4/build/3rdparty/ffmpeg/ffmpeg_version.cmake a valid path on your machine?squareskittles
I will update the postabdou_dev
Answer to your question, Yes I have the path of ffmpeg_versionabdou_dev

1 Answers

1
votes

I solved this error by building and installing OpenCV 4.4.0-pre + OpenCV-contrib (cloned the projects from GitHub) and built using CMake GUI and Visual Studio 2019 (with VS 2017 as C++ toolset platform).

  1. Open CMake GUI and choose the OpenCV sources and OpenCV build folder (output folder).

  2. Click on Configure and choose the Visual Studio 2019 or 2017, depends on what you have.

  3. Start the Configure process.

  4. Set WITH_CUDA and OPENCV_EXTRA_MODULES_PATH to path/to/opencv_contrib/modules

  5. Click on Configure.

  6. WITH_CUDNN option should now appear. Set WITH_CUDNN and OPENCV_DNN_CUDA.

  7. Click on Configure.

  8. Click on Generate.

  9. Open OpenCV.sln.

  10. Set Build to Release instead of Debug.

  11. Right-click on All_build and click on build.

  12. After finishing this process, click on INSTALL and repeat the same task (right-click and choose build).

  13. Close OpenCV.sln solution, open CMD and write python.

  14. Write >>import cv2 and hit enter, then write >>print(cv2.__version__).

  15. If you get OpenCV 4-4.0-pre (or another version) that means everything should work.