ASPENSMONSTER

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
CAUTION

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 http://ftp.us.debian.org/debian/ lenny main contrib non-free
deb-src http://ftp.us.debian.org/debian/ lenny main contrib non-free

deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main contrib non-free

#for flash
deb http://www.backports.org/debian lenny-backports main contrib non-free

#for emerald
deb http://download.tuxfamily.org/shames/debian-lenny/desktopfx/unstable/ ./

#for dvd stuff and other multimedia
deb http://www.debian-multimedia.org lenny main non-free

Removal of packaged software; Mixed Library Musings
CAUTION
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
CAUTION

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:

http://www.alsa-project.org/main/index.php/Download

Compiling

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

and

:~$ 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:

http://wiki.sabayon.org/index.php?title=HOWTO:_Resolve_Problems_with_HDA-Intel_Sound_Cards

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

Conclusion

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

Troubleshooting

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:

http://wiki.sabayon.org/index.php?title=HOWTO:_Resolve_Problems_with_HDA-Intel_Sound_Cards ; This link lists lots of Intel HDA model names.

https://help.ubuntu.com/community/HdaIntelSoundHowto ; This is a very useful Ubuntu helpfile for getting HDA working.

http://ubuntuforums.org/showthread.php?t=205449 ; 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.

libogg-1.2.0

Download from here:

http://www.xiph.org/downloads/

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.

libvorbis-1.3.1

Download from here:

http://www.xiph.org/downloads/

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:

http://aspensmonster.com/2010/03/18/debian-lenny-64-bit-installation/

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:

http://www.xiph.org/downloads/

:~$ 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:

http://aspensmonster.com/2010/03/18/debian-lenny-64-bit-installation/

Now, onto getting that hardware accelerated video!

libva

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:

http://www.splitted-desktop.com/~gbeauchesne/libva/

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.

vdpau-video

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:

http://www.splitted-desktop.com/~gbeauchesne/vdpau-video/ ; (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/nvidia_drv_video.so
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

http://www.splitted-desktop.com/~gbeauchesne/xvba-video/

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://git.videolan.org/x264.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://review.webmproject.org/libvpx.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.

Installing

Execute the following commands to download and install from source:

:~$ svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
:~$ cd ffmpeg
:~$ ./configure [PUT YOUR SPECIFIC OPTIONS HERE]
:~$ 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:

http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/

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:

http://aspensmonster.com/2010/07/17/compiling-vlc-1-0-6-from-source-on-debian-lenny-64-bit/

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:

http://strangestone.livejournal.com/107092.html

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:

http://ubuntuforums.org/showthread.php?t=558538

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

:~$ svn checkout svn://svn.mplayerhq.hu/mplayer/trunk 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”:

http://www.mplayerhq.hu/design7/dload.html

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

“/usr/local/share/mplayer/skins/default”

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.

Running

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:

http://www.kdenlive.org/user-manual/downloading-and-installing-kdenlive/installing-source

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 (0.7.7.1) uses cmake to compile. The version in Debian Lenny is too old. Download the latest cmake (2.8.2)here:

http://www.cmake.org/cmake/resources/software.html

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 0.7.7.1 package from sourceforge:

http://sourceforge.net/projects/kdenlive/

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:

http://www.piksel.org/frei0r

CONCLUSION

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.

July 17, 2010

Compiling VLC 1.0.6 from Source on Debian Lenny 64 bit

Filed under: Uncategorized — Tags: , — aspensmonster @ 12:43 am

flattr this!

  • VLC has since updated to version 1.1.0. If you want to try out this process with the newest source, then download it here: http://sourceforge.net/projects/vlc/files/1.1.0/vlc-1.1.0.tar.bz2/download. This guide should still serve you well however. I highly doubt that there will be any serious kinks in going from 1.0.6 to 1.1.0, though I do plan on trying it out myself whenever I have more time.
  • UPDATE: I did go ahead and compile 1.1.0 from source. However, it requires a LOT more up-to-date libraries than 1.0.6 does and needed several tweaks that I had to google for. As well, I had more issues with playback, particularly with flv files (nearly HALF of them kept segfaulting VLC). In short, I’m sticking with 1.0.6 for now, even though it lacks 1.1.0’s hardware acceleration (which is still experimental as it is). I’d give it a few weeks, and then grab it from the git repository. My only other hypothesis is that my playback issues could be an issue because of an old glibc version. Seeing as hardware support is coded now, this may very well be the case.

This guide is intended as an introduction to compiling software from source, with the added benefit that the result is something very useful –an up-to-date media player– to the typical user. I have written it in a chronological form, from the moment of downloading the package up to the moment the final tests on the compiled software have been finished. In this regard, it does not follow a formula like this:

  1. # apt-get install  libdvdcss gstreamer-lame [HUGE LIST OF ALL SORTS OF WEIRD PROGRAM NAMES AND STUFF LIKE THAT HERE]
  2. $ ./configure --weird-option-one --what-is-this --what-does-this-button-do --how-do-i-shot-web [LONG LONG LIST OF CONFIGURATION OPTIONS]
  3. $ make
  4. # make install
  5. DONE.

Nobody compiles software in this manner. Very rarely does an up-to-date, complicated piece of software work out as smoothly as:

$ ./configure
$ make
# make install

As well, you don’t just magically know which packages to install and what configuration options to use. Rather, I believe that a play-by-play of my experiences compiling VLC, including all wrong turns and bad ideas, will be far more useful in helping others to understand how to properly compile software (and possibly get a better understanding of how it actually comes together).

Right. Let’s get started.

Part 0: The “/etc/apt/sources.list” file

This is my (abbreviated) sources.list file:

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

deb http://ftp.us.debian.org/debian/ lenny main contrib non-free
deb-src http://ftp.us.debian.org/debian/ lenny main contrib non-free

deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main contrib non-free

# Used for all sorts of necessary media headers and programs
deb http://www.debian-multimedia.org lenny main non-free

The key component here is the debian-multimedia repository. If you don’t already have it enabled, then do the following:

$ wget http://www.debian-multimedia.org/pool/main/d/debian-multimedia-keyring/debian-multimedia-keyring_2008.10.16_all.deb
# dpkg -i debian-multimedia-keyring_2008.10.16.deb

This downloads the keyring and installs it, permitting you to use the multimedia repository. Next, be sure to add the entry into the “/etc/apt/sources.list” as shown above and then update apt:

# apt-get update

You are now ready to get started :-)

Part 1: Downloading and Extracting the Source

VLC has since updated to version 1.1.0. If you want to try out this process with the newest source, than download it here: http://sourceforge.net/projects/vlc/files/1.1.0/vlc-1.1.0.tar.bz2/download

The source for VLC 1.0.6 is here: http://download.videolan.org/pub/videolan/vlc/1.0.6/vlc-1.0.6.tar.bz2

Download the source and then extract it to wherever directory you want. I choose to put installed software in my home directory:

preston@mymachine:~$ tar xjvf vlc-1.0.6.tar.bz2
preston@mymachine:~$ cd vlc-1.0.6

Part 2: The “./configure” Command

Introduction

Herein lies the largest part of the work. Go ahead and give the following command a whirl:

preston@PRESTON-BOX:~/vlc-1.0.6$ ./configure

Chances are, it isn’t going to finish. It will probably throw an error about not finding some library or header file. And even if it does spit out a completed configuration, it’s going to be a hallow, empty shell. DON’T compile that! The output might look something like this:

[LOTS OF STUFF ABOVE]...
checking for FREETYPE... yes
checking fontconfig/fontconfig.h usability... yes
checking fontconfig/fontconfig.h presence... yes
checking for fontconfig/fontconfig.h... yes
checking Carbon/Carbon.h usability... no
checking Carbon/Carbon.h presence... no
checking Carbon/Carbon.h... no
checking for FRIBIDI... configure: error: Package requirements (fribidi) were not met:

No package 'fribidi' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix.

Alternatively, you may set the environment variables FRIBIDI_CFLAGS and FRIBIDI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Notice the highlighted lines that show where the error was thrown. Here, it’s telling you bluntly what package was not installed.

Or it could look something like this:

[LOTS OF STUFF ABOVE]...
checking for SWSCALE... yes
checking libswscale/swscale.h usability... yes
checking libswscale/swscale.h presence... yes
checking for libswscale/swscale.h... yes
checking for ffmpeg/swscale.h usability... no
checking for ffmpeg/swscale.h presence... no
checking for ffmpeg/swscale.h... no
checking for POSTPROC... yes
checking for libpostproc/postproc.h usability... no
checking for libpostproc/postproc.h presence... no
checking for libpostproc/postproc.h... no
checking for faad.h usability... yes
checking for faad.h presence... yes
checking for faad.h... yes
checking for faacDecOpen in -lfaad... no
checking for NeAACDecOpen in -lfaad... yes
checking for twolame.h usability... no
checking for twolame.h presence... no
checking for twolame.h... no
configure: error: cannot find development header for libtwolame...

Notice in the highlighted line that it’s not naming a package, only a development header it cannot find.

Getting a “./configure” command to “complete”

So… What do you think we’re going to do to get rid of these errors? We’re going to start installing what look like the right packages and headers ( headers are often called “development packages,” the ones that end in “-dev”). We will continue to do this until we can get a ./configure command that completes (i.e., no “errors”). However, we are NOT going to immediately jump into compiling simply because the “./configure” completes (as I will show you, soon).

I prefer using Synaptic Package Manager for this sort of thing, mainly because it has a simple search function that will usually find the right packages to install. For example, searching for package “fribidi” in Synaptic points me right to it. Install it. Now try to “./configure” again. You’ll probably find another problem, perhaps something like the second example. If that’s the case (missing a header file), then use synaptic to search for the name and install the “-dev” package. That should clear it up.

Continue to clear up these little issues. I had to install the following before I could get a configuration to complete:

  • libmad0-dev
  • libavcodec-dev (Led to MANY other packages being installed. I did not keep track of them.)
  • libavformat-dev
  • libswscale-dev
  • libpostproc-dev
  • libfribidi-dev

Hunting “WARNING” flags in a “./configure” command that “completes”

However, while this configuration will complete, it is still a very hollow shell. VLC generates a list of enabled modules, and you’ll no doubt notice the shortness of the list at the bottom.

Your goal is to hunt down the “WARNING” flags that the configuration script will throw. I’ve highlighted them in this example.

checking sys/mount.h presence... yes
checking for sys/mount.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking netinet/udplite.h usability... no
checking netinet/udplite.h presence... no
checking for netinet/udplite.h... no
checking sys/eventfd.h usability... no
checking sys/eventfd.h presence... no
checking for sys/eventfd.h... no
checking for net/if.h... yes
checking machine/param.h usability... no
checking machine/param.h presence... no
checking for machine/param.h... no
checking sys/shm.h usability... yes
checking sys/shm.h presence... yes
checking for sys/shm.h... yes
checking linux/version.h usability... yes
checking linux/version.h presence... yes
checking for linux/version.h... yes
checking linux/dccp.h usability... yes
checking linux/dccp.h presence... yes
checking for linux/dccp.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking for ssize_t... yes
checking for library containing poll... none required
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking for nanosleep in time.h... yes
checking for timespec in sys/time.h... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for MINIZIP... no
checking unzip.h usability... no
checking unzip.h presence... no
checking for unzip.h... no
checking for HAL... no
configure: WARNING: libhal >= 0.5.0 was not found. Install libhal-dev ?
checking for UDEV... no
checking for MTP... no
configure: WARNING: MTP library not found
checking for DBUS... yes
checking for ntohl in sys/param.h... no
checking if gcc -std=gnu99 accepts -Wall... yes
checking if gcc -std=gnu99 accepts -Wextra... yes
checking if gcc -std=gnu99 accepts -Wsign-compare... yes
checking if gcc -std=gnu99 accepts -Wundef... yes
checking if gcc -std=gnu99 accepts -Wpointer-arith... yes
checking if gcc -std=gnu99 accepts -Wbad-function-cast... yes
checking if gcc -std=gnu99 accepts -Wcast-align... yes
checking if gcc -std=gnu99 accepts -Wwrite-strings... yes
checking if gcc -std=gnu99 accepts -Wmissing-prototypes... yes
checking if gcc -std=gnu99 accepts -Wvolatile-register-var... yes
checking if gcc -std=gnu99 accepts -Werror-implicit-function-declaration... yes
checking if gcc -std=gnu99 accepts -pipe... yes
checking if $CC accepts -Os... yes
checking if $CC accepts -O4... yes
checking if $CC accepts -O3... yes
checking if $CC accepts -O2... yes
checking if $CC accepts -O0... yes
checking if $CC accepts -ffast-math... yes
checking if $CC accepts -funroll-loops... yes
checking if $CC accepts -fomit-frame-pointer... yes
checking if $CC accepts -bundle -undefined error... no
checking __attribute__ ((aligned ())) support... 64
checking for __attribute__((packed))... yes
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking for backtrace... yes
checking if gcc -std=gnu99 groks MMX intrinsics... yes
checking if gcc -std=gnu99 groks MMX inline assembly... yes
checking if gcc -std=gnu99 groks MMX EXT inline assembly... yes
checking if gcc -std=gnu99 groks SSE2 intrinsics... yes
checking if gcc -std=gnu99 groks SSE inline assembly... yes
checking if gcc -std=gnu99 groks SSE2 inline assembly... yes
checking if gcc -std=gnu99 groks 3D Now! inline assembly... yes
checking whether gcc -std=gnu99 accepts -mtune=athlon64... yes
checking for LUA... no
configure: WARNING: lua5.1 not found, trying lua >= 5.1 instead
checking for LUA... no
checking lua.h usability... no
checking lua.h presence... no
checking for lua.h... no
checking lauxlib.h usability... no
checking lauxlib.h presence... no
checking for lauxlib.h... no
checking lualib.h usability... no
checking lualib.h presence... no
checking for lualib.h... no
checking for luaL_newstate in -llua5.1 ... no
checking for luaL_newstate in -llua51 ... no
checking for luaL_newstate in -llua ... no
configure: WARNING: lua >= 5.1 not found!
checking for LIBPROXY... no
checking for NOTIFY... no
checking for TAGLIB... no
configure: WARNING: TagLib library not found
checking liveMedia_version.hh usability... no
checking liveMedia_version.hh presence... no
checking for liveMedia_version.hh... no
checking liveMedia.hh usability... no
checking liveMedia.hh presence... no
checking for liveMedia.hh... no
configure: WARNING: The development files for liveMedia (live555) can't be found
checking dvdread/dvd_reader.h usability... no
checking dvdread/dvd_reader.h presence... no
checking for dvdread/dvd_reader.h... no
checking libdvdread/dvd_reader.h usability... no
checking libdvdread/dvd_reader.h presence... no
checking for libdvdread/dvd_reader.h... no
checking for dvdnav-config... no
checking libsmbclient.h usability... no
checking libsmbclient.h presence... no
checking for libsmbclient.h... no
checking for struct _SMBCCTX.close_fn... no
checking for dvbpsi/dr.h... no
configure: WARNING: cannot find libdvbpsi headers
checking for dvbpsi_GenSDTSections in -ldvbpsi... no
checking linux/videodev2.h usability... yes
checking linux/videodev2.h presence... yes
checking for linux/videodev2.h... yes
checking for LIBV4L2... no
configure: WARNING: LibV4L2 support disabled because libv4l2 development headers were not found
checking for LIBCDIO... no
configure: WARNING: CD Reading and information library not found
checking for VCDINFO... no
configure: WARNING: VCD information library not found
checking for cdrom_msf0 in linux/cdrom.h... yes
checking for scsireq in sys/scsiio.h... no
checking for ioc_toc_header in sys/cdio.h... no
checking for LIBCDDB... no
configure: WARNING: new enough libcddb not found. CDDB access disabled
configure: WARNING: the dvb access module requires libdvbpsi
checking for inet_pton... yes
checking for inet_ntop... yes
checking ogg/ogg.h usability... yes
checking ogg/ogg.h presence... yes
checking for ogg/ogg.h... yes
checking for oggpack_read in -logg... yes
checking ebml/EbmlVersion.h usability... no
checking ebml/EbmlVersion.h presence... no
checking for ebml/EbmlVersion.h... no
checking libmodplug/modplug.h usability... no
checking libmodplug/modplug.h presence... no
checking for libmodplug/modplug.h... no
checking mpc/mpcdec.h usability... no
checking mpc/mpcdec.h presence... no
checking for mpc/mpcdec.h... no
checking mpcdec/mpcdec.h usability... no
checking mpcdec/mpcdec.h presence... no
checking for mpcdec/mpcdec.h... no
configure: WARNING: only static linking is available, you must provide a gme-tree
checking mad.h usability... yes
checking mad.h presence... yes
checking for mad.h... yes
checking for mad_bit_init in -lmad... yes
checking for AVCODEC... yes
checking libavcodec/avcodec.h usability... yes
checking libavcodec/avcodec.h presence... yes
checking for libavcodec/avcodec.h... yes
checking ffmpeg/avcodec.h usability... no
checking ffmpeg/avcodec.h presence... no
checking for ffmpeg/avcodec.h... no
checking libavutil/avutil.h usability... yes
checking libavutil/avutil.h presence... yes
checking for libavutil/avutil.h... yes
checking ffmpeg/avutil.h usability... no
checking ffmpeg/avutil.h presence... no
checking for ffmpeg/avutil.h... no
checking for AVFORMAT... yes
checking libavformat/avformat.h usability... yes
checking libavformat/avformat.h presence... yes
checking for libavformat/avformat.h... yes
checking ffmpeg/avformat.h usability... no
checking ffmpeg/avformat.h presence... no
checking for ffmpeg/avformat.h... no
checking for libavutil/avutil.h... (cached) yes
checking for ffmpeg/avutil.h... (cached) no
checking for SWSCALE... yes
checking libswscale/swscale.h usability... yes
checking libswscale/swscale.h presence... yes
checking for libswscale/swscale.h... yes
checking ffmpeg/swscale.h usability... no
checking ffmpeg/swscale.h presence... no
checking for ffmpeg/swscale.h... no
checking for POSTPROC... yes
checking libpostproc/postproc.h usability... no
checking libpostproc/postproc.h presence... no
checking for libpostproc/postproc.h... no
checking postproc/postprocess.h usability... no
checking postproc/postprocess.h presence... no
checking for postproc/postprocess.h... no
checking sysfs/libsysfs.h usability... yes
checking sysfs/libsysfs.h presence... yes
checking for sysfs/libsysfs.h... yes
checking libtar.h usability... no
checking libtar.h presence... no
checking for libtar.h... no
checking a52dec/a52.h usability... yes
checking a52dec/a52.h presence... yes
checking for a52dec/a52.h... yes
checking for a52_free in -la52... yes
checking for DCA... no
checking for LIBMPEG2... no
configure: WARNING: Could not find libmpeg2 on your system: you may get it from http://libmpeg2.sf.net/ . Alternatively you can use --disable-libmpeg2 to disable the libmpeg2 plugin.
checking vorbis/codec.h usability... yes
checking vorbis/codec.h presence... yes
checking for vorbis/codec.h... yes
checking vorbis/vorbisenc.h usability... yes
checking vorbis/vorbisenc.h presence... yes
checking for vorbis/vorbisenc.h... yes
checking speex/speex.h usability... yes
checking speex/speex.h presence... yes
checking for speex/speex.h... yes
checking for speex_decode_int in -lspeex... yes
checking for SCHROEDINGER... no
checking png.h usability... yes
checking png.h presence... yes
checking for png.h... yes
checking for png_set_rows in -lpng... yes
checking for X264... yes
checking if linker supports -Bsymbolic... yes
checking for FLUIDSYNTH... no
checking for ZVBI... no
configure: WARNING: ZVBI library not found. Enabling the telx module instead
checking for KATE... no
checking kate/kate.h usability... no
checking kate/kate.h presence... no
checking for kate/kate.h... no
checking for TIGER... no
checking for X... libraries , headers 
checking for gethostbyname... yes
checking for connect... (cached) yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking X11/Xlib.h usability... yes
checking X11/Xlib.h presence... yes
checking for X11/Xlib.h... yes
checking for XShmAttach in -lXext... yes
checking for X11/extensions/dpms.h... yes
checking for DPMSInfo in X11/extensions/dpms.h... yes
checking X11/extensions/Xv.h usability... no
checking X11/extensions/Xv.h presence... no
checking for X11/extensions/Xv.h... no
checking for X11/Xlib.h... (cached) yes
checking GL/glu.h usability... yes
checking GL/glu.h presence... yes
checking for GL/glu.h... yes
checking GL/glx.h usability... yes
checking GL/glx.h presence... yes
checking for GL/glx.h... yes
checking X11/extensions/Xinerama.h usability... yes
checking X11/extensions/Xinerama.h presence... yes
checking for X11/extensions/Xinerama.h... yes
checking for XineramaQueryExtension in -lXinerama_pic... no
checking for XineramaQueryExtension in -lXinerama... yes
checking for X11/extensions/xf86vmode.h... no
checking GL/gl.h usability... yes
checking GL/gl.h presence... yes
checking for GL/gl.h... yes
checking for GL/glu.h... (cached) yes
checking for sdl12-config... no
checking for sdl11-config... no
checking for sdl-config... /usr/bin/sdl-config
checking SDL/SDL.h usability... yes
checking SDL/SDL.h presence... yes
checking for SDL/SDL.h... yes
checking SDL/SDL_image.h usability... no
checking SDL/SDL_image.h presence... no
checking for SDL/SDL_image.h... no
checking SDL_image.h usability... no
checking SDL_image.h presence... no
checking for SDL_image.h... no
configure: WARNING: The development package for SDL_image is not installed.
  You should install it alongside your SDL package.
checking for FREETYPE... yes
checking fontconfig/fontconfig.h usability... yes
checking fontconfig/fontconfig.h presence... yes
checking for fontconfig/fontconfig.h... yes
checking Carbon/Carbon.h usability... no
checking Carbon/Carbon.h presence... no
checking for Carbon/Carbon.h... no
checking for FRIBIDI... yes
checking for XML2... no
checking cascade/graphics/CascadeScreen.h usability... no
checking cascade/graphics/CascadeScreen.h presence... no
checking for cascade/graphics/CascadeScreen.h... no
configure: WARNING: Not building Roku HD1000 compatible video output
checking cascade/graphics/CascadeBitmap.h usability... no
checking cascade/graphics/CascadeBitmap.h presence... no
checking for cascade/graphics/CascadeBitmap.h... no
configure: WARNING: Not building Roku HD1000 compatible video output
checking linux/fb.h usability... yes
checking linux/fb.h presence... yes
checking for linux/fb.h... yes
checking soundcard.h usability... no
checking soundcard.h presence... no
checking for soundcard.h... no
checking sys/soundcard.h usability... yes
checking sys/soundcard.h presence... yes
checking for sys/soundcard.h... yes
checking for main in -lossaudio... no
checking for PULSE... yes
checking alsa/asoundlib.h usability... yes
checking alsa/asoundlib.h presence... yes
checking for alsa/asoundlib.h... yes
checking for main in -lasound... yes
checking deschutes/libraries/hdmachinex225/PCMAudioPlayer.h usability... no
checking deschutes/libraries/hdmachinex225/PCMAudioPlayer.h presence... no
checking for deschutes/libraries/hdmachinex225/PCMAudioPlayer.h... no
checking for UpnpInit in -lupnp... no
checking for QT4... yes
checking for moc-qt4... /usr/bin/moc-qt4
checking for rcc... /usr/bin/rcc
checking for uic-qt4... /usr/bin/uic-qt4
checking Ph.h usability... no
checking Ph.h presence... no
checking for Ph.h... no
checking for BONJOUR... yes
checking for XCB... yes
checking for XCB_KEYSYMS... no
configure: WARNING: XCB keysyms was not found
checking for libgcrypt-config... /usr/bin/libgcrypt-config
checking for LIBGCRYPT - version >= 1.1.94... yes (1.4.1)
checking LIBGCRYPT API version... okay
checking for GNUTLS... yes
checking whether to enable RAOP plugin... yes
checking whether byte ordering is bigendian... no
checking for osso_display_blanking_pause in -losso... no
checking for XSPSetPixelDoubling in -lXsp... no
configure: creating ./vlc-config.in
configure: creating ./config.status
config.status: creating extras/package/win32/vlc.win32.nsi
config.status: creating extras/package/macosx/Info.plist
config.status: creating extras/package/macosx/Resources/English.lproj/InfoPlist.strings
config.status: creating extras/package/macosx/plugin/Info.plist
config.status: creating extras/package/macosx/plugin/InstallerInfo.plist
config.status: creating Makefile
config.status: creating projects/activex/Makefile
config.status: creating projects/activex/axvlc.inf
config.status: creating doc/Makefile
config.status: creating extras/package/ipkg/Makefile
config.status: creating libs/loader/Makefile
config.status: creating libs/srtp/Makefile
config.status: creating libs/unzip/Makefile
config.status: creating modules/Makefile
config.status: creating projects/mozilla/Makefile
config.status: creating m4/Makefile
config.status: creating po/Makefile.in
config.status: creating projects/activex/axvlc_rc.rc
config.status: creating projects/mozilla/npvlc_rc.rc
config.status: creating projects/mozilla/vlc.r
config.status: creating projects/mozilla/install.js
config.status: creating share/Makefile
config.status: creating share/vlc_win32_rc.rc
config.status: creating share/libvlc_win32_rc.rc
config.status: creating compat/Makefile
config.status: creating src/Makefile
config.status: creating src/test/Makefile
config.status: creating bin/Makefile
config.status: creating test/Makefile
config.status: creating modules/access/Makefile
config.status: creating modules/access/bd/Makefile
config.status: creating modules/access/bda/Makefile
config.status: creating modules/access/dshow/Makefile
config.status: creating modules/access/dvb/Makefile
config.status: creating modules/access/mms/Makefile
config.status: creating modules/access/cdda/Makefile
config.status: creating modules/access/rtp/Makefile
config.status: creating modules/access/rtsp/Makefile
config.status: creating modules/access/vcd/Makefile
config.status: creating modules/access/vcdx/Makefile
config.status: creating modules/access/screen/Makefile
config.status: creating modules/access/zip/Makefile
config.status: creating modules/access_output/Makefile
config.status: creating modules/audio_filter/Makefile
config.status: creating modules/audio_filter/channel_mixer/Makefile
config.status: creating modules/audio_filter/converter/Makefile
config.status: creating modules/audio_filter/resampler/Makefile
config.status: creating modules/audio_filter/spatializer/Makefile
config.status: creating modules/audio_mixer/Makefile
config.status: creating modules/audio_output/Makefile
config.status: creating modules/codec/Makefile
config.status: creating modules/codec/avcodec/Makefile
config.status: creating modules/codec/cmml/Makefile
config.status: creating modules/codec/dmo/Makefile
config.status: creating modules/codec/shine/Makefile
config.status: creating modules/codec/subtitles/Makefile
config.status: creating modules/codec/spudec/Makefile
config.status: creating modules/codec/wmafixed/Makefile
config.status: creating modules/codec/xvmc/Makefile
config.status: creating modules/control/Makefile
config.status: creating modules/control/http/Makefile
config.status: creating modules/control/globalhotkeys/Makefile
config.status: creating modules/demux/Makefile
config.status: creating modules/demux/asf/Makefile
config.status: creating modules/demux/avformat/Makefile
config.status: creating modules/demux/avi/Makefile
config.status: creating modules/demux/mkv/Makefile
config.status: creating modules/demux/mp4/Makefile
config.status: creating modules/demux/mpeg/Makefile
config.status: creating modules/demux/playlist/Makefile
config.status: creating modules/gui/Makefile
config.status: creating modules/gui/beos/Makefile
config.status: creating modules/gui/pda/Makefile
config.status: creating modules/gui/macosx/Makefile
config.status: creating modules/gui/maemo/Makefile
config.status: creating modules/gui/minimal_macosx/Makefile
config.status: creating modules/gui/qnx/Makefile
config.status: creating modules/gui/qt4/Makefile
config.status: creating modules/gui/skins2/Makefile
config.status: creating modules/gui/wince/Makefile
config.status: creating modules/meta_engine/Makefile
config.status: creating modules/misc/Makefile
config.status: creating modules/misc/dummy/Makefile
config.status: creating modules/misc/lua/Makefile
config.status: creating modules/misc/memcpy/Makefile
config.status: creating modules/misc/notify/Makefile
config.status: creating modules/misc/testsuite/Makefile
config.status: creating modules/misc/playlist/Makefile
config.status: creating modules/misc/osd/Makefile
config.status: creating modules/misc/stats/Makefile
config.status: creating modules/misc/xml/Makefile
config.status: creating modules/misc/probe/Makefile
config.status: creating modules/mux/Makefile
config.status: creating modules/mux/mpeg/Makefile
config.status: creating modules/packetizer/Makefile
config.status: creating modules/services_discovery/Makefile
config.status: creating modules/stream_filter/Makefile
config.status: creating modules/stream_out/Makefile
config.status: creating modules/video_chroma/Makefile
config.status: creating modules/video_filter/Makefile
config.status: creating modules/video_filter/atmo/Makefile
config.status: creating modules/video_filter/dynamicoverlay/Makefile
config.status: creating modules/video_output/Makefile
config.status: creating modules/video_output/msw/Makefile
config.status: creating modules/video_output/qte/Makefile
config.status: creating modules/video_output/x11/Makefile
config.status: creating modules/visualization/Makefile
config.status: creating modules/visualization/visual/Makefile
config.status: creating modules/visualization/galaktos/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
config.status: creating vlc-config
Enabled modules: a52tofloat32 a52tospdif access_alsa access_mmap access_oss adjust alphamask alsa aout_file aout_sdl atmo audio_format audioscrobbler avcodec avformat bandlimited_resampler blend blendbench bluescreen bonjour canvas cdda chain clone cmml colorthres converter_float crop croppadd dbus deinterlace dolby_surround_decoder dtstospdif dynamicoverlay equalizer erase extract fake fb float32_mixer folder freetype gaussianblur gestures glx gnutls gradient grain headphone_channel_mixer hotkeys http i420_rgb_mmx i420_rgb_sse2 i420_ymga i420_ymga_mmx i420_yuy2 i420_yuy2_mmx i420_yuy2_sse2 i422_i420 i422_yuy2 i422_yuy2_mmx i422_yuy2_sse2 inhibit invert linear_resampler logo magnify marq memcpy3dn memcpymmx memcpymmxext mosaic motion motionblur motiondetect mpgatofixed32 mux_ogg noise normvol ogg opengl opengl osd_parser osdmenu oss panoramix param_eq png podcast postproc psychedelic pulse puzzle qt4 rc remoteosd ripple rotate rss rv32 sap scale scaletempo scene screensaver sharpen shout showintf signals simple_channel_mixer skins2 spatializer spdif_mixer speex stream_out_raop swscale telepathy telnet telx transform unzip v4l2 vcd visual vmem vorbis vout_sdl wall wave x11 x11_screen x264 yuv yuvp yuy2_i420 yuy2_i422 zip 


libvlc configuration
--------------------
version               : 1.0.6
system                : linux
architecture          : x86_64 mmx sse sse2
build flavour         : devel 
vlc aliases           : cvlc rvlc svlc qvlc
plugins/bindings      :

You can tune the compiler flags in vlc-config.
To build vlc and its plugins, type `./compile' or `make'.

What do you think we’re going to do now? That’s right. We’re going to keep looking for software to install from this. Notice in my example that it cannot find the “libdvbpsi” headers. Search synaptic and install them. Repeat ad naseum. This is what I had to install to get this particular configuration script looking prettier (having fewer WARNING flags).

  • liblivemedia-dev
  • libtag1-dev
  • libhal-dev
  • libmtp-dev —> led to libusb-dev
  • liblua5.1-0-dev –> led to 3 others: libltdl3-dev, libreadline5-dev, libtool
  • libdvbpsi4-dev
  • libv4l-0
  • libv4l-dev
  • libcdio-dev
  • libvcdinfo-dev –> led to lib9660-dev
  • libcddb2
  • libcddb2-dev
  • libmpeg2-4-dev
  • zvbi
  • libzvbi0
  • libzvbi-common
  • libzvbi-dev
  • libsdl-image1.2-dev —> led to libtiff4-dev libtiffxx0c2
  • libxcb-keysyms0
  • libxcb-keysyms0-dev

After this, most of the warnings were gone. Some remained, such as support for hardware I didn’t have or for features I simply didn’t care about. However, at this point, most of your dependencies will be installed. Most of the work SHOULD be done :P

Setting up the “full” configuration line

Now we are ready to try a full configuration command, one that specifies what features we do (and perhaps don’t) want installed. If you run the command

:~$ ./configure --help

Then you should have a list of ALL of the different flags and options available to you. Most of them are never really needed, though I’m sure you could have fun trying all sorts of different screwy hacks with various parts of the compilation procedure. The key point here though is that it will tell you which features are enabled and disabled by default. To save you some time, this was the full configuration command I ran:

:~$ ./configure --disable-nls --disable-mozilla --enable-x11 --enable-xvideo --disable-gtk --enable-sdl --enable-avcodec --enable-avformat --enable-swscale --enable-mad --enable-libdvbpsi --enable-a52 --enable-libmpeg2 --enable-dvdnav --enable-faad --enable-vorbis --enable-ogg --enable-theora --enable-faac --enable-mkv --enable-freetype --enable-fribidi --enable-speex --enable-flac --enable-live555 --with-live555-tree=/home/preston/live --enable-caca --enable-skins --enable-skins2 --enable-alsa --disable-kde --enable-qt4 --enable-ncurses --enable-release --enable-snapshot --enable-dbus-control --enable-shout --enable-taglib --enable-x264 --enable-v4l --enable-cddax --enable-vcdx --enable-realrtsp --enable-xvmc --enable-svg --enable-dvdread --enable-twolame --enable-real --enable-flac --enable-tremor --with-ffmpeg-mp3lame --with-ffmpeg-faac --enable-quicktime --enable-dirac 

The following

  • –disable-nls
  • –disable-mozilla

Are required to be disabled. If you don’t, then the configuration line won’t complete.

As well, as the configuration scripts change with each release, certain flags might not exist any more. VLC’s configuration –though not necessarily other softwares’ configuration scripts– will tell you which flags it doesn’t recognize. There are a few up there in my configuration line that aren’t recognized and as such don’t do anything (like “–disable-gtk”). You can leave them in the configuration command or take them out; it is, as far as I know, irrelevant.

Getting the “full” configuration line to “complete”

Now that you have all of the relevant features enabled or disabled, you are going to once again repeat the process you did the first two times, hunting for warning flags and other issues that prevent the configuration from properly completing. I personally had to install the libdvdread headers. Other than that, the configuration completed with a nice long list of modules ready to be installed. It then gave me the go ahead to try the “make” command.

Notes about software that is “too old”

When I went through this process, the configuration script complained that my livemedia packages (live-555) were too old. The error looked like this:

[MORE OF CONFIGURATION OUTPUT ABOVE]
checking liveMedia_version.hh usability... yes
checking liveMedia_version.hh presence... yes
checking for liveMedia_version.hh... yes
checking for liveMedia version >= 1214895600 ... no
configure: error: Your version of liveMedia is too old: you may get a more recent one from http://www.live555.com/liveMedia.
Alternatively you can use --disable-live555 to disable the liveMedia plugin.

If this is the case, then you ought to remove the repository version and install the latest if you think it is necessary or worth it. That is what I did. Go ahead and jump down to Part 4 if you want a guide on how to do so.

Part 3: The “make” command ; fixing errors that occur in this stage

This is the point where you hope a whole bunch of gibberish goes rushing past without stopping until saying something along the lines of being successfully installed. Of course, it doesn’t always work that way. There were two issues I encountered:

  1. Missing header files
  2. Improperly compiled supporting software

Missing Header Files

Perfect evidence that even the best configuration files can be thwarted –I’d presume by faulty assumptions that the installation of one package means that such a header file would HAVE to be installed on the machine. Can’t say for sure. Regardless, when I first ran the “make” command, I got this error:

[LOTS OF GIBBERISH ABOVE (relating to the "cdda" module)]
In file included from access.c:30:
cdda.h:70:27: error: cdio/paranoia.h: No such file or directory
In file included from access.c:30:
cdda.h:104: error expected specifier-qualifier-list before 'paranoia_mode_t'
access.c: In function 'get_audio_position':
access.c:170: error: 'cdda_data_t' has no member named 'b_audio_ctl'
access.c:181: error: 'cdda_data_t' has no member named 'b_nav_mode'
[MORE ERROR MESSAGES BELOW]

If you’ve ever written code before, then you’ll know better than to try fixing the last error. The rule is that you hunt down the very FIRST error, and solve IT’S complaint. The list of errors the compiler spits out will almost always originate from the first error. This case is no exception; the “access.c” errors like “has no member named” are symptoms of the first error:

cdda.h:70:27: error: cdio/paranoia.h: No such file or directory

If it cannot find the header file (“paranoia.h”) , than the source code (“access.c”) will of course be unable to resolve the pieces that came from the header.

I had to try a few different packages from synaptic to get this to go away. I installed them in this order:

  1. libcdio-cdda-dev –> libcdio-cdda0 [tried since the problem occured in the cdda module; FAILED]
  2. libcdparanoia-dev [tried since it was a paranoia development file; FAILED]
  3. libcdio-paranoia-dev —> libcdio-paranoia0 [tried since it was a more specific development file including the input/output in the filename; SUCCESS]

After installing the “libcdio-paranoia-dev” file, this error went away and VLC continued to compile.

Improperly compiled supporting software

I had compiled the latest livemedia from source, but apparently, VLC didn’t like how I did it. I got issues like this:

[MORE STUFF ABOVE RELATING TO COMPILING LIVEMEDIA]
/usr/bin/ld: /home/preston/live/liveMedia/libliveMedia.a(Media.o): relocation R_X86_64_32S against 'vtable for Medium' can not be used when making a shared object; recompile with -fPIC
/home/preston/live/liveMedia/libliveMedia.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[5]: *** [liblive555_plugin.la] Error 1
make[5]: Leaving directory '/home/preston/vlc-1.0.6/modules/demux'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory '/home/preston/vlc-1.0.6/modules/demux'
make[3]: *** [all] Error 2
make[3]: Leaving directory '/home/preston/vlc-1.0.6/modules/demux'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/preston/vlc-1.0.6/modules/'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/preston/vlc-1.0.6'
make: *** [all] Error 2

As it turns out, this is apparently a consequence of using a 64 bit operating system. “-fPIC” is a compiler option, something you can tell the compiler to do to your code when compiling it that makes it easier for other software to then use your code. But how do we fix our livemedia installation to use fpic? Well, you need to recompile livemedia with the “-fpic” compiler option. It turns out that livemedia makes this a (relatively) painless process. Read part four.

Part 4: Installing Live-555 and Solving the “recompile with -fPIC” Issue

I don’t actually use this plugin. However, I thought it would be a good idea to practice compiling other supporting software when using the repositories wasn’t sufficient.

Installing correctly

The website gives instructions on how to install.

Download from here:

http://www.live555.com/liveMedia/public/

A filename like “live.2010.07.13.tar.gz” is what you’ll want from that page.

Now, run the following command inside the live directory:

username@computer:~/live$ ./genMakefiles linux

You may notice on the website that the developer says you might need to tweak certain files. Tweak the one called “config.linux” to look like this:

COMPILE_OPTS =		$(INCLUDES) -I. -O2 -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fPIC
C =			                c
C_COMPILER =		cc
C_FLAGS =		        $(COMPILE_OPTS)
CPP =			        cpp
CPLUSPLUS_COMPILER =c++
CPLUSPLUS_FLAGS =	$(COMPILE_OPTS) -Wall -DBSD=1 -Wno-deprecated
OBJ =			        o
LINK =			        c++ -o
LINK_OPTS =		        -L.
CONSOLE_LINK_OPTS =	$(LINK_OPTS)
LIBRARY_LINK =		ar cr 
LIBRARY_LINK_OPTS =	
LIB_SUFFIX =			a
LIBS_FOR_CONSOLE_APPLICATION =
LIBS_FOR_GUI_APPLICATION =
EXE =

I highlighted the lines where I made changes. In the first line, I added the “-fPIC” option so that VLC won’t whine when using it. As a result, livemedia will be compiled with “-fPIC” and VLC will be able to use the code. The website also suggested adding “-Wno-deprecated” to the CPLUSPLUS_FLAGS if your gcc is 3.0 or greater (mine is). I did, and didn’t notice any difference; you’re probably fine not adding it if you don’t want to.

Now, for once, the procedure is as simple as:

username@computer:~/live$ ./configure
username@computer:~/live$ make
username@computer:~/live$ su
username@computer:~/live# make install

Fixing an improper install

Supposing you didn’t add the “-fPIC” flag where you were supposed to. First, execute the following commands in the livemedia directory:

:~$ make clean
:~# make uninstall [may or may not actually work; i can't remember if livemedia has this option or not; if not, don't worry about it. just do the "make clean" and go back to the first section of part four]

Now, go back up to the first section of part four and install as shown. The problem will be resolved.

Part 5: The “make install” Command and Troubleshooting

If you’ve made it this far, congratulations. Chances are, your software is good to go. Assuming that the “make” command completes without errors, then you are ready to install the software by executing this command:

:~# make install

This puts all of the appropriate executables in the right directories and such. I’d also recommend doing this to update the dynamic libraries before running the software:

:~# ldconfig

Now try running vlc:

:~$ vlc

It will probably tell you that you have a buggy glibc version. However, it should still run just fine :-)

How to add features you forgot to include in the ./configure line or have since installed

So, you finally have the program working. It can even read all of your files! Oh, wait… it doesn’t read a certain type. Don’t panic. It happened to me. It wouldn’t open files that were in matroska containers (“*.mkv” files). If this happens, do the following in the vlc directory:

:~$ make clean
:~# make uninstall

Now, since I wasn’t able to play matroska containers, I installed the following packages from synaptic:

  • libmatroska-dev
  • libebml-dev

I then reinstalled vlc with the “./configure” command I used before (the one with all of the enable/disable switches), then “make” and “make install”. I once again executed “ldconfig” as root, and I then had a fully functional VLC media player.

Conclusion

Congratulations. You now have the second latest VLC out there :-)