Debian with lame, mencoder, transcode, xvid & dvd::rip

Debian has one of the largest software repositories around but also has a very strict policy (which I respect) when it comes to legal stuff concerning free software or copyrights. I guess this is the reason why some multimedia software packages are missing. If you stick with Debian you have to install them manually, or – if you want the easy way – you could of course add some third party respositories or change for example to Ubuntu which doesn’t seem to share Debian’s concerns. As I’m running sidux (which is based on Debian Sid) I wanted to go for the manual installation (I don’t like to add repositories other than Debian’s). Debian comes with an MPlayer package but it lacks menconder. If you need menconder you’ll have to install from sources. lame, transcode, xvid and dvd::rip are not part of Debian repositories at all, so we’ll have to install them from sources, too. In this HOWTO I’ll explain how this worked for me (running sidux on amd64). I guess it should be similar to Debian testing or even stable.

Before starting please make sure you have the following packages installed:

  • build-essential
  • devscripts
  • debhelper
  • dpkg-dev
  • fakeroot

Installing lame

lame is one of the best open source mp3 encoders but as copyrights are a bit blurry it’s not included with Debian. Installing it is very easy though. First we have to install some dependencies:

apt-get install libncurses5-dev libsndfile1-dev nasm

(if you’re running an i386 Debian you might have to add “nasm“)

Get the lame sources from here, which are by the time of writing version 3.98.2. Create a temporary directory, change to it and unpack the sources:

mkdir lame
cd lame
tar xvf /path/to/lame-XXX.tar.gz
cd lame-XXX

You may notice that there’s already a “debian” subdirectory – so we’re (almost) ready to generate a genuine Debian package. There are two little things we have to take car of before we start. This might change with following versions of lame, but with lame 3.98.2 we need to change the first line in debian/changelog: it holds the wrong version number, so change

lame (3.98.1) unstable; urgency=low

to

lame (3.98.2) unstable; urgency=low

Otherwise your package will be named after 3.98.1 but in fact holds version 3.98.2. The second thing we need to do is making debian/rules executable:

chmod +x debian/rules

Once you’re done, build the package with

dpkg-buildpackage -rfakeroot

If everything runs through without errors, you may install the packages via

cd ..
su
dpkg -i *.deb

This will install all the packages, including development files (you may need them later on). And done!

Installing MPlayer

MPlayer makes it quite easy to build a Debian package, too. What makes the process rather complicated is fulfilling the requirements. If you have the native Debian MPlayer package installed, please remove it with

apt-get purge mplayer

And remove the .mplayer folder in your home directory:

cd
rm -r .mplayer

Now create a temporary directory and then get the latest MPlayer via subversion:

mkdir mplayer
cd mplayer
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

(If you’re missing "svn", please install the package “subversion” from Debian’s repositories.) Now change to the newly created mplayer subdirectory and run configure:

cd mplayer
./configure

This is just test run to see which dependencies are missing. You can check configure.log for this purpose. Just look around for “Result is: no”, see if you need this feature and install the corresponding header files. Just to give you an example:

============ Checking for pulse ============
#include
int main(void) { return 0; }
.
.
.
Result is: no
##########################################

You could now install libpulse-dev by

apt-get install libpulse-dev

and the next time you run configure you will find “Result is: yes” here. Most of those development packages will likely to be named as “libSOMETHING-dev”. To make it easier, you could just copy and paste what I have installed:

apt-get install libcdio-dev libcdio-cdda-dev libsmbclient-dev libxv-dev libxvmc-dev libdirectfb-dev libgtk-directfb-2.0-dev libxss-dev libxv-dev libxxf86vm-dev libxxf86misc-dev libxxf86dga-dev libggi2-dev libggiwmh0-dev libaa1-dev libcaca-dev libsvga1-dev libdvb-dev libgif-dev xserver-xorg-dev libsdl1.2-dev libpulse-dev libopenal-dev libcdparanoia0-dev libfribidi-dev libenca-dev liblzo2-dev libtwolame-dev libtwolame-dev libspeex-dev libtheora-dev vorbis-tools libmpcdec-dev libavcodec-dev ladspa-sdk liblivemedia-dev libdv4-dev libschroedinger-dev vstream-client-dev liblircclient-dev

This should leave you with a working mplayer. If you like to update sometime to a future svn build of mplayer you might add your personal version number to the package name. To do so edit debian/changelog and change the first line from

mplayer (1.0svn) unstable; urgency=low

to

mplayer (1.0svn1) unstable; urgency=low

The next time you build an mplayer package you could append “2″ and so on…

To actually build the mplayer package now invoke

