Stream Servers

Working on the Radio Stream Directory portal got me into the neccessity to do some research about the audio servers and their behaviour. The aim was not less than to compile the most comprehensive list of URLs that are compatible with the HTML5 player. The bad news: - There is no central directory. The two big platforms shoutcast.com (Shoutcast of course) and xiph.org (for Icecast servers) only offer a large but limited portion of stations in their yellow pages (yp) belonging to their standard. Shoutcast.com YP access requires a licence. - Many stream-URLs are not public because they want you to use their embedded players to increase traffic on their websites. Unfortunately many of these players do not work on any device - Server header responses are not standardized and often incorrect - You easily end up in a mess dealing with real streams, playlists/container formats (pls,m3u,m3u8,asx,asf,ra,ram...), redirects, IPs and text-based URLs - Even if you have the stream-URL geoblocking still persists - The stream lists (listen.pls,stream.m3u etc) provided by the servers often contain incorrect links - For WMA you still need an external player The good news: - Most streams are MP3, AAC or OGG. Firefox supports them all. - Flash is just a container with one of the playable formats inside (the same with other container formats and players) - you can easily find out the stream URL with developer tools in most browsers (F12 - network - media) - protocols other than http do not play a role (very few rtsp and mms left) If you have the stream URL you can use it - in the HTML5 audio player - as a link - or paste it into the address bar. A blank page with a HTML5 player will open automatically. Some remarkable things - Shoutcast does NOT use shoutcast servers for the roughly 30.000 streams they host themselves - the 1800 _SC-suffixed streams from IHeart are not Shoutcast either - the 'Notice2: Shoutcast Server...' in header-responses means nothing. It can be Icecast as well.

Domains

- many stream servers run on a specific IP and port like http://1.2.3.4:8000 - but be aware: servers can be configured by using host request-header: radio1.someurl.com:8000 can be different from radio2.someurl.com:8000 though DNS-servers will point to the same IP (not observed with Shoutcast servers yet)

Server types

Well, there is Shoutcast and Icecast in various versions and a few other servers.

Shoutcast

1.2.3.4:8000 response will be: - a html page (/index.html) if the user-agent in the request-header is a browser (Mozilla, Chrome, IE) - the stream if the user-agent in the request-header is a player ('WAFA' for Winamp) - the first stream can always be accessed with /; by the browser Shoutcast V2 servers can host more than one stream: - only index.html indicates which streams are active (no xml or similar available for non-admins) - /listen.pls?sid=[n] will produce a file (text format) with a list of URLs for stream [n] (starting with 1) - standard stream access URL: /stream/[n]/; - if any non-active sid is chosen, the pls will point to this URL anyway - streams can get an individual /streampath. Numbers still work anyway. - pls also contains the official stream name ("Title1"). Often the radio station's name. But this can be anything. - /stats?sid=[n] shows an xml with basic data for each stream Other playlist formats (listen.m3u,listen.asx) and song info can be accessed via the Public Pages API Shoutcast V1 (outdated) - does not support /stats, /listen.asx and multistream

Icecast

- 1.2.3.4:8000 response will stream the first resource - multiple streams with their own /streampath - /stream.m3u and /stream.xspf are often not configured
Questions? Corrections? Ideas? Comments? PeerAxel@aol.com main index
software development blog Disclaimer