GridStream Streaminfo

A place to discuss tuning in, stream issues or questions about the website or forums.

Moderators: Station Managers, Station Techs

GridStream Streaminfo

Postby Gridfan » Sun Jul 11, 2021 5:15 pm

Streaminfo is a "standard" way of providing song info like title/artist/album/duration/artwork and more, along with the showname and location and any hints as to it being a live show or not.
The data is provided as JSON, and by this point I guess you can say the structure of the data is pretty much frozen. While new types of data might be added, no data will ever be removed (famous last words right?).
Two reasons for this, number one is that a standard must remain consistent to actually be a standard, and secondly it is now known to be used by others outside GSP (besides GridStream Webplayer, GridStream Player).

The longterm url for the streaminfo is player.gridstream.org/streaminfo/
but currently this just redirects to https://gsp.torontocast.stream/streaminfo/

Known projects making use of GridStream Streaminfo:
  • Nadybot Streaminfo us used by the bundled GSP module. More info about this bot in it's Wiki.
User avatar
Gridfan
Gridstream Developer
 
Posts: 5192
Joined: Wed Jul 31, 2002 11:39 pm
Location: Trondheim, Norway

Streaminfo Documentation

Postby Gridfan » Sun Jul 11, 2021 5:17 pm

There is no proper public documentation for Streaminfo (yet, though I guess this is it).

If there are any questions about this standard, feel free to post here and I'll make a FAQ or mini-documentation clarifying things that are not obvious.

All numbers should be assume assumed to be integers (rather than floats) unless otherwise stated. Likewise all strings should be considered to be UTF-8 unless otherwise stated.

  • "live" is 0 if it is a playlist, and 1 if live.
  • "deejay" is "Auto DJ" if not live and the name of the GSP DJ if live. Currently DJ's set this themselves.
  • "name" is the show/stream/event/program name. DJs set this themselves.
  • "info" is additional info, put into a separate field to reduce clutter. DJs set this themselves.
Sometimes DJs forget to set, change or remove info. And while the magic code that runs behind Streaminfo try to be clever about it, there is a chance it might be fooled into thinking there is a live DJ even if there is none.

  • "listeners" is experimental, there are multiple types of streams (MP3, HE-AAC, secure proxy, secure, non-secure), and I'm not certain if this info is properly reported or not.
  • "date" is the date of the Streaminfo data, a cache is used when serving this data to the webplayer/desktop player, the date (ISO 8601 format) can be used to check how stale the cache is. But generally you just need to remember the date string, and if it's later changed then the cache was most likely updated/refreshed.
  • "status" mostly a internal tracker, if 1 then at least 1 stream was detected to work, if 0 then no streams was detected as working. Again the code behind Streaminfo tries to be clever, but it relies on info from the streaming service and/or the stream servers. It should be considered semi-experimental.
  • "stream" is a array/list consisting of a "id", a "url" a "bitrate" and a "codec". The id is unique in the list and is used by the webplayer etc. to remember the user (listener) choice. This text is also shown in the webplayer and the dropdown list in the webplayer settings box. The url is self-explanatory I hope. The bitrate and codec is used by the webplayer etc. in case the stream is lost/interrupted, the player will try the next entry in the list with the same bitrate and same codec.
  • "history" is a array/list of the last 9 tracks played + the track being currently played. "date" is in the ISO8601 format, with Z(ulu) being UTC aka the old GMT.
  • "artist" and "title" is hopefully self-explanatory. There is also a
  • "album" but it is not shown in this example. If no album name is available then that field is not included to safe a few bytes of bandwidth. Artist name is also optional, there should in theory always be a song title but do not assume this. Always have some fallback code to handle empty or missing JSON fields/data. It's better to show "Missing artist" as the artist name instead of crashing.
  • "artwork" is a url to a image, which could be in the PNG or JPG file format, file size can vary a lot, and so can image resolution, as well as the url can vary a lot as well. The artwork can probably be cached for a while by players as they change rarely (though do can sometimes change). It's also possible for something to break as images can be provided by the DJ via the streaming server, via specialised internal metadata tools, via the auto dj software (using embedded artwork from the music files) or via a server software lookup tool, or even a secondary one (this can happen during live shows), so its' possible the artwork is wrong sometimes.
  • "duration" is the playtime of a track in milliseconds. This may be missing in live shows, but in the future that info may be carried through the various software, so a lack of duration can't be assumed to indicate if a DJ is live or not.

