nginx-rtmp-module icon indicating copy to clipboard operation
nginx-rtmp-module copied to clipboard

How to add #EXT-X-ENDLIST once HLS live Stream finish?

Open tmtoan opened this issue 7 years ago • 5 comments

Hi @arut , firstly I want to thank you for the great module and also your contribution to the community.

Now I'm wondering if there is any way to add end signal to .m3u8 file (#EXT-X-ENDLIST) once the live stream end without manually add it? Your help is very much appreciated :)

tmtoan avatar May 19 '17 02:05 tmtoan

Would also like to know this please...

@tmtoan Do you know of a way to add it to the file manually? I've searched all over the place and can't find anything on it. The problem I have is when playing back as an mp4 in jwplayer, the player thinks it's a live stream still due to the lack of the #EXT-X-ENDLIST... Very annoying.

UKNickyD avatar May 25 '17 07:05 UKNickyD

Hi @UKNickyD , to manually add it, just open .m3u8 file with any text editor (e.g. Notepad on Windows or Gedit on Linux) and add #EXT-X-ENDLIST at the end of the file and save, your player will now recognize it as a vod playlist.

tmtoan avatar May 25 '17 08:05 tmtoan

I add the following line,

exec_publish_done bash -c ' tee -a ./${name}.m3u8 <<< "#EXT-X-ENDLIST"';

stonyz avatar Jul 18 '18 02:07 stonyz

But if I use a continuous hls stream, how could I modify the playlist every time when stream has publised? Remove a line from middle and add a line in the end, that's simple but not graceful

cool112 avatar Aug 30 '19 06:08 cool112

Although it is mentioned in the official HLS documentation[1] when using event tag it will add the EXT-X-ENDLIST automatically. But I think it is missed in the nginx rtmp implementation for the directive hls_type event; after using this directive nginx does create a playlist with playlist type EVENT but doesn't add EXT-X-ENDLIST after finishing the stream.

  1. (https://developer.apple.com/documentation/http_live_streaming/example_playlists_for_http_live_streaming/event_playlist_construction ) You can't remove anything from the playlist when using the EVENT tag; you may only append new segments to the end of the file. New segments are added to the end of the file until the event has concluded, at which time the EXT-X-ENDLIST tag is appended. The following example shows the same playlist after it's been updated with new media URIs and the event has ended.

Can anyone shed some more light on this? How do we add the EXT-X-ENDLIST after the stream is finished using event type.

dalmiavaibhav avatar Oct 07 '21 08:10 dalmiavaibhav