I have made a Desktop application that has a live video stream, using C++. I use openCV’s VideoCapture.open() to open and run the stream on the application. It runs perfectly on debug and release mode on my system. Even after I package the application for deployment, and run the packaged application on my system, it runs perfectly.
However, when I try to run this packaged application on another PC, the application starts, but the stream is unable to open. Basically, the .open() function of VideoCapture returns false.
I am not sure what might be going wrong.
if this is on windows, mabe you forgot to pack the
opencv_ffmpegxxxx.dll which contains all video file functions / codecs.
@berak I just tried this. It still does the same thing.
Edit: Also, if this was the case, then it would not have worked even on my computer, right? But, it does work on mine.
…Wrong. It would have found the files elsewhere. You don’t mention how you package the application and for what kind of deployment under what OS, but automatic file collectors are often not perfect and miss some dependencies.
i’m still 80% sure, your app does not find the ffmpeg dll at runtime
It is a Qt application written in C++. I packaged it using Qt’s windeployqt.exe application.
Yes, it was not perfect and couldn’t run the application even on my own laptop initially (It showed pop-ups regarding missing dlls). But after I manually added all those missing dll, it worked perfectly on my laptop.
But somehow still not working on another machine.
As @berak suggested, I added the opencv_ffmpegxxxx.dll file to the package as well, and tried, but still got the same result.
I am using Windows. It is just a folder with the executable of the application, and all the dependencies/dll present along with it.
But I added it to the folder with the executable alongside all the other dll files. What can I do to make the dll discoverable in your opinion?
I forgot to add that I already have opencv_worldxxx.dll in the folder with the executable.
I found the problem. The dll that was missing was opencv_videoio_ffmpegxxx.dll.
When I added this to the folder with the executable, it worked.
Thanks for your help.