Mounting flacs as mp3
December 18, 2009
I have all my music ripped as flac files, but I also have an iphone, which plays mp3s. mp3fs is a filesystem which supports mounting a tree full of flacs so that the files can be accessed as mp3s - transcoding on the fly.
The project website is at http://mp3fs.sourceforge.net/
Installing on Ubuntu 9.10
Download the release from http://sourceforge.net/projects/mp3fs/files/
sudo apt-get install build-essential ifuse fuse-utils libmp3lame-dev libflac-dev libfuse-dev libid3tag0-dev tar -xzvf mp3fs-0.13.tar.gz cd mp3fs-0.13 ./configure make sudo make install
Testing
In the following command, 256 is the bitrate of the produced mp3s.
mp3fs /share/music/flac,256 /share/music/mp3flac -o ro
fstab
To permanently mount the directory, put the following in fstab
mp3fs#/share/music/flac,256 /share/music/mp3flac fuse allow_other,ro 0 0
I had trouble with this - when I did it on my main machine, it prevented KDE from starting properly. When I did it on my server, it had trouble accessing the directory, and would just lock up. I elected not to use this, and just mount as required - it isn't often I want to copy mp3s anyway.
Installing on Debian Lenny
Things are more complicated on Debian, because lame isn't installed by default.
Install required dependencies, then build lame from source
apt-get install build-essential gvfs-fuse fuse-utils libflac-dev libfuse-dev libid3tag0-dev wget http://sourceforge.net/projects/lame/files/lame/3.98.2/lame-398-2.tar.gz/download tar xzvf lame-398-2.tar.gz cd lame-398-2 ./configure make make install
install mp3fs
tar -xzvf mp3fs-0.13.tar.gz cd mp3fs-0.13 ./configure make make install
Thanks
Inspired by a tutorial at http://www.sysadminsjourney.com/content/2008/12/11/convert-flac-mp3-fly-mp3fs