NSA
NSA

Reputation: 6027

VLC doesn't rerequest m3u8 playlist on a sliding window HLS Stream

I am implementing a HLS server and attempting playback via VLC. It plays through the playlist but never rerequests the playlist. Any ideas why? Below is an example of a playlist that I am returning.

#EXTM3U
#EXTINF:9,
http://10.221.218.91:10042/clip/0.ts?session=23
#EXTINF:9,
http://10.221.218.91:10042/clip/1.ts?session=23
#EXTINF:9,
http://10.221.218.91:10042/clip/2.ts?session=23
#EXTINF:9,
http://10.221.218.91:10042/clip/3.ts?session=23
#EXTINF:9,
http://10.221.218.91:10042/clip/4.ts?session=23
#EXTINF:20,
http://10.221.218.91:10042/clip/5.ts?session=23

Upvotes: 1

Views: 4344

Answers (2)

Alexander I.Grafov
Alexander I.Grafov

Reputation: 1408

Each media segment in a playlist must have a unique integer sequence number. It described in #EXT-X-MEDIA-SEQUENCE tag. You must increase decimal number of media sequence each time when new segment appended to live playlist. If you don't use this tag in the playlist then media sequence number assumed = 0 and player assumes what no new segments arrived.

Also you must use #EXT-X-TARGETDURATION in media playlist with decimal-integer indicating the target duration in seconds. The #EXTINF duration of each media segment in the media playlist file, when rounded to the nearest integer, must be less than or equal to the target duration.

Notes above taken from IETF draft on HLS: https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming especially from paragraphs 3.4.2 and 3.4.3.

Accordingly with these rules you sample playlist must look like that:

#EXTM3U
#EXT-X-TARGETDURATION:20
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:9,
http://10.221.218.91:10042/clip/0.ts?session=23
#EXTINF:9,
http://10.221.218.91:10042/clip/1.ts?session=23
#EXTINF:9,
http://10.221.218.91:10042/clip/2.ts?session=23
#EXTINF:9,
http://10.221.218.91:10042/clip/3.ts?session=23
#EXTINF:9,
http://10.221.218.91:10042/clip/4.ts?session=23
#EXTINF:20,
http://10.221.218.91:10042/clip/5.ts?session=23

then #EXT-X-MEDIA-SEQUENCE increased by 1 on each new segment arrived (i.e. approximately after e TARGETDURATION seconds).

Upvotes: 1

feepk
feepk

Reputation: 1831

I strongly recommend you to use VLC 2.1 in your tests since we dramatically improved the HLS support. The current pre-release is available here: http://get.videolan.org:81/testing/vlc-2.1.0-rc1/

Additionally, I'm not entirely sure what's the correct behavior according to the HLS standard - re-requesting the m3u8 from time to time or the server keeping the connection open and pushing further contents of the playlist as they become available. You should check this :-)

Upvotes: 0

Related Questions