est
est

Reputation: 11855

python icecast/shoutcast stream proxy that add genre/song name/artist metadata?

I am listening to 3FM stream but unfortunately it does not provide music name/artist info in its aac/mp3/wma stream.

So I want to write a simple python proxy to add metadata to stream. The metadata is from a periodic crawler grabbing JSON from 3FM website.

Any idea where I can start?

Upvotes: 1

Views: 1326

Answers (2)

TBR
TBR

Reputation: 2880

There is a fairly straight forward approach to slipstreaming metadata (in case of legacy format streams):

  • Set up an Icecast server to relay the stream of your choice.
  • Run your python (or whatever) script to fetch the metadata and send updates to Icecast.
    • compare incoming metadata to current metadta
    • If changed, push data to Icecast using the metadata update feature

From the official documentation:

Metadata Update

This function provides the ability for either a source client or any external program to update the metadata information for a particular mountpoint.

Example:

/admin/metadata?mount=/stream&mode=updinfo&song=ACDC+Back+In+Black

Authentication is required, either with the mount specific source or general admin credentials.

The metadata for legacy streams is one text field. There are no separate fields for "Artist", "Title", etc. This is a limitation of this legacy stream type. Some players will split the field when they encounter a "-".

In case of a proper stream using Ogg encapsulation (so Vorbis or Opus) this is a bit more involved, as there many metadata fields are supported, including arbitrary data, even album art. To inject such things a source client is needed. Liquidsoap can probably do this easily. In the future (planned for 2.5) Icecast will support direct metadata updates of all fields for Ogg streams too.

PS: I know this is an old question, though I think it is well worth of having an answer for it on record for future reference.

Upvotes: 2

Tim
Tim

Reputation: 51

You can use: http://www.3fm.nl/data/dalet/dalet.xml for the meta information. How do you want to build the metadata in?

Upvotes: 5

Related Questions