ASPENSMONSTER Just another WordPress site

September 11, 2010

Debian Lenny 64 bit Multimedia Overhaul: ALSA, FFMPEG, x264, VLC 1.0.6, mplayer, Kdenlive, recordmydesktop, VDPAU, VAAPI

Filed under: Uncategorized — Tags: , — aspensmonster @ 4:54 am

Flattr this!

  • If you have NO idea how to compile software from source, then I suggest you try out my in-depth guide to compiling VLC here from source first. It can be done solely with repository software. However, I do recommend that once you understand the process of configuring and compiling software from source, you remove that VLC and update your libraries as per this guide. THEN you can recompile VLC.
  • While I try to be as thorough as possible, each system is different. By the time I got around to getting all of this installed and operational, I had gone through countless hours of installing this one piece of software and installing that new updated library and running through synaptic to get that dev header file. It is perfectly possible that the instructions below won’t work line for line; you might have to step in at some point and install missing header files from your package manager to get “./configure” commands to complete. Regardless, the overall Architecture and Process outlined here should be helpful to anyone.

This guide is intended to bring a stable Debian Lenny up to speed with current multimedia capabilities with as little use of non-repository software and libraries as possible. By no means is it possible to achieve the above-mentioned goal with the use of official debian stable repositories alone. Some of the latest libraries need to be installed. Indeed, to limit the amount of custom software that needed to be installed, some of the latest versions of the software were installed alongside the repo versions –In particular, the libx264-60 and libx264-65 (but NOT the -dev version, libx264-dev) libraries. While this is generally inadvisable and really just plain bad practice, I experienced no problem with this strategy myself. VLC 1.0.6 and Kdenlive 0.7.6 both seemed smart enough to pick up and use the versions found in the /usr/local directories as opposed to the other directories where the older versions are. You see, I had already done lots of different things to my box by the time I tried all of this out and finally got it working. Should you happen to be working with a clean install, than you really ought to try NOT mixing library versions at all if you can and just start compiling from source.

The Goals

  • Playback (decoding) and encoding of Full HD video (and SD video).
  • Hardware-accelerated decoding of Full HD video (via VDPAU).
  • Editing of Full HD video (and SD video).
  • Screen capture (including microphone and stereo mix sounds).
  • Recording and editing of audio with standard ALSA drivers (no PulseAudio or Jack).
  • Playback of various media files (VLC media player and mplayer).

Source-compiled Software Needed
i.e., apt-get install or use of Synaptic Package Manager won’t cut it for these pieces.

Program Why?
Latest ffmpeg outstanding encoding and decoding; up-to-date media programs require non-crippled ffmpeg libraries.
Latest x264 The best open-source implementation of the H.264 full HD specification available.
libogg-1.1.4 Contains latest ogg libraries. Needed by kdenlive.
libvorbis-1.2.3 Contains latest vorbis libraries. Needed by kdenlive.
live-555 A broadcasting protocol that VLC can use.
VLC 1.0.6 All-purpose media player.
Mplayer Another outstanding media player that can utilize Nvidia’s VDPAU, which enables hardware-accelerated HD video decoding.
Latest ALSA Drivers Installed so that you can use better sound cards like Creative’s X-Fi series.

Audio Considerations

You may notice that I don’t make use of PulseAudio or Jack. Hell, the audio portion of this guide is pretty damn meager. I didn’t have any trouble installing their latest versions or having VLC, kdenlive, etc recognize them in their respective configurations. However, I’m not a huge audiophile, and have next to no knowledge about how to make the best use of these tools. I don’t understand how to setup and configure them either, but that’s a problem between the chair and the keyboard.

I HAVE heard complaints from many Ubuntu users abut Pulse being buggy and a PITA to get working with all of your applications. So I don’t feel entirely bad about not incorporating it. ALSA works just fine for me, though I’m sure some folks will want to utilize Pulse and/or Jack. If you have trouble with Pulse or Jack, then I suggest this.

However, we are going to make use of updated, open-source audio codecs.

