Skip to main content
Topic: OPUSENC using libopus 1.1.2 instead of 1.1.3 (Read 1860 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

OPUSENC using libopus 1.1.2 instead of 1.1.3

Hi Folks,
I am using Linux Mint 18 which seems to have libopus 1.1.2 in the default repositories. I downloaded opus-1.1.3.tar.gz from, extracted it and built it as follows:

Code: [Select]
sudo make install

I also built the latest opus-tools (opus-tools 0.1.9) the same way.

The problem is when I run "opusenc file.flac file.opus" the command line states "Encoding using libopus 1.1.2 (audio)". Also when I check the version of libopus used to create the file by typing "strings file.opus | grep opus" the output is as follows:

Code: [Select]
libopus 1.1.2
ENCODER=opusenc from opus-tools 0.1.9E

So my question is, how can I ensure that libopus 1.1.3 is used by opusenc? Am I building it correctly? It seems to install ok and I compiled the latest libvorbis 1.3.5 this way and confirmed that my ogg vorbis files were indeed created using libvorbis 1.3.5.

I'd really appreciate if someone can confirm if they have successfully installed libopus 1.1.3 in Linux and can help with this query.


Re: OPUSENC using libopus 1.1.2 instead of 1.1.3

Reply #1
Without bothering you with too much ELF trivia.

You can either:
Code: [Select]
LD_PRELOAD=/usr/local/lib/ opusenc

Code: [Select]
LD_LIBRARY_PATH=/usr/local/lib opusenc

You can export LD_LIBRARY_PATH if you want opusenc and other tools to just pick the newer library. But that could be dangerous if you installed other self-compiled libraries there.


Ideally, you would switch to a rolling release distribution with a simple package manager, like Arch.
Then, all your packages would be already updated. And you can build packages yourself when needed, instead of (make install)ing stuff directly which is considered bad practice, and a stability hazard.

Re: OPUSENC using libopus 1.1.2 instead of 1.1.3

Reply #2
This might seem obvious, but have you run ldconfig since you plonked your new libraries down?

Many Linux distros now use /etc/ (and files in /etc/ to define the paths to search for shared libraries.  Typically this will contain /usr/local/lib, but not always.  The paths /usr and /usr/lib are typically "hard-coded" defaults, but entries in LD_LIBRARY_PATH and in /etc/ will be checked first.

You can use the ldd command to check which shared libraries a given program (or library) will use when it runs.  Handy when you're trying to get things like this set up.

Hopefully, all that ELF trivia will let you force (err... I meant properly configure) your new library into use.  As a last resort, you can uninstall the libopus package, but you might need to do a bunch of messing to get round the dependencies.  Or better yet, build the new one into a proper deb package and install that (replace 1.1.2) instead of doing a simple make install which always leads to trouble in the end.

Re: OPUSENC using libopus 1.1.2 instead of 1.1.3

Reply #3

opus: configure && make && make install will install it to /usr/local

opus-tools: configure will use pkg-config to search for opus.
Code: [Select]
pkg-config --modversion opus
will probably only find the system-installed opus in /usr, the old version.

Code: [Select]
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config --modversion opus
should however find 1.1.3 that you manually installed to /usr/local.

Pass that PKG_CONFIG_PATH to configure of opus-tools. After make and install the command
Code: [Select]
ldd /usr/local/bin/opusenc
should show something like => /usr/local/lib/
"I hear it when I see it."

Re: OPUSENC using libopus 1.1.2 instead of 1.1.3

Reply #4
Thank you very much Xnor and Lithopsian!

I was not really familiar with ldconfig at all (and am still a bit sketchy on it so will read up on it some more) but between both of your replies I managed to get opusenc to use the version of libopus (1.1.3) located in /usr/local/lib. Thanks for all your help!

Re: OPUSENC using libopus 1.1.2 instead of 1.1.3

Reply #5
@xnor your reply has nothing to do with picking the right library at run-time. rpath is not enabled by default.

Re: OPUSENC using libopus 1.1.2 instead of 1.1.3

Reply #6
I must be very dumb but I'm trying to compile Opus 1.3.1 and after
Code: [Select]
sudo make install

Code: [Select]
-bash: /usr/bin/opusenc: No such file or directory

Won't work. I'm compiling opus-1.3.1.tar.gz and opus-tools-0.2.tar.gz... is there something else I need to compile or I'm doing something wrong?

SimplePortal 1.0.0 RC1 © 2008-2019