Syntax
What EXT-X-DISCONTINUITY-SEQUENCE means
Each media segment has a discontinuity sequence number. It starts at the value of EXT-X-DISCONTINUITY-SEQUENCE, or 0 if the tag is missing, and goes up by one at every EXT-X-DISCONTINUITY tag. The number says which stretch between breaks a segment belongs to.
That lets a player line up segments across different qualities or audio tracks. If the 1080p and 480p playlists both place a segment in discontinuity 4, the player knows both are in the same stretch of content, even if their media sequence numbers differ.
Where it goes
Media playlists only, once, before the first segment and before any EXT-X-DISCONTINUITY tag. The value is a decimal integer.
Rules from RFC 8216
Section 4.3.3.3 and sections 6.2.1 and 6.2.2 set these rules:
- The tag must come before the first segment and before any discontinuity tag.
- A playlist that contains discontinuities and removes old segments must include this tag. Without it, players may not be able to find matching segments in other qualities.
- When a server removes a discontinuity tag from the playlist, it must raise this value so the numbers of the remaining segments stay the same.
- The value must never go down or wrap around.
- Matching content in different variant streams must have matching discontinuity sequence numbers.
A worked example
Say a live playlist has EXT-X-DISCONTINUITY-SEQUENCE:3, then two segments, a discontinuity tag and two more segments. The first two segments are in discontinuity 3 and the last two in discontinuity 4. Later, the third segment drops off the top, and the discontinuity tag in front of it goes too. The server must now raise the value to 4, so the segment that remains still counts as discontinuity 4.
Common mistakes
- Forgetting to raise the value when a discontinuity leaves a live playlist. Later segments then appear to belong to an earlier stretch, and quality switches can jump to the wrong place.
- Different breaks in different qualities, which can happen when ads are inserted into each quality separately.
How players treat it
RFC 8216 requires players to use the discontinuity sequence number, together with each segment's position on the timeline, to find matching segments when they switch quality or audio track. A single-quality stream without discontinuities does not need the tag.
Example
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:540
#EXT-X-DISCONTINUITY-SEQUENCE:3
#EXTINF:6.000,
seg540.ts
#EXT-X-DISCONTINUITY
#EXTINF:6.000,
seg541.ts
#EXTINF:6.000,
seg542.tsSegment 540 is in discontinuity 3; the EXT-X-DISCONTINUITY tag before segment 541 puts segments 541 and 542 in discontinuity 4.
How m3u8.cloud handles it
The m3u8 inspector shows the EXT-X-DISCONTINUITY-SEQUENCE value and marks where each discontinuity falls. For how breaks are handled in a saved video, see EXT-X-DISCONTINUITY.
Related tags
Check the tags in any playlist
Open the m3u8 inspector