Jul 312007

For a while now I’ve been giving all my digital photos filenames that are meaningful to browse, useful to organise and easy (automated) to implement. The date is used to facilitate easy sorting, a few keywords are added to ease browsing, and the timestamp is added to ensure uniqueness. Thus, I end up with filenames like 20070731_a_great_photo_1425-39.jpg. Continue reading »

Jul 032007

Less than a week after the release of Apple’s iphone in the US, an off-hand comment has finally made me excited about the future of mobile communication technology. OpenMoko is a Linux-based platform that is designed to enable you to “Free Your Phone”. In only a few months time, the first smartphone built for the OpenMoko software platform will be publicly available. Continue reading »

Jun 132007

A lot of people suggest turning the Caps Lock key into a Control key. The more I’ve thought about it, the more it does actually make sense. The Caps Lock key enjoys prime real estate on the keyboard, typically right next to the home row, while its function is only rarely (if ever) required. For many applications (such as my favourite editor Vim) the Control key is a regularly used and vital element of, well, control. Continue reading »

Jun 062007

I wanted to upload a sound track to my Sony Ericsson phone just so that I could use it in the video editor on the phone. It turned out that sounds must be in amr format, and that ffmpeg could convert from ogg.
ffmpeg -i 12-Danny\ Boy.ogg -ar 8000 -ab 12.8 -ac 1 dannyboy.amr

Jun 062007

Mplayer can play 3gp movies created on my Sony Ericsson phone, but does not play the audio. The audio can be extracted using ffmpeg.
ffmpeg -i input.3gp -acodec mp2 -ar 22050 -f wav output.mp2
Once the audio is extracted, it can be recombined with the video using mencoder.
mencoder -audiofile audio.mp2 -o output.mpg -oac copy -ovc lavc -lavcopts vcodec=msmpeg4v2 movie.3gp
The resulting mgp file can be easily played in mplayer.

Jun 062007

After downloading Elephant’s Dream, I found that my laptop was not quite capable of playing even the 1024 version. I discovered that mencoder can resize video.
mencoder elephants_dream_1024.avi -ovc lavc -lavcopts vcodec=mpeg4 -vop scale=768:432 -oac copy -o output.avi
It was necessary to manually work out the new dimensions (768×432) so that the aspect ratio remained fixed.

Jun 062007

I wanted to send an article from a Free Software Magazine issue to a friend. Extracting pages from a PDF turned out to be easy with pdftk.
pdftk FILE.pdf cat RANGE output OUTPUT_FILE.pdf
RANGE can be something like 26-34, or a collection of such excerpts (1-25 35-end).

Jun 062007

In order to demonstrate oscillations in the Earth’s magnetosphere, I wanted to turn a sequence of static images into an animation.

A given set of frame images can be combined to form an MPEG-4 movie using mencoder. In this case the source files were png images with resolution 320×240, and I wanted 24 frames per second.
mencoder mf://*.png -mf w=320:h=240:fps=24:type=png -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output.avi