remotion-dev/remotion · error · Error

#EXT-X-DISCONTINUITY-SEQUENCE directive must have a value

Error message

#EXT-X-DISCONTINUITY-SEQUENCE directive must have a value

What it means

Thrown by parseM3uDirective() at parse-directive.ts:92 when a line matches #EXT-X-DISCONTINUITY-SEQUENCE but has no numeric value. This optional directive indicates the sequence number of the first discontinuity in the playlist. The parser converts the value via Number().

Source

Thrown at packages/media-parser/src/containers/m3u/parse-directive.ts:92

			type: 'm3u-playlist-type',
			playlistType: value,
		};
	}

	if (directive === '#EXT-X-MEDIA-SEQUENCE') {
		if (!value) {
			throw new Error('#EXT-X-MEDIA-SEQUENCE directive must have a value');
		}

		return {
			type: 'm3u-media-sequence',
			value: Number(value),
		};
	}

	if (directive === '#EXT-X-DISCONTINUITY-SEQUENCE') {
		if (!value) {
			throw new Error(
				'#EXT-X-DISCONTINUITY-SEQUENCE directive must have a value',
			);
		}

		return {
			type: 'm3u-discontinuity-sequence',
			value: Number(value),
		};
	}

	if (directive === '#EXT-X-STREAM-INF') {
		if (!value) {
			throw new Error('EXT-X-STREAM-INF directive must have a value');
		}

		const res = parseStreamInf(value);
		return res;
	}

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Ensure the directive carries a non-negative integer: #EXT-X-DISCONTINUITY-SEQUENCE:0
  2. Remove the directive if discontinuity numbering is not needed (it is optional)
  3. Regenerate the playlist with a compliant packager

Example fix

// before
#EXT-X-DISCONTINUITY-SEQUENCE:

// after
#EXT-X-DISCONTINUITY-SEQUENCE:0
Defensive patterns

Strategy: validation

Validate before calling

// Pre-fetch and check EXT-X-DISCONTINUITY-SEQUENCE has a numeric value
const text = await (await fetch(url)).text();
for (const line of text.split('\n')) {
  const trimmed = line.trim();
  if (trimmed.startsWith('#EXT-X-DISCONTINUITY-SEQUENCE')) {
    const colonIdx = trimmed.indexOf(':');
    const val = colonIdx === -1 ? '' : trimmed.slice(colonIdx + 1).trim();
    if (!val || isNaN(Number(val))) {
      throw new Error('#EXT-X-DISCONTINUITY-SEQUENCE is missing its value');
    }
  }
}

Try / catch

try {
  await parseMedia({src: url});
} catch (e) {
  if (e instanceof Error && e.message.includes('EXT-X-DISCONTINUITY-SEQUENCE')) {
    // fix the value or remove the optional directive
  }
  throw e;
}

Prevention

When it happens

Trigger: A playlist line '#EXT-X-DISCONTINUITY-SEQUENCE' with no colon, or '#EXT-X-DISCONTINUITY-SEQUENCE:' with an empty or non-numeric value.

Common situations: Corrupted playlist where the discontinuity sequence number was removed or left empty; encoder bug producing incomplete directives; hand-edited live playlists.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/fdad3df8bba9e7cb. Report an issue: GitHub.