Recommended Installation Timeline
(The guide follows this timeline, top to bottom)

  1. Install latest ALSA drivers [not strictly necessary, but I preferred use of my X-Fi card]
  2. Install latest audio codecs [needed by MLT rendering engine for kdenlive]
  3. Install latest theora codec [needed by MLT rendering engine for kdenlive]
  4. Install libva-0.31.0-sds4 [for use with hardware accelerated decoding of hd video]
  5. Install vdpau-video-0.6.9 [for use with hardware accelerated decoding of hd video]
  6. Install x264 [used extensively by ffmpeg]
  7. Install ffmpeg [needed by kdenlive; a powerful media tool in and of itself]
  8. Install VLC 1.0.6 [all-purpose media player]
  9. Install latest mplayer [can utilize Nvidia’s “VDPAU,” which enables hardware-accelerated HD decoding.]
  10. Install Kdenlive [promising video editor for linux]

My /etc/apt/sources.list file

Just as a note, the listing for “emerald” (tuxfamily) is not necessary for this guide. I DO use some of the updated software in the backports repository (updated gcc, git-core, etc) , but I doubt it is strictly necessary for the purposes of this guide.

deb cdrom:[Debian GNU/Linux 5.0.4 _Lenny_ - Official amd64 CD Binary-1 20100131-21:33]/ lenny main

deb lenny main contrib non-free
deb-src lenny main contrib non-free

deb lenny/updates main contrib non-free
deb-src lenny/updates main contrib non-free

#for flash
deb lenny-backports main contrib non-free

#for emerald
deb ./

#for dvd stuff and other multimedia
deb lenny main non-free

Removal of packaged software; Mixed Library Musings
Be sure to remove the “x264” and “ffmpeg” packages from your system:

#apt-get remove x264 ffmpeg libx264-dev

As for other libraries, I found that “libx264-60” and “libx264-65” were necessary in order to permit packaged install of many of Kdenlive and VLC’s dependencies (such as the freior plugins and dvgrab). I don’t know how adverse an affect this has on the overall media integrity of the system, but I could not notice any significant disadvantages to permitting packages like dvgrab and freior to stay at older releases that use the older x264 shared libraries. So long as I removed the “x264” and “ffmpeg” packages themselves –the main executables– the updated, source-compiled versions always grabbed the latest libraries they could find when I would check with the command

$ldd /usr/local/bin/ffmpeg

All of the newer libraries (ogg, vorbis, and all the other libs that ffmpeg itself installs) were all properly linked here. And seeing as this is what kdenlive calls to do the encoding and decoding and transcoding, I’m positive that the latest versions of the libraries are being used when cutting the HD video.

Finally, running a mixed install like this is always a bit messy. If there are ever problems, then the libraries are a good spot to check. Which libraries are the problem program using? Are they the right libraries? Etc, etc, etc… In my experience, all of the source-compiled libraries and programs put files in the /local/ directories. This is confirmed with the above “ldd” command.

32-bit compatibility libraries

I don’t know whether or not any of the software or dependencies need 32-bit support. I’d imagine at least a few do, so it’s probably a good idea to install the 32-bit compatibilities:

# apt-get install ia32-libs ia32-libs-gtk ia32-libs-libcurl3 ia32-libs-idn11 ia32-libs-libnspr4 ia32-libs-libnss3 ia32-libs-libssh2 ia32-libs-xulrunner lib32nss-mdns

Part 1: Installation of latest ALSA drivers

The three pieces you absolutely need to download and install are:

  • alsa-driver
  • alsa-lib
  • alsa-utils

You can download their latest versions (1.0.23 as of July 27 2010) here:


First install the “alsa-driver” :

:~$ cd alsa-driver-directory
:~$ ./configure
:~$ make
:~# make install

Repeat the process with the libraries, and then the utilities:

:~$ cd alsa-libs-directory
:~$ ./configure
:~$ make
:~# make install


:~$ cd alsa-utils-directory
:~$ ./configure
:~$ make
:~# make install

Loading the modules

