HLS-26: Ability to override WRAP_POINT

Issue Information

Issue Type: Sub-task
Priority: Major
Status: Open

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: HLS Stream Creator (HLS)
Resolution: Unresolved
Target version: VNEXT,
Components: Linear Support , CLI Options ,
Labels: Linear, Segments, UltraLowLatency,

Created: 2017-07-19 09:38:15
Time Spent Working
180 minutes
180 minutes
0 minutes
Child of: HLS-25: Additional flags/features to aid Low Latency Streaming

When creating a live stream, the point at which to start re-using segment names is currently automatically calculated on line 343 and set as WRAP_POINT.

It only fires if the script has been told to limit the number of segments in the manifest (by way of the -c flag)

    if [ "$LIVE_SEGMENT_COUNT" -gt 0 ]
	WRAP_POINT=$(($LIVE_SEGMENT_COUNT * 2)) # Wrap the segment numbering after 2 manifest lengths - prevents disks from filling
	FFMPEG_ADDITIONAL+=" -segment_list_size $LIVE_SEGMENT_COUNT -segment_wrap $WRAP_POINT"

When WRAP_POINT is reached, segment filenames will reset, so we might see

- stream_00001.ts
- stream_00002.ts
- stream_00003.ts
- stream_00004.ts
- stream_00005.ts
- stream_00006.ts
- stream_00001.ts

For standard latency HLS streams this will generally be fine, however, for ultra-low latency HLS streams we risk recycling names before the TTL on any downstream HTTP caches has expired. Due to the very short segment length you risk increasing cache churn if the TTL is lowered too much (and also meaning that if a player gets a bit behind, it may well start skipping)

So, I'd like to add a flag (-w) that allows WRAP_POINT to be explicitly defined (and if it isn't present, stick with the existing method of calculation), as well as perhaps having the ability to tell it never to wrap (though, as it stands, that would mean the older segments are never removed from disk - that might be desirable if you're intending to republish as VOD later though).

Issue Links

Line 343
Toggle State Changes


btasker added 'VNEXT' to Fix Version
btasker removed '1.0' from Fix Version