From the command line, that way I can set FFMPEG_DIR=...
and then run cmake.exe ... .. OPENCV_FFMPEG_USE_FIND_PACKAGE=ON
Although I would have thought you should be able to achieve the same thing in the GUI if you add OPENCV_FFMPEG_USE_FIND_PACKAGE using Add Entry not Environment. The only problem is you then have to configure again and it might not pick up this additional variable.
Yes inside cmake-gui you can edit environment variables. I previously set the varibles in the Windows UI for environmental variables, which led them to appear in the Environment Editor of Cmake-gui. With cmd set you can achieve the same.
This might be the issue. I tried opening the gui with cmd, but added the OPENCV_FFMPEG_USE_FIND_PACKAGE=ON Flag. No difference.
but it set FFMPEG_FOUND to FALSE so package “FFMPEG” is considered to be
Call Stack (most recent call first):
I don’t know what you are doing differently, I just tried again from scratch setting OPENCV_FFMPEG_USE_FIND_PACKAGE=ON and FFMPEG_DIR to the directory containing the cmake script inside of the cmake gui and it picked up FFmpeg straight away.
Does your FFmpeg directory sturcture look similar to the below?
I can build OpenCV now, but I can’t use ist anymore.
On Windows I use VS Code with a CMakeLists.txt Configuration.
I can run normal C++ Code with no problem so far, but as soon as I add an OpenCV function (or even cv::Mat), the build exits with 0, but the whole code isn’t executed anymore, there is also no error message.
It may be that you haven’t added the path to the FFmpeg dll’s to your path, but in that case you would normally see an error informing you which dll is missing. Either way if you haven’t added the bin directory to your path you need to.
That error implies that VideoCapture inside of VideoReader failed to open the stream, however I can’t think of a reason why because the below worked for you
Is there any additional error messages?
Have you tried stepping through the code to see what is happening?
Do you get any additional info if you set the following environmental variables?