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

Ted Lum ffmpeg-archive.org at tedlum.com
Sun Aug 13 03:23:37 EEST 2017


On 8/12/2017 4:27 PM, Moritz Barsnick wrote:
> On Fri, Aug 11, 2017 at 16:27:16 -0700, tlum wrote:
>
> Wow, how did you manage to compose this email? See here, this is what
> the users get:
> http://ffmpeg.org/pipermail/ffmpeg-user/2017-August/036951.html
>
> I can see it here though:
> http://www.ffmpeg-archive.org/ffmpeg-built-static-yet-quot-libopenjp2-so-7-cannot-open-shared-object-file-quot-td4680895.html
Yea... terribly sorry about that. First time using that gateway... I had 
no I idea it was going to munge it like that. Promise I won't do that again.

>> I'm having trouble adding OpenJPEG to my ffmpeg build. I'm doing a static
>> build, still I'm getting:
>>
>> ffmpeg: error while loading shared libraries: libopenjp2.so.7: cannot open shared object file: No such file or directory
> So apparently, ffmpeg isn't static after all.
Well, in one sense it is, because most of the other libraries don't even 
build shared versions, so I know it does link and work with the static 
libraries. In another sense it's not, because C and C++ programs with 
dependencies on glibc aren't really static. My limited understanding is 
that it's kind of a hybrid.
>
>> ffmpeg is being configured like so:
>>
>> PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" \
>>    --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib -ldl" \
>>    --bindir="$HOME/bin" --pkg-config-flags="--static" \
>>    --enable-gpl \
>>    --enable-libfdk_aac \
>>    --enable-libfreetype \
>>    --enable-libmp3lame \
>>    --enable-libopus \
>>    --enable-libvorbis \
>>    --enable-libvpx \
>>    --enable-libx264 \
>>    --enable-libx265 \
>>    --enable-nonfree \
>>    --enable-libvidstab \
>>    --enable-libfontconfig \
>>    --enable-libfribidi \
>>    --enable-libass \
>>    --enable-libopenjpeg
> [...]
>> configure confirms:
>>
>> configure confirms:
>>
>> static                    yes
>> shared                    no
> Well, either something is going wrong during the configure or linking
> process, or you are not using that ffmpeg binary.
>
> What does
> $ which ffmpeg
> $ file ffmpeg
> $ ldd ffmpeg
> and finally
> $ ffmpeg
> say?
I'm sure there is only one copy of all the executables. They are 
actually deployed to /root/bin so they're kept highly isolated from the 
rest of the system. Since I've had so many problems with duplicate 
dependencies, combing the system for them is one of the first 
troubleshooting steps. I'm not opposed to shared libraries, what I'm 
opposed to is installing a shared library that didn't come from a 
repository in an rpm using yum. Otherwise, I find you tend to end up 
with a lot of stray, unmanaged, dependencies causing conflicts, and it 
makes it difficult to deploy applications when dependencies aren't 
readily available. When I'm forced to, I'll do an rpmbuild and drop them 
on the local repository so they're at least managed, deconflicted, and 
easy to deploy, but I'd rather manage one build than one build + a bunch 
of single use dependent libraries... economies of scale come from 
actually sharing shared objects.

So, we have:

[root at san1srvp01 ~]# which ffmpeg
/root/bin/ffmpeg