The JSON has been prettyfied using jsonformatter.curiousconcept.com
Code: Select all
{
   "live":0,
   "name":"",
   "info":"",
   "date":"2021-07-11T16:12:15Z",
   "status":1,
   "stream":[
      {
         "id":"MP3 256kbps (Secure Proxy)",
         "url":"https://daniel.torontocast.com/gspmp3",
         "bitrate":256000,
         "codec":"MP3"
      },
      {
         "id":"MP3 256kbps (Insecure Proxy)",
         "url":"http://daniel.torontocast.com/gspmp3",
         "bitrate":256000,
         "codec":"MP3"
      },
      {
         "id":"MP3 256kbps (Secure)",
         "url":"https://daniel.torontocast.com:1800/stream",
         "bitrate":256000,
         "codec":"MP3"
      },
      {
         "id":"HE-AAC 64kbps (Secure Proxy)",
         "url":"https://daniel.torontocast.com/gspaac",
         "bitrate":64000,
         "codec":"HE-AAC"
      },
      {
         "id":"HE-AAC 64kbps (Insecure Proxy)",
         "url":"http://daniel.torontocast.com/gspaac",
         "bitrate":64000,
         "codec":"HE-AAC"
      },
      {
         "id":"HE-AAC 64kbps (Secure)",
         "url":"https://daniel.torontocast.com:1780/stream",
         "bitrate":64000,
         "codec":"HE-AAC"
      }
   ],
   "history":[
      {
         "date":"2021-07-11T16:11:58Z",
         "artist":"Iron Maiden",
         "title":"Remember Tomorrow",
         "artwork":"https://daniel.torontocast.com:1730/media/tracks/trackImage1016_large.jpg",
         "duration":328307
      },
      {
         "date":"2021-07-11T16:08:21Z",
         "artist":"The Creepshow",
         "title":"Shake",
         "artwork":"https://daniel.torontocast.com:1730/media/tracks/trackImage1554_large.jpg",
         "duration":218410
      },
      {
         "date":"2021-07-11T16:06:31Z",
         "artist":"GSP PROMO",
         "title":"Marketing",
         "duration":110393,
         "artwork":"https://gsp.torontocast.stream/art/gsp_promo_490ac179dda67f8ae0782bb89d516d3c.png"
      },
      {
         "date":"2021-07-11T16:01:39Z",
         "artist":"KT Tunstall",
         "title":"Beauty of Uncertainty",
         "artwork":"https://daniel.torontocast.com:1730/media/tracks/trackImage1074_large.jpg",
         "duration":293721
      },
      {
         "date":"2021-07-11T16:00:11Z",
         "artist":"GSP PROMO",
         "title":"Kermie's Krazy Corner Goliath Teaser",
         "duration":88536,
         "artwork":"https://gsp.torontocast.stream/art/gsp_promo_490ac179dda67f8ae0782bb89d516d3c.png"
      },
      {
         "date":"2021-07-11T15:54:10Z",
         "artist":"Voodoo X",
         "title":"The Awakening",
         "artwork":"https://daniel.torontocast.com:1730/media/tracks/trackImage1474_large.jpg",
         "duration":362136
      },
      {
         "date":"2021-07-11T15:49:18Z",
         "artist":"Arven",
         "title":"My Darkest Dream",
         "artwork":"https://daniel.torontocast.com:1730/media/tracks/trackImage796_large.jpg",
         "duration":292780
      },
      {
         "date":"2021-07-11T15:46:01Z",
         "artist":"Mr. Mister",
         "title":"Broken Wings",
         "artwork":"https://daniel.torontocast.com:1730/media/tracks/trackImage1168_large.jpg",
         "duration":198557
      },
      {
         "date":"2021-07-11T15:44:07Z",
         "artist":"The Ventures",
         "title":"Hawaii Five-O",
         "artwork":"https://daniel.torontocast.com:1730/media/tracks/trackImage1434_large.jpg",
         "duration":114756
      },
      {
         "date":"2021-07-11T15:43:35Z",
         "artist":"GSP SWEEP",
         "title":"Big Boys (Duke Nukem)",
         "duration":32736,
         "artwork":"https://gsp.torontocast.stream/art/gsp_sweep_59b3ea041636313e693c4e26793d5f87.png"
      }
   ],
   "deejay":"Auto DJ",
   "listeners":6
}
User avatar
Gridfan
Gridstream Developer
 
Posts: 5192
Joined: Wed Jul 31, 2002 11:39 pm
Location: Trondheim, Norway


Return to Tech Support

Who is online

Users browsing this forum: No registered users and 1 guest