I have installed ffmpeg from the Ubuntu repositories. This creates the
following files:
* /usr/bin/ffmpeg
* /usr/lib/libavcodec.so.51.50
* /usr/lib/libavformat.so.52.7.0
* /usr/lib/i686/cmov/libavcodec.so.51
* /usr/lib/i686/cmov/libavformat.so.52
as well as some others, including some symlinks.
I have also built a new version of ffmpeg from the ffmpeg project. This
creates the following files:
* /usr/local/bin/ffmpeg
* /usr/local/lib/libavcodec.so.52.18
* /usr/local/lib/libavformat.so.52.29.2
and some others.
$ which ffmpeg reports /usr/local/bin.
When I run ffmpeg, it fails with a message about a missing symbol.
I know that all the libraries have been built correctly, because if I
set LD_LIBRARY_PATH=/usr/local/lib, then my new ffmpeg works correctly.
I read somewhere on google that it is Bad to set LD_LIBRARY_PATH, except
during development or to work around problems that have no other solution.
I have modified /etc/ld.so.conf, adding /usr/local/lib at the top of the
file, and run ldconfig -v; it indicates that the correctly libraries are
there in /usr/local/lib, and are at the top of the listing, so I assume
that they are loaded first.
Now, the only indication that something is wrong comes from
$ ldd /usr/local/bin/ffmpeg
:
: snip
:
libavformat.so.52 => /usr/lib/i686/cmov/libavformat.so.52 (0xb7ffa000)
libavcodec.so.52 => /usr/local/lib/libavcodec.so.52 (0xb7823000)
This shows that /usr/local/bin/ffmpeg is trying to use version 52 of
libavcodec; there is only the one in /usr/local/lib, so it uses the
right one.
However, it is trying to use version 0.52 of libavformat: there are two
of these. For some reason, it is ignoring the setting in /etc/ld.so.conf
and using the /usr/lib/i686/... version instead of my one.
* Is there something INSIDE /usr/local/bin/ffmpeg that makes it
prefer the /usr/lib... version? If so, how do I override it?
* Is /etc/ld.so.conf and ldconfig broken?
* ./configure can somehow detect which libraries are installed.
Perhaps this is broken and uses the wrong search path.
* How do I make it use MY version of libavcodec, libavformat, etc
without resorting to LD_LIBRARY_PATH?
* There is another library (libx264) that gives the same problem...
Some heavyweight solutions spring to mind:
* install into /usr/bin and /usr/lib, overwriting those files from
the packages; however, I am concerned that this will break during
upgrades.
* remove ffmpeg and its dependencies; however, this will mean
uninstalling everything that depends on these packages. I would
prefer not to do this.
* create my own .deb package and install that
=======================================================================
This email, including any attachments, is only for the intended
addressee. It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================