Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Deploying project with OpenCV and FFMPEG Error

Deploying project with OpenCV and FFMPEG Error

Scheduled Pinned Locked Moved Solved 3rd Party Software
4 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ClarkyC Offline
    ClarkyC Offline
    Clarky
    wrote on last edited by Clarky
    #1

    I'm trying to deploy an application that uses opencv and ffmpeg on OSX however I'm getting a crash at run time where the application is looking for a dylib.

    Dyld Error Message:
     Library not loaded: /usr/local/Cellar/ffmpeg/4.1.3/lib/libswresample.3.dylib
     Referenced from: /Applications/myApp.app/Contents/Frameworks/libavcodec.58.dylib
     Reason: image not found
    

    I can see all the libraries within the package contents after I've ran macdeploy. I have tried using the intall_name_tool to try and fix this issue with the following command:

    install_name_tool -change /usr/local/Cellar/ffmpeg/4.1.3/lib/libswresample.3.dylib 
    @executable_path/libswresample.3.dylib  
    /Users/me/code/build_output/MyAppQML/myApp.app/Contents/Frameworks/libavcodec.58.dylib
    

    The command runs however when I check the library with otool -L nothing has changed.

    @executable_path/../Frameworks/libavcodec.58.dylib (compatibility version 58.0.0, current version 58.35.100)
        /usr/local/Cellar/ffmpeg/4.1.3/lib/libswresample.3.dylib (compatibility version 3.0.0, current version 3.3.100)
        /usr/local/Cellar/ffmpeg/4.1.3/lib/libavutil.56.dylib (compatibility version 56.0.0, current version 56.22.100)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
        /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
        @executable_path/../Frameworks/liblzma.5.dylib (compatibility version 8.0.0, current version 8.4.0)
        @executable_path/../Frameworks/libopencore-amrwb.0.dylib (compatibility version 1.0.0, current version 1.3.0)
    

    Am I using the correct parameters for the install_name_tool?
    Im using QT 5.12.1 and Xcode 9.4.1.

    Im also using this in my shared.pri file:

    QT_CONFIG -= no-pkg-config
    CONFIG  += link_pkgconfig
    PKGCONFIG += opencv
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      From the looks of it, the command is correct. Note that your new path is wrong, it should be @executable_path/../Frameworks/libswresample.3.dylib

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • ClarkyC Offline
        ClarkyC Offline
        Clarky
        wrote on last edited by
        #3

        @SGaist said in Deploying project with OpenCV and FFMPEG Error:

        From the looks of it, the command is correct. Note that your new path is wrong, it should be @executable_path/../Frameworks/libswresample.3.dylib

        Hey, thanks for the reply, I fixed my command using your suggestion and managed to get my app working until it comes to the part with opencv where it just crashes.

        Dyld Error Message:
         Symbol not found: ___emutls_get_address
         Referenced from: /Applications/myApp.app/Contents/MacOS/../Frameworks/libgomp.1.dylib
         Expected in: /usr/lib/libSystem.B.dylib
        

        I've tried using the tool again to fix this but I'm not sure if that's the correct way to fix the issue as its a symbol issue rather than a library problem?

        1 Reply Last reply
        0
        • ClarkyC Offline
          ClarkyC Offline
          Clarky
          wrote on last edited by Clarky
          #4

          Managed to fix this by using:

          install_name_tool -change /usr/local/lib/gcc/8/libgcc_s.1.dylib 
          @executable_path/../Frameworks/libgcc_s.1.dylib 
          /Applications/myApp.app/Contents/Frameworks/libgomp.1.dylib
          

          libgomp.1.dylib was originally pointing to an older version of gcc inside /usr/local/lib/gcc

          Thanks for your help!

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved