[FFmpeg-user] Loading shared libraries in macOS

Carl Zwanzig cpz at tuunq.com
Wed Aug 12 18:53:00 EEST 2020


On 8/12/2020 4:52 AM, Aleksid wrote:
> They can be loaded only if I use --prefix=/usr/local/Cellar/ffmpeg and then
> put dylibs into  /usr/local/Cellar/ffmpeg/libs folder.

Then do that, it's what --prefix is for.

> I understand that it is correct in a world of Unix systems. But I would
> prefer to keep dylibs locally, without copying into the system folder.

MacOS is in many ways a *nix system.


This is not an ffmpeg question, this is about how macos handles libraries. 
You'll probably get better information if you learn more about that.

On 8/12/2020 8:01 AM, Aleksid wrote:
> Well, I can copy FFmpeg dylibs to /usr/local/bin. But FFmpeg version
> 4.1, 4.2, 4.3 use the same file names, for example libavcodec.58.dylib.

Yes, that's correct.

> What should I do if  /usr/local/bin already contains dylibs with these
> file names? How can I guess about version 4.1, 4.2 or 4.3? If another
> program will rewrite these dylibs, and I'll get an older version of
> FFmpeg libs? It's another kind of dylib hell.
The whole point of shared libraries is that many applications can use them. 
If you want only your app and your build of ffmpeg to use these particular 
lib, make a subdir and put them in there.

z!
(who goes by 'z', not 'Carl')


More information about the ffmpeg-user mailing list