At this point, the code is all in place. However, it isn’t loaded into the kernel. Do that now:

:~# modprobe snd-pcm-oss
:~# modprobe snd-mixer-oss
:~# modprobe snd-seq-oss

You can check to see what modules are installed by running the command

:~$ lsmod

The sound modules are preceeded by “snd” in the names. Here is an excerpt from my machine:

snd_hda_codec_analog    66120  1 
snd_hda_intel          18435  1 
snd_hda_codec          65180  2 snd_hda_codec_analog,snd_hda_intel
snd_hwdep               5252  1 snd_hda_codec
snd_seq_dummy           1359  0 
snd_ctxfi              74885  1 
snd_seq_oss            23509  0 
snd_pcm_oss            32915  0 
snd_mixer_oss          13534  1 snd_pcm_oss
snd_seq_midi            4128  0 
snd_rawmidi            15425  1 snd_seq_midi
snd_pcm                60577  5 snd_hda_intel,snd_hda_codec,snd_ctxfi,snd_pcm_oss
snd_seq_midi_event      4628  2 snd_seq_oss,snd_seq_midi
snd_seq                41333  6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
snd_timer              15630  2 snd_pcm,snd_seq
snd_seq_device          4717  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq
snd                    46118  18 snd_hda_codec_analog,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_seq_dummy,snd_ctxfi,snd_seq_oss,snd_pcm_oss,snd_mixer_oss,snd_seq_midi,snd_rawmidi,snd_pcm,snd_seq,snd_timer,snd_seq_device

Running alsaconf and getting Creative X-Fi Working

Hopefully, a simple running of “alsaconf” followed by a reboot will do the trick for you:

:~# alsaconf

However, I had problems. I have the standard intel sound (snd-hda-intel), but wanted to use ALSA’s Creative Technologies X-Fi (snd-ctxfi) module so that I could use my X-Fi soundcard instead. I ended up having to load the module manually:

:~# modprobe snd-ctxfi

I then ran alsaconf a second time, rebooted, and all was still a clusterfuck. The kernel kept loading intels sound by default. Turns out I had to modify some files. The first was “/etc/modprobe.d/sound”

:~# nano /etc/modprobe.d/sound

It is possible that this file doesn’t exist. That’s fine. When you run “nano” Just be sure it has the two following pieces in it:

alias snd-card-0 snd-ctxfi
alias sound-slot-0 snd-ctxfi

Hit F3, then Enter, and it should be saved.

Strictly speaking, I’m not sure if this is all that was needed in order to get the X-Fi sound card working. However, upon rebooting, loading the “snd-ctxfi” module, running alsaconf, and then rebooting again, I had sound. As well, I noticed that I could modify the “/etc/modprobe.d/alsa-base” file to better suit my particular flavor of intel’s HDA sound (It is, after all, extremely generic.) I have SPDIF on my mobo and 5.1 surround. The technical model specification is “ALC882/885” and the model name given by alsa is “6stack-dig”. You can take a look here for a better idea of what specific model name to use:

If you want to try this out, the edit the alsa-base file:

:~$ nano /etc/modprobe.d/alsa-base

And add your specific model:

options snd-hda-intel model=6stack-dig


The following timeline has a decent chance of working for getting Creative X-Fi cards working:

  1. Install the latest alsa libraries
  2. Load their modules : “modprobe snd-pcm-oss” etc etc
  3. Load creative’s x-fi module: “modprobe snd-ctxfi”
  4. Modify the “/etc/modprobe.d/sound” file to make sure the X-Fi card takes priority.
  5. Reboot
  6. Run “alsaconf”
  7. Reboot
  8. Sound should work


To be honest, the interwebs will be your bestest friend when trying to resolve sound issues with your particular amalgam of sound card, motherboard, kernel, and other hardware/software issues. However, a few good links to look at are: ; This link lists lots of Intel HDA model names. ; This is a very useful Ubuntu helpfile for getting HDA working. ; an OUTSTANDING –perhaps a little dated, but still applicable– general-purpose troubleshooting guide for sound on linux systems. Look towards the last pages of the thread for more recent hacks that might be of assistance to you.

