{"record":{"id":"8a77a73b5567e391","repo":"remotion-dev/remotion","slug":"unknown-directive-directive-value-value","errorCode":null,"errorMessage":"Unknown directive ${directive}. Value: ${value}","messagePattern":"Unknown directive (.+?)\\. Value: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/m3u/parse-directive.ts","lineNumber":159,"sourceCode":"\t\t\tvalue: p.URI,\n\t\t};\n\t}\n\n\tif (directive === '#EXT-X-PROGRAM-DATE-TIME') {\n\t\tif (!value) {\n\t\t\tthrow new Error('#EXT-X-PROGRAM-DATE-TIME directive must have a value');\n\t\t}\n\n\t\t// Store the raw ISO 8601 date-time string without validation.\n\t\t// This directive associates media segments with absolute dates but\n\t\t// doesn't affect parsing of tracks, dimensions, or other metadata.\n\t\treturn {\n\t\t\ttype: 'm3u-program-date-time',\n\t\t\tdateTime: value,\n\t\t};\n\t}\n\n\tthrow new Error(`Unknown directive ${directive}. Value: ${value}`);\n};\n","sourceCodeStart":141,"sourceCodeEnd":161,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/m3u/parse-directive.ts#L141-L161","documentation":"Thrown by parseM3uDirective() at parse-directive.ts:159 as the fallback for any #-prefixed line that does not match any known directive. The parser recognizes a fixed set of HLS directives; any other line starting with '#' that is not '#EXTM3U' or one of the known EXT-* directives falls through to this throw. Note: RFC 8216 section 4.2 states clients SHOULD ignore unrecognized EXT-* tags, so this behavior is stricter than the spec requires.","triggerScenarios":"Any HLS directive not in the parser's recognized list, including: #EXT-X-KEY (encryption), #EXT-X-DISCONTINUITY (without -SEQUENCE suffix), #EXT-X-BYTERANGE, #EXT-X-SESSION-DATA, #EXT-X-START, #EXT-X-I-FRAMES-ONLY, #EXT-X-DATERANGE, #EXT-X-VERSION newer directives, or comment lines starting with '#'.","commonSituations":"HLS playlists with DRM/encryption (#EXT-X-KEY); playlists using byte-range addressing (#EXT-X-BYTERANGE); playlists with discontinuity markers; newer-spec or vendor-extension directives; any playlist using a feature this parser doesn't yet support.","solutions":["Identify the unrecognized directive from the error message and check if it can be removed from the source playlist","If the directive is #EXT-X-KEY (encryption), the stream requires decryption keys that this parser may not support — use a different tool or remove encryption","Pre-fetch the m3u8 text and filter out unsupported directive lines before passing the src to parseMedia"],"exampleFix":"// before — playlist contains #EXT-X-KEY which the parser doesn't handle\n#EXT-X-KEY:METHOD=AES-128,URI=\"key.bin\"\n#EXTINF:10.0,\nsegment0.ts\n\n// after — pre-fetch and filter unsupported directives, then parse from a Blob\nconst text = await (await fetch(url)).text();\nconst filtered = text\n  .split('\\n')\n  .filter((line) => !line.startsWith('#EXT-X-KEY'))\n  .join('\\n');\nawait parseMedia({src: new Blob([filtered], {type: 'application/vnd.apple.mpegurl'})});","handlingStrategy":"fallback","validationCode":"// Pre-fetch the m3u8, filter unknown directives, then parse from a Blob\nconst resp = await fetch(url);\nconst text = await resp.text();\nconst KNOWN = new Set([\n  '#EXTM3U', '#EXT-X-VERSION', '#EXT-X-INDEPENDENT-SEGMENTS', '#EXT-X-MEDIA',\n  '#EXT-X-TARGETDURATION', '#EXTINF', '#EXT-X-ENDLIST', '#EXT-X-PLAYLIST-TYPE',\n  '#EXT-X-MEDIA-SEQUENCE', '#EXT-X-DISCONTINUITY-SEQUENCE', '#EXT-X-STREAM-INF',\n  '#EXT-X-I-FRAME-STREAM-INF', '#EXT-X-ALLOW-CACHE', '#EXT-X-MAP',\n  '#EXT-X-PROGRAM-DATE-TIME',\n]);\nconst filtered = text\n  .split('\\n')\n  .filter((line) => {\n    const t = line.trim();\n    if (!t.startsWith('#')) return true;\n    const directive = t.split(':')[0];\n    return KNOWN.has(directive);\n  })\n  .join('\\n');\nawait parseMedia({src: new Blob([filtered], {type: 'application/vnd.apple.mpegurl'})});","typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({src: url});\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Unknown directive')) {\n    // filter unsupported directives from the m3u8 and retry, or reject\n  }\n  throw e;\n}","preventionTips":["Pre-fetch the m3u8 text and filter out unsupported directive lines before passing to parseMedia","Check whether the stream uses features this parser does not support (encryption, byte-range, discontinuity) and choose a different tool if needed","Note: RFC 8216 says clients SHOULD ignore unrecognized tags, so this error may indicate a parser limitation rather than invalid data"],"tags":["hls","m3u8","directive","unsupported","forward-compat","encryption"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}