Wednesday, July 29, 2009

Cellphone pictures

I am not sure if it ever happened to you, the situation where you want to take the ultimate picture and your camera battery is empty. You then resort to using your cellphone, since all mobile phones these days have a camera built in. So this is what happened to me: on vacation I wanted to take some pictures only to find out my battery was empty (and of course I didn't have any spare ones for my digital camera). I decided to use my Nokia 3500c to make the pictures. At home, however, how can you transfer them to your computer? Since I don't have a memory card in the cellphone, the USB cable won't see the images (only PIM info). Then I decided to use bluetooth for transferring the pictures from the phone. The following blogpost describes the exact command line instructions to download the pictures from the phone.
Bluetooth transfer

Saturday, June 6, 2009

The C++ Lands


Just had to post this image that I found in a usenet group (comp.lang.c++). Courtesy to whoever made this picture!
Original URL

Monday, February 9, 2009

Converting avi to DVD format

In this blogpost I would like to explain how an existing avi file (in XVID or DIVX format) can be converted to DVD format, ready to be burned to disc. This for people who still have an old DVD player which cannot read DIVX and XVID movies.

First thing to do is to convert the XVID film into a format usable for DVD playback. The DVD standard typically uses MPEG-2 for video and AAC for audio. It is possible other formats are also supported, but I stuck to these formats.

The conversion to MPEG-2 can be done with ffmpeg an open source tool that is able to convert a lot of video files. The command line is as follows:

$>ffmpeg -i film.avi -target pal-dvd film.mpg

This will convert the file film.avi into film.mpg with the standard DVD format (resolution and framerate) for PAL televisions. For NTSC (USA) it is enough to change the 'pal' part into 'ntsc'.
After the file has been converted, it can be massaged to be put on a DVD disc. For this we need to create the directory structure that consists of the directories AUDIO_TS and VIDEO_TS. The directory AUDIO_TS is typically empty on a DVD, but the VIDEO_TS directory contains the files of type VOB and IFO that contain the video and audio in chunks of 1 GB. For creating this directory layout and the correct files, dvdauthor is a good tool. Dvdauthor requires an xml file that contains a description of the structure of the dvd layout. It is very powerful and allows for a lot of customization. In this example I keep it simple with one single file that has 4 chapters:

<dvdauthor dest="DVD">
 <vmgm />
  <titleset>
   <titles>
    <pgc>
     <vob file="film.mpg" chapters="0,15:00,30:00,45:00,1:00:00"/>
   </pgc>
  </titles>
 </titleset>
</dvdauthor>

Save this file as film.xml to the same directory as where film.mpg resides. With dvdauthor now the layout will be created as follows:

$>dvdauthor -x film.xml

This command will create a directory DVD with inside the directories AUDIO_TS and VIDEO_TS. The VIDEO_TS directory will contain the VOB files that contain the video and audio. This structure can then be burned to disc using tools like K3B.

PS: both tools can be installed in Ubuntu using:
$>sudo apt-get install ffmpeg dvdauthor

PS2: There are other tools with which you can accomplish the same job:

Sunday, January 18, 2009

Ubuntu's harddisk killing bug fixed

On slashdot it is mentioned that the famous harddisk killing bug for laptops has been finally fixed. This bug causes laptop harddisks to park and unpark the heads very frequently (as often as every 15 seconds) causing early wearing out of the harddisk. For months fixes have been floating around (do a google for Load_Cycle_Count Ubuntu) but until now it was never really fixed in the distribution. At the moment the fix is in testing for 8.04, 8.10 and 9.04 and should be in the repositories soon.