DjAlms
DjAlms

Reputation: 25

Playing IceCast2 stream in html

So i can play the stream with Vlc media player .m3u.

.m3u: http://IP:8000/source

But i cant play it with a browser.

Can you help me?

And im now streaming to the server with obs, im recording a video on it

Upvotes: 0

Views: 1428

Answers (1)

TBR
TBR

Reputation: 2880

Yes you can play back many streams that are broadcast through Icecast. However you don't want to point your player at the m3u file, but directly at the stream URL instead.

There are:

  • "HTML5" players that use the the <audio> or <video> tags
  • JavaScript based abstractions on top of the aforementioned
  • JavaScript 'compiled' players that bring their own decoders and such for browsers that don't support things natively

For the Audio-element there are a few supported formats and I personally use Opus in Ogg.

For the Video-element there are a few supported formats and I personally use Opus + AV1 or Opus + VP9 inside WebM.

Please note that the "container" (WebM, Ogg, MP4, etc.) is relevant, not just the choice of the codec. Especially for web browsers as they tend to support a much smaller subset than dedicated media players.

In "the olden days" there were also Adobe Flash and Java-applet based players, but they really are irrelevant by now.

When it comes to formats, I'd recommend the Opus codec as it is supported by most browser engines nowadays. For some use cases MP3 might be valid and while proprietary is nowadays no longer patent encumbered. AAC might bring licensing requirements for encoders etc. along.

Upvotes: 2

Related Questions