DEB_BUILD_OPTIONS="--enable-gui --enable-menu" fakeroot debian/rules binary

This will take a while…

When done:

cd ..
su
dpkg -i mplayer_1.0svn1_[i386|amd64].deb
(depending on your architecture)

This might leave you with some error messages concerning unmet dependencies of libconfhelper-perl. Sadly, this package isn’t available in Debian Sid (at least it wasn’t by the time of writing). Please check if you can install it by

apt-get install libconfhelper-perl

If this fails, get the source from Debian etch here. Then make sure the package liblogfile-rotate-perl is installed. If not, please do so:

apt-get install liblogfile-rotate-perl

Now create a temporary directory, change to it an unpack the source tarball of libconfhelper-perl. All dependencies should be installed already (perl and debhelper). You can just go on building the package:

mkdir libconfhelper-perl
cd libconfhelper-perl
tar xvf /path/to/libconfhelper-perl_0.12.5.tar.gz
cd libconfhelper-perl-0.12.5
dpkg-buildpackage -rfakeroot
cd ..
su
dpkg -i libconfhelper-perl_0.12.5_all.deb

This last step should configure the mplayer package correctly. Before you can start you have to install a skin, which is done very easily by

apt-get install mplayer-skin-blue

You may optionally install the browser plugin (“mozilla-mplayer”), too. Now open a terminal and start mplayer by

gmplayer

If it starts up witch no significant error message, you’re done! There will be a shortcut in your KDE / Gnome Menu, too.

Installing transcode

Transcode also has some dependencies. Most of them are not required but useful. I followed this guide which helped pretty well. Again look out for the development packages like “libSOMETHING-dev”. This is what I installed:

apt-get install libzip1 libzip-dev libmpeg2-4-dev libpostproc-dev libavifile-0.7c2 libavifile-0.7-dev avifile-* liba52-0.7.4-dev libmagick++9-dev imagemagick libmagick++10

The rest is peace of cake. Download the source tarball (version 1.06 by the time of writing) from here, unpack it, change to the new directory and then the usual stuff (this time no Debian package though):

tar xvf /path/to/transcode-X.X.X.tar.bz2
cd transcode-X.X.X
./configure --enable-v4l --enable-ogg --enable-vorbis --enable-theora --enable-libdv --enable-a52 --enable-libmpeg3 --enable-libxml2 --enable-sdl --enable-gtk --enable-imagemagick
make
su
make install

This way transcode should end up in /usr/local. Type

transcode -h

for testing. Done!

Installing dvd::rip

dvd::rip is a great tool for ripping DVDs (please be sure to not hurt any copyright restrictions…). It requires transcode, imagemagick and perl – should be no problem! The latter two can be installed via Debian’s repositories – if they aren’t already. Basically, everything you need to do is written down here. I avoid any Debian repositories which are not maintained by Debian or sidux themselves, so I didn’t go for the binaries. Compiling from source isn’t too hard, though. First install some perl modules:

apt-get install libevent-perl libintl-xs-perl libintl-perl libevent-rpc-perl

All other modules will come with dvd::rip. So, download the source tarball from here (version 0.98.9, by the time of writing). And then:

tar xvf /path/to/dvdrip-X.XX.X.tar.gz
cd dvdrip-X.XX.X
perl Makefile.PL
make test

If this errors out with something like this

Undefined subroutine &POSIX::setlocale called at blib/lib/Video/DVDRip/Config.pm line...

edit blib/lib/Video/DVDRip/Config.pm (might need to make the file writable with chmod 644 file), add

use POSIX;

at the top of it and run "make test" again. (I found the solution to this problem here.) When done, install dvd::rip with

su
make install

This will install dvd::rip in /usr/local, but you have to create a KDE / Gnome menu entry manually. Start it with

dvdrip

If it can’t find “xine”, then install it via

apt-get install xine-ui

That should be it!

Installing xvid (edit)

There is one thing I forgot: you need libxvidcore which doesn’t come with Debian either. Get the source from here (version 1.1.3 by the time of writing) and then the usual stuff:

tar xvf /path/to/xvidcore-X.X.X.tar.gz
cd xvidcore-X.X.X/build/generic
./configure
make
su
make install

This way, you should find some new libraries within /usr/local/lib. Maybe run ldconfig as root once. That’s it!

Of course, if you want to watch CSS protected DVDs you would need libdvdcss. As this library cannot be legaly used in some countries (including Germany), you have to look for it yourself. But Google should help you out…

One thought on “Debian with lame, mencoder, transcode, xvid & dvd::rip

  1. Pingback: links for 2009-05-16 « Yesure

Comments are closed.