[root at san1srvp01 ~]# file /root/bin/ffmpeg
/root/bin/ffmpeg: ELF 64-bit LSB executable, x86-64, version 1 
(GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 
2.6.32, BuildID[sha1]=293e48bcdcde80eed190f5514bde9862cc3a6195, stripped

[root at san1srvp01 ~]# ldd /root/bin/ffmpeg
         linux-vdso.so.1 =>  (0x00007ffe29370000)
         libdl.so.2 => /lib64/libdl.so.2 (0x00007ff19d75e000)
         libass.so.5 => /lib64/libass.so.5 (0x00007ff19d534000)
         libm.so.6 => /lib64/libm.so.6 (0x00007ff19d231000)
         libfontconfig.so.1 => /lib64/libfontconfig.so.1 
(0x00007ff19cff4000)
         libfribidi.so.0 => /lib64/libfribidi.so.0 (0x00007ff19cddb000)
         libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00007ff19cb34000)
         libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007ff19c82b000)
         librt.so.1 => /lib64/librt.so.1 (0x00007ff19c623000)
         libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ff19c406000)
         libgomp.so.1 => /lib64/libgomp.so.1 (0x00007ff19c1e0000)
         liblzma.so.5 => /lib64/liblzma.so.5 (0x00007ff19bfba000)
         libz.so.1 => /lib64/libz.so.1 (0x00007ff19bda3000)
         libc.so.6 => /lib64/libc.so.6 (0x00007ff19b9e2000)
         /lib64/ld-linux-x86-64.so.2 (0x00007ff19d96d000)
         libharfbuzz.so.0 => /lib64/libharfbuzz.so.0 (0x00007ff19b789000)
         libexpat.so.1 => /lib64/libexpat.so.1 (0x00007ff19b55e000)
         libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007ff19b348000)
         libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007ff19b010000)
         libgraphite2.so.3 => /lib64/libgraphite2.so.3 (0x00007ff19ade3000)

I am using some shared libraries:

fribidi-0.19.4-6.el7.x86_64 : Library implementing the Unicode 
Bidirectional Algorithm
Repo        : @base
Matched from:
Filename    : /usr/lib64/libfribidi.so.0
Filename    : /usr/lib64/libfribidi.so.0.3.3

fribidi-devel-0.19.4-6.el7.x86_64 : Libraries and include files for FriBidi
Repo        : @base
Matched from:
Filename    : /usr/lib64/libfribidi.so

fontconfig-2.10.95-10.el7.x86_64 : Font configuration and customization 
library
Repo        : @base
Matched from:
Filename    : /usr/lib64/libfontconfig.so.1.7.0
Filename    : /usr/lib64/libfontconfig.so.1

fontconfig-devel-2.10.95-10.el7.x86_64 : Font configuration and 
customization library
Repo        : @base
Matched from:
Filename    : /usr/lib64/libfontconfig.so

freetype-2.4.11-12.el7.x86_64 : A free and portable font rendering engine
Repo        : @base
Matched from:
Filename    : /usr/lib64/libfreetype.so.6.10.0
Filename    : /usr/lib64/libfreetype.so.6

freetype-devel-2.4.11-12.el7.x86_64 : FreeType development libraries and 
header files
Repo        : @base
Matched from:
Filename    : /usr/lib64/libfreetype.so

libass-0.13.4-1.el7.x86_64 : Portable library for SSA/ASS subtitles 
rendering
Repo        : @epel
Matched from:
Filename    : /usr/lib64/libass.so.5.3.2
Filename    : /usr/lib64/libass.so.5

libass-devel-0.13.4-1.el7.x86_64 : Development files for libass
Repo        : @epel
Matched from:
Filename    : /usr/lib64/libass.so
Filename    : /usr/lib64/pkgconfig/libass.pc

Right now, it's compiled without --enable-libopenjpeg because I needed 
to get some work done. Otherwise you wouldn't even get the header (see 
below), you'd just get the missing library error.

[root at san1srvp01 ~]# ffmpeg
ffmpeg version N-86964-gf357104 Copyright (c) 2000-2017 the FFmpeg 
developers
   built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11)
   configuration: --prefix=/root/ffmpeg_build 
--extra-cflags=-I/root/ffmpeg_build/include 
--extra-ldflags='-L/root/ffmpeg_build/lib -ldl' --bindir=/root/bin 
--pkg-config-flags=--static --enable-gpl --enable-libfdk_aac 
--enable-libfreetype --enable-libmp3lame --enable-libopus 
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 
--enable-nonfree --enable-libvidstab --enable-libfontconfig 
--enable-libfribidi --enable-libass
   libavutil      55. 73.100 / 55. 73.100
   libavcodec     57.102.100 / 57.102.100
   libavformat    57. 76.100 / 57. 76.100
   libavdevice    57.  7.100 / 57.  7.100
   libavfilter     6. 98.100 /  6. 98.100
   libswscale      4.  7.102 /  4.  7.102
   libswresample   2.  8.100 /  2.  8.100
   libpostproc    54.  6.100 / 54.  6.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile 
options] outfile}...

>
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the ffmpeg-user mailing list