Part 2: Installation of audio libraries ; libogg ; libvorbis

I didn’t have any trouble here. It was as simple as configure, make, and make install. I needed these for VLC and ffmpeg. I installed “libogg-1.1.4” and “libvorbis-1.2.3”. As of now, the latest stable versions are “libogg-1.2.0” and “libvorbis-1.3.1”. I do not think you will have issues using the latest.


Download from here:

Then do the following:

:~$ cd /path/to/libogg-1.2.0
:~$ ./configure
:~$ make
:~# make install

If the configure fails, just use Synaptic to download any missing development header files.


Download from here:

Same as above:

:~$ cd /path/to/libvorbis-1.3.1
:~$ ./configure
:~$ make
:~# make install

If the configure fails, then again, just install missing dev header files from Synaptic.

mp3 support

If you haven’t already set up mp3 support (or DVD support for that matter), then check out Part 15 of an earlier post I made:

Part 3: Installation of Theora codec ; libtheora-1.1.1

I needed to install the latest theora codec in order to permit screencapturing with gtk-recordmydesktop. You can also grab it from the same site as the ogg and vorbis library files:

:~$ cd /path/to/libtheora-1.1.1
:~$ ./configure
:~$ make
:~# make install

Part 4: Installation of gtk-recordmydesktop

I utilize this program for capturing desktop behavior. It’s no capture card, but it gets the job done for my purposes. Believe it or not, the only necessary action on my part was to use Synaptic:

:~# apt-get install gtk-recordmydesktop

Soundcard notes

I originally installed this while using Intels HDA soundcard. Sound would not be saved in the output ogg video files. However, upon setting up the X-Fi Soundcard, sound worked just fine. However, this was also before I updated the ALSA drivers. For all I know, the updated ALSA drivers might also have been the solution to this no audio issue.

Video bitrate problem

Use of the latest libtheora requires that you specify an appropriate bitrate in gtk-recordmydesktop. Otherwise, the quality is very poor. In the gtk-recordmydesktop GUI, click on “Advanced” and then navigate to the “Misc” tab. In the “Extra Options” dialog, add “-v_bitrate 2000000”. This is the maximum bitrate. If you try to use anything higher, gtk-recordmydesktop will complain and exit with an error message:

“recordMyDesktop has exited with status: 256
Description:Error while parsing the arguments.”

Part 5: Using VDPAU and VAAPI, lib-va-0.31, vdpau-video-0.6.9

These provide VDPAU backends to VAAPI, allowing you to use both VDPAU and VAAPI accelerated code. For example, VLC uses VAAPI (I think), but nvidia’s hardware acceleration uses its own VDPAU. With libva in conjunction with vdpau-video, you can get hardware accelerated video with your Nvidia Graphics card.

I’m assuming here that you have the drivers for the card installed. If not, then see Part 3 of my Lenny Installation Guide:

Now, onto getting that hardware accelerated video!


First, you need to install “libva_0.31.1-1+sds4”. The “sds4” bit is important; it’s the only one that has mp4 AND mpeg support. You can get it here:

Extract it and then follow standard

:~$ cd /path/to/directory
:~$ ./configure
:~$ make
:~# make install

I honestly don’t remember if I had any problems; there might have been an issue about compiling with PIC (Position Independent Code). If any problems pop up and you are on a 64 bit system (like myself), then look for an option to use PIC in the configuration command (run “./configure –help” to see the available options). It will probably look like “-fPIC” or “-pic” or something like that.


Now that we have the libva files installed, we need to install the vdpau backends. I recommend vdpau-video-0.6.9. There is always a tarballed “latest,” but I’m not sure how stable it is. Download whatever version you want here: ; (I recommend the “vdpau-video-0.6.9.tar.gz” file)

Extract it and then follow standard

:~$ cd /path/to/directory
:~$ ./configure
:~$ make
:~# make install

Verifying a successful installation

Assuming libva and vdpau-video are successfully installed, then the output of

