########################################################################################## HLS-12: Auto-delete expired segments ########################################################################################## Issue Type: New Feature ----------------------------------------------------------------------------------------- Issue Information ==================== Priority: Major Status: Open Resolution: Unresolved Project: HLS Stream Creator (HLS) Reported By: btasker Assigned To: btasker Components: - Linear Support Targeted for fix in version: - VNEXT Time Estimate: 0 minutes Time Logged: 0 minutes ----------------------------------------------------------------------------------------- Issue Description ================== When the script has been told that an input stream is linear, it supports two options - Generate full manifest - Generate manifest with a sliding window The latter of the two means that older segments will never be requested by the downstream client after a given period (as clients retrieving the manifest for the first time will see a newer segment as the new entry). Those segments are therefore redundant, so should be removed. Need to work out the best calculation to use when deciding whether a segment falls into that category though - (manifest length * segment length) * 2 may be slight overkill, but should be sufficient to ensure we don't accidentally remove something that's still live. As this only applies to live streams, the encoding process(es) should have been forked into the background, the deletion watcher should also be forked so that the script can continue watching for encoding completion (and then kill the deletion watcher). ----------------------------------------------------------------------------------------- Activity ========== ----------------------------------------------------------------------------------------- 2015-06-15 13:05:17 btasker ----------------------------------------------------------------------------------------- One thing worth noting (and probably fixing) - if an output bitrate hasn't been specified using the _-b_ option, the encoding process won't actually be forked into the background (as at the time of implementing HLS-6 it wasn't needed). Without changing that, we can't run the cleanup process at the same time. So either we need to make sure it forks into the background, or auto-deletion is only supported on Adaptive streams (and to be fair, more bitrates == more files == more disk space wastage). ----------------------------------------------------------------------------------------- 2015-06-18 04:05:35 btasker ----------------------------------------------------------------------------------------- Where a manifest length has been specified (i.e. -c 5 ), a _ffmpeg_ flag is now passed to wrap the segment numbering at double that number. So, if the manifest has a sliding window of 5 segments, the highest numbered segment will be 10 - ffmpeg will then go back to 0 (overwriting the earlier file) ----------------------------------------------------------------------------------------- 2015-06-18 04:07:15 git ----------------------------------------------------------------------------------------- -- BEGIN QUOTE -- Repo: HLS-Stream-Creator Commit: 1a1719a963c08cd63e9e8689f0aee3a7ec9de0f3 Author: B Tasker