Manage FFMPEG Dependency

I am developing an application (using Qt framework which has several dependencies like ffmpeg . Since I am mainly developing a form for macOS I use Homebrew to manage my dependencies like ffmpeg.

As a result, I ran into the problem of unexpected API changes when changing brew formula.

Homebrew mainteners advise me bad dependency handling practice through brew. So I'm wondering what would be the best option?

I am thinking about adding ffmpeg as a submodule of my project. What do you think about this?

+3


source to share


1 answer


If you need a specific version of some library that conflicts with the default as stated,

uninstall current release

download source of desired release https://ffmpeg.org/download.html#releases

decompress source code into some location then cd into there

      

impersonate

./configure 

      

study the output carefully and if there are no signs of ERROR and its search upstream of the library stream is correct, then issue as one of the following

make       # only uses one CPU core still works but slower than -jxxx
make -j4   # to speed up make and you have a dual core CPU
make -j8   # to speed up make and you have a quad core CPU

      



Now let's look at the output of make for and errors ... you can usually ignore the compilation warnings ... if everything seems to be ok then the problem (linux / OSX)

sudo make install

      

this will remove libraries and executables to standard locations that are visible for later linking by downstream applications

You can now compile your downstream code as usual to link to your newly allocated libraries from ffmpeg (there are many)

Above is the simplest case where you have already installed the developer utilities required to compile the source (compilers, linkers, ...)

If the above fails due to missing or incorrect version of the upstream library (s), repeat similar steps for the first ones and then fall back to compiling ffmpeg (recursive descent into library installation frenzy) ... I find compiling massive numbers open source libraries are simpler and standardized on Linux than OSX ... YMMV

+1


source







All Articles