FFmpeg Openbsd with chroot howto PDF Print E-mail
User Rating: / 1
PoorBest 
Written by Bart Dorlandt   
Monday, 21 April 2008 00:00

I use this program in OpenBSD for Gallery2. FFmpeg needs some X libraries. The file it uses can be found in the xbaseXX.tgz package. You don't need to install the whole package. Just extract it in /tmp and copy the files:

  • libX11.so.10.0
  • libXau.so.9.0
  • libXdmcp.so.9.0
  • libXext.so.10.0
  • libfontconfig.so.5.1
  • libfreetype.so.14.0
to /usr/lib/. These files are located in /tmp/usr/X11R6/lib/ (if you extracted it here. See below a summary of commands):

change it to:

# be sure to be root for the following tasks
# (sudo su -l root)
part1=`uname -r | cut -d"." -f 1`
part2=`uname -r | cut -d"." -f 2`

cd /tmp
wget ftp://ftp.nluug.nl/pub/OpenBSD/`uname -r`/i386/xbase${part1}${part2}.tgz
cd /
# Use * instead of the number to make it more future proof
tar xzpf /tmp/xbase${part1}${part2}.tgz ./usr/X11R6/lib/libX11.so.*.*
tar xzpf /tmp/xbase${part1}${part2}.tgz ./usr/X11R6/lib/libXext.so.*.*
tar xzpf /tmp/xbase${part1}${part2}.tgz ./usr/X11R6/lib/libXau.so.*.*
tar xzpf /tmp/xbase${part1}${part2}.tgz ./usr/X11R6/lib/libXdmcp.so.*.*
tar xzpf /tmp/xbase${part1}${part2}.tgz ./usr/X11R6/lib/libfreetype.so.*.*

After this install FFmpeg and it will be completed.

pkg_add -ai ffmpeg-20070501p0

Chroot howto

First we will have to copy the file mentioned above to the same directory in the chroot environment. Copy these files to /var/www/usr/lib.

mkdir -p /var/www/usr/lib
cd /usr/lib
cp -p libX11.so.10.0 \
libXau.so.9.0 \
libXdmcp.so.9.0 \
libXext.so.10.0 \
libfontconfig.so.5.1 \
libfreetype.so.14.0 \
/var/www/usr/lib

Next, we will have to copy the program and its libraries to the chroot environment.

You might want use the script I wrote. This script will copy everything you need. Execute the following command:

./script /usr/local/bin/ffmpeg

After you have done this you'll need to make some symlinks in order to get ffmpeg to work.

cd /var/www/usr/lib
for x in `ls -1 ../local/lib/`; do ln -s ../local/lib/$x $x ; done

Now you may test it to see if ffmpeg works. To do this you need the program sh in /var/www/bin/. Then you may execute the following:

chroot /var/www /bin/sh
ffmpeg

If it print a huge list of commands if all went well.

Respond below if you have any questions.

Last Updated on Friday, 13 February 2009 15:40
 


Related items: