What began as a simple task to play an h.264 High 10 Profile (Hi10P, 10-bit) video clip using VLC 2.0.1 (VideoLAN Client) expanded into a journey through the messy world of multimedia codecs, the fabled Dependency Hell, compiler warnings, and bizarre errors.
As I played a short video clip in VLC, I quickly noticed something was wrong. The video picture had a purple tint, splotchy areas of compression artifacts appeared throughout, and motion trials streaked across the moving image.
Nooo! This never happened before. What could it be?
Playing the same video in Totem and SMPlayer reproduced the same messy image. I then tried playing videos I knew were good. All played fine, so the problem had to be the video.
The clip must be encoded using a new format.
And indeed it was. The video was encoded using the latest h.264 High 10 Profile that is supposed to offer smaller file sizes at the same quality. But that mattered little to me. It looked terrible in Ubuntu 10.10 on VLC 1.1.4, which was what I was using.
The video clip played beautifully in VLC 2.0.1 on Windows 7, so Ubuntu needed either a new player, a new codec, or both.
A New Player or A New Codec?
Choices, choices. With no clear solution, I opted for new codecs first, so I downloaded and compiled the latest x264, VP8, and ffmpeg (another story).
No good. The purplish video and garbage effects still appeared in SMPlayer and the others. Worse, VLC only showed a solid green display area when playing the video. That didn’t work, so after restoring to a working system, I tried a new player instead.
Hi10P Plays in Ubuntu 12.04
Before compiling my own VLC, I wanted to see if the video would play in VLC 2.0.1. I installed Ubuntu 12.04 64-bit and installed VLC 2.0.1 (it’s in the 12.04 repository).
The video played beautifully! No purple tint. No artifacts. No motion trails. The video looked nice. Real nice. Logically, all I need is VLC 2.0.1 for Ubuntu 10.10 64-bit and we’ll finally have peace in Linux Land.
Finding VLC 2.0.1
Sadly, VLC stops at 1.1.4 in the 10.10 repository, so that option was out. I would have to find a 2.0.1 .deb or compile my own. Since compiling can be an involving project, I decided to scour ppa’s and forgotten alleys of the Internet. VideoLAN’s instructions only advised upgrading Ubuntu, so that was no help.
My treasure was nowhere to be found.
Why Not Use VLC From Another Repository?
When updated software is nonexistent for Ubuntu 10.10, a useful trick is to grab the .deb from a newer Ubuntu and install it in Ubuntu 10.10. Usually, this works without problems and Ubuntu 10.10 never knows the difference, but not with VLC.
I grabbed VLC 2.0.1 from Ubuntu 12.04 and tried to install it in Ubuntu 10.10 but encountered numerous dependency errors. And this is where the trouble began.
Ubuntu 10.10 has the software needed to run VLC 2, but it’s outdated. The VLC 2 .deb wants newer versions of its needed libraries and support files, and there is no way to install them in Ubuntu 10.10 short of recompiling everything by hand.
The only remaining option was to lovingly compile my own VLC 2.0.1 custom-tailored for my Ubuntu 10.10.
Compiling VLC 2.0.1
The VLC source readme made it sound so simple: 1) ./configure, 2) make, 3) sudo make install. How hard can that be?
My, oh, my. To begin with, my system lacked the necessary development files, so the configure script aborted upon each missing file. I had to manually install each package using Synaptic — one by one — and rerun configure until configure completed successfully. I lost track of how many times I needed to run configure, but it took hours. I was determined not to give up. Also, I spent time reading the package descriptions in Synaptic to learn what each one did.
“Why not run sudo apt-get build-dep vlc?”
This did not work. While it is great for other programs, it kept quitting with VLC. The dependencies refused to install.
Finally, the configure script completed. Entering make at the terminal produced ten minutes worth of scrolling text that would make a true geek salivate.
And then it aborted with an error.
The error had something to do with missing header (.h) files. After some research, it turns out that VLC 2.0.1 requires header files from ffmpeg 0.7, which I did not have. So, it was off to compiling ffmpeg.
The ffmpeg compile project is a story all its own. Seemingly endless configure options, loads of errors, and many hours finally produced a compiled ffmpeg. It’s as big of a project as VLC itself.
Only then did it dawn on me that VLC only wanted the header files, not the compiled binary. To keep a long (ffmpeg) story short, it didn’t work. VLC 2.0.1 refused to compile on my system, so 2.0.1 was abandoned.
Compiling VLC 2.0.0
The same bug tracking site mentioned that VLC 2.0.0 compiles fine on the same system, so I tried that.
Downloading and compiling VLC 2.0.0 went well. When it came time to install, I used sudo checkinstall instead of sudo make install (despite what the readme said) because I wanted a .deb file.
That did not work. The installation would always abort. After more research, it turns out that VLC 2.0.0 has problems with checkinstall, so I had to use make install in the end.
After entering sudo make install, VLC 2.0.0 finally installed successfully.
Okay, How Do I Run VLC 2.0.0?
Ubuntu Software Center makes running new software easy by installing links in the Main Menu and showing a breadtrail. But sudo make install offers no such convenience. The Main Menu must be edited manually (Right-click the menu and choose Edit Menus).
From a terminal, I entered vlc and got a command line-based vlc running. Plenty of error messages appeared, such as missing interfaces and other goodies.
In short, I never got a video file to play using this compiled VLC. I also wanted the GUI back for convenience, but that never happened either. A few more hours of experimentation yielded no results.
Satisfied that I had done all that I knew to do at this point, I decided to uninstall this version and restore VLC 1.1.4 from the Ubuntu 10.10 repository to get a working system again.
An Odd Situation
Synaptic completely removed VLC and all plugins and support files. I installed VLC 1.1.4 from the Ubuntu Software Center. So far, so good.
However, running VLC did nothing. No GUI. No VLC I was familiar with. Hmm. Entering vlc at the command line showed the problem: VLC 2.0.0 was still installed, and it was trying to run with incompatible 1.1.4 support files. Guess at all the errors that appeared in bash.
I uninstalled and reinstalled again and again, but the VLC 2.0.0 I had compiled continued to remain like a stubborn stain in the carpet. Nothing removed it. I tried sudo apt-get remove vlc, sudo apt-get purge vlc, and sudo apt-get autoremove. I even searched through $PATH manually, but no success. The compiled VLC 2.0.0 remained hidden like a shady watch salesman in a dark, back alley awaiting unsuspecting tourists who enter the passphrase ‘vlc.’ Any attempts to install VLC from Synaptic, the terminal, or the Ubuntu Software Center produced the same effect: VLC 2.0.0 always ran with VLC 1.1.4 packages. Synaptic even reported VLC 1.1.4 installed even though VLC 2.0.0 would execute.
Finally, as root, I manually deleted every vlc directory and related library on the system. That should do it! However, VLC would no longer install because I had also deleted the libvlccore files. man-db was also messed up, and that caused all software installations to exit with error codes.
VLC was not installing. Neither from a compiled source or from the repository. VLC wanted those libvlc files, but I could not install them because they were missing and Synaptic reported that it needed libvlc present before installing libvlc. Weird.
Too Much of A Good Thing
At this point, the focus had shifted from “Let’s compile VLC 2 so I can watch a short Hi10P video clip” to “Help! I want my system back!”
Delving into your system like this and trying to solve errors will provide insight that no book can cover. However, I delved too much and actually broke the system by removing libraries and files critical to Linux. As a result, Linux became unusable. Software could not be installed or uninstalled, and all attempts lead to a long list of errors, missing files, and unresolved dependencies.
There was no choice. I reinstalled Ubuntu 10.10, and now VLC 1.1.4 works again.
• “That’s a lot of work. Why not just use Ubuntu 12.04?”
This was more than making a Hi10P video file play. This was a challenge! This was educational! This was…learning at its finest through trial and error. Why pass up a chance like this to learn more about Linux? I spent days trying to compile a working VLC 2 with the goal of playing Hi10P on Ubuntu 10.10, and I now have a deeper understanding of how VLC is put together along with other under-the-hood Linux knowledge.
Besides that, Ubuntu 10.10 outperforms Ubuntu 12.04, so why switch to a lesser OS? Given the setbacks Ubuntu 12.04 causes, I find little incentive to use Ubuntu 12.04 just to play a single video file compared to how well Ubuntu 10.10 runs for everything else. Ubuntu 10.10 dances happy circles in the sand around Ubuntu 12.04, and I want to dance with it.
• “I can compile VLC in under one minute half asleep with a broken keyboard during a blackout. I’m l33t. So, there!”
Good for you. Not everyone has your skills, and there are beginners everyday who could learn from this.
Normally, compiling software from source is a simple process: configure, make, install. Pretty easy and consistent. However, compiling VLC on Ubuntu 10.10 is an entirely different matter for two reasons: 1) Ubuntu 10.10 is filled with outdated packages necessary for compilation (if you want to compile VLC 2.0.1, then you must update those package by compiling them too), and 2) multimedia programs, such as VLC, are highly dependent upon many, many other software packages, plugins, codecs, and libraries.
Multimedia software is probably the hardest to compile properly given all the existing media formats and libraries out there. It’s an all or nothing situation. Everything has to work before VLC will compile. So, this is not simply a matter of compiling VLC by itself. VLC needs codecs compiled. It needs ffmpeg source. It needs libc6, lua, and a host of other software packages I never knew existed until now
But believe me, after installing them one by one through Synaptic during the configure stage, I am now aware of their importance.
• “Why not just use Windows?”
Don’t make me slap you.
Was It Worth the Hassle?
Oh, yes. Even though Hi10P video never played as intended, I learned a great deal about behind-the-scenes operations on my system. This is knowledge no book can provide. Had I immediately compiled a working VLC without any errors, I would have missed out on this valuable learning exercise. The journey was more educational than the goal.
Would I Do Anything Differently?
I would compile and test inside a virtual machine instead of on a production machine like I did in this case. That was my biggest mistake. I had never compiled VLC before, so I thought this would be a simple, merry stroll along the yellow brick road like any other. After all, I never had major problems compiling before, so why should VLC be any different?
Had I compiled inside a virtual Ubuntu 10.10, my main system would not have become inoperable. Only the virtual machine would have croaked, and problems could be repaired from snapshots.
When compiling a project as massive as VLC where the potential for disaster is great, do so inside a virtual Linux. Later, when the program runs properly, install it on the production machine.
Installing new software on an outdated OS is an area where Windows (usually) beats Linux to a pulp. If I want to run VLC 2.0.1 on Windows XP, all I have to do is download VLC, scan for virii, and install. VLC plays on older Windows with minimal hassle.
Not so with Linux. To install a newer VLC on an older Ubuntu requires locating an existing .deb or compiling one from source. While compiling software on Linux is usually a simple task, the world of multimedia software involves time, dedication, and complexity that can make the most seasoned Linux guru quiver in his squeaky sneakers. There is more to compile than VLC itself.
Overall, this has been educational. So, what are you waiting for? Compile VLC 2.0.1 on Ubuntu 10.10 today!