Building a
MultiMedia Machine with Slackware 12.2
by Lenard
Spencer
(NOSPAMlenardNOSPAM_AT_lenardspencer_DOT_com)
Revision
2009-11-08
(updates, corrections, and omissions)
NOTE: This howto was written before I embraced the use of Slackbuilds,
but it is kept here more for archival purposes than anything else.
This is the first tutorial I've tried to write in a
LLOOOONNNGGG time, so please, if I confuse any of you, just shoot me
an email and I'll try to clarify it. Here we are going to turn
a virgin Slackware 12.2 install into a versatile multimedia
station.
While you can download prebuilt packages from linuxpackages.net,
I have found that some of the later packages were linked with
libraries the package creators had on their systems at the time,
which we probably won't have on ours yet, and if we do, they are more
than likely a different version than what the package expects, in
which case the program will simply bomb out because it can't find the
right libraries. For this reason we will be installing our
libraries and programs from source. These are the steps I took
and documented, and they should work for you as well. So grab a
drink (PLEASE keep it covered, you're at the computer!) and let's get
ready to roll.
UPDATE: This HOWTO is meant for those of you who will be dedicating a Slack partition strictly to multimedia. I will be soon posting another version using Slackbuilds, which a lot of you may find a little more appealing.
FIRST THINGS FIRST
First,
I HIGHLY recommend a fast computer. Because we are working with
a 32-bit Slackware, it may or may not make a difference if your
processor is 32 or 64 bit. Either way, any system with a
processor speed slower than 2 GHz and a front-side bus (FSB) speed
slower than 400 MHz is probably not a good candidate, especially if
you will be working with file sizes measured in GIGS, like DVDs.
Also, I HIGHLY recommend a Geforce video card over ATI, based on
previous experience with ATI's Linux driver totally trashing my
system and making me spend DAYS reinstalling everything. If
your luck is better than mine, then by all means stick with it.
Oh, yeah. Before I forget, it helps tremendously that you have a LOT of hard drive space available, especially since we will be building a system to work with large video files. You may think that 40 gigs is enough, but you'd be amazed at just how fast a 40 gig partition fills up!
That said, let's get to it!
NOTE
ON SLACKWARE 13.0
As of version 13.0, Slackware now
includes MPlayer, which was built with the "USE_PATENTS=NO"
paramater, which means it was built without features that are covered
by patent issues, like faac, mp3lame, and dvdcss (among others).
As I have not done a whole lot with 13.0 as of this writing, I cannot
offer any suggestions as of yet, except to possibly uninstall the
included MPlayer package and build your own as outlined later in this
tutorial. I personally consider 13.0 a "not quite ready
for prime time" version, much like 12.0, and cannot yet
recommend Slack 13 for the multimedia treatment. However, if
you want to try, there is one STRONG recommendation I can make.
Both MPlayer and Xine don't seem to play well with KDE4 (both 32 and
64 bit), so I would have to recommend XFCE over KDE4 for now if you
want to try this on Slack 13.
VIDEO
DRIVERS
Before we go any further, we must
install the video driver for your card. Both ATI and Nvidia
have Linux drivers available on their website, and if you haven't
installed the driver for your card yet, let's do it now before we do
anything else. After you've downloaded the appropriate driver
for your chipset, simply log in as root, and while in the console
(DON'T do startx) save a backup of your xorg.conf file with 'cp
/etc/X11/xorg.conf .' which will save a copy of it in your current
directory. Then run the xxdriverxx.run file you downloaded.
To make life easier on yourself, when it comes to the last question
"would you like to update the xorg.conf file?" PLEASE
answer YES. If things don't work when you do 'startx', you can
go back to the original by running the .run file again with the
--uninstall option. This will (hopefully!) restore the system
to original. At least at this point, you haven't installed
anything else, so if things go horribly wrong (EXTREMELY rare!), you
can just go back and reboot the Slackware CD and reinstall it.
(You shouldn't have to format the /home partition this time.
After all, you have files there, remember?) Now that you have
your video driver installed, we can get to installing the needed
libraries.
INITIAL LIBRARIES
Now
that we have a base Slackware install, we can begin instaling our
first libraries. First, you must be logged in as a regular
user. This will help keep you out of trouble by not having root
access all the time, only su'ing it to do the actual installs.
I found it easier to be in the KDE desktop to do all my work, because
I can have a web browser open to find and download the packages, a
Konqeror file manager open to right-click and extract the packages,
and a Konsole window open to do the actual build and install.
That said, let's get to work. First and foremost, the most
useful package we need is also the first one we will install,
the LAME mp3 encoder
package. While Slackware can PLAY MP3 files out of the box,
this package will enable you to ENCODE MP3's using not only
KAudioKreator, but also some of the other packages we will be
installing during the course of this tutorial. As of this
writing, the current version is 3.98.2. After downloading and
extracting, cd the directory in Konsole and issue these
commands:
./configure --prefix=/usr
--enable-nasm
make
su
make
install
Another useful package to
install at this point is ID3lib.
Slackware
already
includes another ID3 library, libid3tag, but some
programs expect id3lib.
./configure
--prefix=/usr
make
su
make
install
DVD Reading Libraries
The
XINE media player in Slackware is great, but it needs a little
help.
As it stands, it can play DVDs, but it can't properly play some of
the formats otherwise unique to the "Redmond Monster".
So, the first thing we need to do is go to the MPlayer
website and download a grocery list of goodies. The first is
optional, MPlayer and a skin to go with it. But what we're
REALLY after are the codecs package as well as libdvdread and
libdvdnav. There is an older libdvdread package floating about
(libdvdread-0.9.7), but since it doesn't seem to have been actively
maintained since 2006, we will use the MPlayer version (4.1.3).
BUT, if you want to play encrypted DVDs, you will first need to
install the libdvdcss-1.2.10 package from the VideoLAN
developers site.
NOTE: MPlayer includes these libraries in
their source distribution, but we will install them now just in case
we decide not to install MPlayer. If you do decide to install
MPlayer, the configure script will find these libraries and not build
over them.
For libdvdcss:
./configure
--prefix=/usr
make
su
make
install
If the './configure' or 'make'
fail, you will probably need to run './bootstrap' first on a fresh
extraction. If you will be using libdvdread-0.9.7 instead of
the one from MPlayer, the same instructions and caveats
apply.
Installing libdvdread-4.1.3 is straightforward, BUT,
whether you will be using either dvdbackup or lxdvdrip, you will need
to download a patch
from the dvdbackup
site (you can grab the latest dvdbackup while you're there if you
want to). To install the patch into libdvdread, first copy the
patch into the libdvdread-4.1.3 folder and run the following
command:
patch -Np1 -i
DVDFileStat.patch
Now we can build and
install libdvdread and libdvdnav. The only caveat here is that
libdvdread must be installed BEFORE libdvdnav.
to install
both:
./configure2
--prefix=/usr
make
su
make
install
Before we go any further,
let's install the MPlayer codecs package. To do this, simply
extract the package and move the files themselves to
/usr/lib/codecs. The XINE player is already configured to look
in this folder, so no further configuration is necessary.
Before
moving on to the libraries, there is one other package we want to
install: lxdvdrip.
This
handy
little program will allow you to make backups of your
favorite DVDs. Remember the dvdbackup program discussed
earlier? Well, lxdvdrip actually includes its own version of
that program, so we'll install it.
COPYRIGHT
WARNING! Please do not use this
program
to pirate DVDs! Copying DVDs is still considered illegal in
most countries, and this software is only intended to make a backup
that you can view it at your leisure and avoid damaging the
original. I have had a DVD fly apart on me, so I know firsthand
the value of backups. With that said, let's move
forward.
GOTCHA! If
you are working on a fresh Slackware install, the /usr/local/share
folder probably doesn't exist yet, so PLEASE
create it now. As root, type this command:
mkdir
/usr/local/share
If this is not done,
the build will simply create a file called 'share', which will break
any future installs if not corrected.
To install
lxdvdrip:
make
su
make
install
While still root, install the lxdvdrip.conf file to the /etc folder with:
cp doc-pak/lxdvdrip.conf.XX
/etc/lxdvdrip.conf
where XX is EN=English, FR=French, or
DE=German. You will want to at least look at lxdvdrip.conf at
this point, just to see what parameters you will need to change at
this point.
Lxdvdrip names its dvdbackup program
dvdbackup_lxdvdrip, so to make it easier to call, we well create a
symlink with its standalone name. As root, go into
/usr/local/bin and type:
ln -sv
dvdbackup_lxdvdrip dvdbackup
Lxdvdrip
was written with the transcode library in mind, but can easily be
used without it, as it contains another transcoding program, VAMPS,
which is not only much faster than transcode, but from what I've seen
produces slightly better transcoded video quality. So, we will
wait before installing transcode, because there are a LOT of other
libraries that it will link with in order to get maximum
functionality.
Before we forget, let's also install dvdauthor,
which is required by lxdvdrip.
./configure
--prefix=/usr
make
su
make
install
So far, we have created a
system that can 1) rip audio CDs to MP3 that we can load into our
favorite player, 2) play DVDs as well as most media files, and 3)
make safety backups of our favorite DVDs. Next, we will install
the libraries and other programs necessary to turn this Slackbox into
a robust multimedia system.
The Codec
Libraries
From here on, unless otherwise noted, all the
remaining software packages and libraries will be installed in
/usr/local. Also, in many cases there are newer versions
available than what are listed here, but these are what I have
installed and tested.
First up is a52dec-0.7.4.
Although
many
newer programs contain an implimentation of this in
their own builds, this is the standalone version still used by some,
so we will install this one first.
To install
a52dec-0.7.4:
./configure
--prefix=/usr
make
su
make
install
The next few library packages are necessary for
later programs to work
twolame-0.3.12
(mpeg layer 2 encoder)
./configure
make
su
make
install
libsndfile-1.0.20
./configure
make
su
make
install
libsamplerate-0.1.7
aka 'Secret Rabbit Code' (requires
libsndfile)
./configure
make
su
make
install
For Apple's aac format you will need the following
two packages (both available from www.audiocoding.com):
faad2-2.7
(NOTE: the --with-xmms option is optional, but will allow you to play
aac files in xmms.)
./configure --with-mp4v2
--with-xmms
make
su
make
install
faac-1.28
./configure
--with-mp4v2
make
su
make
install
OpenJPEG_v1_3
(the main page still says version 1.2 but 1.3 is available
here)
make
su
make
install
libraw1394-2.0.4
(basic dv library used for reading in digital video from older
firewire camcorders)
NOTE: Slackware 12.2 includes
libraw1394-2.0.0 in the distribution, so it is recommended you keep
that one.
BUT, if you must:
./configure
make
su
make
install
libiec61883-1.2.0
(requires libraw1394) Sadly, the original page, linux1394.org,
apparently no longer exists, but the link will take you to the Debian
page where you can get the latest source code (version
1.2.0).
./configure
make
su
make
install
libusb-1.0.4
(USB device control libs) (required by libdc1934)
NOTE: Slack 12.2
includes an OLD version, 0.1.12, but this installation will coexist
just fine with it. Packages linked to the old libusb will still
use it, but any new packages will use this
one.
./configure
make
su
make
install
libdc1394-2.1.2
Digital
camcorder
control API.
./configure
make
su
make
install
xvidcore-1.2.2
This is an MPEG-4 decoder.
Go into the build/generic folder,
then
./configure
make
su
make
install
gpac-0.4.5
Here
is the first example of interdependence. Gpac looks for ffmpeg,
and will build without it, but our installation of ffmpeg will
require libx264, which requires gpac to output mp4 files with H.264
compression. After ffmpeg is installed, we can come back and
reinstall gpac.
There is a secondary package,
gpac_extra_libs-0.4.5, but we will not be using it, because most of
the libraries in it are already out of date. Besides, we have
already installed some of the libraries we need.
To install gpac, you will first need to
make the configure script executable:
chmod
+x configure
./configure
make
su
make
install
make
install-lib
Before installing x264 and ffmpeg, we
need
to install yasm, an assembler package needed to help build
ffmpeg.
yasm-0.8.0
A complete rewrite of NASM, the Netwide Assembler. We
can safely leave NASM installed, as the two do not share any
filenames. Besides, some programs out there still require NASM to
build.
./configure
make
su
make
install
x264
There
are no official releases of the x264 libraries. However, daily
snapshots are available
at:
http://www.videolan.org/developers/x264.html
NOTE:
The latest snapshots no longer work with ffmpeg, due to some library
routines needed by ffmpeg having been dropped from x264
development.
The snapshot I am currently using is dated 20090328, and at least for
me it works fine.
./configure
--enable-shared --enable-mp4-output
make
su
make
install
NOW we can get to the first of
the major packages, ffmpeg. This is our workhorse for
transforming video. Its most simple use if for converting from one
format to another, but is capable of far more, like wipes, overlays,
dissolves, and much more. It is pretty fast, but it still is
one of the reasons you need a FAST
computer.
ffmpeg-0.5
./configure
--enable-shared --enable-gpl --enable-postproc --enable-swscale
\
--enable-nonfree
--enable-avfilter --enable-pthreads --enable-libfaac --enable-libfaad
\
--enable-libdc1394
--enable-libmp3lame --enable-libtheora --enable-libvorbis
\
--enable-libx264
--enable-libxvid
make
su
make
install
Now we can go back to the gpac
folder and:
su
make
uninstall
make
uninstall-lib
exit
(leaves superuser and back to your normal user)
make
distclean
Now reinstall
./configure
(it will now see the ffmpeg libraries)
make
su
make
install
make
install-lib
At this point, you are now
able to do some REALLY fun things, like rip a DVD movie and convert
it to an mp4 file to watch on your iPod. I will post another
tutorial on that later.
Before we can install any more
major packages, we need to install some more libraries:
libdv-1.0.0
(codec to handle video streams from digital
camcorders)
./configure
make
su
make
install
libquicktime-1.1.3
(HIGHLY recommended by mjpegtools)
./configure
--enable-gpl
make
su
make
install
mjpegtools-1.9.0
NOTE: If you are building on a multicore AMD, it will probably attempt to configure for "Barcelona" and break the build. To get around this problem, open 'cpuinfo.sh' in a text editor and replace 'barcelona' in line 148 with 'k8'.
./configure
make
su
make
install
libmpeg2-0.5.1 (required by transcode)
./configure
make
su
make
install
NOW we can install transcode
1.1.0, which is used by lxdvdrip.
./configure
--enable-libpostproc --enable-alsa --enable-lame --enable-x264
\
--enable-ogg
--enable-vorbis --enable-theora --enable-libdvdread --enable-libdv
\
--enable-libquicktime
--enable-a52 --enable-faac --enable-xml2 --enable-mjpegtools
\
--enable-libavformat --enable-libmpeg2
make
su
make
install
MPlayer
Also used by lxdvdrip, although you can configure lxdvdrip to use
other players.
NOTES: 1) The MPlayer website recommends to use
the latest source snapshot, as they consider 1.0rc2 outdated.
2) MPlayer includes libdvdread, libdvdnav, and libdvdcss, but will
not build these if it finds these libraries already
installed.
./configure
--enable-gui --codecsdir=/usr/lib/codecs
make
su
make
install
NOTE: You may have to add '--disable-ivtv' and/or '--disable-x264' to the configure options if make errors out.
Editing and Creating Videos
Kino
is a non-linear video editing system for Linux. Before we can
install it, we need to install the libavc1394 package.
Libavc1394
requires the libdvdraw package, but we installed that earlier, so we
are good to go.
libavc1394-0.5.3
./configure
make
su
make
install
kino-1.3.4
./configure
--disable-local-ffmpeg (we already have the latest ffmpeg
installed!)
make
su
make
install
An alternate video editor is
LIVES. It requires the JACK package
installed.
jack-audio-connection-kit-0.116.2
./configure
make
su
make
install
lives-1.1.5
./configure
make
su
make
install
Authoring
DVDs
Tovid
is a program to actually create the DVD format structure. It's
written in Python, and requires txt2tags to install.
First, we
install txt2tags:
su
cp
txt2tags /usr/bin (I have not gotten it to
work in /usr/local/bin)
Now the tovid
installation:
./configure
--prefix=/usr (it won't build without this
prefix!)
make
su
make
install
You now have a robust video
editing system. For audio production, we will build around the
Audacity package.
First, we need to install the wxWidgets
package. Since we only really need the GTK widgets, that is
what we will install. We will build the object files into their
own directory in case we need the source for another
configuration.
wxWidgets-2.8.10
mkdir
build_gtk
cd
buid_gtk
../configure
--with-gtk --enable-unicode
make
su
make
install
Now we can install Audacity.
The 1.3.9 beta comes in two flavors, the min package (for those
systems with all the other libraries already installed), and the full
package which includes all the other libraries. We will use the
min source package because we already have everything else we need
already
installed.
audacity-src-1.3.9-beta
./configure
make
su
make
install
That's about it! If
everything went well, you should now have a multimedia production
system capable of producing media with quality that matches
professional systems costing many thousands of dollars. And I
did this over the course of a day and a half, installing the basics
on a Saturday afternoon, and completing it on Sunday, including
writing the notes I needed to write this tutorial.