Ffmpeg as static library

Hello,

i am currently trying to link ffmpeg to my application as a static library (on Mac OS X / Xcode).

What i did so far:

  • i installed ffmpeg via homebrew (worked well)
  • i downloaded Daniel Walz’ filmstro_ffmpeg to see how he did it
  • filmstrom works well, but ffmpeg is linked dynamically here
  • i set up a minimalistic test project and tried linking ffmpeg statically, without success
  • but it works when linking dynamically

So my question is: what do i have to change in projucer so that XCode will link it as a static library?

Settings in projucer look like this so far. These settings will link dynamically.

Best
Clemens

N.B

  1. here: the filmstro_ffmpeg is no longer maintained, I moved everything to my more comprehensive foleys_video_engine. But if the old code works for you, that’s fine.

  2. You are aware of the limitations ffmpeg imposes on their library?
    FFmpeg License and Legal Considerations
    especially:

  1. Use dynamic linking (on windows, this means linking to dlls) for linking with FFmpeg libraries.

IANAL, so maybe you can link statically if you publish your source code under GPL, no idea.

Good luck

Hi Daniel,

thx for your reply!

To 1.: yes, i knew that, but i wanted to keep my first steps in that direction as simple as possible, so your old code was good enough for understanding.

To 2.: Thank you for pointing that out. Actually i had not read anything about that topic until now, since i am just experimenting around while learning juce and updating my c+±skills. I wanted to link statically, because i kind of hate dynamic linking. It just makes deployment more complicated and so on. But since this is a legal issue anyway, i’ll stick to dynamic linking :slight_smile:

Clemens

Totally understandable, everybody does :slight_smile: It’s unfortunately what they give us.

Some of it has to do with their methods (they used reverse engineering, that’s why they try to get everybody away from the disallow reverse engineering clause) or just because they want to promote the FOSS idea, which is fine. It just doesn’t work for everybody unfortunately.

I wish there was a middle ground for independent developers like us who don’t have a lot to spend but still want to go into proprietary software development.

Good luck for your project