andrewrk / groovebasin

Music player server with a web-based user interface.
MIT License
1.9k stars 119 forks source link

Add stream relay support #239

Open pixelblend opened 10 years ago

pixelblend commented 10 years ago

Groovebasin currently supports playback of local files only. MPD supports playback of live streams over HTTP. For Groovebasin to work as a replacement for MPD, HTTP streaming should be implemented.

Groovebasin should go one step further and support HLS streams. There is support in libav for this, which I presume is how VLC supports playback. As libgroove uses the same library, I am optimistic that this could be implemented in the same way.

Some background to this request:

I'm currently working on a project to build radio prototypes, using open-source software and boards such as the Raspberry Pi. We're currently using MPD, with the same love/hate relationship you highlight in your blogpost. We would love to replace MPD with groovebasin but a lack of http streaming makes it a non-starter. The BBC streams all of its content over HLS, so finding a remotely controllable, light-weight player, that supported HLS would be a dream come true.

andrewrk commented 10 years ago

HTTP streaming should be implemented.

Groove Basin already has http streaming. Start the server and then look at http://localhost:16242/stream.mp3

There is one thing to think about with this implementation. Every time you seek, it sends a notice to the client which causes the client to flush its buffer and reconnect to the stream. Then the server sends a burst of data followed by a steady stream which is intended to let the client buffer up a few seconds of audio to start immediate playback.

However when you use an alternate client such as VLC and stream, it is not listening to the data channel which tells it to flush its buffer. So clients will get further and further behind every time you seek.

Does HLS streaming address this issue?

Groovebasin should go one step further and support HLS streams. There is support in libav for this, which I presume is how VLC supports playback

I believe that libav has support for HLS stream playback. Are you sure it has support for being a server? At any rate if HLS streaming were to be implemented it would be in Groove Basin since that is where the server code (and already existing streaming implementation) lives.

pixelblend commented 10 years ago

Well, trust me to give you the wrong end of the stick :)

I was talking about receiving http streams, i.e. not playing local files, but relaying a live audio stream. MPD supports Shoutcast, et al. and VLC can handle HLS playback too.

andrewrk commented 10 years ago

Can you help me understand the use case for this?

Why relay a stream? Why not have users simply connect directly to the real stream?

Do streams go in the library?

pixelblend commented 10 years ago

The use case is to play live radio stations through Groovebasin.

I'm working on a project that plays a mixture of live radio, on-demand content and offline media files and we'd like to use Groovebasin instead of MPD for managing playback.

andrewrk commented 10 years ago

Ah I think I understand. I can see Groove Basin fitting this use case in the future.

michaelshiloh commented 8 years ago

I think I have another reason for requesting this feature: I have an old laptop running Groovebasin connected to my nice speakers. It's in an inconvenient location out of the way, since it never needs to move. My current laptop is always moving, depending on where I'm working. I can stream the BBC locally, but then it's not coming out of the nice speakers. If I want to listen to the BBC on the nice speakers, I have to do that on the inconvenient laptop. If Groovebasin had this feature, I'd get the best of both worlds. Is this something useful to others?

eirinnm commented 7 years ago

Hi guys, just asking for an update on this. Can groovebasin be used to play an internet radio stream? I'm not interested in playback of local files.