
Show HN: MStream – A personal music streaming server - mStreamTeam
https://github.com/IrosTheBeggar/mStream
======
stirner
I made a similar server a while ago, but it is more minimal and command-line-
oriented [1]. The only client so far is a fairly minimal browser client, but
it is functional. It supports any container/codec that libav supports, and
allows either MP3 or Ogg Opus as streaming formats. Songs are dynamically
transcoded to the streaming format when they are requested. This means you can
have a library of heterogeneous, potentially streaming-unfriendly formats, and
not have to worry about the streaming codec du jour or transcode your entire
library when you want to use a new codec.

I want to do more work on the server, but I've been busy working on an audio
format library in Rust to support the transcoding. Right now, the best option
is to either exec() the ffmpeg command line tool, which is easy but has
overhead and makes distribution more difficult, or use the libav* C libraries,
which are quite complex and in my experience poorly documented. I've decided
the best option is to make a cleaner, more minimal audio library that wraps
reference encoder/decoder libraries.

How does mStream handle transcoding, if at all?

[1]
[https://github.com/wwalexander/river](https://github.com/wwalexander/river)

~~~
mStreamTeam
mStream doesn't do any transcoding. Instead I've focused on support for all
common file formats. The webapp includes a fallback to Aurora JS if the the
browser doesn't support the filetype. Typically this is only needed for FLAC
but recently Firefox and Chrome have added FLAC streaming

~~~
stirner
Thanks for the info. The main reason I transcode the streams before
transmitting is for size, not compatibility. There are a lot of situations
where you really, really don't want to stream a 20 MB FLAC file. Lossy codecs
like Opus at 128-192 kbps or MP3 V3/V4 can achieve transparency at a much
smaller size, which is vital if you have a slower or metered connection.

~~~
mStreamTeam
That's a good use case. People typically ask me about trans coding as a why to
stream unsupported file codecs. When I have the time I'll take another look
into transcoding

------
voltagex_
What advantages does this have over Plex, mpd and Ampache?

~~~
mStreamTeam
It's easier to setup and manage than other music streaming servers. The latest
version of mStream Express doesn't have an dependencies. You can get your
server running in 30 seconds since nothing else has to be installed or
configured. It also works for Windows, which most servers don't support.

Here's a video of v0.1 of mStream Express being setup in under a minute:
[https://www.youtube.com/watch?v=IzuxYTaixpU](https://www.youtube.com/watch?v=IzuxYTaixpU)

~~~
mumphster
Can't you do something similar with plex? I don't remember doing much other
than using their installer. Good work though, although I don't listen to much
non-streaming (spotify) music lately.

~~~
kstenerud
Plex kind of works, but if their central server thinks it's offline for some
reason (which happens a LOT), you can't use it, even if you connect directly
to it over LAN.

~~~
mikewhy
Eh? I connect directly to the computers, either from LAN or WAN+port
forwarding, and only have an issue if my home connection is having issues.

~~~
kstenerud
Hmm weird. I'd be connecting directly to it, as in 192.168.1.10:32400/web and
all it would do is redirect to plex.com and then complain that the server is
offline. Refreshing a few times would sometimes fix it, but usually not.

~~~
0x6c6f6c
Even prior to setting up port forwarding I have never had this issue with Plex
:/

------
jepper
I'm using Koel:
[https://github.com/phanan/koel](https://github.com/phanan/koel)

Great alternative to ampache etc, very slick interface.

The hardest part is keeping music and especially playlists synced between
devices, something that can be solved with syncthing or similar software.
Playlists are very hard though with offline desktop clients (Musicbee)

~~~
mbrumlow
Hey, they both use the same image for their devices!

------
mrmondo
How well does it handle larger libraries? My collection is around 1.4TB and
I've found web apps that use a lot of js tend to lag up in the browser
etc....?

~~~
chirau
You have 1.4TB library? That is quite a huge library. How many songs? Are they
MP3s or uncompressed? Do you listen to all of it?

~~~
krick
Doesn't seem so huge to me. I have about the same size, mixed FLAC & mp3 (I
prefer FLAC, but it isn't always available), pretty much all of it I've
listened and it even lacks some considerable number of artists/albums I like.
This does not include podcasts & audiobooks, I have more of them and I did not
listen to all of them yet (I tend to delete audiobooks/podcasts I've listened
more often than music, as probability of repeated listening is usually lower).

~~~
khedoros1
> Doesn't seem so huge to me.

At 176K per second of uncompressed (CD-quality, anyhow) music, 1.4TB comes to
just over 100 days. Several times that figure, with compression. That's a lot
of music. More unique audio data than total amount that I've listened to on
repeat for...probably about the last 5 years added together.

~~~
0x6c6f6c
It really depends on how much variety you have. I had more than that in 2005,
discographies and high bitrate files but it amounted to roughly 1.5 TB. If
that HDD hadn't died around the time Spotify and similar streaming services
came out I'd like have a larger library today

~~~
khedoros1
Well, right, the amount of data depends on variety. In my opinion, having
enough audio to listen to something different all day, every day, for an
amount of time measured in years, is a large collection.

That's not saying that there aren't larger ones, that the collector would
consider themselves unusual, that any value judgement should be implied, etc.
Just that more than a couple months worth of unique audio data seems like "a
lot" to me.

------
HaoZeke
So, why isn't it compared to the venerable mpd?

------
burnbabyburn
I still prefer dlna! but yeah, clients around are the equivalent of xmpp in
terms of user experience, even if setting up a server is a 2min operation.

------
PudgePacket
Also [https://github.com/tchaik/tchaik](https://github.com/tchaik/tchaik).

------
neilsimp1
I have been using Audio Streamer
([https://audiostreamer.org/](https://audiostreamer.org/)) for this purpose
for a few years. It also works on Windows/Linux (and probably Mac, although
it's not listed).

This looks a bit snazzier, though. I may have to give it a try.

------
unhammer
What are the advantages over e.g. Subsonic? (
[http://www.subsonic.org/pages/index.jsp](http://www.subsonic.org/pages/index.jsp)
– there are some popular forks like
[http://beta.madsonic.org/pages/index.jsp](http://beta.madsonic.org/pages/index.jsp)
and [https://github.com/Mach5/supersonic](https://github.com/Mach5/supersonic)
)

------
kawsper
Does anyone know of any software to help keep libraries in sync across
devices?

I have an OSX install that syncs to my iPhone, and I have a Linux laptop and
want the collection on all 3 devices.

~~~
rglullis
Anything wrong with good ol' rsync?

~~~
kawsper
That is my current solution, but that only allows for one-way sync from the
OSX device to either iPhone or Linux, it could be cool if I could add songs
from my Linux device, or the devices could share playlists.

~~~
philsnow
There's Unison:
[https://www.cis.upenn.edu/~bcpierce/unison/](https://www.cis.upenn.edu/~bcpierce/unison/)

it's like bidirectional rsync.

------
gokulnathm
Just a thought - What if we create a radio hub (something like Shoutcast)
pointing to streaming servers like mstream hosted by indie artists and others.
Those who want their collection to be heard by the public can register at the
hub. User management, analytics etc can be handled at the hub.

------
drumttocs8
Open source Plex alternative? Pretty cool.

------
fomojola
Curious: how does this handle NAT (for example, being installed behind
multiple routers)? I have my home server connected to a Linksys router that
connects to the cable modem: if I installed it on that server how would I
connect to it from my phone when I'm not at home?

~~~
mStreamTeam
You'll have to setup port forwarding. This can be done by logging into your
router.

If you don't have access to your router, you can try mStream's auto port
forwarding feature. It will use uPNP to try to automatically configure port
forwarding

~~~
fomojola
Ah, I see. Would I also need a dynamic DNS entry (or a static IP address from
my ISP)?

~~~
tracker1
Just throwing this in, as I thought it was pretty cool.. If you use google
domains, you can update via dyndns request. I haven't tried it yet, but there
doesn't seem to be a charge, and would probably be easy enough to setup a cron
job.

------
jdpigeon
I'm assuming it could run on a raspberry pi?

Also, any plans to write plugins for Spotify or Google Play back end?

~~~
mStreamTeam
I'm looking into writing plugins for youtube, spotify, and maybe soundcloud.
I've found a bunch of open source projects that do it already so I may fork
one of those or see if the author is interested in collaborating.

And yes, it can run on a Raspberry Pi.

~~~
Nux
I think you could hook youtube-dl in to get youtube support (and more).

------
j_s
Lately I have used [https://github.com/thedmd/pianobar-windows-
binaries](https://github.com/thedmd/pianobar-windows-binaries) for Pandora.

------
Siecje
Does the music play out of the clients or the server?

Is this used to control/queue music on a media server or will it play out of
my phone?

~~~
mStreamTeam
The music plays from the clients.

The server hosts your files and has JSON based API to search through music.
The server comes with SQLite built in and a webapp to stream on any device
with a browser

------
ziikutv
When I visit the page from my iPhone it does not play the song.

------
yownie
what no edna love?
[https://github.com/res0nat0r/edna](https://github.com/res0nat0r/edna)

------
NeuroWinter
You an ex What.CD member?

------
voicedYoda
Runnable on a Drobo?

------
opticals
is Flac available?

