LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-19-2014, 11:12 AM   #1
fsLeg
Member
 
Registered: Dec 2013
Location: Russia, Moscow
Distribution: Slackware, EndeavourOS
Posts: 89

Rep: Reputation: Disabled
Local ffmpeg libraries are linked against system ones


I used to be a fan of Opera browser. Now we have yacc (yet another chromium clone), but there's nothing I can do about it but grit my teeth and try to enjoy my web surfing.

One thing in the new Opera that kinda stands in my way is HTML5 audio and video support. Opera claims to support H.264 video and MP3 audio, but it actually doesn't. Well, this particular case is a known bug. But to actually to be able to support those it needs ffmpeg libraries. Opera Beta 25.0.1614.11 requires ffmpeg from 2.3 branch. And that's where the problem starts.

I have ffmpeg-2.1 installed on my system. ffmpeg is known to break its ABI with every major release, which means a headache with installed applications that depend on ffmpeg, so I decided to compile a local version of ffmpeg-2.3.3 (which I hoped to incorporate later in my SlackBuild that repackages the new Opera for Slackware). It compiles just fine. But when I start the browser with
Code:
LD_LIBRARY_PATH="/usr/lib64/opera-beta/ffmpeg:${LD_LIBRARY_PATH}" opera-beta
and navigate to a page with an H.264 video or MP3 audio, its page crashes. The terminal produces the following message:

Code:
/usr/lib64/opera-beta/opera-beta --type=renderer --alt-high-dpi-setting=96 --disable-direct-npapi-requests --enable-deferred-image-decoding --lang=ru --enable-proprietary-media-types-playback --disable-client-side-phishing-detection --with-feature:enhanced-autofill --enable-delegated-renderer --enable-impl-side-painting --disable-accelerated-video-decode --channel=1872.8.239267877: relocation error: /home/fsleg/tgz/ffmpeg-2.3.3/pkg/usr/lib64/opera-beta/ffmpeg/libavformat.so.55: symbol av_add_stable, version LIBAVUTIL_52 not defined in file libavutil.so.52 with link time reference
As you can see, LD_LIBRARY_PATH tells Opera where to look for libraries in case it needs ones, and it honestly tries to use those I provided. But it doesn't tell ffmpeg libraries where to look for their dependencies. For example, in this message we see that libavformat depends on libavutil. libavutil from ffmpeg-2.3.3 is located in the same directory libavformat resides, and this is the directory LD_LIBRARY_PATH points to. But for some reason libavformat links itself to libavutil from installed system-wide ffmpeg-2.1:

Code:
[fsleg@fsleg-slacktop:ffmpeg]$ LD_LIBRARY_PATH=/home/fsleg/tgz/ffmpeg-2.3.3/pkg/usr/lib64/opera-beta/ffmpeg ldd libavformat.so
        ...
        libavcodec.so.55 => /usr/lib64/libavcodec.so.55 (0x00007f5f3c15e000)
        libavutil.so.52 => /usr/lib64/libavutil.so.52 (0x00007f5f3bf0d000)
        ...
If I uninstall ffmpeg-2.1, libav* libraries link themselves correctly and I can watch cat videos on YouTube using HTML5 player. If ffmpeg-2.1 is present system-wide, there is a version mismatch when libraries from ffmpeg-2.3.3 try to link themselves.

This is definitely not an Opera's fault. And I don't think it has anything to do with ffmpeg. Most likely there's something I don't quite understand about dynamic library linking if there are tree-like dependencies. So my question is: how can I use local ffmpeg libraries while having the ones from the other version installed system-wide?
 
Old 09-19-2014, 11:52 AM   #2
ml4711
Member
 
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 146

Rep: Reputation: 103Reputation: 103
You need to set RPATH, when you build ffmpeg:
Maybe You need removepkg ffmpeg-2.1, while You build 2.3.3 ?

ffmpeg configure script has the option "--extra-ldflags"

Which can be used in this way!

Code:
./configure \
  --extra-ldflags="-Wl,-rpath,/usr/lib64/opera-beta/ffmpeg,-enable-new-dtags" \
  ...
  ...
Also se this thread about RPATH:

https://www.linuxquestions.org/quest...ath-4175507925

Enjoy

Last edited by ml4711; 09-19-2014 at 11:56 AM.
 
2 members found this post helpful.
Old 09-19-2014, 12:20 PM   #3
fsLeg
Member
 
Registered: Dec 2013
Location: Russia, Moscow
Distribution: Slackware, EndeavourOS
Posts: 89

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ml4711 View Post
You need to set RPATH, when you build ffmpeg
Thanks! That did the trick. And I learned something new today.
 
  


Reply

Tags
ffmpeg, libraries, opera



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to display static libraries linked in executables ? anctop Linux - General 6 04-14-2012 11:46 PM
Changing a binaries linked libraries piercey Linux - General 1 09-12-2007 06:02 PM
Dynamically linked libraries.. vishalbutte Programming 6 04-17-2006 08:54 PM
How to see which shared libraries are linked to a program zsjoska Linux - Newbie 2 11-19-2004 01:45 PM
Linux Dynamicly Linked Libraries sikil_nuru Programming 3 03-16-2004 07:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration