video playback with compiz

Sunday, 29. November 2009 10:16 - daniel - Other - 0 Comments

Video playback with compiz running is pretty slow and sometimes there are some nasty glitches, like not being able to go to full screen mode, black video etc. Some of this is because of how compiz handles the video. But the good news is there is a way to get good video playback with compiz running.

There is a patch for mplayer 1.0rc2 that lets mplayer use some compiz functions to draw the video. You need to have the video plugin enabled in compiz for this to work.

First we need to get the mplayer sources.

apt-get build-dep mplayer
apt-get install build-essential
apt-get source mplayer

Navigate to mplayer-1.0~rc2/libvo, download the patch and apply it.

patch -p0 vo_xv.c mplayrepatch.patch

Now you should update debain/changelog to create a new version of the package and build and install the package with

fakeroot dpkg-buildpackage -b -uc -us
dpkg -i mplayer_1.0-rc2-0ubuntu17_i386.deb
I tried this with ubuntu 8.10 intrepid. If newer versions of ubuntu ship with a version of mplayer that is incompatible with the patch you have to get the mplayer1.0rc2 source code from the mplayer site.

Video playback should work now without problems. There are some other goodies apart from decent video playback speed and working full screen mode, but these two were the most important for me.

(Yet another) short URL service

Tuesday, 13. October 2009 17:30 - daniel - Other - 0 Comments

I've set up a short URL service at It's basically the same as, but with a cool ajax UI. Yay ;). And the best? is one character shorter then Now if that ain't a perfect reason to use it.

Anyway, I just wanted to do my own url shortening and don't rely on a third party service for it. is powered by php and sqlite. It has the same API as will respond with the short url. Adding format xml will respond with an xml file and a bit more verbose error messages, e.g.

The xml format used is:

<url>ORIGINAL URL</url>
<short>SHORT VERSION</short>

And for errors:
<error>ERROR MESSAGE</error>

Sorry, there is no create.php for a fancy html output. If you want to use it as a bookmarklet, this will have to do. Bookmark this link:

If it works alright I might share the code at some point.

Craft DB WoW Addon

Sunday, 11. October 2009 11:10 - daniel - Other - 0 Comments

Craft DB keeps track of crafter on your server. Whenever you open a profession link, the skills and the name of the crafter will be saved and can be displayed when needed. If you are looking for that Blade Ward enchant and can't remember who has the recipe, you can use CraftDB to look who has it.

Craft DB will display names in different colors if they are online, offline, in your guild, on your friendlist or just some random guy who posted his profession into the trade channel

As soon as you open a profession window (either your own, or from a link), Craft DB will scan all the available recipes and saves them and the name of the person for later use.

Craft DB provides a LibDataBroker launcher to open the windows. If you don't have a LibDataBroker display addon installed, you can use /craftdb or /cdb to open Craft DB.

When you enter something into the search box, Craft DB will perform a search on the currently selected profession and only displays the matching spell names.

Here's the project on Craft DB
Here's the download on Craft DB

Video containers are shit

Thursday, 8. October 2009 11:51 - daniel - Other - 2 Comments

This is going to be a rant, so skip it if you don't care.

Video playback is a pain in the ass. It's not just about codecs and players, but the video containers themselves are shit. I only had one container that has not caused problems yet. Everything else bugged sooner or later.

WMV regularly fails to resume video playback after pause in Media Player Classic. No idea why, but pause just doesn't work here.

MP4 caused some weird problems in mplayer, where the video length is all wrong and the audio and video go out of sync. No idea what's wrong with those shitty files, but I pretty much can't watch those files like this. And to make matters worse, mplayer is the only video player that has decent performance on Linux with Compiz running. The only way to fix these files was to remux them to MKV.

AVI files sometimes come without an index, requiring rebuilding of said index. I just don't get how a encoder can fuck up a video so much that it's unplayable on some players. And why doesn't anyone check before redistributing this files?

The only container I'm happy with is Matroska (MKV). The playback works in every player I use and I have yet to encounter shitty behaviour in any player.


Friday, 4. September 2009 11:32 - daniel - Other - 0 Comments

checkcrc is a programm to compare crc32 checksum. Files coming from irc
bots will often be named like "somename_[DEADBEEF].avi", where DEADBEEF
is the crc32 checksum. checkcrc will try to find checksum strings in
filenames and will compare them to the files checksum.

checkcrc can also be used to create checksums of files by using the -c

I coded it because I wanted to use some C again and because I really needed a tool to check all those file I leeched from IRC ;). I tried a few things that were new to me, like using options and regex in C and using the GNU configure and build system.

It's fun to use but the GNU documentation sucks for someone who trys these tools for the first times. It's well documentated, but there are very few examples about how to use and there are not really examples about good practise in there. I mostly looked at other projects code and some tutorials to find out what I had to do.

Usage: checkcrc [-cvh] [file ...]
    -c  Only calculate checksums, don't try to find a checksum string to compare
    -v  Display version number
    -g  Display this help

    file can by any number of files you want to check.

For instructions how to compile and install checkcrc see INSTALL.

Download checkcrc-0.1.0.tar.gz