libVLC playlist support

This forum is about all development around libVLC.
doublemax
New Cone
New Cone
Posts: 5
Joined: 27 Aug 2015 00:55

libVLC playlist support

Postby doublemax » 29 Nov 2019 12:48

(Development under Windows, libVLC 3.0.7.1, it's about playing video and audio stream via a playlist URL)

I recently switched from libvlc 2.x to 3.x and noticed that it directly supports playlist URLs now. Which is nice.

E.g. i can call libvlc_media_new_location() with a URL to a playlist and it will play the stream.

But i noticed this only worls with video streams, not with pure audio streams.
Examples:
Video stream URL: http://mcdn.daserste.de/daserste/de/master.m3u8

Content:

Code: Select all

#EXTM3U #EXT-X-VERSION:3 #EXT-X-INDEPENDENT-SEGMENTS #EXT-X-STREAM-INF:BANDWIDTH=4237552,AVERAGE-BANDWIDTH=4118400,CODECS="avc1.640020,mp4a.40.2",RESOLUTION=1280x720,FRAME-RATE=50.000 master_3744.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=2314400,AVERAGE-BANDWIDTH=2156000,CODECS="avc1.4d401f,mp4a.40.2",RESOLUTION=960x540,FRAME-RATE=50.000 master_1960.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1477872,AVERAGE-BANDWIDTH=1302400,CODECS="avc1.4d401f,mp4a.40.2",RESOLUTION=640x360,FRAME-RATE=50.000 master_1184.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=677336,AVERAGE-BANDWIDTH=668800,CODECS="avc1.77.30,mp4a.40.2",RESOLUTION=512x288,FRAME-RATE=50.000 master_608.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=366168,AVERAGE-BANDWIDTH=352000,CODECS="avc1.66.30,mp4a.40.2",RESOLUTION=480x270,FRAME-RATE=50.000 master_320.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=219384,AVERAGE-BANDWIDTH=202400,CODECS="avc1.42c015,mp4a.40.5",RESOLUTION=320x180,FRAME-RATE=50.000 master_184.m3u8
This works fine.

Audio stream URL: http://www.wdr.de/wdrlive/media/einslive.m3u
Content:

Code: Select all

http://wdr-1live-live.icecast.wdr.de/wdr/1live/live/mp3/128/stream.mp3?ar-distributor=ffa1
This does not work.

The VLC player however plays both URLs fine.

Is there anything i can do about this? (Naturally i have no control over the content of the playlists)

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: libVLC playlist support

Postby mfkl » 09 Dec 2019 02:46

In C# you would do like this

Code: Select all

static async Task Main(string[] args) { Core.Initialize(); using var libVLC = new LibVLC(); using var media = new Media(libVLC, "http://www.wdr.de/wdrlive/media/einslive.m3u", FromType.FromLocation); await media.Parse(MediaParseOptions.ParseNetwork); using var mp = new MediaPlayer(media.SubItems.First()); mp.Play(); Console.ReadKey(); }
https://mfkl.github.io

doublemax
New Cone
New Cone
Posts: 5
Joined: 27 Aug 2015 00:55

Re: libVLC playlist support

Postby doublemax » 11 Dec 2019 21:19

It seems the corresponding function in libvlc is libvlc_media_parse_with_options(). I'll investigate.

Thanks for the reply.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 32 guests