Results 1 to 6 of 6

Thread: Problem with opencv in static mode

  1. #1
    Join Date
    May 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default 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:

    Qt Code:
    1. VideoCapture capture(url);
    2.  
    3. if (!capture.isOpened())
    4. {
    5. qDebug()<<"Problem opening video";
    6. qDebug() << QString::fromStdString(url);
    7. }
    To copy to clipboard, switch view to plain text mode 

    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

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Problem with opencv in static mode

    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.

  3. #3
    Join Date
    May 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default 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?

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default 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?

  5. #5
    Join Date
    May 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default 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:
    Qt Code:
    1. In file included from ffopencv.c:1:0:
    2. ../../modules/highgui/src/cap_ffmpeg_impl.hpp:71:6: erreur: #error "libswscale is necessary to build the newer OpenCV ffmpeg wrapper"
    3. #error "libswscale is necessary to build the newer OpenCV ffmpeg wrapper"
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default 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.

Similar Threads

  1. Static Linking Qt with openCV
    By harvey_slash in forum Newbie
    Replies: 4
    Last Post: 17th December 2013, 09:36
  2. Build static QT + static SSL problem.
    By makzimi in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2012, 00:45
  3. "Cannot find -lqjpeg" error when compiling QT application in static mode
    By JonathanReez in forum Installation and Deployment
    Replies: 7
    Last Post: 6th September 2011, 16:44
  4. OpenCv Problem
    By danics in forum Qt Programming
    Replies: 1
    Last Post: 13th April 2010, 11:40
  5. I've got a qt&opencv problem.
    By eralvc in forum Installation and Deployment
    Replies: 2
    Last Post: 23rd October 2008, 10:58

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.