revalidation failed (errorno =-5)

July 20th, 2008

If you find your system isn’t booting sometimes and you get this funny error message, edit your kernel boot line in /boot/grub/menu.lst:


kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=75a92494-bdae-4715-92d9-f06d1887008e ro all_generic_ide

e.g - Add the all_generic_ide parameter. All should be fine once again. I believe this is a strange Ubuntu kernel bug, although I’m not sure.

MKV (h.264) playback on XBOX360

July 18th, 2008

While it’s not possible to play mkv files directly on the xbox360, you only need to do a few things to remux the video and audio streams into the mp4 format. This means that no re-encoding is done with the video, therefore there is no loss in video quality.

At the time of writing, the xbox360 doesn’t support anything other than 2 channel AAC audio for mp4 streams, so you’ll have to put up with that. It does work well though.

1. Gather video information
mkvinfo movie.mkv
Look for things like the following:

|+ Segment tracks
| + A track
| + Track number: 1
| + Track UID: 1
| + Track type: video
- snip -
| + Default duration: 41.708ms (23.976 fps for a video track)

This shows us track 1 is the video stream. Remember that, it’ll come in handy later. Also, make a note of the fps, if you get the FPS wrong later you’ll have a/v sync issues. Generally track 1 is always the video stream and track 2 is always the main audio stream:


| + A track
| + Track number: 2
| + Track UID: 445320639
| + Track type: audio
- snip -
| + Name: Main audio DTS 1536
| + Audio track
| + Sampling frequency: 48000.000000
| + Channels: 6

Make a note of whether you’re dealing with a DTS stream (as in my example) or an AC3 stream. There is a newer format ACC3 or something..I don’t know much about that.

2. Extract the video and audio streams from the mkv
Remember, mkv and mp4 are just like avi (in some ways.) They are all container formats, not the actual video itself. Now we extract the audio and video streams we want. If you like you could choose different audio and video streams you discovered using mkvinfo.

Extract the video:

mkvextract tracks movie.mkv 1:video.h264

Next we have to do something quite strange in order to make our h.264 file compatible with the xbox360. Run hexedit video.h264 and change the sequence: “67 64 00 33″ to “67 64 00 29″.

Now we have our video file ready for muxing, we need to deal with the audio stream:

mplayer movie.mkv -novideo -ao pcm:fast:file=audiodump.wav -channels 2

