
A transcoding FUSE filesystem for music - jm3
http://khenriks.github.io/mp3fs/
======
gizmo686
I'm hoping that this type of 'filesystem as a utility' becomes a common method
of chaining programs together, simmilar to the pipe.

On a related note, another FUSE filesystem I have used is ciopfs [1] which
makes a case insensitive filesystem from a given folder. Very useful for
running windows programs that are incidentally platform independent (as in
written in a language like Java) and break on case sensitive filesystems.

[1] [http://www.brain-dump.org/projects/ciopfs/](http://www.brain-
dump.org/projects/ciopfs/)

~~~
lelandbatey
Whoa, my mind is more than a little blown at this idea. Like Dropbox, but for
actions or operations. Just drop a file and now its being converted or
manipulated. I hope this becomes a reality!

~~~
bane
I've written a few data processing systems over the years and one of my
foundational principles is to eschew complex command line parameters and
instead just use the filesystem to infer things.

For example: building a comic book library? Where do I store the publisher,
title and issue metadata? Why not just infer it from the organization of the
file system?

D.C.Comics/Batman/The Batman #123.cbz Marvel/Avengers/Avengers - Ultimate
#12.cbz

I once built a text processing and conversion system that used a different
scheme.

You mount or copy your text files into a folder "source" and it picks up
whatever's in there processes it and dumps the converted result out to "sink".

Later I set it up to have some filters on the data. So "sink" turned into a
hierarchy of different pre-filtered results.

sink/Car_Makers sink/countries/France sink/countries/England sink/Truck_Makers

And in the end, only documents that fell into one of those classes appeared in
the relevant sink folder. At a glance you'd know if there was something
relevant to that class of documents or not just by running "ls" or "dir" on
it.

It cut hundreds of hours off of analyzing the results since you'd know a head
of time if it was likely you'd find something productive related to one of the
output classes.

This work with fuse is really exciting.

Imagine dumping in your text files wherever, fuse mounting it and then just
exploring the results in all kinds of useful ways. Maybe you write an "entity
extraction" filesystem.

So "Mobydick.txt"

Gets turned into

/mnt/mobydick/characters/ishmael/chapters/1
/mnt/mobydick/characters/ishmael/chapters/4
/mnt/mobydick/characters/ahab/chapters/4
/mnt/mobydick/characters/queequeg/chapters/3
/mnt/mobydick/characters/queequeg/chapters/4

/mnt/mobydick/chapters/4/characters/ishmael
/mnt/mobydick/chapters/4/characters/ahab
/mnt/mobydick/chapters/4/characters/queequeg

/mnt/mobydick/locations/Nantucket/chapters/1
/mnt/mobydick/locations/Nantucket/chapters/4
/mnt/mobydick/locations/Pequod/chapters/4

/mnt/mobydick/chapters/4/locations/Nantucket
/mnt/mobydick/chapters/4/locations/Pequod

/mnt/mobydick/chapters/1/text.txt /mnt/mobydick/chapters/2/text.txt
/mnt/mobydick/chapters/3/text.txt /mnt/mobydick/chapters/4/text.txt

And now you can use the fuse filesystem as an analytic tool

~~~
NoMoreNicksLeft
I'm using Plex for comics. I don't worry about where the metadata is stored.
There's an interface to enter it manually, and an API to write an agent script
that grabs the metadata for you.

Trying to shoehorn it all into the filesystem as directory names seems...
destined for disappointment.

~~~
bane
Out of curiosity, how are you using plex for comics? The photo gallery
feature? I keep asking the developers to add cbz and cbr support but it
doesn't seem to be coming.

~~~
NoMoreNicksLeft
Yeh, the photos. The developers are assholes, it's a closed source project...
but everything else is so bad it's tough to not go with it.

I've also figured out how to do audio streams (radio stations).

------
mitchellh
This reminds me of a very fun assignment we had in college: we had to
implement a FUSE filesystem to extract ID3 tags from MP3s. This was part of
our OS class to learn about the filesystem (while at the same time we were
diving into the Linux kernel).

I'd really recommend to anyone who wants to understand more about filesystems
to write your own FUSE filesystem. It isn't difficult (assuming you have a
basic understanding of C), they run in userspace so they can't mess things up
too badly, and it is really gratifying to drag/drop files into a folder and
have _magic_ happen.

~~~
pmiller2
Actually, you don't even have to know C; you can do it in Python. Here's an
example: [http://www.stavros.io/posts/python-fuse-
filesystem/](http://www.stavros.io/posts/python-fuse-filesystem/)

------
AceJohnny2
Huh, I had used MP3fs or something like it years ago. I see this project's
code dates back to 2006, so maybe this was it? Glad to see it lives on :)

~~~
dangravell
Yeah, mp3fs has been around a long time. It's really useful.

------
lobster_johnson
Very cool. I had this same idea (and of course secretly hoped I was the first
to have thought of it, but that's rarely the case) just the other day, as I
found myself having to re-encode a bunch of FLAC files purchased at
HDtracks.com to M4A, since Spotify for some absurd reason doesn't support
FLAC. It's straightforward enough with ffmpeg, but it's yet another annoying
step required before you can listen to the music.

------
holri
Alternative: This script synchronizes a music collection recursively one way
from a lossless format source directory to a lossy file format target
directory.

[https://bitbucket.org/ghorvath/music-collection-
sync](https://bitbucket.org/ghorvath/music-collection-sync)

------
michel-slm
Nice! I did this a few years ago as a class project but didn't take it as far
as this project is doing. Impressive.

------
dflock
Been using this for years - very useful and nice to see it being maintained
again.

------
spacemanmatt
A while back I saw a similar project that used Samba to transcode on the fly.

------
shmerl
Why specifically MP3? Something more up to date like Opus could be more
interesting.

~~~
dguaraglia
Probably because it's the most commonly supported format by portable players?

~~~
shmerl
Hard to say, for portable players I only use something that can run Rockbox
and it supports Opus just fine. But the general trend now is decline of their
usage altogether. With the rise of handsets and tablets portable players
became more exotic, like PDAs of the past. I barely see them being used
anywhere. And with general purpose mobile OSes and software media players,
supporting more codecs shouldn't be an issue.

When I get some music in lossless format like FLAC I encode it in Opus for
regular usage.

~~~
supercoder
I guess because it's better to use a format everyone has heard of rather than
one no one has heard of ?

~~~
shmerl
Not really. It's like proposing to use IE6 because people "have heard of it".

I wonder what people here like outdated patented codecs. It's like a lose lose
in all aspects.

