by moreentropy · 7y ago · 0 comments
The protocol is/was directly supported by about any MP3 player software since the end of the 90s, including display of metadata updated (song/show title). One problem with Icecast streams is that content is streamed through a long lasting HTTP request. If the TCP connection breaks there is no way to recover without interrupting playback. Some Antivirus software will think the stream is a downloadable file, so it will withhold data from the browser while trying to download the whole stream. Using HTTPS for Icecast helps to keep most AV software from MITMing the stream.
If you implement A/V streaming to the web today, you most probably would want to use chunked streaming with modern protocols like HLS or DASH. ffmpeg can do this. The encoder will save a live a/v source into small fragments (like 2 seconds) on a webserver that the browser can download, reassemble and play one after the other. If one chunk download fails (because of a network change on the client side), the browser might be able to retry downloading chunks.
Caching/distribution also works using standard HTTP accelerators with chunked streaming while you need to chain multiple Icecast servers if you want to scale Icecast.
Edit and shameless self plug: I wrote an Icecast exporter a few years ago to get nice streaming stats in Prometheus: https://github.com/markuslindenberg/icecast_exporter
IceCast is much faster than that at least - and not so problematic - typically the stream starts a bit before live data so you have a second or two in which you can reconnect and match up the current ending of the data.
EDIT: Both of these are abuses of HTTP though while they probably should be using a dedicated UDP-based streaming protocol which wouldn't suffer from any of these issues. WebRTC goes in the right direction by using RTP for this.
That's experience with one company owning a group of stations across the country. I don't know how other stations or groups work with it. These stations aren't typically critical data. Includes a couple of news stations, but a few seconds latency for a breaking story won't 'break' them.
I've seen solutions from Akamai that go down to a second or two even with this approach, so i think it's coming pretty close.
Edit: If you want really really low latencies (<100ms) you can use WebRTC for broadcast streaming to the browser. If the network has a hiccup it will instantly show in the stream though, so for robustness chunked HTTP streaming is a much better choice at the cost of a few seconds latency.