remotion-dev/remotion · error · Error

EXT-X-STREAM-INF directive must have a value

Error message

EXT-X-STREAM-INF directive must have a value

What it means

Thrown by parseM3uDirective() at parse-directive.ts:105 when a line matches #EXT-X-STREAM-INF but has no attribute value. This directive declares a variant stream in a master playlist and per RFC 8216 must include at minimum a BANDWIDTH attribute. The parser delegates to parseStreamInf() which splits on commas and expects KEY=VALUE pairs.

Source

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

		};
	}

	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;
	}

	if (directive === '#EXT-X-I-FRAME-STREAM-INF') {
		return {
			type: 'm3u-i-frame-stream-info',
		};
	}

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

		return {

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Ensure the directive includes at least BANDWIDTH: #EXT-X-STREAM-INF:BANDWIDTH=1000000,RESOLUTION=1280x720,CODECS="avc1.42c01e"
  2. Regenerate the master playlist with a compliant HLS packager
  3. Verify the master playlist response was fully received

Example fix

// before
#EXT-X-STREAM-INF:
720p.m3u8

// after
#EXT-X-STREAM-INF:BANDWIDTH=1000000,RESOLUTION=1280x720,CODECS="avc1.42c01e"
720p.m3u8
Defensive patterns

Strategy: validation

Validate before calling

// Pre-fetch and check EXT-X-STREAM-INF has attributes including BANDWIDTH
const text = await (await fetch(masterUrl)).text();
for (const line of text.split('\n')) {
  const trimmed = line.trim();
  if (trimmed.startsWith('#EXT-X-STREAM-INF')) {
    const colonIdx = trimmed.indexOf(':');
    if (colonIdx === -1 || !trimmed.slice(colonIdx + 1).includes('BANDWIDTH')) {
      throw new Error('#EXT-X-STREAM-INF is missing BANDWIDTH attribute');
    }
  }
}

Try / catch

try {
  await parseMedia({src: masterUrl});
} catch (e) {
  if (e instanceof Error && e.message.includes('EXT-X-STREAM-INF')) {
    // fix the master playlist attributes
  }
  throw e;
}

Prevention

When it happens

Trigger: A master playlist line '#EXT-X-STREAM-INF' with no colon, or '#EXT-X-STREAM-INF:' with empty attributes — no BANDWIDTH=, RESOLUTION=, CODECS= key-value pairs.

Common situations: Corrupted master playlist from a buggy packager; hand-edited file where attributes were removed; truncated response where the attribute line was cut off.

Related errors


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