# Can Mopidy play BBC Radio HLS streams?

**URL:** <https://discourse.mopidy.com/t/can-mopidy-play-bbc-radio-hls-streams/5993>\
**Category:** Help and support\
**Created:** [August 28, 2024, 9:14pm UTC](https://discourse.mopidy.com/t/can-mopidy-play-bbc-radio-hls-streams/5993 "2024-08-28T21:14:24Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisisbd](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/chrisisbd/32/2338_2.png) [@chrisisbd](https://discourse.mopidy.com/u/chrisisbd)\
**Post date:** [August 28, 2024, 9:14pm UTC](https://discourse.mopidy.com/t/can-mopidy-play-bbc-radio-hls-streams/5993/1 "2024-08-28T21:14:24Z")

</div>

I am running Mopidy 3.4.1 on a Raspberry Pi 4, it’s working fine playing local media files.

Now I am wondering if it can play BBC Radio stream. I have a playlist of BBC Radio streams  
from [https://garfnet.org.uk/download/radio/20231029-bbc-radio-with-rewind.m3u](https://garfnet.org.uk/download/radio/20231029-bbc-radio-with-rewind.m3u) and I have copied it to /var/lib/mopidy/m3u. The list of radio stations appears as a playlist in mopidy clients but I don’t seem to be able to actually play the streams.

I have also tried putting a single item from the playlist into /var/lib/mopidy/http, the line is:-

‘’’  
[http://as-hls-ww-live.akamaized.net/pool\_904/live/ww/bbc\_radio\_fourfm/bbc\_radio\_fourfm.isml/bbc\_radio\_fourfm-audio%3D96000.norewind.m3u8](http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_fourfm/bbc_radio_fourfm.isml/bbc_radio_fourfm-audio%3d96000.norewind.m3u8)  
‘’’

This doesn’t work either.

Do these streams (HLS I think) not work in Mopidy or do I need some more configuration?

---

<div class="post-metadata">

**Author:** ![Matthias\_Meulien](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/matthias_meulien/32/2260_2.png) [@Matthias\_Meulien](https://discourse.mopidy.com/u/Matthias_Meulien)\
**Post date:** [August 29, 2024, 6:24am UTC](https://discourse.mopidy.com/t/can-mopidy-play-bbc-radio-hls-streams/5993/2 "2024-08-29T06:24:01Z")

</div>

Is the extension Mopidy-Stream enabled?

> [@chrisisbd](#):
>
> I have also tried putting a single item from the playlist into /var/lib/mopidy/http

Why are you doing that? Did you tried to play the stream using your Mopidy client? What happened? Did you look at the logs?

> [@chrisisbd](#):
>
> Do these streams (HLS I think) not work in Mopidy or do I need some more configuration?

It depends of what GStreamer plugins are installed, not of Mopidy.

---

<div class="post-metadata">

**Author:** ![chrisisbd](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/chrisisbd/32/2338_2.png) [@chrisisbd](https://discourse.mopidy.com/u/chrisisbd)\
**Post date:** [August 29, 2024, 9:35am UTC](https://discourse.mopidy.com/t/can-mopidy-play-bbc-radio-hls-streams/5993/3 "2024-08-29T09:35:28Z")

</div>

> Matthias\_Meulien [1]Matthias\_Meulien  
> August 29
> 
> Is the extension Mopidy-Stream enabled?

Yes (extract from ‘mopidyctl config’) :-

```
[stream]
enabled = true
protocols = 
  http
  https
  mms
  rtmp
  rtmps
  rtsp
metadata_blacklist = 
timeout = 5000

```

> ```
> chrisisbd:
> 
> I have also tried putting a single item from the playlist into
> /var/lib/mopidy/http
> 
> ```
> 
> Why are you doing that? Did you tried to play the stream using your  
> Mopidy client? What happened? Did you look at the logs?

Well, I actually want to play the single stream most of the time  
(Radio 4), rather than having to select it from the play list.

Basically nothing happens at all when I try to play the stream with my  
client but I find most multimedia programs so counter-intuitive that  
I’m not convinced I’m actually asking it to do the right thing.

Which logs should I be looking at? There’s no errors from Mopidy that  
I can see in syslog.

> ```
> chrisisbd:
> 
> Do these streams (HLS I think) not work in Mopidy or do I need some
> more configuration?
> 
> ```
> 
> It depends of what GStreamer plugins are installed, not of Mopidy.

So how can I tell whether the right GStreamer are there? It would  
_seem_ as if they’re there :-

```
root@homepi:/var/log# gst-inspect-1.0 | grep -i HLS
adaptivedemux2: hlsdemux2: HLS Demuxer
typefindfunctions: application/x-hls: m3u8

```

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [August 29, 2024, 3:48pm UTC](https://discourse.mopidy.com/t/can-mopidy-play-bbc-radio-hls-streams/5993/4 "2024-08-29T15:48:12Z")

</div>

I’m sorry to report that HLS streams in Mopidy are broken. They’ve been that way for a long time as a consequence of how we handle playlists. It’s been great if someone could fix it.

---

<div class="post-metadata">

**Author:** ![chrisisbd](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/chrisisbd/32/2338_2.png) [@chrisisbd](https://discourse.mopidy.com/u/chrisisbd)\
**Post date:** [August 29, 2024, 9:11pm UTC](https://discourse.mopidy.com/t/can-mopidy-play-bbc-radio-hls-streams/5993/5 "2024-08-29T21:11:20Z")

</div>

Ah, thank you, at least that means I don’t need to waste any more  
time trying to fix my installation.

---

<div class="post-metadata">

**Author:** ![Matthias\_Meulien](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/matthias_meulien/32/2260_2.png) [@Matthias\_Meulien](https://discourse.mopidy.com/u/Matthias_Meulien)\
**Post date:** [August 30, 2024, 8:12am UTC](https://discourse.mopidy.com/t/can-mopidy-play-bbc-radio-hls-streams/5993/6 "2024-08-30T08:12:27Z")

</div>

For completness a related issue I guess [Make sure HLS playback works. · Issue #1149 · mopidy/mopidy · GitHub](https://github.com/mopidy/mopidy/issues/1149).

---

<div class="post-metadata">

**Author:** ![Matthias\_Meulien](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/matthias_meulien/32/2260_2.png) [@Matthias\_Meulien](https://discourse.mopidy.com/u/Matthias_Meulien)\
**Post date:** [September 1, 2024, 11:53am UTC](https://discourse.mopidy.com/t/can-mopidy-play-bbc-radio-hls-streams/5993/7 "2024-09-01T11:53:53Z")

</div>

Well, I picked a random URL (`http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_three/bbc_radio_three.isml/bbc_radio_three-audio=320000.m3u8` precisely) in the `.m3u` URL you sent and I’ve added the random URL to my Mopidy client (Argos, using “add stream to tracklist…” in main menu) and… it works.

Done the same with many other URL from the `.m3u` file; Some play a standard message saying that the program is not available right now, others just play music, programs, etc. `ffprobe` reports that all those streams are HLS streams.

So, it’s not clear to me what is not working… Remote playlists? HLS streams are working on my side.

```sh
matthias@argos:~ $ gst-inspect-1.0 | grep hls
adaptivedemux2: hlsdemux2: HLS Demuxer
hls: hlsdemux: HLS Demuxer
hls: hlssink: HTTP Live Streaming sink
hls: hlssink2: HTTP Live Streaming sink
libav: avmux_hls: libav Apple HTTP Live Streaming muxer
typefindfunctions: application/x-hls: m3u8
matthias@argos:~ $ sudo mopidyctl deps
Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf deps" as user mopidy
Executable: /usr/bin/mopidy
Platform: Linux-6.6.31+rpt-rpi-v7-armv7l-with-glibc2.36
Python: CPython 3.11.2 from /usr/lib/python3.11
Mopidy: 3.4.2 from /usr/local/lib/python3.11/dist-packages
  Pykka: 4.0.2 from /usr/local/lib/python3.11/dist-packages
  requests: 2.31.0 from /usr/local/lib/python3.11/dist-packages
    charset-normalizer: 3.3.2 from /usr/local/lib/python3.11/dist-packages
    idna: 3.7 from /usr/local/lib/python3.11/dist-packages
    urllib3: 2.2.1 from /usr/local/lib/python3.11/dist-packages
    certifi: 2024.2.2 from /usr/local/lib/python3.11/dist-packages
  setuptools: 69.5.1 from /usr/local/lib/python3.11/dist-packages
  tornado: 6.4 from /usr/local/lib/python3.11/dist-packages
Mopidy-InternetArchive: 3.0.1 from /usr/local/lib/python3.11/dist-packages
  Mopidy: 3.4.2 from /usr/local/lib/python3.11/dist-packages
  Pykka: 4.0.2 from /usr/local/lib/python3.11/dist-packages
  cachetools: 5.2.0 from /usr/lib/python3/dist-packages
  requests: 2.31.0 from /usr/local/lib/python3.11/dist-packages
    charset-normalizer: 3.3.2 from /usr/local/lib/python3.11/dist-packages
    idna: 3.7 from /usr/local/lib/python3.11/dist-packages
    urllib3: 2.2.1 from /usr/local/lib/python3.11/dist-packages
    certifi: 2024.2.2 from /usr/local/lib/python3.11/dist-packages
  setuptools: 69.5.1 from /usr/local/lib/python3.11/dist-packages
  uritools: 4.0.0 from /usr/lib/python3/dist-packages
Mopidy-Podcast: 3.0.1 from /usr/lib/python3/dist-packages
Mopidy-Local: 3.2.1 from /usr/lib/python3/dist-packages
Mopidy-Iris: 3.69.3 from /usr/local/lib/python3.11/dist-packages
  Mopidy: 3.4.2 from /usr/local/lib/python3.11/dist-packages
  Pykka: 4.0.2 from /usr/local/lib/python3.11/dist-packages
  setuptools: 69.5.1 from /usr/local/lib/python3.11/dist-packages
Mopidy-SomaFM: 2.0.2 from /usr/local/lib/python3.11/dist-packages
  Mopidy: 3.4.2 from /usr/local/lib/python3.11/dist-packages
  Pykka: 4.0.2 from /usr/local/lib/python3.11/dist-packages
  requests: 2.31.0 from /usr/local/lib/python3.11/dist-packages
    charset-normalizer: 3.3.2 from /usr/local/lib/python3.11/dist-packages
    idna: 3.7 from /usr/local/lib/python3.11/dist-packages
    urllib3: 2.2.1 from /usr/local/lib/python3.11/dist-packages
    certifi: 2024.2.2 from /usr/local/lib/python3.11/dist-packages
  setuptools: 69.5.1 from /usr/local/lib/python3.11/dist-packages
Mopidy-Bandcamp: 1.1.5 from /usr/local/lib/python3.11/dist-packages
  setuptools: 69.5.1 from /usr/local/lib/python3.11/dist-packages
  Mopidy: 3.4.2 from /usr/local/lib/python3.11/dist-packages
  Pykka: 4.0.2 from /usr/local/lib/python3.11/dist-packages
Mopidy-Listenbrainz: 0.2.1 from /usr/local/lib/python3.11/dist-packages
  Mopidy: 3.4.2 from /usr/local/lib/python3.11/dist-packages
  Pykka: 4.0.2 from /usr/local/lib/python3.11/dist-packages
  setuptools: 69.5.1 from /usr/local/lib/python3.11/dist-packages
GStreamer: 1.22.0.0 from /usr/lib/python3/dist-packages/gi
  Detailed information: 
    Python wrapper: python-gi 3.42.2
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        alsasink
        osssink
        oss4sink
        pulsesink
        id3demux
        id3v2mux
        lamemp3enc
        mpegaudioparse
        mpg123audiodec
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacdec
        flacparse
        shout2send
      Not found:
        flump3dec
        mad

```

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [September 1, 2024, 12:39pm UTC](https://discourse.mopidy.com/t/can-mopidy-play-bbc-radio-hls-streams/5993/8 "2024-09-01T12:39:52Z")

</div>

How long did it work for?

---

<div class="post-metadata">

**Author:** ![Matthias\_Meulien](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/matthias_meulien/32/2260_2.png) [@Matthias\_Meulien](https://discourse.mopidy.com/u/Matthias_Meulien)\
**Post date:** [September 1, 2024, 3:18pm UTC](https://discourse.mopidy.com/t/can-mopidy-play-bbc-radio-hls-streams/5993/9 "2024-09-01T15:18:37Z")

</div>

> How long did it work for?

I’d say it stopped after \>30 minutes; But it didn’t crash (not sure if it’s what you have in mind), I stopped manually.

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [September 1, 2024, 7:47pm UTC](https://discourse.mopidy.com/t/can-mopidy-play-bbc-radio-hls-streams/5993/10 "2024-09-01T19:47:54Z")

</div>

HLS streams are split into chunks (segments), each lasting just a few seconds. The URIs for the chunks are provided in an m3u8 playlist file which is updated as new chunks are produced and old ones removed as they become obsolete. The main m3u8 playlist for the stream contains a segment list for different quality streams.

So you can load the initial playlist, take the first item in that list, get that segment list and start playing the first segment and then the next and so on, until you get to the end and we’ll stop. That’s what our normal playlist handling code does. But our code won’t re-load the segment playlist when it updates with new chunks, so we’ll stop prematurely. We need something to realise these HLS streams should be handled differently.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/system/32/1_2.png) [@system](https://discourse.mopidy.com/u/system)\
**Post date:** [March 3, 2025, 7:48am UTC](https://discourse.mopidy.com/t/can-mopidy-play-bbc-radio-hls-streams/5993/11 "2025-03-03T07:48:17Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
