3

My team and I are working on a project with OpenCV (v. 2.4.2) and QT(v. 4.8.4). We are developing in QtCreator. It is a cross-platform project that will be primarily looking for movement in video files.

On the Mac OSX, the video file will open properly using the normal cv::VideoCapture object and interface and we can run our program successfully. However, on Windows, the file would not open, just throwing this error on the QtCreator terminal when the program exits:

warning: Error opening file (../../modules/highgui/src/cap_ffmpeg_impl.hpp:361)

However, when we set QtCreator to 'Release' build mode instead of 'Debug', the program opens the file as it should.

My teammate and I have done extensive research on this error and found no real solutions. We have tried installing codecs, moving the opencv_ffmpeg.dll file to the working directory of the .exe, and modifying the path with the location of the opencv_ffmpeg.dll (as well as the location of the ffmpeg library.) We have also made sure that our video is valid, as well as the file path (the same video works on a MacOS, and the video file will actually play in Windows through Qt's Phonon module).

Similar questions:

VideoCapture OpenCV 2.4.2 error in windows

Problem with VideoCapture in OpenCV 2.3

Any ideas about what could be causing this issue?

Community
  • 1
  • 1
Daedalus
  • 41
  • 1
  • 4

1 Answers1

1

Unfortunately, I can't give the reason but we also often get these problems if we use precompiled OpenCV dll's. The error is caused anywhere by connecting ffmpeg to the videocapture. In our case rebuilding OpenCV on the concerned computer fixed the error.

Tobias Senst
  • 2,665
  • 17
  • 38
  • Yeah that makes sense, we are using the precompiled dll's as well. When we recompile from the source, do we have to compile with/include ffmpeg in a special way or is that done automatically in OpenCV 2.4? – Daedalus Feb 12 '13 at 23:25
  • I every time use the default settings. Somehow than the codecs are connected correctly, but I do not know how excatly, perhaps opencv parse some system specific folders or settings. – Tobias Senst Feb 23 '13 at 08:19
  • I hope this is wrong (since [I cannot get OpenCV to build locally](http://stackoverflow.com/q/19439670/575530)) but it could be at the root of my problems too: http://stackoverflow.com/q/19598664/575530 – dumbledad Oct 26 '13 at 16:42