Howto convert MPC, Flac and Ogg to mp3 on Linux with free tools

January 30, 2011

In my MP3 library’s past I had experimented with different file formats. I have recordings of vinyl or radio in FLAC (Free Lossless Audio Codec), MPC (Musepack), Ogg (Ogg Vorbis) and other, extracted audio tracks from DVB-recordings on my PC. But since my car’s radio, my phone and my DVD player don’t support those formats (Nokias N900 did!), I chose to convert them to MP3. I made three little bash scripts, that probably only prove my limited coding capabilities… 🙂

Nevertheless, these little snippets are quite handy for me, and yes, I do know there are better solutions around, but that simply works for me. For security reasons, the source files are not deleted, but moved to a new subdirectory. The final “ls” creates a playlist in the working directory.

If you want to try that at home, you’ll need the programs:

– oggdec from the vorbis-tools package

– flac from the flac package

– mpcdec from the package musepack-tools

All of them are in standard Ubuntu repositories and can easily be installed via aptitude (at least here on Maverick (10.10).

a) FLAC, via stdout:

for file in *.flac
do flac -cd “$file” | lame -h – “${file%.flac}.mp3”;
mkdir flac.old
mv *.flac flac.old/
ls *3 > playlist.m3u

b) … and the same for MPC:

for file in *.mpc
do mpcdec “$file” – | lame -h – “${file%.mpc}.mp3”;
mkdir mpc.old
mv *.mpc mpc.old/
ls *3 > playlist.m3u

c) Ogg Vorbis:

Directing Oggdec to stdout wouldn’t work here, so I needed a temp.wav file for each conversion process:

for file in *.ogg
do oggdec -o temp.wav “$file”;
lame -h -V4 temp.wav “${file%.ogg}.mp3”;
rm temp.wav
mkdir ogg.old
mv *.ogg ogg.old/
ls *3 > playlist.m3u

Next thing will be extracting the audio track from 3GP files, like ancient mobile phones used to record. As far as i read up to now, Mplayer or its partner mencoder should be able to do that, e.g. for videos with

mencoder infile.3gp -oac pcm -ovc raw -o outfile.avi

I’ll keep you updated.


Creating your own Webradio “app” for the N900 on Maemo5

June 6, 2010

Just came across this “Apphere that enables your N900 to play the FM4 Webradio stream via a tiny little icon on the smartphone’s desktop. Like most apps, there is really not much magic involved.

I had a look into the Debian package used to install this austrian radiostation‘s App. If you have the extras-devel and/or -testing repositories enabled on your phone (either via Program Manager or by editing sources.list), then an apt-cache search webradio will give you this:

mfeilner@laptop:~$ ssh root@n900

root@n900’s password:

Nokia-N900:~# apts webradio

webradio-fm4 – Startup Webradio

webradio-radio-wien – Startup Webradio

webradio-superfly – Vienna’s Soulful Radiostation (Web Radio)


As you can see, I did’nt even have to worry about in which pocket or trouser I left the phone yesterday evening… Back home, it automatically connects to my WLAN, and via OpenSSH I can connect. I added bash and some aliases to the “~.bashrc“, just like I am used to on a PC. Apts is my alias for apt-cache search, and a simple apt-get install webradio-fm4 adds those files to the phone:

Nokia-N900:~# dpkg -L webradio-fm4

















Yes, the full set of dpkg and apt is available on this phone. Once you had a look into these files, adding another Webradio as an Icon to your Desktop – or as the Mac and Android people would call it – an “App“, is pretty straightforward: Just copy, rename and edit /usr/share/applications/hildon/webradio-fm4.desktop and adapt it to your needs:

Nokia-N900:~# cat /usr/share/applications/hildon/webradio-fm4.desktop

[Desktop Entry]





#Exec=sh /home/user/ fm4

Exec=/usr/bin/dbus-send –print-reply – /com/nokia/mediaplayer string:””





X-Osso-Type=application/x-executableNokia-N900:~# vi /usr/share/applications/hildon/webradio-fm4.desktop

You only need to change the URL of the webcast in the line “Exec” and probably you would want to change the name in “Name” and “Comment”. I added another Icon in /usr/share/icons/hicolor/48×48/hildon/ and pointed the line starting with “Icon” to that file. Opening, Copying and Editing the icon image (a 48×48 pixel sized PNG) works fine with Gimp, since the N900’s SSH-Server fully supports the FISH-Protocol integrated in Konqueror and Dolphin. The app now is available in the programm menu and as a widget for the desktop.

My next step will be finding out about recording music from services like shoutcast and or video recording from flash sources with the N900. The 32 GByte of internal memory must be filled somehow :-). By the way: there were already about 100 webradiostations preconfigured with my device, and Mplayer is available – so the recording shouldn’t be that difficult. And flash works fine, even webtv works – if you keep the resolution down. Hail to all the apple fans, and thank god there’s no need for I-tunes in this world – except for dummies.


Getting MMS, USSD Codes and HD movies to work on Nokias N900

February 27, 2010

This N900 from Nokia is really a great thing and full of stunning technology. Nevertheless it’s not fully functional for me, at least the way it comes to the customer. I just got back my test device from an external author, who flashed it back to vendor defaults. This gave me the chance to find out how things have changed with Maemo 5, the Ovi Store and the newer updates of Nokia’s Debian operating system.

What I am still missing is support for MMS, USSD Codes and some extensions for movies, even though there is obviously no better supporta around in a mobile phone than there is in the N900, except for portable DVD-Players. Just behold: Apple and Palm can’t do Flash, we are talking about HD and DivX here!

Ok, here’s my wishlist: I have O2’s multicard enabled, I want to send MMS to my beloved wife when I am on the road, and I want to watch my HD-TV recordings on my mobile phone and in Hotels via the TV-out of the N900

So here is what I did:

First thing was adding some repositories: The following is my “sources.list”, or to be precise, my “hildon-application-manager.list” in “/etc/apt/sources.list.d”:

Nokia-N900-02-8:/etc/apt/sources.list.d# cat hildon-application-manager.list
deb ./
deb ./
deb ./
deb fremantle free non-free
deb fremantle free non-free
deb fremantle free non-free

Take care, because the “testing” and  “devel” packages may break your system. If you need a working phone, leave out the last two lines and wait until the MMS function is built in by Nokia. If you prefer the hard way, by using the click and click touchscreen-app-manager, read this. Oh, for all of this I quickly installed SSH-Server, SSH-Client, Midnight Commander and Wget, all through “apt-get install” commands, , like on any other Debian PC.

Then I followed the instructions for the Unstructured Supplementary Service Data (USSD) Pad I found here (Thanks Pycage!) and I got a USSD Icon in the program manager. Now switching from one sim card to the other with *123# works, and with *125#  I can control which of my mobile phones shall receive SMS, MMS or calls. Obviously there’s more things that can be done with that:  Owners of prepaid sim cards can check their balance with *100#, a full list of codes is here and here. Both links are in German and for German providers. Your mileage may vary… 🙂

Next step: MMS. On the symbian60 website there is a nice howto that provides an easy way how to enable MMS on your N900. In brief, you need two apps and a little configuration work, including adding a new internet (WAP) access point. After that you have an extra app, not yet integrated with your conversations, but with your contacts. You can send and recieve MMS and choose contacts from your adressbook. Resizing an image from 5 megapixel size to 300-px-MMS-size may take quite a while on the N900’s ARM-600-Mhz-CPU, but it works. And it does nicely.

Don’t forget to go online with the new MMS profile before sending! Took me some time to figure that out… 🙂

Finally: Getting OGG and  Divx-encoded High-Resolution Movies to work on the N900. That’s even simpler, since there are a lot of Media Players out there, and there are codec-packages for your Debian-Maemo-combination available . However choosing the right movie may be difficult due to the restricted hardware. Don’t force your device to do scaling – that won’t work in most cases. If you want to make sure your N900 runs with clean and correct movie files, go to the Internet Archive and download some HD, Ogg, divx, H.264 movies or other files. These movies are freely available, a really great library. Download them to “/home/user/MyDocs/.videos/” on your mobile, and the media player will show them. Or – for the fans of animation, go and get the open source films “Elephants Dream” or “Big Buck Bunny“- all rendered with Blender. This screen shot shows my wget process on the N900 downloading Elephants dream to the mobile.

My N900 downloading elephantsdream via wget and SSH

But even though Kmplayer and others can play also 1920-HD-Videos, watching them won’t be fun – the hardware is too slow. Big buck bunny in 1080 Ogg vorbis plays, but is no fun either. From my experience you better make sure that your videos’ resolution is less than or equal to DVD (about 800×600 should work), and then you can have brilliant movies on the Beamer or TV via the built-in cinch connection.

One thing must be added: There are so nice shortcuts (more tipps and tricks here) on the N900: Have you tried portrait mode in the browser? Hit CTRL+Shift+P to activate it, then turn  your phone around. For screenshots on the N900, hit CTRL+Shift+P and go to “/home/user/MyDocs/.images/screenshots/”.

And if you want a wallpaper series on your desktop – like putting a panorama photo from your  holiday  there? Just have a look at the “.desktop” files in “/home/user/MyDocs/.images/”, copy 4 images there and edit on of these files to suit your needs. Nice, isn’t it? I did this with vi on the N900. Works perfectly, I am sure that also Emacs can do that.