Urisourcebin fails to stream from Icecast server

I try to handle an OGG/Vorbis Icecast stream,
and the pipeline stops each time new track metadata arrives.
Tried:

GST_DEBUG=3 gst-launch-1.0 urisourcebin uri=http://127.0.0.1:8000/mpd.ogg ! oggdemux ! audio/x-vorbis ! vorbisdec ! fakesink

Got:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.037954522 15239 0x55b575655930 WARN               structure gststructure.c:2093:priv_gst_structure_append_to_gstring: No value transform to serialize field 'session' of type
'GstSoupSession'
Got context from element 'souphttpsrc0': gst.soup.session=context, session=(GstSoupSession)NULL;
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
Got EOS from element "pipeline0".
0:02:35.052176219 15239 0x7f2f04000b70 WARN                 basesrc gstbasesrc.c:3132:gst_base_src_loop:<souphttpsrc0> error: Internal data stream error.
Execution ended after 0:02:34.969183130
Setting pipeline to NULL ...
0:02:35.052383276 15239 0x7f2f04000b70 WARN                 basesrc gstbasesrc.c:3132:gst_base_src_loop:<souphttpsrc0> error: streaming stopped, reason not-linked (-1)
ERROR: from element /GstPipeline:pipeline0/GstURISourceBin:urisourcebin0/GstSoupHTTPSrc:souphttpsrc0: Internal data stream error.
Additional debug info:
../gstreamer-1.22.11/libs/gst/base/gstbasesrc.c(3132): gst_base_src_loop (): /GstPipeline:pipeline0/GstURISourceBin:urisourcebin0/GstSoupHTTPSrc:souphttpsrc0:
streaming stopped, reason not-linked (-1)
Freeing pipeline ...

What can it be?

Do you have a public feed that we could test to reproduce the issue ?

Yes, that same stream is publicly available at
https://radio.movepointfintech.ru/mpd.ogg

Edited your post so the URL is visible

This is probably related to something called “chained oggs”.

When the metadata changes, new ogg headers are sent and a new stream starts, basically.

This will make oggdemux re-create the source pads and remove the old source pads (theoretically the codecs or stream number/properties could have changed).

This is not something that can be handled within a gst-launch-1.0 pipeline though, it only connects the first audio pad to vorbisdec, and if that goes away and a new one pops up it’s not going to get connected.

You’ll have to write some code to handle this properly.

Alternatively, use some higher-level API that will handle this for you.

playbin3 uri=https://.... should hopefully work.

If you want to do something else with the decoded audio this might work for you:

gst-launch-1.0 -t uridecodebin3 uri=https://radio.movepointfintech.ru/mpd.ogg ! audioconvert ! fakeaudiosink

(uridecodebin3 is smart and will reuse the same decoder if possible, so the output pad won’t change if the format stays the same)

anek@tux ~/src/lina-tv $ gst-launch-1.0 -t uridecodebin3 uri=https://radio.movepointfintech.ru/mpd.ogg ! audioconvert ! fakeaudiosink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'souphttpsrc0': gst.soup.session=context, session=(GstSoupSession)NULL;
FOUND TAG      : found by element "sink".
          artist: fripSide
    album artist: fripSide
           title: MC⑦
           album: infinite synthesis 5
extended comment: TRACK=32
                : DISC=2
        datetime: 2019
           genre: J-Pop
         encoder: Xiph.Org libVorbis I 20200704 (Reducing Environment)
 encoder version: 0
     audio codec: Vorbis
 nominal bitrate: 140000
         bitrate: 140000
FOUND TAG      : found by element "sink".
container format: Ogg
FOUND TAG      : found by element "sink".
          artist: fripSide
    album artist: fripSide
           title: MC⑦
           album: infinite synthesis 5
extended comment: TRACK=32
                : DISC=2
        datetime: 2019
           genre: J-Pop
         encoder: Xiph.Org libVorbis I 20200704 (Reducing Environment)
 encoder version: 0
     audio codec: Vorbis
 nominal bitrate: 140000
         bitrate: 140000
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin3:uridecodebin3-0/GstURISourceBin:urisourcebin0/GstSoupHTTPSrc:souphttpsrc0: Internal data stream error.
Additional debug info:
../gstreamer-1.22.11/libs/gst/base/gstbasesrc.c(3132): gst_base_src_loop (): /GstPipeline:pipeline0/GstURIDecodeBin3:uridecodebin3-0/GstURISourceBin:urisourcebin0/GstSoupHTTPSrc:souphttpsrc0:
streaming stopped, reason not-linked (-1)
Execution ended after 0:00:14.637510878
Setting pipeline to NULL ...
Freeing pipeline ...

The same, stream stopped at track change

What GStreamer version is this with?

It’s possible that I didn’t test long enough of course, but also possible it got fixed recently. :slight_smile:

Plugin Details:
  Name                     soup
  Description              libsoup HTTP client src/sink
  Filename                 /usr/lib64/gstreamer-1.0/libgstsoup.so
  Version                  1.22.11
  License                  LGPL
  Source module            gst-plugins-good
  Documentation            https://gstreamer.freedesktop.org/documentation/soup/
  Source release date      2024-03-19
  Binary package           Gentoo GStreamer ebuild
  Origin URL               https://www.gentoo.org
[I] media-libs/gstreamer
     Available versions:  (1.0) 1.22.11^t
       {+caps +introspection nls test unwind ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  1.22.11(1.0)^t(08:28:59 AM 07/15/2024)(caps introspection nls -test -unwind ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
     Homepage:            https://gstreamer.freedesktop.org/
     Description:         Open source multimedia framework

Try the latest release (1.24.9). I was using 1.24.8

Thanks, it works :slight_smile: Accurately and smoothly

2 Likes