:~$ vainfo

Should look something like this:

libva: libva version 0.31.0-sds4
Xlib:  extension "XFree86-DRI" missing on display ":0.0".
libva: va_getDriverName() returns 0
libva: Trying to open /usr/local/lib/va/drivers/
libva: va_openDriver() returns 0
vainfo: VA API version: 0.31
vainfo: Driver version: Splitted-Desktop Systems VDPAU backend for VA API - 0.6.9
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD

What if I have an ATI graphics card?

I honestly know next to nothing about this situation. I’ve only ever owned one ATI card, and it was a nightmare. I’ve used Nvidia ever sense without problems. However, I believe that “xvba-video” is the ATI analog to the Nvidia “vdpau-video”. I’d say try installing “xvba-video-0.7.3” from

And then trying the standard ./configure make make install.

Part 6: Installation of latest x264

“x264” is an open-source implementation of the H.264 (also called “AVC” in some cases) codec. Quite a lot of HD content uses H.264 with the x264 encoder. If you want to cut and render with HD video, having the latest x264 is an absolute must.

I’d recommend adding the following libraries from your package manager. We’ve installed all the latest ones that we need to at this point:

:~# apt-get install yasm texi2html libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev

If any other libraries or headers are needed, install them. Using the latest x264 requires using git source:

:~$ git clone git://
:~$ cd x264
:~$ ./configure --enable-pic
:~$ make
:~#make install

If you are running a 64 bit operating system, then it is absolutely necessary that you use the “–enable-pic” flag.

Part 7: Installation of ffmpeg

FFMPEG is the media workhorse of the linux world. It encodes, it has muxers and demuxers, and all sorts of other capabilities that I don’t even understand. However, it is necessary to have the latest version installed in order for your system to be up-to-date.

libvpx (not required)

This section is optional. You can skip it completely if you want. Installing libvpx will let you encode and decode VP8 video. VP8 has some promise to become an open standard for video playback in HTML5, primarily due to Google backing the code. It may or may not happen, but I figure it never hurts to have it on your system in any case.

:~$ git clone git://
:~$ cd libvpx
:~$ ./configure
:~$ make
:~# make install

The configuration line

FFmpeg gives you lots of fine-tuned control over just what features get installed. The “./configure” portion of the install can be a bit tricky. This is mine:

./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-libdc1394 --enable-shared --enable-vaapi --enable-libvpx

You can remove or add whatever you like (for example, if you don’t want to install libvpx, then remove it from the above “./configure” command). Just keep in mind you might have to install some other necessary files from your package manager to get the “./configure” command to complete.


Execute the following commands to download and install from source:

:~$ svn checkout svn:// ffmpeg
:~$ cd ffmpeg
:~$ make
:~# make install

Verifying the Install

First, run

:~# ldconfig

Then, you can use the program “ldd” to see what libraries are being used by ffmpeg. This is very useful in determining if the latest vorbis, theora –and any other source-compiled libraries you compiled– are actually being used by your ffmpeg install.

:~$ ldd /usr/local/bin/ffmpeg

If you’ve compiled up-to-date libraries for components such as libtheora, then the *.so file should be located in a “/local/” directory. If it’s just in “/usr/lib” or “/usr/bin/”, then chances are you’re just using a packaged, out-of-date version.

Using ffmpeg and x264 concurrently

I feel that one Robert Swain has already hit the nail squarely on the head here. You can check out his guide to x264 and ffmpeg here:

Part 8: Installation of VLC 1.0.6

I originally intended for this to be a short part of the guide. However, it grew into a project all it’s own. Check it out here:

Hardware accelerated playback

Version 1.0.6 (which I documented) does not have hardware accelerated support (not via vdpau, anyway). VLC’s version 1.1.0 and up do, but it is very much so a new and experimental feature. You can try compiling the newest VLC and see if it’s making calls to libva or vdpau-video when you have hardware acceleration enabled. Other than that, I’m not much use for you. Maybe I’ll update this section later if I have time to tinker with it.

