Problem with opencv in static mode
Hello everyone !
I have an issue since some days. Let me explain : I am trying to create a video processing software. Everything works good, except now when I want to deploy this application statically . Now when I compile in static, I can no longer open the imagges and videos yet opened well before ... This is my simplify code:
Code:
VideoCapture capture(url);
if (!capture.isOpened())
{
qDebug()<<"Problem opening video";
qDebug
() <<
QString::fromStdString(url
);
}
The video does not open and there are no errors . I just have my qDebug () which tells me that the video does not open ... If anyone has a solution I'm interested.
Thanks in advance
Re: Problem with opencv in static mode
Quote:
except now when I want to deploy this application statically
What do you mean by this? If you aren't supplying the DLLs or other libraries / plugins needed to read images, then of course the app will fail.
Re: Problem with opencv in static mode
Thanks for replied !
I have already supplied the libraries.
I think i founds the problem. It's because of opencv_ffmpeg.dll. When i compile opencv to static libs with cmake, i have a opencv_ffmpeg.dll, but i need a opencv_ffmpeg.a to have a static lib. How do you think i can do?
Re: Problem with opencv in static mode
If you end up with a DLL, then you didn't do a static build. Perhaps there is a license restriction on mpeg that doesn't allow compiling to a static library and the cmake project is set up that way?
Re: Problem with opencv in static mode
Hum, yeah i think so too.
But do you know how can i have a static library of opencv_ffmpeg ?
I'm trying compiling opencv_ffmpeg by changing the make.bat, in 3rdparty of opencv sources, but i have an error, and i don't how i can resolve this:
Code:
In file included from ffopencv.c:1:0:
../../modules/highgui/src/cap_ffmpeg_impl.hpp:71:6: erreur: #error "libswscale is necessary to build the newer OpenCV ffmpeg wrapper"
#error "libswscale is necessary to build the newer OpenCV ffmpeg wrapper"
Re: Problem with opencv in static mode
I can't really help you much with this. The error is a compile-time assert. You need to find the "libswscale" library (try Google) and have that available during the compile. Looking at the source code where the error occurs would probably tell you more about it.