Syntax
What EXT-X-DISCONTINUITY means
EXT-X-DISCONTINUITY marks a break between the segment that follows it and the one before it. Normally each segment continues exactly where the last one ended, with timestamps counting up without a jump. A discontinuity tells the player that this is not the case here, so it must reset before reading on.
The tag has no value and no attributes.
When it is needed
Section 4.3.2.3 of RFC 8216 says the tag must be present when any of these change between two segments:
- the file format, for example from MPEG-2 TS to fMP4
- the number, type or identifiers of the tracks
- the timestamp sequence, for example when timestamps start again from zero
It should be present when the encoding parameters, such as the resolution, or the encoding sequence change. Typical causes are an ad or a slate inserted between parts of a program, an encoder that restarts during a live stream, and recordings stitched together from separate files.
Where it goes
Media playlists only, on its own line before the first segment after the break. It applies to that one segment. A playlist can contain as many as it needs.
Related rules
- Each segment has a discontinuity sequence number: the value of
EXT-X-DISCONTINUITY-SEQUENCE(or 0) plus the number of discontinuity tags before it. Matching content in different qualities must have matching numbers. - A live playlist that contains discontinuities and drops old segments must carry
EXT-X-DISCONTINUITY-SEQUENCE, and the server must raise that value when a discontinuity tag leaves the playlist. - A server that uses
EXT-X-PROGRAM-DATE-TIMEshould put one on every segment that follows a discontinuity. - Players must be ready to reset their parsers and decoders before a segment that follows a discontinuity.
Common mistakes
- Leaving it out when timestamps restart. Players may stall, skip ahead, or play audio out of sync after the break.
- Different breaks in different qualities. If the 720p playlist has a discontinuity that the 480p one does not, switching quality can land in the wrong place.
- Joining segments without looking at it. Tools that concatenate segment files byte by byte keep the timestamp jump. The result can show frozen frames or report the wrong length.
How players treat it
At a discontinuity, players flush their decoders and treat the new segment's timestamps as a fresh start that continues the same timeline. Done well, viewers see a clean cut from one part to the next.
Example
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:6
#EXTINF:6.000,
meeting/seg100.ts
#EXTINF:6.000,
meeting/seg101.ts
#EXT-X-DISCONTINUITY
#EXTINF:6.000,
slate/recess0.ts
#EXTINF:6.000,
slate/recess1.ts
#EXT-X-ENDLISTThe stream switches from the meeting camera to a recess slate made by a different encoder, so the switch is marked with EXT-X-DISCONTINUITY.
How m3u8.cloud handles it
Supported. When building the MP4, m3u8.cloud keeps the timeline continuous across each break, so the saved video plays straight through.
The m3u8 inspector marks where each discontinuity falls.
Related tags
Check the tags in any playlist
Open the m3u8 inspector