简体   繁体   中英

OpenCV ffmpeg DLL not loaded when running app on Windows 7, works on 8 and 10

I need to maintain a desktop app written in C++, using Qt and OpenCV for some video processing. As far as I understood, the decoding part of OpenCV is delegated to ffmpeg in a separate DLL for licensing reasons.

The development environment is on Windows 10, using QT Creator and MSVC12 64-bit as compiler. OpenCV version is 3.0, the official distribution. Here, everything runs fine, I am able to decode a video using VideoCapture::open().

Issues arise when I try to run the application in a standalone fashion with all the required DLLs in the same folder as the .exe file. All cases below are 64-bit OSes.

On a Windows 10 computer, not the same as the developement machine and no developer libraries present, the video decoding works fine. I have tested on a Windows 8 machine as well, no issues so far.

On Windows 7, the things get tricky. The same video files that successfully load during the previous tests are not recognized by the app at all ie the isOpened call on VideoCapture returns false. For further testing, I stripped the opencv_ffmpeg300_64.dll file to narrow down the issue on Windows 10 and 8; as expected, without this DLL the app is no more able to open the same video files.

It seems that the DLL is simply not recognized on Windows 7.

Edit: Further investigation using Process Explorer clearly shows that the aforementioned DLL is not loaded when the app runs on Windows 7.

  • Is there something specific about how Windows 7 manages the DLL path resolution and eventual security measures? Seems normal that the first search location is the same folder as the executable, which is the case here.

I have tried to trace using WinApiOverride32, with no results.

More specifically, the error data opencv_ffmpeg.dll can be caused by the following reasons:

  • Erroneous or corrupted registry entries for opencv_ffmpeg.dll
  • The virus or malware that damaged the opencv_ffmpeg.dll file.
  • Hardware failure, for example, a low-quality hard disk that caused corrupted file opencv_ffmpeg.dll.
  • Another program changed the required version of opencv_ffmpeg.dll.
  • Another program maliciously or by mistake deleted the file opencv_ffmpeg.dll.
  • Another program deleted opencv_ffmpeg.dll.

Building and Installing OpenCV with Extra Modules on Windows 7 64-bit

Auto-answer...

By upgrading to OpenCV 3.1 on that project some months ago, the issue was fixed. Can be some remainder of a bug in previous versions of the library

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM