A recorded video is a finished list of pieces. A live HLS stream is a list that keeps changing: every few seconds new segments appear at the end and old ones fall off the start. Record it like a normal video and you get whatever was in the list at that instant, which is usually the last thirty seconds.
Following the window
The recorder re-reads the playlist about as often as the stream's target segment duration, adds any new segments to its queue, and downloads them in order. Each segment has a sequence number, so gaps are obvious: if number 1,204 is followed by 1,206, we know exactly what is missing.
Starting earlier than "now"
Some broadcasters keep a long back buffer (a "DVR window") of an hour or more. When they do, the recorder offers to start from the beginning of the window instead of the live edge, so you can catch the part you missed.
When the stream hiccups
- A segment fails: it is retried with growing pauses while newer segments keep downloading, then written into place when it arrives.
- The playlist stops updating: after three target durations without change, the recorder assumes the broadcast paused and keeps polling quietly.
- The playlist ends (an
#EXT-X-ENDLISTtag appears): the recording is finished and closed cleanly.
Hourly files
Long recordings can be split into one file per hour. Each file starts on a segment boundary, so every file plays on its own and nothing is cut mid-frame.
What we will not do
Streams protected with DRM are not recorded. The recorder detects them and tells you, rather than producing a file that will not play.