EXT-X-TARGETDURATION

Sets the maximum media segment duration for the playlist, in whole seconds.

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

Syntax

#EXT-X-TARGETDURATION:<s>

What EXT-X-TARGETDURATION means

EXT-X-TARGETDURATION sets the longest a media segment in the playlist may be, in whole seconds. Each segment's EXTINF duration, rounded to the nearest whole number, must not be larger than this value. A 6.006-second segment rounds to 6 and fits a target duration of 6; a 6.6-second segment rounds to 7 and does not.

The value is a decimal integer, and it applies to the whole playlist.

Where it goes

Every media playlist must have exactly one, usually near the top. It never appears in a master playlist.

Rules from RFC 8216

Section 4.3.3.1 and section 6.2 set these rules:

The RFC 8216bis draft adds that the value must be at least 1, and notes that in protocol version 5 and earlier the target was compared with segment durations without rounding.

How it paces live streams

Common mistakes

How players treat it

Players use the target duration to time playlist reloads and to decide how far from the live edge to start. A segment much longer than the target can make a player run out of buffered video before the next reload brings more.

Example

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:1200
#EXTINF:6.006,
seg1200.ts
#EXTINF:5.972,
seg1201.ts
#EXTINF:6.006,
seg1202.ts

Every EXTINF value in this live playlist rounds to 6 or less, so a target duration of 6 seconds is valid.

How m3u8.cloud handles it

When you record a live stream, m3u8.cloud uses EXT-X-TARGETDURATION to decide how often to reload the playlist to look for new pieces.

Check the tags in any playlist

Open the m3u8 inspector