MusicPlayerDaemon / MPD

Music Player Daemon
https://www.musicpd.org/
GNU General Public License v2.0
2.19k stars 350 forks source link

[(large) feature] TVHeadend HTSP support #92

Open rubdos opened 7 years ago

rubdos commented 7 years ago

I just asked this on IRC; I'll just post it here too.

About TVHeadend

TVHeadend is a TV streaming server and recorder for Linux, FreeBSD and Android supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, ISDB-T, IPTV, SAT>IP and HDHomeRun as input sources.

On top of those input sources, anything that's streamable (without DRM, usually) TV or radio can get into TVHeadend.

Tvheadend offers the HTTP (VLC, MPlayer), HTSP (Kodi, Movian) and SAT>IP streaming.

Multiple EPG sources are supported (over-the-air DVB and ATSC including OpenTV DVB extensions, XMLTV, PyXML).

TL;DR: TVHeadend streams radio, TV, from any source over the network.

What's currently possible with mpd and TVHeadend

I'm currently listening to "Radio 1" (Belgian national radio) using the .m3u playlist that TVHeadend generates (http[s]://[tvheadend]/playlist). This playlist contains a randomized session key, such that the player client does not have to authenticate with TVHeadend over HTTP AUTH.

An image as example (note that the first four songs are from a CD):

Example of the current setup in ncmpcpp

As you see, no channel name is available, nor the current programme name, although TVHeadend has this information. It is simply not transferred over this https stream.

Actual feature request

Note that I am willing to develop the feature myself; I just need confirmation that it would eventually be mainlined

TVHeadend has a proprietary protocol called htsp (home theatre system streaming protocol, afaik), which can be queried for channels, EPG information, and can be used to stream the actual audio.

I suggest to have mpd have a configuration item, e.g.,

tvheadend {
  host "localhost:9982"
  user "mpd"
  pass "pass_mpd"
}

so it connects/tries to connect on MPD startup, and queries for channels, which it makes available for playback.

Things to consider

rubdos commented 7 years ago

There is currently an implementation of htsp (afaik, the only current one, and the only one that's 100% likely to be up to date) here, in the kodi hts addon. It's GPLv2'd.

A while ago, I started implementing htsp myself in Rust (mostly as exercise, and to use it in a SalifishOS app), which is mostly working now.


I suppose you guys rather have me use libhts from kodi?