[Icecast] Best method of grabbing Now Playing metadata with PHP?

Fred Gleason fredg at paravelsystems.com
Thu Sep 12 22:49:30 UTC 2019


On Thu, 2019-09-12 at 22:05 +0100, Richard G Elen wrote:
> Can someone do me the favour of pointing us at a routine, library, 
> script or technique that will grab Now Playing metadata (Title,
> Artist, 
> Album) remotely (ie from another machine) from an Icecast 2.4.x
> server 
> reliably for logging purposes, preferably using PHP?

You may want to take a look at GlassPlayer:

	https://github.com/RadioFreeAsia/GlassPlayer

While (as the name implies) it is primarily an audio stream player,
when invoked with the '--metadata-out --json' options, GlassPlayer will
emit a JSON-formatted update each time stream metadata changes. It
derives these updates from the audio bitstream itself --i.e. no polling
of or interaction with the IceCast administrative interface whatever is
required.

For example:

*** snip snip ***
[fredg at elastigirl ~]$ glassplayer --metadata-out --json 
http://streamer.example.com:8000/SomeMountpoint
{
    "Metadata": {
        "icy-url": "stream.example.com",
        "icy-name": "WXYZ",
        "icy-genre": "Various",
        "icy-description": "WXYZ Stream"
    }
}

{
    "Metadata": {
        "StreamTitle": "Do It Again - Steely Dan"
    }
}
*** snip snip ***

Cheers!


|---------------------------------------------------------------------|
| Frederick F. Gleason, Jr. |             Chief Developer             |
|                           |             Paravel Systems             |
|---------------------------------------------------------------------|
|  There is only one thing worse than having your competitors trying  |
|  to inter-operate with your systems - and that is to have your      |
|  competitors *not* trying to inter-operate with your systems.       |
|                                                                     |
|                                          -- Alan(UK), GrokLaw.net   |
|---------------------------------------------------------------------|




More information about the Icecast mailing list