Sunday, January 27, 2013

HLS continuous streaming

HLS is a sequence of MPEG-TS fragments and M3U8 playlist. Each fragment has its sequence number. Upon stream restart these sequence numbers used to start from beginning. Some players don't like that behavior and stop the stream. Besides some HLS files can remain unerased.

A new directive hls_continuous makes HLS generation more consistent. When stream is started nginx-rtmp parses the playlist and finds the last sequence number. Streaming is started from that sequence number.