[FFmpeg-user] ffmpeg built static, yet "libopenjp2.so.7: cannot open shared object file"

Carl Eugen Hoyos ceffmpeg at gmail.com
Mon Aug 14 11:49:40 EEST 2017


2017-08-12 22:27 GMT+02:00 Moritz Barsnick <barsnick at gmx.net>:
> On Fri, Aug 11, 2017 at 16:27:16 -0700, tlum wrote:

>> static                    yes
>> shared                    no
>
> Well, either something is going wrong during the configure or linking
> process, or you are not using that ffmpeg binary.

(Nothing is "wrong" with the linking process: All linkers I know of
prefer dynamic libraries they find over static libraries in the same
directory - which makes sense.)

FFmpeg - as probably any other open source project - can be built
as a completely static binary but this is not related to above output
of configure nor to any configure option, it is a function of your
toolchain (and/or the toolchain-specific options that you pass to
configure).

The options --enable-shared and --disable-static (--disable-shared
and --enable-static being the default as can be seen above) only
control how the libav libraries that are shipped with FFmpeg are
built: Either only as static libraries (this is the default and it makes
testing easier because you can run the resulting ffmpeg binary
from the built directory without installing it as I alwas do) or only
as shared library or both.

If you want any of the external dependencies of FFmpeg (like
x264 or in your case libopenjpeg) linked statically, remove the
.so symlink from the x264/libopenjpeg or the /usr/local/lib*
directory.

If you want a truly static ffmpeg binary, consider using musl,
note that 32bit musl is NOT supported by FFmpeg and this is
not documented (FFmpeg developers are against documenting
this), and you may not immediately notice, the build process
works fine.

Carl Eugen


More information about the ffmpeg-user mailing list