PDA

View Full Version : Problem with opencv in static mode



oneirics
13th May 2015, 12:49
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:



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

d_stranz
15th May 2015, 17:03
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.

oneirics
17th May 2015, 13:58
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?

d_stranz
17th May 2015, 16:49
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?

oneirics
18th May 2015, 11:06
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:

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"

d_stranz
18th May 2015, 21:05
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.