In this guide
Length and offset have different meaningsThe HTTP response supplies another layer of evidencePreserve context before reporting a failureHLS can describe a media segment as a byte range inside a resource instead of assigning every segment a separate file. EXT-X-BYTERANGE supplies the range length and, where present, its offset. A player then retrieves the appropriate portion through HTTP range mechanisms.
This packaging means repeated requests to one filename can represent different segments. Counting unique URLs is therefore not a reliable way to count playable segments.
Length and offset have different meanings
A range length says how many bytes belong to the segment. An offset says where that range begins. When the offset is omitted, HLS defines a continuation relationship subject to its rules; it is not a general instruction to start at byte zero.
An original hypothetical range has length 1,000 bytes and starts at offset 2,000. Its inclusive byte positions are 2,000 through 2,999. The ending index is offset plus length minus one. Confusing a length with an ending index is a common arithmetic error when reading logs.
The HTTP response supplies another layer of evidence
A successful single-range response commonly uses 206 Partial Content and a Content-Range field. The status is expected behavior for a partial request, not an indication that the server sent a damaged fraction of a complete video by mistake. The exact response must still match the request semantics.
A server can respond differently when it ignores a range or when a requested range cannot be satisfied. Diagnose from the request headers, response status and range metadata together; a media filename alone cannot explain what happened.
| HLS concept | HTTP-facing question |
|---|---|
| Resource URI | Which object is addressed? |
| Byte offset | Where does this segment begin? |
| Byte length | How much data belongs to it? |
| Response range | Did the response correspond to the requested portion? |
Preserve context before reporting a failure
Keep the relevant BYTERANGE line, its resource URI role and the Range/Content-Range values if available. Redact secret query parameters and authorization fields. One failed range may identify a packaging or delivery problem even when another range in the same resource succeeds. Replacing the URL with a new filename does not repair inconsistent offsets or resource contents.
