Parallel installation from sources and packet manager on the same system

Hi together,

I need help regarding parallel installtion from sources into /usr/local and via packet manager into /usr tree. I have to patch something on ffmpeg and I must use specific x264 svn versions to produce HD clips with Kdenlive because of a bug and a multithreading issue. So it isn't possible to use binaries from a distributor for producing clips. I've learned that it is necessary to build all from sources to keep full control of all my issues.
Meanwhile I've built all successfully from sources into /usr/local (libx264, ffmpeg svn, mlt0.5.10, Kdenlive0.7.8) and I'll use this to produce my HD clips.

Because of the changes to ffmpeg I was uninstalling itself and all other software who depends on it like VLC.
How is it possible to keep all the binaries from my distributor like VLC, ffmpeg and x264 which are good enough for all other purposes like playback parallel to my frozen producer environment from sources?

I've played around a little bit and there are the following issues/questions:

Issue #1
I get an error while making ffmpeg if libx264 is twice present (/usr/lib a. /usr/local/lib)
(With twice I mean including -devel package). Without -devel no problem.
make ...
LD ffmpeg_g
/home/cs/src/ffmpeg-checkout-2010-09-13/libavcodec/libavcodec.so: undefined reference to `x264_encoder_open_104'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Fehler 1

If only one libx264 is pressent, all works fine and ffmpeg is linked against it clean. Here against my own /usr/local build.
ldd /usr/local/bin/ffmpeg | grep x264
libx264.so.104 => /usr/local/lib/libx264.so.104 (0xb6562000)

Question #1
How can I control this manual while the build?

Question #2
The build of mlt works fine even if both ffmpegs are installed and with or without -devel package.
I've no idea which ffmpeg or libs is mlt using? /usr or /usr/local? How can I proof and control this?

Question #3
It seems that I've no problems with Kdenlive, because here I can set the path to melt.
Should I follow something here?

Thanks
Christian

Hi,

doing a double installation in /user and /usr local may result in a total mess for applications relying upon x264 and ffmpeg. It is not the recommended way to do some testing or to run some specific versions por personnal use.

If you do not want to have problems, install special versions in your home directory, to achieve that use --prefix=/home/username/yourdirectory in the configure process of each program.

Sunab.

I use --prefix=$HOME/opt when configuring the packages.
Then, in .bashrc or .profile, I add environment variables:

export PKG_CONFIG_PATH="$HOME/opt/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$HOME/opt/lib:$LD_LIBRARY_PATH"
export PATH="$HOME/opt/bin:$PATH"
export MLT_FREI0R_PLUGIN_PATH=$HOME/opt/lib/frei0r-1

You will need at least the first two set before trying to configure and build each project.

Back again after a fundamental distribution decision and a lot of other issues, I'll go ahead with OpenSuse 11.3 x64 which I've installed new from scratch.

Dan, thank's for your post, it works fine! But there's one problem left with x264, see below.

I've added lib64 directories to get all working fine, because some stuff is installed there...

export PKG_CONFIG_PATH="$HOME/opt/lib/pkgconfig:$HOME/opt/lib64/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$HOME/opt/lib:$HOME/opt/lib64:$LD_LIBRARY_PATH"
export PATH="$HOME/opt/bin:$PATH"

My 1st try was to build ffmpeg, mlt, kdenlive from sources into /home/chr/opt. At this moment no ffmpeg, mlt, kdenlive was parallel installed from binaries. Only libx264 and all the many other libs needed to build all was installed as binaries over the packet manager.
All is working fine!
Even if ffmpeg is installed from binaries prior, all is working fine. I've checked libmltavformat.so and it's pointing to my ffmpeg libav* in ~/opt.

But if I use my own x264 instead of the binaries, I get this error from ffmpeg configure script:
ERROR: libx264 not found

How can I solve this?
For testing I've added my ~/opt/lib(64) directories in the /etc/ld.so.conf file. From this moment on I can see my ~/opt lib's system wide in the ldconfig -p cache. It takes no effect, ffmpeg still couldn't find my own x264.

Here my other solved issue, feel free to comment.

ffmpeg:
After make install I have to copy libavutil/opt.h manually from the sources directory to ~/opt/include..
mlt failed to build without it.
ffmpeg is from svn snap Sept 30th

ffmpeg configure script is not using pkg-config, so you must also set CFLAGS and LDFLAGS:

export CFLAGS="-I$HOME/opt/include $CFLAGS"
export LDFLAGS="-L$HOME/opt/lib64 -L$HOME/opt/lib $LDFLAGS"

Thanks for helping! Now it works!

With this solution I'm able to use a separate environment only for producing with kdenlive. I can independent decide myself which versions should therefore be used and patching of ffmpeg is also possible.

Christian