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.

hls on;
hls_path /tmp/hls;
hls_continuous on;

Ffplay/ffmpeg is completely happy with that. However VLC sometimes stops playing at fragment boundary.

The feature is off by default.

No comments:

Post a Comment