Amarok/Archives/Convert current track to MPEG4


As an user of the cell phone SonyEricsson K750i, I really like listening to music while I can't use Amarok. To save a few megabytes on my memory stick, I created a shell script which converts the current song automatically to MPEG4-AAC.


You need the MP3-encoder lame to convert your MP3s to wave files, the [faac encoder with MPEG4 support and, of course, Amarok.

Was true. Now you need only ffmpeg [1].

The script

Save this file as and chmod +x it.

file=`dcop amarok player path`

if [ -f "$file" ]; then cp "$file" /tmp


if [ -f $INPUT ]; then
        chmod +w $INPUT
        ffmpeg -i "/tmp/$filename" $OUTPUT
        mv $OUTPUT $dirname/
        exit 0


  • due to a bug in faac, quality under 100 is not possible (faac crashes sometimes then); this valid for previous version -- the current one doesn't use faac, but ffmpeg and it does not set any parameters.
  • meta tags aren't included in the converted file; again -- valid for previous version, now they are included, because conversion is direct.


Just type in "./". Then your currently playing file will be converted and put into the same directory as the original file, but with the extension .m4a.

This page was last edited on 14 December 2012, at 11:00. Content is available under Creative Commons License SA 4.0 unless otherwise noted.