EXT-X-DISCONTINUITY-SEQUENCE

Gives the discontinuity sequence number of the first segment, so players can match segments across qualities after breaks.

Media playlist tagAny protocol versionIn: Media playlistRFC 8216, section 4.3.3.3

Syntax

#EXT-X-DISCONTINUITY-SEQUENCE:<number>

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:

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

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.ts

Segment 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.

Check the tags in any playlist

Open the m3u8 inspector