{"record":{"id":"e6600498b667d497","repo":"remotion-dev/remotion","slug":"ext-x-stream-inf-directive-must-have-a-value","errorCode":null,"errorMessage":"EXT-X-STREAM-INF directive must have a value","messagePattern":"EXT-X-STREAM-INF directive must have a value","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/m3u/parse-directive.ts","lineNumber":105,"sourceCode":"\t\t};\n\t}\n\n\tif (directive === '#EXT-X-DISCONTINUITY-SEQUENCE') {\n\t\tif (!value) {\n\t\t\tthrow new Error(\n\t\t\t\t'#EXT-X-DISCONTINUITY-SEQUENCE directive must have a value',\n\t\t\t);\n\t\t}\n\n\t\treturn {\n\t\t\ttype: 'm3u-discontinuity-sequence',\n\t\t\tvalue: Number(value),\n\t\t};\n\t}\n\n\tif (directive === '#EXT-X-STREAM-INF') {\n\t\tif (!value) {\n\t\t\tthrow new Error('EXT-X-STREAM-INF directive must have a value');\n\t\t}\n\n\t\tconst res = parseStreamInf(value);\n\t\treturn res;\n\t}\n\n\tif (directive === '#EXT-X-I-FRAME-STREAM-INF') {\n\t\treturn {\n\t\t\ttype: 'm3u-i-frame-stream-info',\n\t\t};\n\t}\n\n\tif (directive === '#EXT-X-ALLOW-CACHE') {\n\t\tif (!value) {\n\t\t\tthrow new Error('#EXT-X-ALLOW-CACHE directive must have a value');\n\t\t}\n\n\t\treturn {","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/m3u/parse-directive.ts#L87-L123","documentation":"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.","triggerScenarios":"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.","commonSituations":"Corrupted master playlist from a buggy packager; hand-edited file where attributes were removed; truncated response where the attribute line was cut off.","solutions":["Ensure the directive includes at least BANDWIDTH: #EXT-X-STREAM-INF:BANDWIDTH=1000000,RESOLUTION=1280x720,CODECS=\"avc1.42c01e\"","Regenerate the master playlist with a compliant HLS packager","Verify the master playlist response was fully received"],"exampleFix":"// before\n#EXT-X-STREAM-INF:\n720p.m3u8\n\n// after\n#EXT-X-STREAM-INF:BANDWIDTH=1000000,RESOLUTION=1280x720,CODECS=\"avc1.42c01e\"\n720p.m3u8","handlingStrategy":"validation","validationCode":"// Pre-fetch and check EXT-X-STREAM-INF has attributes including BANDWIDTH\nconst text = await (await fetch(masterUrl)).text();\nfor (const line of text.split('\\n')) {\n  const trimmed = line.trim();\n  if (trimmed.startsWith('#EXT-X-STREAM-INF')) {\n    const colonIdx = trimmed.indexOf(':');\n    if (colonIdx === -1 || !trimmed.slice(colonIdx + 1).includes('BANDWIDTH')) {\n      throw new Error('#EXT-X-STREAM-INF is missing BANDWIDTH attribute');\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({src: masterUrl});\n} catch (e) {\n  if (e instanceof Error && e.message.includes('EXT-X-STREAM-INF')) {\n    // fix the master playlist attributes\n  }\n  throw e;\n}","preventionTips":["Verify master playlist variants include at minimum BANDWIDTH in #EXT-X-STREAM-INF","Use a compliant packager to generate well-formed master playlists"],"tags":["hls","m3u8","directive","ext-x-stream-inf","malformed","master-playlist"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}