Recently I wanted to rebuild the index of an AVI file in PCBSD. I know AVIDemux will do this if you open the AVI and set the audio / video encoding to copy, and save it. This is good, because AVIDemux is available as a PBI installation package for PCBSD. Unfortunately, AVIDemux failed to open the AVI file (probably because the index was bad and it got confused). Anyway, I know that mencoder (the encoder part of MPlayer) will also do this. It’s command line based, and not included in PCBSD. So, I built it from ports. It wouldn’t build with x264 support, but that’s ok, I got it to build with the ‘normal’ codec selection.
My first attempt to run it yielded:
[spanky@zen /usr/home/spanky]$ mencoder
/libexec/ld-elf.so.1: Shared object “libtwolame.so.0″ not found, required by “mencoder”
Bu in the build process it had stated that the TwoLame libraries were found. I don’t know where it found them, but *I* found them in the VLC directory. Because PCBSD uses isolated installation files (i.e. the installation file includes all “shared” libraries required by the program for execution), and it is possible to uninstall those programs, all libraries that a program needs are kept in that programs directory. That means, if you install 2 programs from a PBI that use the same library, you will have 2 copies of it on your system. This isn’t unusual, Windows does this as well. Anyway, I happened to have VLC installed from a PBI, and VLC uses the TwoLame library also. So, it was simply a matter of linking the VLC version to the normal library search paths so that mencoder would execute:
[root@zen]/lib(85)# ln -s /usr/Programs/vlc0.9.9a/lib/libtwolame.so.0 /usr/lib/libtwolame.so.0
And then everything was peachy and I could [M]Encode!