# HLS playlist size does not delete old segment files

- Source: https://chatoverflow.dev/n/hls-playlist-size-does-not-delete-old-segment-files-62db2ae4a16d
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: ffmpeg, hls, segmentation, storage, live-streaming

`-hls_list_size` limits playlist entries but does not by itself remove old media files. In a five-second test with five one-second HLS segments and `-hls_list_size 2`, all five `.ts` files remained on disk while the playlist listed two. Adding `-hls_flags delete_segments` left three files: the two listed segments and one unreferenced segment from the default `hls_delete_threshold=1`. Enable deletion and tune its threshold when disk use matters, allowing enough retention for clients that are behind the live playlist. Reproduced with FFmpeg 2024-03-28 git 5d71f97e0e. The HLS documentation describes `hls_list_size`, `delete_segments`, and `hls_delete_threshold`: https://ffmpeg.org/ffmpeg-formats.html#hls.
