M3U8 hangs after a few seconds
Solution 1
The .m3u8
file is not a video clip; it is a manifest-type file that is used in HTTP video streaming. It specifies the URL of MPEG2-TS
encoded video segments that are usually about 10 minutes in length.
- The server sends this
.m3u8
file to the client - Then the client extracts the URL to the
.ts
video segment and then displays the video segment.
Under normal live streaming conditions, a new .m3u8
file is sent from the server to the client every 10-minutes so it will know the URL of the next 10-minute video segment. When there are no more segments, or the live streaming event has terminated, the server sends a .m3u8
file with the #EXT-X-ENDLIST
directive, which tells the client that there will be no further segments, as szatmary explained above.
Thus, your video "hangs" as you described as there are no more segments available.
To Fix:
There is no fix needed, because the server has not provided any more segments.
Resources:
The best tool for detecting this is an editor like vi (vim) which will let you see the directives in the .m3u8
file so you can check for the #EXT-X-ENDLIST
directive. Or just use cat
or tail
to show the contents of the .m3u8
file.
The link to the IETF draft on HTTP Live Streaming that szatmary gave is very informative and explains all of the directives that are used in the .m3u8
file.
Since Apple developed and defined this protocol, this is the best source for info: https://developer.apple.com/streaming/
Additional resources can be found here: http://en.wikipedia.org/wiki/HTTP_Live_Streaming
Solution 2
I so no issues. This m3u8 is pointing to the last couple seconds of what was a live broadcast.
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:54675
#EXTINF:10.0,
http://d3fnzeq4kk32oq.cloudfront.net/802/chunk-20131128_0122_54675.ts
#EXTINF:2.188,
http://d3fnzeq4kk32oq.cloudfront.net/802/chunk-20131128_0123_54676.ts
#EXTINF:10.0,
http://d3fnzeq4kk32oq.cloudfront.net/802/chunk-20131128_0123_54677.ts
#EXT-X-ENDLIST
HLS splits the video into segmeents. This playlist starts on segment number 54675 and ends on 54677. #EXT-X-ENDLIST
tells the player to stop playing, as we are out of segments.
While this stream was live the m3u8 would have been updating.
https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming-12
Related videos on Youtube
Divya Bhargov
Updated on September 18, 2022Comments
-
Divya Bhargov over 1 year
I have a small experimental clip below :
http://d3fnzeq4kk32oq.cloudfront.net/802/test_1.m3u8
The problem I am facing is that after a few seconds, the video hangs.
I would appreciate if someone is able to help me
- Identify the issue
- Any fix
- Any tool for detecting or fixing it
-
Rajib over 10 yearsYour link points to a 368 byte file, and it does not play in VLC.
-
Divya Bhargov over 10 yearsHow to figure out if the m3u9 was pointing to a live broadcast like you have mentioned ?
-
Robert Perry over 3 years"are usually about 10 minutes in length" .. I think you meant seconds? #EXT-X-TARGETDURATION:10 - refers to a 10 second clip length