I need to help to 'convert' from HLS to UDP multicast

Hi All!
I have this command line:

gst-launch-1.0 souphttpsrc location=http://local_IP:8080/index.m3u8 ! hlsdemux ! mpegtsmux name=mux pcr-interval=20 ! udpsink host=234.5.5.5 port=1234 auto-multicast=true

I have this error:

Got context from element 'souphttpsrc0': gst.soup.session=context, session=(GstSoupSession)NULL;
Got context from element 'souphttpsrc2': gst.soup.session=context, session=(GstSoupSession)NULL;
ERROR: from element /GstPipeline:pipeline0/GstHLSDemux:hlsdemux0: Internal data stream error.
Additional debug info:
../gst-libs/gst/adaptivedemux/gstadaptivedemux.c(2708): _src_chain (): /GstPipeline:pipeline0/GstHLSDemux:hlsdemux0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

“not-negotiated” means there’s a problem with the media format (“caps” in GStreamer lingo).

mpegtsmux takes elementary streams as input (h264, mp3, aac, etc.) and muxes those into an MPEG-TS stream.

What hlsdemux outputs depends a bit on your playlist. If it’s a very simplistic HLS playlist it will just output an MPEG-TS stream, which you can stream out directly with udpsink, although you may have to chop it up into smaller chunks within the MTU that can be sent over UDP (7 TS packets of 188 are common).

For more complex playlists hlsdemux might also output additional pads with additional audio streams, in which case you’d need to demux the mpeg-ts into elementary streams, and the remux everything back into mpeg-ts with mpegtsmux (adding parsers before the muxer as well). This probably requires writing some code until you know the exact stream configuration and can hardcode it.