This gets the audio from the mkv file and saves it as audiodump.wav ready for re encoding using nero’s AACenc program (http://www.nero.com/eng/down-ndaudio.php):

3. Encode the audio dump to AAC format
Now we encode the wav file to AAC:

neroAacEnc -lc -ignorelength -q 0.50 -if audiodump.wav -of audio.m4a

Both the audio and video streams are now ready to be muxed (put together) by MP4Box:

4. Mux the files

Remember to use the correct FPS value we obtained using mkvinfo from earlier!

MP4Box -new output.mp4 -add video.h264 -add audio.m4a -fps 23.976

output.mp4 is now ready to watch!!

Footnotes:
1. I didn’t have any luck getting windows media player 11 to stream the mp4’s to my xbox, I got the all to common ‘format not supported’ thing on the xbox even though they played just fine on WMP11.

2. You’ll want to split your original MKV into just under 4GB chunks if you’re putting the files on anything other than DVD5/DVD9. Do this:
mkvmerge -o output_part.mkv --split 3900M movie.mkv

*note - we leave it just under 4000M for two reasons, firstly fat32 can’t store eactly 4GB, secondly I’m not sure if it’s GiB or GB…!

3. Special thanks to Mike from Linux Love. For some tips that actually worked!

4. I’m not sure if there’s an artificial limit on the file size of mp4s that can be played back, but I will know by this afternoon!

Update:
It appears as though the xbox360 doesn’t like any media files > 4GB, a bit of a shame really. Hopefully the next dashboard update will fix these issues. Until then, looks like we’ll have to put up with split files.

Banshee 1.0

June 16th, 2008

Once in a while, a fantastic piece of open source software comes along. Just the other day, banshee 1.0 was released. I must say, I’m *very* impressed. It’s like a much better, really great iTunes. With the addition of video it now covers pretty much everything I wanted in a media player thingi for Linux.

Check it out: Banshee 1.0!

Ubuntu UK Podcast

March 27th, 2008

The Ubuntu UK Podcast show was recently established, someone I met from HantsLUG hosts it and it’s pretty interesting for those of you who are Ubuntu users. Check it out!

Ubuntu UK Podcast

PHP-Clearsilver installation guide for Ubuntu/Debian

March 27th, 2008

I updated my php-clearsilver installation guide today after discovering it’s wrong in a few places. Fortunately, I don’t think anyone’s ever used it (apart from me today.)

If you know what clearsilver is and you use php, you might find it interesting.

Installing PHP Clearsilver module for apache on Ubuntu and Debian

Creating a bridge for VirtualBox / wireless bridging on Ubuntu

March 17th, 2008

Following several guides on setting up a bridge on my laptop between the wireless network interface and VirtualBox for direct networking was simply not working for me. Today after lots of head scratching I finally discovered why.

Turns out that the standard bridge utils are no good for most wireless cards, but there is a workaround.

Check out this guide, and read under the wireless section:
Bridged Networking with VirtualBox on Linux Hosts

What you can do is add those various commands to a little script file in /etc/network/if-up.d/ which will set up the ‘bridge’ upon starting networking.

Woohoo!

Ripping copy protected DVDs on linux (ripguard, puppetlock, arccos etc)

March 5th, 2008

Unfortunately, you can’t!!! Well, not as far as I can tell, I’ve asked around and scoured the web but it seems there’s no use, there simply isn’t a way to do it on linux. The next best thing is to use DVDFab for windows via Wine (it kind of semi-officially works with Wine).

As I found nothing really solid on google, I thought I’d write this post as it’s annoying when you can’t find anything.

DVDFab

How infuriating! What a great way to encourage people to illegally download things instead of buying them. I wonder when (or if) these movie studios will ever learn that it’s a really dumb idea to stop people having total control over things they buy.

Convert a bunch of pngs to gifs with imagemagick

February 28th, 2008

Just a handy one for the IE6 png support:
for i in `ls`; do x=`basename $i .png`; convert $i $x.gif; done

Fluid horizontal list based highlighting menu with icons

February 28th, 2008

No doubt it’s been done elsewhere, but I spent quite a while trying to get this one working. Basically I wanted a horizontal css menu with decent markup and no hacks. I also wanted to have nice icons for each item correctly vertically aligned. On top of that I wanted the whole thing to be fluid so it would look right at any text size. Unfortunately because of IE6’s lack of support for :hover on anything but links I needed to use containing spans for the text on each list item (doh!) I guess you could use javascript or something instead, but that’d be really horrid!

After a lot of hair pulling, I finally got it to work:
Menu

#navigation ul {
  margin:               0;
  padding:              0;
  background-color:     #eee;
  height:               2em;
  border-bottom:        1px solid #888;
}

#navigation li {
  float:                left;
  list-style-type:      none;
  border-right:         1px solid #888;
}

#navigation a {
  float:                left;
  margin:               0;
  background-repeat:    no-repeat;
  background-position:  5px 50%;
  text-decoration:      none;
  color:                #333;
}

#navigation .inner {
  padding:              0 .4em 0 26px;  /* Adjust based on the width of icon + 10px */
  display:              inline;
  line-height:          2em;
  vertical-align:       middle;
}

#navigation .contacts {
  background-image: url(/crm/resources/icons/contacts.png)
}

#navigation .activities {
  background-image: url(/crm/resources/icons/activities.png)
}

#navigation .reports {
  background-image: url(/crm/resources/icons/reports.png)
}

#navigation .utilities {
  background-image: url(/crm/resources/icons/utilities.png)
}

#navigation a:hover {
  background-color:         #fff;
}

And here’s the HTML:

<div id="navigation">
<ul>
  <li><a href="" class="contacts"><span class="inner">Contacts</span></a></li>
<li><a href="" class="activities"><span class="inner">Activities</span></a></li>
<li><a href="" class="reports"><span class="inner">Reports</span></a></li>
<li><a href="" class="utilities"><span class="inner">Utilities</span></a></li></ul>
</div>

*I got my icons from the fantastic FamFamFam web site. This guy gives away loads of great icons for free. You might want to convert them to transparent gifs though as obviously IE6- won’t handle the transparency in the PNGs.

I’m no css expert, so if you can see anything silly in the css/markup or know of some way of improving this, please drop me a comment!

Cron gotcha

February 14th, 2008

While pondering why my backup scripts weren’t working in /etc/cron.daily, I remembered that run-parts (the thing that runs stuff in that directory) doesn’t like running scripts with a .sh, or indeed probably any extension on them.

Handy to remember that one!