I did however find one link that looks to be promising and to the point:

However, I don’t think you need to patch ffmpeg anymore. Just compile it with the “–enable-vaapi” option.

Part 9: Installation of latest mplayer

Mplayer is another outstanding media player in addition to VLC. It is more minimalistic and command-line aimed then VLC, but I still use it for those occasions when I want to watch 1080p video with hardware acceleration. Keep in mind, I installed mplayer AFTER compiling VLC from source. For all I know, there could be plenty of external software you need to grab from your package manager in order to get mplayer to compile. I found a rather old link that might be of use if you aren’t sure what to do:

If you are ready and know how to compile software from source, then just do this:

:~$ svn checkout svn:// mplayer
:~$ cd mplayer
:~$ ./configure --enable-gui
:~$ make
:~# make install

Getting skins to work

Even with “–enable-gui” called in the configuration line, there is no gui to start with. You have to download one from here under the “Skins”:

I use the default “Blue.” However, there were some tricks getting it installed. Ultimately, you need to have a directory structure like this:


and in that default folder, you need to have all of the skin files. Mine looks like this:

user@machine:/usr/local/share/mplayer/skins/default$ ls
about.png         eqb.png          mute.png            skin
bareqb.png        exit.png         next.png            skinb.png
barexit.png       font.fnt         playbar.png         stop.png
barffwd.png       font-pl.png      playlist.png        subblue.png
barfwd.png        forward.png      play.png            subload.png
barmute.png       icons            pos.png             symbols2.png
barplay.png       load.png         prefs.png           symbols.fnt
barrev.png        main.png         prev.png            symbolsg.fnt
barrevv.png       main-silver.png  progres-long2c.png  VERSION
barstop.png       menu.png         progres-long2d.png  zoom-3.png
barzoom.png       menus.png        README
Blue-1.7.tar.bz2  minimize.png     rev.png

In short, DON’T put a folder inside the “default” folder. For example with the default “Blue” skin, it comes packaged in a tarball. Extracting gives me a folder called “Blue”. I then open that folder and dump all of the contents (images and a folder labeled “icons”) into the “/usr/local/share/mplayer/skins/default” folder.

Hardware Accelerated Video Decoding

You can check that mplayer does indeed have vdpau working by running:

:~$ mplayer-vo help
"vdpau      vdpau with X11"

Should be one of the listings.


mplayer -vc help

Will list ALL of the codecs. You should see some with “vdpau” labels.

An example command to play an HD file with hardware acceleration is:

mplayer -vo vdpau -vc ffh264vdpau path/to/file.mkv

The same principle works with other kinds of files. Just make sure the video output (vo) is “vdpau”, and then use the appropriate video codec (vc), such as “ffh264vdpau” or “ffmpeg12vdpau” or “ffvc1vdpau”.

Part 10: Installation of Kdenlive

In my opinion, this is Linux’s best bet at an intuitive video editor for common use. It is most definitely a work in progress. The general instructions for compiling from source are pretty good:

Lots of the libraries will already be installed, and ffmpeg will be updated too (assuming you’ve used this guide). Installing the MLT rendering engine and then kdenlive itself isn’t too difficult after that.

cmake issues

However, the latest version they have ( uses cmake to compile. The version in Debian Lenny is too old. Download the latest cmake (2.8.2)here:

and install.

When it comes time to use cmake at the end of their guide, it should work. And one last thing: DON’T use the svn version. It is currently using an updated KDE environment that Debian’s “kdelibs5” is incompatible with. Just download the kdenlive package from sourceforge:

frie0r plugins

I remember having a hard time getting these installed from source and needed to use a repository instead. Use the one listed here:


As of now, you should have a very updated stable Lenny installation. Make no mistake, it’s a mixed install and that’s always tricky. However, nothing beats having all of the same media capabilities as a windows box (more or less) on a stable distribution of Linux 🙂

I’m sure I’ll be updating this guide from time to time. Feel free to leave comments if you have questions or came up with some other work around that you think might help others.

No Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment