remotion-dev/remotion · error · Error
#EXT-X-MAP directive must have a value
Error message
#EXT-X-MAP directive must have a value
What it means
Thrown by parseM3uDirective() at parse-directive.ts:131 when a line matches #EXT-X-MAP but has no attribute value. The #EXT-X-MAP directive specifies how to obtain the initialization segment (init.mp4) for the media playlist and is required for fMP4/CMAF segment formats. The parser delegates to parseM3uKeyValue() which needs the attribute string.
Source
Thrown at packages/media-parser/src/containers/m3u/parse-directive.ts:131
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 {
type: 'm3u-allow-cache',
allowsCache: value === 'YES',
};
}
if (directive === '#EXT-X-MAP') {
if (!value) {
throw new Error('#EXT-X-MAP directive must have a value');
}
const p = parseM3uKeyValue(value);
if (!p.URI) {
throw new Error('EXT-X-MAP directive must have a URI');
}
return {
type: 'm3u-map',
value: p.URI,
};
}
if (directive === '#EXT-X-PROGRAM-DATE-TIME') {
if (!value) {
throw new Error('#EXT-X-PROGRAM-DATE-TIME directive must have a value');
}
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Ensure the directive includes at least a URI attribute: #EXT-X-MAP:URI="init.mp4"
- Regenerate the playlist with a compliant packager
- Verify the media playlist was fully received without truncation
Example fix
// before #EXT-X-MAP: // after #EXT-X-MAP:URI="init.mp4"
Defensive patterns
Strategy: validation
Validate before calling
// Pre-fetch and check EXT-X-MAP has attributes
const text = await (await fetch(url)).text();
for (const line of text.split('\n')) {
const trimmed = line.trim();
if (trimmed.startsWith('#EXT-X-MAP')) {
const colonIdx = trimmed.indexOf(':');
if (colonIdx === -1 || !trimmed.slice(colonIdx + 1).trim()) {
throw new Error('#EXT-X-MAP is missing its attributes');
}
}
} Try / catch
try {
await parseMedia({src: url});
} catch (e) {
if (e instanceof Error && e.message.includes('EXT-X-MAP')) {
// fix the init segment declaration in the playlist
}
throw e;
} Prevention
- Ensure CMAF/fMP4 playlists include a valid #EXT-X-MAP:URI="..." directive
- Verify the init segment URL is reachable
When it happens
Trigger: A playlist line '#EXT-X-MAP' with no colon, or '#EXT-X-MAP:' with empty attributes — no URI=, BYTERANGE= key-value pairs.
Common situations: Corrupted init segment declaration in a CMAF/fMP4 media playlist; encoder bug producing an incomplete #EXT-X-MAP line; hand-edited playlist.
Related errors
- EXT-X-MAP directive must have a URI
- EXT-X-VERSION directive must have a value
- EXT-X-MEDIA directive must have a value
- EXT-X-TARGETDURATION directive must have a value
- EXTINF has no value
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/c5b5c8372465c6c3.
Report an issue: GitHub.